vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   FORUMHOME Variables on OTHER pages... (https://vborg.vbsupport.ru/showthread.php?t=73213)

Pimpboard 12-22-2004 05:54 PM

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.

:)

ericgtr 12-22-2004 06:19 PM

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.

Pimpboard 12-22-2004 07:05 PM

Quote:

Originally Posted by ericgtr
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.

Yeah, I'm thinking it should be a fairly simple thing to do, it's just that I haven't found a "working" hack for this yet. Most responses to this request are:

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.

Paul M 12-22-2004 08:01 PM

Just use this bit of code to get the latest new user.

$userstats = unserialize($datastore['userstats']);
$newusername = $userstats['newusername'];

Pimpboard 12-22-2004 08:17 PM

Quote:

Originally Posted by Paul M
Just use this bit of code to get the latest new user.

$userstats = unserialize($datastore['userstats']);
$newusername = $userstats['newusername'];


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.

Paul M 12-22-2004 08:48 PM

No, you need to put the two lines in forumdisplay.php - at the end just above the print output should do.

Pimpboard 12-22-2004 08:54 PM

Quote:

Originally Posted by Paul M
No, you need to put it in forumdisplay.php - at the end just above the print output should do.

$userstats = unserialize($datastore['userstats']);
$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.

Paul M 12-22-2004 09:12 PM

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

and add 'userstats', above the iconcache line.

Pimpboard 12-22-2004 09:19 PM

Quote:

Originally Posted by Paul M
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'
);

and add 'userstats', above the iconcache line.


GENIUS! :) Thanks a TON! I really appreciate it!

Paul M 12-22-2004 10:18 PM

Quote:

Originally Posted by Pimpboard
GENIUS! :) Thanks a TON! I really appreciate it!

NP :)


All times are GMT. The time now is 11:21 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.02566 seconds
  • Memory Usage 1,734KB
  • 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
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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