boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Hacks] B2 Stats
Goto page 1, 2, 3 ... 9, 10, 11  Next
 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Fri Aug 16, 2002 5:43 pm    Post subject: [Hacks] B2 Stats Reply with quote

Due to many minor errors, I have updated the b2stats.php, now just download it @ http://www.orientek.net/kore/gamerz/files/b2stats.zip

You should not change anything except the layout. The tables names has been intergrated to b2, so you do not need to change it like last time.

The demo of b2stats.php is http://www.orientek.net/kore/gamerz/b2stats2.php

Thanks =)
_________________

++ GamerZ.Per.Sg - Complex Simplicity


Last edited by GamerZ on Sun Jan 05, 2003 4:41 pm; edited 6 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Fri Aug 16, 2002 5:43 pm    Post subject: Reply with quote

ops forgot to post the ouput

here is it

http://www.orientek.net/kore/gamerz/b2stats.php
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
seeya



Joined: 13 Jul 2002
Posts: 32
Location: Singapore

PostPosted: Sat Aug 17, 2002 12:20 am    Post subject: Reply with quote

seems nice .. but i don't use as i cannot access my ftp .. argh !!!!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
zootsuit



Joined: 17 May 2002
Posts: 14

PostPosted: Mon Aug 19, 2002 2:34 am    Post subject: Reply with quote

very nice
Back to top
View user's profile Send private message
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Mon Aug 19, 2002 5:12 am    Post subject: Reply with quote

hehe added in some more startts updating the code when i get home
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
seeya



Joined: 13 Jul 2002
Posts: 32
Location: Singapore

PostPosted: Mon Aug 19, 2002 7:38 am    Post subject: Reply with quote

gamerz then pro Smile
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Tue Aug 20, 2002 4:46 pm    Post subject: Updated Reply with quote

Updated It.

[php:1:de031565ae]
<?
// Start Connect To MYSQL
include ("blog.header.php");
include("refererLib.php");
dbconnect();

// Basic MYSQL Queries
$a = mysql_query('SELECT COUNT(DISTINCT ID) FROM gamerz_b2posts') or die(mysql_error());
$totalposts = mysql_result($a, 0);

$b = mysql_query('SELECT COUNT(DISTINCT comment_ID) FROM gamerz_b2comments') or die(mysql_error());
$totalcomments = mysql_result($b, 0);

$c = mysql_query('SELECT COUNT(DISTINCT comment_author) FROM gamerz_b2comments') or die(mysql_error());
$commentsposters = mysql_result($c, 0);

// Output General Stats
echo "<div class=\"Title\">» Generals Stats</div>\n";
echo "<b>".$totalposts."</b> Posts<br>\n";
echo "<b>".$totalcomments."</b> Comments<br>\n";
echo "<b>".$commentsposters."</b> Different Nicks Were Represented In The Comments\n";
echo "<br><br>";

// Latest 5 Blog Entries
echo "<br><br><div class=\"Title\">» Latest 5 Blog Entries</div>\n";
$query = "SELECT ID, post_title FROM gamerz_b2posts ORDER BY post_date DESC LIMIT 5";
$result = mysql_query($query);
while ($data = mysql_fetch_row($result)) {
echo "<b>+</b> <a href=\"http://www.orientek.net/kore/gamerz/index.php?p=$data[0]\">$data[1]</a><br>\n";
}

// Latest 5 Comments
echo "<br><br><div class=\"Title\">» Latest 5 Comments</div>\n";
$query = "SELECT ID, post_title, comment_author, comment_date FROM gamerz_b2posts, gamerz_b2comments WHERE gamerz_b2posts.ID=gamerz_b2comments.comment_post_ID ORDER BY gamerz_b2comments.comment_date DESC LIMIT 5";
$result = mysql_query($query);
while ($data = mysql_fetch_row($result)) {
echo "<b>+</b> $data[3] - $data[2] (<a href=\"http://www.orientek.net/kore/gamerz/index.php?p=$data[0]\">$data[1]</a>)<br>\n";
}

// Top 5 Most Commented Blog
echo "<br><br><div class=\"Title\">» 5 Most Commented Blogs</div>\n";
$query = "SELECT ID, post_title, COUNT(gamerz_b2comments.comment_post_ID) AS 'commentstotal' FROM gamerz_b2posts , gamerz_b2comments WHERE gamerz_b2posts.ID=gamerz_b2comments.comment_post_ID GROUP BY gamerz_b2comments.comment_post_ID ORDER BY commentstotal DESC LIMIT 5";
$result = mysql_query($query);
while ($data = mysql_fetch_row($result)) {
echo "<b>+</b> <a href=\"http://www.orientek.net/kore/gamerz/index.php?p=$data[0]\">$data[1]</a> ($data[2] Comments)<br>\n";
}

// Comments' Members Stats
echo "<br><br><div class=\"Title\">» Comments' Members Stats</div>\n";
echo "<table bgcolor=\"$tableborder\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\">\n";
echo "<tr>\n";
echo "<td>\n";
echo "<table cellspacing=\"1\" cellpadding=\"2\">\n";
echo "<tr>\n";
echo "<td bgcolor=\"$topcell\"><b>No.</b></td>\n";
echo "<td bgcolor=\"$topcell\"><b>Members' Nickname</b></td>\n";
echo "<td bgcolor=\"$topcell\"><b>Members' Posts</b></td>\n";
echo "</tr>\n";
// Comments' Members Stats - MYSQL
$e = mysql_query("SELECT comment_author, COUNT(*) AS 'total' FROM gamerz_b2comments GROUP BY comment_author ORDER BY total DESC") or die(mysql_error());
$i=1;
while ($data = mysql_fetch_row($e)) {
echo "<tr>\n<td bgcolor=\"$menucell\">".$i."</td>\n";
echo "<td bgcolor=\"$menucell\">".$data[0]."</td>\n"; // holds the name
echo "<td bgcolor=\"$menucell\">".$data[1]."</td>\n</tr>\n"; // holds the number of comments
$i++;
}
echo "</table>\n</td>\n</tr>\n</table>\n";
echo "</td>\n</tr>\n";


// Categories Stats
echo "<br><br><div class=\"Title\">» Categories Stats</div>";
echo "<table bgcolor=\"$tableborder\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\">";
echo "<tr>";
echo "<td>";
echo "<table cellspacing=\"1\" cellpadding=\"2\">";
echo "<tr>";
echo "<td bgcolor=\"$topcell\"><b>Category Name</b></td>";
echo "<td bgcolor=\"$topcell\"><b>Posts In Category</b></td>";
echo "</tr>";
$e = mysql_query("SELECT cat_name , COUNT(*) AS 'total' FROM gamerz_b2posts , gamerz_b2categories WHERE gamerz_b2posts.post_category=gamerz_b2categories.cat_ID GROUP BY gamerz_b2posts.post_category ORDER BY total DESC") or die(mysql_error());
while ($data = mysql_fetch_row($e)) {
echo "<tr>\n<td bgcolor=\"$menucell\">".$data[0]."</td>\n"; // holds the cat name
echo "<td bgcolor=\"$menucell\">".$data[1]."</td>\n</tr>\n"; // holds the post in the cat
}
echo "</table>\n</td>\n</tr>\n</table>";

// Referers Stats
echo "<tr>\n<td>\n";
echo "<br><br><div class=\"Title\">» Referers Stats</div>";
$list = topRefererList(10,"global");
foreach ($list as $link){
print "$link<BR>";
}
echo "</tr>\n</td>\n</table>\n";
?>
[/php:1:de031565ae]
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Tue Aug 20, 2002 5:09 pm    Post subject: Reply with quote

Updated the demo page too : http://www.orientek.net/kore/gamerz/b2stats.php
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Tanner



Joined: 06 Jul 2002
Posts: 55
Location: Germany

PostPosted: Tue Aug 20, 2002 8:06 pm    Post subject: Reply with quote

Cool! :lol:
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
zootsuit



Joined: 17 May 2002
Posts: 14

PostPosted: Tue Aug 20, 2002 8:11 pm    Post subject: Reply with quote

I can't seem to draw it in to my site. maybe I'm being braindead today.
Back to top
View user's profile Send private message
dotdotspace



Joined: 15 Mar 2002
Posts: 138
Location: Seattle, WA

PostPosted: Thu Aug 22, 2002 12:59 am    Post subject: Reply with quote

GamerZ, i'm working on modding your code to make it easier for it to integrate into b2. Smile

basically since blog.header.php includes b2config.php, and you're including blog.header.php, i thought i'd use variables where you hardcoded the info. i also added a $blogfilename variable to store the exact filename of the person's b2, just to streamline the code.

i'll edit this post when i verify that it works. i'll email it to you so you can test it. i'll also write a readme, and make a zip with b2stats.php, refererLog.php, the readme, and give credit to the guy who wrote refererLog.php since the source code is available on his website.

simple hack, small distro.

edit 1: b2stats.php requires that you be running b2 v0.6, and not my outdated 0.5.1. Smile


Last edited by dotdotspace on Thu Aug 22, 2002 3:32 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Thu Aug 22, 2002 1:43 am    Post subject: Reply with quote

Wow thanks man =)
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
dotdotspace



Joined: 15 Mar 2002
Posts: 138
Location: Seattle, WA

PostPosted: Thu Aug 22, 2002 3:33 am    Post subject: Reply with quote

a preliminary stats file is available here. the readme will probably need reworking, but hey.. it's my first readme file!

Last edited by dotdotspace on Thu Aug 22, 2002 3:46 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
zootsuit



Joined: 17 May 2002
Posts: 14

PostPosted: Thu Aug 22, 2002 3:35 am    Post subject: Reply with quote

dot all I'm getting at that link is this:

Quote:
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


no source either
Back to top
View user's profile Send private message
dotdotspace



Joined: 15 Mar 2002
Posts: 138
Location: Seattle, WA

PostPosted: Thu Aug 22, 2002 3:46 am    Post subject: Reply with quote

i fixed the link. it should've been to a zip file and not a php file..
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Goto page 1, 2, 3 ... 9, 10, 11  Next
Page 1 of 11

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group