vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Variable Question (https://vborg.vbsupport.ru/showthread.php?t=203102)

ChrisChristian 01-26-2009 12:19 AM

Variable Question
 
Hi!

How I can use these variables in threads/posts:

I already tried everything, but I can?t retrieve these values in posts/threads.

In IP.BOARD is very easy to retrieve these types of information to show in posts/threads, but I can?t figure out how to do this in vBulletin.

Thanks in advance.

Code:


$totalthreads
$totalposts
$numbermembers
$totalonline
$numberregistered
$numberguest
$recordusers
$recorddate
$recordtime
$activeusers
$activemembers
$newusername
$birthdays
$upcomingevents


Dismounted 01-26-2009 03:49 AM

Do you mean display them in templates, or do you mean something like a BB Code?

ChrisChristian 01-26-2009 06:21 AM

Quote:

Originally Posted by Dismounted (Post 1724850)
Do you mean display them in templates, or do you mean something like a BB Code?

In a template. For example, postbit or postbit_legacy.

The values I?m REALLY need for now are:

Code:

$totalthreads
$totalposts

No matter what I do, I can?t retrieve these values in a plugin that run in postbit or postbit_legacy.

Dismounted 01-26-2009 07:21 AM

Straight from index.php: (I assume you searched on how to fetch these details before?)
PHP Code:

// get total threads & posts from the forumcache
$totalthreads 0;
$totalposts 0;
if (
is_array($vbulletin->forumcache))
{
    foreach (
$vbulletin->forumcache AS $forum)
    {
        
$totalthreads += $forum['threadcount'];
        
$totalposts += $forum['replycount'];
    }
}
$totalthreads vb_number_format($totalthreads);
$totalposts vb_number_format($totalposts); 

You must fetch the "forumcache" item from the datastore before this will work ($specialtemplates array).

ChrisChristian 01-26-2009 08:55 AM

Yes, I searched. I will test this asap. Thanks!

--------------- Added 26/01/2009 at 09:24 ---------------

Bah, I give up! I?m trying to port a modification I did for IP.BOARD that there is no similar for vBulletin, but vB code is too messy to boot and I?m not a php guru. Thanks anyway Dismounted. :up:


All times are GMT. The time now is 09:21 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.01636 seconds
  • Memory Usage 1,724KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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