Sorry , but i could not understand what you meant by creating a module of user online
do you want the CB avatars of the users to be shown in the online user list ?
hello,
Yes i mean cb avatar of user, i coded some code but i doesn't work i will send to you de code.
this the code:
---------------------------------------------Code------------------------------------------------------------
<?php // no direct access
defined('_JEXEC') or die;
global $_CB_framework, $_CB_database, $ueConfig, $mainframe;
if ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) {
echo 'CB not installed';
return;
}
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
cbimport( 'cb.database' );
cbimport( 'language.front' );
function getNameFormatOnline($name,$uname,$format) {
if ( $format != 3 ) {
$name = str_replace( array("&",""","'","<",">"), array("&","\"","'","<",">"), $name );
}
SWITCH ($format) {
CASE 1 :
$returnName = $name;
break;
CASE 2 :
$returnName = $name." (".$uname.")";
break;
CASE 3 :
$returnName = $uname;
break;
CASE 4 :
$returnName = $uname." (".$name.")";
break;
}
return $returnName;
}
if (is_callable(array($params,"get"))) {
$class_sfx = $params->get( 'moduleclass_sfx');
$pretext = $params->get( 'pretext', "" );
$posttext = $params->get( 'posttext', "" );
} else {
$class_sfx = '';
$pretext = '';
$posttext = '';
}
$query = "SELECT DISTINCT a.username, a.userid, u.name, c.avatar"
."\n FROM #__session AS a, #__users AS u, #__comprofiler AS c"
."\n WHERE (a.userid = u.id) AND (a.guest = 0) AND (c.user_id = u.id) "
. "AND (a.client_id = 0)"
."\n ORDER BY " . ( ( $ueConfig['name_format'] > 2 ) ? "a.username" : "u.name" ) . " ASC";
$_CB_database->setQuery($query);
$rows = $_CB_database->loadObjectList();
$result = '';
if ( count( $rows ) > 0) {
$result .= "
hi,
I know that freichat has avatar of community builder, the avatars of freichat appear when user clic on chat, but for me i need also module who's online appear like gmail or facebook, always show avatars of all user online. thank you.
If i am not mistaken facebook and gmail works same as FreiChat i.e they don't have any additional module showing online friends except the chatbox in the bottom right .
But if you need any module like that , there will be plenty of who is online modules for Joomla / CB , why are you trying to make your own ?
Your previous draft for topic is pending
If you continue, your previous draft will be discarded.