Web site sig.

Want to chit chat about anything, do it here ... posting here won't increase your post count (or shouldn't!). Please do not post any "phpBB" specific topics here unless they do not fit into the category above. Do not post bug reports, feature or support requests!
Forum rules
Please do not post any "phpBB" specific topics here unless they do not fit into the category above.

Do not post bug reports, feature or support requests! No really... Do not post bug reports, feature or support requests! Doing so will make Bertie a very sad bear indeed. :(
Post Reply
User avatar
Viperal2
Registered User
Posts: 223
Joined: Tue Jun 08, 2004 9:28 pm
Contact:

Web site sig.

Post by Viperal2 »

This is the one i was to display the number of view, post and topics. this is the only wasy to get the total number of views. Note really good for big / huge forums, but for mine it fine.

It better to get the data from the bb config table (but it doesn'y have the total views :( )

Code: Select all

<?php 
define('CPG_NUKE', true);
include ('config.php');
include ('includes/db/mysql.php');

$db	= new sql_db();
$db->sql_connect($dbhost, $dbuname, $dbpass, $dbname, $dbport, false);

$numviews = $numreplies = $numtopics = 0;

$result = $db->sql_query('SELECT topic_views, topic_replies FROM '.$prefix.'_bb2topics');

while( $post3 = $db->sql_fetchrow($result) ) {
    
   $numviews = $numviews + $post3['topic_views'];
   $numreplies = $numreplies + $post3['topic_replies'];
   $numtopics++;
}

$db->sql_freeresult($result);

$numposts = $numtopics + $numreplies;

$image = 'images/signature2.png'; 
$im = imagecreatefrompng($image); 
$tc = ImageColorAllocate ($im, 0, 0, 0); 
$tc2 = ImageColorAllocate ($im, 0, 0, 255); 
 
ImageString($im, 3, 155, 5, 'Here's the Live statistics', $tc); 
ImageString($im, 2, 190, 20, 'Total Topics :', $tc);
ImageString($im, 2, 280, 20, $numtopics, $tc2);
ImageString($im, 2, 190, 30, 'Total Posts  :', $tc);
ImageString($im, 2, 280, 30, $numposts, $tc2); 
ImageString($im, 2, 190, 40, 'Total Views  :', $tc);
ImageString($im, 2, 280, 40, $numviews, $tc2); 

header('Content-Type: image/png'); 
Imagepng($im,'',100); 
ImageDestroy ($im); 
?>
What is The Viperal ?

http://developer.berlios.de/projects/viperals/" target="_blank

tapanb
Registered User
Posts: 35
Joined: Thu Aug 05, 2004 10:52 am
Location: India
Contact:

Re: Web site sig.

Post by tapanb »

Hello!

Wow! With this code i learnt how to make text based images. Now i can start my own free hit - counter service muhahahahah! :D

Thanks!

Roberdin
Registered User
Posts: 1546
Joined: Wed Apr 09, 2003 8:44 pm
Location: London, United Kingdom

Re: Web site sig.

Post by Roberdin »

You've also inpsired me to create mine. ;)
Rob

User avatar
Viperal2
Registered User
Posts: 223
Joined: Tue Jun 08, 2004 9:28 pm
Contact:

Re: Web site sig.

Post by Viperal2 »

glade it help you'll ;)
What is The Viperal ?

http://developer.berlios.de/projects/viperals/" target="_blank

User avatar
Viperal2
Registered User
Posts: 223
Joined: Tue Jun 08, 2004 9:28 pm
Contact:

Re: Web site sig.

Post by Viperal2 »

just noticed i saided Note was actually supposed be be not recommended.

As with phpBB2.2 you do a small class and grab the cached file or run a query to the config table with has almost everyithing you need, But silly me said I want the number of views.. lol. I think i change it and put the munber of users and newest user.
What is The Viperal ?

http://developer.berlios.de/projects/viperals/" target="_blank

tanfwc
Registered User
Posts: 10
Joined: Sat May 15, 2004 8:06 am
Contact:

Re: Web site sig.

Post by tanfwc »

Viperal2 wrote:glade it help you'll ;)
May i ask how about a user keying in his user name at the URL like ?name=username and he can use the sig as his own and at the same time he can advertise my forum...how do i do that?

and how about changing the font type?
tanfwc
[ + ] My HomePage
[ + ] GuestBook
[ + ] Photo Gallery
[ + ] Free Image Hosting

Post Reply