number of comments, trackbacks, entries, & when last upd

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

number of comments, trackbacks, entries, & when last upd

Post by carl_galloway »

Hi all,

Is there a quick easy way of calling some variables that allow me to place the total number of comments, total number of trackbacks, total number of entries, and when the blog was last updated into index.tpl?

Would I need to create a config.inc.php, and if so what do I need to do to start the ball rolling.

Carl
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: number of comments, trackbacks, entries, & when last

Post by garvinhicking »

Hi!

Such variables are not available by default, because they would require some intense DB lookups you don't want to perform on each page call.

However I've added a new smarty function for 1.0 and 1.1 that you can call like this:

Code: Select all

Total Entries: {serendipity_getTotalCount what='entries'}<br />
Total Comments: {serendipity_getTotalCount what='comments'}<br />
Total Trackbacks: {serendipity_getTotalCount what='trackbacks'}<br />
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply