PDA

View Full Version : Post count in one forum?


Neo-Storm
10-13-2002, 05:57 PM
Is there a hack or can someone make a hack that count the posts in only one forum? So i say requests! If you could it can be selectable in admin cp with a yes or no: Count posts to special count or something like that, so i have more than one forum counted!

Please help me :)

Chris M
10-13-2002, 05:58 PM
I think there is...

Satan

Neo-Storm
10-13-2002, 05:59 PM
Originally posted by hellsatan
I think there is...

Satan

Lol, can i have a link please :)

Chris M
10-13-2002, 06:02 PM
Try using the search and searching for:

Post counts per forum

I think it comes with an Avatar & Usertitle per forum too...

I dont remember the link:(

Satan

Neo-Storm
10-13-2002, 06:15 PM
I have searched too, and can't find it :'(

Chris M
10-13-2002, 06:24 PM
Hmmm...

Let me have a think about it, and see if I can remember who made it:)

Satan

Neo-Storm
10-13-2002, 06:26 PM
Ok, thx already ;)

NTLDR
10-13-2002, 07:17 PM
If you just wanted one forum and are quite happy to have it hardcoded then its real easy :D

Neo-Storm
10-13-2002, 07:37 PM
Originally posted by NTLDR
If you just wanted one forum and are quite happy to have it hardcoded then its real easy :D

I rather have more than one forum, and easy editing... So if you can do it :rolleyes:

Neo-Storm
10-14-2002, 05:31 AM
Sorry i have said it wrong.. I want a count in the postbit how much topics a user has started in one forum (at my forum the showcase)

I think that is easier?

NTLDR
10-14-2002, 07:03 PM
In functions.php find:

// global options
global $showdeficon,$displayemails,$enablepms,$allowsigna tures,$wordwrap,$dateformat,$timeformat,$logip,$re placewords,$postsperday,$avatarenabled,$registered dateformat,$viewattachedimages;

And replace with;

// global options
global $showdeficon,$displayemails,$enablepms,$allowsigna tures,$wordwrap,$dateformat,$timeformat,$logip,$re placewords,$postsperday,$avatarenabled,$registered dateformat,$viewattachedimages,$DB_site;

Then find:

$post[postdate]=vbdate($dateformat,$post[dateline]);
$post[posttime]=vbdate($timeformat,$post[dateline]);

Add after:

$singleforum=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post WHERE forumid=X AND postuserid=$post[userid]');
$post[sfcount]=number_format($singleforum['posts']);


Remember to change X to the forumid with the posts in you want to count and add $post[sfcount] in the postbit template.

This ISN'T the best way to do this, as it adds 1 query for each post in the thread, I expect someone can come up with a more efficent way.

Neo-Storm
10-15-2002, 03:52 AM
can i aslo add for x more than 1 forum? so 1,2,3,4 etc.?

Neo-Storm
10-15-2002, 06:58 PM
*bump* please look at it NTLDR

Neo-Storm
10-21-2002, 04:26 PM
*bump* again :P

Chris M
10-21-2002, 04:38 PM
Ok...Multiple forums?

Find: (from the code above)
$singleforum=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post WHERE forumid=X AND postuserid=$post[userid]');
Change to:
$singleforum=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post WHERE forumid=X AND forumid=Y AND forumid =Z AND postuserid=$post[userid]');

Change X, Y & Z to the forumids...

To add more, just include :
AND forumid=theforumid

Satan

Neo-Storm
10-21-2002, 04:42 PM
thx hellsatan :)

Chris M
10-21-2002, 04:52 PM
Np;)

Satan