mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
More BC Fixes on forum templates.
This commit is contained in:
@@ -77,6 +77,13 @@ function nextprev_shortcode($parm = '')
|
|||||||
|
|
||||||
// Calculate
|
// Calculate
|
||||||
$total_items = intval($parm['total']);
|
$total_items = intval($parm['total']);
|
||||||
|
|
||||||
|
if(empty($total_items))
|
||||||
|
{
|
||||||
|
e107::getDebug()->log("Next Prev has zero total items");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$check_render = true;
|
$check_render = true;
|
||||||
|
|
||||||
if(vartrue($parm['glyphs']) && (deftrue('BOOTSTRAP')))
|
if(vartrue($parm['glyphs']) && (deftrue('BOOTSTRAP')))
|
||||||
@@ -156,6 +163,8 @@ function nextprev_shortcode($parm = '')
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
var_dump($total_items);
|
||||||
|
|
||||||
$total_pages = ceil($total_items/$perpage);
|
$total_pages = ceil($total_items/$perpage);
|
||||||
$last_page = ceil($total_pages*$perpage)-$perpage;
|
$last_page = ceil($total_pages*$perpage)-$perpage;
|
||||||
$current_page = ($current_start/$perpage) + 1;
|
$current_page = ($current_start/$perpage) + 1;
|
||||||
|
@@ -127,6 +127,7 @@ if (!$forum->checkPerm($forumId, 'view'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$forumInfo = $forum->forumGet($forumId);
|
$forumInfo = $forum->forumGet($forumId);
|
||||||
|
$forumSCvars = array();
|
||||||
//----$threadsViewed = $forum->threadGetUserViewed();
|
//----$threadsViewed = $forum->threadGetUserViewed();
|
||||||
|
|
||||||
if (empty($FORUM_VIEW_START))
|
if (empty($FORUM_VIEW_START))
|
||||||
@@ -253,7 +254,7 @@ if ($message)
|
|||||||
}
|
}
|
||||||
--*/
|
--*/
|
||||||
|
|
||||||
$threadCount = $forumInfo['forum_threads'];
|
$threadCount = (int) $forumInfo['forum_threads'];
|
||||||
|
|
||||||
if ($threadCount > $view)
|
if ($threadCount > $view)
|
||||||
{
|
{
|
||||||
@@ -265,7 +266,6 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($pages)
|
if ($pages)
|
||||||
{
|
{
|
||||||
if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== false || strpos($FORUM_VIEW_END, 'THREADPAGES') !== false)
|
if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== false || strpos($FORUM_VIEW_END, 'THREADPAGES') !== false)
|
||||||
@@ -502,13 +502,15 @@ if (count($threadList) )
|
|||||||
{
|
{
|
||||||
$thread_info['thread_options'] = array();
|
$thread_info['thread_options'] = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($thread_info['thread_sticky'])
|
if($thread_info['thread_sticky'])
|
||||||
{
|
{
|
||||||
$sticky_threads++;
|
$sticky_threads++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($sticky_threads > 0 && !$stuck && $forum->prefs->get('hilightsticky'))
|
if($sticky_threads > 0 && !$stuck && $forum->prefs->get('hilightsticky'))
|
||||||
{
|
{
|
||||||
if($FORUM_IMPORTANT_ROW)
|
if(!empty($FORUM_IMPORTANT_ROW))
|
||||||
{
|
{
|
||||||
$forum_view_forum .= $FORUM_IMPORTANT_ROW;
|
$forum_view_forum .= $FORUM_IMPORTANT_ROW;
|
||||||
}
|
}
|
||||||
@@ -516,15 +518,18 @@ if (count($threadList) )
|
|||||||
{
|
{
|
||||||
$forum_view_forum .= "<tr><td class='forumheader'> </td><td colspan='5' class='forumheader'><span class='mediumtext'><b>" . LAN_FORUM_1006 . "</b></span></td></tr>";
|
$forum_view_forum .= "<tr><td class='forumheader'> </td><td colspan='5' class='forumheader'><span class='mediumtext'><b>" . LAN_FORUM_1006 . "</b></span></td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$stuck = true;
|
$stuck = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$thread_info['thread_sticky'])
|
if(!$thread_info['thread_sticky'])
|
||||||
{
|
{
|
||||||
$reg_threads++;
|
$reg_threads++;
|
||||||
}
|
}
|
||||||
if ($reg_threads == '1') // Removed as not needed in new template. && !$unstuck && $stuck
|
|
||||||
|
if($reg_threads === 1 && (THEME_LEGACY === true && $reg_threads === 1 && $stuck === true && $unstuck !== true)) // Removed as not needed in new template. && !$unstuck && $stuck
|
||||||
{
|
{
|
||||||
if($FORUM_NORMAL_ROW)
|
if(!empty($FORUM_NORMAL_ROW))
|
||||||
{
|
{
|
||||||
$forum_view_forum .= $FORUM_NORMAL_ROW;
|
$forum_view_forum .= $FORUM_NORMAL_ROW;
|
||||||
}
|
}
|
||||||
@@ -532,8 +537,10 @@ if (count($threadList) )
|
|||||||
{
|
{
|
||||||
$forum_view_forum .= "<tr><td class='forumheader'> </td><td colspan='5' class='forumheader'><span class='mediumtext'><b>" . LAN_FORUM_1007 . "</b></span></td></tr>";
|
$forum_view_forum .= "<tr><td class='forumheader'> </td><td colspan='5' class='forumheader'><span class='mediumtext'><b>" . LAN_FORUM_1007 . "</b></span></td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$unstuck = true;
|
$unstuck = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$forum_view_forum .= parse_thread($thread_info);
|
$forum_view_forum .= parse_thread($thread_info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1034,7 +1041,11 @@ function fpages($thread_info, $replies)
|
|||||||
global $forum;
|
global $forum;
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
|
||||||
$pages = ceil(($replies)/$forum->prefs->get('postspage'));
|
$replies = (int) $replies;
|
||||||
|
$postsPerPage = (int) $forum->prefs->get('postspage');
|
||||||
|
|
||||||
|
$pages = ceil(($replies)/$postsPerPage);
|
||||||
|
|
||||||
$thread_info['thread_sef'] = eHelper::title2sef($thread_info['thread_name'],'dashl');
|
$thread_info['thread_sef'] = eHelper::title2sef($thread_info['thread_name'],'dashl');
|
||||||
$urlparms = $thread_info;
|
$urlparms = $thread_info;
|
||||||
$text = '';
|
$text = '';
|
||||||
|
@@ -167,7 +167,7 @@ class forum_shortcodes extends e_shortcode
|
|||||||
function sc_search()
|
function sc_search()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!$srchIcon = e107::getParser()->toGlyph('fa-search'))
|
if(!deftrue('FONTAWESOME') || !$srchIcon = e107::getParser()->toGlyph('fa-search'))
|
||||||
{
|
{
|
||||||
$srchIcon = LAN_SEARCH;
|
$srchIcon = LAN_SEARCH;
|
||||||
}
|
}
|
||||||
|
@@ -57,6 +57,10 @@
|
|||||||
|
|
||||||
function sc_threadpages()
|
function sc_threadpages()
|
||||||
{
|
{
|
||||||
|
if(empty($this->var['parms']))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return e107::getParser()->parseTemplate("{NEXTPREV={$this->var['parms']}}");
|
return e107::getParser()->parseTemplate("{NEXTPREV={$this->var['parms']}}");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,7 +147,7 @@
|
|||||||
|
|
||||||
function sc_moderators()
|
function sc_moderators()
|
||||||
{
|
{
|
||||||
return $this->var['modUser'];
|
return is_array($this->var['modUser']) ? implode(", ",$this->var['modUser']) : $this->var['modUser'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_browsers()
|
function sc_browsers()
|
||||||
@@ -635,9 +639,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_replies()
|
function sc_replies($parm='')
|
||||||
{
|
{
|
||||||
$val = ($this->var['thread_total_replies']) ? $this->var['thread_total_replies'] : '0';
|
$val = ($this->var['thread_total_replies']) ? $this->var['thread_total_replies'] : '0';
|
||||||
|
|
||||||
|
if($parm === 'raw')
|
||||||
|
{
|
||||||
|
return $val;
|
||||||
|
}
|
||||||
|
|
||||||
return e107::getParser()->toBadge($val);
|
return e107::getParser()->toBadge($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -895,7 +905,14 @@
|
|||||||
function sc_pages()
|
function sc_pages()
|
||||||
{
|
{
|
||||||
// $tVars['PAGES'] = fpages($thread_info, $tVars['REPLIES']);
|
// $tVars['PAGES'] = fpages($thread_info, $tVars['REPLIES']);
|
||||||
return fpages($this->var, $this->sc_replies());
|
$ret = fpages($this->var, $this->sc_replies('raw'));
|
||||||
|
|
||||||
|
if(!empty($ret))
|
||||||
|
{
|
||||||
|
return LAN_GOPAGE.": ".$ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -21,10 +21,6 @@ $FORUM_VIEW_START = "
|
|||||||
<div class='spacer'>
|
<div class='spacer'>
|
||||||
<table style='".USER_WIDTH."' class='fborder table' >
|
<table style='".USER_WIDTH."' class='fborder table' >
|
||||||
<tr>
|
<tr>
|
||||||
<td class='fcaption'>{BREADCRUMB}</td>
|
|
||||||
</tr>
|
|
||||||
{SUBFORUMS}
|
|
||||||
<tr>
|
|
||||||
<td style='width:80%' class='forumheader'>
|
<td style='width:80%' class='forumheader'>
|
||||||
<span class='mediumtext'>{FORUMTITLE}</span></td>
|
<span class='mediumtext'>{FORUMTITLE}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -165,7 +161,7 @@ if (empty($FORUM_VIEW_END))
|
|||||||
<div class='spacer'>
|
<div class='spacer'>
|
||||||
<table class='fborder table' style='".USER_WIDTH."'>
|
<table class='fborder table' style='".USER_WIDTH."'>
|
||||||
<tr>
|
<tr>
|
||||||
<td style='vertical-align:middle; width:50%' class='forumheader3'><span class='smalltext'>{MODERATORS}</span></td>
|
<td style='vertical-align:middle; width:50%' class='forumheader3'><span class='smalltext'>{LAN=LAN_FORUM_1009}: {MODERATORS}</span></td>
|
||||||
<td style='vertical-align:middle; width:50%' class='forumheader3'><span class='smalltext'>{BROWSERS}</span></td>
|
<td style='vertical-align:middle; width:50%' class='forumheader3'><span class='smalltext'>{BROWSERS}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
Reference in New Issue
Block a user