Jump to content

Insert/include: How to output code only if is part of IPB?


Recommended Posts


With wordpress i can use:

// Prevent Direct Access
if (defined('DB_NAME'))
	echo '... my code';

i don't have found something similar with ipb, and if i use insert in template i don't know how i can prevent code output if is called via url (no inside ipb).

i've try to put in $var instead of echo, but i don't know how i can "echo" this var with insert in wy template.


so, i need to kill code if isn't in ipb, or something like this:


$var = "myoutput";

in template:

{insert="/myfile.php" echo $var;}


... how i can this? :)


thanks in advance,


Link to comment
Share on other sites

edit: ok, i've found a scratch of code inside some ipb source file:

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );


This fix my request :)



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...