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


PHP dbcount函数代码示例

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


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

示例1: verify_sitelinks

 /**
  * Link ID validation
  * @param $link_id
  * @return bool|string
  */
 public static function verify_sitelinks($link_id)
 {
     if (isnum($link_id)) {
         return dbcount("(link_id)", DB_SITE_LINKS, "link_id='" . intval($link_id) . "'");
     }
     return FALSE;
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:12,代码来源:SiteLinks.php

示例2: set_forumVotes

/**
 * Cast Question Votes
 * @param     $info
 * @param int $points
 * @todo: move and improvise the voting system
 */
function set_forumVotes($info, $points = 0)
{
    global $userdata;
    // @todo: extend on user's rank threshold before can vote. - Reputation threshold- Roadmap 9.1
    // @todo: allow multiple votes / drop $res - Roadmap 9.1
    if (checkgroup($info['forum_vote']) && dbcount("('thread_id')", DB_FORUM_THREADS, "thread_locked='0'")) {
        $data = array('forum_id' => $_GET['forum_id'], 'thread_id' => $_GET['thread_id'], 'post_id' => $_GET['post_id'], 'vote_points' => $points, 'vote_user' => $userdata['user_id'], 'vote_datestamp' => time());
        $hasVoted = dbcount("('vote_user')", DB_FORUM_VOTES, "vote_user='" . intval($userdata['user_id']) . "' AND thread_id='" . intval($_GET['thread_id']) . "'");
        if (!$hasVoted) {
            $isSelfPost = dbcount("('post_id')", DB_FORUM_POSTS, "post_id='" . intval($_GET['post_id']) . "' AND post_user='" . intval($userdata['user_id']) . "");
            if (!$isSelfPost) {
                $result = dbquery_insert(DB_FORUM_VOTES, $data, 'save', array('noredirect' => 1, 'no_unique' => 1));
                if ($result && $info['forum_answer_threshold'] > 0) {
                    $vote_result = dbquery("SELECT SUM('vote_points'), thread_id FROM " . DB_FORUM_VOTES . " WHERE post_id='" . $data['post_id'] . "'");
                    $v_data = dbarray($vote_result);
                    if ($info['forum_answer_threshold'] != 0 && $v_data['vote_points'] >= $info['forum_answer_threshold']) {
                        $result = dbquery("UPDATE " . DB_FORUM_THREADS . " SET 'thread_locked'='1' WHERE thread_id='" . $v_data['thread_id'] . "'");
                    }
                }
                redirect(FORUM . "viewthread.php?thread_id=" . $_GET['thread_id'] . "&post_id=" . $_GET['post_id']);
            } else {
                redirect(FORUM . "viewthread.php?thread_id=" . $_GET['thread_id'] . "&post_id=" . $_GET['post_id'] . '&error=vote_self');
            }
        } else {
            redirect(FORUM . "viewthread.php?thread_id=" . $_GET['thread_id'] . "&post_id=" . $_GET['post_id'] . '&error=vote');
        }
    }
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:34,代码来源:forum_include.php

示例3: verify_post

 /**
  * Verify Post ID
  * @param $post_id
  * @return bool|string
  */
 public static function verify_post($post_id)
 {
     if (isnum($post_id)) {
         return dbcount("('post_id')", DB_FORUM_POSTS, "post_id='" . $post_id . "'");
     }
     return FALSE;
 }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:12,代码来源:Functions.php

示例4: flood_control

function flood_control($field, $table, $where)
{
    global $userdata, $settings, $locale;
    $flood = false;
    if (!iSUPERADMIN && !iADMIN && (!defined("iMOD") || !iMOD)) {
        $result = dbquery("SELECT MAX(" . $field . ") AS last_post FROM " . $table . " WHERE " . $where);
        if (dbrows($result)) {
            $data = dbarray($result);
            if (time() - $data['last_post'] < $settings['flood_interval']) {
                $flood = true;
                $result = dbquery("INSERT INTO " . DB_FLOOD_CONTROL . " (flood_ip, flood_timestamp) VALUES ('" . USER_IP . "', '" . time() . "')");
                if (dbcount("(flood_ip)", DB_FLOOD_CONTROL, "flood_ip='" . USER_IP . "'") > 4) {
                    if (iMEMBER && $settings['flood_autoban'] == "1") {
                        require_once INCLUDES . "sendmail_include.php";
                        require_once INCLUDES . "suspend_include.php";
                        $result = dbquery("UPDATE " . DB_USERS . " SET user_status='4', user_actiontime='0' WHERE user_id='" . $userdata['user_id'] . "'");
                        suspend_log($userdata['user_id'], 4, $locale['global_440'], true);
                        $message = str_replace("[USER_NAME]", $userdata['user_name'], $locale['global_442']);
                        sendemail($userdata['user_name'], $userdata['user_email'], $settings['siteusername'], $settings['siteemail'], $locale['global_441'], $message);
                    } elseif (!iMEMBER) {
                        $result = dbquery("INSERT INTO " . DB_BLACKLIST . " (blacklist_ip, blacklist_email, blacklist_reason) VALUES ('" . USER_IP . "', '', '" . $locale['global_440'] . "')");
                    }
                }
            }
        }
    }
    return $flood;
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:28,代码来源:flood_include.php

示例5: __construct

 public function __construct()
 {
     if (empty(self::$locale)) {
         $locale = fusion_get_locale('', LOCALE . LOCALESET . "admin/errors.php");
         $locale += fusion_get_locale('', LOCALE . LOCALESET . "errors.php");
         self::$locale += $locale;
     }
     $this->error_status = filter_input(INPUT_POST, 'error_status', FILTER_VALIDATE_INT, array('min_range' => 0, 'max_range' => 2));
     $this->posted_error_id = filter_input(INPUT_POST, 'error_id', FILTER_VALIDATE_INT);
     $this->delete_status = filter_input(INPUT_POST, 'delete_status', FILTER_VALIDATE_INT, array('min_range' => 0, 'max_range' => 2));
     $this->rowstart = filter_input(INPUT_GET, 'rowstart', FILTER_VALIDATE_INT) ?: 0;
     $this->error_id = filter_input(INPUT_GET, 'error_id', FILTER_VALIDATE_INT);
     if (isnum($this->error_status) && $this->posted_error_id) {
         dbquery("UPDATE " . DB_ERRORS . " SET error_status='" . $this->error_status . "' WHERE error_id='" . $this->posted_error_id . "'");
         redirect(FUSION_REQUEST);
     }
     if (isset($_POST['delete_entries']) && isnum($this->delete_status)) {
         dbquery("DELETE FROM " . DB_ERRORS . " WHERE error_status='" . $_POST['delete_status'] . "'");
         $source_redirection_path = preg_replace("~" . fusion_get_settings("site_path") . "~", "", FUSION_REQUEST, 1);
         redirect(fusion_get_settings("siteurl") . $source_redirection_path);
     }
     $result = dbquery("SELECT * FROM " . DB_ERRORS . " ORDER BY error_timestamp DESC LIMIT " . $this->rowstart . ",20");
     while ($data = dbarray($result)) {
         $this->errors[$data['error_id']] = $data;
     }
     $this->rows = $this->errors ? dbcount('(error_id)', DB_ERRORS) : 0;
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:27,代码来源:Errors.php

示例6: check_duplicate_ranks

 protected function check_duplicate_ranks()
 {
     global $aidlink;
     $comparing_data = dbarray(dbquery("SELECT rank_apply FROM " . DB_FORUM_RANKS . " WHERE rank_id='" . $this->data['rank_id'] . "'"));
     if ($this->data['rank_apply'] < USER_LEVEL_MEMBER && $this->data['rank_apply'] != $comparing_data['rank_apply'] && dbcount("(rank_id)", DB_FORUM_RANKS, (multilang_table("FR") ? "rank_language='" . LANGUAGE . "' AND" : "") . "\n                                    rank_id!='" . $this->data['rank_id'] . "' AND rank_apply='" . $this->data['rank_apply'] . "'")) {
         addNotice('info', self::$locale['413']);
         redirect(FUSION_SELF . $aidlink . '&section=fr');
     }
     return FALSE;
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:10,代码来源:ranks.php

示例7: EnterResult

function EnterResult($tid, $round, $match, $score1, $score2)
{
    $result1 = dbquery("SELECT * FROM " . DB_T_MATCHES . " WHERE match_round='" . $round . "' AND match_match='" . $match . "' AND match_tour='" . $tid . "'");
    $data1 = dbarray($result1);
    if ($score1 > $score2) {
        $winner = $data1['match_pl1'];
        $looser = $data1['match_pl2'];
    } else {
        $winner = $data1['match_pl2'];
        $looser = $data1['match_pl1'];
    }
    $result = dbquery("UPDATE " . DB_T_MATCHES . " SET match_score1='" . $score1 . "', match_score2='" . $score2 . "', match_winner='" . $winner . "', match_played='1' WHERE match_round='" . $round . "' AND match_match='" . $match . "' AND match_tour='" . $tid . "'");
    $pl = dbcount("(player_id)", DB_T_PLAYERS, "player_tour='" . $tid . "' AND player_checkin='1'");
    $max = getMaxPl($pl);
    $rounds = log($max) / log(2);
    if ($round == $rounds) {
        //fin12
        $set_w1 = dbquery("UPDATE " . DB_T_TOURS . " SET tour_w1='" . $winner . "', tour_w2='" . $looser . "' WHERE tour_id='" . $tid . "'");
        $check_f = dbarray(dbquery("SELECT tour_w3, tour_w4 FROM " . DB_T_TOURS . " WHERE tour_id='" . $tid . "'"));
        if ($check_f['tour_w3'] != "0" && $check_f['tour_w4'] != "0") {
            $fin = dbquery("UPDATE " . DB_T_TOURS . " SET tour_finished='1' WHERE tour_id='" . $tid . "'");
        }
    } elseif ($round == $rounds + 1) {
        //fin34
        $set_w3 = dbquery("UPDATE " . DB_T_TOURS . " SET tour_w3='" . $winner . "', tour_w4='" . $looser . "' WHERE tour_id='" . $tid . "'");
        $check_f = dbarray(dbquery("SELECT tour_w1, tour_w2 FROM " . DB_T_TOURS . " WHERE tour_id='" . $tid . "'"));
        if ($check_f['tour_w1'] != "0" && $check_f['tour_w2'] != "0") {
            $fin = dbquery("UPDATE " . DB_T_TOURS . " SET tour_finished='1' WHERE tour_id='" . $tid . "'");
        }
    } else {
        //just enter
        if ($match % 2 == 1) {
            $nextround = $round + 1;
            $nextmatch = ($match + 1) / 2;
            $result2 = dbquery("UPDATE " . DB_T_MATCHES . " SET match_pl1='" . $winner . "' WHERE match_round='" . $nextround . "' AND match_match='" . $nextmatch . "' AND match_tour='" . $tid . "'");
            if ($round == $rounds - 1) {
                //looser to fin34
                $x = $rounds + 1;
                $result3 = dbquery("UPDATE " . DB_T_MATCHES . " SET match_pl1='" . $looser . "' WHERE match_round='" . $x . "' AND match_match='1' AND match_tour='" . $tid . "'");
            }
        }
        if ($match % 2 == 0) {
            $nextround = $round + 1;
            $nextmatch = $match / 2;
            $result2 = dbquery("UPDATE " . DB_T_MATCHES . " SET match_pl2='" . $winner . "' WHERE match_round='" . $nextround . "' AND match_match='" . $nextmatch . "' AND match_tour='" . $tid . "'");
            if ($round == $rounds - 1) {
                //looser to fin34
                $x = $rounds + 1;
                $result2 = dbquery("UPDATE " . DB_T_MATCHES . " SET match_pl2='" . $looser . "' WHERE match_round='" . $x . "' AND match_match='1' AND match_tour='" . $tid . "'");
            }
        }
    }
}
开发者ID:SymbolixDEV,项目名称:AL-PHP-Fusion-Addons,代码行数:53,代码来源:functions_dump.php

示例8: faq_listing

function faq_listing()
{
    global $locale, $aidlink, $show_faqs;
    $total_cat_count = dbcount("(faq_cat_id)", DB_FAQ_CATS, multilang_table("FQ") ? "faq_cat_language='" . LANGUAGE . "'" : "");
    $_GET['show_faq'] = isset($_GET['show_faq']) && isnum($_GET['show_faq']) ? $_GET['show_faq'] : 0;
    $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $total_cat_count ? $_GET['rowstart'] : 0;
    $result = dbquery("SELECT fc.faq_cat_id, fc.faq_cat_name,\n\tcount(faq_id) 'faq_count'\n\tFROM " . DB_FAQ_CATS . " fc\n\tleft join " . DB_FAQS . " f using (faq_cat_id)\n\t" . (multilang_table("FQ") ? "WHERE fc.faq_cat_language='" . LANGUAGE . "'" : "") . "\n\tgroup by fc.faq_cat_id\n\tORDER BY fc.faq_cat_name\n\tlimit " . intval($_GET['rowstart']) . ", " . intval($show_faqs) . "\n\t");
    $cat_rows = dbrows($result);
    if ($cat_rows > 0) {
        echo "<div class='m-t-10'>\n";
        echo "<div class='clearfix'>\n";
        if ($total_cat_count > $cat_rows) {
            echo "<div class='pull-right'>\n";
            echo makepagenav($_GET['rowstart'], $show_faqs, $total_cat_count, 3, FUSION_SELF . $aidlink . "&amp;", "rowstart");
            echo "</div>\n";
        }
        echo sprintf($locale['faq_0115'], $cat_rows, $total_cat_count);
        echo "</div>\n";
        echo "</div>\n";
        echo "<table class='table table-responsive table-striped m-t-20'>\n<thead><tr>\n";
        echo "<th class='col-xs-4'>" . $locale['faq_0103'] . "</th>\n";
        echo "<th>" . $locale['faq_0104'] . "</th>\n";
        echo "<th>" . $locale['faq_0105'] . "</th>\n";
        echo "<th class='text-right'>" . $locale['faq_0106'] . "</th>\n";
        echo "</tr>\n";
        echo "</thead>\n<tbody>\n";
        while ($data = dbarray($result)) {
            echo "<tr>\n";
            // let us use 2 page nav. :)
            echo "<td><a href='" . FUSION_SELF . $aidlink . "&amp;show_faq=" . $data['faq_cat_id'] . "'>" . $data['faq_cat_name'] . "</a></td>\n";
            echo "<td><span class='badge'>" . $data['faq_count'] . "</span></td>\n";
            echo "<td>" . $data['faq_cat_id'] . "</td>\n";
            echo "<td class='text-right'>\n\t\t\t<a href='" . FUSION_SELF . $aidlink . "&amp;action=edit&amp;cat_id=" . $data['faq_cat_id'] . "&amp;section=faq-category'>" . $locale['faq_0107'] . "</a> -\n";
            echo "<a href='" . FUSION_SELF . $aidlink . "&amp;action=delete&amp;cat_id=" . $data['faq_cat_id'] . "&amp;section=faq-category' onclick=\"return confirm('" . $locale['faq_0109'] . "');\">" . $locale['faq_0108'] . "</a></td>\n";
            echo "</tr>\n";
            if ($_GET['show_faq'] == $data['faq_cat_id']) {
                show_faq($data['faq_cat_id'], $data['faq_count']);
            }
        }
        // simple toggle
        add_to_jquery("\n\t\t\$('.faq_toggle').bind('click', function() {\n\t\t\tvar faqs = \$(this).data('target');\n\t\t\tvar faq_length = \$('#' + faqs + ':visible').length;\n\t\t\t\$('.faq_list').hide();\n\t\t\tif (faq_length > 0) {\n\t\t\t\t\$('#'+faqs).hide();\n\t\t\t} else {\n\t\t\t\t\$('#'+faqs).show();\n\t\t\t}\n\t\t});\n\t\t");
        echo "</table>\n";
    } else {
        echo "<div class='well text-center'>" . $locale['faq_0116'] . "<br />\n</div>\n";
    }
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:46,代码来源:faq_admin.php

示例9: display_loginform

 /**
  * Display Login form
  * @param array $info
  */
 function display_loginform(array $info)
 {
     global $locale, $userdata, $aidlink;
     opentable($locale['global_100']);
     if (iMEMBER) {
         $msg_count = dbcount("(message_id)", DB_MESSAGES, "message_to='" . $userdata['user_id'] . "' AND message_read='0' AND message_folder='0'");
         opentable($userdata['user_name']);
         echo "<div style='text-align:center'><br />\n";
         echo THEME_BULLET . " <a href='" . BASEDIR . "edit_profile.php' class='side'>" . $locale['global_120'] . "</a><br />\n";
         echo THEME_BULLET . " <a href='" . BASEDIR . "messages.php' class='side'>" . $locale['global_121'] . "</a><br />\n";
         echo THEME_BULLET . " <a href='" . BASEDIR . "members.php' class='side'>" . $locale['global_122'] . "</a><br />\n";
         if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C")) {
             echo THEME_BULLET . " <a href='" . ADMIN . "index.php" . $aidlink . "' class='side'>" . $locale['global_123'] . "</a><br />\n";
         }
         echo THEME_BULLET . " <a href='" . BASEDIR . "index.php?logout=yes' class='side'>" . $locale['global_124'] . "</a>\n";
         if ($msg_count) {
             echo "<br /><br />\n";
             echo "<strong><a href='" . BASEDIR . "messages.php' class='side'>" . sprintf($locale['global_125'], $msg_count);
             echo ($msg_count == 1 ? $locale['global_126'] : $locale['global_127']) . "</a></strong>\n";
         }
         echo "<br /><br /></div>\n";
     } else {
         echo "<div id='login_form' class='panel panel-default text-center text-dark'>\n";
         if (fusion_get_settings("sitebanner")) {
             echo "<a class='display-inline-block' href='" . BASEDIR . fusion_get_settings("opening_page") . "'><img src='" . BASEDIR . fusion_get_settings("sitebanner") . "' alt='" . fusion_get_settings("sitename") . "'/></a>\n";
         } else {
             echo "<a class='display-inline-block' href='" . BASEDIR . fusion_get_settings("opening_page") . "'>" . fusion_get_settings("sitename") . "</a>\n";
         }
         echo "<div class='panel-body text-center'>\n";
         echo $info['open_form'];
         echo $info['user_name'];
         echo $info['user_pass'];
         echo $info['remember_me'];
         echo $info['login_button'];
         echo $info['registration_link'] . "<br/><br/>";
         echo $info['forgot_password_link'] . "<br/><br/>";
         echo $info['close_form'];
         echo "</div>\n";
         echo "</div>\n";
     }
     closetable();
 }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:46,代码来源:login.php

示例10: flood_control

function flood_control($field, $table, $where, $debug = FALSE)
{
    global $userdata, $settings, $locale, $defender;
    $flood = FALSE;
    if (!iSUPERADMIN && !iADMIN && (!defined("iMOD") || !iMOD) || $debug) {
        $result = dbquery("SELECT MAX(" . $field . ") AS last_post FROM " . $table . " WHERE " . $where);
        if (dbrows($result)) {
            $time = time();
            $data = dbarray($result);
            if ($time - $data['last_post'] < $settings['flood_interval']) {
                $defender->stop();
                addNotice('warning', sprintf($locale['flood'], countdown($settings['flood_interval'] - ($time - $data['last_post']))));
                $flood = TRUE;
                $result = dbquery("INSERT INTO " . DB_FLOOD_CONTROL . " (flood_ip, flood_ip_type, flood_timestamp) VALUES ('" . USER_IP . "', '" . USER_IP_TYPE . "', '" . time() . "')");
                // This should be in settings, "After how many flood offences take action" then a setting for what action to take
                if (dbcount("(flood_ip)", DB_FLOOD_CONTROL, "flood_ip='" . USER_IP . "'") > 4) {
                    if (!$debug) {
                        if (iMEMBER && $settings['flood_autoban'] == "1") {
                            require_once INCLUDES . "sendmail_include.php";
                            require_once INCLUDES . "suspend_include.php";
                            $result = dbquery("UPDATE " . DB_USERS . " SET user_status='4', user_actiontime='0' WHERE user_id='" . $userdata['user_id'] . "'");
                            suspend_log($userdata['user_id'], 4, $locale['global_440'], TRUE);
                            $message = str_replace("[USER_NAME]", $userdata['user_name'], $locale['global_442']);
                            $message = str_replace("[USER_IP]", USER_IP, $message);
                            $message = str_replace("[USER_IP]", USER_IP, $message);
                            $message = str_replace("[SITE_EMAIL]", $settings['siteemail'], $message);
                            $message = str_replace("[SITEUSERNAME]", $settings['siteusername'], $message);
                            $subject = str_replace("[SITENAME]", $settings['sitename'], $locale['global_441']);
                            sendemail($userdata['user_name'], $userdata['user_email'], $settings['siteusername'], $settings['siteemail'], $subject, $message);
                        } elseif (!iMEMBER) {
                            $result = dbquery("INSERT INTO " . DB_BLACKLIST . " (blacklist_ip, blacklist_ip_type, blacklist_email, blacklist_reason) VALUES ('" . USER_IP . "', '" . USER_IP_TYPE . "', '', '" . $locale['global_440'] . "')");
                        }
                    } else {
                        addNotice('info', "DEBUG MESSAGE: Triggered flood control action due to repeated offences. This could've resulted in a ban or suspenstion");
                    }
                }
            }
        }
    }
    return $flood;
}
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:41,代码来源:flood_include.php

示例11: pif_cache

function pif_cache($cache)
{
    global $pif_cache, $pif_global;
    switch ($cache) {
        case "total_reg_users":
            if (!array_key_exists("total_reg_users", $pif_cache) || $pif_cache['total_reg_users'] == '') {
                $in = "";
                foreach ($pif_global['visible_members'] as $value) {
                    $in .= $in != '' ? ", " : "";
                    $in .= $value;
                }
                $pif_cache['total_reg_users'] = number_format(dbcount("(user_id)", DB_USERS, "user_status IN(" . $in . ")"));
            }
            break;
        case "newest_reg_member":
            if (!array_key_exists("newest_reg_member", $pif_cache) || !is_array($pif_cache['newest_reg_member'])) {
                $pif_cache['newest_reg_member'] = array();
                list($pif_cache['newest_reg_member']['user_id'], $pif_cache['newest_reg_member']['user_name'], $pif_cache['newest_reg_member']['user_status']) = dbarraynum(dbquery("SELECT user_id, user_name, user_status FROM " . DB_USERS . " WHERE user_status='0' ORDER BY user_joined DESC LIMIT 0,1"));
            }
            break;
        case "online_users":
            if (!array_key_exists("online_users", $pif_cache) || !is_array($pif_cache['online_users'])) {
                $pif_cache['online_users'] = array();
                $result = dbquery("SELECT ton.online_user, tu.user_id, tu.user_name, tu.user_status, tu.user_level FROM " . DB_ONLINE . " ton\r\n\t\tLEFT JOIN " . DB_USERS . " tu ON ton.online_user=tu.user_id");
                $pif_cache['online_users']['guests'] = 0;
                $pif_cache['online_users']['members'] = array();
                while ($data = dbarray($result)) {
                    if ($data['online_user'] == "0") {
                        $pif_cache['online_users']['guests']++;
                    } else {
                        array_push($pif_cache['online_users']['members'], array("user_id" => $data['user_id'], "user_name" => $data['user_name'], "user_status" => $data['user_status'], "user_level" => $data['user_level']));
                    }
                }
            }
            break;
        default:
            echo "Cache Error";
    }
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:39,代码来源:pif_global_cache.php

示例12: article_admin_editlist

function article_admin_editlist($id)
{
    global $data;
    $editlist = "";
    $sel = "";
    $checkparent = dbcount("(article_cat_id)", DB_ARTICLE_CATS, "article_cat_parent='" . (int) $id . "'");
    $result2 = dbquery("SELECT article_cat_id, article_cat_name FROM " . DB_ARTICLE_CATS . " WHERE article_cat_parent='0' ORDER BY article_cat_name");
    if (dbrows($result2) != 0) {
        $editlist .= "<option value='0'" . $sel . "><span class='small'></span></option>\n";
        while ($data2 = dbarray($result2)) {
            if (isset($_GET['action']) && $_GET['action'] == "edit") {
                $sel = $data['article_cat_parent'] == $data2['article_cat_id'] ? " selected='selected'" : "";
            }
            if (isset($_GET['action']) && $_GET['action'] == "edit" && $_GET['cat_id'] != $data2['article_cat_id'] && $checkparent == 0) {
                $editlist .= "<option value='" . $data2['article_cat_id'] . "'{$sel}>" . $data2['article_cat_name'] . "</option>\n";
            } elseif (!isset($_GET['action'])) {
                $editlist .= "<option value='" . $data2['article_cat_id'] . "'{$sel}>" . $data2['article_cat_name'] . "</option>\n";
            }
        }
    }
    return $editlist;
}
开发者ID:keddyboys,项目名称:kmods,代码行数:22,代码来源:subcats_articles_include.php

示例13: flood_control

function flood_control($field, $table, $where)
{
    global $userdata, $settings;
    $flood = false;
    if (!iSUPERADMIN && !iADMIN && (!defined("iMOD") || !iMOD)) {
        $result = dbquery("SELECT MAX(" . $field . ") AS last_post FROM " . $table . " WHERE " . $where);
        if (dbrows($result)) {
            $data = dbarray($result);
            if (time() - $data['last_post'] < $settings['flood_interval']) {
                $flood = true;
                $result = dbquery("INSERT INTO " . DB_FLOOD_CONTROL . " (flood_ip, flood_timestamp) VALUES ('" . USER_IP . "', '" . time() . "')");
                if (dbcount("(flood_ip)", DB_FLOOD_CONTROL, "flood_ip='" . USER_IP . "'") > 4) {
                    if (iMEMBER) {
                        $result = dbquery("UPDATE " . DB_USERS . " SET user_status='1' WHERE user_id='" . $userdata['user_id'] . "'");
                    } else {
                        $result = dbquery("INSERT INTO " . DB_BLACKLIST . " (blacklist_ip, blacklist_email, blacklist_reason) VALUES ('" . USER_IP . "', '', 'Automatic Ban')");
                    }
                }
            }
        }
    }
    return $flood;
}
开发者ID:roniwahyu,项目名称:AKEUDA,代码行数:23,代码来源:flood_include.php

示例14: checkPasswordRequest

 public function checkPasswordRequest($email, $account)
 {
     if (!$this->_isValidEMailAddress($email)) {
         return FALSE;
     }
     if (preg_match("/^[0-9a-z]{32}\$/", $account) && dbcount("(user_id)", DB_USERS, "user_email='" . $email . "' AND user_algo='md5'") || preg_match("/^[0-9a-z]{64}\$/", $account)) {
         $result = dbquery("SELECT user_name FROM " . DB_USERS . " WHERE user_email='" . $email . "' AND user_password='" . $account . "'");
         if (dbrows($result)) {
             $data = dbarray($result);
             $this->_userName = $data['user_name'];
             $this->_newPassword = $this->getNewPassword();
             $this->_setNewHash($this->_newPassword);
             $this->_sendNewPassword();
             return TRUE;
         } else {
             $this->_error = 3;
             return FALSE;
         }
     } else {
         $this->_error = 3;
         return FALSE;
     }
 }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:23,代码来源:LostPassword.php

示例15: count_bew

function count_bew($type = "all")
{
    //global $locale;
    if ($type == "all") {
        $newbew = dbcount("(pr_id)", PR_DB_BEWERBUNG, "pr_status = '1'");
        $beabew = dbcount("(pr_id)", PR_DB_BEWERBUNG, "pr_status = '2'");
        $einbew = dbcount("(pr_id)", PR_DB_BEWERBUNG, "pr_status = '3'");
        $delbew = dbcount("(pr_id)", PR_DB_BEWERBUNG, "pr_status = '4'");
        echo THEME_BULLET . " ";
        if ($newbew == '0') {
            echo "Keine neuen Bewerbungen<br>";
        } elseif ($newbew == '1') {
            echo "<b><font color='red'>" . $newbew . " neue Bewerbung<br></font></b>";
        } else {
            echo "<b><font color='red'>" . $newbew . " neue Bewerbungen<br></font></b>";
        }
        echo "<br />" . THEME_BULLET . " ";
        if ($beabew == '1') {
            echo "" . $beabew . " Bewerbung ist in Bearbeitung<br>";
        } else {
            echo "" . $beabew . " Bewerbungen sind in Bearbeitung<br>";
        }
        echo "<br />";
        if (iSUPERADMIN) {
            echo THEME_BULLET . " ";
            if ($delbew == '1') {
                echo "" . $delbew . " Bewerbung wurde gel&ouml;scht";
            } else {
                echo "" . $delbew . " Bewerbungen wurden gel&ouml;scht";
            }
            echo "<br />";
        }
    } else {
        $count = dbcount("(pr_id)", PR_DB_BEWERBUNG, "pr_status = {$type}");
        return $count;
    }
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:37,代码来源:panel_func.inc.php


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