Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
Recent Tutorials
Top posting users this month
Top Achievers
Who is online?
In total there are 48 users online :: 0 Registered, 0 Hidden and 48 Guests :: 1 Bot
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
Post a message automatically when locking a topic
Page 1 of 1 • Share
- Wolfuryo
- Gender :
Posts : 256
Points : 3805
Reputation : 81
Language : Romanian and English
Browser : Forum Version :
This code should work on any forum version with no problems. It posts a predefined messages when you lock a topic. Add this code in the JavaScript Management Section with placement on the topics:
Modifications
-replace "Topic locked" with whatever you want;
-replace true with false if you want to deactivate the script without deleting it.
If you have any problem with the code, feel free to ask me.
- Code:
$(function(){/*Main jquery funtion*/
//By Wolfuryo//
//Free to use or modify, but you have to keep this notice here//
//Use at your own risk :D//
var message="Topic locked";/*The message to be posted*/
var active=true;/*Set to false to deactivate the script*/
//Do not modify anything below unless you know what you are doing//
var path=window.location.pathname;/*The current page*/
var reg=/t\d+\-/;/*Test to see if the current page is a topic*/
var elem=$("a[href*='/modcp?mode=lock']");/*Lock topic link*/
var link;/*Used later*/
if(!reg.test(path) || !elem.length || !active) return;/*Wrong page or no element, do not continue*/
$("a[href*='/modcp?mode=lock'], a[href*='/modcp?mode=lock']>img").click(function(e){/*Lock topic button is clicked*/
e.preventDefault();/*Prevent the page to automatically go to the lock topic page*/
link=$("a[href*='/modcp?mode=lock']").attr("href");/*Get the lock topic page's link*/
$.post("/post",{/*Post message*/
mode:"reply",/*Post mode as reply*/
t:parseInt(link.match(/\d+/)[0]),
message:message,/*Message*/
post:"Ok"/**/
}).always(function(){/*When the message is posted or error happens*/
window.location=link.split("%3F").join("?");/*Go to the lock topic page*/
})/*Close the function*/
})/*Close the click event*/
})/*Close the main function*/
Modifications
|
|
If you have any problem with the code, feel free to ask me.
Last edited by Andrei34 on Sat 13 May 2017, 04:31; edited 1 time in total
TonnyKamper likes this post
- Anita
- Gender :
Posts : 26
Points : 2816
Reputation : 10
Location : [404 - Not Found]
Language : English, Spanish, Rubbish
Browser : Forum Version :
Wow! This sounds great! I love the line, "Use at your own risk". LOL!
I inserted the script. As soon as I locked the topic, it led me to a 404 page, and the returned to the topic, which was still unlocked. I wonder why...
Cheers, mate!
I inserted the script. As soon as I locked the topic, it led me to a 404 page, and the returned to the topic, which was still unlocked. I wonder why...
Cheers, mate!
- Wolfuryo
- Gender :
Posts : 256
Points : 3805
Reputation : 81
Language : Romanian and English
Browser : Forum Version :
The code doesn't get the good link for the lock topic page I think What is your forum link? Also please send me a pm with an account that has moderation rights.
Hello @Andrei34 ,
thank for the work .
At the end of your script, you forgot one because it was not functional on my phpbb2 fofo
Functional script at home
Thanks for the script, but I encounter the same worries about my EDGE version,
Putting at the end of the script; It becomes functional but that by the drop-down menu though when I look in the source code, whether it is with your script or without the link is the same but the redirection page says with your script:
Hoping to have helped my friend
a++
thank for the work .
At the end of your script, you forgot one because it was not functional on my phpbb2 fofo
- Code:
})/*Close the main function*/
Functional script at home
- Code:
});/*Close the main function*/
Thanks for the script, but I encounter the same worries about my EDGE version,
Putting at the end of the script; It becomes functional but that by the drop-down menu though when I look in the source code, whether it is with your script or without the link is the same but the redirection page says with your script:
- Code:
http://punbb.forumactif.org/modcp%3Fmode=lock&
- Code:
http://punbb.forumactif.org/modcp?mode=lock&t=
Hoping to have helped my friend
a++
- Wolfuryo
- Gender :
Posts : 256
Points : 3805
Reputation : 81
Language : Romanian and English
Browser : Forum Version :
Let me see if I got it right. The script works on phpbb2, but not on edge?
Milouze14 wrote:Sorry, I'm french,
The script is not functional whatsoever for the version phpbb2, punbb and EDGE
The problem is here in the redirection page:
with your script:
- Code:
%3F
instead of :
- Code:
?
Ahhh I quoted instead of editing
- Wolfuryo
- Gender :
Posts : 256
Points : 3805
Reputation : 81
Language : Romanian and English
Browser : Forum Version :
Replace the code with:
- Code:
$(function(){/*Main jquery funtion*/
//By Wolfuryo//
//Free to use or modify, but you have to keep this notice here//
//Use at your own risk :D//
var message="Topic locked";/*The message to be posted*/
var active=true;/*Set to false to deactivate the script*/
//Do not modify anything below unless you know what you are doing//
var path=window.location.pathname;/*The current page*/
var reg=/t\d+\-/;/*Test to see if the current page is a topic*/
var elem=$("a[href*='/modcp?mode=lock']");/*Lock topic link*/
var link;/*Used later*/
if(!reg.test(path) || !elem.length || !active) return;/*Wrong page or no element, do not continue*/
elem.click(function(e){/*Lock topic button is clicked*/
e.preventDefault();/*Prevent the page to automatically go to the lock topic page*/
link=$(this).attr("href");/*Get the lock topic page's link*/
$.post("/post",{/*Post message*/
mode:"reply",/*Post mode as reply*/
t:parseInt(link.match(/\d+/)[0]),
message:message,/*Message*/
post:"Ok"/**/
}).always(function(){/*When the message is posted or error happens*/
window.location.pathname=decodeURI(link);/*Go to the lock topic page*/
})/*Close the function*/
})/*Close the click event*/
})/*Close the main function*/
Thank,
but on my punbb test forum, it's always the same redirect page 404 with always this
It is only this damn redirection page that is nonfunctional because when we return to the subject, the message is present for information
but on my punbb test forum, it's always the same redirect page 404 with always this
- Code:
%3F
- Code:
?
It is only this damn redirection page that is nonfunctional because when we return to the subject, the message is present for information
Last edited by Milouze14 on Sat 13 May 2017, 03:22; edited 1 time in total
- Wolfuryo
- Gender :
Posts : 256
Points : 3805
Reputation : 81
Language : Romanian and English
Browser : Forum Version :
- Code:
$(function(){/*Main jquery funtion*/
//By Wolfuryo//
//Free to use or modify, but you have to keep this notice here//
//Use at your own risk :D//
var message="Topic locked";/*The message to be posted*/
var active=true;/*Set to false to deactivate the script*/
//Do not modify anything below unless you know what you are doing//
var path=window.location.pathname;/*The current page*/
var reg=/t\d+\-/;/*Test to see if the current page is a topic*/
var elem=$("a[href*='/modcp?mode=lock']");/*Lock topic link*/
var link;/*Used later*/
if(!reg.test(path) || !elem.length || !active) return;/*Wrong page or no element, do not continue*/
elem.click(function(e){/*Lock topic button is clicked*/
e.preventDefault();/*Prevent the page to automatically go to the lock topic page*/
link=$(this).attr("href");/*Get the lock topic page's link*/
$.post("/post",{/*Post message*/
mode:"reply",/*Post mode as reply*/
t:parseInt(link.match(/\d+/)[0]),
message:message,/*Message*/
post:"Ok"/**/
}).always(function(){/*When the message is posted or error happens*/
window.location.pathname=decodeURI(link.replace("%3F", "?"));/*Go to the lock topic page*/
})/*Close the function*/
})/*Close the click event*/
})/*Close the main function*/
Sorry Andrei34 ,
but not functional on the phpbb2, phpbb3 et punbb
It is only this redirection page that is non functional because when we return to the subject, the message is present for information
but not functional on the phpbb2, phpbb3 et punbb
It is only this redirection page that is non functional because when we return to the subject, the message is present for information
- Wolfuryo
- Gender :
Posts : 256
Points : 3805
Reputation : 81
Language : Romanian and English
Browser : Forum Version :
- Code:
$(function(){/*Main jquery funtion*/
//By Wolfuryo//
//Free to use or modify, but you have to keep this notice here//
//Use at your own risk :D//
var message="Topic locked";/*The message to be posted*/
var active=true;/*Set to false to deactivate the script*/
//Do not modify anything below unless you know what you are doing//
var path=window.location.pathname;/*The current page*/
var reg=/t\d+\-/;/*Test to see if the current page is a topic*/
var elem="a[href*='/modcp?mode=lock']";/*Lock topic link*/
var link;/*Used later*/
if(!reg.test(path) || !elem.length || !active) return;/*Wrong page or no element, do not continue*/
$("a[href*='/modcp?mode=lock'], a[href*='/modcp?mode=lock']>img").click(function(e){/*Lock topic button is clicked*/
e.preventDefault();/*Prevent the page to automatically go to the lock topic page*/
link=$("a[href*='/modcp?mode=lock']").attr("href");/*Get the lock topic page's link*/
$.post("/post",{/*Post message*/
mode:"reply",/*Post mode as reply*/
t:parseInt(link.match(/\d+/)[0]),
message:message,/*Message*/
post:"Ok"/**/
}).always(function(){/*When the message is posted or error happens*/
window.location=link.split("%3F").join("?");/*Go to the lock topic page*/
})/*Close the function*/
})/*Close the click event*/
})/*Close the main function*/
Hummmmm, you want a good news my friend?
Your script is functional on the versions, phpbb2, phpbb3, Punbb, Invision and Edge
A big thank you for your dedication .
a++
Your script is functional on the versions, phpbb2, phpbb3, Punbb, Invision and Edge
A big thank you for your dedication .
a++
- Wolfuryo
- Gender :
Posts : 256
Points : 3805
Reputation : 81
Language : Romanian and English
Browser : Forum Version :
Yay I edited the first post with the good code. This script caused me a little headache lol
Thanks for testing it
Thanks for testing it
- ThunderTBNew Member
- Gender :
Posts : 2
Points : 2569
Reputation : 0
Language : French
Browser : Forum Version :
Thank you , very handy .
- Sponsored content
Similar topics
Create an account or log in to leave a reply
You need to be a member in order to leave a reply.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum