Last visit Profile on hover

Go down

Last visit Profile on hover

Post by HoeGy48 on Sat Aug 12, 2017 3: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 : 71
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Re: Last visit Profile on hover

Post by Justice™ on Sat Aug 12, 2017 10:23 am

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 : 536
Reputation : 124
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Re: Last visit Profile on hover

Post by HoeGy48 on Sat Aug 12, 2017 10:54 am

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

Posts : 71
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Re: Last visit Profile on hover

Post by Justice™ on Sat Aug 12, 2017 11:20 am

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 : 536
Reputation : 124
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Re: Last visit Profile on hover

Post by HoeGy48 on Sat Aug 12, 2017 4:45 pm

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

Posts : 71
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Re: Last visit Profile on hover

Post by HoeGy48 on Sun Aug 13, 2017 11:28 am

bump
avatar
HoeGy48
Forumember

Posts : 71
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Re: Last visit Profile on hover

Post by SLGray on Sun Aug 13, 2017 2: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 : 43696
Reputation : 3108
Language : English
Location : United States

http://fmthemesdesignteam.forumotion.com/

Back to top Go down

Re: Last visit Profile on hover

Post by Justice™ on Mon Aug 14, 2017 9:09 am

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 : 536
Reputation : 124
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Re: Last visit Profile on hover

Post by HoeGy48 on Mon Aug 14, 2017 9:28 am

This si what i get now.


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

Posts : 71
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Re: Last visit Profile on hover

Post by Justice™ on Mon Aug 14, 2017 9:46 am

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 : 536
Reputation : 124
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Re: Last visit Profile on hover

Post by HoeGy48 on Mon Aug 14, 2017 10:33 am

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

Posts : 71
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Back to top


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