';
$faqcatID=$_GET['faqcatID'];
$faqID=$_GET['faqID'];
$faqcat=safe_query("SELECT question,faqID,sort FROM ".PREFIX."faq WHERE faqcatID='$faqcatID' ORDER BY sort");
if(mysql_num_rows($faqcat)) {
eval ("\$faq_question_head = \"".gettemplate("faq_question_head")."\";");
echo $faq_question_head;
$i=1;
while($ds=mysql_fetch_array($faqcat)){
if($i%2) {
$bg1=BG_1;
$bg2=BG_2;
}
else {
$bg1=BG_3;
$bg2=BG_4;
}
$i++;
$sort=$ds[sort];
$question=''.$ds[question].'';
eval ("\$faq_question = \"".gettemplate("faq_question")."\";");
echo $faq_question;
}
eval ("\$faq_foot = \"".gettemplate("faq_foot")."\";");
echo $faq_foot;
}
else echo 'no faq available.
[ go back ]';
}
elseif($_GET['action']=="faq") {
if(ispageadmin($userID)) echo'
';
$faqcatID=$_GET['faqcatID'];
$faqID=$_GET['faqID'];
$cat=safe_query("SELECT faqcatID FROM ".PREFIX."faq WHERE faqID='$faqID'");
if(mysql_num_rows($cat)) {
while($da=mysql_fetch_array($cat)) {
$backlink='Questions';
}
}
$faq=safe_query("SELECT faqcatID,question,answer FROM ".PREFIX."faq WHERE faqID='$faqID'");
if(mysql_num_rows($faq)) {
eval ("\$faq_answer_head = \"".gettemplate("faq_answer_head")."\";");
echo $faq_answer_head;
while($ds=mysql_fetch_array($faq)){
$bg1=BG_1;
$answer=$ds[answer];
$question=$ds[question];
eval ("\$faq_answer = \"".gettemplate("faq_answer")."\";");
echo $faq_answer;
}
eval ("\$faq_foot = \"".gettemplate("faq_foot")."\";");
echo $faq_foot;
}
else echo 'no faq available.
[ go back ]';
}
else {
if(ispageadmin($userID)) echo'
';
$faqcats=safe_query("SELECT * FROM ".PREFIX."faq_categories ORDER BY sort");
if(mysql_num_rows($faqcats)) {
$anzcats=mysql_num_rows(safe_query("SELECT faqcatID FROM ".PREFIX."faq_categories"));
eval ("\$faq_category_head = \"".gettemplate("faq_category_head")."\";");
echo $faq_category_head;
$i=1;
while($ds=mysql_fetch_array($faqcats)) {
$anzfaqs=mysql_num_rows(safe_query("SELECT faqID FROM ".PREFIX."faq WHERE faqcatID='".$ds[faqcatID]."'"));
if($i%2) {
$bg1=BG_1;
$bg2=BG_2;
}
else {
$bg1=BG_3;
$bg2=BG_4;
}
$faqcatname='• '.$ds[faqcatname].'';
$description=cleartext($ds[description]);
eval ("\$faq_category = \"".gettemplate("faq_category")."\";");
echo $faq_category;
$i++;
}
eval ("\$faq_foot = \"".gettemplate("faq_foot")."\";");
echo $faq_foot;
}
else echo 'no categories available.';
}
?>