Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Rumpa on January 11, 2015, 03:07:34 PM

Title: Show join date age location last active in post and pm
Post by: Rumpa on January 11, 2015, 03:07:34 PM
Link to the mod (https://custom.simplemachines.org/index.php?mod=3975)

About

This modification can add Join Date, Age, Location, Last Active and User Id in post view and also in personal message.

For SMF 2.0.15 you can Enable/Disable these buttons in Admin--->Configaration--->Modification Settings(if not redirect)

Version

V1.0 (Initial Release)

V1.1 (Added User Id)

V1.2

V1.3 Released For SMF 2.0.11

V1.4 Change Log For SMF 2.0.14

V1.5 Release For SMF 2.0.15

V1.5.1 Release with Latin_Spanish language (Thanks for "Rock Lee"

Created by Rumpa

License

This modification is licensed under BSD License

http://www.opensource.org/licenses/bsd-license.php

                        Copyright (c) 2014, Rumpa
                         All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Title: Re: Show join date age location last active in post and pm
Post by: Rumpa on January 12, 2015, 05:29:21 AM
About

This modification can add Join Date, Age, Location, Last Active and User Id in post view and also in personal message.

For SMF 2.0.9 you can Enable/Disable these buttons in Admin--->Configaration--->Modification Settings(if not redirect)

Version

V1.1 (Added User Id)

Title: Re: Show join date age location last active in post and pm
Post by: Rumpa on January 14, 2015, 09:16:58 AM
Fixed minor error
Title: Re: Show join date age location last active in post and pm
Post by: Rumpa on April 27, 2015, 08:30:20 AM
V1.2 released
Title: Re: Show join date age location last active in post and pm
Post by: Rumpa on September 30, 2015, 02:46:05 AM
V1.3 Released For SMF 2.0.11
Title: Re: Show join date age location last active in post and pm
Post by: Aye Aye on November 23, 2015, 05:58:47 AM



Greetings:


I am using SMF 2.0.11 on Windows 10 Pro.


This Mod downloads successfully but fails Test. Please advise. (.exe file fails test).

Title: Re: Show join date age location last active in post and pm
Post by: Aye Aye on November 30, 2015, 04:06:24 PM
^


Bump . . .
Title: Re: Show join date age location last active in post and pm
Post by: Rumpa on December 02, 2015, 07:49:08 AM
Which theme you are using
Title: Re: Show join date age location last active in post and pm
Post by: Aye Aye on January 01, 2016, 03:17:36 AM
^


SMF Default Theme - Curve (2.0)


This is what is shown in Admin>Configuration>Current theme


There is also another theme which shows up in Admin>Configuration>Theme Settings.

It is called Core Theme (2.0)


I like to keep my Forum as simple and user-friendly as possible. Whatever mods I add are for making the Forums easy to use for the Members.

Title: Re: Show join date age location last active in post and pm
Post by: landyvlad on December 18, 2017, 07:25:13 AM
What is the update process please?  Is it just upload and install the new one, or do I uninstall./delete the old one first?
(It'd be cool if this info was included in the description of the mod, for easy reference)

Thanks
Title: Re: Show join date age location last active in post and pm
Post by: Rumpa on January 01, 2018, 11:19:26 AM
Quote from: landyvlad on December 18, 2017, 07:25:13 AM
What is the update process please?  Is it just upload and install the new one, or do I uninstall./delete the old one first?
(It'd be cool if this info was included in the description of the mod, for easy reference)

Thanks

You need to uninstalled old version before install new one
Title: Re: Show join date age location last active in post and pm
Post by: landyvlad on January 17, 2018, 04:38:43 AM
I am trying to uninstall v 1.3 (in order to instal 1.4).

I am getting this error:

Quotereplace   ./Themes/default/Display.template.php     test failed

Appreciate if you could let me know what I need to do to get this sorted so I can then install v 1.4.

Thanks
Title: Re: Show join date age location last active in post and pm
Post by: Rumpa on January 25, 2018, 04:26:27 AM
Quote./Themes/default/Display.template.php

Upload here above file I can check what actual error you got.[/b]
Title: Re: Show join date age location last active in post and pm
Post by: aegersz on January 25, 2018, 04:48:45 AM
i'm interested. How does it play with the "Last login date" mod ?

actually, i would take it off and try this. my members are not keen about divulging much personal information but country data is fine.

BUT my poor Config > Misc settings page is overloaded !

great mod but i will wait a bit as my system is currently stable.
Title: Re: Show join date age location last active in post and pm
Post by: aegersz on January 25, 2018, 05:37:17 AM
there is a thread about searching on Location - i will cross link topics - maybe you guys can work sonething out since you are collecting that data.

please refer to https://www.simplemachines.org/community/index.php?topic=558484.msg3959276#msg3959276
Title: Re: Show join date age location last active in post and pm
Post by: pepa on January 25, 2018, 03:26:33 PM
Quote from: aegersz on January 25, 2018, 05:37:17 AM
there is a thread about searching on Location - i will cross link topics - maybe you guys can work sonething out since you are collecting that data.

please refer to https://www.simplemachines.org/community/index.php?topic=558484.msg3959276#msg3959276

Yes, thank you aegersz.  There is also a related mod request that Rumpa may be interested in, it's here -> https://www.simplemachines.org/community/index.php?topic=558490.0 (https://www.simplemachines.org/community/index.php?topic=558490.0)
Title: Re: Show join date age location last active in post and pm
Post by: landyvlad on January 28, 2018, 09:18:47 PM
Rumpa - sorry have been busy, I'll endeavour to do this in the next few days (can't access cpanel from work computer)  Cheers
Title: Re: Show join date age location last active in post and pm
Post by: landyvlad on March 14, 2018, 11:37:10 PM
Is there a version of this mod for SMF 2.1 on the way perchance?


Quote from: landyvlad on January 28, 2018, 09:18:47 PM
Rumpa - sorry have been busy, I'll endeavour to do this in the next few days (can't access cpanel from work computer)  Cheers

Problem is sorted I think.
Title: Re: Show join date age location last active in post and pm
Post by: -Rock Lee- on March 15, 2018, 01:14:59 PM
I made the modifications in another way but for the next one this really is great for me, I leave the translations in Latin Spanish:

Code (Spanish_Latin) Select
$txt['user_id'] = 'iD del usuario';
$txt['show_user_post'] = 'Mostrar el iD del usuario en la publicación:';
$txt['show_user_pm'] = 'Mostrar el iD del usuario en los mensajes personales:';
$txt['date_registered'] = 'Fecha de ingreso';
$txt['show_join_date_post'] = 'Mostrar la fecha de registro en la publicación:';
$txt['show_join_date_pm'] = 'Mostrar la fecha de registro en los mensajes personales:';
$txt['location'] = 'Ubicación';
$txt['show_location_post'] = 'Mostrar la ubicación del miembro en la publicación:';
$txt['show_location_pm'] = 'Mostrar la ubicación del miembro en los mensajes personales:';
$txt['age'] = 'Edad';
$txt['show_age_post'] = 'Mostrar la edad del miembro en la publicación:';
$txt['show_age_pm'] = 'Mostrar la edad del miembro en los mensajes personales:';
$txt['last_login'] = 'Última actividad';
$txt['show_last_login_post'] = 'Mostrar la última actividad del miembro en la publicación:';
$txt['show_last_login_pm'] = 'Mostrar la última actividad del miembro en los mensajes personales:';


Code (Spanish_Latin-uft8) Select
$txt['user_id'] = 'ID del usuario';
$txt['show_user_post'] = 'Mostrar el ID del usuario en la publicación:';
$txt['show_user_pm'] = 'Mostrar el ID del usuario en los mensajes personales:';
$txt['date_registered'] = 'Fecha de Ingreso';
$txt['show_join_date_post'] = 'Mostrar la fecha de registro en la publicación:';
$txt['show_join_date_pm'] = 'Mostrar la fecha de registro en los mensajes personales:';
$txt['location'] = 'Ubicación';
$txt['show_location_post'] = 'Mostrar la ubicación del miembro en la publicación:';
$txt['show_location_pm'] = 'Mostrar la ubicación del miembro en los mensajes personales:';
$txt['age'] = 'Edad';
$txt['show_age_post'] = 'Mostrar la edad del miembro en la publicación:';
$txt['show_age_pm'] = 'Mostrar la edad del miembro en los mensajes personales:';
$txt['last_login'] = 'Última actividad';
$txt['show_last_login_post'] = 'Mostrar la última actividad del miembro en la publicación:';
$txt['show_last_login_pm'] = 'Mostrar la última actividad del miembro en los mensajes personales:';


Regards!
Title: Re: Show join date age location last active in post and pm
Post by: landyvlad on February 06, 2019, 06:17:25 AM
Are the features of this mod included in core code for SMF 2.1 RC1?
If not, will this mod be updated?
Title: Re: Show join date age location last active in post and pm
Post by: Arantor on February 06, 2019, 06:57:28 AM
The mod will need substantial changes for RC1 because location is no longer a hard coded field but migrated to the custom field set up.
Title: Re: Show join date age location last active in post and pm
Post by: landyvlad on February 06, 2019, 05:07:41 PM
Ok thanks for the heads up mate.
Title: Re: Show join date age location last active in post and pm
Post by: pocttopus on May 31, 2020, 03:49:34 PM
Are there any successful experience using/emulating this mod for 2.1rc2?
Title: Re: Show join date age location last active in post and pm
Post by: Arantor on May 31, 2020, 03:57:05 PM
Quote from: Arantor on February 06, 2019, 06:57:28 AM
The mod will need substantial changes for RC1 because location is no longer a hard coded field but migrated to the custom field set up.

Ditto for RC2.
Title: Re: Show join date age location last active in post and pm
Post by: shadav on June 17, 2020, 08:04:24 PM
trying to install this onto a 2.0.17

but in sources/load.php I don't have
find
);
}
}

return true;
}


replace
);
}
}
if (!empty($profile['birthdate']) && $profile['birthdate'] !== '0001-01-01')
{
list ($birth_year, $birth_month, $birth_day) = sscanf($profile['birthdate'], '%d-%d-%d');
$datearray = getdate(forum_time());
$memberContext[$user] += array(
'age' => $birth_year <= 4 ? $txt['age'] : $datearray['year'] - $birth_year - (($datearray['mon'] > $birth_month || ($datearray['mon'] == $birth_month && $datearray['mday'] >= $birth_day)) ? 0 : 1)
);
}
return true;
}


the closest I could find was
];
}
}

return empty($loaded_ids) ? false : $loaded_ids;
}


so then if i add like this is it ok?
];
}
}
if (!empty($profile['birthdate']) && $profile['birthdate'] !== '0001-01-01')
{
list ($birth_year, $birth_month, $birth_day) = sscanf($profile['birthdate'], '%d-%d-%d');
$datearray = getdate(forum_time());
$memberContext[$user] += array(
'age' => $birth_year <= 4 ? $txt['age'] : $datearray['year'] - $birth_year - (($datearray['mon'] > $birth_month || ($datearray['mon'] == $birth_month && $datearray['mday'] >= $birth_day)) ? 0 : 1)
);
}
return empty($loaded_ids) ? false : $loaded_ids;
}


[edit] ok so that didn't work....nothing showed up in posts or pms....not sure where to add this then.....
Title: Re: Show join date age location last active in post and pm
Post by: pikeman on February 13, 2022, 07:34:48 AM
Hello, is a modification for 2.1 planned?
Title: Re: Show join date age location last active in post and pm
Post by: davo88 on February 18, 2022, 10:56:08 PM
Quote from: pikeman on February 13, 2022, 07:34:48 AMHello, is a modification for 2.1 planned?
Wondering the same thing. My forum really needs this info displayed.
Title: Re: Show join date age location last active in post and pm
Post by: landyvlad on February 20, 2022, 09:01:43 PM
IF it is updated at any point it may take a while because

Quote from: Arantor on February 06, 2019, 06:57:28 AMThe mod will need substantial changes ... because location is no longer a hard coded field but migrated to the custom field set up.

Just for the benefit of those asking above :)
Title: Re: Show join date age location last active in post and pm
Post by: Arantor on February 21, 2022, 03:17:09 AM
On the other hand, being a custom field, you can set it to display on the posts yourself... ;)
Title: Re: Show join date age location last active in post and pm
Post by: pikeman on February 21, 2022, 04:44:43 PM
Basically I only need the registration date and I don't know how to add it in the custom fields.
Title: Re: Show join date age location last active in post and pm
Post by: Arantor on February 21, 2022, 05:04:56 PM
Location is a custom field now, the others not so much.
Title: Re: Show join date age location last active in post and pm
Post by: landyvlad on July 19, 2022, 06:13:35 AM
The most useful is the ability to display 'last active' to know if there's any point PMing someone etc.

Given there's no apparent likelihood of this mod being updated, is there a way to display that information? (in post and PM)? 

Are any of these fields (aside from location as already mentioned by Arantor)  shown natively in 2.1?
Title: Re: Show join date age location last active in post and pm
Post by: GL700Wing on July 19, 2022, 09:41:40 AM
Quote from: landyvlad on July 19, 2022, 06:13:35 AMThe most useful is the ability to display 'last active' to know if there's any point PMing someone etc.

Given there's no apparent likelihood of this mod being updated, is there a way to display that information? (in post and PM)? 

Are any of these fields (aside from location as already mentioned by Arantor)  shown natively in 2.1?
I've added the 'Join Date' and 'Last Active' info to the post/PM display screen on one of my SMF 2.01.9 forums - I'll work out the code for SMF 2.1 and post it as a Tip/Trick ...
Title: Re: Show join date age location last active in post and pm
Post by: Arantor on July 19, 2022, 09:43:09 AM
Do note that last active is deliberately hidden on the profile page if the user has their online status set to hidden - because if they don't want to present as online, showing their last active as such undermines that.
Title: Re: Show join date age location last active in post and pm
Post by: GL700Wing on July 19, 2022, 10:04:52 AM
Quote from: Arantor on July 19, 2022, 09:43:09 AMDo note that last active is deliberately hidden on the profile page if the user has their online status set to hidden - because if they don't want to present as online, showing their last active as such undermines that.
Noted - will check/respect that setting when I develop the Tip/Trick.
Title: Re: Show join date age location last active in post and pm
Post by: GL700Wing on July 21, 2022, 02:12:33 AM
Here ya go @pikeman and @landyvlad ...

Tip for SMF 2.1: Show 'Date Joined' and 'Last Active' in posts and PMs (https://www.simplemachines.org/community/index.php?topic=583028.0)
Title: Re: Show join date age location last active in post and pm
Post by: Rumpa on November 25, 2022, 07:32:04 AM
For SMF 2.0.19 and 2.1.3 you can Enable/Disable these buttons in Admin--->Configaration--->Modification Settings(if not redirect)

Version

V2.0 is big update it's support SMF 2.0.19
And it's support SMF 2.1.3
in SMF 2.1.x Location added by deafult so not needed any modification

Title: Re: Show join date age location last active in post and pm
Post by: davo88 on March 14, 2024, 04:27:17 PM
2.1.4
I would like to split the 'Last active' line into two so it appears on two lines like this.

Last Active:
14 Jan 2024 at 10:52

Anyone know where and how to do this edit?
Title: Re: Show join date age location last active in post and pm
Post by: GL700Wing on March 14, 2024, 05:49:43 PM
Quote from: davo88 on March 14, 2024, 04:27:17 PMI would like to split the 'Last active' line into two so it appears on two lines like this.

Last Active:
14 Jan 2024 at 10:52

Anyone know where and how to do this edit?
@davo88 If you're using the code in the Tip for SMF 2.1: Show 'Date Joined' and 'Last Active' in posts and PMs (https://www.simplemachines.org/community/index.php?topic=583028.0) I posted you could make the following change in ./Themes/default/languages/Modifications.english.php

Find:
$txt['lastActive'] = 'Last Active: ';
Replace with:
$txt['lastActive'] = 'Last Active:<br>';
Title: Re: Show join date age location last active in post and pm
Post by: davo88 on March 14, 2024, 10:00:23 PM
Thanks GL700Wing. My question was actually about Rumpa's mod. But I tried the code edits in Tip for SMF 2.0/2.1: Show 'Date Joined' and 'Last Active' in posts and PMs (https://www.simplemachines.org/community/index.php?topic=583028.0) and that produces a neat display, so I think I'll go with that option.

I have a question about adding to the date but will ask it in the 'Tip' topic in case others are interested.