![]() |
|
Thread Tools |
#1
|
||||
|
||||
Using External PHP Pages
Im trying to include an external php file in the VB template. I found this tutorial. I've added the following plugin with Global_Start as the Hook Location.
Plugins are Enabled in VB Options and the plugin itself is activated too.
And then I'm calling for {vb:raw includedheader} in the FORUMDISPLAY file. Nothing is showing up in my template though. No members have liked this post.
|
#2
|
||||
|
||||
You need to add this:
No members have liked this post.
Last edited by kh99; 31 Aug 2011 at 17:50. Reason: fixed error |
#3
|
||||
|
||||
Thanks
Where would i include that? No members have liked this post.
|
#4
|
||||
|
||||
__________________
Former vBulletin.org Staff Member
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.) No members have liked this post.
|
#5
|
|||
|
|||
At the end, as in the article Lynne linked to. And sorry, BTW, what I posted actually had an error in it.
![]() No members have liked this post.
|
#6
|
||||
|
||||
So this is what i have right now:
And using {vb:raw includedheader} in the "header" file in the template. Its still not working No members have liked this post.
|
#7
|
||||
|
||||
Sorry, I probably confused you with my error. This should work:
with this in the header template: {vb:raw includedheader} (the variable names needed to match in the ob_get_contents() and preRegister lines). No members have liked this post.
|
#8
|
||||
|
||||
I have a very similar question. My site is www.wavingthewheat.com
I am using a php script to count the number of rows in a table on the database. The script is loaded at www.wavingthewheat.com/chatuser.php I am trying to have the output of that file displayed in my navbar template. I have created a plugin with the following code
In my navbar template I have {vb:raw includedphp} as part of the Chat link. The php script works and displays the number of online users, however I can't get anything to display in the template using the plugin. The following members like this post: nima6
|
#9
|
|||
|
|||
It looks like you've misspelled 'navbar' in your preregister call.
The following members like this post: nima6
|
#10
|
||||||||
|
||||||||
Originally Posted by kh99
![]()
That worked. Thanks a bunch. --------------- Added 31 Aug 2011 at 20:45 --------------- I must the most idiot on this forums. I'm trying to include a second php file (for footer this time) and am having problems again. This time this is what im using:
and {vb:raw includedfooter} That doesnt work either. I changed the includedphp to includedfphp because using just the includedphp didnt work. I assumed it was because that variable was already being used elsewhere so i changed it (nothing happened though) No members have liked this post.
|
#11
|
|||
|
|||
Good catch. Sadly with that fixed it still doesn't work. Ideas?
No members have liked this post.
|
#12
|
||||
|
||||
It is official. I am an idiot. I had a spelling error as well
No members have liked this post.
|
#13
|
|||
|
|||
Which hook are you using? Try using parse_templates if you aren't already.
No members have liked this post.
|
#14
|
||||
|
||||
Originally Posted by kh99
I don't know what parse templates are.![]()
I used the hook global_start. execution order 5. Does the PHP code need to be contained in <?php tags? Here is the code in my php file in case it matters.
No members have liked this post.
|
#15
|
||||||||
|
||||||||
You don't need the <?php in plugin code.
'parse_templates' is a different hook location, but 'global_start' will work so you're OK. I think you had another typo in the code you posted above (there's an extra space in 'includedphp ', which I now see is a typo in the "Rendering Templates..." article). Try this:
BTW, not to confuse things further, but you could also do something like this in the plugin:
and {vb:raw num_chatting} in the template, and you wouldn't need the external file. No members have liked this post.
|
![]() |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 18:17.