* @version 2.1 * @package jTips * * Description: Store the games and setup */ jTipsSpoofCheck(); global $database, $jTips; //jTipsDebug($_REQUEST); //die(); require_once 'components/com_jtips/classes/jgame.class.php'; require_once 'components/com_jtips/classes/jround.class.php'; require_once 'components/com_jtips/classes/jseason.class.php'; $jRound = new jRound($database); $jSeason = new jSeason($database); if ($round_id = jTipsGetParam($_REQUEST, 'id', false)) { $jRound->load($round_id); } $season_id = jTipsGetParam($_REQUEST, 'season_id', false); $jSeason->load($season_id); $results = $games_to_keep = array(); //jTipsLogger::_log($_REQUEST); jTipsLogger::_log('about to save round and games'); //first, save the round info $start_time_date = jTipsGetParam($_REQUEST, 'date_start_date', strftime($jTips['DateFormat'])) . " "; $start_minute = jTipsGetParam($_REQUEST, 'date_start_time_minute', ''); $start_time_time = jTipsGetParam($_REQUEST, 'date_start_time_hour', '') . ":" . str_pad($start_minute, 2, '0', STR_PAD_LEFT) . jTipsGetParam($_REQUEST, 'date_start_time_meridiem', ''); if (!preg_match('/\\d/', $start_time_time)) { $start_time_time = strftime($jTips['TimeFormat']); } $start_time = $start_time_date . " " . $start_time_time; //BUG 263 - set the date fields if we are in J1.0
$jTipsUser = new jTipsUser($database); $jTipsUser->load($user_id); $render->assign('jTipsUser', $jTipsUser); $round_id = jTipsGetParam($_REQUEST, 'rid', ''); $jSeason = new jSeason($database); $jSeason->load($jTipsUser->season_id); $render->assign('jSeason', $jSeason); $jRound = new jRound($database); if ($round_id == false) { $complete = 0; while ($complete !== 1) { $tempRound = new jRound($database); if ($round_id == false) { $round_id = $jSeason->getCurrentRound(); } $tempRound->load($round_id); $round_id = $tempRound->getPrev(); if (!is_numeric($round_id)) { break; } $jRound = new jRound($database); $jRound->load($round_id); $complete = $jRound->getStatus(); } } $jRound->load($round_id); $render->assign('jRound', $jRound); $jGameParams = array('round_id' => $jRound->id); $jGame = new jGame($database); $jGames = forceArray($jGame->loadByParams($jGameParams)); $render->assign('jGames', $jGames);
// Set default values for newer config variables if (!isset($jTips['Is24Hour'])) { $jTips['Is24Hour'] = '0'; } if (!isset($jTips['MinuteValues'])) { $jTips['MinuteValues'] = '0'; } $mainframe->addCustomHeadTag("<script type='text/javascript'>var DateFormat = '" . $dateFormat . "'; var Offset = " . TimeDate::getOffset() . "; var MinuteValues = {$jTips['MinuteValues']}; var Is24Hour = {$jTips['Is24Hour']};</script>"); //BUG 259 - No need to define style here - causes problems in J1.0 with IE //$mainframe->addCustomHeadTag("<style type='text/css'>.pick_score {display:none;} .pick_margin {display:none} .pick_bonus {display:none;} .team_starts {display:none;}</style>"); $tpl = new EditMode(); $focus = new jRound($database); $ids = jTipsGetParam($_REQUEST, 'cid', array()); if (!empty($ids)) { $id = array_shift($ids); $focus->load($id); } //load the jRound object into the script $mainframe->addCustomHeadTag("<script type='text/javascript'>var jRound = " . @json_encode($focus) . ";</script>"); $tpl->formData = array('title' => $jLang['_ADMIN_ROUND_TITLE'] . ": " . ($focus->exists() ? $jLang['_ADMIN_OTHER_EDIT'] : $jLang['_ADMIN_OTHER_NEW'])); $tpl->focus =& $focus; $tpl->status = $focus->getStatus(); if ($focus->getStatus() !== false) { $tpl->massToggles = "disabled"; } else { $tpl->massToggles = ""; } $meridiemOptions = array(jTipsHTML::makeOption('am', 'am'), jTipsHTML::makeOption('pm', 'pm')); //get the time from the start_time if (!$focus->start_time) { $focus->start_time = gmdate('Y-m-d H:i:s');
function getNextLogicalRound() { global $database; $round_id = $this->getCurrentRound(); $jRound = new jRound($database); $jRound->load($round_id); if ($jRound->round + 1 >= $this->rounds) { return $this->rounds; } else { return $jRound->round + 1; } }
* */ jTipsSpoofCheck(); global $mosConfig_absolute_path, $database, $jTips, $jTipsCurrentUser, $jLang, $Itemid; require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jcomment.class.php'; require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jgame.class.php'; require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jround.class.php'; require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jseason.class.php'; require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jtip.class.php'; jTipsLogger::_log('about to start saving tips'); //TODO: remove this if (empty($jTipsCurrentUser->id)) { die('No jTips User!'); } $jRound = new jRound($database); $jRound->load(jTipsGetParam($_REQUEST, 'round_id', 0)); // BUG 389 - Can save tips by hacking HTML with Firebug if (!$jRound->id or $jRound->getStatus() !== false) { // trying to post to an invalid round or round in progress jTipsRedirect('index.php?option=com_jtips&Itemid=' . $Itemid, $jLang['_COM_CANNOT_POST_CLOSED']); exit; } $jSeason = new jSeason($database); $jSeason->load($jRound->season_id); $jGame = new jGame($database); $jGameParams = array('round_id' => $jRound->id); $jGames = forceArray($jGame->loadByParams($jGameParams)); $myTips = array(); $isUpdate = null; foreach ($jGames as $jGame) { $game_id = 'game' . $jGame->id;
//Load the current user. //This should be done in the calling script and the jTipsUser object made a global /*$jTipsUser = new jTipsUser($database); $parameters = array( 'season_id' => $jSeason->id, 'user_id' => $id ); $jTipsUser->loadByParams($parameters);*/ $parameters = array(); $jSeasons = forceArray($jSeason->loadByParams($parameters)); for ($i = 0; $i < count($jSeasons); $i++) { if ($jSeasons[$i]->end_time < gmdate('Y-m-d')) { unset($jSeasons[$i]); } } //Load the current round info $jRound = new jRound($database); $rid = jTipsGetParam($_REQUEST, 'rid', false); if (!$rid) { $rid = $jSeason->getCurrentRound(); } $jRound->load($rid); $render->assign('jRound', $jRound); //Load the comment for this round $jComment = new jComment($database); $parameters = array('user_id' => $jTipsCurrentUser->id, 'round_id' => $jRound->id); $jComment->loadByParams($parameters); $render->assign('jComment', $jComment); $render->display(); } //jtips_HTML::jtips_addtips($jTipsUser, $jRound, $jSeason, $jSeasons, $jComment);
function getLast(&$jTipsUser, $field = 'points') { global $database; $jSeason = new jSeason($database); $jSeason->load($jTipsUser->season_id); $jRound = new jRound($database); $jRound->load($jSeason->getLatestRound()); if ($jRound->scored != 1) { $jRound->load($jRound->getPrev()); } //$prev_id = $jRound->getPrev(); //$jRound->load($prev_id); $query = "SELECT `{$field}` FROM #__jtips_history WHERE user_id = " . $jTipsUser->id . " AND round_id = " . $jRound->id . ";"; //jTipsDebug($query); $database->setQuery($query); $res = $database->loadResult(); return is_numeric($res) ? floatval($res) : 0; }
$params = array('order' => array('type' => 'order', 'direction' => $direction, 'by' => $orderby)); //has the season select been used? if ($season_id = jTipsGetParam($_REQUEST, 'season_id', false)) { $params['season_id'] = array('type' => 'join', 'join_table' => '#__jtips_rounds', 'lhs_table' => '#__jtips_comments', 'lhs_key' => 'round_id', 'rhs_table' => '#__jtips_rounds', 'rhs_key' => 'id', 'supplement' => 'AND #__jtips_rounds.season_id = ' . $jComment->_db->Quote($season_id)); } $jComments = forceArray($jComment->loadByParams($params, $limit, $limitstart)); $pageNav = new mosPageNav($jComment->getCount($params), $limitstart, $limit); $data = array(); $i = 0; foreach ($jComments as $comment) { //get the comment poster details $jTipsUser = new jTipsUser($database); $jTipsUser->load($comment->user_id); //Which round is it for $jRound = new jRound($database); $jRound->load($comment->round_id); if (strlen($comment->comment) > 100) { $suffix = '...'; } else { $suffix = ''; } $data[$comment->id] = array(makeListLink(substr(jTipsStripslashes($comment->comment), 0, 100) . $suffix, $i++), $jTipsUser->getUserField('name'), $jTipsUser->getUserField('username'), $comment->getSeasonName(), $jRound->round, TimeDate::toDisplayDateTime($comment->updated)); } $jSeason = new jSeason($database); $jSeasons = forceArray($jSeason->loadByParams()); $options = array(jTipsHTML::makeOption('', $jLang['_ADMIN_USERS_SELECT_SEASON'])); foreach ($jSeasons as $season) { $options[] = jTipsHTML::makeOption($season->id, $season->name); } $filters = array($jLang['_ADMIN_SEASON_SELECT'] => jTipsHTML::selectList($options, 'season_id', "id='season_id' class='inputbox' onChange='this.form.submit();'", 'value', 'text', jTipsGetParam($_REQUEST, 'season_id', ''))); jTipsAdminDisplay::ListView($formData, $header, $data, $pageNav, 'list', $filters, $jLang['_ADMIN_COMMENTS_INFO']);
function getSummaryDetail(&$jTipsUser, $col) { global $database, $jTips, $jLang, $mosConfig_live_site; $Itemid = jTipsGetParam($_REQUEST, 'Itemid', ''); $jSeason = new jSeason($database); $jSeason->load($jTipsUser->season_id); switch ($col) { case 'season': return $jSeason->name; break; case 'rank': $rank = $jTipsUser->getRank(); if (empty($rank)) { return "N/A"; } else { return $rank . " / " . $jTipsUser->getTotalUsers(); } break; case 'score': return $jTipsUser->getTotalScore('points'); break; case 'average': $jRound = new jRound($database); $jRound->load($jSeason->getLastRound()); $round = $jRound->round ? $jRound->round : 1; return round($jTipsUser->getTotalScore('points') / $round, 1); break; case 'precision': return $jTipsUser->getTotalScore('precision'); break; case 'projected': $jRound = new jRound($database); $jRound->load($jSeason->getLatestRound()); $round = $jRound->round ? $jRound->round : 1; $average = $jTipsUser->getTotalScore('points') / $round; return round($average * $jSeason->rounds, 1); break; case 'doubleup': return "<img src='{$mosConfig_live_site}/administrator/images/" . ($jTipsUser->doubleup > 0 ? "publish_x.png' title='" . $jLang['_COM_DASH_ROUND'] . " " . $jTipsUser->doubleup . "'" : "tick.png' />"); break; case 'paid': global $Itemid; if ($jTips['Payments'] == 'paypal' and !$jTipsUser->paid) { $sid = $jSeason->id; if (!$sid) { $sid = getSeasonID(); } return parsePayPalCode($jTips['PayPal'], 'join', $sid); } else { if ($jTips['Payments'] == 'manual' and !$jTipsUser->paid) { return "<img src='{$mosConfig_live_site}/administrator/images/publish_x.png' />"; } else { if ($jTips['Payments'] and $jTipsUser->paid) { $confirm_unsub = 'return confirm("' . $jLang['_COM_UNSUBLINK_PART1'] . ' ' . $jSeason->name . ' ' . $jLang['_COM_UNSUBLINK_PART2'] . '");'; return "<div style='text-align:center;'>\n\t\t\t\t\t\t\t<img src='{$mosConfig_live_site}/administrator/images/tick.png' alt='Paid' border='0' />\n\t\t\t\t\t\t\t<!-- br />\n\t\t\t\t\t\t\t<a href='" . jTipsRoute("index.php?option=com_jtips&Itemid={$Itemid}&view=Dashboard&action=remove&season={$jSeason->id}") . "' onclick='" . $confirm_unsub . "'>" . $jLang['_COM_UNSUBSCRIBE'] . "</a -->\n\t\t\t\t\t\t</div>"; } else { return "-"; } } } /*if ($jTips['Payments'] == 'paypal') { if (!$jTipsUser->paid) { return parsePayPalCode($jTips['PayPal'], 'join', $jSeason->id); } else { $confirm_unsub = 'return confirm("' . $jLang['_COM_UNSUBLINK_PART1'] . ' ' . $jSeason->name . ' ' . $jLang['_COM_UNSUBLINK_PART2'] . '");'; return "<div style='text-align:center;'> <img src='$mosConfig_live_site/administrator/images/tick.png' alt='Paid' border='0' /> <br /> <a href='" .jTipsRoute("index.php?option=com_jtips&Itemid=$Itemid&view=Dashboard&action=remove&season={$jSeason->id}"). "' onclick='" .$confirm_unsub ."'>" .$jLang['_COM_UNSUBSCRIBE']. "</a> </div>"; } } else if ($jTips['Payments'] == 'manual') { return "<img src='$mosConfig_live_site/administrator/images/" .($jTipsUser->paid == 1 ? "tick.png" : "publish_x.png"). "' />"; } else { return "-"; }*/ break; default: return "-"; break; } }
function fillInAdditionalFields() { global $database; $jTipsUser = new jTipsUser($database); $jTipsUser->load($this->user_id); $this->user =& $jTipsUser; $jTeam = new jTeam($database); if ($this->tip_id > 0) { $jTeam->load($this->tip_id); } $this->team =& $jTeam; $jGame = new jGame($database); $jGame->load($this->game_id); $jRound = new jRound($database); $jRound->load($jGame->round_id); $this->round =& $jRound; $this->round_num = $jRound->round; $jSeason = new jSeason($database); $jSeason->load($jRound->season_id); $this->season =& $jSeason; }
* Website: www.jtips.com.au * @author Jeremy Roberts * @copyright Copyright © 2009, jTips * @license Commercial - See website for details * * @since 2.1.10 - 20/05/2009 * @version 1.0.0 * @package jTips * * Description: Marks selected rounds as uncomplete * which then allows editing fully a round. * * // BUG 351 - allow uncompleting a round */ jTipsSpoofCheck(); global $mosConfig_absolute_path, $database, $jLang; require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jround.class.php'; $cid = jTipsGetParam($_REQUEST, 'cid', array()); if ($cid === false or is_array($cid) and count($cid) == 0) { //should never get here mosRedirect('index2.php?option=com_jtips&task=list&module=Rounds', $jLang['_ADMIN_ROUNDS_NONE_TO_PROCESS']); } jTipsLogger::_log('uncompleting rounds'); foreach ($cid as $id) { $jRound = new jRound($database); $jRound->load($id); $jRound->scored = 0; $jRound->save(); } $msg = count($cid) . ' ' . $jLang['_ADMIN_ROUNDS_UNCOMPLETED']; mosRedirect('index2.php?option=com_jtips&module=Rounds&task=list', $msg);
function display() { global $mainframe, $database, $jTips, $jLang, $jLicence, $mosConfig_absolute_path, $mosConfig_live_site, $database; jTipsLogger::_log('Loading dashboard', 'INFO'); jTipsCommonHTML::loadOverlib(); $option = jTipsGetParam($_REQUEST, 'option', 'com_jtips'); if (isJoomla15()) { JToolbarHelper::title($jLang['_ADMIN_DASH_CPANEL'], 'frontpage'); } else { ?> <table class="adminheading" border="0" width="100%"> <tr> <th class="cpanel" align="left"><?php echo $jLang['_ADMIN_DASH_CPANEL']; ?> </th> <td align="right"><a href="http://www.jtips.com.au" target="_blank" title="jTips Home"><img src="<?php echo $mosConfig_live_site; ?> /components/com_jtips/images/license_logo.png" alt="" border="0" /></a></td> </tr> </table> <?php } ?> <table class="adminform"> <tr> <td width="55%" valign="top"> <?php jTipsLogger::_log('Building dashboard icons', 'INFO'); foreach ($this->menu as $item) { if (isset($item['url']) and !empty($item['url'])) { $link = $item['url']; $extra = "target='_blank'"; } else { $link = "index2.php?option={$option}&task=" . $item['task']; $extra = ""; } ?> <div id="cpanel" style="float:left;"> <div class="icon"> <a href="<?php echo $link; ?> " <?php echo $extra; ?> > <img src="components/com_jtips/images/<?php echo $item['image']; ?> " alt="<?php echo $jLang[$item['alt']]; ?> " align="middle" border="0" /><span><?php echo $jLang[$item['link']]; ?> </span></a> </div> </div> <?php } ?> </td> <td width="45%" valign="top"> <div style="width: 100%;"> <?php $tabs = new jTipsTabs(1); $tabs->startPane('dashpanel'); $tabs->startTab($jLang['_ADMIN_DASH_TAB_SUMMARY'], 'summary'); $center = "style='text-align:center;'"; ?> <table class='adminlist'> <thead> <tr> <th><?php echo $jLang['_COM_DASH_SEASON']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_COM_DASH_CURR_ROUND']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_TOTAL_USERS']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_PENDING_TIPS']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_PENDING_PAYMENT']; ?> </th> </tr> </thead> <tbody> <?php jTipsLogger::_log('Loading season data', 'INFO'); $total_user_count = 0; foreach ($this->jSeasons as $jSeason) { if (TimeDate::toDatabaseDate($jSeason->end_time) > gmdate('Y-m-d')) { $round_id = $jSeason->getCurrentRound(); $jRound = new jRound($database); if ($round_id) { $jRound->load($round_id); } $jTipsUsers = $jSeason->getUsers(); $total_users = 0; $no_tips = 0; $has_paid = 0; $no_tips_overlib = ""; foreach ($jTipsUsers as $jTipsUser) { $total_users++; if (!$jTipsUser->hasTipped($jRound->id)) { $no_tips++; if ($no_tips < 10) { $no_tips_overlib .= "<br />" . htmlentities($jTipsUser->getName()); } else { if ($no_tips == 10) { $no_tips_overlib .= "<br />...more"; } } } if ($jTipsUser->paid == 1) { $has_paid++; } } if ($jTips['Payments'] != 0) { $pending_payment = $total_users - $has_paid; } else { $pending_payment = "N/A"; } $no_tips_overlib = substr($no_tips_overlib, 6); if ($no_tips > 0) { $no_tips_overlib_call = jTipsToolTip($no_tips_overlib, "Users Missing Tips"); } else { $no_tips_overlib_call = ''; } ?> <tr> <td><?php echo $jSeason->name; ?> </td> <td <?php echo $center; ?> ><?php echo $jRound->round; ?> </td> <td <?php echo $center; ?> ><?php echo $total_users; ?> </td> <td <?php echo $center; ?> ><?php echo $no_tips . " " . $no_tips_overlib_call; ?> </td> <td <?php echo $center; ?> ><?php echo $pending_payment; ?> </td> </tr> <?php $total_user_count += $total_users; } } ?> </tbody> </table> <?php $tabs->endTab(); $tabs->startTab($jLang['_ADMIN_DASH_TAB_UPDATED'], 'update'); $filesWritable = filesWritable(); ?> <table class="adminlist" width="100%"> <thead> <tr> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_UPG_THISVERSION']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_UPG_LATESTVERSION']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_UPG_UPGRADE']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_UPG_FILE_CHECK']; ?> </th> </tr> </thead> <tbody> <tr> <td <?php echo $center; ?> ><?php echo getFullVersion(); ?> </td> <!-- td <?php echo $center; ?> id="latest_version"><input type="button" onclick="liveCheckLatestVersion('latest_version');" class="button" value="Check Now" <?php if (!$filesWritable) { echo "disabled"; } ?> /></td --> <td <?php echo $center; ?> >N/A</td> <!-- td <?php echo $center; ?> ><span id="liveupdatespan"><?php echo getUpdateButton('', ''); ?> </span></td --> <td <?php echo $center; ?> >N/A</td> <td <?php echo $center; ?> > <?php if ($filesWritable) { $tip = $jLang['_ADMIN_DASH_UPG_FILE_CHECK_OK']; $tipTitle = $jLang['_ADMIN_DASH_UPG_FILE_CHECK_OK_TITLE']; $img = 'checkin.png'; echo jTipsToolTip($tip, $tipTitle, '', $img); } else { $tip = $jLang['_ADMIN_DASH_UPG_FILE_CHECK_FAIL']; $tipTitle = $jLang['_ADMIN_DASH_UPG_FILE_CHECK_FAIL_TITLE']; $img = 'warning.png'; ?> <a href=> <?php echo jTipsToolTip($tip, $tipTitle, '', $img, '', "index2.php?option=com_jtips&module=Upgrade&task=list"); ?> </a> <?php } ?> </td> </tr> <?php if (needsUpgrade()) { ?> <tr> <td colspan="4" id="upgrade_area" <?php echo $center; ?> > <input type="button" class="button" name="upgrade" value="<?php echo $jLang['_ADMIN_UPGRADE_BUTTON']; ?> " onclick="doUpgrade(this);" /> </td> </tr> <?php } ?> </tbody> <thead> <tr> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_LAST_VALIDATED']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_VALIDATION']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_EXPIRY_DATE']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_LICENSE_USER_COUNT']; ?> </th> </tr> </thead> <tbody> <tr> <td <?php echo $center; ?> ><?php $validation_date = $jLicence->getValidationDate(); if ($validation_date == -1) { echo $jLang['_ADMIN_DASH_LIC_EXPIRED']; } else { echo $validation_date; } ?> </td> <td <?php echo $center; ?> ><a href="index2.php?option=com_jtips&task=Validate&module=Dashboard"><?php echo $jLang['_ADMIN_DASH_REVALIDATE']; ?> </a></td> <td <?php echo $center; ?> ><?php echo TimeDate::toDisplayDate($jLicence->licence['license_expiry']); ?> </td> <td <?php echo $center; ?> ><?php echo $jLicence->getActiveUserCount(); ?> / <?php echo $jLicence->getLicensedUsers(); ?> </td> </tr> </tbody> <thead> <tr> <th <?php echo $center; ?> colspan="4"><?php echo $jLang['_ADMIN_DASH_LOGGING']; ?> </th> </tr> </thead> <tbody> <tr> <td nowrap><?php echo $jLang['_ADMIN_DASH_FILE_SIZE']; ?> : <?php echo size_readable(filesize($mosConfig_absolute_path . '/components/com_jtips/jtips.log')); ?> </td> <td <?php echo $center; ?> ><a href="index2.php?option=com_jtips&task=DownloadLog&module=Dashboard"><?php echo $jLang['_ADMIN_DASH_DOWNLOAD']; ?> </a></td> <td <?php echo $center; ?> ><a href="index2.php?option=com_jtips&task=PurgeLog&module=Dashboard"><?php echo $jLang['_ADMIN_DASH_PURGE']; ?> </a></td> <td> </td> </tr> </tbody> <tfoot> <tr> <td colspan="4"><small><em><?php echo $jLang['_ADMIN_DASH_LOG_ROTATED']; ?> </em></small></td> </tr> </tfoot> </table> <?php $tabs->endTab(); $tabs->startTab($jLang['_ADMIN_DASH_TAB_ABOUT'], 'about'); ?> <div style="text-align:center;"><img src="components/com_jtips/images/logo.png" border="0" /> <h1><?php echo getFullVersion(); ?> </h1></div> <p><?php echo $jLang['_ADMIN_DASH_ABOUT_UPDATES']; ?> <a href="http://www.jtips.com.au/" target="_blank">http://www.jtips.com.au</a></p> <p><?php echo $jLang['_ADMIN_DASH_ABOUT_SALES']; ?> <a href="mailto:sales@jtips.com.au?subject=jTips Enquiry">sales@jtips.com.au</a></p> <p><?php echo $jLang['_ADMIN_DASH_ABOUT_SUPPORT']; ?> <a href="http://www.jtips.com.au" target="_blank">jTips.com.au</a></p> <p><?php echo $jLang['_ADMIN_DASH_ABOUT_REBUILD']; ?> <a href="#" onclick="sendRebuildRequest('rebuildProgress');">» <?php echo $jLang['_COMMON_CLICK_HERE']; ?> «</a> <span id="rebuildProgress"></span></p> <?php $tabs->endTab(); $tabs->startTab($jLang['_ADMIN_DASH_TAB_CREDITS'], 'credits'); ?> <p><strong><?php echo $jLang['_ADMIN_DASH_CREDITS']; ?> :</strong></p> <table class="adminlist" width="100%"> <thead> <tr> <th><?php echo $jLang['_ADMIN_DASH_CREDITS_PACKAGE']; ?> </th> <th><?php echo $jLang['_ADMIN_DASH_CREDITS_HOMEPAGE']; ?> </th> </tr> </thead> <tbody> <tr> <td>mootools</td> <td><a href="http://mootools.net/" target="_blank">http://mootools.net</a></td> </tr> <tr> <td>tnimg</td> <td><a href="http://vagh.armdex.com/tnimg" target="_blank">http://vagh.armdex.com/tnimg</a></td> </tr> <tr> <td>cURL</td> <td><a href="http://www.phpclasses.org/browse/package/1988.html" target="_blank">http://www.phpclasses.org</a></td> </tr> <tr> <td>dUnzip2</td> <td><a href="http://www.phpclasses.org/browse/package/2495.html" target="_blank">http://www.phpclasses.org</a></td> </tr> <tr> <td>MOOdalBox</td> <td><a href="http://www.e-magine.ro/web-dev-and-design/36/moodalbox/" target="_blank">http://www.e-magine.ro</a></td> </tr> <tr> <td>Silk Icons</td> <td><a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">http://www.famfamfam.com</a></td> </tr> <tr> <td>datejs</td> <td><a href="http://www.datejs.com/" target="_blank">http://www.datejs.com</a></td> </tr> <tr> <td>strftime in javascript</td> <td><a href="http://tech.bluesmoon.info/2008/04/strftime-in-javascript.html" target="_blank">http://tech.bluesmoon.info/2008/04/strftime-in-javascript.html</a></td> </tr> <tr> <td>Editor Area</td> <td><a href="http://www.cdolivet.net/editarea/" target="_blank">http://www.cdolivet.net/editarea</a></td> </tr> <tr> <td>GNOME Icons</td> <td><a href="http://commons.wikimedia.org/wiki/GNOME_Desktop_icons" target="_blank">http://commons.wikimedia.org/wiki/GNOME_Desktop_icons</a></td> </tr> </tbody> </table> <?php $tabs->endTab(); $tabs->startTab($jLang['_ADMIN_DASH_TAB_HELP'], 'help'); ?> <h2><?php echo $jLang['_ADMIN_DASH_HELP']; ?> </h2> <p><?php echo $jLang['_ADMIN_DASH_HELP_INTRO']; ?> <a href="http://www.jtips.com.au" target="_blank">www.jtips.com.au</a></p> <ul> <li><?php echo $jLang['_ADMIN_DASH_HELP_GETTING_STARTED']; ?> </li> <li><?php echo $jLang['_ADMIN_DASH_HELP_GUIDES']; ?> </li> <li><?php echo $jLang['_ADMIN_DASH_HELP_TRICKS']; ?> </li> </ul> <p>Do you have an invalid license key? Please contact jTips Support at <a href="mailto:support@jtips.com.au">support@jtips.com.au</a> and confirm your license key is valid for the domain <strong><?php echo $_SERVER['SERVER_NAME']; ?> </strong>.</p> <?php $tabs->endTab(); $tabs->endPane(); ?> </div> </td> </tr> </table> <?php }
} $mainframe->addCustomHeadTag("<script type='text/javascript' src='" . $mosConfig_live_site . "/components/com_jtips/views/CompetitionLadder/CompetitionLadder.js'></script>"); $render = new jTipsRenderCompetitionLadder(); global $mainframe, $database, $jTips; $my = $mainframe->getUser(); //$jTipsUser = new jTipsUser($database); $page = jTipsGetParam($_REQUEST, 'page', 0); $round_id = jTipsGetParam($_REQUEST, 'round_id', false); $jSeason = new jSeason($database); $season_id = getSeasonID(); $jSeason->load($season_id); $render->assign('jSeason', $jSeason); //die(getSeasonID()); $jRound = new jRound($database); if ($round_id !== false) { $jRound->load($round_id); } else { //Bug 171 & 172 - getCurrentRound is problematic here - gets currently active round! //$round_id = $jSeason->getCurrentRound(); $round_id = $jSeason->getLastRound(); $jRound->load($round_id); if ($jRound->scored != 1) { $prev_id = $jRound->getPrev(); if ($prev_id !== false) { $jRound->load($prev_id); } } } $render->assign('jRound', $jRound); $jTipsCurrentUserParams = array('season_id' => $jSeason->id, 'status' => 1); $total = $jTipsCurrentUser->getCount($jTipsCurrentUserParams);
function getSeasonName() { global $database; if (!isset($this->season_name)) { $jRound = new jRound($database); $jRound->load($this->round_id); $jSeason = new jSeason($database); $jSeason->load($jRound->season_id); $this->season_name = $jSeason->name; } return $this->season_name; }
function getSummaryScores() { global $database; $season_ids = $this->getSeasons(); $scores = array(); foreach ($season_ids as $season_id) { $jSeason = new jSeason($database); $jSeason->load($season_id); $round_id = $jSeason->getCurrentRound(); $jRound = new jRound($database); $jRound->load($round_id); $last_round_id = $jRound->getPrev(); $jHistory = new jHistory($database); if (is_integer($last_round_id)) { $params = array('user_id' => $this->user_id, 'round_id' => $round_id); $jHistory->loadByParams($params); } $jTipsUser_season = new jTipsUser($database); $params = array('user_id' => $this->user_id, 'season_id' => $season_id); $jTipsUser_season->loadByParams($params); $jRound->load($last_round_id); $total = $jHistory->getTotal($this, 'points'); if (!isset($total)) { $total = 0; } $average = $total / (is_numeric($jRound->round) && $jRound->round > 0 ? $jRound->round : 1); if (!isset($average)) { $average = 0; } $scores[$season_id] = array('total_points' => $total, 'total_precision' => $jHistory->getTotal($this, 'precision'), 'average' => $average, 'doubleup' => $jTipsUser_season->doubleup, 'paid' => $jTipsUser_season->paid); } return $scores; }
function getLastRoundWinners(&$jTipsUser, $season_id = false) { global $database; if ($season_id === false) { $season_ids = $jTipsUser->getSeasons(); } else { $season_ids = array($season_id); } $winners = array(); foreach ($season_ids as $season_id) { $jSeason = new jSeason($database); $jSeason->load($season_id); //$round_id = $jSeason->getLastRound(); if ($this->id) { $jRound = new jRound($database); $jRound->load($this->id); $winners[$season_id] = $jRound->getRoundWinners(); } else { continue; } } //jTipsDebug(count($winners)); return $winners; }
$objParams = array('end_time' => array('type' => 'query', 'query' => "> '{$date}'"), 'left_join' => array('type' => 'left_join', 'join_table' => '#__jtips_users', 'lhs_table' => '#__jtips_seasons', 'lhs_key' => 'id', 'rhs_table' => '#__jtips_users', 'rhs_key' => 'season_id')); if (isset($jTipsUser->user_id) and !empty($jTipsUser->user_id)) { $objParams['#__jtips_users.user_id'] = $jTipsUser->user_id; } $jSeasons = forceArray($jSeason->loadByParams($objParams)); if (count($jSeasons) > 0) { $jSeason =& array_shift($jSeasons); } } $jRound = new jRound($database); $round_id = $jSeason->getCurrentRound(); $jRound->load($round_id); if ($jRound->scored == 0) { $prev_round_id = $jSeason->getLastRound(); $prev_round = new jRound($database); $prev_round->load($prev_round_id); $jRound =& $prev_round; $load_round = $prev_round_id; } else { $load_round = $jRound->id; } $jHistory = new jHistory($database); $jTipsUsers = $jHistory->getLadder($jTips['NumDefault'], $load_round); ?> <table width='100%' cellspacing="0"> <thead> <tr class='sectiontableheader jtableheader'> <th>#</th> <th><?php echo $jLang['_COM_TIP_LADDER_USER']; ?>
//Do we have an existing Season? $id = array_shift($ids); if (is_numeric($id)) { $jComment->load($id); } if (!$jComment->exists()) { mosRedirect('index2.php?option=com_jtips&task=list&module=Comments', $jLang['_ADMIN_COMMENT_LOAD_ERROR']); } $jTipsUser = new jTipsUser($database); $jTipsUser->load($jComment->user_id); $title = $jLang['_ADMIN_DASH_COMMENT_MANAGER'] . ": " . $jLang['_ADMIN_OTHER_EDIT']; $mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/Comments/Comments.js'></script>"); //what seasons are there $jSeason = new jSeason($database); $jSeasons = forceArray($jSeason->loadByParams(array())); $jSeasonOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE'])); jTipsSortArrayObjects($jSeasons, 'name', 'ASC'); foreach ($jSeasons as $season) { $jSeasonOptions[] = jTipsHTML::makeOption($season->id, $season->name); } //which season is this in? $jRound = new jRound($database); $jRound->load($jComment->round_id); $jRounds = forceArray($jRound->loadByParams(array('season_id' => $jRound->season_id))); $jRoundOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE'])); jTipsSortArrayObjects($jSeasons, 'name', 'ASC'); foreach ($jRounds as $round) { $jRoundOptions[] = jTipsHTML::makeOption($round->id, $round->round); } $formData = array('basic' => array('legend' => '_ADMIN_COMM_EDIT_COMMENT', 'fields' => array('id' => array('field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'id', 'id' => 'id', 'value' => $jComment->id))), 'orig_round_id' => array('field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'orig_round_id', 'id' => 'orig_round_id', 'value' => $jComment->round_id))), 'user_id' => array('label' => '_COM_DASH_USER', 'field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'user_id', 'id' => 'user_id', 'value' => $jComment->user_id))), 'user' => array('label' => '_COM_DASH_USER', 'field' => array('type' => 'label', 'attributes' => array('type' => 'label', 'value' => $jTipsUser->getUserField('name') . " (" . $jTipsUser->getUserField('username') . ")"))), 'season_id' => array('label' => '_ADMIN_ROUND_SEASON', 'field' => array('type' => 'select', 'attributes' => array('name' => 'season_id', 'id' => 'season_id', 'class' => 'inputbox', 'onChange' => 'getTheRounds(this);'), 'options' => $jSeasonOptions, 'selected' => $jRound->season_id)), 'round_id' => array('label' => '_ADMIN_ROUND_ROUND', 'field' => array('type' => 'select', 'attributes' => array('name' => 'round_id', 'id' => 'round_id', 'class' => 'inputbox'), 'options' => $jRoundOptions, 'selected' => $jComment->round_id)), 'comment' => array('label' => '_ADMIN_COMM_EDIT_COMMENT', 'field' => array('type' => 'text', 'attributes' => array('size' => 50, 'name' => 'comment', 'id' => 'comment', 'class' => 'inputbox', 'type' => 'text', 'value' => jTipsStripslashes(htmlentities($jComment->comment, ENT_QUOTES))))), 'updatedlabel' => array('label' => '_COM_TIPS_LASTUP', 'field' => array('type' => 'label', 'attributes' => array('type' => 'label', 'value' => TimeDate::toDisplayDateTime($jComment->updated))), 'description' => '_ADMIN_COMMENTS_UDPATED_DESCRIPTION')))); jTipsAdminDisplay::EditView($title, $formData, 'comments');