コード例 #1
0
ファイル: jtips.html.php プロジェクト: joomux/jTips
    /**
     * Display the page title and set the document title based on parameters
     * // BUG 349 - support for Page Title menu item parameter option
     *
     * @since 2.1.10
     */
    function title()
    {
        global $mainframe, $jTips;
        $view = jTipsGetParam($_REQUEST, 'view', 'Dashboard');
        $default_title = jTipsGetParam($jTips['Menu'], $view, 'jTips');
        if (isJoomla15()) {
            $document =& JFactory::getDocument();
            $params =& $mainframe->getParams();
            // Page Title
            $menus =& JSite::getMenu();
            $menu = $menus->getActive();
            if (is_object($menu)) {
                $menu_params = new JParameter($menu->params);
                if (!$menu_params->get('page_title')) {
                    $params->set('page_title', JText::_($default_title));
                }
            } else {
                $params->set('page_title', JText::_($default_title));
            }
            $document->setTitle($params->get('page_title'));
            if ($params->def('show_page_title', 0)) {
                ?>
				<div class="componentheading<?php 
                echo $params->get('pageclass_sfx');
                ?>
">
					<?php 
                echo html_entity_decode(stripslashes($params->get('page_title')));
                ?>
				</div>
				<?php 
            }
        } else {
            $mainframe->setPageTitle($default_title);
            if (!empty($jTips['Title'])) {
                ?>
<h1 class='componentheading jmain_heading'><?php 
                echo $jTips['Title'];
                ?>
</h1>
				<?php 
            }
        }
    }
コード例 #2
0
ファイル: CheckComment.php プロジェクト: joomux/jTips
/**
 * Website: www.jtips.com.au
 * @author Jeremy Roberts
 * @copyright Copyright &copy; 2009, jTips
 * @license Commercial - See website for details
 * 
 * @since 2.1 - 16/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: 
 */
global $database, $mosConfig_absolute_path;
ob_clean();
require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jbadword.class.php';
$comment = jTipsGetParam($_REQUEST, 'comment', '');
$jBad = new jBadWord($database);
$badwords = forceArray($jBad->loadByParams(array()));
$count = $deleted = $replaced = 0;
$results = array();
foreach ($badwords as $jBadWord) {
    $search = '/' . $jBadWord->badword . '/' . ($jBadWord->match_case == 1 ? 'i' : '');
    $found = preg_match_all($search, $comment, $matches);
    if ($found > 0) {
        $count++;
        $found = $found + $jBadWord->hits;
        $jBadWord->hits = $found;
        if ($jBadWord->action == 'delete') {
            $deleted++;
            array_push($results, 0);
        } else {
コード例 #3
0
ファイル: GetSeasonObject.php プロジェクト: joomux/jTips
/**
 * Website: www.jtips.com.au
 * @author Jeremy Roberts
 * @copyright Copyright &copy; 2009, jTips
 * @license Commercial - See website for details
 * 
 * @since 2.1 - 09/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: 
 */
global $database;
if (!class_exists('jSeason')) {
    require_once 'components/com_jtips/classes/jseason.class.php';
}
ob_clean();
$season_id = jTipsGetParam($_REQUEST, 'season_id', false);
if (!$season_id) {
    die(@json_encode(new stdClass()));
}
$jSeason = new jSeason($database);
$jSeason->load($season_id);
//$season = json_encode($jSeason);
foreach ($jSeason as $key => $val) {
    if (!property_exists($jSeason, $key) or substr($key, 0, 1) == '_') {
        unset($jSeason->{$key});
    }
}
//suppress errors for unsupported types
die(@json_encode($jSeason));
コード例 #4
0
ファイル: edit.php プロジェクト: joomux/jTips
 * @license Commercial - See website for details
 * 
 * @since 2.1 - 01/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: Load an existing team, or prepare a new one.
 * Load the form fields and prepare for editing
 */
//This breaks the shortcuts on the dashboard
//jTipsSpoofCheck();
global $database;
require_once 'components/com_jtips/classes/jseason.class.php';
require_once 'components/com_jtips/classes/jteam.class.php';
$jTeam = new jTeam($database);
$ids = jTipsGetParam($_REQUEST, 'cid', array());
//Do we have an existing Season?
$id = array_shift($ids);
if (is_numeric($id)) {
    $jTeam->load($id);
}
//set the page title
$title = $jLang['_ADMIN_TEAM_TITLE'] . ": " . ($jTeam->exists() ? $jLang['_ADMIN_OTHER_EDIT'] : $jLang['_ADMIN_OTHER_NEW']);
//set the custom javascripts
$mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/Teams/Teams.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) {
コード例 #5
0
ファイル: LoadGames.php プロジェクト: joomux/jTips
<?php

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 - 07/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: Load a JSON encoded string of game objects for the passed in round
 */
//Can't do this here since this script is loaded with ajax
//jTipsSpoofCheck();
global $database;
require_once 'components/com_jtips/classes/jgame.class.php';
ob_clean();
//ob_start();
if ($round_id = jTipsGetParam($_REQUEST, 'round_id', false)) {
    $jGame = new jGame($database);
    $params = array('round_id' => $round_id, 'order' => array('type' => 'order', 'by' => 'position', 'direction' => 'asc'));
    $jGames = forceArray($jGame->loadByParams($params));
    die(@json_encode($jGames));
} else {
    die(json_encode(false));
}
コード例 #6
0
ファイル: ToggleBoolean.php プロジェクト: joomux/jTips
 * Website: www.jtips.com.au
 * @author Jeremy Roberts
 * @copyright Copyright &copy; 2009, jTips
 * @license Commercial - See website for details
 * 
 * @since 2.1 - 16/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: 
 */
global $database;
ob_clean();
require_once 'components/com_jtips/classes/juser.class.php';
$user_id = jTipsGetParam($_REQUEST, 'user_id', '');
$field = jTipsGetParam($_REQUEST, 'field', '');
$jTipsUser = new jTipsUser($database);
$jTipsUser->load($user_id);
$jTipsUser->{$field} = intval(!$jTipsUser->{$field});
$jTipsUser->save();
if ($jTipsUser->{$field}) {
    if ($field == 'status') {
        //send notification email
        $jTipsUser->sendNotificationEmail('Approval');
    }
    die('tick');
} else {
    if ($field == 'status') {
        //send notification email
        $jTipsUser->sendNotificationEmail('Reject');
    }
コード例 #7
0
ファイル: default.php プロジェクト: joomux/jTips
    /**
     * Take data assigned in $data and display it
     */
    function display()
    {
        global $jTipsCurrentUser, $mainframe, $database, $jLang, $jTips, $mosConfig_live_site;
        $mosConfig_offset = $mainframe->getCfg('offset');
        //$Itemid = jTipsGetParam($_REQUEST, 'Itemid', '');
        global $Itemid;
        //$mainframe->setPageTitle(getComponentName($Itemid).' > '.$jTips['Menu']['Tips']);
        //jTipsCommonHTML::loadOverlib();
        $useJs = false;
        if ($jTips['JsLadder'] != 'none') {
            $useJs = true;
        }
        if ($jTips['EnableComments'] == 1 and $jTips['EnableCommentFilter'] == 1) {
            $checkComment = "onclick='return validateComment(\"comment\");'";
        } else {
            $checkComment = "onClick='document.tips_form.submit();'";
        }
        //jtips_HTML::buildMenu('tips', $this->jSeason, $this->jTipsUser);
        //jtips_HTML::seasonsList($this->jTipsUser, $this->jSeasons, "onchange='getSeason(this);'", true, jTipsGetParam($_REQUEST, 'season', jTipsGetParam($_REQUEST, 'season_id', false)));
        $postURL = jTipsRoute("index.php?option=com_jtips&Itemid={$Itemid}");
        ?>
		<script type='text/javascript'>
		function getSeason(obj) {
			var id = obj.options[obj.selectedIndex].value;
			return window.location.href='<?php 
        echo html_entity_decode(jTipsRoute("index.php?option=com_jtips&Itemid={$Itemid}&task=Tips&season="));
        ?>
' + id;
		}
		</script>
		<form action='<?php 
        echo $postURL;
        ?>
' method='post' name='tips_form' id='tips_form'>
		<input type='hidden' name='option' value='com_jtips' />
		<input type='hidden' name='view' value='Tips' />
		<input type="hidden" name="action" value="save" />
		<input type='hidden' name='user_id' value='<?php 
        echo $jTipsCurrentUser->id;
        ?>
' />
		<input type="hidden" name="<?php 
        echo jTipsSpoofValue();
        ?>
" value="1" />
		<h2 class="contentheading jmain_heading"><?php 
        echo $this->jSeason->name;
        ?>
</h2>
		<h3 align="center">
		<?php 
        if ($this->jRound->getPrev()) {
            ?>
			<a style="font-size:smaller;" href='<?php 
            echo jTipsRoute("index.php?option=com_jtips&amp;Itemid={$Itemid}&amp;view=Tips&amp;rid=" . $this->jRound->getPrev());
            ?>
'>&laquo; <?php 
            echo $jLang['_COM_PREV_ROUND'];
            ?>
</a>
			<?php 
        }
        echo "&nbsp;" . $jLang['_COM_DASH_ROUND'] . " " . $this->jRound->round . "&nbsp;";
        if ($this->jRound->getNext()) {
            ?>
			<a  style="font-size:smaller;" href='<?php 
            echo jTipsRoute("index.php?option=com_jtips&amp;Itemid={$Itemid}&amp;view=Tips&amp;rid=" . $this->jRound->getNext());
            ?>
'><?php 
            echo $jLang['_COM_NEXT_ROUND'];
            ?>
 &raquo;</a>
			<?php 
        }
        ?>
		</h3>
		<?php 
        if ($this->jRound->exists()) {
            $jGameParams = array('round_id' => $this->jRound->id, 'order' => array('type' => 'order', 'by' => 'position', 'direction' => 'ASC'));
            $jGame = new jGame($database);
            $jGames = forceArray($jGame->loadByParams($jGameParams));
            $tags = "class='sectiontableheader jtableheader'";
            ?>
			<table width="100%" cellspacing="0">
			<thead>
				<tr class="sectiontableheader">
				<th <?php 
            echo $tags;
            ?>
 width="33%"><?php 
            echo $jLang['_COM_TIPS_TIPPING_CLOSE'];
            ?>
</th>
			<?php 
            if ($jTips['ShowJSCountdown'] == 1) {
                ?>
				<th <?php 
                echo $tags;
                ?>
 width="34%"><?php 
                echo $jLang['_COM_TIPS_TIME_TO_CLOSE'];
                ?>
</th>
				<?php 
            }
            ?>
				<th <?php 
            echo $tags;
            ?>
 width="33%"><?php 
            echo $jLang['_COM_TIPS_LASTUP'];
            ?>
</th>
				</tr>
			</thead>
			<tbody>
				<tr class="sectiontableentry1">
				<td style="text-align:center;">
				<?php 
            //BUG 136 - show closed/closes depending on start time
            echo TimeDate::toDisplayDateTime($this->jRound->start_time, false);
            ?>
</td>
				<?php 
            if ($jTips['ShowJSCountdown'] == 1) {
                ?>
				<td><div id='countdown' style="text-align:center;" class="highlight"><?php 
                echo $jLang['_COM_CLOSED'];
                ?>
</div></td>
			<?php 
            }
            $jTipParams = array('game_id' => array('type' => 'reference', 'query' => "SELECT DISTINCT id FROM #__jtips_games WHERE round_id = " . $this->jRound->id), 'user_id' => $jTipsCurrentUser->id);
            $jTip = new jTip($database);
            $jTipss = forceArray($jTip->loadByParams($jTipParams));
            ?>
<td><?php 
            if (count($jTipss) > 0) {
                echo TimeDate::toDisplayDateTime($jTipss[0]->updated, false);
            } else {
                echo "&nbsp;";
            }
            ?>
			</td>
			</tr>
			</tbody>
			</table>
			<?php 
            if (jTipsGetParam($jTips, 'TeamLadderPopup', 0)) {
                $url = "view=TeamLadder&Itemid={$Itemid}&menu=0";
                ?>
<p style="text-align:center;font-weight:bold;"><?php 
                if (isJoomla15()) {
                    /*?>
                    		<a class="modal" rel="{handler: 'iframe', size: {x: <?php echo $jTips['ShowTipsWidth']; ?>, y: <?php echo $jTips['ShowTipsHeight']; ?>}}" href="<?php echo jTipsRoute("index2.php?option=com_jtips&" .$url); ?>" title='Team Ladder'><?php echo $jLang['_COM_TIPS_SHOWHIDE']; ?></a>
                    		<?php*/
                    // better popup handling in J1.5
                    JHTML::_('behavior.modal');
                    $rel = json_encode(array('size' => array('x' => $jTips['ShowTipsWidth'], 'y' => $jTips['ShowTipsHeight'])));
                    $url = jTipsRoute("index.php?option=com_jtips&tmpl=component&" . $url);
                    $attribs = array('class' => 'modal', 'rel' => str_replace('"', "'", $rel), 'title' => $jLang['_COM_TIPS_SHOWHIDE']);
                    echo JHTML::link($url, $jLang['_COM_TIPS_SHOWHIDE'], $attribs);
                } else {
                    ?>
					<a href='javascript:void(0);' onClick="openPopup('<?php 
                    echo $url;
                    ?>
', 'Team Ladder');"><?php 
                    echo $jLang['_COM_TIPS_SHOWHIDE'];
                    ?>
</a>
					<?php 
                }
                ?>
</p><?php 
            }
            //BUG 189 - Which order should the tips panel be shown in
            if ($this->jSeason->tips_layout == 'away') {
                $left = 'away';
                $right = 'home';
            } else {
                $left = 'home';
                $right = 'away';
            }
            ?>
			<table align='center' width='100%' class="jdatatable" cellspacing="0">
				<tr>
					<th <?php 
            echo $tags;
            ?>
><?php 
            echo $jLang['_COM_GAME_' . strtoupper($left)];
            ?>
</th>
			<?php 
            if ($this->jSeason->team_starts) {
                ?>
                <th <?php 
                echo $tags;
                ?>
><?php 
                echo $jLang['_COM_TIPS_' . strtoupper($left) . 'START'];
                ?>
</th>
                <?php 
            }
            if ($this->jSeason->pick_score == 1) {
                ?>
					<th <?php 
                echo $tags;
                ?>
><?php 
                echo $jLang['_COM_TIPS_' . strtoupper($left) . 'SCORE'];
                ?>
</th>
				<?php 
            }
            ?>
					<th <?php 
            echo $tags;
            ?>
>
					<?php 
            if ($this->jSeason->pick_draw == 1 and ($this->jSeason->pick_score and !$jTips['HideTeamSelect'] or !$this->jSeason->pick_score)) {
                echo "&nbsp;" . $jLang['_COM_GAME_DRAW'] . "&nbsp;";
            } else {
                echo "&nbsp;";
            }
            ?>
</th>
			<?php 
            if ($this->jSeason->pick_score == 1) {
                ?>
					<th <?php 
                echo $tags;
                ?>
><?php 
                echo $jLang['_COM_TIPS_' . strtoupper($right) . 'SCORE'];
                ?>
</th>
				<?php 
            }
            if ($this->jSeason->team_starts) {
                ?>
                <th <?php 
                echo $tags;
                ?>
><?php 
                echo $jLang['_COM_TIPS_' . strtoupper($right) . 'START'];
                ?>
</th>
                <?php 
            }
            ?>
					<th <?php 
            echo $tags;
            ?>
><?php 
            echo $jLang['_COM_GAME_' . strtoupper($right)];
            ?>
</th>
			<?php 
            if ($this->jSeason->pick_margin == 1) {
                ?>
					<th <?php 
                echo $tags;
                ?>
><?php 
                echo $jLang['_COM_TIPS_MARGIN'];
                ?>
</th>
				<?php 
            }
            if ($this->jSeason->pick_bonus >= 1) {
                ?>
					<th <?php 
                echo $tags;
                ?>
><?php 
                echo $jLang['_COM_TIPS_BONUS'];
                ?>
</th>
				<?php 
            }
            if ($this->jSeason->game_times) {
                ?>
					<th <?php 
                echo $tags;
                ?>
><?php 
                echo $jLang['_COM_TIPS_TIME'];
                ?>
</th>
				<?php 
            }
            if ($this->jRound->scored == 1) {
                ?>
					<th <?php 
                echo $tags;
                ?>
><?php 
                echo $jLang['_COM_TIPS_RESULT'];
                ?>
</th>
				<?php 
            }
            ?>
				<th <?php 
            echo $tags;
            ?>
>&nbsp;</th>
				</tr>
			<?php 
            // BUG 316 - have TimeDate::toDatabaseDateTime around jRound->start_time was deducting an offset from a GMT time - bad
            if ($this->jRound->start_time < gmdate('Y-m-d H:i:s') or $jTipsCurrentUser->hasTipped($this->jRound->id) and $jTips['TipLockout'] == 1) {
                $disabled = "disabled";
            } else {
                $disabled = '';
            }
            $hasTipped = count($jTipss) > 0;
            $rowIndex = 0;
            foreach ($jGames as $jGame) {
                $leftTeam = new jTeam($database);
                $rightTeam = new jTeam($database);
                $jTipParams = array('user_id' => $jTipsCurrentUser->id, 'game_id' => $jGame->id);
                $jTip->loadByParams($jTipParams);
                $left_id_field = $left . '_id';
                $right_id_field = $right . '_id';
                $leftLoaded = $rightLoaded = false;
                if ($jGame->{$left_id_field}) {
                    $leftTeam->load($jGame->{$left_id_field});
                    $leftLoaded = true;
                }
                if ($jGame->{$right_id_field}) {
                    $rightTeam->load($jGame->{$right_id_field});
                    $rightLoaded = true;
                }
                if (!$leftLoaded and $rightLoaded) {
                    $this->byes[] = $rightTeam;
                }
                if ($leftLoaded and !$rightLoaded) {
                    $this->byes[] = $leftTeam;
                }
                if (!$leftLoaded or !$rightLoaded) {
                    continue;
                }
                if ($jGame->winner_id == $leftTeam->id) {
                    $left_style = "font-weight:bold;";
                    $right_style = "";
                } else {
                    if ($jGame->winner_id == -1) {
                        $left_style = "font-style:italics;";
                        $right_style = "font-style:italics;";
                    } else {
                        if ($jGame->winner_id == $rightTeam->id) {
                            $left_style = "";
                            $right_style = "font-weight:bold;";
                        } else {
                            $left_style = "";
                            $right_style = "";
                        }
                    }
                }
                $rowClasses = "class='sectiontableentry" . ($rowIndex % 2 + 1) . " jtablerow" . ($rowIndex % 2 + 1) . "'";
                if ($this->jSeason->pick_score and $jGame->has_score) {
                    $onClick = 'onClick="switchScore(' . $jGame->id . ');"';
                } else {
                    $onClick = '';
                }
                ?>
				<tr <?php 
                echo $rowClasses;
                ?>
>
					<td style='text-align:right;<?php 
                echo $left_style;
                ?>
'><label for="<?php 
                echo $left;
                ?>
_game<?php 
                echo $jGame->id;
                ?>
"><?php 
                echo $leftTeam->getDisplayLogoName('right');
                ?>
</label>&nbsp;
						<?php 
                if ($this->jSeason->pick_score and !$jTips['HideTeamSelect'] or !$this->jSeason->pick_score) {
                    ?>
							<input type='radio' <?php 
                    echo $onClick;
                    ?>
 class="inputbox" name='game<?php 
                    echo $jGame->id;
                    ?>
' id='<?php 
                    echo $left;
                    ?>
_game<?php 
                    echo $jGame->id;
                    ?>
' value='<?php 
                    echo $leftTeam->id;
                    ?>
' <?php 
                    echo $jTip->tip_id == $leftTeam->id ? 'checked="checked"' : '';
                    ?>
 <?php 
                    echo $disabled;
                    ?>
 />
							<?php 
                }
                ?>
					</td>
					<?php 
                if ($this->jSeason->team_starts) {
                    $left_start_field = $left . '_start';
                    $leftStart = $jGame->{$left_start_field} + 0;
                    if ($jGame->{$left_start_field} > 0) {
                        $leftStart = "+{$leftStart}";
                    } else {
                        if ($leftStart == 0) {
                            $leftStart = "&nbsp;";
                        }
                    }
                    ?>
                        <td style='text-align:center;'><?php 
                    echo $leftStart;
                    ?>
</td>
                        <?php 
                }
                if ($this->jSeason->pick_score == 1) {
                    ?>
						<td style='text-align:center;'>
						<?php 
                    if ($jGame->has_score == 1) {
                        ?>
							<input type='text' onKeyUp="this.value=this.value.replace(/[^\d]+/, '');" class="inputbox" id="<?php 
                        echo $left . $jGame->id;
                        ?>
" name='<?php 
                        echo $left . $jGame->id;
                        ?>
' style='text-align:center;' maxLength='5' size='5' value='<?php 
                        $left_score_field = $left . '_score';
                        echo $jTip->{$left_score_field};
                        ?>
' <?php 
                        echo $disabled;
                        ?>
 onBlur="setSelectedTeam(<?php 
                        echo $jGame->id;
                        ?>
);" />
							<?php 
                    } else {
                        ?>
&nbsp;<?php 
                    }
                    ?>
						</td>
						<?php 
                }
                if ($this->jSeason->pick_draw == 1 and ($this->jSeason->pick_score and !$jTips['HideTeamSelect'] or !$this->jSeason->pick_score)) {
                    ?>
						<td style='text-align:center;'>&nbsp;<input class="inputbox" type='radio' name='game<?php 
                    echo $jGame->id;
                    ?>
' id="draw_game<?php 
                    echo $jGame->id;
                    ?>
" value='-1' <?php 
                    echo $jTip->tip_id == -1 ? 'checked="checked"' : '';
                    ?>
 <?php 
                    echo $disabled;
                    ?>
 <?php 
                    echo $onClick;
                    ?>
/></td>
						<?php 
                } else {
                    ?>
						<td style='text-align:center;'>&nbsp;<?php 
                    echo $jLang['_COM_TEAM_VS'];
                    ?>
&nbsp;</td>
						<?php 
                }
                if ($this->jSeason->pick_score == 1) {
                    ?>
						<td style='text-align:center;'>
						<?php 
                    if ($jGame->has_score == 1) {
                        ?>
							<input type='text' onKeyUp="this.value=this.value.replace(/[^\d]+/, '');" class="inputbox" id="<?php 
                        echo $right . $jGame->id;
                        ?>
" name='<?php 
                        echo $right . $jGame->id;
                        ?>
' style='text-align:center;' maxLength='5' size='5' value='<?php 
                        $right_score_field = $right . '_score';
                        echo $jTip->{$right_score_field};
                        ?>
' <?php 
                        echo $disabled;
                        ?>
 onBlur="setSelectedTeam(<?php 
                        echo $jGame->id;
                        ?>
);" />
							<?php 
                    } else {
                        ?>
&nbsp;<?php 
                    }
                    ?>
						</td>
						<?php 
                }
                $right_start_field = $right . '_start';
                if ($this->jSeason->team_starts) {
                    $rightStart = $jGame->{$right_start_field} + 0;
                    if ($jGame->{$right_start_field} > 0) {
                        $rightStart = "+{$rightStart}";
                    } else {
                        if ($rightStart == 0) {
                            $rightStart = "&nbsp;";
                        }
                    }
                    ?>
                        <td style='text-align:center;'><?php 
                    echo $rightStart;
                    ?>
</td>
                        <?php 
                }
                ?>
					<td style='text-align:left;<?php 
                echo $right_style;
                ?>
'>
						<?php 
                if ($this->jSeason->pick_score and !$jTips['HideTeamSelect'] or !$this->jSeason->pick_score) {
                    ?>
							<input type='radio' <?php 
                    echo $onClick;
                    ?>
  class="inputbox" name='game<?php 
                    echo $jGame->id;
                    ?>
' value='<?php 
                    echo $rightTeam->id;
                    ?>
' <?php 
                    echo $jTip->tip_id == $rightTeam->id ? 'checked="checked"' : '';
                    ?>
 <?php 
                    echo $disabled;
                    ?>
 id="<?php 
                    echo $right;
                    ?>
_game<?php 
                    echo $jGame->id;
                    ?>
"/>
							<?php 
                }
                ?>
						&nbsp;<label for="<?php 
                echo $right;
                ?>
_game<?php 
                echo $jGame->id;
                ?>
"><?php 
                echo $rightTeam->getDisplayLogoName('left');
                ?>
</label>
					</td>
					<?php 
                if ($this->jSeason->pick_margin == 1) {
                    ?>
						<td style='text-align:center;'>
						<?php 
                    if ($jGame->has_margin == 1) {
                        ?>
							<input type='text' onKeyUp="this.value=this.value.replace(/[^\d]+/, '');" class="inputbox" name='margin<?php 
                        echo $jGame->id;
                        ?>
' style='text-align:center;' maxLength='5' size='5' value='<?php 
                        echo $jTip->margin;
                        ?>
' <?php 
                        echo $disabled;
                        ?>
 />
							<?php 
                    } else {
                        ?>
&nbsp;<?php 
                    }
                    ?>
						</td>
						<?php 
                }
                if ($this->jSeason->pick_bonus > 0) {
                    if ($jGame->has_bonus == 1) {
                        // BUG 302 - awayTeam and homeTeam do not exist anymore
                        $bonusTeams = array('' => $jLang['_ADMIN_CONF_NONE'], $jGame->{$left_id_field} => $leftTeam->getName(), $jGame->{$right_id_field} => $rightTeam->getName());
                        if ($this->jSeason->pick_bonus == 2) {
                            $bonusTeams['-2'] = $jLang['_ADMIN_SEASON_EPTB_BOT'];
                        }
                        ?>
							<td style='text-align:center;'><?php 
                        echo makeSelectList($bonusTeams, 'bonus' . $jGame->id, "{$disabled} class='inputbox'", $jTip->bonus_id);
                        ?>
</td>
							<?php 
                    } else {
                        ?>
							<td style='text-align:center;'>&nbsp;</td>
							<?php 
                    }
                }
                //show the game time
                if ($this->jSeason->game_times) {
                    ?>
<td><?php 
                    if ($jGame->start_time) {
                        echo TimeDate::toDisplayDateTime($jGame->start_time, false);
                    } else {
                        echo "&nbsp;";
                    }
                    ?>
</td><?php 
                }
                if ($this->jRound->scored == 1) {
                    $left_score_field = $left . '_score';
                    $right_score_field = $right . '_score';
                    ?>
							<th <?php 
                    echo $tags;
                    ?>
><?php 
                    echo $jGame->{$left_score_field} . " - " . $jGame->{$right_score_field};
                    ?>
&nbsp;</th>
						<?php 
                }
                ?>
<td><?php 
                if (!empty($jGame->description)) {
                    $description = nl2br(stripslashes($jGame->description));
                    echo jTipsToolTip($description, $jLang['_COM_GAME_ADDITIONAL_INFO']);
                } else {
                    echo "&nbsp;";
                }
                ?>
</td>
				</tr>
				<?php 
                $rowIndex++;
            }
            ?>
			</table>
			<div>
			<?php 
            $this->renderByes();
            ?>
			<table width="100%" cellspacing="10">
			<?php 
            if ($jTips['DoubleUp'] == 1) {
                if ($jTipsCurrentUser->doubleup > 0 && $jTipsCurrentUser->doubleup < $this->jRound->id || $disabled == 'disabled') {
                    $disable_doubleup = 'disabled';
                } else {
                    $disable_doubleup = '';
                }
                ?>
				<tr>
					<td style='text-align:center'><h4><label for="doubleup"><?php 
                echo $jLang['_COM_GAME_USEDOUBLE'];
                ?>
</label>&nbsp;<input type='checkbox' class="inputbox" id="doubleup" name='doubleup' value='<?php 
                echo $this->jRound->id;
                ?>
' <?php 
                echo $jTipsCurrentUser->doubleup == $this->jRound->id ? "checked" : "";
                ?>
 <?php 
                echo $disable_doubleup;
                ?>
 /></h4></td>
				</tr>
				<?php 
            }
            if ($jTips['EnableComments'] == 1) {
                if ($disabled == 'disabled') {
                    $commentArea = "<em>";
                    if (strlen($this->jComment->comment) > 0) {
                        $commentArea .= $this->jComment->comment;
                    } else {
                        $commentArea .= $jLang['_ADMIN_CONF_NONE'];
                    }
                    $commentArea .= "</em>";
                } else {
                    $comment = str_replace('"', "'", $this->jComment->comment);
                    $commentArea = '
					<input name="comment" id="comment" size="50" class="inputbox" value="' . $comment . '" />
					';
                }
                ?>
				<tr>
					<td style="text-align:center;"><?php 
                echo $jLang['_COM_DASH_COMMENT'];
                ?>
: <?php 
                echo $commentArea;
                ?>
</td>
				</tr>
				<?php 
            }
            ?>
			<tr>
				<td style='text-align:center' id='submittipsbuttonarea'><?php 
            echo $disabled != "disabled" ? "<input type='button' class='button' name='submittips' id='submittips' value='" . $jLang['_COM_TIPS_SAVE'] . "' {$checkComment} />" : "";
            ?>
</td>
			</tr>
			<tr>
				<td style='text-align:center; padding-top:5px; display:none;' id='ajaxloading'></td>
			</tr>
			</table>
			</div>
			<input type='hidden' name='round_id' value='<?php 
            echo $this->jRound->id;
            ?>
' />
			</form>
			<?php 
        } else {
            if ($this->jRound->exists() and TimeDate::toDatabaseDateTime($this->jRound->start_time) > gmdate('Y-m-d H:i:s')) {
                ?>
			<h2 style='text-align:center'><?php 
                echo $jLang['_COM_DASH_ROUND'] . " " . $this->jRound->round;
                ?>
</h2>
			<h2 style='text-align:center'><?php 
                echo $jLang['_COM_ROUND_CLOSED'];
                ?>
</h2>
			<?php 
            } else {
                if ($this->jRound->exists()) {
                    ?>
				<h2 style='text-align:center'><?php 
                    echo $jLang['_COM_DASH_ROUND'] . " " . $this->jRound->round;
                    ?>
</h2>
				<?php 
                } else {
                    ?>
				<h2 style='text-align:center'><?php 
                    echo $jLang['_COM_ROUND_NOGAMES'];
                    ?>
</h2>
				<?php 
                }
            }
        }
        if ($this->jRound->getStatus() === false and !empty($jTipsCurrentUser->id)) {
            $userTime = strtotime($this->jRound->start_time) - TimeDate::getOffset(false);
            $targetTime = date('Y-m-d H:i:s', $userTime);
            if ($jTips['ShowJSCountdown'] == 1) {
                $field = "'countdown'";
            } else {
                $field = "false";
            }
            ?>
			<script type='text/javascript'>
				window.addEvent('domready', function(){
					var year = <?php 
            echo TimeDate::format($targetTime, '%Y', true, false);
            ?>
;
					var month = <?php 
            echo TimeDate::format($targetTime, '%m', true, false) - 1;
            ?>
;
					var day = <?php 
            echo TimeDate::format($targetTime, '%d', true, false);
            ?>
;
					var hour = <?php 
            echo TimeDate::format($targetTime, '%H', true, false);
            ?>
;
					var min = <?php 
            echo TimeDate::format($targetTime, '%M', true, false);
            ?>
;
					var sec = 0;
					jTipsCountdown(year, month, day, hour, min, 1, <?php 
            echo $field;
            ?>
);
				});
			</script>
			<?php 
        }
    }
コード例 #8
0
ファイル: locked.php プロジェクト: joomux/jTips
    /**
     * Take data assigned in $data and display it
     */
    function display()
    {
        global $jTipsCurrentUser, $mainframe, $database, $jLang, $jTips, $mosConfig_live_site;
        $mosConfig_offset = $mainframe->getCfg('offset');
        global $Itemid;
        $useJs = false;
        if ($jTips['JsLadder'] != 'none') {
            $useJs = true;
        }
        ?>
<h2 class="contentheading jmain_heading"><?php 
        echo $this->jSeason->name;
        ?>
</h2>
<h3 align="center"><?php 
        if ($this->jRound->getPrev()) {
            ?>
 <a style="font-size: smaller;"
	href='<?php 
            echo jTipsRoute("index.php?option=com_jtips&amp;Itemid={$Itemid}&amp;view=Tips&amp;layout=locked&amp;rid=" . $this->jRound->getPrev());
            ?>
'>&laquo;
	<?php 
            echo $jLang['_COM_PREV_ROUND'];
            ?>
</a> <?php 
        }
        echo "&nbsp;" . $jLang['_COM_DASH_ROUND'] . " " . $this->jRound->round . "&nbsp;";
        if ($this->jRound->getNext()) {
            ?>
 <a style="font-size: smaller;"
	href='<?php 
            echo jTipsRoute("index.php?option=com_jtips&amp;Itemid={$Itemid}&amp;view=Tips&amp;layout=locked&amp;rid=" . $this->jRound->getNext());
            ?>
'><?php 
            echo $jLang['_COM_NEXT_ROUND'];
            ?>
&raquo;</a> <?php 
        }
        ?>
</h3>
<?php 
        if ($this->jRound->exists()) {
            $jGameParams = array('round_id' => $this->jRound->id, 'order' => array('type' => 'order', 'by' => 'position', 'direction' => 'ASC'));
            $jGame = new jGame($database);
            $jGames = forceArray($jGame->loadByParams($jGameParams));
            $tags = "class='sectiontableheader jtableheader'";
            ?>
		<table width="100%" cellspacing="0">
			<thead>
				<tr class="sectiontableheader">
					<th <?php 
            echo $tags;
            ?>
 width="50%"><?php 
            echo $jLang['_COM_ROUND_START_TIME'];
            ?>
</th>
					<?php 
            if ($jTips['ShowJSCountdown'] == 1) {
                ?>
					<th <?php 
                echo $tags;
                ?>
 width="50%"><?php 
                echo $jLang['_COM_ROUND_TIME_TO_START'];
                ?>
</th>
					<?php 
            }
            ?>
				</tr>
			</thead>
			<tbody>
				<tr class="sectiontableentry1">
					<td style="text-align: center;"><?php 
            //BUG 136 - show closed/closes depending on start time
            echo TimeDate::toDisplayDateTime($this->jRound->start_time, false);
            ?>
</td>
					<?php 
            if ($jTips['ShowJSCountdown'] == 1) {
                ?>
					<td>
					<div id='countdown' style="text-align: center;" class="highlight"><?php 
                echo $jLang['_COM_CLOSED'];
                ?>
</div>
					</td>
					<?php 
            }
            ?>
				</tr>
			</tbody>
		</table>
					<?php 
            if (jTipsGetParam($jTips, 'TeamLadderPopup', 0)) {
                $url = "view=TeamLadder&Itemid={$Itemid}&menu=0";
                ?>
		<p style="text-align: center; font-weight: bold;">
						<?php 
                if (isJoomla15()) {
                    // better popup handling in J1.5
                    JHTML::_('behavior.modal');
                    $rel = json_encode(array('size' => array('x' => $jTips['ShowTipsWidth'], 'y' => $jTips['ShowTipsHeight'])));
                    $url = jTipsRoute("index.php?option=com_jtips&tmpl=component&" . $url);
                    $attribs = array('class' => 'modal', 'rel' => str_replace('"', "'", $rel), 'title' => $jLang['_COM_TIPS_SHOWHIDE']);
                    echo JHTML::link($url, $jLang['_COM_TIPS_SHOWHIDE'], $attribs);
                } else {
                    ?>
 <a href='javascript:void(0);'
							onClick="openPopup('<?php 
                    echo $url;
                    ?>
', 'Team Ladder');"><?php 
                    echo $jLang['_COM_TIPS_SHOWHIDE'];
                    ?>
</a>
							<?php 
                }
                ?>
</p><?php 
            }
            //BUG 189 - Which order should the tips panel be shown in
            if ($this->jSeason->tips_layout == 'away') {
                $left = 'away';
                $right = 'home';
            } else {
                $left = 'home';
                $right = 'away';
            }
            ?>
		<table align='center' width='100%' class="jdatatable" cellspacing="0">
			<tr>
				<th <?php 
            echo $tags;
            ?>
><?php 
            echo $jLang['_COM_GAME_' . strtoupper($left)];
            ?>
</th>
				<?php 
            if ($this->jSeason->team_starts) {
                ?>
				<th <?php 
                echo $tags;
                ?>
><?php 
                echo $jLang['_COM_TIPS_' . strtoupper($left) . 'START'];
                ?>
</th>
				<?php 
            }
            if ($this->jSeason->team_starts) {
                ?>
				<th <?php 
                echo $tags;
                ?>
><?php 
                echo $jLang['_COM_TIPS_' . strtoupper($right) . 'START'];
                ?>
</th>
				<?php 
            }
            ?>
				<th <?php 
            echo $tags;
            ?>
>&nbsp;</th>
				<th <?php 
            echo $tags;
            ?>
><?php 
            echo $jLang['_COM_GAME_' . strtoupper($right)];
            ?>
</th>
				<?php 
            if ($this->jSeason->game_times) {
                ?>
				<th <?php 
                echo $tags;
                ?>
><?php 
                echo $jLang['_COM_TIPS_TIME'];
                ?>
</th>
				<?php 
            }
            if ($this->jRound->scored == 1) {
                ?>
				<th <?php 
                echo $tags;
                ?>
><?php 
                echo $jLang['_COM_TIPS_RESULT'];
                ?>
</th>
				<?php 
            }
            ?>
				<th <?php 
            echo $tags;
            ?>
>&nbsp;</th>
			</tr>
			<?php 
            $rowIndex = 0;
            foreach ($jGames as $jGame) {
                $leftTeam = new jTeam($database);
                $rightTeam = new jTeam($database);
                $left_id_field = $left . '_id';
                $right_id_field = $right . '_id';
                $leftLoaded = $rightLoaded = false;
                if ($jGame->{$left_id_field}) {
                    $leftTeam->load($jGame->{$left_id_field});
                    $leftLoaded = true;
                }
                if ($jGame->{$right_id_field}) {
                    $rightTeam->load($jGame->{$right_id_field});
                    $rightLoaded = true;
                }
                if (!$leftLoaded and $rightLoaded) {
                    $this->byes[] = $rightTeam;
                }
                if ($leftLoaded and !$rightLoaded) {
                    $this->byes[] = $leftTeam;
                }
                if (!$leftLoaded or !$rightLoaded) {
                    continue;
                }
                if ($jGame->winner_id == $leftTeam->id) {
                    $left_style = "font-weight:bold;";
                    $right_style = "";
                } else {
                    if ($jGame->winner_id == -1) {
                        $left_style = "font-style:italics;";
                        $right_style = "font-style:italics;";
                    } else {
                        if ($jGame->winner_id == $rightTeam->id) {
                            $left_style = "";
                            $right_style = "font-weight:bold;";
                        } else {
                            $left_style = "";
                            $right_style = "";
                        }
                    }
                }
                $rowClasses = "class='sectiontableentry" . ($rowIndex % 2 + 1) . " jtablerow" . ($rowIndex % 2 + 1) . "'";
                ?>
			<tr <?php 
                echo $rowClasses;
                ?>
>
				<td style='text-align:right;<?php 
                echo $left_style;
                ?>
'><label
					for="<?php 
                echo $left;
                ?>
_game<?php 
                echo $jGame->id;
                ?>
"><?php 
                echo $leftTeam->getDisplayLogoName('right');
                ?>
</label></td>
					<?php 
                if ($this->jSeason->team_starts) {
                    $left_start_field = $left . '_start';
                    $leftStart = $jGame->{$left_start_field} + 0;
                    if ($jGame->{$left_start_field} > 0) {
                        $leftStart = "+{$leftStart}";
                    } else {
                        if ($leftStart == 0) {
                            $leftStart = "&nbsp;";
                        }
                    }
                    ?>
				<td style='text-align: center;'><?php 
                    echo $leftStart;
                    ?>
</td>
				<?php 
                }
                ?>
				<td style='text-align: center;'>&nbsp;<?php 
                echo $jLang['_COM_TEAM_VS'];
                ?>
&nbsp;</td>
				<?php 
                $right_start_field = $right . '_start';
                if ($this->jSeason->team_starts) {
                    $rightStart = $jGame->{$right_start_field} + 0;
                    if ($jGame->{$right_start_field} > 0) {
                        $rightStart = "+{$rightStart}";
                    } else {
                        if ($rightStart == 0) {
                            $rightStart = "&nbsp;";
                        }
                    }
                    ?>
				<td style='text-align: center;'><?php 
                    echo $rightStart;
                    ?>
</td>
				<?php 
                }
                ?>
				<td style='text-align:left;<?php 
                echo $right_style;
                ?>
'><label
					for="<?php 
                echo $right;
                ?>
_game<?php 
                echo $jGame->id;
                ?>
"><?php 
                echo $rightTeam->getDisplayLogoName('left');
                ?>
</label>
				</td>
				<?php 
                //show the game time
                if ($this->jSeason->game_times) {
                    ?>
					<td><?php 
                    if ($jGame->start_time) {
                        echo TimeDate::toDisplayDateTime($jGame->start_time, false);
                    } else {
                        echo "&nbsp;";
                    }
                    ?>
</td><?php 
                }
                if ($this->jRound->scored == 1) {
                    $left_score_field = $left . '_score';
                    $right_score_field = $right . '_score';
                    ?>
					<th <?php 
                    echo $tags;
                    ?>
><?php 
                    echo $jGame->{$left_score_field} . " - " . $jGame->{$right_score_field};
                    ?>
&nbsp;</th>
					<?php 
                }
                ?>
<td><?php 
                if (!empty($jGame->description)) {
                    $description = nl2br(stripslashes($jGame->description));
                    echo jTipsToolTip($description, $jLang['_COM_GAME_ADDITIONAL_INFO']);
                } else {
                    echo "&nbsp;";
                }
                ?>
</td>
			</tr>
			<?php 
                $rowIndex++;
            }
            ?>
		</table>
		<div><?php 
            $this->renderByes();
            ?>
</div>
		<?php 
        } else {
            if ($this->jRound->exists() and TimeDate::toDatabaseDateTime($this->jRound->start_time) > gmdate('Y-m-d H:i:s')) {
                ?>
		<h2 style='text-align: center'><?php 
                echo $jLang['_COM_DASH_ROUND'] . " " . $this->jRound->round;
                ?>
</h2>
		<h2 style='text-align: center'><?php 
                echo $jLang['_COM_ROUND_CLOSED'];
                ?>
</h2>
			<?php 
            } else {
                if ($this->jRound->exists()) {
                    ?>
		<h2 style='text-align: center'><?php 
                    echo $jLang['_COM_DASH_ROUND'] . " " . $this->jRound->round;
                    ?>
</h2>
				<?php 
                } else {
                    ?>
		<h2 style='text-align: center'><?php 
                    echo $jLang['_COM_ROUND_NOGAMES'];
                    ?>
</h2>
				<?php 
                }
            }
        }
        if ($this->jRound->getStatus() === false) {
            $userTime = strtotime($this->jRound->start_time) - TimeDate::getOffset(false);
            $targetTime = date('Y-m-d H:i:s', $userTime);
            if ($jTips['ShowJSCountdown'] == 1) {
                $field = "'countdown'";
            } else {
                $field = "false";
            }
            ?>
		<script type='text/javascript'>
						window.addEvent('domready', function(){
							var year = <?php 
            echo TimeDate::format($targetTime, '%Y', true, false);
            ?>
;
							var month = <?php 
            echo TimeDate::format($targetTime, '%m', true, false) - 1;
            ?>
;
							var day = <?php 
            echo TimeDate::format($targetTime, '%d', true, false);
            ?>
;
							var hour = <?php 
            echo TimeDate::format($targetTime, '%H', true, false);
            ?>
;
							var min = <?php 
            echo TimeDate::format($targetTime, '%M', true, false);
            ?>
;
							var sec = 0;
							jTipsCountdown(year, month, day, hour, min, 1, <?php 
            echo $field;
            ?>
);
						});
					</script>
			<?php 
        }
    }
コード例 #9
0
ファイル: save.php プロジェクト: joomux/jTips
jTipsSpoofCheck();
global $mosConfig_absolute_path;
$file = jTipsGetParam($_REQUEST, 'path', '');
if (!$file) {
    //create a new file
    $file = $mosConfig_absolute_path . '/components/com_jtips/custom/views/' . jTipsGetParam($_REQUEST, 'view', 'DEFAULT');
    if (jTipsGetParam($_REQUEST, 'tmpl', false)) {
        $file .= '/tmpl';
    }
    $filename = jTipsGetParam($_REQUEST, 'filename', 'default.ext.php');
    //clean the filename
    $regex = array('#(\\.){2,}#', '#[^A-Za-z0-9\\.\\_\\- ]#', '#^\\.#');
    $file .= '/' . preg_replace($regex, '', $filename);
}
if (jTipsGetParam($_FILES['fileupload'], 'tmp_name', false)) {
    if (isJoomla15()) {
        jimport('joomla.filesystem.file');
        $result = JFile::upload($_FILES['fileupload']['tmp_name'], $file);
    } else {
        $result = move_uploaded_file($_FILES['fileupload']['tmp_name'], $file);
    }
} else {
    $content = jTipsGetParam($_REQUEST, 'filecontent', '');
    $result = writeFile($file, jTipsStripslashes($content));
}
if ($result) {
    $message = $jLang['_ADMIN_CSTM_SAVE_SUCCESS'];
} else {
    $message = $jLang['_ADMIN_CSTM_SAVE_FAILURE'];
}
mosRedirect('index2.php?option=com_jtips&module=Customisations', $message);
コード例 #10
0
ファイル: GetFields.php プロジェクト: joomux/jTips
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 - 09/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: Get a list of available import fields for the selected table
 */
global $database, $jLang;
ob_clean();
$table = jTipsGetParam($_REQUEST, 'table', '');
if ($table == '-1' or $table == '') {
    die("opts = new Array();");
}
$jObj = new $table($database);
$defs =& $jObj->getFieldMap();
$i = 1;
ksort($defs);
$js = "\nvar opts = new Array();\n\n";
foreach ($defs as $field => $def) {
    if (isset($def['import']) and $def['import'] == true) {
        $label = $jLang[$def['label']];
        $js .= "\n\t\topts.push(new Option('{$label}', '{$field}'));\n\t\t";
        $i++;
    }
}
コード例 #11
0
ファイル: list.tmpl.php プロジェクト: joomux/jTips
    function display()
    {
        global $jLang;
        ?>
		<form action='index2.php' method='post' name='adminForm'>
			<input type='hidden' name='task' value='list' />
			<input type='hidden' name='option' value='<?php 
        echo jTipsGetParam($_REQUEST, 'option', 'com_jtips');
        ?>
' />
			<input type='hidden' name='module' value='Export' />
			<input type='hidden' name='hidemainmenu' value='0' />
			<input type="hidden" name="<?php 
        echo jTipsSpoofValue();
        ?>
" value="1" />
			<?php 
        if (isJoomla15()) {
            JToolBarHelper::title($jLang['_ADMIN_CONF_EXPBTN'], 'export');
        } else {
            ?>
				<table class='adminheading'>
					<tr><th><?php 
            echo $jLang['_ADMIN_CONF_EXPBTN'];
            ?>
</th></tr>
				</table>
				<?php 
        }
        ?>
			<fieldset>
			<legend><?php 
        echo $jLang['_ADMIN_EXP_INFO'];
        ?>
</legend>
			<table class='admintable' width="100%">
				<tr>
					<td class="key" width="25%"><?php 
        echo $jLang['_ADMIN_EXP_PREVIOUS'];
        ?>
</td>
					<td><?php 
        echo $this->selectLists['history'];
        ?>
&nbsp;<?php 
        echo $this->selectLists['actions'];
        ?>
&nbsp;<input type='submit' name='doAction' value='Go!' class='button' <?php 
        echo $this->disableExportButton;
        ?>
 onclick="this.form.task.value='history'" /></td>
				</tr>
				<tr>
					<td class="key" width="25%"><?php 
        echo $jLang['_ADMIN_EXP_SELECT_TYPE'];
        ?>
</td>
					<td><?php 
        echo $this->selectLists['objects'];
        ?>
&nbsp;<input type="submit" name="getExport" value="Export Data" class="button" onclick="this.form.task.value='export'" /></td>
				</tr>
			</table>
			</fieldset>
		</form>
		<?php 
    }
コード例 #12
0
ファイル: save.php プロジェクト: joomux/jTips
if (!isJoomla15()) {
    $jSeason->start_time = TimeDate::toDisplayDate($jSeason->start_time);
    $jSeason->end_time = TimeDate::toDisplayDate($jSeason->end_time);
}
if ($_FILES['image']['name'] and imageDirCheck()) {
    $logofile = 'images/jtips/' . $_FILES['image']['name'];
    if (isJoomla15()) {
        jimport('joomla.filesystem.file');
        jTipsLogger::_log('MOVING ' . $_FILES['image']['tmp_name'] . ' TO ' . $logofile, 'ERROR');
        //JFile::move($_FILES['image']['tmp_name'], $mosConfig_absolute_path.'/'.$logofile);
        //BUG 270 - to complete upload, use the upload function, not move
        JFile::upload($_FILES['image']['tmp_name'], $mosConfig_absolute_path . '/' . $logofile);
    } else {
        if (!is_dir($mosConfig_absolute_path . '/images/jtips') or !file_exists($mosConfig_absolute_path . '/images/jtips')) {
            mkdir($mosConfig_absolute_path . '/images/jtips');
        }
        move_uploaded_file($_FILES['image']['tmp_name'], $mosConfig_absolute_path . '/' . $logofile);
    }
    $jSeason->image = $logofile;
} else {
    if (jTipsGetParam($_REQUEST, 'remove_image', 0) == 1) {
        $jSeason->image = '';
    }
}
$saved = $jSeason->save();
$message = 'Season ' . $jSeason->name . ($saved != false ? ' Saved!' : ' failed to save. Error!');
if ($task == 'apply') {
    mosRedirect('index2.php?option=com_jtips&hidemainmenu=1&task=edit&module=Seasons&cid[]=' . $jSeason->id, $message);
} else {
    mosRedirect('index2.php?option=com_jtips&task=list&module=Seasons', $message);
}
コード例 #13
0
ファイル: docopy.php プロジェクト: joomux/jTips
 *
 * Description:
 */
require_once 'components/com_jtips/classes/jgame.class.php';
require_once 'components/com_jtips/classes/jround.class.php';
global $database, $jLang;
$id = jTipsGetParam($_REQUEST, 'id', false);
if (!$id or !is_numeric($id)) {
    // BUG 373 - Round fails to copy
    jTipsLogger::_log('No round id specified to copy!', 'ERROR');
    mosRedirect('index2.php?option=com_jtips&task=list&module=Rounds', $jLang['_ADMIN_ROUND_COPY_FAIL']);
}
$focus = new jRound($database);
$focus->load($id);
$focus->id = null;
$focus->round = jTipsGetParam($_REQUEST, 'round', '');
$focus->scored = 0;
if (!$focus->round) {
    jTipsLogger::_log('No Round number entered when copying round, determine next one.', 'ERROR');
    $query = "SELECT MAX(round)+1 AS nextround FROM #__jtips_rounds WHERE season_id = '" . $focus->season_id . "'";
    $database->setQuery($query);
    $focus->round = $database->loadResult();
}
$focus->save();
$query = "SELECT id FROM #__jtips_games WHERE round_id = '" . $database->getEscaped($id) . "'";
$database->setQuery($query);
$game_ids = $database->loadResultArray();
if (!empty($game_ids)) {
    foreach ($game_ids as $gid) {
        $jGame = new jGame($database);
        $jGame->load($gid);
コード例 #14
0
ファイル: default.php プロジェクト: joomux/jTips
    function display()
    {
        global $Itemid, $database, $mainframe, $jTips, $jLang, $mosConfig_live_site, $jTipsCurrentUser;
        $mosConfig_offset = $mainframe->getCfg('offset');
        $postURL = jTipsRoute("index.php?option=com_jtips&Itemid={$Itemid}");
        ?>
		<script type='text/javascript'>
		function getTeamLadder(obj) {
			document.getElementById('season_id').value = obj.options[obj.selectedIndex].value;
			document.ladderForm.submit();
			//window.location.href='index.php?option=com_jtips&Itemid=<?php 
        echo $Itemid;
        ?>
&task=teams&season=' + id;
		}
		</script>
		<form action="<?php 
        echo $postURL;
        ?>
" method="post" name="ladderForm">
		<input type="hidden" name="option" value="com_jtips" />
		<input type="hidden" name="task" value="TeamLadder" />
		<input type="hidden" name="season" id="season_id" />
		<?php 
        if (jTipsGetParam($_REQUEST, 'menu', 1)) {
            //jtips_HTML::seasonsList($jTipsCurrentUser, $this->jSeasons, "onchange='getTeamLadder(this);'", false, $this->jSeason->id);
        }
        ?>
		<table width='100%' cellspacing="0">
		<thead>
		<?php 
        ?>
		<tr class='sectiontableheader jtableheader'>
			<th class="jtips_team_ladder_header">#</th>
			<th class="jtips_team_ladder_header">&nbsp;</th>
			<th class="jtips_team_ladder_header"><?php 
        echo $jLang['_COM_TLD_TEAM'];
        ?>
</th>
			<?php 
        if (!empty($jTips['TeamLadderColumns'])) {
            foreach ($jTips['TeamLadderColumns'] as $field) {
                $lang_key = "_COM_TLD_ABR_" . strtoupper($field);
                ?>
				<th style="text-align:center" width="5" class="jtips_team_ladder_header"><?php 
                echo $jLang[$lang_key];
                ?>
</th>
				<?php 
            }
        }
        ?>
		</tr>
		<?php 
        ?>
		</thead>
		<tbody>
		<?php 
        $i = 1;
        $rowIndex = 0;
        $noteams = true;
        if (count($this->jTeams) > 0) {
            foreach ($this->jTeams as $jTeam) {
                $extra = "";
                $thisRowIndex = $rowIndex++;
                ?>
				<tr class='sectiontableentry<?php 
                echo $thisRowIndex % 2 + 1;
                ?>
 jtablerow<?php 
                echo $thisRowIndex % 2 + 1;
                ?>
'>
					<td style='text-align:center'><?php 
                echo $i;
                ?>
</td>
					<td style='text-align:center'>
					<?php 
                $img = $jTeam->getLogo();
                //					if (jTipsFileExists(getJtipsImage($jTeam->logo))) {
                //						$img .= "<img src='" .$mainframe->getCfg('live_site');
                //						if (!empty($jTips['SubDirectory'])) {
                //							$img .= $jTips['SubDirectory'];
                //						}
                //						$img .= "/" .getJtipsImage($jTeam->logo). "' alt=' ' border='0' />";
                //					}
                if (empty($img)) {
                    $img .= "&nbsp;";
                }
                echo $img;
                ?>
					</td>
					<?php 
                $popupUrl = "view=TeamLadder&Itemid={$Itemid}&action=ShowTeam&id=" . $jTeam->id;
                if (jTipsGetParam($_REQUEST, 'menu', 0) or !jTipsGetParam($_REQUEST, 'tmpl', false)) {
                    if (isJoomla15()) {
                        /*$x = $jTips['ShowTipsWidth'];
                        		$y = $jTips['ShowTipsHeight'];
                        		//BUG 274 - team ladder popup results in broken scroll bar
                        		if (basename($_SERVER['SCRIPT_FILENAME']) != 'index2.php') {
                        			$class = "class='modal'";
                        		} else {
                        			$class = '';
                        		}
                        		$teamname = "<a $class rel=\"{handler: 'iframe', size: {x: $x, y: $y}}\" href='" .jTipsRoute($mosConfig_live_site. "/index2.php?option=com_jtips&$popupUrl&menu=0"). "'>" .$jTeam->getName(). "</a>";
                        		*/
                        // better popup handling in J1.5
                        JHTML::_('behavior.modal');
                        $rel = json_encode(array('handler' => 'iframe', 'size' => array('x' => $jTips['ShowTipsWidth'], 'y' => $jTips['ShowTipsHeight'])));
                        $url = jTipsRoute("index.php?option=com_jtips&tmpl=component&{$popupUrl}&menu=0");
                        $attribs = array('class' => 'modal', 'rel' => str_replace('"', "'", $rel), 'title' => $jTeam->getName());
                        $teamname = JHTML::link($url, $jTeam->getName(), $attribs);
                    } else {
                        $teamname = "<a href='javascript:void(0);' onClick='openPopup(\"{$popupUrl}\", \"" . $jTeam->getName() . "\");'>" . $jTeam->getName() . "</a>";
                    }
                } else {
                    $teamname = $jTeam->getName();
                }
                ?>
				<td align="left"><?php 
                echo $teamname;
                ?>
</td>
				<?php 
                if (!empty($jTips['TeamLadderColumns'])) {
                    foreach ($jTips['TeamLadderColumns'] as $field) {
                        ?>
						<td style='text-align:center'><?php 
                        echo $jTeam->getTeamField($field);
                        ?>
</td>
						<?php 
                    }
                }
                ?>
			</tr>
			<?php 
                $i++;
            }
        } else {
            ?>
			<tr>
				<td style='text-align:center' colspan='20'><?php 
            echo $jLang['_COM_TEAMS_UNAVAILABLE'];
            ?>
</td>
			</tr>
			<?php 
        }
        $rowIndex = 0;
        ?>
		</tbody>
		</table>
		<table align='right' cellspacing="0">
		<thead id="teamLegendHeader">
		<tr>
			<th colspan='2' class='sectiontableheader'><?php 
        echo $jLang['_COM_TLD_LEGEND'];
        ?>
</th>
		</tr>
		</thead>
		<tbody id='teamLegend'>
		<?php 
        if (!empty($jTips['TeamLadderColumns'])) {
            foreach ($jTips['TeamLadderColumns'] as $field) {
                $lang_key = "_COM_TLD_" . strtoupper($field);
                $abr_key = "_COM_TLD_ABR_" . strtoupper($field);
                $thisRowIndex = $rowIndex++;
                ?>
				<tr class='sectiontableentry<?php 
                echo $thisRowIndex % 2 + 1;
                ?>
 jtablerow<?php 
                echo $thisRowIndex % 2 + 1;
                ?>
'>
					<td style='text-align:center;font-weight:bold;'><?php 
                echo $jLang[$abr_key];
                ?>
</td>
					<td style='text-align:left'><?php 
                echo $jLang[$lang_key];
                ?>
</td>
				</tr>
				<?php 
            }
        }
        ?>
		</tbody>
		</table>
		<?php 
        if ($jTips['JsLadder'] != 'none') {
            ?>
			<script type='text/javascript'>
			window.addEvent('domready', function() {
				var teamLegend = new Fx.Slide('teamLegend', {
					duration:<?php 
            echo $jTips['JsLadderDuration'] * 1000;
            ?>
,
					wait: true,
					<?php 
            if ($jTips['JsLadder'] == 'linear') {
                echo "transition: Fx.Transitions.linear";
            } else {
                ?>
					transition: Fx.Transitions.<?php 
                echo $jTips['JsLadder'];
                ?>
.<?php 
                echo $jTips['JsLadderStyle'];
                ?>
						<?php 
            }
            ?>
				});
				teamLegend.hide();
				$('teamLegendHeader').addEvent('click', function(e){
					e = new Event(e);
					teamLegend.toggle();
					e.stop();
				});
				$('teamLegendHeader').setStyle('cursor', 'pointer');
			});

			</script>
			<?php 
        }
        ?>
		</form>
		<?php 
    }
コード例 #15
0
ファイル: toolbar.jtips.php プロジェクト: joomux/jTips
<?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');
}
コード例 #16
0
ファイル: MailMan.php プロジェクト: joomux/jTips
 * @copyright Copyright &copy; 2009, jTips
 * @license Commercial - See website for details
 *
 * @since 2.1 - 14/10/2008
 * @version 2.1
 * @package jTips
 *
 * Description: Sends email reminders to users that have opted to receive them
 */
set_time_limit(0);
ob_clean();
global $mosConfig_absolute_path, $database, $jTips;
require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/classes/jremind.class.php';
$jTips['EnableEmailReminders'] == '1' or die('Reminders disabled');
//do we have the right key to avoid DOS
if (!jTipsGetParam($_GET, 'key', false) or md5(jTipsGetParam($_GET, 'key', '')) != md5($jTips['EmailManKey'])) {
    jTipsLogger::_log('invalid passkey. attempted to force email reminders!', 'ERROR');
    die('Invalid access key');
}
//Get All Current Seasons
$query = "SELECT id FROM #__jtips_seasons WHERE start_time <= '" . gmdate('Y-m-d') . "' AND end_time >= '" . gmdate('Y-m-d') . "';";
$database->setQuery($query);
$season_ids = $database->loadResultArray();
$from = $jTips['EmailRemindFromAddress'];
$fromname = $jTips['EmailRemindFromName'];
$subject = $jTips['EmailRemindSubject'];
$body = $jTips['EmailRemindBody'];
$tables = array('#__jtips_users', '#__users');
sort($tables);
$write = array();
$tableArr = $database->getTableFields($tables);
コード例 #17
0
ファイル: save.php プロジェクト: joomux/jTips
 * 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('Direct Access to this location is not allowed.');
require_once 'components/com_jtips/classes/jtip.class.php';
global $database, $jTips;
jTipsSpoofCheck();
//jTipsDebug($_REQUEST);
$game_ids = jTipsGetParam($_REQUEST, 'game_id', array());
//jTipsDebug($game_ids);
foreach ($game_ids as $index => $gid) {
    $jTip = new jTip($database);
    if (!empty($_REQUEST['id'][$index])) {
        $jTip->load($_REQUEST['id'][$index]);
    }
    $game_index = "g{$gid}";
    $jTip->tip_id = jTipsGetParam($_REQUEST[$game_index], 'tip_id');
    $jTip->home_score = jTipsGetParam($_REQUEST[$game_index], 'home_score');
    $jTip->away_score = jTipsGetParam($_REQUEST[$game_index], 'away_score');
    $jTip->margin = jTipsGetParam($_REQUEST[$game_index], 'margin');
    $jTip->bonus_id = jTipsGetParam($_REQUEST[$game_index], 'bonus_id');
    $jTip->game_id = $gid;
    $jTip->user_id = jTipsGetParam($_REQUEST, 'user_id');
    if (!empty($jTip->user_id)) {
        jTipsLogger::_log("ADMIN: saving tips. Tip_id = " . $jTip->tip_id);
        $jTip->save();
    }
}
mosRedirect('index2.php?option=com_jtips&task=list&module=Tips', 'Tips Saved');
コード例 #18
0
ファイル: save.php プロジェクト: joomux/jTips
$comment = trim(strip_tags(stripslashes(jTipsGetParam($_REQUEST, 'comment', ''))));
$comment = cleanComment(str_replace('\\', '', $comment));
if ($jTips['EnableComments'] == 1 && !empty($comment)) {
    jTipsLogger::_log('saving comment');
    $jComment = new jComment($database);
    $jCommentParams = array('user_id' => $jTipsCurrentUser->id, 'round_id' => $jRound->id);
    $jComment->loadByParams($jCommentParams);
    $jComment->user_id = $jTipsCurrentUser->id;
    $jComment->round_id = $jRound->id;
    $jComment->comment = $comment;
    $jComment->save();
    jTipsLogger::_log('comment saved');
}
$emailResult = '';
if ($jTips['TipsNotifyEnable'] and $jTipsCurrentUser->getPreference('tips_notifications')) {
    if (sendTipsConfirmation($jTipsCurrentUser, $myTips)) {
        $emailResult = '. ' . $jLang['_COM_TIPS_EMAIL_SUCCESS'];
    } else {
        $emailResult = '. ' . $jLang['_COM_TIPS_EMAIL_FAILURE'];
    }
}
// BUG 312 - more JomSocial Integration
if ($jTips['JomSocialActivities'] and $jTips['JomSocialOnSaveTips']) {
    require_once $mosConfig_absolute_path . '/administrator/components/com_jtips/utils/jTipsJomSocial.php';
    jTipsJomSocial::writeOnSaveTips($jTipsCurrentUser->user_id, $isUpdate, $jSeason, $jRound);
}
jTipsLogger::_log('done saving tips, redirecting...');
//die('save done');
$message = $jLang['_COM_TIPS_SAVED_MESSAGE'] . $emailResult;
jTipsRedirect('index.php?option=com_jtips&view=Tips&Itemid=' . jTipsGetParam($_REQUEST, 'Itemid', '') . '&season=' . $jSeason->id, $message);
コード例 #19
0
ファイル: edit.php プロジェクト: joomux/jTips
    $where = "AND (username LIKE '%" . $database->getEscaped($user_search) . "%' OR name LIKE '%" . $database->getEscaped($user_search) . "%')";
} else {
    $where = '';
}
$offset = jTipsGetParam($_REQUEST, 'limitstart', 0);
$query = "SELECT COUNT(*) FROM #__users WHERE block = '0' {$where}";
$database->setQuery($query);
$total = $database->loadResult();
$limit = jTipsGetParam($_REQUEST, 'limit', $jTips['NumMax']);
$pageNav = new mosPageNav($total, $offset, $limit);
$tpl->pageNav = $pageNav;
$direction = jTipsGetParam($_REQUEST, 'filter_order_Dir', 'asc');
if (empty($direction)) {
    $direction = 'asc';
}
$orderby = jTipsGetParam($_REQUEST, 'filter_order', 'name');
if (empty($orderby)) {
    $orderby = 'name';
}
// BUG 319 - creating users that don't require activation, or creating a user by admin leaves an activation code
//$query = "SELECT id FROM #__users WHERE activation = '' ORDER BY $orderby $direction";
$query = "SELECT id FROM #__users WHERE block = '0' {$where} ORDER BY {$orderby} {$direction}";
$database->setQuery($query, $pageNav->limitstart, $pageNav->limit);
$list = (array) $database->loadResultArray();
$users = array();
foreach ($list as $id) {
    if (isJoomla15()) {
        $JoomlaUser = new JUser();
    } else {
        $JoomlaUser = new mosUser($database);
    }
コード例 #20
0
ファイル: toolbar.php プロジェクト: joomux/jTips
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 - 01/10/2008
 * @version 2.1
 * @package jTips
 * 
 * Description: Builds the toolbar for the Users module
 */
global $jLang;
switch (jTipsGetParam($_REQUEST, 'task', 'list')) {
    case 'list':
        jTipsMenuBar::startTable();
        jTipsMenuBar::custom('clean', 'process', '../components/com_jtips/images/PROCESS.png', $jLang['_COM_ADMIN_CLEAN_USERS'], false);
        jTipsMenuBar::spacer();
        jTipsMenuBar::deleteListX($jLang['_ADMIN_CONFIRM_REMOVE']);
        jTipsMenuBar::spacer();
        if (isJoomla15()) {
            JToolbarHelper::addNewX('edit');
        } else {
            jTipsMenuBar::addNewX('edit');
        }
        jTipsMenuBar::spacer();
        jTipsMenuBar::endTable();
        break;
    case 'edit':
コード例 #21
0
ファイル: build.php プロジェクト: joomux/jTips
}
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') . "'"));
$jSeasons = $jSeason->loadByParams($jSeasonParams);
$render->assign('jSeasons', $jSeasons);
if (!jTipsGetParam($_REQUEST, 'menu', 1)) {
    echo "\n\t<style type='text/css'>\n\t@import url({$mosConfig_live_site}/templates/" . jTipsGetTemplateName() . "/css/template.css);\n\t@import url({$mosConfig_live_site}/components/com_jtips/css/jtips-popup.css);\n\t</style>";
    if ($jTips['ShowTipsPadding']) {
        $width = $jTips['ShowTipsWidth'] - 40;
        echo '<div style="padding-top:10px;padding-left:10px;padding-right:10px;padding-bottom:10px;width:' . $width . 'px;text-align:center;">';
    }
}
$render->display();
if (!jTipsGetParam($_REQUEST, 'menu', 1)) {
    if ($jTips['ShowTipsPadding']) {
        echo '</div>';
    }
    if (!isJoomla15()) {
        die;
    }
}
//jtips_HTML::show_teamLadder($jTipsUser, $jSeason);
コード例 #22
0
ファイル: ShowTips.php プロジェクト: joomux/jTips
        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);
//should columns be hidden?
$hideRaw = jTipsGetParam($_REQUEST, 'hide');
if ($hideRaw) {
    //BUG 231 - Add a fallback in case we are using PHP < 5.2.0
    if (!function_exists('json_decode')) {
        $hideColumns = array('result', 'actual', 'awarded');
    } else {
        // TODO: need to ensure json_decode returns an array here
        $hideColumns = json_decode(jTipsStripslashes(rawurldecode($hideRaw)));
    }
    // BUG 371 - use a fallback if something went wrong
    if (!$hideColumns) {
        $hideColumns = array('result', 'actual', 'awarded');
    }
    $render->assign('stats', false);
} else {
    $hideColumns = array();
コード例 #23
0
ファイル: edit.php プロジェクト: joomux/jTips
<?php

defined('_JEXEC') or defined('_VALID_MOS') or die('Restricted Access');
/**
 * Author: Jeremy Roberts
 * Package: jTicket
 * Website: www.jtips.com.au
 * Created: 09/09/2008
 *
 * Description:
 *
 *
 */
global $jLang;
jTipsSpoofCheck();
$title = $jLang['_ADMIN_LANGUAGE_EDITING'];
$langKeys = jTipsGetParam($_REQUEST, 'cid', array());
$key = array_shift($langKeys);
$formData = array();
if (isset($jLang[$key])) {
    $formData = array('fieldset' => array('legend' => '_ADMIN_LANG_EDIT_VALUE', 'fields' => array('label' => array('label' => '_ADMIN_LANGUAGE_SYSKEY', 'field' => array('type' => 'label', 'attributes' => array('value' => $key, 'type' => 'label'))), 'data' => array('label' => '_ADMIN_LANGUAGE_EDIT', 'field' => array('type' => 'text', 'attributes' => array('size' => '50', 'type' => 'text', 'class' => 'inputbox', 'name' => 'languageVar', 'value' => htmlentities($jLang[$key], ENT_QUOTES, 'UTF-8')))), 'key' => array('type' => 'hidden', 'field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'languageKey', 'value' => $key))))));
}
jTipsAdminDisplay::EditView($title, $formData, 'langmanager');
コード例 #24
0
ファイル: save.php プロジェクト: joomux/jTips
<?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());
コード例 #25
0
ファイル: save.php プロジェクト: joomux/jTips
 * Package: jTicket
 * Website: www.jtips.com.au
 * Created: 10/09/2008
 *
 * Description: Saves the edited language key definition
 * 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'];
コード例 #26
0
ファイル: list.php プロジェクト: joomux/jTips
$limit = jTipsGetParam($_REQUEST, 'limit', 25);
$direction = jTipsGetParam($_REQUEST, 'filter_order_Dir', 'asc');
if (empty($direction)) {
    $direction = 'asc';
}
$orderby = jTipsGetParam($_REQUEST, 'filter_order', 'name');
if (empty($orderby)) {
    $orderby = 'name';
}
$params = array('order' => array('type' => 'order', 'direction' => $direction, 'by' => $orderby), 'join_users' => array('type' => 'join', 'join_table' => '#__users', 'lhs_table' => '#__jtips_users', 'lhs_key' => 'user_id', 'rhs_table' => '#__users', 'rhs_key' => 'id'));
if ($season_id = jTipsGetParam($_REQUEST, 'season_id', false)) {
    $params['season_id'] = $season_id;
}
$jTipsUsers = forceArray($jTipsUser->loadByParams($params, $limit, $limitstart));
$pageNav = new mosPageNav($jTipsUser->getCount(), $limitstart, $limit);
$data = array();
$i = 0;
foreach ($jTipsUsers as $jTipsUserItem) {
    $scores = $jTipsUserItem->getSummaryScores();
    $data[$jTipsUserItem->id] = array("<label for='cb{$i}'>" . $jTipsUserItem->getUserField('name') . "</label>", $jTipsUserItem->getUserField('username'), $jTipsUserItem->getSeasonName(), $jTipsUserItem->doubleup, number_format($scores[$jTipsUserItem->season_id]['average'], 2), $scores[$jTipsUserItem->season_id]['total_points'], '<div style="text-align:center;"><a href="javascript:toggleBoolean(\'' . $jTipsUserItem->id . '\', \'paid\');"><img src="images/' . ($jTipsUserItem->paid ? "tick" : "publish_x") . '.png" id="paid_' . $jTipsUserItem->id . '" border="0" /></div>', '<div style="text-align:center;"><a href="javascript:toggleBoolean(\'' . $jTipsUserItem->id . '\', \'status\');"><img src="images/' . ($jTipsUserItem->status == 1 ? "tick" : "publish_x") . '.png" border="0" id="status_' . $jTipsUserItem->id . '" /></a></div>');
    $i++;
}
$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', '')));
//BUG 217 - 5th arg was teamEdit, changed to list - this is the TASK form field value
jTipsAdminDisplay::ListView($formData, $header, $data, $pageNav, 'list', $filters, $jLang['_ADMIN_USERS_INFO'], true);
コード例 #27
0
ファイル: ShowTeam.php プロジェクト: joomux/jTips
 */
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);
$jSeason->load($jTeam->season_id);
$render->assign('jSeason', $jSeason);
$render->display();
if (!isJoomla15()) {
    die;
}
/*
$my = $mainframe->getUser();
$jTipsUser = new jTipsUser($database);
$jTipsUserParams = array(
	'user_id' => $my->id,
コード例 #28
0
ファイル: save.php プロジェクト: joomux/jTips
                if (!$jGame->home_id or !$jGame->away_id) {
                    // this is a bye
                    $jGame->winner_id = null;
                } else {
                    $jGame->winner_id = -1;
                    $jGame->draw = 1;
                }
            }
        }
        // BUG 401 - should be able to set the bonus points without allowing users to pick the bonus result
        if (jTipsGetParam($_REQUEST['bonus_id'], $i, false)) {
            $jGame->bonus_id = jTipsGetParam($_REQUEST['bonus_id'], $i, null);
        }
    }
    // set the description if we have one
    $jGame->description = strip_tags(jTipsGetParam($_REQUEST['description'], $i, ''));
    if ($jGame->save()) {
        $games_to_keep[] = $jGame->id;
        $results[] = 1;
    } else {
        $results[] = 0;
    }
}
$message = "Saved " . array_sum($results) . "/" . count($results) . " Games";
//Delete games that have been removed by unchecking them
$jGame = new jGame($database);
$params = array('round_id' => $jRound->id, 'id' => array('type' => 'query', 'query' => " NOT IN ('" . implode("', '", $games_to_keep) . "')"));
$jGames = forceArray($jGame->loadByParams($params));
$deleted = 0;
foreach ($jGames as $oldGame) {
    $oldGame->destroy();
コード例 #29
0
ファイル: admin.jtips.html.php プロジェクト: joomux/jTips
    function EditView($title, $formData, $icon = 'generic')
    {
        global $jTips, $jLang;
        jTipsCommonHTML::loadCalendar();
        ?>
		<form action="index2.php" name="adminForm" method="post" enctype="multipart/form-data">
		<input type="hidden" name="option" value='<?php 
        echo jTipsGetParam($_REQUEST, 'option', 'com_jtips');
        ?>
'>
		<input type='hidden' name='task' value=''>
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type='hidden' name='module' value='<?php 
        echo jTipsGetParam($_REQUEST, 'module', '');
        ?>
'>
		<input type="hidden" name="<?php 
        echo jTipsSpoofValue();
        ?>
" value="1" />
		<?php 
        if (isJoomla15()) {
            JToolBarHelper::title($title, $icon);
        } else {
            ?>
			<table class="adminheading">
			<tr><th class="edit"><?php 
            echo $title;
            ?>
</th></tr>
			</table>
			<?php 
        }
        foreach ($formData as $fieldset) {
            ?>
			<fieldset>
			<legend><?php 
            echo $jLang[$fieldset['legend']];
            ?>
</legend>
			<table class="admintable" width="100%">
			<tbody>
			<?php 
            $hiddenFields = array();
            foreach ($fieldset['fields'] as $row) {
                if ($row['field']['type'] == 'hidden') {
                    $hiddenFields[] = $row;
                    continue;
                }
                if ($row['field']['type'] == 'editor') {
                    $colspan = 2;
                } else {
                    $colspan = 1;
                }
                ?>
<tr>
				<td class="key" width="25%"><label for="<?php 
                echo $row['field']['attributes']['id'];
                ?>
"><?php 
                echo $jLang[$row['label']];
                ?>
</label></td>
				<td width="25%" colspan="<?php 
                echo $colspan;
                ?>
"><?php 
                echo parseEditField($row['field']);
                ?>
</td>
				<?php 
                if ($colspan == 1) {
                    ?>
				<td width="50%"><?php 
                    echo isset($row['description']) ? $jLang[$row['description']] : "";
                    ?>
&nbsp;</td>
					<?php 
                }
                ?>
				</tr><?php 
            }
            ?>
			</tbody>
			<tfoot>
			</tfoot>
			</table>
			<?php 
            //now loop on the hidden fields
            if (!empty($hiddenFields)) {
                foreach ($hiddenFields as $def) {
                    echo parseEditField($def['field']);
                }
            }
            ?>
			</fieldset>
			<?php 
        }
        ?>
		</form>
		<?php 
    }
コード例 #30
0
ファイル: list.php プロジェクト: joomux/jTips
require_once 'components/com_jtips/classes/jround.class.php';
require_once 'components/com_jtips/classes/jseason.class.php';
require_once 'components/com_jtips/modules/Dashboard/list.tmpl.php';
require_once 'components/com_jtips/utils/update.php';
$mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/Dashboard/Dashboard.js'></script>");
$mainframe->addCustomHeadTag("<script type='text/javascript'>var jTipsCurrentVersion = '" . getFullVersion() . "';</script>");
$tpl = new ListMode();
if (!jTipsGetParam($_REQUEST, 'nu', 0)) {
    $autoUpgradeResult = autoUpgrade();
    if ($autoUpgradeResult !== false) {
        $message = '';
        if ($autoUpgradeResult == 1) {
            //upgrade success!
            $jTipsVersion = getFullVersion();
            //BUG 262 - AutoUpgrade to version message corrected
            $newVersion = jTipsGetParam($_SESSION, 'jtips_upgraded_version', 'Latest Version');
            $message = 'System Upgraded!';
            // to ' .$jTipsVersion;
            unset($_SESSION['jtips_upgraded_version']);
        } else {
            if ($autoUpgradeResult == 0) {
                //upgrade not required
            } else {
                if (is_string($autoUpgradeResult)) {
                    //display the error message
                    //Auto Update Failed: [message]
                    $message = 'System Upgrade Failed: ' . $autoUpgradeResult;
                }
            }
        }
        if ($message) {