Skip past navigation, straight to the content

Post Levels 1.1.1

Post Levels 1.1.1 is a bugfix release that will (hopefully) get rid of some of the problems people have been seeing with the 1.1 release.

Download

Post Levels 1.1.1

New Features

  • Use the post teaser as the preview: You can now show the post teaser as the preview for non-logged in users. (requested by Gas)
  • Bug fixes: This release should fix the issues with Ultimate Tag Warrior 3.1415926 (duplicate posts and SQL errors). If you find more, please let me know.

Note: Several people have mentioned that Post Levels is causing their posts to appear in reverse order. I’m unable to duplicate this, so please let me know if it’s still happening in this version.

110 Comments

  1. So far, so good. At first glance all my problems have been resolved. Thank you!

    Posted Feb 17, 2007 at 9:09am | Permalink
  2. Charlie

    Seems to be working fine for me. The posts are appearing in the correct order again. Thanks a bunch.

    Posted Feb 17, 2007 at 9:32am | Permalink
  3. Thanks for this plugin! Everything’s working well, except there’s one entry in my archives that’s showing up 3 times on the list. I’m using SRG Clean Archives.

    Posted Feb 18, 2007 at 3:47am | Permalink
  4. Rai: It looks like SRG Clean Archives uses a slightly different SQL query for the archives. If you want to fix this, you can edit the archives plugin as follows.

    1. Open srg_clean_archives.php
    2. On line 32, you’ll find:
      $arcresults2 = $wpdb->get_results("SELECT ID, post_date, post_title, comment_status ...
    3. Add DISTINCT before the word ID on that line, it should now look like: $arcresults2 = $wpdb->get_results("SELECT DISTINCT ID, post_date, post_title, comment_status ...

    That should fix your problem.

    Posted Feb 18, 2007 at 9:36am | Permalink
  5. Weirdly enough, I find that on my test blog, it’s working perfectly EXCEPT for the using a excerpt as a teaser function. I have that option selected, but it’s not showing up when I log out and visit the page.

    (http://test.gordsellar.com)

    Posted Feb 20, 2007 at 12:18am | Permalink
  6. Gordsellar: If you want to use the excerpt as the post teaser, you must make sure to manually enter an excerpt when authoring the post. If you leave that field blank, the default “You have to be logged in” text is shown.

    Posted Feb 20, 2007 at 8:31am | Permalink
  7. I’ve found a minor issue with this version. Users at a WordPress level of Administrator are able to see all posts, even if those posts belong to another user (even another Administrator user) and those posts have a higher Post Level than their user Post Level.

    Example: Administrator #1 has a Post Levels user level of 5. Administrator #2 writes a post assigned Post Level 10. Administrator #1 can see that post.

    Is this a bug, or is this by design?

    I’m using WordPress 2.1.1 and Post Levels 1.1.1. This behavior did not occur with WP 2.0.x/PL 1.0.

    Posted Feb 22, 2007 at 12:22pm | Permalink
  8. Joefish: By design, although open to debate.

    I’ve never tested it, but can the admin see all private posts in the admin area of WP? I don’t touch the SQL in the admin area (too risky).

    Posted Feb 22, 2007 at 12:28pm | Permalink
  9. They are visible under Manage -> Posts (wp-admin/edit.php).

    The post total under Users -> Authors and Users (wp-admin/users.php) reveals only public posts. That is, if there are six posts, but only one of them is public the Actions column will list “View 1 post.” However, if you click that link you’re back to Manage -> Posts (ex. wp-admin/edit.php?author=4) where all posts are again visible.

    Posted Feb 22, 2007 at 1:29pm | Permalink
  10. Joefish: Yeah, that’s what I thought. I’d say it’s by design — hiding those posts would require editing the admin SQL queries, which can be risky in my opinion (I would hate to lock somebody out of the admin area through an error).

    Posted Feb 22, 2007 at 5:36pm | Permalink
  11. After further investigation, I’ve found that it’s not Post Levels that’s changed, but rather WordPress. In 2.0.x, a private post would be visible only to the post author (without any plugins, I mean). In 2.1, private posts are always visible to all Editors and Administrators.

    Posted Feb 23, 2007 at 6:08am | Permalink
  12. reallybites

    How do one make use of the “teaser” feature? And for the title plus excerpt, does it mean that anything I typed on the “excerpt field” at the “create new post page” will be visible to all readers?

    Posted Feb 27, 2007 at 4:30am | Permalink
  13. reallybites

    And on the post level configuration page, I’m seeing this :

    Private Post Title Prefix:

    Private Post Title Prefix:

    Default Post Level

    and so on.

    Why is there a duplicate of the private post title prefix?

    Thanks!

    Posted Feb 27, 2007 at 4:33am | Permalink
  14. reallybites

    Oh nevermind, I missed out the prepended and appended. Sorry for the multiple comments.

    Posted Feb 27, 2007 at 4:33am | Permalink
  15. reallybites: I can’t tell if you figured out your issues. Regardless, the “Title plus excerpt” preview will show the excerpt you type into the “Post Excerpt” box on the “Write Post” page to non-logged in users.

    Posted Feb 27, 2007 at 11:05am | Permalink
  16. reallybites

    Thanks! How about the “teaser” feature? How does it work?

    Posted Feb 27, 2007 at 5:52pm | Permalink
  17. reallybites: The teaser function will only show the content you place before the <!--more--> in the post. You can find a description on the WordPress Write Post documentation page.

    Posted Feb 27, 2007 at 6:14pm | Permalink
  18. Can we have an example of how to use the teaser? I’m a little confused. I’ve tried the exerts and bit, but it doesn’t work. Does one have to turn it on, or something?

    Also, is there a way to indicate if the post is private in the blog, so users who login automatically know what are private posts and what are not?

    Posted Mar 2, 2007 at 2:02pm | Permalink
  19. Sophia: If you go to the Plugin page, you’ll see a menu option to control the Post levels configuration. In there, you can set the Private Post Preview option in order to use the teaser. You can also add text to the title of a private post, using the post title prefix and suffix.

    Posted Mar 2, 2007 at 2:07pm | Permalink
  20. joiz

    Works ok for me, the list of pages no longer appear three times. Kudos!

    One question though… Is there a hack available that allows me to display the recent comments on the sidebar depending on the post level of the reader?

    Posted Mar 2, 2007 at 5:08pm | Permalink
  21. @fil: *cough* Whoops.

    I love you. =-) Marry me?

    Thanks!

    Posted Mar 2, 2007 at 7:04pm | Permalink
  22. Should have tested before posting.

    People can only view the posts if they are logged in. The teaser or any other option does not appear, even when it’s turned on.

    And is there any way to make the pre-fix or post-fix an image, instead of text?

    Posted Mar 2, 2007 at 7:31pm | Permalink
  23. See, this is my goal. One day I hope to make plugins so cool they elicit marriage proposals.

    Posted Mar 3, 2007 at 7:50am | Permalink
  24. Joiz: I don’t know of one offhand, but if you can wait a bit, I was planning on making a widget that supports post levels (it would require you to use the Widgets plugin though).

    Sophia: When you turn on the teaser, do non-logged in users see the title of the private post? Or just nothing at all? If they see the title, then make sure you’ve written a teaser / excerpt (you have to do this manually). If they don’t see the title (i.e. nothing is displayed of that post at all), then I don’t really know what’s wrong (perhaps you have caching turned on?).

    You can put in HTML into your prefix / postfix for private posts — so use something like <img src="private.gif" /> (where private.gif is the name of the image).

    Posted Mar 3, 2007 at 11:47am | Permalink
  25. @fil: For the record, one should change the double quotes to single quotes if they’re going to add HTML to their prefix or postfix. Otherwise you end up with some funky things in the title.

    And yes… WTF is up with this lack of teasing? *sigh* If you’re interested, take a jog over to my website and take a look.

    Posted Mar 3, 2007 at 1:28pm | Permalink
  26. Sophia: Yes, depending on the theme, you can run into issues with HTML inside the pre/post fix. Your other option is to modify your theme to use the is_private() function to conditionally output during your post loop.

    As for the lack of teasing. I think I realized why it’s not working for you — I only show the teaser for items that are at or below the default post level (which is 0 by default). Change the default post level to something higher (or post the posts you want teased at level 0) and you should see the teasers. I didn’t really document that feature very well. Or at all.

    Posted Mar 3, 2007 at 1:48pm | Permalink
  27. Apparently the default user level has to be higher as well. Is there any way we could have that changed?

    Posted Mar 4, 2007 at 7:03am | Permalink
  28. Sophia: I’ll add a new option in the next version that will let you control that. If you want to change it yourself, you can edit the file on line 113, and change

    $postlevels_current_user_level = get_option('postlevels_default_user_level');

    to

    $postlevels_current_user_level = '3'

    Or however high you want posts to show …

    Posted Mar 4, 2007 at 12:22pm | Permalink
  29. neoen

    Hello, this is great plugin, but when using with Gengo (multilanguage plugin), there is SQL error:
    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘p ON p2l.post_id = p.ID INNER JOIN wp_categories AS c ON p2c.category_id = c.cat’ at line 1]
    SELECT c.*, COUNT(*) as category_count FROM wp_post2lang p2l INNER JOIN wp_post2cat p2c ON p2c.post_id = p2l.post_id INNER JOIN (wp_posts LEFT JOIN wp_postmeta as pl_wp_postmeta ON (wp_posts.ID = pl_wp_postmeta.post_id)) p ON p2l.post_id = p.ID INNER JOIN wp_categories AS c ON p2c.category_id = c.cat_ID WHERE p2l.language_id IN (1) AND p2c.category_id IN (1,3) AND p.post_type = ‘post’ AND p. (wp_posts.post_status = ‘publish’ OR (wp_posts.post_status = ‘private’ AND (pl_wp_postmeta.meta_key = ‘post_level’ AND pl_wp_postmeta.meta_value

    Posted Mar 5, 2007 at 6:03am | Permalink
  30. Neoen: Change line 254 of the plugin from:

    if (function_exists('af_ela_super_archive'))

    to

    if (true)

    That should fix the issue.

    Posted Mar 5, 2007 at 10:13am | Permalink
  31. I LOVE the PostLevels plugin but I can’t get the option to work that lets non-registered users see the title of the post they can’t read. When I first installed it, I saw the options on the PostLevelConfigurations menu; sadly, the option listed there now is “none for posts to be completely hidden from people who aren’t logged on”

    I am using the latest version of WP and Post Level 1.1.1

    Thanks!

    Posted Mar 9, 2007 at 10:55pm | Permalink
  32. Ebenezer — The posts shown in the preview are only those below the default user level — so you need to set the post preview option as well as the default user level.

    Posted Mar 10, 2007 at 3:45pm | Permalink
  33. I’m one of the old complainers about the RSS issue. I was looking into a possible solution when I upgraded my friend to the latest Wordpress and went through all the plugins to check for updates. Naturally you’ve been hard at work lately. I’m not sure how you plan on re-implementing the feature but assuming there needs to be some sort of basic authentication I thought I’d point out the page that I planned on using with the old stuff. I got it to function correctly in a web browser, but upgrade before doing a full test…

    http://labs.spaceshipnofuture.org/icky/HTTP%20authentication%20with%20PHP-CGI/

    Posted Mar 13, 2007 at 4:16pm | Permalink
  34. Fil,

    I am having a similar problem as Ebeneezer - I get the same message he does in the Post Levels Configuration box. I have the latest version of Word Press, and I installed the plug-in and activated it, and typed in a prefix comment, and set the configuration to Teaser. I then logged off the site and went to look at the blog to see if the plug-in worked.

    I couldn’t even bring up the webpage. I get a “internet could not display this webpage” message. If I deactivate the plugin, the page works fine. If I try to change user levels, or change the default post level or default user level I get the following message, and if I say yes - nothing changes:

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/d/r/d/drdetecto/html/wp-admin/admin-header.php:16) in /home/content/d/r/d/drdetecto/html/wp-includes/functions.php on line 1219

    Posted Mar 14, 2007 at 5:08pm | Permalink
  35. What exactly does this mean and how do i fix it?

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘posts, wp_post2cat post2cat WHERE posts.ID 21 AND posts. (wp_’ at line 2]

    SELECT DISTINCT posts.ID, posts.post_title, posts.post_date, posts.comment_count FROM (wp_posts LEFT JOIN wp_postmeta as pl_wp_postmeta ON (wp_posts.ID = pl_wp_postmeta.post_id)) posts, wp_post2cat post2cat WHERE posts.ID 21 AND posts. (wp_posts.post_status = ‘publish’ OR (wp_posts.post_status = ‘private’ AND (pl_wp_postmeta.meta_key = ‘post_level’ AND pl_wp_postmeta.meta_value 20060316195321 ORDER BY RAND() LIMIT 5

    * No related posts found.

    Posted Mar 16, 2007 at 6:23pm | Permalink
  36. PS. i believe it has something to do with my Category Tagging plugin

    Posted Mar 16, 2007 at 6:31pm | Permalink
  37. Andrew

    Hi Fil,

    I am making the switch of my site from WordPress 2.0.7 to 2.1.2, and with 2.0.7 I was using a modified version of Post Levels 1.0. I really can’t remember how I exactly I had the plugin modified, but there is a feature in it that I like. It was an instruction page function, that if some one who didn’t have enough access tried to access the page, it would just show them that page. Was that one of your original functions of the plugin, or something I had added?

    Posted Mar 22, 2007 at 11:47am | Permalink
  38. Dipsy

    [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘p ON p2c.post_id=p.id WHERE (p. (wp_posts.post_status = ‘publish’ at line 5]
    SELECT p2c.category_id AS cat_id, COUNT(p2c.rel_id) AS numposts, UNIX_TIMESTAMP(max(p.post_date_gmt)) + ‘3′ AS last_post_date, UNIX_TIMESTAMP(max(p.post_date_gmt)) AS last_post_date_gmt FROM wp_post2cat p2c INNER JOIN (wp_posts LEFT JOIN wp_postmeta as pl_wp_postmeta ON (wp_posts.ID = pl_wp_postmeta.post_id)) p ON p2c.post_id=p.id WHERE (p. (wp_posts.post_status = ‘publish’ OR (wp_posts.post_status = ‘private’ AND (pl_wp_postmeta.meta_key = ‘post_level’ AND pl_wp_postmeta.meta_value

    Posted Mar 24, 2007 at 11:53am | Permalink
  39. Dipsy

    [Unknown column ‘p.id’ in ‘on clause’]
    SELECT p2c.category_id AS cat_id, COUNT(p2c.rel_id) AS numposts, UNIX_TIMESTAMP(max(wp_posts.post_date_gmt)) + ‘3′ AS last_post_date, UNIX_TIMESTAMP(max(wp_posts.post_date_gmt)) AS last_post_date_gmt FROM wp_post2cat p2c INNER JOIN (wp_posts LEFT JOIN wp_postmeta as pl_wp_postmeta ON (wp_posts.ID = pl_wp_postmeta.post_id)) ON p2c.post_id=p.id WHERE ( (wp_posts.post_status = ‘publish’ OR (wp_posts.post_status = ‘private’ AND (pl_wp_postmeta.meta_key = ‘post_level’ AND pl_wp_postmeta.meta_value

    Posted Mar 24, 2007 at 12:31pm | Permalink
  40. Dipsy
    Posted Mar 24, 2007 at 12:32pm | Permalink
  41. wpress 2.1, Ultimate Tag Warrior 3.1415926, Post Levels 111

    did You mention mysql query bugfix? :)

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘p on p2t.post_id = p.ID WHERE post_date_gmt

    Posted Mar 25, 2007 at 4:12am | Permalink
  42. Rob

    Just some feedback about getting categories to list on WP 2.1.2 with Post Levels 1.1.1.
    I found didn’t work, but does work.
    So as you already document show_count needs to be 1, but it seems changing hierarchical to 0 also breaks the category listing.
    Otherwise we’ve found the plugin really great - thanks.

    Posted Apr 4, 2007 at 4:00am | Permalink
  43. Rob

    Sorry - my previous message got munged - hopefully this will work:

    Just some feedback about getting categories to list on WP 2.1.2 with Post Levels 1.1.1.
    I found wp_list_categories arguments ‘title_li=&show_count=1&hierarchical=0′ didn’t work, but ‘title_li=&show_count=1′ does work.
    So as you already document show_count needs to be 1, but it seems changing hierarchical to 0 also breaks the category listing.
    Otherwise we’ve found the plugin really great - thanks.

    Posted Apr 4, 2007 at 4:03am | Permalink
  44. This definitely fixed my problem with administrators not being able to see private posts even with a user level of 10. And also fixed the ordering of posts.

    You rock! Thank you for this plugin.

    Posted Apr 8, 2007 at 11:59am | Permalink
  45. Janus

    This is a bit strange. I’ve created 2 postings; one with postlevel 2 and another with postlevel 5. I’ve also created 2 users, one with userlvl 1 and another with lvl 8.

    The postings with postlevel 2 and 5 should be visible to userlvl 8 and userlvl 1 should not be seeing anything. But unfortunately userlvl 1 can see both postings (lvl 2 and 5)

    Both users are created as subscribers.

    Posted Apr 10, 2007 at 12:41pm | Permalink
  46. defiant

    I’m unable to change the post level after I’ve already published. For example, if I post a level 3 and edit it to be a level 4, the post automatically goes back to being a level 3. Any suggestions on how to fix that?

    Posted Apr 12, 2007 at 9:29am | Permalink
  47. Janus

    Ahh… I found the reason. Your plugin only works with WP 2.1.1, and I’ve upgraded to 2.1.3

    I just downgraded again :-|

    Posted Apr 12, 2007 at 1:40pm | Permalink
  48. @Janus - I’m using Post Levels 1.1.1 with WP 2.1.3 and I’m having no problems.

    Posted Apr 13, 2007 at 7:37am | Permalink
  49. Janus

    Joefish -> Weird… but it works perfectly after my downgrade. Well… I think I can live with wp2.1.1 :)

    Posted Apr 13, 2007 at 12:32pm | Permalink
  50. Seb

    Thanks for the plugin !

    However, I get exactly the same error as Janus mentioned 4 messages above (http://fortes.com/2007/02/16/post-levels-111/#comment-9320). I have installed a clean version of WP 2.1.3 with Kubrick default theme, and have tested the plugin exactly the same way as Janus did, and all posts were visible to logged-in users whatever their post level restriction. Only non logged-in users were restricted.

    I wonder what changed from WP 2.1.1 to 2.1.3. that blocks the plugin to work properly. Any ideas ? Thanks a lot !

    Posted Apr 20, 2007 at 11:37pm | Permalink
  51. Thank You

    Posted Apr 25, 2007 at 1:34am | Permalink
  52. Jin

    Thanks for this plugin, Fil.

    I just wanted to flag the same issue that Seb has with WP 2.1.3. Any user, once logged in, can see a private post, irrespective of its level.
    (http://fortes.com/2007/02/16/post-levels-111/#comment-9826)

    I’ll try to figure out a fix and post back here, but it’d probably be faster if you did it. :)

    Posted May 2, 2007 at 11:36am | Permalink
  53. I’m seeing the everybody-can-read 2.1.3 behavior. if you get a fix for this I’d love to know about it. thank goodness, though… I thought it was just me! :)

    Posted May 4, 2007 at 1:09pm | Permalink
  54. Hi, I’m getting this error as well with WP 2.1.3:

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ORDER BY post_date ASC LIMIT 1′ at line 1]
    SELECT ID, post_title FROM wp_posts WHERE post_date > ” AND post_type = ‘post’ AND post_status = ‘publish’ AND ID != ORDER BY post_date ASC LIMIT 1

    Posted May 5, 2007 at 5:52pm | Permalink
  55. Cristian

    When using Event Calendar plugin I get

    WordPress database error: [Column ‘post_id’ in where clause is ambiguous]
    SELECT DISTINCT id, post_title, GREATEST(start,’2007-05-01 00:00:00′) AS start_date, LEAST(end,’2007-06-01 00:00:00′) AS end_date, allday, 1 AS is_event FROM (wp_posts LEFT JOIN wp_postmeta as pl_wp_postmeta ON (wp_posts.ID = pl_wp_postmeta.post_id)),wp_ec3_schedule WHERE (wp_posts.post_status = ‘publish’ OR (wp_posts.post_status = ‘private’ AND (pl_wp_postmeta.meta_key = ‘post_level’ AND pl_wp_postmeta.meta_value =’2007-05-01 00:00:00′ AND start=’2007-05-08 00:00:00′ ORDER BY start LIMIT 3

    Thank you for any help and for this plugin.

    Posted May 7, 2007 at 10:38pm | Permalink
  56. Hi! Thanks a lot for your great plugin! However, when turned on, I’m getting a MYSQL error when combined with the extract terms plugin by Semiologic, more specifically, the related entries plugin. Here’s the error…

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘as posts LEFT JOIN wp_postmeta as postmeta ON postmeta.post_id = posts.’ at line 6]
    SELECT DISTINCT posts.*, MATCH ( posts.post_title, posts.post_content ) AGAINST ( ‘background vocals underground rock scene dregs belts have never heard awesomeness reminiscent medium pace drastic change japanese underground acoustic sound shigure fresh sound mood changes time changes miyamoto instrumentals 3 piece passionately rin’ ) AS mysql_score FROM (wp_posts LEFT JOIN wp_postmeta as pl_wp_postmeta ON (wp_posts.ID = pl_wp_postmeta.post_id)) as posts LEFT JOIN wp_postmeta as postmeta ON postmeta.post_id = posts.ID WHERE posts.post_date_gmt 55 AND ( posts.post_password = ” ) AND ( (wp_posts.post_status = ‘publish’ OR (wp_posts.post_status = ‘private’ AND (pl_wp_postmeta.meta_key = ‘post_level’ AND pl_wp_postmeta.meta_value

    Posted May 9, 2007 at 1:15am | Permalink
  57. On activation, plugin completely destroys my theme layout and goodness knows what else…

    Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\vhosts\st-andrews-fund.org.uk\httpdocs\wp-content\plugins\post-levels.php:688) in C:\Inetpub\vhosts\st-andrews-fund.org.uk\httpdocs\wp-includes\pluggable.php on line 271

    Posted May 19, 2007 at 10:19am | Permalink
  58. OK. I am using 2.1.3 and I had hoped to use it in 2.2… I now understand it does not work in these versions. Are you going to update the plug-in?

    Posted May 19, 2007 at 10:22am | Permalink
  59. Jin

    Mea culpa. After spending a weekend analysing the code and SQL, on WP 2.1.3 Postlevels works just fine for me.

    I didn’t realise that WP displays private posts irrespective of the level if the post was authored by the user who is currently logged in. Once this is taken into account during testing, the behaviour seems correct.

    Everything seems to be working well now.

    Posted May 20, 2007 at 2:04am | Permalink
  60. I have now tried Post Levels 1.1.1 on my Wordpress 2.2 blog and it may well work but I do not know because it throws so many errors and completely destroys my theme in the process!

    A great shame because the plugin sounds just what I need!

    Posted May 20, 2007 at 6:24am | Permalink
  61. Lyanna

    Hey there, first of all, thanks muchly for this plugin, I’ve been using it for ages now.
    I did upgrade to 2.1.3 recently however and I am experiencing the same problems that Jin and Seb mentioned. Users that are not logged in do not see the private posts. Users that are logged in can see every post, whether their userlevel is lower than the post or not. None of the posts are authored by them btw.

    Posted May 20, 2007 at 3:16pm | Permalink
  62. I really really like this plugin. It is a great solution for personal bloggers. I’m wondering: Is there a simple way to reduce the number of privacy levels from 10 to 3? And if so, would there be a friendly way of being able to rename to things like “Family” “Friends” “Public”, etc.?

    Posted Jun 11, 2007 at 10:51pm | Permalink
  63. Marcos

    Delightful plugin. Some sort of widget or hook for a widget that only displays based on the user level would be great. Even if it was just like the “text” widget, but with user level control… or even some php code we could paste in a text widget to restrict access to that widget. Anything along those lines would be excellent. Thanks!

    Posted Jun 13, 2007 at 11:56am | Permalink
  64. hi all.

    Posted Jun 14, 2007 at 12:44pm | Permalink
  65. Kale

    Any progress on getting this to work for Wordpress 2.2?

    Posted Jun 27, 2007 at 1:12am | Permalink
  66. Naz

    Hello. I think this plug-in is what I need, and I thought I set it up correctly; but it’s not working out as expected. Here’s what I want to do:

    I have a private level 3 post.
    I want non-logged-in users to see the title + excerpt.
    I want logged-in level 0 to level 2 users to see the title + excerpt.
    I want logged-in level 3 and above users to see the full post (but know it was private via the prefix/postfix title text).

    However, what I get is is that non-logged-in users and logged-in users below level 3 don’t see anything about the post. So I think I’m configuring something incorrectly. This is on a fresh WP 2.1.1 install and is the only plug-in activated. Please help me configure this if possible. Thanks!

    Posted Jun 29, 2007 at 8:26am | Permalink
  67. Do you have any ideas on when the http_auth querystring capability will be available again? This functionality would make my company’s blog a lot more convenient for our employees - I’d even be willing to help if you would provide me some points. Thanks so much for this great plugin!

    Posted Jun 30, 2007 at 5:28pm | Permalink
  68. I can’t get this plug in working on WP 2.2. It does not matter what levels I set to the post or to my user, the post always shows. If I understand it correctly it might not be working for WP 2.2?

    Posted Jul 16, 2007 at 2:09am | Permalink
  69. Is there anyway to rename, or add descriptive text to, the level numbers in the select box on the new-post page? It would be nice to have the same descriptions as are used for users in the user management interface.

    Great plugin by the way, thank you very much for writing it!

    Posted Jul 29, 2007 at 9:36pm | Permalink
  70. Hi, I have the same as Cristian already mentioned, with ventcalendar plugin there is the following problem:

    WordPress database error: [Column ‘post_id’ in where clause is ambiguous]
    SELECT DISTINCT id, post_title, GREATEST(start,’2007-05-01 00:00:00′) AS start_date, LEAST(end,’2007-06-01 00:00:00′) AS end_date, allday, 1 AS is_event FROM (wp_posts LEFT JOIN wp_postmeta as pl_wp_postmeta ON (wp_posts.ID = pl_wp_postmeta.post_id)),wp_ec3_schedule WHERE (wp_posts.post_status = ‘publish’ OR (wp_posts.post_status = ‘private’ AND (pl_wp_postmeta.meta_key = ‘post_level’ AND pl_wp_postmeta.meta_value =’2007-05-01 00:00:00′ AND start=’2007-05-08 00:00:00′ ORDER BY start LIMIT 3

    What can I do to fix this?

    TIA peter “un loco”

    Posted Aug 2, 2007 at 12:27pm | Permalink
  71. hi, I fixed the problem with EVENTCALENDAR PLUGIN.

    could not sent the code via your message form. please give me your email-adress.

    mine is: tanguero at un-loco dot de

    best regards
    peter stiens from germany

    Posted Aug 3, 2007 at 2:41pm | Permalink
  72. On line 567 there is an extra ‘) between the php tag and the end of the option tag that causes an error metioned in some of these comments. In the admin section it causes the option for Title, Title/Excerpt, Teaser, None to become “None for posts to be completely…” Removing that ‘) fixed the problem. I was using v. 1.1.1. The bug showed up in IE7, but the code itself is invalid on that line.

    Great plugin! It works great!

    Posted Aug 16, 2007 at 12:42pm | Permalink
  73. I have installed Post Levels 1.1.1 on WordPress 2.2.2, and it’s working well except for comment feeds. (Private posts were also showing in post feeds, although I think that’s probably a WordPress bug.)

    In my comment feeds, the last comment is duplicated for however many comments are in the feed. This does not happen if I disable the Post Levels plugin.

    I checked over the plugins I have enabled, and I think the only one that might be related to comment feeds is Akismet, but the problem still occurs if I disable Akismet. (I also tried deactivating Get Recent Comments and Smart Comment Link, but that made no difference either.)

    Is anyone else experiencing a similar problem?

    Posted Sep 3, 2007 at 1:10pm | Permalink
  74. cmarshall

    I am using WP 2.3B2 (I am preparing a site for release in a couple of months, so I’m ensuring I work with WP 2.3).

    I get the same MySQL error everyone else is getting:

    WordPress database error: [Column ‘post_id’ in where clause is ambiguous]
    SELECT DISTINCT id, post_title, GREATEST(start,’2007-09-01 00:00:00′) AS start_date, LEAST(end,’2007-10-01 00:00:00′) AS end_date, allday, 1 AS is_event FROM (wp_posts LEFT JOIN wp_postmeta as pl_wp_postmeta ON (wp_posts.ID = pl_wp_postmeta.post_id)),wp_ec3_schedule WHERE (wp_posts.post_status = ‘publish’ OR (wp_posts.post_status = ‘private’ AND (pl_wp_postmeta.meta_key = ‘post_level’ AND pl_wp_postmeta.meta_value =’2007-09-01 00:00:00′ AND start

    Posted Sep 8, 2007 at 7:50am | Permalink
  75. cmarshall

    Holy cow. I have no idea what it did, but it completely blew up my DB.

    First of all, it wouldn’t let me deactivate it. I had to physically remove the plugin, and the errors keep coming. Good thing I was working on a sandbox.

    I have two plugins that may be contributors: wp-cache and eventcalendar 3.

    Posted Sep 8, 2007 at 7:55am | Permalink
  76. cmarshall

    Just FYI. It ws a cached page in wp-cache. I flushed the toilet, and the errors stopped. That doesn’t change the fact that the plugin would not let me deactivate it, though.

    Posted Sep 8, 2007 at 7:58am | Permalink
  77. Katy

    I’m using WP 2.2.1 and the teasers aren’t showing up for unregistered users!

    Posted Sep 13, 2007 at 3:31pm | Permalink
  78. I have the plugin actiavted and when I click on a post that is private while not logged in I get a 404 error. Any fix for this?

    Thanks

    Kevin

    Posted Sep 14, 2007 at 10:04pm | Permalink
  79. cmarshall

    Okay, it’s a problem with EventCalendar 3, and it’s a big problem. When you do your SQL parsing, you create LEFT JOINs within LEFT JOINs, and MySQL just goes kablooey.

    I think that a substantial part of the blame may lie in the EventCalendar 3 plugin, but it would probably be a good idea for you to see if there’s something that you could do in your code to fix it. Basically, EC3 is doing the same thing that you are, and you guys are colliding. If this happens with EC3, it will probably happen with other plugins as well.

    I’ll let the EC3 person know about this as well, so they can address their own issues.

    Posted Sep 17, 2007 at 5:13pm | Permalink
  80. The SQL query needs the tables adding.

    Here’s a quick and dirty hack that made this work for me on WP2.3. I put my changes into postlevels_query_cleanup - mainly so I could track it and rip it out later. (Nice code btw - this ‘cover the exceptions’ function really comes in useful)

    post-levels.php

    insert at line 246:

    // fix for WordPress 2.3
    // evilzenscientist - 2 Oct 07

    $sql = preg_replace(”/post_id/”, “wp_postmeta.post_id”, $sql);

    $sql = preg_replace(”/, meta_value/”, “, wp_postmeta.meta_value”, $sql);
    $sql = preg_replace(”/meta_key/”, “wp_postmeta.meta_key”, $sql);

    // end

    Posted Oct 2, 2007 at 9:50pm | Permalink
  81. Urg - the comments system ate this.

    I posted what works for me at: http://www.evilzenscientist.com/blog/2007/10/02/post-levels-update-for-wordpress-23/

    Posted Oct 2, 2007 at 10:14pm | Permalink
  82. thomas

    i get the following errors with post levels 1.1:

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘p WHERE p.post_date ‘2007-10-10 20:25:45′ AND p.post_type = ‘post’ AND p. (wp’ at line 1]
    SELECT p.ID, p.post_title FROM (wp_posts LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id) AS p WHERE p.post_date > ‘2007-10-10 20:25:45′ AND p.post_type = ‘post’ AND p. (wp_posts.post_status = ‘publish’ OR (wp_posts.post_status = ‘private’ AND (wp_postmeta.meta_key = ‘post_level’ AND wp_postmeta.meta_value

    Posted Oct 11, 2007 at 6:53am | Permalink
  83. thomas

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘p WHERE p.post_date ‘2007-10-10 20:25:45′ AND p.post_type = ‘post’ AND p. (wp’ at line 1]
    SELECT p.ID, p.post_title FROM (wp_posts LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id) AS p WHERE p.post_date > ‘2007-10-10 20:25:45′ AND p.post_type = ‘post’ AND p. (wp_posts.post_status = ‘publish’ OR (wp_posts.post_status = ‘private’ AND (wp_postmeta.meta_key = ‘post_level’ AND wp_postmeta.meta_value

    Posted Oct 11, 2007 at 6:56am | Permalink
  84. KA

    Hi,

    First of all, let me thank you for a wonderful plugin that has been in my blog since it started. It is easy to use and serve exactly the purpose of what I have in mind.

    With WP2.3, I am a little stuck cos it does not seem to work with this new version of wordpress (at least not yet) and I would like to try some of the new stuff in 2.3.

    Any thoughts of updating this plugin for WP 2.3?

    Thanks again for the good stuff…

    KA

    Posted Oct 20, 2007 at 1:13am | Permalink
  85. Khaliel

    Why the plugin’s author is not helping us anymore ?? i’ve got this error :

    [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘p WHERE p.post_date

    Posted Nov 4, 2007 at 11:42am | Permalink
  86. Khaliel

    Erreur de la base de données de WordPress : [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘p WHERE p.post_date

    Posted Nov 4, 2007 at 11:43am | Permalink
  87. Can the content of my posts to be read and indexed by search engine but protected from human eyes when they click through?

    Can the protected posts still be listed with the archives, latest posts, and random posts plugin?

    Does the post level plugin work with pages as well?

    Posted Nov 9, 2007 at 9:52am | Permalink
  88. This plugin works fine for me after following Doug Neiner’s solution (see previous comment @ 16 aug 2007). Just remove the ‘) from line 567…

    I am using WordPress 2.3 and post-levels v1.1.1.

    Thanks Fortes!

    Posted Nov 18, 2007 at 9:42pm | Permalink
  89. I’m with Naz, above. With my default post level and default user levels both set to 0, I would hope that there would be some way to show teasers to non-logged-in users, but no. Posts with a post level of 1 are invisible to everyone except users with at least a post level of 1.

    If there’s no way to show a teaser to anyone, I’m not sure I see the point.

    Posted Nov 19, 2007 at 7:56pm | Permalink
  90. Cool.

    Posted Dec 1, 2007 at 4:44am | Permalink
  91. David

    Can someone post an edited version of the plugin?

    Thanks,

    David

    Posted Dec 6, 2007 at 7:09pm | Permalink
  92. David

    Can you post the working version for WP 2.3.1?

    Posted Dec 7, 2007 at 2:42am | Permalink
  93. This seems to be a nice plugin. Though making pages private lets them appear as non existant. Clicking a page link just gives a 404 error.
    No matter to what I set the preview option, non logged in users simply get the error. Instead it should post a page preview I think. Not?!

    Posted Dec 13, 2007 at 5:17am | Permalink
  94. I installed the latest version of wordpress and upgraded to Post Levels 1.1.1 the other day. All appeared to be working fine. Today, though I noticed that any person that has access to any level of private post suddenly has access to ALL levels of private posts. Anyone else have this happen?

    Posted Dec 13, 2007 at 5:45pm | Permalink
  95. I am running WP 2.3.1 with Post Levels 1.1.1. I have PostLevels set to display the title-only of my private entries in feed readers.

    However, this doesn’t work for any entry published at levels above 0. I use level 2 for my private entries, and I want these to display a title on feed readers.

    Is there a fix for this??

    Posted Dec 13, 2007 at 7:27pm | Permalink
  96. AG

    Hello, I love this plugin and am using Post Levels 1.1.1. Ever since I upgraded to Wordpress 2.3.1, I noticed that there’s a Wordpress database error. It only shows up if I’m logged in as an Admin. But the unlogged view (as seen by guests) won’t show any errors as I mentioned. I found this really strange. Is there a remedy for this when I log into my admin panel so I won’t see these errors. I really appreciate your time for making this plugin.

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS p WHERE p.post_date

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS p WHERE p.post_date > '2007-12-15 23:33:51' AND p.post_type = 'post' AND p. ' at line 1]
    SELECT p.ID, p.post_title FROM (b2posts LEFT JOIN b2postmeta as pl_b2postmeta ON (b2posts.ID = pl_b2postmeta.post_id)) AS p WHERE p.post_date > '2007-12-15 23:33:51' AND p.post_type = 'post' AND p. (b2posts.post_status = 'publish' OR (b2posts.post_status = 'private' AND (pl_b2postmeta.meta_key = 'post_level' AND pl_b2postmeta.meta_value

    Posted Dec 16, 2007 at 12:22pm | Permalink
  97. I am getting the same error as AG. The previous version I had, v1.0, does not have this error. So something that changed between 1.0 and 1.1.1 is causing that error to happen. If that is of any help

    Posted Dec 20, 2007 at 10:23pm | Permalink
  98. Still having the same issue as above but here’s more detail :

    wp v2.3.2 + pl v1.1.1

    * users level 0 can not see any private posts, as would be expected
    * users level 1 can see level 1 private posts but no private posts above level 1, as would be expected.
    * users level 2 and up can see all private posts regardless of level

    Is this the general incompatibility with wp 2.3x that I keep reading about … or is there a fix? I’ve combed through the plugin code but I can’t find anything that does anything different between a level 1and a level 2 user.

    Posted Jan 5, 2008 at 5:43pm | Permalink
  99. nbb

    I have the same problem like Carrie. (WP 2.3.3 and PL 1.1.1).

    It seems that PL works fine for people are not logged in (you cannot see private posts). But people logged in of all levels (0,1,2,3,…) can see Level 10 postings (or any other higher level posts) at any time.

    Aktivated Plugins Running (AddQuicktag, Aksimet, AddQuicktag, Lightbox JS v2.03.2 Plugin, Post Levels, The Hacker’s Diet)

    Posted Jan 10, 2008 at 12:39pm | Permalink
  100. Thank you for your wonderful coding! But I’ve found one little glitch…. I’m running Wordpress 2.3.2 with the plug-in ‘page-links-to’ version 1.4 and your plug-in version 1.1.1.

    My issue is that when I’m logged in, my links that use the ‘page-links-to’ plug-in don’t open in a new window like I’ve told them to, but when I log out they do open in a new window…. Any thoughts? Not a big deal, just curious.

    Posted Jan 24, 2008 at 5:28pm | Permalink
  101. Does it work with 2.3.2? Looks like mixed results.

    If not, when do you anticipate upgrading for 2.3.2?

    Also, want to run with rolemanager 2.2.1 - any known problems?

    Thanks!

    Posted Feb 4, 2008 at 8:54pm | Permalink
  102. Xen

    I’m using WP2.3.3 + PL1.1.1. The levels are working as expected, but the Recent Posts and Pages menu are showing all posts as (Private). Actual blog titles are correct. When I view a non-private post, the postfix on the menu disappears.

    I wonder if others face the same problem or its something to do with my theme/setup.

    FYI, a little debug shows that in postlevels_the_title() $incomingpost always references my last post or whatever post i’m viewing. not sure if this info helps.

    Posted Feb 9, 2008 at 1:08pm | Permalink
  103. I just downloaded your Post Level plugin. I think this is going to be great and allow me to accomplish what I am looking for in regards to privacy on certain posts.

    I did notice one thing that doesn’t seem to be working? Or maybe it is just my template? If I login as a user with a post level of 1, I can do a search on the blog and view all private posts, even those that should only be viewable for those that have a level of 10. (These posts are not viewable for users NOT logged in, so only registered users can view.)

    Is there something I need to do/update so that they cannot be searched on by users with lower post level permissions? There are just certain things I do not want my mother-in-law to stumble upon, if you know what I mean. :-)

    I am using Wordpress 2.2 and have tried this one two different themes with the same result.

    Thanks so much for sharing this great plugin. I look forward to applying it to more posts.

    Posted Feb 14, 2008 at 9:22pm | Permalink
  104. niknah

    The private posts not showing up in categories problem is normal for wordpress, not related to theme but to whether there is a public post in the category. Even without this plugin, if you save a post as private and click on “manage” > “categories”, the count of posts won’t be updated.

    One way to fix this is to make one empty public post per category so the category is visible.

    Another way is to edit wp-includes/taxonomy.php
    In the function _update_post_term_count, change the bit that says “post_status = ‘publish’”
    to “(post_status = ‘publish’ or post_status = ‘private’)”

    Like…
    $count = $wpdb->get_var(”SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND (post_status = ‘publish’ or post_status = ‘private’) AND post_type = ‘post’ AND term_taxonomy_id = ‘$term’”);

    …then re save all your private posts(or one post per category) so that the category count is bigger than 0

    Posted Feb 20, 2008 at 6:18am | Permalink
  105. Ben

    Is there a way to display the level of the post, in the heading for example? Actually, I want to display the headings in different colors, so people know which posts are the most private etc.

    I tried is_post_level(1) and the $post_level variables, but to no success.

    Posted Feb 21, 2008 at 3:05pm | Permalink
  106. Ben

    Ah, got it. To access the level-number inside the loop, use:

    $thispostlevel = get_post_custom_values(get_option(’postlevels_post_key’));

    Posted Feb 22, 2008 at 9:15am | Permalink
  107. Ben

    Ah, got it. To access the level-number inside the loop, use:

    $thispostlevel = get_post_custom_values(get_option(’postlevels_post_key’));

    this returns an array, the post level is $thispostlevel[0].

    Posted Feb 22, 2008 at 9:16am | Permalink
  108. Hi! I’m using your plugin to restrict the access to some pages for some user. Is it possible to show a standard text like “You do not have enough rights to show this page” if users try to open such a page?

    You can have a look at my Website. I’d like to have such a message on the “VIP” Page, if unregistered users or users without enoug rights open this page.

    With kind regards from Germany!

    Krooms

    Posted Feb 23, 2008 at 8:00pm | Permalink
  109. hi fil…

    first of all thank u for this plugin..it works perfectly with my post, but not with my pages..
    if i set private a page (lev 2 for example) when i click on publish it is saved as draft and the button it’s is invisible to all. how can i resolve it? Thank you

    Posted Mar 3, 2008 at 2:52pm | Permalink
  110. Catalin

    I have a fresh 2.3.3 wordpress and this plugin is activated but it’s not working well.
    I have 2 posts with level 1 and 2.
    I have 2 users with level 1 and 2.

    If there is no one logged in they can’t see the posts with level 1 and 2.

    But, if user1 is logged, he can see both posts. Same issue with user2.

    Thank you.

    Posted Mar 19, 2008 at 12:10pm | Permalink

6 Trackbacks/Pingbacks

  1. Posted Feb 19, 2007 at 5:49pm | Permalink

    Post Levels 1.0.9 (for WordPress 2.0.x)…

    I’ve gotten a few emails from people that are still running the 2.0.x versions of WordPress (which will apparently be supported until 2010). Due to a boring technical reason, the “User Levels” menu is hidden from the admin section if …

  2. Posted May 3, 2007 at 12:51pm | Permalink

    […] Just wanted to give a friendly reminder to all the Wordpress people that Post Levels is out and works with Wordpress 2.1.x …  You can check it out here. […]

  3. Posted May 20, 2007 at 12:33am | Permalink

    […] Visit […]

  4. Posted Oct 2, 2007 at 10:14pm | Permalink

    […] made an update for the post-levels plugin so it works with WordPress […]

  5. Posted Oct 3, 2007 at 9:32am | Permalink

    […] the end I used the post-levels plugin from Filipe Fortes - it needed some SQL mungling to work with WordPress 2.3 - but the end […]

  6. Posted Nov 4, 2007 at 6:57pm | Permalink

    […] added a couple plugins to WordPress today.  I added Post Levels so I could add a private section to the blog.  Now, if the title of the post has “- […]