# set stream encoding if possible to avoid converting issues if (function_exists('stream_encoding')) { stream_encoding($fp, $cs_main['charset']); } fwrite($fp, $text); fclose($fp); cs_redirect($cs_lang['success'], 'options', 'roots'); } else { $data = array(); $data['head']['message'] = cs_getmsg(); $data['op'] = cs_sql_option(__FILE__, 'wars'); $pholders = array(); $pholders['{SQUADNAME}'] = $cs_lang['op_squadname']; $pholders['{SQUADURL}'] = $cs_lang['op_squadurl']; $pholders['{OPPONENTNAME}'] = $cs_lang['op_opponentname']; $pholders['{OPPONENTURL}'] = $cs_lang['op_opponenturl']; $pholders['{SCORE_1}'] = $cs_lang['op_score1']; $pholders['{SCORE_2}'] = $cs_lang['op_score2']; $pholders['{MATCH_URL}'] = $cs_lang['op_matchurl']; $pholders['{CAT_NAME}'] = $cs_lang['op_catname']; $lang = cs_substr($account['users_lang'], 0, 2); if (!file_exists('uploads/wars/news_' . $lang . '.txt')) { $lang = 'de'; } $data['news']['text'] = file_get_contents('uploads/wars/news_' . $lang . '.txt'); $data['pholders'] = array(); foreach ($pholders as $holder => $meaning) { $data['pholders'][] = array('holder' => $holder, 'meaning' => $meaning); } echo cs_subtemplate(__FILE__, $data, 'wars', 'options'); }
for ($run = 0; $run < $loop_temp; $run++) { $a = cs_substr($temp[$run], 0, 6); //check is this a squad $b = cs_substr($temp[$run], 0, 5); //check is this a clan if ($a == 'Squad:') { if (!empty($where)) { $where = $where . ' OR '; } $z = cs_substr($temp[$run], 6); $where .= "squ.squads_name = '" . cs_sql_escape(str_replace('Squad:', '', $temp[$run])) . "'"; } elseif ($b == 'Clan:') { if (!empty($where)) { $where = $where . ' OR '; } $z = cs_substr($temp[$run], 5); $where .= "cla.clans_name = '" . cs_sql_escape(str_replace('Clan:', '', $temp[$run])) . "'"; } else { if (!empty($where)) { $where .= ' OR '; } $where .= "usr.users_nick = '" . cs_sql_escape($temp[$run]) . "'"; $z = $temp[$run]; } } $from = 'users usr LEFT JOIN {pre}_members mem ON usr.users_id = mem.users_id '; $from .= 'LEFT JOIN {pre}_squads squ ON mem.squads_id = squ.squads_id '; $from .= 'LEFT JOIN {pre}_clans cla ON squ.clans_id = cla.clans_id'; $select = 'usr.users_id AS users_id, usr.users_nick AS users_nick, usr.users_email AS users_email'; $order = ''; $cs_messages = cs_sql_select(__FILE__, $from, $select, $where, 0, 0, 0);
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('faq'); $max = 40; $data = array(); $data['count']['faq'] = cs_sql_count(__FILE__, 'faq'); $cells = 'categories_id, categories_name'; $where = "categories_mod = 'faq' AND categories_access <= '" . $account['access_faq'] . "'"; $data['categories'] = cs_sql_select(__FILE__, 'categories', $cells, $where, 'categories_name', 0, 0); $count_categories = count($data['categories']); for ($run = 0; $run < $count_categories; $run++) { $data['categories'][$run]['categories_name'] = cs_secure($data['categories'][$run]['categories_name']); $cells = 'faq_id, faq_question, faq_answer'; $cond = 'categories_id = \'' . $data['categories'][$run]['categories_id'] . '\''; $data['categories'][$run]['faq'] = cs_sql_select(__FILE__, 'faq', $cells, $cond, 'faq_id ASC', 0, 0); $data['categories'][$run]['faq'] = empty($data['categories'][$run]['faq']) ? array() : $data['categories'][$run]['faq']; $count_faq = count($data['categories'][$run]['faq']); for ($run2 = 0; $run2 < $count_faq; $run2++) { $data['categories'][$run]['faq'][$run2]['faq_question'] = strlen($data['categories'][$run]['faq'][$run2]['faq_question']) < $max ? cs_secure($data['categories'][$run]['faq'][$run2]['faq_question'], 1) : cs_substr(cs_secure($data['categories'][$run]['faq'][$run2]['faq_question']), 0, $max - 2) . '..'; $data['categories'][$run]['faq'][$run2]['faq_answer'] = strlen($data['categories'][$run]['faq'][$run2]['faq_answer']) < $max ? cs_secure($data['categories'][$run]['faq'][$run2]['faq_answer'], 1, 1, 1, 1) : cs_substr(cs_secure($data['categories'][$run]['faq'][$run2]['faq_answer'], 1, 1, 1, 1), 0, $max - 2) . '..'; } } echo cs_subtemplate(__FILE__, $data, 'faq', 'list');
// ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('news'); $cs_get = cs_get('catid'); $cs_option = cs_sql_option(__FILE__, 'news'); $data = array(); $tables = 'news ne INNER JOIN {pre}_categories cat ON ne.categories_id = cat.categories_id'; $select = 'ne.news_id AS news_id, ne.news_headline AS news_headline, ne.news_time AS news_time'; $public = 'ne.news_public > \'0\' AND cat.categories_access <= \'' . $account['access_news'] . '\''; if (!empty($cs_get['catid'])) { $public .= ' AND cat.categories_id = ' . $cs_get['catid']; } $order = 'ne.news_time DESC'; $cs_news = cs_sql_select(__FILE__, $tables, $select, $public, $order, 0, $cs_option['max_navlist']); if (empty($cs_news)) { echo $cs_lang['no_data']; } else { if ($cs_option['max_navlist'] == 1) { $cs_news = array(0 => $cs_news); } $run = 0; foreach ($cs_news as $news) { $data['news'][$run]['news_time'] = cs_date('unix', $news['news_time'], 1, 1, 0); $short = strlen($news['news_headline']) <= $cs_option['max_headline'] ? $news['news_headline'] : cs_substr($news['news_headline'], 0, $cs_option['max_headline']) . '...'; $data['news'][$run]['news_url'] = cs_url('news', 'view', 'id=' . $news['news_id']); $data['news'][$run]['news_short'] = cs_secure($short); $data['news'][$run]['news_headline'] = cs_secure($news['news_headline']); $run++; } echo cs_subtemplate(__FILE__, $data, 'news', 'navlist'); }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('files'); $cs_get = cs_get('catid'); $cs_option = cs_sql_option(__FILE__, 'files'); $data = array(); $join = 'files fls INNER JOIN {pre}_categories cat ON fls.categories_id = cat.categories_id'; $select = 'files_name, files_time, files_id'; $where = 'cat.categories_access <= ' . (int) $account['access_files']; if (!empty($cs_get['catid'])) { $where .= ' AND cat.categories_id = ' . $cs_get['catid']; } $order = 'files_time DESC'; $data['files'] = cs_sql_select(__FILE__, $join, $select, $where, $order, 0, $cs_option['max_navlist']); if (!empty($data['files'])) { $files_loop = count($data['files']); for ($run = 0; $run < $files_loop; $run++) { $data['files'][$run]['date'] = cs_date('unix', $data['files'][$run]['files_time']); $data['files'][$run]['files_name'] = strlen($data['files'][$run]['files_name']) > $cs_option['max_headline'] ? cs_substr($data['files'][$run]['files_name'], 0, $cs_option['max_headline']) . '..' : $data['files'][$run]['files_name']; } echo cs_subtemplate(__FILE__, $data, 'files', 'navlist'); } else { echo $cs_lang['no_data']; }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('templates'); if (!empty($_SESSION['tpl_preview'])) { $ending = cs_substr($_SESSION['tpl_preview'], -3); } if (!empty($ending) && $ending != '{2}') { $_SESSION['tpl_preview'] .= '{2}'; die; } elseif (!empty($ending)) { $cs_main['template'] = cs_substr($_SESSION['tpl_preview'], 0, -3); $ajax_preview = 1; unset($_SESSION['tpl_preview']); } elseif (!empty($_GET['template']) && !empty($account['users_ajax'])) { $_SESSION['tpl_preview'] = $_GET['template']; } $templates = cs_checkdirs('templates'); $tpl_all = count($templates); $activate = isset($_GET['activate']) ? $_GET['activate'] : 0; $activate = $activate == 'install' ? 0 : $activate; $allow = 0; if (!empty($activate)) { foreach ($templates as $mod) { if ($mod['dir'] == $activate) { $allow++; } } } if (!empty($activate) and !empty($allow)) {
$data['in'][$run]['money'] = cs_secure($data['in'][$run]['cash_money']); $inout = $data['in'][$run]['cash_inout']; if ($inout == 'in') { $icon = 'green'; } elseif ($inout == 'out') { $icon = 'red'; } $data['in'][$run]['in_out'] = cs_html_img('symbols/clansphere/' . $icon . '.gif'); } // Auszahlungen $data['sort2']['date'] = cs_sort('cash', 'center', $start, 0, 1, $sort); $data['sort2']['money'] = cs_sort('cash', 'center', $start, 0, 3, $sort); $where = "cash_inout = 'out'"; $data['out'] = cs_sql_select(__FILE__, 'cash', '*', $where, $order, $start, $account['users_limit']); $cash_loop = count($data['out']); for ($run = 0; $run < $cash_loop; $run++) { $data['out'][$run]['date'] = cs_date('date', $data['out'][$run]['cash_time']); $data['out'][$run]['id'] = $data['out'][$run]['cash_id']; $text = $data['out'][$run]['cash_text']; $text = cs_substr($text, 0, 25); $data['out'][$run]['for'] = cs_secure($text); $data['out'][$run]['money'] = cs_secure($data['out'][$run]['cash_money']); $inout = $data['out'][$run]['cash_inout']; if ($inout == 'in') { $icon = 'green'; } elseif ($inout == 'out') { $icon = 'red'; } $data['out'][$run]['in_out'] = cs_html_img('symbols/clansphere/' . $icon . '.gif'); } echo cs_subtemplate(__FILE__, $data, 'cash', 'center');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('history'); empty($_REQUEST['start']) ? $start = 0 : ($start = $_REQUEST['start']); $cs_sort[1] = 'history_time DESC'; $cs_sort[2] = 'history_time ASC'; $cs_sort[3] = 'history_text DESC'; $cs_sort[4] = 'history_text ASC'; $sort = empty($_REQUEST['sort']) ? 1 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $history_count = cs_sql_count(__FILE__, 'history'); $data = array(); $cells = 'hs.history_time AS history_time, hs.history_text AS history_text, '; $data['history'] = cs_sql_select(__FILE__, 'history', '*', 0, $order, $start, $account['users_limit']); $history_loop = count($data['history']); $data['url']['create'] = cs_url('history', 'create'); $data['count']['history'] = $history_count; $data['head']['message'] = cs_getmsg(); $data['head']['pages'] = cs_pages('history', 'manage', $history_count, $start, $sort); $data['sort']['time'] = cs_sort('history', 'manage', $start, 0, 1, $sort); $data['sort']['text'] = cs_sort('history', 'manage', $start, 0, 3, $sort); for ($run = 0; $run < $history_loop; $run++) { $data['history'][$run]['text'] = cs_secure(cs_substr($data['history'][$run]['history_text'], 0, 17)) . '...'; $data['history'][$run]['time'] = cs_date('unix', $data['history'][$run]['history_time'], 1); $data['history'][$run]['url_edit'] = cs_url('history', 'edit', 'id=' . $data['history'][$run]['history_id']); $data['history'][$run]['url_remove'] = cs_url('history', 'remove', 'id=' . $data['history'][$run]['history_id']); } echo cs_subtemplate(__FILE__, $data, 'history', 'manage');
} require_once 'mods/clansphere/filetype.php'; for ($run = 0; $run < $count_att; $run++) { $file = $cs_att[$run]['boardfiles_name']; $extension = strlen(strrchr($file, ".")); $name = strlen($file); $ext = substr($file, $name - $extension + 1, $name); $ext_lower = strtolower($ext); $data['attachments'][$run]['icon'] = cs_filetype($ext_lower); if (file_exists('uploads/board/files/' . $cs_att[$run]['boardfiles_id'] . '.' . $ext)) { $file_file = filesize('uploads/board/files/' . $cs_att[$run]['boardfiles_id'] . '.' . $ext); $data['attachments'][$run]['filename'] = cs_html_link($cs_main['php_self']['dirname'] . 'mods/board/attachment.php?id=' . $cs_att[$run]['boardfiles_id'], $file, 1); $data['attachments'][$run]['size'] = cs_filesize($file_file); } elseif (file_exists('uploads/board/files/' . $file)) { $file_file = filesize('uploads/board/files/' . $file); $data['attachments'][$run]['filename'] = cs_html_link($cs_main['php_self']['dirname'] . 'mods/board/attachment.php?name=' . $file, $file, 1); $data['attachments'][$run]['size'] = cs_filesize($file_file); } else { $data['attachments'][$run]['filename'] = $cs_lang['no_att_exist']; $data['attachments'][$run]['size'] = cs_filesize(0); } $threads_headline = $cs_att[$run]['threads_headline']; $data['attachments'][$run]['topics'] = strlen($threads_headline) <= 15 ? $threads_headline : cs_substr($threads_headline, 0, 15) . '...'; $data['attachments'][$run]['threads_headline'] = $threads_headline; $data['attachments'][$run]['topics_link'] = cs_url('board', 'thread', 'where=' . $cs_att[$run]['threads_id']); $data['attachments'][$run]['downloaded'] = $cs_att[$run]['boardfiles_downloaded']; $data['attachments'][$run]['user'] = $cs_att[$run]['users_nick']; $data['attachments'][$run]['user_link'] = cs_url('users', 'view', 'id=' . $cs_att[$run]['users_id']); $data['attachments'][$run]['remove'] = cs_url('board', 'delatt_admin', 'id=' . $cs_att[$run]['boardfiles_id']); } echo cs_subtemplate(__FILE__, $data, 'board', 'attachements_admin');
$cs_lang = cs_translate('articles'); $cs_get = cs_get('catid'); $cs_option = cs_sql_option(__FILE__, 'articles'); $data = array(); //cut headline after... $figures = 15; $select = 'ar.articles_id AS articles_id, ar.articles_headline AS articles_headline, ar.articles_time AS articles_time'; $check = 'ar.articles_navlist > \'0\' AND cat.categories_access <= \'' . $account['access_articles'] . '\''; if (!empty($cs_get['catid'])) { $check .= ' AND cat.categories_id = ' . $cs_get['catid']; } $order = 'ar.articles_time DESC'; $tables = 'articles ar INNER JOIN {pre}_categories cat ON ar.categories_id = cat.categories_id'; $cs_articles = cs_sql_select(__FILE__, $tables, $select, $check, 'ar.articles_time DESC', 0, $cs_option['max_navlist']); if (empty($cs_articles)) { echo $cs_lang['no_data']; } else { if ($cs_option['max_navlist'] == 1) { $cs_articles = array(0 => $cs_articles); } $run = 0; foreach ($cs_articles as $articles) { $data['articles'][$run]['articles_time'] = cs_date('unix', $articles['articles_time'], 1, 1, 0); $short = strlen($articles['articles_headline']) <= $figures ? $articles['articles_headline'] : cs_substr($articles['articles_headline'], 0, $figures) . '...'; $data['articles'][$run]['articles_url'] = cs_url('articles', 'view', 'id=' . $articles['articles_id']); $data['articles'][$run]['articles_short'] = cs_secure($short); $data['articles'][$run]['articles_headline'] = cs_secure($articles['articles_headline']); $run++; } echo cs_subtemplate(__FILE__, $data, 'articles', 'navlist'); }
$data['link']['attachments_count'] = $count_att; if (empty($count_att)) { $data['attachments'] = ''; } require_once 'mods/clansphere/filetype.php'; for ($run = 0; $run < $count_att; $run++) { $file = $cs_att[$run]['boardfiles_name']; $extension = strlen(strrchr($file, ".")); $name = strlen($file); $ext = substr($file, $name - $extension + 1, $name); $ext_lower = strtolower($ext); $data['attachments'][$run]['img'] = cs_filetype($ext_lower); if (file_exists('uploads/board/files/' . $cs_att[$run]['boardfiles_id'] . '.' . $ext)) { $file_file = filesize('uploads/board/files/' . $cs_att[$run]['boardfiles_id'] . '.' . $ext); $data['attachments'][$run]['filename'] = cs_html_link('mods/board/attachment.php?id=' . $cs_att[$run]['boardfiles_id'], $file, 1); $data['attachments'][$run]['size'] = cs_filesize($file_file); } elseif (file_exists('uploads/board/files/' . $file)) { $file_file = filesize('uploads/board/files/' . $file); $data['attachments'][$run]['filename'] = cs_html_link('mods/board/attachment.php?name=' . $file, $file, 1); $data['attachments'][$run]['size'] = cs_filesize($file_file); } else { $data['attachments'][$run]['filename'] = $cs_lang['no_att_exist']; $data['attachments'][$run]['size'] = cs_filesize(0); } $headline = strlen($cs_att[$run]['threads_headline']) <= 15 ? $cs_att[$run]['threads_headline'] : cs_substr($cs_att[$run]['threads_headline'], 0, 15) . '...'; $data['attachments'][$run]['topics'] = cs_link($headline, 'board', 'thread', 'where=' . $cs_att[$run]['threads_id'], 0, $cs_att[$run]['threads_headline']); $data['attachments'][$run]['downloaded'] = $cs_att[$run]['boardfiles_downloaded']; $img_del = cs_icon('editdelete', 16, $cs_lang['remove']); $data['attachments'][$run]['remove'] = cs_link($img_del, 'board', 'delatt', 'id=' . $cs_att[$run]['boardfiles_id'], 0, $cs_lang['remove']); } echo cs_subtemplate(__FILE__, $data, 'board', 'attachments');
$where = !empty($categories_id) ? "categories_id = '" . $categories_id . "'" : 0; $links_count = cs_sql_count(__FILE__, 'links', $where); $cells = 'categories_id, categories_name'; $categories_data = cs_sql_select(__FILE__, 'categories', $cells, "categories_mod = 'links'", 'categories_name', 0, 0); $data['head']['count'] = $links_count; $data['head']['pages'] = cs_pages('links', 'manage', $links_count, $start, $categories_id, $sort); $data['head']['cat_dropdown'] = cs_dropdown('where', 'categories_name', $categories_data, $categories_id, 'categories_id'); $data['head']['getmsg'] = cs_getmsg(); $data['sort']['name'] = cs_sort('links', 'manage', $start, $categories_id, 1, $sort); $tables = 'links ln INNER JOIN {pre}_categories cat ON ln.categories_id = cat.categories_id'; $cells = 'ln.links_name AS links_name, ln.links_url AS links_url, ln.links_stats AS links_stats, '; $cells .= 'ln.links_id AS links_id, ln.categories_id AS categories_id, '; $cells .= 'cat.categories_name AS categories_name'; $where = empty($categories_id) ? 0 : "ln.categories_id = '" . $categories_id . "'"; $data['links'] = cs_sql_select(__FILE__, $tables, $cells, $where, $order, $start, $account['users_limit']); $links_loop = count($data['links']); for ($run = 0; $run < $links_loop; $run++) { $data['links'][$run]['name'] = cs_secure($data['links'][$run]['links_name']); $data['links'][$run]['cat'] = cs_secure($data['links'][$run]['categories_name']); $data['links'][$run]['url'] = $data['links'][$run]['links_url']; $data['links'][$run]['url_short'] = cs_substr($data['links'][$run]['links_url'], 0, 20); if ($data['links'][$run]['links_stats'] == 'on') { $data['links'][$run]['color'] = 'lime'; $data['links'][$run]['on_off'] = $cs_lang['online']; } else { $data['links'][$run]['color'] = 'red'; $data['links'][$run]['on_off'] = $cs_lang['offline']; } $data['links'][$run]['id'] = $data['links'][$run]['links_id']; } echo cs_subtemplate(__FILE__, $data, 'links', 'manage');
} } if (empty($web_charset)) { $data['charset']['result_web_setting'] .= $cs_lang['charset_missing'] . cs_html_br(1); $data['charset']['result_web_setting'] .= $cs_lang['file'] . ': ' . $file . cs_html_br(2); } if (!empty($data['charset']['result_web_setting'])) { $data['charset']['result_web_setting'] .= $cs_lang['charset_web_hint']; } # Check for possible SQL related charset problems $sql_info = cs_sql_version(__FILE__); $sql_charset = strtolower($sql_info['encoding']); $sql_valid = 0; if ($charset == 'utf-8' and ($sql_charset == 'utf-8' or $sql_charset == 'utf8' or $sql_charset == 'unicode')) { $sql_valid = 1; } elseif (cs_substr($charset, 0, 9) == 'iso-8859-' and (cs_substr($sql_charset, 0, 9) == 'iso-8859-' or cs_substr($sql_charset, 0, 5) == 'latin')) { $sql_valid = 1; } elseif ($sql_charset == 'default' or $sql_charset == 'pdo encoding') { $sql_valid = 1; } else { $data['charset']['result_sql_setting'] = $cs_lang['charset_unexpected'] . ' : ' . $sql_info['encoding']; } # Check for MySQL version 4.1.8 or above due to charset / collation support $data['if']['old_mysql'] = 0; global $cs_db; $ext_mysql = array('mysql', 'mysqli', 'pdo_mysql'); if (in_array($cs_db['type'], $ext_mysql)) { $myv = explode('.', $sql_info['server']); settype($myv[2], 'integer'); if ($myv[0] < 4 or $myv[0] == 4 and $myv[1] < 1 or $myv[0] == 4 and $myv[1] == 1 and $myv[2] < 8) { $data['if']['old_mysql'] = 1;
function cs_abcode_url($matches) { $matches[1] = trim($matches[1]); $java = cs_substr($matches[1], 0, 10); if (strtolower($java) != 'javascript') { if (empty($matches[2])) { $matches[2] = $matches[1]; } $matches[1] = strpos($matches[1], 'www.') === 0 ? 'http://' . $matches[1] : $matches[1]; return cs_html_link($matches[1], $matches[2], 1); } else { return cs_abcode_i(array(0, 'Javascript Links are not allowed')); } }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('history'); $cs_get = cs_get('id,agree,cancel'); if (isset($cs_get['agree'])) { cs_sql_delete(__FILE__, 'history', $cs_get['id']); cs_redirect($cs_lang['del_true'], 'history'); } if (isset($cs_get['cancel'])) { cs_redirect($cs_lang['del_false'], 'history'); } $history = cs_sql_select(__FILE__, 'history', 'history_text', 'history_id = ' . $cs_get['id']); if (!empty($history)) { $data = array(); $data['head']['topline'] = sprintf($cs_lang['remove_entry'], $cs_lang['mod_name'], cs_substr($history['history_text'], 0, 15)); $data['history']['content'] = cs_link($cs_lang['confirm'], 'history', 'remove', 'id=' . $cs_get['id'] . '&agree'); $data['history']['content'] .= ' - '; $data['history']['content'] .= cs_link($cs_lang['cancel'], 'history', 'remove', 'id=' . $cs_get['id'] . '&cancel'); echo cs_subtemplate(__FILE__, $data, 'history', 'remove'); } else { cs_redirect('', 'history'); }
// $Id$ $cs_lang = cs_translate('replays'); $cs_get = cs_get('catid'); $cs_option = cs_sql_option(__FILE__, 'replays'); $data = array(); $tables = 'replays re INNER JOIN {pre}_categories cat ON re.categories_id = cat.categories_id'; $select = 're.replays_id AS replays_id, re.games_id AS games_id, re.replays_date AS replays_date, re.replays_team1 AS replays_team1, re.replays_team2 AS replays_team2'; $check = 'cat.categories_access <= \'' . $account['access_replays'] . '\''; if (!empty($cs_get['catid'])) { $check .= ' AND cat.categories_id = ' . $cs_get['catid']; } $order = 're.replays_date DESC'; $cs_replays = cs_sql_select(__FILE__, $tables, $select, $check, $order, 0, $cs_option['max_navlist']); if (empty($cs_replays)) { echo $cs_lang['no_data']; } else { $run = 0; foreach ($cs_replays as $replays) { $data['replays'][$run]['game_icon'] = cs_html_img('uploads/games/' . $replays['games_id'] . '.gif'); $data['replays'][$run]['date'] = cs_date('date', $replays['replays_date']); $data['replays'][$run]['view_url'] = cs_url('replays', 'view', 'id=' . $replays['replays_id']); $short_team1 = strlen($replays['replays_team1']) <= $cs_option['max_headline_team1'] ? $replays['replays_team1'] : cs_substr($replays['replays_team1'], 0, $cs_option['max_headline_team1']) . '...'; $short_team2 = strlen($replays['replays_team2']) <= $cs_option['max_headline_team2'] ? $replays['replays_team2'] : cs_substr($replays['replays_team2'], 0, $cs_option['max_headline_team2']) . '...'; $data['replays'][$run]['team1_short'] = cs_secure($short_team1); $data['replays'][$run]['team2_short'] = cs_secure($short_team2); $data['replays'][$run]['team1'] = cs_secure($replays['replays_team1']); $data['replays'][$run]['team2'] = cs_secure($replays['replays_team2']); $run++; } echo cs_subtemplate(__FILE__, $data, 'replays', 'navlist'); }