Example #1
0
 function editPost()
 {
     $id = intval($_GET["contentID"]);
     if (!$id) {
         return false;
     }
     $doRedirect = false;
     $fill = $_POST;
     if (isset($_POST["slug"]) && $_POST["slug"]) {
         $fill["slug"] = core::generateSlug($_POST["slug"]);
     }
     if (isset($_POST["uploadPicture"])) {
         $uploadedPics = blog::uploadOnePicture($fill["slug"]);
     }
     $fill["poster"] = "";
     if (isset($_FILES["poster"]) && $_FILES["poster"]["error"] == 0) {
         $uploadedPics = blog::uploadOnePicture($fill["slug"], "articleImages");
         if (isset($uploadedPics["poster"]) && $uploadedPics["poster"]) {
             $fill["poster"] = serialize($uploadedPics["poster"]);
         }
     }
     if (isset($_POST["savePost"])) {
         if (blog::updatePost($id, $fill)) {
             $doRedirect = true;
         }
     }
     article::getAllCats($id);
     system::setParam("page", "editPost");
     $sqlData = blog::buildForm("content", array("AND `contentID`={$id}"));
     blog::showAttachedPics($sqlData);
     if ($doRedirect) {
         system::redirect(system::param("urlBase") . "listPage");
     }
 }
Example #2
0
 function editItem()
 {
     $id = intval($_GET["id"]);
     $doRedirect = false;
     if (isset($_POST["savePost"])) {
         blog::updatePost($id, $_POST);
         $doRedirect = true;
     }
     if (isset($_POST["uploadPicture"])) {
         $uploadedPics = blog::uploadOnePicture($_POST["slug"]);
     }
     system::setParam("page", "editPortfolioItem");
     $sqlData = blog::buildForm("portfolio", "AND `id`={$id}");
     blog::showAttachedPics($sqlData, "portfolioPics");
     if ($doRedirect) {
         system::redirect(system::param("urlBase") . "items");
     }
 }
Example #3
0
 function edit()
 {
     $id = intval($_GET["entryID"]);
     $doRedirect = false;
     system::setParam("page", "addPage");
     if (!$id) {
         return system::redirect("/adm/listPage");
     }
     if (isset($_POST) && $_POST) {
         $url = $_POST["URL"];
         if ($this->db->query("UPDATE `redirect` SET `URL`='?' WHERE `entryID`=?", $url, $id)) {
             $doRedirect = true;
         }
     }
     $sqlData = blog::buildForm("redirect", array("AND `entryID`={$id}"));
     if ($doRedirect) {
         system::redirect("/adm/redirect/listPage");
     }
 }
Example #4
0
 function edit()
 {
     if (empty($_GET["userID"])) {
         return false;
     }
     $doRedirect = false;
     system::setParam("page", "userEdit");
     if (isset($_POST["savePost"])) {
         $data = $_POST;
         unset($data["savePost"]);
         if (!empty($data["password"])) {
             $data["password"] = md5(md5($data["password"]));
         } else {
             unset($data["password"]);
         }
         $this->db->updateTable("users", $data, "userID", $_GET["userID"]);
         $doRedirect = true;
     }
     blog::buildForm("users", "AND `userID`=" . intval($this->args[0]));
     if ($doRedirect) {
         system::redirect(system::param("urlBase") . "users");
     }
 }
Example #5
0
File: blog.php Project: ygres/sblog
 function editCategory()
 {
     system::setParam("page", "editCategory");
     $id = intval($_GET["categoryID"]);
     if (!empty($_POST)) {
         unset($_POST["savePost"]);
         blog::updateCategory($id, $_POST);
     }
     blog::buildForm("categories", "categoryID`={$id}");
 }