Example #1
0
 }
 // UPDATE POST IN DB:
 if (!$edited_Item->dbupdate()) {
     // Could not update successful
     $Messages->add(T_('The post couldn\'t be updated.'), 'error');
     break;
 }
 // post post-publishing operations:
 param('trackback_url', 'string');
 if (!empty($trackback_url)) {
     if ($edited_Item->status != 'published') {
         $Messages->add(T_('Post not publicly published: skipping trackback...'), 'note');
     } else {
         // trackback now:
         load_funcs('comments/_trackback.funcs.php');
         trackbacks($trackback_url, $edited_Item);
     }
 }
 // Execute or schedule notifications & pings:
 $edited_Item->handle_post_processing(false, $exit_after_save);
 $Messages->add(T_('Post has been updated.'), 'success');
 if (!$exit_after_save) {
     // We want to continue editing...
     break;
 }
 /* fp> I noticed that after publishing a new post, I always want
  *     to see how the blog looks like. If anyone doesn't want that,
  *     we can make this optional...
  */
 $edited_Item->load_Blog();
 if ($edited_Item->status == 'redirected') {
Example #2
0
         // There have been some validation errors:
         // Params we need for tab switching:
         $tab_switch_params = 'p=' . $post_ID;
         break;
     }
     // UPDATE POST IN DB:
     $edited_Item->dbupdate();
     // post post-publishing operations:
     param('trackback_url', 'string');
     if (!empty($trackback_url)) {
         if ($edited_Item->status != 'published') {
             $Messages->add(T_('Post not publicly published: skipping trackback...'), 'info');
         } else {
             // trackback now:
             load_funcs('comments/_trackback.funcs.php');
             trackbacks($trackback_url, $edited_Item->content, $edited_Item->title, $edited_Item->ID);
         }
     }
     // Execute or schedule notifications & pings:
     $edited_Item->handle_post_processing();
     $Messages->add(T_('Post has been updated.'), 'success');
     // REDIRECT / EXIT
     header_redirect($redirect_to);
     // Switch to list mode:
     // $action = 'list';
     // init_list_mode();
     break;
 case 'publish':
     // Publish NOW:
     $post_status = 'published';
     // Check permissions: