Skip to Content Skip to Menu

🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

Change Cb activity feed date format

7 months 3 days ago #338150 by pjfroelofs
Change Cb activity feed date format was created by pjfroelofs
6 years ago, we managed to change the date format of an activity.
Current format: 5 months ago
Desired format: 14/12/2023 15:04:51

We used a template override in the folder /components/com_comprofiler/plugin/user/plug_cbactivity/templates/default
In a file called ‘activity-container.php’ we removed a call to ‘timeago’.

In the new version of CB this override causes errors.
We have to change the date format again.

Can you give me a hint, which file / line has the code that has to be changed?

Regard,
Patrick
 

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
7 months 3 days ago #338152 by krileon
Replied by krileon on topic Change Cb activity feed date format
A lot of the PHP got hidden away into layout helper functions, but this is still doable from the template files. Specifically the container.php files are responsible for rendering an activity container. The date output would be the following in those files.
Code:
<?php echo $rowDate; ?>

You can replace it with the following to just render the raw date.
Code:
<?php echo cbFormatDate( $row->getDate() ); ?>

Have added a feature ticket to review finding a way to allow customizing the format easily. Probably through a language string override like we'd done for other date format usages.

forge.joomlapolis.com/issues/9425


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: pjfroelofs

Please Log in or Create an account to join the conversation.

7 months 1 day ago - 7 months 1 day ago #338167 by pjfroelofs
Replied by pjfroelofs on topic Change Cb activity feed date format
Thank you very much, for the hint where to change the activty feed time format.

One last similar question.
We want the same format in CB GroupJive Wall.
Could you give us a hint which code / file do we have to change?

Ik found the template folder: /components/com_comprofiler/plugin/user/plug_cbgroupjive/templates

Regards, Patrick

   
Last edit: 7 months 1 day ago by pjfroelofs.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
7 months 1 day ago #338174 by krileon
Replied by krileon on topic Change Cb activity feed date format
I wouldn't recommend using CB GroupJive Wall if you have CB Activity as it can directly replace the Wall tab in groups. Regardless it would be the same process of creating a new template and assigning CB GroupJive Wall to it. Specifically it's the below file.

/components/com_comprofiler/plugin/user/plug_cbgroupjive/plugins/cbgroupjivewall/templates/default/wall.php

You'd need to adjust the following.

FROM:
Code:
cbFormatDate( $row->getString( 'date', '' ), true, 'timeago' )
TO:
Code:
cbFormatDate( $row->getString( 'date', '' ) )


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

6 months 4 weeks ago #338183 by pjfroelofs
Replied by pjfroelofs on topic Change Cb activity feed date format
We do not want to mix cb activity with groupjive wall, so this code is very helpfull to us.

I thought I should create a folder, next to the default folder. To create a custom template.
But in CB GroupJive Wall, there are no parameters to choose a different template.

Can you confirm, that an adjustment of the original wall.php file is the only way to go?
And that means we have te change it after every CB Groupjive update?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
6 months 4 weeks ago #338187 by krileon
Replied by krileon on topic Change Cb activity feed date format
GJ integrations match whatever template is selected in core GJ. So make an empty template folder in core GJ then select that template for core GJ. Now you can make some folder for GJ Wall and be able to override fine. Modifying the defaults will result in your changes lost on every update of GJ Wall so I don't recommend doing that.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum