vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Query for forum(s) thread count (https://vborg.vbsupport.ru/showthread.php?t=152480)

ResaleBroker 07-17-2007 02:11 AM

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. :)

Eikinskjaldi 07-17-2007 02:31 AM

Quote:

Originally Posted by ResaleBroker (Post 1293312)
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'


ResaleBroker 07-17-2007 02:54 AM

Quote:

Originally Posted by Eikinskjaldi (Post 1293322)
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]}

Eikinskjaldi 07-17-2007 03:24 AM

Quote:

Originally Posted by ResaleBroker (Post 1293331)
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.

ResaleBroker 07-17-2007 03:34 AM

Quote:

Originally Posted by Eikinskjaldi (Post 1293350)
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]

Eikinskjaldi 07-17-2007 05:04 AM

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.

ResaleBroker 07-17-2007 05:17 AM

Thank you for your help. I do appreciate it.


All times are GMT. The time now is 06:45 AM.

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.03440 seconds
  • Memory Usage 1,731KB
  • 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
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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