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.

Allow only Administrators to delete a topic

+2
Perfe <3
smurfavr
6 posters

Page 2 of 2 Previous  1, 2

Go down

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 : 1883
Reputation : 22
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down


Solved Re: Allow only Administrators to delete a topic

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

No change.
smurfavr
smurfavr
Active Poster

Male Posts : 1883
Reputation : 22
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

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.
OliverJ
OliverJ
New Member

Posts : 1
Reputation : 1
Language : English

https://help.forumotion.com/

Back to top Go down

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
skouliki
skouliki
Manager
Manager

Female Posts : 15118
Reputation : 1696
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

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

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

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.
smurfavr
smurfavr
Active Poster

Male Posts : 1883
Reputation : 22
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

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?
TheCrow
TheCrow
Manager
Manager

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

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
smurfavr
smurfavr
Active Poster

Male Posts : 1883
Reputation : 22
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

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

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

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?
smurfavr
smurfavr
Active Poster

Male Posts : 1883
Reputation : 22
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

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

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Page 2 of 2 Previous  1, 2

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum