vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Variable Relocation (https://vborg.vbsupport.ru/showthread.php?t=40019)

SaintDog 06-18-2002 07:35 PM

Variable Relocation
 
It has been a while since I needed to request anything, most anything that I needed was already being released or had been released some time ago :). I want to thank all the code hackers for that, makes my life a lot easier.

----------

Down to the request, what I need is to be able to use the statistics variables in the header template, as well as the forumhome template (currently they can only be used in the foumhome template).

The statistics variables are the ones that state the member count, total thread & post count, the Un-Registered/Registered welcome message (ie: Welcome Back SaintDog!).

I would appreciate it very much if someone could make it to where I could use these variables in the header template.

Regards,

- SaintDog

Xenon 06-18-2002 09:07 PM

hmm, i'm not really sure, but try this:

copy this code from index.php
PHP Code:

$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format($numbersmembers['users']);

// get total posts
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=number_format($countposts['posts']);

$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=number_format($countthreads['threads']);

// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbersmembers[max]");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];

// if user is know, then welcome
if ($bbuserinfo['userid']!=0) {
  
$username=$bbuserinfo['username'];
  eval(
"\$welcometext = \"".gettemplate('forumhome_welcometext')."\";");
  eval(
"\$logincode = \"".gettemplate('forumhome_logoutcode')."\";");
  eval(
"\$newposts = \"".gettemplate('forumhome_newposts')."\";");

} else {
  
$welcometext "";
  eval(
"\$newposts = \"".gettemplate('forumhome_todayposts')."\";");
  eval(
"\$logincode = \"".gettemplate('forumhome_logincode')."\";");


just before this line in global.php
PHP Code:

// ###################### Start headers ####################### 

then add the variables you want to the headertemplate

SaintDog 06-18-2002 09:13 PM

Does not seem to work :( - I do appreciate you trying though :)

- SaintDog

Xenon 06-18-2002 09:18 PM

oh, i see a fault ;)

try to put the code from index.php just before this line in global.php:
// parse css, header & footer ##################

SaintDog 06-18-2002 09:27 PM

That does not work either....

- SaintDog

mr e 06-18-2002 09:51 PM

Grab whatever variables you need in the PHP Include template thing, so copy that code into that template. I think that should work. :D

SaintDog 06-18-2002 10:01 PM

That too does not work, I tried placing the code from index.php in there and nothing happened, no errors, but nothing worked either.

- SaintDog

mr e 06-18-2002 10:27 PM

You could use this hack for a base to see how it might be done.

https://vborg.vbsupport.ru/showthrea...e+users+header

Logician 06-19-2002 07:47 AM

Saintdog: what Xenon suggested is correct and does the trick. Pls double check your steps. For instance did you add the variable $numbermembers to header template after the adding the code to global.php?

SaintDog 06-19-2002 07:50 AM

Yes, that does not work for me at all, vBT is unhacked - this would be #1 for vBT, everything else is simply template modifications.

- SaintDog


All times are GMT. The time now is 03:23 PM.

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.01004 seconds
  • Memory Usage 1,745KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete