Support » Plugins » Viewlevel Enhancement plugin

  • Viewlevel Enhancement
    I love the Viewlevel plugin, but from my point of view there are two drawbacks:

    1. The fact that you have to set the post level by typing a specific string into the post text – not very user-friendly
    2. There’s nothing to stop a user from posting a message higher than they’re allowed to read (e.g. a Level 2 user can put “vl=7” in their post, and it will be set as a level 7 post).

    I’ve therefore created my own “Viewlevel Enhancement” plugin, which provides a drop-down menu of the available levels on the main post page. In its default form, the menu will show “Level 0″,”Level 1″,…”Level 10”, but it can very easily be modified to (a) remove levels that you don’t want to use, and (b) show more friendly text.
    For example, on my site (which I use for a scuba club), Level 0 is an Unregistered member, Level 2 is a club member, and Level 4 is a committee member. I don’t use any other levels. The menu on my posts page therefore shows “Public Post”, “Members-only Post”, and “Committee-only Post”. Level 2 users will not see the “Comittee-only post” option.
    You can download the source from here.
    Just drop it in your plugins folder, and activate it! No hacks required!
    This is my first plugin, so please let me have any feedback.

Viewing 15 replies - 1 through 15 (of 23 total)
  • Sweet I’ll try it and let you know

    That’s great! I wanted to do something like this, but didn’t know how. As I mentioned in the other viewlevel thread, I’m out of town and my server (which hosts both my blog and the viewlevel plugin page) has gone down – but as soon as I get home this weekend I’ll put the server back up and try this plugin out. 🙂

    I can’t recreate the above problem, so I guess I was mistaken. If not, let me know.

    Hey, that code looks startlingly familiar… 🙂

    I really love this add on (and hope that the two plugins eventually are merged into one) but I seem to have a problem with mine. After saving an entry, I get the following error:
    Warning: Cannot modify header information – headers already sent by (output started at /home/woppat/public_html/blog/wp-content/plugins/vlenhance.php:128) in /home/woppat/public_html/blog/wp-admin/post.php on line 146
    Everything still “works”… the post is made and properly categorized, but I have to click “back” in order to get back into my WordPress editing and such. Is this just a weird glitch with the plugin or is there something I’ve done incorrectly (somehow??) with the install?

    I have the same problem, but only when I try to login to my site.

    hmmm not doing something right.
    i dropped it into my plugins and when i activate it
    it just appears on the top of the screen above the header as al lthe php code…

    Sorry – I haven’t been monitoring this thread (I wish the WP developers would implement a “subscribe to thread” option!).
    Firstly – yes, Ringmaster, I admit it, I used your Adhesive plugin to work out how to do it for Viewlevel.
    Secondly, the errors. Not sure why this is happening, although my version of WP is fairly heavily hacked, and this is my first plugin, so it’s entirely possible that it’s something I’ve screwed up! Unfortunately, I’m away for the weekend, but I’ll try to investigate next week when I get back.

    Anonymous & nstead >
    On line 56, remplace :
    ” add_action(‘admin_footer’,’vl_admin_footer’); “
    “add_filter(‘admin_footer’,’vl_admin_footer’); “
    to get it work without error.

    oops, the post above was mine 🙂

    I replaced the “add_action” with “add_filter” without success. I’m still receiving errors whenever I try to add, edit, login, etc. while the plugin is activated. I’m also more than a little disgruntled that in spite of unchecking the box that allows users to publish posts, any registered user may still post and publish to my site. This is not acceptable.
    WP is severely lacking in customizing which users have what privileges. I hope future versions of WP focus on that failing.

    From the WordPress Wiki:

    From a coding perspective, actions and filters are identical. The add_action function is nothing more than an alias for the add_filter function.

    So I wouldn’t have expected cramoisi’s solution to work. I’ve been snowed under at work this week, so haven’t had a chance to look at it, and next week I’m on holiday. I promise to look at it when I get back. My index.php is heavily hacked, and I’m using about 9 different plugins & hacks, so that’s probably why it works for me. I’ll try installing it on a clean WP installation when I get back from holiday. Thanks for your patience!

    *blush* I don’t want to admit it, but I fell prey to the white space issue. I’m reasonably certain that was my issue. as now everything is up and running properly. WHoops… guess I should check little things like white space and typos before posting.

    well, I thought I give it a swirl, but the moment I activate your plugin, my site goes white, i.e. all is empty. glancing through your code I see you’ve made some adjustments for version 1.3 of WP, I am using 1.2 – could this cause the problem? I removed that whole if statement but the site remained blank.
    for now I disabled but still curious to see the outcome of your plugin – guess I am a tad confused for what it is, as after creating the very first viewlevel custom field, I’ve had already a popup menu which I could re-use to set other posts to some viewlevel value.

    Not sure if you are back from vacation yet. If you have not read my “category Protection” post please take a few minutes to read it:
    I was wondering if you think this makes sense given your VL-Enhancement. Is it possible to provide similar function at the Category level?
    I have finally gotten your code and the original VL package to run. Nice Job 🙂 One suggestion, I got burned by the white space in your download file. You may want to check that.
    Still unable get the padlock image to show up but that is another story.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘Viewlevel Enhancement plugin’ is closed to new replies.