mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
More forum problems fixed, more to do
This commit is contained in:
@@ -1221,7 +1221,7 @@ class e107
|
||||
|
||||
/**
|
||||
* Retrieve online users handler singleton object
|
||||
* @return e_online
|
||||
* @return e_ranks
|
||||
*/
|
||||
public static function getRank()
|
||||
{
|
||||
|
@@ -15,15 +15,18 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
{
|
||||
$parm = ($parm ? $parm : 10);
|
||||
global $LATESTPOSTS_START, $LATESTPOSTS_END, $LATESTPOSTS_POST;
|
||||
|
||||
$txt = $this->e107->tp->parseTemplate($LATESTPOSTS_START, true);
|
||||
$start = max($this->threadInfo['thread_total_replies'] - $parm, 0);
|
||||
$num = min($this->threadInfo['thread_total_replies'], $parm);
|
||||
|
||||
$tmp = $this->forum->postGet($this->threadInfo['thread_id'], $start, $num);
|
||||
|
||||
for($i = count($tmp)-1; $i > 0; $i--)
|
||||
$bach = e107::getScBatch('view', 'forum');
|
||||
for($i = count($tmp); $i > 0; $i--)
|
||||
{
|
||||
setScVar('forum_shortcodes', 'postInfo', $tmp[$i]);
|
||||
$bach->setScVar('postInfo', $tmp[$i-1]);
|
||||
//setScVar('forum_shortcodes', 'postInfo', $tmp[$i]);
|
||||
$txt .= $this->e107->tp->parseTemplate($LATESTPOSTS_POST, true);
|
||||
}
|
||||
$txt .= $this->e107->tp->parseTemplate($LATESTPOSTS_END, true);
|
||||
@@ -34,7 +37,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
{
|
||||
global $THREADTOPIC_REPLY;
|
||||
$tmp = $this->forum->postGet($this->threadInfo['thread_id'], 0, 1);
|
||||
setScVar('forum_shortcodes', 'postInfo', $tmp[0]);
|
||||
e107::getScBatch('view', 'forum')->setScVar('postInfo', $tmp[0]);
|
||||
return $this->e107->tp->parseTemplate($THREADTOPIC_REPLY, true);
|
||||
}
|
||||
|
||||
@@ -125,10 +128,10 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
|
||||
function sc_postthreadas()
|
||||
{
|
||||
global $action, $thread_info;
|
||||
global $action, $threadInfo;
|
||||
if (MODERATOR && $action == "nt")
|
||||
{
|
||||
$thread_sticky = (isset($_POST['threadtype']) ? $_POST['threadtype'] : $thread_info['head']['thread_sticky']);
|
||||
$thread_sticky = (isset($_POST['threadtype']) ? $_POST['threadtype'] : $threadInfo['thread_sticky']); // no reference of 'head' $threadInfo['head']['thread_sticky']
|
||||
return "<br /><span class='defaulttext'>".LAN_400."<input name='threadtype' type='radio' value='0' ".(!$thread_sticky ? "checked='checked' " : "")." />".LAN_1." <input name='threadtype' type='radio' value='1' ".($thread_sticky == 1 ? "checked='checked' " : "")." />".LAN_2." <input name='threadtype' type='radio' value='2' ".($thread_sticky == 2 ? "checked='checked' " : "")." />".LAN_3."</span>";
|
||||
}
|
||||
return '';
|
||||
@@ -136,9 +139,10 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
|
||||
function sc_backlink()
|
||||
{
|
||||
global $forum, $thread_info, $eaction, $action;
|
||||
$_tmp = '';
|
||||
$forum->set_crumb(true, ($action == 'nt' ? ($eaction ? LAN_77 : LAN_60) : ($eaction ? LAN_78 : LAN_406.' '.$thread_info['head']['thread_name'])), $_tmp);
|
||||
global $forum, $threadInfo, $eaction, $action;
|
||||
$_tmp = new e_vars();
|
||||
// no reference of 'head' $threadInfo['head']['thread_name']
|
||||
$forum->set_crumb(true, ($action == 'nt' ? ($eaction ? LAN_77 : LAN_60) : ($eaction ? LAN_78 : LAN_406.' '.$threadInfo['thread_name'])), $_tmp);
|
||||
return $_tmp->BREADCRUMB;
|
||||
}
|
||||
|
||||
@@ -150,7 +154,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
|
||||
function sc_emailnotify()
|
||||
{
|
||||
global $thread_info, $action, $eaction;
|
||||
global $threadInfo, $action, $eaction;
|
||||
|
||||
$pref = e107::getPlugPref('forum');
|
||||
|
||||
@@ -163,9 +167,10 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($thread_info))
|
||||
if(isset($threadInfo))
|
||||
{
|
||||
$chk = ($thread_info['head']['thread_active'] == 99 ? "checked='checked'" : '');
|
||||
// no reference of 'head' $threadInfo['head']['thread_active']
|
||||
$chk = ($threadInfo['thread_active'] == 99 ? "checked='checked'" : '');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -27,8 +27,8 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
|
||||
function sc_threaddatestamp()
|
||||
{
|
||||
global $gen;
|
||||
return "<a id='post_{$this->post_info['post_id']}' href='".$this->e107->url->getUrl('forum', 'thread', array('func' => 'post', 'id' => $this->postInfo['post_id']))."'>".IMAGE_post."</a> ".$gen->convert_date($this->postInfo['post_datestamp'], 'forum');
|
||||
$gen = e107::getDateConvert();
|
||||
return "<a id='post_{$this->postInfo['post_id']}' href='".$this->e107->url->getUrl('forum', 'thread', array('func' => 'post', 'id' => $this->postInfo['post_id']))."'>".IMAGE_post."</a> ".$gen->convert_date($this->postInfo['post_datestamp'], 'forum');
|
||||
}
|
||||
|
||||
function sc_post()
|
||||
@@ -271,6 +271,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
if (!$this->postInfo['post_user']) { return ''; }
|
||||
|
||||
$rankInfo = e107::getRank()->getRanks($this->postInfo['post_user']);
|
||||
// FIXME - level handler!!!
|
||||
|
||||
if(!$parm) { $parm = 'name'; }
|
||||
|
||||
|
@@ -5,7 +5,7 @@ function url_forum_forum($parms)
|
||||
switch($parms['func'])
|
||||
{
|
||||
case 'view':
|
||||
$page = (varset($parms['page']) ? '&p='.$parms['page'] : '');
|
||||
$page = (varset($parms['page']) ? '&p='.$parms['page'] : '');
|
||||
return e_PLUGIN_ABS."forum/forum_viewforum.php?id={$parms['id']}{$page}";
|
||||
break;
|
||||
|
||||
@@ -26,7 +26,7 @@ function url_forum_forum($parms)
|
||||
break;
|
||||
|
||||
case 'mfar':
|
||||
return e_PLUGIN_ABS.'forum/forum.php?f=mfar&id='.$parms['id'];
|
||||
return e_PLUGIN_ABS.'forum/forum.php?f=mfar&id='.$parms['id'];
|
||||
break;
|
||||
|
||||
}
|
||||
|
@@ -6,65 +6,65 @@ function url_forum_thread($parms)
|
||||
{
|
||||
|
||||
case 'nt':
|
||||
return e_PLUGIN_ABS."forum/forum_post.php?f=nt&id={$parms['id']}";
|
||||
return e_PLUGIN_ABS."forum/forum_post.php?f=nt&id={$parms['id']}";
|
||||
break;
|
||||
|
||||
case 'rp':
|
||||
return e_PLUGIN_ABS."forum/forum_post.php?f=rp&id={$parms['id']}";
|
||||
return e_PLUGIN_ABS."forum/forum_post.php?f=rp&id={$parms['id']}";
|
||||
break;
|
||||
|
||||
case 'view':
|
||||
$page = (varset($parms['page']) ? '&p='.$parms['page'] : '');
|
||||
$page = (varset($parms['page']) ? '&p='.$parms['page'] : '');
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?id={$parms['id']}{$page}";
|
||||
break;
|
||||
|
||||
case 'last':
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?id={$parms['id']}&last=1";
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?id={$parms['id']}&last=1";
|
||||
break;
|
||||
|
||||
case 'post':
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=post&id={$parms['id']}";
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=post&id={$parms['id']}";
|
||||
break;
|
||||
|
||||
case 'report':
|
||||
$page = (isset($parms['page']) ? (int)$parms['page'] : 0 );
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=report&id={$parms['id']}&post={$parms['post']}&p={$page}";
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=report&id={$parms['id']}&post={$parms['post']}&p={$page}";
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
return e_PLUGIN_ABS."forum/forum_post.php?f=edit&id={$parms['id']}";
|
||||
return e_PLUGIN_ABS."forum/forum_post.php?f=edit&id={$parms['id']}";
|
||||
break;
|
||||
|
||||
case 'move':
|
||||
return e_PLUGIN_ABS."forum/forum_conf.php?f=move&id={$parms['id']}";
|
||||
return e_PLUGIN_ABS."forum/forum_conf.php?f=move&id={$parms['id']}";
|
||||
break;
|
||||
|
||||
case 'split':
|
||||
return e_PLUGIN_ABS."forum/forum_conf.php?f=split&id={$parms['id']}";
|
||||
return e_PLUGIN_ABS."forum/forum_conf.php?f=split&id={$parms['id']}";
|
||||
break;
|
||||
|
||||
case 'quote':
|
||||
return e_PLUGIN_ABS."forum/forum_post.php?f=quote&id={$parms['id']}";
|
||||
return e_PLUGIN_ABS."forum/forum_post.php?f=quote&id={$parms['id']}";
|
||||
break;
|
||||
|
||||
case 'next':
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=next&id={$parms['id']}";
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=next&id={$parms['id']}";
|
||||
break;
|
||||
|
||||
case 'prev':
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=prev&id={$parms['id']}";
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=prev&id={$parms['id']}";
|
||||
break;
|
||||
|
||||
case 'track':
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=track&id={$parms['id']}";
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=track&id={$parms['id']}";
|
||||
break;
|
||||
|
||||
case 'untrack':
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=untrack&id={$parms['id']}";
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=untrack&id={$parms['id']}";
|
||||
break;
|
||||
|
||||
case 'track_toggle':
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=track_toggle&id={$parms['id']}";
|
||||
return e_PLUGIN_ABS."forum/forum_viewtopic.php?f=track_toggle&id={$parms['id']}";
|
||||
break;
|
||||
|
||||
}
|
||||
|
@@ -1154,31 +1154,29 @@ class e107forum
|
||||
function set_crumb($forum_href=false, $thread_title='', &$templateVar)
|
||||
{
|
||||
$e107 = e107::getInstance();
|
||||
global $FORUM_CRUMB, $forumInfo, $thread;
|
||||
global $FORUM_CRUMB, $forumInfo, $threadInfo, $thread;
|
||||
global $BREADCRUMB,$BACKLINK; // Eventually we should deprecate BACKLINK
|
||||
|
||||
if(!$forumInfo) { $forumInfo = $thread->threadInfo; }
|
||||
// var_dump($forumInfo);
|
||||
// var_dump($thread);
|
||||
if(!$forumInfo && $thread) { $forumInfo = $thread->threadInfo; }
|
||||
|
||||
if(is_array($FORUM_CRUMB))
|
||||
{
|
||||
$search = array('{SITENAME}', '{SITENAME_HREF}');
|
||||
$replace = array(SITENAME, "href='".$e107->url->getUrl('core:core', 'main', 'action=index')."'");
|
||||
$replace = array(SITENAME, $e107->url->getUrl('core:core', 'main', 'action=index'));
|
||||
$FORUM_CRUMB['sitename']['value'] = str_replace($search, $replace, $FORUM_CRUMB['sitename']['value']);
|
||||
|
||||
$search = array('{FORUMS_TITLE}', '{FORUMS_HREF}');
|
||||
$replace = array(LAN_01, "href='".$e107->url->getUrl('forum', 'forum', 'func=main')."'");
|
||||
$replace = array(LAN_01, $e107->url->getUrl('forum', 'forum', 'func=main'));
|
||||
$FORUM_CRUMB['forums']['value'] = str_replace($search, $replace, $FORUM_CRUMB['forums']['value']);
|
||||
|
||||
$search = '{PARENT_TITLE}';
|
||||
$replace = $e107->tp->toHTML($forumInfo['parent_name']);
|
||||
$FORUM_CRUMB['parent']['value'] = str_replace($search, $replace, $FORUM_CRUMB['parent']['value']);
|
||||
|
||||
if($forum_info['forum_sub'])
|
||||
if($forumInfo['forum_sub'])
|
||||
{
|
||||
$search = array('{SUBPARENT_TITLE}', '{SUBPARENT_HREF}');
|
||||
$replace = array(ltrim($forumInfo['sub_parent'], '*'), "href='".$e107->url->getUrl('forum', 'forum', "func=view&id={$forumInfo['forum_sub']}")."'");
|
||||
$replace = array(ltrim($forumInfo['sub_parent'], '*'), $e107->url->getUrl('forum', 'forum', "func=view&id={$forumInfo['forum_sub']}"));
|
||||
$FORUM_CRUMB['subparent']['value'] = str_replace($search, $replace, $FORUM_CRUMB['subparent']['value']);
|
||||
}
|
||||
else
|
||||
@@ -1187,11 +1185,13 @@ class e107forum
|
||||
}
|
||||
|
||||
$search = array('{FORUM_TITLE}', '{FORUM_HREF}');
|
||||
$replace = array(ltrim($forumInfo['forum_name'], '*'),"href='".$e107->url->getUrl('forum', 'forum', "func=view&id={$forumInfo['forum_id']}")."'");
|
||||
// TODO - remove 'href=' from the return value
|
||||
$replace = array(ltrim($forumInfo['forum_name'], '*'), $e107->url->getUrl('forum', 'forum', "func=view&id={$forumInfo['forum_id']}"));
|
||||
$FORUM_CRUMB['forum']['value'] = str_replace($search, $replace, $FORUM_CRUMB['forum']['value']);
|
||||
|
||||
$search = array('{THREAD_TITLE}');
|
||||
$replace = array($thread->threadInfo['thread_name']);
|
||||
$threadInfo['thread_id'] = intval($threadInfo['thread_id']);
|
||||
$search = array('{THREAD_TITLE}', '{THREAD_HREF}');
|
||||
$replace = array($threadInfo['thread_name'], $e107->url->getUrl('forum', 'thread', "func=view&id={$threadInfo['thread_id']}")); // $thread->threadInfo - no reference found
|
||||
$FORUM_CRUMB['thread']['value'] = str_replace($search, $replace, $FORUM_CRUMB['thread']['value']);
|
||||
|
||||
$FORUM_CRUMB['fieldlist'] = 'sitename,forums,parent,subparent,forum,thread';
|
||||
@@ -1201,17 +1201,17 @@ class e107forum
|
||||
{
|
||||
$dfltsep = ' :: ';
|
||||
$BREADCRUMB = "<a class='forumlink' href='".e_BASE."index.php'>".SITENAME."</a>".$dfltsep."<a class='forumlink' href='".e_PLUGIN."forum/forum.php'>".LAN_01."</a>".$dfltsep;
|
||||
if($forum_info['sub_parent'])
|
||||
if($forumInfo['sub_parent'])
|
||||
{
|
||||
$forum_sub_parent = (substr($forum_info['sub_parent'], 0, 1) == '*' ? substr($forum_info['sub_parent'], 1) : $forum_info['sub_parent']);
|
||||
$BREADCRUMB .= "<a class='forumlink' href='".e_PLUGIN."forum/forum_viewforum.php?{$forum_info['forum_sub']}'>{$forum_sub_parent}</a>".$dfltsep;
|
||||
$forum_sub_parent = (substr($forumInfo['sub_parent'], 0, 1) == '*' ? substr($forumInfo['sub_parent'], 1) : $forumInfo['sub_parent']);
|
||||
$BREADCRUMB .= "<a class='forumlink' href='".e_PLUGIN."forum/forum_viewforum.php?{$forumInfo['forum_sub']}'>{$forum_sub_parent}</a>".$dfltsep;
|
||||
}
|
||||
|
||||
$tmpFname = $forum_info['forum_name'];
|
||||
$tmpFname = $forumInfo['forum_name'];
|
||||
if(substr($tmpFname, 0, 1) == "*") { $tmpFname = substr($tmpFname, 1); }
|
||||
if ($forum_href)
|
||||
{
|
||||
$BREADCRUMB .= "<a class='forumlink' href='".e_PLUGIN."forum/forum_viewforum.php?{$forum_info['forum_id']}'>".$e107->tp->toHTML($tmpFname, TRUE, 'no_hook,emotes_off')."</a>";
|
||||
$BREADCRUMB .= "<a class='forumlink' href='".e_PLUGIN."forum/forum_viewforum.php?{$forumInfo['forum_id']}'>".$e107->tp->toHTML($tmpFname, TRUE, 'no_hook,emotes_off')."</a>";
|
||||
} else
|
||||
{
|
||||
$BREADCRUMB .= $tmpFname;
|
||||
|
@@ -13,7 +13,11 @@
|
||||
*/
|
||||
|
||||
require_once('../../class2.php');
|
||||
|
||||
$e107 = e107::getInstance();
|
||||
$tp = e107::getParser();
|
||||
$ns = e107::getRender();
|
||||
|
||||
if (!$e107->isInstalled('forum'))
|
||||
{
|
||||
header('Location: '.e_BASE.'index.php');
|
||||
@@ -45,6 +49,7 @@ switch($action)
|
||||
case 'rp':
|
||||
$threadInfo = $forum->threadGet($id, false);
|
||||
$forumId = $threadInfo['thread_forum_id'];
|
||||
$forumInfo = $forum->forumGet($forumId);
|
||||
break;
|
||||
|
||||
case 'nt':
|
||||
@@ -94,7 +99,7 @@ if ($action != 'nt' && !$threadInfo['thread_active'] && !MODERATOR)
|
||||
}
|
||||
|
||||
$forumInfo['forum_name'] = $tp->toHTML($forumInfo['forum_name'], true);
|
||||
define('e_PAGETITLE', LAN_01.' / '.$forumInfo['forum_name'].' / '.($action == 'rp' ? LAN_02.$threadInfo['thread_name'] : LAN_03));
|
||||
define('e_PAGETITLE', ($action == 'rp' ? LAN_02.$threadInfo['thread_name'] : LAN_03).' / '.$forumInfo['forum_name'].' / '.LAN_01);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@@ -40,8 +40,8 @@ $forum = new e107forum;
|
||||
//$view = 25;
|
||||
$view = $forum->prefs->get('threadspage', 25);
|
||||
if(!$view) { $view = 25; }
|
||||
$page = (varset($_GET['p']) ? $_GET['p'] : 0);
|
||||
$threadFrom = $page * $view;
|
||||
$page = (varset($_GET['p']) ? $_GET['p'] : 1);
|
||||
$threadFrom = ($page - 1) * $view;
|
||||
|
||||
global $forum_info, $FORUM_CRUMB;
|
||||
$fVars = new e_vars;
|
||||
@@ -83,7 +83,7 @@ $forumInfo['forum_name'] = $e107->tp->toHTML($forumInfo['forum_name'], true, 'no
|
||||
$forumInfo['forum_description'] = $e107->tp->toHTML($forumInfo['forum_description'], true, 'no_hook');
|
||||
|
||||
$_forum_name = (substr($forumInfo['forum_name'], 0, 1) == '*' ? substr($forumInfo['forum_name'], 1) : $forumInfo['forum_name']);
|
||||
define('e_PAGETITLE', LAN_01.' / '.$_forum_name);
|
||||
define('e_PAGETITLE', $_forum_name.' / '.LAN_01);
|
||||
//define('MODERATOR', $forum_info['forum_moderators'] != '' && check_class($forum_info['forum_moderators']));
|
||||
//$modArray = $forum->forum_getmods($forum_info['forum_moderators']);
|
||||
|
||||
@@ -411,25 +411,28 @@ function parse_thread($thread_info)
|
||||
{
|
||||
for($a = 0; $a <= 2; $a++)
|
||||
{
|
||||
$aa = $a + 1;
|
||||
$tVars->PAGES .= $tVars->PAGES ? ' ' : '';
|
||||
$url = $e107->url->getUrl('forum', 'thread', "func=view&id={$thread_info['thread_id']}&page={$a}");
|
||||
$tVars->PAGES .= "<a href='{$url}'>".($a+1).'</a>';
|
||||
$url = $e107->url->getUrl('forum', 'thread', "func=view&id={$thread_info['thread_id']}&page={$aa}");
|
||||
$tVars->PAGES .= "<a href='{$url}'>{$aa}</a>";
|
||||
}
|
||||
$tVars->PAGES .= ' ... ';
|
||||
for($a = $pages-3; $a <= $pages-1; $a++)
|
||||
{
|
||||
$aa = $a + 1;
|
||||
$tVars->PAGES .= $tVars->PAGES ? ' ' : '';
|
||||
$url = $e107->url->getUrl('forum', 'thread', "func=view&id={$thread_info['thread_id']}&page={$a}");
|
||||
$tVars->PAGES .= "<a href='{$url}'>".($a+1).'</a>';
|
||||
$url = $e107->url->getUrl('forum', 'thread', "func=view&id={$thread_info['thread_id']}&page={$aa}");
|
||||
$tVars->PAGES .= "<a href='{$url}'>{$aa}</a>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for($a = 0; $a <= ($pages-1); $a++)
|
||||
{
|
||||
$aa = $a + 1;
|
||||
$tVars->PAGES .= $tVars->PAGES ? ' ' : '';
|
||||
$url = $e107->url->getUrl('forum', 'thread', "func=view&id={$thread_info['thread_id']}&page={$a}");
|
||||
$tVars->PAGES .= "<a href='{$url}'>".($a+1).'</a>';
|
||||
$url = $e107->url->getUrl('forum', 'thread', "func=view&id={$thread_info['thread_id']}&page={$aa}");
|
||||
$tVars->PAGES .= "<a href='{$url}'>{$aa}</a>";
|
||||
}
|
||||
}
|
||||
$tVars->PAGES = LAN_316.' [ '.$tVars->PAGES.' ]';
|
||||
|
@@ -14,8 +14,10 @@
|
||||
*/
|
||||
|
||||
require_once ('../../class2.php');
|
||||
|
||||
$e107 = e107::getInstance();
|
||||
$tp = e107::getParser();
|
||||
$ns = e107::getRender();
|
||||
|
||||
if (!$e107->isInstalled('forum'))
|
||||
{
|
||||
@@ -41,8 +43,8 @@ include_lan(e_PLUGIN . 'forum/languages/'.e_LANGUAGE.'/lan_forum_viewtopic.php')
|
||||
include_once (e_PLUGIN . 'forum/forum_class.php');
|
||||
include_once(e_PLUGIN . 'forum/templates/forum_icons_template.php');
|
||||
|
||||
$forum = new e107forum;
|
||||
$thread = new e107ForumThread;
|
||||
$forum = new e107forum();
|
||||
$thread = new e107ForumThread();
|
||||
|
||||
if(isset($_GET['f']) && $_GET['f'] == 'post')
|
||||
{
|
||||
@@ -82,7 +84,7 @@ if (USER && (USERID != $thread->threadInfo['thread_user'] || $thread->threadInfo
|
||||
$forum->threadIncview($threadId);
|
||||
}
|
||||
|
||||
define('e_PAGETITLE', LAN_01 . ' / ' . $e107->tp->toHTML($thread->threadInfo['forum_name'], true, 'no_hook, emotes_off') . " / " . $tp->toHTML($thread->threadInfo['thread_name'], true, 'no_hook, emotes_off'));
|
||||
define('e_PAGETITLE', $tp->toHTML($thread->threadInfo['thread_name'], true, 'no_hook, emotes_off').' / '.$e107->tp->toHTML($thread->threadInfo['forum_name'], true, 'no_hook, emotes_off').' / '.LAN_01);
|
||||
$forum->modArray = $forum->forumGetMods($thread->threadInfo['forum_moderators']);
|
||||
define('MODERATOR', (USER && $forum->isModerator(USERID)));
|
||||
|
||||
@@ -98,7 +100,7 @@ if (MODERATOR && isset($_POST['mod']))
|
||||
$thread->threadInfo = $forum->threadGet($thread->threadId);
|
||||
}
|
||||
|
||||
$postList = $forum->PostGet($thread->threadId, $thread->page * $thread->perPage, $thread->perPage);
|
||||
$postList = $forum->PostGet($thread->threadId, ($thread->page - 1) * $thread->perPage, $thread->perPage);
|
||||
|
||||
$gen = new convert;
|
||||
if ($thread->message)
|
||||
@@ -117,7 +119,7 @@ if (isset($thread->threadInfo['thread_options']['poll']))
|
||||
$pollstr = "<div class='spacer'>" . $poll->render_poll($_qry, 'forum', 'query', true) . '</div>';
|
||||
}
|
||||
//Load forum templates
|
||||
|
||||
// FIXME - new template paths!
|
||||
if (file_exists(THEME . 'forum_design.php'))
|
||||
{
|
||||
include_once (THEME . 'forum_design.php');
|
||||
@@ -321,7 +323,7 @@ function showmodoptions()
|
||||
else
|
||||
{
|
||||
$type = 'Post';
|
||||
$ret = "<form method='post' action='" . e_SELF . '?' . e_QUERY . "' id='frmMod_{$postInfo['post_forum']}_{$postInfo['post_thread']}'>";
|
||||
$ret = "<form method='post' action='" . e_SELF . '?' . e_QUERY . "' id='frmMod_{$postInfo['post_thread']}_{$postInfo['post_id']}'>";
|
||||
$delId = $postInfo['post_id'];
|
||||
}
|
||||
|
||||
@@ -475,7 +477,7 @@ class e107ForumThread
|
||||
$e107 = e107::getInstance();
|
||||
$this->threadId = (int)varset($_GET['id']);
|
||||
$this->perPage = (varset($_GET['perpage']) ? (int)$_GET['perpage'] : $forum->prefs->get('postspage'));
|
||||
$this->page = (varset($_GET['p']) ? (int)$_GET['p'] : 0);
|
||||
$this->page = (varset($_GET['p']) ? (int)$_GET['p'] : 1);
|
||||
|
||||
//If threadId doesn't exist, or not given, redirect to main forum page
|
||||
if (!$this->threadId || !$this->threadInfo = $forum->threadGet($this->threadId))
|
||||
@@ -577,11 +579,12 @@ class e107ForumThread
|
||||
if ($forum->prefs->get('reported_post_email'))
|
||||
{
|
||||
require_once (e_HANDLER . 'mail.php');
|
||||
$report = LAN_422 . SITENAME . " : " . (substr(SITEURL, -1) == "/" ? SITEURL : SITEURL . "/") . $PLUGINS_DIRECTORY . "forum/forum_viewtopic.php?" . $thread_id . ".post\n" . LAN_425 . USERNAME . "\n" . $report_add;
|
||||
$report = LAN_422 . SITENAME . " : " . (substr(SITEURL, -1) == "/" ? SITEURL : SITEURL . "/") . $e107->getFolder('plugins') . "forum/forum_viewtopic.php?" . $this->threadId . ".post\n" . LAN_425 . USERNAME . "\n" . $report_add;
|
||||
$subject = LAN_421 . " " . SITENAME;
|
||||
sendemail(SITEADMINEMAIL, $subject, $report);
|
||||
}
|
||||
$e107->sql->db_Insert('generic', "0, 'reported_post', " . time() . ", '" . USERID . "', '{$thread_info['head']['thread_name']}', " . intval($thread_id) . ", '{$report_add}'");
|
||||
// no reference of 'head' $threadInfo['head']['thread_name']
|
||||
$e107->sql->db_Insert('generic', "0, 'reported_post', " . time() . ", '" . USERID . "', '{$this->threadInfo['thread_name']}', " . intval($this->threadId) . ", '{$report_add}'");
|
||||
define('e_PAGETITLE', LAN_01 . " / " . LAN_428);
|
||||
$url = $e107->url->getUrl('forum', 'thread', 'func=post&id='.$postId);
|
||||
$text = LAN_424 . "<br /><br /><a href='{$url}'>" . LAN_429 . '</a>';
|
||||
|
@@ -227,21 +227,21 @@ $THREADTOPIC_REPLY = "
|
||||
";
|
||||
}
|
||||
|
||||
$FORUM_CRUMB['sitename']['value'] = "<a class='forumlink' {SITENAME_HREF}>{SITENAME}</a>";
|
||||
$FORUM_CRUMB['sitename']['value'] = "<a class='forumlink' href='{SITENAME_HREF}'>{SITENAME}</a>";
|
||||
$FORUM_CRUMB['sitename']['sep'] = " :: ";
|
||||
|
||||
$FORUM_CRUMB['forums']['value'] = "<a class='forumlink' {FORUMS_HREF}>{FORUMS_TITLE}</a>";
|
||||
$FORUM_CRUMB['forums']['value'] = "<a class='forumlink' href='{FORUMS_HREF}'>{FORUMS_TITLE}</a>";
|
||||
$FORUM_CRUMB['forums']['sep'] = " :: ";
|
||||
|
||||
$FORUM_CRUMB['parent']['value'] = "{PARENT_TITLE}";
|
||||
$FORUM_CRUMB['parent']['sep'] = " :: ";
|
||||
|
||||
$FORUM_CRUMB['subparent']['value'] = "<a class='forumlink' {SUBPARENT_HREF}>{SUBPARENT_TITLE}</a>";
|
||||
$FORUM_CRUMB['subparent']['value'] = "<a class='forumlink' href='{SUBPARENT_HREF}'>{SUBPARENT_TITLE}</a>";
|
||||
$FORUM_CRUMB['subparent']['sep'] = " :: ";
|
||||
|
||||
$FORUM_CRUMB['forum']['value'] = "<a class='forumlink' {FORUM_HREF}>{FORUM_TITLE}</a>";
|
||||
$FORUM_CRUMB['forum']['value'] = "<a class='forumlink' href='{FORUM_HREF}'>{FORUM_TITLE}</a>";
|
||||
$FORUM_CRUMB['forum']['sep'] = " :: ";
|
||||
|
||||
$FORUM_CRUMB['thread']['value'] = "{THREAD_TITLE}";
|
||||
$FORUM_CRUMB['thread']['value'] = "<a class='forumlink' href='{THREAD_HREF}'>{THREAD_TITLE}</a>";
|
||||
|
||||
?>
|
@@ -2,16 +2,14 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2011 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/templates/forum_viewtopic_template.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
@@ -162,7 +160,7 @@ $FORUMEND = "<tr><td colspan='2' class='forumheader3' style='text-align:center'>
|
||||
|
||||
<table style='".USER_WIDTH."'>
|
||||
<tr>
|
||||
<td style='width:80%'><span class='mediumtext'>{GOTOPAGES} </span>
|
||||
<td style='width:80%'>{GOTOPAGES}
|
||||
</td>
|
||||
<td style='width:20%; text-align: right; white-space: nowrap'>
|
||||
{BUTTONS}
|
||||
@@ -287,18 +285,18 @@ $FORUMDELETEDSTYLE = "<tr>
|
||||
</tr>";
|
||||
|
||||
|
||||
$FORUM_CRUMB['sitename']['value'] = "<a class='forumlink' {SITENAME_HREF}>{SITENAME}</a>";
|
||||
$FORUM_CRUMB['sitename']['value'] = "<a class='forumlink' href='{SITENAME_HREF}'>{SITENAME}</a>";
|
||||
$FORUM_CRUMB['sitename']['sep'] = " :: ";
|
||||
|
||||
$FORUM_CRUMB['forums']['value'] = "<a class='forumlink' {FORUMS_HREF}>{FORUMS_TITLE}</a>";
|
||||
$FORUM_CRUMB['forums']['value'] = "<a class='forumlink' href='{FORUMS_HREF}'>{FORUMS_TITLE}</a>";
|
||||
$FORUM_CRUMB['forums']['sep'] = " :: ";
|
||||
|
||||
$FORUM_CRUMB['parent']['value'] = "{PARENT_TITLE}";
|
||||
$FORUM_CRUMB['parent']['sep'] = " :: ";
|
||||
|
||||
$FORUM_CRUMB['subparent']['value'] = "<a class='forumlink' {SUBPARENT_HREF}>{SUBPARENT_TITLE}</a>";
|
||||
$FORUM_CRUMB['subparent']['value'] = "<a class='forumlink' href='{SUBPARENT_HREF}'>{SUBPARENT_TITLE}</a>";
|
||||
$FORUM_CRUMB['subparent']['sep'] = " :: ";
|
||||
|
||||
$FORUM_CRUMB['forum']['value'] = "<a class='forumlink' {FORUM_HREF}>{FORUM_TITLE}</a>";
|
||||
$FORUM_CRUMB['forum']['value'] = "<a class='forumlink' href='{FORUM_HREF}'>{FORUM_TITLE}</a>";
|
||||
|
||||
?>
|
Reference in New Issue
Block a user