WordPress.org

Ready to get started?Download WordPress

Forums

Viewlevel Enhancement plugin (23 posts)

  1. bAs
    Member
    Posted 10 years ago #

    Sweet I'll try it and let you know

  2. wyzewoman
    Member
    Posted 10 years ago #

    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. :-)

  3. nstead
    Member
    Posted 10 years ago #

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

  4. ringmaster
    Member
    Posted 9 years ago #

    Hey, that code looks startlingly familiar... :)

  5. Liberty
    Member
    Posted 9 years ago #

    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?

  6. Anonymous
    Unregistered
    Posted 9 years ago #

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

  7. Anonymous
    Unregistered
    Posted 9 years ago #

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

  8. nstead
    Member
    Posted 9 years ago #

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

  9. Anonymous
    Unregistered
    Posted 9 years ago #

    Anonymous & nstead >
    On line 56, remplace :
    " add_action('admin_footer','vl_admin_footer'); "
    by
    "add_filter('admin_footer','vl_admin_footer'); "
    to get it work without error.

  10. cramoisi
    Member
    Posted 9 years ago #

    oops, the post above was mine :)

  11. Liberty
    Member
    Posted 9 years ago #

    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.

  12. nstead
    Member
    Posted 9 years ago #

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

  13. Liberty
    Member
    Posted 9 years ago #

    *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.

  14. Anonymous
    Unregistered
    Posted 9 years ago #

    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.

  15. Vigna
    Member
    Posted 9 years ago #

    Neil:
    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: http://wordpress.org/support/4/10834/rss
    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.

  16. Anonymous
    Unregistered
    Posted 9 years ago #

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

  17. Vigna
    Member
    Posted 9 years ago #

    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;
    }
    '

  18. Anonymous
    Unregistered
    Posted 9 years ago #

    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;

  19. Anonymous
    Unregistered
    Posted 9 years ago #

    (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;

  20. Anonymous
    Unregistered
    Posted 9 years ago #

    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.

  21. Anonymous
    Unregistered
    Posted 9 years ago #

    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!

  22. nolageek
    Member
    Posted 9 years ago #

    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.

  23. nolageek
    Member
    Posted 9 years ago #

    Anyone know where I can get this plugin/enhancement?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.