Recent Topics

1 Feb 02, 2007 17:45    

In the http://manual.b2evolution.net/Main.php_file Docs I found this piece of code:

<?php 
     $TOPART = new ItemList($blog, array(), '', '', -1, '', array(), '', 'DESC', 'views', 4); 
     echo "<ul>"; 
     while ($TOPART_ITEM = $TOPART->get_item()) { 
     echo "<li><a href=\"", $TOPART_ITEM->get_permanent_url(); 
     echo "\">", $TOPART_ITEM->title('','',false), "</a>"; 
     } 
     echo "</ul>"; 
 ?> 


and I was wondering what the values are for where now 'views' is inserted. I can't find the source of the code in the distro. Pointing out in wich php file it is might help me also.

2 Feb 03, 2007 07:25

$Item->views();

will display the views.

imho your better off using the technical docs at http://doc.b2evolution.net if you want to find out how what stuff you can use. Or the best way would just be to look at how your skin (or another skin) does it.

3 Mar 22, 2007 11:01

Hmm, couldn´t get it working... always returns Fatal error: Call to a member function on a non-object ...

Where exactly I have to insert

$Item->views();

in the TOP-List hack?

4 Mar 22, 2007 16:28

You need to use $TOPART_ITEM->views(); ;)

¥

5 Mar 22, 2007 20:17

Ok... right, but this returns "xxx views"; how can I just return the number of views as simple number?

6 Mar 23, 2007 07:52

echo $TOPART_ITEM->views;

;)

¥

7 Mar 23, 2007 13:36

Perfect; thanks again!!!


Form is loading...