Exemplo n.º 1
0
            if (empty($exp_date)) {
                $exptime = 0;
            } else {
                unset($m);
                preg_match("/^([0-9]{1,2})\\.([0-9]{1,2})\\.([0-9]{4})\$/", $exp_date, $m);
                $exptime = mktime(23, 59, 59, $m[2], $m[1], $m[3]);
            }
            if ($exptime != 0 and $exptime <= $publtime) {
                $exptime = $publtime;
            }
            list($pid_old) = $db->sql_fetchrow($db->sql_query("SELECT `pid` FROM `" . NV_BANNERS_ROWS_GLOBALTABLE . "` WHERE `id`=" . intval($id) . ""));
            $sql = "UPDATE `" . NV_BANNERS_ROWS_GLOBALTABLE . "` SET `title`=" . $db->dbescape($title) . ", `pid`=" . $pid . ", `clid`=" . $clid . ", \n            `file_name`=" . $db->dbescape($file_name) . ", `file_ext`=" . $db->dbescape($file_ext) . ", `file_mime`=" . $db->dbescape($file_mime) . ", \n            `width`=" . $width . ", `height`=" . $height . ", `file_alt`=" . $db->dbescape($file_alt) . ", `click_url`=" . $db->dbescape($click_url) . ", \n            `publ_time`=" . $publtime . ", `exp_time`=" . $exptime . " WHERE `id`=" . $id;
            $db->sql_query($sql);
            if ($pid_old != $pid) {
                nv_fix_banner_weight($pid);
                nv_fix_banner_weight($pid_old);
            }
            nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_banner', "bannerid " . $id, $admin_info['userid']);
            nv_CreateXML_bannerPlan();
            Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=info_banner&id=" . $id);
            die;
        }
    }
} else {
    $title = $row['title'];
    $pid = $row['pid'];
    $clid = $row['clid'];
    $file_alt = $row['file_alt'];
    $click_url = $row['click_url'];
    $publ_date = !empty($row['publ_time']) ? date("d.m.Y", $row['publ_time']) : "";
    $exp_date = !empty($row['exp_time']) ? date("d.m.Y", $row['exp_time']) : "";
Exemplo n.º 2
0
        $error = $lang_module['title_empty'];
    } elseif ($width < 50 or $height < 50) {
        $error = $lang_module['size_incorrect'];
    } else {
        if (!empty($description)) {
            $description = defined('NV_EDITOR') ? nv_nl2br($description, '') : nv_nl2br(nv_htmlspecialchars($description), '<br />');
        }
        list($blang_old, $form_old) = $db->query('SELECT blang, form FROM ' . NV_BANNERS_GLOBALTABLE . '_plans WHERE id=' . intval($id))->fetch(3);
        $stmt = $db->prepare('UPDATE ' . NV_BANNERS_GLOBALTABLE . '_plans SET blang= :blang, title= :title, description= :description, form= :form, width=' . $width . ', height=' . $height . ' WHERE id=' . $id);
        $stmt->bindParam(':blang', $blang, PDO::PARAM_STR);
        $stmt->bindParam(':title', $title, PDO::PARAM_STR);
        $stmt->bindParam(':description', $description, PDO::PARAM_STR);
        $stmt->bindParam(':form', $form, PDO::PARAM_STR);
        $stmt->execute();
        if ($form_old != $form or $blang_old != $blang) {
            nv_fix_banner_weight($id);
        }
        nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_plan', 'planid ' . $id, $admin_info['userid']);
        nv_CreateXML_bannerPlan();
        Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=info_plan&id=' . $id);
        die;
    }
} else {
    $blang = $row['blang'];
    $title = $row['title'];
    $description = nv_br2nl($row['description']);
    $form = $row['form'];
    $width = $row['width'];
    $height = $row['height'];
}
if (!empty($description)) {