} // Start Integration AlphaUserPoints // **************************** $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php'; if ($fbConfig->alphauserpoints && file_exists($api_AUP)) { static $maxPoints = false; if ($maxPoints == false) { //Get the max# of points for any one user $kunena_db->setQuery("SELECT MAX(points) FROM #__alpha_userpoints"); $maxPoints = $kunena_db->loadResult(); check_dberror("Unable to load AUP max points."); } $kunena_db->setQuery("SELECT points FROM #__alpha_userpoints WHERE `userid`='" . (int) $fmessage->userid . "'"); $numPoints = $kunena_db->loadResult(); check_dberror("Unable to load AUP points."); $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(64); //should match column width in the <TD> above -5 pixels $useGraph = 1; } // End Integration AlphaUserPoints
$rImg = KUNENA_URLRANKSPATH . 'rankmod.gif'; } if ($uIsAdm and !$showSpRank) { $rText = _RANK_ADMINISTRATOR; $rImg = KUNENA_URLRANKSPATH . 'rankadmin.gif'; } if ($fbConfig->rankimages && isset($rImg)) { $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>"; } 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(64); //should match column width in the <TD> above -5 pixels //$myGraph->BarGraphHoriz(); $useGraph = 1;
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 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.'); 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 { $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 ($uIsMod) { $rText = _RANK_MODERATOR; $rImg = KUNENA_URLRANKSPATH . 'rankmod.gif'; } if ($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; } } } //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 */ }
/** * Méthode qui se charger de créer le Singleton * * @return objet retourne une instance de la classe * @author Stephane F **/ public static function getInstance() { if (!isset(self::$instance)) { $class = __CLASS__; self::$instance = false; self::$instance = new $class(); } return self::$instance; }
//We transforme multidimensionnal array to unidimensionnal array $dataFirst = array(); foreach ($flot as $key => $value) { $dataFirst[$value[0]] = $value[1]; } //An other array $data = array("0" => array("2000" => 0, "2002" => 25, "2003" => 32, "2004" => 1, "2005" => 58, "2006" => 31, "2007" => 79, "2008" => 51, "2009" => 54, "2010" => 12, "2011" => 17, "2012" => 14, "2013" => 13), "1" => array("2000" => 0, "2002" => 0, "2003" => 0, "2004" => 20, "2005" => 0, "2006" => 40, "2007" => 50, "2008" => 0, "2009" => 60, "2010" => 0, "2011" => 0, "2012" => 0, "2013" => 0), "2" => array("2000" => 0, "2002" => -20, "2003" => -30, "2004" => 65, "2005" => 0, "2006" => 10, "2007" => 10, "2008" => 18, "2009" => 39, "2010" => 0, "2011" => 23, "2012" => 36, "2013" => 54), "3" => array("2001" => 0, "2002" => 10, "2003" => 3, "2004" => 1, "2005" => 5, "2006" => 2, "2007" => 3, "2008" => 3, "2009" => -5, "2010" => 8, "2011" => 9, "2012" => 5, "2013" => 20), "4" => array("2000" => 0, "2002" => 0, "2003" => 0, "2004" => 0, "2005" => 0, "2006" => 0, "2007" => 46, "2008" => 10, "2009" => 7, "2010" => 4, "2011" => 5, "2012" => 6, "2013" => 0)); $d = array("2000" => -7, "2001" => 15, "2002" => 39, "2003" => 26, "2004" => 36, "2005" => 18, "2006" => 32, "2007" => 56, "2008" => 38, "2009" => 103, "2010" => 105, "2011" => 126, "2012" => 125, "2013" => 76); //Be carefull, for stock graph, array structure must be the same as the array below $stock = array('Jan' => array('open' => 35, 'close' => 20, 'min' => 10, 'max' => 37), 'Feb' => array('open' => 28, 'close' => 17, 'min' => 11, 'max' => 32), 'Mar' => array('open' => 17, 'close' => 25, 'min' => 14, 'max' => 33), 'Apr' => array('open' => 27, 'close' => 20, 'min' => 11, 'max' => 29), 'May' => array('open' => 12, 'close' => 25, 'min' => 9, 'max' => 29), 'Jun' => array('open' => 12, 'close' => 23, 'min' => 4, 'max' => 25), 'Jul' => array('open' => 20, 'close' => 16, 'min' => 3, 'max' => 22), 'Aug' => array('open' => 15, 'close' => 29, 'min' => 7, 'max' => 34), 'Sep' => array('open' => 20, 'close' => 26, 'min' => 9, 'max' => 29), 'Oct' => array('open' => 28, 'close' => 17, 'min' => 5, 'max' => 31), 'Nov' => array('open' => 15, 'close' => 29, 'min' => 8, 'max' => 37), 'Dec' => array('open' => 12, 'close' => 60, 'min' => 10, 'max' => 67)); $stock2 = array("Série 1" => array('open' => 34, 'close' => 42, 'min' => 27, 'max' => 45), "Série 2" => array('open' => 55, 'close' => 25, 'min' => 14, 'max' => 59), "Série 3" => array('open' => 15, 'close' => 40, 'min' => 12, 'max' => 47), "Série 4" => array('open' => 62, 'close' => 38, 'min' => 25, 'max' => 65), "Série 5" => array('open' => 38, 'close' => 49, 'min' => 32, 'max' => 64), "Série 6" => array('open' => 40, 'close' => 40, 'min' => 32, 'max' => 48)); $stock3 = array("aplasie" => array('open' => 1.04, 'close' => 1.04, 'min' => 0.87, 'max' => 1.24), "thrombopénie" => array('open' => 1.09, 'close' => 1.09, 'min' => 0.95, 'max' => 1.25), "anorexie" => array('open' => 1.02, 'close' => 1.02, 'min' => 0.86, 'max' => 1.21), "mucites" => array('open' => 0.87, 'close' => 0.87, 'min' => 0.71, 'max' => 1.06), "leucopénie" => array('open' => 0.9, 'close' => 0.9, 'min' => 0.1, 'max' => 1.34), "neutropénie" => array('open' => 1, 'close' => 1, 'min' => 0.78, 'max' => 1.2)); //All options available $options = array('width' => null, 'height' => null, 'paddingTop' => 10, 'type' => 'line', 'steps' => 5, 'filled' => true, 'tooltips' => false, 'circles' => true, 'stroke' => '#3cc5f1', 'background' => "#ffffff", 'gradient' => null, 'titleHeight' => 0, 'tooltipLegend' => '', 'legends' => '', 'title' => null, 'radius' => 100, 'diskLegends' => false, 'diskLegendsType' => 'label'); //We call an instance of phpGraph() class $G = new phpGraph(); ?> <!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>phpGraph</title> <link rel="stylesheet" type="text/css" href="phpGraph_style.css" media="all"> </head> <body> <div class="draw"><!-- Use this div to wrap your svg --> <?php //This is only to see code of the page. You can delet it. // highlight_string(file_get_contents('samples.php')); // //Then we draw charts