• 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.
    Neil.

Viewing 8 replies - 16 through 23 (of 23 total)
  • padlock.gif will not show up if the path to it is set wrong, I know I had to adjust the path in the .php file.
    just do a search for padlock.gif and each time check if it is referencing a path or not. if I remember correctly, in one instance it was just a missing slash just before the word padlock.gif. it all depends where you have the gif file stored in relation to the index.php file.
    the white space – did that give problems in the sense that just the whole site went white? I’ve noticed that several plugins create this problem for me…

    Regarding white space, yes the site either went white or the pages would display all the PHP code. My lesson learned is that when downloading plug-ins I will always open file and check for extra white space at end of file.
    Okay I have fixed the padlock problem. Here is the deal. I am sure wzyewomen has a buch of plug-ins and hacks on her system so this problem did not expose itself until you install ona virgin v1.3 code base. Basically the padlock image would not display because the of two problems: and extra “\” and an incorrect path.
    Basically the $site_root variable does not exist and we need to recall that the instructtions request that the image be placed in the wp-images directory. I fixed the code by usinging dirname to adjust for the current file path. Since viewfile.php is installed in wp-content/plug-ins we need to adjust for this. I also found that there was an extra “\'” which probably worked for teh $site_root method. Anyhow here is my patch:

    function post_padlock($text){
    global $show_viewlevel, $padlock_filename;
    if ($show_viewlevel)
    {
    $leveltext='<sup>’.intval(viewlevel()).'</sup> ‘;
    } else {
    $leveltext=” “; }
    if (viewlevel()){
    // $text='<img src=\”.$site_root.’/wp-images/’.$padlock_filename.’\’ border=\’0\’ />’.$leveltext.$text;
    // $text='<img src=\”.$site_root.’/wp-images/’.$padlock_filename.’ border=\’0\’ />’.$leveltext.$text;
    $padlock_path = dirname(dirname(dirname(__FILE__))).’/wp-images/’.$padlock_filename;
    if (file_exists($padlock_path)) {
    $text='<img src=’.$padlock_path.’ border=\’0\’/>’.$leveltext.$text;
    } else {
    $text=” “;
    }
    }
    return $text;
    }

    the easier way is to just replace:
    $text='<img src=\''.$site_root.'/wp-images/'.$padlock_filename.'\' border=\'0\'/>'.$leveltext.$text;
    with:
    $text='<img src=\''.get_settings('siteurl').'/wp-images/'.$padlock_filename.'\' border=\'0\'/>'.$leveltext.$text;
    also, since border=0 is deprecated, change it to a style tag, to make:
    $text='<img src=\''.get_settings('siteurl').'/wp-images/'.$padlock_filename.'\' style=\'border:0px;\' />'.$leveltext.$text;

    (there was weird html funkadoo, so i’m trying to repost. also, these changes are in the post_padlock function)
    the easier way is to just replace:
    $text='<img src=\”.$site_root.’/wp-images/’.$padlock_filename.’\’ border=\’0\’/>’.$leveltext.$text;
    with:
    $text='<img src=\”.get_settings(‘siteurl’).’/wp-images/’.$padlock_filename.’\’ border=\’0\’/>’.$leveltext.$text;
    also, since border=0 is deprecated, change it to a style tag, to make:
    $text='<img src=\”.get_settings(‘siteurl’).’/wp-images/’.$padlock_filename.’\’ style=\’border:0px;\’ />’.$leveltext.$text;

    made sure that I have no white space after the php tag – but still, the mmoment I enable this plugin (and a couple of others), my site goes white. any ideas what could be causing this? my index page is a level higher than my wp folder.

    This is just what I was looking for. I’m new to wp and I have a question: Where is the plugins folder and how do you activate a plugin? Thanks!

    Not Found
    The requested URL /WP/vlenhance.phps was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Anyone know where I can get this plugin/enhancement?

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