View Full Version : Number of threads use started in a certain forum
Admin
01-04-2002, 10:00 PM
Just like we have the number of hacks the user released in postbit, you can have this too.
Let's say you have a reviews forum on your board, and you want to show next to each user's post how many reviews he has posted.
Use this hack, and replace X in this code:
$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN (x) AND postuserid IN $hackuserids GROUP BY postuserid");
with the ID of that forum, or with a comma delimited list of forum ID's (for example: 2,5,3,7).
Have fun. :D
TheComputerGuy
01-05-2002, 08:27 AM
firefly works wonders ;)
squawell
01-05-2002, 08:27 AM
haha~~~it's me again!!
i know u will post the ss right?? :D :D
thankz FireFly i think it a great hack again~~
squawell
01-05-2002, 08:39 AM
FireFly one question~~
if i have two or more forums need how should i change the x~~
squawell
01-05-2002, 09:00 AM
FireFly the txt have someplace wrong??
$getpostids=$DB_site->query("
SELECT post.postid FROM post
WHERE post.threadid='$threadid' AND post.visible=1
ORDER BY dateline $postorder LIMIT ".($limitlower-1).",$perpage
");
if ($limitupper>$totalposts) {
$limitupper=$totalposts;
if ($limitlower>$totalposts) {
$limitlower=$totalposts-$perpage;
}
}
if ($limitlower<=0) {
$limitlower=1;
}
$postids="post.postid IN (0";
while ($post=$DB_site->fetch_array($getpostids)) {
$postids.=",".$post['postid'];
}
$postids.=")";
$hackuserids.=")";
$hacks=array();
$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN (4,5) AND postuserid IN $hackuserids GROUP BY postuserid");
while ($hackcount=$DB_site->fetch_array($hackcounts)) {
if (!isset($hackcount[totalhacks]))
$hackcount[totalhacks]=0;
$hacks["$hackcount[postuserid]"]=$hackcount[totalhacks];
}
$hacks[0]=0;
*********************************
with this:
*********************************
$getpostids=$DB_site->query("
SELECT post.postid,post.userid AS postuserid FROM post
WHERE post.threadid='$threadid' AND post.visible=1
ORDER BY dateline $postorder LIMIT ".($limitlower-1).",$perpage
");
if ($limitupper>$totalposts) {
$limitupper=$totalposts;
if ($limitlower>$totalposts) {
$limitlower=$totalposts-$perpage;
}
}
if ($limitlower<=0) {
$limitlower=1;
}
$postids="post.postid IN (0";
$hackuserids="(0";
while ($post=$DB_site->fetch_array($getpostids)) {
$postids.=",".$post['postid'];
$hackuserids.=",".$post['postuserid'];
}
$postids.=")";
$hackuserids.=")";
$hacks=array();
$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN (x) AND postuserid IN $hackuserids GROUP BY postuserid");
while ($hackcount=$DB_site->fetch_array($hackcounts)) {
if (!isset($hackcount[totalhacks]))
$hackcount[totalhacks]=0;
$hacks["$hackcount[postuserid]"]=$hackcount[totalhacks];
}
$hacks[0]=0;
it's the same code~ :confused: :confused:
fonzerelli_79
01-05-2002, 11:41 AM
nice one firefly
keep em coming!!
Admin
01-05-2002, 12:56 PM
Fixed the .txt file. :)
squawell, read my post again, I hate saying the same thing twice.
squawell
01-05-2002, 01:14 PM
sorry~~
i just misunderstand about ur first post's example!! :(
now i understand~ thankz u tell me that~~~:D
Hey kickaz hack here :) It works perfectly...
Any way you can tell us how to make this a field in the profile? And be forum specific..?
Like
Contibutations In General: 10
Contibutations In Reviews: 15
ect..
Lesane
01-05-2002, 07:45 PM
Great hack FireFly, as usual ;) Thx
bobbydavro
01-07-2002, 02:26 PM
just installed this and it works but not sure if this is because of another hack firefly helped me install before,
but I have a moderator validation on the forum I have added this to and the users hack count increases even before the moderator has validated the post.
eg i have a hints and tips forum, so I have added a hints (instead of hacks) count. When a user submits a hint it gos for moderator validation but the count is going up before validation. If the moderator then deletes the post the value does return to the correct value.
SgtSling
01-09-2002, 04:08 AM
is this intensive on the server?
Admin
01-09-2002, 08:32 AM
Not at all, that's the beauty of it. :) Only one more query per thread, not a query per post like the other hacks. :)
humble
01-10-2002, 05:33 PM
fyi- this doesn't appear to be compatible with vb v2.2.1 and vbPortal v3.x
Admin
01-11-2002, 11:59 AM
It works on v2.2.1, because that's what we have running here.
As for vbPortal... I can't tell.
Really great ! Easy to install. 5 stars :p Thx.
cya
fonzerelli_79
01-15-2002, 12:27 PM
i get an error when i run the query (i replaced the x with the room id no.)
i use vbportal but i dont think that this matters as its only effecting vb files
Admin
01-15-2002, 12:38 PM
What is the error? :)
fonzerelli_79
01-15-2002, 12:42 PM
Originally posted by FireFly
What is the error? :)
obviously that would have helped - doh!! the error is this
Invalid SQL: $hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN (10) AND postuserid IN $hackuserids GROUP BY postuserid");
mysql error: You have an error in your SQL syntax near '$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM threa' at line 1
mysql error number: 1064
Admin
01-15-2002, 01:06 PM
Err...why are you running that whole line as a query?
fonzerelli_79
01-15-2002, 01:10 PM
because im an idiot
aaarrrggggggg - doh!doh!doh!doh!doh!doh!doh!doh!doh!doh!doh!doh!do h!
ive fixed it now
maybe from now on firefly, you should put me on your ignore list so you dont have to listen to my stupid questions - this isnt my day - lol
fonzerelli_79
01-15-2002, 01:26 PM
(i hope im not on fireflys ignore list yet)
i added $post[hacks] to my post bit template but it isnt displaying anything
what could be wrong? :D
fonzerelli_79
01-19-2002, 11:13 AM
heres an example
fonzerelli_79
01-19-2002, 11:48 AM
i have my board set up so that only moderators may submit news in my news room
is it possible to only add this hack to the moderators postbit or would this require further hacking
Ice Man_00
01-25-2002, 01:26 PM
Hi.
Just a question......
Is there a way to add a the same hack like this, but so it counts in two diffrents.
Like this:
Just like your board, you have "Hacks" but is there anyway to add one more to it, so it`s counting from diffrents thread.
So it will be, just a ex.
Hacks: 0
Requested Hacks: 0
Hope it goes, becase i like this idea of this hack really good.
Thx a lot !!!!
cyrus
01-26-2002, 04:23 PM
Originally posted by FireFly
Err...why are you running that whole line as a query?
what should be run in phpmyadmin then ? :rolleyes:
Admin
01-26-2002, 04:26 PM
Originally posted by cyrus
what should be run in phpmyadmin then ? :rolleyes:
Nothing.
cyrus
01-26-2002, 04:33 PM
omg
sorry, stupid question .... bangs head against monitor
good thing it aint liquid crystal ;)
wolfe
01-26-2002, 04:38 PM
thanx m8
nitro
02-13-2002, 01:38 PM
ye it works gr8 vbb 222 and vbp 3pr7 with pr8 update
nice 1 firefly great hack
just an idea id like to see the hack incorporated into member.php get user info as another table aswell as visible in the posts.
please ne chance of furthering the addon to this ultimate level i think it wud be really good
TWTCommish
02-13-2002, 01:40 PM
I've already got an expanded hack in the works...breaks down a user's posts/threads per forum along with some other details. I'll try to release it soon.
Great hack, BTW. :)
M.Smith
02-13-2002, 08:04 PM
Originally posted by fonzerelli_79
(i hope im not on fireflys ignore list yet)
i added $post[hacks] to my post bit template but it isnt displaying anything
what could be wrong? :D
Mine does exactly the same as yours!
whats wrong with it firefly?
BTW: im running version 2.2.2
and sorry fonzerelli_79 but i despise man utd!
NEWCASTLE UTD RULES ALL!
SaintDog
02-17-2002, 06:08 PM
Thanks for this great hack FireFly, this hack is recording posts from about 10-12 forums, but it is working from what I can see :). Just the hack I needed to track submissions in the forums.
Sn2,
$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN (x) AND postuserid IN $hackuserids GROUP BY postuserid");
Did you make sure you changed the (x) to the id of the forum(s) you wished it to count threads in? You have to change that or nothing will appear. Place your cursor over the link of the forum you wish this hack to record threads from and look at the ID at the end of the URL, place that ID in place of the x in the above coding (in showthread.php).
SaintDog
Snake~eyes
03-10-2002, 11:55 AM
1. How do you lit all the hacks in the user profile like it is done here?
2. and how about top 10 hackers?
3. Is there some type of way to get the install button like done here?
4. POssibly a way to get omthing like the hacks database here?
lotta questions.. i hope there's answers :D
Ice Man_00
03-13-2002, 10:51 PM
Great hack..
But i have one question.
Is there any way to add a little extra to this ??
The count in memberlist as well
&
more counts.
in postbit can it be done under posts and hacks a little extra ??
name
avatar
location
registered
posts
hacks
hacks II (from diffrent forums)
Is this possible ?!?
Thx in advanced
Ice Man_00
03-16-2002, 09:34 AM
bump
Snake~eyes
03-16-2002, 11:26 AM
hrm... i thought tihs was kinda ovious in the read me
Then use $post[hacks] in the postbit template to show the number of threads the user started in that forum. It will link to the user profile if he has more than 0 threads.
Also, Firefly can ya answer my questions?
Ice Man_00
03-17-2002, 06:58 AM
Originally posted by dhogan444
hrm... i thought tihs was kinda ovious in the read me
Then use $post[hacks] in the postbit template to show the number of threads the user started in that forum. It will link to the user profile if he has more than 0 threads.
My post you answered about ??
If it was, you see what i mean ??? I already have this installed in the postbit template with the hacks count on how many threads a user have done. But what i asking about is another to it could count from one hacks, two funs. Do you see now ?!?
Hacks: 0
Funs: 0
:) Ice Man
Snake~eyes
03-17-2002, 01:33 PM
oh i see what your saying.. lol.. mybad
uh.. hrm.. wish firefly would reply already :p
Snake~eyes
03-21-2002, 10:07 PM
*bump*
Ice Man_00
03-22-2002, 05:17 AM
firefly !!!!!!!!!!!!!!!!!!!!!!11
Where are youuuuuuu ?!?!?!
LOL :D
Ice Man
Snake~eyes
04-03-2002, 02:04 PM
*bump*
Snake~eyes
04-05-2002, 12:50 AM
*bump, yet again*
top 10 hackers woul be cool.... mabey displayed on a non-vb page?
Funkie
04-20-2002, 06:44 PM
~Bump~
would also like to count other bits....
Apart from hacks..
Originally posted by Ice Man_00
My post you answered about ??
If it was, you see what i mean ??? I already have this installed in the postbit template with the hacks count on how many threads a user have done. But what i asking about is another to it could count from one hacks, two funs. Do you see now ?!?
Hacks: 0
Funs: 0
:) Ice Man
PLEASE DO THIS :)
Allstar DC
05-04-2002, 08:17 PM
to do that is very easy, just use find & replace function and replace the words "hack" with (example) "hacks II" en add that hack again. like you did the first time
that way it will add the hack twice but using different counts.
put this one too in your postbit template and your done
works great.
(sorry for my bad english)
|-Last-Spirit-|
05-05-2002, 01:24 PM
Originally posted by Allstar DC
to do that is very easy, just use find & replace function and replace the words "hack" with (example) "hacks II" en add that hack again. like you did the first time
that way it will add the hack twice but using different counts.
put this one too in your postbit template and your done
works great.
(sorry for my bad english)
I for one would like to have 2 counters myself (have one now and that one works) but I don't understand what you are trying to say here......
You want me to add this :
$getpostids=$DB_site->query("
SELECT post.postid,post.userid AS postuserid FROM post
WHERE post.threadid='$threadid' AND post.visible=1
ORDER BY dateline $postorder LIMIT ".($limitlower-1).",$perpage
");
if ($limitupper>$totalposts) {
$limitupper=$totalposts;
if ($limitlower>$totalposts) {
$limitlower=$totalposts-$perpage;
}
}
if ($limitlower<=0) {
$limitlower=1;
}
$postids="post.postid IN (0";
$hackuserids="(0";
while ($post=$DB_site->fetch_array($getpostids)) {
$postids.=",".$post['postid'];
$hackuserids.=",".$post['postuserid'];
}
$postids.=")";
$hackuserids.=")";
$hacks=array();
$hackcounts=$DB_site->query("SELECT postuserid,COUNT(*) AS totalhacks FROM thread WHERE forumid IN (x) AND postuserid IN $hackuserids GROUP BY postuserid");
while ($hackcount=$DB_site->fetch_array($hackcounts)) {
if (!isset($hackcount[totalhacks]))
$hackcount[totalhacks]=0;
$hacks["$hackcount[postuserid]"]=$hackcount[totalhacks];
}
$hacks[0]=0;
*********************************
Still in showthread.php, add this:
*********************************
if ($hacks["$post[userid]"]!='') {
$post[hacks]="<a href=\"member.php?s=$session[sessionhash]&action=getinfo&userid=$post[userid]\">".$hacks["$post[userid]"]."</a>";
} else {
$post[hacks]=0;
}
a second time in my showthread.php ???
Ice Man_00
05-08-2002, 03:23 PM
Then we have something to try on. Anyone who has tried it ??
Thx for all help, if any problem come.. i will post it here.
:)
BigJohnson
06-22-2002, 10:38 PM
Well can someone do the top because i would like to add more than one as well. Can someone please post the code for this thanks.
Ice Man_00
06-23-2002, 12:25 PM
I`ve done as they told here... just change the hack to ex. jokes and do it all over again. Then it works....
Really great hack this is, and ezy to install
I have a question ?! how i can put a date ( like since 30 days )
( number of threads in certain forum since xx days )
BigJohnson
07-08-2002, 10:24 PM
Can you please post the code all over again If you want to have it show 2 things. Please. I still don't no how to do it. PLease just change it for me and tell me what to do thanks so much. You need to describe it more thanks so much. I really need this badly. Thanks.
BigJohnson
07-16-2002, 12:20 PM
Iw ould like to have this info added into my getinfo template. Can someone please post the code to what i have to do in order to have this show up in peoples profiles. Thanks so much.
Allstar DC
08-10-2002, 08:43 AM
Originally posted by BigJohnson
Can you please post the code all over again If you want to have it show 2 things. Please. I still don't no how to do it. PLease just change it for me and tell me what to do thanks so much. You need to describe it more thanks so much. I really need this badly. Thanks.
did you figure out allready how to make it 2 seperate counts???
if not, than i will explain it again
Christoff
10-02-2002, 06:42 AM
Hi
I would like to get people with highest counts in the forum index. Is there any chance for a hack that will do that thing?
Regards
BusteR
BigJohnson
04-05-2004, 01:45 PM
Well the code is a little dif that u have to search for. I am not that sure on how to do it ;)
Boofo
04-05-2004, 01:47 PM
did you figure out allready how to make it 2 seperate counts???
if not, than i will explain it again
Welcome back, sir. ;) Where you been?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.