PDA

View Full Version : How to include code in misc.php


BBR-APBT
04-19-2009, 03:06 PM
I have a chunk of code in a plugin In which I include in misc.php in vbulletin to display.
The problem is it always shows at the top.
I want to make this its own page in misc.php with its own block instead of at the top of the page above the header. Any help would be great.

Here is an example code.


if (isset($_GET['test'])) if ($_GET['test] == 'true')
{
if (!$vbulletin->userinfo['userid'] OR !($permissions['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']))
{
print_no_permission();
}
require_once('page.php');
}

Dismounted
04-19-2009, 03:23 PM
You have to kill the script (with exit()), otherwise, the rest of misc.php will still run.

BBR-APBT
04-19-2009, 04:04 PM
You have to kill the script (with exit()), otherwise, the rest of misc.php will still run.
That kills the template and everything.

I want to have a box on misc.php Right now the include is at the very top above the header and all. I am trying to have its own space there on the page.

Lynne
04-19-2009, 05:30 PM
You don't say what is in your php script, but perhaps you shouldn't echo (I'm guessing that is what you are doing) and instead set a variable with the results which you can put wherever you want on the page.

BBR-APBT
04-19-2009, 08:27 PM
I am including a php file with a form and a bunch of if statements.

it all runs just fine only problem is it stays at the very top.

Lynne
04-19-2009, 09:11 PM
Ok, but what method are you using to output the results from your php file? If you are using echo, then it will go into the page wherever the code gets called which is not necessarily where you want it.

BBR-APBT
04-19-2009, 09:24 PM
ok I got it I had to make a plugin for just the ob code stuff.


Ok all done here is what I came up with.
https://vborg.vbsupport.ru/showthread.php?t=211677