Thread: Count script.
View Single Post
  #6 (permalink)  
Old 10-09-2006, 12:19 AM
chad90382 chad90382 is offline
Casual Pligger
 
Join Date: May 2006
Posts: 30
Thanks: 8
Thanked 10 Times in 6 Posts
Thumbs up updated Count Script

this is an update to LG's script
just gives the users alot more information than just total members and links...

it also gives a total for comments, categories, pageviews, tags and votes!


--------------------------------

1st step, make a count.php and put the following simple code:

PHP Code:
<?php
// Count script by LG-2. Gets the rows in MySQL and outputs them.
mysql_select_db($db);
$result mysql_query"SELECT * FROM users" )
or die(
"SELECT Error: ".mysql_error());
$num_rows mysql_num_rows($result);
$result2 mysql_query"SELECT link_id FROM links" )
or die(
"SELECT Error: ".mysql_error());
$num_links mysql_num_rows($result2);
$result3 mysql_query"SELECT comment_id FROM comments" )
or die(
"SELECT Error: ".mysql_error());
$num_comments mysql_num_rows($result3);
$result4 mysql_query"SELECT category__auto_id FROM categories" )
or die(
"SELECT Error: ".mysql_error());
$num_categories mysql_num_rows($result4);
$result5 mysql_query"SELECT pv_id FROM pageviews" )
or die(
"SELECT Error: ".mysql_error());
$num_pageviews mysql_num_rows($result5);
$result6 mysql_query"SELECT tag_link_id FROM tags" )
or die(
"SELECT Error: ".mysql_error());
$num_tags mysql_num_rows($result6);
$result7 mysql_query"SELECT vote_id FROM votes" )
or die(
"SELECT Error: ".mysql_error());
$num_votes mysql_num_rows($result7);
?>

2nd step is to place this somewere on your site (of course change the text to fit your personal site)
I myself put it in libs/sidebarstories.php...

PHP Code:
include('count.php'); 

            echo 
" TVB Members: <font class=h5red>$num_rows  </font> <br>";
            echo 
"TVB Videos: <font class=h5red>$num_links</font><br>";
            echo 
"TVB Votes: <font class=h5red>$num_votes</font><br>";
            echo 
"TVB Comments: <font class=h5red>$num_comments</font><br>";
            echo 
"TVB Categories: <font class=h5red>$num_categories</font><br>";
            echo 
"TVB Tags: <font class=h5red>$num_tags</font><br>";
            echo 
"TVB Page Views: <font class=h5red>$num_pageviews</font>"
just wanted to share this update with the community
thatvideoblog.com
Reply With Quote
The Following 4 Users Say Thank You to chad90382 For This Useful Post: