当前位置: 首页>>代码示例>>PHP>>正文


PHP cs_sql_count函数代码示例

本文整理汇总了PHP中cs_sql_count函数的典型用法代码示例。如果您正苦于以下问题:PHP cs_sql_count函数的具体用法?PHP cs_sql_count怎么用?PHP cs_sql_count使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cs_sql_count函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cs_threads_comments

function cs_threads_comments($threads_id)
{
    settype($threads_id, 'integer');
    $condition = "comments_mod = 'board' AND comments_fid = '" . $threads_id . "'";
    $comments = cs_sql_count(__FILE__, 'comments', $condition);
    $cells = array('threads_comments');
    $content = array($comments);
    cs_sql_update(__FILE__, 'threads', $cells, $content, $threads_id, 0, 0);
    return $comments;
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:10,代码来源:repair.php

示例2: cs_trashmail

function cs_trashmail($email)
{
    $parts = explode('@', $email, 2);
    if (empty($parts[1])) {
        return false;
    } else {
        $where = "trashmail_entry = '" . strtolower(cs_sql_escape($parts[1])) . "'";
        $check = cs_sql_count(__FILE__, 'trashmail', $where);
        return empty($check) ? false : true;
    }
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:11,代码来源:trashmail.php

示例3: cs_admin_menu

function cs_admin_menu()
{
    global $cs_main, $account;
    $cs_lang = cs_translate('clansphere');
    $data = array();
    $recent_mod = $cs_main['mod'];
    $recent_action = $cs_main['action'];
    $link_count = 0;
    if (file_exists('mods/' . $recent_mod . '/manage.php') && $account['access_' . $recent_mod] >= 3) {
        include $cs_main['def_path'] . '/mods/' . $recent_mod . '/info.php';
        # look for sql table named like mod, else use first sql table given
        $mod_tables = is_array($mod_info['tables']) ? $mod_info['tables'] : array();
        if (in_array($recent_mod, $mod_tables)) {
            $sql_table = $recent_mod;
        } elseif (isset($mod_tables[0])) {
            $sql_table = $mod_tables[0];
        } else {
            $sql_table = false;
        }
        $sql_count = empty($sql_table) ? '' : ' (' . cs_sql_count(__FILE__, $sql_table) . ')';
        $link_count++;
        $data['menu']['manage'] = $recent_action == 'manage' ? $cs_lang['manage'] : cs_link($cs_lang['manage'], $recent_mod, 'manage') . $sql_count;
        $data['if']['manage'] = true;
    } else {
        $data['menu']['manage'] = '';
        $data['if']['manage'] = false;
    }
    if (file_exists('mods/' . $recent_mod . '/create.php') && $account['access_' . $recent_mod] >= 3 && $recent_mod != 'shoutbox') {
        $link_count++;
        $data['menu']['create'] = $recent_action == 'create' ? $cs_lang['create'] : cs_link($cs_lang['create'], $recent_mod, 'create');
        $data['if']['create'] = true;
    } else {
        $data['menu']['create'] = '';
        $data['if']['create'] = false;
    }
    if (file_exists('mods/' . $recent_mod . '/options.php') && $account['access_' . $recent_mod] >= 5) {
        $link_count++;
        $data['menu']['options'] = $recent_action == 'options' ? $cs_lang['options'] : cs_link($cs_lang['options'], $recent_mod, 'options');
        $data['if']['options'] = true;
    } else {
        $data['menu']['options'] = '';
        $data['if']['options'] = false;
    }
    if ($link_count > 1) {
        $data['links']['count'] = $link_count;
        return cs_subtemplate(__FILE__, $data, 'clansphere', 'admin_menu');
    }
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:48,代码来源:admin_menu.php

示例4: 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;
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:42,代码来源:tools.php

示例5: empty

$cs_sort[1] = 'gbk.gbook_time DESC';
$cs_sort[2] = 'gbk.gbook_time ASC';
$cs_sort[3] = 'usr.users_email DESC';
$cs_sort[4] = 'usr.users_email ASC';
$order = $cs_sort[$sort];
$user_gb = empty($_POST['user_gb']) ? 0 : $_POST['user_gb'];
if (empty($user_gb)) {
    $user_gb = empty($_GET['user_gb']) ? 0 : $_GET['user_gb'];
}
if (!empty($user_gb)) {
    $where = "users_nick = '" . cs_sql_escape($user_gb) . "'";
    $cs_user = cs_sql_select(__FILE__, 'users', 'users_id', $where);
    $id = $cs_user['users_id'];
}
$where = "gbook_users_id ='" . $id . "'";
$gbook_count = cs_sql_count(__FILE__, 'gbook', $where);
$data['head']['count'] = $gbook_count;
$data['head']['pages'] = cs_pages('gbook', 'manage', $gbook_count, $start, $id, $sort);
$data['head']['user_gb'] = empty($user_gb) ? '' : $user_gb;
$data['head']['getmsg'] = cs_getmsg();
$data['sort']['email'] = cs_sort('gbook', 'manage', $start, $id, 3, $sort);
$data['sort']['time'] = cs_sort('gbook', 'manage', $start, $id, 1, $sort);
$from = 'gbook gbk LEFT JOIN {pre}_users usr ON gbk.users_id = usr.users_id';
$select = 'gbk.gbook_id AS gbook_id, gbk.users_id AS users_id, gbk.gbook_time AS gbook_time, gbk.gbook_nick AS gbook_nick, ';
$select .= 'gbk.gbook_email AS gbook_email, gbk.gbook_lock AS gbook_lock, gbk.gbook_ip AS gbook_ip, ';
$select .= 'usr.users_nick AS users_nick, usr.users_email AS users_email';
$cs_gbook = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']);
$gbook_loop = count($cs_gbook);
for ($run = 0; $run < $gbook_loop; $run++) {
    if ($cs_gbook[$run]['users_id'] > 0) {
        $gbook[$run]['nick'] = cs_secure($cs_gbook[$run]['users_nick']);
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:manage.php

示例6: cs_get

$cs_get = cs_get('id');
$data = array();
$users_id = empty($cs_get['id']) ? 0 : $cs_get['id'];
$nick_temp = cs_sql_select(__FILE__, 'users', 'users_nick', 'users_id = ' . $users_id);
if (isset($_GET['agree'])) {
    $nick = $nick_temp['users_nick'];
    $chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
    $chars_count = strlen($chars) - 1;
    $mail = '';
    $given = 1;
    while (!empty($given)) {
        for ($i = 0; $i < 40; $i++) {
            $rand = rand(0, $chars_count);
            $mail .= $chars[$rand];
        }
        $given = cs_sql_count(__FILE__, 'users', "users_email = '" . $mail . "'");
    }
    $array_data = array('access_id' => 0, 'users_nick' => $nick, 'users_pwd' => '', 'users_name' => '', 'users_surname' => '', 'users_sex' => '', 'users_age' => '', 'users_height' => 0, 'users_lang' => '', 'users_country' => "fam", 'users_postalcode' => '', 'users_place' => '', 'users_adress' => '', 'users_icq' => 0, 'users_jabber' => '', 'users_skype' => '', 'users_email' => $mail, 'users_url' => '', 'users_phone' => '', 'users_mobile' => '', 'users_laston' => 0, 'users_picture' => '', 'users_avatar' => '', 'users_signature' => '', 'users_info' => '', 'users_regkey' => '', 'users_register' => 0, 'users_delete' => 1);
    $array_keys = array_keys($array_data);
    $array_values = array_values($array_data);
    cs_sql_update(__FILE__, 'users', $array_keys, $array_values, $users_id);
    cs_sql_delete(__FILE__, 'members', $users_id, 'users_id');
    cs_cache_clear();
    cs_redirect($cs_lang['del_true'], 'users');
}
if (isset($_GET['cancel'])) {
    cs_redirect($cs_lang['del_false'], 'users');
} else {
    $data['head']['body'] = sprintf($cs_lang['rly_rmv_user'], $nick_temp['users_nick']);
    $data['url']['agree'] = cs_url('users', 'remove', 'id=' . $users_id . '&amp;agree');
    $data['url']['cancel'] = cs_url('users', 'remove', 'id=' . $users_id . '&amp;cancel');
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:remove.php

示例7: count

}
if (isset($_POST['submit_1'])) {
    $post_count = count($_POST);
    $post_count = $post_count - '1';
    $cs_gallery_pic['folders_id'] = empty($_POST['folders_name']) ? $_POST['folders_id'] : make_folders_create('gallery', $_POST['folders_name']);
    $cs_gallery_option = cs_sql_option(__FILE__, 'gallery');
    $img_max['thumbs'] = $cs_gallery_option['thumbs'];
    for ($run = 0; $run < $post_count; $run++) {
        if (!empty($_POST['status_' . $run])) {
            $name = $_POST['name_' . $run];
            if (!extension_loaded('gd')) {
                die(cs_error_internal(0, 'GD extension not installed.'));
            }
            if (cs_resample('uploads/gallery/pics/' . $name, 'uploads/gallery/thumbs/' . 'Thumb_' . $name, $img_max['thumbs'], $img_max['thumbs'])) {
                $where = "gallery_name = '" . cs_sql_escape($name) . "'";
                $search = cs_sql_count(__FILE__, 'gallery', $where);
                if (empty($search)) {
                    $cs_gallery_pic['users_id'] = $account['users_id'];
                    $cs_gallery_pic['gallery_name'] = $name;
                    $cs_gallery_pic['gallery_status'] = isset($_POST['gallery_status']) ? $_POST['gallery_status'] : 0;
                    $cs_gallery_pic['gallery_access'] = isset($_POST['gallery_access']) ? $_POST['gallery_access'] : 0;
                    $cs_gallery_pic['gallery_watermark'] = $_POST['gallery_watermark'];
                    if (!empty($_POST['gallery_watermark'])) {
                        $watermark_pos = $_POST['watermark_pos'];
                        $watermark_trans = $_POST['gallery_watermark_trans'];
                        $cs_gallery_pic['gallery_watermark_pos'] = $watermark_pos . '|--@--|' . $watermark_trans;
                    }
                    $extension = strlen(strrchr($name, "."));
                    $file = strlen($name);
                    $filename = substr($name, 0, $file - $extension);
                    $cs_gallery_pic['gallery_titel'] = $filename;
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:manage_advanced.php

示例8: cs_translate

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('wars');
$squads_id = empty($_REQUEST['where']) ? 0 : (int) $_REQUEST['where'];
$where_count = empty($squads_id) ? 0 : "squads_id = '" . $squads_id . "'";
$where = empty($squads_id) ? 0 : "war.squads_id = '" . $squads_id . "'";
$start = empty($_REQUEST['start']) ? 0 : (int) $_REQUEST['start'];
$cs_sort[1] = 'war.wars_date DESC';
$cs_sort[2] = 'war.wars_date ASC';
$cs_sort[3] = 'cln.clans_name DESC';
$cs_sort[4] = 'cln.clans_name ASC';
$cs_sort[5] = 'cat.categories_name DESC';
$cs_sort[6] = 'cat.categories_name ASC';
$sort = empty($_REQUEST['sort']) ? 1 : (int) $_REQUEST['sort'];
$order = $cs_sort[$sort];
$wars_count = cs_sql_count(__FILE__, 'wars', $where_count);
$data = array();
$data['info']['warcount'] = sprintf($cs_lang['count'], $wars_count);
$data['pages']['choice'] = cs_pages('wars', 'list', $wars_count, $start, $squads_id, $sort);
$data['url']['form'] = cs_url('wars', 'list');
$cid = "squads_fightus = '0'";
$data['squads'] = cs_sql_select(__FILE__, 'squads', 'squads_name, squads_id', $cid, 'squads_name', 0, 0);
$count_squads = count($data['squads']);
for ($run = 0; $run < $count_squads; $run++) {
    $data['squads'][$run]['name'] = cs_secure($data['squads'][$run]['squads_name']);
}
$data['sort']['date'] = cs_sort('wars', 'list', $start, $squads_id, 1, $sort);
$data['sort']['enemy'] = cs_sort('wars', 'list', $start, $squads_id, 3, $sort);
$data['sort']['category'] = cs_sort('wars', 'list', $start, $squads_id, 5, $sort);
$select = 'war.games_id AS games_id, war.wars_date AS wars_date, war.wars_status AS status, war.clans_id AS clans_id, cln.clans_short AS clans_short, cat.categories_name AS categories_name, war.categories_id AS categories_id, war.wars_score1 AS wars_score1, war.wars_score2 AS wars_score2, war.wars_id AS wars_id';
$from = 'wars war INNER JOIN {pre}_categories cat ON war.categories_id = cat.categories_id ';
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:list.php

示例9: cs_translate

<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('board');
$cs_usertime = cs_sql_select(__FILE__, 'users', 'users_readtime', "users_id = '" . $account["users_id"] . "'");
$cs_readtime = cs_time() - $cs_usertime['users_readtime'];
$from = 'threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id';
$conditions = "frm.board_access <= '" . $account['access_board'] . "' AND frm.board_pwd = ''";
$cs_count = cs_sql_count(__FILE__, $from, $conditions);
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
$data['lang']['count'] = $cs_count;
$data['pages']['list'] = cs_pages('board', 'active', $cs_count, $start);
$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}_read red ON thr.threads_id = red.threads_id AND red.users_id = '" . $account['users_id'] . "'";
$select = 'thr.threads_id AS threads_id, thr.threads_headline AS threads_headline, thr.threads_view AS threads_view, thr.threads_comments AS threads_comments, thr.threads_important AS threads_important, thr.threads_close AS threads_close, thr.threads_last_time AS threads_last_time, usr.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, red.read_since AS read_since';
$order = 'thr.threads_view DESC, thr.threads_last_time DESC';
$cs_threads = cs_sql_select(__FILE__, $from, $select, $conditions, $order, $start, $account['users_limit']);
if (empty($cs_threads)) {
    $data['if']['not_active'] = true;
    $data['if']['active'] = false;
} else {
    $data['if']['not_active'] = false;
    $data['if']['active'] = true;
    $run = 0;
    foreach ($cs_threads as $thread) {
        if (empty($thread['threads_comments'])) {
            include_once 'mods/board/repair.php';
            $thread['threads_comments'] = cs_threads_comments($thread['threads_id']);
        }
        $icon = 'post_';
        $tid = $thread['threads_id'];
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:active.php

示例10: cs_datereal

<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$tday = cs_datereal('d');
$tmonth = cs_datereal('n');
$tyear = cs_datereal('Y');
$daystart = mktime(0, 0, 0, $tmonth, $tday, $tyear);
$daystart = cs_timediff($daystart, 1);
$where = 'count_time > \'' . $daystart . '\'';
echo number_format(cs_sql_count(__FILE__, 'count', $where), 0, ',', '.');
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:11,代码来源:navday.php

示例11: cs_translate

<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('quotes');
$categories_id = empty($_REQUEST['where']) ? 0 : $_REQUEST['where'];
settype($categories_id, 'integer');
$where = empty($categories_id) ? 0 : "categories_id = '" . $categories_id . "'";
$start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start'];
$cs_sort[1] = 'quotes_headline DESC';
$cs_sort[2] = 'quotes_headline ASC';
$cs_sort[3] = 'quotes_time DESC';
$cs_sort[4] = 'quotes_time ASC';
$sort = empty($_REQUEST['sort']) ? 3 : $_REQUEST['sort'];
$order = $cs_sort[$sort];
$quotes_count = cs_sql_count(__FILE__, 'quotes', $where);
$data = array();
$data['url']['form'] = cs_url('quotes', 'manage');
$data['lang']['all'] = $cs_lang['total'] . ': ';
$data['head']['count'] = $quotes_count;
$data['head']['pages'] = cs_pages('quotes', 'manage', $quotes_count, $start, $categories_id, $sort);
$data['head']['message'] = cs_getmsg();
$quotesmod = "categories_mod = 'quotes'";
$categories_data = cs_sql_select(__FILE__, 'categories', '*', $quotesmod, 'categories_name', 0, 0);
$data['head']['dropdown'] = cs_dropdown('where', 'categories_name', $categories_data, $categories_id, 'categories_id');
$from = 'quotes qts LEFT JOIN {pre}_users usr ON qts.users_id = usr.users_id';
$select = 'qts.quotes_headline AS quotes_headline, qts.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, usr.users_delete AS users_delete, qts.quotes_time AS quotes_time, qts.quotes_id AS quotes_id';
$cs_quotes = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']);
$quotes_loop = count($cs_quotes);
$data['sort']['quotes_headline'] = cs_sort('quotes', 'manage', $start, $categories_id, 1, $sort);
$data['sort']['quotes_time'] = cs_sort('quotes', 'manage', $start, $categories_id, 3, $sort);
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:manage.php

示例12: settype

}
settype($board_id, 'integer');
include 'mods/board/functions.php';
$from = 'board frm INNER JOIN {pre}_categories cat ON frm.categories_id = cat.categories_id';
#$from .= " INNER JOIN {pre}_members mem ON frm.squads_id = mem.squads_id AND mem.users_id = '" . $account['users_id'] . "'";
$select = 'frm.board_pwd AS board_pwd, frm.board_name AS board_name, cat.categories_name AS categories_name, ';
$select .= 'frm.board_id AS board_id, cat.categories_id AS categories_id, frm.board_access AS board_access, frm.squads_id AS squads_id';
$where = "frm.board_id = " . (int) $board_id;
$cs_thread = cs_sql_select(__FILE__, $from, $select, $where, 0, 0, 1);
if (!empty($cs_thread['board_pwd'])) {
    $where = "users_id = " . (int) $account['users_id'] . " AND board_id = " . (int) $cs_thread['board_id'];
    $check_pw = cs_sql_count(__FILE__, 'boardpws', $where);
}
if (!empty($cs_thread['squads_id'])) {
    $where = "squads_id = " . (int) $cs_thread['squads_id'] . " AND users_id = " . (int) $account['users_id'];
    $check_sq = cs_sql_count(__FILE__, 'members', $where);
}
//Sicherheitsabfrage Beginn
$errorpage = 0;
if (empty($board_id) || count($cs_thread) == 0) {
    $errorpage++;
}
if ($account['access_board'] < $cs_thread['board_access'] or empty($check_pw)) {
    $errorpage = empty($check_sq) ? 1 : 0;
}
if (!empty($errorpage)) {
    return errorPage('thread_add', $cs_lang);
}
//Sicherheitsabfrage Ende
#check mod
$acc_mod = 0;
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:thread_add.php

示例13: 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');
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:30,代码来源:stats.php

示例14: cs_unlink

                cs_unlink('squads', $cs_squads['squads_picture']);
            }
            $cs_squads['squads_picture'] = $filename;
        } else {
            $error .= $cs_lang['up_error'];
        }
    }
    if (empty($cs_squads['clans_id'])) {
        $error .= $cs_lang['no_clan'] . cs_html_br(1);
    }
    if (empty($cs_squads['squads_name'])) {
        $error .= $cs_lang['no_name'] . cs_html_br(1);
    }
    $where = "squads_name = '" . cs_sql_escape($cs_squads['squads_name']) . "'";
    $where .= " AND squads_id != '" . $squads_id . "'";
    $search = cs_sql_count(__FILE__, 'squads', $where);
    if (!empty($search)) {
        $error .= $cs_lang['squad_exists'] . cs_html_br(1);
    }
}
if (!isset($_POST['submit'])) {
    $data['head']['body'] = $cs_lang['errors_here'];
} elseif (!empty($error)) {
    $data['head']['body'] = $error;
}
if (!empty($error) or !isset($_POST['submit'])) {
    foreach ($cs_squads as $key => $value) {
        $data['squads'][$key] = cs_secure($value);
    }
    $data['head']['mod'] = $cs_lang[$op_squads['label'] . 's'];
    $data['squads']['abcode'] = cs_abcode_features('squads_text');
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:edit.php

示例15: cs_translate

// $Id$
$cs_lang = cs_translate('wars');
$cs_post = cs_post('id');
$cs_get = cs_get('id');
$data = array();
$wars_id = empty($cs_get['id']) ? 0 : $cs_get['id'];
if (!empty($cs_post['id'])) {
    $wars_id = $cs_post['id'];
}
$cs_rounds['wars_id'] = $wars_id;
$cs_rounds['maps_id'] = 0;
$new_map = '';
$cs_rounds['rounds_score1'] = '';
$cs_rounds['rounds_score2'] = '';
$cs_rounds['rounds_description'] = '';
$cs_rounds['rounds_order'] = cs_sql_count(__FILE__, 'rounds', 'wars_id = \'' . $cs_rounds['wars_id'] . '\'') + 1;
$error = '';
if (!empty($_GET['up']) || !empty($_GET['down'])) {
    $roundid = !empty($_GET['up']) ? (int) $_GET['up'] : $_GET['down'];
    $round = cs_sql_select(__FILE__, 'rounds', 'rounds_order', "rounds_id = '" . $roundid . "'");
    $new_order = !empty($_GET['up']) ? $round['rounds_order'] - 1 : $round['rounds_order'] + 1;
    $where = "wars_id = '" . $wars_id . "' AND rounds_order = '" . $new_order . "'";
    $round_old = cs_sql_select(__FILE__, 'rounds', 'rounds_id', $where);
    $cells = array('rounds_order');
    if (empty($round_old)) {
        $rounds = cs_sql_select(__FILE__, 'rounds', 'rounds_id', "wars_id = '" . $wars_id . "'", 'rounds_id ASC', 0, 0);
        $count_rounds = count($rounds);
        for ($run = 0; $run < $count_rounds; $run++) {
            $values = array($run + 1);
            cs_sql_update(__FILE__, 'rounds', $cells, $values, $rounds[$run]['rounds_id']);
        }
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:rounds.php


注:本文中的cs_sql_count函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。