Disable user to delete listing


  • abu
    Newbie
     
    12 points

    Hello, when a user submits a listing and then view that listing, they are shown an alert saying:

    Listing Author – Delete – Edit This Listing.

    How can disable all users the ability to edit or delete their listing only admin should be able to edit or delete.

    Thanks.


    Josh
    Josh
    Super Guru
     
    13,887 points

    Hello Abu,
    Please add below code under Theme Setup >General Setup >Custom css

    #editlistingbox {
    display: none;
    }



    abu
    Newbie
     
    12 points

    I want to able to disallow edit and delete for other than admin. There is also an option to edit or delete from the profile page.

    How can I disable globally using php not css?

    Thanks


    Josh
    Josh
    Super Guru
     
    13,887 points

    Hello Abu,
    Try below code under Theme Setup >General Setup >Custom CSS >Footer Styles


    <script>
    if (!jQuery(".logged-in")[1]){
    jQuery('#editlistingbox,.hidden_grid a').hide();
    }
    </script>



    abu
    Newbie
     
    12 points

    This isn’t what I’m looking for, I’m thinking more of user permissions. I have created a feature request thread, hope you guys will consider it.


    Josh
    Josh
    Super Guru
     
    13,887 points

    Hello Abu,
    You can use the [MEMBERSHIP] shortcode to hide content
    >>http://www.premiumpress.com/docs/#MEMBERSHIP



    abu
    Newbie
     
    12 points

    Thank you for that, what are the user levels? What do the numbers mean? Which number is subscirber?


    Josh
    Josh
    Super Guru
     
    13,887 points

    The numbers represent your Membership Package ID.Which you can get under Listing Setup >Membership Package >ID



    abu
    Newbie
     
    12 points

    That won’t work for me, I want to disable delete and edit site wide for everybody except admin that means, subscribers etc can only post. Any way to do that?


    Josh
    Josh
    Super Guru
     
    13,887 points

    The code I provided above works perfectly



    abu
    Newbie
     
    12 points

    Thanks for the reply Josh.
    Anyone can turn off javascript and bypass that bit of jquery. If it can be done with php that would be great.



    Na
    Newbie
     
    54 points

    The jQuery disables both “edit and delete listing”. If I only need to disable “delete listing”. what is the jQuery?


    Josh
    Josh
    Super Guru
     
    13,887 points

    Hello Na,
    Please try below cod under Theme Setup >General Setup >Custom css

    .logged-in #editlistingbox a:first-child {
    display:none;
    }



    Na
    Newbie
     
    54 points

    I copied your code, but failed to disable the delete button, then I rewrote it step by step, still failed. Is there anything wrong?


    Josh
    Josh
    Super Guru
     
    13,887 points

    Hello Na,
    Send in a ticket I will do this for you


Viewing 15 posts - 1 through 15 (of 21 total)

You must be logged in to reply to this topic.