Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 08-23-2012, 09:11 AM
0zx 0zx is offline
 
Join Date: Feb 2012
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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!
Reply With Quote
  #2  
Old 08-23-2012, 12:12 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #3  
Old 08-23-2012, 08:40 PM
0zx 0zx is offline
 
Join Date: Feb 2012
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Not yet tested it, but it seem to be exactly what I needed
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08933 seconds
  • Memory Usage 2,170KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete