The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Inserting PHP Twitter aggregation in footer help
I have a simple php script for twitter aggregation that I want to embed into the footer of my vbulletin site. I am very familiar with code, but its not displaying. It just shows the code like it wasn't wrapped in php tags. So I tried to create a php widget, and it displayed above the header of the site, and showed some errors referring to lines of code in its config file. I have the script working on a plain php page outside of vbulletin on the same server and it doesn't show any errors.
Does anyone know why it would not work correctly while inserted into the vbulletin site? All I am wanting to do is show some specific users latest tweets on my site. But displaying using php not javascript. I had posted on vbulletin.com but they told me to post here. Thanks for any help! |
#2
|
|||
|
|||
If you use the code in a php widget, you'd probably need to change it to save any output in a string called $output, otherwise it will come out at the top of the page as you saw. If you don't want to go though and change the code, you could also do something like this:
PHP Code:
You could also do the same thing without a widget (if you want), by putting that code in a plugin and registering the variable to a template, like PHP Code:
Code:
{vb:raw my_output} |
#3
|
|||
|
|||
Thank you for your reply. I am going to plug this stuff in and see what I run into. Thank you very much for your help!
--------------- Added [DATE]1323283861[/DATE] at [TIME]1323283861[/TIME] --------------- One quick question. what should I specify as the "hook location"? This would be my first plugin to configure with vbulletin. |
#4
|
|||
|
|||
For something going in the footer, parse_templates is probably a good one to use. It's called just before the header and footer templates are rendered (you can see where it is if you look in includes/class_bootstrap.php and search for parse_templates).
|
#5
|
|||
|
|||
PHP Code:
|
#6
|
|||
|
|||
Quote:
Quote:
|
#7
|
|||
|
|||
Ok I got it working, but in vbulletin it gives me an error. installed in its own directory on my server it works fine and doesn't throw any errors.
Warning: file_get_contents(http://twitter.com/statuses/user_timeline/I.xml) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in [path]/TwitterClass.php on line 400 I know its relevant to the code I'm using to display the twitter feeds. But I didnt know if you could tell from the error what might be interfering. |
#8
|
|||
|
|||
Well, the url it's trying to open *is* invalid, so if it's working outside of vbulletin it must be because it's opening a different url. Maybe the url string is being built from some config information that it's not getting in the vb integrated "version".
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|