PDA

View Full Version : Variable Question


ChrisChristian
01-26-2009, 12:19 AM
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.


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

$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?)
// 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: