WordPress.org

Ready to get started?Download WordPress

Forums

Request: Preview this post (7 posts)

  1. southerngal
    Member
    Posted 10 years ago #

    One thing I really miss about b2 is the preview feature. Any way to include this in the next release?

  2. OperaManiac
    Member
    Posted 10 years ago #

    Preview for the post and preview for the comment.
    Sushubh says yey to the wish!

  3. Nick Momrik
    Member
    Posted 10 years ago #

    Me too...I was just thinking about that last night. That would be an awesome feature!

  4. Dougal Campbell
    Member
    Posted 10 years ago #

    In the meantime, one trick you can use is to save your post with a date in the future (under Advanced Editing). Then it will show up in the edit screen along with your other posts, so that you can get a rough idea of how the formatting looks. Then when you're satisfied that the post is done, just uncheck the "Edit Timestamp" box and post.

  5. davidchait
    Member
    Posted 10 years ago #

    If people want it, I hacked my code up such that logged-in users can see their own Draft posts visible in the main post list (well, I also went and made Private posts visible to all logged-in users > level 5, since the only people at that level will be myself and other people I deem site administrators... ;) ).
    Let me know and I can extract and jot some notes here. They both rely on querying user information (which wasn't available without a bit of work) and then doing different compares in the posts-query to 'get extra posts' into the results.
    =d

  6. Nick Momrik
    Member
    Posted 10 years ago #

    David,
    That would be great!

  7. davidchait
    Member
    Posted 10 years ago #

    (Two Caveats: 1. I'm trying to drag this info out of my brain, so I may miss a step. 2. This is on 1.0-alpha, might not match 100%...)
    First, the Private posts thing is basically 'there already', it just seems to be missing an 'activator'... ;) To activate the private-posts stuff, I added the following at the end of my wp-config.php:

    if ($pagenow != 'wp-login.php')
    get_currentuserinfo(); // cache away.

    I actually have a little more than that -- I also check if I'm on my test server, and if so I hard-code my userdata (as my test server isn't setup properly for my to login to it...). But that's just further enhancement. ;) This basically sets up the $user_ID var, as well as some others, for use later in the code.
    The code that references it already is in wp-blog-header.php, look/search for "Get private posts" or "isset($user_ID)".
    Second, the by-level thing, and Drafts viewing, all in. Requires the above modification. Then, right where it does the if (isset($user_ID), I changed the following line to read:
    $where .= " OR post_author = $user_ID OR 5 < $user_level)";
    Now, what does that change above do, and why'd I remove the !=draft test?
    - checks if you ($user_ID) are the author, and if so show the post
    - checks if your level ($user_level) is greater than 5 (arbitrary -- pick your cutoff), and if so show the post.
    Basically, means you'll always see your own Draft and Private posts, and if you are above level 5 you'll see everyone else's as well. If you want to restrict private posts to just the author, try this instead (untested!!):
    $where .= " OR post_author = $user_ID OR (5 < $user_level AND post_status!='private')";
    I haven't yet seen a good definition for Draft vs Private, so the user_level 'unlocking' would want to check post_status!= whichever kind you want to be only-author-visible versus anyone-logged-in-level>5-visible.
    Did that make sense? I'm freaking tired, just realized it's 2am -- been working on my site too late ... but it's coming together. Just moved the comments link into my inset meta info area, which compacts the height of the posts another line and a half, so you see more posts.
    =d
    http://www.chait.net

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.