public function getLink($user, $class = '', $sizex = 90, $sizey = 90) { $user = KunenaFactory::getUser($user); $size = $this->getSize($sizex, $sizey); if ($size->y > 100) { $avatar = AlphaUserPointsHelper::getAupAvatar($user->userid, 0, 100 * (double) $size->x / (double) $size->y, '100'); } else { $avatar = AlphaUserPointsHelper::getAupAvatar($user->userid, 0, $size->x, $size->y); } if (!$avatar) { $avatar = '<img border="0" width="100" height="100" alt="" src="' . JUri::root() . 'components/com_alphauserpoints/assets/images/avatars/generic_gravatar_grey.png">'; } return $avatar; }
public function getLink($user, $class='', $sizex=90, $sizey=90) { $user = KunenaFactory::getUser($user); $size = $this->getSize($sizex, $sizey); if ($size->y > 100) { $avatar = AlphaUserPointsHelper::getAupAvatar ( $user->userid, 0, 100*(float)$size->x/(float)$size->y, '100' ); } else { $avatar = AlphaUserPointsHelper::getAupAvatar ( $user->userid, 0, $size->x, $size->y ); } if (!$avatar) { // FIXME: need a better way to do this $avatar = '<img border="0" width="100" height="100" alt="" src="http://kunena16cb/components/com_alphauserpoints/assets/images/avatars/generic_gravatar_grey.gif">'; } return $avatar; }
if ($fbConfig->avatar_src == "jomsocial") { // Get CUser object $jsuser =& CFactory::getUser($userinfo->userid); $msg_avatar = '<span class="fb_avatar"><img src="' . $jsuser->getThumbAvatar() . '" alt=" " /></span>'; } else { if ($fbConfig->avatar_src == "clexuspm") { $msg_avatar = '<span class="fb_avatar"><img src="' . MyPMSTools::getAvatarLinkWithID($userinfo->userid) . '" /></span>'; } else { if ($fbConfig->avatar_src == "cb") { $msg_avatar = '<span class="fb_avatar">' . $kunenaProfile->showAvatar($userinfo->userid, '') . '</span>'; } else { if ($fbConfig->avatar_src == "aup") { $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php'; if (file_exists($api_AUP)) { $fbConfig->fb_profile == 'aup' ? $showlink = 1 : ($showlink = 0); $msg_avatar = '<span class="fb_avatar">' . AlphaUserPointsHelper::getAupAvatar($userinfo->userid, $showlink) . '</span>'; } } else { $avatar = $userinfo->avatar; if (!empty($avatar)) { if (!file_exists(KUNENA_PATH_UPLOADED . DS . 'avatars/s_' . $avatar)) { $msg_avatar = '<span class="fb_avatar"><img border="0" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '" alt="" style="max-width: ' . $fbConfig->avatarwidth . 'px; max-height: ' . $fbConfig->avatarheight . 'px;" /></span>'; } else { $msg_avatar = '<span class="fb_avatar"><img border="0" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '" alt="" /></span>'; } } else { $msg_avatar = '<span class="fb_avatar"><img border="0" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/nophoto.jpg" alt="" /></span>'; } } } }
function showlist($ulrows, $total_results, $pageNav, $limitstart, $query_ext, $search = "") { global $is_Moderator; $app =& JFactory::getApplication(); $fbConfig =& CKunenaConfig::getInstance(); $kunena_db =& JFactory::getDBO(); if ($search == "") { $search = _KUNENA_USRL_SEARCH; } ?> <script type = "text/javascript"> <!-- function validate() { if ((document.usrlform.search == "") || (document.usrlform.search.value == "")) { alert('<?php echo _KUNENA_USRL_SEARCH_ALERT; ?> '); return false; } else { return true; } } //--> </script> <?php if ($fbConfig->joomlastyle < 1) { $boardclass = "fb_"; } ?> <div class="<?php echo $boardclass; ?> _bt_cvr1"> <div class="<?php echo $boardclass; ?> _bt_cvr2"> <div class="<?php echo $boardclass; ?> _bt_cvr3"> <div class="<?php echo $boardclass; ?> _bt_cvr4"> <div class="<?php echo $boardclass; ?> _bt_cvr5"> <table class = "fb_blocktable" id ="fb_userlist" border = "0" cellspacing = "0" cellpadding = "0" width="100%"> <thead> <tr> <th> <table width = "100%" border = "0" cellspacing = "0" cellpadding = "0"> <tr> <td align = "left"> <div class = "fb_title_cover fbm"> <span class="fb_title fbl"> <?php echo _KUNENA_USRL_USERLIST; ?> </span> <?php printf(_KUNENA_USRL_REGISTERED_USERS, $app->getCfg('sitename'), $total_results); ?> </div> </td> <td align = "right"> <form name = "usrlform" method = "post" action = "<?php echo CKunenaLink::GetUserlistURL(); ?> " onsubmit = "return validate()"> <input type = "text" name = "search" class = "inputbox" style = "width:150px" maxlength = "100" value = "<?php echo $search; ?> " onblur = "if(this.value=='') this.value='<?php echo $search; ?> ';" onfocus = "if(this.value=='<?php echo $search; ?> ') this.value='';" /> <input type = "image" src = "<?php echo KUNENA_TMPLTMAINIMGURL . '/images/usl_search_icon.gif'; ?> " alt = "<?php echo _KUNENA_USRL_SEARCH; ?> " align = "top" style = "border: 0px;"/> </form> </td> </tr> </table> </th> </tr> </thead> <tbody> <tr> <td class = "<?php echo $boardclass; ?> fb-userlistinfo"> <!-- Begin: Listing --> <table width = "100%" border = "0" cellspacing = "0" cellpadding = "0"> <tr class = "fb_sth fbs"> <th class = "th-1 frst <?php echo $boardclass; ?> sectiontableheader" align="center"> </th> <?php if ($fbConfig->userlist_online) { ?> <th class = "th-2 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_ONLINE; ?> </th> <?php } ?> <?php if ($fbConfig->userlist_avatar) { ?> <th class = "th-3 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_AVATAR; ?> </th> <?php } ?> <?php if ($fbConfig->userlist_name) { ?> <th class = "th-4 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_NAME; echo CKunenaLink::GetUserlistLink('&orderby=name&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=name&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_username) { ?> <th class = "th-5 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_USERNAME; echo CKunenaLink::GetUserlistLink('&orderby=username&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=username&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_posts) { ?> <th class = "th-7 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_POSTS; echo CKunenaLink::GetUserlistLink('&orderby=posts&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=posts&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_karma) { ?> <th class = "th-7 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_KARMA; echo CKunenaLink::GetUserlistLink('&orderby=karma&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=karma&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_email) { ?> <th class = "th-8 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_EMAIL; echo CKunenaLink::GetUserlistLink('&orderby=email&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=email&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_usertype) { ?> <th class = "th-9 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_USERTYPE; echo CKunenaLink::GetUserlistLink('&orderby=usertype&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=usertype&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_joindate) { ?> <th class = "th-10 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_JOIN_DATE; echo CKunenaLink::GetUserlistLink('&orderby=registerDate&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=registerDate&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_lastvisitdate) { ?> <th class = "th-11 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_LAST_LOGIN; echo CKunenaLink::GetUserlistLink('&orderby=lastvisitDate&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=lastvisitDate&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_userhits) { ?> <th class = "th-12 lst <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_HITS; echo CKunenaLink::GetUserlistLink('&orderby=uhits&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=uhits&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> </tr> <?php $i = 1; foreach ($ulrows as $ulrow) { $evenodd = $i % 2; if ($evenodd == 0) { $usrl_class = "sectiontableentry1"; } else { $usrl_class = "sectiontableentry2"; } $nr = $i + $limitstart; // Avatar $uslavatar = ''; if ($fbConfig->avatar_src == "clexuspm") { $uslavatar = '<img border="0" class="usl_avatar" src="' . MyPMSTools::getAvatarLinkWithID($ulrow->id, "s") . '" alt="" />'; } else { if ($fbConfig->avatar_src == "cb") { $kunenaProfile =& CKunenaCBProfile::getInstance(); $uslavatar = $kunenaProfile->showAvatar($ulrow->id); } else { if ($fbConfig->avatar_src == "aup") { $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php'; if (file_exists($api_AUP)) { $fbConfig->fb_profile == 'aup' ? $showlink = 1 : ($showlink = 0); $uslavatar = AlphaUserPointsHelper::getAupAvatar($ulrow->id, $showlink, $fbConfig->avatarsmallwidth, $fbConfig->avatarsmallheight); } // end integration AlphaUserPoints } else { $kunena_db->setQuery("SELECT avatar FROM #__fb_users WHERE userid='{$ulrow->id}'"); $avatar = $kunena_db->loadResult(); if ($avatar != '') { if (!file_exists(KUNENA_PATH_UPLOADED . DS . 'avatars/s_' . $avatar)) { $uslavatar = '<img border="0" class="usl_avatar" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '" alt="" />'; } else { $uslavatar = '<img border="0" class="usl_avatar" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/s_' . $avatar . '" alt="" />'; } } else { $uslavatar = '<img border="0" class="usl_avatar" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/s_nophoto.jpg" alt="" />'; } } } } // ?> <tr class = "<?php echo $boardclass; echo $usrl_class; ?> fbm"> <td class = "td-1 frst fbs" align="center"> <?php echo $nr; ?> </td> <?php if ($fbConfig->userlist_online) { ?> <td class = "td-2"> <?php // online - ofline status $sql = "SELECT COUNT(userid) FROM #__session WHERE userid='{$ulrow->id}'"; $kunena_db->setQuery($sql); $isonline = $kunena_db->loadResult(); if ($isonline && $ulrow->showOnline == 1) { echo isset($fbIcons['onlineicon']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['onlineicon'] . '" border="0" alt="' . _MODLIST_ONLINE . '" />' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'onlineicon.gif" border="0" alt="' . _MODLIST_ONLINE . '" />'; } else { echo isset($fbIcons['offlineicon']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['offlineicon'] . '" border="0" alt="' . _MODLIST_OFFLINE . '" />' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'offlineicon.gif" border="0" alt="' . _MODLIST_OFFLINE . '" />'; } ?> </td> <?php } ?> <?php if ($fbConfig->userlist_avatar) { ?> <td class = "td-3" align="center"> <?php if (strlen($uslavatar)) { echo CKunenaLink::GetProfileLink($fbConfig, $ulrow->id, $uslavatar); } else { echo ' '; } ?> </td> <?php } ?> <?php if ($fbConfig->userlist_name) { ?> <td class = "td-4 fbm" align="center"> <?php echo CKunenaLink::GetProfileLink($fbConfig, $ulrow->id, $ulrow->name); ?> </td> <?php } ?> <?php if ($fbConfig->userlist_username) { ?> <td class = "td-5 fbm" align="center"> <?php echo CKunenaLink::GetProfileLink($fbConfig, $ulrow->id, $ulrow->username); ?> </td> <?php } ?> <?php if ($fbConfig->userlist_posts) { ?> <td class = "td-7 fbs" align="center"> <?php echo $ulrow->posts; ?> </td> <?php } ?> <?php if ($fbConfig->userlist_karma) { ?> <td class = "td-7 fbs" align="center"> <?php echo $ulrow->karma; ?> </td> <?php } ?> <?php if ($fbConfig->userlist_email) { echo "\t\t<td class=\"td-8 fbs\" align=\"center\"><a href=\"mailto:{$ulrow->email}\">{$ulrow->email}</a></td>\n"; } if ($fbConfig->userlist_usertype) { echo "\t\t<td class=\"td-9 fbs\" align=\"center\">{$ulrow->usertype}</td>\n"; } if ($fbConfig->userlist_joindate) { echo "\t\t<td class=\"td-10 fbs\" align=\"center\">" . convertDate($ulrow->registerDate) . "</td>\n"; } if ($fbConfig->userlist_lastvisitdate) { echo "\t\t<td class=\"td-11 fbs\" align=\"center\">" . convertDate($ulrow->lastvisitDate) . "</td>\n"; } ?> <td class = "td-12 lst fbs" align="center"> <?php if ($fbConfig->userlist_userhits) { ?> <?php echo $ulrow->uhits; ?> <?php } ?> </td> <?php echo "\t</tr>\n"; $i++; } ?> </table> <form name = "usrlform" method = "post" action = "<?php echo CKunenaLink::GetUserlistURL(); ?> " onsubmit = "return false;"> <table width = "100%" class="fb_userlist_pagenav" border = "0" cellspacing = "0" cellpadding = "0"> <tr class = "fb_sth fbs"> <th class = "th-1 fbm" align = "center" style = "text-align:center;"> <?php // TODO: fxstein - Need to perform SEO cleanup echo $pageNav->getPagesLinks(CKunenaLink::GetUserlistURL($query_ext)); ?> </th> </tr> </table> <table class = "fb_blocktable" id="fb_userlist_bottom" style="border-bottom:0px;margin:0;" border = "0" cellspacing = "0" cellpadding = "0" width="100%"> <tr> <th class = "th-right fbs" align="right" style="text-align:right"> <?php echo $pageNav->getPagesCounter(); ?> | <?php echo _KUNENA_USRL_DISPLAY_NR; ?> <?php echo $pageNav->getLimitBox(CKunenaLink::GetUserlistURL($query_ext)); ?> </th> </tr> </table> </form> </td> </tr> </tbody> </table> <!-- Finish: Listing --> </div> </div> </div> </div> </div> <?php //(JJ) BEGIN: WHOISONLINE if (file_exists(KUNENA_ABSTMPLTPATH . '/plugin/who/whoisonline.php')) { include KUNENA_ABSTMPLTPATH . '/plugin/who/whoisonline.php'; } else { include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/who/whoisonline.php'; } //(JJ) FINISH: WHOISONLINE ?> <!-- Begin: Forum Jump --> <div class="<?php echo $boardclass; ?> _bt_cvr1"> <div class="<?php echo $boardclass; ?> _bt_cvr2"> <div class="<?php echo $boardclass; ?> _bt_cvr3"> <div class="<?php echo $boardclass; ?> _bt_cvr4"> <div class="<?php echo $boardclass; ?> _bt_cvr5"> <table class = "fb_blocktable" id="fb_bottomarea" border = "0" cellspacing = "0" cellpadding = "0"> <thead> <tr> <th class = "th-right"> <?php //(JJ) FINISH: CAT LIST BOTTOM if ($fbConfig->enableforumjump) { require_once KUNENA_PATH_LIB . DS . 'kunena.forumjump.php'; } ?> </th> </tr> </thead> <tbody><tr><td></td></tr></tbody> </table> </div> </div> </div> </div> </div> <!-- Finish: Forum Jump --> <?php }
/** * Gets the avatar of the user. Currently supporting JomSocial, Kunena, AUP and CB. * * @global <type> $cwConfig * @param <type> $userid * @param <type> $height * @return <type> */ function getUserAvatar($userid = 0, $height = 48) { $app =& JFactory::getApplication(); $cwConfig = $app->getUserState(SESSION_CONFIG); $db = JFactory::getDBO(); $avatar = ''; $username = $cwConfig[USER_NAME]; switch ($cwConfig[USER_AVTAR]) { case 'jomsocial': $jspath = JPATH_BASE . DS . 'components' . DS . 'com_community'; include_once $jspath . DS . 'libraries' . DS . 'core.php'; // Get CUser object $jsuser =& CFactory::getUser($userid); $usrname = $jsuser->{$username}; $avatarLoc = $jsuser->getThumbAvatar(); $link = CRoute::_('index.php? option=com_community&view=profile&userid=' . $userid . '&Itemid=' . JRequest::getInt('Itemid')); $avatar = '<a href="' . $link . '"><img class="hasTip" style="border: 1px solid #cccccc; height: ' . $height . 'px;" src="' . $avatarLoc . '" alt="' . $usrname . '" title="' . $usrname . '"/></a>'; break; case 'cb': $strSql = "SELECT `avatar`, firstname FROM #__comprofiler WHERE `user_id`='{$userid}' AND `avatarapproved`='1'"; $db->setQuery($strSql); $result = $db->loadObject(); $link = JRoute::_('index.php?option=com_comprofiler&task=userProfile&user='******'<a href="' . $link . '"><img src="' . $avatarLoc . '" class="hasTip" style="border: 1px solid #cccccc; height: ' . $height . 'px;" alt="' . $result->firstname . '" title="' . $result->firstname . '"/></a>'; break; case 'touch': $avatarLoc = JURI::base(true) . '/index2.php?option=com_community&controller=profile&task=avatar&width=' . $height . '&height=' . $height . '&user_id=' . $userid . '&no_ajax=1'; $avatar = '<img src="' . $avatarLoc . '" style="border: 1px solid #cccccc; height: ' . $height . 'px;" alt=""/>'; $link = JRoute::_("index.php?option=com_community&view=profile&user_id={$userid}&Itemid=" . JRequest::getInt('Itemid')); $avatar = '<a href="' . $link . '">' . $avatar . '</a>'; break; case 'gravatar': $strSql = 'SELECT email FROM #__users WHERE id=' . $userid; $db->setQuery($strSql); $email = $db->loadResult(); $url = 'http://www.gravatar.com/avatar/' . md5(strtolower(trim($email))); $url .= "?s={$height}&d=mm&r=g"; $avatar = '<img src="' . $url . '"/>'; break; case 'kunena': $query = "SELECT a.avatar, b." . $username . " FROM #__fb_users as a" . " LEFT JOIN #__users as b on b.id=a.userid where a.userid=" . $userid; $db->setQuery($query); $kunenaUser = $db->loadObject(); $kunena_avtar = @$kunenaUser->avatar; $kunena_avtars = JURI::base(true) . '/images/fbfiles'; if ($kunena_avtar != '') { if (!file_exists(JPATH_ROOT . '/images/fbfiles/avatars/l_' . $kunena_avtar)) { $avatarLoc = $kunena_avtars . '/avatars/' . $kunena_avtar; } else { $avatarLoc = $kunena_avtars . '/avatars/l_' . $kunena_avtar; } } else { $avatarLoc = $kunena_avtars . '/avatars/nophoto.jpg'; } //URL $usrname = $kunenaUser->{$username} ? $kunenaUser->{$username} : JText::_('GUEST'); $link = JRoute::_('index.php?option=com_kunena&func=fbprofile&userid=' . $userid); $avatar = '<a href="' . $link . '" title="' . $usrname . '"><img src="' . $avatarLoc . '" class="hasTip" style="border: 1px solid #cccccc; height: ' . $height . 'px;" alt="' . $usrname . '"/></a>'; break; case 'aup': $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php'; if (file_exists($api_AUP)) { require_once $api_AUP; $avatar = AlphaUserPointsHelper::getAupAvatar($userid, 1, $height, $height); } break; } return $avatar; }
public static function showAvatar($userid) { static $jva_avatars; $model = jvarcadeModelCommon::getInst(); $config = $model->getConf(); if (!($jva_avatars && is_array($jva_avatars) && count($jva_avatars) && array_key_exists((int) $userid, $jva_avatars))) { if (!is_array($jva_avatars)) { $jva_avatars = array(); } $_avatar = ''; //Community Builder if ((int) $config->scorelink == 2) { $db = JFactory::getDBO(); $db->setQuery('SELECT avatar FROM #__comprofiler WHERE user_id = ' . (int) $userid); $_avatar = $db->loadResult(); if (strlen($_avatar) && file_exists(JPATH_BASE . '/' . 'images' . '/' . 'comprofiler' . '/' . $_avatar) && ($img_size = @getimagesize(JPATH_BASE . '/' . 'images' . '/' . 'comprofiler' . '/' . $_avatar))) { $_avatar = JURI::root() . 'images/comprofiler/' . $_avatar; } else { $_avatar = JURI::root() . 'components/com_comprofiler/plugin/templates/default/images/avatar/tnnophoto_n.png'; } //JomSocial } elseif ((int) $config->scorelink == 1 && is_file(JPATH_ROOT . '/' . 'components' . '/' . 'com_community' . '/' . 'libraries' . '/' . 'core.php')) { include_once JPATH_ROOT . '/' . 'components' . '/' . 'com_community' . '/' . 'libraries' . '/' . 'core.php'; $js_user = CFactory::getUser((int) $userid); $_avatar = $js_user->getThumbAvatar(); //AlphaUserPoints } elseif ((int) $config->scorelink == 3) { $api_AUP = JPATH_SITE . '/components/com_alphauserpoints/helper.php'; if (file_exists($api_AUP)) { require_once $api_AUP; $avatar = AlphaUserPointsHelper::getAupAvatar($userid, 0, '50', '50', '', ''); echo $avatar; } } $_avatar = $_avatar ? '<img src="' . $_avatar . '" border="0" height="50" width="50" align="middle" />' : ''; $jva_avatars[(int) $userid] = $_avatar; } return $jva_avatars[(int) $userid]; }
//alert('<?php echo $this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED')); ?> '); //} } </script> <div id="j-main-container"> <div class="span2"> <?php $com_params = JComponentHelper::getParams('com_alphauserpoints'); $useAvatarFrom = $com_params->get('useAvatarFrom'); if ($com_params->get('useAvatarFrom') == 'alphauserpoints') { $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php'; require_once $api_AUP; $avatar = AlphaUserPointsHelper::getAupAvatar($row->userid, 0, '', 100); echo '<div>'; echo $avatar; echo '</div>'; } ?> </div> <div class="form-horizontal span10"> <form action="index.php?option=com_alphauserpoints" method="post" name="statistic-form" id="statistic-form" class="form-validate"> <?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'details')); ?> <?php echo JHtml::_('bootstrap.addTab', 'myTab', 'details', JText::_('AUP_DETAILS', true)); ?>
/** * Gets the user avatar image without any link * * @param unknown $system * @param unknown $userid * @param unknown $alt * @param number $height * @param string $email * @param string $path_only * @param unknown $attribs * @return void|Ambigous <string, unknown, NULL, string> */ public static function get_user_avatar_image($system, $userid, $alt, $height = 48, $email = null, $path_only = true, $attribs = array()) { $db = JFactory::getDBO(); $avatar = ''; $userid = !empty($userid) ? $userid : 0; switch ($system) { case 'cjforum': $api = JPATH_ROOT . '/components/com_cjforum/helpers/api.php'; if (file_exists($api)) { require_once $api; $avatar = CjForumApi::get_user_avatar_image($userid, $height); if ($path_only == false) { $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>'; } } break; case 'cjblog': $api = JPATH_ROOT . DS . 'components' . DS . 'com_cjblog' . DS . 'api.php'; if (file_exists($api)) { include_once $api; $avatar = CjBlogApi::get_user_avatar_image($userid, $height); if ($path_only == false) { $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>'; } } break; case 'jomsocial': include_once JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'defines.community.php'; require_once JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php'; require_once JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'helpers' . DS . 'string.php'; $user = CFactory::getUser($userid); $avatar = $user->getThumbAvatar(); if ($path_only == false) { $attribs['height'] = $height . 'px'; $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>'; } break; case 'cb': global $_CB_framework, $_CB_database, $ueConfig, $mainframe; $api = JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php'; if (!is_file($api)) { return; } require_once $api; cbimport('cb.database'); cbimport('cb.tables'); cbimport('cb.field'); cbimport('language.front'); outputCbTemplate($_CB_framework->getUi()); //TODO: Here $img_attribs['height'] = $height . 'px'; if ($userid > 0) { $cbUser = CBuser::getInstance($userid); if ($cbUser !== null) { $avatar = $cbUser->getField('avatar', null, 'php', 'profile', 'list'); $name = $cbUser->getField('name'); $avatar = $avatar['avatar']; if ($path_only == false) { $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>'; } } } else { if ($height <= 90) { $avatar = $path_only ? selectTemplate() . 'images/avatar/tnnophoto_n.png' : Jhtml::image(selectTemplate() . 'images/avatar/tnnophoto_n.png', '', $img_attribs); } else { $avatar = $path_only ? selectTemplate() . 'images/avatar/nophoto_n.png' : Jhtml::image(selectTemplate() . 'images/avatar/nophoto_n.png', '', $img_attribs); } } break; case 'touch': $avatarLoc = JURI::base(true) . '/index2.php?option=com_community&controller=profile&task=avatar&width=' . $height . '&height=' . $height . '&user_id=' . $userid . '&no_ajax=1'; $attribs[] = array('style' => 'height: ' . $height . 'px'); $avatar = $path_only ? $avatarLoc : JHtml::image($avatarLoc, $alt, $attribs); break; case 'gravatar': if (null == $email && $userid > 0) { $strSql = 'SELECT email FROM #__users WHERE id=' . $userid; $db->setQuery($strSql); $email = $db->loadResult(); } $avatar = 'https://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) . '?s=' . $height . '&d=mm&r=g'; if ($path_only == false) { $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>'; } break; case 'kunena': if (CJFunctions::_initialize_kunena()) { $class = 'avatar'; $user = KunenaFactory::getUser($userid); $avatar = $user->getAvatarImage($class, $height, $height); if ($path_only) { preg_match_all('/<img .*src=["|\']([^"|\']+)/i', $avatar, $matches); foreach ($matches[1] as $key => $value) { $avatar = $value; break; } } } break; case 'aup': $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php'; if (file_exists($api_AUP)) { require_once $api_AUP; if ($path_only) { $avatar = AlphaUserPointsHelper::getAvatarPath($userid); } else { $avatar = AlphaUserPointsHelper::getAupAvatar($userid, 0, $height, $height); } } break; case 'easysocial': $api = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_easysocial' . DS . 'includes' . DS . 'foundry.php'; if (file_exists($api)) { require_once $api; $my = Foundry::user(); $avatar = $my->getAvatar($height < 64 ? SOCIAL_AVATAR_SMALL : ($height < 128 ? SOCIAL_AVATAR_MEDIUM : SOCIAL_AVATAR_LARGE)); $attribs[] = array('style' => 'height: ' . $height . 'px'); if ($path_only == false) { $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>'; } } break; } return $avatar; }
public function getUserAvatarImage($app, $userId, $email = null, $height = 48, $urlOnly = true, $alt = '', $imgAttribs = array()) { $avatar = ''; $userId = !empty($userId) ? $userId : 0; $imgAttribs['class'] = isset($imgAttribs['class']) ? $imgAttribs['class'] : 'img-avatar'; switch ($app) { case 'cjforum': $api = JPATH_ROOT . '/components/com_cjforum/lib/api.php'; if (file_exists($api)) { require_once $api; $profileApi = CjForumApi::getProfileApi(); $avatar = $profileApi->getUserAvatarImage($userId, $height); if ($urlOnly == false) { $imgAttribs['height'] = $height . 'px'; $imgAttribs['style'] = 'max-height: ' . $height . 'px; max-width: ' . $height . 'px;'; $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($imgAttribs) ? JArrayHelper::toString($imgAttribs) : $imgAttribs) . ' /') . '>'; } } break; case 'cjblog': $api = JPATH_ROOT . '/components/com_cjblog/api.php'; if (file_exists($api)) { include_once $api; $avatar = CjBlogApi::get_user_avatar_image($userId, $height); if ($urlOnly == false) { $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($imgAttribs) ? JArrayHelper::toString($imgAttribs) : $imgAttribs) . ' /') . '>'; } } break; case 'easyprofile': $api = JPATH_ROOT . '/components/com_jsn/helpers/helper.php'; if (file_exists($api)) { $user = new JsnUser($userId); $avatar = $user->getValue('avatar'); if ($urlOnly == false) { $imgAttribs['height'] = $height . 'px'; $imgAttribs['style'] = 'max-height: ' . $height . 'px; display: block; margin: 0 auto'; $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($imgAttribs) ? JArrayHelper::toString($imgAttribs) : $imgAttribs) . ' /') . '>'; } } break; case 'jomsocial': require_once JPATH_ROOT . '/components/com_community/defines.community.php'; require_once JPATH_ROOT . '/components/com_community/libraries/core.php'; require_once JPATH_ROOT . '/components/com_community/helpers/string.php'; $user = CFactory::getUser($userId); $avatar = $user->getThumbAvatar(); if ($urlOnly == false) { $imgAttribs['height'] = $height . 'px'; $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($imgAttribs) ? JArrayHelper::toString($imgAttribs) : $imgAttribs) . ' /') . '>'; } break; case 'cb': global $_CB_framework, $_CB_database, $ueConfig, $mainframe; $api = JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php'; if (!is_file($api)) { return; } require_once $api; cbimport('cb.database'); cbimport('cb.tables'); cbimport('cb.field'); cbimport('language.front'); outputCbTemplate($_CB_framework->getUi()); //TODO: Here $imgAttribs['height'] = $height . 'px'; if ($userId > 0) { $cbUser = CBuser::getInstance($userId); if ($cbUser !== null) { $avatar = $cbUser->getField('avatar', null, 'php', 'profile', 'list'); $alt = $cbUser->getField('name'); $avatar = $avatar['avatar']; } } else { if ($height <= 90) { $avatar = selectTemplate() . 'images/avatar/tnnophoto_n.png'; } else { $avatar = selectTemplate() . 'images/avatar/nophoto_n.png'; } } if ($urlOnly == false) { $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($imgAttribs) ? JArrayHelper::toString($imgAttribs) : $imgAttribs) . ' /') . '>'; } break; case 'gravatar': if (null == $email && $userId > 0) { try { $db = JFactory::getDbo(); $query = $db->getQuery(true)->select('email')->from('#__users')->where('id = ' . $userId); $db->setQuery($query); $email = $db->loadResult(); } catch (Exception $e) { } } $avatar = 'https://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) . '?s=' . $height . '&d=mm&r=g'; if ($urlOnly == false) { $avatar = JHtml::image($avatar, $alt, $imgAttribs); } break; case 'kunena': if ($this->_initialize_kunena()) { $class = 'avatar'; $user = KunenaFactory::getUser($userId); $avatar = $user->getAvatarImage($class, $height, $height); if ($urlOnly) { preg_match_all('/<img .*src=["|\']([^"|\']+)/i', $avatar, $matches); foreach ($matches[1] as $key => $value) { $avatar = $value; break; } } } break; case 'aup': $api_AUP = JPATH_SITE . '/components/com_alphauserpoints/helper.php'; if (file_exists($api_AUP)) { require_once $api_AUP; if ($urlOnly) { $avatar = AlphaUserPointsHelper::getAvatarPath($userId); } else { $avatar = AlphaUserPointsHelper::getAupAvatar($userId, 0, $height, $height); } } break; case 'easysocial': $api = JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php'; if (file_exists($api)) { require_once $api; $my = Foundry::user($userId); $avatar = $my->getAvatar($height < 64 ? SOCIAL_AVATAR_SMALL : ($height < 128 ? SOCIAL_AVATAR_MEDIUM : SOCIAL_AVATAR_LARGE)); $imgAttribs[] = array('style' => 'height: ' . $height . 'px'); if ($urlOnly == false) { $avatar = '<img src="' . $avatar . '" alt="' . $alt . '" ' . trim((is_array($imgAttribs) ? JArrayHelper::toString($imgAttribs) : $imgAttribs) . ' /') . '>'; } } break; } return $avatar; }
if ($fbConfig->avatar_src == "jomsocial") { // Get CUser object $jsuser =& CFactory::getUser($kunena_my->id); $jr_avatar = '<img src="' . $jsuser->getThumbAvatar() . '" alt=" " />'; } else { if ($fbConfig->avatar_src == "clexuspm") { $jr_avatar = '<img src="' . MyPMSTools::getAvatarLinkWithID($kunena_my->id) . '" alt=" " />'; } else { if ($fbConfig->avatar_src == "cb") { $jr_avatar = $kunenaProfile->showAvatar($kunena_my->id); } else { if ($fbConfig->avatar_src == "aup") { $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php'; if (file_exists($api_AUP)) { $fbConfig->fb_profile == 'aup' ? $showlink = 1 : ($showlink = 0); $jr_avatar = AlphaUserPointsHelper::getAupAvatar($kunena_my->id, $showlink, $fbConfig->avatarsmallwidth, $fbConfig->avatarsmallheight); } // end integration AlphaUserPointselse } else { if ($fbavatar != "") { if (!file_exists(KUNENA_PATH_UPLOADED . DS . 'avatars/s_' . $fbavatar)) { $jr_avatar = '<img src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $fbavatar . '" alt=" " style="max-width: ' . $fbConfig->avatarsmallwidth . 'px; max-height: ' . $fbConfig->avatarsmallheight . 'px;" />'; } else { $jr_avatar = '<img src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/s_' . $fbavatar . '" alt=" " />'; } } else { $jr_avatar = '<img src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/s_nophoto.jpg" alt=" " />'; $jr_profilelink = '<a href="' . JRoute::_(KUNENA_LIVEURLREL . '&func=myprofile') . '" >' . _PROFILEBOX_MYPROFILE . '</a>'; } } }
function uddeIMgetPicOnly($ofanid, $config, $noanchor=false) { // PIC only $mosConfig_lang = uddeIMgetLang(); $database = uddeIMgetDatabase(); $gimmeback = ""; $grsize = 80; if ($config->avatarw) $grsize = $config->avatarw; $picstyle = ""; if ($config->avatarw || $config->avatarh) { $picstyle = " style='"; if ($config->avatarw) $picstyle .= "max-width: ".$config->avatarw."px; "; if ($config->avatarh) $picstyle .= "max-height: ".$config->avatarh."px; "; $picstyle .= "'"; } if ($config->showcbpic==1) { // CB if (is_dir(uddeIMgetPath('absolute_path')."/components/com_comprofiler/plugin/language/".$mosConfig_lang."/images")) $fileLang=$mosConfig_lang; else $fileLang="default_language"; $sql="SELECT avatar FROM #__comprofiler WHERE user_id=".(int)$ofanid." LIMIT 1"; $database->setQuery($sql); $ofanavatar=$database->loadResult(); $filenamelocal = "/images/comprofiler/tn".$ofanavatar; // Thumbnail $filenamelive = uddeIMgetPath('live_site') ."/images/comprofiler/tn".$ofanavatar; // Thumbnail $filenameglocal = "/images/comprofiler/".$ofanavatar; // Gallery $filenameglive = uddeIMgetPath('live_site') ."/images/comprofiler/".$ofanavatar; // Gallery // NOPHOTO for CB $filename2local = "/components/com_comprofiler/plugin/language/".$fileLang."/images/tnnophoto.jpg"; $filename2live = uddeIMgetPath('live_site') ."/components/com_comprofiler/plugin/language/".$fileLang."/images/tnnophoto.jpg"; // NOPHOTO for CBE $filename3local = "/images/".$fileLang."/tnnophoto.jpg"; $filename3live = uddeIMgetPath('live_site') ."/images/".$fileLang."/tnnophoto.jpg"; // NOPHOTO for CB 2.0 $filename4local = "/components/com_comprofiler/plugin/templates/default/images/avatar/tnnophoto_n.png"; $filename4live = uddeIMgetPath('live_site') ."/components/com_comprofiler/plugin/templates/default/images/avatar/tnnophoto_n.png"; // CB 2.0 // $cbUser =& CBuser::getInstance( $ofanid ); // if ( !$cbUser ) // $cbUser =& CBuser::getInstance( null ); // $avatar = $cbUser->getField( 'avatar', null, 'html', 'none', 'list' ); if (uddeIMfileExists($filenamelocal)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenamelive."' alt='' />"; } elseif (uddeIMfileExists($filenameglocal) && $config->CBgallery) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />"; } elseif ($config->gravatar) { $email = uddeIMgetEMailFromID((int)$ofanid, $config); $grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr); $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />"; } elseif (uddeIMfileExists($filename4local)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename4live."' alt='' />"; } elseif (uddeIMfileExists($filename2local)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename2live."' alt='' />"; } elseif (uddeIMfileExists($filename3local)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename3live."' alt='' />"; } else { $imgurl = "NOPHOTO"; } if ($noanchor) $gimmeback = $imgurl; else $gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config); } elseif ($config->showcbpic==2) { // FB $sql="SELECT avatar FROM #__fb_users WHERE userid=".(int)$ofanid." LIMIT 1"; $database->setQuery($sql); $ofanavatar=$database->loadResult(); $filenameglocal = "/images/fbfiles/avatars/".$ofanavatar; // Gallery $filenameglive = uddeIMgetPath('live_site') ."/images/fbfiles/avatars/".$ofanavatar; // Gallery $filename2local = "/images/fbfiles/avatars/s_nophoto.jpg"; $filename2live = uddeIMgetPath('live_site') ."/images/fbfiles/avatars/s_nophoto.jpg"; if (uddeIMfileExists($filenameglocal)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />"; } elseif ($config->gravatar) { $email = uddeIMgetEMailFromID((int)$ofanid, $config); $grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr); $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />"; } elseif (uddeIMfileExists($filename2local)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename2live."' alt='' />"; } if ($noanchor) $gimmeback = $imgurl; else $gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config); } elseif ($config->showcbpic==3) { // Agora // $database->setQuery("UPDATE #__agora_config SET conf_value=$conf_value WHERE conf_name='$conf_name'"); // $dbresult = $database->query(); $adir = ""; $useavatars = 0; if (uddeIMfileExists("/components/com_agora/cache/cache_config.php")) { include(uddeIMgetPath('absolute_path')."/components/com_agora/cache/cache_config.php"); if (isset($agora_config['o_avatars_dir'])) { $adir = $agora_config['o_avatars_dir']; } if (isset($agora_config['o_avatars'])) { $useavatars = $agora_config['o_avatars']; } } if (!$adir) return $gimmeback; $sql = "SELECT id, show_avatars FROM #__agora_users WHERE jos_id=".(int)$ofanid; $database->setQuery($sql); $results = $database->loadObjectList(); if (!$results) { $agoraid = "notfound"; $showavatars = 0; } else { foreach($results as $result) { $agoraid = $result->id; $showavatars = $result->show_avatars; } } // $value = NULL; // if ($database->loadObject($value)) { // $agoraid = $value->id; // $showavatars = $value->show_avatars; // } else { // $agoraid = "notfound"; // $showavatars = 0; // } $pic1 = "/".$agoraid.".gif"; $pic2 = "/".$agoraid.".jpg"; $pic3 = "/".$agoraid.".png"; $filename1local = "/".$adir.$pic1; $filename1live = uddeIMgetPath('live_site') ."/".$adir.$pic1; $filename2local = "/".$adir.$pic2; $filename2live = uddeIMgetPath('live_site') ."/".$adir.$pic2; $filename3local = "/".$adir.$pic3; $filename3live = uddeIMgetPath('live_site') ."/".$adir.$pic3; $filename4local = "/".$adir."/noavatar_sm.gif"; $filename4live = uddeIMgetPath('live_site') ."/".$adir."/noavatar_sm.gif"; if (uddeIMfileExists($filename1local) && $useavatars && $showavatars) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename1live."' alt='' />"; } elseif (uddeIMfileExists($filename2local) && $useavatars && $showavatars) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename2live."' alt='' />"; } elseif (uddeIMfileExists($filename3local) && $useavatars && $showavatars) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename3live."' alt='' />"; } elseif ($config->gravatar) { $email = uddeIMgetEMailFromID((int)$ofanid, $config); $grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr); $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />"; } elseif (uddeIMfileExists($filename4local)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename4live."' alt='' />"; } if ($noanchor) $gimmeback = $imgurl; else $gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config); } elseif ($config->showcbpic==4) { // CBE (new) if (is_dir(uddeIMgetPath('absolute_path')."/components/com_cbe/plugin/language/".$mosConfig_lang."/images")) $fileLang=$mosConfig_lang; else $fileLang="default_language"; $sql="SELECT avatar FROM #__cbe WHERE user_id=".(int)$ofanid." LIMIT 1"; $database->setQuery($sql); $ofanavatar=$database->loadResult(); $filenamelocal = "/images/cbe/tn".$ofanavatar; // Thumbnail $filenamelive = uddeIMgetPath('live_site') ."/images/cbe/tn".$ofanavatar; // Thumbnail $filenameglocal = "/images/cbe/".$ofanavatar; // Gallery $filenameglive = uddeIMgetPath('live_site') ."/images/cbe/".$ofanavatar; // Gallery // NOPHOTO for CBE new $filename3local = "/components/com_cbe/images/".$fileLang."/tnnophoto.jpg"; $filename3live = uddeIMgetPath('live_site') ."/components/com_cbe/images/".$fileLang."/tnnophoto.jpg"; if (uddeIMfileExists($filenamelocal)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenamelive."' alt='' />"; } elseif (uddeIMfileExists($filenameglocal) && $config->CBgallery) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />"; } elseif ($config->gravatar) { $email = uddeIMgetEMailFromID((int)$ofanid, $config); $grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr); $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />"; } elseif (uddeIMfileExists($filename3local)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename3live."' alt='' />"; } if ($noanchor) $gimmeback = $imgurl; else $gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config); } elseif ($config->showcbpic==5) { // KUNENA $sql="SELECT avatar FROM #__fb_users WHERE userid=".(int)$ofanid." LIMIT 1"; $database->setQuery($sql); $ofanavatar=$database->loadResult(); $filenameglocal = "/images/fbfiles/avatars/".$ofanavatar; // Gallery $filenameglive = uddeIMgetPath('live_site') ."/images/fbfiles/avatars/".$ofanavatar; // Gallery $filename2local = "/images/fbfiles/avatars/s_nophoto.jpg"; $filename2live = uddeIMgetPath('live_site') ."/images/fbfiles/avatars/s_nophoto.jpg"; if (uddeIMfileExists($filenameglocal)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />"; } elseif ($config->gravatar) { $email = uddeIMgetEMailFromID((int)$ofanid, $config); $grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr); $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />"; } elseif (uddeIMfileExists($filename2local)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename2live."' alt='' />"; } if ($noanchor) $gimmeback = $imgurl; else $gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config); } elseif ($config->showcbpic==6) { // JOMSOCIAL, no gravatar if (class_exists('CFactory')) { $jsuser = CFactory::getUser((int)$ofanid); $filenameglive = $jsuser->getThumbAvatar(); $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />"; } if ($noanchor) $gimmeback = $imgurl; else $gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config); } elseif ($config->showcbpic==7) { // AUP, no gravatar $api_AUP = JPATH_SITE.'/components/com_alphauserpoints/helper.php'; if ( file_exists($api_AUP) ) { require_once($api_AUP); if ($config->avatarw && $config->avatarh) $avatar = AlphaUserPointsHelper::getAupAvatar($ofanid, 0, $config->avatarw, $config->avatarh); else $avatar = AlphaUserPointsHelper::getAupAvatar($ofanid, 0); // [int $width], [int $height] $imgurl = $avatar; } if ($noanchor) $gimmeback = $imgurl; else $gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config); } elseif ($config->showcbpic==8) { // JooCM $avatarFile = ""; $sql = "SELECT a.* FROM #__joocm_avatars AS a INNER JOIN #__joocm_users AS u ON u.id_avatar = a.id WHERE u.id = ".(int)$ofanid; $database->setQuery($sql); $avatar = $database->loadObject(); if (is_object($avatar)) { $pos = strpos($avatar->avatar_file, 'http://'); if ($pos === false) { if ($avatar->avatar_file) { $avatarFile = uddeIMgetPath('live_site')."/media/joocm/avatars/"; if ($avatar->id_user) { $avatarFile .= $avatar->id_user.'/'.$avatar->avatar_file; } else { $avatarFile .= 'standard/'.$avatar->avatar_file; } } } else { $avatarFile = $avatar->avatar_file; } } if (!$avatarFile) { if ($config->gravatar) { $email = uddeIMgetEMailFromID((int)$ofanid, $config); $avatarFile = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr); } else { $avatarFile = uddeIMgetPath('live_site').'/media/joocm/avatars/standard/_cm_noavatar.png'; } } if ($avatarFile) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$avatarFile."' alt='' />"; } if ($noanchor) $gimmeback = $imgurl; else $gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config); } elseif ($config->showcbpic==9) { // KUNENA 1.6+ // $api_KUN = JPATH_SITE.'/components/com_kunena/lib/kunena.config.class.php'; // if ( file_exists($api_KUN) ) { // require_once($api_KUN); // $kcfg = KunenaFactory::getConfig(); //} $sql="SELECT avatar FROM #__kunena_users WHERE userid=".(int)$ofanid." LIMIT 1"; $database->setQuery($sql); $ofanavatar=$database->loadResult(); $filenameglocal = "/media/kunena/avatars/".$ofanavatar; $filenameglive = uddeIMgetPath('live_site') ."/media/kunena/avatars/".$ofanavatar; $filename2local = "/media/kunena/avatars/s_nophoto.jpg"; $filename2live = uddeIMgetPath('live_site') ."/media/kunena/avatars/s_nophoto.jpg"; if (uddeIMfileExists($filenameglocal)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />"; } elseif ($config->gravatar) { $email = uddeIMgetEMailFromID((int)$ofanid, $config); $grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr); $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />"; } elseif (uddeIMfileExists($filename2local)) { $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filename2live."' alt='' />"; } if ($noanchor) $gimmeback = $imgurl; else $gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config); } elseif ($config->showcbpic==10) { // NINJABOARD // $filenameglocal = "/media/com_ninjaboard/images/avatars/".$ofanid."/avatar.png"; // $filenameglive = uddeIMgetPath('live_site') ."/media/com_ninjaboard/images/avatars/".$ofanid."/avatar.png"; // if (uddeIMfileExists($filenameglocal)) { // $gimmeback = uddeIMgetLinkOnly($ofanid, "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />", $config); // } $filenameglive = uddeIMgetPath('live_site') ."/index.php?view=avatar&id=".$ofanid."&thumbnail=large"; $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$filenameglive."' alt='' />"; if ($noanchor) $gimmeback = $imgurl; else $gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config); } elseif ($config->showcbpic==11 || $config->showcbpic==12) { // KUNENA 2.0+, 3.0+ $sizex = $sizey = $grsize; $class = 'avatar'; KunenaForum::setup(); $isInstalled = KunenaForum::installed (); if ($isInstalled) { $user = KunenaUserHelper::get($ofanid); // $user = KunenaFactory::getUser(); // Get avatar URL "/media/kunena/avatars/path/file.jpg" $avatarUrl = $user->getAvatarURL($sizex, $sizey); // Get avatar <img> tag $avatarHtml = $user->getAvatarImage($class, $sizex, $sizey); // Get profile link with avatar pointing to profile page $userLink = $user->getLink(null, $avatarHtml); $filenameglocal = $avatarUrl; $filenameglive = $avatarHtml; if (!empty($avatarUrl)) { $imgurl = $filenameglive; } elseif ($config->gravatar) { $email = uddeIMgetEMailFromID((int)$ofanid, $config); $grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr); $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />"; } else { $imgurl = ""; } if ($noanchor) $gimmeback = $imgurl; else $gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config); } } elseif ($config->showcbpic==0 && $config->gravatar) { // disabled, but gravatar enabled $email = uddeIMgetEMailFromID((int)$ofanid, $config); $grurl = uddeIMgetGravatar($email, $grsize, $config->gravatard, $config->gravatarr); $imgurl = "<img class='uddeim-tn'".$picstyle." src='".$grurl."' alt='' />"; if ($noanchor) $gimmeback = $imgurl; else $gimmeback = uddeIMgetLinkOnly($ofanid, $imgurl, $config); } return $gimmeback; }
<?php if ($fbConfig->avatar_src == "jomsocial" && $leaf->userid) { // Get CUser object $jsuser =& CFactory::getUser($last_reply[$leaf->id]->userid); $useravatar = '<img class="fb_list_avatar" src="' . $jsuser->getThumbAvatar() . '" alt=" " />'; echo CKunenaLink::GetProfileLink($fbConfig, $last_reply[$leaf->id]->userid, $useravatar); } else { if ($fbConfig->avatar_src == "cb") { $useravatar = $kunenaProfile->showAvatar($last_reply[$leaf->id]->userid, 'fb_list_avatar'); echo CKunenaLink::GetProfileLink($fbConfig, $last_reply[$leaf->id]->userid, $useravatar); } else { if ($fbConfig->avatar_src == "aup") { $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php'; if (file_exists($api_AUP)) { $fbConfig->fb_profile == 'aup' ? $showlink = 1 : ($showlink = 0); echo AlphaUserPointsHelper::getAupAvatar($last_reply[$leaf->id]->userid, $showlink, 40, 40); } // end integration AlphaUserPoints } else { $javatar = $last_reply[$leaf->id]->avatar; if ($javatar != '') { echo CKunenaLink::GetProfileLink($fbConfig, $last_reply[$leaf->id]->userid, '<img class="fb_list_avatar" src="' . (!file_exists(KUNENA_PATH_UPLOADED . DS . 'avatars/s_' . $javatar) ? KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $javatar : KUNENA_LIVEUPLOADEDPATH . '/avatars/s_' . $javatar) . '" alt="" />'); } else { echo CKunenaLink::GetProfileLink($fbConfig, $last_reply[$leaf->id]->userid, '<img class="fb_list_avatar" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/s_nophoto.jpg" alt="" />'); } } } } ?> </span> <?php
function showprf($userid, $page) { $fbConfig =& CKunenaConfig::getInstance(); $kunena_acl =& JFactory::getACL(); $kunena_my =& JFactory::getUser(); $kunena_db =& JFactory::getDBO(); // ERROR: mixed global $fbIcons global $fbIcons; //Get userinfo needed later on, this limits the amount of queries unset($userinfo); $kunena_db->setQuery("SELECT a.*, b.* FROM #__fb_users AS a INNER JOIN #__users AS b ON b.id=a.userid WHERE a.userid='{$userid}'"); $userinfo = $kunena_db->loadObject(); check_dberror('Unable to get user profile info.'); if (!$userinfo) { $kunena_db->setQuery("SELECT * FROM #__users WHERE id='{$userid}'"); $userinfo = $kunena_db->loadObject(); check_dberror('Unable to get user profile info.'); if (!$userinfo) { echo '<h3>' . _KUNENA_PROFILE_NO_USER . '</h3>'; return; } else { // Check moderator status (admin is moderator) $aro_group = $kunena_acl->getAroGroup($userid); $is_admin = strtolower($aro_group->name) == 'super administrator' || strtolower($aro_group->name) == 'administrator'; // there's no profile; set userid and moderator status. $kunena_db->setQuery("INSERT INTO #__fb_users (userid,moderator) VALUES ('{$userid}','{$is_admin}')"); $kunena_db->query(); check_dberror('Unable to create user profile.'); $kunena_db->setQuery("SELECT a.*, b.* FROM #__fb_users AS a LEFT JOIN #__users AS b ON b.id=a.userid WHERE a.userid='{$userid}'"); $userinfo = $kunena_db->loadObject(); check_dberror('Unable to get user profile info.'); // TODO: For future use // echo '<h3>' . _KUNENA_PROFILE_NOT_FOUND . '</h3>'; // return; } } // User Hits $kunena_db->setQuery('UPDATE #__fb_users SET uhits=uhits+1 WHERE userid=' . $userid); $kunena_db->query() or trigger_dberror("Unable to update user hits."); // get userprofile hits $msg_userhits = $userinfo->uhits; //get the username: $fb_username = ""; if ($fbConfig->username) { $fb_queryName = "username"; } else { $fb_queryName = "name"; } $fb_username = $userinfo->{$fb_queryName}; $lists["userid"] = $userid; $msg_username = $fb_username; // $msg_username = ($fmessage->email != "" && $kunena_my->id > 0 && $fbConfig->showemail == '1') ? "<a href=\"mailto:" . $fmessage->email . "\">" . $fb_username . "</a>" : $fb_username; if ($fbConfig->allowavatar) { $Avatarname = $userinfo->username; if ($fbConfig->avatar_src == "jomsocial") { // Get CUser object $user =& CFactory::getUser($userid); $msg_avatar = '<span class="fb_avatar"><img src="' . $user->getAvatar() . '" alt="" /></span>'; } else { if ($fbConfig->avatar_src == "clexuspm") { $msg_avatar = '<span class="fb_avatar"><img src="' . MyPMSTools::getAvatarLinkWithID($userid, "b") . '" alt="" /></span>'; } else { if ($fbConfig->avatar_src == "cb") { $kunenaProfile = CKunenaCBProfile::getInstance(); $msg_avatar = '<span class="fb_avatar">' . $kunenaProfile->showAvatar($userid, '', 0) . '</span>'; } else { if ($fbConfig->avatar_src == "aup") { $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php'; if (file_exists($api_AUP)) { $fbConfig->fb_profile == 'aup' ? $showlink = 1 : ($showlink = 0); $msg_avatar = '<span class="fb_avatar">' . AlphaUserPointsHelper::getAupAvatar($userinfo->userid, $showlink) . '</span>'; } } else { $avatar = $userinfo->avatar; if ($avatar != '') { if (!file_exists(KUNENA_PATH_UPLOADED . DS . 'avatars/l_' . $avatar)) { $msg_avatar = '<span class="fb_avatar"><img border="0" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '" alt="" style="max-width: ' . $fbConfig->avatarwidth . 'px; max-height: ' . $fbConfig->avatarheight . 'px;" /></span>'; } else { $msg_avatar = '<span class="fb_avatar"><img border="0" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '" alt="" /></span>'; } } else { $msg_avatar = '<span class="fb_avatar"><img border="0" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/nophoto.jpg" alt="" /></span>'; } } } } } } if ($fbConfig->showuserstats) { //user type determination $ugid = $userinfo->gid; $uIsMod = 0; $uIsAdm = 0; if ($ugid > 0) { //only get the groupname from the ACL if we're sure there is one $agrp = strtolower($kunena_acl->get_group_name($ugid, 'ARO')); } if ($ugid == 0) { $msg_usertype = _VIEW_VISITOR; } else { if (strtolower($agrp) == "administrator" || strtolower($agrp) == "superadministrator" || strtolower($agrp) == "super administrator") { $msg_usertype = _VIEW_ADMIN; $uIsAdm = 1; } elseif ($uIsMod) { $msg_usertype = _VIEW_MODERATOR; } else { $msg_usertype = _VIEW_USER; } } //done usertype determination, phew... //Get the max# of posts for any one user $kunena_db->setQuery("SELECT MAX(posts) FROM #__fb_users"); $maxPosts = $kunena_db->loadResult(); //# of post for this user and ranking $numPosts = (int) $userinfo->posts; //ranking if ($fbConfig->showranking) { if ($userinfo->rank != '0') { //special rank $kunena_db->setQuery("SELECT * FROM #__fb_ranks WHERE rank_id='{$userinfo->rank}'"); $getRank = $kunena_db->loadObjectList(); check_dberror("Unable to load ranks."); $rank = $getRank[0]; $rText = $rank->rank_title; $rImg = KUNENA_URLRANKSPATH . $rank->rank_image; } if ($userinfo->rank == '0') { //post count rank $kunena_db->setQuery("SELECT * FROM #__fb_ranks WHERE ((rank_min <= '{$numPosts}') AND (rank_special = '0')) ORDER BY rank_min DESC", 0, 1); $getRank = $kunena_db->loadObjectList(); check_dberror("Unable to load ranks."); $rank = $getRank[0]; $rText = $rank->rank_title; $rImg = KUNENA_URLRANKSPATH . $rank->rank_image; } if ($userinfo->rank == '0' && $uIsMod) { $rText = _RANK_MODERATOR; $rImg = KUNENA_URLRANKSPATH . 'rankmod.gif'; } if ($userinfo->rank == '0' && $uIsAdm) { $rText = _RANK_ADMINISTRATOR; $rImg = KUNENA_URLRANKSPATH . 'rankadmin.gif'; } if ($fbConfig->rankimages) { $msg_userrankimg = '<img src="' . $rImg . '" alt="" />'; } $msg_userrank = $rText; $useGraph = 0; //initialization if (!$fbConfig->poststats) { $msg_posts = '<div class="viewcover">' . "<strong>" . _POSTS . " {$numPosts}" . "</strong>" . "</div>"; $useGraph = 0; } else { $myGraph = new phpGraph(); //$myGraph->SetGraphTitle(_POSTS); $myGraph->AddValue(_POSTS, $numPosts); $myGraph->SetRowSortMode(0); $myGraph->SetBarImg(KUNENA_URLGRAPHPATH . "col" . $fbConfig->statscolor . "m.png"); $myGraph->SetBarImg2(KUNENA_URLEMOTIONSPATH . "graph.gif"); $myGraph->SetMaxVal($maxPosts); $myGraph->SetShowCountsMode(2); $myGraph->SetBarWidth(4); //height of the bar $myGraph->SetBorderColor("#333333"); $myGraph->SetBarBorderWidth(0); $myGraph->SetGraphWidth(120); //should match column width in the <TD> above -5 pixels //$myGraph->BarGraphHoriz(); $useGraph = 1; } } } // Start Integration AlphaUserPoints // ********************************* $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php'; if ($fbConfig->alphauserpoints && file_exists($api_AUP)) { //Get the max# of points for any one user $database =& JFactory::getDBO(); $database->setQuery("SELECT max(points) from #__alpha_userpoints"); $maxPoints = $database->loadResult(); $database->setQuery("SELECT points from #__alpha_userpoints WHERE `userid`='" . $userid . "'"); $numPoints = $database->loadResult(); $myGraphAUP = new phpGraph(); $myGraphAUP->AddValue(_KUNENA_AUP_POINTS, $numPoints); $myGraphAUP->SetRowSortMode(0); $myGraphAUP->SetBarImg(KUNENA_URLGRAPHPATH . "col" . $fbConfig->statscolor . "m.png"); $myGraphAUP->SetBarImg2(KUNENA_URLEMOTIONSPATH . "graph.gif"); $myGraphAUP->SetMaxVal($maxPoints); $myGraphAUP->SetShowCountsMode(2); $myGraphAUP->SetBarWidth(4); //height of the bar $myGraphAUP->SetBorderColor("#333333"); $myGraphAUP->SetBarBorderWidth(0); $myGraphAUP->SetGraphWidth(120); //should match column width in the <TD> above -5 pixels $useGraph = 1; } // End Integration AlphaUserPoints // ******************************* //karma points and buttons if ($fbConfig->showkarma && $userid != '0') { $karmaPoints = $userinfo->karma; $karmaPoints = (int) $karmaPoints; $msg_karma = "<strong>" . _KARMA . ":</strong> {$karmaPoints}"; $msg_karmaminus = ''; $msg_karmaplus = ''; if ($kunena_my->id != '0' && $kunena_my->id != $userid) { $msg_karmaminus .= "<a href=\"" . JRoute::_(KUNENA_LIVEURLREL . '&func=karma&do=decrease&userid=' . $userid) . "\"><img src=\""; if (isset($fbIcons['karmaminus'])) { $msg_karmaminus .= KUNENA_URLICONSPATH . $fbIcons['karmaminus']; } else { $msg_karmaminus .= KUNENA_URLEMOTIONSPATH . "karmaminus.gif"; } $msg_karmaminus .= "\" alt=\"Karma-\" border=\"0\" title=\"" . _KARMA_SMITE . "\" align=\"middle\" /></a>"; $msg_karmaplus .= "<a href=\"" . JRoute::_(KUNENA_LIVEURLREL . '&func=karma&do=increase&userid=' . $userid) . "\"><img src=\""; if (isset($fbIcons['karmaplus'])) { $msg_karmaplus .= KUNENA_URLICONSPATH . $fbIcons['karmaplus']; } else { $msg_karmaplus .= KUNENA_URLEMOTIONSPATH . "karmaplus.gif"; } $msg_karmaplus .= "\" alt=\"Karma+\" border=\"0\" title=\"" . _KARMA_APPLAUD . "\" align=\"middle\" /></a>"; } } /*let's see if we should use uddeIM integration */ if ($fbConfig->pm_component == "uddeim" && $userid && $kunena_my->id) { //we should offer the user a PMS link //first get the username of the user to contact $PMSName = $userinfo->username; $msg_pms = "<a href=\"" . JRoute::_('index.php?option=com_uddeim&task=new&recip=' . $userid) . "\"><img src=\""; if ($fbIcons['pms']) { $msg_pms .= KUNENA_URLICONSPATH . $fbIcons['pms']; } else { $msg_pms .= KUNENA_URLEMOTIONSPATH . "sendpm.gif"; } $msg_pms .= "\" alt=\"" . _VIEW_PMS . "\" border=\"0\" title=\"" . _VIEW_PMS . "\" /></a>"; } /*let's see if we should use myPMS2 integration */ if ($fbConfig->pm_component == "pms" && $userid && $kunena_my->id) { //we should offer the user a PMS link //first get the username of the user to contact $PMSName = $userinfo->username; $msg_pms = "<a href=\"" . JRoute::_('index.php?option=com_pms&page=new&id=' . $PMSName . '&title=' . $fmessage->subject) . "\"><img src=\""; if ($fbIcons['pms']) { $msg_pms .= KUNENA_URLICONSPATH . $fbIcons['pms']; } else { $msg_pms .= KUNENA_URLEMOTIONSPATH . "sendpm.gif"; } $msg_pms .= "\" alt=\"" . _VIEW_PMS . "\" border=\"0\" title=\"" . _VIEW_PMS . "\" /></a>"; } // online - ofline status if ($userid > 0) { $sql = "SELECT COUNT(userid) FROM #__session WHERE userid='{$userid}'"; $kunena_db->setQuery($sql); $isonline = $kunena_db->loadResult(); if ($isonline && $userinfo->showOnline == 1) { $msg_online = isset($fbIcons['onlineicon']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['onlineicon'] . '" border="0" alt="' . _MODLIST_ONLINE . '" />' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'onlineicon.gif" border="0" alt="' . _MODLIST_ONLINE . '" />'; } else { $msg_online = isset($fbIcons['offlineicon']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['offlineicon'] . '" border="0" alt="' . _MODLIST_OFFLINE . '" />' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'offlineicon.gif" border="0" alt="' . _MODLIST_OFFLINE . '" />'; } } /* ClexusPM integration */ if ($fbConfig->pm_component == "clexuspm") { //we should offer the user a PMS link //first get the username of the user to contact $PMSName = $userinfo->aid; $msg_pms = "<a href=\"" . JRoute::_('index.php?option=com_mypms&task=new&to=' . $userid . '' . $fmessage->subject) . "\"><img src=\""; if ($fbIcons['pms']) { $msg_pms .= KUNENA_URLICONSPATH . $fbIcons['pms']; } else { $msg_pms .= KUNENA_JLIVEURL . "/components/com_mypms/images/icons/message_12px.gif"; } $msg_pms .= "\" alt=\"" . _VIEW_PMS . "\" border=\"0\" title=\"" . _VIEW_PMS . "\" /></a>"; //mypms pro profile link $msg_profile = "<a href=\"" . MyPMSTools::getProfileLink($userid) . "\"><img src=\""; if ($fbIcons['userprofile']) { $msg_profile .= KUNENA_URLICONSPATH . $fbIcons['userprofile']; } else { $msg_profile .= KUNENA_JLIVEURL . "/components/com_mypms/images/managecontact_icon.gif"; } $msg_profile .= "\" alt=\"" . _VIEW_PROFILE . "\" border=\"0\" title=\"" . _VIEW_PROFILE . "\" /></a>"; //mypms add buddy link $msg_buddy = "<a href=\"" . JRoute::_('index.php?option=com_mypms&user='******'&task=addbuddy') . "\"><img src=\""; if ($fbIcons['pms2buddy']) { $msg_buddy .= KUNENA_URLICONSPATH . $fbIcons['pms2buddy']; } else { $msg_buddy .= KUNENA_JLIVEURL . "/components/com_mypms/images/messages/addbuddy.gif"; } $msg_buddy .= "\" alt=\"" . _VIEW_ADDBUDDY . "\" border=\"0\" title=\"" . _VIEW_ADDBUDDY . "\" /></a>"; $kunena_db->setQuery("SELECT icq, ym, msn, aim, website, location FROM #__mypms_profiles WHERE user='******'"); $profileitems = $kunena_db->loadObjectList(); check_dberror("Unable to load mypms_profiles."); foreach ($profileitems as $profileitems) { if ($profileitems->aim) { $msg_aim = "<a href=\"aim:goim?screenname=" . str_replace(" ", "+", $profileitems->aim) . "\"><img src=\"" . KUNENA_URLEMOTIONSPATH . "aim.png\" border=0 alt=\"\" /></a>"; } if ($profileitems->icq) { $msg_icq = "<a href=\"http://www.icq.com/whitepages/wwp.php?uin=" . $profileitems->icq . "\"><img src=\"" . KUNENA_URLEMOTIONSPATH . "icq.png\" border=0 alt=\"\" /></a>"; } if ($profileitems->msn) { $msg_msn = "<a href=\"" . JRoute::_('index.php?option=com_mypms&task=showprofile&user='******'/plugin/fbprofile/userinfos.php')) { include KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/userinfos.php'; } else { include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/fbprofile/userinfos.php'; } ?> <!-- /Kunena Profile --> </td> <td class = "<?php echo $boardclass; ?> profile-right" valign="top" width="74%"> <!-- User Messages --> <?php if (file_exists(KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/summary.php')) { include KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/summary.php'; } else { include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/fbprofile/summary.php'; } ?> <?php if (file_exists(KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/forummsg.php')) { include KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/forummsg.php'; } else { include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/fbprofile/forummsg.php'; } ?> </td> </tr> </table> <?php /* end of function */ }