{'title'}; my $body = \$_[1]->{'body'}; $$body = ''; $$title = ''; # get faqid and redirect to faq.bml if none my $faqid = $GET{'faqid'} + 0; my $faqcat = $GET{'faqcat'}; my $where; my $dbr = LJ::get_db_reader(); # loading single faqid if ($faqid) { $$title = BML::ml('.title_num', { 'num' => $faqid }); $where = "faqid=$faqid"; # loading entire faqcat } elsif ($faqcat) { my $catname = $dbr->selectrow_array("SELECT faqcatname FROM faqcat WHERE faqcat=?", undef, $faqcat); $$title = BML::ml('.title_cat', { 'catname' => LJ::ehtml($catname) }); $where = "faqcat=" . $dbr->quote($faqcat); # no faqid or faqcat specified, redirect } else { return BML::redirect("faq.bml"); } my $remote = LJ::get_remote(); # get language settings my $curlang = BML::get_language(); my $deflang = BML::get_language_default(); my $altlang = $curlang ne $deflang; my $mld; if ($altlang) { my $mll = LJ::Lang::get_lang($curlang); $mld = LJ::Lang::get_dom("faq"); $altlang = 0 unless $mll && $mld; } # query db and get data my $sth = $dbr->prepare("SELECT faqid, question, answer, faqcat, lastmoduserid, ". "DATE_FORMAT(lastmodtime, '%Y-%m-%d'), ". "UNIX_TIMESTAMP(lastmodtime) FROM faq ". "WHERE $where ORDER BY sortorder"); $sth->execute; if ($dbr->err) { $$title = $ML{'Error'}; $$body = "$ML{'error.dberror'}
$ML{'.lastupdated'}
$lastmodwho, $lastmodtime
$ML{'.error.nofaq'}
\n"; } $$body .= ""; $$body .= BML::ml('.backfaqcat',{'faqcat'=>$backfaqcat,}) . "