Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-17-2007, 02:11 AM
ResaleBroker's Avatar
ResaleBroker ResaleBroker is offline
 
Join Date: Aug 2004
Location: Arizona, USA
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Query for forum(s) thread count

I would like to display the thread count for one or more forums in my "Articles" page which is a modified "showgroups" page (3.6.x).

Currently the number assigned to "Available Articles:" is hand coded and I'm trying to automate the process. I'm would also like to display the number of threads in each forum next to the respective category.

Does anyone know what query(s) I could use to do this?

Thank you for any help you can offer.
Reply With Quote
  #2  
Old 07-17-2007, 02:31 AM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ResaleBroker View Post
I would like to display the thread count for one or more forums in my "Articles" page which is a modified "showgroups" page (3.6.x).

Currently the number assigned to "Available Articles:" is hand coded and I'm trying to automate the process. I'm would also like to display the number of threads in each forum next to the respective category.

Does anyone know what query(s) I could use to do this?

Thank you for any help you can offer.
the data lives in the threadcount property of the forums in the forumcache

PHP Code:
$vbulletin->forumcache[$forumid]['threadcount'
Reply With Quote
  #3  
Old 07-17-2007, 02:54 AM
ResaleBroker's Avatar
ResaleBroker ResaleBroker is offline
 
Join Date: Aug 2004
Location: Arizona, USA
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Eikinskjaldi View Post
the data lives in the threadcount property of the forums in the forumcache

PHP Code:
$vbulletin->forumcache[$forumid]['threadcount'
Thank you for the prompt reply. How would I implement this for that page I listed?

I tried adding this code to the template without success:
{$vbulletin->forumcache[$forumid == 167][threadcount]}
Reply With Quote
  #4  
Old 07-17-2007, 03:24 AM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ResaleBroker View Post
Thank you for the prompt reply. How would I implement this for that page I listed?

I tried adding this code to the template without success:
{$vbulletin->forumcache[$forumid == 167][threadcount]}
I have no idea how your template is interacting with your code, however what you want is
$vbulletin->forumcache[167][threadcount]


I used $forumid because I assumed you were using some kind of template_bit to generate the forum links.
Reply With Quote
  #5  
Old 07-17-2007, 03:34 AM
ResaleBroker's Avatar
ResaleBroker ResaleBroker is offline
 
Join Date: Aug 2004
Location: Arizona, USA
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Eikinskjaldi View Post
I have no idea how your template is interacting with your code, however what you want is
$vbulletin->forumcache[167][threadcount]


I used $forumid because I assumed you were using some kind of template_bit to generate the forum links.
When I past that code into the template this is the output: Array[167][threadcount]
Reply With Quote
  #6  
Old 07-17-2007, 05:04 AM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Probably need to play around with quotes and braces

30 seconds with google later, I found this...

https://vborg.vbsupport.ru/showthread.php?t=98009


Code:
Object-Type" Variables ($vbulletin->GPC['somevar']).
Do use single quotes, but wrap such variables into figure brackets. One valid example is {$vbulletin->GPC['somevar']}.
If you attempt using $vbulletin->GPC['somevar'] or $vbulletin->GPC[somevar], you will get an error
However its 3.5, not 3.6, I am not sure the {} are needed. I recommend having a play with braces and quotes. Alternatively, alias the forum in code, and reference the alias.
Reply With Quote
  #7  
Old 07-17-2007, 05:17 AM
ResaleBroker's Avatar
ResaleBroker ResaleBroker is offline
 
Join Date: Aug 2004
Location: Arizona, USA
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for your help. I do appreciate it.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:25 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.03912 seconds
  • Memory Usage 2,228KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete