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&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=faq_group&action=edit&id=" . $cres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]) . "</a>"; $cres[$i]["delete"] = "<a href=\"index.php?page=admin&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=faq_group&action=delete&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&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=faq_group&action=add\">" . $language["FAQ_ADD"] . "</a>"); unset($cres); }
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&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=faq_question&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&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=faq_question&action=edit&id=" . $cres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]) . "</a>"; $cres[$i]["delete"] = "<a href=\"index.php?page=admin&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=faq_question&action=delete&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&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=faq_question&action=add\">" . $language["FAQ_QUESTION_ADD"] . "</a>"); unset($cres); }