The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
+2
Perfe <3
smurfavr
6 posters

    Allow only Administrators to delete a topic

    smurfavr
    smurfavr
    Active Poster


    Male Posts : 1881
    Reputation : 22
    Language : Bulgarian

    Solved Allow only Administrators to delete a topic

    Post by smurfavr February 8th 2020, 8:06 am

    First topic message reminder :

    @TheCrow I pasted the code as written, but the moderator can still delete topics. https://help.forumotion.com/t155267-allow-only-administrators-to-delete-a-topic

    Allow only Administrators to delete a topic - Page 2 MsJck6N
    smurfavr
    smurfavr
    Active Poster


    Male Posts : 1881
    Reputation : 22
    Language : Bulgarian

    Solved Re: Allow only Administrators to delete a topic

    Post by smurfavr February 28th 2020, 9:02 am

    No change.
    OliverJ
    OliverJ
    New Member


    Posts : 1
    Reputation : 1
    Language : English

    Solved Re: Allow only Administrators to delete a topic

    Post by OliverJ February 28th 2020, 10:26 am

    Yes he/she have the rights of all these things.
    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15311
    Reputation : 1705
    Language : English,Greek
    Location : Greece

    Solved Re: Allow only Administrators to delete a topic

    Post by skouliki February 28th 2020, 10:28 am

    OliverJ wrote:Yes he/she have the rights of all these things.

    Please do not hijack another member’s topic

    If you have a problem with your forum please open your own thread

    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Allow only Administrators to delete a topic

    Post by TheCrow February 28th 2020, 12:19 pm

    @smurfavr,

    For my test forum, I used the same code and I even made my forum in Bulgarian to test it, and it still works fine. Is there any other code that may interfere with this code?

    Allow only Administrators to delete a topic - Page 2 Screen23

    Regards,
    TC.



    Allow only Administrators to delete a topic - Page 2 Thecro10
    Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    smurfavr
    smurfavr
    Active Poster


    Male Posts : 1881
    Reputation : 22
    Language : Bulgarian

    Solved Re: Allow only Administrators to delete a topic

    Post by smurfavr February 28th 2020, 2:08 pm

    Code works. The problem was with me. I had made a mistake and had not checked the In all the pages checkbox. I'm sorry.


    Which codes from the ones you gave me to use?
    This
    Code:
    // A code by :copyright:️TheCrow (2018) for Forumotion. Please do not remove these comments :
            // http://help.forumotion.com/t155267-allow-only-administrators-to-delete-a-topic#1067499
            $(document).ready(function () {
              if (!(_userdata.user_level == 1)) {
                $(function(){
                  if (/mode=delete/.test(window.location.href)) {
                    $('input.mainoption').remove();
                    $('<span style="display:block;text-align:center;color:red;font-weight:700;font-size:16px">Sorry but only Administrators are allowed to delete topics.</span>').insertAfter('input.liteoption');
                  }
                });
                $('a[href*="modcp?mode=delete"]').removeAttr('href').css("cursor","not-allowed");
                $('a img[alt="Delete this topic"]').attr("title","Only Administrators are allowed to delete a topic"); // For Mod-Tools deletion of the entire topic
                $('td.post-options a[href*="mode=delete"]').removeAttr('href').attr('style','cursor:not-allowed!important');
                $('img.i_icon_delete').attr("title","Only Administrators are allowed to delete messages").css("cursor","not-allowed"); // For Messages
              }
            });

    @TheCrow Thanks for your time.
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Allow only Administrators to delete a topic

    Post by TheCrow February 28th 2020, 8:15 pm

    Hello,

    Happy to hear that it works. Yes, that will work just fine.

    Is this now solved?



    Allow only Administrators to delete a topic - Page 2 Thecro10
    Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    smurfavr
    smurfavr
    Active Poster


    Male Posts : 1881
    Reputation : 22
    Language : Bulgarian

    Solved Re: Allow only Administrators to delete a topic

    Post by smurfavr February 28th 2020, 8:48 pm

    There's another thing you didn't do in the code. From the button you can moderate this forum moderator can delete topics.

    Allow only Administrators to delete a topic - Page 2 AHrdMdy
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Allow only Administrators to delete a topic

    Post by TheCrow February 28th 2020, 8:59 pm

    Hello,

    Try this code instead:
    Code:
    // A code by :copyright:️TheCrow (2018) for Forumotion. Please do not remove these comments :
            // http://help.forumotion.com/t155267-allow-only-administrators-to-delete-a-topic#1067499
            $(document).ready(function () {
              if (!(_userdata.user_level == 1)) {
                $(function(){
                  if (/mode=delete/.test(window.location.href)) {
                    $('input.mainoption').remove();
                    $('<span style="display:block;text-align:center;color:red;font-weight:700;font-size:16px">Sorry but only Administrators are allowed to delete topics.</span>').insertAfter('input.liteoption');
                  }
                });
                $('input.liteoption[name="delete"]').remove();
                $('a[href*="modcp?mode=delete"]').removeAttr('href').css("cursor","not-allowed");
                $('a img[alt="Delete this topic"]').attr("title","Only Administrators are allowed to delete a topic"); // For Mod-Tools deletion of the entire topic
                $('td.post-options a[href*="mode=delete"]').removeAttr('href').attr('style','cursor:not-allowed!important');
                $('img.i_icon_delete').attr("title","Only Administrators are allowed to delete messages").css("cursor","not-allowed"); // For Messages
              }
            });

    This should fix that button too.

    Regards,
    TC.



    Allow only Administrators to delete a topic - Page 2 Thecro10
    Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!
    smurfavr
    smurfavr
    Active Poster


    Male Posts : 1881
    Reputation : 22
    Language : Bulgarian

    Solved Re: Allow only Administrators to delete a topic

    Post by smurfavr February 28th 2020, 9:17 pm

    Everything works very well. Thank you very much. @TheCrow

    I want to ask you for other changes to the code that I want to make in this topic or write a new topic?
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Allow only Administrators to delete a topic

    Post by TheCrow February 29th 2020, 5:55 am

    Hello,

    It would be best to do this in a new topic instead.

    Problem solved & topic archived.
    Please read our forum rules: ESF General Rules

    Regards,
    TC.



    Allow only Administrators to delete a topic - Page 2 Thecro10
    Forum of the Forums

    Forumotion Rules | Tips & Tricks |
    FAQ | Did you forget your password?



    *** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
    No support via PM!

      Current date/time is September 23rd 2024, 1:30 am