Instructions: Upload and run faq_install.php from your admin directory. Follow the on-screen directions.
Upgrading from Stasik's hack: Upload and run faq_install.php from your admin directory and choose the option to upgrade from v2 of the hack.
Upgrading from a previous version of *this* hack (e.g. from this thread): Upload and run faq_install.php from your admin directory and choose the option to upgrade from "v3, v31, or v32" of the hack.
Please DO NOT contact me via PM, IM, email, or otherwise outside this thread about this hack.
Thanks to Stasik for the great hack!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I did the hack and it worked fine for me a couple of weeks ago but now the FAQ when clicked upon is empty ... I might have done another hack that might have affected one of the files ... any opinions / advice ???
if ($action=="faq") {
$templatesused = "faq_title,faq_head,faq_entry";
include("./global.php");
if(isset($page)){$sql = "WHERE faqid='$page'";}
$query = "SELECT faqid,title FROM faq$sql ORDER BY showorder";
$faqs=$DB_site->query($query);
while ($faq=$DB_site->fetch_array($faqs)) {
if (isset($page))
{$title = " > <a href='misc.php?s=$session[sessionhash]&action=faq&page=$faq[faqid]'>$faq[title]</a>";
}
$questions=$DB_site->query("SELECT entryid,title,faqid FROM faqentries WHERE faqid='$faq[faqid]' ORDER BY showorder");
while ($question=$DB_site->fetch_array($questions)) {
eval ("\$faqtitles .= "".gettemplate("faq_title")."";");
}
eval ("\$faqhead .= "".gettemplate("faq_head")."";");
unset ($faqtitles);
}
if (isset($page)) {
$entries=$DB_site->query("SELECT entryid,title,text FROM faqentries WHERE faqid='$page' ORDER BY showorder");
while($entry=$DB_site->fetch_array($entries)){
$entry[text] = bbcodeparse2($entry[text],$entry[dohtml],$entry[dobbcode],$entry[dosmilies],$entry[dobbcode]);
eval ("\$faqentries .= "".gettemplate("faq_entry")."";");
}
}
eval("dooutput("".gettemplate("faq")."");");
}
I'm running v 2.2.1
but then when asked to find
PHP Code:
if ($action=="faq") {
$templatesused = ""; // Only one template used so load it when called
include("./global.php");
$page = intval($page);
if (!$page)
$page = '';
eval("dooutput("".gettemplate("faq$page")."");");
FireFly or another person, could you please let me know why I am getting the below error. I have applied the fix provided by Bira as well as the one that another member provided which is supposed to fix the ordering problem, below is the error I get when trying to change the order:
Warning: Variable passed to each() is not an array or object in /path/to/my/forums/admin/faq.php on line 344
I installed it, and there weren't any updates to the admin control panel. If I try to run faq.php directly I get some complaint about "Fatal error: call to undefined function: cpheader() in....path\faq.php on line 13.
You still would have to run the FAQ Install file to update things Christina, I think anyway (since there may be new queries or such added to the db).
I still have not figured out why I get the above error, Can anyone help out on this, I know I can not be the only one getting this, or am I? (I am using 2.2.1)