Current time: 07-05-2009, 02:01 AM Hello There, Guest! (LoginRegister)


Post Reply 
Php includes or SSI in templates?
01-08-2009, 03:11 AM
Post: #1
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
Quote this message in a reply
01-08-2009, 03:47 AM
Post: #2
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}

[Image: sig.php?mybb]
MyBB is on Facebook and Twitter
Visit this user's website Find all posts by this user
Quote this message in a reply
01-08-2009, 05:59 AM
Post: #3
RE: Php includes or SSI in templates?
Thank you DennisTT
Find all posts by this user
Quote this message in a reply
01-13-2009, 04:59 PM
Post: #4
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
Quote this message in a reply
01-13-2009, 05:08 PM
Post: #5
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.

My Personal Site - Twitter
MyBB Support Team
Ille qui nos omnes servabit.
Visit this user's website Find all posts by this user
Quote this message in a reply
01-13-2009, 05:18 PM (This post was last modified: 01-13-2009 05:19 PM by Matalina.)
Post: #6
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
Quote this message in a reply
01-13-2009, 05:21 PM
Post: #7
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.

My Personal Site - Twitter
MyBB Support Team
Ille qui nos omnes servabit.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: