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.

Replacing "in a watched topic" with the topic's name in the toolbar

4 posters

Go down

Replacing "in a watched topic" with the topic's name in the toolbar Empty Replacing "in a watched topic" with the topic's name in the toolbar

Post by Guest May 1st 2017, 10:08 pm

Hello everyone,

This code will change the "in a watched topic" with the actual name of the topic. It should work on any forum version, as long as you have the toolbar activated. This code should be added with placement on all pages.
Code:
$(function(){
//by Wolfuryo
var i=0; // initialization for the for loop
if(!_userdata.activate_toolbar || !_userdata.session_logged_in) return; //no toolbar, no fun
/*Adding the name and some classes*/
_lang["Notif_topic_watch"] = "<a href=\"/u%(id)d\">%(name)s</a> wrote a message in <a href=\"/t%(topic_id)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\" class='cl'>%(topic_name)s</a>";
_lang["Notif_topic_watch_p"] = "<a href=\"/u%(id)d\">%(name)s</a> wrote a message in <a href=\"/t%(topic_id)dp%(start)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\" class='cl'>%(topic_name)s</a>";
_lang["Notif_topic_watch_guest"] = "A guest wrote a message in <a href=\"/t%(topic_id)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\" class='cl'>%(topic_name)s</a>";
_lang["Notif_topic_watch_p_guest"] = "A guest wrote a message in <a href=\"/t%(topic_id)dp%(start)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\" class='cl'>%(topic_name)s</a>"; 
$("body").on("DOMNodeInserted", ".cl", function(){ //The notification is created
$(this).text($(this).text().replace(/-/g, " ")).removeClass("cl").addClass("cd"); //remove some stuff
})
})
Notice:The code might have bugs, but, when I'll have more free time, I'll make a better one. If it's not working for you, please reply to this topic with your forum address and PM me a test account.
avatar
Guest
Guest


Back to top Go down

Replacing "in a watched topic" with the topic's name in the toolbar Empty Re: Replacing "in a watched topic" with the topic's name in the toolbar

Post by amghidh May 4th 2017, 9:48 am

not working:
Replacing "in a watched topic" with the topic's name in the toolbar Sans_t25

forum link: https://www.odros.net/forum
amghidh
amghidh
Forumember

Posts : 55
Reputation : 10
Language : EN FR AR TM
Location : Algeria

http://odros.yoo7.com

Back to top Go down

Replacing "in a watched topic" with the topic's name in the toolbar Empty Re: Replacing "in a watched topic" with the topic's name in the toolbar

Post by skouliki May 4th 2017, 10:02 am

hello 
i added as a test in my test forum (punbb) also not working

Replacing "in a watched topic" with the topic's name in the toolbar Scree190
skouliki
skouliki
Manager
Manager

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

http://iconskouliki.forumgreek.com

Back to top Go down

Replacing "in a watched topic" with the topic's name in the toolbar Empty Re: Replacing "in a watched topic" with the topic's name in the toolbar

Post by Draxion May 4th 2017, 10:28 am

Also, as another note, I'm 100% sure there is already a tutorial for this function in the Tricks and Tips section.
Draxion
Draxion
Helper
Helper

Male Posts : 2518
Reputation : 321
Language : English
Location : USA

https://www.talesoftellene.com/

Back to top Go down

Replacing "in a watched topic" with the topic's name in the toolbar Empty Re: Replacing "in a watched topic" with the topic's name in the toolbar

Post by skouliki May 4th 2017, 10:31 am

Draxion wrote:Also, as another note, I'm 100% sure there is already a tutorial for this function in the Tricks and Tips section.
i believe you mean this https://help.forumotion.com/t137560-title-of-watched-topics-in-notifications?highlight=watched
skouliki
skouliki
Manager
Manager

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

http://iconskouliki.forumgreek.com

Back to top Go down

Replacing "in a watched topic" with the topic's name in the toolbar Empty Re: Replacing "in a watched topic" with the topic's name in the toolbar

Post by Draxion May 4th 2017, 10:32 am

Yes, I believe so.
Draxion
Draxion
Helper
Helper

Male Posts : 2518
Reputation : 321
Language : English
Location : USA

https://www.talesoftellene.com/

Back to top Go down

Replacing "in a watched topic" with the topic's name in the toolbar Empty Re: Replacing "in a watched topic" with the topic's name in the toolbar

Post by Guest May 4th 2017, 3:50 pm

I haven't noticed that tutorial. A mod should send this to trash, as that tutorial is better.
avatar
Guest
Guest


Back to top Go down

Replacing "in a watched topic" with the topic's name in the toolbar Empty Re: Replacing "in a watched topic" with the topic's name in the toolbar

Post by SLGray May 4th 2017, 8:21 pm

Since to the garbage as requested.


Replacing "in a watched topic" with the topic's name in the toolbar Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51489
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

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