Connection module (released !!)

18 years 2 weeks ago #10144 by justberare
Replied by justberare on topic Re:Connection module
ok I tried something but it doesn't work.

if someone can help

Attachment mod_connexion.zip not found

Attachments:

Please Log in to join the conversation.

18 years 2 weeks ago #10157 by justberare
Replied by justberare on topic Re:Connection module
Here is the code I am trying to fix :

[code:1] <?php

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

global $mosConfig_offset;
global $database;
global $mosConfig_lang,
global $mosConfig_mbf_content;
global $ueConfig;
global $mosConfig_hits;
global $mosConfig_vote;
global $my;
global $mosConfig_absolute_path;
global $mosConfig_lang;
global $return=null;



$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"
;

$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]

(it's a module code)

I can't make it :dry: :S :(

Post edited by: justberare, at: 2006/04/12 18:28

Please Log in to join the conversation.

18 years 2 weeks ago #10160 by damiendownload
Replied by damiendownload on topic Re:Connection module
this is a difficult module to create... i have made one for cbe though, i feel for you bro. if cb and cbe used the same code i could of helped, and it isnt just as straight forward as copying the connections tab.

Please Log in to join the conversation.

18 years 2 weeks ago #10165 by justberare
Replied by justberare on topic Re:Connection module
.... :S oh nooooooooooooooooooooooooo ...

Actually I don't understand why...

I don't understand where the difference stands ..

Please Log in to join the conversation.

18 years 2 weeks ago #10167 by damiendownload
Replied by damiendownload on topic Re:Connection module
because a tab is poart of the cb script

like so , the page loading process....
joomla scripts loaded
cb scripts loaded
cb tabs loaded
end

a module gets ...

joomla scripts loaded
module loaded
end

so the scripts to desipher the variables in the tab are not loaded as a module :P i know the process is more complex and i could of described it better but thats the basic idea of it!

Please Log in to join the conversation.

18 years 2 weeks ago #10172 by justberare
Replied by justberare on topic Re:Connection module
ok I have an idea to make it simple.

I know I am not a programmer but I probably found a way to avoid those scripts we need :

- 1 cbplugin + 1 module

-- The cbplugin is activated but invisible. It makes a mysql column into the #__comprofiler. For each user you have then a new value : a list of the userids corresponding to the connections the user has.

for example :

John | 62 | .... | .... | 64, 78, 123 , 441

If user John (number 62) has the users 64, 78, 123 and 441 in his connections range.

So each time the user goes on his profile, the list in updated.

So here : just one script.

-- The module fetch the list for the user and display the avatar and the realname of the users whose number is 64, 78, 123 , 441.


Could this work ?

actually this module is vital for me and I cannot spend 500$ on it ...

Post edited by: justberare, at: 2006/04/12 21:57

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.178 seconds

Facebook Twitter LinkedIn