View Full Version : Thread Counter & Display
TouchingVirus
04-16-2004, 10:00 PM
As Requested by BigJohnson..
This hack counts the numbers of threads a user has made in a specific forum or forums, and outputs the count on the postbits & the profile page..
Included is the instructions for up to 5 counters..but you can add in more, just read the code, its easy to follow :)
It also allows for exemptions from the counters based on userid's and not usergroups though i am sure its adaptable!
Enjoy!
Boofo
04-17-2004, 09:51 PM
Won't that code in the showthread add a query for every post on the page? It's in the loop, right? ;)
TouchingVirus
04-17-2004, 10:01 PM
Yes, but consider the information it retreives along with the amount of post's per page..(a usual 15)..it adds about a second to load times :)
Boofo
04-17-2004, 10:04 PM
There's got to be an easier way to do that outside the loop. That's why I didn't meess with it because of the queries it would add. But at least you got it done. Good job. ;)
BigJohnson
04-18-2004, 05:23 AM
Thanks so much. Well u can just sort between threads made a different way but then u wont be able to edit the number of new threads created in the amdin cp or anything.
Thanks so much dude. I love you hehe.
gmarik
04-19-2004, 03:48 PM
Interesting one...
Logikos
04-23-2004, 01:41 AM
Very nice hack, one of my members were asking for this. I know he will find it useful :)
Ryuujin
05-02-2004, 02:12 PM
Hey, could you make some modifications for a new post count, for offtopic/spam forums? so they dont mixup with the normal post count?
Example:
Post: 980 (normal)
SPAM Post: 4666 (In the OFFTOPIC/CHAT/SPAM forums IDs: 2,3,4)
thanks n.nU
pjdaley
05-28-2004, 12:56 AM
can anyone get this up and running? to have a total count of multiple forums?
pjdaley
06-04-2004, 03:29 AM
bump?
Cyberfreak
10-11-2004, 10:53 PM
Hello :)
I`ve seen to have some problem installing this one...
In the count1.txt file you say:
=========================================
Open functions_newpost.php
Add Before $DB_site->query(" on line 367
=========================================
// Begin Thread Count Hack By TouchingVirus
if (($foruminfo['forumid']=='counter1_forum1') || ($foruminfo['forumid']=='counter1_forum2'))
{
$threadcount1 = $DB_site->query("SELECT * FROM thread_count WHERE userid=$bbuserinfo[userid]");
while ($threadcounter1 = $DB_site->fetch_array($threadcount1))
{$counter++;}if ($counter<1)
{
$DB_site->query("INSERT INTO thread_count (userid,count1) VALUES('".$bbuserinfo['userid']."',1)");
}
else
{
$DB_site->query("UPDATE thread_count SET count1=count1+1 WHERE userid=$bbuserinfo[userid]");
}
}
// End Thread Count Hack By TouchingVirus
But in my functions_newpost.php (under includes/functions_newpost.php) i have on line 367...
Line 365 // check that they can use this icon
Line 366 if ($post['iconid'] > 0)
Line 367 {
$membergroups = fetch_membergroupids_array($bbuserinfo);
$imagecheck = $DB_site->query("SELECT usergroupid FROM " . TABLE_PREFIX . "icon AS icon
INNER JOIN " . TABLE_PREFIX . "imagecategorypermission USING (imagecategoryid)
WHERE icon.iconid = $post[iconid]
AND usergroupid IN (" . addslashes(implode(',', $membergroups)) . ")
");
if ($DB_site->num_rows($imagecheck) == sizeof($membergroups))
{
$post['iconid'] = 0;
}
}
// ### POST NEW THREAD ###
eh.. kinda dumb here maybe, but please help me out.. :o
But hey, nice hack :D
Cheers, Cyberfreak.
By the way, uses vB 3.0.3
Could that do anything about it maybe... ?? hmm...
Cyberfreak
10-16-2004, 10:36 AM
Never mind, i got it done :D
Thankx for your havk TV...again ;)
Cheers, Cyberfreak
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.