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


PHP dbarraynum函数代码示例

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


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

示例1: __construct

 public function __construct()
 {
     global $locale, $admin_pages, $aidlink;
     @(list($title) = dbarraynum(dbquery("SELECT admin_title FROM " . DB_ADMIN . " WHERE admin_link='" . FUSION_SELF . "'")));
     set_title($locale['global_123'] . $locale['global_201'] . ($title ? $title . $locale['global_200'] : ""));
     $this->admin_pages = $admin_pages;
     // generate core sections
     $this->admin_sections = array(0 => $locale['ac00'], 1 => $locale['ac01'], 2 => $locale['ac02'], 3 => $locale['ac03'], 4 => $locale['ac04'], 5 => $locale['ac05']);
     $this->current_page = self::_currentPage();
     // Dashboard breadcrumb
     add_breadcrumb(array('link' => ADMIN . 'index.php' . $aidlink . '&pagenum=0', 'title' => $locale['ac10']));
     $activetab = isset($_GET['pagenum']) && isnum($_GET['pagenum']) ? $_GET['pagenum'] : $this->_isActive();
     if ($activetab != 0 && $activetab <= 5) {
         add_breadcrumb(array('link' => ADMIN . $aidlink . "&amp;pagenum=" . $activetab, 'title' => $locale['ac0' . $activetab]));
     }
 }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:16,代码来源:admin.php

示例2: whoishere_observer

function whoishere_observer($forum_place)
{
    global $userdata;
    $user_id = iMEMBER ? $userdata['user_id'] : USER_IP;
    $forum_id = "";
    $thread_id = "";
    if ($forum_place == "index") {
        $forum_id = 0;
        $thread_id = 0;
    } elseif ($forum_place == "forum" && isset($_GET['forum_id']) && isnum($_GET['forum_id'])) {
        $forum_id = $_GET['forum_id'];
        $thread_id = 0;
    } elseif ($forum_place == "thread" && isset($_GET['thread_id']) && isnum($_GET['thread_id'])) {
        list($forum_id) = dbarraynum(dbquery("SELECT forum_id FROM " . DB_THREADS . " WHERE thread_id='" . (int) $_GET['thread_id'] . "'"));
        $thread_id = $_GET['thread_id'];
    }
    if (isnum($forum_id) && isnum($thread_id)) {
        dbquery("REPLACE INTO " . DB_FORUM_OBSERVER . " SET user_id='" . $user_id . "', forum_id='" . $forum_id . "', thread_id='" . $thread_id . "', age='" . time() . "'");
    }
    dbquery("DELETE FROM " . DB_FORUM_OBSERVER . " WHERE age < (" . time() . "-5*60)");
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:21,代码来源:forum_observer.php

示例3: 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

示例4: get_thread_stats

 static function get_thread_stats($thread_id)
 {
     list($array['post_count'], $array['last_post_id'], $array['first_post_id']) = dbarraynum(dbquery("SELECT COUNT(post_id), MAX(post_id), MIN(post_id) FROM " . DB_FORUM_POSTS . " WHERE thread_id='" . intval($thread_id) . "' AND post_hidden='0' GROUP BY thread_id"));
     if (!$array['post_count']) {
         redirect(INFUSIONS . 'forum/index.php');
     }
     // exit no.2
     $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $array['last_post_id'] ? $_GET['rowstart'] : 0;
     // secure against XSS
     return $array;
 }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:11,代码来源:Viewthread.php

示例5: dbquery

echo "<div class='side-label'>" . $locale['global_021'] . "</div>\n";
#echo "<div><strong>".$locale['global_021']."</strong></div>\n";
$result = dbquery("\r\n\tSELECT tt.forum_id, tt.thread_id, tt.thread_subject, tt.thread_lastpost FROM " . DB_THREADS . " tt\r\n\tINNER JOIN " . DB_FORUMS . " tf ON tt.forum_id=tf.forum_id\r\n\tWHERE " . groupaccess('forum_access') . " AND tt.thread_hidden='0' \r\n\tORDER BY thread_lastpost DESC LIMIT 5\r\n");
if (dbrows($result)) {
    while ($data = dbarray($result)) {
        $itemsubject = trimlink($data['thread_subject'], 23);
        echo THEME_BULLET . " <a href='" . make_url(FORUM . "viewthread.php?thread_id=" . $data['thread_id'], BASEDIR . "forum-thread-" . $data['thread_id'] . "-", $data['thread_subject'], ".html") . "' title='" . $data['thread_subject'] . "' class='side'>{$itemsubject}</a><br />\n";
        // Pimped: make_url
    }
} else {
    echo "<div style='text-align:center'>" . $locale['global_023'] . "</div>\n";
}
echo "<div class='side-label'>" . $locale['global_022'] . "</div>\n";
#echo "<div><strong>".$locale['global_022']."</strong></div>\n";
$timeframe = $settings['popular_threads_timeframe'] != 0 ? "thread_lastpost >= " . (time() - $settings['popular_threads_timeframe']) : "";
list($min_posts) = dbarraynum(dbquery("SELECT thread_postcount FROM " . DB_THREADS . ($timeframe ? " WHERE " . $timeframe : "") . " ORDER BY thread_postcount DESC LIMIT 4,1"));
$timeframe = $timeframe ? " AND tt." . $timeframe : "";
$result = dbquery("\r\n\tSELECT tf.forum_id, tt.thread_id, tt.thread_subject, tt.thread_postcount\r\n\tFROM " . DB_FORUMS . " tf\r\n\tINNER JOIN " . DB_THREADS . " tt USING(forum_id)\r\n\tWHERE " . groupaccess('forum_access') . " AND tt.thread_postcount >= '" . $min_posts . "'" . $timeframe . " AND tt.thread_hidden='0'\r\n\tORDER BY thread_postcount DESC, thread_lastpost DESC LIMIT 5\r\n");
if (dbrows($result) != 0) {
    echo "<table cellpadding='0' cellspacing='0' width='100%'>\n";
    while ($data = dbarray($result)) {
        $itemsubject = trimlink($data['thread_subject'], 20);
        #echo THEME_BULLET." <a href='".FORUM."viewthread.php?thread_id=".$data['thread_id']."' title='".$data['thread_subject']."' class='side'>$itemsubject</a><div align=right>[".($data['thread_postcount'] - 1)."]</div><br />\n";
        echo "<tr>\n<td class='side-small'>" . THEME_BULLET . " <a href='" . make_url(FORUM . "viewthread.php?thread_id=" . $data['thread_id'], BASEDIR . "forum-thread-" . $data['thread_id'] . "-", $data['thread_subject'], ".html") . "' title='" . $data['thread_subject'] . "' class='side'>{$itemsubject}</a></td>\n";
        // Pimped: make_url
        echo "<td align='right' class='side-small'>[" . ($data['thread_postcount'] - 1) . "]</td>\n</tr>\n";
    }
    echo "</table>\n";
} else {
    echo "<div style='text-align:center'>" . $locale['global_023'] . "</div>\n";
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:forum_threads_panel.php

示例6: closetable

    echo "<div style='text-align:center'>" . $locale['435'] . " [<a href=\"javascript:void(0)\" onclick=\"javascript:populateSelectAll()\">" . $locale['436'] . "</a>]\n";
    echo "[<a href=\"javascript:void(0)\" onclick=\"javascript:populateSelectNone()\">" . $locale['437'] . "</a>]</div></td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td align='center' colspan='2' class='tbl'><hr />" . $locale['460'] . " <span style='color:#ff0000'>*</span>\n";
    echo "<input type='password' name='user_admin_password' value='' class='textbox' style='width:150px;' autocomplete='off' /></td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td align='center' colspan='2' class='tbl'>\n";
    echo "<input type='hidden' name='file' value='{$file}' />\n";
    echo "<input class='button' type='submit' name='btn_do_restore' style='width:100px;' value='" . $locale['438'] . "' />\n";
    echo "<input class='button' type='submit' name='btn_cancel' style='width:100px;' value='" . $locale['439'] . "' /></td>\n";
    echo "</tr>\n</table>\n</form>\n";
    closetable();
} else {
    $table_opt_list = "";
    $result = dbquery("SHOW tables");
    while ($row = dbarraynum($result)) {
        $table_opt_list .= "<option value='" . $row[0] . "'";
        if (preg_match("/^" . DB_PREFIX . "/i", $row[0])) {
            $table_opt_list .= " selected='selected'";
        }
        $table_opt_list .= ">" . $row[0] . "</option>\n";
    }
    opentable($locale['450']);
    echo "<script type='text/javascript'>\n<!--\n";
    echo "function backupSelectCore(){for(i=0;i<document.backupform.elements['db_tables[]'].length;i++){document.backupform.elements['db_tables[]'].options[i].selected=(document.backupform.elements['db_tables[]'].options[i].text).match(/^{$db_prefix}/);}}\n";
    echo "function backupSelectAll(){for(i=0;i<document.backupform.elements['db_tables[]'].length;i++){document.backupform.elements['db_tables[]'].options[i].selected=true;}}\n";
    echo "function backupSelectNone(){for(i=0;i<document.backupform.elements['db_tables[]'].length;i++){document.backupform.elements['db_tables[]'].options[i].selected=false;}}\n";
    echo "//-->\n</script>\n";
    echo "<form action='" . FUSION_SELF . $aidlink . "' name='backupform' method='post'>\n";
    echo "<table align='center' cellspacing='0' cellpadding='0'>\n<tr>\n";
    echo "<td valign='top'>\n";
开发者ID:necrophcodr,项目名称:Muks,代码行数:31,代码来源:db_backup.php

示例7: dbquery

 // New in 7.02.07
 $result = dbquery("DELETE FROM " . DB_FORUM_POLL_VOTERS . " WHERE forum_vote_user_id='" . $user_id . "'");
 // Delete votes on forum threads
 $result = dbquery("DELETE FROM " . DB_MESSAGES_OPTIONS . " WHERE user_id='" . $user_id . "'");
 // Delete messages options
 $threads = dbquery("SELECT * FROM " . DB_THREADS . " WHERE thread_lastuser='" . $user_id . "'");
 if (dbrows($threads)) {
     while ($thread = dbarray($threads)) {
         // Update thread last post author, date and id
         $last_thread_post = dbarray(dbquery("SELECT post_id, post_author, post_datestamp FROM " . DB_POSTS . " WHERE thread_id='" . $thread['thread_id'] . "' ORDER BY post_id DESC LIMIT 0,1"));
         dbquery("UPDATE " . DB_THREADS . " SET\tthread_lastpost='" . $last_thread_post['post_datestamp'] . "',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthread_lastpostid='" . $last_thread_post['post_id'] . "',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthread_lastuser='" . $last_thread_post['post_author'] . "'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE thread_id='" . $thread['thread_id'] . "'");
         // Update thread posts count
         $posts_count = dbcount("(post_id)", DB_POSTS, "thread_id='" . $thread['thread_id'] . "'");
         dbquery("UPDATE " . DB_THREADS . " SET thread_postcount='" . $posts_count . "' WHERE thread_id='" . $thread['thread_id'] . "'");
         // Update forum threads count and posts count
         list($threadcount, $postcount) = dbarraynum(dbquery("SELECT COUNT(thread_id), SUM(thread_postcount) FROM " . DB_THREADS . " WHERE forum_id='" . $thread['forum_id'] . "' AND thread_lastuser='" . $user_id . "' AND thread_hidden='0'"));
         if (isnum($threadcount) && isnum($postcount)) {
             dbquery("UPDATE " . DB_FORUMS . " SET forum_postcount='" . $postcount . "', forum_threadcount='" . $threadcount . "' WHERE forum_id='" . $thread['forum_id'] . "' AND forum_lastuser='" . $user_id . "'");
         }
     }
 }
 $forums = dbquery("SELECT * FROM " . DB_FORUMS . " WHERE forum_lastuser='" . $user_id . "'");
 if (dbrows($forums)) {
     while ($forum = dbarray($forums)) {
         // Update forum last post
         $last_forum_post = dbarray(dbquery("SELECT post_id, post_author, post_datestamp FROM " . DB_POSTS . " WHERE forum_id='" . $forum['forum_id'] . "' ORDER BY post_id DESC LIMIT 0,1"));
         dbquery("UPDATE " . DB_FORUMS . " SET\tforum_lastpost='" . $last_forum_post['post_datestamp'] . "',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tforum_lastuser='" . $last_forum_post['post_author'] . "'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE forum_id='" . $forum['forum_id'] . "'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND forum_lastuser='" . $user_id . "'");
     }
 }
 // *** Needs fixing or placed before threads deletition
 $threads = dbquery("SELECT * FROM " . DB_THREADS . " WHERE thread_author='" . $user_id . "'");
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:members.php

示例8: multilang_table

/**
 * check multilang tables
 * @staticvar boolean[] $tables
 * @param string $table Table name
 * @return boolean
 */
function multilang_table($table)
{
    static $tables = NULL;
    if ($tables === NULL) {
        $tables = array();
        $result = dbquery("SELECT mlt_rights FROM " . DB_LANGUAGE_TABLES . " WHERE mlt_status='1'");
        while ($row = dbarraynum($result)) {
            $tables[$row[0]] = TRUE;
        }
    }
    return isset($tables[$table]);
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:18,代码来源:sqlhandler.inc.php

示例9: dbquery

$result = dbquery("SELECT f.forum_id, f.forum_name, f2.forum_name AS forum_cat_name\r\n\tFROM " . DB_FORUMS . " f\r\n\tINNER JOIN " . DB_FORUMS . " f2 ON f.forum_cat=f2.forum_id\r\n\tWHERE " . groupaccess('f.forum_access') . " AND f.forum_cat!='0' ORDER BY f2.forum_order ASC, f.forum_order ASC");
while ($data2 = dbarray($result)) {
    if ($data2['forum_cat_name'] != $current_cat) {
        if ($current_cat != "") {
            $forum_list .= "</optgroup>\n";
        }
        $current_cat = $data2['forum_cat_name'];
        $forum_list .= "<optgroup label='" . $data2['forum_cat_name'] . "'>\n";
    }
    $sel = $data2['forum_id'] == $fdata['forum_id'] ? " selected='selected'" : "";
    $forum_list .= "<option value='" . $data2['forum_id'] . "'{$sel}>" . $data2['forum_name'] . "</option>\n";
}
$forum_list .= "</optgroup>\n";
echo "<div style='padding-top:5px'>\n" . $locale['540'] . "<br />\n";
echo "<select name='jump_id' class='textbox' onchange=\"jumpforum(this.options[this.selectedIndex].value);\">";
echo $forum_list . "</select>\n</div>\n";
echo "<div><hr />\n";
echo "<img src='" . get_image("foldernew") . "' alt='" . $locale['560'] . "' style='vertical-align:middle;' /> - " . $locale['470'] . "<br />\n";
echo "<img src='" . get_image("folder") . "' alt='" . $locale['561'] . "' style='vertical-align:middle;' /> - " . $locale['472'] . "<br />\n";
echo "<img src='" . get_image("folderlock") . "' alt='" . $locale['564'] . "' style='vertical-align:middle;' /> - " . $locale['473'] . "<br />\n";
echo "<img src='" . get_image("stickythread") . "' alt='" . $locale['563'] . "' style='vertical-align:middle;' /> - " . $locale['474'] . "\n";
echo "</div><!--sub_forum-->\n";
closetable();
echo "<script type='text/javascript'>\n" . "function jumpforum(forumid) {\n";
echo "document.location.href='" . FORUM . "viewforum.php?forum_id='+forumid;\n}\n";
echo "</script>\n";
list($threadcount, $postcount) = dbarraynum(dbquery("SELECT COUNT(thread_id), SUM(thread_postcount) FROM " . DB_THREADS . " WHERE forum_id='" . $_GET['forum_id'] . "'"));
if (isnum($threadcount) && isnum($postcount)) {
    dbquery("UPDATE " . DB_FORUMS . " SET forum_postcount='{$postcount}', forum_threadcount='{$threadcount}' WHERE forum_id='" . $_GET['forum_id'] . "'");
}
require_once THEMES . "templates/footer.php";
开发者ID:roniwahyu,项目名称:AKEUDA,代码行数:31,代码来源:viewforum.php

示例10: author

| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) {
    die("Access Denied");
}
if ($profile_method == "input") {
    //Nothing
} elseif ($profile_method == "display") {
    include_once INFUSIONS . "user_gold/infusion_db.php";
    include_once INFUSIONS . "user_gold/functions.php";
    $user_id = isnum($_GET['lookup']) ? $_GET['lookup'] : 0;
    if ($user_id) {
        list($name) = dbarraynum(dbquery("SELECT user_name FROM " . DB_USERS . " WHERE user_id=" . $user_id));
        list($cash, $bank, $karma, $chips) = dbarraynum(dbquery("SELECT cash, bank, karma, chips FROM " . DB_UG3 . " WHERE owner_id=" . $user_id));
        echo "</table>";
        echo "<div style='margin:5px'></div>\n";
        echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n";
        echo "<td class='tbl2' colspan='2'><strong>" . $locale['uf_user_ug3-information'] . "</strong></td>\n";
        echo "</tr>\n<tr>\n";
        echo "<td class='tbl1' colspan='2'>";
        echo "<table width='100%'>\n<tr>\n";
        echo "<td class='tbl1' width='50%'><img src='" . GOLD_IMAGE . "cash.png' title='" . UGLD_GOLDTEXT . "' alt='" . UGLD_GOLDTEXT . "' />&nbsp;" . formatMoney($cash) . "</td>";
        echo "<td class='tbl1' width='50%'><img src='" . GOLD_IMAGE . "bank.png' title='" . UGLD_GOLDTEXT . $locale['uf_user_ug3-information_001'] . "' alt='" . UGLD_GOLDTEXT . $locale['uf_user_ug3-information_001'] . "' />&nbsp;" . formatMoney($bank) . "</td>";
        echo "</tr><tr>";
        echo "<td class='tbl1' width='50%'><img src='" . GOLD_IMAGE . "karma.png' title='" . $locale['uf_user_ug3-information_003'] . "' alt='" . $locale['uf_user_ug3-information_003'] . "' />&nbsp;" . formatMoney($karma) . "</td>";
        echo "<td class='tbl1' width='50%'><img src='" . GOLD_IMAGE . "chips.png' title='" . $locale['uf_user_ug3-information_002'] . "' alt='" . $locale['uf_user_ug3-information_002'] . "' />&nbsp;" . formatMoney($chips) . "</td>";
        echo "</tr><tr>";
        echo "<td class='tbl1' colspan='2' width='100%'><hr /><div style='text-align: center;'>" . $locale['uf_user_ug3-information_004'] . "<br />" . showribbons($user_id, false) . "</div></td>";
        echo "</tr>\n</table>\n";
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:user_ug3-information_include.php

示例11: list

// Forum Stats
if ($settings['forum_statistics_forumstats']) {
    list($posts) = dbarraynum(dbquery("SELECT SUM(forum_postcount) FROM " . DB_FORUMS));
    $posts = empty($posts) ? 0 : $posts;
    list($threads) = dbarraynum(dbquery("SELECT SUM(forum_threadcount) FROM " . DB_FORUMS));
    $threads = empty($threads) ? 0 : $threads;
    list($age) = dbarraynum(dbquery("SELECT user_joined from " . DB_USERS . " WHERE user_id=1"));
    $age = empty($age) ? 0 : $age;
    $threadspday = round_num($threads / ((time() - $age) / (3600 * 24)));
    $postspday = round_num($posts / ((time() - $age) / (3600 * 24)));
    $rowspan++;
}
// Top Posters
if ($settings['forum_statistics_topposters']) {
    list($tposter_id, $tposter_name, $tposter_status, $tposter_posts) = dbarraynum(dbquery("SELECT user_id, user_name, user_status, user_posts FROM " . DB_USERS . " ORDER BY user_posts DESC LIMIT 1"));
    list($aposter_id, $aposter_name, $aposter_status, $aposter_ppday) = dbarraynum(dbquery("SELECT user_id, user_name, user_status, (user_posts/((" . time() . "-user_joined)/(24*3600))) FROM " . DB_USERS . " WHERE user_joined < (" . time() . "-(3600*24)) ORDER BY user_posts DESC LIMIT 1"));
    $rowspan++;
}
// User Stats
if ($settings['forum_statistics_userstats']) {
    pif_cache("online_users");
    $total_online = $pif_cache['online_users']['guests'] + count($pif_cache['online_users']['members']);
    list($max_online, $max_online_time) = explode(":", $stats['max_online_users']);
    if ($total_online > $max_online) {
        $stats['max_online_users'] = $total_online . ":" . time();
        update_stats();
        $max_online = $total_online;
        $max_online_time = time();
    }
    $rowspan++;
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:forum_statistics.php

示例12: author

| http://www.pimped-fusion.net
+----------------------------------------------------------------------------+
| Filename: forum/includes/forum_statistics.php
| Version: Pimped Fusion v0.09.00
+----------------------------------------------------------------------------+
| This program is released as free software under the Affero GPL license.
| You can redistribute it and/or modify it under the terms of this license
| which you can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this copyright header is
| strictly prohibited without written permission from the original author(s).
+---------------------------------------------------------------------------*/
if (!defined("PIMPED_FUSION")) {
    die("Access Denied");
}
$thread_id = isnum($_GET['thread_id']) ? $_GET['thread_id'] : 0;
if ($thread_id) {
    list($thread_subject) = dbarraynum(dbquery("SELECT thread_subject from " . DB_THREADS . " WHERE thread_id=" . (int) $thread_id . ""));
    $rel_thread_res = dbquery("\r\n\t\tSELECT tt.thread_id, tt.thread_subject, tf.forum_id, tf.forum_name, tf.forum_access, tt.thread_postcount, tt.thread_lastpost\r\n\t\tFROM " . DB_THREADS . " tt\r\n\t\tINNER JOIN " . DB_FORUMS . " tf ON tt.forum_id=tf.forum_id\r\n\t\tWHERE MATCH (thread_subject) AGAINST ('" . $thread_subject . "' IN BOOLEAN MODE) AND thread_id != " . (int) $thread_id . "\r\n\t\tAND " . groupaccess('tf.forum_access') . "\r\n\t\tORDER BY tt.thread_lastpost DESC LIMIT 5");
    if (dbrows($rel_thread_res)) {
        opentable($locale['similar_100']);
        echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th class='forum-caption'>" . $locale['global_044'] . "</th>\r\n\t\t\t\t\t<th class='forum-caption'>" . $locale['global_048'] . "</th>\r\n\t\t\t\t\t<th class='forum-caption'>" . $locale['global_046'] . "</th>\r\n\t\t\t\t\t<th class='forum-caption'>" . $locale['global_047'] . "</th>\r\n\t\t\t\t</tr>\n";
        $i = 0;
        while ($thread = dbarray($rel_thread_res)) {
            $i++;
            $row = $i % 2 ? " class='tbl1'" : " class='tbl2'";
            echo "\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td" . $row . "><a href='" . make_url(FORUM . "viewthread.php?thread_id=" . $thread['thread_id'], BASEDIR . "forum-thread-" . $thread['thread_id'] . "-", $thread['thread_subject'], ".html") . "'>" . $thread['thread_subject'] . "</a></td>\r\n\t\t\t\t\t<td" . $row . ">" . $thread['forum_name'] . "</td>\r\n\t\t\t\t\t<td" . $row . ">" . $thread['thread_postcount'] . "</td>\r\n\t\t\t\t\t<td" . $row . ">" . showdate("forumdate", $thread['thread_lastpost']) . "</td>\r\n\t\t\t\t</tr>";
        }
        echo "</table>";
        closetable();
    }
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:forum_similar_threads.php

示例13: db_exists

function db_exists($table, $updateCache = FALSE)
{
    static $tables = NULL;
    $length = strlen(DB_PREFIX);
    if (substr($table, 0, $length) === DB_PREFIX) {
        $table = substr($table, $length);
    }
    $sql = "SELECT substring(table_name, " . ($length + 1) . ") " . " FROM information_schema.tables WHERE table_schema = database() " . " AND table_name LIKE :table_pattern";
    if ($tables === NULL) {
        $result = dbquery($sql, array(':table_pattern' => str_replace('_', '\\_', DB_PREFIX) . '%'));
        while ($row = dbarraynum($result)) {
            $tables[$row[0]] = TRUE;
        }
    } elseif ($updateCache) {
        $tables[$table] = dbresult(dbquery('SELECT exists(' . $sql . ')', array(':table_pattern' => DB_PREFIX . $table)), 0);
    }
    return !empty($tables[$table]);
}
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:18,代码来源:sqlhandler.inc.php

示例14: dbcount

}
if (isset($_GET['pid']) && isnum($_GET['pid'])) {
    $reply_count = dbcount("(post_id)", DB_POSTS, "thread_id='" . $fdata['thread_id'] . "' AND post_id<='" . $_GET['pid'] . "' AND post_hidden='0'");
    if ($reply_count > $posts_per_page) {
        $_GET['rowstart'] = (ceil($reply_count / $posts_per_page) - 1) * $posts_per_page;
    }
}
if ($fdata['forum_parent'] != 0) {
    // Pimped: Sub-Cats & make_url -->
    $sub_data = dbarray(dbquery("SELECT forum_id, forum_name FROM " . DB_FORUMS . " WHERE forum_id='" . $fdata['forum_parent'] . "'"));
    $caption = $fdata['forum_cat_name'] . " &raquo; <a href='" . make_url(FORUM . "viewforum.php?forum_id=" . $sub_data['forum_id'], BASEDIR . "forum-" . $sub_data['forum_id'] . "-", $sub_data['forum_name'], ".html") . "'>" . $sub_data['forum_name'] . "</a> &raquo; <a href='" . make_url(FORUM . "viewforum.php?forum_id=" . $fdata['forum_id'], BASEDIR . "forum-" . $fdata['forum_id'] . "-", $fdata['forum_name'], ".html") . "'>" . $fdata['forum_name'] . "</a>";
} else {
    $caption = $fdata['forum_cat_name'] . " &raquo; <a href='" . make_url(FORUM . "viewforum.php?forum_id=" . $fdata['forum_id'], BASEDIR . "forum-" . $fdata['forum_id'] . "-", $fdata['forum_name'], ".html") . "'>" . $fdata['forum_name'] . "</a>";
}
// Pimped: Sub-Cats & make_url <--
list($rows, $last_post) = dbarraynum(dbquery("SELECT COUNT(post_id), MAX(post_id) \r\nFROM " . DB_POSTS . " WHERE thread_id='" . (int) $_GET['thread_id'] . "' AND post_hidden='0' GROUP BY thread_id"));
// Next / Prev Thread
$prev = "";
$next = "";
if ($settings['threads_show_next_prev']) {
    $ex_prev = dbcount("(thread_id)", DB_THREADS, "forum_id='" . (int) $fdata['forum_id'] . "' AND thread_lastpost < '" . (int) $fdata['thread_lastpost'] . "' ORDER BY thread_lastpost DESC LIMIT 1");
    $prev_thread['thread_id'] = 0;
    if ($ex_prev > 0) {
        $prev_thread = dbarray(dbquery("SELECT thread_id, thread_subject\r\n\t\tFROM " . DB_THREADS . "\r\n\t\tWHERE forum_id='" . (int) $fdata['forum_id'] . "' AND thread_lastpost<'" . (int) $fdata['thread_lastpost'] . "' ORDER BY thread_lastpost DESC LIMIT 1"));
    }
    $ex_next = dbcount("(thread_id)", DB_THREADS, "forum_id='" . (int) $fdata['forum_id'] . "' AND thread_lastpost > '" . (int) $fdata['thread_lastpost'] . "' ORDER BY thread_lastpost ASC LIMIT 1");
    $next_thread['thread_id'] = 0;
    if ($ex_next > 0) {
        $next_thread = dbarray(dbquery("SELECT thread_id, thread_subject\r\n\t\tFROM " . DB_THREADS . "\r\n\t\tWHERE forum_id='" . (int) $fdata['forum_id'] . "' AND thread_lastpost>'" . (int) $fdata['thread_lastpost'] . "' ORDER BY thread_lastpost ASC LIMIT 1"));
    }
    if ($next_thread['thread_id'] > 0) {
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:viewthread.php

示例15: dbquery

    $group = "SuperAdmin";
}
if ($check == "0") {
    $group = "Public";
}
if ($check == "") {
    $check = "0";
}
echo "\n<td align='right'>" . $locale['422'] . "</td>\n<td><select name='visibility_opts' class='textbox'>\n<option selected value='" . $check . "'>{$group}\n{$visibility_opts}</select></td>\n<tr>\n<td align='right' valign='top'>" . $locale['MKROAX102'] . "</td>\n<td><textarea name='embed_code' cols='25' rows='5' class='textbox'>{$embed_code}</textarea>\n</td></tr>\n</table></td>\n<td width='40%' align='right' valign='top'>\n<table align='center' cellspacing='0' cellpadding='0' class='tbl'>\n<tr>\n<td align='right' valign='top'>" . $locale['KROAX112'] . "</td>\n<td><textarea name='description' cols='45' rows='10' class='textbox'>{$description}</textarea>\n</td></tr>\n<tr>\n<td align='right'>" . $locale['KROAX205'] . " </td>\n<td><input type='text' name='tumb' value='{$tumb}' class='textbox' style='width:200px;'></td>\n</tr>\n<input type='hidden' name='approval' value='{$approval}' readonly>";
echo "</table>";
$resultcat = dbquery("select title,cid from " . $db_prefix . "kroax_kategori WHERE cid='{$cat}'");
$datacat = dbarray($resultcat);
echo "<tr><td align='center' colspan='2'>" . $locale['KROAX210'] . " :";
echo '<select class="textbox" name="cat"> <option value="' . $datacat['cid'] . '">' . $datacat['title'] . '</option>';
$result = dbquery("select cid, title, parentid from " . $db_prefix . "kroax_kategori order by parentid,title");
while (list($cid, $title, $parentid) = dbarraynum($result)) {
    if ($parentid != 0) {
        $title = getparent($parentid, $title);
    }
    echo '<option value="' . $cid . '">' . $title . '</option>';
}
echo '</select></td></tr>';
echo "<td align='center' colspan='2'>\n\n\n<input type='submit' name='save_cat' value='" . $locale['KROAX106'] . "' class='button'></td><td align='right'>\n</tr>\n</div>\n</table>\n</form>\n";
tablebreak();
echo "<div id='lajv'>";
$orderby = $sortby == "all" ? "" : " WHERE kroax_titel LIKE '{$sortby}%'";
$result = dbquery("SELECT * FROM " . $db_prefix . "kroax" . $orderby . "");
$rows = dbrows($result);
if (!isset($rowstart) || !isNum($rowstart)) {
    $rowstart = 0;
}
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:kroax_admin.php


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