/** * 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; }
$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) { $jSeasonOptions[] = jTipsHTML::makeOption($season->id, $season->name); } //build the field definitions $formData = array('basic' => array('legend' => '_ADMIN_BASIC_INFORMATION', 'fields' => array('id' => array('field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'id', 'id' => 'id', 'value' => $jTeam->id))), 'season' => array('label' => '_ADMIN_TEAM_SEASON', 'field' => array('type' => 'select', 'attributes' => array('name' => 'season_id', 'id' => 'season_id', 'class' => 'inputbox'), 'options' => $jSeasonOptions, 'selected' => $jTeam->season_id)), 'name' => array('label' => '_ADMIN_TEAM_NAME', 'field' => array('type' => 'text', 'attributes' => array('name' => 'name', 'id' => 'name', 'class' => 'inputbox', 'size' => '50', 'type' => 'text', 'value' => $jTeam->name))), 'location' => array('label' => '_ADMIN_TEAM_LOCATION', 'field' => array('type' => 'text', 'attributes' => array('name' => 'location', 'id' => 'location', 'class' => 'inputbox', 'size' => '50', 'type' => 'text', 'value' => $jTeam->location))), 'website' => array('label' => '_ADMIN_TEAM_URL', 'field' => array('type' => 'text', 'attributes' => array('name' => 'url', 'id' => 'url', 'class' => 'inputbox', 'size' => '50', 'type' => 'text', 'value' => $jTeam->url))), 'about' => array('label' => '_ADMIN_TEAM_ABOUT', 'field' => array('type' => 'editor', 'attributes' => array('name' => 'about', 'id' => 'about', 'class' => 'inputbox', 'value' => jTipsStripslashes($jTeam->about))))))); $formData['image'] = array('legend' => '_ADMIN_TEAM_LOGO', 'fields' => array('logo' => array('label' => '_ADMIN_TEAM_LOGO', 'field' => array('type' => 'file', 'attributes' => array('size' => '50', 'type' => 'file', 'class' => 'inputbox', 'name' => 'logo', 'id' => 'logo'))))); if ($jTeam->logo) { $formData['image']['fields']['current_logo'] = array('label' => '_ADMIN_TEAM_CURRENT_LOGO', 'field' => array('type' => 'img', 'attributes' => array('alt' => 'Logo', 'id' => 'current_logo', 'src' => $mosConfig_live_site . '/' . getJtipsImage($jTeam->logo, 100)))); $formData['image']['fields']['remove_logo'] = array('label' => '_ADMIN_TEAM_REMOVE_LOGO', 'field' => array('type' => 'checkbox', 'attributes' => array('class' => 'inputbox', 'name' => 'remove_logo', 'value' => '1', 'type' => 'checkbox', 'onClick' => 'if (this.checked){$("logo").disabled=true;}else{$("logo").disabled=false}')), 'description' => '_ADMIN_TEAM_REMOVE_LOGO_DEF'); } // BUG 287 - can no longer edit team points /*$formData['points'] = array( 'legend' => '_ADMIN_TEAM_POINTS_ADJUST', 'fields' => array( 'wins' => array( 'label' => '_ADMIN_TEAM_ADJUST_WINS', 'field' => array( 'type' => 'text', 'attributes' => array( 'name' => 'wins', 'id' => 'wins', 'class' => 'inputbox', 'size' => '10',
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> <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;"> </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 ? ' ' : $location; ?> </td> <td align="center"><?php echo $isBye ? ' ' : $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>"; } }
$jTeam = new jTeam($database); if ($id = jTipsGetParam($_REQUEST, 'id', false)) { $jTeam->load($id); } $jTeam->bind($_POST); if (jTipsGetParam($_REQUEST, 'removeImage', false)) { $jTeam->logo = null; } else { unset($jTeam->logo); //so we dont overwrite the current value } if (isset($_FILES['logo']['name']) and !empty($_FILES['logo']['name']) and imageDirCheck()) { //Upload image $filename = str_replace(' ', '_', $_FILES['logo']['name']); $filename_100 = getJtipsImage($filename, 100); $filename_25 = getJtipsImage($filename); if (!isJoomla15()) { if (!is_dir($mosConfig_absolute_path . '/images/jtips') or !file_exists($mosConfig_absolute_path . '/images/jtips')) { mkdir($mosConfig_absolute_path . '/images/jtips'); } } else { jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); jimport('joomla.filesystem.path'); if (!JFolder::exists($mosConfig_absolute_path . '/images/jtips')) { JFolder::create($mosConfig_absolute_path . '/images/jtips'); } //create empty img files and make writeable JFile::write($mosConfig_absolute_path . '/images/jtips/' . $filename_100, ''); if (JPath::canChmod($mosConfig_absolute_path . '/images/jtips/' . $filename_100)) { JPath::setPermissions($mosConfig_absolute_path . '/images/jtips/' . $filename_100, 666);
?> "> <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' /> "; // echo $img; // } // } if ($params->get('incimage') and !empty($jTeam->logo) and jTipsFileExists(getJtipsImage($jTeam->logo))) { echo $jTeam->getLogo() . " "; } 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') {