예제 #1
0
         if ($url !== $oldslug) {
             $oldid = $oldslug;
         }
         // if slug was changed set $oldid
         $upddraft = $draft;
         include 'template/error_checking.php';
         // send new inputs for slug changes and new nonces
         echo '<input id="nonce" name="nonce" type="hidden" value="' . get_nonce("edit", "edit.php") . '" />';
         echo '<input id="existing-url" name="existing-url" type="hidden" value="' . $url . '" />';
         echo '<input id="post-id" name="post-id" type="hidden" value="' . $url . '" />';
         echo "</div>";
         die;
     }
 }
 // if ajax we are done
 changedataAjaxSave($url, $oldslug);
 // redirect user back to edit page or redirectto
 if (isset($_POST['redirectto']) && $_POST['redirectto'] != '') {
     $redirect_url = $_POST['redirectto'];
 } else {
     $redirect_url = 'edit.php';
 }
 if ($pageIsNew) {
     $redirect_url .= "?id=" . $url . "&upd=edit-success&type=new";
 }
 // new page
 if ($slugHasChanged) {
     $redirect_url .= "?id=" . $url . "&old=" . $oldslug . "&upd=edit-success&type=edit";
 } else {
     $redirect_url .= "?id=" . $url . "&upd=edit-success&type=edit";
 }
예제 #2
0
         $upddraft = $draft;
         include 'template/error_checking.php';
         // send new inputs for slug changes and new nonces
         echo '<input id="nonce" name="nonce" type="hidden" value="' . get_nonce("edit", "edit.php") . '" />';
         if (!$status) {
             die("</div>");
         }
         // do not update slugs etc on failures
         echo '<input id="existing-url" name="existing-url" type="hidden" value="' . $url . '" />';
         echo '<input id="post-id" name="post-id" type="hidden" value="' . $url . '" />';
         echo "</div>";
         die;
     }
 }
 // if ajax we are done
 changedataAjaxSave($url, $oldslug, $status);
 if (!$status) {
     redirect("edit.php?id=" . $url . "&upd=edit-error&type=edit");
 }
 // redirect user back to edit page or redirectto
 if (isset($_POST['redirectto']) && $_POST['redirectto'] != '') {
     $redirect_url = $_POST['redirectto'];
 } else {
     $redirect_url = 'edit.php';
 }
 if ($pageIsNew) {
     $redirect_url .= "?id=" . $url . "&upd=edit-success&type=new";
 }
 // new page
 if ($slugHasChanged) {
     $redirect_url .= "?id=" . $url . "&old=" . $oldslug . "&upd=edit-success&type=edit";