Last LOGIN ??

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
hexenez
Registered User
Posts: 3
Joined: Tue Feb 06, 2007 11:40 am

Last LOGIN ??

Post by hexenez » Tue Feb 06, 2007 11:46 am

Hi !

I'm trying to change something in the "Who is Online" box.

This box displays the last registered user. {NEWEST_USER}

I'd like to display the "last logged in" user.

Is it possible ?


Thanks a lot,
Hex

User avatar
Noobarmy
Registered User
Posts: 2388
Joined: Tue Apr 04, 2006 6:15 pm
Location: London
Contact:

Post by Noobarmy » Tue Feb 06, 2007 5:04 pm

not the best way to do it but:

in includes/functions.php find

Code: Select all

		case 'newestuser':
			$sql = "SELECT user_id, username
				FROM " . USERS_TABLE . "
				WHERE user_id <> " . ANONYMOUS . "
				ORDER BY user_id DESC
				LIMIT 1";
			break;
replace with

Code: Select all

		case 'newestuser':
			$sql = "SELECT user_id, username
				FROM " . USERS_TABLE . "
				WHERE user_id <> " . ANONYMOUS . "
				ORDER BY user_lastvisit DESC
				LIMIT 1";
			break;
you'ld need to change the lang var that says its the newest user though.
Image

hexenez
Registered User
Posts: 3
Joined: Tue Feb 06, 2007 11:40 am

Post by hexenez » Wed Feb 07, 2007 12:30 pm

Thank you !!!

Yes, it's maybe not the best way, but it works perfectly !

Thanks a lot !
Hex

PS: by the way, i sometimes try to "custom" my phpBB forum. So, i would like to know if there is a place where i can find all the names (and description) of vars in phpBBforums.

Thnks

PaNtheris
Registered User
Posts: 19
Joined: Thu Nov 30, 2006 10:41 am

Post by PaNtheris » Wed Feb 07, 2007 1:33 pm

Can you post a link with example how that last login looks? :)

User avatar
Noobarmy
Registered User
Posts: 2388
Joined: Tue Apr 04, 2006 6:15 pm
Location: London
Contact:

Post by Noobarmy » Wed Feb 07, 2007 4:41 pm

it looks like a piece of text that says last user to login : <username> :P
hexenez there are various websites that talk about modding and have a lot of resources on phpBB. the database stuff is all documented at http://phpbbdoctor.com the vars themselves i dont really know anywhere that documents them. best option: look through the code yourself :)
Image

hexenez
Registered User
Posts: 3
Joined: Tue Feb 06, 2007 11:40 am

Post by hexenez » Thu Feb 08, 2007 7:04 am

lol, thanks a lot Noobarmy.

To see how it looks like: Here

Locked

Return to “2.0.x Support Forum”