vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Exclude global_start from register.php? (https://vborg.vbsupport.ru/showthread.php?t=225390)

slobra 10-16-2009 05:53 PM

Exclude global_start from register.php?
 
I've created this global_start plugin to display a list of sponsor images on my forum:

Code:

ob_start();
include('/home/username/site.com/forums/sponsors.php');
$includedphp = ob_get_contents();
ob_end_clean();

I'm calling it in the footer template. The list shows up on every page but I want to exclude it from register.php. I know there's a way to do this but I don't know how. Can someone help? Thanks!

Lynne 10-16-2009 06:13 PM

put a condition around it based on THIS_SCRIPT. eg:
PHP Code:

if (THIS_SCRIPT != 'name_of_script') {
stuff



slobra 10-16-2009 08:03 PM

Thanks for the tip. I'm a little confused. Do I add that to my global_start plugin, sponsors.php, or register.php? I tried:

if (THIS_SCRIPT != 'sponsors.php') {
ob_start();
include('/home/username/site.com/forums/sponsors.php');
$includedphp = ob_get_contents();
ob_end_clean();
}

I must be missing something. :)

Lynne 10-16-2009 08:15 PM

Look at the top of your script and you'll see a line like this (example):
PHP Code:

define('THIS_SCRIPT''newthread'); 

Then, in your plugin, you use 'newthread' in the condition like this:
PHP Code:

if (THIS_SCRIPT != 'newthread') { 


slobra 10-16-2009 10:48 PM

Got it, thanks very much Lynne!


All times are GMT. The time now is 09:28 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.01161 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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