Current time: 02-09-2012, 05:39 AM Hello There, Guest! (LoginRegister)


Php includes or SSI in templates?
01-08-2009, 03:11 AM
Post: #1
Solved: 1 Year, 4 Months, 1 Week, 3 Days, 15 Hours, 34 Minutes, 52 Seconds ago Php includes or SSI in templates?
Hi, I have tested some script to include in mybb templates, but dont work. For example, a simple php script for random quotes, I tried with this:

PHP Code:
<?
include('myserverpath/randomquote.php');
?>

But dont work.

How I can include php files in templates?
Thank you.
Find all posts by this user
01-08-2009, 03:47 AM
Post: #2
Solved: 1 Year, 4 Months, 1 Week, 3 Days, 15 Hours, 34 Minutes, 52 Seconds ago RE: Php includes or SSI in templates?
At the top of global.php after <?php, add:
PHP Code:
ob_start();
include(
'myserverpath/randomquote.php');
$my_random_quote ob_get_clean(); 

Then in your template use {$my_random_quote}

Dennis Tsang :: MyBB Developer
Follow me on Twitter: @dennistt

Vote MyBB as the #1 Free Forum Software of 2011
Visit this user's website Find all posts by this user
01-08-2009, 05:59 AM
Post: #3
Solved: 1 Year, 4 Months, 1 Week, 3 Days, 15 Hours, 34 Minutes, 52 Seconds ago RE: Php includes or SSI in templates?
Thank you DennisTT
Find all posts by this user
01-13-2009, 04:59 PM
Post: #4
Solved: 1 Year, 4 Months, 1 Week, 3 Days, 15 Hours, 34 Minutes, 52 Seconds ago RE: Php includes or SSI in templates?
On an upgrade will this need to be done again?

And can I do multiple php files this way?
Find all posts by this user
01-13-2009, 05:08 PM
Post: #5
Solved: 1 Year, 4 Months, 1 Week, 3 Days, 15 Hours, 34 Minutes, 52 Seconds ago RE: Php includes or SSI in templates?
If global.php has changes then obviously yes, you'll need to make the changes again. otherwise, no.

Download My Plugins
My Personal Site - Twitter
[Image: eX4bjF]
Visit this user's website Find all posts by this user
01-13-2009, 05:18 PM (This post was last modified: 01-13-2009 05:19 PM by Matalina.)
Post: #6
Solved: 1 Year, 4 Months, 1 Week, 3 Days, 15 Hours, 34 Minutes, 52 Seconds ago RE: Php includes or SSI in templates?
Nevermind I found a plugin that will do the job.

http://community.mybboard.net/thread-402...#pid271885
(01-13-2009 05:08 PM)MattR Wrote:  If global.php has changes then obviously yes, you'll need to make the changes again. otherwise, no.

That's not acceptable solution then. The whole point of persuading the client to use myBB was for the ability to make modifications with hacking the core code.

Thankfully I found a plugin that does the job for me.
Find all posts by this user
01-13-2009, 05:21 PM
Post: #7
Solved: 1 Year, 4 Months, 1 Week, 3 Days, 15 Hours, 34 Minutes, 52 Seconds ago RE: Php includes or SSI in templates?
But the edit Dennis gave is just a small core file edit, so if that file where to be updated, you'd have to add it back, that's all I meant.

Download My Plugins
My Personal Site - Twitter
[Image: eX4bjF]
Visit this user's website Find all posts by this user


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication