Allow only Administrators to delete a topic
+2
Perfe <3
smurfavr
6 posters
Page 1 of 2
Page 1 of 2 • 1, 2
Allow only Administrators to delete a topic
@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
Re: Allow only Administrators to delete a topic
hello
you have to be patient when TheCrow log in he will see the post
you have to be patient when TheCrow log in he will see the post
Re: Allow only Administrators to delete a topic
I have not done a double post.
psp
I marked him because he is the author of the topic. Anyone who knows what the problem is can help.
psp
I marked him because he is the author of the topic. Anyone who knows what the problem is can help.
Re: Allow only Administrators to delete a topic
Hi
Can you post there the code you placed in your javascript management ?
Can you post there the code you placed in your javascript management ?
Re: Allow only Administrators to delete a topic
- Code:
// A code by ️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)) {
$('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
$('ul.profile-icons 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
}
});
Re: Allow only Administrators to delete a topic
Perfe <3 wrote:
- 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)) {
$('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
$('ul.profile-icons 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
}
});
please do not hijack another member's post
the topic starter smurfavr must post his code (even if the code is the same as yours )
Re: Allow only Administrators to delete a topic
- Code:
$('a img[alt="Delete this topic"]')
I do not know any word of bulgarian but i know that "Delete this topic" doesn't sound bulgarian at all.
Please read again the tutorial !
Re: Allow only Administrators to delete a topic
skouliki wrote:Perfe <3 wrote:
- 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)) {
$('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
$('ul.profile-icons 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
}
});
please do not hijack another member's post
the topic starter smurfavr must post his code (even if the code is the same as yours )
Its the same code!
Re: Allow only Administrators to delete a topic
Neptune- wrote:
- Code:
$('a img[alt="Delete this topic"]')
I do not know any word of bulgarian but i know that "Delete this topic" doesn't sound bulgarian at all.
Please read again the tutorial !
@Neptune-
This is the code and the words are translated correctly in Bulgarian.
- Code:
// A code by ️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)) {
$('a[href*="modcp?mode=delete"]').removeAttr('href').css("cursor","not-allowed");
$('a img[alt="Изтрийте тази тема"]').attr("title","Само администраторите могат да изтрият тема"); // For Mod-Tools deletion of the entire topic
$('ul.profile-icons a[href*="mode=delete"]').removeAttr('href').attr('style','cursor:not-allowed!important');
$('img.i_icon_delete').attr("title","Само администраторите могат да изтриват съобщения").css("cursor","not-allowed"); // For Messages
}
});
Re: Allow only Administrators to delete a topic
I just tried your script after i switched my profile to bulgarian.
On hovering the "delete topic" icon, the cursor changed and the link was removed. Same for the "delete post" inside each post.
Script is working as it should.
Any conflict with other scripts ?
Maybe you should try to place it only on topics (rather than all pages like said in tutorial) !
Edit : Lot of strings still in english once i chose bulgarian on my profile (toolbar for example)
Edit 2 :
In fact, even without translating the correct alt, it works. No way to delete the topic. With no translation the button will still display "Delete this topic" but button is no more clickable.
Edit 3 :
The code in the tutorial is suitable for phpBB3.
For phpBB2 you should use the following one
On hovering the "delete topic" icon, the cursor changed and the link was removed. Same for the "delete post" inside each post.
Script is working as it should.
Any conflict with other scripts ?
Maybe you should try to place it only on topics (rather than all pages like said in tutorial) !
Edit : Lot of strings still in english once i chose bulgarian on my profile (toolbar for example)
Edit 2 :
In fact, even without translating the correct alt, it works. No way to delete the topic. With no translation the button will still display "Delete this topic" but button is no more clickable.
Edit 3 :
The code in the tutorial is suitable for phpBB3.
For phpBB2 you should use the following one
- Code:
// A code by ️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)) {
$('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
}
});
Re: Allow only Administrators to delete a topic
@Neptune-
After your code revision, it now works and the delete button cannot be used by a moderator.
There is another problem from the drop down menu there is an option to delete a post and from there still a moderator can delete a post.
I noted In the topics
After your code revision, it now works and the delete button cannot be used by a moderator.
There is another problem from the drop down menu there is an option to delete a post and from there still a moderator can delete a post.
I noted In the topics
Re: Allow only Administrators to delete a topic
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!
Re: Allow only Administrators to delete a topic
Hello again,
I need the url link of the page where you click yes/no and a screenshot if you can where you press right click (on the yes button) > inspect element.
Regards,
TC.
I need the url link of the page where you click yes/no and a screenshot if you can where you press right click (on the yes button) > inspect element.
Regards,
TC.
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!
Re: Allow only Administrators to delete a topic
Okay,
So after the 4th line of your code, after this:
press enter and paste this part:
This should give you this result after you select the delete option from the dropdown:
Regards,
TC.
So after the 4th line of your code, after this:
|
- Code:
if (/modcp?mode=delete/.test(window.location.href)) {
$('input.mainoption[name="confirm"]').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[name="cancel"]');
}
This should give you this result after you select the delete option from the dropdown:
Regards,
TC.
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!
Re: Allow only Administrators to delete a topic
Is that how the code should look?
I tried, but still a moderator can delete a post from the drop down.
- Code:
// A code by ️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)) {
if (/modcp?mode=delete/.test(window.location.href)) {
$('input.mainoption[name="confirm"]').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[name="cancel"]');
}
$('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
}
});
I tried, but still a moderator can delete a post from the drop down.
Re: Allow only Administrators to delete a topic
Hello @smurfavr,
Yes, like that. Sorry, I forgot to remove the href correctly. Please replace the above code I sent you with this one:
This should fix your problem. Plus, you can change the text
to anything you like.
Regards,
TC.
Yes, like that. Sorry, I forgot to remove the href correctly. Please replace the above code I sent you with this one:
- Code:
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');
}
This should fix your problem. Plus, you can change the text
|
Regards,
TC.
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!
Re: Allow only Administrators to delete a topic
@TheCrow I pasted the code but no change.
- 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)) {
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
}
});
Re: Allow only Administrators to delete a topic
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!
Re: Allow only Administrators to delete a topic
Yes I am logged in with a moderator profile and the drop down menu still works as a moderator.
The code does not work on my forum.
The code doesn't work on my test forum either.
It would be best if you can hide the moderator rank drop-down menu.
The code does not work on my forum.
The code doesn't work on my test forum either.
It would be best if you can hide the moderator rank drop-down menu.
Re: Allow only Administrators to delete a topic
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!
Re: Allow only Administrators to delete a topic
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!
Re: Allow only Administrators to delete a topic
This
- Code:
// A code by ️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)) {
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
}
});
Re: Allow only Administrators to delete a topic
Hello,
Do you have any other javascript that may interfere with this javascript?
Do you have any other javascript that may interfere with this javascript?
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!
Re: Allow only Administrators to delete a topic
I have a total of 20 Java scripts but I don't know if any of them interfere.
PSP
In my test forum I stopped all the java script and left only your code but it still doesn't work.
Can it interfere with some of the CSS code?
PSP
In my test forum I stopped all the java script and left only your code but it still doesn't work.
Can it interfere with some of the CSS code?
Re: Allow only Administrators to delete a topic
Hello again @smurfavr,
Please try and replace your code with this one:
What I did, is that I inserted a function just to make sure it reaches the url stage for this. Please try it and let me know.
Regards,
TC.
Please try and replace your code with this one:
- Code:
// A code by ️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
}
});
What I did, is that I inserted a function just to make sure it reaches the url stage for this. Please try it and let me know.
Regards,
TC.
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!
Page 1 of 2 • 1, 2
Similar topics
» Allow only Administrators to delete a topic
» Allow only Administrators to delete a topic (Change the code)
» Major Flaw in the tutorial "allow-only-administrators-to-delete-a-topic"
» I need an administrators help please forumotion sent me a delete forum message
» I delete a topic
» Allow only Administrators to delete a topic (Change the code)
» Major Flaw in the tutorial "allow-only-administrators-to-delete-a-topic"
» I need an administrators help please forumotion sent me a delete forum message
» I delete a topic
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum