Recent Topics

[2.0.2-alpha] Number of Posts in month/year view

Started by on Feb 20, 2008 – Contents updated: Feb 20, 2008

Feb 20, 2008 03:50    

My b2evolution Version: 2.0.2-alpha
How can I limit the number of posts when viewing by monht or year views. I can get over 200 posts making it a huge page. The number of post per page does not work.

TIA

Feb 24, 2008 17:14

Hi red-five,

Welcome to the forums.
Do upgrade to 2.4. The version you are using is a very first release of the 2.x branch. That makes it very unstable.

Good luck

Feb 24, 2008 18:36

Upgrading is the right thing to do because anyone using an alpha release needs to accept that they are running a version not likely to be supported and prone to 'undocumented features', but in this case it won't solve the problem.

This is a bug and I will move it to the 240 bugs forum.

I took an unmodified 2.4.0-RC2 installation and told it 2 posts per page. I then went to my "archives" link and clicked on "February". The resultant page showed all posts from the month of February - not limited to 2 and therefore a complete duplication of this problem.

Feb 24, 2008 18:49

I bet it limited your posts when viewing the blog normally though huh? ;)

It's badly phrased but the archive setting is distinct from the posts per page setting ( although having it's own per page setting would be pretty cool )

¥

*edit*
moved to "feature requests" because if it isn't one then it should be ;)

ohhh yeah, upgrade already :|

Feb 27, 2008 00:51

"Badly phrased" is either the understatement of the century or a rather clever way to say 'bug' :-/

Like, if I tell it to give me 10 posts per page I obviously expect it to NOT give me more than one on a single post page, and I don't expect it to make up posts if I don't have 10 posts to display, but if it comes up with 200 posts per page then it has failed to limit the display to 10 per page.

Especially when the problem shows up on archives but not other sorting methods like categories (and probably tags).

Feb 27, 2008 20:16

Found this while doing something unrelated:

  • CollectionSettings::get( 9/archive_posts_per_page/ ): '100'

  • [/list:u] suggesting there is a variable $archive_posts_per_page that defaults to 100 and may be easily overriden in /conf/_advanced.php.

Feb 28, 2008 00:26

Good find! Using Agent Ransack I do not see that setting in any file in the conf folder, but I did (allegedly) find it on the SEO form by finding it in a file there. The noted text on the SEO settings subtab says "Leave empty to use blog default (5)" which obviously isn't happening.

The only place I found where that value is actually set to something is in inc/collections/model/_collsettings.class.php where it is set to '100'. This does not explain getting what would seem to be the entire archive though, as seems to be red-five's situation.

Also I could not duplicate this on my actual blog - only my un-touched test blog. I therefore wonder if SOMEHOW selecting something on the SEO subtab kicks stuff into playing nicely in this area? I have no clue yah? All I know is after figuring out how to tell the back office to link titles to permalinks then telling the skin to not do that so I could use the ministats plugin, I opted to use one of the canned SEO settings that are available. So maybe ... ?

Feb 28, 2008 00:43

Yep and searching on the clues from EdB brings us to this:

archives_post_per_page defaults to 100 in /inc/collections/model/_collsettings.class.php line 70:

'archive_posts_per_page' => '100',


and is overriden by the SEO guru's who all have their say:
awall
/inc/collections/model/_blog.class.php line 785:

$this->set_setting( 'archive_posts_per_page', NULL );


abeal
/inc/collections/model/_blog.class.php line 820:

$this->set_setting( 'archive_posts_per_page', 10 );


mgray
/inc/collections/model/_blog.class.php line 855:

$this->set_setting( 'archive_posts_per_page', 20 );


rfishkin
/inc/collections/model/_blog.class.php line 890:

$this->set_setting( 'archive_posts_per_page', 50 );


sspencer
/inc/collections/model/_blog.class.php line 925:

$this->set_setting( 'archive_posts_per_page', 10 );


Form is loading...

Advanced CMS – This forum is powered by b2evolution CMS, a complete engine for your website.