PDA

View Full Version : **Need an expierienced vbulletin coder both in html and php**


HMBeaty
08-01-2006, 02:30 AM
Just as the title says. If you can catch me on AIM as "fasternu8", that'd be good too. Anyway, I've been working on a couple projects on my site, and ONE has me REALLY stuck!!!! I'm trying to pull the stats from the forum index page (Threads, Posts, Members, Active Members) and get them to work on another page. I've so far gotten the Members and Active Members to work, but am totally stumped on how to get the Threads and Posts to come up!!!!

What I've got so far....

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'advertise'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(
'userstats'
);

// pre-cache templates used by all actions
$globaltemplates = array(
'advertise'
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once(DIR. '/includes/functions.php');

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

// ### BOARD STATISTICS #################################################

// 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);

// get total members and newest member from template
$numbermembers = vb_number_format($vbulletin->userstats['numbermembers']);
$newusername = $vbulletin->userstats['newusername'];
$newuserid = $vbulletin->userstats['newuserid'];
$activemembers = vb_number_format($vbulletin->userstats['activemembers']);
$show['activemembers'] = ($vbulletin->options['activememberdays'] > 0 AND ($vbulletin->options['activememberoptions'] & 2)) ? true : false;

// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTTA HERE... ###
($hook = vBulletinHook::fetch_hook('forumhome_complete')) ? eval($hook) : false;

$navbits = array();
$navbits[$parent] = 'Advertising on Redline Motorsports';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('advertise') . '");');

?>

I (along with Zachariah) though putting....

require_once(DIR. '/includes/functions.php');

would help, but of course not, so if you can tell me what I need to add where ever, I'd greatly appreciate it. This is starting to get VERY frustrating!!!

Sorry, I know, wrong forum

RS_Jelle
08-01-2006, 01:36 PM
Maybe you can take a look at psiStats 2006 (https://vborg.vbsupport.ru/showthread.php?t=104213) :)

It displays all those stats, so you can take a look at the code to see how this is done ;)

HMBeaty
08-01-2006, 11:01 PM
Couldn't find anything? Am I looking over something? I was looking through it kind of quick too, that mod has alot of files, lol

Paul M
08-01-2006, 11:32 PM
You don't actually load the forum cache anywhere in that script, add these lines to the backend section.

require_once(DIR . '/includes/functions_forumlist.php');
cache_ordered_forums(1);

HMBeaty
08-01-2006, 11:43 PM
AWESOME!!! That worked nicely. Thank you Paul M!!!!! Just saved me from going through about 15 more files, lol. Thank you very much sir!!