modifying index.php and index.html for new variables

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
jorj
Posts: 7
Joined: Thu Jan 08, 2004 2:06 am
Contact:

modifying index.php and index.html for new variables

Post by jorj »

Hi,
I am using phpmyfaq 1.3.9, and I would like to add some extra variables to be displayed in the index.html template.

I have modified the index.php as follows:

setting the main variables:

Code: Select all

$tpl->processTemplate ("index", array(
                                "writeTitle" => $title,
                                "metaDescription" => $metaDescription,
                                "metaKeywords" => $metaKeywords,
                                "metaPublisher" => $metaPublisher,
                                "metaLanguage" => $metaLanguage,
                                 ...etc
I have added some variables at the end like this:

Code: Select all

                                "showDate" => $showdate,
                                "showTime" => $showtime);
$showtime and $showdate are variables that I have defined earlier.

In the INDEX.HTML file, whenever I wanted these variables to be displayed, I have placed them in curley braces: eg {showTime}

However, when I go to the home page, I get the following error:

Code: Select all

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/html/kb/faq/index.php on line 141
Line 141 is the last line of the $tpl array above.

Any ideas?
Thorsten
Posts: 15739
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

maybe you have forgotten a closing bracket?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
jorj
Posts: 7
Joined: Thu Jan 08, 2004 2:06 am
Contact:

Post by jorj »

Thorsten wrote:Hi,

maybe you have forgotten a closing bracket?

bye
Thorsten
That was it. I forgot a closing bracket.
Thanks.
Post Reply