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.

Last visit Profile on hover

View previous topic View next topic Go down

Last visit Profile on hover

Post by HoeGy48 on August 12th 2017, 10:06 am

Hello,

I've recently edded the profile on hover feature. explained here: http://fmdesign.forumotion.com/t404p50-display-a-preview-of-the-user-profile-on-hover
But i would like to add the last visit time in it as well.
Does anyone know which chanbge i've to make to do so?

kind regards
avatar
HoeGy48
Forumember

Posts : 63
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Re: Last visit Profile on hover

Post by Justice™ on August 12th 2017, 5:23 pm

Hello,

Remove the code from that tutorial from your forum. I made a code that should do what you want but I need to test it on your forum.
avatar
Justice™
Forumember

Posts : 489
Reputation : 115
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Re: Last visit Profile on hover

Post by HoeGy48 on August 12th 2017, 5:54 pm

sure, could you send me the code?
avatar
HoeGy48
Forumember

Posts : 63
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Re: Last visit Profile on hover

Post by Justice™ on August 12th 2017, 6:20 pm

You didn't understood what I said. I have a code that is almost complete but I have to test it on your forum. I'll test it myself through the browser's console(the console is a place that allows one to run javascript on aony page). The code by Ange and the one by me are messing up with each other and I can't see for sure if my code is ok or not. That's way I asked you to remove Ange's code.
avatar
Justice™
Forumember

Posts : 489
Reputation : 115
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Re: Last visit Profile on hover

Post by HoeGy48 on August 12th 2017, 11:45 pm

aah sorry i indeed misunderstood, i'll remove the code now. my link, www.orion-gaming.com
avatar
HoeGy48
Forumember

Posts : 63
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Re: Last visit Profile on hover

Post by HoeGy48 on August 13th 2017, 6:28 pm

bump
avatar
HoeGy48
Forumember

Posts : 63
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Re: Last visit Profile on hover

Post by SLGray on August 13th 2017, 9:56 pm

@HoeGy48 wrote:aah sorry i indeed misunderstood, i'll remove the code now. my link, www.orion-gaming.com

@HoeGy48 wrote:bump
Second Reminder:
Please don't double post. Your posts need to be separated by 24 hours before bumping. Please use the edit button, instead!

Please read our forum rules: ESF General Rules


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

avatar
SLGray
Administrator
Administrator

Male Posts : 39639
Reputation : 2666
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

Re: Last visit Profile on hover

Post by Justice™ on August 14th 2017, 4:09 pm

Hi again,

See if this code works:
Code:
        $(function() {
          var links = $('a[href^="/u"]').filter(function() {
            if (this.firstChild && this.firstChild.tagName) {
              if (this.firstChild.tagName != 'IMG') {
                return this;
              }
            } else {
              return this;
            }
          }),
           
          usersinfo = {};
       
          links.tooltipster && links.not('.mentiontag, .tooltipstered').filter(function() {
            if (!$(this).closest('#tabs')[0]) {
              return this;
            }
          }).tooltipster({
            animation : 'fade',
            interactive : true,
            contentAsHTML : true,
            minWidth : 300,
            maxWidth : 300,
            delay : 500,
            arrowColor : "#EEE",
            autoClose : true,
            content : 'Loading...',
            functionBefore: function(origin, continueTooltip) {
              continueTooltip();
       
              var userid = $(this).attr('href').replace(/.*?\/u(\d+).*/, '$1');
              if (origin.data('ajax') !== 'cached') {
                if (usersinfo[userid] != undefined) {
                  origin.tooltipster('content', usersinfo[userid]).data('ajax', 'cached');
                } else {
                  $.ajax({
                    type: 'GET',
                    url: "/ajax/index.php",
                    dataType: "html",
                 
                    data: {
                      f: "m",
                      user_id: userid
                    },
       
                    success: function(html) {
$.get("/u"+userid+"stats", function(data){
data=$("li>label:contains('Last visit :')", data).first().parent().html();
html+=data;
                      usersinfo[userid] = html;
                      origin.tooltipster('content', html).data('ajax', 'cached');
});
                    }
                  });
                }
              }
            }
          });
        });
avatar
Justice™
Forumember

Posts : 489
Reputation : 115
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Re: Last visit Profile on hover

Post by HoeGy48 on August 14th 2017, 4:28 pm

This si what i get now.


But i would like it to display beneath "friends" in the same style.
avatar
HoeGy48
Forumember

Posts : 63
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Re: Last visit Profile on hover

Post by Justice™ on August 14th 2017, 4:46 pm

Replace the code with:
Code:
                $(function() {
                  var links = $('a[href^="/u"]').filter(function() {
                    if (this.firstChild && this.firstChild.tagName) {
                      if (this.firstChild.tagName != 'IMG') {
                        return this;
                      }
                    } else {
                      return this;
                    }
                  }),
                 
                  usersinfo = {};
             
                  links.tooltipster && links.not('.mentiontag, .tooltipstered').filter(function() {
                    if (!$(this).closest('#tabs')[0]) {
                      return this;
                    }
                  }).tooltipster({
                    animation : 'fade',
                    interactive : true,
                    contentAsHTML : true,
                    minWidth : 300,
                    maxWidth : 300,
                    delay : 500,
                    arrowColor : "#EEE",
                    autoClose : true,
                    content : 'Loading...',
                    functionBefore: function(origin, continueTooltip) {
                      continueTooltip();
             
                      var userid = $(this).attr('href').replace(/.*?\/u(\d+).*/, '$1');
                      if (origin.data('ajax') !== 'cached') {
                        if (usersinfo[userid] != undefined) {
                          origin.tooltipster('content', usersinfo[userid]).data('ajax', 'cached');
                        } else {
                          $.ajax({
                            type: 'GET',
                            url: "/ajax/index.php",
                            dataType: "html",
                       
                            data: {
                              f: "m",
                              user_id: userid
                            },
             
                            success: function(html) {
        $.get("/u"+userid+"stats", function(data){
        data=data.split("</ul></div><div").join($("li>label:contains('Last visit :')", data).first().parent().html()+"</ul></div><div");
        html+=data;
                              usersinfo[userid] = html;
                              origin.tooltipster('content', html).data('ajax', 'cached');
        });
                            }
                          });
                        }
                      }
                    }
                  });
                });
avatar
Justice™
Forumember

Posts : 489
Reputation : 115
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Re: Last visit Profile on hover

Post by HoeGy48 on August 14th 2017, 5:33 pm

when i hover over it, a blank tab appearce.
avatar
HoeGy48
Forumember

Posts : 63
Reputation : 1
Language : Dutch

http://www.oriongaming.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