本文整理汇总了PHP中cs_sort函数的典型用法代码示例。如果您正苦于以下问题:PHP cs_sort函数的具体用法?PHP cs_sort怎么用?PHP cs_sort使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cs_sort函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cs_translate
<?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');
示例2: empty
$start = empty($cs_get['start']) ? 0 : $cs_get['start'];
if (!empty($cs_post['start'])) {
$start = $cs_post['start'];
}
$sort = empty($cs_get['sort']) ? 2 : $cs_get['sort'];
if (!empty($cs_post['sort'])) {
$sort = $cs_post['sort'];
}
$cs_sort[1] = 'linkus_name DESC';
$cs_sort[2] = 'linkus_name ASC';
$cs_sort[3] = 'linkus_banner DESC';
$cs_sort[4] = 'linkus_banner ASC';
$order = $cs_sort[$sort];
$linkus_count = cs_sql_count(__FILE__, 'linkus');
$data['head']['count'] = $linkus_count;
$data['head']['pages'] = cs_pages('linkus', 'manage', $linkus_count, $start, 0, $sort);
$data['head']['getmsg'] = cs_getmsg();
$data['sort']['name'] = cs_sort('linkus', 'manage', $start, 0, 1, $sort);
$data['sort']['banner'] = cs_sort('linkus', 'manage', $start, 0, 3, $sort);
$select = 'linkus_id, linkus_name, linkus_banner';
$data['linkus'] = cs_sql_select(__FILE__, 'linkus', $select, 0, $order, $start, $account['users_limit']);
$linkus_loop = count($data['linkus']);
for ($run = 0; $run < $linkus_loop; $run++) {
$data['linkus'][$run]['name'] = cs_secure($data['linkus'][$run]['linkus_name']);
$data['linkus'][$run]['banner'] = cs_secure($data['linkus'][$run]['linkus_banner']);
$place = 'uploads/linkus/' . $data['linkus'][$run]['linkus_banner'];
$mass = getimagesize($place);
$data['linkus'][$run]['mass'] = cs_secure($mass[0] . ' x ' . $mass[1]);
$data['linkus'][$run]['id'] = $data['linkus'][$run]['linkus_id'];
}
echo cs_subtemplate(__FILE__, $data, 'linkus', 'manage');
示例3: array
$data = array();
$start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start'];
$cs_sort[1] = 'boardreport_time DESC';
$cs_sort[2] = 'boardreport_time ASC';
$cs_sort[3] = 'boardreport_done DESC, boardreport_time DESC';
$cs_sort[4] = 'boardreport_done ASC, boardreport_time DESC';
$cs_sort[5] = 'threads_headline DESC';
$cs_sort[6] = 'boardreport_time ASC';
$sort = empty($_REQUEST['sort']) ? 1 : $_REQUEST['sort'];
$order = $cs_sort[$sort];
$data['lang']['getmsg'] = cs_getmsg();
$data['head']['boardreport_count'] = cs_sql_count(__FILE__, 'boardreport');
$data['head']['pages'] = cs_pages('board', 'reportlist', $data['head']['boardreport_count'], $start, 0, $sort);
$data['sort']['boardreport_time'] = cs_sort('board', 'reportlist', $start, 0, 1, $sort);
$data['sort']['boardreport_done'] = cs_sort('board', 'reportlist', $start, 0, 3, $sort);
$data['sort']['threads_headline'] = cs_sort('board', 'reportlist', $start, 0, 5, $sort);
$from = 'boardreport bdr INNER JOIN {pre}_threads thr ON bdr.threads_id = thr.threads_id';
$select = 'bdr.boardreport_time AS boardreport_time, bdr.boardreport_done AS boardreport_done, bdr.threads_id AS threads_id, thr.threads_headline AS threads_headline, bdr.comments_id AS comments_id';
$cs_report = cs_sql_select(__FILE__, $from, $select, 0, $order, $start, $account['users_limit']);
$report_loop = count($cs_report);
$data['boardreport'] = array();
for ($run = 0; $run < $report_loop; $run++) {
$data['boardreport'][$run]['boardreport_time'] = cs_date('date', $cs_report[$run]['boardreport_time'], 1);
$data['boardreport'][$run]['boardreport_done'] = empty($cs_report[$run]['boardreport_done']) ? $cs_lang['no'] : $cs_lang['yes'];
$headline = cs_secure($cs_report[$run]['threads_headline']);
// $comments_count = empty($cs_report[$run]['comments_id']) ? 0 : cs_sql_count(__FILE__,'comments',"comments_mod = 'board' AND comments_fid = '" . $cs_report[$run]['threads_id'] . "'");
// $goto = floor($comments_count / $account['users_limit']) * $account['users_limit'] . '#com' . $comments_count;
$link = cs_link($headline, 'board', 'thread', 'where=' . $cs_report[$run]['threads_id']);
// . '&start=' . $goto);
$data['boardreport'][$run]['threads_headline'] = $link . ' #' . $cs_report[$run]['comments_id'];
}
示例4: cs_sql_escape
$medalsuser_id = cs_sql_escape($_GET['delete']);
cs_sql_delete(__FILE__, 'medalsuser', $medalsuser_id);
cs_redirect($cs_lang['del_true'], 'medals', 'user', 'where=' . $medals_id);
}
$start = empty($_GET['start']) ? 0 : $_GET['start'];
$cs_sort[1] = 'md.medalsuser_date DESC';
$cs_sort[2] = 'md.medalsuser_date ASC';
$cs_sort[3] = 'usr.users_nick DESC';
$cs_sort[4] = 'usr.users_nick ASC';
$sort = empty($_GET['sort']) ? 1 : $_GET['sort'];
$order = $cs_sort[$sort];
$tables = 'medalsuser md LEFT JOIN {pre}_users usr ON usr.users_id = md.users_id';
$cells = 'usr.users_nick AS users_nick, md.users_id AS users_id, usr.users_active AS users_active, usr.users_delete AS users_delete, ';
$cells .= 'md.medals_id AS medals_id, md.medalsuser_date AS medalsuser_date, md.medalsuser_id AS medalsuser_id';
$where = 'medals_id = ' . $medals_id . '';
$data['medals_user'] = array();
$data['medals_user'] = cs_sql_select(__FILE__, $tables, $cells, $where, $order, $start, $account['users_limit']);
$data['count']['medals_user'] = count($data['medals_user']);
$data['count']['all_medals_user'] = cs_sql_count(__FILE__, 'medalsuser', $where);
$data['sort']['date'] = cs_sort('medals', 'user', $start, $medals_id, 1, $sort);
$data['sort']['users_nick'] = cs_sort('medals', 'user', $start, $medals_id, 3, $sort);
$data['pages']['list'] = cs_pages('medals', 'user', $data['count']['all_medals_user'], $start, $medals_id, $sort);
for ($i = 0; $i < $data['count']['medals_user']; $i++) {
$data['medals_user'][$i]['user'] = cs_user($data['medals_user'][$i]['users_id'], $data['medals_user'][$i]['users_nick'], $data['medals_user'][$i]['users_active'], $data['medals_user'][$i]['users_delete']);
$data['medals_user'][$i]['remove_url'] = cs_url('medals', 'user', 'where=' . $data['medals_user'][$i]['medals_id'] . '&delete=' . $data['medals_user'][$i]['medalsuser_id']);
$data['medals_user'][$i]['medals_date'] = cs_date('unix', $data['medals_user'][$i]['medalsuser_date'], 1);
}
$data['medals']['id'] = $medals_id;
$data['message']['medals'] = cs_getmsg();
$data['form']['dirname'] = $cs_main['php_self']['dirname'];
echo cs_subtemplate(__FILE__, $data, 'medals', 'user');
示例5: cs_substr
$data['in'][$run]['id'] = $data['in'][$run]['cash_id'];
$text = $data['in'][$run]['cash_text'];
$text = cs_substr($text, 0, 25);
$data['in'][$run]['for'] = cs_secure($text);
$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';
示例6: cs_translate
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('clans');
$op_clans = cs_sql_option(__FILE__, 'clans');
$start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start'];
$cs_sort[1] = 'clans_name DESC';
$cs_sort[2] = 'clans_name ASC';
$cs_sort[3] = 'clans_short DESC';
$cs_sort[4] = 'clans_short ASC';
$sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort'];
$order = $cs_sort[$sort];
$clans_count = cs_sql_count(__FILE__, 'clans');
$data['lang']['mod_name'] = $cs_lang[$op_clans['label']];
$data['lang']['all'] = $cs_lang['total'] . ': ';
$data['lang']['count'] = $clans_count;
$data['pages']['list'] = cs_pages('clans', 'list', $clans_count, $start, 0, $sort);
$select = 'clans_name, clans_short, clans_country, clans_id';
$cs_clans = cs_sql_select(__FILE__, 'clans', $select, 0, $order, $start, $account['users_limit']);
$clans_loop = count($cs_clans);
$data['sort']['name'] = cs_sort('clans', 'list', $start, 0, 1, $sort);
$data['sort']['short'] = cs_sort('clans', 'list', $start, 0, 3, $sort);
if (empty($clans_loop)) {
$data['clans'] = '';
}
for ($run = 0; $run < $clans_loop; $run++) {
$data['clans'][$run]['country'] = cs_html_img('symbols/countries/' . $cs_clans[$run]['clans_country'] . '.png', 11, 16);
$data['clans'][$run]['name'] = cs_link(cs_secure($cs_clans[$run]['clans_name']), 'clans', 'view', 'id=' . $cs_clans[$run]['clans_id']);
$data['clans'][$run]['short'] = cs_secure($cs_clans[$run]['clans_short']);
}
echo cs_subtemplate(__FILE__, $data, 'clans', 'list');
示例7: empty
//$mof = empty($where) ? '' : " AND users_sex = '" . cs_sql_escape($where) . "'";
$where = empty($_GET['where']) ? 0 : $_GET['where'];
$mof = empty($where) ? '' : " AND users_nick LIKE '" . cs_sql_escape($where) . "%'";
$condition = 'users_delete = 0 AND users_active = 1' . $mof;
$users_count = cs_sql_count(__FILE__, 'users', $condition);
$data['head']['mod'] = $cs_lang['mod_name'];
$data['head']['action'] = $cs_lang['list'];
$data['head']['total'] = $users_count;
$data['head']['pages'] = cs_pages('users', 'list', $users_count, $start, $where, $sort);
$sel_female = $where === 'female' ? 'selected' : '';
$data['head']['sel_female'] = $sel_female;
$sel_male = $where === 'male' ? 'selected' : '';
$data['head']['sel_male'] = $sel_male;
$data['sort']['nick'] = cs_sort('users', 'list', $start, $where, 1, $sort);
$data['sort']['place'] = cs_sort('users', 'list', $start, $where, 3, $sort);
$data['sort']['laston'] = cs_sort('users', 'list', $start, $where, 5, $sort);
$select = 'users_id, users_nick, users_place, users_laston, users_country, users_hidden, users_active, users_invisible';
$cs_users = cs_sql_select(__FILE__, 'users', $select, $condition, $order, $start, $account['users_limit']);
$users_loop = count($cs_users);
for ($run = 0; $run < $users_loop; $run++) {
$cs_users[$run]['country'] = cs_html_img('symbols/countries/' . $cs_users[$run]['users_country'] . '.png');
$cs_users[$run]['users_id'] = cs_secure($cs_users[$run]['users_id']);
$cs_users[$run]['nick'] = cs_user($cs_users[$run]['users_id'], $cs_users[$run]['users_nick'], $cs_users[$run]['users_active']);
$content = cs_secure($cs_users[$run]['users_place']);
$hidden = explode(',', $cs_users[$run]['users_hidden']);
if (in_array('users_place', $hidden)) {
$content = ($account['access_users'] > 4 or $cs_users[$run]['users_id'] == $account['users_id']) ? cs_html_italic(1) . $content . cs_html_italic(0) : '';
}
$cs_users[$run]['place'] = $content;
$cs_users[$run]['laston'] = cs_date('unix', $cs_users[$run]['users_laston']);
$cs_users[$run]['page'] = cs_userstatus($cs_users[$run]['users_laston'], $cs_users[$run]['users_invisible']);
示例8: empty
$cs_sort[6] = 'members_since ASC';
$sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort'];
$order = $cs_sort[$sort];
$cru = "users_id = '" . $where . "'";
$clans_count = cs_sql_count(__FILE__, 'members', $cru);
$data['lang']['mod_name'] = $cs_lang[$op_clans['label']];
$data['lang']['addons'] = cs_addons('users', 'view', $where, 'clans');
$data['pages']['list'] = cs_pages('clans', 'users', $clans_count, $start, $where, $sort);
$select = 'mem.members_task AS members_task, mem.members_since AS members_since, ';
$select .= 'sqd.squads_id AS squads_id, sqd.squads_name AS squads_name, ';
$select .= 'cln.clans_id AS clans_id, cln.clans_name AS clans_name';
$from = 'members mem INNER JOIN {pre}_squads sqd ON mem.squads_id = sqd.squads_id ';
$from .= 'INNER JOIN {pre}_clans cln ON sqd.clans_id = cln.clans_id';
$where2 = "mem.users_id ='" . $where . "'";
$cs_clans = cs_sql_select(__FILE__, $from, $select, $where2, $order, $start, $account['users_limit']);
$clans_loop = count($cs_clans);
$data['sort']['clans'] = cs_sort('clans', 'users', $start, $where, 1, $sort);
$data['lang']['clans'] = $cs_lang[$op_clans['label']];
$data['sort']['squads'] = cs_sort('clans', 'users', $start, $where, 3, $sort);
$data['lang']['squads'] = $cs_lang[$op_squads['label']];
$data['sort']['joined'] = cs_sort('clans', 'users', $start, $where, 5, $sort);
if (empty($clans_loop)) {
$data['clans'] = '';
}
for ($run = 0; $run < $clans_loop; $run++) {
$data['clans'][$run]['name'] = cs_link(cs_secure($cs_clans[$run]['clans_name']), 'clans', 'view', 'id=' . $cs_clans[$run]['clans_id']);
$data['clans'][$run]['short'] = cs_link(cs_secure($cs_clans[$run]['squads_name']), 'squads', 'view', 'id=' . $cs_clans[$run]['squads_id']);
$data['clans'][$run]['task'] = cs_secure($cs_clans[$run]['members_task']);
$data['clans'][$run]['since'] = empty($cs_clans[$run]['members_since']) ? '-' : cs_date('date', $cs_clans[$run]['members_since']);
}
echo cs_subtemplate(__FILE__, $data, 'clans', 'users');
示例9: count
$sqd_loop = count($sqd_data);
for ($run = 0; $run < $sqd_loop; $run++) {
$data['squad'][$run]['selected'] = $sqd_data[$run]['squads_id'] == $squads_id ? ' selected="selected"' : '';
$data['squad'][$run]['id'] = $sqd_data[$run]['squads_id'];
$data['squad'][$run]['name'] = cs_secure($sqd_data[$run]['squads_name']);
}
if (empty($sqd_loop)) {
$data['squad'] = array();
}
$data['lang']['msg'] = !empty($msg) ? $msg : '';
$select = 'mem.members_admin AS members_admin, mem.members_order AS members_order, mem.users_id AS users_id, usr.users_nick AS users_nick, usr.users_delete AS users_delete, usr.users_active AS users_active, mem.members_task, mem.members_id AS members_id';
$from = 'members mem INNER JOIN {pre}_users usr ON mem.users_id = usr.users_id';
$where = "mem.squads_id = '" . $squads_id . "'";
$cs_members = cs_sql_select(__FILE__, $from, $select, $where, $order, 0, 0);
$members_loop = count($cs_members);
$data['sort']['user'] = cs_sort('members', 'center', 0, $squads_id, 1, $sort);
$data['sort']['task'] = cs_sort('members', 'center', 0, $squads_id, 3, $sort);
$img_edit = cs_icon('edit', 16, $cs_lang['edit']);
$img_del = cs_icon('editdelete', 16, $cs_lang['remove']);
if (empty($members_loop)) {
$data['members'] = '';
}
for ($run = 0; $run < $members_loop; $run++) {
$users_nick = cs_user($cs_members[$run]['users_id'], $cs_members[$run]['users_nick'], $cs_members[$run]['users_active'], $cs_members[$run]['users_delete']);
$data['members'][$run]['user'] = empty($cs_members[$run]['members_admin']) ? $users_nick : cs_html_big(1) . $users_nick . cs_html_big(0);
$data['members'][$run]['task'] = cs_secure($cs_members[$run]['members_task']);
$data['members'][$run]['order'] = $cs_members[$run]['members_order'];
$data['members'][$run]['edit'] = cs_link($img_edit, 'members', 'change', 'id=' . $cs_members[$run]['members_id'], 0, $cs_lang['edit']);
$data['members'][$run]['remove'] = cs_link($img_del, 'members', 'center', 'del_id=' . $cs_members[$run]['members_id'], 0, $cs_lang['remove']);
}
echo cs_subtemplate(__FILE__, $data, 'members', 'center');
示例10: cs_sql_select
$data['events'] = cs_sql_select(__FILE__, 'events', $columns, $where, 0, 0, 1);
$data['events']['time'] = cs_date('unix', $data['events']['events_time'], 1);
$count_where = "events_id = " . (int) $events_id . " AND eventguests_status = ";
$data['count']['status_0'] = cs_sql_count(__FILE__, 'eventguests', $count_where . '0');
$data['count']['status_3'] = cs_sql_count(__FILE__, 'eventguests', $count_where . '3');
$data['count']['status_4'] = cs_sql_count(__FILE__, 'eventguests', $count_where . '4');
$data['count']['status_5'] = cs_sql_count(__FILE__, 'eventguests', $count_where . '5');
$data['count']['status_booked'] = $data['count']['status_4'] + $data['count']['status_5'];
$data['count']['status_available'] = $data['events']['events_guestsmax'] - $data['count']['status_booked'];
$data['head']['count'] = $data['count']['status_0'] + $data['count']['status_3'] + $data['count']['status_booked'];
$data['head']['pages'] = cs_pages('events', 'guests', $data['head']['count'], $start, $events_id, $sort);
$data['head']['getmsg'] = cs_getmsg();
$data['sort']['user'] = cs_sort('events', 'guests', $start, $events_id, 1, $sort);
$data['sort']['name'] = cs_sort('events', 'guests', $start, $events_id, 3, $sort);
$data['sort']['time'] = cs_sort('events', 'guests', $start, $events_id, 5, $sort);
$data['sort']['status'] = cs_sort('events', 'guests', $start, $events_id, 7, $sort);
$from = 'eventguests egt LEFT JOIN {pre}_users usr ON egt.users_id = usr.users_id';
$select = 'egt.eventguests_name AS eventguests_name, egt.eventguests_surname AS eventguests_surname, ' . 'egt.eventguests_since AS eventguests_since, egt.users_id AS users_id, usr.users_nick AS users_nick, ' . 'usr.users_surname AS users_surname, usr.users_hidden AS users_hidden, usr.users_active AS users_active, ' . 'usr.users_delete AS users_delete, usr.users_name AS users_name, usr.users_phone AS users_phone, ' . 'usr.users_mobile AS users_mobile, egt.eventguests_id AS eventguests_id, egt.eventguests_notice AS eventguests_notice, ' . 'egt.eventguests_phone AS eventguests_phone, egt.eventguests_mobile AS eventguests_mobile, ' . 'egt.eventguests_status AS eventguests_status';
$cs_eventguests = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']);
$eventguests_loop = count($cs_eventguests);
if (empty($eventguests_loop)) {
$data['eventguests'] = '';
}
for ($run = 0; $run < $eventguests_loop; $run++) {
$allow = 0;
if ($cs_eventguests[$run]['users_id'] == $account['users_id'] or $account['access_users'] > 4) {
$allow = 1;
}
$hidden = explode(',', $cs_eventguests[$run]['users_hidden']);
$content = cs_secure($cs_eventguests[$run]['users_surname']);
if (in_array('users_surname', $hidden)) {
示例11: cs_pages
$data['where']['mod'] = $where;
$data['head']['count'] = $categories_count;
$data['head']['pages'] = cs_pages('categories', 'manage', $categories_count, $start, $where, $sort);
$run = 0;
$modules = cs_checkdirs('mods');
foreach ($modules as $mods) {
$check_axx = empty($account['access_' . $mods['dir'] . '']) ? 0 : $account['access_' . $mods['dir'] . ''];
if (!empty($mods['categories']) and $check_axx > 2) {
$mods['dir'] == $where ? $sel = 1 : ($sel = 0);
$data['mod'][$run]['sel'] = cs_html_option($mods['name'], $mods['dir'], $sel);
$run++;
}
}
$data['head']['getmsg'] = cs_getmsg();
$data['sort']['name'] = cs_sort('categories', 'manage', $start, $where, 1, $sort);
$data['sort']['url'] = cs_sort('categories', 'manage', $start, $where, 3, $sort);
$select = 'categories_id, categories_name, categories_url, categories_subid';
$data['cat'] = cs_sql_select(__FILE__, 'categories', $select, $mdp, $order, $start, $account['users_limit']);
$data['cat'] = cs_catsort($data['cat']);
$categories_loop = !empty($data['cat']) ? count($data['cat']) : '';
for ($run = 0; $run < $categories_loop; $run++) {
$blank = '';
if (!empty($data['cat'][$run]['layer'])) {
for ($i = 0; $i < $data['cat'][$run]['layer']; $i++) {
$blank .= ' ';
}
$blank .= cs_icon('add_sub_task');
}
$data['cat'][$run]['subcat_layer'] = $blank;
$cs_cat_name = cs_secure($data['cat'][$run]['categories_name']);
$data['cat'][$run]['category'] = cs_link($cs_cat_name, 'categories', 'view', 'id=' . $data['cat'][$run]['categories_id']);
示例12: sprintf
$j = (int) (2 * $i);
$data['lbrounds'][$run]['value'] = $j;
$data['lbrounds'][$run]['if']['lbnotselected'] = $lb == 1 && $data['lbrounds'][$run]['value'] == $round ? false : true;
$data['lbrounds'][$run]['name'] = $cs_lang['round'] . ' ' . ($j % 2 == 0 ? sprintf('%1.0F', $i) : sprintf('%1.1F', $i));
$i += 0.5;
$run++;
}
break;
}
$data['vars']['matchcount'] = count($data['matches']);
$data['vars']['cups_id'] = $cups_id;
$data['pages']['list'] = cs_pages('cups', 'matchlist', $data['vars']['matchcount'], $start, $cups_id, $sort);
$data['if']['brackets'] = $system['cups_brackets'] == CS_CUPS_SYSTEM_LB ? true : false;
$data['sort']['team1'] = cs_sort('cups', 'matchlist', $start, $cups_id, 1, $sort, 'round=' . $round);
$data['sort']['team2'] = cs_sort('cups', 'matchlist', $start, $cups_id, 3, $sort, 'round=' . $round);
$data['sort']['bracket'] = cs_sort('cups', 'matchlist', $start, $cups_id, 5, $sort, 'round=' . $round);
if ($system['cups_system'] == CS_CUPS_TYPE_USERS) {
$data['lang']['team'] = $cs_lang['player'];
}
$notallowed = array(CS_CUPS_TEAM_UNKNOWN, CS_CUPS_TEAM_BYE);
for ($i = 0; $i < $data['vars']['matchcount']; $i++) {
$data['matches'][$i]['betlink'] = '';
if (!empty($account['access_bets']) && $account['access_bets'] > 3) {
$cupmatch = $data['matches'][$i];
if ($cupmatch['cupmatches_winner'] == CS_CUPS_TEAM_UNKNOWN && !in_array($cupmatch['squad1_id'], $notallowed) && !in_array($cupmatch['squad2_id'], $notallowed) && empty($cupmatch['cupmatches_accepted1']) && empty($cupmatch['cupmatches_accepted2']) && empty($cupmatch['cupmatches_score1']) && empty($cupmatch['cupmatches_score2'])) {
$data['matches'][$i]['betlink'] = cs_link(cs_icon('bets'), 'bets', 'create', 'cupmatchid=' . $data['matches'][$i]['cupmatches_id']);
}
}
if ($system['cups_brackets'] == CS_CUPS_SYSTEM_LB) {
$data['matches'][$i]['bracket'] = empty($data['matches'][$i]['cupmatches_loserbracket']) ? $cs_lang['winners'] : $cs_lang['losers'];
}
示例13: empty
$cs_sort[4] = 'clans_short ASC';
$sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort'];
$order = $cs_sort[$sort];
$data['lang']['getmsg'] = cs_getmsg();
$data['lang']['mod_name'] = $cs_lang[$op_clans['label']];
$own = "users_id = '" . $account['users_id'] . "'";
$clans_count = cs_sql_count(__FILE__, 'clans', $own);
$data['lang']['mod_name'] = $cs_lang[$op_clans['label']];
$data['lang']['new'] = cs_link($cs_lang['new_' . $op_clans['label']], 'clans', 'new');
$data['lang']['all'] = $cs_lang['total'] . ': ';
$data['lang']['count'] = $clans_count;
$data['pages']['list'] = cs_pages('clans', 'center', $clans_count, $start, 0, $sort);
$select = 'clans_name, clans_short, clans_id';
$cs_clans = cs_sql_select(__FILE__, 'clans', $select, $own, $order, $start, $account['users_limit']);
$clans_loop = count($cs_clans);
$data['sort']['name'] = cs_sort('clans', 'center', $start, 0, 1, $sort);
$data['sort']['short'] = cs_sort('clans', 'center', $start, 0, 3, $sort);
if (empty($clans_loop)) {
$data['clans'] = '';
}
for ($run = 0; $run < $clans_loop; $run++) {
$data['clans'][$run]['name'] = cs_link(cs_secure($cs_clans[$run]['clans_name']), 'clans', 'view', 'id=' . $cs_clans[$run]['clans_id']);
$data['clans'][$run]['short'] = cs_secure($cs_clans[$run]['clans_short']);
$data['clans'][$run]['edit'] = cs_link(cs_icon('edit', 16, $cs_lang['edit']), 'clans', 'change', 'id=' . $cs_clans[$run]['clans_id'], 0, $cs_lang['edit']);
if ($cs_clans[$run]['clans_id'] == 1) {
$data['clans'][$run]['remove'] = '-';
} else {
$data['clans'][$run]['remove'] = cs_link(cs_icon('editdelete', 16, $cs_lang['remove']), 'clans', 'delete', 'id=' . $cs_clans[$run]['clans_id'], 0, $cs_lang['remove']);
}
}
echo cs_subtemplate(__FILE__, $data, 'clans', 'center');
示例14: cs_sql_count
$order = $cs_sort[$sort];
$own = "users_id = '" . $account['users_id'] . "'";
$squads_count = cs_sql_count(__FILE__, 'members', $own);
$data['head']['mod'] = $cs_lang[$op_squads['label'] . 's'];
$data['lang']['new_label'] = $cs_lang['new_' . $op_squads['label']];
$data['head']['count'] = $squads_count;
$data['head']['pages'] = cs_pages('squads', 'center', $squads_count, $start, 0, $sort);
$data['head']['getmsg'] = cs_getmsg();
$data['lang']['join_label'] = $cs_lang['join_' . $op_squads['label']];
if (!empty($squads_count)) {
$data['if']['squad_to_leave'] = TRUE;
$data['lang']['leave_label'] = $cs_lang['leave_' . $op_squads['label']];
}
$data['sort']['squad_name'] = cs_sort('squads', 'center', $start, 0, 1, $sort);
$data['lang']['label'] = $cs_lang[$op_squads['label']];
$data['sort']['members_task'] = cs_sort('squads', 'center', $start, 0, 3, $sort);
$select = 'sqd.squads_name AS squads_name, sqd.squads_id AS squads_id, mem.members_task AS members_task, mem.members_admin AS members_admin';
$from = 'members mem INNER JOIN {pre}_squads sqd ON mem.squads_id = sqd.squads_id';
$where = "mem.users_id = '" . $account['users_id'] . "'";
$data['squads'] = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']);
$squads_loop = count($data['squads']);
for ($run = 0; $run < $squads_loop; $run++) {
$data['squads'][$run]['id'] = $data['squads'][$run]['squads_id'];
$data['squads'][$run]['name'] = cs_secure($data['squads'][$run]['squads_name']);
$data['squads'][$run]['members_task'] = cs_secure($data['squads'][$run]['members_task']);
if (!empty($data['squads'][$run]['members_admin'])) {
$data['squads'][$run]['if']['squad_admin'] = TRUE;
$data['squads'][$run]['if']['no_squad_admin'] = FALSE;
} else {
$data['squads'][$run]['if']['squad_admin'] = FALSE;
$data['squads'][$run]['if']['no_squad_admin'] = TRUE;
示例15: array
$data = array();
$start = empty($cs_get['start']) ? 0 : $cs_get['start'];
if (!empty($cs_post['start'])) {
$start = $cs_post['start'];
}
$sort = empty($cs_get['sort']) ? 2 : $cs_get['sort'];
if (!empty($cs_post['sort'])) {
$sort = $cs_post['sort'];
}
$cs_sort[1] = 'boardranks_min DESC';
$cs_sort[2] = 'boardranks_min ASC';
$cs_sort[3] = 'boardranks_name DESC';
$cs_sort[4] = 'boardranks_name ASC';
$order = $cs_sort[$sort];
$boardranks_count = cs_sql_count(__FILE__, 'boardranks');
$data['head']['count'] = $boardranks_count;
$data['head']['pages'] = cs_pages('boardranks', 'manage', $boardranks_count, $start, 0, $sort);
$data['head']['getmsg'] = cs_getmsg();
$data['sort']['boardranks_min'] = cs_sort('boardranks', 'manage', $start, 0, 1, $sort);
$data['sort']['boardranks_name'] = cs_sort('boardranks', 'manage', $start, 0, 3, $sort);
$select = 'boardranks_id, boardranks_min, boardranks_name';
$cs_boardranks = cs_sql_select(__FILE__, 'boardranks', $select, 0, $order, $start, $account['users_limit']);
$boardranks_loop = count($cs_boardranks);
for ($run = 0; $run < $boardranks_loop; $run++) {
$id = $cs_boardranks[$run]['boardranks_id'];
$data['bora'][$run]['boardranks_min'] = cs_secure($cs_boardranks[$run]['boardranks_min']);
$data['bora'][$run]['boardranks_name'] = cs_secure($cs_boardranks[$run]['boardranks_name']);
$data['bora'][$run]['url_edit'] = cs_url('boardranks', 'edit', 'id=' . $id);
$data['bora'][$run]['url_remove'] = cs_url('boardranks', 'remove', 'id=' . $id);
}
echo cs_subtemplate(__FILE__, $data, 'boardranks', 'manage');