vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [vBulletin 4] Simple way of including an external PHP file (https://vborg.vbsupport.ru/showthread.php?t=242454)

philwareham 07-20-2010 11:55 AM

Looks OK to me, have you made the plugin hook 'global_start'?

Maybe try a full server path for kbar.php?

Triky 07-20-2010 11:21 PM

Yes, I'm using global_start. Using a full server path I can get the forum to work (previously I was getting a blank forum page).. but nothing is being included. And yes, I'm sure the file is where it is supposed to be.

This is strange.. please help me! :)

ragtek 07-21-2010 04:18 AM

And that's the problem;)

There is no global_start hook anymore;)

Use global_bootstrap_init_start

philwareham 07-21-2010 07:19 AM

Quote:

Originally Posted by ragtek (Post 2072286)
There is no global_start hook anymore;)

Huh? I'm using it fine on my v4.0.5 install for hooks in the header and footer templates. Confused.

ragtek 07-21-2010 07:47 AM

PHP Code:

// Deprecated as of release 4.0.2, replaced by global_bootstrap_init_start
($hook vBulletinHook::fetch_hook('global_start')) ? eval($hook) : false;

$bootstrap->load_style();

// legacy code needs this
$permissions $vbulletin->userinfo['permissions'];

// Deprecated as of release 4.0.2, replaced by global_bootstrap_complete
($hook vBulletinHook::fetch_hook('global_setup_complete')) ? eval($hook) : false


philwareham 07-21-2010 08:13 AM

Ah OK thanks, I'll change all occurrences of 'global_start' to 'global_bootstrap_init_start' to futureproof the hooks.

Triky 07-21-2010 12:16 PM

I was having problems both with the hook and the PHP code of the plugin. This is the correct code:

PHP Code:

ob_start();
  require_once(
'/path/to/public_html/includes/kbar.php');
  
$kbar ob_get_contents();
ob_end_clean();
vB_Template::preRegister('header',array('kbar' => $kbar)); 

Thank you!

southie 10-06-2010 06:49 PM

i am having the same issue, did you ever find a solution to this problem Centrix ? or anybody else who could help ?

Quote:

Originally Posted by Centrix (Post 2069043)
I tried this, but it made my forum crash miserably. I had to restore a database backup in order for it to work again.



I made a custom template and I dont know which hook location to use for this...? if I use global start my site and forum (site is linked to the forums) is just the contents of the php file im trying to include.


webmaster74 10-09-2010 12:54 AM

Quote:

Originally Posted by Crimm (Post 2036621)
vB_Template::preRegister('TEMPLATE YOU ARE USING',array('php_include' => $php_include));[/code]

Step 2: You will have to figure out these two entries for yourself: LOCATION OF EXTERNAL FILE & Hook Location

To give you an example of what you should use is that if you want to display your external PHP file on your Forum's Home. Then replace these two with these values:

Hook Location with forumhome_start
TEMPLATE YOU ARE USING with FORUMHOME

I created this plug-in and activated it.

ob_start();
include('/home/mydomain/public_html/php/includes/ineverypost.inc.php');
$includedineverypost = ob_get_contents();
ob_end_clean();


vB_Template::preRegister('postbit_display_complete ',array('includedineverypost' => $includedineverypost));

in vb 3.8.6, this was hooked to 'postbit_display_complete'

Now with VB4, there is no template for post_display_complete....

I tried "postbit" it did notwork. I tried other postbit related templates, this still did not work.

any help ??

hihello 11-19-2010 06:23 PM

The included page shows up but it's showing on every page. I used the parse_template hook. Do I need to include anything else to only show one a specific page?


All times are GMT. The time now is 02:32 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.01304 seconds
  • Memory Usage 1,742KB
  • 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_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete