jTipsLogger::_log('MENU TASK: ' . $task); //$Itemid = jTipsGetParam($_REQUEST, 'Itemid', $Itemid); //Itemid is a global! if (!isJoomla15()) { $dateFormat = '%Y-%m-%d'; } else { $dateFormat = $jTips['DateFormat']; } $mainframe->addCustomHeadTag("<script type='text/javascript'>var jTipsLiveSite = '{$mosConfig_live_site}';var Offset = " . TimeDate::getOffset(false) . ";var DateFormat = '" . $dateFormat . "';</script>"); $jSeason = new jSeason($database); $season_id = getSeasonID(); $jSeason->load($season_id); $season_link = ''; //"&season=" .$jSeason->id; $render->assign('jSeason', $jSeason); $render->assign('season_link', $season_link); $render->assign('adminUrl', "view=Administration&Itemid={$Itemid}&season=" . getSeasonID()); /* * TODO: BUG: XXX - the admin scripts were not loaded if the scorer was not part of a competition */ $my =& $mainframe->getUser(); if ($jSeason->scorer_id == $my->id) { //$mainframe->addCustomHeadTag('<script type="text/javascript" src="' .$mosConfig_live_site. '/components/com_jtips/views/Administration/Administration.js"></script>'); //$mainframe->addCustomHeadTag('<script type="text/javascript" src="' .$mosConfig_live_site. '/administrator/components/com_jtips/lib/date.js"></script>'); jTipsCommonHTML::loadCalendar(); } $render->displayPreferencesLink(); if (!isset($jTips['Menu']) or empty($jTips['Menu'])) { $jTips['Menu'] = array(); } if (array_key_exists($view, $jTips['Menu'])) { $classes = array('Dashboard' => array('class' => "sectiontableentry2 jmain_menu", 'cursor' => "cursor:pointer;cursor:hand;", 'onevent' => "onClick='window.location.href=\"" . jTipsRoute("index.php?option=com_jtips&Itemid={$Itemid}&view=Dashboard{$season_link}") . "\"'; onmouseover='this.className=\"sectiontableentry1 jmain_menu_hover\"' onmouseout='this.className=\"sectiontableentry2 jmain_menu\"'"), 'CompetitionLadder' => array('class' => "sectiontableentry2 jmain_menu", 'cursor' => "cursor:pointer;cursor:hand;", 'onevent' => "onClick='window.location.href=\"" . jTipsRoute("index.php?option=com_jtips&Itemid={$Itemid}&view=CompetitionLadder{$season_link}") . "\"' onmouseover='this.className=\"sectiontableentry1 jmain_menu_hover\"' onmouseout='this.className=\"sectiontableentry2 jmain_menu\"'"), 'TeamLadder' => array('class' => "sectiontableentry2 jmain_menu", 'cursor' => "cursor:pointer;cursor:hand;", 'onevent' => "onClick='window.location.href=\"" . jTipsRoute("index.php?option=com_jtips&Itemid={$Itemid}&view=TeamLadder{$season_link}") . "\"' onmouseover='this.className=\"sectiontableentry1 jmain_menu_hover\"' onmouseout='this.className=\"sectiontableentry2 jmain_menu\"'"));
require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jseason.class.php'; if ($params->get('load_mootools')) { $mainframe->addCustomHeadTag("<script type='text/javascript' src='" . $mosConfig_live_site . "/components/com_jtips/js/mootools.js'></script>"); } /* * quick check to make the xml file the right one so it appears * properly in the list of modules */ if (isJoomla15() and jTipsFileExists(dirname(__FILE__) . '/installer.xml')) { jimport('joomla.filesystem.file'); $data = JFile::read(dirname(__FILE__) . '/installer.xml'); JFile::write(dirname(__FILE__) . '/mod_jtips_dash_comp_ladder.xml', $data); JFile::delete(dirname(__FILE__) . '/installer.xml'); } $jSeason = new jSeason($database); $season_id = getSeasonID(); if (is_numeric($season_id)) { $jSeason->load($season_id); } else { $date = gmdate('Y-m-d'); //Bug 33.4 - Extended params array to default to season for current user $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);
<?php if (!defined('_JEXEC') and !defined('_VALID_MOS')) { die('Restricted Access'); } /** * Author: Jeremy Roberts * Package: jTicket * Website: www.jtips.com.au * Created: 30/09/2008 * * Description: Saves the User Preferences */ global $database, $Itemid; $jTipsUsers = new jTipsUser($database); $jTipsUserParams = array('user_id' => jTipsGetParam($_REQUEST, 'id', 0)); $jTipsUserArr = forceArray($jTipsUsers->loadByParams($jTipsUserParams)); foreach ($jTipsUserArr as $jTipsUser) { $jTipsUser->setPreference('default_season', jTipsGetParam($_REQUEST, 'default_season', -1)); $jTipsUser->setPreference('timezone', jTipsGetParam($_REQUEST, 'timezone', null)); $jTipsUser->setPreference('email_reminder', jTipsGetParam($_REQUEST, 'email_reminder', '0')); $jTipsUser->setPreference('tips_notifications', jTipsGetParam($_REQUEST, 'tips_notifications', '0')); } $return_view = jTipsGetParam($_REQUEST, 'return', 'Dashboard'); if (!$return_view) { $return_view = 'Dashboard'; } jTipsRedirect('index.php?option=com_jtips&view=' . jTipsGetParam($_REQUEST, 'return', 'Dashboard') . '&Itemid=' . $Itemid . '&season=' . getSeasonID());
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; } }
} $include_file = $mosConfig_absolute_path . "/components/com_jtips/views/" . $view . "/" . jTipsGetParam($_REQUEST, 'action', 'build') . ".php"; jTipsLogger::_log("looking for module file at: " . $include_file, 'INFO'); //BUG 289 - check if we are running the MailMan if (basename($_SERVER['SCRIPT_FILENAME']) == 'index2.php' and (jTipsGetParam($_REQUEST, 'action', '') == 'MailMan' or jTipsGetParam($_REQUEST, 'rid', false))) { $bypassSeasonCheck = true; } else { $bypassSeasonCheck = false; } if (jTipsFileExists($include_file) and (getSeasonID() or $bypassSeasonCheck)) { jTipsLogger::_log('Executing script ' . jTipsGetParam($_REQUEST, 'action', 'build'), 'INFO'); include $include_file; } else { switch ($task) { default: jTipsLogger::_log('fell through all possible cases in jtips.php for view = ' . $view . '; action=' . jTipsGetParam($_REQUEST, 'action') . '; task=' . $task . ' and season_id=' . getSeasonID(), 'ERROR'); echo "<span class='error'>View or Competition not found! Aborting routine.</span>"; break; } } //////////////////////////////// /// BUG 77 - IE Incompatibility /// Moved the moodalbox script after DOM has loaded if (!isJoomla15()) { echo "<script src='" . $mosConfig_live_site . "/components/com_jtips/js/moodalbox.js' type='text/javascript'></script>"; } /// END BUG 77 /////////////////////////////// //lets show the logo at all times! if (jTipsGetParam($_REQUEST, 'menu', 1)) { jtips_HTML::licence();
function display() { ob_get_contents(); global $database, $mainframe, $jTips, $jLang, $jTipsCurrentUser, $Itemid, $mosConfig_live_site; $send_email = $jTipsCurrentUser->getPreference('email_reminder'); if (empty($send_email)) { $send_email = '0'; } $tips_notifications = $jTipsCurrentUser->getPreference('tips_notifications'); if (empty($tips_notifications)) { $tips_notifications = '0'; } $postURL = jTipsRoute("index.php?option=com_jtips&Itemid=" . $Itemid); $width = $jTips['ShowTipsWidth'] - 40; ?> <style type="text/css"> @import url(<?php echo $mosConfig_live_site; ?> /components/com_jtips/css/jtips-default.css); @import url(<?php echo $mosConfig_live_site; ?> /components/com_jtips/css/jtips-popup.css); </style> <div style="padding-top:10px;padding-left:10px;padding-right:10px;padding-bottom:10px;width:<?php echo $width; ?> px;text-align:center;"> <form action="<?php echo $postURL; ?> " name="adminForm" method="post" id="adminForm"> <input type="hidden" name="option" value="<?php echo jTipsGetParam($_REQUEST, 'option', 'com_jtips'); ?> " /> <input type="hidden" name="view" value="UserPreferences" /> <input type="hidden" name="action" value="save" /> <input type="hidden" name="task" value="save" /> <input type="hidden" name="return" value="<?php echo jTipsGetParam($_REQUEST, 'return', ''); ?> " /> <input type="hidden" name="season" value="<?php echo getSeasonID(); ?> " /> <input type="hidden" name="user" value="<?php echo $jTipsCurrentUser->id; ?> " /> <input type="hidden" name="id" value="<?php echo $jTipsCurrentUser->user_id; ?> " /> <h1 class="contentheading"><?php echo $jLang['_COM_USER_PREFERENCES']; ?> </h1> <table width="100%" border="0" cellspacing="5" cellpadding="0" style="margin-top:25px;"> <tbody> <tr> <th align="right"><?php echo $jLang['_COM_TIME_ZONE']; ?> </th> <td><?php echo makeSelectList($this->timezones, 'timezone', "class='inputbox'", $this->timezone); ?> </td> </tr> <?php if (isset($jTips['EnableEmailReminders']) and $jTips['EnableEmailReminders'] == 1) { ?> <tr> <th align="right"><?php echo $jLang['_COM_SEND_REMINDER_EMAIL']; ?> </th> <td><?php echo jTipsHTML::yesnoRadioList('email_reminder', '', $send_email); ?> </td> </tr> <?php } ?> <?php if (isset($jTips['TipsNotifyEnable']) and $jTips['TipsNotifyEnable'] == 1) { ?> <tr> <th align="right"><?php echo $jLang['_ADMIN_CONF_NOTIFY_TIPS']; ?> </th> <td><?php echo jTipsHTML::yesnoRadioList('tips_notifications', '', $tips_notifications); ?> </td> </tr> <?php } ?> </tbody> <tfoot> <tr> <td style="text-align:center;" colspan="2"><input type="submit" name="submit_preferences" value=" <?php echo $jLang['_COM_SAVE']; ?> " class="button" onClick="window.top.setTimeout('window.parent.document.getElementById(\'sbox-window\').close()', 700);" /></td> </tr> </tfoot> </table> </form> </div> <?php }
require_once $include_path . 'classes/jteam.class.php'; require_once $include_path . 'classes/jgame.class.php'; include $include_path . 'config.jtips.php'; /* * quick check to make the xml file the right one so it appears * properly in the list of modules */ if (isJoomla15() and jTipsFileExists(dirname(__FILE__) . '/installer.xml')) { jimport('joomla.filesystem.file'); $data = JFile::read(dirname(__FILE__) . '/installer.xml'); JFile::write(dirname(__FILE__) . '/mod_jtips_dash_teams.xml', $data); JFile::delete(dirname(__FILE__) . '/installer.xml'); } //Get the season $jSeason = new jSeason($database); $jSeason->load(getSeasonID()); if (isset($jSeason->id) and !empty($jSeason->id)) { //parse info here $fieldOptions = array('-1' => '--None--', 'points' => 'Points', 'wins' => 'Wins', 'played' => 'Played', 'points_for' => 'GF', 'points_against' => 'GA'); ?> <table width="100%" border="0" id="mod_jtips_team_table" cellspacing="0"> <thead> <tr class="sectiontableheader jtableheader"> <th>#</th> <th><?php echo $jLang['_COM_TLD_TEAM']; ?> </th> <?php if ($team_field != '-1') { ?>