![]() |
This hack was done by Kier, just wanted to post it in its own thread :)
What It Does Counts all the views for each thread and adds them together. Basically a sum of the pageviews for all of your threads. How To Implement This Copy and paste this code into index.php in the regular forum directory. PHP Code:
Example: http://www.systemlogic.net/boards on the top left next to the number of posts/threads stats. |
good hack min :D
|
This is a cool little hack, I've just implemented it with no problems other than my own stupidity (I forgot to upload the new index.php -- d'Oh!).
Anyway, after I installed it and looked at it (I put the output on a new line under the thread and post counts), it occurred to me that if you've imported from UBB (as I have), this isn't really a true count. UBB doesn't keep track of thread views, so however many you had while using UBB don't count. Your actual number may be a little higher or much higher; there's no real way to know. This is not a criticism; I don't mean to rain on this parade. I'm just pointing it out, that's all. |
nice :)
|
Quote:
|
Good idea! Thx for repost it as a own thread.:)
|
great little hack!!
I have added this feature on my forum ^_^ thanks |
As far as the ubb missing views, could you add a little saying as of May 7, 2001 or something like that. If so how would I do that?
Dan |
where do I insert this at?
what line number? And what about adding "Thread views since"" Like posted above Great idea. |
That was just an idea I had. I would like to know as well. Any hackers interested.
|
easy dude
Just insert $totalviews since 1-5-01 into where you want it on your forum home template :) |
Well, it's very simple. Where ever you stick the $totalviews, just put the text by that. For example, if you put it in your forumhome template, so it's below your total threads and total posts, as I did, like this:
Code:
<b>$totalviews</b> total thread views Code:
<b>$totalviews</b> total thread views since May 7, 2001 |
Where do you paste the code at, in the index.php? Anywhere special.
Can someone give an example of placement. Thanks Dan |
in the forum home template
Put it under launch buddy list or wherever |
Quote:
|
Thanks very much,
What about the index.php file I need to edit. Where should I put the code it's says in the above post. It say cut and paste this code into the index.php file. |
just find a place... like under total posts in index.php
|
I can't find total posts in the index.php file. Can someone cut out a small part of this file were they have this code placed in the index.php file?
// Total Thread Views $boardviews = $DB_site->query_first(" SELECT SUM(views) AS threadviews FROM thread"); $totalviews = number_format($boardviews[threadviews]); |
In index.php, look for this:
Code:
// get newest member This is how mine looks: PHP Code:
|
Worked like a charm. I was getting messed up because I didn't realize at first there are two index files.
|
Very cool hack :)
Thanks for posting it. Olly |
Thanks for the hack, very nice.
Is there any way to include this hack onto a Non-VB page? I've added the correct code into my /forums/index.php.. and then I made a new file named totalthreadviews.inc.php with this code: Code:
<?php Any ideas on this one? |
Very nice and simple hack, appreciated :)
|
That's a great hack, thanks alot :D
Any change of putting this into the "stats" in the VB control panel to give more of a per day/week/month effect listing? |
If you want the views displayed without a "," then use this code instead:
PHP Code:
|
Thanks for the hack. Works Great
Joey;) |
Quote:
Gr??e nach Reinbek, -Tom |
i tried to post that code in the index.php file but it did not work .... can some body add this hack to that file and put it for downloading plz.:(
|
Hack works great.
How would someone also add under a members profile the total amount of page views that member has? |
I think im the only one who cant get this hack to work :(
I did two things as instructed - add that piece of code in my /forums/index.php file exactly the same way JJR512 did it and I added <b>$totalviews</b> total thread views - in the forum home template When I refreshed - all i saw was total thread view with no number next to it :( Whats wrong? Thanks in advance - im using v2.0.1 btw |
Here is how I have mind setup in the forumhome template.
Registered Members: <b>$numbermembers</b><br> Total Threads: <b>$totalthreads</b> | Total Posts: <b>$totalposts</b> | Total Views: <b>$totalviews</b><br> |
This is what my index.php looks like.
$totalthreads=$countthreads['threads']; if ($totalthreads=='') { $totalthreads=0; } // Total Thread Views $boardviews = $DB_site->query_first(" SELECT SUM(views) AS threadviews FROM thread"); $totalviews = number_format($boardviews[threadviews]); |
Webhost
I thought u were just suppose to add // Total Thread Views $boardviews = $DB_site->query_first(" SELECT SUM(views) AS threadviews FROM thread"); $totalviews = number_format($boardviews[threadviews]); How come you got some extra code above this? btw - pardon my lack on php knowledge - but are there permissions set for php files? |
yes code above above ties in with something else.
Email me your index.php and forumhome template for me to look at to joeymoses1@home.com |
Here you go Webhost or anyone else who is willing 2 help me out :) - I copied and pasted the forum home template source in a txt file
Thanks :) This is how i edited the index.php file - I went to my ftp proggy (Cute FTP) first I made a backup of the index file by downloading it on my harddisk - then I right clicked and edited the index file from my uploaded version - it opened into notepad - then added the code - and uploaded the amended version.. I take it php files do not have chmod permissions, do they? |
Try inserting the bold item below
// Total Thread Views $boardviews = $DB_site->query_first(" SELECT SUM(views) AS threadviews FROM thread"); $totalviews = number_format($boardviews[threadviews]); }<--- I think you need that // get newest member $getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbersmembers[max]"); $newusername=$getnewestusers['username']; $newuserid=$getnewestusers['userid']; |
Love this simple hack. Got it installed on my boards. Good job!
|
webhost mate - tried that = still no joy :(
I guess this hack doesnt wanna work on my board! ( sob sob) Anybody got any other ideas? |
try uploading this index.php file, first backup your file on your hardrive then delete the index.php file on your server and upload this one.
[Zip Removed -- don't post full source code!] |
lukman give a url to your board
|
All times are GMT. The time now is 03:51 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|