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 Sat Feb 08 2020, 09:06

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 Fri Feb 28 2020, 10:02

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 Fri Feb 28 2020, 11:26

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 Fri Feb 28 2020, 11:28

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 : 14217
Reputation : 1635
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 Fri Feb 28 2020, 13:19

@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 : 6878
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 Fri Feb 28 2020, 15:08

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 Fri Feb 28 2020, 21:15

Hello,

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

Is this now solved?
TheCrow
TheCrow
Manager
Manager

Male Posts : 6878
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 Fri Feb 28 2020, 21:48

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 Fri Feb 28 2020, 21:59

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 : 6878
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 Fri Feb 28 2020, 22:17

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 Sat Feb 29 2020, 06:55

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 : 6878
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