Calling {writeTopTenRow} from within main.tpl

You have a suggestion for a future version of phpMyFAQ? Then post it here!

Moderator: Thorsten

Post Reply
silvermead
Posts: 4
Joined: Thu Aug 25, 2005 3:32 pm

Calling {writeTopTenRow} from within main.tpl

Post by silvermead »

Hi, I'm trying to get the top 10 and most recent five faq lists to load within the main.tpl template, but they won't show.

See: http://support.silvermead.co.uk/

You can see at the bottom I have included them in the index.tpl and they come through perfectly.

Do I need to change somehting somewhere for writeTopTenRow and writeNewestRow to be parsed from within main.tpl please?

Thank you very much for any help in advance!
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

you have to add the following code in main.php:

Code: Select all

                'writeTopTenHeader' => $PMF_LANG['msgTopTen'],
                'writeTopTenRow' => generateTopTen(),
                'writeNewestHeader' => $PMF_LANG['msgLatestArticles'],
                'writeNewestRow' => generateFiveNewest(),
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
silvermead
Posts: 4
Joined: Thu Aug 25, 2005 3:32 pm

Post by silvermead »

I think I might have entered that wrong, now no content is loading: http://support.silvermead.co.uk


My main.php looks like:

<?php
/**
* $Id: main.php,v 1.2.2.1 2005/08/13 18:15:43 thorstenr Exp $
*
* @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @since 2002-08-23
* @copyright (c) 2001-2005 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the 'License'); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an 'AS IS'
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/

$tpl->processTemplate ('writeContent', array(
'writeNewsHeader' => $PMF_CONF['title'].$PMF_LANG['msgNews'],
'writeNews' => generateNews(),
'writeNumberOfArticles' => $PMF_LANG['msgHomeThereAre'].generateNumberOfArticles().$PMF_LANG['msgHomeArticlesOnline'])),
'writeTopTenHeader' => $PMF_LANG['msgTopTen'],
'writeTopTenRow' => generateTopTen(),
'writeNewestHeader' => $PMF_LANG['msgLatestArticles'],
'writeNewestRow' => generateFiveNewest();

$tpl->includeTemplate('writeContent', 'index');
?>
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

the file has to look like th following:

Code: Select all

<?php
/**
* $Id: main.php,v 1.2.2.1 2005/08/13 18:15:43 thorstenr Exp $
*
* @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @since 2002-08-23
* @copyright (c) 2001-2005 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the 'License'); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an 'AS IS'
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/

$tpl->processTemplate ('writeContent', array(
'writeNewsHeader' => $PMF_CONF['title'].$PMF_LANG['msgNews'],
'writeNews' => generateNews(),
'writeNumberOfArticles' => $PMF_LANG['msgHomeThereAre'].generateNumberOfArticles().$PMF_LANG['msgHomeArticlesOnline'],
'writeTopTenHeader' => $PMF_LANG['msgTopTen'],
'writeTopTenRow' => generateTopTen(),
'writeNewestHeader' => $PMF_LANG['msgLatestArticles'],
'writeNewestRow' => generateFiveNewest());

$tpl->includeTemplate('writeContent', 'index');
?>
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
silvermead
Posts: 4
Joined: Thu Aug 25, 2005 3:32 pm

Post by silvermead »

I'm really sorry but it still has a problem with that file - line 27 but I can't see anything wrong.

http://support.silvermead.co.uk/

Thank you so much for your help.
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

sorry for the bug... here's the corrected file:

Code: Select all

<?php
/**
* $Id: main.php,v 1.2.2.1 2005/08/13 18:15:43 thorstenr Exp $
*
* @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @since 2002-08-23
* @copyright (c) 2001-2005 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the 'License'); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an 'AS IS'
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/

$tpl->processTemplate ('writeContent', array(
'writeNewsHeader' => $PMF_CONF['title'].$PMF_LANG['msgNews'],
'writeNews' => generateNews(),
'writeNumberOfArticles' => $PMF_LANG['msgHomeThereAre'].generateNumberOfArticles().$PMF_LANG['msgHomeArticlesOnline'],
'writeTopTenHeader' => $PMF_LANG['msgTopTen'],
'writeTopTenRow' => generateTopTen(),
'writeNewestHeader' => $PMF_LANG['msgLatestArticles'],
'writeNewestRow' => generateFiveNewest()));

$tpl->includeTemplate('writeContent', 'index');
?>
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
silvermead
Posts: 4
Joined: Thu Aug 25, 2005 3:32 pm

Post by silvermead »

Brilliant, all fixed! Thank you so much for all your help and excellent software.
Post Reply