vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   PHP Includes and external php files (https://vborg.vbsupport.ru/showthread.php?t=143598)

php4ever 03-30-2007 12:10 PM

PHP Includes and external php files
 
I read threads that say hacking vBulletin will alter support privileges and yet I see others that say using php includes is not proper either considering the vBulletin template system. What I want to know is this;

Where are there any guides, tutorials or requirements on creating products and plugins?

Which is the better method to use? products and plugins or phpincludes?

I've got code that switches content based on browser written in PHP and should work fine as an include but standard phpinclude methods dont work.

Any direction would be appreciated.

alster 03-30-2007 05:40 PM

Good question. Same question here. They told me that we have to make a mod but standards to beggin a mode are not easy and I´m still trying to figure it out.

calorie 03-30-2007 06:08 PM

You can do PHP includes in products/plugins. Example:
Code:

Hook location:
global_start

PHP code:
require_once('/path/to/file.php');

Here is an example if your PHP code prints output:
Code:

Hook location:
global_start

PHP code:
ob_start();
require_once('/path/to/file.php');
$some_output = ob_get_contents();
ob_end_clean();

Use global_start only if you want the code to run on most pages.
Otherwise, choose a more appropriate hook location.

More information can be found at the following links:

alster 03-30-2007 06:30 PM

Thank you, finally!
I´ll read it carefully.


All times are GMT. The time now is 03:50 PM.

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.01412 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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