Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #1  
Old 07-26-2005, 02:36 AM
ibejo Offline
pp veteran
 
Join Date: Jun 2005
Location: Florida
Posts: 68
Send a message via Yahoo to ibejo
Total Comments?

Anyone know of a addon/hack/mod to get the total comments for the site (sum of all comments)?

thanks!

James
__________________
James
ColorBlind Photography
http://www.colorblindphotography.com
Reply With Quote
  #2  
Old 07-26-2005, 08:52 PM
Janny Offline
forum loafer
 
Join Date: Jul 2005
Location: Germany - Sommerhausen
Posts: 6
Send a message via ICQ to Janny
Hey James,

to see the total number of comments on your site you must put this in the index.php of the Pixelpost-file

Code:
// Get number of comments in database
$commentnumb = sql_array("select count(*) as count from ".$pixelpost_db_prefix."comments where datetime<='$datetime'");

$pixelpost_commentnumb = $commentnumb['count'];

$tpl = str_replace("<ALL_COMMENTS>",$pixelpost_commentnumb,$tpl);
Now you can place <ALL_COMMENTS> anywhere on your site.

To see the total number of comments in the adminpanel search this in the index.php of the admin-file
Code:
// list of comments
    if($_GET['id'] == "") {
        echo "<div id='jcaption'>List of Comments - delete at will</div><div id='content'><ul>";
and change it to this
Code:
// list of comments
    if($_GET['id'] == "") {
    $commentnumb = sql_array("select count(*) as count from ".$pixelpost_db_prefix."comments");
    $pixelpost_commentnumb = $commentnumb['count'];
     echo "<div id='jcaption'>List of Comments - delete at will || <strong><span id='photonumb'>$pixelpost_commentnumb</span> comments at all in the database</strong></div><div id='content'><ul>";
__________________
Janny
Reply With Quote
  #3  
Old 07-26-2005, 09:35 PM
raminia's Avatar
raminia+ Offline
Team Pixelpost
 
Join Date: Jan 2005
Location: FL, US
Posts: 3,706
Send a message via Yahoo to raminia
to see the number of all comments in the admin panel you can use the stats.php addon. the old stat addon report some of these usefull info. It will fail to report correct info about visitors since v1.4.2 and it needs an upgrade but till then you can relay on its other info like Number of comments and number of comments per photo and things like that.

@ Janny and James
to have the number of all comments in the photoblog you can use the same addon and modify it. you can use this modification too. but PLEASE do this as an addon. no need to modify the index.php. you can do it inside an addon very simply. just put these line inside an addon. and save it as my_addon.php and upload it to the addons folder of your photoblog. then use the tag.
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7
Reply With Quote
  #4  
Old 07-26-2005, 09:59 PM
ibejo Offline
pp veteran
 
Join Date: Jun 2005
Location: Florida
Posts: 68
Send a message via Yahoo to ibejo
Thanks for the reply everyone! Excellent!
__________________
James
ColorBlind Photography
http://www.colorblindphotography.com
Reply With Quote
  #5  
Old 07-27-2005, 12:47 AM
Janny Offline
forum loafer
 
Join Date: Jul 2005
Location: Germany - Sommerhausen
Posts: 6
Send a message via ICQ to Janny
Quote:
Originally Posted by raminia
to see the number of all comments in the admin panel you can use the stats.php addon.
Right, I can use this if I would like to see the information on the addon site. But if I would like to see it on the comments site as on the image site, I have to change the admin index.php, haven't I? Please correct me if it's wrong.

Quote:
Originally Posted by raminia
to have the number of all comments in the photoblog [...] but PLEASE do this as an addon. no need to modify the index.php.
Sorry, I didn't know, how I have to make a new addon. That's why I had modified the index.php. But now I know how it works, thanks.
__________________
Janny
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 12:28 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs