Show join date age location last active in post and pm

Started by Rumpa, January 11, 2015, 03:07:34 PM

Previous topic - Next topic

Rumpa

Link to the mod

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.

Rumpa

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)


Rumpa


Rumpa


Rumpa


Aye Aye




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).



Rumpa


Aye Aye

^


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.


landyvlad

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
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Rumpa

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

landyvlad

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
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Rumpa

Quote./Themes/default/Display.template.php

Upload here above file I can check what actual error you got.[/b]

aegersz

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.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

#14
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
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

pepa

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

landyvlad

Rumpa - sorry have been busy, I'll endeavour to do this in the next few days (can't access cpanel from work computer)  Cheers
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

landyvlad

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.
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

-Rock Lee-

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!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

landyvlad

Are the features of this mod included in core code for SMF 2.1 RC1?
If not, will this mod be updated?
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Arantor

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.

landyvlad

"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

pocttopus

Are there any successful experience using/emulating this mod for 2.1rc2?

Arantor

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.

shadav

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.....

pikeman


davo88

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.

landyvlad

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 :)
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Arantor

On the other hand, being a custom field, you can set it to display on the posts yourself... ;)

pikeman

Basically I only need the registration date and I don't know how to add it in the custom fields.

Arantor

Location is a custom field now, the others not so much.

landyvlad

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?
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

GL700Wing

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 ...
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Arantor

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.

GL700Wing

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.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

GL700Wing

Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Rumpa

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


davo88

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?

GL700Wing

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 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>';
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

davo88

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 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.

Advertisement: