Пример #1
0
 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]));
     }
 }
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)");
}
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";
    }
}
Пример #4
0
 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;
 }
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";
}
Пример #6
0
    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";
Пример #7
0
 // 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='******'");
 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='******'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='******' 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='******'");
         }
     }
 }
 $forums = dbquery("SELECT * FROM " . DB_FORUMS . " WHERE forum_lastuser='******'");
 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='******'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='******'");
     }
 }
 // *** Needs fixing or placed before threads deletition
 $threads = dbquery("SELECT * FROM " . DB_THREADS . " WHERE thread_author='" . $user_id . "'");
Пример #8
0
/**
 * 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]);
}
Пример #9
0
$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";
| 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";
// 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++;
}
| 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();
    }
}
Пример #13
0
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]);
}
Пример #14
0
}
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) {
Пример #15
0
    $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;
}
Пример #16
0
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| 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("IN_FUSION")) {
    die("Access Denied");
}
include LOCALE . LOCALESET . "admin/main.php";
include INFUSIONS . "user_info_panel/user_info_panel.php";
@(list($title) = dbarraynum(dbquery("SELECT admin_title FROM " . DB_ADMIN . " WHERE admin_link='" . FUSION_SELF . "'")));
add_to_title($locale['global_200'] . $locale['global_123'] . ($title ? $locale['global_201'] . $title : ""));
$pages = array(1 => false, 2 => false, 3 => false, 4 => false, 5 => false);
$index_link = false;
$admin_nav_opts = "";
$current_page = 0;
openside($locale['global_001']);
$result = dbquery("SELECT admin_title, admin_page, admin_rights, admin_link FROM " . DB_ADMIN . " ORDER BY admin_page DESC, admin_title ASC");
$rows = dbrows($result);
while ($data = dbarray($result)) {
    if ($data['admin_link'] != "reserved" && checkrights($data['admin_rights'])) {
        $pages[$data['admin_page']] .= "<option value='" . ADMIN . $data['admin_link'] . $aidlink . "'>" . preg_replace("/&(?!(#\\d+|\\w+);)/", "&amp;", $data['admin_title']) . "</option>\n";
    }
}
$content = false;
for ($i = 1; $i < 6; $i++) {
Пример #17
0
             }
         }
         echo "</tr>\n</table>\n</form>\n";
     }
 }
 ## Forum Stats
 if ($settings['forum_profile_statistics']) {
     list($name, $posts, $age) = dbarraynum(dbquery("SELECT user_name, user_posts, user_joined FROM " . DB_USERS . " WHERE user_id=" . (int) $_GET['lookup']));
     $posts = empty($posts) ? 0 : $posts;
     list($threads) = dbarraynum(dbquery("SELECT COUNT(thread_id) FROM " . DB_THREADS . " WHERE thread_author=" . (int) $_GET['lookup']));
     $threads = empty($threads) ? 0 : $threads;
     $threadspday = round_num($threads / ((time() - $age) / (3600 * 24)));
     $postspday = round_num($posts / ((time() - $age) / (3600 * 24)));
     list($ranked_higher) = dbarraynum(dbquery("SELECT COUNT(user_id) FROM " . DB_USERS . " WHERE user_posts>" . $posts));
     $rank = $ranked_higher + 1;
     list($allposts) = dbarraynum(dbquery("SELECT SUM(forum_postcount) FROM " . DB_FORUMS));
     $percentage = empty($posts) || empty($allposts) ? 0 : $posts * 100.0 / $allposts;
     $percentage = round_num($percentage);
     closetable();
     opentable(sprintf($locale['forum_ext_title_profile'], $name));
     echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n\t<tr>\r\n\t\t\t\t\t<th class='forum-caption' width='1%' style='white-space: nowrap;' rowspan='2'><img alt='" . $locale['forum_ext_stats'] . "' src='" . IMAGES . "forum/forum_stats.png' /></th>\r\n\t\t\t\t\t<td class='tbl1'>\r\n\t\t\t\t\t\t" . number_format($threads) . " " . $locale['forum_ext_threads'] . " ::\r\n\t\t\t\t\t\t" . number_format($posts) . " " . $locale['forum_ext_posts'] . " ::\r\n\t\t\t\t\t\t" . $threadspday . " " . $locale['forum_ext_threadspday'] . " ::\r\n\t\t\t\t\t\t" . $postspday . " " . $locale['forum_ext_postspday'] . "\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class='tbl1'>\r\n\t\t\t\t\t\t" . sprintf($locale['forum_ext_ranking'], $name, number_format($rank), $percentage) . "\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>";
     foreach (array("threads", "posts") as $type) {
         $other_type = $type == "threads" ? "posts" : "threads";
         if ($type == "threads") {
             if (!isset($_GET['show']) || isset($_GET['show']) && $_GET['show'] != "posts") {
                 $visibility = "";
             } else {
                 $visibility = "style='display: none;'";
             }
         } else {
             if (isset($_GET['show']) && $_GET['show'] == "posts") {
Пример #18
0
    if ($can_post) {
        echo "<a href='post.php?action=newthread&amp;forum_id=" . $fdata['forum_id'] . "'><img src='" . get_image("newthread") . "' alt='" . $locale['566'] . "' style='border:0px' /></a>\n";
    }
    echo "</td>\n</tr>\n</table>\n";
}
closetable();
if (iMEMBER && $can_reply && !$fdata['thread_locked']) {
    require_once INCLUDES . "bbcode_include.php";
    opentable($locale['512']);
    echo "<form name='inputform' method='post' action='" . FUSION_SELF . "?thread_id=" . $_GET['thread_id'] . "'>\n";
    echo "<table cellpadding='0' cellspacing='1' class='tbl-border center'>\n<tr>\n";
    echo "<td align='center' class='tbl1'><textarea name='message' cols='70' rows='7' class='textbox' style='width:98%'></textarea><br />\n";
    echo display_bbcodes("360px", "message") . "</td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td align='center' class='tbl2'><label><input type='checkbox' name='disable_smileys' value='1' />" . $locale['513'] . "</label></td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td align='center' class='tbl1'><input type='submit' name='postquickreply' value='" . $locale['514'] . "' class='button' /></td>\n";
    echo "</tr>\n</table>\n</form><!--sub_forum_thread-->\n";
    closetable();
}
echo "<script type='text/javascript'>function jumpforum(forum_id) {\n";
echo "document.location.href='" . FORUM . "viewforum.php?forum_id='+forum_id;\n";
echo "}\n" . "function setChecked(frmName,chkName,val) {\n";
echo "dml=document.forms[frmName];\n" . "len=dml.elements.length;\n" . "for(i=0;i < len;i++) {\n";
echo "if(dml.elements[i].name == chkName) {\n" . "dml.elements[i].checked = val;\n}\n}\n}\n";
echo "</script>\n";
list($postcount, $lastpid) = dbarraynum(dbquery("SELECT COUNT(post_id), MAX(post_id) FROM " . DB_POSTS . " WHERE thread_id='" . $_GET['thread_id'] . "' GROUP BY thread_id"));
if (isnum($postcount)) {
    dbquery("UPDATE " . DB_THREADS . " SET thread_postcount='{$postcount}', thread_lastpostid={$lastpid} WHERE thread_id='" . $_GET['thread_id'] . "'");
}
require_once THEMES . "templates/footer.php";
Пример #19
0
    // Pimped: Forum-Cats and make_url (for javascript) <--
}
$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='" . make_url(FORUM . "viewforum.php?forum_id='+forumid", BASEDIR . "forum-'+forumid+'", "", ".html'") . ";\n}\n";
// Pimped: make_url (for javascript)
echo "</script>\n";
$mysql_subcats = '';
// Pimped
if (is_array($cache_subcats) && count($cache_subcats)) {
    foreach ($cache_subcats as $subcat) {
        $mysql_subcats .= " OR forum_id='" . (int) $subcat . "'";
    }
}
list($threadcount, $postcount) = dbarraynum(dbquery("SELECT COUNT(thread_id), SUM(thread_postcount)\r\nFROM " . DB_THREADS . " WHERE thread_hidden='0' AND forum_id='" . (int) $_GET['forum_id'] . "'" . $mysql_subcats));
// Pimped
if (isnum($threadcount) && isnum($postcount)) {
    dbquery("UPDATE " . DB_FORUMS . " SET forum_postcount='" . $postcount . "', forum_threadcount='" . $threadcount . "' WHERE forum_id='" . (int) $_GET['forum_id'] . "'");
    // Pimped
}
require_once TEMPLATES . "footer.php";
Пример #20
0
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) {
    die("Access Denied");
}
openside($locale['global_020']);
echo "<div class='side-label'><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') . " ORDER 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='" . FORUM . "viewthread.php?thread_id=" . $data['thread_id'] . "' title='" . $data['thread_subject'] . "' class='side'>{$itemsubject}</a><br />\n";
    }
} else {
    echo "<div style='text-align:center'>" . $locale['global_023'] . "</div>\n";
}
echo "<div class='side-label'><strong>" . $locale['global_022'] . "</strong></div>\n";
list($min_posts) = dbarraynum(dbquery("SELECT thread_postcount FROM " . DB_THREADS . " ORDER BY thread_postcount DESC LIMIT 4,5"));
$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}'\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 "<tr>\n<td class='side-small'>" . THEME_BULLET . " <a href='" . FORUM . "viewthread.php?thread_id=" . $data['thread_id'] . "' title='" . $data['thread_subject'] . "' class='side'>{$itemsubject}</a></td>\n";
        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";
}
closeside();
Пример #21
0
+--------------------------------------------------------*/
require_once "../../maincore.php";
require_once THEMES . "templates/header.php";
if (isset($current) && !isNum($current)) {
    fallback("index.php");
}
include INFUSIONS . "varcade/functions.php";
opentable($locale['TOUR008']);
makeheader();
echo "<div id='lajv'>";
$gname = dbquery("SELECT DISTINCT game_id FROM " . $db_prefix . "varcade_tournament_scores ORDER BY game_id ASC");
echo '<form action="' . FUSION_SELF . '" method="post">
<span class="small"><b>' . $locale['TOUR011'] . ' </b></span>
<select class="textbox" name="gameid" size=1 onchange="submit()">
<option> ' . $locale['TOUR012'] . ' ';
while (list($name) = dbarraynum($gname)) {
    $row = dbarray(dbquery("SELECT * FROM " . $db_prefix . "varcade_games WHERE lid='{$name}'"));
    echo '<option value="' . $row['lid'] . '">' . $row['title'];
}
echo '</select>
</form>';
if (isset($gameid)) {
    $where = "WHERE game_id = '{$gameid}'";
} else {
    $where = "WHERE game_id = '{$current}'";
}
$hiscorex = dbquery("SELECT DISTINCT game_id, player_id, game_score, score_date FROM " . $db_prefix . "varcade_tournament_scores " . $where . " ORDER BY game_score DESC LIMIT 0,25");
echo '<br><table width="98%" cellpadding="0" cellspacing="1" class="tbl-border">
<tr align="center">
<td width="10%"  class="tbl2"><span class="small"><b>' . $locale['VARC182'] . '</b></span></td>
<td width="22%"  class="tbl2"><span class="small"><b>' . $locale['VARC170'] . '</b></span></td>