MyBB Community Forums

Full Version: [Download] MyBB Statistics Signature
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
So, um, I was tired of not knowing how to get a statistics signature for my website, so I finally decided to look for how to do it, and I did. Thanks to http://php.net I can finally do it, and I don't want everyone else to be in the dark as well, so here is a free download on how to do it, not really a tutorial, but I didn't know where else to put this. :/


Just so people know, it's to make a signature like the one I have.

Also, statsig2 has the information reversed, as in, it has the link at the top of the sig and the information at the bottom.
More a plugin that a tutorial really, moved to releases Smile

One thing I will say though is this... instead of doing:

//This Calculates Your Total Posts
$total_posts_query = mysql_query("SELECT * FROM ".TABLE_PREFIX."posts");
$total_posts = mysql_num_rows($total_posts_query);

//This Calculates Your Total Members
$total_members_query = mysql_query("SELECT * FROM ".TABLE_PREFIX."users");
$total_members = mysql_num_rows($total_members_query);

//This Calculates Your Total Threads
$total_threads_query = mysql_query("SELECT * FROM ".TABLE_PREFIX."threads");
$total_threads = mysql_num_rows($total_threads_query);

Maybe do:

//This Calculates Your Total Posts
$total_posts = mysql_query("SELECT COUNT(*) FROM ".TABLE_PREFIX."posts");

//This Calculates Your Total Members
$total_members = mysql_query("SELECT COUNT(*) FROM ".TABLE_PREFIX."users");

//This Calculates Your Total Threads
$total_threads = mysql_query("SELECT COUNT(*) FROM ".TABLE_PREFIX."threads");

Otherwise you'll have a huge array of all of the posts, users and threads, this should be much faster.
K, thanks, I'm not that great at PHP, just looked it up to make this, so yeah, I'll change the download real quick. Wink

I also gave you credit for the help in the file.
Nice work in progress, may I suggest that the forum name be on the first line and the stats on the 2nd?
Alright, well, I'll make that an alternate download, however, it's pretty easy to do yourself. xD
How many queries makes this plugin?, how this plugin works?, well, when it makes the thread count?.

I think this plugin is good, but maybe server intensive. ¿?
Looks to me as if you'd have 3 huge queries every time the image is displayed - that will stress the server...

I think Labrocca's way to use the cache is much better...
Like I said, I'm not that great with PHP, I just read up to make this. :/
Hi,

what's the licence of this file? Maybe we can work together to perfect it. If it's a free licence (for example GPLv3?) I would contribute some caching possibilities. Wink
I haven't went into License specifics yet, however, I don't want a link to the Pharmaboards in it. Toungue
Pages: 1 2 3 4 5 6 7