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.
The forum of the forums
4 posters

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

    avatar
    Guest
    Guest


    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.
    amghidh
    amghidh
    Forumember


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

    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
    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15391
    Reputation : 1709
    Language : English,Greek
    Location : Greece

    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

    Draxion
    Draxion
    Helper
    Helper


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

    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.
    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15391
    Reputation : 1709
    Language : English,Greek
    Location : Greece

    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

    Draxion
    Draxion
    Helper
    Helper


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

    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.
    avatar
    Guest
    Guest


    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.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3523
    Language : English
    Location : United States

    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.

      Current date/time is November 11th 2024, 2:41 pm