Support » Plugins and Hacks » ViewLevel 1.1 Release

  • ViewLevel is a plugin that lets you hide certain posts from users below a certain userlevel. I’ve made some changes, based a lot on your feedback, and am now releasing version 1.1!
    ViewLevel 1.1
    What’s new in v.1.1

  • Properly hides post contents in rss feeds, including the comments feed
  • Option to show a message in place of hidden posts (i.e. “Please log in to see this post”)
  • Option to set a default viewlevel for posts (lets you make all posts private unless you specify otherwise!)
  • The calendar now shows only posts that the user is allowed to see
  • Option to show the post viewlevel next to the padlock icon (code snippet thanks to Dave Disser)
Viewing 15 replies - 1 through 15 (of 33 total)
  • Thanks for the update and keep up the good work. Will test the plugin later today and let you know if there’s any issue.
    BTW, I really like the simplistic look of your site.

    I have a problem wih the upgrade to version 1.1
    When displaying the post title (the_title) and the padlock icon, on a post titled “I Surrender,” I get something that looks like this:
    I Surrender!”> (padlock image here) I Surrender!
    I have checked the plugin code and cannot find where this is occurring.
    Any help will be appreciated.

    Thanks, Anon!
    DaveDorm pointed out another issue – database errors popping up in the admin interface. Should be resolved now in v.1.1.1, which you can find at the same link.

    Installed per instructions and get the following:
    Warning: Cannot modify header information – headers already sent by (output started at /home/sitename/sitedir/blog/wp-content/plugins/viewlevel.php:345) in /home/sitename/sitedir/blog/wp-login.php on line 257
    followed by three or four more of the same message with different line numbers. Any ideas? Thanks

    Paulspen,
    Do the first few lines of your plugin.php look like this?
    ?php
    /*
    Plugin Name: View Levels v.1.1.1
    Plugin URI: http://www.furbona.org/viewlevels.php#
    Description: When posts have a custom field called "viewlevel" set, only lets users with that user level or above see the post.
    Author: Kendra Burbank
    Author URI: http://www.furbona.org
    */

    If not, you may have somehow gotten the php file which I’m using to send out the actual plugin php. The first few lines of that file look like this:
    <?php
    $file = '../viewlevel.php'; $code = file_get_contents($file);
    if ($code) {
    header("Content-Type: application/octet-stream");
    // inline is for "attachment" if browser is not IE

    If that’s what’s going on, then try using this link instead (again, renaming it viewlevel.php and putting it in your plugin folder… you’ll have to deactivate and reactivate);
    viewlevel.phps
    Hope this works for you!

    Thanks, Kendra.
    Nope, I’m using the right one, but let me mess around a little more and get back to you.
    Thanks for the response!

    OK. I reinstalled and it seems to have fixed itself. Now the only issue is that when I view the blog as me (viewlevel 10) and see view-level protected posts, the protected post title reads:
    Title”> X Title
    where X is the missing padlock image.
    When I view it as viewlevel 0, the post doesn’t appear at all, which I guess means it’s working.
    Thanks again!

    sweet

    cant get it to work- i edited and uploaded- when i edit the wp-blog-header.php the site goes byebye, had to disable this plugin.
    using wp1.2

    Fatal error: Call to undefined function: add_filter() in /home/tekwh0re/public_html/wp/index.php on line 30
    help?
    Can someone fix this page too?

    Tek, can you give some more details? Had you just installed the plugin? Were there any other error messages? What do you have on line 30 of your index.php file?
    Thanks!

    Yeah… what I did before was I screwed up my index.php page.
    I think I fixed that but I am still having problems. If you got to tekwh0re.net/wp you will see where I made a private post which isn’t private and its showing up on the rss feed. =(

    I found the source of the problem where post titles would show up twice (it took me a while to find the problem, because apparently my version of index.php was pre-wordpress1.2 . I forgot that I had just copied it over like that. So the bug wasn’t showing up for me.)
    New version 1.1.2 fixes the problem.
    viewlevel.html
    This should help Paulspen and Tek and anybody else who’s written me about this. 🙂

    =)

    Hey Kendra: I’ve been getting this message again after I installed 1.1.2
    Warning: Cannot modify header information – headers already sent by (output started at /home/sitename/sitedir/blog/wp-content/plugins/viewlevel.php:345) in /home/sitename/sitedir/blog/wp-login.php on line 257
    Tried all sorts of things: logging out, deleting cookies, etc, but once this error comes up, then other parts of the blog stop working soon after. Once it wouldn’t even let me log in again! The only thing I can think of is does it matter if the blog is stored in its own directory and not on the top level of the site? I only ask this because I noticed I needed to add the directory to the line in viewlevel that calls padlock.gif in order for the lock to show up. Could my directory structure be causing the above problem?
    Please help a fellow Ithacan.
    Thanks!

Viewing 15 replies - 1 through 15 (of 33 total)
  • You must be logged in to reply to this topic.