A script for all closed topics
2 posters
Page 1 of 1
A script for all closed topics
I want a script to wright on all closed topics ex: "This topic is now closed to further replies."
Last edited by Mati on 29/9/2015, 17:34; edited 1 time in total
Re: A script for all closed topics
Hi @Mati,
Try the following :
Go to Modules > JS codes management > Create a new script
Placement : In the topics
There's various data at the top that you can modify :
locked : The URL of your locked image
message : The message you want to display
To style the notice you can use the .notice_locked classname.
Try the following :
Go to Modules > JS codes management > Create a new script
Placement : In the topics
- Code:
$(function() {
var locked = 'http://i21.servimg.com/u/f21/16/89/96/68/locked10.png',
message = 'This topic is now closed to further replies.',
reply = $('.i_reply')[0],
main = document.getElementById('main-content'),
node;
if (reply && reply.src == locked) {
node = document.createElement('DIV');
node.className = 'notice_locked';
node.innerHTML = message;
main && main.insertBefore(node, main.firstChild);
}
});
There's various data at the top that you can modify :
locked : The URL of your locked image
message : The message you want to display
To style the notice you can use the .notice_locked classname.
Re: A script for all closed topics
Works perfect but is it possible to have it above quick reply box.
Re: A script for all closed topics
Sure !
Replace the script with this :
Replace the script with this :
- Code:
$(function() {
var locked = 'http://i21.servimg.com/u/f21/16/89/96/68/locked10.png',
message = 'This topic is now closed to further replies.',
reply = $('.i_reply')[0],
main = document.getElementById('main-content'),
quick = document.anchors.quickreply,
node;
if (reply && reply.src == locked) {
node = document.createElement('DIV');
node.className = 'notice_locked';
node.innerHTML = message;
if (main && quick) main.insertBefore(node, quick);
}
});
Similar topics
» is there a recent topics with auto update Script
» the Script Warning for Locked Topics is not working for some reason
» How to put this script for some topics
» Hide some topics via script?
» Hide effect for similar topics script
» the Script Warning for Locked Topics is not working for some reason
» How to put this script for some topics
» Hide some topics via script?
» Hide effect for similar topics script
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum