Use modified date in newsflash

News Show Pro GK5 - flexible, responsive and easily extendable free Joomla module support forum.
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Sat Feb 27, 2016 2:04 am
For a new site based on gk_university, I have made some changes to the the events_list module mode so I can show the latest news in the module on the home page. The articles are Joomla articles, which are ordered by their modified date.
Now I would also like to show the modified date in the date box. Currently I fetch the creation date with the following code:

Code: Select all
for($i = 0; $i < count($this->parent->content); $i++) {         
         $title = $this->parent->content[$i]['title'];
         $text = $this->parent->content[$i]['text'];
         $date = $this->parent->content[$i]['date'];


However $date is the article creation date. Is there also a simple way to fetch the article modified date?

The file I am referring to is controller.php in mod_news_pro_gk5/tmpl/portal_modes/events_list

Thank you for your help!
User avatar
Fresh Boarder

GK User
Mon Feb 29, 2016 3:43 pm
I have now solved this by adding the variable "modified" to the SQL query in \data_sources\com_content\model.php
Line 294:
Code: Select all
content.created_by_alias AS author_alias,
  content.modified AS modified,
'.$config['username'].' AS author_username,
User avatar
Fresh Boarder

teitbite
Fri Mar 04, 2016 11:56 am
Hi

That's a correct solution. Thank You for shearing it with others. I'm closing this thread now.
User avatar
Moderator


cron