Last Active On MemberList

Started by Nathaniel, August 09, 2008, 06:02:03 AM

Previous topic - Next topic

Nathaniel

Link to Mod

Last Active On MemberList 1.4 by Nathaniel
Overview

This mod adds a "Last Active" column to the MemberList, allowing you to view the last time that your members were active. It also allows you to sort the MemberList by the last active time of every member, meaning that you can view your members in order of when they were last active.

SMF Version Support
Official support for SMF 2 RC4 and above only. You can use the 1.02 package for SMF 1.1.x and versions of SMF 2 below SMF 2 RC2. Use the 1.03 package for SMF 2 RC2 and SMF 2 RC3.

Donate
If this mod has helped you, then feel free to support the developer by Donating. Any amount of money is welcome.

Themes/Templates
This mod only edits a single template file, the 'Memberlist.template.php' file which is not used in most custom themes. If your custom theme doesn't contain this file then it should work automatically. Otherwise refer to the information below to make this mod work in your custom theme.

Default template install problems
If you want to install this mod for a custom theme (that has its own 'Memberlist.template.php' file), then find the relevant edits in this section for your version of SMF.

If you are having problem with this mod installing for the default theme with SMF 1.1.x and you are only receiving errors for the 'Memberlist.template.php edit, then you can install the mod normally and then perform the steps set out in the 'Troubleshooting' section for the default theme. Its likely that you have installed another mod which edits the same parts of that template file.

Custom theme edit for SMF 2 RC4 and above
Code ("Find (Memberlist.template.php - curve themes)") Select
               <td class="windowbg lefttext">', $member['registered_date'], '</td>

Code ("Replace") Select
                <td class="windowbg lefttext">', $member['registered_date'], '</td>
               <td class="windowbg lefttext">', $member['last_login'], '</td>


Code ("Find (Memberlist.template.php - core themes)") Select
               <td align="center" class="windowbg">', $member['registered_date'], '</td>

Code ("Replace") Select
               <td align="center" class="windowbg">', $member['registered_date'], '</td>
               <td align="center" class="windowbg">', $member['last_login'], '</td>


Custom theme edit for SMF 2 RC2 and SMF 2 RC3
Code ("Find (Memberlist.template.php - curve themes)") Select
               <td class="windowbg" align="', $context['right_to_left'] ? 'right' : 'left', '">', $member['registered_date'], '</td>

Code ("Replace") Select
               <td class="windowbg" align="', $context['right_to_left'] ? 'right' : 'left', '">', $member['registered_date'], '</td>
               <td class="windowbg" align="', $context['right_to_left'] ? 'right' : 'left', '">', $member['last_login'], '</td>


Code ("Find (Memberlist.template.php - core themes)") Select
               <td align="center" class="windowbg">', $member['registered_date'], '</td>

Code ("Replace") Select
               <td align="center" class="windowbg">', $member['registered_date'], '</td>
               <td align="center" class="windowbg">', $member['last_login'], '</td>


Custom theme edit for SMF 1.1.x and SMF 2 (only versions below SMF 2 RC2)
Code ("Find (Memberlist.template.php)") Select
            <td class="windowbg" align="left">', $member['registered_date'], '</td>

Code ("Replace") Select
            <td class="windowbg" align="left">', $member['registered_date'], '</td>
            <td class="windowbg" align="left">', $member['last_login'], '</td>


Custom theme edit For SMF 1.1.x only
Code ("Find all occurrences  (Memberlist.template.php)") Select
colspan="12"

Code ("Replace") Select
colspan="13"

Troubleshooting (SMF 1.1.x only)
If the final edit for SMF 1.1.x failed, the one that changes the 'colspan' value, then its possible that you have already installed another mod that adds columns to this list. If that is the case, then you can try to find all cases of this code, where x is greater than 12.
colspan="x"

Replace with this code.
colspan="x+1"

So if the code was like this.
colspan="13"

You would change it to this.
colspan="14"

Remember that you will have to perform that edit four times in the 'Memberlist.template.php' file.

If you need any help with edits for custom themes, then you can ask for it in the support topic for this mod, remember that you will have to post the 'Memberlist.template.php' file from your custom theme, otherwise I will not be able to perform the edits.

Version changes
v1.4 - 5 November 2010
Updated for SMF 2 RC4.

v1.03 - 27 May 2010
Changed package info to work with SMF 2 RC3.
Removed official support for SMF versions below SMF 2 RC2.

v1.02 - 19 November 2009
Added support for SMF 2 RC2 and curve. Also updated mod description.

v1.01
Added support for SMF 1.1.6 and SMF 2 Beta 4.0.

v1.0 - 07 August 2008
Original Mod release.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

edi67

CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Kimmie

#2
this is already a default feature on the admins member list. (column heading is "Last Online")

DSollick

When installing on SMF 1.1.4 and 1.1.5, it glitches the Members page [It said that there was an error while trying to modify './Themes/default/Memberlist.template.php'], which I'm assuming is the issue I'm seeing in the following image.  Uninstalling the package does not fix the glitch :(

Nathaniel

#4
@DSollick,
The error you are experiencing only occurs if you have installed another mod which adds something to the memberlist page. It happens because the title of the list has a property called colspan, which defines how many columns that it takes up, when you add new columns with a mod and multiple mods try to do this, then the title won't cover all of the columns.

To fix this this problem you can try to find all instances (there should be exactly four that you need to edit) in that file with the code : colspan="

And add one to the number that you find afterwards, but be careful. Not all of them need to be changed, only the ones that have a value of about 12, 13 or 14. I can do the edits for you, if you post your Memberlist.template.php file.

Please note, this is not a bug with the mod, if anything its a bug with SMF that makes it harder for mods to be compatible, its fixed in SMF 2 Beta.... ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

DSollick

#5
Thanks for explaining that  :D

Seeing as though I don't trust myself to do the edits myself, I've attached by Memberlist.template.php file.  If you would be so kind as to tell me what line-number the modifications have to be done on, so I can look for myself and edit it if I run into this problem again, that would be awesome :)

Nathaniel

Okay, the issue was being caused by a compatiblity problem between the "Gender on the Memberlist" mod and this mod. Basically, they both want to add their own column to the Member List page and this causes errors with SMF 1.1.5 (not with SMF 2 Beta). I have fixed this for your 'Memberlist.template.php' file, these edits appeared on lines 52, 64, 137 and 143 for your file.

I replaced this code:
colspan="13"

With this code:
colspan="14"

If you have to add another column then you could change that value to 15, or if you have to remove one then you could change it to 13. ;)

I have also re-attached your 'Memberlist.template.php' file so that you can use it if you wish.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

DSollick


Simplemachines Cowboy

And it's even sortable.
Nice one.
My SMF forum: The Open Range

Maliante

i use a dilber mc theme and this theme not have Memberlist.template.php is possible this mod work in this theme or only in default??

Maliante




Nathaniel

#10
@Maliante,
It should work automatically for your theme, as long as it doesn't have its own Memberlist.template.php file.

Update:
I have now updated the Downloads page so that it includes instructions for getting this mod to work with custom themes, and the default theme.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Nathaniel

Version 1.01
Added support for SMF 1.1.6 and SMF 2 Beta 4.0.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

David2376

I have got this mod to properly work BUT I am not showing "Last Login" in the column heading. Is there a way to correct this?

Nathaniel

I am not sure what you mean by 'correct', that is an intended part of this mod. Although you can change the 'Last Active' language string to 'Last Login', with the edit below.

Find this code ('Memberlist.php'):
'label' => $txt['lastLoggedIn']

Replace with this code:
'label' => 'Last Login'
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Jhez

New installation of SMF 1.1.7 yesterday, using existing database. After installing SMF, I have applied a number of very useful packages - lots of love to all of you who make them. After each package, I have carefully gone back to the forum to check that it still worked as intended, not really being interested in having to do another reinstall.

I now find myself with one bug. When I go to my Member list, then use the Member List Position Filter to get only a sublist of members in a specific group, I get an error when I try to sort that group by the field Last Active (from the package Last Active on Memberlist).

The issue does not appear when I sort by any other column visible.




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, 30' at line 6
File: /customers/jhez.dk/jhez.dk/httpd.www/eve/dgaf/forum/Sources/Memberlist.php
Line: 662

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.7, while your database is at version 1.1.5. The above error might possibly go away if you execute the latest version of upgrade.php.




I so appreciate both features. Can someone get these two excellent persons to work together on making their mods accept each other? Would be immensely useful.

OK, and while this is a bugreport, I do want to recommend the Auto Email Inactive Users feature. As an admin, these three packages has really made my life much easier.

:)
Jhez




My installed mods are

   Mod Name       Version     
1.    Select Admin for Notifications    1.2
2.    RemoveQuotedImages    1.0
3.    Simple Award System    2.0.0.4b
4.    Table From CSV    1.30
5.    Auto Email Inactive Users    1.7
6.    Order Stickied Topics    1.01
7.    Default Membergroup on Registration    1.1
8.    Ellow yellow christmas edition smiley set    1.1.0.1
9.    SMF Chat - by Joseph Szenasi    1.0
10.    Group Moderators    1.4
11.    Manage Members Membergroups    1.0.0
12.    Registration redirection    0.1
13.    Display Age and Location next to posts    1.0
14.    Last Active On MemberList    1.01
15.    Member List Position Filter    1.1.0
16.    Registration - Show Gender mod    1.0.0
17.    No More Ugly Avatar Scrollbars    1.0
18.    AvatarSelect    1.1.2
19.    EmailValidator    1.0
20.    Force Topic Read On Login Mod    1.0
21.    Member Awards    1.0.2
22.    RateThatTopic    1.0

Avatar Packages

   Mod Name    Version    
1.    Sci-Fi Avatars    1.0
2.    Country Flags

Nathaniel

@Jhez,
I am only answering your questions that relate to this mod, any other questions can be asked separately in the relevant boards on this forum.

Fixing compatibility issues with the "Member List Position Filter" Mod:
Find the second occurrence of this code from your 'Memberlist.php' file:
      'registered' => array(
         'down' => 'mem.dateRegistered ASC',
         'up' => 'mem.dateRegistered DESC'
      ),


Replace with this code:
      'registered' => array(
         'down' => 'mem.dateRegistered ASC',
         'up' => 'mem.dateRegistered DESC'
      ),
      //   Add the last online column, for the Last Active On MemberList Mod.
      'last_active' => array(
         'down' => 'mem.lastLogin DESC',
         'up' => 'mem.lastLogin ASC'
      ),


I won't be updating this mod to fix this compatibility issue, as its an issue with the other mod adding a new array for the memberlist sorting methods which causes the error (instead of making use of the current/normal list).

@Everyone,
I have tested the "Last Active On MemberList" mod for SMF 1.1.7, and updated the mod site page accordingly.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Morp

Could you make this compatible with 1.0.10?

Nathaniel

Quote from: Morp on July 20, 2009, 06:22:24 PM
Could you make this compatible with 1.0.10?

I have no intention of making this mod compatible with the SMF 1.0.x line, although I think you are referring to SMF 1.1.10. While I haven't tested this mod for SMF 1.1.10 it should work with it, as there weren't many changes (only security fixes I believe).
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Morp

#18
Quote from: Nathaniel on July 21, 2009, 02:24:20 AM
Quote from: Morp on July 20, 2009, 06:22:24 PM
Could you make this compatible with 1.0.10?

I have no intention of making this mod compatible with the SMF 1.0.x line, although I think you are referring to SMF 1.1.10. While I haven't tested this mod for SMF 1.1.10 it should work with it, as there weren't many changes (only security fixes I believe).

Yes I meant the 1.1.10, sorry was a bit tired yesterday

__________________

I hope you don't mind.. I made the auto installer compatible with the new version.
Just edit the package-info.xml
you had it compatible with 1.1.4-1.99.99 the new version is at 1.1.1 so you have to lower the 1.1.4 to 1.1.1 or 1.1.10

Cheers

ohioreef

I tried installing this on 1.1.10 and I get an error stating the package is either corrupt or incompatible with my version of SMF.

ohioreef

I see the issue Morp mentioned, but how do I go about making that change in the package-info.xml file so I can install on 1.1.10?

Nathaniel

Version 1.02:
Added support for SMF 2 RC2 and curve. Also updated mod description.

Quote from: ohioreef on October 15, 2009, 10:35:20 PM
I see the issue Morp mentioned, but how do I go about making that change in the package-info.xml file so I can install on 1.1.10?
The issue with the installation for this mod and 1.1.10 was a bug with the SMF package manager. The newest version has a workaround for this issue.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

ohioreef

Thanks. I ended up getting it installed by dropping back to 1.1.09, installing this mod and then "reupgrading" my SMF.

thezkitten

i love this mod, but i was having a buttload of issues!
the last active was really long, too long to fit comfortable in the memberlist, and i had sql errors when i tried to sort by date, this may be due to all the mods i've done to my members list (lots of custom tweeking) and i have a pile of mods as well.
so, i tweeked it to the specs i liked myself!

if anyone else had the same problems i did, you may want to try this (image of final result attached)

With this way, no need to add and type of thing to load,
and your date format will be like this  "2009-11-16"
instead of like this "November 19, 2009, 12:56:34 AM"
and sort without any sql errors


./Sources/Memberlist.php

Find:
'registered' => array(
'label' => $txt[233]
),

Add After:
//last active thingy
'last_login' => array(
'label' => $txt[12399221]
),

      

Find:
'registered' => array(
'down' => 'mem.dateRegistered ASC',
'up' => 'mem.dateRegistered DESC'
),

Add After:
//last acative thingy
'last_login' => array(
'down' => 'mem.lastLogin ASC',
'up' => 'mem.lastLogin DESC'
),

now, i added an extra definition to the language file,
./Themes/default/languages/index.english.php
$txt[12399221] = 'Last Active';
to make it easier on yourself, you can just define it in this file if you want by changing the 'label'
'label' => 'Your Words Here'




-----------------------
      
./Themes/default/Memberlist.template.php

Find:
<td class="windowbg" align="left">', $member['registered_date'], '</td>

Add After:
//last active thingy
<td class="windowbg2" align="left">', $member['last_login_date'], '</td>


If this is your only memberlist mod, in memberlist.template.phpjust change all
colspan="12"
to
colspan="13"

if this is one of many, just add one to your colspan. (there's only 4 you need to change)
http://zkitten.com  :|:  http://chaoticlycreative.com  :|:  http://etsysteamteam.com [nofollow]

Lots O Smileys not working for you? This may be it!  Also, Need to Show Custom Fields in Memberlist? this could help! (for 1.1.x)

Nathaniel

v1.03 - 27 May 2010
Changed package info to work with SMF 2 RC3.
Removed official support for SMF versions below SMF 2 RC2.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

FireDitto

Will this be made RC4 friendly??
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Nathaniel

v1.4 - 5 November 2010
Updated for SMF 2 RC4.

Quote from: FireDitto on November 05, 2010, 06:17:07 AM
Will this be made RC4 friendly??

Yes. It is now. :D
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

FireDitto

Thank you! This is a very useful mod =D
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

FireDitto

Ah, you called the "Last Active" file "Last Post".

It installed the "Last Active", but was a little confusing trying to find the right file to upload.

=)
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Nathaniel

Apologies for the confusion caused, I updated a lot of mods last night, looks like I got that name wrong for that package. :S

Its the right mod though, which is a good. ;) I've updated it so that the package has the correct name.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

FireDitto

Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

GhostHunter

#31
This is a great mod, thanks to Nathaniel for creating it!

I am having a persistent problem that I am unable to solve. I get the following error when I try to sort the memberlist by the Last Active column:

DATABASE ERROR

Unknown column 'mem.last_login' in 'order clause'
File: /public_html/smf/Sources/Memberlist.php
Line: 360

I am using SMF 1.1.13, DilberMC theme. There are no other mods that alter the memberlist installed (that I know of). The mod works fine when sorting by other columns, and patches specific to 1.1.xx have been done. I have tried the tweaks posted by thezkitten in reply #23 of this thread, no joy.

Any clues?

Made the following changes:

./Sources/Memberlist.php

Find:
      'registered' => array(
         'label' => $txt['date_registered']
      ),

Replace with:
      'registered' => array(
         'label' => $txt[233]
      ),

(Fixed missing "Date Registered" text in column header)

./Themes/default/languages/index.english.php
Find:
$txt[233] = 'Date Registered';
Add after:
$txt['lastLoggedIn'] = 'Last Active';

This changed the error message when trying to sort on Last Active to:

Database Error
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, 30' at line 5
File: /home/jimnu0c/public_html/NEBRASKAGHOSTS/smf/Sources/Memberlist.php
Line: 351

I also get this error when I try to sort on Date Registered:

Database Error
Unknown column 'mem.date_registered' in 'order clause'
File: /home/jimnu0c/public_html/NEBRASKAGHOSTS/smf/Sources/Memberlist.php
Line: 351

Other columns sort normally.

This one is a little beyond me at this point. Any help would be appreciated.

TIA

Jim

Markco

Please i would like to change the format of date "30-01-2011" in version 2.0Gold

Thank's

++
Sorry, I use the on-line translator ("Reverso") French / English

Nathaniel

Quote from: Markco on June 21, 2011, 04:47:02 AM
Please i would like to change the format of date "30-01-2011" in version 2.0Gold

Thank's

++

This mod depends only on SMF's date format, if you want to change the format then you will need to change the overall forum setting.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Markco

Sorry, I use the on-line translator ("Reverso") French / English

Senkusha

I suppose since this MOD is quite old, that there's very little hope of having it updated for SMF 2.1.x?
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

Steve

You never know unless you ask. The @Nathaniel was here today so he should see your post on his next visit.
DO NOT pm me for support!

Advertisement: