Exemple #1
0
     if (isset($_POST["add"])) {
         if (CONF_BACKEND_SAFEMODE) {
             Redirect(ADMIN_FILE . "?dpt=catalog&sub=discuss&safemode=yes");
         }
         discAddDiscussion($discussion["productID"], $_POST["newAuthor"], $_POST["newTopic"], $_POST["newBody"]);
         Redirect($return_url);
     }
     $smarty->hassign("return_url", $return_url);
     $smarty->assign("discussion", $discussion);
     $smarty->assign("answer", 1);
 } else {
     if (isset($_GET["delete"])) {
         if (CONF_BACKEND_SAFEMODE) {
             Redirect(ADMIN_FILE . "?dpt=catalog&sub=discuss&productID=" . $_GET["productID"] . "&safemode=yes");
         }
         discDeleteDiscusion($_GET["delete"]);
         Redirect(GetUrlToNavigate());
     }
     $callBackParam = array();
     if (isset($_GET["sort"])) {
         $callBackParam["sort"] = $_GET["sort"];
     }
     if (isset($_GET["direction"])) {
         $callBackParam["direction"] = $_GET["direction"];
     }
     $discussions = array();
     $navigatorHtml = "";
     $discussed_products = discGetAllDiscussedProducts();
     $smarty->assign("products", $discussed_products);
     if (isset($_GET["productID"])) {
         $callBackParam["productID"] = $_GET["productID"];
Exemple #2
0
    $dis_subject = "";
    $dis_text = "";
}
$smarty->hassign("dis_nic", $dis_nic);
$smarty->hassign("dis_subject", $dis_subject);
$smarty->hassign("dis_text", $dis_text);
if (isset($_GET["remove_topic"]) && isset($productID) && isset($_SESSION["log"])) {
    if (isset($_SESSION["log"]) && in_array(100, $relaccess)) {
        if (!prdProductExists($productID)) {
            //product not found
            header("HTTP/1.0 404 Not Found");
            header("HTTP/1.1 404 Not Found");
            header("Status: 404 Not Found");
            die(ERROR_404_HTML);
        }
        discDeleteDiscusion($_GET["remove_topic"]);
        Redirect("index.php?productID={$productID}&discuss=yes");
    }
}
if (isset($productID) && $productID > 0 && (isset($_GET["discuss"]) || isset($_POST["discuss"]))) {
    if (!prdProductExists($productID)) {
        //product not found
        header("HTTP/1.0 404 Not Found");
        header("HTTP/1.1 404 Not Found");
        header("Status: 404 Not Found");
        die(ERROR_404_HTML);
    }
    $smarty->assign("discuss", "yes");
    $smarty->assign("main_content_template", "product_discussion.tpl");
    $q = db_query("select name from " . PRODUCTS_TABLE . " where productID=" . $productID . " and enabled=1");
    $a = db_fetch_row($q);