Log in

View Full Version : Total Thread Views?


fasteddie
09-01-2005, 05:16 AM
I've been searching for total thread views for a forum hack, but I can't find it anywhere.

I want what BoxerWorld (www.boxerworld.com/forums) has:

Boxer Board Statistics

Threads: 70,542, Posts: 616,988, Members: 33,720, Thread Views: 17,293,396

I can't find the hack. Help please! THANKS!

I've been searching for total thread views for a forum hack, but I can't find it anywhere.

I want what BoxerWorld (www.boxerworld.com/forums) has:

Boxer Board Statistics

Threads: 70,542, Posts: 616,988, Members: 33,720, Thread Views: 17,293,396

I can't find the hack. Help please! THANKS!

Anyone got any ideas at all? Please? Pretty please? ;)

I've been searching for total thread views for a forum hack, but I can't find it anywhere.

I want what BoxerWorld (www.boxerworld.com/forums) has:

Boxer Board Statistics

Threads: 70,542, Posts: 616,988, Members: 33,720, Thread Views: 17,293,396

I can't find the hack. Help please! THANKS!



Anyone got any ideas at all? Please? Pretty please? ;)

Anyone got any ideas at all? Please? Pretty please? ;)

fasteddie
09-02-2005, 06:35 AM
I've been searching for total thread views for a forum hack, but I can't find it anywhere.

I want what BoxerWorld (www.boxerworld.com/forums) has:

Boxer Board Statistics

Threads: 70,542, Posts: 616,988, Members: 33,720, Thread Views: 17,293,396

I can't find the hack. Help please! THANKS!



Anyone got any ideas at all? Please? Pretty please? ;)



Anyone got any ideas at all? Please? Pretty please? ;)

Does anybody know? TIA!

Logician
09-02-2005, 09:28 AM
This looks like a hack request so IMO the forum is wrong but nevermind..

(Assuming you use vb 3.0.x)
Edit index.php, find:


// ### LOGGED IN USERS #################################################


before that add:

// Logician Hack: Calculate Board View Count
$boardviews = $DB_site->query_first("SELECT SUM(views) AS threadviews FROM " . TABLE_PREFIX . "thread");
$totalviews = number_format($boardviews[threadviews]);
// Logician Hack: Calculate Board View Count


Then add $totalviews to somewhere in your forumhome template.

IMPORTANT WARNING: If you have too many threads or too many visitors, this is NOT a performance friendly hack. It puts a burden on your forum home page as it is a pain for MYSQL to compile this stats everytime forum home page is loaded. If you have a small and low traffic forum, you can use it but I dont suggest it installed in a large or high traffic forum.
[/End of Warning]

The performance friendly way of doing it is to index threadviews column in thread table AND tie this code to a vb cron and make it post to the datastore, then read the stats from there but well it requires some work so this is all I can offer. If you want a better version, I'd suggest your request to post it to Hack requests forum.

fasteddie
09-03-2005, 01:31 AM
AWESOME. THANK YOU so much. Can I use this in conjunction with the cached stats hack?

arena
01-26-2007, 12:24 AM
For 3.6.4 work?