本文整理汇总了PHP中cs_user函数的典型用法代码示例。如果您正苦于以下问题:PHP cs_user函数的具体用法?PHP cs_user怎么用?PHP cs_user使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cs_user函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cs_addons
function cs_addons($modul, $action, $id, $modul_now)
{
global $account, $cs_main;
$show = $modul . '/' . $action;
$addons = cs_checkdirs('mods', $show);
$count = count($addons);
$var = '';
if (!empty($count)) {
foreach ($addons as $mod) {
$acc_dir = 'access_' . $mod['dir'];
if (array_key_exists($acc_dir, $account) and $account[$acc_dir] >= $mod['show'][$show]) {
$mod['action'] = $modul == $mod['dir'] ? $action : $modul;
$out = $modul_now == $mod['dir'] ? $mod['name'] : cs_link($mod['name'], $mod['dir'], $mod['action'], 'id=' . $id);
if ($mod['dir'] == $modul) {
if ($modul == 'users') {
$cs_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active, users_delete', 'users_id = ' . $id);
$user = cs_user($id, $cs_user['users_nick'], $cs_user['users_active'], $cs_user['users_delete']);
$var = $mod['name'] . ' - ' . $user . cs_html_hr('100%') . $var;
} else {
$cs_refer = cs_sql_select(__FILE__, $modul, $modul . '_name', $modul . '_id = ' . $id);
$name = cs_secure($cs_refer[$modul . '_name']);
$var = $mod['name'] . ' - ' . cs_link($name, $modul, $action, 'id=' . $id) . cs_html_hr('100%') . $var;
}
} else {
if (!empty($mod['references'][$modul])) {
/*
* @TODO ACCESS rights (usersgallery) for count columns
*/
$column = empty($mod['references'][$modul . '_column']) ? $modul . '_id' : $mod['references'][$modul . '_column'];
$more = empty($mod['references'][$modul . '_where']) ? '' : ' AND (' . $mod['references'][$modul . '_where'] . ')';
$count = cs_sql_count(__FILE__, $mod['references'][$modul], $column . ' = ' . $id . $more);
$var .= $out . " (" . $count . ")\r\n - ";
} else {
$var .= $out . "\r\n - ";
}
}
}
}
}
$var = substr($var, 0, -3);
return $var;
}
示例2: cs_comments_edit
function cs_comments_edit($mod, $action, $com_id, $mod_name, $more = 'id')
{
$cs_lang = cs_translate('comments');
global $account;
settype($com_id, 'integer');
$data['if']['guest'] = FALSE;
$guestnick = '';
$cells = 'users_id, comments_text, comments_time, comments_fid, comments_edit, comments_guestnick';
$cs_comments = cs_sql_select(__FILE__, 'comments', $cells, "comments_id = " . (int) $com_id);
$com_fid = $cs_comments['comments_fid'];
if ($account['access_comments'] >= 4 or $account['users_id'] == $cs_comments['users_id']) {
$data['head']['mod'] = $mod_name;
$data['if']['preview'] = false;
if (isset($_POST['submit']) or isset($_POST['preview'])) {
$cs_comments['comments_text'] = $_POST['comments_text'];
$error = '';
if (empty($cs_comments['users_id'])) {
$guestnick = $_POST['comments_guestnick'];
if (empty($guestnick) and empty($cs_comments['users_id'])) {
$error .= $cs_lang['no_guestnick'] . cs_html_br(1);
} else {
$op_users = cs_sql_option(__FILE__, 'users');
$nick2 = str_replace(' ', '', $guestnick);
$nickchars = strlen($nick2);
if ($nickchars < $op_users['min_letters']) {
$error .= sprintf($cs_lang['short_guestnick'], $op_users['min_letters']) . cs_html_br(1);
}
$search_nick = cs_sql_count(__FILE__, 'users', "users_nick = '" . cs_sql_escape($guestnick) . "'");
if (!empty($search_nick)) {
$error .= $cs_lang['nick_exists'] . cs_html_br(1);
}
}
}
if (empty($cs_comments['comments_text'])) {
$error .= $cs_lang['no_text'] . cs_html_br(1);
}
}
if (!isset($_POST['submit']) and !isset($_POST['preview'])) {
$data['head']['body'] = $cs_lang['body_com_edit'];
} elseif (!empty($error)) {
$data['head']['body'] = $error;
} elseif (isset($_POST['preview'])) {
$data['head']['body'] = $cs_lang['preview'];
}
if (isset($_POST['preview']) and empty($error)) {
$data['if']['preview'] = true;
$userid = $account['users_id'];
$select = 'users_nick, users_laston, users_place, users_country, users_active, users_invisible, users_delete';
$cs_user = cs_sql_select(__FILE__, 'users', $select, "users_id = " . (int) $userid);
if (empty($cs_comments['users_id'])) {
$data['if']['guest_prev'] = TRUE;
$data['if']['user_prev'] = FALSE;
$data['prev']['guestnick'] = cs_secure($guestnick);
} else {
$data['if']['guest_prev'] = FALSE;
$data['if']['user_prev'] = TRUE;
$user = cs_secure($cs_user['users_nick']);
$url = 'symbols/countries/' . $cs_user['users_country'] . '.png';
$data['prev']['flag'] = cs_html_img($url, 11, 16);
$data['prev']['user'] = cs_user($userid, $cs_user['users_nick'], $cs_user['users_active'], $cs_user['users_delete']);
$data['prev']['status'] = cs_userstatus($cs_user['users_laston'], $cs_user['users_invisible']);
$data['prev']['laston'] = empty($cs_user['users_invisible']) ? '--' : cs_date('unix', $cs_user['users_laston']);
$place = empty($cs_user['users_place']) ? '-' : $cs_user['users_place'];
$data['prev']['place'] = cs_secure($place);
$who = "users_id = '" . $userid . "'";
$count_com[$userid] = cs_sql_count(__FILE__, 'comments', $who);
$data['prev']['posts'] = $count_com[$userid];
}
$opt = "comments_mod = '" . cs_sql_escape($mod) . "' AND comments_fid = " . (int) $com_fid;
$count_com = cs_sql_count(__FILE__, 'comments', $opt);
$data['prev']['count_com'] = $count_com + 1;
$data['prev']['date'] = cs_date('unix', cs_time(), 1);
$data['prev']['text'] = cs_secure($cs_comments['comments_text'], 1, 1);
}
if (!empty($error) or isset($_POST['preview']) or !isset($_POST['submit'])) {
$data['com']['form_name'] = $mod . '_com_edit';
$data['com']['form_url'] = cs_url($mod, 'com_edit');
$data['com']['smileys'] = cs_abcode_smileys('comments_text');
$data['com']['abcode'] = cs_abcode_features('comments_text');
if ($account['access_comments'] >= 4 and empty($cs_comments['users_id'])) {
$data['if']['guest'] = TRUE;
$data['com']['guestnick'] = $cs_comments['comments_guestnick'];
}
$data['com']['text'] = $cs_comments['comments_text'];
$data['com']['id'] = $com_id;
echo cs_subtemplate(__FILE__, $data, 'comments', 'com_edit');
} else {
$opt = "comments_mod = '" . cs_sql_escape($mod) . "' AND comments_fid = " . (int) $com_fid;
$opt .= " AND comments_id <= '" . $com_id . "'";
$count_com = cs_sql_count(__FILE__, 'comments', $opt);
$start = floor($count_com / $account['users_limit']) * $account['users_limit'];
if (!empty($cs_comments['comments_edit'])) {
$edits = explode('/', $cs_comments['comments_edit']);
$edits_count = $edits[3] + 1;
} else {
$edits_count = 1;
}
$com_edits = $account['users_id'] . '/' . $account['users_nick'] . '/' . cs_time() . '/' . $edits_count;
$com_cells = array('comments_text', 'comments_edit', 'comments_guestnick');
$com_save = array($cs_comments['comments_text'], $com_edits, $guestnick);
//.........这里部分代码省略.........
示例3: elseif
$history['history_text'] = '';
$history['history_time'] = '';
$history['users_id'] = 0;
}
if (!isset($_POST['submit']) and !isset($_POST['preview'])) {
$data['head']['body'] = $cs_lang['body'];
} elseif (!empty($error)) {
$data['head']['body'] = $error;
} elseif (isset($_POST['preview'])) {
$data['head']['body'] = $cs_lang['preview'];
}
if (isset($_POST['preview']) and empty($error)) {
$data['if']['preview'] = TRUE;
$data['preview']['date'] = cs_date('unix', $history['history_time'], 1);
$cs_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active', "users_id = '" . $history['users_id'] . "'");
$data['preview']['user'] = cs_user($history['users_id'], $cs_user['users_nick'], $cs_user['users_active']);
$data['preview']['text'] = cs_secure($history['history_text'], 1, 1, 1, 1);
}
if (!empty($error) or !isset($_POST['submit']) or isset($_POST['preview'])) {
if (empty($cs_main['rte_html'])) {
$data['if']['no_rte_html'] = 1;
$data['history']['abcode_smileys'] = cs_abcode_smileys('history_text', 1);
$data['history']['abcode_features'] = cs_abcode_features('history_text', 1, 1);
$data['history']['text'] = $history['history_text'];
$data['if']['rte_html'] = 0;
} else {
$data['if']['rte_html'] = 1;
$data['if']['no_rte_html'] = 0;
$data['history']['rte_html'] = cs_rte_html('history_text', $history['history_text']);
}
echo cs_subtemplate(__FILE__, $data, 'history', 'create');
示例4: explode
$tr = 0;
for ($run = 0; $run < $members_loop; $run++) {
$members = $data['squads'][$sq_run]['members'];
$hidden = explode(',', $members[$run]['users_hidden']);
$allow = $members[$run]['users_id'] == $account['users_id'] or $account['access_users'] > 4 ? 1 : 0;
if (empty($members[$run]['users_picture'])) {
$members[$run]['picture'] = $cs_lang['nopic'];
} else {
$place = 'uploads/users/' . $members[$run]['users_picture'];
$size = getimagesize($cs_main['def_path'] . '/' . $place);
$members[$run]['picture'] = cs_html_img($place, $size[1], $size[0]);
}
$url = 'symbols/countries/' . $members[$run]['users_country'] . '.png';
$members[$run]['country'] = cs_html_img($url, 11, 16) . ' ';
$members[$run]['nick'] = $data['squads'][$sq_run]['clans_tagpos'] == 1 ? $data['squads'][$sq_run]['clans_tag'] . ' ' : '';
$members[$run]['nick'] .= cs_user($members[$run]['users_id'], $members[$run]['users_nick'], $members[$run]['users_active'], $members[$run]['users_delete']);
$members[$run]['nick'] .= $data['squads'][$sq_run]['clans_tagpos'] == 2 ? ' ' . $data['squads'][$sq_run]['clans_tag'] : '';
$users_name = !in_array('users_name', $hidden) || !empty($allow) ? $members[$run]['users_name'] : '';
$users_surname = !in_array('users_surname', $hidden) || !empty($allow) ? $members[$run]['users_surname'] : '';
$members[$run]['surname'] = empty($users_name) && empty($users_surname) ? ' - ' : $users_name . ' ' . $users_surname;
$members[$run]['task'] = cs_secure($members[$run]['members_task']);
$since = empty($members[$run]['members_since']) ? '-' : cs_date('date', $members[$run]['members_since']);
$members[$run]['since'] = $since;
$tr++;
$members[$run]['if']['td'] = FALSE;
$members[$run]['if']['end_row'] = FALSE;
if ($tr % 2 != 0 && $tr == $members_loop) {
$members[$run]['if']['td'] = TRUE;
} elseif ($tr % 2 == 0 && $tr != $members_loop) {
$members[$run]['if']['end_row'] = TRUE;
}
示例5: cs_secure
$data['threads'][$run]['important'] = '';
}
$headline = cs_secure($thread['threads_headline']);
$data['threads'][$run]['headline'] = cs_link($headline, 'board', 'thread', 'where=' . $thread['threads_id']);
if ($thread['threads_comments'] > $account['users_limit']) {
$data['threads'][$run]['pages'] = cs_html_br(1);
$data['threads'][$run]['pages'] .= $cs_lang['page'] . ' ';
$data['threads'][$run]['pages'] .= cs_pages('board', 'thread', $thread['threads_comments'], 0, $thread['threads_id'], 0, 0, 1);
} else {
$data['threads'][$run]['pages'] = '';
}
$data['threads'][$run]['comments'] = $thread['threads_comments'];
$data['threads'][$run]['view'] = $thread['threads_view'];
if (!empty($thread['threads_last_time'])) {
$date = cs_date('unix', $thread['threads_last_time'], 1);
$comments = $thread['threads_comments'] == 0 ? 0 : $thread['threads_comments'] - 1;
$goto = floor($comments / $account['users_limit']) * $account['users_limit'];
$goto .= '#com' . $thread['threads_comments'];
$data['threads'][$run]['last'] = cs_link($date, 'board', 'thread', 'where=' . $thread['threads_id'] . '&start=' . $goto);
if (!empty($thread['users_id'])) {
$data['threads'][$run]['last_user'] = cs_html_br(1);
$data['threads'][$run]['last_user'] .= $cs_lang['from'] . ' ';
$data['threads'][$run]['last_user'] .= cs_user($thread['users_id'], $thread['users_nick'], $thread['users_active']);
} else {
$data['threads'][$run]['last_user'] = '';
}
}
$run++;
}
}
echo cs_subtemplate(__FILE__, $data, 'board', 'active');
示例6: 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');
示例7: empty
$wars_access = empty($account['access_wars']) ? 0 : $account['access_wars'];
if (!empty($squadmember) or $wars_access >= 3) {
$wars['if']['squadmember'] = TRUE;
$wars['if']['no_players'] = FALSE;
$wars['if']['status'] = FALSE;
$tables = 'players ply INNER JOIN {pre}_users usr ON ply.users_id = usr.users_id';
$cells = 'ply.users_id AS users_id, ply.players_status AS players_status, ' . 'ply.players_time AS players_time, usr.users_nick AS users_nick, usr.users_active AS users_active';
$nplayers = cs_sql_select(__FILE__, $tables, $cells, 'ply.wars_id = \'' . $wars_id . '\'', 'ply.players_status DESC', 0, 0);
if (empty($nplayers)) {
$wars['if']['no_players'] = TRUE;
$wars['nplayers'] = array();
} else {
$in_list = 0;
$pl = 0;
foreach ($nplayers as $player) {
$wars['nplayers'][$pl]['user'] = cs_user($player['users_id'], $player['users_nick'], $player['users_active']);
$wars['nplayers'][$pl]['status'] = $cs_lang[$player['players_status']];
$wars['nplayers'][$pl]['date'] = cs_date('unix', $player['players_time'], 1);
if ($player['users_id'] == $account['users_id']) {
$in_list = 1;
}
$pl++;
}
}
if (!empty($squadmember)) {
$wars['if']['status'] = TRUE;
if (!isset($_POST['status'])) {
$condition = 'users_id = \'' . $account['users_id'] . '\' AND wars_id = \'' . $wars_id . '\'';
$select = cs_sql_select(__FILE__, 'players', 'players_id, players_status', $condition);
$wars['status']['yes'] = '';
$wars['status']['maybe'] = '';
示例8: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('board');
require_once 'mods/board/functions.php';
$data = array();
$data['stats']['topics'] = cs_sql_count(__FILE__, 'threads');
$data['stats']['posts'] = cs_sql_count(__FILE__, 'comments', 'comments_mod = \'board\'');
$data['stats']['users'] = cs_sql_count(__FILE__, 'users', 'users_active = 1 AND users_delete = 0');
$data['stats']['categories'] = cs_sql_count(__FILE__, 'categories', 'categories_mod = \'board\'');
$data['stats']['boards'] = cs_sql_count(__FILE__, 'board');
$data['stats']['users_active'] = cs_sql_count(__FILE__, 'comments', 'comments_mod = \'board\'', 'users_id');
$user = toplist_comments(0, 3);
$data['stats']['toplist'] = '';
if (!empty($user)) {
foreach ($user as $users_data) {
$data['stats']['toplist'] .= empty($users_data['users_nick']) ? '- (' . $users_data['num_comments'] . ' ' . $cs_lang['posts'] . '), ' : cs_user($users_data['users_id'], $users_data['users_nick'], $users_data['users_active'], $users_data['users_delete']) . ' (' . $users_data['num_comments'] . ' ' . $cs_lang['posts'] . '), ';
}
$data['stats']['toplist'] = substr($data['stats']['toplist'], 0, -2);
}
$tables = 'threads t INNER JOIN {pre}_board b ON t.board_id = b.board_id ' . 'AND b.board_access <= \'' . $account['access_board'] . '\' AND b.board_pwd = \'\' ' . 'INNER JOIN {pre}_comments cms ON cms.comments_mod = \'board\' ' . 'AND cms.comments_fid = t.threads_id GROUP BY t.threads_id, t.threads_comments, t.threads_headline';
$cells = 't.threads_id AS threads_id, t.threads_comments AS threads_comments, ';
$cells .= 't.threads_headline AS threads_headline, COUNT(cms.comments_id) AS comments';
$select = cs_sql_select(__FILE__, $tables, $cells, 0, 'comments DESC');
$data['stats']['longest_thread'] = $select['threads_headline'];
$data['stats']['longest_thread_posts'] = $select['comments'];
$data['link']['longest_thread'] = cs_url('board', 'thread', 'where=' . $select['threads_id']);
$data['stats']['average_posts'] = !empty($data['stats']['topics']) ? round($data['stats']['posts'] / $data['stats']['topics'], 2) : 0;
echo cs_subtemplate(__FILE__, $data, 'board', 'stats');
示例9: cs_sql_update
$_SESSION['articles'][$id] = true;
cs_sql_update(__FILE__, 'articles', array('articles_views'), array(1 + $views), $id, 0, 0);
}
}
$cells = 'articles_views, articles_headline, users_id, articles_time, articles_text, articles_fornext, articles_com, categories_id';
$cs_articles = cs_sql_select(__FILE__, 'articles', $cells, "articles_id = '" . $cs_articles_id . "'");
$categories = cs_sql_select(__FILE__, 'categories', 'categories_picture, categories_access', "categories_id = '" . $cs_articles['categories_id'] . "'");
if ($categories['categories_access'] > $account['access_categories']) {
echo $cs_lang['nocat_axx'];
} else {
$cs_main['page_title'] = $cs_articles['articles_headline'];
cs_articles_views($cs_articles_id, $cs_articles['articles_views']);
$page = empty($cs_get['page']) ? 1 : $cs_get['page'];
$data['head']['articles_headline'] = cs_secure($cs_articles['articles_headline']);
$cs_articles_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active, users_delete', "users_id = '" . $cs_articles['users_id'] . "'");
$data['head']['users_link'] = cs_user($cs_articles['users_id'], $cs_articles_user['users_nick'], $cs_articles_user['users_active'], $cs_articles_user['users_delete']) . ' ';
$data['head']['articles_date'] = cs_date('unix', $cs_articles['articles_time'], 1);
$data['head']['pages'] = $page;
$data['if']['catimg'] = empty($categories['categories_picture']) ? false : true;
$data['cat']['url_catimg'] = empty($data['if']['catimg']) ? '' : 'uploads/categories/' . $categories['categories_picture'];
$with_html = cs_abcode_inhtml($cs_articles['articles_text']);
$text = trim(cs_abcode_inhtml($cs_articles['articles_text'], 'del'));
if (substr($text, 0, 3) == '<p>' and substr($text, -4, 4) == '</p>') {
$text = substr($text, 3, -4);
}
$text = explode("[pagebreak]", $text);
$count_text = count($text);
$page_now = $page - 1;
if (!empty($with_html)) {
$text[$page_now] = cs_abcode_inhtml($text[$page_now], 'add');
}
示例10: cs_user
$buddy_data['buddys_off'][$run]['users_nick'] = $buddys_off[$run]['users_nick'];
$buddy_data['buddys_off'][$run]['users_link'] = cs_user($buddys_off[$run]['buddys_user'], $buddys_off[$run]['users_nick'], $buddys_off[$run]['users_active'], $buddys_off[$run]['users_delete']);
$buddy_data['buddys_off'][$run]['buddys_id'] = $buddys_off[$run]['buddys_id'];
$buddy_data['buddys_off'][$run]['users_country'] = $buddys_off[$run]['users_country'];
}
for ($run = 0; $run < $loop_on; $run++) {
$buddy_data['buddys_on'][$run]['users_id'] = $buddys_on[$run]['buddys_user'];
$buddy_data['buddys_on'][$run]['users_nick'] = $buddys_on[$run]['users_nick'];
$buddy_data['buddys_on'][$run]['users_link'] = cs_user($buddys_on[$run]['buddys_user'], $buddys_on[$run]['users_nick'], $buddys_on[$run]['users_active'], $buddys_on[$run]['users_delete']);
$buddy_data['buddys_on'][$run]['buddys_id'] = $buddys_on[$run]['buddys_id'];
$buddy_data['buddys_on'][$run]['users_country'] = $buddys_on[$run]['users_country'];
}
}
if (isset($_GET['notice'])) {
$buddy_data['if']['manage'] = FALSE;
$buddy_data['if']['notice'] = TRUE;
$id = $_GET['notice'];
settype($id, 'integer');
$from = 'buddys bds INNER JOIN {pre}_users usr ON bds.buddys_user = usr.users_id';
$select = 'bds.buddys_id AS buddys_id, bds.buddys_time AS buddys_time, bds.buddys_user AS ';
$select .= 'buddys_user, bds.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, usr.users_delete AS users_delete, usr.users_laston AS ';
$select .= 'users_laston, bds.buddys_notice AS buddys_notice';
$where = "buddys_id = '" . $id . "'";
$cs_buddys = cs_sql_select(__FILE__, $from, $select, $where);
$buddys_loop = count($cs_buddys);
$buddy_data['buddys']['users_link'] = cs_user($cs_buddys['buddys_user'], $cs_buddys['users_nick'], $cs_buddys['users_active'], $cs_buddys['users_delete']);
$buddy_data['buddys']['users_laston'] = cs_date('unix', $cs_buddys['users_laston'], 1);
$buddy_data['buddys']['buddys_time'] = cs_date('unix', $cs_buddys['buddys_time'], 1);
$buddy_data['buddys']['buddys_notice'] = cs_secure($cs_buddys['buddys_notice'], 1, 1);
}
echo cs_subtemplate(__FILE__, $buddy_data, 'buddys', 'center');
示例11: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('board');
require_once 'mods/board/functions.php';
$data = array();
$cs_homelimit = cs_sql_select(__FILE__, 'users', 'users_homelimit, users_readtime', "users_id = '" . $account["users_id"] . "'");
$cs_readtime = cs_time() - $cs_homelimit['users_readtime'];
cs_sql_query(__FILE__, "DELETE FROM {pre}_read WHERE users_id = '" . $account['users_id'] . "' AND read_since < '" . $cs_readtime . "'");
$from = "threads thr " . "INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id " . "INNER JOIN {pre}_categories cat ON cat.categories_id = frm.categories_id " . "INNER JOIN {pre}_users usr ON thr.threads_last_user = usr.users_id " . "LEFT JOIN {pre}_members mem ON frm.squads_id = mem.squads_id AND mem.users_id = '" . $account['users_id'] . "' " . "LEFT JOIN {pre}_read red ON thr.threads_id = red.threads_id AND red.users_id = '" . $account['users_id'] . "'";
$where = "(frm.board_access <= '" . $account['access_board'] . "' OR mem.users_id = '" . $account['users_id'] . "') AND frm.board_pwd = '' AND thr.threads_last_time > '" . $cs_readtime . "' AND (thr.threads_last_time > red.read_since OR red.threads_id IS NULL)";
$select = 'cat.categories_name AS categories_name, cat.categories_id AS categories_id, frm.board_name AS board_name, frm.board_id AS board_id, thr.threads_headline AS threads_headline, thr.threads_last_time AS threads_last_time, thr.threads_comments AS threads_comments, thr.threads_id AS threads_id, usr.users_nick AS users_nick, usr.users_id AS users_id, usr.users_active AS users_active, usr.users_delete AS users_delete';
$order = 'thr.threads_last_time DESC';
$data['threads'] = cs_sql_select(__FILE__, $from, $select, $where, $order, 0, $cs_homelimit['users_homelimit']);
if (!empty($data['threads'])) {
$count_threads = count($data['threads']);
for ($run = 0; $run < $count_threads; $run++) {
$data['threads'][$run]['threads_last_time'] = !empty($data['threads'][$run]['threads_last_time']) ? cs_date('unix', $data['threads'][$run]['threads_last_time'], 1) : '';
$data['threads'][$run]['pages'] = $data['threads'][$run]['threads_comments'] <= $account['users_limit'] ? '' : cs_html_br(1) . cs_pages('board', 'thread', $data['threads'][$run]['threads_comments'], 0, $data['threads'][$run]['threads_id'], 0, 0, 1);
$data['threads'][$run]['users_nick'] = !empty($data['threads'][$run]['users_nick']) ? cs_html_br(1) . $cs_lang['from'] . ' ' . cs_user($data['threads'][$run]['users_id'], $data['threads'][$run]['users_nick'], $data['threads'][$run]['users_active'], $data['threads'][$run]['users_delete']) : '';
$data['threads'][$run]['new_posts'] = last_comment($data['threads'][$run]['threads_id'], $account['users_id'], $account['users_limit']);
}
echo cs_subtemplate(__FILE__, $data, 'board', 'users_home');
}
示例12: elseif
// only show "enter result" if both teams are known
if ($data['match']['squad1_id'] != CS_CUPS_TEAM_UNKNOWN && $data['match']['squad2_id'] != CS_CUPS_TEAM_UNKNOWN) {
$data['if']['nothingyet'] = true;
}
} elseif (!empty($squad1_member) && empty($data['match']['cupmatches_accepted1']) || !empty($squad2_member) && empty($data['match']['cupmatches_accepted2'])) {
$data['if']['accept'] = true;
} elseif (!empty($data['match']['cupmatches_accepted1']) && !empty($data['match']['cupmatches_accepted2'])) {
$data['if']['confirmed'] = true;
} elseif (!empty($data['match']['cupmatches_accepted1']) || !empty($data['match']['cupmatches_accepted2'])) {
$data['if']['waiting'] = true;
$other_team = $data['match']['cupmatches_accepted1'] == 1 ? 2 : 1;
if ($system['cups_system'] == CS_CUPS_TYPE_TEAMS) {
$link = empty($data['match']['squad' . $other_team . '_name']) ? $data['match']['squad' . $other_team . '_name_c'] : cs_link($data['match']['squad' . $other_team . '_name'], 'squads', 'view', 'id=' . $data['match']['squad' . $other_team . '_id']);
} else {
$users_data = cs_sql_select(__FILE__, 'users', 'users_active', "users_id = '" . $data['match']['squad' . $other_team . '_id'] . "'");
$link = cs_user($data['match']['squad' . $other_team . '_id'], $data['match']['user' . $other_team . '_nick'], $users_data['users_active']);
}
$data['lang']['waiting'] = sprintf($cs_lang['waiting'], $link);
} else {
$data['if']['waiting'] = true;
$data['lang']['waiting'] = $cs_lang['waiting_both'];
}
} else {
$data['if']['participator'] = false;
}
echo cs_subtemplate(__FILE__, $data, 'cups', 'match');
include_once 'mods/comments/functions.php';
$count = cs_sql_count(__FILE__, 'comments', 'comments_fid = \'' . $match_id . '\' AND comments_mod = \'cups\'');
if (!empty($count)) {
cs_comments_view($match_id, 'cups', 'match', $count);
}
示例13: cs_sql_select
$select .= 'usr.users_name AS users_name, usr.users_surname AS users_surname, usr.users_sex AS users_sex, ';
$select .= 'usr.users_picture AS users_picture, usr.users_active AS users_active, usr.users_delete AS users_delete, usr.users_hidden AS users_hidden, ';
$select .= 'usr.users_laston AS users_laston, usr.users_invisible AS users_invisible';
$from = 'members mem INNER JOIN {pre}_users usr ON mem.users_id = usr.users_id ';
$where = "mem.squads_id='" . $squads_id . "'";
$order = 'mem.members_order ASC, usr.users_nick ASC';
$data['members'] = cs_sql_select(__FILE__, $from, $select, $where, $order, 0, 0, 0);
$data['squad']['members'] = count($data['members']);
for ($run = 0; $run < $data['squad']['members']; $run++) {
$data['members'][$run]['countrypath'] = 'symbols/countries/' . $data['members'][$run]['users_country'] . '.png';
$data['members'][$run]['country'] = $cs_country[$data['members'][$run]['users_country']];
$data['members'][$run]['members_since'] = empty($data['members'][$run]['members_since']) ? '-' : cs_date('date', $data['members'][$run]['members_since']);
$data['members'][$run]['page'] = cs_userstatus($data['members'][$run]['users_laston'], $data['members'][$run]['users_invisible']);
$users_nick = empty($data['members'][$run]['members_admin']) ? cs_secure($data['members'][$run]['users_nick']) : cs_html_big(1) . cs_secure($data['members'][$run]['users_nick']) . cs_html_big(0);
$nick = $data['squad']['clans_tagpos'] == 1 ? $data['squad']['clans_tag'] . ' ' . $users_nick : $users_nick . ' ' . $data['squad']['clans_tag'];
$data['members'][$run]['users_url'] = cs_user($data['members'][$run]['users_id'], $data['members'][$run]['users_nick'], $data['members'][$run]['users_active'], $data['members'][$run]['users_delete']);
}
//ranks
$data['if']['rank'] = 0;
if (!empty($account['access_ranks'])) {
$cells = 'ranks_id, ranks_name, ranks_url, ranks_img, ranks_code';
$ranks = cs_sql_select(__FILE__, 'ranks', $cells, "squads_id = '" . $squads_id . "'", 'ranks_name', 0, 5);
$ranks_loop = count($ranks);
$data['if']['rank'] = empty($ranks_loop) ? FALSE : TRUE;
for ($run = 0; $run < $ranks_loop; $run++) {
$ranks[$run]['name'] = cs_secure($ranks[$run]['ranks_name']);
$ranks[$run]['picture'] = '';
if (!empty($ranks[$run]['ranks_url']) and $ranks[$run]['ranks_img'] != 'http://') {
$picture = cs_html_img($ranks[$run]['ranks_img']);
$ranks[$run]['picture'] = cs_html_link('http://' . $ranks[$run]['ranks_url'], $picture);
} else {
示例14: cs_sql_select
$cs_cash = cs_sql_select(__FILE__, 'cash', $select, "cash_id = '" . $cash_id . "'");
}
if (!isset($_POST['submit']) and empty($error)) {
$data['head']['body'] = $cs_lang['body_info'];
} elseif (!empty($error)) {
$data['head']['body'] = $error;
}
if (!empty($error) or !isset($_POST['submit'])) {
$data['cash'] = $cs_cash;
$data['cash']['cash_money'] = cs_secure($data['cash']['cash_money'], 0, 0, 0);
$data['cash']['cash_text'] = cs_secure($data['cash']['cash_text'], 0, 0, 0);
$data['cash']['cash_info'] = cs_secure($data['cash']['cash_info'], 0, 0, 0);
$inoutlist[0]['cash_inout'] = 'in';
$inoutlist[0]['name'] = $cs_lang['drop_in'];
$inoutlist[1]['cash_inout'] = 'out';
$inoutlist[1]['name'] = $cs_lang['drop_out'];
$data['cash']['inout_sel'] = cs_dropdown('cash_inout', 'name', $inoutlist, $cs_cash['cash_inout']);
$data['cash']['date_sel'] = cs_dateselect('datum', 'date', $cs_cash['cash_time'], 2000);
$data['cash']['abcode_smileys'] = cs_abcode_smileys('cash_info');
$data['cash']['abcode_features'] = cs_abcode_features('cash_info');
$data['cash']['id'] = $cash_id;
$cs_user = cs_sql_select(__FILE__, 'users', 'users_nick', "users_id = '" . $cs_cash['users_id'] . "'");
$data['cash']['users_sel'] = cs_user($cs_cash['users_id'], $cs_user['users_nick']);
$data['users']['nick'] = empty($users_nick) ? $cs_user['users_nick'] : cs_secure($users_nick, 0, 0, 0);
echo cs_subtemplate(__FILE__, $data, 'cash', 'edit');
} else {
$cash_cells = array_keys($cs_cash);
$cash_save = array_values($cs_cash);
cs_sql_update(__FILE__, 'cash', $cash_cells, $cash_save, $cash_id);
cs_redirect($cs_lang['changes_done'], 'cash');
}
示例15: cs_icon
if ($account['access_comments'] >= 5 or !empty($thread_mods['boardmods_del'])) {
$img_del = cs_icon('editdelete', 16, $cs_lang['remove']);
$data['thread_desc']['remove'] = cs_link($img_del, $mod, 'thread_remove', 'id=' . $data['thread']['threads_id'], 0, $cs_lang['remove']);
} elseif ($data['thread']['users_id'] == $account['users_id'] and empty($sum)) {
$img_del = cs_icon('editdelete', 16, $cs_lang['remove']);
$data['thread_desc']['remove'] = cs_link($img_del, $mod, 'thread_remove', 'id=' . $data['thread']['threads_id'], 0, $cs_lang['remove']);
}
}
$data['if']['closed'] = false;
if (!empty($data['thread']['threads_close'])) {
$data['if']['closed'] = true;
if ($data['thread']['threads_close'] == -1) {
$message = $cs_lang['thread_closed1'];
} else {
$user = cs_sql_select(__FILE__, 'users', 'users_nick,users_active', 'users_id = ' . (int) $data['thread']['threads_close']);
$user_lnk = cs_user($data['thread']['threads_close'], $user['users_nick'], $user['users_active']);
$user_lnk .= ' ' . cs_link(cs_icon('mail_send', 16, 'PM'), 'messages', 'create', 'to_id=' . $data['thread']['threads_close']);
$message = sprintf($cs_lang['thread_closed2'], $user_lnk);
}
$data['thread']['closed_img'] = cs_icon('lockoverlay', 48);
$data['thread']['closed'] = $message;
}
$data['if']['modpanel'] = false;
$data['if']['modp_close'] = false;
$data['if']['modp_open'] = false;
$data['if']['modp_delpin'] = false;
$data['if']['modp_addpin'] = false;
$allow_close_now = 0;
//Anfang Modpanel
if ($account['access_board'] >= 5 or !empty($thread_mods['boardmods_modpanel'])) {
$allow_close_now = 1;