vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Quick Question - Defining Variables (https://vborg.vbsupport.ru/showthread.php?t=49149)

.:.NetStartz.:. 02-20-2003 11:54 AM

Quick Question - Defining Variables
 
I've been trying this for several days before I decided to seek help. Myself and my partner have put a lot of work into the board/site and I don't want to ruin it by messing up one file.

Basically I would like to use my custom template ( custom_template ) by calling the variable $custom

Where would I go or how would I define that variable so it would work everywhere on my board including myVBindex and custom php pages made.

Thanks,
:classic:

Xenon 02-20-2003 11:57 AM

you have to create it within global.php where $header and $footer are defined :)

.:.NetStartz.:. 02-20-2003 11:59 AM

Could you tell me how... ;)

.:.NetStartz.:. 02-20-2003 12:02 PM

Do I find
Quote:

eval("\$footer .= \"".gettemplate('footer')."\";");
and replace it with
Quote:

eval("\$footer .= \"".gettemplate('footer')."\";");
eval("\$custom .= \"".gettemplate('custom_template')."\";");
?

.:.NetStartz.:. 02-20-2003 12:10 PM

If so...that gives me the following error...

Quote:

Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/eogn/public_html/forum/global.php(321) : eval()'d code on line 1

Xenon 02-20-2003 12:19 PM

PHP Code:

eval("\$custom = \"".gettemplate('custom_template')."\";"); 


.:.NetStartz.:. 02-20-2003 12:26 PM

Heres a piece of my global.php file after the changes.

Quote:

$header='';
$footer='';

// parse PHP include ##################
eval(gettemplate('phpinclude',0,0));

// parse css, header & footer ##################
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval("\$header .= \"".gettemplate('header')."\";");
eval("\$footer .= \"".gettemplate('footer')."\";");

// custom templates ##################
eval("\$468x60 = \"".gettemplate('ads_468x60_main')."\";");

// parse other global templates

eval("\$gobutton = \"".gettemplate('gobutton')."\";");
But then I get this error.
Quote:

Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/eogn/public_html/forum/global.php(321) : eval()'d code on line 1

Xenon 02-20-2003 12:41 PM

AFAIK $468x60 is no valid varname

php varialbes have to start with an letter as far as i know..

.:.NetStartz.:. 02-20-2003 01:00 PM

Thanks -- Works like a charm.

Xenon 02-20-2003 01:13 PM

you're welcome :)


All times are GMT. The time now is 01:01 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.01134 seconds
  • Memory Usage 1,730KB
  • 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
  • (1)bbcode_php_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