/*
+--------------------------------------------------------------------------
| Advanced Image Hosting Script v2.1
| ========================================
| by Stephen Yabziz
| (c) 2005 YABSoft Services
| http://www.yabsoft.com
| ========================================
| Web: http://www.yabsoft.com
| Email: ywyhnchina@163.com
+---------------------------------------------------------------------------
|
| > Script written by Stephen Yabziz
| > Date started: 14th February 2004
|
+--------------------------------------------------------------------------
*/
define("IN_FAQ",1);
include "includes/inc.php";
$baseUrl='index.php?';
$db->setQuery("select * from faq order by `order`");
$db->query();
$FAQS=$db->loadRowList();
if($FAQS)
foreach($FAQS as $faq)
{
if($faq[p_id])
$items[$faq[p_id]][]=$faq;
else
{
$sections[]=$faq;
$section_list.='';
}
}
$template->set_filenames(array(
'body' => 'faq.html')
);
if($sections)
foreach($sections as $section)
{
$i++;
$section['class']=$i%2?'tdrow1':'tdrow2';
$template->assign_block_vars('menu', $section);
if($items[$section[faq_id]])
foreach($items[$section[faq_id]] as $item)
{
$template->assign_block_vars('menu.row', $item);
}
}
if($sections)
foreach($sections as $section)
{
$i++;
$section['class']=$i%2?'tdrow1':'tdrow2';
$template->assign_block_vars('section', $section);
$i=0;
if($items[$section[faq_id]])
foreach($items[$section[faq_id]] as $item)
{
$i++;
$item['class']=$i%2?'tdrow1':'tdrow2';
$item['answer']=str_replace("\n","
",$item['answer']);
$template->assign_block_vars('section.row', $item);
}
}
require_once("header.php");
$template->pparse('body');
include "footer.php";
?>