Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: tinoest on January 15, 2011, 12:12:42 PM

Title: Add Join Date : to each members reply in topic view
Post by: tinoest on January 15, 2011, 12:12:42 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=2889)

This Modification adds the date registered in the form 'Join Date' to each users reply in topic view.

It is displayed after the number of posts they have.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg593.imageshack.us%2Fimg593%2F153%2Fjoindate.png&hash=348043a46cd2fd8ddd3391d5b5a29e67351a7f71) (http://img593.imageshack.us/img593/153/joindate.png)

As of v 1.1 : It can now be controlled from the theme settings panel.

Added support for SMF 2.x


Licence

Quote
Copyright © 2012 tinoest.  All rights reserved.

Developed by: tinoest
              http://www.tinoest.no-ip.org

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
  1. Redistributions of source code must retain the above copyright notice,
     this list of conditions and the following disclaimers.
  2. Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimers in the
     documentation and/or other materials provided with the distribution.
  3. Neither the names of tinoest, nor the names of its contributors may be
     used to endorse or promote products derived from this Software without
     specific prior written permission.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
WITH THE SOFTWARE.

This license may be viewed online at http://opensource.org/licenses/BSD-3-Clause
Title: Re: Add Join Date : to each members reply in topic view
Post by: futeball on February 21, 2011, 10:22:28 PM
There was an error 'The package you are trying to download or install is either corrupt or not compatible with this version of SMF.'.
I'm using smf 1.1.13. Please check it out. TQ.
Title: Re: Add Join Date : to each members reply in topic view
Post by: Arantor on February 22, 2011, 03:13:00 AM
Yeah the file wasn't updated to include instructions for 1.1.13 even though they're identical to 1.1.12.

Try installing http://custom.simplemachines.org/mods/index.php?mod=2113 and selecting 1.1.12 from the dropdown it gives you (that tells the package manager to look for instructions for 1.1.12 instead of 1.1.13)
Title: Re: Add Join Date : to each members reply in topic view
Post by: tinoest on February 23, 2011, 07:42:51 PM
Apologies for that, thought I had copied the identical instructions across.

Its been done now.  :)
Title: Re: Add Join Date : to each members reply in topic view
Post by: Danny S. on March 06, 2011, 02:21:32 AM
Just an FYI, got this to work in 2.0RC5 with the following code:


      // Show the member's registration date?
      if (!empty($message['member']['registered']) && (!empty($settings['show_registration_date']))
         echo '
                        <li class="registrationdate">', $txt['date_registered'], ': ', strftime(' %b, %Y',  strtotime($message['member']['registered'])), '</li>';
Title: Re: Add Join Date : to each members reply in topic view
Post by: waruna on March 31, 2011, 12:50:04 PM
Hi. I'm using RC2. Install this and got this error:

Quote
1.    Execute Modification    ./Sources/Load.php    Test failed
      1.    Replace    ./Sources/Load.php    Test failed
      2.    Add Before    ./Sources/Load.php    Test successful
*    2.    Execute Modification    ./Themes/default/Display.template.php    Test successful
*    3.    Execute Modification    ./Sources/ManageSettings.php    Test failed
      1.    Add After    ./Sources/ManageSettings.php    Test failed
*    4.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
   5.    Execute Modification    ./Themes/default/languages/Modifications.english-utf8.php    Skipping file

Can anyone advice me? Thanks in advance.
Title: Re: Add Join Date : to each members reply in topic view
Post by: Danny S. on March 31, 2011, 02:43:18 PM
Quote from: Danny S. on March 06, 2011, 02:21:32 AM
Just an FYI, got this to work in 2.0RC5 with the following code:


      // Show the member's registration date?
      if (!empty($message['member']['registered']))
         echo '
                        <li class="registrationdate">', $txt['date_registered'], ': ', strftime(' %b, %Y',  strtotime($message['member']['registered'])), '</li>';



You can get it to show by adding the above code into your display.template.php file.
Title: Re: Add Join Date : to each members reply in topic view
Post by: suljanic on April 06, 2011, 08:52:42 AM
Hello, I need one information. I installed the mod successfully. But use the Croatian language and are not showing the text 'Join Date', only the date is displayed. Where and what code must I entered?
Title: Re: Add Join Date : to each members reply in topic view
Post by: suljanic on April 07, 2011, 06:22:41 AM
I solved the problem.  :)  thx
Title: Re: Add Join Date : to each members reply in topic view
Post by: ApplianceJunk on August 12, 2012, 11:58:37 PM
Works, thanks!
Title: Re: Add Join Date : to each members reply in topic view
Post by: futeball on September 29, 2012, 02:06:52 PM
Im using smf 2.0.2 but I can't find where to enable this mod? Please advise.
Title: Re: Add Join Date : to each members reply in topic view
Post by: Shambles on September 29, 2012, 02:18:04 PM
In my setup, it's

Admin > Configuration > Modification Settings > Miscellaneous

.. then tick the box entitled "Show join date in topic view:"
Title: Re: Add Join Date : to each members reply in topic view
Post by: tinoest on September 29, 2012, 02:20:47 PM
Quote from: Shambles™ on September 29, 2012, 02:18:04 PM
In my setup, it's

Admin > Configuration > Modification Settings > Miscellaneous

.. then tick the box entitled "Show join date in topic view:"

Thanks, seems I was to slow to reply!

It should be where Shambles just said, if it's not then can you post your ManageSettings.php file
Title: Re: Add Join Date : to each members reply in topic view
Post by: futeball on September 30, 2012, 07:14:51 AM
Ok, found it. Thanks guys! ;)
Title: Re: Add Join Date : to each members reply in topic view
Post by: TheDel on February 09, 2013, 11:27:55 AM
anyway to turn around the date for the Americans?
It says Month Date Year and we use Day Month Year
Title: Re: Add Join Date : to each members reply in topic view
Post by: Shambles on February 09, 2013, 12:02:39 PM
Quote
anyway to turn around the date for the Americans?
It says Month Date Year and we use Day Month Year
I thought America used Month Day Year  ???
Title: Re: Add Join Date : to each members reply in topic view
Post by: tinoest on February 09, 2013, 12:31:28 PM
Find this line in Sources/Load.php

'joined' => empty($profile['date_registered']) ? '' : timeformat($profile['date_registered'], '%b %Y'),

And edit it to the format that you want.

timeformat is a function in Sources/Subs.php and uses http://php.net/manual/en/function.strftime.php to format the string.
Title: Re: Add Join Date : to each members reply in topic view
Post by: AK49BWL on March 09, 2013, 10:29:27 PM
Can someone tell me why this particular action would need to take place for this mod? Enabling the mod toggles real_name vs member_name, and this is completely unrelated to the mod itself, I'm just really curious as to the reason.

Find: [Select]
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['real_name'] . '</a>',

Replace With: [Select]
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . (empty($modSettings['display_join_date']) ? $profile['real_name'] : $profile['member_name']) . '">' . $profile['real_name'] . '</a>',
Title: Re: Add Join Date : to each members reply in topic view
Post by: Arantor on March 09, 2013, 10:35:49 PM
There's no good reason for it that I can think of.

In fact I'd probably go as far as calling it a bug because it is unintended - and unwanted - behaviour and in some cases could be a privacy issue (e.g. cases where a user signs up with one name and immediately changes the display name to cloak their real login name)
Title: Re: Add Join Date : to each members reply in topic view
Post by: IMSassafras on March 07, 2014, 02:36:16 PM
For whatever reason, this mod isn't working.  I did notice that the last version compatible is 2.0.5 and I have 2.0.7.  I didn't get any errors or failure notices though, so I went a head with the mod.  I checked the mod instructions and is didn't give an "this mod is not compatible with your version of SMF" so I felt installing it on my forum.

What's up? And can this be updated?

~Sass

:::::::::::::: OOPS!!!!!:::::::::::::

I didn't turn on the mod.  [egg on face]

Fixed the problem!!
Title: Re: Add Join Date : to each members reply in topic view
Post by: pikeman on March 05, 2022, 06:45:58 AM
Hello, is a modification for 2.1 planned?
Title: Re: Add Join Date : to each members reply in topic view
Post by: tinoest on March 06, 2022, 07:59:37 AM
Quote from: pikeman on March 05, 2022, 06:45:58 AMHello, is a modification for 2.1 planned?

I didn't realise people still used this mod! I'll look to get an update done for SMF 2.1 shortly.

Try the attached MemberSince-1.0.2.tar.gz
Title: Re: Add Join Date : to each members reply in topic view
Post by: pikeman on March 06, 2022, 09:40:34 AM
It works, thank you! :)
Title: Re: Add Join Date : to each members reply in topic view
Post by: Shades. on March 06, 2022, 11:25:23 AM
Quote from: tinoest on March 06, 2022, 07:59:37 AM
Quote from: pikeman on March 05, 2022, 06:45:58 AMHello, is a modification for 2.1 planned?

I didn't realise people still used this mod! I'll look to get an update done for SMF 2.1 shortly.

Try the attached MemberSince-1.0.2.tar.gz
Works great and also works with the Relative Time Format (https://custom.simplemachines.org/index.php?mod=4235) mod. ;)
Title: Re: Add Join Date : to each members reply in topic view
Post by: WolfJ on August 21, 2022, 12:32:01 PM
Hello.

Just wanted to ask as I've spent the past two days pulling apart this mod if there is a way to change it from "Date" Registered" to "Joined" on the forum posts as the latter just is too big and causes the text to go onto the next line.

Thanks 
Title: Re: Add Join Date : to each members reply in topic view
Post by: Kindred on August 21, 2022, 12:54:11 PM
No need to pull apart code.
All language strings are in language files -- either specific to the mod or in modifications.english.php
Title: Re: Add Join Date : to each members reply in topic view
Post by: tinoest on August 21, 2022, 02:23:36 PM
Quote from: WolfJ on August 21, 2022, 12:32:01 PMHello.

Just wanted to ask as I've spent the past two days pulling apart this mod if there is a way to change it from "Date" Registered" to "Joined" on the forum posts as the latter just is too big and causes the text to go onto the next line.

Thanks 

This mod should say Join Date, it's defined in Themes/default/languages/Modifications.english.php
Title: Re: Add Join Date : to each members reply in topic view
Post by: WolfJ on August 21, 2022, 02:56:28 PM
Quote from: tinoest on August 21, 2022, 02:23:36 PM
Quote from: WolfJ on August 21, 2022, 12:32:01 PMHello.

Just wanted to ask as I've spent the past two days pulling apart this mod if there is a way to change it from "Date" Registered" to "Joined" on the forum posts as the latter just is too big and causes the text to go onto the next line.

Thanks 

This mod should say Join Date, it's defined in
Themes/default/languages/Modifications.english.php


Okay I've just checked and it's there as it should be, even I use a custom theme that shouldn't break it I don't think.

I tried to reinstall the mod but my package manager says this is missing.

            // Show users join date?
            if (!empty($modSettings['display_join_date']) && !empty($message['member']['joined']))
                echo '
                            <li>', $txt['date_registered'], ': ', $message['member']['joined'], '</li>';

            // Show avatars, images, etc.?


Sorry if I seem really dumb or stupid I'm just trying to figure out a way to solve this problem. Thanks
Title: Re: Add Join Date : to each members reply in topic view
Post by: Kindred on August 21, 2022, 03:13:37 PM
you mean it shows that as missing on UNINSTALL?

Or it shows that the target code, which THAT code replaces can not be found on INSTALL?
Title: Re: Add Join Date : to each members reply in topic view
Post by: WolfJ on August 21, 2022, 03:41:06 PM
Quote from: Kindred on August 21, 2022, 03:13:37 PMyou mean it shows that as missing on UNINSTALL?

Or it shows that the target code, which THAT code replaces can not be found on INSTALL?

Apologies I didn't state that, yes it's on the uninstall package screen sorry. So not sure if that's my issue. I tried to put it into random places in the "./Sources/ManageSettings.php" file but still doesn't work.
Title: Re: Add Join Date : to each members reply in topic view
Post by: tinoest on August 21, 2022, 05:03:47 PM
That change is made in Themes/default/Display.template.php
When you were trying to change the text displayed did you make any changes to that file?
Title: Re: Add Join Date : to each members reply in topic view
Post by: WolfJ on August 21, 2022, 05:14:54 PM
Quote from: tinoest on August 21, 2022, 05:03:47 PMThat change is made in
Themes/default/Display.template.php
When you were trying to change the text displayed did you make any changes to that file?

I had to manually add the code cause it gave me an install error and I had to move it down the file cause on my theme it was showing above the profile picture.

            // Show users join date?
            if (!empty($modSettings['display_join_date']) && !empty($message['member']['joined']))
                echo '
                            <li>', $txt['date_registered'], ': ', $message['member']['joined'], '</li>';

Can of confused why it's saying it fails on "./Sources/ManageSettings.php" if it's meant to go into "Themes/default/Display.template.php"
Title: Re: Add Join Date : to each members reply in topic view
Post by: tinoest on August 21, 2022, 07:10:04 PM
There is another change in manage settings. Look at the manual edits on the modifications site and work out which one you have modified so that it no longer uninstalls correctly.
Title: Re: Add Join Date : to each members reply in topic view
Post by: WolfJ on August 21, 2022, 07:14:40 PM
Quote from: tinoest on August 21, 2022, 07:10:04 PMThere is another change in manage settings. Look at the manual edits on the modifications site and work out which one you have modified so that it no longer uninstalls correctly.

The error on the uninstall is coming from "./Sources/ManageSettings.php"

Tells me to find

// Show users join date?
if (!empty($modSettings['display_join_date']) && !empty($message['member']['joined']))
echo '
<li>', $txt['date_registered'], ': ', $message['member']['joined'], '</li>';

// Show avatars, images, etc.?

And replace with

// Show avatars, images, etc.?

But when I check "./Sources/ManageSettings.php" that code doesn't exist anywhere. Could this be why it's not displaying correctly in posts maybe
Title: Re: Add Join Date : to each members reply in topic view
Post by: tinoest on August 21, 2022, 07:18:34 PM
That change is in the file I said above not manage settings. You're not reading the package installer correctly.
Title: Re: Add Join Date : to each members reply in topic view
Post by: WolfJ on August 21, 2022, 08:11:53 PM
Quote from: tinoest on August 21, 2022, 07:18:34 PMThat change is in the file I said above not manage settings. You're not reading the package installer correctly.

I'll attach a screenshot

Screenshot 2022-08-22 021057.png
Title: Re: Add Join Date : to each members reply in topic view
Post by: GL700Wing on August 22, 2022, 12:03:31 AM
@WolfJ - If you're comfortable with making some code edits you could uninstall this mod and implement 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) - this would also enable you to set the label/title to meet your needs.