The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

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

View previous topic View next topic Go down

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

Post by Justice™ on 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
Justice™
Forumember

Posts : 517
Reputation : 119
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

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

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

not working:


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

Posts : 41
Reputation : 5
Language : EN FR AR TM
Location : Algeria

http://odros.yoo7.com

Back to top Go down

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

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

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

avatar
skouliki
Graphic Designer
Graphic Designer

Female Posts : 3012
Reputation : 471
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

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

Post by Draxion on 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.
avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1813
Reputation : 227
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

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

Post by skouliki on 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 http://help.forumotion.com/t137560-title-of-watched-topics-in-notifications?highlight=watched
avatar
skouliki
Graphic Designer
Graphic Designer

Female Posts : 3012
Reputation : 471
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

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

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

Yes, I believe so.


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1813
Reputation : 227
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

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

Post by Justice™ on 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
Justice™
Forumember

Posts : 517
Reputation : 119
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

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

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

Since to the garbage as requested.


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

avatar
SLGray
Administrator
Administrator

Male Posts : 40523
Reputation : 2733
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


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