custom html in #gkUpdates

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Mon Oct 20, 2014 4:05 pm
Reply with quote
Report this post
Hi,
is it possible to use a custom html module in News2 #gkUpdates position?
I created one, but it doesn't show up (with or without the "Show last update date" option in template manager).
Thank you very much.
Regards
User avatar
Fresh Boarder

GK User
Wed Oct 22, 2014 11:29 am
Reply with quote
Report this post
Please, anyone?
Thank you
User avatar
Fresh Boarder

teitbite
Fri Oct 24, 2014 6:29 pm
Reply with quote
Report this post
Hi

You need to edit file /layout/blocks/updates.php and remove this:

Code: Select all
// Used helper function
if(!function_exists('gk_get_last_update')) {
   function gk_get_last_update($table, $column, $state) {
      $db = JFactory::getDBO();
      $date_query = 'SELECT '.$column.' FROM #__'.$table.' WHERE '.$state.' = 1 ORDER BY '.$column.' DESC LIMIT 1;';   
      $db->setQuery($date_query);
      if($dates = $db->loadAssocList()) {
         foreach($dates as $date) {
            return strtotime($date[$column]);
         }
      }
   }
}

// Basic variables
$final_date = 0;
$new_date = 0;

// get joomla created dates
$final_date = gk_get_last_update('content', 'created', 'state');
// check if any modify date isn't later
$new_date = gk_get_last_update('content', 'modified', 'state');
if($new_date > $final_date) $final_date = $new_date;
// the same for K2 if exist
if(file_exists(JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php')) {
   $new_date = gk_get_last_update('k2_items', 'created', 'published');
   if($new_date > $final_date) $final_date = $new_date;
   // return the final results
   $new_date = gk_get_last_update('k2_items', 'modified', 'published');
   if($new_date > $final_date) $final_date = $new_date;
}

echo JText::_('TPL_GK_LANG_UPDATE_DATE') . ' ' . date(JText::_('TPL_GK_LANG_UPDATE_DATE_FORMAT'), $final_date);

// EOF


with this:

Code: Select all
<jdoc:include type="modules" name="updates" />
User avatar
Moderator

GK User
Wed Oct 29, 2014 11:46 am
Reply with quote
Report this post
Thank you very much! Solved!
Have a nice day
User avatar
Fresh Boarder


cron