Example #1
0
function getLastRoundSummaryDetail(&$jTipsUser, $col)
{
    global $jTips, $jLang, $database;
    $jSeason = new jSeason($database);
    $jSeason->load($jTipsUser->season_id);
    switch ($col) {
        case 'season':
            return $jSeason->name;
            break;
        case 'last_won':
            //return $jTipsUser->getName();
            // BUG 313 - Social Integration on Last Round Summary dashlet
            if (isset($jTips['SocialIntegration']) and !empty($jTips['SocialIntegration'])) {
                // which type of integration
                if ($jTips['SocialIntegration'] == 'cb') {
                    // Community Builder
                    $link = jTipsRoute("index.php?option=com_comprofiler&task=userProfile&user="******"<img src='{$img}' alt='Avatar' title='" . $jTipsUser->getName() . "' align='absmiddle' />&nbsp;<a href='{$link}'>" . $jTipsUser->getName() . "</a>";
                return "<div style='text-align:left;'>{$html}</div>";
            } else {
                return $jTipsUser->getName();
            }
            break;
        case 'last_prec':
            $jHistory = new jHistory($database);
            return $jHistory->getLast($jTipsUser, 'precision');
            break;
        case 'last_round':
            $jHistory = new jHistory($database);
            return $jHistory->getLast($jTipsUser);
            break;
        case 'last_prect':
            return $jTipsUser->getTotalScore('precision');
            break;
        case 'last_tot':
            return $jTipsUser->getTotalScore('points');
            break;
        case 'last_comm':
            $jComment = new jComment($database);
            $params = array('user_id' => $jTipsUser->id, 'round_id' => $jSeason->getLastRound());
            $jComment->loadByParams($params);
            return jTipsStripslashes($jComment->comment);
            break;
        default:
            return '-';
    }
}