Файл: faq.php
Строк: 95
<?
session_set_cookie_params(86400);
session_start();
$full_home_path = dirname(__FILE__);
require_once($full_home_path."/_rootload.php");
mconnect();
validateUser();
if (!EnableLanguages()) { error("Can not load languages."); mclose(); exit; }
if (!GetCurrentCurrency()) { print $_lang[ErrorGetCurrentCurrency]; mclose(); exit; }
head('utf-8',$_lang[FaqTitle]);
print "<H1 class=pagetitle>".$_lang[FaqTitle]."</H1><hr class=hr>";
$FaqShowAllOnOnePage = GetSetting("FaqShowAllOnOnePage");
if ($group == '0') { $group="0"; } else { $group=@intval($group); }
if ($group and !$FaqShowAllOnOnePage and $requestgroup == "") { $requestgroup = $group; } else if (!$requestgroup and !$FaqShowAllOnOnePage) { $requestgroup = "0"; }
if ($group and $FaqShowAllOnOnePage and $requestgroup == "") { $requestgroup = $group; } else if (!$requestgroup and $FaqShowAllOnOnePage) { $requestgroup = "0"; }
if ((!$FaqShowAllOnOnePage and !$item) or $FaqShowAllOnOnePage) {
$groups = GetFaqGroups();
if (@mysql_num_rows($groups) > 0) {
print "<ul>";
while ($grp = @mysql_fetch_object($groups)) {
if (!$group or ($grp->id == $group or ($FaqShowAllOnOnePage and !$requestgroup))) {
$faqs=GetFaqs($grp->id);
if (@mysql_num_rows($faqs) > 0) {
print "<li class=faqgroup>$grp->name</b>";
print "<ul>";
while ($faq = @mysql_fetch_object($faqs)) {
if ($FaqShowAllOnOnePage) { $addUrl = "&requestgroup=$requestgroup#item$faq->id"; } else { $addUrl = "&item=$faq->id&requestgroup=$requestgroup#item$faq->id"; }
print "<li class=faqitem><a href=?group=$grp->id$addUrl class=faqitemlink>$faq->name</a>";
}
print "</ul><BR>";
}
}
}
print "</ul>";
} else {
$nogroups = 1;
}
$faqs=GetFaqs('0');
if (@mysql_num_rows($faqs) > 0) {
print "<ul>";
while ($faq = @mysql_fetch_object($faqs)) {
if ($FaqShowAllOnOnePage) { $addUrl = "#item$faq->id"; } else { $addUrl = "&item=$faq->id#item$faq->id"; }
print "<li class=faqitem><a href=?group=0$addUrl class=faqitemlink>$faq->name</a>";
}
print "</ul>";
}
} else {
print "<a href=?group=$requestgroup class=faqitemlink>".$_lang["FaqOglavlenie"]."</a><BR>";
}
print "<BR>";
if ($group != "" or $nogroups) {
$faqs=GetFaqs("$group");
if (@mysql_num_rows($faqs) > 0) {
while ($faq = @mysql_fetch_object($faqs)) {
if ($FaqShowAllOnOnePage) {
print "<a name="item$faq->id"></a><B class="faqtitle">".$faq->name."</B><BR><BR>".htmlDecode($faq->message)."<BR><BR>";
} else if ($faq->id == $item) {
print "<a name="item$faq->id"></a><B class="faqtitle">".$faq->name."</B><BR><BR>".htmlDecode($faq->message)."<BR><BR>";
break;
}
}
}
}
if ((!$FaqShowAllOnOnePage and !$item) or $FaqShowAllOnOnePage) {
} else {
print "<a href=?group=$requestgroup class=faqitemlink>".$_lang["FaqOglavlenie"]."</a><BR>";
}
foot('utf-8');
mclose();
?>