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 online

View previous topic View next topic Go down

Solved Last online

Post by HoeGy48 on August 5th 2017, 9:29 am

Hello,
I wondered if it's possible to add a section in the profile tab where you are able to see a membe it's last login to the website. I know it is in the statistics tab but i would like to display it in the profile tab?

Regards.
avatar
HoeGy48
Forumember

Posts : 63
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Solved Re: Last online

Post by Justice™ on August 5th 2017, 9:53 am

Yes it's possible. I'll need your forum's address.
avatar
Justice™
Forumember

Posts : 491
Reputation : 116
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Last online

Post by HoeGy48 on August 5th 2017, 9:59 am

avatar
HoeGy48
Forumember

Posts : 63
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Solved Re: Last online

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

Hi,

Add this JS code with placement on all pages:
Code:
$(function(){
/*Code by Wolfuryo. Usage of this code without this notice in place will result in the destruction of the website using it*/
if(!/u\d+$/.test(location.pathname)) return;
$.get(location.pathname+"stats", function(data){
data=data.match(/<li><label>Last visit :<\/label>.+<\/li>/);
var elem=$("#cp-main>h1");
if(!elem) return;
elem.after(data);
})
});
avatar
Justice™
Forumember

Posts : 491
Reputation : 116
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Last online

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

I've added the code, but i can't find any place where it has been put.

Is it possible to get it above the avatar?
avatar
HoeGy48
Forumember

Posts : 63
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Solved Re: Last online

Post by Justice™ on August 5th 2017, 1:03 pm

I made a mistake in the code. Use this one:
Code:
$(function(){
/*Code by Wolfuryo. Usage of this code without this notice in place will result in the destruction of the website using it*/
if(!/u\d+$/.test(location.pathname)) return;
$.get(location.pathname+"stats", function(data){
data=data.match(/<li><label>Last visit :<\/label>.+<\/li>/)[0].replace(/<li>|<label>|<\/label>|<\/li>/g, "");
var elem=$("#cp-main>h1");
if(!elem) return;
elem.append(data);
})
});

The information should appear next to the All about name thing.
avatar
Justice™
Forumember

Posts : 491
Reputation : 116
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Last online

Post by HoeGy48 on August 5th 2017, 2:00 pm

Hello,

It's displaying in the profile field now. Thanks!
Got one more little question. Is it possible to alight it on the right. Because it's stuck against the All info about text now 😊
avatar
HoeGy48
Forumember

Posts : 63
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Solved Re: Last online

Post by Justice™ on August 5th 2017, 2:05 pm

Yes, it's possible. Replace the JS code with this:
Code:
        $(function(){
        /*Code by Wolfuryo. Usage of this code without this notice in place will result in the destruction of the website using it*/
        if(!/u\d+$/.test(location.pathname)) return;
        $.get(location.pathname+"stats", function(data){
        data=data.match(/<li><label>Last visit :<\/label>.+<\/li>/)[0].replace(/<li>|<label>|<\/label>|<\/li>/g, "");
        var elem=$("#cp-main>h1");
        if(!elem) return;
        elem.append("<div style='float:right'>"+data+"</div>");
        })
        });
avatar
Justice™
Forumember

Posts : 491
Reputation : 116
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: Last online

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

That works perfectly! Thanks a lot Wolfuryo!
avatar
HoeGy48
Forumember

Posts : 63
Reputation : 1
Language : Dutch

http://www.oriongaming.forumotion.com

Back to top Go down

Solved Re: Last online

Post by Draxion on August 5th 2017, 4:27 pm

Thank you for your help, @Wolfuryo!
Problem solved & topic archived.
Please read our forum rules: ESF General Rules


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 : 1548
Reputation : 200
Language : English
Location : USA

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