mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 05:07:27 +02:00
Forum: minor code clean-up
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
* Copyright (C) 2008-2014 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
require_once ('../../class2.php');
|
require_once ('../../class2.php');
|
||||||
define('NAVIGATION_ACTIVE','forum');
|
define('NAVIGATION_ACTIVE','forum');
|
||||||
|
|
||||||
$e107 = e107::getInstance();
|
$e107 = e107::getInstance();
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$ns = e107::getRender();
|
$ns = e107::getRender();
|
||||||
@@ -27,6 +28,7 @@ if (isset($_POST['fjsubmit']))
|
|||||||
header('location:' . e107::getUrl()->create('forum/forum/view', array('id'=>(int) $_POST['forumjump']), 'full=1&encode=0'));
|
header('location:' . e107::getUrl()->create('forum/forum/view', array('id'=>(int) $_POST['forumjump']), 'full=1&encode=0'));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$highlight_search = isset($_POST['highlight_search']);
|
$highlight_search = isset($_POST['highlight_search']);
|
||||||
|
|
||||||
if (!e_QUERY)
|
if (!e_QUERY)
|
||||||
@@ -36,23 +38,18 @@ if (!e_QUERY)
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
include_once(e_PLUGIN.'forum/forum_class.php');
|
||||||
|
|
||||||
include_once (e_PLUGIN . 'forum/forum_class.php');
|
|
||||||
|
|
||||||
|
|
||||||
$forum = new e107forum();
|
$forum = new e107forum();
|
||||||
$thread = new e107ForumThread();
|
$thread = new e107ForumThread();
|
||||||
|
|
||||||
|
// check if user wants to download a file
|
||||||
if(vartrue($_GET['id']) && isset($_GET['dl']))
|
if(vartrue($_GET['id']) && isset($_GET['dl']))
|
||||||
{
|
{
|
||||||
$forum->sendFile($_GET);
|
$forum->sendFile($_GET);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(e_AJAX_REQUEST && varset($_POST['action']) == 'quickreply')
|
if(e_AJAX_REQUEST && varset($_POST['action']) == 'quickreply')
|
||||||
{
|
{
|
||||||
$forum->ajaxQuickReply();
|
$forum->ajaxQuickReply();
|
||||||
@@ -63,8 +60,6 @@ if(e_AJAX_REQUEST && MODERATOR) // see javascript above.
|
|||||||
$forum->ajaxModerate();
|
$forum->ajaxModerate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($_GET['last']))
|
if (isset($_GET['last']))
|
||||||
{
|
{
|
||||||
$_GET['f'] = 'last';
|
$_GET['f'] = 'last';
|
||||||
@@ -114,8 +109,7 @@ e107::getScBatch('view', 'forum')->setScVar('forum', $forum);
|
|||||||
//var_dump(e107::getScBatch('forum', 'forum'));
|
//var_dump(e107::getScBatch('forum', 'forum'));
|
||||||
|
|
||||||
|
|
||||||
|
if(MODERATOR && isset($_POST['mod']))
|
||||||
if (MODERATOR && isset($_POST['mod']))
|
|
||||||
{
|
{
|
||||||
require_once(e_PLUGIN."forum/forum_mod.php");
|
require_once(e_PLUGIN."forum/forum_mod.php");
|
||||||
$thread->message = forum_thread_moderate($_POST);
|
$thread->message = forum_thread_moderate($_POST);
|
||||||
@@ -135,7 +129,7 @@ if(count($postList))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$gen = new convert;
|
$gen = new convert;
|
||||||
if ($thread->message)
|
if($thread->message)
|
||||||
{
|
{
|
||||||
//$ns->tablerender('', $thread->message, array('forum_viewtopic', 'msg'));
|
//$ns->tablerender('', $thread->message, array('forum_viewtopic', 'msg'));
|
||||||
e107::getMessage()->add($thread->message);
|
e107::getMessage()->add($thread->message);
|
||||||
@@ -159,25 +153,27 @@ if(e107::isInstalled('poll'))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//Load forum templates
|
//Load forum templates
|
||||||
// FIXME - new template paths!
|
// FIXME - new template paths!
|
||||||
if (file_exists(THEME . 'forum_design.php'))
|
if(file_exists(THEME.'forum_design.php')) // legacy file
|
||||||
{
|
{
|
||||||
include_once (THEME . 'forum_design.php');
|
include_once (THEME.'forum_design.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vartrue($FORUMSTART))
|
if (!vartrue($FORUMSTART))
|
||||||
{
|
{
|
||||||
if (file_exists(THEME . 'forum_viewtopic_template.php'))
|
if(file_exists(THEME.'forum_viewtopic_template.php'))
|
||||||
{
|
{
|
||||||
require_once (THEME . 'forum_viewtopic_template.php');
|
require_once (THEME.'forum_viewtopic_template.php');
|
||||||
}
|
}
|
||||||
elseif (file_exists(THEME . 'forum_template.php'))
|
elseif(file_exists(THEME.'forum_template.php'))
|
||||||
{
|
{
|
||||||
require_once (THEME . 'forum_template.php');
|
require_once(THEME.'forum_template.php');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
require_once (e_PLUGIN . 'forum/templates/forum_viewtopic_template.php');
|
require_once(e_PLUGIN.'forum/templates/forum_viewtopic_template.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,7 +189,6 @@ if(is_array($FORUM_VIEWTOPIC_TEMPLATE) && deftrue('BOOTSTRAP',false))
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// get info for main thread -------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
// get info for main thread -------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
$tVars = new e_vars;
|
$tVars = new e_vars;
|
||||||
$forum->set_crumb(true, '', $tVars); // Set $BREADCRUMB (and BACKLINK)
|
$forum->set_crumb(true, '', $tVars); // Set $BREADCRUMB (and BACKLINK)
|
||||||
|
Reference in New Issue
Block a user