예제 #1
0
function faq_read()
{
    global $admintpl, $language, $STYLEURL, $CURUSER, $STYLEPATH;
    $admintpl->set("faq_add", false, true);
    $admintpl->set("language", $language);
    $cres = genrelistfaq('', 'faq_group');
    for ($i = 0; $i < count($cres); $i++) {
        $cres[$i]["name"] = unesc($cres[$i]["title"]);
        $cres[$i]["edit"] = "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=faq_group&amp;action=edit&amp;id=" . $cres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]) . "</a>";
        $cres[$i]["delete"] = "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=faq_group&amp;action=delete&amp;id=" . $cres[$i]["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
    }
    $admintpl->set("faq", $cres);
    $admintpl->set("faq_add_new", "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=faq_group&amp;action=add\">" . $language["FAQ_ADD"] . "</a>");
    unset($cres);
}
예제 #2
0
function faq_read($search = '')
{
    global $admintpl, $language, $STYLEURL, $CURUSER, $STYLEPATH;
    $admintpl->set("faq_add", false, true);
    $admintpl->set("language", $language);
    $admintpl->set("groups", cat_combo_search($_POST['faq_id']));
    $append = '';
    if (strlen($search) > 0 && strlen($_POST['faq_id']) > 0) {
        $append = " AND cat_id = " . sqlesc($_POST['faq_id']) . "";
        $admintpl->set("frm_action", "index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=faq_question&amp;action=serch");
    }
    $cres = genrelistfaq($append);
    for ($i = 0; $i < count($cres); $i++) {
        $cres[$i]["name"] = unesc($cres[$i]["title"]);
        $cres[$i]["group_name"] = unesc(getGroup($cres[$i]["cat_id"]));
        if (strlen($cres[$i]["description"]) > 200) {
            $cres[$i]["description"] = format_comment(unesc(substr($cres[$i]["description"], 0, 200) . '...'));
        } else {
            $cres[$i]["description"] = format_comment(unesc($cres[$i]["description"]));
        }
        $cres[$i]["edit"] = "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=faq_question&amp;action=edit&amp;id=" . $cres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]) . "</a>";
        $cres[$i]["delete"] = "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=faq_question&amp;action=delete&amp;id=" . $cres[$i]["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
    }
    $admintpl->set("categories", $cres);
    $admintpl->set("faq_add_new", "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=faq_question&amp;action=add\">" . $language["FAQ_QUESTION_ADD"] . "</a>");
    unset($cres);
}