Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 28 Mar 2011, 11:26
Muffin89 Muffin89 is offline
 
Join Date: Feb 2011
Include php file in template

Hi everyone. I have some trouble including a php file in my template, will describe the problem below:

I have a template with an header, a navbar, the forum/content, footer and a fixed right bar. I want to insert this php code(for now) into the right bar:

userbox.php

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

userbox plugin:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Inside the footer template I have made a div that is fixed and I call the plugin with this code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But it doesn't output my desired string.

The HOOK is parse_templates.

When i in the plugin write echo $userboxinsert; the userbox get's inserted but at the top of the screen, so the link works.

Would be very happy if someone could help me with this problem!

--------------- Added 28 Mar 2011 at 14:09 ---------------

I can add that when I turn debug on, the file is included but it doesn't write out any text!

Last edited by Muffin89 : 28 Mar 2011 at 14:09. Reason: Auto-Merged DoublePost
Reply With Quote
  #2  
Old 28 Mar 2011, 16:48
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
This line here is registering a variable named $php_include:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That line would allow you to use this line in the footer template:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If you want to use the variable $userboxinsert, then you need to preregister that variable, not php_include.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #3  
Old 29 Mar 2011, 08:24
Muffin89 Muffin89 is offline
 
Join Date: Feb 2011
Thank you that solved the problem!
Reply With Quote
  #4  
Old 26 May 2012, 18:50
KatieG's Avatar
KatieG KatieG is offline
 
Join Date: Apr 2008
I am using (vBulletin 4.0.5 Patch Level 6)

Plugin Code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Using Hook: global_start_init_start

To display in header template I tried both below, but I still get no output


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Can anyone help please
Reply With Quote
  #5  
Old 26 May 2012, 18:53
kh99's Avatar
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Change the preRegister line to:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


(or else change the ob_get_contents() line to use $kellysmenu instead of $kbar).
__________________
Please don't PM me - post your questions in the appropriate forum.
Please don't PM me to ask me to read your thread.
Reply With Quote
  #6  
Old 27 May 2012, 00:23
KatieG's Avatar
KatieG KatieG is offline
 
Join Date: Apr 2008

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Using Hook: global_start_init_start

To display in header template I tried both below, but I still get no output

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #7  
Old 27 May 2012, 00:49
kh99's Avatar
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Try using hook parse_templates. If it still doesn't work, try this as a test:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


BTW, you definitely want to use {vb:raw kellysmenu} in the template (assuming you have some version of vbulletin 4).
__________________
Please don't PM me - post your questions in the appropriate forum.
Please don't PM me to ask me to read your thread.
Reply With Quote
  #8  
Old 27 May 2012, 07:22
KatieG's Avatar
KatieG KatieG is offline
 
Join Date: Apr 2008
Thanks

{vb:raw kellysmenu}

worked this morning
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 06:16.

Layout Options | Width: Wide Color: