Beispiel #1
0
 /**
  * get img for team
  * @param object ranking row
  * @param int type = 1 for club small logo, 2 for country
  * @return html string
  */
 public static function getLogo($item, $type = 1)
 {
     if ($type == 1) {
         if (!empty($item->logo_small)) {
             return JHtml::image($item->logo_small, $item->short_name, 'class="teamlogo"');
         }
     } else {
         if ($type == 2 && !empty($item->country)) {
             return Countries::getCountryFlag($item->country, 'class="teamcountry"');
         } else {
             if ($type == 3) {
                 if (!empty($item->team_picture)) {
                     return JHtml::image($item->team_picture, $item->short_name, 'class="teamlogo"');
                 }
             } else {
                 if ($type == 4) {
                     if (!empty($item->projectteam_picture)) {
                         return JHtml::image($item->projecteam_picture, $item->short_name, 'class="teamlogo"');
                     }
                 }
             }
         }
     }
     return '';
 }
 /**
  * get img for team
  * @param object ranking row
  * @param int type = 1 for club small logo, 2 for country
  * @return html string
  */
 function getLogo($item, $type = 1)
 {
     if ($type == 1) {
         if (!empty($item->logo_small)) {
             return JHTML::image(JURI::root() . $item->logo_small, $item->short_name, 'class="teamlogo"');
         }
     } else {
         if ($type == 2 && !empty($item->country)) {
             return Countries::getCountryFlag($item->country, 'class="teamcountry"');
         }
     }
     return '';
 }
Beispiel #3
0
 public static function getStaffLink($item, $params)
 {
     $flag = "";
     if ($params->get('show_flag')) {
         $flag = Countries::getCountryFlag($item->country) . " ";
     }
     $text = "<i>" . JoomleagueHelper::formatName(null, $item->firstname, $item->nickname, $item->lastname, $params->get("name_format")) . "</i>";
     if ($params->get('show_staff_link')) {
         $link = JoomleagueHelperRoute::getStaffRoute($params->get('p'), $params->get('team'), $item->slug);
         echo $flag . JHtml::link($link, $text);
     } else {
         echo '<i>' . JText::sprintf('%1$s', $flag . $text) . '</i>';
     }
 }
Beispiel #4
0
 public static function convertAddressString($name = '', $address = '', $state = '', $zipcode = '', $location = '', $country = '', $addressString = 'COM_JOOMLEAGUE_ADDRESS_FORM')
 {
     $resultString = '';
     if (!empty($address) || !empty($state) || !empty($zipcode) || !empty($location)) {
         $countryFlag = Countries::getCountryFlag($country);
         $countryName = Countries::getCountryName($country);
         $dummy = Countries::removeEmptyFields($name, $address, $state, $zipcode, $location, $countryFlag, $countryName, JText::_($addressString));
         $dummy = str_replace('%NAME%', $name, $dummy);
         $dummy = str_replace('%ADDRESS%', $address, $dummy);
         $dummy = str_replace('%STATE%', $state, $dummy);
         $dummy = str_replace('%ZIPCODE%', $zipcode, $dummy);
         $dummy = str_replace('%LOCATION%', $location, $dummy);
         $dummy = str_replace('%FLAG%', $countryFlag, $dummy);
         $dummy = str_replace('%COUNTRY%', $countryName, $dummy);
         $resultString .= $dummy;
     }
     $resultString .= '&nbsp;';
     return $resultString;
 }
if ($this->overallconfig['show_project_heading'] == 1 && $this->project) {
    ?>
	<div class="componentheading">
		<table class="contentpaneopen">
			<tbody>
				<?php 
    if ($this->overallconfig['show_project_country'] == 1) {
        ?>
				<tr class="contentheading">
					<td colspan="<?php 
        echo $nbcols;
        ?>
">
					<?php 
        $country = $this->project->country;
        echo Countries::getCountryFlag($country) . ' ' . Countries::getCountryName($country);
        ?>
					</td>
				</tr>
				<?php 
    }
    ?>
				<tr class="contentheading">
					<?php 
    if ($this->overallconfig['show_project_sporttype_picture'] == 1) {
        ?>
						<td>
						<?php 
        // diddipoeler
        echo JHTML::image($this->project->sport_type_picture, $this->project->sport_type_name, array('title' => $this->project->sport_type_name, 'width' => $this->overallconfig['picture_width']));
        /*
 /**
  * returns html <img> for club assigned to team
  * @param object team
  * @param int type=1 for club small image,or 2 for club country
  * @param boolean $with_space
  * @return unknown_type
  */
 public function getTeamClubIcon($team, $type = 1, $attribs = array())
 {
     if (!isset($team->name)) {
         return "";
     }
     $title = $team->name;
     $attribs = array_merge(array('title' => $title, $attribs));
     if ($type == 1) {
         if (!empty($team->logo_small) && JFile::exists($team->logo_small)) {
             $image = JHTML::image($team->logo_small, $title, $attribs);
         } else {
             $image = JHTML::image(JURI::root() . JoomleagueHelper::getDefaultPlaceholder("clublogosmall"), $title, $attribs);
         }
     } elseif ($type == 2 && !empty($team->country)) {
         $image = Countries::getCountryFlag($team->country);
         if (empty($image)) {
             $image = JHTML::image(JURI::root() . JoomleagueHelper::getDefaultPlaceholder("icon"), $title, $attribs);
         }
     } elseif ($type == 3 && !empty($team->country) && !empty($team->logo_small) && JFile::exists($team->logo_small)) {
         //$image = Countries::getCountryFlag($team->country);
         if (empty($image)) {
             $image = JHTML::image($team->logo_small, $title, $attribs) . ' ' . Countries::getCountryFlag($team->country);
         }
     } elseif ($type == 3 && !empty($team->country) && !empty($team->logo_small) && !JFile::exists($team->logo_small)) {
         //$image = Countries::getCountryFlag($team->country);
         if (empty($image)) {
             $image = JHTML::image(JURI::root() . JoomleagueHelper::getDefaultPlaceholder("icon"), $title, $attribs) . ' ' . Countries::getCountryFlag($team->country);
         }
     } elseif ($type == 4 && !empty($team->country) && !empty($team->logo_small) && JFile::exists($team->logo_small)) {
         //$image = Countries::getCountryFlag($team->country);
         if (empty($image)) {
             $image = Countries::getCountryFlag($team->country) . ' ' . JHTML::image($team->logo_small, $title, $attribs);
         }
     } elseif ($type == 4 && !empty($team->country) && !empty($team->logo_small) && !JFile::exists($team->logo_small)) {
         //$image = Countries::getCountryFlag($team->country);
         if (empty($image)) {
             $image = Countries::getCountryFlag($team->country) . ' ' . JHTML::image(JURI::root() . JoomleagueHelper::getDefaultPlaceholder("icon"), $title, $attribs);
         }
     } else {
         $image = '';
     }
     return $image;
 }
            ?>
<span class='hasTip' title="<?php 
            echo JText::sprintf('COM_JOOMLEAGUE_PRED_RESULTS_RESULT_HINT', $match->homeName, $match->awayName, $outputStr);
            ?>
"><?php 
            echo $outputStr;
            ?>
</span><?php 
            if ($this->config['show_logo_small_overview'] == 1) {
                echo '<br />' . JoomleagueModelPredictionResults::showClubLogo($match->awayLogo, $match->awayName) . '<br />';
                if ($this->config['show_team_names'] == 1) {
                    echo $match->awayShortName . '<br />';
                }
            }
            if ($this->config['show_logo_small_overview'] == 2) {
                echo '<br />' . Countries::getCountryFlag($match->awayCountry);
                if ($this->config['show_team_names'] == 1) {
                    echo $match->awayCountry . '<br />';
                }
            }
            ?>
            </td>
					<?php 
        }
        ?>
				<?php 
        if ($this->config['show_points']) {
            ?>
<td <?php 
            echo $tdClassStr;
            ?>
?>

<?php 
if (count($clubs) > 0) {
    foreach ($clubs as $club) {
        $idstring = $id . $params->get('moduleclass_sfx');
        if ($mode == 'T') {
            $birthdaytext .= '<div id="' . $idstring . '" class="textdiv">';
        }
        $club->default_picture = JoomleagueHelper::getDefaultPlaceholder('clublogobig');
        if ($params->get('limit') > 0 && $counter == intval($params->get('limit'))) {
            break;
        }
        $class = $k == 0 ? $params->get('sectiontableentry1') : $params->get('sectiontableentry2');
        $thispic = "";
        $flag = $params->get('show_club_flag') ? Countries::getCountryFlag($club->country) . "&nbsp;" : "";
        $text = $club->name;
        $usedname = $flag . $text;
        $club_link = "";
        $club_link = JoomleagueHelperRoute::getClubInfoRoute($club->project_id, $club->id);
        $showname = JHTML::link($club_link, $usedname);
        $birthdaytext .= '<div class="qslide">';
        $birthdaytext .= '<div class="tckproject"><p>' . $showname . '</p></div>';
        if ($params->get('show_picture') == 1) {
            if (file_exists(JPATH_BASE . '/' . $club->picture) && $club->picture != '') {
                $thispic = $club->picture;
            } elseif (file_exists(JPATH_BASE . '/' . $club->default_picture) && $club->default_picture != '') {
                $thispic = $club->default_picture;
            }
            $birthdaytext .= '<div style="width:100%"><center><img style="" src="' . JURI::base() . '/' . $thispic . '" alt="' . $text . '" title="' . $text . '"';
            if ($params->get('picture_width') != '') {
Beispiel #9
0
}
?>
		<td class="info">
		<table class="plinfo table">
			<?php 
if (!empty($this->person->country) && $this->config["show_nationality"] == 1) {
    ?>
			<tr>
				<td class=""><span class="label"><?php 
    echo JText::_('COM_JOOMLEAGUE_PERSON_NATIONALITY');
    ?>
				</span>
				</td>
				<td class="data">
				<?php 
    echo Countries::getCountryFlag($this->person->country) . " " . JText::_(Countries::getCountryName($this->person->country));
    ?>
				</td>
			</tr>
			<?php 
}
?>
			<tr>
				<td class="">
					<span class="label"><?php 
echo JText::_('COM_JOOMLEAGUE_PERSON_NAME');
?>
</span>
				</td>
				<td class="data">
				<?php 
							</td>
							<td nowrap='nowrap' class="td_c">
								<?php 
                    // clublogo oder vereinsflagge
                    if ($this->config['show_logo_small'] == 1) {
                        $logo_away = $this->model->getMatchTeamClubLogo($result->projectteam2_id);
                        if ($logo_away == '' || !file_exists($logo_away)) {
                            $logo_away = 'images/com_joomleague/database/placeholders/placeholder_small.gif';
                        }
                        $imgTitle = JText::sprintf('COM_JOOMLEAGUE_PRED_ENTRY_LOGO_OF', $awayName);
                        echo ' ';
                        echo JHTML::image($logo_away, $imgTitle, array(' title' => $imgTitle));
                    }
                    if ($this->config['show_logo_small'] == 2) {
                        $country_away = $this->model->getMatchTeamClubFlag($result->projectteam2_id);
                        echo Countries::getCountryFlag($country_away);
                    }
                    ?>
							</td>						
							<td nowrap='nowrap' class="td_l">
								<?php 
                    if (isset($favTeamsList[$predictionProject->project_id]) && $favTeamsList[$predictionProject->project_id] == $result->projectteam2_id) {
                        ?>
<span style='background-color:yellow; color:black; padding:2px; '><?php 
                        echo $awayName;
                        ?>
</span>
								<?php 
                    } else {
                        echo $awayName;
                    }
Beispiel #11
0
?>
</td>
		</tr>		
		<tr>
			<td class="key"><?php 
echo $this->form->getLabel('alias');
?>
</td>
			<td><?php 
echo $this->form->getInput('alias');
?>
</td>
		</tr>
		<tr>
			<td class="key"><?php 
echo $this->form->getLabel('country');
?>
</td>
			<td><?php 
echo $this->form->getInput('country');
?>
&nbsp;<?php 
echo Countries::getCountryFlag($this->form->getValue('country'));
?>
&nbsp;(<?php 
echo $this->form->getValue('country');
?>
)</td>
		</tr>
	</table>
</fieldset>
Beispiel #12
0
    switch ($this->config['show_user_profile']) {
        case 1:
            // Link to Joomla Contact Page
            $link = JoomleagueHelperRoute::getContactRoute($this->person->user_id);
            $outputName = JHtml::link($link, $outputName);
            break;
        case 2:
            // Link to CBE User Page with support for JoomLeague Tab
            $link = JoomleagueHelperRoute::getUserProfileRouteCBE($this->person->user_id, $this->project->id, $this->person->id);
            $outputName = JHtml::link($link, $outputName);
            break;
        default:
            break;
    }
}
echo $outputName . '&nbsp;&nbsp;' . Countries::getCountryFlag($this->person->country);
if (!empty($this->person->nickname)) {
    ?>
							<tr>
								<td align="right">
									<b>
										<?php 
    echo JText::_('Nickname');
    ?>
									</b>
								</td>
								<td class="td_l">
									<?php 
    echo $this->person->nickname;
    ?>
								</td>
Beispiel #13
0
 function onContentSearch($text, $phrase = '', $ordering = '', $areas = null)
 {
     $db = JFactory::getDbo();
     require_once JPATH_SITE . '/components/com_joomleague/joomleague.core.php';
     // load plugin params info
     $plugin = JPluginHelper::getPlugin('search', 'joomleague');
     $search_clubs = $this->params->def('search_clubs', 1);
     $search_teams = $this->params->def('search_teams', 1);
     $search_players = $this->params->def('search_players', 1);
     $search_playgrounds = $this->params->def('search_playgrounds', 1);
     $search_staffs = $this->params->def('search_staffs', 1);
     $search_referees = $this->params->def('search_referees', 1);
     $search_projects = $this->params->def('search_projects', 1);
     $text = trim($text);
     if ($text == '') {
         return array();
     }
     $wheres = array();
     switch ($phrase) {
         case 'any':
         default:
             $words = explode(' ', $text);
             $wheres = array();
             $wheresteam = array();
             $whereperson = array();
             $whereplayground = array();
             $whereproject = array();
             if ($search_clubs) {
                 foreach ($words as $word) {
                     $word = $db->Quote('%' . $db->getEscaped($word, true) . '%', false);
                     $wheres2 = array();
                     $wheres2[] = 'c.name LIKE ' . $word;
                     $wheres2[] = 'c.alias LIKE ' . $word;
                     $wheres2[] = 'c.location LIKE ' . $word;
                     $wheres[] = implode(' OR ', $wheres2);
                 }
             }
             if ($search_teams) {
                 foreach ($words as $word) {
                     $word = $db->Quote('%' . $db->getEscaped($word, true) . '%', false);
                     $wheres2 = array();
                     $wheres2[] = 't.name LIKE ' . $word;
                     $wheresteam[] = implode(' OR ', $wheres2);
                 }
             }
             if ($search_players || $search_referees || $search_staffs) {
                 foreach ($words as $word) {
                     $word = $db->Quote('%' . $db->getEscaped($word, true) . '%', false);
                     $wheres2 = array();
                     $wheres2[] = 'pe.firstname LIKE ' . $word;
                     $wheres2[] = 'pe.lastname LIKE ' . $word;
                     $wheres2[] = 'pe.nickname LIKE ' . $word;
                     $whereperson[] = implode(' OR ', $wheres2);
                 }
             }
             if ($search_playgrounds) {
                 foreach ($words as $word) {
                     $word = $db->Quote('%' . $db->getEscaped($word, true) . '%', false);
                     $wheres2 = array();
                     $wheres2[] = 'pl.name LIKE ' . $word;
                     $wheres2[] = 'pl.city LIKE ' . $word;
                     $whereplayground[] = implode(' OR ', $wheres2);
                 }
             }
             if ($search_projects) {
                 foreach ($words as $word) {
                     $word = $db->Quote('%' . $db->getEscaped($word, true) . '%', false);
                     $wheres2 = array();
                     $wheres2[] = 'prj.name LIKE ' . $word;
                     $whereproject[] = implode(' OR ', $wheres2);
                 }
             }
             $where = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $wheres) . ')';
             $whereteam = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $wheresteam) . ')';
             $whereperson = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $whereperson) . ')';
             $whereplayground = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $whereplayground) . ')';
             $whereproject = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $whereproject) . ')';
             break;
     }
     $rows = array();
     if ($search_clubs) {
         $query = "SELECT 'Club' as section, c.name AS title," . " c.founded AS created," . " c.country," . " c.logo_big AS picture," . " CONCAT( ' Address: ',c.address,' ',c.zipcode,' ',c.location,' Phone: ',c.phone,' Fax: ',c.fax,' E-Mail: ',c.email) AS text," . " pt.project_id AS project_id, c.id AS club_id, " . " '' AS href," . " '2' AS browsernav " . " FROM #__joomleague_club AS c" . " LEFT JOIN #__joomleague_team AS t ON c.id = t.club_id" . " LEFT JOIN #__joomleague_project_team AS pt ON pt.team_id = t.id" . " WHERE ( " . $where . " ) " . " GROUP BY c.name ORDER BY c.name";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         for ($i = 0; $i < count($list); $i++) {
             $list[$i]->href = JoomLeagueHelperRoute::getClubInfoRoute($list[$i]->project_id, $list[$i]->club_id);
         }
         $rows[] = $list;
     }
     if ($search_teams) {
         $query = "SELECT 'Team' as section, t.name AS title," . " t.checked_out_time AS created, t.notes AS text, t.id AS team_id, " . " CONCAT( ' Info: ',t.info , ' Notes: ', t.notes ) AS text," . " pt.project_id AS project_id, " . " pt.picture AS picture, " . " '' AS href, c.country AS country, " . " '2' AS browsernav" . " FROM #__joomleague_team AS t " . " LEFT JOIN #__joomleague_project_team AS pt ON pt.team_id = t.id" . " LEFT JOIN #__joomleague_club AS c ON t.club_id = c.id" . " WHERE ( " . $whereteam . " ) " . " GROUP BY t.name ORDER BY t.name";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         for ($i = 0; $i < count($list); $i++) {
             $list[$i]->href = JoomLeagueHelperRoute::getTeamInfoRoute($list[$i]->project_id, $list[$i]->team_id);
         }
         $rows[] = $list;
     }
     if ($search_players) {
         $query = "SELECT 'Person' as section, REPLACE(CONCAT(pe.firstname, ' \\'', pe.nickname, '\\' ' , pe.lastname ),'\\'\\'','') AS title," . " pe.birthday AS created," . " pe.country," . " pe.picture AS picture, " . " CONCAT( ' Birthday:',pe.birthday , ' Notes:', pe.notes ) AS text," . " pt.project_id AS project_id, pt.team_id as team_id, pe.id as person_id, " . " '' AS href," . " '2' AS browsernav" . " FROM #__joomleague_person AS pe" . " LEFT JOIN #__joomleague_team_player AS tp" . " ON tp.person_id = pe.id" . " LEFT JOIN #__joomleague_project_team AS pt ON pt.id = tp.projectteam_id" . " WHERE ( " . $whereperson . " ) " . " AND pe.published = '1' " . " GROUP BY pe.lastname, pe.firstname, pe.nickname " . " ORDER BY pe.lastname,pe.firstname,pe.nickname";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         for ($i = 0; $i < count($list); $i++) {
             $list[$i]->href = JoomLeagueHelperRoute::getPlayerRoute($list[$i]->project_id, $list[$i]->team_id, $list[$i]->person_id);
         }
         $rows[] = $list;
     }
     if ($search_staffs) {
         $query = "SELECT 'Staff' as section, REPLACE(CONCAT(pe.firstname, ' \\'', pe.nickname, '\\' ' , pe.lastname ),'\\'\\'','') AS title," . " pe.birthday AS created," . " pe.country," . " pe.picture AS picture, " . " CONCAT( ' Birthday:',pe.birthday , ' Notes:', pe.notes ) AS text," . " pt.project_id AS project_id, pt.team_id as team_id, pe.id as person_id, " . " '' AS href," . " '2' AS browsernav" . " FROM #__joomleague_person AS pe" . " LEFT JOIN #__joomleague_team_staff AS ts" . " ON ts.person_id = pe.id " . " LEFT JOIN #__joomleague_project_team AS pt" . " ON pt.id = tp.projectteam_id" . " WHERE ( " . $whereperson . " ) " . " AND pe.published = '1' " . " GROUP BY pe.lastname, pe.firstname, pe.nickname " . " ORDER BY pe.lastname,pe.firstname,pe.nickname";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         for ($i = 0; $i < count($list); $i++) {
             $list[$i]->href = JoomLeagueHelperRoute::getStaffRoute($list[$i]->project_id, $list[$i]->team_id, $list[$i]->person_id);
         }
         $rows[] = $list;
     }
     if ($search_referees) {
         $query = "SELECT 'Referee' as section, REPLACE(CONCAT(pe.firstname, ' \\'', pe.nickname, '\\' ' , pe.lastname ),'\\'\\'','') AS title," . " pe.birthday AS created," . " pe.country," . " pe.picture AS picture, " . " CONCAT( 'Birthday:', pe.birthday, ' Notes:', pe.notes ) AS text," . " pt.project_id AS project_id, pe.id as person_id, " . " ''AS href," . " '2' AS browsernav" . " FROM #__joomleague_person AS pe" . " LEFT JOIN #__joomleague_project_referee AS pr" . " ON pr.person_id = pe.id" . " WHERE ( " . $whereperson . " ) " . " AND pe.published = '1' " . " AND pr.published = '1' " . " GROUP BY pe.lastname, pe.firstname, pe.nickname " . " ORDER BY pe.lastname,pe.firstname,pe.nickname";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         for ($i = 0; $i < count($list); $i++) {
             $list[$i]->href = JoomLeagueHelperRoute::getRefereeRoute($list[$i]->project_id, $list[$i]->team_id, $list[$i]->person_id);
         }
         $rows[] = $list;
     }
     if ($search_playgrounds) {
         $query = "SELECT 'Playground' as section, pl.name AS title," . " pl.checked_out_time AS created," . " pl.country," . " pl.picture AS picture, " . " pl.notes AS text," . " pt.project_id AS project_id, pl.id as playground_id, " . " '' AS href," . " '2' AS browsernav" . " FROM #__joomleague_playground AS pl" . " LEFT JOIN #__joomleague_club AS c" . " ON c.id = pl.club_id" . " LEFT JOIN #__joomleague_match AS m" . " ON m.playground_id = pl.id" . " LEFT JOIN #__joomleague_round AS r" . " ON m.round_id = r.id" . " WHERE ( " . $whereplayground . " ) " . " GROUP BY pl.name ORDER BY pl.name ";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         for ($i = 0; $i < count($list); $i++) {
             $list[$i]->href = JoomLeagueHelperRoute::getPlaygroundRoute($list[$i]->project_id, $list[$i]->playgroundid);
         }
         $rows[] = $list;
     }
     if ($search_projects) {
         $query = "SELECT 'Project' as section, prj.name AS title," . " prj.checked_out_time AS created," . " l.country," . " prj.picture AS picture, " . " prj.project_id AS project_id, " . " '' AS href," . " '2' AS browsernav" . " FROM #__joomleague_project AS prj" . " LEFT JOIN #__joomleague_league AS l" . " ON l.id = prj.league_id" . " WHERE ( " . $whereproject . " ) " . " GROUP BY prj.name ";
         " ORDER BY prj.name ";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         for ($i = 0; $i < count($list); $i++) {
             $list[$i]->href = JoomLeagueHelperRoute::getRankingRoute($list[$i]->project_id);
         }
         $rows[] = $list;
     }
     $results = array();
     if (count($rows)) {
         foreach ($rows as $row) {
             if ($row) {
                 foreach ($row as $output) {
                     if ($output->country) {
                         $flag = Countries::getCountryFlag($output->country);
                         $output->flag = $flag;
                         $output->text = $flag . ' ' . $output->text;
                     }
                     if ($output->picture) {
                         $output->text = '<p><img style="float: left;" src="' . $output->picture . '" alt="" width="50" height="" >' . $output->text . '</p>';
                     }
                 }
             }
         }
         foreach ($rows as $row) {
             $results = array_merge($results, (array) $row);
         }
     }
     return $results;
 }
Beispiel #14
0
                $picture = $game->{$pic};
                $type = 1;
                echo JoomleagueHelper::getPictureThumb($picture, $game->tname1, $this->config['picture_width'], $this->config['picture_height'], $type);
                break;
            case 'country_small':
                $type = 6;
                $pic = 'away_country';
                if ($game->{$pic} != '' && !empty($game->{$pic})) {
                    echo Countries::getCountryFlag($game->{$pic}, 'height="11"');
                }
                break;
            case 'country_big':
                $type = 7;
                $pic = 'away_country';
                if ($game->{$pic} != '' && !empty($game->{$pic})) {
                    echo Countries::getCountryFlag($game->{$pic}, 'height="50"');
                }
                break;
        }
        ?>
				</td>
					<?php 
    }
    ?>
				<td  class="td_l">
					<?php 
    echo $tname2;
    ?>
				</td>
					<?php 
    if ($this->config['show_referee'] == 1) {
Beispiel #15
0
<li class="modjlgrandomplayer"><?php 
$picturetext = JText::_('JL_PERSON_PICTURE');
$text = JoomleagueHelper::formatName(null, $person->firstname, $person->nickname, $person->lastname, $params->get("name_format"));
$imgTitle = JText::sprintf($picturetext . ' %1$s', $text);
if (isset($list['inprojectinfo']->picture)) {
    $picture = $list['inprojectinfo']->picture;
    $pic = JoomleagueHelper::getPictureThumb($picture, $imgTitle, $params->get('picture_width'), $params->get('picture_heigth'));
    echo '<a href="' . $link . '">' . $pic . '</a>';
}
?>
</li>
<li class="playerlink">
<?php 
if ($params->get('show_player_flag')) {
    echo Countries::getCountryFlag($person->country) . " ";
}
if ($params->get('show_player_link')) {
    $link = JoomleagueHelperRoute::getPlayerRoute($list['project']->slug, $list['infoteam']->team_id, $person->slug);
    echo JHtml::link($link, $text);
} else {
    echo JText::sprintf('%1$s', $text);
}
?>
</li>
<?php 
if ($params->get('show_team_name')) {
    ?>
<li class="teamname">
<?php 
    echo JoomleagueHelper::getPictureThumb($list['infoteam']->team_picture, $list['infoteam']->name, $params->get('team_picture_width', 21), $params->get('team_picture_height', 0), 1) . " ";
 function getClubIconHtmlSimple($logo_small, $country, $type = 1, $with_space = 0)
 {
     if ($type == 1) {
         $params = array();
         $params["align"] = "top";
         $params["border"] = 0;
         if ($with_space == 1) {
             $params["style"] = "padding:1px;";
         }
         if ($logo_small == "") {
             $logo_small = JoomleagueHelper::getDefaultPlaceholder("clublogosmall");
         }
         return JHTML::image($logo_small, "", $params);
     } elseif ($type == 2 && isset($country)) {
         return Countries::getCountryFlag($team->country);
     }
 }
        ?>
								</a>
							</td>
							<?php 
    }
    ?>
						<td><?php 
    echo $row->name;
    ?>
</td>
						<td><?php 
    echo $row->short_name;
    ?>
</td>
						<td class="center"><?php 
    echo Countries::getCountryFlag($row->country);
    ?>
</td>
						<td class="order">
							<span>
								<?php 
    echo $this->pagination->orderUpIcon($i, $i > 0, 'league.orderup', 'COM_JOOMLEAGUE_GLOBAL_ORDER_UP', $ordering);
    ?>
							</span>
							<span>
								<?php 
    echo $this->pagination->orderDownIcon($i, $n, $i < $n, 'league.orderdown', 'COM_JOOMLEAGUE_GLOBAL_ORDER_DOWN', $ordering);
    ?>
								<?php 
    $disabled = true ? '' : 'disabled="disabled"';
    ?>
Beispiel #18
0
 /**
  * returns html <img> for club assigned to team
  * @param object team
  * @param int type=1 for club small image,or 2 for club country
  * @param boolean $with_space
  * @return unknown_type
  */
 public function getTeamClubIcon($team, $type = 1, $attribs = array())
 {
     if (!isset($team->name)) {
         return "";
     }
     $title = $team->name;
     $attribs = array_merge(array('title' => $title, $attribs));
     if ($type == 1) {
         if (!empty($team->logo_small) && JFile::exists($team->logo_small)) {
             $image = JHtml::image($team->logo_small, $title, $attribs);
         } else {
             $image = JHtml::image('images/com_joomleague/database/placeholders/placeholder_small.gif', $title, $attribs);
         }
     } elseif ($type == 2 && !empty($team->country)) {
         $image = Countries::getCountryFlag($team->country);
         if (empty($image)) {
             $image = JHtml::image('images/com_joomleague/database/placeholders/placeholder_flags.png', $title, $attribs);
         }
     } else {
         $image = '';
     }
     return $image;
 }
Beispiel #19
0
if (count($persons) > 1) {
    $persons = jl_birthday_sort($persons, array("n+days_to_birthday", "n" . $params->get('sort_order') . "age"), false);
}
$k = 0;
$counter = 0;
?>
<table class="birthday">
<?php 
if (count($persons) > 0) {
    foreach ($persons as $person) {
        if ($params->get('limit') > 0 && $counter == intval($params->get('limit'))) {
            break;
        }
        $class = $k == 0 ? $params->get('sectiontableentry1') : $params->get('sectiontableentry2');
        $thispic = "";
        $flag = $params->get('show_player_flag') ? Countries::getCountryFlag($person['country']) . "&nbsp;" : "";
        $text = htmlspecialchars(JoomleagueHelper::formatName(null, $person['firstname'], $person['nickname'], $person['lastname'], $params->get("name_format")), ENT_QUOTES, 'UTF-8');
        $usedname = $flag . $text;
        $person_link = "";
        $person_type = $person['type'];
        if ($person_type == 1) {
            $person_link = JoomleagueHelperRoute::getPlayerRoute($person['project_id'], $person['team_id'], $person['id']);
        } else {
            if ($person_type == 2) {
                $person_link = JoomleagueHelperRoute::getStaffRoute($person['project_id'], $person['team_id'], $person['id']);
            } else {
                if ($person_type == 3) {
                    $person_link = JoomleagueHelperRoute::getRefereeRoute($person['project_id'], $person['team_id'], $person['id']);
                }
            }
        }
Beispiel #20
0
 function showClubIcon(&$team, $type = 1, $with_space = 0)
 {
     if ($type == 1 && isset($team->country)) {
         if ($team->logo_small != '') {
             echo JHtml::image($team->logo_small, '');
             if ($with_space == 1) {
                 echo ' style="padding:1px;"';
             }
         } else {
             echo '&nbsp;';
         }
     } elseif ($type == 2 && isset($team->country)) {
         echo Countries::getCountryFlag($team->country);
     }
 }
					</div>
<?php 
    }
}
// if ($this->config['show_birthday'] > 0 AND $this->row->birthday !="0000-00-00") ends
if ($this->config['show_country_flag']) {
    ?>
					<div>
						<span class="jl_roster_persondetails_label">
							<?php 
    echo JText::_("COM_JOOMLEAGUE_PERSON_NATIONALITY");
    ?>
						</span><!-- /.jl_roster_persondetails_label -->
						<span class="jl_roster_persondetails_data">
<?php 
    echo Countries::getCountryFlag($this->row->country);
    ?>
						</span><!-- /.jl_roster_persondetails_data -->
					</div>
<?php 
}
// if ($this->config['show_country_flag']) ends
?>
				</div><!-- /.jl_roster_persondetails -->
			</div><!-- /.jl_rosterperson_detail_column -->
<?php 
if ($this->overallconfig['use_jl_substitution'] or $this->config['show_events_stats']) {
    ?>
		<div class="jl_rosterstats">
<?php 
    if ($this->overallconfig['use_jl_substitution']) {
Beispiel #22
0
 public static function getClubIconHtml(&$team, $type = 1, $with_space = 0)
 {
     $small_club_icon = $team->logo_small;
     if ($type == 1) {
         $params = array();
         $params['align'] = "top";
         $params['border'] = 0;
         if ($with_space == 1) {
             $params['style'] = 'padding:1px;';
         }
         if ($small_club_icon == '') {
             $small_club_icon = JoomleagueHelper::getDefaultPlaceholder("clublogosmall");
         }
         return JHtml::image($small_club_icon, '', $params);
     } elseif ($type == 2 && isset($team->country)) {
         return Countries::getCountryFlag($team->country);
     }
 }
 // Check if the user wants to show the club logo or country flag
 switch ($this->config['show_logo_small']) {
     case 1:
         $teamA .= '<td class="' . $class1 . '">';
         $teamA .= ' ' . JoomleagueModelProject::getClubIconHtml($hometeam, 1);
         $teamA .= '</td>';
         $teamB .= '<td class="' . $class2 . '">';
         $teamB .= JoomleagueModelProject::getClubIconHtml($guestteam, 1) . ' ';
         $teamB .= '</td>';
         break;
     case 2:
         $teamA .= '<td class="' . $class1 . '">';
         $teamA .= Countries::getCountryFlag($hometeam->country);
         $teamA .= '</td>';
         $teamB .= '<td class="' . $class2 . '">';
         $teamB .= Countries::getCountryFlag($guestteam->country);
         $teamB .= '</td>';
         break;
     case 3:
         $teamA .= '<td class="' . $class1 . '">';
         $teamA .= JoomleagueHelper::getPictureThumb($hometeam->picture, $hometeam->name, $this->config['team_picture_width'], $this->config['team_picture_height'], 1);
         $teamA .= '</td>';
         $teamB .= '<td class="' . $class2 . '">';
         $teamB .= JoomleagueHelper::getPictureThumb($guestteam->picture, $guestteam->name, $this->config['team_picture_width'], $this->config['team_picture_height'], 1);
         $teamB .= '</td>';
         break;
 }
 $seperator = '<td width="10">' . $this->config['seperator'] . '</td>';
 $isFavTeam = in_array($guestteam->id, $this->favteams);
 $away = JoomleagueHelper::formatTeamName($guestteam, "g" . $match->id . "t" . $guestteam->id, $this->config, $isFavTeam, $awaylink);
 $teamB .= '<td class="' . $class2 . '">' . $away . '</td>';
			<td><?php 
echo $this->form->getInput('players');
?>
</td>
		</tr>
		
		<tr>
			<td class="key"><?php 
echo $this->form->getLabel('country');
?>
</td>
			<td><?php 
echo $this->form->getInput('country');
?>
&nbsp;<?php 
echo Countries::getCountryFlag($this->object->country);
?>
&nbsp;(<?php 
echo $this->object->country;
?>
)</td>
		</tr>
        <tr>
			<td class="key"><?php 
echo $this->form->getLabel('picture');
?>
</td>
			<td><?php 
echo $this->form->getInput('picture');
?>
</td>
 /**
  * get img for team
  * @param object ranking row
  * @param int type = 1 for club small logo, 2 for country
  * @return html string
  */
 function getLogo($item, $params)
 {
     $type = $params->get('show_logo');
     if ($type == 'country_flag' && !empty($item->country)) {
         return Countries::getCountryFlag($item->country, 'class="teamcountry"');
     }
     //dynamic object property string
     $pic = $params->get('show_picture');
     return JoomleagueHelper::getPictureThumb($item->{$pic}, $item->name, $params->get('team_picture_width'), $params->get('team_picture_height'), 3);
 }
				<?php 
}
?>

			<td width="50%" align="center" valign="top">
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td width="40%" align="right">
							<b>
								<?php 
echo JText::_('COM_JOOMLEAGUE_REFEREE_NAME');
?>
							</b>
						</td>
						<td width="60%" class="td_l">
							<?php 
$dummy = str_replace("%FIRSTNAME%", $this->referee->firstname, JText::_('COM_JOOMLEAGUE_REFEREE_NAME_FORM'));
$dummy = str_replace("%LASTNAME%", $this->referee->lastname, $dummy);
$outputName = $dummy;
echo $outputName;
echo "&nbsp;&nbsp;" . Countries::getCountryFlag($row->country);
?>
						</td>
					</tr>
				</table>
			</td>


	</table>
<br />
 function onContentSearch($text, $phrase = '', $ordering = '', $areas = null)
 {
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     // load plugin params info
     $plugin =& JPluginHelper::getPlugin('search', 'joomleague');
     $search_clubs = $this->params->def('search_clubs', 1);
     $search_teams = $this->params->def('search_teams', 1);
     $search_players = $this->params->def('search_players', 1);
     $search_playgrounds = $this->params->def('search_playgrounds', 1);
     $search_staffs = $this->params->def('search_staffs', 1);
     $search_referees = $this->params->def('search_referees', 1);
     $search_projects = $this->params->def('search_projects', 1);
     $text = trim($text);
     if ($text == '') {
         return array();
     }
     $wheres = array();
     switch ($phrase) {
         case 'any':
         default:
             $words = explode(' ', $text);
             $wheres = array();
             $wheresteam = array();
             $wheresperson = array();
             $wheresplayground = array();
             $wheresproject = array();
             if ($search_clubs) {
                 foreach ($words as $word) {
                     $word = $db->Quote('%' . $db->getEscaped($word, true) . '%', false);
                     $wheres2 = array();
                     $wheres2[] = 'c.name LIKE ' . $word;
                     $wheres2[] = 'c.alias LIKE ' . $word;
                     $wheres2[] = 'c.location LIKE ' . $word;
                     $wheres2[] = 'c.unique_id LIKE ' . $word;
                     $wheres[] = implode(' OR ', $wheres2);
                 }
             }
             if ($search_teams) {
                 foreach ($words as $word) {
                     $word = $db->Quote('%' . $db->getEscaped($word, true) . '%', false);
                     $wheres2 = array();
                     $wheres2[] = 't.name LIKE ' . $word;
                     $wheresteam[] = implode(' OR ', $wheres2);
                 }
             }
             if ($search_players || $search_referees || $search_staffs) {
                 foreach ($words as $word) {
                     $word = $db->Quote('%' . $db->getEscaped($word, true) . '%', false);
                     $wheres2 = array();
                     $wheres2[] = 'pe.firstname LIKE ' . $word;
                     $wheres2[] = 'pe.lastname LIKE ' . $word;
                     $wheres2[] = 'pe.nickname LIKE ' . $word;
                     $wheresperson[] = implode(' OR ', $wheres2);
                 }
             }
             if ($search_playgrounds) {
                 foreach ($words as $word) {
                     $word = $db->Quote('%' . $db->getEscaped($word, true) . '%', false);
                     $wheres2 = array();
                     $wheres2[] = 'pl.name LIKE ' . $word;
                     $wheres2[] = 'pl.city LIKE ' . $word;
                     $wheresplayground[] = implode(' OR ', $wheres2);
                 }
             }
             if ($search_projects) {
                 foreach ($words as $word) {
                     $word = $db->Quote('%' . $db->getEscaped($word, true) . '%', false);
                     $wheres2 = array();
                     $wheres2[] = 'pro.name LIKE ' . $word;
                     $wheres2[] = 'pro.staffel_id LIKE ' . $word;
                     $wheresproject[] = implode(' OR ', $wheres2);
                 }
             }
             $where = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $wheres) . ')';
             $whereteam = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $wheresteam) . ')';
             $wheresperson = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $wheresperson) . ')';
             $wheresplayground = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $wheresplayground) . ')';
             $wheresproject = '(' . implode($phrase == 'all' ? ') AND (' : ') OR (', $wheresproject) . ')';
             break;
     }
     $rows = array();
     if ($search_clubs) {
         $query = "SELECT 'Club' as section, c.name AS title," . " c.founded AS created," . " c.country," . " c.logo_big AS picture," . " CONCAT( 'Address: ',c.address,' ',c.zipcode,' ',c.location,' Phone: ',c.phone,' Fax: ',c.fax,' E-Mail: ',c.email,' Vereinsnummer: ',c.unique_id ) AS text," . " pt.project_id AS project," . " CONCAT( 'index.php?option=com_joomleague" . "&view=clubinfo&cid=', CONCAT_WS(':',c.id,c.alias) ,'&p=', CONCAT_WS(':',pro.id,pro.alias) ) AS href," . " '2' AS browsernav" . " FROM #__joomleague_club AS c" . " LEFT JOIN #__joomleague_team AS t" . " ON c.id = t.club_id" . " LEFT JOIN #__joomleague_project_team AS pt" . " ON pt.team_id = t.id" . " LEFT JOIN #__joomleague_project AS pro" . " ON pt.project_id = pro.id" . " WHERE ( " . $where . " ) " . " GROUP BY c.name ORDER BY c.name";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         $rows[] = $list;
     }
     if ($search_teams) {
         $query = "SELECT 'Team' as section, t.name AS title," . " t.checked_out_time AS created," . " CONCAT( 'Teamart:',t.info , ' Notes:', t.notes ) AS text," . " pt.project_id AS project, " . " pt.picture AS picture, " . " CONCAT( 'index.php?option=com_joomleague" . "&view=teaminfo&tid=', CONCAT_WS(':',t.id,t.alias) ,'&p=', CONCAT_WS(':',pro.id,pro.alias) ) AS href," . " '2' AS browsernav" . " FROM #__joomleague_team AS t" . " LEFT JOIN #__joomleague_project_team AS pt" . " ON pt.team_id = t.id" . " LEFT JOIN #__joomleague_project AS pro" . " ON pt.project_id = pro.id" . " WHERE ( " . $whereteam . " ) " . " GROUP BY t.name ORDER BY t.name";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         $rows[] = $list;
     }
     if ($search_players) {
         $query = "SELECT 'Person' as section, REPLACE(CONCAT(pe.firstname, ' \\'', pe.nickname, '\\' ' , pe.lastname ),'\\'\\'','') AS title," . " pe.birthday AS created," . " pe.country," . " pe.picture AS picture, " . " CONCAT( 'Birthday:',pe.birthday , ' Notes:', pe.notes ) AS text," . " pt.project_id AS project," . " CONCAT( 'index.php?option=com_joomleague" . "&view=player&pid=', CONCAT_WS(':',pe.id,pe.alias) ,'&p=', CONCAT_WS(':',pro.id,pro.alias) , '&tid=', CONCAT_WS(':',t.id,t.alias) ) AS href," . " '2' AS browsernav" . " FROM #__joomleague_person AS pe" . " LEFT JOIN #__joomleague_team_player AS tp" . " ON tp.person_id = pe.id" . " LEFT JOIN #__joomleague_project_team AS pt" . " ON pt.id = tp.projectteam_id" . " LEFT JOIN #__joomleague_team AS t" . " ON t.id = pt.team_id" . " LEFT JOIN #__joomleague_project AS pro" . " ON pt.project_id = pro.id" . " WHERE ( " . $wheresperson . " ) " . " AND pe.published = '1' " . " GROUP BY pe.lastname, pe.firstname, pe.nickname ORDER BY pe.lastname,pe.firstname,pe.nickname";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         $rows[] = $list;
     }
     if ($search_staffs) {
         $query = "SELECT 'Staff' as section, REPLACE(CONCAT(pe.firstname, ' \\'', pe.nickname, '\\' ' , pe.lastname ),'\\'\\'','') AS title," . " pe.birthday AS created," . " pe.country," . " pe.picture AS picture, " . " CONCAT( 'Birthday:',pe.birthday , ' Notes:', pe.notes ) AS text," . " pt.project_id AS project," . " CONCAT( 'index.php?option=com_joomleague" . "&view=staff&pid=', CONCAT_WS(':',pe.id,pe.alias) ,'&p=', CONCAT_WS(':',pro.id,pro.alias), '&tid=', CONCAT_WS(':',t.id,t.alias) ) AS href," . " '2' AS browsernav" . " FROM #__joomleague_person AS pe" . " LEFT JOIN #__joomleague_team_staff AS ts" . " ON ts.person_id = pe.id" . " LEFT JOIN #__joomleague_project_team AS pt" . " ON pt.id = tp.projectteam_id" . " LEFT JOIN #__joomleague_team AS t" . " ON t.id = pt.team_id" . " LEFT JOIN #__joomleague_project AS pro" . " ON pt.project_id = pro.id" . " WHERE ( " . $wheresperson . " ) " . " AND pe.published = '1' " . " GROUP BY pe.lastname, pe.firstname, pe.nickname ORDER BY pe.lastname,pe.firstname,pe.nickname";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         $rows[] = $list;
     }
     if ($search_referees) {
         $query = "SELECT 'Referee' as section, REPLACE(CONCAT(pe.firstname, ' \\'', pe.nickname, '\\' ' , pe.lastname ),'\\'\\'','') AS title," . " pe.birthday AS created," . " pe.country," . " pe.picture AS picture, " . " CONCAT( 'Birthday:', pe.birthday, ' Notes:', pe.notes ) AS text," . " pr.project_id AS project," . " CONCAT( 'index.php?option=com_joomleague" . "&view=referee&pid=', CONCAT_WS(':',pe.id,pe.alias) ,'&p=', CONCAT_WS(':',pro.id,pro.alias) ) AS href," . " '2' AS browsernav" . " FROM #__joomleague_person AS pe" . " LEFT JOIN #__joomleague_project_referee AS pr" . " ON pr.person_id = pe.id" . " LEFT JOIN #__joomleague_project AS pro" . " ON pr.project_id = pro.id" . " WHERE ( " . $wheresperson . " ) " . " AND pe.published = '1' " . " GROUP BY pe.lastname, pe.firstname, pe.nickname ORDER BY pe.lastname,pe.firstname,pe.nickname";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         $rows[] = $list;
     }
     if ($search_playgrounds) {
         $query = "SELECT 'Playground' as section, pl.name AS title," . " pl.checked_out_time AS created," . " pl.country," . " pl.picture AS picture, " . " pl.notes AS text," . " r.project_id AS project," . " CONCAT( 'index.php?option=com_joomleague" . "&view=playground&pgid=', CONCAT_WS(':',pl.id,pl.alias) ,'&p=', CONCAT_WS(':',pro.id,pro.alias) ) AS href," . " '2' AS browsernav" . " FROM #__joomleague_playground AS pl" . " LEFT JOIN #__joomleague_club AS c" . " ON c.id = pl.club_id" . " LEFT JOIN #__joomleague_match AS m" . " ON m.playground_id = pl.id" . " LEFT JOIN #__joomleague_round AS r" . " ON m.round_id = r.id" . " LEFT JOIN #__joomleague_project AS pro" . " ON r.project_id = pro.id" . " WHERE ( " . $wheresplayground . " ) " . " GROUP BY pl.name ORDER BY pl.name ";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         $rows[] = $list;
     }
     if ($search_projects) {
         $query = "SELECT 'Project' as section, pro.name AS title," . " pro.checked_out_time AS created," . " l.country," . " pro.picture AS picture, " . " CONCAT( pro.name, ' Staffel-ID (', pro.staffel_id, ')' ) AS text," . " pro.id AS project," . " CONCAT( 'index.php?option=com_joomleague" . "&view=ranking&type=', '0','&p=', CONCAT_WS(':',pro.id,pro.alias) ) AS href," . " '2' AS browsernav" . " FROM #__joomleague_project AS pro" . " LEFT JOIN #__joomleague_league AS l" . " ON l.id = pro.league_id" . " WHERE ( " . $wheresproject . " ) " . " GROUP BY pro.name ORDER BY pro.name ";
         $db->setQuery($query);
         $list = $db->loadObjectList();
         $rows[] = $list;
     }
     $results = array();
     if (count($rows)) {
         foreach ($rows as $row) {
             if ($row) {
                 foreach ($row as $output) {
                     //echo 'country<pre>'.print_r($output->country,true).'</pre><br>';
                     //echo 'picture<pre>'.print_r($output->picture,true).'</pre><br>';
                     $output->href = JRoute::_($output->href);
                     if ($output->country) {
                         $flag = Countries::getCountryFlag($output->country);
                         $output->flag = $flag;
                         $output->text = $flag . ' ' . $output->text;
                     }
                     if ($output->picture) {
                         $output->text = '<p><img style="float: left;" src="' . $output->picture . '" alt="" width="50" height="" >' . $output->text . '</p>';
                     }
                 }
             }
         }
         foreach ($rows as $row) {
             // diddipoeler
             // testausgabe
             //echo '<pre>'.print_r($row,true).'</pre><br>';
             $results = array_merge($results, (array) $row);
         }
     }
     return $results;
 }
 function sendMemberTipResults($predictionMemberID, $predictionGameID, $RoundID, $ProjectID, $joomlaUserID)
 {
     $option = JRequest::getCmd('option');
     $document =& JFactory::getDocument();
     $mainframe =& JFactory::getApplication();
     $configprediction = $this->getPredictionTemplateConfig('predictionentry');
     $overallConfig = $this->getPredictionOverallConfig();
     $configprediction = array_merge($overallConfig, $configprediction);
     $predictionProjectSettings = $this->getPredictionProject($ProjectID);
     $predictionProject = $this->getPredictionGame();
     $predictionProjectS = $this->getPredictionProjectS();
     if ($configprediction['use_pred_select_matches']) {
         $match_ids = $configprediction['predictionmatchid'];
     }
     $roundResults = $this->getMatchesDataForPredictionEntry($predictionGameID, $ProjectID, $RoundID, $joomlaUserID, $match_ids);
     //  $mainframe->enqueueMessage(JText::_('roundResults -> <pre> '.print_r($roundResults,true).'</pre><br>' ),'Notice');
     //  $mainframe->enqueueMessage(JText::_('predictionProject -> <pre> '.print_r($predictionProject,true).'</pre><br>' ),'Notice');
     //  $mainframe->enqueueMessage(JText::_('predictionProjectS -> <pre> '.print_r($predictionProjectS,true).'</pre><br>' ),'Notice');
     $predictionGameMemberMail = $this->getPredictionMemberEMailAdress($predictionMemberID);
     //$mainframe->enqueueMessage(JText::_('predictionGameMemberMail -> <pre> '.print_r($predictionGameMemberMail,true).'</pre><br>' ),'Notice');
     //Fetch the mail object
     $mailer =& JFactory::getMailer();
     // als html
     $mailer->isHTML(TRUE);
     //Set a sender
     $config =& JFactory::getConfig();
     $sender = array($config->getValue('config.mailfrom'), $config->getValue('config.fromname'));
     $mailer->setSender($sender);
     $mailer->addRecipient($predictionGameMemberMail);
     //Create the mail
     $mailer->setSubject(JText::_('COM_JOOMLEAGUE_PRED_ENTRY_MAIL_TITLE'));
     foreach ($predictionProjectS as $predictionProject) {
         $body = '';
         // jetzt die ergebnisse
         $body .= "<html>";
         $body .= "<table class='blog' cellpadding='0' cellspacing='0' width='100%'>";
         $body .= "<tr>";
         $body .= "<td class='sectiontableheader'>";
         $body .= JText::sprintf('COM_JOOMLEAGUE_PRED_HEAD_ACTUAL_PRED_GAME', '<b><i>' . $predictionProject->projectName . '</i></b>');
         $body .= "</td>";
         $body .= "</tr>";
         $body .= "</table>";
         $body .= "<table width='100%' cellpadding='0' cellspacing='0'>";
         $body .= "<tr>";
         $body .= "<th class='sectiontableheader' style='text-align:center;'>" . JText::_('COM_JOOMLEAGUE_PRED_ENTRY_DATE_TIME') . "</th>";
         $body .= "<th class='sectiontableheader' style='text-align:center;' colspan='5' >" . JText::_('COM_JOOMLEAGUE_PRED_ENTRY_MATCH') . "</th>";
         $body .= "<th class='sectiontableheader' style='text-align:center;'>" . JText::_('COM_JOOMLEAGUE_PRED_ENTRY_RESULT') . "</th>";
         $body .= "<th class='sectiontableheader' style='text-align:center;'>" . JText::_('COM_JOOMLEAGUE_PRED_ENTRY_YOURS') . "</th>";
         $body .= "<th class='sectiontableheader' style='text-align:center;'>" . JText::_('COM_JOOMLEAGUE_PRED_ENTRY_POINTS') . "</th>";
         $body .= "</tr>";
         // schleife über die ergebnisse in der runde
         foreach ($roundResults as $result) {
             $class = $k == 0 ? 'sectiontableentry1' : 'sectiontableentry2';
             $resultHome = isset($result->team1_result) ? $result->team1_result : '-';
             if (isset($result->team1_result_decision)) {
                 $resultHome = $result->team1_result_decision;
             }
             $resultAway = isset($result->team2_result) ? $result->team2_result : '-';
             if (isset($result->team2_result_decision)) {
                 $resultAway = $result->team2_result_decision;
             }
             $closingtime = $configprediction['closing_time'];
             //3600=1 hour
             $matchTimeDate = JoomleagueHelper::getTimestamp($result->match_date, 1, $predictionProjectSettings->serveroffset);
             $thisTimeDate = JoomleagueHelper::getTimestamp('', 1, $predictionProjectSettings->serveroffset);
             $matchTimeDate = $matchTimeDate - $closingtime;
             $body .= "<tr class='" . $class . "'>";
             $body .= "<td class='td_c'>";
             $body .= JHtml::date($result->match_date, 'd.m.Y H:i', false);
             $body .= " - ";
             //$body .= JHTML::date(date("Y-m-d H:i:s",$matchTimeDate),$configprediction['time_format']);
             $body .= "</td>";
             $homeName = $this->getMatchTeam($result->projectteam1_id);
             $awayName = $this->getMatchTeam($result->projectteam2_id);
             // clublogo oder vereinsflagge hometeam
             $body .= "<td nowrap='nowrap' class='td_r'>";
             $body .= $homeName;
             $body .= "</td>";
             $body .= "<td nowrap='nowrap' class='td_c'>";
             if ($configprediction['show_logo_small'] == 1) {
                 $logo_home = $this->getMatchTeamClubLogo($result->projectteam1_id);
                 if ($logo_home == '' || !file_exists($logo_home)) {
                     $logo_home = 'images/com_joomleague/database/placeholders/placeholder_small.gif';
                 }
                 $imgTitle = JText::sprintf('COM_JOOMLEAGUE_PRED_ENTRY_LOGO_OF', $homeName);
                 $body .= JHTML::image(JURI::root() . $logo_home, $imgTitle, array(' title' => $imgTitle));
                 $body .= ' ';
             }
             if ($configprediction['show_logo_small'] == 2) {
                 $country_home = $this->getMatchTeamClubFlag($result->projectteam1_id);
                 $body .= Countries::getCountryFlag($country_home);
             }
             $body .= "</td>";
             $body .= "<td nowrap='nowrap' class='td_c'>";
             $body .= "<b>" . $configprediction['seperator'] . "</b>";
             $body .= "</td>";
             // clublogo oder vereinsflagge awayteam
             $body .= "<td nowrap='nowrap' class='td_c'>";
             if ($configprediction['show_logo_small'] == 1) {
                 $logo_away = $this->getMatchTeamClubLogo($result->projectteam2_id);
                 if ($logo_away == '' || !file_exists($logo_away)) {
                     $logo_away = 'images/com_joomleague/database/placeholders/placeholder_small.gif';
                 }
                 $imgTitle = JText::sprintf('COM_JOOMLEAGUE_PRED_ENTRY_LOGO_OF', $awayName);
                 $body .= ' ';
                 $body .= JHTML::image(JURI::root() . $logo_away, $imgTitle, array(' title' => $imgTitle));
             }
             if ($configprediction['show_logo_small'] == 2) {
                 $country_away = $this->getMatchTeamClubFlag($result->projectteam2_id);
                 $body .= Countries::getCountryFlag($country_away);
             }
             $body .= "</td>";
             $body .= "<td nowrap='nowrap' class='td_l'>";
             $body .= $awayName;
             $body .= "</td>";
             // spielergebnisse
             $body .= "<td class='td_c'>";
             $body .= $resultHome . $configprediction['seperator'] . $resultAway;
             $body .= "</td>";
             // tippergebnisse
             $body .= "<td class='td_c'>";
             if ($predictionProject->mode == '0') {
                 $body .= $result->tipp_home . $configprediction['seperator'] . $result->tipp_away;
             }
             if ($predictionProject->mode == '1') {
                 $body .= $result->tipp;
             }
             $body .= "</td>";
             // punkte
             $body .= "<td class='td_c'>";
             $points = $this->getMemberPredictionPointsForSelectedMatch($predictionProject, $result);
             $totalPoints = $totalPoints + $points;
             $body .= $points;
             $body .= "</td>";
             $body .= "</tr>";
             // tendencen im tippspiel
             if ($configprediction['show_tipp_tendence']) {
                 $body .= "<tr class='tipp_tendence'>";
                 $body .= "<td class='td_c'>";
                 $body .= "&nbsp;";
                 $body .= "</td>";
                 $body .= "<td class='td_l' colspan='8'>";
                 $totalCount = $this->getTippCountTotal($predictionGameID, $result->id);
                 $homeCount = $this->getTippCountHome($predictionGameID, $result->id);
                 $awayCount = $this->getTippCountAway($predictionGameID, $result->id);
                 $drawCount = $this->getTippCountDraw($predictionGameID, $result->id);
                 if ($totalCount > 0) {
                     $percentageH = round($homeCount * 100 / $totalCount, 2);
                     $percentageD = round($drawCount * 100 / $totalCount, 2);
                     $percentageA = round($awayCount * 100 / $totalCount, 2);
                 } else {
                     $percentageH = 0;
                     $percentageD = 0;
                     $percentageA = 0;
                 }
                 $body .= "<span style='color:" . $configprediction['color_home_win'] . "' >";
                 $body .= JText::sprintf('COM_JOOMLEAGUE_PRED_ENTRY_PERCENT_HOME_WIN', $percentageH, $homeCount) . "</span><br />";
                 $body .= "<span style='color:" . $configprediction['color_draw'] . "'>";
                 $body .= JText::sprintf('COM_JOOMLEAGUE_PRED_ENTRY_PERCENT_DRAW', $percentageD, $drawCount) . "</span><br />";
                 $body .= "<span style='color:" . $configprediction['color_guest_win'] . "'>";
                 $body .= JText::sprintf('COM_JOOMLEAGUE_PRED_ENTRY_PERCENT_AWAY_WIN', $percentageA, $awayCount) . "</span>";
                 $body .= "</td>";
                 //$body .= "<td colspan='8'>&nbsp;</td>";
                 $body .= "</tr>";
             } else {
                 $k = 1 - $k;
             }
         }
         $body .= "<tr>";
         $body .= "<td colspan='8'>&nbsp;</td>";
         $body .= "<td class='td_c'>" . JText::sprintf('COM_JOOMLEAGUE_PRED_ENTRY_TOTAL_POINTS_COUNT', $totalPoints) . "</td>";
         $body .= "</tr>";
         $body .= "<table>";
         if ($configprediction['show_help'] == 1 || $configprediction['show_help'] == 2) {
             $body .= $this->createHelptText($predictionProject->mode);
         }
         $body .= "</html>";
     }
     $mailer->setBody($body);
     //Sending the mail
     $send =& $mailer->Send();
     if ($send !== true) {
         //echo 'Error sending email to:<br />'.print_r($recipient,true).'<br />';
         //echo 'Error message: '.$send->message;
         $mainframe->enqueueMessage(JText::_('COM_JOOMLEAGUE_PRED_ENTRY_MAIL_SEND_ERROR'), 'Error');
     } else {
         //echo 'Mail sent';
         $emailadresses = implode(",", $predictionGameMemberMail);
         $mainframe->enqueueMessage(JText::sprintf('COM_JOOMLEAGUE_PRED_ENTRY_MAIL_SEND_OK', $emailadresses), '');
     }
 }
Beispiel #29
0
            $picture = $this->team2->{$pic};
            $type = 1;
            echo JoomleagueHelper::getPictureThumb($picture, $this->team2->name, $this->config['team_picture_width'], $this->config['team_picture_height'], $type);
            break;
        case 'country_small':
            $type = 6;
            $pic = 'country';
            if ($this->team2->{$pic} != '' && !empty($this->team2->{$pic})) {
                echo Countries::getCountryFlag($this->team2->{$pic}, 'height="11"');
            }
            break;
        case 'country_big':
            $type = 7;
            $pic = 'country';
            if ($this->team2->{$pic} != '' && !empty($this->team2->{$pic})) {
                echo Countries::getCountryFlag($this->team2->{$pic}, 'height="50"');
            }
            break;
    }
    ?>
		</td>
	</tr>

    <?php 
}
// end team logo
?>

	<tr>
		<td class="team">
			<?php 
                        echo $playerName;
                        ?>
" title="zum Zoomen anklicken" width="<?php 
                        echo $this->config['player_picture_width'];
                        ?>
" /></a>
    <?php 
                    }
                    ?>
		</td><?php 
                }
                if ($this->config['show_country_flag']) {
                    ?>
		<td width="16" nowrap="nowrap" style="text-align:center; ">
			<?php 
                    echo Countries::getCountryFlag($players->country);
                    ?>
		</td><?php 
                }
                ?>
		<td class="td_l"><?php 
                if ($this->config['link_player'] == 1) {
                    $link = JoomleagueHelperRoute::getPlayerRoute($this->project->slug, $this->team->slug, $players->slug);
                    echo JHTML::link($link, '<span class="playername">' . $playerName . '</span>');
                } else {
                    echo '<span class="playername">' . $playerName . '</span>';
                }
                ?>
        </td>
        <?php 
                if ($this->config['show_birthday'] > 0) {