Exemplo n.º 1
0
function makeheader()
{
    global $data, $varcsettings, $db_prefix, $locale, $size, $gamefile;
    echo "<fieldset><legend>" . $locale['VARC206'] . "</legend>";
    echo "<table align='center' valign='middle' width='95%' cellspacing='0' cellpadding='0'>\n<td align='left'><b> [ <a href='" . INFUSIONS . "varcade/index.php'>" . $locale['VARC100'] . "</a>  ]</b>";
    if ($varcsettings['popup'] == "1") {
        echo "<b> [ <a href='#' onclick=window.open('" . INFUSIONS . "varcade/random.php?p=1','VArcpopup','scrollbars=yes,resizable=yes,width=800,height=700')>" . $locale['VARC101'] . "</a> ] </b>";
    } else {
        echo "<b> [ <a href='" . INFUSIONS . "varcade/random.php'>" . $locale['VARC101'] . "</a> ] </b>";
    }
    if (iMEMBER) {
        if ($varcsettings['favorites'] == "1") {
            echo "<b> [ <a href='" . INFUSIONS . "varcade/favorit_games.php'>" . $locale['VARC102'] . "</a> ] </b>";
        }
    }
    echo " <input type='text' id='query' class='textbox' style=' height: 17px; width: 100px; border: 1px solid #000; background-color: #636363; color: #000; font-size: 12px;' value='" . $locale['VARC103'] . "' onBlur=\"if(this.value=='') this.value='" . $locale['VARC103'] . "';\" onFocus=\"if(this.value=='" . $locale['VARC103'] . "') this.value='';\" onKeyDown=\"if(event.keyCode==13) Search();\">";
    echo "</td>";
    $result1 = dbquery("SELECT * FROM " . $db_prefix . "varcade_cats WHERE " . groupaccess('access') . " ORDER BY title ASC");
    echo "<td align='right'>";
    echo "<form method='post' action='" . INFUSIONS . "varcade/index.php'>";
    echo "<select name='category' class='textbox' onChange=\"this.form.submit()\">";
    echo '<option value="">' . $locale['VARC104'] . '</option>';
    while ($data1 = dbarray($result1)) {
        echo "<option value='" . $data1['cid'] . "'>" . $data1['title'] . "</option>";
    }
    echo "</select></form></td></table></fieldset>";
}
Exemplo n.º 2
0
function showsublinks($sep = "&middot;", $class = "")
{
    $sres = dbquery("SELECT link_window, link_visibility, link_url, link_name FROM " . DB_SITE_LINKS . "\n\t\tWHERE " . groupaccess('link_visibility') . " AND link_position>='2' AND link_url!='---' ORDER BY link_order ASC");
    if (dbrows($sres)) {
        $i = 0;
        $res = "<ul>\n";
        while ($sdata = dbarray($sres)) {
            $link_target = $sdata['link_window'] == "1" ? " target='_blank'" : "";
            $li_class = $i == 0 ? " class='first-link" . ($class ? " {$class}" : "") . "'" : ($class ? " class='{$class}'" : "");
            if (strstr($sdata['link_url'], "http://") || strstr($sdata['link_url'], "https://")) {
                $res .= "<li" . $li_class . ">" . $sep . "<a href='" . $sdata['link_url'] . "'{$link_target}><span>" . $sdata['link_name'] . "</span></a></li>\n";
            } else {
                $res .= "<li" . $li_class . ">" . $sep . "<a href='" . BASEDIR . $sdata['link_url'] . "'{$link_target}><span>" . $sdata['link_name'] . "</span></a></li>\n";
            }
            $i++;
        }
        if (iMEMBER) {
            $res .= "<li" . $li_class . ">" . $sep . "<a href='" . BASEDIR . "setuser.php?logout=yes'><span>Logout</span></a> </li>\n";
        } else {
            $res .= "<li" . $li_class . ">" . $sep . "<a href='" . BASEDIR . "register.php'><span>Register</span></a> </li>\n";
        }
        $res .= "</ul>\n";
        return $res;
    }
}
Exemplo n.º 3
0
 /**
  * Get thread structure on specific forum id.
  * @param            $forum_id
  * @param bool|FALSE $filter
  * @return array
  */
 public static function get_forum_thread($forum_id, $filter = FALSE)
 {
     $info = array();
     $locale = fusion_get_locale("", FORUM_LOCALE);
     $forum_settings = ForumServer::get_forum_settings();
     $userdata = fusion_get_userdata();
     $userdata['user_id'] = !empty($userdata['user_id']) ? (int) intval($userdata['user_id']) : 0;
     $lastVisited = isset($userdata['user_lastvisit']) && isnum($userdata['user_lastvisit']) ? $userdata['user_lastvisit'] : time();
     /**
      * Get threads with filter conditions (XSS prevention)
      */
     $thread_query = "\n        SELECT\n        count(t.thread_id) 'thread_max_rows',\n        count(a1.attach_id) 'attach_image',\n        count(a2.attach_id) 'attach_files'\n        FROM " . DB_FORUM_THREADS . " t\n        LEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = t.forum_id\n        INNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n        #LEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id\n        LEFT JOIN " . DB_FORUM_POSTS . " p1 ON p1.thread_id = t.thread_id and p1.post_id = t.thread_lastpostid\n        LEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n        LEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND p1.post_id = v.post_id\n        LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n        LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = t.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n        WHERE t.forum_id='" . intval($forum_id) . "' AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . "\n        " . (isset($filter['condition']) ? $filter['condition'] : '') . "\n        GROUP BY tf.forum_id\n        ";
     $thread_result = dbquery($thread_query);
     $thread_rows = dbrows($thread_result);
     $count = array("thread_max_rows" => 0, "attach_image" => 0, "attach_files" => 0);
     $info['item'][$forum_id]['forum_threadcount'] = 0;
     $info['item'][$forum_id]['forum_threadcount_word'] = format_word($count['thread_max_rows'], $locale['fmt_thread']);
     if ($thread_rows > 0) {
         $count = dbarray($thread_result);
         $info['item'][$forum_id]['forum_threadcount'] = 0;
         $info['item'][$forum_id]['forum_threadcount_word'] = format_word($count['thread_max_rows'], $locale['fmt_thread']);
     }
     $info['thread_max_rows'] = $count['thread_max_rows'];
     if ($info['thread_max_rows'] > 0) {
         $info['threads']['pagenav'] = "";
         $info['threads']['pagenav2'] = "";
         // anti-XSS filtered rowstart
         $_GET['thread_rowstart'] = isset($_GET['thread_rowstart']) && isnum($_GET['thread_rowstart']) && $_GET['thread_rowstart'] <= $count['thread_max_rows'] ? $_GET['thread_rowstart'] : 0;
         $thread_query = "\n            SELECT t.*, tf.forum_type, tf.forum_name, tf.forum_cat,\n            tu1.user_name ' author_name', tu1.user_status 'author_status', tu1.user_avatar 'author_avatar',\n            tu2.user_name 'last_user_name', tu2.user_status 'last_user_status', tu2.user_avatar 'last_user_avatar',\n            p1.post_datestamp, p1.post_message,\n            IF (n.thread_id > 0, 1 , 0) 'user_tracked',\n            count(v.vote_user) 'thread_rated',\n            count(pv.forum_vote_user_id) 'poll_voted',\n            p.forum_poll_title,\n            count(v.post_id) AS vote_count,\n            a1.attach_name, a1.attach_id,\n            a2.attach_name, a2.attach_id,\n            count(a1.attach_mime) 'attach_image',\n            count(a2.attach_mime) 'attach_files',\n            min(p2.post_datestamp) 'first_post_datestamp'\n            FROM " . DB_FORUM_THREADS . " t\n            LEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = t.forum_id\n            INNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n            LEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id\n            LEFT JOIN " . DB_FORUM_POSTS . " p1 ON p1.thread_id = t.thread_id and p1.post_id = t.thread_lastpostid\n            LEFT JOIN " . DB_FORUM_POSTS . " p2 ON p2.thread_id = t.thread_id\n            LEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n            #LEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND p1.post_id = v.post_id\n            LEFT JOIN " . DB_FORUM_VOTES . " v on v.thread_id = t.thread_id AND v.vote_user='******'user_id'] . "' AND v.forum_id = t.forum_id AND tf.forum_type='4'\n            LEFT JOIN " . DB_FORUM_POLL_VOTERS . " pv on pv.thread_id = t.thread_id AND pv.forum_vote_user_id='" . $userdata['user_id'] . "' AND t.thread_poll=1\n            LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n            LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = t.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n            LEFT JOIN " . DB_FORUM_THREAD_NOTIFY . " n on n.thread_id = t.thread_id and n.notify_user = '******'user_id'] . "'\n            WHERE t.forum_id='" . $forum_id . "' AND t.thread_hidden='0' AND " . groupaccess('tf.forum_access') . "\n            " . (isset($filter['condition']) ? $filter['condition'] : '') . "\n            " . (multilang_table("FO") ? "AND tf.forum_language='" . LANGUAGE . "'" : '') . "\n            GROUP BY t.thread_id\n            " . (isset($filter['order']) ? $filter['order'] : '') . "\n            LIMIT " . intval($_GET['thread_rowstart']) . ", " . $forum_settings['threads_per_page'];
         $cthread_result = dbquery($thread_query);
         if (dbrows($cthread_result) > 0) {
             while ($threads = dbarray($cthread_result)) {
                 $icon = "";
                 $match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id'];
                 if ($threads['thread_lastpost'] > $lastVisited) {
                     if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) {
                         $icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>";
                     } else {
                         $icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>";
                     }
                 }
                 $author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']);
                 $lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']);
                 $threads += array("thread_link" => array("link" => FORUM . "viewthread.php?thread_id=" . $threads['thread_id'], "title" => $threads['thread_subject']), "forum_type" => $threads['forum_type'], "thread_pages" => makepagenav(0, $forum_settings['posts_per_page'], $threads['thread_postcount'], 3, FORUM . "viewthread.php?thread_id=" . $threads['thread_id'] . "&amp;"), "thread_icons" => array('lock' => $threads['thread_locked'] ? "<i class='" . self::get_forumIcons('lock') . "' title='" . $locale['forum_0263'] . "'></i>" : '', 'sticky' => $threads['thread_sticky'] ? "<i class='" . self::get_forumIcons('sticky') . "' title='" . $locale['forum_0103'] . "'></i>" : '', 'poll' => $threads['thread_poll'] ? "<i class='" . self::get_forumIcons('poll') . "' title='" . $locale['forum_0314'] . "'></i>" : '', 'hot' => $threads['thread_postcount'] >= 20 ? "<i class='" . self::get_forumIcons('hot') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'reads' => $threads['thread_views'] >= 20 ? "<i class='" . self::get_forumIcons('reads') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'image' => $threads['attach_image'] > 0 ? "<i class='" . self::get_forumIcons('image') . "' title='" . $locale['forum_0313'] . "'></i>" : '', 'file' => $threads['attach_files'] > 0 ? "<i class='" . self::get_forumIcons('file') . "' title='" . $locale['forum_0312'] . "'></i>" : '', 'icon' => $icon), "thread_starter" => $locale['forum_0006'] . timer($threads['first_post_datestamp']) . " " . $locale['by'] . " " . profile_link($author['user_id'], $author['user_name'], $author['user_status']) . "</span>", "thread_author" => $author, "thread_last" => array('avatar' => display_avatar($lastuser, '30px', '', '', ''), 'profile_link' => profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']), 'time' => $threads['post_datestamp'], 'post_message' => parseubb(parsesmileys($threads['post_message'])), "formatted" => "<div class='pull-left'>" . display_avatar($lastuser, '30px', '', '', '') . "</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='overflow-hide'>" . $locale['forum_0373'] . " <span class='forum_profile_link'>" . profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']) . "</span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . timer($threads['post_datestamp']) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>"));
                 if ($threads['thread_sticky']) {
                     $info['threads']['sticky'][$threads['thread_id']] = $threads;
                 } else {
                     $info['threads']['item'][$threads['thread_id']] = $threads;
                 }
             }
         }
         if ($info['thread_max_rows'] > $forum_settings['threads_per_page']) {
             $info['threads']['pagenav'] = makepagenav($_GET['thread_rowstart'], $forum_settings['threads_per_page'], $info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&amp;", "thread_rowstart");
             $info['threads']['pagenav2'] = makepagenav($_GET['thread_rowstart'], $forum_settings['threads_per_page'], $info['thread_max_rows'], 3, clean_request("", array("thread_rowstart"), FALSE) . "&amp;", "thread_rowstart", TRUE);
         }
     }
     return (array) $info;
 }
Exemplo n.º 4
0
function download_subcats($id, $type = "")
{
    global $locale, $subcats_available;
    $result = dbquery("SELECT download_cat_id, download_cat_name, download_cat_description FROM " . DB_DOWNLOAD_CATS . " WHERE " . groupaccess('download_cat_access') . " AND download_cat_parent='" . $id . "' ORDER BY download_cat_name");
    $k = dbrows($result);
    if ($k > 0) {
        if ($type == "2") {
            $counter = 0;
            $columns = 2;
            echo "<tr>\n";
            echo "<td class='tbl2' colspan='" . $columns . "'><span class='side'><strong>" . $locale['432'] . "</strong></span></td><tr>\n";
            while ($data = dbarray($result)) {
                if ($counter != 0 && $counter % $columns == 0) {
                    echo "</tr>\n<tr>\n";
                }
                $num = dbcount("(download_cat)", DB_DOWNLOADS, "download_cat='" . (int) $data['download_cat_id'] . "'");
                if ($num > 0) {
                    $subcats_available = true;
                }
                echo "<td valign='top' width='50%' class='tbl1 download_idx_cat_name'><!--download_idx_cat_name--><a href='" . FUSION_SELF . "?cat_id=" . $data['download_cat_id'] . "'>" . $data['download_cat_name'] . "</a> <span class='small2'>({$num})</span>";
                if ($data['download_cat_description'] != "") {
                    echo "<br />\n<span class='small'>" . $data['download_cat_description'] . "</span>";
                }
                echo "</td>\n";
                $counter++;
            }
            if ($counter % $columns != 0) {
                echo "<td valign='top' width='50%' class='tbl1 download_idx_cat_name'></td>\n";
            }
            echo "<div style='margin:5px'></div>";
            echo "</tr>\n";
        } else {
            echo "<br />";
            echo "<tr><td colspan='8' class='tbl1 small' style='text-align:left;'>";
            echo "<span class='side'><strong>" . $locale['432'] . ": </strong></span>";
            while ($data = dbarray($result)) {
                $k--;
                $num = dbcount("(download_cat)", DB_DOWNLOADS, "download_cat='" . (int) $data['download_cat_id'] . "'");
                echo "<a href='" . FUSION_SELF . "?cat_id=" . $data['download_cat_id'] . "'>" . $data['download_cat_name'] . "</a> <span class='small2'>(" . $num . ")</span>";
                if ($k > 0) {
                    echo ", ";
                }
            }
            echo "</td></tr>\n";
        }
    }
}
function showsidelinks(array $options = array(), $id = 0)
{
    global $userdata;
    static $data = array();
    $settings = fusion_get_settings();
    $acclevel = isset($userdata['user_level']) ? $userdata['user_level'] : 0;
    $res =& $res;
    if (empty($data)) {
        $data = dbquery_tree_full(DB_SITE_LINKS, "link_id", "link_cat", "WHERE link_position <= 2" . (multilang_table("SL") ? " AND link_language='" . LANGUAGE . "'" : "") . " AND " . groupaccess('link_visibility') . " ORDER BY link_cat, link_order");
    }
    if (!$id) {
        $res .= "<ul class='main-nav'>\n";
    } else {
        $res .= "<ul class='sub-nav p-l-10' style='display: none;'>\n";
    }
    foreach ($data[$id] as $link_id => $link_data) {
        $li_class = "";
        if ($link_data['link_name'] != "---" && $link_data['link_name'] != "===") {
            $link_target = $link_data['link_window'] == "1" ? " target='_blank'" : "";
            if (START_PAGE == $link_data['link_url']) {
                $li_class .= ($li_class ? " " : "") . "current-link";
            }
            if (preg_match("!^(ht|f)tp(s)?://!i", $link_data['link_url'])) {
                $item_link = $link_data['link_url'];
            } else {
                $item_link = BASEDIR . $link_data['link_url'];
            }
            $link_icon = "";
            if ($link_data['link_icon']) {
                $link_icon = "<i class='" . $link_data['link_icon'] . "'></i>";
            }
            $res .= "<li" . ($li_class ? " class='" . $li_class . "'" : "") . ">\n";
            $res .= "<a class='display-block p-5 p-l-0 p-r-0' href='{$item_link}' {$link_target}>\n";
            $res .= $link_icon . $link_data['link_name'];
            $res .= "</a>\n";
            if (isset($data[$link_id])) {
                $res .= showsidelinks($options, $link_data['link_id']);
            }
            $res .= "</li>\n";
        } elseif ($link_data['link_cat'] > 0) {
            echo "<li class='divider'></li>";
        }
    }
    $res .= "</ul>\n";
    return $res;
}
Exemplo n.º 6
0
function weblink_subcats($id, $type = "")
{
    global $locale;
    $result = dbquery("SELECT weblink_cat_id, weblink_cat_name, weblink_cat_description FROM " . DB_WEBLINK_CATS . " WHERE " . groupaccess('weblink_cat_access') . " AND weblink_cat_parent='" . (int) $id . "'  ORDER BY weblink_cat_name");
    $k = dbrows($result);
    if ($k > 0) {
        if ($type == "2") {
            $counter = 0;
            $columns = 2;
            echo "<span class='side'><strong>" . $locale['413'] . "</strong></span><br />\n";
            echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
            while ($data = dbarray($result)) {
                if ($counter != 0 && $counter % $columns == 0) {
                    echo "</tr>\n<tr>\n";
                }
                $num = dbcount("(weblink_cat)", DB_WEBLINKS, "weblink_cat='" . (int) $data['weblink_cat_id'] . "'");
                echo "<td valign='top' width='50%' class='tbl'><a href='" . FUSION_SELF . "?cat_id=" . $data['weblink_cat_id'] . "'>" . $data['weblink_cat_name'] . "</a> <span class='small2'>(" . $num . ")</span>";
                if ($data['weblink_cat_description'] != "") {
                    echo "<br />\n<span class='small'>" . $data['weblink_cat_description'] . "</span>";
                }
                echo "</td>\n";
                $counter++;
            }
            if ($counter % $columns != 0) {
                echo "<td valign='top' width='50%' class='tbl'></td>\n";
            }
            echo "</tr>\n</table>\n";
            echo "<div style='margin:5px'></div>";
            echo "<br />";
        } else {
            echo "<br />";
            echo "<span class='side'><strong>" . $locale['413'] . ": </strong></span>";
            while ($data = dbarray($result)) {
                $k--;
                $num = dbcount("(weblink_cat)", DB_WEBLINKS, "weblink_cat='" . (int) $data['weblink_cat_id'] . "'");
                echo "<a href='" . FUSION_SELF . "?cat_id=" . $data['weblink_cat_id'] . "'>" . $data['weblink_cat_name'] . "</a> <span class='small2'>(" . $num . ")</span>";
                if ($k > 0) {
                    echo ", ";
                }
            }
        }
    }
}
Exemplo n.º 7
0
function article_subcats($id, $type = "")
{
    global $locale;
    $result = dbquery("SELECT article_cat_id, article_cat_name, article_cat_description FROM " . DB_ARTICLE_CATS . " WHERE " . groupaccess('article_cat_access') . " AND article_cat_parent='" . (int) $id . "'  ORDER BY article_cat_name");
    $k = dbrows($result);
    if ($k > 0) {
        if ($type == "1") {
            $counter = 0;
            $columns = 2;
            echo "<span class='side'><strong>" . $locale['406'] . "</strong></span><br />\n";
            echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
            while ($data = dbarray($result)) {
                if ($counter != 0 && $counter % $columns == 0) {
                    echo "</tr>\n<tr>\n";
                }
                $num = dbcount("(article_cat)", DB_ARTICLES, "article_cat='" . $data['article_cat_id'] . "' AND article_draft='0'");
                echo "<td valign='top' width='50%' class='tbl article_idx_cat_name'><!--article_idx_cat_name--><a href='" . FUSION_SELF . "?cat_id=" . $data['article_cat_id'] . "'>" . $data['article_cat_name'] . "</a> <span class='small2'>({$num})</span>";
                if ($data['article_cat_description'] != "") {
                    echo "<br />\n<span class='small'>" . $data['article_cat_description'] . "</span>";
                }
                echo "</td>\n";
                $counter++;
            }
            echo "</tr>\n</table>\n";
            echo "<div style='margin:5px'></div>";
        } else {
            echo "<br />";
            echo "<span class='side'><strong>" . $locale['406'] . ": </strong></span>";
            while ($data = dbarray($result)) {
                $k--;
                $num = dbcount("(article_cat)", DB_ARTICLES, "article_cat='" . (int) $data['article_cat_id'] . "' AND article_draft='0'");
                echo "<!--article_idx_cat_name--><a href='" . FUSION_SELF . "?cat_id=" . $data['article_cat_id'] . "'>" . $data['article_cat_name'] . "</a> <span class='small2'>({$num})</span>";
                if ($k > 0) {
                    echo ", ";
                }
            }
        }
    }
}
Exemplo n.º 8
0
| 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).
+--------------------------------------------------------*/
require_once dirname(__FILE__) . "../../../../maincore.php";
header('Content-Type: application/rss+xml; charset=' . $locale['charset'] . '');
if (file_exists(INFUSIONS . "rss_feeds_panel/locale/" . LANGUAGE . ".php")) {
    include INFUSIONS . "rss_feeds_panel/locale/" . LANGUAGE . ".php";
} else {
    include INFUSIONS . "rss_feeds_panel/locale/English.php";
}
if (db_exists(DB_NEWS)) {
    $result = dbquery("SELECT * FROM " . DB_NEWS . " WHERE " . groupaccess('news_visibility') . (multilang_table("NS") ? " AND news_language='" . LANGUAGE . "'" : "") . "\tORDER BY news_datestamp DESC LIMIT 0,10");
    $rssimage = $settings['siteurl'] . $settings['sitebanner'];
    echo "<?xml version=\"1.0\" encoding=\"" . $locale['charset'] . "\"?>\n\n";
    echo "<rss version=\"2.0\">\n\n\t<image>\n <url>{$rssimage}</url>\n </image>\n\t<channel>\n";
    if (dbrows($result) != 0) {
        echo "<title>" . $settings['sitename'] . $locale['rss004'] . (multilang_table("NS") ? " " . $locale['rss007'] . " " . LANGUAGE : "") . "</title>\n";
        echo "<link>" . $settings['siteurl'] . "</link>\n \r\n\t  <description>" . $settings['description'] . "</description>\n";
        while ($row = dbarray($result)) {
            $rsid = intval($row['news_id']);
            $rtitle = $row['news_subject'];
            $description = stripslashes(nl2br($row['news_news']));
            $description = strip_tags($description, "<a><p><br /><br /><hr />");
            echo "<item>\n";
            echo "<title>" . htmlspecialchars($rtitle) . "</title>\n";
            echo "<link>" . $settings['siteurl'] . "infusions/news/news.php?readmore=" . $rsid . "</link>\n";
            echo "<description>" . htmlspecialchars($description) . "</description>\n";
            pdp_update_cat_downloads($last_cat);
            pdp_update_cat_downloads($download->data['cat_id']);
        }
        if ($ok) {
            if ($download->status == PDP_PRO_NEW) {
                fallback('edit_files.php?did=' . $download->id);
            }
            fallback(FUSION_SELF . '?did=' . $download->id . '&errno=0');
        }
    }
}
/****************************************************************************
 * CREATE
 */
$all_cats = array();
$res = dbquery("SELECT  cat_name, top_cat, cat_id, cat_upload_access" . " FROM " . DB_PDP_CATS . "" . (iPDP_MOD ? "" : " WHERE " . groupaccess("cat_upload_access")) . " ORDER BY cat_order ASC");
while ($data = dbarray($res)) {
    $all_cats[$data['cat_id']] = array("name" => $data['cat_name'], "parentcat" => $data['top_cat'], "access" => $data['cat_upload_access']);
}
function pdp_tmp_show_cat($parentid, $cat_array, $level, $sel_this)
{
    $retval = "";
    foreach ($cat_array as $myid => $thiscat) {
        if ($thiscat['parentcat'] == $parentid && checkgroup($thiscat['access'])) {
            $retval .= "<option value='{$myid}'" . ($sel_this == $myid ? ' selected="selected"' : '') . '>' . str_repeat("&nbsp;", $level * 4) . $thiscat['name'] . '</option>';
            $retval .= pdp_tmp_show_cat($myid, $cat_array, $level + 1, $sel_this);
        }
    }
    return $retval;
}
$sel_cats = pdp_tmp_show_cat(0, $all_cats, 0, $download->data['cat_id']);
Exemplo n.º 10
0
     } else {
         if ($_GET['fields'] == 2) {
             $fieldsvar = search_fieldsvar($ssubject, $smessage, $sextended);
         } else {
             $fieldsvar = "";
         }
     }
 }
 if ($fieldsvar) {
     $rows = dbcount("(news_id)", DB_NEWS, groupaccess('news_visibility') . " AND " . $fieldsvar . " AND (news_start='0'||news_start<=" . time() . ") AND (news_end='0'||news_end>=" . time() . ") " . ($_GET['datelimit'] != 0 ? " AND news_datestamp>=" . (time() - $_GET['datelimit']) : ""));
 } else {
     $rows = 0;
 }
 if ($rows != 0) {
     $items_count .= THEME_BULLET . "&nbsp;<a href='" . FUSION_SELF . "?stype=news&amp;stext=" . $_GET['stext'] . "&amp;" . $composevars . "'>" . $rows . " " . ($rows == 1 ? $locale['n401'] : $locale['n402']) . " " . $locale['522'] . "</a><br />\n";
     $result = dbquery("SELECT tn.*, tu.user_id, tu.user_name, tu.user_status FROM " . DB_NEWS . " tn\r\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON tn.news_name=tu.user_id\r\n\t\t\tWHERE " . groupaccess('news_visibility') . " AND (news_start='0'||news_start<=" . time() . ")\r\n\t\t\tAND (news_end='0'||news_end>=" . time() . ") AND " . $fieldsvar . "\r\n\t\t\t" . ($_GET['datelimit'] != 0 ? " AND news_datestamp>=" . (time() - $_GET['datelimit']) : "") . "\r\n\t\t\tORDER BY " . $sortby . " " . ($_GET['order'] == 1 ? "ASC" : "DESC") . ($_GET['stype'] != "all" ? " LIMIT " . $_GET['rowstart'] . ",10" : ""));
     while ($data = dbarray($result)) {
         $search_result = "";
         $text_all = $data['news_news'] . " " . $data['news_extended'];
         $text_all = search_striphtmlbbcodes($text_all);
         $text_frag = search_textfrag($text_all);
         // $text_frag = highlight_words($swords, $text_frag);
         $subj_c = search_stringscount($data['news_subject']);
         $text_c = search_stringscount($data['news_news']);
         $text_c2 = search_stringscount($data['news_extended']);
         $search_result .= "<a href='news.php?readmore=" . $data['news_id'] . "'>" . $data['news_subject'] . "</a>" . "<br /><br />\n";
         // $search_result .= "<a href='news.php?readmore=".$data['news_id']."'>".highlight_words($swords, $data['news_subject'])."</a>"."<br /><br />\n";
         $search_result .= "<div class='quote' style='width:auto;height:auto;overflow:auto'>" . $text_frag . "</div><br />";
         $search_result .= "<span class='small2'>" . $locale['global_070'] . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "\n";
         $search_result .= $locale['global_071'] . showdate("longdate", $data['news_datestamp']) . "</span><br />\n";
         $search_result .= "<span class='small'>" . $subj_c . " " . ($subj_c == 1 ? $locale['520'] : $locale['521']) . " " . $locale['n403'] . " " . $locale['n404'] . ", ";
Exemplo n.º 11
0
         $dell_f_post = true;
         echo $locale['605'] . "<br />\n";
     } else {
         echo $locale['606'] . "<br />\n";
     }
     if ($dell_f_post && count($array_post) == 1) {
         echo "<br /><strong>" . $locale['607'] . "</strong><br /><br />\n";
         echo "<a href='" . FORUM . "viewthread.php?thread_id=" . $pdata['thread_id'] . "&amp;rowstart=" . $_GET['rowstart'] . "'>" . $locale['609'] . "</a>";
         $f_post_blo = true;
     }
     echo "</div></div>\n";
 }
 if (!isset($_POST['new_forum_id']) && !$f_post_blo) {
     $forum_list = "";
     $current_cat = "";
     $fl_result = dbquery("\r\n\t\t\t\t\tSELECT f.forum_id, f.forum_name, f2.forum_name AS forum_cat_name, \r\n\t\t\t\t\t\t(SELECT COUNT(thread_id) \r\n\t\t\t\t\t\tFROM " . DB_THREADS . " th \r\n\t\t\t\t\t\tWHERE f.forum_id=th.forum_id AND th.thread_id!='" . $pdata['thread_id'] . "'\r\n\t\t\t\t\t\tGROUP BY th.forum_id) AS threadcount\r\n\t\t\t\t\tFROM " . DB_FORUMS . " f\r\n\t\t\t\t\tINNER JOIN " . DB_FORUMS . " f2 ON f.forum_cat=f2.forum_id\r\n\t\t\t\t\tWHERE " . groupaccess('f.forum_access') . " AND f.forum_cat!='0' \r\n\t\t\t\t\tHAVING threadcount != 0\r\n\t\t\t\t\tORDER BY f2.forum_order ASC, f.forum_order ASC\r\n\t\t\t\t");
     if (dbrows($fl_result) > 0) {
         while ($fl_data = dbarray($fl_result)) {
             if ($fl_data['forum_cat_name'] != $current_cat) {
                 if ($current_cat != "") {
                     $forum_list .= "</optgroup>\n";
                 }
                 $current_cat = $fl_data['forum_cat_name'];
                 $forum_list .= "<optgroup label='" . $fl_data['forum_cat_name'] . "'>\n";
             }
             $sel = $fl_data['forum_id'] == $fdata['forum_id'] ? " selected='selected'" : "";
             $forum_list .= "<option value='" . $fl_data['forum_id'] . "'{$sel}>" . $fl_data['forum_name'] . "</option>\n";
         }
         $forum_list .= "</optgroup>\n";
         echo "<form name='modopts' method='post' action='" . FUSION_SELF . "?thread_id=" . $fdata['thread_id'] . "&amp;rowstart=" . $_GET['rowstart'] . "'>\n";
         echo "<table cellpadding='0' cellspacing='0' width='100%' align='center'>\n<tr>\n";
Exemplo n.º 12
0
| 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).
+--------------------------------------------------------*/
// Count Max
$result = dbquery("SELECT tp.post_id FROM " . DB_FORUM_POSTS . " tp\n\tINNER JOIN " . DB_FORUM_THREADS . " tt ON tp.thread_id = tt.thread_id\n\tINNER JOIN " . DB_FORUMS . " tf ON tp.forum_id = tf.forum_id\n\t" . (multilang_table("FO") ? "WHERE tf.forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('forum_access') . "\n\tAND tt.thread_postcount='1' AND tt.thread_locked='0' AND post_hidden='0' AND thread_hidden='0'\n\tGROUP BY tt.thread_id\n\t");
$this->forum_info['post_rows'] = dbrows($result);
if (dbrows($result) > 0) {
    if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
        $_GET['rowstart'] = 0;
    }
    require_once INCLUDES . "mimetypes_include.php";
    $result = dbquery("\n\t\tSELECT tp.forum_id, tp.thread_id, tp.post_id, tp.post_author, tp.post_message, tp.post_datestamp,\n\t\tt.*, tf.*,\n\t\ttu1.user_name AS author_name, tu1.user_status AS author_status, tu1.user_avatar as author_avatar,\n\t\ttu2.user_name AS last_user_name, tu2.user_status AS last_user_status, tu2.user_avatar AS last_user_avatar,\n\t\tp.forum_poll_title,\n\t\tcount(v.post_id) AS vote_count,\n\t\ta1.attach_name, a1.attach_id,\n\t\ta2.attach_name, a2.attach_id,\n\t\tcount(a1.attach_mime) 'attach_image',\n\t\tcount(a2.attach_mime) 'attach_files'\n\t\tFROM " . DB_FORUM_POSTS . " tp\n\t\tINNER JOIN " . DB_FORUMS . " tf ON tp.forum_id=tf.forum_id\n\t\tINNER JOIN " . DB_FORUM_THREADS . " t ON tp.thread_id=t.thread_id\n\t\tINNER JOIN " . DB_USERS . " tu1 ON t.thread_author = tu1.user_id\n\t\tLEFT JOIN " . DB_USERS . " tu2 ON t.thread_lastuser = tu2.user_id #issue 323\n\t\tLEFT JOIN " . DB_FORUM_POLLS . " p ON p.thread_id = t.thread_id\n\t\tLEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = t.thread_id AND tp.post_id = v.post_id\n\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = t.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = t.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t" . (multilang_table("FO") ? "WHERE tf.forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('tf.forum_access') . "\n\t\tAND t.thread_postcount='1' AND t.thread_locked='0'\n\t\tAND post_hidden='0' AND thread_hidden='0'\n\t\tGROUP BY t.thread_id\n\t\tORDER BY tp.post_datestamp DESC LIMIT " . $_GET['rowstart'] . "," . $forum_settings['posts_per_page'] . "\n\t\t");
    while ($threads = dbarray($result)) {
        // opt for moderators.
        $this->forum_info['moderators'] = \PHPFusion\Forums\Moderator::parse_forum_mods($threads['forum_mods']);
        $icon = "";
        $match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id'];
        if ($threads['thread_lastpost'] > $this->forum_info['lastvisited']) {
            if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) {
                $icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>";
            } else {
                $icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>";
            }
        }
        $author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']);
        $lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']);
        $threads += array("thread_link" => array("link" => INFUSIONS . "forum/viewthread.php?thread_id=" . $threads['thread_id'], "title" => $threads['thread_subject']), "forum_type" => $threads['forum_type'], "thread_pages" => makepagenav(0, $forum_settings['posts_per_page'], $threads['thread_postcount'], 3, FORUM . "viewthread.php?thread_id=" . $threads['thread_id'] . "&amp;"), "thread_icons" => array('lock' => $threads['thread_locked'] ? "<i class='" . get_forumIcons('lock') . "' title='" . $locale['forum_0263'] . "'></i>" : '', 'sticky' => $threads['thread_sticky'] ? "<i class='" . get_forumIcons('sticky') . "' title='" . $locale['forum_0103'] . "'></i>" : '', 'poll' => $threads['thread_poll'] ? "<i class='" . get_forumIcons('poll') . "' title='" . $locale['forum_0314'] . "'></i>" : '', 'hot' => $threads['thread_postcount'] >= 20 ? "<i class='" . get_forumIcons('hot') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'reads' => $threads['thread_views'] >= 20 ? "<i class='" . get_forumIcons('reads') . "' title='" . $locale['forum_0311'] . "'></i>" : '', 'image' => $threads['attach_image'] > 0 ? "<i class='" . get_forumIcons('image') . "' title='" . $locale['forum_0313'] . "'></i>" : '', 'file' => $threads['attach_files'] > 0 ? "<i class='" . get_forumIcons('file') . "' title='" . $locale['forum_0312'] . "'></i>" : '', 'icon' => $icon), "thread_starter" => $locale['forum_0006'] . timer($threads['post_datestamp']) . " " . $locale['by'] . " " . profile_link($author['user_id'], $author['user_name'], $author['user_status']) . "</span>", "thread_author" => $author, "thread_last" => array('avatar' => display_avatar($lastuser, '30px', '', '', ''), 'profile_link' => profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']), 'time' => $threads['post_datestamp'], 'post_message' => parseubb(parsesmileys($threads['post_message'])), "formatted" => "<div class='pull-left'>" . display_avatar($lastuser, '30px', '', '', '') . "</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='overflow-hide'>" . $locale['forum_0373'] . " <span class='forum_profile_link'>" . profile_link($lastuser['user_id'], $lastuser['user_name'], $lastuser['user_status']) . "</span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . timer($threads['post_datestamp']) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>"));
Exemplo n.º 13
0
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
require_once THEMES . "templates/global/home.php";
require_once INCLUDES . "infusions_include.php";
include LOCALE . LOCALESET . "homepage.php";
add_to_title($locale['home']);
add_breadcrumb(array("title" => $locale['home'], "link" => BASEDIR . "home.php"));
$configs = array();
$configs[DB_NEWS] = array('select' => "SELECT\n\tns.news_id as id, ns.news_subject as title, ns.news_news as content,\n\tns.news_datestamp as datestamp, us.user_id, us.user_name,\n\tus.user_status, nc.news_cat_id as cat_id, nc.news_cat_name as cat_name,\n\tns.news_image as image,\n\tnc.news_cat_image as cat_image,\n\tcount(c1.comment_id) as comment_count,\n\tcount(r1.rating_id) as rating_count\n\tFROM " . DB_NEWS . " as ns\n\tLEFT JOIN " . DB_NEWS_CATS . " as nc ON nc.news_cat_id = ns.news_cat\n\tLEFT JOIN " . DB_COMMENTS . " as c1 on (c1.comment_item_id = ns.news_id and c1.comment_type = 'NS')\n\tLEFT JOIN " . DB_RATINGS . " as r1 on (r1.rating_item_id = ns.news_id AND r1.rating_type = 'NS')\n\tINNER JOIN " . DB_USERS . " as us ON ns.news_name = us.user_id\n\tWHERE (" . time() . " > ns.news_start OR ns.news_start = 0)\n\tAND (" . time() . " < ns.news_end OR ns.news_end = 0)\n\tAND " . groupaccess('ns.news_visibility') . " " . (multilang_table("NS") ? "AND news_language='" . LANGUAGE . "'" : "") . "\n\tgroup by ns.news_id\n\tORDER BY ns.news_datestamp DESC LIMIT 3", 'locale' => array('norecord' => $locale['home_0050'], 'blockTitle' => $locale['home_0000']), 'infSettings' => get_settings("news"), 'categoryLinkPattern' => INFUSIONS . "news/news.php?cat_id={cat_id}", 'contentLinkPattern' => INFUSIONS . "news/news.php?readmore={id}");
$configs[DB_ARTICLES] = array('select' => "SELECT\n\tar.article_id as id, ar.article_subject as title, ar.article_snippet as content,\n\tar.article_datestamp as datestamp, ac.article_cat_id as cat_id, ac.article_cat_name as cat_name,\n\tus.user_id, us.user_name, us.user_status\n\tFROM " . DB_ARTICLES . " as ar\n\tINNER JOIN " . DB_ARTICLE_CATS . " as ac ON ac.article_cat_id = ar.article_cat\n\tINNER JOIN " . DB_USERS . " as us ON us.user_id = ar.article_name\n\tWHERE " . groupaccess('ar.article_visibility') . " " . (multilang_table("AR") ? "AND ac.article_cat_language='" . LANGUAGE . "'" : "") . "\n\tORDER BY ar.article_datestamp DESC LIMIT 3", 'locale' => array('norecord' => $locale['home_0051'], 'blockTitle' => $locale['home_0001']), 'infSettings' => get_settings("article"), 'categoryLinkPattern' => INFUSIONS . "articles/articles.php?cat_id={cat_id}", 'contentLinkPattern' => INFUSIONS . "articles/articles.php?article_id={id}");
$configs[DB_BLOG] = array('select' => "SELECT\n\tbl.blog_id as id, bl.blog_subject as title, bl.blog_blog as content,\n\tbl.blog_datestamp as datestamp, us.user_id, us.user_name,\n\tus.user_status, bc.blog_cat_id as cat_id, bc.blog_cat_name as cat_name,\n\tbl.blog_image as image,\n\tbc.blog_cat_image as cat_image,\n\tcount(c1.comment_id) as comment_count,\n\tcount(r1.rating_id) as rating_count\n\tFROM " . DB_BLOG . " as bl\n\tLEFT JOIN " . DB_BLOG_CATS . " as bc ON bc.blog_cat_id = bl.blog_cat\n\tLEFT JOIN " . DB_COMMENTS . " as c1 on (c1.comment_item_id = bl.blog_id and c1.comment_type = 'BL')\n\tLEFT JOIN " . DB_RATINGS . " as r1 on (r1.rating_item_id = bl.blog_id AND r1.rating_type = 'BL')\n\tINNER JOIN " . DB_USERS . " as us ON bl.blog_name = us.user_id\n\tWHERE (" . time() . " > bl.blog_start OR bl.blog_start = 0)\n\tAND (" . time() . " < bl.blog_end OR bl.blog_end = 0)\n\tAND " . groupaccess('bl.blog_visibility') . " " . (multilang_table("BL") ? "AND blog_language='" . LANGUAGE . "'" : "") . "\n\tgroup by bl.blog_id\n\tORDER BY bl.blog_datestamp DESC LIMIT 3", 'locale' => array('norecord' => $locale['home_0052'], 'blockTitle' => $locale['home_0002']), 'infSettings' => get_settings("blog"), 'categoryLinkPattern' => INFUSIONS . "blog/blog.php?cat_id={cat_id}", 'contentLinkPattern' => INFUSIONS . "blog/blog.php?readmore={id}");
$configs[DB_DOWNLOADS] = array('select' => "SELECT\n\tdl.download_id as id, dl.download_title as title, dl.download_description_short as content,\n\tdl.download_datestamp as datestamp, dc.download_cat_id as cat_id, dc.download_cat_name as cat_name,\n\tus.user_id, us.user_name, us.user_status,\n\tdl.download_image as image,\n\tcount(c1.comment_id) as comment_count,\n\tcount(r1.rating_id) as rating_count\n\tFROM " . DB_DOWNLOADS . " dl\n\tINNER JOIN " . DB_DOWNLOAD_CATS . " dc ON dc.download_cat_id = dl.download_cat\n\tINNER JOIN " . DB_USERS . " us ON us.user_id = dl.download_user\n\tLEFT JOIN " . DB_COMMENTS . " as c1 on (c1.comment_item_id = dl.download_id and c1.comment_type = 'D')\n\tLEFT JOIN " . DB_RATINGS . " as r1 on (r1.rating_item_id = dl.download_id AND r1.rating_type = 'D')\n\tWHERE " . groupaccess('dl.download_visibility') . " " . (multilang_table("DL") ? "AND dc.download_cat_language='" . LANGUAGE . "'" : "") . "\n\tgroup by dl.download_id\n\tORDER BY dl.download_datestamp DESC LIMIT 3", 'locale' => array('norecord' => $locale['home_0053'], 'blockTitle' => $locale['home_0003']), 'infSettings' => get_settings("downloads"), 'categoryLinkPattern' => DOWNLOADS . "downloads.php?cat_id={cat_id}", 'contentLinkPattern' => DOWNLOADS . "downloads.php?cat_id={cat_id}&download_id={id}");
$contents = array();
foreach ($configs as $table => $config) {
    if (!db_exists($table)) {
        continue;
    }
    $contents[$table] = array('data' => array(), 'colwidth' => 0, 'norecord' => $config['locale']['norecord'], 'blockTitle' => $config['locale']['blockTitle'], 'infSettings' => $config['infSettings']);
    $result = dbquery($config['select']);
    $items_count = dbrows($result);
    if (!$items_count) {
        continue;
    }
    $contents[$table]['colwidth'] = floor(12 / $items_count);
    $data = array();
    $count = 1;
    while ($row = dbarray($result)) {
Exemplo n.º 14
0
            render_news($news_subject, $news_news, $news_info);
        }
        echo "<!--sub_news_idx-->\n";
        if ($rows > $items_per_page) {
            echo "<div align='center' style=';margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], $items_per_page, $rows, 3) . "\n</div>\n";
        }
    } else {
        opentable($locale['global_077']);
        echo "<div style='text-align:center'><br />\n" . $locale['global_078'] . "<br /><br />\n</div>\n";
        closetable();
    }
} else {
    if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
        $_GET['rowstart'] = 0;
    }
    $result = dbquery("SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status FROM " . DB_NEWS . " tn\n\t\tLEFT JOIN " . DB_USERS . " tu ON tn.news_name=tu.user_id\n\t\tLEFT JOIN " . DB_NEWS_CATS . " tc ON tn.news_cat=tc.news_cat_id\n\t\tWHERE " . groupaccess('news_visibility') . " AND news_id='" . $_GET['readmore'] . "' AND news_draft='0'\n\t\tLIMIT 1");
    if (dbrows($result)) {
        include INCLUDES . "comments_include.php";
        include INCLUDES . "ratings_include.php";
        $data = dbarray($result);
        if (!isset($_POST['post_comment']) && !isset($_POST['post_rating'])) {
            $result2 = dbquery("UPDATE " . DB_NEWS . " SET news_reads=news_reads+1 WHERE news_id='" . $_GET['readmore'] . "'");
            $data['news_reads']++;
        }
        $news_cat_image = "";
        $news_subject = $data['news_subject'];
        if ($data['news_image_t1'] && $settings['news_image_readmore'] == "0") {
            $img_size = @getimagesize(IMAGES_N . $data['news_image']);
            $news_cat_image = "<a href=\"javascript:;\" onclick=\"window.open('" . IMAGES_N . $data['news_image'] . "','','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=" . ($img_size[0] + 20) . ",height=" . ($img_size[1] + 20) . "')\"><img src='" . IMAGES_N_T . $data['news_image_t1'] . "' alt='" . $data['news_subject'] . "' class='news-category' /></a>";
        } elseif ($data['news_cat_image']) {
            $news_cat_image = "<a href='news_cats.php?cat_id=" . $data['news_cat'] . "'><img src='" . get_image("nc_" . $data['news_cat_name']) . "' alt='" . $data['news_cat_name'] . "' class='news-category' /></a>";
Exemplo n.º 15
0
     $result = dbquery("SELECT thread_lastpost, thread_lastuser FROM " . DB_THREADS . " WHERE forum_id='" . $_POST['new_forum_id'] . "' AND thread_hidden='0' ORDER BY thread_lastpost DESC LIMIT 1");
     if (dbrows($result)) {
         $pdata2 = dbarray($result);
         $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_lastpost='" . $pdata2['thread_lastpost'] . "', forum_postcount=forum_postcount+" . $post_count . ", forum_threadcount=forum_threadcount+1, forum_lastuser='******'thread_lastuser'] . "' WHERE forum_id='" . $_POST['new_forum_id'] . "'");
     } else {
         $result = dbquery("UPDATE " . DB_FORUMS . " SET forum_lastpost='0', forum_postcount=forum_postcount+1, forum_threadcount=forum_threadcount+" . $post_count . ", forum_lastuser='******' WHERE forum_id='" . $_POST['new_forum_id'] . "'");
     }
     echo "<div style='text-align:center'><br />\n" . $locale['452'] . "<br /><br />\n";
     echo "<a href='index.php'>" . $locale['403'] . "</a><br /><br />\n</div>\n";
 } else {
     $move_list = "";
     $sel = "";
     $result = dbquery("SELECT forum_id, forum_name FROM " . DB_FORUMS . " WHERE forum_cat='0' ORDER BY forum_order");
     if (dbrows($result) != 0) {
         while ($data = dbarray($result)) {
             $result2 = dbquery("SELECT forum_id, forum_name FROM " . DB_FORUMS . " WHERE forum_cat='" . $data['forum_id'] . "' AND forum_parent='0' AND " . groupaccess('forum_access') . " ORDER BY forum_order");
             //subforums
             if (dbrows($result2) != 0) {
                 $move_list .= "<optgroup label='" . $data['forum_name'] . "'>\n";
                 while ($data2 = dbarray($result2)) {
                     if ($_GET['forum_id'] == $data2['forum_id']) {
                         $sel = " selected";
                     } else {
                         $sel = "";
                     }
                     $move_list .= "<option value='" . $data2['forum_id'] . "'{$sel}>" . $data2['forum_name'] . "</option>\n";
                     $move_list .= forum_move_to($data2['forum_id']);
                     //subforums
                 }
                 $move_list .= "</optgroup>\n";
             }
Exemplo n.º 16
0
}
if (isset($_GET['delete']) && isnum($_GET['delete']) && dbcount("(thread_id)", DB_FORUM_THREAD_NOTIFY, "thread_id='" . $_GET['delete'] . "' AND notify_user='******'user_id'] . "'")) {
    $result = dbquery("DELETE FROM " . DB_FORUM_THREAD_NOTIFY . " WHERE thread_id=" . $_GET['delete'] . " AND notify_user="******"SELECT tn.thread_id FROM " . DB_FORUM_THREAD_NOTIFY . " tn\n            INNER JOIN " . DB_FORUM_THREADS . " tt ON tn.thread_id = tt.thread_id\n            INNER JOIN " . DB_FORUMS . " tf ON tt.forum_id = tf.forum_id\n            WHERE tn.notify_user="******" AND " . groupaccess('forum_access') . " AND tt.thread_hidden='0'");
$rows = dbrows($result);
if (!isset($_GET['rowstart']) or !isnum($_GET['rowstart']) or $_GET['rowstart'] > $rows) {
    $_GET['rowstart'] = 0;
}
$info['post_rows'] = $rows;
if ($rows) {
    require_once INCLUDES . "mimetypes_include.php";
    $info['page_nav'] = $rows > 10 ? makepagenav($_GET['rowstart'], 16, $rows, 3, FUSION_REQUEST, "rowstart") : "";
    $result = dbquery("\n                SELECT tf.forum_id, tf.forum_name, tf.forum_access, tf.forum_type, tf.forum_mods,\n                tn.thread_id, tn.notify_datestamp, tn.notify_user,\n                ttc.forum_id AS forum_cat_id, ttc.forum_name AS forum_cat_name,\n                tp.post_datestamp, tp.post_message,\n                tt.thread_subject, tt.forum_id, tt.thread_lastpost, tt.thread_lastpostid, tt.thread_lastuser, tt.thread_postcount, tt.thread_views, tt.thread_locked,\n                tt.thread_author, tt.thread_poll, tt.thread_sticky,\n                uc.user_id AS s_user_id, uc.user_name AS author_name, uc.user_status AS author_status, uc.user_avatar AS author_avatar,\n                u.user_id, u.user_name as last_user_name, u.user_status as last_user_status, u.user_avatar as last_user_avatar,\n                count(v.post_id) AS vote_count,\n                count(a1.attach_mime) 'attach_image',\n\t\t\t\tcount(a2.attach_mime) 'attach_files'\n                FROM " . DB_FORUM_THREAD_NOTIFY . " tn\n                INNER JOIN " . DB_FORUM_THREADS . " tt ON tn.thread_id = tt.thread_id\n                INNER JOIN " . DB_FORUMS . " tf ON tt.forum_id = tf.forum_id\n                LEFT JOIN " . DB_FORUMS . " ttc ON ttc.forum_id = tf.forum_cat\n                LEFT JOIN " . DB_USERS . " uc ON tt.thread_author = uc.user_id\n                LEFT JOIN " . DB_USERS . " u ON tt.thread_lastuser = u.user_id\n                LEFT JOIN " . DB_FORUM_POSTS . " tp ON tt.thread_id = tp.thread_id\n                LEFT JOIN " . DB_FORUM_VOTES . " v ON v.thread_id = tt.thread_id AND tp.post_id = v.post_id\n                LEFT JOIN " . DB_FORUM_ATTACHMENTS . " a1 on a1.thread_id = tt.thread_id AND a1.attach_mime IN ('" . implode(",", img_mimeTypes()) . "')\n\t\t\t\tLEFT JOIN " . DB_FORUM_ATTACHMENTS . " a2 on a2.thread_id = tt.thread_id AND a2.attach_mime NOT IN ('" . implode(",", img_mimeTypes()) . "')\n                WHERE tn.notify_user="******" AND " . groupaccess('forum_access') . " AND tt.thread_hidden='0'\n                GROUP BY tn.thread_id\n                ORDER BY tn.notify_datestamp DESC\n                LIMIT " . $_GET['rowstart'] . ",16\n            ");
    $i = 0;
    while ($threads = dbarray($result)) {
        // opt for moderators.
        $this->forum_info['moderators'] = \PHPFusion\Forums\Moderator::parse_forum_mods($threads['forum_mods']);
        $icon = "";
        $match_regex = $threads['thread_id'] . "\\|" . $threads['thread_lastpost'] . "\\|" . $threads['forum_id'];
        if ($threads['thread_lastpost'] > $this->forum_info['lastvisited']) {
            if (iMEMBER && ($threads['thread_lastuser'] == $userdata['user_id'] || preg_match("(^\\.{$match_regex}\$|\\.{$match_regex}\\.|\\.{$match_regex}\$)", $userdata['user_threads']))) {
                $icon = "<i class='" . get_forumIcons('thread') . "' title='" . $locale['forum_0261'] . "'></i>";
            } else {
                $icon = "<i class='" . get_forumIcons('new') . "' title='" . $locale['forum_0260'] . "'></i>";
            }
        }
        $author = array('user_id' => $threads['thread_author'], 'user_name' => $threads['author_name'], 'user_status' => $threads['author_status'], 'user_avatar' => $threads['author_avatar']);
        $lastuser = array('user_id' => $threads['thread_lastuser'], 'user_name' => $threads['last_user_name'], 'user_status' => $threads['last_user_status'], 'user_avatar' => $threads['last_user_avatar']);
Exemplo n.º 17
0
function jump_to_forum($forum_id)
{
    global $fdata, $testaccess;
    $jump_list = "";
    $sel = "";
    $result = dbquery("SELECT f.forum_id, f.forum_parent, f2.forum_name AS forum_cat_name FROM " . DB_FORUMS . " f\r\n\tLEFT JOIN " . DB_FORUMS . " f2 ON f2.forum_id=f.forum_id\r\n\tWHERE " . groupaccess('f.forum_access', $testaccess) . " AND f2.forum_parent='{$forum_id}'");
    while ($data = dbarray($result)) {
        if (URL_REWRITE) {
            $value = $data['forum_id'] . "-" . clean_subject_urlrewrite($data['forum_cat_name']);
        } else {
            $value = $data['forum_id'];
        }
        // Pimped for make_url (for javascript
        $sel = $data['forum_id'] == $fdata['forum_id'] ? " selected='selected'" : "";
        // Pimped: --> Forum-Cats and make_url (for javascript)
        $jump_list .= "<option value='" . $value . "'{$sel}>&nbsp;&nbsp;-" . $data['forum_cat_name'] . "</option>\n";
    }
    return $jump_list;
}
Exemplo n.º 18
0
    redirect(BASEDIR . "index.php");
}
require_once THEMES . "templates/header.php";
if (!isset($lastvisited) || !isnum($lastvisited)) {
    $lastvisited = time();
}
add_to_title($locale['global_200'] . $locale['global_043']);
opentable($locale['global_043']);
$result = dbquery("SELECT tp.post_id FROM " . DB_FORUM_POSTS . " tp\r\n\tLEFT JOIN " . DB_FORUMS . " tf ON tp.forum_id = tf.forum_id\r\n\tLEFT JOIN " . DB_FORUM_THREADS . " tt ON tp.thread_id = tt.thread_id\r\n\t" . (multilang_table("FO") ? "WHERE tf.forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('tf.forum_access') . " AND tp.post_hidden='0' AND tt.thread_hidden='0' AND (tp.post_datestamp > " . $lastvisited . " OR tp.post_edittime > " . $lastvisited . ")");
$rows = dbrows($result);
$threads = 0;
if ($rows) {
    if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
        $_GET['rowstart'] = 0;
    }
    $result = dbquery("SELECT tp.forum_id, tp.thread_id, tp.post_id, tp.post_author, IF(tp.post_datestamp>tp.post_edittime, tp.post_datestamp, tp.post_edittime) AS post_timestamp,\r\n\t\ttf.forum_name, tf.forum_access, tt.thread_subject, tu.user_id, tu.user_name, tu.user_status\r\n\t\tFROM " . DB_FORUM_POSTS . " tp\r\n\t\tLEFT JOIN " . DB_FORUMS . " tf ON tp.forum_id = tf.forum_id\r\n\t\tLEFT JOIN " . DB_FORUM_THREADS . " tt ON tp.thread_id = tt.thread_id\r\n\t\tLEFT JOIN " . DB_USERS . " tu ON tp.post_author = tu.user_id\r\n\t\t" . (multilang_table("FO") ? "WHERE tf.forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('tf.forum_access') . " AND tp.post_hidden='0' AND tt.thread_hidden='0' AND (tp.post_datestamp > '" . $lastvisited . "' OR tp.post_edittime > '" . $lastvisited . "')\r\n\t\tGROUP BY tp.thread_id\r\n\t\tORDER BY post_timestamp DESC LIMIT " . $_GET['rowstart'] . ",20");
    $i = 0;
    echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
    echo "<td width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['global_048'] . "</strong></td>\n";
    echo "<td class='tbl2'><strong>" . $locale['global_044'] . "</strong></td>\n";
    echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_050'] . "</strong></td>\n";
    echo "</tr>\n";
    $threads = dbrows($result);
    while ($data = dbarray($result)) {
        if ($i % 2 == 0) {
            $row_color = "tbl1";
        } else {
            $row_color = "tbl2";
        }
        echo "<tr>\n";
        echo "<td width='1%' class='" . $row_color . "' style='white-space:nowrap'>" . $data['forum_name'] . "</td>\n";
         if ($_GET['fields'] == 2) {
             $fieldsvar = search_fieldsvar($ssubject, $smessage);
         } else {
             $fieldsvar = "";
         }
     }
 }
 if ($fieldsvar) {
     $result = dbquery("SELECT * FROM " . DB_CUSTOM_PAGES . " WHERE " . groupaccess('page_access') . " AND " . $fieldsvar);
     $rows = dbrows($result);
 } else {
     $rows = 0;
 }
 if ($rows != 0) {
     $items_count .= THEME_BULLET . "&nbsp;<a href='" . FUSION_SELF . "?stype=custompages&amp;stext=" . $_GET['stext'] . "&amp;" . $composevars . "'>" . $rows . " " . ($rows == 1 ? $locale['c401'] : $locale['c402']) . " " . $locale['522'] . "</a><br />\n";
     $result = dbquery("SELECT * FROM " . DB_CUSTOM_PAGES . "\n\t\t\tWHERE " . groupaccess('page_access') . " AND " . $fieldsvar . "\n\t\t\tORDER BY " . $sortby . " " . ($_GET['order'] == 1 ? "ASC" : "DESC") . ($_GET['stype'] != "all" ? " LIMIT " . $_GET['rowstart'] . ",10" : ""));
     while ($data = dbarray($result)) {
         $search_result = "";
         $text_all = stripslashes($data['page_content']);
         ob_start();
         eval("?>" . $text_all . "<?php ");
         $text_all = ob_get_contents();
         ob_end_clean();
         $text_all = search_striphtmlbbcodes($text_all);
         $text_frag = search_textfrag($text_all);
         $subj_c = search_stringscount($data['page_title']);
         $text_c = search_stringscount($text_all);
         // $text_frag = highlight_words($swords, $text_frag);
         $search_result .= "<a href='viewpage.php?page_id=" . $data['page_id'] . "'>" . $data['page_title'] . "</a>" . "<br /><br />\n";
         // $search_result .= "<a href='viewpage.php?page_id=".$data['page_id']."'>".highlight_words($swords, $data['page_title'])."</a>"."<br /><br />\n";
         $search_result .= "<div class='quote' style='width:auto;height:auto;overflow:auto'>" . $text_frag . "</div><br />\n";
Exemplo n.º 20
0
        while ($parent_data = dbarray($parent_result)) {
            $i--;
            if ($parent_data['forum_id'] != $data['forum_id']) {
                echo "<a href='" . FORUM . "viewforum.php?forum_id=" . $parent_data['forum_id'] . "'>" . $parent_data['forum_name'] . "</a>\n";
                if ($i > 0) {
                    echo " , ";
                }
            }
        }
        echo "</td>\n";
        echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>" . ($threadcount == 0 ? "0" : $threadcount) . "</td>\n";
        echo "<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>" . ($postcount == 0 ? "0" : $postcount) . "</td>\n";
        echo "<td width='1%' class='tbl2' style='white-space:nowrap'>";
        $post = dbarray(dbquery("SELECT max(forum_lastpost) as lastpost FROM " . DB_FORUMS . " WHERE " . groupaccess('forum_access') . " AND forum_parent='" . $data['forum_id'] . "'"));
        $condition = $data['forum_lastpost'] > $post['lastpost'] ? $data['forum_lastpost'] : $post['lastpost'];
        $post_data = dbarray(dbquery("SELECT forum_lastpost, forum_lastuser, user_name, user_status FROM " . DB_FORUMS . " LEFT JOIN " . DB_USERS . " ON forum_lastuser=user_id WHERE " . groupaccess('forum_access') . " AND forum_lastpost='" . $condition . "'"));
        if ($post_data['forum_lastpost'] == 0) {
            echo $locale['405'] . "</td>\n</tr>\n";
        } else {
            echo showdate("forumdate", $post_data['forum_lastpost']) . "<br />\n";
            echo "<span class='small'>" . $locale['406'] . profile_link($post_data['forum_lastuser'], $post_data['user_name'], $post_data['user_status']) . "</span></td>\n";
            echo "</tr>\n";
        }
        //subforums end
    }
} else {
    echo "<tr>\n<td colspan='5' class='tbl1'>" . $locale['407'] . "</td>\n</tr>\n";
}
echo "</table><!--sub_forum_idx_table-->\n<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td class='forum'><br />\n";
echo "<img src='" . get_image("foldernew") . "' alt='" . $locale['560'] . "' style='vertical-align:middle;' /> - " . $locale['409'] . "<br />\n";
Exemplo n.º 21
0
         if ($_GET['fields'] == 2) {
             $fieldsvar = search_fieldsvar($ssubject, $smessage);
         } else {
             $fieldsvar = "";
         }
     }
 }
 if ($fieldsvar) {
     $result = dbquery("SELECT tp.forum_id, tp.thread_id, tp.post_id, tp.post_message, tt.thread_subject,\r\n\t\t\ttf.forum_access FROM " . DB_POSTS . " tp\r\n\t\t\tLEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = tp.forum_id\r\n\t\t\tLEFT JOIN " . DB_THREADS . " tt ON tt.thread_id = tp.thread_id\t\t\t\r\n\t\t\tWHERE " . groupaccess('forum_access') . ($_GET['forum_id'] != 0 ? " AND tf.forum_id=" . $_GET['forum_id'] : "") . "\r\n\t\t\tAND " . $fieldsvar . ($_GET['datelimit'] != 0 ? " AND post_datestamp>=" . (time() - $_GET['datelimit']) : ""));
     $rows = dbrows($result);
 } else {
     $rows = 0;
 }
 if ($rows) {
     $items_count .= THEME_BULLET . "&nbsp;<a href='" . FUSION_SELF . "?stype=forums&amp;stext=" . $_GET['stext'] . "&amp;" . $composevars . "'>" . $rows . " " . ($rows == 1 ? $locale['f402'] : $locale['f403']) . " " . $locale['522'] . "</a><br  />\n";
     $result = dbquery("SELECT tp.forum_id, tp.thread_id, tp.post_id, tp.post_message, tp.post_datestamp, tt.thread_subject,\r\n\t\t\ttt.thread_sticky, tf.forum_access, tu.user_id, tu.user_name, tu.user_status FROM " . DB_POSTS . " tp\r\n\t\t\tLEFT JOIN " . DB_THREADS . " tt ON tp.thread_id = tt.thread_id\r\n\t\t\tLEFT JOIN " . DB_FORUMS . " tf ON tp.forum_id = tf.forum_id\r\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON tp.post_author=tu.user_id\r\n\t\t\tWHERE " . groupaccess('forum_access') . ($_GET['forum_id'] != 0 ? " AND tf.forum_id=" . $_GET['forum_id'] : "") . "\r\n\t\t\tAND " . $fieldsvar . ($_GET['datelimit'] != 0 ? " AND post_datestamp>=" . (time() - $_GET['datelimit']) : "") . "\r\n\t\t\tORDER BY " . $sortby . " " . ($_GET['order'] == 1 ? "ASC" : "DESC") . ($_GET['stype'] != "all" ? " LIMIT " . $_GET['rowstart'] . ",10" : ""));
     while ($data = dbarray($result)) {
         $search_result = "";
         $text_all = search_striphtmlbbcodes(iADMIN ? $data['post_message'] : preg_replace("#\\[hide\\](.*)\\[/hide\\]#si", "", $data['post_message']));
         $text_frag = search_textfrag($text_all);
         $subj_c = search_stringscount($data['thread_subject']);
         $text_c = search_stringscount($data['post_message']);
         // $text_frag = highlight_words($swords, $text_frag);
         $search_result .= ($data['thread_sticky'] == 1 ? "<strong>" . $locale['f404'] . "</strong> " : "") . "<a href='" . FORUM . "viewthread.php?thread_id=" . $data['thread_id'] . "&amp;highlight=" . urlencode($_GET['stext']) . "&amp;pid=" . $data['post_id'] . "#post_" . $data['post_id'] . "'>" . $data['thread_subject'] . "</a>" . "<br  /><br  />\n";
         // $search_result .= ($data['thread_sticky'] == 1 ? "<strong>".$locale['f404']."</strong> " : "")."<a href='".FORUM."viewthread.php?thread_id=".$data['thread_id']."&amp;highlight=".urlencode($_GET['stext'])."&amp;pid=".$data['post_id']."#post_".$data['post_id']."'>".highlight_words($swords, $data['thread_subject'])."</a>"."<br  /><br  />\n";
         $search_result .= "<div class='quote' style='width:auto;height:auto;overflow:auto'>" . $text_frag . "</div><br  />";
         $search_result .= "<span class='small2'>" . $locale['global_070'] . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "\n";
         $search_result .= $locale['global_071'] . showdate("longdate", $data['post_datestamp']) . "</span><br  />\n";
         $search_result .= "<span class='small'>" . $subj_c . " " . ($subj_c == 1 ? $locale['520'] : $locale['521']) . " " . $locale['f406'] . " " . $locale['f407'] . ", ";
         $search_result .= $text_c . " " . ($text_c == 1 ? $locale['520'] : $locale['521']) . " " . $locale['f406'] . " " . $locale['f408'] . "</span><br  /><br  />\n";
         search_globalarray($search_result);
Exemplo n.º 22
0
require_once THEMES . "templates/header.php";
if (!iMEMBER) {
    redirect("../../index.php");
}
if (isset($_GET['delete']) && isnum($_GET['delete']) && dbcount("(thread_id)", DB_THREAD_NOTIFY, "thread_id='" . $_GET['delete'] . "' AND notify_user='******'user_id'] . "'")) {
    $result = dbquery("DELETE FROM " . DB_THREAD_NOTIFY . " WHERE thread_id=" . $_GET['delete'] . " AND notify_user="******"SELECT tn.thread_id FROM " . DB_THREAD_NOTIFY . " tn\n\tINNER JOIN " . DB_THREADS . " tt ON tn.thread_id = tt.thread_id\n\tINNER JOIN " . DB_FORUMS . " tf ON tt.forum_id = tf.forum_id\n\tWHERE tn.notify_user="******" AND " . groupaccess('forum_access') . " AND tt.thread_hidden='0'");
$rows = dbrows($result);
if ($rows) {
    $result = dbquery("\n\t\tSELECT tf.forum_access, tn.thread_id, tn.notify_datestamp, tn.notify_user,\n\t\ttt.thread_subject, tt.forum_id, tt.thread_lastpost, tt.thread_lastuser, tt.thread_postcount,\n\t\ttu.user_id AS user_id1, tu.user_name AS user_name1, tu.user_status AS user_status1, \n\t\ttu2.user_id AS user_id2, tu2.user_name AS user_name2, tu2.user_status AS user_status2\n\t\tFROM " . DB_THREAD_NOTIFY . " tn\n\t\tINNER JOIN " . DB_THREADS . " tt ON tn.thread_id = tt.thread_id\n\t\tINNER JOIN " . DB_FORUMS . " tf ON tt.forum_id = tf.forum_id\n\t\tLEFT JOIN " . DB_USERS . " tu ON tt.thread_author = tu.user_id\n\t\tLEFT JOIN " . DB_USERS . " tu2 ON tt.thread_lastuser = tu2.user_id\n\t\tINNER JOIN " . DB_POSTS . " tp ON tt.thread_id = tp.thread_id\n\t\tWHERE tn.notify_user="******" AND " . groupaccess('forum_access') . " AND tt.thread_hidden='0'\n\t\tGROUP BY tn.thread_id\n\t\tORDER BY tn.notify_datestamp DESC\n\t\tLIMIT " . $_GET['rowstart'] . ",10\n\t");
    echo "<table class='tbl-border' cellpadding='0' cellspacing='1' width='100%'>\n<tr>\n";
    echo "<td class='tbl2'><strong>" . $locale['global_044'] . "</strong></td>\n";
    echo "<td class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_050'] . "</strong></td>\n";
    echo "<td class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_047'] . "</strong></td>\n";
    echo "<td class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_046'] . "</strong></td>\n";
    echo "<td class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_057'] . "</strong></td>\n";
    echo "</tr>\n";
    $i = 0;
    while ($data = dbarray($result)) {
        $row_color = $i % 2 == 0 ? "tbl1" : "tbl2";
        echo "<tr>\n<td class='" . $row_color . "'><a href='" . FORUM . "viewthread.php?thread_id=" . $data['thread_id'] . "'>" . $data['thread_subject'] . "</a></td>\n";
        echo "<td class='" . $row_color . "' style='text-align:center;white-space:nowrap'>" . profile_link($data['user_id1'], $data['user_name1'], $data['user_status1']) . "</td>\n";
        echo "<td class='" . $row_color . "' style='text-align:center;white-space:nowrap'>" . profile_link($data['user_id2'], $data['user_name2'], $data['user_status2']) . "<br />\n\t\t" . showdate("forumdate", $data['thread_lastpost']) . "</td>\n";
        echo "<td class='" . $row_color . "' style='text-align:center;white-space:nowrap'>" . ($data['thread_postcount'] - 1) . "</td>\n";
        echo "<td class='" . $row_color . "' style='text-align:center;white-space:nowrap'><a href='" . FUSION_SELF . "?delete=" . $data['thread_id'] . "' onclick=\"return confirm('" . $locale['global_060'] . "');\">" . $locale['global_058'] . "</a></td>\n";
Exemplo n.º 23
0
         case "C":
             $access = dbcount("(page_id)", DB_CUSTOM_PAGES, "page_id='" . $data['comment_item_id'] . "' AND " . groupaccess('page_access'));
             if ($access > 0) {
                 $comment = trimlink($data['comment_message'], 23);
                 $commentStart = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $data['comment_item_id'] . "' AND comment_type='C' AND comment_id<=" . $data['comment_id']);
                 if ($commentStart > $settings['comments_per_page']) {
                     $commentStart = "&amp;c_start=" . floor($commentStart / $settings['comments_per_page']) * $settings['comments_per_page'];
                 } else {
                     $commentStart = "";
                 }
                 $output .= THEME_BULLET . " <a href='" . BASEDIR . "viewpage.php?page_id=" . $data['comment_item_id'] . $commentStart . "#c" . $data['comment_id'] . "' title='" . $comment . "' class='side'>" . $comment . "</a><br />\n";
                 $i++;
             }
             continue;
         case "D":
             $access = dbquery("\tSELECT download_id FROM " . DB_DOWNLOADS . " d, " . DB_DOWNLOAD_CATS . " c WHERE\n\t\t\t\t\t\t\t\t\td.download_id='" . $data['comment_item_id'] . "' AND\n\t\t\t\t\t\t\t\t\td.download_cat=c.download_cat_id AND\n\t\t\t\t\t\t\t\t\t" . groupaccess('c.download_cat_access'));
             if (dbrows($access) > 0) {
                 $comment = trimlink($data['comment_message'], 23);
                 $commentStart = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='" . $data['comment_item_id'] . "' AND comment_type='D' AND comment_id<=" . $data['comment_id']);
                 if ($commentStart > $settings['comments_per_page']) {
                     $commentStart = "&amp;c_start=" . floor($commentStart / $settings['comments_per_page']) * $settings['comments_per_page'];
                 } else {
                     $commentStart = "";
                 }
                 $output .= THEME_BULLET . " <a href='" . BASEDIR . "downloads.php?download_id=" . $data['comment_item_id'] . $commentStart . "#c" . $data['comment_id'] . "' title='" . $comment . "' class='side'>" . $comment . "</a><br />\n";
                 $i++;
             }
             continue;
     }
 }
 echo $output;
Exemplo n.º 24
0
        echo "</script>\n";
    }
}
if ($rows > $threads_per_page || iMEMBER && $can_post) {
    echo "<table cellspacing='0' cellpadding='0' width='100%'>\n<tr>\n";
    if ($rows > $threads_per_page) {
        echo "<td style='padding-top:5px'>" . makePageNav($_GET['rowstart'], $threads_per_page, $rows, 3, FUSION_SELF . "?forum_id=" . $_GET['forum_id'] . "&amp;") . "</td>\n";
    }
    if (iMEMBER && $can_post) {
        echo "<td align='right' style='padding-top:5px'><a href='post.php?action=newthread&amp;forum_id=" . $_GET['forum_id'] . "'><img src='" . get_image("newthread") . "' alt='" . $locale['566'] . "' style='border:0px;' /></a></td>\n";
    }
    echo "</tr>\n</table>\n";
}
$forum_list = "";
$current_cat = "";
$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";
Exemplo n.º 25
0
}
opentable("---> " . $title . "");
if ($kroaxsettings['kroax_set_keepalive'] == "1") {
    echo "<div id ='onlinestatus'>";
    echo '<div style="height: 30px;"><em><IMG SRC="/infusions/the_kroax/img/loading.gif">' . $locale['MKROAX116'] . '</em></div>';
    echo '</div>';
}
if (!isset($p)) {
    makeheader();
    echo "<div id='lajv'>";
    echo "</div>";
}
if ($kroaxsettings['kroax_set_related'] == "1") {
    echo " <table width='120px;' align='left'>";
    echo "<tr width='15%'><td class ='tbl2' width='15%' align='center'>" . $locale['MKROAX105'] . "</td></tr>";
    $relresult = dbquery("select * from " . $db_prefix . "kroax WHERE " . groupaccess('kroax_access') . " AND " . groupaccess('kroax_access_cat') . " AND kroax_cat='" . $data['kroax_cat'] . "' AND kroax_approval='' ORDER BY RAND() DESC LIMIT 0,5");
    while ($reldata = dbarray($relresult)) {
        echo "<tr><td align='center' class='tbl2'>";
        $rtype = substr($reldata['kroax_url'], -3, 3);
        if ($rtype == "mp3") {
            $showimg = "<img src='" . INFUSIONS . "the_kroax/img/musicstream.jpg' width='50' height='30'>";
        } elseif ($reldata['kroax_tumb']) {
            $showimg = "<IMG SRC='" . $reldata['kroax_tumb'] . "' width='70' height='50'>";
        } else {
            $showimg = "<img src='" . INFUSIONS . "the_kroax/img/nopic.gif' width='70' height='50'>";
        }
        if (!isset($p)) {
            $videolink = '<a href="' . INFUSIONS . 'the_kroax/embed.php?url=' . $reldata['kroax_id'] . '">';
        } else {
            $videolink = '<a href="#" onclick=window.open("' . INFUSIONS . 'the_kroax/embed.php?p=1&url=' . $reldata['kroax_id'] . '","Click","scrollbars=yes,resizable=yes,width=800,height=600")>';
        }
         if ($_GET['fields'] == 2) {
             $fieldsvar = search_fieldsvar($ssubject, $ssnippet, $smessage);
         } else {
             $fieldsvar = "";
         }
     }
 }
 if ($fieldsvar) {
     $result = dbquery("SELECT ta.*,tac.* FROM " . DB_ARTICLES . " ta\r\n\t\t\tINNER JOIN " . DB_ARTICLE_CATS . " tac ON ta.article_cat=tac.article_cat_id\r\n\t\t\tWHERE " . groupaccess('article_cat_access') . " AND " . $fieldsvar . "\r\n\t\t\t" . ($_GET['datelimit'] != 0 ? " AND article_datestamp>=" . (time() - $_GET['datelimit']) : ""));
     $rows = dbrows($result);
 } else {
     $rows = 0;
 }
 if ($rows != 0) {
     $items_count .= THEME_BULLET . "&nbsp;<a href='" . FUSION_SELF . "?stype=articles&amp;stext=" . $_GET['stext'] . "&amp;" . $composevars . "'>" . $rows . " " . ($rows == 1 ? $locale['a401'] : $locale['a402']) . " " . $locale['522'] . "</a><br />\n";
     $result = dbquery("SELECT ta.*,tac.*, tu.user_id, tu.user_name, tu.user_status FROM " . DB_ARTICLES . " ta\r\n\t\t\tINNER JOIN " . DB_ARTICLE_CATS . " tac ON ta.article_cat=tac.article_cat_id\r\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON ta.article_name=tu.user_id\r\n\t\t\tWHERE " . groupaccess('article_cat_access') . " AND " . $fieldsvar . "\r\n\t\t\t" . ($_GET['datelimit'] != 0 ? " AND article_datestamp>=" . (time() - $_GET['datelimit']) : "") . "\r\n\t\t\tORDER BY " . $sortby . " " . ($_GET['order'] != 1 ? "ASC" : "DESC") . ($_GET['stype'] != "all" ? " LIMIT " . $_GET['rowstart'] . ",10" : ""));
     while ($data = dbarray($result)) {
         $search_result = "";
         $text_all = search_striphtmlbbcodes($data['article_snippet'] . " " . $data['article_article']);
         $text_frag = search_textfrag($text_all);
         $subj_c = search_stringscount($data['article_subject']);
         $text_c = search_stringscount($data['article_snippet'] . " " . $data['article_article']);
         $text_frag = highlight_words($swords, $text_frag);
         $search_result .= "<a href='articles.php?article_id=" . $data['article_id'] . "'>" . highlight_words($swords, $data['article_subject']) . "</a>" . "<br /><br />\n";
         $search_result .= "<div class='quote' style='width:auto;height:auto;overflow:auto'>" . $text_frag . "</div><br />";
         $search_result .= "<span class='small2'>" . $locale['global_070'] . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "\n";
         $search_result .= $locale['global_071'] . showdate("longdate", $data['article_datestamp']) . "</span><br />\n";
         $search_result .= "<span class='small'>" . $subj_c . " " . ($subj_c == 1 ? $locale['520'] : $locale['521']) . " " . $locale['522'] . " " . $locale['a404'] . ", ";
         $search_result .= $text_c . " " . ($text_c == 1 ? $locale['520'] : $locale['521']) . " " . $locale['522'] . " " . $locale['a405'] . "</span><br /><br />\n";
         search_globalarray($search_result);
     }
Exemplo n.º 27
0
if (file_exists(INFUSIONS . "fusionboard4/locale/" . $settings['locale'] . ".php")) {
    include INFUSIONS . "fusionboard4/locale/" . $settings['locale'] . ".php";
} else {
    include INFUSIONS . "fusionboard4/locale/English.php";
}
if (!iMEMBER) {
    redirect("../../index.php");
}
add_to_title($locale['global_200'] . $locale['global_042']);
$result = dbquery("SELECT COUNT(post_id) FROM " . DB_POSTS . " tp\n\tINNER JOIN " . DB_FORUMS . " tf ON tp.forum_id=tf.forum_id\n\tWHERE " . groupaccess('tf.forum_access') . " AND post_author='" . $userdata['user_id'] . "'\n\tORDER BY tp.post_datestamp DESC LIMIT 100");
$rows = dbrows($result);
if ($rows) {
    if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
        $_GET['rowstart'] = 0;
    }
    $result = dbquery("SELECT tp.forum_id, tp.thread_id, tp.post_id, tp.post_author, tp.post_datestamp,\n\t\ttf.forum_name, tf.forum_access, tt.thread_subject\n\t\tFROM " . DB_POSTS . " tp\n\t\tINNER JOIN " . DB_FORUMS . " tf ON tp.forum_id=tf.forum_id\n\t\tINNER JOIN " . DB_THREADS . " tt ON tp.thread_id=tt.thread_id\n\t\tWHERE " . groupaccess('tf.forum_access') . " AND tp.post_author='" . $userdata['user_id'] . "'\n\t\tORDER BY tp.post_datestamp DESC LIMIT " . $_GET['rowstart'] . ",20");
    $i = 0;
    opentable($locale['global_042']);
    echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl-border'>\n<tr>\n";
    echo "<td width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['global_048'] . "</strong></td>\n";
    echo "<td width='100%' class='tbl2'><strong>" . $locale['global_044'] . "</strong></td>\n";
    echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['global_049'] . "</strong></td>\n";
    echo "</tr>\n";
    while ($data = dbarray($result)) {
        if ($i % 2 == 0) {
            $row_color = "tbl1";
        } else {
            $row_color = "tbl2";
        }
        echo "<tr>\n";
        echo "<td width='1%' class='" . $row_color . "' style='white-space:nowrap'>" . trimlink($data['forum_name'], 30) . "</td>\n";
Exemplo n.º 28
0
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once THEMES . "templates/header.php";
include LOCALE . LOCALESET . "forum/main.php";
if (!isset($lastvisited) || !isnum($lastvisited)) {
    $lastvisited = time();
}
add_to_title($locale['global_200'] . $locale['400']);
opentable($locale['400']);
echo "<!--pre_forum_idx--><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_idx_table'>\n";
$forum_list = "";
$current_cat = "";
$result = dbquery("SELECT f.*, f2.forum_name AS forum_cat_name, u.user_id, u.user_name, u.user_status\n\tFROM " . DB_FORUMS . " f\n\tLEFT JOIN " . DB_FORUMS . " f2 ON f.forum_cat = f2.forum_id\n\tLEFT JOIN " . DB_USERS . " u ON f.forum_lastuser = u.user_id\n\tWHERE " . groupaccess('f.forum_access') . " AND f.forum_cat!='0'\n\tGROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC");
if (dbrows($result) != 0) {
    while ($data = dbarray($result)) {
        if ($data['forum_cat_name'] != $current_cat) {
            $current_cat = $data['forum_cat_name'];
            echo "<tr>\n<td colspan='2' class='forum-caption forum_cat_name'><!--forum_cat_name-->" . $data['forum_cat_name'] . "</td>\n";
            echo "<td align='center' width='1%' class='forum-caption' style='white-space:nowrap'>" . $locale['402'] . "</td>\n";
            echo "<td align='center' width='1%' class='forum-caption' style='white-space:nowrap'>" . $locale['403'] . "</td>\n";
            echo "<td width='1%' class='forum-caption' style='white-space:nowrap'>" . $locale['404'] . "</td>\n";
            echo "</tr>\n";
        }
        $moderators = "";
        if ($data['forum_moderators']) {
            $mod_groups = explode(".", $data['forum_moderators']);
            foreach ($mod_groups as $mod_group) {
                if ($moderators) {
Exemplo n.º 29
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();
Exemplo n.º 30
0
     }
     echo "<table cellpadding='0' cellspacing='1' width='100%'>\n<tr>\n";
     while ($data = dbarray($result)) {
         if ($counter != 0 && $counter % $settings['thumbs_per_row'] == 0) {
             echo "</tr>\n<tr>\n";
         }
         echo "<td align='center' valign='top' class='tbl'>\n";
         echo "<strong>" . $data['album_title'] . "</strong><br /><br />\n<a href='" . make_url(BASEDIR . FUSION_SELF . "?album_id=" . $data['album_id'], BASEDIR . "photogallery-album-" . $data['album_id'] . "-", $data['album_title'], ".html") . "'>";
         if ($data['album_thumb'] && file_exists(PHOTOS . $data['album_thumb'])) {
             echo "<img src='" . PHOTOS . $data['album_thumb'] . "' alt='" . $data['album_thumb'] . "' title='" . $locale['401'] . "' style='border:0px' />";
         } elseif (file_exists(PHOTOS . "nophoto.jpg")) {
             echo "<img src='" . PHOTOS . "nophoto.jpg' alt='" . $locale['402'] . "' title='" . $locale['402'] . "' style='border:0px' />";
         } else {
             echo $locale['402'];
         }
         $sub_articles = dbcount("(album_id)", DB_PHOTO_ALBUMS, groupaccess('album_access') . " AND album_parent='" . $data['album_id'] . "'");
         echo "</a><br /><br />\n<span class='small'>\n";
         echo $locale['407'] . ": " . $sub_articles . "<br />";
         echo $locale['403'] . showdate("shortdate", $data['album_datestamp']) . "<br />\n";
         echo $locale['404'] . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "<br />\n";
         echo $locale['405'] . dbcount("(photo_id)", DB_PHOTOS, "album_id='" . $data['album_id'] . "'") . "</span><br />\n";
         echo "</td>\n";
         $counter++;
         $k++;
     }
     echo "</tr>\n</table>\n";
     closetable();
     if ($rows > $settings['thumbs_per_page']) {
         echo "<div align='center' style='margin-top:5px;'>\n" . pagination(true, $_GET['rowstart'], $settings['thumbs_per_page'], $rows, 3, "", "photogallery", "", "", "-", "", "") . "\n</div>\n";
     }
 } else {