Recent Topics

1 Oct 21, 2008 11:31    

My b2evolution Version: 1.10.x

I would like to be able to present at page with a list of the most popular articles (most read) sorted by the most popular at the top.

The list should be in the same way as it is in the summary.php

Would that be possible ?

Any help would be highly appriciated.

Thanx in advance.

2 Oct 21, 2008 11:55

Tilqi should write a HOWTO on this topic. I'm sure he finds some time to answer this question.

Good luck

3 Oct 22, 2008 23:30

it's quite easy.. you could create a stable page using ;

$orderby = 'views'


and get them to be displayed manually with a link to your .../index.php?orderby=views

4 Oct 23, 2008 09:48

tilqicom,

Might be easy for you :-)

I would like something like this:


<?php // --------------------------- BLOG LIST -----------------------------
for( $blog=blog_list_start();
$blog!=false;
$blog=blog_list_next() )
{ # by uncommenting the following lines you can hide some blogs
// if( $blog == 1 ) continue; // Hide blog 1...
if( $blog == 2 ) continue; // Hide blog 2...
if( $blog == 3 ) continue; // Hide blog 3...
if( $blog == 4 ) continue; // Hide blog 4...
?>
<ul>
<?php	// Get the 60 last posts for each blog:
$BlogBList = & new ItemList( $blog,  '', '', '', '', '', array(), '', 'DESC', '', 60, '', '', '', '', '', '', '', 'posts' );
while( $Item = $BlogBList->get_item() )
{
?>
<li lang="<?php $Item->lang() ?>">
<?php $Item->issue_date() ?>:
<?php $Item->permanent_link( '#title#' ) ?>
</li>
<?php
}
?>
</ul>
<?php

Sorted by most popular post, with the most read post at the top.

Can it be done ?

5 Oct 23, 2008 11:10

i always choose the simpliest way concerning the circumstances (:

you want one stable page listing the titles of the articles and that's it right ?

so duplicate the .../index.php in the root rename it (let's say popularity.php) and set it to $orderby = 'views'..

and in order to display titles only, duplicate your current skin and rename it (let's say myskin2)...remove the skin_include( '_item_content.inc.php' part in the index.main.php..

and open up popularity.php and add $skin = 'myskin2';

now you have a stable page displaying permanent url (titles)s of the posts sorted by views... if you want it to filter posts from all blogs, not only default blog; you can create and aggregated blog and set it as default.. try it and if sth doesnt do like you wanted it to; we ll look into it.. good luck


Form is loading...