Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-27-2013, 09:23 PM
Aluje Aluje is offline
 
Join Date: Jan 2013
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default External PHP file not displaying results

I am having issues including a php file in my header on all pages. I was able to make this function yesterday however, today after I have deleted the other plugin I am unable to even make 'Hello World' show up. I have included screenshots of all of the areas where this include should effect.

Please see attached. What am I doing wrong?

Thank you for taking the time to look into this in advance.
Attached Images
File Type: png phpCode.png (30.2 KB, 0 views)
File Type: jpg plugin.jpg (89.5 KB, 0 views)
File Type: png debugPage.png (50.2 KB, 0 views)
File Type: jpg frontpage.jpg (63.0 KB, 0 views)
Reply With Quote
  #2  
Old 01-27-2013, 09:28 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try changing the hook location to parse_templates.

Edit: also, you need to insert {vb:raw php_include} in the headinclude template (maybe you have it but just didn't show it).
Reply With Quote
  #3  
Old 01-27-2013, 09:36 PM
Aluje Aluje is offline
 
Join Date: Jan 2013
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The call to the variable is in the headinclude, I just forgot a screenshot

Using the parse_templates did not work. I did a search of the page just in case the code is black or in case it ended up behind the forums and the search is not finding anything called "Hello".

(I have included the screenshot I forgot.)
Attached Images
File Type: jpg template.jpg (100.5 KB, 0 views)
Reply With Quote
  #4  
Old 01-27-2013, 09:43 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm..well, you have that in headinclude which means it's outside the body tags. I suppose it should appear anyway, but maybe it isn't for some reason. Did you try viewing the html source of the page to see if it's there? (it should be near the top).
Reply With Quote
  #5  
Old 01-27-2013, 09:50 PM
Aluje Aluje is offline
 
Join Date: Jan 2013
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It is no where in the html code.

Should I try putting it in a template inside the body tags? If so is there a suggestion for which template I should put it in?
Reply With Quote
  #6  
Old 01-27-2013, 09:54 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

'header' is inside the body tags, I believe. But if it isn't in the html source now then I don't think changing the template will make any difference.

If you have more than one style, are you sure you're viewing the same style as the template you modified?

Try simplifying things, like try just setting $php_include to a string to see if it's the buffering or the include that's the problem (I see where it says the file was included, so I don't expect it's that).
Reply With Quote
  #7  
Old 01-27-2013, 09:58 PM
Aluje Aluje is offline
 
Join Date: Jan 2013
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Still nothing showing in the code, see below for the changed code:

Quote:
ob_start();
require_once('./includes/phpinclude.php');
$php_include = "Hello World";
ob_end_clean();

vB_Template:: preRegister('headinclude',array('php_include' => $php_include));
Edit: I only have one style on my page.
Reply With Quote
  #8  
Old 01-27-2013, 10:02 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I really don't see any reason that wouldn't work unless you're not looking at the template that you modified. I see from the picture that you're modifying the Master style - has the headinclude template been modified in the Default style (or any parent of your chosen style)?

Try putting Hello World directly in the headinclude template and see if that works.
Reply With Quote
  #9  
Old 01-27-2013, 10:12 PM
Aluje Aluje is offline
 
Join Date: Jan 2013
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried putting the "Hello World" directly into the headinclude and it did not work. So, I went into a clean install of vBulletin and tried the plugin there and it worked. I guess somehow the original code of the forum was corrupted while I was working on it yesterday.

I will redevelop my website on the clean version, thank you for your help. It is greatly appreciated
Reply With Quote
Reply


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 10:05 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.04177 seconds
  • Memory Usage 2,258KB
  • Queries Executed 12 (?)
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_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (5)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)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_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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete