Using phpMyFaq includes in another cms php templates.

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
mgu
Posts: 5
Joined: Sat Nov 08, 2003 5:55 am

Using phpMyFaq includes in another cms php templates.

Post by mgu »

Hello,

Although I have read over the "Howto: Include php files in phpMyFAQ", I have not found a solution to my situation.

I am using a simple php cms (dixit.net) that uses php for its own templates. I wish to incorporate PHPMyFAQ into the cms templates:

<body>
<?php include 'headfoot/header.php'; ?>
<?php include 'faq/index.php'; ?>
<?php include 'headfoot/footer.php'; ?>
</body>

When I tried the above, I get an error from PHPMyFaq: Fehler: Die Datei template/index.html kann nicht geöffnet werden.

Before I start trying weird things to get it working,
is this possibly just a path problem?

Is there any quick fix available?
Thorsten
Posts: 15759
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

it seems, this is a path problem. I don't know the CMS dixit.net, so I donÄt know how it works...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mgu
Posts: 5
Joined: Sat Nov 08, 2003 5:55 am

Post by mgu »

I didn't know php worked the way it does with includes.

Dixit, the cms, is installed in /www; phpMyFAQ is installed in /www/faq.
Dixit has user assigned templates for each page created. So instead of writing content for the FAQ page, I just assign the template that includes 'faq/index.php' in the body of the page.

Anyway, is the solution anymore complicated then editing phpMyFAQ's index.php and adding /faq to the paths?

Is there a global relative path in phpMyFAQ that I can change?
Thorsten
Posts: 15759
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

I believe, it would be easier to change the design of the phpMyFAQ templates to the templates of your CMS. This is easier than changing the code of phpMyFAQ.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mgu
Posts: 5
Joined: Sat Nov 08, 2003 5:55 am

Post by mgu »

I guess so.

Having looked into this after reading your HowTo sticky, the index.php file seems to have changed from german comments to english.

Where exactly do I put the code that is suppose to be under the "/* Einzel-Templates der Unterseiten bestimmen */" comment?

My suggestion would be for all the necessary info be already in the index.php either commented or not for the test.php example.
Thorsten
Posts: 15759
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

I will change the comments into english in phpMyFAQ 1.3.9.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mgu
Posts: 5
Joined: Sat Nov 08, 2003 5:55 am

Post by mgu »

Could you also change the HowTo sticky in this forum?

I still don't understand what to do with:

Code: Select all

$string = join ("", @file("test.php")); 
ob_start(); 
eval(" ?>".$string."<?php "); 
$value = ob_get_contents(); 
ob_end_clean();  
thank for your help,

mgu
Thorsten
Posts: 15759
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

this code is for inserting PHP-Code from a file into the FAQ.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
mgu
Posts: 5
Joined: Sat Nov 08, 2003 5:55 am

Post by mgu »

I was not clear with my last question.

Under what */ comment does the code go under in index.php?
Thorsten
Posts: 15759
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

you can put the code somewhere before

Code: Select all

/* load templates */
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply