예제 #1
0
// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
//
require_once "../lib-common.php";
require_once $_CONF['path_html'] . 'forum/include/gf_format.php';
require_once $_CONF['path_html'] . 'forum/include/gf_showtopic.php';
require_once $_CONF['path'] . 'plugins/forum/debug.php';
// Common Debug Code
// Display Common headers
gf_siteHeader();
// Check for access privilege and pass true to check that user is signed in.
forum_chkUsercanAccess(true);
$forum = COM_applyFilter($_REQUEST['forum'], true);
$showtopic = COM_applyFilter($_REQUEST['showtopic'], true);
ForumHeader($forum, $showtopic);
// Pass thru filter any get or post variables to only allow numeric values and remove any hostile data
$fortopicid = COM_applyFilter($_REQUEST['fortopicid'], true);
$moveid = COM_applyFilter($_REQUEST['moveid'], true);
$top = COM_applyFilter($_REQUEST['top']);
$movetoforum = COM_applyFilter($_REQUEST['movetoforum'], true);
$msgid = COM_applyFilter($_REQUEST['msgid'], true);
$msgpid = COM_applyFilter($_REQUEST['msgpid'], true);
$fortopicid = COM_applyFilter($_REQUEST['fortopicid'], true);
$modfunction = COM_applyFilter($_REQUEST['modfunction']);
$submit = $_POST['submit'];
if ($forum == 0) {
    alertMessage($LANG_GF02['msg71']);
    exit;
}
if (forum_modPermission($forum, $_USER['uid'])) {
예제 #2
0
파일: index.php 프로젝트: ivywe/forum
        // Delete all individual topic notification records
        DB_query("DELETE FROM {$_TABLES['forum_watch']} WHERE uid='{$_USER['uid']}' AND forum_id='{$forum}' and topic_id > '0' ");
        $display = COM_refresh($_CONF['site_url'] . '/forum/index.php?msg=1&forum=' . $forum);
        COM_output($display);
        exit;
    } else {
        $display .= alertMessage($LANG_GF02['msg136'], $LANG_GF01['ERROR']);
    }
    $display = gf_createHTMLDocument($display);
    COM_output($display);
    exit;
}
// MAIN CODE BEGINS to view forums or topics within a forum
isset($showtopic) or $showtopic = '';
// FIXME
ForumHeader($forum, $showtopic, $display);
// Check if the number of records was specified to show - part of page navigation.
// Will be 0 if not set - as I'm now passing this tru gf_applyFilte() at top of script
if ($show == 0 and $CONF_FORUM['show_topics_perpage'] > 0) {
    $show = $CONF_FORUM['show_topics_perpage'];
} elseif ($show == 0) {
    $show = 20;
}
if ($forum > 0) {
    $addforumvar = "&forum=" . $forum;
    $topicCount = DB_count($_TABLES['forum_topic'], array('pid', 'forum'), array(0, $forum));
} else {
    $topicCount = DB_count($_TABLES['forum_topic'], 'pid', 0);
}
$numpages = ceil($topicCount / $show);
if ($numpages == 0) {