Kirill N Posted March 4, 2015 Share Posted March 4, 2015 How do I display a user's join date in the post bit? Link to comment Share on other sites More sharing options...
The Jimmo Posted March 4, 2015 Share Posted March 4, 2015 Template hook. Think I may experiment real quick. Link to comment Share on other sites More sharing options...
Kirill N Posted March 4, 2015 Author Share Posted March 4, 2015 Template hook. Think I may experiment real quick. Hmm I expected it could be done by adding just one line to the template. But thanks, looking forward to it! Link to comment Share on other sites More sharing options...
The Jimmo Posted March 4, 2015 Share Posted March 4, 2015 You could probably do it that way too. A template hook though would be more robust IMO. Link to comment Share on other sites More sharing options...
Kirill N Posted March 4, 2015 Author Share Posted March 4, 2015 You could probably do it that way too. A template hook though would be more robust IMO.I have a very heavily modified theme so I think a template edit would be a better idea. Do you by any chance what code I should add? Link to comment Share on other sites More sharing options...
The Jimmo Posted March 4, 2015 Share Posted March 4, 2015 Can check out my hook here: http://community.invisionpower.com/files/file/7303-jimmo-user-join-date-in-post/Or add the below:{datetime="$comment->author()->joined"} Link to comment Share on other sites More sharing options...
Kirill N Posted March 4, 2015 Author Share Posted March 4, 2015 Can check out my hook here: http://community.invisionpower.com/files/file/7303-jimmo-user-join-date-in-post/Or add the below:{datetime="$comment->author()->joined"} This is exactly what I was looking for. Thanks so much! Link to comment Share on other sites More sharing options...
Kirill N Posted March 15, 2015 Author Share Posted March 15, 2015 Can check out my hook here: http://community.invisionpower.com/files/file/7303-jimmo-user-join-date-in-post/Or add the below:{datetime="$comment->author()->joined"} Do you by any chance know how to make it display the month and year only? Link to comment Share on other sites More sharing options...
Adriano Faria Posted March 15, 2015 Share Posted March 15, 2015 @ForeverPontiac, the date returns as an object (\IPS\DateTime) so you can use format. I'm working to update my hook (http://community.invisionpower.com/files/file/4821-enhanced-joined-date/) and it uses the joined date as well. That's how I did to format it:$joinedDate->format( 'm/d/Y' );However I use it on a PHP function, not on template... don't know how you can do this on a theme hook. Link to comment Share on other sites More sharing options...
The Jimmo Posted March 15, 2015 Share Posted March 15, 2015 {{$date = $comment->author()->joined;}} {{$date = $date->format( 'M Y' );}} {$date} wherever you want to use it in the templateBasically what @Adriano Faria mentioned, can probably reduce and combine the lines a bit but this is for demonstration purposes. Link to comment Share on other sites More sharing options...
crmarks Posted August 2, 2017 Share Posted August 2, 2017 Removed for edit. BRB. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.