View Full Version : Miscellaneous Hacks - Threads Started by User in Postbit and Profile
Boofo
05-08-2006, 10:00 PM
vB3.5.4 Threads Started by User in Postbit and Profile
Version 1.0.1
(By Andreas, Boofo, Hambil and Paul M.)
What does this product do?
This product counts the threads started by a user and displays it in the postbit and the profile. It will also display the threads per day in the profile. The thread count is automatically updated hourly via cron job. New threads are added to the count in real time. No extra queries are run in the postbit or profile when getting the thread count, only when the cron job runs. This product has been tested on a live board with over 15,000 users and 40,000 threads and ran unnoticeably in the background in 0.3 seconds during the cron job update. This product only counts valid threads (not moderated or soft-deleted threads).
NOTE: This Hack requires at least mySQL 4.0.4
Version Information:
Version 1.0.0 --Initial release
Version 1.0.1 --No longer counts threads in forums that have the "Count Posts Made in this Forum Towards User Post Counts" option set to No. Also made the posts and threads counts in the postbit clickable search links like in the profile.
NOTE: You must redo the postbit template edit to get the clickable links.
Credits:
Thanks goes out to Andreas for the original version of this product. Thanks also goes out to Paul M for coming up with the way to update the thread count without adding a query to every post, and to Hambil for coming up with the way to not count threads in forums where the "Count Posts Made in this Forum Towards User Post Counts" option is set to No. Thanks guys! ;)
Details
---------
1 Product XML (4 Plugins, 2 Phrases)
Atakan KOC
05-09-2006, 11:00 AM
Thanks BooFo
Boofo
05-09-2006, 11:01 AM
You are very welcome, sir. ;)
Developer
05-09-2006, 11:53 AM
I know there was another hack doing the same in member's profile
But this is great ;) realy and nice ideas in coding
thnx, Sir :)
Boofo
05-09-2006, 12:14 PM
I know there was another hack doing the same in member's profile
But this is great ;) realy and nice ideas in coding
thnx, Sir :)
The reason I released this is because the other hack you mentioned adds a query for each post on the page. ;)
I can't take the credit for all of this, Andreas and Paul M. were the reasons it turned out as well as it did. ;)
You might want to click the install button as I plan on adding a few things to this soon. ;)
Developer
05-09-2006, 12:19 PM
Yeah ur hack is more powerful ;)
i was plan to click install once i realy instal it when i've time ;)
anyway waiting for the update
*/me clicks INSTALL
Talisman
05-09-2006, 12:26 PM
Very nice, Boofo. Thanks for releasing this. ;)
FLMom
05-09-2006, 01:29 PM
Thanks Bob! Will be installing this later today!
Boofo
05-09-2006, 01:40 PM
You 2 ladies AND Developer are very welcome. ;)
Developer
05-09-2006, 02:08 PM
>>>>>><<<<<
Boofo
05-09-2006, 02:10 PM
3 :|
It sure took you long enough to catch that. I'm disappointed. :cross-eyed:
I will change it now. ;)
Boofo
05-09-2006, 02:15 PM
reserved
For what?
For what?
dont know, maybe I wanted to try it first or maybe I wanted to say this when posting at the first post, but I always can't catch it.
But does it work in postbit_legacy ?
The Free Bird
05-09-2006, 02:37 PM
Thanks Boofo
Boofo
05-09-2006, 02:43 PM
dont know, maybe I wanted to try it first or maybe I wanted to say this when posting at the first post, but I always can't catch it.
But does it work in postbit_legacy ?
Yes, it works fine in there but as I don't use the posbit_legacy, I didn't include the code for that. But it should be basically the same thing I would think. ;)
You guys might want to click install for this as I am planning on adding some more to it soon. ;)
Here's my posbit_legacy
I can't find the code.
Any idea Sir. ?
xStylezx
05-09-2006, 02:53 PM
Very nice,ill be installing this later today
Boofo
05-09-2006, 03:00 PM
Here's my posbit_legacy
I can't find the code.
Well, no wonder you can't find this:
$vbphrase[posts]: $post[posts]
in there. You have a very heavily modified postbit_legacy template. You need to just add the code where you want it to show then. The code I posted above I got from doing a Show Default for the template. That will tell you where it should be at in an unmodified template. ;)
Thanks Sir. so much for your efforts. I think I'm getting better in my 2nd week installing and dealing with hacks.
Waiting for the next versions.
Here's before and after. :banana:
Boofo
05-09-2006, 03:33 PM
The after picture shows the Moderator Statistcs. :surprised:
Boofo
05-09-2006, 04:16 PM
dumb me, fixed it :D
That looks really good! ;)
FLMom
05-09-2006, 04:57 PM
Got mine up and running too Boofo, thanks again!
Boofo
05-09-2006, 04:59 PM
You're very welcome, young lady. ;)
MagicMouse
05-09-2006, 05:38 PM
Thanks it's very usefull.
Thanks Bob .. always knew you'd be useful one day .. https://vborg.vbsupport.ru/external/2006/05/25.gif .. https://vborg.vbsupport.ru/external/2006/05/26.gif
Clicked install
Boofo
05-09-2006, 10:18 PM
Don't get too used to it. My usefulness comes in spurts, and not very often at that. ;)
By the way, I like those post icons. Wanna share, buddy? ;)
4number8
05-09-2006, 11:38 PM
Nice one Boofo, thanks alot :)
Boofo
05-10-2006, 09:34 AM
You're very welcome, sir. ;)
Oblivion Knight
05-10-2006, 09:51 AM
Awesome, very nice work guys.. :)
Installed.
Boofo
05-10-2006, 10:05 AM
Thank you, sir, Enjoy! ;)
davidw
05-10-2006, 12:42 PM
As requested on posting my information, here's an sql error I've received.
Database error in vBulletin 3.5.4:
Invalid SQL:
CREATE TEMPORARY TABLE vb_userthreads (userid INT(10) UNSIGNED NOT NULL DEFAULT '0',
threads INT(10) UNSIGNED NOT NULL DEFAULT '0');
MySQL Error : Access denied for user 'xxxxx'@'localhost' to database
'xxxxxxx_xxx_-_xxxxxxx'
Error Number : 1044
Date : Tuesday, May 9th 2006 @ 03:59:20 PM
I'm using PHP 4.3.9 and MySQL 4.1.10a
davidw
05-10-2006, 12:46 PM
Fixed it - had to add "create temporary table" privileges/permissions to MySQL - then FLUSH the priviledges/permissions.
Boofo
05-10-2006, 01:37 PM
Glad you got it sorted, sir. ;)
I figured it was a permissions thing for MySQL. Nice to be right every now and then. ;)
Snake
05-10-2006, 07:05 PM
Awesome! Finally, you have made this hack for the vB v3.5.x series. Thanks a ton Boofo! :)
tormodg
05-13-2006, 09:12 AM
Very nice, thank you.
*installs
Boofo
05-13-2006, 09:22 AM
Thanks Boofo
You're welcome and you are going to miss a very important update in the next day or two. ;)
TCattitude
05-13-2006, 08:01 PM
A question:
What is the difference of this mod with this one:
https://vborg.vbsupport.ru/showthread.php?t=93657&highlight=post+count
...from Andreas. Obviously, without taking care of the point you write about, Boofo, in the post #4 of that thread. Hm?.
Boofo
05-13-2006, 10:01 PM
A question:
What is the difference of this mod with this one:
https://vborg.vbsupport.ru/showthread.php?t=93657&highlight=post+count
...from Andreas. Obviously, without taking care of the point you write about, Boofo, in the post #4 of that thread. Hm?.
This is just an expansion of that with the added things from the first post here, which now account for moderated and deleted threads.
Also made the posts and threads counts in the postbit clickable search links like in the profile.
Here no changes...i install the new one byt its look the same..
Boofo
05-14-2006, 04:02 PM
Also made the posts and threads counts in the postbit clickable search links like in the profile.
Here no changes...i install the new one byt its look the same..
Then you're not looking close enough. ;)
Click on the post count or thread count in the postbit.
EDIT: I forgot to add you need to redo the template edit in the postbit to get the clickable links. Sorry about that.
Snake
05-14-2006, 04:35 PM
Thanks for the nice little update, sir! :)
Boofo
05-14-2006, 04:36 PM
Any time, my friend, any time. ;)
EDIT: I forgot to add you need to redo the template edit in the postbit to get the clickable links. Sorry about that.
Ohhhh and the other stuff that i have edit i have make one code there 1meter LONG :)
Can you post what i must change there?i make by hand.
Boofo
05-14-2006, 04:40 PM
The change is in the text file in the zip you downloaded. ;)
evofile
05-14-2006, 09:14 PM
look at the mySQL error that i'm getting!
UPDATE user AS user
SET user.threads =
(
SELECT COUNT(threadid)
FROM thread AS thread
LEFT JOIN forum AS forum ON forum.forumid = thread.forumid
WHERE visible = 1
AND (forum.options & 4096)
AND user.userid=postuserid
);
Boofo
05-15-2006, 05:04 AM
What error? That's the query.
Charming.Thanks for the update.
evofile
05-15-2006, 06:51 PM
What error? That's the query.
oops sorry i forgot to paste the error here is the error:
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 'SELECT COUNT(threadid)
FROM thread AS thread
LEFT JOIN f
Boofo
05-15-2006, 07:26 PM
You need to post the whole error. I can't tell much with what you have there.
evofile
05-15-2006, 10:05 PM
Database error in vBulletin 3.5.4:
Invalid SQL:
UPDATE user AS user
SET user.threads =
(
SELECT COUNT(threadid)
FROM thread AS thread
LEFT JOIN forum AS forum ON forum.forumid = thread.forumid
WHERE visible = 1
AND (forum.options & 4096)
AND user.userid=postuserid
);
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 'SELECT COUNT(threadid)
FROM thread AS thread
LEFT JOIN f
Error Number : 1064
Date : Monday, May 15th 2006 @ 09:41:36 PM
Script : http://forum.evofile.com/cron.php?&rand=694578 (http://forum.evofile.com/cron.php?&rand=694578)
Referrer : http://www.evofile.com/ (http://www.evofile.com/)
IP Address : 69.86.205.252
Username : Unregistered
Classname : vb_database
Boofo
05-16-2006, 12:54 AM
Database error in vBulletin 3.5.4:
Invalid SQL:
UPDATE user AS user
SET user.threads =
(
SELECT COUNT(threadid)
FROM thread AS thread
LEFT JOIN forum AS forum ON forum.forumid = thread.forumid
WHERE visible = 1
AND (forum.options & 4096)
AND user.userid=postuserid
);
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 'SELECT COUNT(threadid)
FROM thread AS thread
LEFT JOIN f
Error Number : 1064
Date : Monday, May 15th 2006 @ 09:41:36 PM
Script : http://forum.evofile.com/cron.php?&rand=694578 (http://forum.evofile.com/cron.php?&rand=694578)
Referrer : http://www.evofile.com/ (http://www.evofile.com/)
IP Address : 69.86.205.252
Username : Unregistered
Classname : vb_database
What version of MySQL are you running on the server?
evofile
05-16-2006, 02:24 AM
What version of MySQL are you running on the server?
4.0.24
Boofo
05-16-2006, 02:37 AM
Hang in there, we're looking at it now. ;)
Oblivion Knight
06-14-2006, 10:09 AM
Yup, I'm getting the same error but with vBulletin 3.6.0 Beta 2..
It might have been doing it before the upgrade, but I've only just re-added an email address to receive database error messages (they do my head in!).. Running MySQL 4.0.27-standard.
Boofo
06-14-2006, 10:22 AM
Yup, I'm getting the same error but with vBulletin 3.6.0 Beta 2..
It might have been doing it before the upgrade, but I've only just re-added an email address to receive database error messages (they do my head in!).. Running MySQL 4.0.27-standard.
I thought 3.6 took a higher MySQL version that that.
Oblivion Knight
06-14-2006, 10:29 AM
I thought 3.6 took a higher MySQL version that that.From vbulletin.com:
vBulletin 3.6 now requires PHP 4.3.3 or later and MySQL 4.0.16 or later.
:)
Boofo
06-14-2006, 10:38 AM
I'm using 4.1.11 and this hack works fine with that. I have a fix for it for older versions somewhere.
Freesteyelz
06-15-2006, 06:59 AM
Genius! Thank you guys! *Clicked Install*
futuredood
06-17-2006, 01:54 AM
hey boofo, i installed this successfully, except nowhere does it show us how to set up the cron.. can you add that to the instructions? thanks.
Boofo
06-17-2006, 05:05 AM
hey boofo, i installed this successfully, except nowhere does it show us how to set up the cron.. can you add that to the instructions? thanks.
Nope, can't give you any instructions, sorry. ;)
That's because it uses a hook and does it all automatically. ;)
futuredood
06-17-2006, 05:26 AM
haha great! what i did was i uploaded it, and only put the code in my memberinfo template (i only want it to show up in the profile).
is that the reason it's not working for me? i didn't want it to show up in the postbit templates. if it hasn't been updating, maybe it has to be with my server settings.
Boofo
06-17-2006, 05:50 AM
Make sure the threads it isn't counting aren't in forums where you have the postcount turned off. It will update new threads immediately and adjust it when the cron runs.
futuredood
06-17-2006, 06:22 AM
ah, i caught the problem. i posted a new thread and it counted fine, but old threads aren't counted. i tried running some maintenance scripts, like updating post counts but that didn't do the trick. was their a step i missed?
Boofo
06-17-2006, 06:58 PM
All the threads that the member has started are counted when you first install the hack and when the cron runs.
futuredood
06-20-2006, 12:31 AM
hm didn't seem to work when i reinstalled and overwrote the original file. it's ok though since i'm installing this on a new forum.
Tyegurl
06-26-2006, 01:00 AM
darn i need mysql 4.0.4...:(
futuredood
06-26-2006, 11:17 AM
threads seem to be counted correctly, but this error is e-mailed to me about once a night. i read someone else received this error too.. it'd be nice to know that everything was running smooth, though.:
Database error in vBulletin 3.5.4:
Invalid SQL:
UPDATE user AS user
SET user.threads =
(
SELECT COUNT(threadid)
FROM thread AS thread
LEFT JOIN forum AS forum ON forum.forumid = thread.forumid
WHERE visible = 1
AND (forum.options & 4096)
AND user.userid=postuserid
);
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 'SELECT COUNT(threadid)
FROM thread AS thread
LEFT JOIN f
Error Number : 1064
barca4ever
07-13-2006, 10:08 PM
I have a user has posted 2 threads, so he's thread's count is 2 which is correct, But when I soft-deleted his 2 threads, his thread's count still showing 2 !!!
Arngrim
07-15-2006, 08:30 AM
Great MOD Boofo. I've been looking for this for a while, and after entering about ten different types of criteria and searching through a dozen pages of the Search engine...I finally found it. Though I use MySQL 4.0.27-standard. Will this be a problem in the future? It seems to be working fine for me... Cheers.
*Installed*
Edit: Aye, seems I am also receiving that E-mail that a few Users above have mentioned. The Hack works fine, though it hasn't updated my correct Thread Count, if it was supposed to do that (i.e. be retroactive). I could probably just create a bunch of 'test' topics, and then erase them, so that I bring the count to its correct level... Anyhow, here's the error in case it differs in any area:
Database error in vBulletin 3.5.4:
Invalid SQL:
UPDATE user AS user
SET user.threads =
(
SELECT COUNT(threadid)
FROM thread AS thread
LEFT JOIN forum AS forum ON forum.forumid = thread.forumid
WHERE visible = 1
AND (forum.options & 4096)
AND user.userid=postuserid
);
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 'SELECT COUNT(threadid)
FROM thread AS thread
LEFT JOIN f
Error Number : 1064
Date : Saturday, July 15th 2006 @ 06:50:22 AM
Script : http://www.address-omitted/forums/cron.php?&rand=826012
Referrer : http://www.address-omitted/forums/usercp.php
IP Address : omitted
Username : Unregistered
Classname : vb_database
Oblivion Knight
07-25-2006, 05:45 PM
Just to let you know, I had to remove this block of code in the product for it to install on 3.6.0 RC2:
$version = explode('.', mysql_get_server_info($db->connection_write));
if ($idx = strpos($version[2], '-'))
{
$version[2] = substr($version[2], 0, $idx);
}
if ($version[0] < 4 OR ($version[0] == 4 AND $version[2] < 4))
{
print_cp_message('This Hack requires at least mySQL 4.0.4');
}Otherwise it spat out an error, whining about an invalid MySQL resource with mysql_get_server_info.
serhat_kk
07-30-2006, 02:55 AM
Thanks Boofo but i've a problem
Threads: 1200
Posts: 1,800
how do i add "," to Threads???
thanks...:)
music legend
09-03-2006, 04:07 AM
is this mod coming out for 3.6?
Valter
09-06-2006, 12:03 AM
Doesn't work properly with 3.6.
I have the same problems as Arngrim and Oblivion Knight reported.
tazB.ca
09-06-2006, 10:33 PM
I Sher Hope Someone Can Make This For 3.60,with A Option To Turn Thread Count Off For Some Forums,while Keeping Post Count On Still...
NetRover
09-09-2006, 06:22 PM
I Sher Hope Someone Can Make This For 3.60,with A Option To Turn Thread Count Off For Some Forums,while Keeping Post Count On Still...
Me too, exactly. Would like my users to be able to find their thread without having to ask the team. I'm not interested in the count and would like to be able to turn it off.
Snake
09-09-2006, 07:52 PM
Weird. It's working just fine on my forums.
snowlion
09-12-2006, 01:33 AM
Weird. It's working just fine on my forums.
can you post your customized for this hack to work with 3.6.0
Snake
09-12-2006, 12:45 PM
can you post your customized for this hack to work with 3.6.0
Look in the previous page, the post by Oblivion. That should do it. ;)
tazB.ca
09-13-2006, 12:55 PM
I Sher Hope Someone Can Make This For 3.60,with A Option To Turn Thread Count Off For Some Forums,while Keeping Post Count On Still...
COULD SOMEONE EDIT THIS HACK FOR IT TO DO THIS?
davidw
09-13-2006, 01:25 PM
The author of the hack is currently without access to a computer.
serhat_kk
10-14-2006, 11:43 AM
When i deleted users threads...Profile is not refreshing... İ delete users all posts bu it shows "13 threads per day"...
how do i fix it?
thanks...
tekstylez
01-11-2007, 08:53 PM
trying to install on 3.6.4
It is telling me "This Hack requires at least mySQL 4.0.4"
but my version is 4.1.21-standard-log
any fix for this?
SCRIPT3R
01-11-2007, 08:54 PM
trying to install on 3.6.4
It is telling me "This Hack requires at least mySQL 4.0.4"
but my version is 4.1.21-standard-log
any fix for this?
see this post (https://vborg.vbsupport.ru/showpost.php?p=1037390&postcount=72). ;)
Terminatoronly
01-14-2007, 11:24 AM
Working Like A charm its the best hack :) btw i am using vb 3.6.4 and its working 100% :D
bigfoot
01-15-2007, 07:21 PM
Thanks for this mod.
However I found the following things:
- Version checker does not seem to run properly. My server runs a newer version than the one required.
- The info for editing the templates does only include standard postbit - not postbit_legacy
However I managed to make a workaround for both :D
Is there any way to make this mod count threads only in certain forum IDs?
Any help would be greatly appreciated. Thank you.
Tralala
04-02-2007, 09:51 PM
I've applied Oblivion Knight's edit above, and successfully installed this. It seems to be working okay... but I don't see any Cron Job listed in the AdminCP's Scheduled Task Manager. Am I supposed to?
Tralala
04-02-2007, 09:59 PM
Is there any way to make this mod count threads only in certain forum IDs?
Any help would be greatly appreciated. Thank you.
Ideally I'd like to see that too. As well as a separate preference for forums, for counting posts or threads. I might want threadstarts to count, but posts to NOT count. And right now, it's an all-or-nothing affair for each forum.
Mudvayne
05-16-2007, 06:03 AM
This hack was working fine on 3.6.5 but in 3.6.7 its not working & I get DB error.
Mudvayne
07-10-2007, 03:27 AM
I have posted a fixed version for 3.6.7 here! (https://vborg.vbsupport.ru/showthread.php?t=151844)
fishhub
07-20-2007, 06:07 PM
does the threads count work well in postbits for pm?
fishhub
07-21-2007, 04:52 PM
does it start from 0 threads upon installing or it will update according to the updated nos of threads as per member?
fishhub
07-28-2007, 04:27 PM
Great MOD Boofo. I've been looking for this for a while, and after entering about ten different types of criteria and searching through a dozen pages of the Search engine...I finally found it. Though I use MySQL 4.0.27-standard. Will this be a problem in the future? It seems to be working fine for me... Cheers.
*Installed*
Edit: Aye, seems I am also receiving that E-mail that a few Users above have mentioned. The Hack works fine, though it hasn't updated my correct Thread Count, if it was supposed to do that (i.e. be retroactive). I could probably just create a bunch of 'test' topics, and then erase them, so that I bring the count to its correct level... Anyhow, here's the error in case it differs in any area:
i get this prob too!any kind soul to assist?
SCRIPT3R
07-28-2007, 06:37 PM
i get this prob too!any kind soul to assist?
see this post (https://vborg.vbsupport.ru/showpost.php?p=1037390&postcount=72). ;)
fishhub
07-29-2007, 04:25 PM
see this post (https://vborg.vbsupport.ru/showpost.php?p=1037390&postcount=72). ;)
thks, i've tried. But the thread count starts from zero instead of current respective numbers of threads already started.
Appreciate you could guide .
fishhub
08-07-2007, 06:25 PM
anyone can assist?threads count dont seem to be activated accordingly. All starts with zero..
SCRIPT3R
08-07-2007, 07:08 PM
thks, i've tried. But the thread count starts from zero instead of current respective numbers of threads already started.
Appreciate you could guide .
anyone can assist?threads count dont seem to be activated accordingly. All starts with zero..
PM me your site info and i'll take a look if you'd like.
fishhub
08-08-2007, 05:50 PM
PM me your site info and i'll take a look if you'd like.
Pmed u. TIA.
fishhub
09-17-2007, 04:14 PM
Pmed u. TIA.
still cant get it work. Anyone has solution. TIA.:o
Mudvayne
09-17-2007, 04:30 PM
fishhub try this (https://vborg.vbsupport.ru/showthread.php?t=151844) version. This should also work on vb 3.5.x
fishhub
09-22-2007, 04:51 PM
fishhub try this (https://vborg.vbsupport.ru/showthread.php?t=151844) version. This should also work on vb 3.5.x
thanks, I tried and got this.
Database error in vBulletin 3.5.4:
Invalid SQL:
### INSERT QUERY GENERATED BY fetch_query_sql() ###
INSERT INTO plugin
(`active`, `executionorder`, `title`, `hookname`, `phpcode`, `product`)
VALUES
('1', '1', 'Threads started by User: Hourly Cron', 'cron_script_cleanup', '$vbulletin->db->query_write(\"\r\n UPDATE \" . TABLE_PREFIX . \"user AS user \r\n SET user.threads =\r\n (\r\n SELECT COUNT(threadid)\r\n FROM \" . TABLE_PREFIX . \"thread AS thread\r\n LEFT JOIN \" . TABLE_PREFIX . \"forum AS forum ON forum.forumid = thread.forumid \r\n WHERE visible = 1 \r\n AND (forum.options & 4096) \r\n AND user.userid=postuserid\r\n )\r\n\");', 'thread_count_7272');
MySQL Error : Unknown column 'executionorder' in 'field list'
Error Number : 1054
fl_Handsofrain
05-07-2008, 12:40 PM
3.7.0 ?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.