Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('_JEXEC') or die;
- $module_categories = $params->get('categories');
- foreach ($module_categories as $category){
- $ids[]=$category
- }
- $db = JFactory::getDBO();
- $db->setQuery("
- select * from #__k2_items as i
- inner join
- #__k2_categories as c
- where (i.catid = c.id and c.id in (".implode(','$ids).")
- or (i.catid = c.parent and c.parent in (".implode(','$ids).")
- order by extra_fields asc");
- $items = $db->loadObjectList();
- ?>
- <?php foreach ($items as $count => $item) : ?>
- <?php $extra_field = json_decode($item->extra_fields);?>
- <?php if ((in_array($item->parent,$module_categories)) or (in_array($item->catid,$module_categories))) :?>
- <?php if (($extra_field['0']->value >= date('Y-m-d')) and ($item->published == '1')) : ?>
- <div class="kevent-category">
- <b>CATID: <?php echo $item->catid; ?></b> <b>PARENT: <?php echo $item->parent; ?></b>
- </div>
- <div class="kevent-title">
- <?php echo $item->title; ?>
- </div>
- <div class="kevent-category">
- <i><?php echo $item->name; ?></i>
- </div>
- <div class="kevent-date">
- <i><?php echo $extra_field['0']->value; ?></i>
- </div>
- <div class="kevent-date">
- <i><?php echo JHTML::_('date', $extra_field['0']->value,JText::_('DATE_FORMAT_LC1'), 'UTC'); ?></i>
- </div>
- <?php endif; ?>
- <?php endif; ?>
- <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement