forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: cerberus on July 17, 2004, 11:10:55 pm

Title: <?php require in a theme?
Post by: cerberus on July 17, 2004, 11:10:55 pm
Hi!
I'm trying to use the SSI functions of YabbSE in a template but I can't understand why it isn't working.
I have the following code
Code: [Select]
<?php require("/web/htdocs/mysite/home/SSI.php"); ?>
<? recentTopics(); ?>
where should I insert it?

Thanks!
Title: Re: <?php require in a theme?
Post by: Joachim Müller on July 18, 2004, 07:57:27 am
you can't use php in template.html
Use theme.php instead

GauGau
Title: Re: <?php require in a theme?
Post by: cerberus on July 18, 2004, 12:14:48 pm
I did it
Code: [Select]
<?php
require(" /web/htdocs/mysite/home/SSI.php");
$template_main_menu = <<<EOT
<? recentTopics(); ?>

                <span class="topmenu">
It isn't working. It says that it has failed opening SSI.php ???
That's weird because the file is there :(
Title: Re: <?php require in a theme?
Post by: cerberus on July 18, 2004, 01:00:06 pm
I've tried in a couple of ways, I can't get it to work :(
Title: Re: <?php require in a theme?
Post by: kegobeer on July 18, 2004, 04:17:40 pm
require(" /web/htdocs/mysite/home/SSI.php");

See the space between require(" and /web?  Delete it and see if that helps.
Title: Re: <?php require in a theme?
Post by: cerberus on July 18, 2004, 06:21:13 pm
My code hasn't got that space. It's just a typo that I did here :-[
Title: Re: <?php require in a theme?
Post by: cerberus on July 18, 2004, 06:56:52 pm
I've modified theme.php
Code: [Select]
<?php
$template_main_menu 

require(
"/web/htdocs/mysite/home/SSI.php");
recentTopics();
<<<EOT
<span class="topmenu">
now I see the recent topics list output by SSI.php, but I don't see nothing related to the gallery. After the recent topics there:
Quote
Warning: main(lang/english.php): failed to open stream: No such file or directory in /web/htdocs/mysite/home/foto/include/init.inc.php on line 246

Fatal error: main(): Failed opening required 'lang/english.php' (include_path='.:/usr/local/lib/php') in /web/htdocs/mysite/home/foto/include/init.inc.php on line 246
But all the files intact and readable ???
Title: Re: <?php require in a theme?
Post by: Joachim Müller on July 18, 2004, 08:24:22 pm
Will get hard, as Yabb SE and cpg share some function and var names. I suggest using <iframe> instead, with the source being an empty file that just has the include in it.

GauGau
Title: Re: <?php require in a theme?
Post by: cerberus on July 18, 2004, 08:31:48 pm
So I have to create an intermediate php file which uses the ssi functions and include it via iframes. I'll try now.