/templates/gk_publisher/html/com_k2/templates/default/latest.php

https://gitlab.com/ppapadatis/Videolearn · PHP · 126 lines · 100 code · 21 blank · 5 comment · 36 complexity · 2289262af8a3f3b8b8a6532cf48982ca MD5 · raw file

  1. <?php
  2. /**
  3. * @package K2
  4. * @author GavickPro http://gavick.com
  5. */
  6. // no direct access
  7. defined('_JEXEC') or die;
  8. ?>
  9. <section id="k2Container" class="latestView<?php if($this->params->get('pageclass_sfx')) echo ' '.$this->params->get('pageclass_sfx'); ?>">
  10. <?php if($this->params->get('show_page_title')): ?>
  11. <header>
  12. <h1><?php echo $this->escape($this->params->get('page_title')); ?></h1>
  13. </header>
  14. <?php endif; ?>
  15. <?php foreach($this->blocks as $key=>$block): ?>
  16. <div class="itemsContainer" style="width:<?php echo number_format(99.0/$this->params->get('latestItemsCols'), 1); ?>%;">
  17. <?php if($this->params->get('latestItemsCols') > 1) : ?>
  18. <div class="itemsContainerWrap">
  19. <?php endif; ?>
  20. <?php if($this->source=='categories'): $category=$block; ?>
  21. <?php if($this->params->get('categoryFeed') || $this->params->get('categoryImage') || $this->params->get('categoryTitle') || $this->params->get('categoryDescription')): ?>
  22. <div class="itemsCategory">
  23. <?php if ($this->params->get('categoryImage') && !empty($category->image)): ?>
  24. <img src="<?php echo $category->image; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($category->name); ?>" style="width:<?php echo $this->params->get('catImageWidth'); ?>px;height:auto;" />
  25. <?php endif; ?>
  26. <?php if ($this->params->get('categoryTitle')): ?>
  27. <h2><a href="<?php echo $category->link; ?>"><?php echo $category->name; ?></a></h2>
  28. <?php endif; ?>
  29. <?php if ($this->params->get('categoryDescription') && isset($category->description)): ?>
  30. <p><?php echo $category->description; ?></p>
  31. <?php endif; ?>
  32. <?php echo $category->event->K2CategoryDisplay; ?>
  33. </div>
  34. <?php if($this->params->get('categoryFeed')): ?>
  35. <a class="k2FeedIcon" href="<?php echo $category->feed; ?>"><?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?></a>
  36. <?php endif; ?>
  37. <?php endif; ?>
  38. <?php else: $user=$block; ?>
  39. <?php if ($this->params->get('userFeed') || $this->params->get('userImage') || $this->params->get('userName') || $this->params->get('userDescription') || $this->params->get('userURL') || $this->params->get('userEmail')): ?>
  40. <div class="itemAuthorBlock">
  41. <?php if ($this->params->get('userImage') && !empty($user->avatar)): ?>
  42. <div class="gkAvatar">
  43. <img src="<?php echo $user->avatar; ?>" alt="<?php echo $user->name; ?>" style="width:<?php echo $this->params->get('userImageWidth'); ?>px;height:auto;" />
  44. </div>
  45. <?php endif; ?>
  46. <div class="itemAuthorDetails">
  47. <?php if ($this->params->get('userName')): ?>
  48. <h3><a rel="author" href="<?php echo $user->link; ?>"><?php echo $user->name; ?></a></h3>
  49. <?php endif; ?>
  50. <?php if ($this->params->get('userDescription') && isset($user->profile->description)): ?>
  51. <?php echo $user->profile->description; ?>
  52. <?php endif; ?>
  53. <?php if ($this->params->get('userURL') && isset($user->profile->url)): ?>
  54. <span class="itemAuthorURL">
  55. <?php echo JText::_('K2_WEBSITE_URL'); ?>: <a rel="me" href="<?php echo $user->profile->url; ?>" target="_blank"><?php echo $user->profile->url; ?></a>
  56. </span>
  57. <?php endif; ?>
  58. <?php if ($this->params->get('userEmail')): ?>
  59. <span class="itemAuthorEmail"> <?php echo JText::_('K2_EMAIL'); ?>: <?php echo JHTML::_('Email.cloak', $user->email); ?> </span>
  60. <?php endif; ?>
  61. </div>
  62. <?php echo $user->event->K2UserDisplay; ?>
  63. </div>
  64. <?php if($this->params->get('userFeed')): ?>
  65. <a class="k2FeedIcon" href="<?php echo $user->feed; ?>"><?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?></a>
  66. <?php endif; ?>
  67. <?php endif; ?>
  68. <?php endif; ?>
  69. <div class="itemList">
  70. <?php if($this->params->get('latestItemsDisplayEffect')=="first"): ?>
  71. <?php foreach ($block->items as $itemCounter=>$item): K2HelperUtilities::setDefaultImage($item, 'latest', $this->params); ?>
  72. <?php if($itemCounter==0): ?>
  73. <?php $this->item=$item; echo $this->loadTemplate('item'); ?>
  74. <?php else: ?>
  75. <h2 class="itemTitleList">
  76. <?php if ($item->params->get('latestItemTitleLinked')): ?>
  77. <a href="<?php echo $item->link; ?>"> <?php echo $item->title; ?> </a>
  78. <?php else: ?>
  79. <?php echo $item->title; ?>
  80. <?php endif; ?>
  81. </h2>
  82. <?php endif; ?>
  83. <?php endforeach; ?>
  84. <?php else: ?>
  85. <?php foreach ($block->items as $item): K2HelperUtilities::setDefaultImage($item, 'latest', $this->params); ?>
  86. <?php
  87. $this->item=$item;
  88. if($this->params->get('latestItemsCols') > 1) {
  89. echo $this->loadTemplate('item_columns');
  90. } else {
  91. echo $this->loadTemplate('item');
  92. }
  93. ?>
  94. <?php endforeach; ?>
  95. <?php endif; ?>
  96. </div>
  97. <?php if($this->params->get('latestItemsCols') > 1) : ?>
  98. </div>
  99. <?php endif; ?>
  100. </div>
  101. <?php if(($key+1)%($this->params->get('latestItemsCols'))==0): ?>
  102. <div class="clr"></div>
  103. <?php endif; ?>
  104. <?php endforeach; ?>
  105. </section>