News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

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.

Advertisement: