1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-30 09:39:55 +02:00

More BC Fixes on forum templates.

This commit is contained in:
Cameron
2017-12-12 15:03:23 -08:00
parent ea073afe9a
commit 7e33124335
5 changed files with 81 additions and 48 deletions

View File

@@ -127,6 +127,7 @@ if (!$forum->checkPerm($forumId, 'view'))
}
$forumInfo = $forum->forumGet($forumId);
$forumSCvars = array();
//----$threadsViewed = $forum->threadGetUserViewed();
if (empty($FORUM_VIEW_START))
@@ -253,7 +254,7 @@ if ($message)
}
--*/
$threadCount = $forumInfo['forum_threads'];
$threadCount = (int) $forumInfo['forum_threads'];
if ($threadCount > $view)
{
@@ -265,7 +266,6 @@ else
}
if ($pages)
{
if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== false || strpos($FORUM_VIEW_END, 'THREADPAGES') !== false)
@@ -490,56 +490,63 @@ if(is_array($subList) && isset($subList[$forumInfo['forum_parent']][$forumId]))
$fVars->SUBFORUMS = $FORUM_VIEW_SUB_START.$sub_info.$FORUM_VIEW_SUB_END;
}
--*/
if (count($threadList) )
{
foreach($threadList as $thread_info)
if(count($threadList))
{
if($thread_info['thread_options'])
foreach($threadList as $thread_info)
{
$thread_info['thread_options'] = unserialize($thread_info['thread_options']);
}
else
{
$thread_info['thread_options'] = array();
}
if ($thread_info['thread_sticky'])
{
$sticky_threads ++;
}
if ($sticky_threads > 0 && !$stuck && $forum->prefs->get('hilightsticky'))
{
if($FORUM_IMPORTANT_ROW)
if($thread_info['thread_options'])
{
$forum_view_forum .= $FORUM_IMPORTANT_ROW;
$thread_info['thread_options'] = unserialize($thread_info['thread_options']);
}
else
{
$forum_view_forum .= "<tr><td class='forumheader'>&nbsp;</td><td colspan='5' class='forumheader'><span class='mediumtext'><b>".LAN_FORUM_1006."</b></span></td></tr>";
$thread_info['thread_options'] = array();
}
$stuck = true;
}
if (!$thread_info['thread_sticky'])
{
$reg_threads ++;
}
if ($reg_threads == '1') // Removed as not needed in new template. && !$unstuck && $stuck
{
if($FORUM_NORMAL_ROW)
if($thread_info['thread_sticky'])
{
$forum_view_forum .= $FORUM_NORMAL_ROW;
$sticky_threads++;
}
else
if($sticky_threads > 0 && !$stuck && $forum->prefs->get('hilightsticky'))
{
$forum_view_forum .= "<tr><td class='forumheader'>&nbsp;</td><td colspan='5' class='forumheader'><span class='mediumtext'><b>".LAN_FORUM_1007."</b></span></td></tr>";
if(!empty($FORUM_IMPORTANT_ROW))
{
$forum_view_forum .= $FORUM_IMPORTANT_ROW;
}
else
{
$forum_view_forum .= "<tr><td class='forumheader'>&nbsp;</td><td colspan='5' class='forumheader'><span class='mediumtext'><b>" . LAN_FORUM_1006 . "</b></span></td></tr>";
}
$stuck = true;
}
$unstuck = true;
if(!$thread_info['thread_sticky'])
{
$reg_threads++;
}
if($reg_threads === 1 && (THEME_LEGACY === true && $reg_threads === 1 && $stuck === true && $unstuck !== true)) // Removed as not needed in new template. && !$unstuck && $stuck
{
if(!empty($FORUM_NORMAL_ROW))
{
$forum_view_forum .= $FORUM_NORMAL_ROW;
}
else
{
$forum_view_forum .= "<tr><td class='forumheader'>&nbsp;</td><td colspan='5' class='forumheader'><span class='mediumtext'><b>" . LAN_FORUM_1007 . "</b></span></td></tr>";
}
$unstuck = true;
}
$forum_view_forum .= parse_thread($thread_info);
}
$forum_view_forum .= parse_thread($thread_info);
}
}
else
{
$forum_view_forum .= deftrue('BOOTSTRAP')?"<div class='alert alert-warning'>".LAN_FORUM_1008."</div>":
$forum_view_forum .= deftrue('BOOTSTRAP') ? "<div class='alert alert-warning'>".LAN_FORUM_1008."</div>":
"<tr><td class='forumheader alert alert-warning alert-block' colspan='6'>".LAN_FORUM_1008."</td></tr>";
}
@@ -1033,8 +1040,12 @@ function fpages($thread_info, $replies)
{
global $forum;
$tp = e107::getParser();
$replies = (int) $replies;
$postsPerPage = (int) $forum->prefs->get('postspage');
$pages = ceil(($replies)/$forum->prefs->get('postspage'));
$pages = ceil(($replies)/$postsPerPage);
$thread_info['thread_sef'] = eHelper::title2sef($thread_info['thread_name'],'dashl');
$urlparms = $thread_info;
$text = '';
@@ -1091,7 +1102,7 @@ function fpages($thread_info, $replies)
}
else
{
$text = implode("",$opts); // ."</div>";
$text = implode(" ",$opts); // ."</div>";
}
}