vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Statistics Modifications - Live Forum Statistics on All Pages in Forum Header (https://vborg.vbsupport.ru/showthread.php?t=128863)

Neutral Singh 10-11-2006 10:00 PM

Live Forum Statistics on All Pages in Forum Header
 
Live Forum Statistics on All Pages in Header Template
Plugin Keywords: Member info,Statistics, Members, New Members, Forum, Statistics, Member Info, Forum, Stats,

Please Don't Forget to Click Install

Requested by :
Myself :devious:

Context :
Searched through vb.org but could not find a similar plugin/hack. I wanted to show all vital forum stats like total posts, total threads, total members and newest member on each page of my forum as well as vBa CMPS, in header template and this plugin performs exactly the same function.

What this plugin does ?
This plugin uses the 'global_start' hook and stores the desired information from your forum database into php variables and when called in 'header 'template, produces the desired results.

Utility :
Imagine... an unregistered/guest visits your website for the first time via a search engine link (95% of times its not the homepage that is found via a search engines link) and the first thing s/he notices is the forum header information and says wow!! this forum has got xxxx members, xxxxx threads, xxxxxx posts, why not get registered with this community and see what this forum has got in store for me. LOL!! quite true actually. ;)

Demo : http://www.sikhphilosophy.net

Any Screenshots : Demo is self-explanatory.

Warning : This plugin executes 5 queries per pageload.

Installation Instructions : (Also attached alongwith the plugin.)
Code:

Step by Step Instructions:
1. Ofcourse, download the Plugin.
2. Go to 'Plugin System' module in vb admin panel and click 'Download/Upload Plugins'.
3. Towards the botton of next screen, you will see a box table - 'Import Plugin Definitions XML File'. Click the 'Browse' button and select the Plugin Definitions XML File downloaded and saved somewhere on your computer. Click the 'Import' button and well... you are not quite yet done. LOL!!
4. Ok, Now go to Styles & Tempalte --> 'Styles Manager' and select the 'Common Templates' option from drop down menu and click the 'Go' button.
5. In the header template:
 
Find: (ususally at the end of the template file)
<!-- content table -->
$spacer_open
 
$_phpinclude_output
 
 
 
Add Above:
<!-- Forum Stats in Header Template -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td>
    <div align="left"><span class="smallfont">| <b>Discussions:</b> $totalthreads | <b>Messages:</b> $totalposts | <b>Members: </b>$numbermembers | <b>Online: </b>$totalonline </b> | <b>Newest :</b> <a href="$vboptions[bburl]/member.php?u=$newuserid"><b>$newusername</b></a> (Welcome!)
</span></div>
    </td>
</tr>
</table>
<!-- Forum Stats in Header Template -->

Ofcourse you can customise this code to suit your website setup. ;)

9. And, now finally you are done! :)


Enjoy!!

Please Don't Forget to Click Install

Shazz 10-12-2006 01:18 AM

Looks very cool, would be nice for big forums :)

Barakat 10-12-2006 05:04 AM

installed >>>>>>>

eXtremeTim 10-12-2006 05:25 AM

there are much better ways to accomplish this without having 5 extra queries per page.

shadowevil 10-12-2006 05:49 AM

<font color="SeaGreen">*Installed*</font>

Snake 10-12-2006 08:41 AM

Thanks.

Acido 10-12-2006 11:32 AM

Quote:

Originally Posted by eXtremeTim
there are much better ways to accomplish this without having 5 extra queries per page.

But this is the only way published as vb add-on.
Quite strange :rolleyes:

Kihon Kata 10-12-2006 12:47 PM

Get to work, Tim ;)

Quote:

Originally Posted by eXtremeTim
there are much better ways to accomplish this without having 5 extra queries per page.


Neutral Singh 10-12-2006 01:25 PM

oh! i would love that if queries could be eliminated in live update of statistics... :) Thanks.

phpdevrus 10-12-2006 08:35 PM

hmmm why do you need to requery for this information when it is already done by vb? cant you just pull those variables into the header? that was they only need to be done once and will not add queries to show the same information twice.

just an idea.

Neutral Singh 10-13-2006 12:23 AM

I am yet to find ways to show that information in the header... if we could do that it would fine. :)

Acido 10-13-2006 05:16 AM

May be using a cron each X Minutes to store the variables?

yesfans 10-13-2006 01:14 PM

Only thing I did not like on this one is that it put the info on my main forums page also which I didn't want. Anyway to out on all pages but the main front page?

Neutral Singh 10-19-2006 01:01 AM

Quote:

Originally Posted by yesfans
Only thing I did not like on this one is that it put the info on my main forums page also which I didn't want. Anyway to out on all pages but the main front page?

Simple cover the code with the following conditionals like below:

Code:

<if condition="THIS_SCRIPT != 'forumhome'">

<!-- Forum Stats in Header Template -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td>
    <div align="left"><span class="smallfont">| <b>Discussions:</b> $totalthreads | <b>Messages:</b> $totalposts | <b>Members: </b>$numbermembers | <b>Online: </b>$totalonline </b> | <b>Newest :</b> <a href="$vboptions[bburl]/member.php?u=$newuserid"><b>$newusername</b></a> (Welcome!)
</span></div>
    </td>
</tr>
</table>
<!-- Forum Stats in Header Template -->

</if>



rareclownfish 11-05-2006 12:05 AM

I'm trying to get your hack to work on phpportals, do you have any idea how to?

iran.gs 12-13-2006 02:28 PM

Very nice Installed 3.64 vb

spazz191 02-11-2007 07:31 PM

This is a great hack. I installed it but the counts don't match up to my VB stats. It looks like it is counting hidden and deleted posts too. Is there a way around this or a fix in the future.
I will uninstall till then, if fixed will click installed.

shete 02-12-2007 04:14 AM

Very nice ... one minor bug though ... when i click on " New Posts "

the information becomes blank on that page .... weird

superluks 02-14-2007 10:06 PM

One tiny bug - it shows softly deleted messages and topics in static.

akulion 02-25-2007 10:14 PM

thanks man this is just sweet!! works for 3.6.4 perfectly

installed :D

Invalid ID 03-01-2007 03:10 PM

Sardar Jee, tussi great ho :)

rezapci 03-01-2007 03:41 PM

good good good

Jason Black 10-21-2007 11:43 AM

screen shoots please?

JohnBee 11-22-2007 03:46 PM

Quote:

Originally Posted by eXtremeTim (Post 1095177)
there are much better ways to accomplish this without having 5 extra queries per page.

I for one would love to see this. Based on your response to others following your fantastic claim, I guess we can assume the validity of your statement.

yuriy 12-26-2007 09:07 PM

This just like makes your forum look so awesome! :D i made a link to WHOS ONLINE for the Online: :p looks awesome! thank you!!

ReaperUK 01-17-2008 09:18 AM

cheers nice mod

legionofangels 01-24-2008 05:58 PM

Have you tried using different fonts with this yet to see if it's compatible as far as it's table dimensions with other fonts?

Or does your plug in allow us to modify the dimensions of the Stats table as well?

XxBuLLeTz 02-01-2008 01:54 AM

how come the stats on another vb page are different than my default stats on the forumhome.

codershark 03-03-2008 06:46 AM

any screenshots available ? running also on 3.7 ?

ericdesmontagne 03-24-2008 03:36 PM

Hello, your mod seems to extra, but can we use it with the 3.6.8 and 3.7 version of vB ? Thanks.

testebr 04-09-2008 07:56 PM

Read this topic for you understand how to save that five querys of your plugin.

testebr 04-11-2008 12:13 PM

Create new plugin:

Hook Location: init_startup

Plugin PHP Code: $datastore_fetch[] = "'userstats'";

And done, all variables enable in any template with ZERO new query.

amirlol 04-12-2008 05:56 PM

thanks

w1z4rd 08-05-2008 09:54 AM

Quote:

Originally Posted by codershark (Post 1455716)
any screenshots available ? running also on 3.7 ?

Runs using 3.7x on my test board.

Quote:

Originally Posted by testebr (Post 1488193)
Create new plugin:

Hook Location: init_startup

Plugin PHP Code: $datastore_fetch[] = "'userstats'";

And done, all variables enable in any template with ZERO new query.

Thanks for that :up:

Scovic 12-07-2008 01:29 PM

Quote:

Originally Posted by testebr (Post 1488193)
Create new plugin:

Hook Location: init_startup

Plugin PHP Code: $datastore_fetch[] = "'userstats'";

And done, all variables enable in any template with ZERO new query.

I cant get this to work.
How do I call "userstats"?

$totalthreads
$totalposts
$numbermembers etc

doesnt show anything.

Thanks

Qleb 10-13-2009 11:16 PM

i love u man

Qleb 10-13-2009 11:27 PM

to show pictures total in any where, use this in to the same plugin

add this to

admincp --> edit plugins

add it above every thing

PHP Code:

$pictures    $db->query_first("SELECT COUNT(*) AS picture,MAX(pictureid) AS max FROM " TABLE_PREFIX "picture");
$allpictures number_format($pictures['picture']); 


in template any where :

Total pictures : $allpictures

;)


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02652 seconds
  • Memory Usage 1,820KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (37)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete