Wicko

category_item.php

Jul 3rd, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.48 KB | None | 0 0
  1. <?php
  2. /**
  3. * @version $Id: category_item.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
  4. * @package K2
  5. * @author JoomlaWorks http://www.joomlaworks.net
  6. * @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
  7. * @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
  8. */
  9.  
  10. // no direct access
  11. defined('_JEXEC') or die;
  12.  
  13. // Define default image size (do not change)
  14. K2HelperUtilities::setDefaultImage($this->item, 'itemlist', $this->params);
  15.  
  16. ?>
  17.  
  18. <!-- Start K2 Item Layout -->
  19. <div class="catItemView group<?php echo ucfirst($this->item->itemGroup); ?><?php echo ($this->item->featured) ? ' catItemIsFeatured' : ''; ?><?php if($this->item->params->get('pageclass_sfx')) echo ' '.$this->item->params->get('pageclass_sfx'); ?>">
  20.  
  21. <!-- Plugins: BeforeDisplay -->
  22. <?php echo $this->item->event->BeforeDisplay; ?>
  23.  
  24. <!-- K2 Plugins: K2BeforeDisplay -->
  25. <?php echo $this->item->event->K2BeforeDisplay; ?>
  26.  
  27. <div class="catItemHeader">
  28. <?php if($this->item->params->get('catItemDateCreated')): ?>
  29. <!-- Date created -->
  30. <span class="catItemDateCreated">
  31. <?php echo JHTML::_('date', $this->item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>
  32. </span>
  33. <?php endif; ?>
  34.  
  35. <?php if($this->item->params->get('catItemTitle')): ?>
  36. <!-- Item title -->
  37. <h3 class="catItemTitle">
  38. <?php if(isset($this->item->editLink)): ?>
  39. <!-- Item edit link -->
  40. <span class="catItemEditLink">
  41. <a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $this->item->editLink; ?>">
  42. <?php echo JText::_('K2_EDIT_ITEM'); ?>
  43. </a>
  44. </span>
  45. <?php endif; ?>
  46.  
  47. <?php if ($this->item->params->get('catItemTitleLinked')): ?>
  48. <a href="<?php echo $this->item->link; ?>">
  49. <?php echo $this->item->title; ?>
  50. </a>
  51. <?php else: ?>
  52. <?php echo $this->item->title; ?>
  53. <?php endif; ?>
  54.  
  55. <?php if($this->item->params->get('catItemFeaturedNotice') && $this->item->featured): ?>
  56. <!-- Featured flag -->
  57. <span>
  58. <sup>
  59. <?php echo JText::_('K2_FEATURED'); ?>
  60. </sup>
  61. </span>
  62. <?php endif; ?>
  63. </h3>
  64. <?php endif; ?>
  65.  
  66. <?php if($this->item->params->get('catItemAuthor')): ?>
  67. <!-- Item Author -->
  68. <span class="catItemAuthor">
  69. <?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?>
  70. <?php if(isset($this->item->author->link) && $this->item->author->link): ?>
  71. <a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
  72. <?php else: ?>
  73. <?php echo $this->item->author->name; ?>
  74. <?php endif; ?>
  75. </span>
  76. <?php endif; ?>
  77. </div>
  78.  
  79. <!-- Plugins: AfterDisplayTitle -->
  80. <?php echo $this->item->event->AfterDisplayTitle; ?>
  81.  
  82. <!-- K2 Plugins: K2AfterDisplayTitle -->
  83. <?php echo $this->item->event->K2AfterDisplayTitle; ?>
  84.  
  85. <?php if($this->item->params->get('catItemRating')): ?>
  86. <!-- Item Rating -->
  87. <div class="catItemRatingBlock">
  88. <span><?php echo JText::_('K2_RATE_THIS_ITEM'); ?></span>
  89. <div class="itemRatingForm">
  90. <ul class="itemRatingList">
  91. <li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li>
  92. <li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li>
  93. <li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li>
  94. <li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li>
  95. <li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li>
  96. <li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li>
  97. </ul>
  98. <div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"><?php echo $this->item->numOfvotes; ?></div>
  99. <div class="clr"></div>
  100. </div>
  101. <div class="clr"></div>
  102. </div>
  103. <?php endif; ?>
  104.  
  105. <div class="catItemBody">
  106.  
  107. <!-- Plugins: BeforeDisplayContent -->
  108. <?php echo $this->item->event->BeforeDisplayContent; ?>
  109.  
  110. <!-- K2 Plugins: K2BeforeDisplayContent -->
  111. <?php echo $this->item->event->K2BeforeDisplayContent; ?>
  112.  
  113. <?php if($this->item->params->get('catItemImage') && !empty($this->item->image)): ?>
  114. <!-- Item Image -->
  115. <div class="catItemImageBlock">
  116. <span class="catItemImage">
  117. <a href="<?php echo $this->item->link; ?>" title="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>">
  118. <img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
  119. </a>
  120. </span>
  121. <div class="clr"></div>
  122. </div>
  123. <?php endif; ?>
  124.  
  125. <?php if($this->item->params->get('catItemIntroText')): ?>
  126. <!-- Item introtext -->
  127. <div class="catItemIntroText">
  128. <?php echo $this->item->introtext; ?>
  129. </div>
  130. <?php endif; ?>
  131.  
  132. <div class="clr"></div>
  133.  
  134. <?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?>
  135. <!-- Item extra fields -->
  136. <div class="catItemExtraFields">
  137. <h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4>
  138. <ul>
  139. <?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
  140. <?php if($extraField->value != ''): ?>
  141. <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
  142. <?php if($extraField->type == 'header'): ?>
  143. <h4 class="catItemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
  144. <?php else: ?>
  145. <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
  146. <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
  147. <?php endif; ?>
  148. </li>
  149. <?php endif; ?>
  150. <?php endforeach; ?>
  151. </ul>
  152. <div class="clr"></div>
  153. </div>
  154. <?php endif; ?>
  155.  
  156. <!-- Plugins: AfterDisplayContent -->
  157. <?php echo $this->item->event->AfterDisplayContent; ?>
  158.  
  159. <!-- K2 Plugins: K2AfterDisplayContent -->
  160. <?php echo $this->item->event->K2AfterDisplayContent; ?>
  161.  
  162. <div class="clr"></div>
  163. </div>
  164.  
  165. <?php if(
  166. $this->item->params->get('catItemHits') ||
  167. $this->item->params->get('catItemCategory') ||
  168. $this->item->params->get('catItemTags') ||
  169. $this->item->params->get('catItemAttachments')
  170. ): ?>
  171. <div class="catItemLinks">
  172.  
  173. <?php if($this->item->params->get('catItemHits')): ?>
  174. <!-- Item Hits -->
  175. <div class="catItemHitsBlock">
  176. <span class="catItemHits">
  177. <?php echo JText::_('K2_READ'); ?> <b><?php echo $this->item->hits; ?></b> <?php echo JText::_('K2_TIMES'); ?>
  178. </span>
  179. </div>
  180. <?php endif; ?>
  181.  
  182. <?php if($this->item->params->get('catItemCategory')): ?>
  183. <!-- Item category name -->
  184. <div class="catItemCategory">
  185. <span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span>
  186. <a href="<?php echo $this->item->category->link; ?>"><?php echo $this->item->category->name; ?></a>
  187. </div>
  188. <?php endif; ?>
  189.  
  190. <?php if($this->item->params->get('catItemTags') && count($this->item->tags)): ?>
  191. <!-- Item tags -->
  192. <div class="catItemTagsBlock">
  193. <span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span>
  194. <ul class="catItemTags">
  195. <?php foreach ($this->item->tags as $tag): ?>
  196. <li><a href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?></a></li>
  197. <?php endforeach; ?>
  198. </ul>
  199. <div class="clr"></div>
  200. </div>
  201. <?php endif; ?>
  202.  
  203. <?php if($this->item->params->get('catItemAttachments') && count($this->item->attachments)): ?>
  204. <!-- Item attachments -->
  205. <div class="catItemAttachmentsBlock">
  206. <span><?php echo JText::_('K2_DOWNLOAD_ATTACHMENTS'); ?></span>
  207. <ul class="catItemAttachments">
  208. <?php foreach ($this->item->attachments as $attachment): ?>
  209. <li>
  210. <a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $attachment->link; ?>">
  211. <?php echo $attachment->title ; ?>
  212. </a>
  213. <?php if($this->item->params->get('catItemAttachmentsCounter')): ?>
  214. <span>(<?php echo $attachment->hits; ?> <?php echo ($attachment->hits==1) ? JText::_('K2_DOWNLOAD') : JText::_('K2_DOWNLOADS'); ?>)</span>
  215. <?php endif; ?>
  216. </li>
  217. <?php endforeach; ?>
  218. </ul>
  219. </div>
  220. <?php endif; ?>
  221.  
  222. <div class="clr"></div>
  223. </div>
  224. <?php endif; ?>
  225.  
  226. <div class="clr"></div>
  227.  
  228. <?php if($this->item->params->get('catItemVideo') && !empty($this->item->video)): ?>
  229. <!-- Item video -->
  230. <div class="catItemVideoBlock">
  231. <h3><?php echo JText::_('K2_RELATED_VIDEO'); ?></h3>
  232. <?php if($this->item->videoType=='embedded'): ?>
  233. <div class="catItemVideoEmbedded">
  234. <?php echo $this->item->video; ?>
  235. </div>
  236. <?php else: ?>
  237. <span class="catItemVideo"><?php echo $this->item->video; ?></span>
  238. <?php endif; ?>
  239. </div>
  240. <?php endif; ?>
  241.  
  242. <?php if($this->item->params->get('catItemImageGallery') && !empty($this->item->gallery)): ?>
  243. <!-- Item image gallery -->
  244. <div class="catItemImageGallery">
  245. <h4><?php echo JText::_('K2_IMAGE_GALLERY'); ?></h4>
  246. <?php echo $this->item->gallery; ?>
  247. </div>
  248. <?php endif; ?>
  249.  
  250. <div class="clr"></div>
  251.  
  252. <?php if($this->item->params->get('catItemCommentsAnchor') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>
  253. <!-- Anchor link to comments below -->
  254. <div class="catItemCommentsLink">
  255. <?php if(!empty($this->item->event->K2CommentsCounter)): ?>
  256. <!-- K2 Plugins: K2CommentsCounter -->
  257. <?php echo $this->item->event->K2CommentsCounter; ?>
  258. <?php else: ?>
  259. <?php if($this->item->numOfComments > 0): ?>
  260. <a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
  261. <?php echo $this->item->numOfComments; ?> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
  262. </a>
  263. <?php else: ?>
  264. <a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
  265. <?php echo JText::_('K2_BE_THE_FIRST_TO_COMMENT'); ?>
  266. </a>
  267. <?php endif; ?>
  268. <?php endif; ?>
  269. </div>
  270. <?php endif; ?>
  271.  
  272. <?php if ($this->item->params->get('catItemReadMore')): ?>
  273. <!-- Item "read more..." link -->
  274. <div class="catItemReadMore">
  275. <a class="k2ReadMore" href="<?php echo $this->item->link; ?>">
  276. <?php echo JText::_('K2_READ_MORE'); ?>
  277. </a>
  278. </div>
  279. <?php endif; ?>
  280.  
  281. <div class="clr"></div>
  282.  
  283. <?php if($this->item->params->get('catItemDateModified')): ?>
  284. <!-- Item date modified -->
  285. <?php if($this->item->modified != $this->nullDate && $this->item->modified != $this->item->created ): ?>
  286. <span class="catItemDateModified">
  287. <?php echo JText::_('K2_LAST_MODIFIED_ON'); ?> <?php echo JHTML::_('date', $this->item->modified, JText::_('K2_DATE_FORMAT_LC2')); ?>
  288. </span>
  289. <?php endif; ?>
  290. <?php endif; ?>
  291.  
  292. <!-- Plugins: AfterDisplay -->
  293. <?php echo $this->item->event->AfterDisplay; ?>
  294.  
  295. <!-- K2 Plugins: K2AfterDisplay -->
  296. <?php echo $this->item->event->K2AfterDisplay; ?>
  297.  
  298. <div class="clr"></div>
  299. </div>
  300. <!-- End K2 Item Layout -->
Advertisement
Add Comment
Please, Sign In to add comment