vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Php file in vbulletin [help] (https://vborg.vbsupport.ru/showthread.php?t=286974)

0zx 08-23-2012 09:11 AM

Php file in vbulletin [help]
 
Hello. First of all I'm not sure if this is the correct place to post this, but I do it anyways. Sorry if its incorrect, and feel free to move/delete my post.

Anyways, I'd like to refer to these URLS:
https://www.vbulletin.com/forum/show...letin-template
https://www.vbulletin.com/forum/show...18#post1066718

In the last URL it's pretty much answering all of my isses, but ONE.

At the bottom of hes thread he says this:
Note: If you wish to include() multiple PHP files, make sure you use ob_clean() before each include() to reset the buffer.

Alright. So I DO want to include multiple PHP files, but I want one file on seperate templates.

My guess would be to set an value to each of the includes, or rename the second "$includedphp" to "$includedphp1".

But I'm very new to coding, and I actually dont dare to mess around with it too much.

So, to summary my thread:

I want to include 2(multiple) .php files into vbulletin.
I've managed to include 1(single) .php file into vbulletin.

I've got php file 1 on template 1
I want php file 2 on template 2

What he explains how to do, is to have 2 php files on one template.


Now, as said before I'm very new to the php language, and programming generally, so dont shot me if anything I say is incorrect^^ All I want is to understand how to... do what I've asked for:)


Thanks in advice!

kh99 08-23-2012 12:12 PM

If you wanted to include multiple files you could do this:

Code:

ob_start();
  include('path/to/this/file/myfile.php');
  $includedphp = ob_get_contents();
  ob_clean();
  include('path/to/this/file/myfile1.php');
  $includedphp1 = ob_get_contents();
  ob_clean();
  include('path/to/this/file/myfile2.php');
  $includedphp2 = ob_get_contents();
  // etc
ob_end_clean();


Of course you can name the variables anything you want (they don't have to be $includedphp, they could be $myfile, $myfile1, etc).

0zx 08-23-2012 08:40 PM

Thanks, Not yet tested it, but it seem to be exactly what I needed:)


All times are GMT. The time now is 03:45 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.01024 seconds
  • Memory Usage 1,713KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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