Today's Active topic to replace View Topics since last visit Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
3 posters

    Today's Active topic to replace View Topics since last visit

    felicity4us2
    felicity4us2
    Forumember


    Posts : 345
    Reputation : 9
    Language : english

    In progress Today's Active topic to replace View Topics since last visit

    Post by felicity4us2 March 3rd 2016, 12:46 am

    Hi,
    www.igid.com/forum

    I would like 'today's active topic' to replace 'view topics since last visit' on the top of our page -

    Can you all help me do this or at least to add 'today's active topic' to the top of the page.

    Today's Active topic to replace View Topics since last visit Statis10


    Today's Active topic to replace View Topics since last visit Statis11

    Thank you so very much.
    Sir Chivas™
    Sir Chivas™
    Helper
    Helper


    Male Posts : 6983
    Reputation : 457
    Language : EN, FR, ES
    Location : || CSS || HTML || Graphics Designs || Support ||

    In progress Re: Today's Active topic to replace View Topics since last visit

    Post by Sir Chivas™ March 15th 2016, 3:28 pm

    Hi,

    Can you provide your index_body template: ACP >> Display >> Templates >> General >> Index_body


    Thank you,
    Sir Chivas.
    felicity4us2
    felicity4us2
    Forumember


    Posts : 345
    Reputation : 9
    Language : english

    In progress Re: Today's Active topic to replace View Topics since last visit

    Post by felicity4us2 March 18th 2016, 4:11 pm

    I don't know about that - we use invision and don't think we have it - do we?

    But, I would appreciate you help. One of our admins used this code:

    Code:
    window.addEventListener("load",function(){var a=document.getElementById('userlinks');if(a){a=a.getElementsByTagName('a')[0];
    a.href='search?search_id=activetopics';
    a.innerHTML="Today's active topics";
    }},false);

    It works well, except it has shown up in the login field here:

    Today's Active topic to replace View Topics since last visit Login10

    I know that she will be back, but could use your help now. Also, this might be great for others to know.

    Thanks ahead of time for your help.
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13246
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Today's Active topic to replace View Topics since last visit

    Post by Ange Tuteur March 18th 2016, 7:03 pm

    Hi,

    Replace your current script with this :
    Code:
    $(function() {
      var userlinks = document.getElementById('userlinks');
     
      if (_userdata.session_logged_in && userlinks) {
        for (var a = userlinks.getElementsByTagName('A'), i = 0, j = a.length; i < j; i++) {
          if (/\/search\?search_id=newposts/.test(a[i].href)) {
            a[i].href = '/search?search_id=activetopics';
            a[i].innerHTML = 'Today\'s active topics';
            break;
          }
        }
      }
    });

    It should loop through all the links that are children of
    Code:
    #userlinks
    . If one of the links matches the specified href attribute ( /search?search_id=newposts ) it'll be changed into the one you want.
    felicity4us2
    felicity4us2
    Forumember


    Posts : 345
    Reputation : 9
    Language : english

    In progress Re: Today's Active topic to replace View Topics since last visit

    Post by felicity4us2 March 25th 2016, 8:13 pm

    It didn't work, but our forum is still loading changes.