Forums

[Plugin: User Photo] Small tweak to work with no approval (13 posts)

  1. randyhoyt
    Member
    Posted 9 months ago #

    I set the field "Require user photo moderation for all users at or below this level" to a value of "(none)", meaning that users can upload a photo and have it accepted without any approval needed. However, photos were still saying that they needed approval in WP 2.6.5.

    I think I figured out the issue. When checking permissions, the plugin checks to see if the user's level is less than the required level. The required level in this case is -1, which is right. But the user's level is blank ("") instead of zero ("0"). Since -1 is not less than a blank value, it acts like the user does not have the right permissions.

    I solved this by adding the following code before line 442 ...

    if ($current_user->user_level == "") {$user_level = 0;} else {$user_level = $current_user->user_level;}

    ... and then changing 442 to use my new $user_level variable instead of $current_user->user_level:

    if($user_level <= get_option('userphoto_level_moderated') ){

  2. Txanny
    Member
    Posted 8 months ago #

    I also had this problem, but I think is much better to just change the line 442 to this:
    if(intval($current_user->user_level) <= get_option('userphoto_level_moderated') ){

  3. dwenaus
    Member
    Posted 8 months ago #

    YOU GUYS ROCK! I was having this problem too on a large site, and I just thought it was the users having trouble with the photos. but no. thanks for fixing this annoying problem. :)

  4. benlancaster
    Member
    Posted 8 months ago #

    Here's the fix I'm using:

    http://pastebin.com/d502d3aa8

  5. christopherbw
    Member
    Posted 7 months ago #

    @benlancaster

    Can you repost that fix that you use? Its unavailable.

  6. christopherbw
    Member
    Posted 7 months ago #

    That worked super guys...thanks.

  7. Bane Unreinen
    Member
    Posted 6 months ago #

    thanx randyhoyt! it worked like a charm.

  8. margjedonder
    Member
    Posted 6 months ago #

    benlancaster fix is unavailable agien.
    Txanny's fix works great!

  9. tom009
    Member
    Posted 5 months ago #

    This fix works with WP 2.7.1 ?

  10. dragunoff
    Member
    Posted 3 months ago #

    For me it worked just by changing line 122 to this:

    if(//A QUICK AND DIRTY FIX TO DISABLE MODERATION($userdata->userphoto_approvalstatus == USERPHOTO_APPROVED) &&

    The plugin version is 0.9.4 and WP is 2.8.4
    Cheers

  11. ruizwashere
    Member
    Posted 3 months ago #

    dragunoff's fix id not work. I believe it has something to do with the hidden comment not being closed.

    Txanny's worked like a charm.

  12. dragunoff
    Member
    Posted 2 months ago #

    the comment doesn't need to be closed as it's a one line comment.
    Don't know... it worked for me :)
    Photos are still reported as "pending moderation" but that doesn't have any effect anymore.

  13. auxano
    Member
    Posted 1 month ago #

    Txanny, thank you! Your solution worked great.

Reply

You must log in to post.

About this Topic

Tags