The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
PHP in Templates?
Can PHP scripts be added to templates?
I am looking to add the follwing (or similar) to the footer area of my pages. It basically scrapes an area of code from a given webpage. Whats the best way of doing it? PHP Code:
|
#2
|
|||
|
|||
No php in templates. There is a way to do it, but leeching via scraping I have no desire to support or help with. I believe scraping is illegal technically?
Unless you are scraping your own site for the lack of a better method to retrive the data? |
#3
|
|||
|
|||
Its the latter, I am scraping from my own site.
|
#4
|
|||
|
|||
I would suggest you use curl. You can put the hook in global and store the response in a variable after ya process it. Put that variable in the footer template and you're all set.
The advantage is, curl will sort out the socket, the headers, the responses for you. You can set a timeout and do different things if you don't get the response fast enough. So here's a piece of code I have shared before to do about the same thing, fetch remote data from a website to integrate with vBulletin. PHP Code:
|
#5
|
|||
|
|||
Thanks Noppid, I'll have a play with that and see how it goes.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|