MyBB Community Forums
urrghh is there a simple way to include an HTML file without writing a plugin - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: urrghh is there a simple way to include an HTML file without writing a plugin (/thread-114544.html)



urrghh is there a simple way to include an HTML file without writing a plugin - Dannymh - 2012-03-07

Hi all,

I have been trying to include a ticker on my page which grabs the latest sports odds from one of my pages and then scrolls it across.

When I gather the odds via CRON, it creates an HTML page for me with the lnks that will scroll across the page, and I want to include this into the ticker.

I can alternately have this include an XML file isntead. I have had an absolute nightmare trying to get this to include into my template and wondered if anyone knew of a simple way to include either an XML file or an HTML file.

Dan


RE: urrghh is there a simple way to include an HTML file without writing a plugin - fizz - 2012-03-07

include an html file where? Just in like pagename.php?

IF that's it just add:
<?php include('file.html');?>
wherever u want the html to display.


RE: urrghh is there a simple way to include an HTML file without writing a plugin - Dannymh - 2012-03-07

no inside a template. I wrote a plugin for this instead and just replace the {Live_odds_ticker}

with the content of the HTML file using get_file_contents()


RE: urrghh is there a simple way to include an HTML file without writing a plugin - pavemen - 2012-03-07

hard code it into global.php or another page and dump it into a variable that you then insert into the template where you want it to show

or

use "patches" plugin to insert to code you need for you

or

use the "hooks" plugin to run specific code for a known hook without having to write your own plugin

or

write a plugin