vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Post count in one forum? (https://vborg.vbsupport.ru/showthread.php?t=44585)

Neo-Storm 10-13-2002 05:57 PM

Post count in one forum?
 
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

Quote:

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

Quote:

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:

PHP Code:

// global options
    
global $showdeficon,$displayemails,$enablepms,$allowsignatures,$wordwrap,$dateformat,$timeformat,$logip,$replacewords,$postsperday,$avatarenabled,$registereddateformat,$viewattachedimages

And replace with;

PHP Code:

// global options
    
global $showdeficon,$displayemails,$enablepms,$allowsignatures,$wordwrap,$dateformat,$timeformat,$logip,$replacewords,$postsperday,$avatarenabled,$registereddateformat,$viewattachedimages,$DB_site

Then find:

PHP Code:

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

Add after:

PHP Code:

$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)
PHP Code:

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

Change to:
PHP Code:

$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 :
Code:

AND forumid=theforumid
Satan

Neo-Storm 10-21-2002 04:42 PM

thx hellsatan :)

Chris M 10-21-2002 04:52 PM

Np;)

Satan


All times are GMT. The time now is 10:05 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01081 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (6)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (17)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete