Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-22-2004, 05:54 PM
Pimpboard Pimpboard is offline
 
Join Date: Feb 2004
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.

Reply With Quote
  #2  
Old 12-22-2004, 06:19 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 12-22-2004, 07:05 PM
Pimpboard Pimpboard is offline
 
Join Date: Feb 2004
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 12-22-2004, 08:01 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

$userstats = unserialize($datastore['userstats']);
$newusername = $userstats['newusername'];
Reply With Quote
  #5  
Old 12-22-2004, 08:17 PM
Pimpboard Pimpboard is offline
 
Join Date: Feb 2004
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 12-22-2004, 08:48 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, you need to put the two lines in forumdisplay.php - at the end just above the print output should do.
Reply With Quote
  #7  
Old 12-22-2004, 08:54 PM
Pimpboard Pimpboard is offline
 
Join Date: Feb 2004
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 12-22-2004, 09:12 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 12-22-2004, 09:19 PM
Pimpboard Pimpboard is offline
 
Join Date: Feb 2004
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #10  
Old 12-22-2004, 10:18 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Pimpboard
GENIUS! Thanks a TON! I really appreciate it!
NP
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:57 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04399 seconds
  • Memory Usage 2,252KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete