Connection module (released !!)

18 years 1 week ago #9773 by justberare
Connection module (released !!) was created by justberare
Hi,

I've been looking for quite a long time now a very simple module ... that actually doesn't exist.

I'd like to display the user's connection (like it is displayed in any profile tab) in a module.

I've tried to extract code lines from the connection plugin but I am weak ... :blush:

So if anyone knows how to code this module or how to hack a module from mambome for example, I'd very very happy.

Post edited by: justberare, at: 2006/04/20 16:12

Please Log in to join the conversation.

18 years 1 week ago #9898 by justberare
Replied by justberare on topic Re:Connection module
:whistle:

or do you know any place where I could pay for it ?

thx

Please Log in to join the conversation.

18 years 1 week ago #9899 by Syrinx
Replied by Syrinx on topic Re:Connection module
You could put the project up for bids at joomlancers.com

Please Log in to join the conversation.

18 years 1 week ago #9901 by justberare
Replied by justberare on topic Re:Connection module
thx !!

Please Log in to join the conversation.

18 years 1 week ago #10051 by justberare
Replied by justberare on topic Re:Connection module
well actually, I just took a second look at it my self. The job is just to extract code from the tab plugin. I am sure it would be a like a 10 second work for any coder. I can take care of the xml file if you want :unsure:

please ...

Please Log in to join the conversation.

18 years 1 week ago #10140 by justberare
Replied by justberare on topic Re:Connection module
ok, this is the code I wanna use for the module. I need the different variable in the module xml file but I don't know how to modify the code ... :(

and Actually I'd like to display only 20 connections (5*4 table) and then display a my others connections (link to the profile).

[code:1]function getDisplayTab($tab,$user,$ui) {
global $database, $ueConfig, $mosConfig_hits,$mosConfig_vote,$my, $mosConfig_absolute_path, $mosConfig_lang;
$return=null;

$isVisitor=null;
if(isset($ueConfig) && $ueConfig==1 && $my->id!=$user->id) {
return null;
}
if($tab->description != null) $return .= "\t\t<div class=\"tab_Description\">".unHtmlspecialchars(getLangDefinition($tab->description))."</div>\n";
if($my->id != $user->id) $isVisitor="\n AND m.pending=0 AND m.accepted=1";
$query = "SELECT DISTINCT m.*,u.name,u.email,u.username,c.avatar,c.avatarapproved, u.id, IF(s.session_id=null,0,1) AS 'isOnline' "
. "\n FROM #__comprofiler_members AS m"
. "\n LEFT JOIN #__comprofiler AS c ON m.memberid=c.id"
. "\n LEFT JOIN #__users AS u ON m.memberid=u.id"
. "\n LEFT JOIN #__session AS s ON s.userid=u.id"
. "\n WHERE m.referenceid=". $user->id .""
. "\n AND c.approved=1 AND u.block=0 AND c.confirmed=1"
. $isVisitor
. "\n ORDER BY m.membersince DESC"
;
//if($user->id==$my->id) $return = "<div style=\"width:100%;text-align:right;\"><a href=\"".sefRelToAbs('index.php?option=com_comprofiler&amp;task=manageConnections')."\" >"._UE_MANAGECONNECTIONS."</a></div>";
$database->setQuery( $query );
$connections = $database->loadObjectList();
if(!count($connections)>0) {
$return .= _UE_NOCONNECTIONS;
return $return;
}
$boxHeight = $ueConfig+46;
$boxWidth = $ueConfig+28;
foreach($connections AS $connection) {
$conAvatar=null;
$conAvatar=getFieldValue('image',$connection->avatar,$connection);
$emailIMG=getFieldValue('primaryemailaddress',$connection->email,$connection,null,1);
$pmIMG=getFieldValue('pm',$connection->username,$connection,null,1);
$onlineIMG=getFieldValue('status',$connection->isOnline,$connection,null,1);
if($connection->accepted==1 && $connection->pending==1) $actionIMG = "<img src=\"components/com_comprofiler/images/pending.png\" border=\"0\" alt=\""._UE_CONNECTIONPENDING."\" title=\""._UE_CONNECTIONPENDING."\" /> <a href=\"".sefRelToAbs("index.php?option=com_comprofiler&amp;act=connections&amp;task=removeConnection&amp;connectionid=".$connection->memberid)."\" onclick=\"return confirmSubmit();\" ><img src=\"components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\""._UE_REMOVECONNECTION."\" title=\""._UE_REMOVECONNECTION."\" /></a>";
elseif($connection->accepted==1 && $connection->pending==0) $actionIMG = "<a href=\"".sefRelToAbs("index.php?option=com_comprofiler&amp;act=connections&amp;task=removeConnection&amp;connectionid=".$connection->memberid)."\" onclick=\"return confirmSubmit();\" ><img src=\"components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\""._UE_REMOVECONNECTION."\" title=\""._UE_REMOVECONNECTION."\" /></a>";
elseif($connection->accepted==0) $actionIMG = "<a href=\"".sefRelToAbs("index.php?option=com_comprofiler&amp;act=connections&amp;task=acceptConnection&amp;connectionid=".$connection->memberid)."\"><img src=\"components/com_comprofiler/images/tick.png\" border=\"0\" alt=\""._UE_ACCEPTCONNECTION."\" title=\""._UE_ACCEPTCONNECTION."\" /></a> <a href=\"".sefRelToAbs("index.php?option=com_comprofiler&amp;act=connections&amp;task=removeConnection&amp;connectionid=".$connection->memberid)."\"><img src=\"components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\""._UE_REMOVECONNECTION."\" title=\""._UE_DECLINECONNECTION."\" /></a>";
$tipField = "<b>"._UE_CONNECTEDSINCE."</b> : ".dateConverter($connection->membersince,'Y-m-d',$ueConfig);
if(getLangDefinition($connection->type)!=null) $tipField .= "<br /><b>"._UE_CONNECTIONTYPE."</b> : ".getConnectionTypes($connection->type);
if($connection->description!=null) $tipField .= "<br /><b>"._UE_CONNECTEDCOMMENT."</b> : ".$connection->description;
$tipTitle = _UE_CONNECTEDDETAIL;
$htmltext = $conAvatar;
$style = "style=\"padding:5px;\"";
$tooltipAvatar = cbFieldTip($ui, $tipField, $tipTitle, $width='250', $icon='', $htmltext, $href='', $style, $olparams='',false);
if($my->id==$user->id) {
$return .= "<div class=\"connectionBox\" style=\"position:relative;height:".($boxHeight+24)."px;width:".$boxWidth."px;\">"
. "<div style=\"position:absolute; top:3px; width:auto;left:5px;right:5px;\">".$actionIMG.'</div>'
. "<div style=\"position:absolute; top:18px; width:auto;left:5px;right:5px;\">".$tooltipAvatar.'</div>'
. "<div style=\"position:absolute; bottom:0px; width:auto;left:5px;right:5px;\">"
. $onlineIMG." ".htmlentities(getNameFormat($connection->name,$connection->username,$ueConfig))
. "<br /><a href=\"".sefRelToAbs("index.php?option=com_comprofiler&amp;task=userProfile&amp;user=".$connection->memberid)
."\"><img src=\"components/com_comprofiler/images/profiles.gif\" border=\"0\" alt=\""._UE_VIEWPROFILE."\" title=\""
._UE_VIEWPROFILE."\" /></a> ".$emailIMG." ".$pmIMG."\n";
} else {
$return .= "<div class=\"connectionBox\" style=\"position:relative;height:".$boxHeight."px;width:".$boxWidth."px;\">"
. "<div style=\"position:absolute; top:10px; width:auto;left:5px;right:5px;\">".$tooltipAvatar.'</div>'
. "<div style=\"position:absolute; bottom:0px; width:auto;left:5px;right:5px;\">"
. $onlineIMG." ".htmlentities(getNameFormat($connection->name,$connection->username,$ueConfig))."\n";
}
$return .= "</div></div>\n";
}
$return .= "<div style=\"clear:both;\">&nbsp;</div>";
return $return;
}
[/code:1]


thx

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.521 seconds

Facebook Twitter LinkedIn