Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: damacguy - tammikuu 07, 2006, 02:28:52 AP

Otsikko: Edit memberlist.php to show last login
Kirjoitti: damacguy - tammikuu 07, 2006, 02:28:52 AP
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?
Otsikko: Re: Edit memberlist.php to show last login
Kirjoitti: damacguy - tammikuu 10, 2006, 08:22:03 IP
Anyone?  :'(
Otsikko: Re: Edit memberlist.php to show last login
Kirjoitti: damacguy - tammikuu 12, 2006, 02:50:30 IP
This has to be doable. I just don't know the formatting of the php code to get it to work.
Otsikko: Re: Edit memberlist.php to show last login
Kirjoitti: H - tammikuu 12, 2006, 03:24:51 IP
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!)
Otsikko: Re: Edit memberlist.php to show last login
Kirjoitti: damacguy - tammikuu 16, 2006, 04:05:23 IP
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?
Otsikko: Re: Edit memberlist.php to show last login
Kirjoitti: Skipdawg - tammikuu 16, 2006, 04:35:57 IP
KEWL idea!  ;)

I'd like to see the option of both there.
Otsikko: Re: Edit memberlist.php to show last login
Kirjoitti: damacguy - tammikuu 21, 2006, 08:19:00 IP
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>