<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>bbPress Showcase Topic: Problem in Topics-per-page and pagination question</title>
<link>http://bbshowcase.org/forums/</link>
<description>bbPress Showcase Topic: Problem in Topics-per-page and pagination question</description>
<language>en</language>
<pubDate>Sun, 12 Feb 2012 05:34:11 +0000</pubDate>

<item>
<title>_ck_ on "Problem in Topics-per-page and pagination question"</title>
<link>http://bbshowcase.org/forums/topic/problem-in-topics-per-page-and-pagination-question#post-992</link>
<pubDate>Mon, 02 Feb 2009 12:43:21 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">992@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;The count for super_stickies is only done on page 1&#60;br /&#62;
bbPress doesn't look them up if page&#38;gt;1 so count will always be zero&#60;/p&#62;
&#60;p&#62;Just don't try to include the stickies in the count, stickies are special.&#60;/p&#62;
&#60;p&#62;Also, bbPress might already know how many topics are in the total, I am uncertain what the variable name is for regular topic lists but in views the global is &#60;code&#62;$view_count&#60;/code&#62; - you'd have to dig through the code to see what the variable is for regular topic lists.&#60;/p&#62;
&#60;p&#62;Since the front page doesn't normally paginate, study forum pages instead.&#60;/p&#62;
&#60;p&#62;This is the magic line where internally it knows how many topics there are, I just don't know the external variable name:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;$this-&#38;gt;found_rows = bb_count_last_query( $this-&#38;gt;request );&#60;/code&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>tikitakfire on "Problem in Topics-per-page and pagination question"</title>
<link>http://bbshowcase.org/forums/topic/problem-in-topics-per-page-and-pagination-question#post-990</link>
<pubDate>Mon, 02 Feb 2009 04:51:10 +0000</pubDate>
<dc:creator>tikitakfire</dc:creator>
<guid isPermaLink="false">990@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;Look, I make this function:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function pagination_info() {
	global $page, $topics, $super_stickies, $topics_per_page;

	if (empty($forums)) {
		$forums = get_forums();
	}

	foreach ($forums as  $forum) {
		$info[&#38;#39;total_topics&#38;#39;] += $forum-&#38;gt;topics;
	}

	$info[&#38;#39;current_topics&#38;#39;] = count($topics) + count($super_stickies);
	$info[&#38;#39;must_be&#38;#39;] = (($page - 1) * $topics_per_page[&#38;#39;front-page&#38;#39;]);
	$info[&#38;#39;from_topic&#38;#39;] = ($info[&#38;#39;must_be&#38;#39;] + 1);
	$info[&#38;#39;to_topic&#38;#39;] = ($info[&#38;#39;must_be&#38;#39;] + $info[&#38;#39;current_topics&#38;#39;]);

	return $info;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and I set 5 topics in the front page.&#60;/p&#62;
&#60;p&#62;Now, if I have 10 topics and 1 is super sticky, in the first page returns from_topic 1 to_topic 6 (it's ok by the problem that you told me) and in the second page this returns from_topic 6 to_topic 9 when it should return from_topic 7 to_topic 10...&#60;/p&#62;
&#60;p&#62;Can give me some help to fix them?
&#60;/p&#62;</description>
</item>
<item>
<title>_ck_ on "Problem in Topics-per-page and pagination question"</title>
<link>http://bbshowcase.org/forums/topic/problem-in-topics-per-page-and-pagination-question#post-966</link>
<pubDate>Sat, 31 Jan 2009 12:19:57 +0000</pubDate>
<dc:creator>_ck_</dc:creator>
<guid isPermaLink="false">966@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;Yes, bbPress has a minor flaw in that super-stickies override any per-page count and will be added to the total. So even though the per-page is set to 15, the first page has 3 super-stickies so there are 18 total.&#60;/p&#62;
&#60;p&#62;You can show pagination info by using the &#60;code&#62;global $page;&#60;/code&#62; that bbPress uses internally to keep track of what page it's on but getting the total count is a little trickier.&#60;/p&#62;
&#60;p&#62;You'll have to study the &#60;code&#62;function get_page_number_links&#60;/code&#62; and &#60;code&#62;function paginate_links&#60;/code&#62; to see how they work and use their filters.
&#60;/p&#62;</description>
</item>
<item>
<title>tikitakfire on "Problem in Topics-per-page and pagination question"</title>
<link>http://bbshowcase.org/forums/topic/problem-in-topics-per-page-and-pagination-question#post-965</link>
<pubDate>Sat, 31 Jan 2009 07:37:18 +0000</pubDate>
<dc:creator>tikitakfire</dc:creator>
<guid isPermaLink="false">965@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;I don't know if you noticed, but here is the same: the first page shows 18 topics and the others 15...
&#60;/p&#62;</description>
</item>
<item>
<title>tikitakfire on "Problem in Topics-per-page and pagination question"</title>
<link>http://bbshowcase.org/forums/topic/problem-in-topics-per-page-and-pagination-question#post-964</link>
<pubDate>Sat, 31 Jan 2009 07:30:53 +0000</pubDate>
<dc:creator>tikitakfire</dc:creator>
<guid isPermaLink="false">964@http://bbshowcase.org/forums/</guid>
<description>&#60;p&#62;Hey _ck_!&#60;/p&#62;
&#60;ol&#62;
&#60;li&#62;I using Topics-per-page with 5 posts in the front-page to test and, on the first page, the plugin displays 7 topics and in the following pages, shows 5.&#60;br /&#62;
If I set 10 topics the plugin show 12 on the first page and 10 on the others, etc...&#60;/p&#62;
&#60;p&#62;How I can fix them?&#60;/li&#62;
&#60;li&#62;how I can show an pagination information like this?&#60;br /&#62;
&#60;code&#62;Showing post 1 to 10 of 30 &#124; Pages: 1 2 3&#60;/code&#62;&#60;/li&#62;
&#60;/ol&#62;</description>
</item>

</channel>
</rss>

