vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Defining a variable (https://vborg.vbsupport.ru/showthread.php?t=71983)

paulyy 11-21-2004 03:41 AM

Defining a variable
 
How do I create a variable that will detect the page and show a certain image?

I'm not a PHP person at all, so please reply in dummy language :) I figured in theory it would be something like;

PHP Code:

$pageimg 
   IF 
page=gallery.php SHOW <img src="images/misc/gallery.gif" /> 
     OR
   IF 
page=cars.php SHOW <img src="images/misc/car.gif" /> 

I plan on adding this to my phpinclude_start. Any help is appreciated!

paulyy 11-21-2004 05:14 AM

Just remembered xenon told me awhile back that declaring variables in the phpinclude_start won't actually work in "called templates". Does this mean it won't work in the header template? If not, how or where do I declare them so that they will?

Any help on this is appreciated!

Xenon 11-21-2004 04:17 PM

PHP Code:

if (THIS_SCRIPT == 'gallery'$showimage '<img src="images/misc/gallery.gif" />'

this belongs to the phpinclude_start template

and it works in the header but there are templates which are called from within functions, and those can't use those vars (like postbit for example)

paulyy 11-22-2004 05:27 AM

I see, thanks a lot! :)

paulyy 11-22-2004 09:49 AM

Nevermind done this bit! :)

Xenon 11-24-2004 05:03 PM

you're welcome :)


All times are GMT. The time now is 03:47 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.01043 seconds
  • Memory Usage 1,716KB
  • 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)post_thanks_navbar_search
  • (1)printthread
  • (6)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