News:

Wondering if this will always be free?  See why free is better.

Main Menu

Edit memberlist.php to show last login

Started by damacguy, January 07, 2006, 02:28:52 AM

Previous topic - Next topic

damacguy

The membership director for my user group would like to have the memberlist page changed so that instead of showing date registered, it shows date last logged in.

I'm totally new to php, but I've figured the file is memberlist.php, and the array to change is...
'registered' => array(
'label' => $txt[233]


I've also looked in profile.template.php to see if I could borrow code from the "last active" line there. But the code is different. I thought that replaceing the Registered section with this would work...
'lastLoggedIn' => array(
'label' => 'Last Active'
),


But it seems to continue to show the date registered.
:'(

Suggestions?


damacguy

This has to be doable. I just don't know the formatting of the php code to get it to work.

H

I don't know either but it shouldn't be much more difficult than copying the relevant code from the profile page (which has the last active on it!)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

damacguy

Well, I can edit my memberlist.tempate.php to show the last login of members. But when I try and sort on that column I get the following error with my memberlist.php file...
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 50' at line 7
File: /Library/WebServer/Documents/smf/Sources/Memberlist.php
Line: 268


Suggestions?

Skipdawg

KEWL idea!  ;)

I'd like to see the option of both there.
Skipdawg's Community

Powered by SMF 1.1.3

damacguy

Can anyone help me with the php syntax causing my error. The line (268) in memberlist.php reads as such...
LIMIT $_REQUEST[start], $modSettings[defaultMaxMembers]", __FILE__, __LINE__);

FWIW, the code I used in memberlist.template.php was to replace line 124 with...
<td class="windowbg" align="left">', $member['last_login'], '</td>

Advertisement: