vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to include code in misc.php (https://vborg.vbsupport.ru/showthread.php?t=211641)

BBR-APBT 04-19-2009 03:06 PM

How to include code in misc.php
 
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.

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

Quote:

Originally Posted by Dismounted (Post 1794468)
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


All times are GMT. The time now is 01:40 AM.

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.01179 seconds
  • Memory Usage 1,721KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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