Example #1
0
 /**
  * Get HTML to display the current team logo
  * 
  * @param [int] The size of the logo to display. Defaults to 25px
  * 
  * @return string The HTML img code
  */
 function getLogo($size = 25)
 {
     global $mainframe, $mosConfig_live_site;
     $logo_text = '';
     if (!empty($this->logo) and jTipsFileExists(getJtipsImage($this->logo, $size))) {
         $logo_text = "<img src='" . $mosConfig_live_site;
         $logo_text .= "/" . getJtipsImage($this->logo, $size) . "' alt='" . $this->getName() . "' border='0' align='absmiddle' />";
     }
     return $logo_text;
 }
 * 
 * 
 */
global $database, $jTips, $jLang, $mosConfig_live_site, $jTipsCurrentUser, $mosConfig_absolute_path;
require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/utils/functions.inc.php';
require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jhistory.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';
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;
Example #3
0
defined('_JEXEC') or defined('_VALID_MOS') or die('Restricted Access');
/**
 * Website: www.jtips.com.au
 * @author Jeremy Roberts
 * @copyright Copyright &copy; 2009, jTips
 * @license Commercial - See website for details
 * 
 * @since 2.1 - 08/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: Allow file upload and import of data
 */
global $mosConfig_absolute_path, $mainframe;
require_once 'components/com_jtips/modules/Import/list.tmpl.php';
$mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/Import/Import.js'></script>");
$tpl = new ListMode();
$file = $mosConfig_absolute_path . '/administrator/components/com_jtips/import.csv';
$tpl->importExists = jTipsFileExists($file);
$objects = array('' => $jLang['_ADMIN_CONF_NONE'], 'jBadWord' => $jLang['_ADMIN_EXP_BADWORDS'], 'jGame' => $jLang['_ADMIN_EXP_GAMES'], 'jRound' => $jLang['_ADMIN_EXP_ROUNDS'], 'jTeam' => $jLang['_ADMIN_EXP_TEAMS'], 'jSeason' => $jLang['_ADMIN_EXP_SEASONS']);
$objectsOptions = array();
foreach ($objects as $key => $val) {
    $objectsOptions[] = jTipsHTML::makeOption($key, $val);
}
$tpl->selectLists['objects'] = jTipsHTML::selectList($objectsOptions, 'importObject', "id='importObject' class='inputbox' onchange='getOptions(this);'", 'value', 'text');
$tpl->noneOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']));
$tpl->headers = fetchImportRow();
$tpl->row1Data = fetchImportRow(1);
$tpl->row2Data = fetchImportRow(2);
$tpl->opts = '';
$tpl->display();
Example #4
0
defined('_JEXEC') or defined('_VALID_MOS') or die('Restricted Access');
/**
 * Author: Jeremy Roberts
 * Package: jTicket
 * Website: www.jtips.com.au
 * Created: 30/09/2008
 * 
 * Description: 
 * 
 * 
 */
global $database, $mainframe, $mosConfig_absolute_path, $jTipsCurrentUser;
require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jround.class.php';
require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jteam.class.php';
if (jTipsFileExists($mosConfig_absolute_path . '/components/com_jtips/custom/views/TeamLadder/ShowTeamRender.ext.php')) {
    require_once $mosConfig_absolute_path . '/components/com_jtips/custom/views/TeamLadder/ShowTeamRender.ext.php';
} else {
    require_once $mosConfig_absolute_path . '/components/com_jtips/views/TeamLadder/ShowTeamRender.php';
}
if (!isJoomla15()) {
    //Trash anything we have so far
    ob_clean();
    ob_start();
}
$render = new jTipsRenderShowTeam();
$id = jTipsGetParam($_REQUEST, 'id', '');
$jTeam = new jTeam($database);
$jTeam->load($id);
$render->assign('jTeam', $jTeam);
$jSeason = new jSeason($database);
Example #5
0
 * to the jLang array and writes the array to
 * the language file.
 *
 * Allows complete language customisation
 */
global $mainframe, $jLang, $mosConfig_lang, $mosConfig_absolute_path;
//Make sure this is not a hack job
jTipsSpoofCheck();
//set the edited field
$key = jTipsGetParam($_REQUEST, 'languageKey', '');
$val = jTipsHTML::cleanText(jTipsGetParam($_REQUEST, 'languageVar', ''));
$jLang[$key] = trim($val);
ksort($jLang);
if (writeArrayToFile('jLang', $jLang, 'components/com_jtips/i18n/' . $mosConfig_lang . '.php')) {
    //BUG 265 - delete the existing js language file if it exists
    // BUG 320 - Fixed typo in path to js language file
    $jsLangFile = $mosConfig_absolute_path . '/components/com_jtips/js/language.js';
    if (jTipsFileExists($jsLangFile)) {
        if (isJoomla15()) {
            jimport('joomla.filesystem.file');
            JFile::delete($jsLangFile);
        } else {
            unlink($jsLangFile);
        }
    }
    $message = $jLang['_ADMIN_LANGUAGE_UPDATED'];
} else {
    $message = $jLang['_ADMIN_LANGUAGE_UPDATE_FAILED'];
}
//redirect to list
mosRedirect('index2.php?option=com_jtips&module=Language&task=list', $message);
Example #6
0
defined('_JEXEC') or defined('_VALID_MOS') or die('Restricted Access');
/**
 * Author: Jeremy Roberts
 * Package: jTicket
 * Website: www.jtips.com.au
 * Created: 29/09/2008
 *
 * Description:
 *
 *
 */
global $database, $mainframe, $mosConfig_absolute_path, $jTipsCurrentUser, $mosConfig_live_site;
require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jseason.class.php';
require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jteam.class.php';
if (jTipsFileExists($mosConfig_absolute_path . '/components/com_jtips/custom/views/TeamLadder/tmpl/default.ext.php')) {
    require_once $mosConfig_absolute_path . '/components/com_jtips/custom/views/TeamLadder/tmpl/default.ext.php';
} else {
    require_once $mosConfig_absolute_path . '/components/com_jtips/views/TeamLadder/tmpl/default.php';
}
if (isJoomla15()) {
    JHTML::_('behavior.modal');
}
$render = new jTipsRenderTeamLadder();
$season_id = getSeasonID();
$jSeason = new jSeason($database);
$jSeason->load($season_id);
$render->assign('jSeason', $jSeason);
$jTeams = $jSeason->getTeamLadder('points');
$render->assign('jTeams', $jTeams);
$jSeasonParams = array('end_time' => array('type' => 'query', 'query' => "> '" . gmdate('Y-m-d') . "'"), 'start_time' => array('type' => 'query', 'query' => "< '" . gmdate('Y-m-d') . "'"));
Example #7
0
<?php

/**
 * Author: Jeremy Roberts
 * Company: jTips
 * Website: www.jtips.com.au
 * Licence: Commercial. May not be copied, modified or redistributed
 */
defined('_JEXEC') or defined('_VALID_MOS') or die('Restricted access');
//require_once( $mainframe->getPath( 'toolbar_html' ));
$include_file = "components/com_jtips/modules/" . jTipsGetParam($_REQUEST, 'module', '') . "/toolbar.php";
jTipsLogger::_log("looking for toolbar file: {$include_file}", 'INFO');
if (jTipsFileExists($include_file)) {
    jTipsLogger::_log("found {$include_file}... running script");
    include $include_file;
} else {
    jTipsLogger::_log('failed to find toolbar file!', 'ERROR');
}
Example #8
0
<?php

defined('_JEXEC') or defined('_VALID_MOS') or die('Restricted Access');
global $mosConfig_absolute_path, $database, $my, $jTips, $Itemid, $mosConfig_live_site;
if (is_null($mosConfig_absolute_path)) {
    $mosConfig_absolute_path = JPATH_SITE;
}
require_once 'administrator/components/com_jtips/utils/logger.php';
require_once 'administrator/components/com_jtips/utils/compat.php';
require_once 'administrator/components/com_jtips/utils/functions.inc.php';
require_once 'administrator/components/com_jtips/utils/timedate.php';
require_once 'administrator/components/com_jtips/classes/juser.class.php';
require_once 'administrator/components/com_jtips/classes/jseason.class.php';
require_once 'administrator/components/com_jtips/classes/jgame.class.php';
require_once 'administrator/components/com_jtips/classes/jteam.class.php';
if (jTipsFileExists('administrator/components/com_jtips/config.jtips.php')) {
    include 'administrator/components/com_jtips/config.jtips.php';
}
if (!isJoomla15()) {
    if ($params->get('load_mootools')) {
        ?>
		<script type="text/javascript" src="<?php 
        echo $mosConfig_live_site;
        ?>
/components/com_jtips/js/mootools.js"></script>
		<?php 
    }
    ?>
	<script type="text/javascript" src="<?php 
    echo $mosConfig_live_site;
    ?>
Example #9
0
 function process()
 {
     global $database, $jTips, $mosConfig_absolute_path;
     $this->clearHistory();
     $params = array('round_id' => $this->id);
     $jSeason = new jSeason($database);
     $jSeason->load($this->season_id);
     $jGame = new jGame($database);
     $jGames = forceArray($jGame->loadByParams($params));
     $params = array('season_id' => $this->season_id);
     $jTipsUser = new jTipsUser($database);
     $jTipsUsers = forceArray($jTipsUser->loadByParams($params));
     $noTips = $scores = $worst_precision = array();
     $played = count($jGames);
     foreach ($jTipsUsers as $jTipsUser) {
         jTipsLogger::_log("Processing scores for user " . $jTipsUser->id);
         $score = $matching = $precision = $allAwayScore = 0;
         if ($jTipsUser->hasTipped($this->id)) {
             jTipsLogger::_log($jTipsUser->id . " has tipped in round " . $this->id);
             foreach ($jGames as $jGame) {
                 jTipsLogger::_log("Processing game " . $jGame->id);
                 $params = array('user_id' => $jTipsUser->id, 'game_id' => $jGame->id);
                 $jTip = new jTip($database);
                 $jTip->loadByParams($params);
                 // make sure this is not a bye game
                 if (!$jGame->home_id or !$jGame->away_id or !$jGame->winner_id) {
                     jTipsLogger::_log('attempting to process tips on a bye game, skipping', 'INFO');
                     continue;
                 }
                 /*
                  * Feature Request 101 - Team Starts
                  * Determine the winner when we take the starts into account
                  * We only care about the starts for picking the winner/draw
                  * For picking the margins and scores, use the actual winner
                  */
                 if ($jSeason->team_starts) {
                     jTipsLogger::_log('processing team starts');
                     $homeScore = $awayScore = 0;
                     $homeScore = $jGame->home_score + ($jGame->home_start + 0);
                     $awayScore = $jGame->away_score + ($jGame->away_start + 0);
                     if ($homeScore > $awayScore) {
                         $winnerID = $jGame->home_id;
                     } else {
                         if ($homeScore < $awayScore) {
                             $winnerID = $jGame->away_id;
                         } else {
                             if ($homeScore == $awayScore) {
                                 $winnerID = -1;
                             }
                         }
                     }
                     jTipsLogger::_log('feature 101: With starts, the winner is ' . $winnerID . ', otherwise the winner is ' . $jGame->winner_id . " HOME {$homeScore} v AWAY {$awayScore}");
                 } else {
                     $winnerID = $jGame->winner_id;
                 }
                 if ($jTip->tip_id == $winnerID) {
                     //User tipped right!
                     jTipsLogger::_log("CORRECT TIP by " . $jTipsUser->id . " in round_id " . $this->id . " in game_id " . $jGame->id);
                     //BUG 248 - Add ToughScore if enabled
                     if ($jSeason->tough_score and $jGame->tough_score) {
                         $score += $jGame->tough_score;
                     }
                     if ($winnerID == -1) {
                         $score += isset($jSeason->user_draw) ? $jSeason->user_draw : 0;
                         jTipsLogger::_log("Draw correctly picked!");
                     } else {
                         $score += isset($jSeason->user_correct) ? $jSeason->user_correct : 0;
                     }
                     $matching++;
                 }
                 if ($winnerID == $jGame->away_id) {
                     $allAwayScore += $jSeason->user_correct;
                 }
                 //Check for correct margins and handle precision score gathering
                 if ($jSeason->pick_margin == 1 and $jGame->has_margin == 1) {
                     $margin = abs($jGame->home_score - $jGame->away_score);
                     if ($jTip->margin == $margin) {
                         $score += isset($jSeason->user_pick_margin) ? $jSeason->user_pick_margin : 0;
                         jTipsLogger::_log("correct margin picked!");
                     }
                     if ($jSeason->precision_score == 1) {
                         if ($jGame->winner_id == $jTip->tip_id) {
                             $margin_offset = abs($margin - $jTip->margin);
                         } else {
                             $margin_offset = abs($margin + $jTip->margin);
                         }
                         if (isset($worst_precision[$jGame->id]) && $margin_offset > $worst_precision[$jGame->id] || empty($worst_precision[$jGame->id])) {
                             $worst_precision[$jGame->id] = $margin_offset;
                         }
                         $precision += $margin_offset;
                         jTipsLogger::_log("PICK_MARGIN: Adding {$margin_offset} to precision of {$precision}");
                     }
                 }
                 //Check for correct scores and handle precision score gathering
                 if ($jSeason->pick_score == 1 and $jGame->has_score == 1) {
                     $margin = abs($jGame->home_score - $jGame->away_score);
                     if ($jTip->home_score == $jGame->home_score and $jTip->away_score == $jGame->away_score) {
                         $score += isset($jSeason->user_pick_score) ? $jSeason->user_pick_score : 0;
                         jTipsLogger::_log("Correct scores picked!");
                     }
                     if ($jSeason->precision_score == 1) {
                         $pickedScoreMargin = abs($jTip->home_score - $jTips->away_score);
                         if ($jGame->winner_id == $jTip->tip_id) {
                             $score_offset = abs($margin - $pickedScoreMargin);
                         } else {
                             $score_offset = abs($margin + $pickedScoreMargin);
                         }
                         if (isset($worst_precision[$jGame->id]) and $score_offset > $worst_precision[$jGame->id] or empty($worst_precision[$jGame->id])) {
                             $worst_precision[$jGame->id] = $score_offset;
                         }
                         $precision += $score_offset;
                         jTipsLogger::_log("PICK_SCORE: Adding {$score_offset} to precision of {$precision}");
                         jTipsLogger::_log("PREC DEBUG: {$jTipsUser->id}-{$jTipsUser->user_id} Picked Margin: {$pickedScoreMargin}. Actual Margin: {$margin}. Applied Precision: {$score_offset}. Running Precision: {$precision}", 'INFO');
                     }
                 }
                 //Check for a bonus team selection
                 if ($jSeason->pick_bonus >= 1 and $jGame->has_bonus == 1) {
                     if ($jTip->bonus_id == $jGame->bonus_id && $jGame->bonus_id != -1) {
                         $score += isset($jSeason->user_pick_bonus) ? $jSeason->user_pick_bonus : 0;
                     }
                 }
             }
             //was a perfect round picked?
             if ($matching == $played) {
                 $score += isset($jSeason->user_bonus) ? $jSeason->user_bonus : 0;
             }
             //did the user use their 'doubleup'
             if ($jTipsUser->doubleup == $this->id and $jTips['DoubleUp'] == 1) {
                 $score = $score * 2;
             }
             $scores[] = $score;
             //Save the data to the history object
             $jHistory = new jHistory($database);
             $jHistory->user_id = $jTipsUser->id;
             $jHistory->round_id = $this->id;
             jTipsLogger::_log("Score for user_id " . $jTipsUser->id . " in round_id " . $this->id . " is {$score}");
             $jHistory->points = $score;
             //Update rank after all users have been saved
             $jHistory->outof = count($jTipsUsers);
             //$jHistory->comment	= $jTipsUser->comment;
             if ($jSeason->precision_score == 1) {
                 jTipsLogger::_log("setting precision to {$precision} for user_id " . $jTipsUser->id . " in round_id " . $this->id);
                 $jHistory->precision = $precision;
             } else {
                 $jHistory->precision = 0;
             }
             if ($jHistory->save() !== false) {
                 $results[] = 1;
             } else {
                 jTipsLogger::_log("Error saving history: " . $jHistory->_error);
                 $results[] = 0;
             }
             //remove the current comment
             $jTipsUser->comment = null;
             $jTipsUser->save();
             // Check if the AlphaUserPoints config option is set
             if (isJoomla15()) {
                 $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
             } else {
                 $api_AUP = $mosConfig_absolute_path . 'components/com_alphauserpoints/helper.php';
             }
             if (!$this->scored and $jTips['AlphaUserPoints'] and jTipsFileExists($api_AUP)) {
                 require_once $api_AUP;
                 jTipsLogger::_log('sending ' . $score . ' points for user ' . $jTipsUser->user_id, 'INFO');
                 $refID = AlphaUserPointsHelper::getAnyUserReferreID($jTipsUser->user_id);
                 AlphaUserPointsHelper::newpoints('plgaup_jtips_total_points', $refID, '', '', $score);
             }
             if (!$this->scored and $jTips['JomSocialActivities'] and $jTips['JomSocialUserResults']) {
                 global $mosConfig_absolute_path;
                 require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/utils/jTipsJomSocial.php';
                 jTipsJomSocial::writeRoundResult($jSeason, $this, $jTipsUser->user_id, $score);
             }
         } else {
             $noTips[] = $jTipsUser;
         }
     }
     if (count($noTips) > 0) {
         /////////////////////////////////////////////////
         // Feature Request 71
         // Allow users that did not to be assigned
         // all the away teams
         //
         /*if ($jSeason->user_none != -1) {
         		$thisRound = $jSeason->user_none;
         		} else if (is_array($scores) && count($scores) > 0) {
         		$thisRound = min($scores);
         		} else {
         		$thisRound = 0;
         		}*/
         if ($jSeason->user_none == -2) {
             //handle all away teams
             $thisRound = $allAwayScore;
             jTipsLogger::_log("didn't tip? You'll be stuck with the away teams. You got {$thisRound}");
         } else {
             if ($jSeason->user_none == -1) {
                 //handle lowest possible score
                 if (is_array($scores) and count($scores) > 0) {
                     $thisRound = min($scores);
                     jTipsLogger::_log("didn't tip? You'll be stuck with the lowest score this round, {$thisRound}");
                 } else {
                     $thisRound = 0;
                     jTipsLogger::_log("didn't tip? You'll be stuck {$thisRound}");
                 }
             } else {
                 //handle allocated score
                 $thisRound = $jSeason->user_none;
                 jTipsLogger::_log("didn't tip? You're getting {$thisRound}");
             }
         }
         //
         // END Feature Request 71
         ////////////////////////////////////////////////////
         foreach ($noTips as $jTipsUser) {
             $jHistory = new jHistory($database);
             $jHistory->user_id = $jTipsUser->id;
             $jHistory->round_id = $this->id;
             $jHistory->points = $thisRound;
             $jHistory->precision = array_sum($worst_precision);
             //$jHistory->outof		= count($jTipsUsers);
             //$jHistory->comment	= $jTipsUser->comment;
             if ($jHistory->save() !== false) {
                 $results[] = 1;
             } else {
                 $results[] = 0;
             }
             $jTipsUser->save();
             // Check if the AlphaUserPoints config option is set
             if (isJoomla15()) {
                 $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
             } else {
                 $api_AUP = $mosConfig_absolute_path . 'components/com_alphauserpoints/helper.php';
             }
             if (!$this->scored and $jTips['AlphaUserPoints'] and jTipsFileExists($api_AUP)) {
                 require_once $api_AUP;
                 jTipsLogger::_log('sending ' . $score . ' points for user ' . $jTipsUser->user_id, 'INFO');
                 $refID = AlphaUserPointsHelper::getAnyUserReferreID($jTipsUser->user_id);
                 AlphaUserPointsHelper::newpoints('plgaup_jtips_total_points', $refID, '', '', $thisRound);
             }
             if (!$this->scored and $jTips['JomSocialActivities']) {
                 global $mosConfig_absolute_path;
                 require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/utils/jTipsJomSocial.php';
                 if ($jTips['JomSocialUserResults']) {
                     jTipsJomSocial::writeRoundResult($jSeason, $this, $jTipsUser->user_id, $score);
                 }
                 if ($jTips['JomSocialOnNoTips']) {
                     jTipsJomSocial::writeOnNoTips($jTipsUser->user_id, $jSeason, $this);
                 }
             }
         }
     }
     $jHistory = new jHistory($database);
     $jHistory->setRanks($this->id, true);
     if (!$this->scored and $jTips['JomSocialActivities']) {
         // find out who won the round and write it to the JomSocial stream
         $winners = $this->getRoundWinners();
         jTipsJomSocial::writeRoundWinners($winners, $this, $jSeason);
     }
     $this->scored = 1;
     $result = $this->save();
     //if ($this->scored != 1) {
     jTeam::updateLadder($this, $jSeason);
     //}
     //$this->scored = 1;
     //return $this->save();
     return $result;
 }
Example #10
0
    function display()
    {
        global $jTipsCurrentUser, $database, $mainframe, $mosConfig_absolute_path, $jLang, $jTips, $mosConfig_live_site;
        $width = $jTips['ShowTipsWidth'] - 40;
        ?>
		<style type="text/css">
		@import url(<?php 
        echo $mosConfig_live_site;
        ?>
/templates/<?php 
        echo jTipsGetTemplateName();
        ?>
/css/template.css);
		@import url(<?php 
        echo $mosConfig_live_site;
        ?>
/components/com_jtips/css/jtips-popup.css);
		</style>
		<?php 
        if ($jTips['ShowTipsPadding']) {
            ?>
			<div style="float:left;padding-top:10px;padding-left:10px;padding-right:10px;padding-bottom:10px;width:<?php 
            echo $width;
            ?>
px;text-align:center;">
			<?php 
        }
        if (!empty($this->jTeam->url)) {
            ?>
			<div style="float:right;">
				<a href="<?php 
            echo $this->jTeam->url;
            ?>
" target="_blank"><img src="images/M_images/weblink.png" align="absmiddle" border="0" alt="<?php 
            echo $jLang['_COM_TEAM_HOME_PAGE'];
            ?>
" title="<?php 
            echo $this->jTeam->url;
            ?>
" /></a>
				&nbsp;<a href="<?php 
            echo $this->jTeam->url;
            ?>
" target="_blank"><?php 
            echo preg_replace('/.*[^\\/]:\\/+/i', '', $this->jTeam->url);
            ?>
</a>
			</div>
			<?php 
        }
        ?>
		<h1 align="left"><?php 
        echo $this->jTeam->getName();
        ?>
</h1>
		<?php 
        $img = '';
        if (!empty($this->jTeam->logo) and jTipsFileExists($mosConfig_absolute_path . '/' . getJtipsImage($this->jTeam->logo, 100))) {
            $path = getJtipsImage($this->jTeam->logo, 100);
            $name = $this->jTeam->getName();
            $img = "<img src='{$mosConfig_live_site}/{$path}' align='left' border='1' style='margin-right:10px;margin-bottom:10px;' alt='{$name}' />";
        }
        $about = $img . jTipsStripslashes($this->jTeam->about);
        if (!empty($about)) {
            ?>
		        <p style="padding-top:5px;" align="left">
		        <?php 
            echo $about;
            ?>
		        </p>
		        <?php 
        }
        ?>
		<div style="clear:both;">&nbsp;</div>
		<h2 align="center" class="contentheading"><?php 
        echo $jLang['_COM_TEAM_HISTORY'];
        ?>
</h2>
		<table width="100%" border="0" cellspacing="0">
		<thead>
		<tr class="sectiontableheader">
		<th><?php 
        echo $jLang['_COM_DASH_ROUND'];
        ?>
</th>
		<th><?php 
        echo $jLang['_ADMIN_ROUND_DATE'];
        ?>
</th>
		<th><?php 
        echo $jLang['_COM_TEAM_VS'];
        ?>
</th>
		<th><?php 
        echo $jLang['_ADMIN_TEAM_LOCATION'];
        ?>
</th>
		<th><?php 
        echo $jLang['_COM_SCORE'];
        ?>
</th>
		<th><?php 
        echo $jLang['_COM_TIPS_RESULT'];
        ?>
</th>
		</tr>
		</thead>
		<tbody>
		<?php 
        $rowIndex = 0;
        $history = $this->jTeam->getHistory();
        foreach ($history as $game) {
            $other = new jTeam($database);
            if ($this->jTeam->id == $game->home_id) {
                $other->load($game->away_id);
                $location = $jLang['_COM_TEAM_HOME'];
            } else {
                $other->load($game->home_id);
                $location = $jLang['_COM_TEAM_AWAY'];
            }
            $isBye = false;
            if (!$other->id) {
                $isBye = true;
            }
            if ($game->winner_id == $this->jTeam->id) {
                $result = 'tick';
                $alt = $jLang['_COM_TEAM_WIN'];
            } else {
                if ($game->winner_id == '-1') {
                    $result = 'draw';
                    $alt = $jLang['_COM_TEAM_DRAW'];
                } else {
                    $result = 'cross';
                    $alt = $jLang['_COM_TEAM_LOSS'];
                }
            }
            $date = TimeDate::toDisplayDate($game->start_time, true, false);
            $live_site = $mainframe->getCfg('live_site');
            if (strrpos($live_site, '/') == strlen($live_site) - 1) {
                $live_site = substr($live_site, 0, -1);
            }
            $thisRowIndex = $rowIndex++;
            ?>
			<tr class="sectiontableentry<?php 
            echo $thisRowIndex % 2 + 1;
            ?>
 jtablerow<?php 
            echo $thisRowIndex % 2 + 1;
            ?>
">
			<td align="center"><?php 
            echo $game->round;
            ?>
.</td>
			<td align="left"><?php 
            echo $date;
            ?>
</td>
			<td align="left"><?php 
            echo $isBye ? '<em>' . $jLang['_COM_BYE'] . '</em>' : $other->getDisplayLogoName();
            ?>
</td>
			<td align="center"><?php 
            echo $isBye ? '&nbsp;' : $location;
            ?>
</td>
			<td align="center"><?php 
            echo $isBye ? '&nbsp;' : $game->home_score . ' - ' . $game->away_score;
            ?>
</td>
			<td align="center"><img src="<?php 
            echo $mosConfig_live_site;
            ?>
/components/com_jtips/images/<?php 
            echo $result;
            ?>
.png" alt="<?php 
            echo $alt;
            ?>
" title="<?php 
            echo $alt;
            ?>
" border="0" /></td>
			</tr>
			<?php 
        }
        ?>
		</tbody>
		</table>
		<?php 
        if ($jTips['ShowTipsPadding']) {
            echo "</div>";
        }
    }
Example #11
0
/**
 * Load the language file into the language variable
 *
 * @since 2.1.9
 * @param string The name of the language to load
 * @return array The populated language array
 */
function loadLanguage($language = false)
{
    global $jLang, $mosConfig_absolute_path, $mosConfig_lang;
    if (!empty($jLang)) {
        return $jLang;
    }
    if (!$language) {
        $language = $mosConfig_lang;
    }
    include $mosConfig_absolute_path . '/administrator/components/com_jtips/i18n/master.php';
    if (jTipsFileExists($mosConfig_absolute_path . '/administrator/components/com_jtips/i18n/' . $language . '.php')) {
        $masterLanguage = $jLang;
        include $mosConfig_absolute_path . '/administrator/components/com_jtips/i18n/' . $language . '.php';
        // BUG 333 - merge the master lanuage array with the edited one
        $jLang = array_merge($masterLanguage, $jLang);
    }
    return $jLang;
}
Example #12
0
    $view = 'Dashboard';
}
//set a default, just in case
//Show the menu!
if (jTipsFileExists($mosConfig_absolute_path . '/components/com_jtips/views/Menu/build.php') and jTipsGetParam($_REQUEST, 'menu', 1) and getSeasonID()) {
    include $mosConfig_absolute_path . '/components/com_jtips/views/Menu/build.php';
}
$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>";
Example #13
0
function getLastUpdateCheckDate()
{
    global $mosConfig_absolute_path;
    $auto = $mosConfig_absolute_path . '/administrator/components/com_jtips/auto';
    if (!jTipsFileExists($auto)) {
        return gmdate('1970-01-01 00:00:00');
    }
    if (isJoomla15()) {
        jimport('joomla.filesystem.file');
        return JFile::read($auto);
    } else {
        return file_get_contents($auto);
    }
}
Example #14
0
 * @copyright Copyright &copy; 2009, jTips
 * @license Commercial - See website for details
 * 
 * @since 2.1 - 08/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: Download or delete a previously exported file
 */
jTipsSpoofCheck();
global $mosConfig_absolute_path;
$file = jTipsGetParam($_REQUEST, 'export_history', null);
$action = jTipsGetParam($_REQUEST, 'expAction', 'download');
$path = $mosConfig_absolute_path . '/administrator/components/com_jtips/exports/';
$filename = $path . $file;
if (!jTipsFileExists($filename)) {
    mosRedirect('index2.php?option=com_jtips&task=list&module=Export', 'File not found');
}
$message = '';
if ($action == 'download') {
    ob_end_clean();
    header("Pragma: public");
    // required
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Cache-Control: private", false);
    // required for certain browsers
    header('Content-Description: File Transfer');
    header('Content-Type: application/vnd.ms-excel');
    header("Content-Disposition: inline; filename=\"" . basename($filename) . "\";");
    header("Content-Transfer-Encoding: binary");
Example #15
0
        ?>
">
			<td align="right"><?php 
        echo $i;
        ?>
.</td>
			<td align="left">
			<?php 
        //			if ($incimage and isset($jTeam->logo) and !empty($jTeam->logo)) {
        //				if (jTipsFileExists(getJtipsImage($jTeam->logo))) {
        //					$img = "<img src='" .$mainframe->getCfg('live_site');
        //					$img .= "/" .getJtipsImage($jTeam->logo). "' alt=' ' border='0' align='absmiddle' />&nbsp;";
        //					echo $img;
        //				}
        //			}
        if ($params->get('incimage') and !empty($jTeam->logo) and jTipsFileExists(getJtipsImage($jTeam->logo))) {
            echo $jTeam->getLogo() . "&nbsp;";
        }
        global $Itemid;
        $popupUrl = "view=TeamLadder&action=ShowTeam&id=" . $jTeam->id . "&Itemid=" . $Itemid;
        if (isJoomla15()) {
            $x = $jTips['ShowTipsWidth'];
            $y = $jTips['ShowTipsHeight'];
            echo "<a class='modal' rel=\"{handler: 'iframe', size: {x: {$x}, y: {$y}}}\" href='" . jTipsRoute($mosConfig_live_site . "/index2.php?option=com_jtips&{$popupUrl}&menu=0") . "'>" . $jTeam->getName() . "</a>";
        } else {
            echo "<a href='javascript:void(0);' onClick='openPopup(\"{$popupUrl}\", \"" . $jTeam->getName() . "\");'>" . $jTeam->getName() . "</a>";
        }
        ?>
</td>
			<?php 
        if ($team_field != '-1') {
Example #16
0
<?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: Build and render the Preferences form
 */
global $mosConfig_absolute_path;
require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jseason.class.php';
if (jTipsFileExists($mosConfig_absolute_path . '/components/com_jtips/custom/views/UserPreferences/tmpl/default.ext.php')) {
    require_once $mosConfig_absolute_path . '/components/com_jtips/custom/views/UserPreferences/tmpl/default.ext.php';
} else {
    require_once $mosConfig_absolute_path . '/components/com_jtips/views/UserPreferences/tmpl/default.php';
}
//Trash anything we have so far
//ob_clean();
//ob_start();
$render = new jTipsRenderUserPreferences();
/*
$timezones = timezone_abbreviations_list();
$tzlist = array();
foreach ($timezones as $area => $tzone) {
	foreach ($tzone as $tz) {
		$offset = round($tz['offset'] / (60 * 60), 1);
		if (isset($tz['dst']) and $tz['dst'] != 0) {