The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
FORUMHOME Variables on OTHER pages...
I've been digging and digging into the vb script, as well as searching the span of 3 different sites for this information, and have yet to find the proper method for doing this.
What I would like to be able to do is this... The "What's Going On" stats from the FORUMHOME / index.php page, as well as the "Newest Member" info, I would like to pull ALL of those variables into 1 php file, where I DEFINE the variables as global and call the page"homestats.php", where I can just put a simple: ob_start(); include "homestats.php"; $homestats = ob_get_contents(); ob_end_clean(); That's all I want to do, however, I'm finding it nearly impossible to get straight solutions to this problem by simply searching for it on the various vb related forums. My main focus for this request is getting the "Newest Member" username displayed on the FORUMDISPLAY, but I figured, I might as well request a full stat extraction, so I can use it elsewhere if needed later. The project I'm working on is doing away with the FORUMHOME completely, I just simply do not need it. BUT, I do need some of the stats and info from it, which is where my issue has arisen. If you can PLEASE help with this, I will thank you kindly, and put you in my prayers. |
#2
|
||||
|
||||
My initial thinking is that all of this can be done with templates, everything you are talking about already exists, so it's just a matter of variable placement into custom templates.
|
#3
|
|||
|
|||
Quote:
To add: <div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div> Into the template, however those variables are only defined in the index.php / FORUMHOME template. I need a way to pull those vars into other pages, or possibly define them as global variables. |
#4
|
||||
|
||||
Just use this bit of code to get the latest new user.
$userstats = unserialize($datastore['userstats']); $newusername = $userstats['newusername']; |
#5
|
|||
|
|||
Quote:
Like this? In the PHP Includes Start: ob_start(); $userstats = unserialize($datastore['userstats']); $newusername = $userstats['newusername']; echo $newusername; $newestuser = ob_get_contents(); ob_end_clean(); Then in the template call $newestuser ???? If so, I've tried this and it doesn't work for some reason. EDITED: This works for FORUMHOME, but not FORUMDISPLAY. |
#6
|
||||
|
||||
No, you need to put the two lines in forumdisplay.php - at the end just above the print output should do.
|
#7
|
|||
|
|||
Quote:
$newusername = $userstats['newusername']; eval('print_output("' . fetch_template('FORUMDISPLAY') . '");'); I did this, uploaded the modified forumdisplay.php, added $newusername into my forumdisplay template, and it does nothing. There seems to be a step or something that I am missing in the whole process. I'm just at a loss. BTW, your help is greatly appreciated. |
#8
|
||||
|
||||
Ah, userstats is not defined in the special templates array in forumdisplay.
Find; Code:
// get special data templates from the datastore $specialtemplates = array( 'iconcache', 'mailqueue' ); |
#9
|
|||
|
|||
Quote:
GENIUS! Thanks a TON! I really appreciate it! |
#10
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|