Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    No, for this you should use some third party membership plugin that will disallow unregistered members viewing page with [adverts_add] shortcode.

    Thread Starter edragonxx

    (@edragonxx)

    Ok, but will you add that option in the future? At the moment I can write quickhack in your code to force users log in. Like hide tick option from users and put it always on.

    Plugin Author Greg Winiarski

    (@gwin)

    This actually does not require changing WPAdverts code, just add in your theme functions.php file something like this

    add_filter("the_content", "registered_users_only", 10, 2);
    function registered_users_only($content, $id = null) {
        if( !is_user_logged_in() && stripos($content, '[adverts_add') !== false ) {
            $content = "You need to be registered to post an Ad.<br/>";
            $content.= sprintf('<a href="%s">Register</a><br/>', wp_registration_url());
            $content.= sprintf('<a href="%s">Login</a><br/>', wp_login_url());
        } 
    
        return $content;
    }

    and only registered members will be able to post Ads.

    This is not a good solution, you have to activate the possibility for everyone to register for it to work, hence a lot of spam registration incoming.

    A better solution would be to have the possibility to force registration through the advert form (or not depending on whatever you decide) which generate a lot less false registration crap. Then you can leave the option to leave everyone register off.

    Plugin Author Greg Winiarski

    (@gwin)

    This is only example of what can be done, like i wrote in my first message users should use some third party membership plugin to handle registrations and login, also even if you use the default WP Registration and Login you can install some reCAPTCHA plugin that will stop spam registrations.

    WPAdverts itself (at least in basic version) will not handle registration and login as there are already much better plugins that were developed specifically for this task.

    Does this work with the latest version of WordPress? Users are unable to log in through Adverts – they keep getting brought back to the login screen. And new users who have listed an ad and check marked to create a user, so they can manage their ads are created with a role of ‘subscriber’, not classified manager.

    Plugin Author Greg Winiarski

    (@gwin)

    I do not know what do you mean by “Users are unable to log in through Adverts”? WPAdverts itself does not have feature which would allow users to login or register it just links to default WP registration and login pages.

    Just use Page Restrict plugin.
    Worked perfect for me!

    Spend some time with theme my login plugin. It helps solve a lot of these problems. We just need to talk Greg into incorporating a theme my login registration function into his plugin as optional ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Only registered users’ is closed to new replies.