View Full Version : Thread Count
GeekyDesigns
01-15-2005, 10:00 PM
This is a small hack that will add a thread count to the postbit, but it makes it avaible to any varible that gets the whole user table, such as $bbuserinfo and $userinfo.
Included is an update function that will allow you to update the threads counts for any reason.
Shouldn't take more than 5 min to install :)
It was tested on two dev boards, there shouldn't be any issues.
Thanks to Matt and Chris Padfield :)
yoyoyoyo
01-16-2005, 08:20 PM
***clicks install***
Zachery
01-16-2005, 08:22 PM
Added a screen shot
rex_b
01-16-2005, 08:45 PM
Nice :)
Zachery
01-16-2005, 08:58 PM
Sorta suprised no one has done it before
rex_b
01-16-2005, 09:21 PM
Yah I think it would be much better if that's the count we all used instead of posts.
Guest190829
01-16-2005, 10:44 PM
Great mod guys!
* clicks install *
Mike Gaidin
01-17-2005, 12:45 AM
Sorta suprised no one has done it before
It was, but I don't think it was released here. I had requested it.
deathemperor
01-17-2005, 01:11 AM
Sorta suprised no one has done it before
they has but they didn't release here, I've seen several boards have this.
Zachery
01-17-2005, 01:31 AM
they has but they didn't release here, I've seen several boards have this.
i ment released it i did it during the betas
xmitchx
01-17-2005, 03:10 AM
I wont be using this as I have no need to but if I may suggest something:
Included is an update function that will allow you to update the threads counts for any reason.
Im not sure if thats what im about to suggest, but I suggest having a "resync thread counts" option so that the thread counts are accurate.
Boofo
01-17-2005, 03:47 AM
Sorta suprised no one has done it before
Then you haven't checked my profile. I did this quite a while ago. ;)
Boofo
01-17-2005, 03:49 AM
It was, but I don't think it was released here. I had requested it.
Mike, how soon we forget. ;)
alsfeena
01-17-2005, 06:29 AM
It didnt work with me!!
The forum and threads are working properly but no changes only showing the posts count...?
I did it as in the instruction file and finally i upgraded whole counts of my forum
lasto
01-17-2005, 09:52 AM
wots the load on this or additional queries ?
TCattitude
01-17-2005, 10:52 AM
Then you haven't checked my profile. I did this quite a while ago. ;)
I was looking for this for a weeks ago, and... nothing (in hacks, betas and also the requests fortums) :rolleyes:
Thanks GeekyDesigns, great mini hack ;)
Zachery
01-17-2005, 11:38 AM
Mike, how soon we forget. ;)
Yea I saw bob but your way can be insanely intensive unless i totaly missed how you were storing the data instead of calling it on every page view.
Snatch
01-17-2005, 11:56 AM
if i get to this URL Referer: http://www.celebritymarkt.de/admincp/misc.php?do=threadcount i get this error.
Datenbankfehler in vBulletin 3.0.5:
Ungueltige SQL-Abfrage: SELECT userid FROM user ORDER BY userid DESC LIMIT -1000, 1000
mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1000, 1000' at line 1
mysql error number: 1064
Datum: 17.01.2005 14:54:53
Skript: http://www.celebritymarkt.de/admincp/misc.php?do=threadcount&perpage=1000&page=2
Referer: http://www.celebritymarkt.de/admincp/misc.php?do=threadcount
Benutzername: Snatch
IP-Adresse:
Zachery
01-17-2005, 12:20 PM
if i get to this URL Referer: http://www.celebritymarkt.de/admincp/misc.php?do=threadcount i get this error.
Datenbankfehler in vBulletin 3.0.5:
Ungueltige SQL-Abfrage: SELECT userid FROM user ORDER BY userid DESC LIMIT -1000, 1000
mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1000, 1000' at line 1
mysql error number: 1064
Datum: 17.01.2005 14:54:53
Skript: http://www.celebritymarkt.de/admincp/misc.php?do=threadcount&perpage=1000&page=2
Referer: http://www.celebritymarkt.de/admincp/misc.php?do=threadcount
Benutzername: Snatch
IP-Adresse:
1064 is generaly dealing with memory, what version of MySQL are you running ?
BarHopper
01-17-2005, 02:29 PM
/me installed
Shack Networks
01-17-2005, 03:39 PM
Do we need to add anything to postbit as I am seeing nothing on my test forum
Zachery
01-17-2005, 03:42 PM
d'oh how could i forget that
for now use this
<div>
$vbphrase[posts]: $post[posts]
</div>
add under
<div>
$vbphrase[threads]: $post[threads]
</div>
Shack Networks
01-17-2005, 03:44 PM
Tis OK I Figured it, nice hack
I clicked Install
Shack Networks
01-17-2005, 03:49 PM
I just noticed that if you delete a thread the and update the thread count it still says it has not been deleted ?
Shack Networks
01-17-2005, 03:51 PM
Ahh my mistake once more, it does it Via admincp/misc.php?do=threadcount, I was using the wrong thing lol
Kewl hack
Zachery
01-17-2005, 04:19 PM
Ahh my mistake once more, it does it Via admincp/misc.php?do=threadcount, I was using the wrong thing lol
Kewl hack
Right now it wont delete the threadcount if the thread gets deleted, I will fix that later
Lethal
01-17-2005, 05:40 PM
Then you haven't checked my profile. I did this quite a while ago. ;)
yup, i have yours installed boofo
Nice and useful addition .. thanks
Clicked install https://vborg.vbsupport.ru/external/2005/01/2.gif
Snatch
01-17-2005, 07:58 PM
1064 is generaly dealing with memory, what version of MySQL are you running ?
I use mysql Ver 14.7 Distrib 4.1.7, for pc-linux (i386)
what can i do to fix this error ?
BarHopper
01-17-2005, 08:32 PM
d'oh how could i forget that
*cough*LMFAO*cough* :devious:
Zachery
01-17-2005, 08:34 PM
I use mysql Ver 14.7 Distrib 4.1.7, for pc-linux (i386)
what can i do to fix this error ?
Upgrade to 4.1.8 and see if it fixes the problem, if it doesnt ill figure out why it isnt running. As its running fine on my 4.1.7 and php 5.0.3 + apache 2.0.52
Snatch
01-17-2005, 08:43 PM
The hack is runnig but the threads count beginns from 0 :(
Update to 4.1.8 is not possible for me, is there no other was ?
Zachery
01-17-2005, 08:59 PM
The hack is runnig but the threads count beginns from 0 :(
Update to 4.1.8 is not possible for me, is there no other was ?
You need to be able to run the threadcount updateer for everyones threads count to start above 0
Zachery
01-17-2005, 09:00 PM
wots the load on this or additional queries ?
No additional load except when maybe rebuilding the thread count otherwise there is 0 additional pull on the database
Rambo
01-17-2005, 09:36 PM
Installed =)..
Good mod! Good Job!
Mike Gaidin
01-18-2005, 01:04 AM
Mike, how soon we forget. ;)
No, I didn't forget. I only recall it being released at your place and not here. :)
EDIT: I remember now that it was here also.
Shack Networks
01-18-2005, 04:36 PM
No idea why but using both Firefox and IE6 the threadcount page does not get page 1 ?
Any one else having this problem ?
Cheertobi
01-18-2005, 06:02 PM
Hi,
No idea why but using both Firefox and IE6 the threadcount page does not get page 1 ?
Any one else having this problem ?
jap, same problem here using IE6!
Tobias
Cheertobi
01-20-2005, 02:48 PM
Hi,
No idea why but using both Firefox and IE6 the threadcount page does not get page 1 ?
Any one else having this problem ?
is there a fix for this problem?!
Regards,
Tobi
MajorFm.com
01-31-2005, 05:08 PM
You sure this works ok? i have done everything exactly how you told me but some people have 0 threads when i know they have got some....
http://www.majorfm.com/forum/thread2925.html
AJ is me... i have done many threads but its shows as 0 but on post 3 it shows 10 threads for that user, i assume this is a problem with usergroups and is not working for mods etc...
Please advise
Zachery
01-31-2005, 09:37 PM
You sure this works ok? i have done everything exactly how you told me but some people have 0 threads when i know they have got some....
http://www.majorfm.com/forum/thread2925.html
AJ is me... i have done many threads but its shows as 0 but on post 3 it shows 10 threads for that user, i assume this is a problem with usergroups and is not working for mods etc...
Please advise
Did you rebuild thread counters?
MajorFm.com
02-01-2005, 12:54 AM
Did you rebuild thread counters?
Yes i did about 10 times just to make sure... :squareeyed:
I did "Rebuild Thread Information" in maintenence...
MajorFm.com
02-01-2005, 01:34 PM
What's going wrong...?
MajorFm.com
02-01-2005, 08:18 PM
However it is counting threads from when i installed the hack for some users and from day one for other users...
Please advise...
MajorFm.com
02-03-2005, 09:07 PM
anyone?
Zachery
02-04-2005, 02:56 AM
Don't know why it isn't working, worked in 3 of my test forums (1 without tABLE_PREFIX and two with
MajorFm.com
02-04-2005, 07:49 AM
Is there any checks i can do to fix it... i have done thread count a few times, that didnt solve it..
MajorFm.com
02-06-2005, 01:49 PM
Anyone? im using 3.0.3
It still doesnt count threads from day one on some users... is there a fix, what can i do, i really want this hack to work, its just what i was looking for...
Zachery
02-06-2005, 02:32 PM
Is it counting your new threads? Are post & thread counts enabled in the proper forums? It ignores threadcount like postcount
MajorFm.com
02-06-2005, 05:10 PM
yes it is counting the new threads and some old threads on random members but for some members its only counting new threads...
As far as i know, post and thread counts are enabled, where would i check if they are? but common sense tells me that if it wasnt enabled, the new threads would not be counted either...
MajorFm.com
02-22-2005, 04:12 PM
i just installed another stats hack and the threads is displaying properly... there must be something wrong with this... please look into it, i would appreciate it!
Zachery
05-01-2005, 04:03 PM
Wonder if anyone is still using it ? :D
MajorFm.com
05-02-2005, 08:28 PM
Wonder if this hack will ever work for me ? :-(
Zachery
05-02-2005, 08:54 PM
I don't see why its not working, or even why it wouldn't work...
Go into PHPMyAdmin and run this query, or in the vB Query runner make sure to change for table prefixes if nessary
What does this mean? Can i run the query as it is, or do I have to change it. If I have to change it; How do I do that?
Zachery
05-03-2005, 03:56 PM
Did you install vB with a table prefix?
If not
ALTER TABLE `user` ADD `threads` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL AFTER `posts` ;
otherwise
ALTER TABLE `THETABLEPREFIXGOESRIGHTHEREINSTEADOFTHISuser` ADD `threads` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL AFTER `posts` ;
I am really not sure. I did not install vB my self, but i think it was without a table prefix.. Thanks for you're reply! :)
Zachery
05-03-2005, 05:54 PM
I am really not sure. I did not install vB my self, but i think it was without a table prefix.. Thanks for you're reply! :)
You can check in config.php under the setting tableprefix, if there is anything between the '' then you have one, if theres nothing, then you don't
mholtum
05-03-2005, 06:29 PM
sweet
/me installs
webrats
05-03-2005, 06:31 PM
it sits at page 1 for me :(
Zachery
05-03-2005, 06:34 PM
it sits at page 1 for me :(
Can you be abit more specific...
webrats
05-03-2005, 06:54 PM
Can you be abit more specific...
when you do the
http:///misc.php?do=threadcount
it only does the first page then it goes to
misc.php?do=threadcount&perpage=1000&page=2
and is blank kust sits an refreshes
Zachery
05-03-2005, 06:56 PM
when you do the
http:///misc.php?do=threadcount
it only does the first page then it goes to
misc.php?do=threadcount&perpage=1000&page=2
and is blank kust sits an refreshes
Hmm... try cleraing your cache and starting again.
webrats
05-03-2005, 07:00 PM
Hmm... try cleraing your cache and starting again.
nope still just sits there after the first 1000
webrats
05-03-2005, 07:01 PM
is there a way i can just type the command in mysql and do it from shell?
webrats
05-03-2005, 07:11 PM
/misc.php?do=threadcount&perpage=2000
will work but once i add the page # is screws up
webrats
05-06-2005, 04:47 PM
anyone
Marco van Herwaarden
05-06-2005, 07:33 PM
I don't think you can set the perpage that high
webrats
05-06-2005, 09:08 PM
I don't think you can set the perpage that high
if i use the default it doesnt work
even at 10 it doesnt work
vakvak
05-07-2005, 03:10 AM
d'oh how could i forget that
for now use this
<div>
$vbphrase[posts]: $post[posts]
</div>
add under
<div>
$vbphrase[threads]: $post[threads]
</div>Where are temlate postbit_legacy, postbit to put into practice
my forum No threads: not
forum/admincp/misc.php?do=threadcount i apply
Kaishi
05-07-2005, 09:13 PM
installed flawlessly under 3.07
webrats
05-16-2005, 07:16 AM
i still cant get it count the old threads
Pain86
05-16-2005, 01:14 PM
i still cant get it count the old threads
i seem to be having the same problem... it doesnt count all the threads.. some members have 3 threads showin in their postbit when they have made more..
is there a way to fix this? :ermm:
Zachery
05-16-2005, 02:21 PM
i seem to be having the same problem... it doesnt count all the threads.. some members have 3 threads showin in their postbit when they have made more..
is there a way to fix this? :ermm:
Are all the threads they made in forums that count for posts?
Pain86
05-16-2005, 06:18 PM
hmm not sure what you mean? sorry.
:(
do you mean when they make a thread it just adds to their postcount?....
for example .. ive made over 500 threads but 106 thread count shows up in my postcount....
Zachery
05-16-2005, 07:59 PM
hmm not sure what you mean? sorry.
:(
do you mean when they make a thread it just adds to their postcount?....
for example .. ive made over 500 threads but 106 thread count shows up in my postcount....
Are the said 500 threads you have made still in the database?
Are they in forums where posts count towards post count?
Pain86
05-16-2005, 09:07 PM
yea.. all forums counts towards post count.
Pain86
05-16-2005, 09:10 PM
and all the threads are in the datebase
Pain86
05-18-2005, 11:13 AM
hi i got this error when updating threads..
Database error in vBulletin 3.0.7:
Invalid SQL: SELECT userid FROM user ORDER BY userid DESC LIMIT -1000, 1000
mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1000, 1000' at line 1
mysql error number: 1064
MajorFm.com
06-19-2005, 01:59 PM
Im glad its not just me with these count issues... when i installed it, it actually started me off at a grand total of zero... even though i know im the top thread poster on my forum...
Zachery
06-19-2005, 02:40 PM
Yes, as it should, because how the hell can a it know what you've done BEFORE you started logging them?
Thats why you rebuild the count...
MajorFm.com
06-19-2005, 02:42 PM
lmao... we have rebuilded the count over 10 times as it sez in my previous posts...
Zachery
06-19-2005, 02:47 PM
lmao... we have rebuilded the count over 10 times as it sez in my previous posts...
I've tested it and it works in my installations.. I really have no logical explaination why it wouldn't be working..
MajorFm.com
06-19-2005, 02:58 PM
maybe a conflict with another hack would be the only explanation... :(
mholtum
06-19-2005, 03:40 PM
It didnt work with me!!
The forum and threads are working properly but no changes only showing the posts count...?
I did it as in the instruction file and finally i upgraded whole counts of my forum
Nothing on mine either.. Hmm Am I missing something?
nubian
06-22-2005, 02:57 AM
Nothing on mine either.. Hmm Am I missing something?
same here!
i know it says for 3.0.5 but does this work for 3.0.7?
mkdevo
06-23-2005, 11:29 AM
installed on 3.0.7. works great! thanks!
MajorFm.com
07-17-2005, 03:24 AM
glad its not just me with the issue... i have worn my update counter buttons out!
mrpibbny
07-17-2005, 03:13 PM
I can't get it to work, either. It looks as if I've done nothing. *shrugs*
Kirk Y
07-17-2005, 10:27 PM
Yeah, I'm having the same problem. I see nothing in my posbit... and when I run the update page, it just keeps going and going... never stopping. I only have 1500 threads... and if it's rebuilding at 1000 threads per page, it shouldn't be taking this long.
mrpibbny
07-18-2005, 01:28 AM
I have 2,600 threads, that isn't the problem. I wish I was better at this stuff. :ninja:
tanyeri24
10-12-2005, 02:01 AM
also works under 3.5.0 ?
MajorFm.com
10-12-2005, 04:02 PM
Was the ever a fix for this? we cant all be wrong...?
hotwheels
12-20-2005, 07:44 AM
I just installed it tonite on 3.07 and it worked perfectly....
Join Date: Jul 2005
hotwheels's Garage
Location: Cheyenne, Wyoming
Last Seen: 1 Minute Ago (04:34 AM)
Posts: 8,079
Threads: 1205
Time spent in forums: 2 Weeks 2 Days 14 hours 16 minutes 44 seconds
Average time: 2 hours 24 minutes 11 seconds
when you guy's are running the update counter, are you going mysite.com/forum/admincp/misc.php?do=threadcount ? I ran it this way and it has you log in, then it does an automatic update. Mine was forums/admincp but it worked.
hotwheels
here is a random member i checked, just to see if it is working: Join Date: Oct 2005
1993SE's Garage
Location: Laramie, Wy
Last Seen: 18 Minutes Ago (04:28 AM)
Posts: 510
Threads: 28
Time spent in forums: 1 Day 23 hours 50 minutes 19 seconds
Average time: 56 minutes 57 seconds
PIKenPIK
12-30-2005, 06:18 PM
same probs here on VB 3.07.
like the others same DB error:
Invalid SQL: SELECT userid FROM user ORDER BY userid DESC LIMIT -1000, 1000
mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1000, 1000' at line 1
mysql error number: 1064
Date: Friday 30th of December 2005 08:53:55 PM
Script: http://www.www.xxxxxxxx.xx/forums/admincp/misc.php?do=threadcount&perpage=1000&page=2
Referer: http://www.xxxxxxxx.xx/forums/admincp/misc.php?do=threadcount
Username: PIKenPIK
IP Address: XXXXXXXXXXX
First page seems to go well, starting with the 2nd 1.000 threads doesn't work.
Changing in misc.php: $perpage = 1000 into $perpage = 250 gives the same ...
I'm sure it's no memory prob ..... I've done major hacks and 20.000 members on the forum (done lots of maintenance with +1.000 "things" without problems) ...
Can this be fixed?
Really need the hack for further (promotion)plans.
XXX
PnP
//edit: i don't have a table prefix. (so that's not the prob).
d'oh how could i forget that
for now use this
<div>
$vbphrase[posts]: $post[posts]
</div>
add under
<div>
$vbphrase[threads]: $post[threads]
</div>
for those unsure, add this to your postbit_template. Once you do this and run the update it wil start counting NEW THREADS.
sybakaos
04-02-2006, 06:00 PM
Those having problems with thread updates (misc.php step) set
$perpage = 1000;
To the number of threads you have. For example, I have a forums with 140k threads. I changed the code to:
$perpage = 140000;
This is -not- a fix for this hack but a way to omit the (possible) faulty code for forums over 1000 threads..
Enjoy!
mrpibbny
06-03-2006, 06:12 PM
I get the following error when I access the last instruction -
Database error in vBulletin 3.0.8:
Invalid SQL: UPDATE user SET threads = 0 WHERE userid = 180
mysql error: Unknown column 'threads' in 'field list'
mysql error number: 1054
Date: Saturday 03rd of June 2006 03:06:41 PM
Script: http://c0h0rt.org/forum/admincp/misc.php?do=threadcount
Referer:
Username: stackzilla
IP Address: 24.195.194.67
Any thoughts as to what I did wrong?
4Prometheus
11-21-2006, 11:20 PM
Where is INSTALL?
Thank you very much for taking the time and trouble to share a working hack.
Happy Holidays!
Peace.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.