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


PHP getcount函数代码示例

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


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

示例1: main

 function main()
 {
     global $_G;
     if ($_GET['onsubmit'] && check()) {
         foreach ($_GET[ids] as $k => $v) {
             $id = intval($v);
             if ($_GET[del][$k] == 0) {
                 continue;
             }
             if ($_GET['_del_all'] == 1 && $_GET['del'][$k]) {
                 DB::delete(__CLASS__, "id=" . intval($id));
             }
         }
         cpmsg('操作成功', 'success', 'm=' . __CLASS__ . '&a=' . __FUNCTION__);
         return false;
     }
     $size = 30;
     $start = ($_G['page'] - 1) * $size;
     $url = '';
     $and = '';
     if ($_GET['uid']) {
         $uid = intval($_GET[uid]);
         $and .= " AND uid =" . $uid;
         $url .= "&uid=" . $uid;
     }
     if ($_GET['username']) {
         $username = urldecode_utf8(trim($_GET[username]));
         $and .= " AND username ='" . $username . "'";
         $url .= "&username=" . urlencode_utf8($username);
     }
     if ($_GET['ip']) {
         $ip = trim($_GET[ip]);
         $and .= " AND ip ='" . $ip . "'";
         $url .= "&ip=" . $ip;
     }
     if ($_GET['jf_down']) {
         $jf_down = intval($_GET[jf_down]);
         $and .= " AND org_jf >='" . $jf_down . "'";
         $url .= "&jf_down=" . $jf_down;
     }
     if ($_GET['jf_up']) {
         $jf_up = intval($_GET[jf_up]);
         $and .= " AND org_jf <='" . $jf_up . "'";
         $url .= "&jf_up=" . $jf_up;
     }
     if ($_GET[type] && array_key_exists($_GET[type], $_G['setting']['jf_type'])) {
         $type = addslashes(trim($_GET[type]));
         $and .= " AND type='{$type}'";
         $url .= "&type=" . $type;
     }
     $sign_list = DB::fetch_all("SELECT * FROM " . DB::table(__CLASS__) . " where 1 {$and}  ORDER BY id DESC LIMIT {$start},{$size}");
     $count = getcount(__CLASS__, $and);
     $showpage = multi($count, $size, $_G[page], URL . "m=sign&a=main" . $url);
     foreach ($sign_list as $k => $v) {
         $sign_list[$k][username_url] = urlencode_utf8($v[username]);
         $sign_list[$k][dateline] = dgmdate($v[dateline], 'u');
     }
     $this->add(array('count' => $count, 'sign_list' => $sign_list, 'showpage' => $showpage));
     $this->show('sign/main');
 }
开发者ID:sayi21cn,项目名称:ttae_open,代码行数:60,代码来源:sign.action.php

示例2: transfer_list

function transfer_list()
{
    $page = max(1, MooGetGPC('page', 'integer', 'G'));
    $limit = 16;
    $offset = ($page - 1) * $limit;
    $uid = MooGetGPC('uid', 'integer', 'P');
    $sid = MooGetGPC('sid', 'integer', 'P');
    $s_str = $and = '';
    if ($uid > 0) {
        $s_str .= 'uid like \'%' . $uid . '%\'';
        $and = ' AND ';
    }
    if ($sid > 0) {
        $s_str .= $and . 'sid=' . $sid;
    }
    if (!empty($s_str)) {
        $s_str = ' WHERE ' . $s_str;
    }
    $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}members_transfer {$s_str} ORDER BY id DESC LIMIT {$offset},{$limit}";
    $transfer = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql);
    $total = getcount('members_transfer', $s_str);
    $currenturl = "index.php?action=other_members_transfer&h=list";
    $pages = multipage($total, $limit, $page, $currenturl);
    require_once adminTemplate('transfer_list');
}
开发者ID:noikiy,项目名称:zays,代码行数:25,代码来源:other_members_transfer.php

示例3: GetInfo

function GetInfo()
{
    $body = "<table><tr><td>";
    $body .= "<img src='../images/rasp_title.gif' /></td>";
    $body .= "<tr collspan='2'><td></td></tr></table>";
    $body .= "<blockquote>";
    $body .= "<font class='news_text'>В таблице \"Расписание\" базы данных содержится <b>" . getcount("select count(id) as sm from as_persones") . "</b> записей.<br /><br />В данную таблицу вносят данные по каждой учебной группе, указывая ее номер (1, 2, ...). Для того, чтобы внести информацию для повторно сдающих учащихся, создают специальную группу, с указанием в поле номера группы - \"Повторники\". Предусмотрена возможность внесения произвольной информации - поле \"Примечание\".</font><br><br>";
    $body .= "</blockquote>";
    $body .= "<table><tr><td>";
    $body .= "<img src='../images/person_title.gif' /></td>";
    $body .= "<tr collspan='2'><td></td></tr></table>";
    $body .= "<blockquote>";
    $body .= "<font class='news_text'>В таблице \"Персонал\" базы данных содержится <b>" . getcount("select count(id) as sm from as_persones") . "</b> записей.<br /><br />В данную таблицу вносят данные о преподавателях: фотография, Ф.И.О., звание/должность.</font><br><br>";
    $body .= "</blockquote>";
    $body .= "<table><tr><td>";
    $body .= "<img src='../images/otz_title.gif' /></td>";
    $body .= "<tr collspan='2'><td></td></tr></table>";
    $body .= "<blockquote>";
    $body .= "<font class='news_text'>Таблица отзывов содержит <b>" . getcount("select count(id) as sm from as_board") . " </b> записей </font>";
    $body .= "<font class='news_text'>, из них не обработано <b>" . getcount("select count(id) as sm from as_board where visibled = 'N' or visibled is NULL") . "</b> записей.<br /><br />Эта таблица содержит отзывы о преподавателях, сделанные посетителями сайта. Данные из этой таблицы появяться на сайте для обозрения посетителей только после того, как администратор сайта установит соответствующий флаг. При необходимости, содержание отзыва можно отредактировать.</font>";
    $body .= "</blockquote>";
    $body .= "<br>";
    $body .= "<div align='center'><font class='news_text'>Для управления содержанием разделов выберите необходимую Вам ссылку </font></div>";
    return $body;
}
开发者ID:vskrip,项目名称:autosar,代码行数:25,代码来源:f_info.php

示例4: post

 function post()
 {
     global $_G;
     $type = trim_html($_GET['type'], 1);
     $type_arr = array('message', 'feedback');
     if (!$type || !in_array($type, $type_arr)) {
         $type = 'message';
     }
     $arr = array();
     $arr['type'] = $type;
     $arr['content'] = trim_html($_GET['content'], 1);
     $arr['name'] = trim_html($_GET['name'], 1);
     $arr['contact'] = trim_html($_GET['contact'], 1);
     $arr['company_name'] = trim_html($_GET['company_name'], 1);
     $arr['url'] = trim_html($_GET['url'], 1);
     $arr['check'] = 0;
     $arr['dateline'] = TIMESTAMP;
     if ($_G['uid'] > 0 && !$arr['name']) {
         $arr['name'] = $_G['username'];
     }
     if ($arr['email'] && !is_email($arr['email'])) {
         msg('邮箱格式不正确');
     }
     $count = getcount('message', "content = '" . $arr['content'] . "'");
     if ($count > 0) {
         msg('您的信息我们已收到,感谢提交');
     }
     DB::insert('message', $arr);
     msg('提交成功', 'success');
 }
开发者ID:lqlstudio,项目名称:ttae_open,代码行数:30,代码来源:message.action.php

示例5: csc

 function csc($task = array())
 {
     global $_G;
     if (getcount('home_blog', array('uid' => $_G['uid']))) {
         return true;
     }
     return array('csc' => 0, 'remaintime' => 0);
 }
开发者ID:pan289091315,项目名称:Discuz,代码行数:8,代码来源:task_blog.php

示例6: existdomain

function existdomain($domain, $domainroot)
{
    global $_G;
    $exist = false;
    if (getcount('common_domain', array('domain' => $domain, 'domainroot' => $domainroot))) {
        $exist = true;
    }
    return $exist;
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:9,代码来源:function_domain.php

示例7: getFriendInfo

 function getFriendInfo($uId, $num = MY_FRIEND_NUM_LIMIT, $isExtra = false)
 {
     $users = $this->getUsers(array($uId), false, true, $isExtra, true, $num, false, true);
     $where = array('uId' => $uId, 'status' => 1);
     $totalNum = getcount('friend', $where);
     $friends = $users[0]['friends'];
     unset($users[0]['friends']);
     $result = array('totalNum' => $totalNum, 'friends' => $friends, 'me' => $users[0]);
     return new APIResponse($result);
 }
开发者ID:shiyake,项目名称:php-ihome,代码行数:10,代码来源:Users.php

示例8: active_rightbottom_message

function active_rightbottom_message()
{
    $type = MooGetGPC('type', 'string');
    $sql_where = ' WHERE  1=1 ';
    //note 显示全部
    if (isset($_GET['type']) == 'all') {
        $sql_where .= "";
        //note 显示已处理过的
    } else {
        if ((isset($_GET['type']) ? $_GET['type'] : '') == 'dealed') {
            $sql_where .= " AND dealstate = '1'";
            //note 显示未处理过的
        } else {
            $sql_where .= " AND dealstate = '0'";
        }
    }
    //分页
    $page_per = 20;
    $page = max(1, MooGetGPC('page', 'integer', 'G'));
    $limit = 20;
    $offset = ($page - 1) * $limit;
    //所管理的客服id列表
    $myservice_idlist = get_myservice_idlist();
    if (empty($myservice_idlist)) {
        $sql_where .= " AND sid IN({$GLOBALS['adminid']})";
    } elseif ($myservice_idlist == 'all') {
        //all为客服主管能查看所有的
    } else {
        $sql_where .= " AND sid IN({$myservice_idlist})";
    }
    if (isset($_GET['id'])) {
        $id = MooGetGPC('id', 'integer', 'G');
        $sql = "UPDATE {$GLOBALS['dbTablePre']}admin_remark SET status=1 WHERE id='{$id}'";
        $GLOBALS['_MooClass']['MooMySQL']->query($sql);
        salert('操作成功', 'index.php?action=other_rightbottom&h=message');
    }
    $total = getcount('admin_remark', $sql_where);
    $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}admin_remark {$sql_where} ORDER BY id DESC LIMIT {$offset},{$limit}";
    $remark_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql);
    //note 获得当前的url 去除多余的参数
    /* $currenturl = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; 
    	$currenturl = preg_replace("/(&page=\d+)/","",$currenturl);
    	$currenturl = preg_replace("/(&type=undealed)/","",$currenturl);
    	$currenturl = preg_replace("/(&type=dealed)/","",$currenturl);
    	$currenturl = preg_replace("/(&type=all)/","",$currenturl);
    	$currenturl2 = $currenturl;
    	$currenturl = $currenturl."&type=$type";
    	echo $currenturl; */
    $currenturl = "index.php?action=other_rightbottom&h=message&type={$type}";
    //note 跳转到某一页
    $page_num = ceil($total / $limit);
    $page_links = multipage($total, $page_per, $page, $currenturl);
    //note 调用模板
    require adminTemplate('other_rightbottom_message');
}
开发者ID:noikiy,项目名称:zays,代码行数:55,代码来源:other_rightbottom.php

示例9: generate_dropdown

function generate_dropdown($id, $gid, $pid)
{
    $c = getcount("groups", "WHERE creator = '{$id}' AND group_id != '{$gid}'");
    if ($c == 0) {
        return false;
    }
    $e = '<select name="move_' . $pid . '"><option>Verschieben nach...</option>';
    $h = get_group($id, $gid);
    while (list($key, $val) = each($h)) {
        $e .= '<option value="' . $val['group_id'] . '">' . $val['title'] . '</option>';
    }
    $e .= '</select>';
    return $e;
}
开发者ID:BackupTheBerlios,项目名称:freechess-svn,代码行数:14,代码来源:groups_functions.php

示例10: getstatistics

function getstatistics()
{
    global $_SGLOBAL, $_SC, $_SCONFIG;
    $dbsize = 0;
    $query = $_SGLOBAL['db']->query("SHOW TABLE STATUS LIKE '{$_SC['tablepre']}%'", 'SILENT');
    while ($table = $_SGLOBAL['db']->fetch_array($query)) {
        $dbsize += $table['Data_length'] + $table['Index_length'];
    }
    $sitekey = trim($_SCONFIG['sitekey']);
    if (empty($sitekey)) {
        $sitekey = mksitekey();
        $_SGLOBAL['db']->query("REPLACE INTO " . tname('settings') . " (variable, value) VALUES ('sitekey', '{$sitekey}')");
        include_once S_ROOT . './function/cache.func.php';
        updatesettingcache();
    }
    $statistics = array('sitekey' => $sitekey, 'version' => S_VER, 'release' => S_RELEASE, 'php' => PHP_VERSION, 'mysql' => $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT VERSION()"), 0), 'dbsize' => $dbsize, 'charset' => $_SC['charset'], 'sitename' => preg_replace('/[\'\\"\\s]/s', '', $_SCONFIG['sitename']), 'adnum' => getcount('ads', array()), 'announcementnum' => getcount('announcements', array()), 'attachmentnum' => getcount('attachments', array()), 'forumnum' => getcount('forums', array()), 'categorynum' => getcount('categories', array()), 'channelnum' => getcount('channels', array()), 'friendlinknum' => getcount('friendlinks', array()), 'membernum' => getcount('members', array()), 'modelnum' => getcount('models', array()), 'pollnum' => getcount('polls', array()), 'reportnum' => getcount('reports', array()), 'robotnum' => getcount('robots', array()), 'spacecommentnum' => getcount('spacecomments', array()), 'spaceitemnum' => getcount('spaceitems', array()), 'tagnum' => getcount('tags', array()), 'usergroupnum' => getcount('usergroups', array()));
    $statistics['update'] = rawurlencode(serialize($statistics)) . '&h=' . substr(md5($_SERVER['HTTP_USER_AGENT'] . '|' . implode('|', $statistics)), 8, 8);
    return $statistics;
}
开发者ID:superman1982,项目名称:ng-cms,代码行数:19,代码来源:admin_index.php

示例11: getAllUsers

    function getAllUsers($from, $userNum, $friendNum = MY_FRIEND_NUM_LIMIT, $isExtra = false)
    {
        global $_SGLOBAL;
        $totalNum = getcount('space', '');
        // space
        $sql = 'SELECT s.*
				FROM %s s 
				ORDER BY s.uid
				LIMIT %d, %d';
        $sql = sprintf($sql, tname('space'), $from, $userNum);
        $query = $_SGLOBAL['db']->query($sql);
        $spaces = $uIds = array();
        while ($row = $_SGLOBAL['db']->fetch_array($query)) {
            $spaces[$row['uid']] = $row;
            $uIds[] = $row['uid'];
        }
        $users = $this->getUsers($uIds, $spaces, true, $isExtra, true, $friendNum, true);
        $result = array('totalNum' => $totalNum, 'users' => $users);
        return new APIResponse($result);
    }
开发者ID:shiyake,项目名称:php-ihome,代码行数:20,代码来源:Site.php

示例12: getAllUsers

    function getAllUsers($from, $num)
    {
        global $_SGLOBAL;
        $totalNum = getcount('space', '');
        $sql = 'SELECT s.*, sf.*
				FROM %s s 
				LEFT JOIN %s sf ON s.uid = sf.uid
				ORDER BY s.uid
				LIMIT %d, %d';
        $sql = sprintf($sql, tname('space'), tname('spacefield'), $from, $num);
        $query = $_SGLOBAL['db']->query($sql);
        $users = array();
        while ($space = $_SGLOBAL['db']->fetch_array($query)) {
            $user = $this->_space2user($space);
            $user['friends'] = $this->_getFriends($space['uid']);
            $user['action'] = 'add';
            $users[] = $user;
        }
        $result = array('totalNum' => $totalNum, 'users' => $users);
        return new APIResponse($result);
    }
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:21,代码来源:Site.php

示例13: updatestat

function updatestat($type, $primary = 0)
{
    global $_G;
    if (empty($_G['uid']) || empty($_G['setting']['updatestat'])) {
        return false;
    }
    $nowdaytime = dgmdate($_G['timestamp'], 'Ymd');
    if ($primary) {
        $setarr = array('uid' => $_G['uid'], 'daytime' => $nowdaytime, 'type' => $type);
        if (getcount('common_statuser', $setarr)) {
            return false;
        } else {
            DB::insert('common_statuser', $setarr);
        }
    }
    if (getcount('common_stat', array('daytime' => $nowdaytime))) {
        DB::query("UPDATE " . DB::table('common_stat') . " SET `{$type}`=`{$type}`+1 WHERE daytime='{$nowdaytime}'");
    } else {
        DB::query("DELETE FROM " . DB::table('common_statuser') . " WHERE daytime != '{$nowdaytime}'");
        DB::insert('common_stat', array('daytime' => $nowdaytime, $type => '1'));
    }
}
开发者ID:v998,项目名称:discuzx-en,代码行数:22,代码来源:function_stat.php

示例14: shop_list

 function shop_list()
 {
     global $_G, $assign;
     $shop_list = array();
     foreach ($assign[goods] as $k => $v) {
         $nick = $v['nick'];
         if (!$nick) {
             continue;
         }
         $and = "nick='{$nick}'" . ' AND hide = 0  AND `check`=1 ';
         //$and_time .= " AND start_time < ".TIMESTAMP;
         //$and_time .= " AND ( end_time = 0 or  end_time > ".TIMESTAMP.")";
         //$and .= ' AND `check` = 1  AND `hide`=0 AND num>0 ' .$and_time;
         $count = getcount('goods', $and);
         $arr = $v;
         $arr[desc] = cutstr(trim_html($v[desc], 1), 150);
         $arr[goods] = D(array('and' => $and, 'limit' => 4, 'all' => true));
         $arr['count'] = $count;
         $shop_list[] = $arr;
     }
     return array('shop_list' => $shop_list);
 }
开发者ID:lqlstudio,项目名称:ttae_open,代码行数:22,代码来源:data_api.php

示例15: showmessage

         showmessage('对不起,您的邀请码已经过期!');
     }
 }
 if ($bp['isactive'] == 1) {
     showmessage('users_have_actived', 'index.php', 2);
 }
 if (!@(include_once S_ROOT . './uc_client/client.php')) {
     showmessage('system_error');
 }
 //邮箱
 $email = isemail(trim($_POST['email'])) ? trim($_POST['email']) : '';
 if (empty($email)) {
     showmessage('email_format_is_wrong');
 }
 if ($_SCONFIG['checkemail']) {
     if ($count = getcount('spacefield', array('email' => $email))) {
         showmessage('email_has_been_registered');
     }
 }
 $num = strpos($email, '@');
 $num = $num > 15 ? 15 : $num;
 $username = substr($email, 0, $num);
 //创建新用户
 $newuid = uc_user_register($username, $password, $email);
 if ($newuid <= 0) {
     if ($newuid == -1) {
         showmessage('user_name_is_not_legitimate');
     } elseif ($newuid == -2) {
         showmessage('include_not_registered_words');
     } elseif ($newuid == -3) {
         showmessage('user_name_already_exists');
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_overseasinvite.php


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