Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #518 and forums.topics pagination bug

  • Loading branch information...
commit 7975a4128db415e9d9c6a9bdea7823463d897fb1 1 parent cf04873
@trustmaster trustmaster authored
View
8 system/core/forums/forums.topics.inc.php
@@ -533,20 +533,20 @@ function cursort($trigger, $way)
if ($row['poll_id']>0)
{ $row['ft_title'] = $L['Poll'].": ".$row['ft_title']; }
- if ($row['ft_postcount']>$cfg['maxtopicsperpage'])
+ if ($row['ft_postcount']>$cfg['maxpostsperpage'])
{
- $row['ft_maxpages'] = ceil($row['ft_postcount'] / $cfg['maxtopicsperpage']);
+ $row['ft_maxpages'] = ceil($row['ft_postcount'] / $cfg['maxpostsperpage']);
if($row['ft_maxpages'] > 5)
{
$address = $row['ft_url'] . ((mb_strpos($row['ft_url'], '?') !== false) ? '&d=' : '?d=');
- $last_n = ($row['ft_maxpages'] - 1) * $cfg['maxtopicsperpage'];
+ $last_n = ($row['ft_maxpages'] - 1) * $cfg['maxpostsperpage'];
$last_page = '<span class="pagenav_last"><a href="'.$address.$last_n.'">'.$row['ft_maxpages'].'</a></span>';
}
else
{
$last_page = '';
}
- $row['ft_pages'] = $L['Pages'] . ': <span class="pagenav_small">' . sed_pagination($row['ft_url'], 0, $row['ft_postcount'], $cfg['maxtopicsperpage'], 'd') . $last_page . '</span>';
+ $row['ft_pages'] = $L['Pages'] . ': <span class="pagenav_small">' . sed_pagination($row['ft_url'], 0, $row['ft_postcount'], $cfg['maxpostsperpage'], 'd') . $last_page . '</span>';
}
$t-> assign(array(
View
21 system/core/page/page.inc.php
@@ -120,7 +120,8 @@
}
$catpath = sed_build_catpath($pag['page_cat'], '<a href="%1$s">%2$s</a>');
-$pag['page_fulltitle'] = $catpath." ".$cfg['separator']." <a href=\"".$pag['page_pageurl']."\">".$pag['page_title']."</a>";
+$pag['page_fulltitle'] = empty($catpath) ? '' : $catpath . ' ' . $cfg['separator'] . ' ';
+$pag['page_fulltitle'] .= "<a href=\"".$pag['page_pageurl']."\">".$pag['page_title']."</a>";
$pag['page_fulltitle'] .= ($pag['page_totaltabs']>1 && !empty($pag['page_tabtitle'][$pag['page_tab']-1])) ? " (".$pag['page_tabtitle'][$pag['page_tab']-1].")" : '';
$comments = ($sed_cat[$pag['page_cat']]['com']) ? true : false;
@@ -131,10 +132,20 @@
list($comments_link, $comments_display, $comments_count) = sed_build_comments($item_code, $pag['page_pageurl'], $comments);
list($ratings_link, $ratings_display) = sed_build_ratings($item_code, $pag['page_pageurl'], $ratings);
-$title_tags[] = array('{TITLE}', '{CATEGORY}');
-$title_tags[] = array('%1$s', '%2$s');
-$title_data = array($pag['page_title'], $sed_cat[$pag['page_cat']]['title']);
-$out['subtitle'] = sed_title('title_page', $title_tags, $title_data);
+if ($pag['page_cat'] == 'system')
+{
+ $title_tags[] = array('{TITLE}');
+ $title_tags[] = array('%1$s');
+ $title_data = array($pag['page_title']);
+ $out['subtitle'] = sed_title('title_list', $title_tags, $title_data);
+}
+else
+{
+ $title_tags[] = array('{TITLE}', '{CATEGORY}');
+ $title_tags[] = array('%1$s', '%2$s');
+ $title_data = array($pag['page_title'], $sed_cat[$pag['page_cat']]['title']);
+ $out['subtitle'] = sed_title('title_page', $title_tags, $title_data);
+}
/* === Hook === */
$extp = sed_getextplugins('page.main');
View
7 system/functions.php
@@ -862,9 +862,12 @@ function sed_build_catpath($cat, $mask)
$pathcodes = explode('.', $sed_cat[$cat]['path']);
foreach($pathcodes as $k => $x)
{
- $tmp[]= sprintf($mask, sed_url('list', 'c='.$x), $sed_cat[$x]['title']);
+ if ($x != 'system')
+ {
+ $tmp[]= sprintf($mask, sed_url('list', 'c='.$x), $sed_cat[$x]['title']);
+ }
}
- return implode(' '.$cfg['separator'].' ', $tmp);
+ return is_array($tmp) ? implode(' '.$cfg['separator'].' ', $tmp) : '';
}
/* ------------------ */
Please sign in to comment.
Something went wrong with that request. Please try again.