Guest User

item.php

a guest
Apr 3rd, 2011
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 26.19 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @version     $Id: item.php 502 2010-06-24 20:33:42Z joomlaworks $
  4.  * @package     K2
  5.  * @author      JoomlaWorks http://www.joomlaworks.gr
  6.  * @copyright   Copyright (c) 2006 - 2010 JoomlaWorks, a business unit of Nuevvo Webware 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('Restricted access');
  12.  
  13. ?>
  14. <script>
  15.   window.addEvent('domready',function () {
  16.     $$('div.itemExtraFields ul li').each(function(element,index) {
  17.       element.removeClass('even');
  18.       element.removeClass('odd');
  19.       element.addClass(index%2 ? 'odd' : 'even');
  20.     });
  21.   });
  22. </script>
  23. <!-- Start K2 Item Layout -->
  24. <span id="startOfPageId<?php echo JRequest::getInt('id'); ?>"></span>
  25.  
  26. <div id="k2Container" class="itemView<?php echo ($this->item->featured) ? ' itemIsFeatured' : ''; ?><?php if($this->item->params->get('pageclass_sfx')) echo ' '.$this->item->params->get('pageclass_sfx'); ?>">
  27.  
  28.     <!-- Plugins: BeforeDisplay -->
  29.     <?php echo $this->item->event->BeforeDisplay; ?>
  30.  
  31.     <!-- K2 Plugins: K2BeforeDisplay -->
  32.     <?php echo $this->item->event->K2BeforeDisplay; ?>
  33.  
  34.     <?php if(isset($this->item->editLink)): ?>
  35.     <!-- Item edit link -->
  36.     <span class="itemEditLink">
  37.         <a class="modal" rel="{handler:'iframe',size:{x:990,y:650}}" href="<?php echo $this->item->editLink; ?>">
  38.             <?php echo JText::_('Edit item'); ?>
  39.         </a>
  40.     </span>
  41.     <?php endif; ?>
  42.  
  43.     <div class="itemHeader">
  44.        
  45.         <?php if($this->item->params->get('itemDateCreated')): ?>
  46.         <!-- Date created -->
  47.         <span class="itemDateCreated">
  48.             <?php echo JHTML::_('date', $this->item->created , JText::_('DATE_FORMAT_LC2')); ?>
  49.         </span>
  50.         <?php endif; ?>
  51.  
  52.       <?php if($this->item->params->get('itemTitle')): ?>
  53.       <!-- Item title -->
  54.       <h1 class="itemTitle">
  55.         <?php echo $this->item->title; ?>
  56.  
  57.       </h1>
  58.       <?php endif; ?>
  59.  
  60.         <?php if($this->item->params->get('itemAuthor')): ?>
  61.         <!-- Item Author -->
  62.         <span class="itemAuthor">
  63.             <?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?>&nbsp;
  64.             <?php if(empty($this->item->created_by_alias)): ?>
  65.             <a href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
  66.             <?php else: ?>
  67.             <?php echo $this->item->author->name; ?>
  68.             <?php endif; ?>
  69.         </span>
  70.         <?php endif; ?>
  71.  
  72.   </div>
  73.  
  74.   <!-- Plugins: AfterDisplayTitle -->
  75.   <?php echo $this->item->event->AfterDisplayTitle; ?>
  76.  
  77.   <!-- K2 Plugins: K2AfterDisplayTitle -->
  78.   <?php echo $this->item->event->K2AfterDisplayTitle; ?>
  79.  
  80.     <?php if(
  81.         $this->item->params->get('itemFontResizer') ||
  82.         $this->item->params->get('itemPrintButton') ||
  83.         $this->item->params->get('itemEmailButton') ||
  84.         $this->item->params->get('itemSocialButton') ||
  85.         $this->item->params->get('itemVideoAnchor') ||
  86.         $this->item->params->get('itemImageGalleryAnchor') ||
  87.         $this->item->params->get('itemCommentsAnchor')
  88.     ): ?>
  89.   <div class="itemToolbar">
  90.         <ul>
  91.             <?php if($this->item->params->get('itemFontResizer')): ?>
  92.             <!-- Font Resizer -->
  93.             <li>
  94.                 <span class="itemTextResizerTitle"><?php echo JText::_('font size'); ?></span>
  95.                 <a href="#" id="fontDecrease">
  96.                     <span><?php echo JText::_('decrease font size'); ?></span>
  97.                     <img src="components/com_k2/images/system/blank.gif" alt="<?php echo JText::_('decrease font size'); ?>" />
  98.                 </a>
  99.                 <a href="#" id="fontIncrease">
  100.                     <span><?php echo JText::_('increase font size'); ?></span>
  101.                     <img src="components/com_k2/images/system/blank.gif" alt="<?php echo JText::_('increase font size'); ?>" />
  102.                 </a>
  103.             </li>
  104.             <?php endif; ?>
  105.  
  106.             <?php if($this->item->params->get('itemPrintButton')): ?>
  107.             <!-- Print Button -->
  108.             <li>
  109.                 <?php if(JRequest::getCmd('print')==1): ?>
  110.                 <a class="itemPrintLink" href="<?php echo $this->item->printLink; ?>" onclick="window.print();return false;">
  111.                     <span><?php echo JText::_('Print'); ?></span>
  112.                 </a>
  113.                 <?php else: ?>
  114.                 <a class="modal itemPrintLink" href="<?php echo $this->item->printLink; ?>" rel="{handler:'iframe',size:{x:900,y:500}}">
  115.                     <span><?php echo JText::_('Print'); ?></span>
  116.                 </a>
  117.                 <?php endif; ?>
  118.             </li>
  119.             <?php endif; ?>
  120.  
  121.             <?php if($this->item->params->get('itemEmailButton') && (!JRequest::getInt('print')) ): ?>
  122.             <!-- Email Button -->
  123.             <li>
  124.                 <a class="itemEmailLink" onclick="window.open(this.href,'win2','width=400,height=350,menubar=yes,resizable=yes'); return false;" href="<?php echo $this->item->emailLink; ?>">
  125.                     <span><?php echo JText::_('E-mail'); ?></span>
  126.                 </a>
  127.             </li>
  128.             <?php endif; ?>
  129.  
  130.             <?php if($this->item->params->get('itemSocialButton') && !is_null($this->item->params->get('socialButtonCode', NULL))): ?>
  131.             <!-- Item Social Button -->
  132.             <li>
  133.                 <?php echo $this->item->params->get('socialButtonCode'); ?>
  134.             </li>
  135.             <?php endif; ?>
  136.  
  137.             <?php if($this->item->params->get('itemVideoAnchor') && !empty($this->item->video)): ?>
  138.             <!-- Anchor link to item video below - if it exists -->
  139.             <li>
  140.                 <a class="itemVideoLink k2Anchor" href="<?php echo $this->item->link; ?>#itemVideoAnchor"><?php echo JText::_('Video'); ?></a>
  141.             </li>
  142.             <?php endif; ?>
  143.  
  144.             <?php if($this->item->params->get('itemImageGalleryAnchor') && !empty($this->item->gallery)): ?>
  145.             <!-- Anchor link to item image gallery below - if it exists -->
  146.             <li>
  147.                 <a class="itemImageGalleryLink k2Anchor" href="<?php echo $this->item->link; ?>#itemImageGalleryAnchor"><?php echo JText::_('Image Gallery'); ?></a>
  148.             </li>
  149.             <?php endif; ?>
  150.  
  151.             <?php if($this->item->params->get('itemCommentsAnchor') && $this->item->params->get('itemComments') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>
  152.             <!-- Anchor link to comments below - if enabled -->
  153.             <li>
  154.                 <?php if(!empty($this->item->event->K2CommentsCounter)):?>
  155.                     <!-- K2 Plugins: K2CommentsCounter -->
  156.                     <?php echo $this->item->event->K2CommentsCounter; ?>
  157.                 <?php else:?>
  158.                     <?php if($this->item->numOfComments > 0): ?>
  159.                     <a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
  160.                         <span><?php echo $this->item->numOfComments; ?></span> <?php echo ($this->item->numOfComments>1) ? JText::_('comments') : JText::_('comment'); ?>
  161.                     </a>
  162.                     <?php else: ?>
  163.                     <a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
  164.                         <?php echo JText::_('Be the first to comment!'); ?>
  165.                     </a>
  166.                     <?php endif; ?>
  167.                 <?php endif; ?>
  168.             </li>
  169.             <?php endif; ?>
  170.         </ul>
  171.         <div class="clr"></div>
  172.   </div>
  173.     <?php endif; ?>
  174.  
  175.     <?php if($this->item->params->get('itemRating')): ?>
  176.     <!-- Item Rating -->
  177.     <div class="itemRatingBlock">
  178.         <span><?php echo JText::_('Rate this item'); ?></span>
  179.         <div class="itemRatingForm">
  180.             <ul class="itemRatingList">
  181.                 <li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li>
  182.                 <li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('1 star out of 5'); ?>" class="one-star">1</a></li>
  183.                 <li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('2 stars out of 5'); ?>" class="two-stars">2</a></li>
  184.                 <li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('3 stars out of 5'); ?>" class="three-stars">3</a></li>
  185.                 <li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('4 stars out of 5'); ?>" class="four-stars">4</a></li>
  186.                 <li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('5 stars out of 5'); ?>" class="five-stars">5</a></li>
  187.             </ul>
  188.             <div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"><?php echo $this->item->numOfvotes; ?></div>
  189.             <div class="clr"></div>
  190.         </div>
  191.         <div class="clr"></div>
  192.     </div>
  193.     <?php endif; ?>
  194.  
  195.   <div class="itemBody">
  196.  
  197.       <!-- Plugins: BeforeDisplayContent -->
  198.       <?php echo $this->item->event->BeforeDisplayContent; ?>
  199.  
  200.       <!-- K2 Plugins: K2BeforeDisplayContent -->
  201.       <?php echo $this->item->event->K2BeforeDisplayContent; ?>
  202.  
  203.       <?php if($this->item->params->get('itemImage') && !empty($this->item->image)): ?>
  204.       <!-- Item Image -->
  205.       <div class="itemImageBlock">
  206.           <span class="itemImage">
  207.  
  208.             <a class="modal" href="<?php echo $this->item->imageXLarge; ?>" title="<?php echo JText::_('Click to preview image'); ?>">
  209.                 <img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
  210.             </a>
  211.           </span>
  212.  
  213.           <?php if($this->item->params->get('itemImageMainCaption') && !empty($this->item->image_caption)): ?>
  214.           <!-- Image caption -->
  215.           <span class="itemImageCaption"><?php echo $this->item->image_caption; ?></span>
  216.           <?php endif; ?>
  217.  
  218.           <?php if($this->item->params->get('itemImageMainCredits') && !empty($this->item->image_credits)): ?>
  219.           <!-- Image credits -->
  220.           <span class="itemImageCredits"><?php echo $this->item->image_credits; ?></span>
  221.           <?php endif; ?>
  222.  
  223.           <div class="clr"></div>
  224.       </div>
  225.       <?php endif; ?>
  226.  
  227.       <?php if(!empty($this->item->fulltext)): ?>
  228.  
  229.       <?php if($this->item->params->get('itemIntroText')): ?>
  230.       <!-- Item introtext -->
  231.       <div class="itemIntroText">
  232.         <?php echo $this->item->introtext; ?>
  233.       </div>
  234.       <?php endif; ?>
  235.  
  236.       <?php if($this->item->params->get('itemFullText')): ?>
  237.       <!-- Item fulltext -->
  238.       <div class="itemFullText">
  239.         <?php echo $this->item->fulltext; ?>
  240.       </div>
  241.       <?php endif; ?>
  242.  
  243.       <?php else: ?>
  244.  
  245.       <!-- Item text -->
  246.       <div class="itemFullText">
  247.         <?php echo $this->item->introtext; ?>
  248.       </div>
  249.  
  250.       <?php endif; ?>
  251.  
  252.         <div class="clr"></div>
  253.  
  254.       <?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
  255.       <!-- Item extra fields -->
  256.       <div class="itemExtraFields">
  257.         <h3><?php echo JText::_('Extra Fields'); //You can change that "Extra fields" part to whatever ?></h3>
  258.         <ul>
  259.            
  260.             <?php $exfields = $this->item->extra_fields; ?> <!--This part puts the extra fields in a variable-->
  261.             <li><?php if($exfields[1]->value) echo $exfields[1]->value;?></li>
  262.             <li><?php if($exfields[2]->value) echo $exfields[2]->value;?></li>
  263.             <li><?php if($exfields[3]->value) echo $exfields[3]->value;?></li>
  264.             <li><?php if($exfields[4]->value) echo $exfields[4]->value;?></li>
  265.             <li><?php if($exfields[5]->value) echo $exfields[5]->value;?></li>
  266.             <li><?php if($exfields[6]->value) echo $exfields[6]->value;?></li>
  267.             <li><?php if($exfields[7]->value) echo $exfields[7]->value;?></li>
  268.             <li><?php if($exfields[8]->value) echo $exfields[8]->value;?></li>
  269.             </ul>
  270.         <div class="clr"></div>
  271.       </div>
  272.       <?php endif; ?>
  273.  
  274.         <?php if($this->item->params->get('itemDateModified') && intval($this->item->modified)!=0):?>
  275.         <!-- Item date modified -->
  276.         <?php if($this->item->created != $this->item->modified): ?>
  277.         <span class="itemDateModified">
  278.             <?php echo JText::_('Last modified on'); ?> <?php echo JHTML::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC2')); ?>
  279.         </span>
  280.         <?php endif; ?>
  281.         <?php endif; ?>
  282.  
  283.       <!-- Plugins: AfterDisplayContent -->
  284.       <?php echo $this->item->event->AfterDisplayContent; ?>
  285.  
  286.       <!-- K2 Plugins: K2AfterDisplayContent -->
  287.       <?php echo $this->item->event->K2AfterDisplayContent; ?>
  288.  
  289.       <div class="clr"></div>
  290.   </div>
  291.  
  292.   <?php if(
  293.   $this->item->params->get('itemHits') ||
  294.   $this->item->params->get('itemTwitterLink') ||
  295.   $this->item->params->get('itemCategory') ||
  296.   $this->item->params->get('itemTags') ||
  297.   $this->item->params->get('itemShareLinks') ||
  298.   $this->item->params->get('itemAttachments')
  299.   ): ?>
  300.   <div class="itemLinks">
  301.  
  302.         <?php if($this->item->params->get('itemHits') || $this->item->params->get('itemTwitterLink')): ?>
  303.         <div class="itemHitsTwitter">
  304.             <?php if($this->item->params->get('itemHits')): ?>
  305.             <!-- Item Hits -->
  306.             <span class="itemHits">
  307.                 <?php echo JText::_('Read'); ?> <b><?php echo $this->item->hits; ?></b> <?php echo JText::_('times'); ?>
  308.             </span>
  309.             <?php endif; ?>
  310.  
  311.             <?php if($this->item->params->get('itemHits') && $this->item->params->get('itemTwitterLink') && $this->item->params->get('twitterUsername')): ?>
  312.             <span class="itemHitsTwitterSep">|</span>
  313.             <?php endif; ?>
  314.  
  315.             <?php if($this->item->params->get('itemTwitterLink') && $this->item->params->get('twitterUsername')): ?>
  316.             <!-- Twitter Link -->
  317.             <span class="itemTwitterLink">
  318.                 <a title="<?php echo JText::_('Like this? Tweet it to your followers!'); ?>" href="<?php echo $this->item->twitterURL; ?>" target="_blank">
  319.                     <?php echo JText::_('Like this? Tweet it to your followers!'); ?>
  320.                 </a>
  321.             </span>
  322.             <?php endif; ?>
  323.  
  324.             <div class="clr"></div>
  325.         </div>
  326.         <?php endif; ?>
  327.  
  328.         <?php if($this->item->params->get('itemCategory')): ?>
  329.         <!-- Item category name -->
  330.         <div class="itemCategory">
  331.             <span><?php echo JText::_('Published in'); ?></span>
  332.             <a href="<?php echo $this->item->category->link; ?>"><?php echo $this->item->category->name; ?></a>
  333.         </div>
  334.         <?php endif; ?>
  335.  
  336.       <?php if($this->item->params->get('itemTags') && count($this->item->tags)): ?>
  337.       <!-- Item tags -->
  338.       <div class="itemTagsBlock">
  339.           <span><?php echo JText::_("Tagged under"); ?></span>
  340.           <ul class="itemTags">
  341.             <?php foreach ($this->item->tags as $tag): ?>
  342.             <li><a href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?></a></li>
  343.             <?php endforeach; ?>
  344.           </ul>
  345.           <div class="clr"></div>
  346.       </div>
  347.       <?php endif; ?>
  348.  
  349.       <?php if($this->item->params->get('itemShareLinks')): ?>
  350.       <!-- Item social links -->
  351.         <div class="itemSocialLinksBlock">
  352.             <span><?php echo JText::_("Social sharing"); ?></span>
  353.             <ul class="itemSocialLinks">
  354.                 <li><a class="googlebuzz" title="<?php echo JText::_("Add to Google Buzz"); ?>" href="http://www.google.com/buzz/post?url=<?php echo $this->item->socialLink; ?>&amp;message=<?php echo urlencode($this->item->title); ?>" target="_blank"><span><?php echo JText::_("Add to Google Buzz"); ?></span></a></li>
  355.                 <li><a class="facebook" title="<?php echo JText::_("Add to Facebook"); ?>" href="http://www.facebook.com/sharer.php?u=<?php echo $this->item->socialLink; ?>&amp;t=<?php echo urlencode($this->item->title); ?>" target="_blank"><span><?php echo JText::_("Add to Facebook"); ?></span></a></li>
  356.                 <li><a class="delicious" title="<?php echo JText::_("Add to Delicious"); ?>" href="http://del.icio.us/post?url=<?php echo $this->item->socialLink; ?>&amp;title=<?php echo urlencode($this->item->title); ?>" target="_blank"><span><?php echo JText::_("Add to Delicious"); ?></span></a></li>
  357.                 <li><a class="digg" title="<?php echo JText::_("Digg this"); ?>" href="http://digg.com/submit?url=<?php echo $this->item->socialLink; ?>&amp;title=<?php echo urlencode($this->item->title); ?>" target="_blank"><span><?php echo JText::_("Digg this"); ?></span></a></li>
  358.                 <li><a class="reddit" title="<?php echo JText::_("Add to Reddit"); ?>" href="http://reddit.com/submit?url=<?php echo $this->item->socialLink; ?>&amp;title=<?php echo urlencode($this->item->title); ?>" target="_blank"><span><?php echo JText::_("Add to Reddit"); ?></span></a></li>
  359.                 <li><a class="stumble" title="<?php echo JText::_("Add to StumbleUpon"); ?>" href="http://www.stumbleupon.com/submit?url=<?php echo $this->item->socialLink; ?>&amp;title=<?php echo urlencode($this->item->title); ?>" target="_blank"><span><?php echo JText::_("Add to StumbleUpon"); ?></span></a></li>
  360.                 <li><a class="myspace" title="<?php echo JText::_("Add to MySpace"); ?>" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=<?php echo $this->item->socialLink; ?>&amp;t=<?php echo urlencode($this->item->title); ?>" target="_blank"><span><?php echo JText::_("Add to MySpace"); ?></span></a></li>
  361.                 <li><a class="technorati" title="<?php echo JText::_("Add to Technorati"); ?>" href="http://www.technorati.com/faves?add=<?php echo $this->item->socialLink; ?>" target="_blank"><span><?php echo JText::_("Add to Technorati"); ?></span></a></li>
  362.                 <li class="clr"></li>
  363.             </ul>
  364.             <div class="clr"></div>
  365.         </div>
  366.       <?php endif; ?>
  367.  
  368.       <?php if($this->item->params->get('itemAttachments') && count($this->item->attachments)): ?>
  369.       <!-- Item attachments -->
  370.       <div class="itemAttachmentsBlock">
  371.           <span><?php echo JText::_("Download attachments:"); ?></span>
  372.           <ul class="itemAttachments">
  373.             <?php foreach ($this->item->attachments as $attachment): ?>
  374.             <li>
  375.                 <a title="<?php echo htmlentities($attachment->titleAttribute, ENT_QUOTES, 'UTF-8'); ?>" href="<?php echo JRoute::_('index.php?option=com_k2&view=item&task=download&id='.$attachment->id); ?>">
  376.                     <?php echo $attachment->title ; ?>
  377.                 </a>
  378.                 <?php if($this->item->params->get('itemAttachmentsCounter')): ?>
  379.                 <span>(<?php echo $attachment->hits; ?> <?php echo (count($attachment->hits)==1) ? JText::_("download") : JText::_("downloads"); ?>)</span>
  380.                 <?php endif; ?>
  381.             </li>
  382.             <?php endforeach; ?>
  383.           </ul>
  384.       </div>
  385.       <?php endif; ?>
  386.  
  387.         <div class="clr"></div>
  388.   </div>
  389.   <?php endif; ?>
  390.  
  391.   <?php if($this->item->params->get('itemAuthorBlock') && empty($this->item->created_by_alias)):?>
  392.   <!-- Author Block -->
  393.   <div class="itemAuthorBlock">
  394.  
  395.     <?php if($this->item->params->get('itemAuthorImage') && !empty($this->item->author->avatar)):?>
  396.     <img class="itemAuthorAvatar" src="<?php echo $this->item->author->avatar; ?>" alt="<?php echo $this->item->author->name; ?>" />
  397.     <?php endif; ?>
  398.  
  399.     <div class="itemAuthorDetails">
  400.       <h3 class="itemAuthorName">
  401.         <a href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
  402.       </h3>
  403.  
  404.       <?php if($this->item->params->get('itemAuthorDescription') && !empty($this->item->author->profile->description)):?>
  405.       <p><?php echo $this->item->author->profile->description; ?></p>
  406.       <?php endif; ?>
  407.  
  408.       <?php if($this->item->params->get('itemAuthorURL') && !empty($this->item->author->profile->url)):?>
  409.       <span class="itemAuthorUrl"><?php echo JText::_("Website:"); ?> <a href="<?php echo $this->item->author->profile->url; ?>" target="_blank" rel="nofollow"><?php echo str_replace('http://','',$this->item->author->profile->url); ?></a></span>
  410.       <?php endif; ?>
  411.  
  412.       <?php if($this->item->params->get('itemAuthorEmail')):?>
  413.       <span class="itemAuthorEmail"><?php echo JText::_("E-mail:"); ?> <?php echo JHTML::_('Email.cloak', $this->item->author->email); ?></span>
  414.       <?php endif; ?>
  415.  
  416.             <div class="clr"></div>
  417.  
  418.             <!-- K2 Plugins: K2UserDisplay -->
  419.             <?php echo $this->item->event->K2UserDisplay; ?>
  420.  
  421.     </div>
  422.     <div class="clr"></div>
  423.   </div>
  424.   <?php endif; ?>
  425.  
  426.   <?php if($this->item->params->get('itemAuthorLatest') && empty($this->item->created_by_alias) && isset($this->authorLatestItems)): ?>
  427.   <!-- Latest items from author -->
  428.     <div class="itemAuthorLatest">
  429.         <h3><?php echo JText::_("Latest from"); ?> <?php echo $this->item->author->name; ?></h3>
  430.         <ul>
  431.             <?php foreach($this->authorLatestItems as $key=>$item): ?>
  432.             <li class="<?php echo ($key%2) ? "odd" : "even"; ?>">
  433.                 <a href="<?php echo $item->link ?>"><?php echo $item->title; ?></a>
  434.             </li>
  435.             <?php endforeach; ?>
  436.         </ul>
  437.         <div class="clr"></div>
  438.     </div>
  439.     <?php endif; ?>
  440.  
  441.   <?php if($this->item->params->get('itemRelated') && isset($this->relatedItems)): ?>
  442.   <!-- Related items by tag -->
  443.     <div class="itemRelated">
  444.         <h3><?php echo JText::_("Related items (by tag)"); ?></h3>
  445.         <ul>
  446.             <?php foreach($this->relatedItems as $key=>$item): ?>
  447.             <li class="<?php echo ($key%2) ? "odd" : "even"; ?>">
  448.                 <a href="<?php echo $item->link ?>"><?php echo $item->title; ?></a>
  449.             </li>
  450.             <?php endforeach; ?>
  451.         </ul>
  452.         <div class="clr"></div>
  453.     </div>
  454.     <?php endif; ?>
  455.  
  456.     <div class="clr"></div>
  457.  
  458.   <?php if($this->item->params->get('itemVideo') && !empty($this->item->video)): ?>
  459.   <!-- Item video -->
  460.   <a name="itemVideoAnchor" id="itemVideoAnchor"></a>
  461.  
  462.   <div class="itemVideoBlock">
  463.     <h3><?php echo JText::_('Related Video'); ?></h3>
  464.  
  465.         <?php if($this->item->videoType=='embedded'): ?>
  466.         <div class="itemVideoEmbedded">
  467.             <?php echo $this->item->video; ?>
  468.         </div>
  469.         <?php else: ?>
  470.         <span class="itemVideo"><?php echo $this->item->video; ?></span>
  471.         <?php endif; ?>
  472.  
  473.       <?php if($this->item->params->get('itemVideoCaption') && !empty($this->item->video_caption)): ?>
  474.       <span class="itemVideoCaption"><?php echo $this->item->video_caption; ?></span>
  475.       <?php endif; ?>
  476.  
  477.       <?php if($this->item->params->get('itemVideoCredits') && !empty($this->item->video_credits)): ?>
  478.       <span class="itemVideoCredits"><?php echo $this->item->video_credits; ?></span>
  479.       <?php endif; ?>
  480.  
  481.       <div class="clr"></div>
  482.   </div>
  483.   <?php endif; ?>
  484.  
  485.   <?php if($this->item->params->get('itemImageGallery') && !empty($this->item->gallery)): ?>
  486.   <!-- Item image gallery -->
  487.   <a name="itemImageGalleryAnchor" id="itemImageGalleryAnchor"></a>
  488.   <div class="itemImageGallery">
  489.       <h3><?php echo JText::_('Image Gallery'); ?></h3>
  490.       <?php echo $this->item->gallery; ?>
  491.   </div>
  492.   <?php endif; ?>
  493.  
  494.   <?php if($this->item->params->get('itemNavigation') && !JRequest::getCmd('print') && (isset($this->item->nextLink) || isset($this->item->previousLink))): ?>
  495.   <!-- Item navigation -->
  496.   <div class="itemNavigation">
  497.     <span class="itemNavigationTitle"><?php echo JText::_('More in this category:'); ?></span>
  498.  
  499.         <?php if(isset($this->item->previousLink)): ?>
  500.         <a class="itemPrevious" href="<?php echo $this->item->previousLink; ?>">
  501.             &laquo; <?php echo $this->item->previousTitle; ?>
  502.         </a>
  503.         <?php endif; ?>
  504.  
  505.         <?php if(isset($this->item->nextLink)): ?>
  506.         <a class="itemNext" href="<?php echo $this->item->nextLink; ?>">
  507.             <?php echo $this->item->nextTitle; ?> &raquo;
  508.         </a>
  509.         <?php endif; ?>
  510.  
  511.   </div>
  512.   <?php endif; ?>
  513.  
  514.   <!-- Plugins: AfterDisplay -->
  515.   <?php echo $this->item->event->AfterDisplay; ?>
  516.  
  517.   <!-- K2 Plugins: K2AfterDisplay -->
  518.   <?php echo $this->item->event->K2AfterDisplay; ?>
  519.  
  520.   <?php if($this->item->params->get('itemComments') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1'))):?>
  521.   <!-- K2 Plugins: K2CommentsBlock -->
  522.   <?php echo $this->item->event->K2CommentsBlock; ?>
  523.   <?php endif;?>
  524.  
  525.  <?php if($this->item->params->get('itemComments') && !JRequest::getInt('print') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2')) && empty($this->item->event->K2CommentsBlock)):?>
  526.   <!-- Item comments -->
  527.   <a name="itemCommentsAnchor" id="itemCommentsAnchor"></a>
  528.  
  529.   <div class="itemComments">
  530.  
  531.       <?php if($this->item->params->get('commentsFormPosition')=='above' && $this->item->params->get('itemComments') && !JRequest::getInt('print') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2' && K2HelperPermissions::canAddComment($this->item->catid)))): ?>
  532.       <!-- Item comments form -->
  533.       <div class="itemCommentsForm">
  534.         <?php echo $this->loadTemplate('comments_form'); ?>
  535.       </div>
  536.       <?php endif; ?>
  537.  
  538.       <?php if($this->item->numOfComments>0 && $this->item->params->get('itemComments') && !JRequest::getInt('print') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2'))): ?>
  539.       <!-- Item user comments -->
  540.       <h3 class="itemCommentsCounter">
  541.         <span><?php echo $this->item->numOfComments; ?></span> <?php echo ($this->item->numOfComments>1) ? JText::_('comments') : JText::_('comment'); ?>
  542.       </h3>
  543.  
  544.       <ul class="itemCommentsList">
  545.         <?php foreach ($this->item->comments as $key=>$comment): ?>
  546.         <li class="<?php echo ($key%2) ? "odd" : "even"; echo (!$this->item->created_by_alias && $comment->userID==$this->item->created_by) ? " authorResponse" : ""; ?>">
  547.  
  548.             <span class="commentLink">
  549.                 <a href="<?php echo $this->item->link; ?>#comment<?php echo $comment->id; ?>" name="comment<?php echo $comment->id; ?>" id="comment<?php echo $comment->id; ?>">
  550.                     <?php echo JText::_('Comment Link'); ?>
  551.                 </a>
  552.             </span>
  553.  
  554.                 <?php if($comment->userImage):?>
  555.                 <img src="<?php echo $comment->userImage; ?>" alt="<?php echo $comment->userName; ?>" width="<?php echo $this->item->params->get('commenterImgWidth'); ?>" />
  556.                 <?php endif; ?>
  557.  
  558.                 <span class="commentDate">
  559.                 <?php echo JHTML::_('date', $comment->commentDate, JText::_('DATE_FORMAT_LC2')); ?>
  560.             </span>
  561.  
  562.             <span class="commentAuthorName">
  563.                 <?php echo JText::_("posted by"); ?>
  564.                 <?php if(!empty($comment->userLink)): ?>
  565.                 <a href="<?php echo $comment->userLink; ?>" title="<?php echo $comment->userName; ?>" target="_blank" rel="nofollow">
  566.                     <?php echo $comment->userName; ?>
  567.                 </a>
  568.                 <?php else: ?>
  569.                 <?php echo $comment->userName; ?>
  570.                 <?php endif; ?>
  571.             </span>
  572.  
  573.             <p><?php echo $comment->commentText; ?></p>
  574.  
  575.                 <div class="clr"></div>
  576.         </li>
  577.         <?php endforeach; ?>
  578.       </ul>
  579.  
  580.       <div class="itemCommentsPagination">
  581.         <?php echo $this->pagination->getPagesLinks(); ?>
  582.         <div class="clr"></div>
  583.       </div>
  584.         <?php endif; ?>
  585.  
  586.         <?php if($this->item->params->get('commentsFormPosition')=='below' && $this->item->params->get('itemComments') && !JRequest::getInt('print') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2' && K2HelperPermissions::canAddComment($this->item->catid)))): ?>
  587.       <!-- Item comments form -->
  588.       <div class="itemCommentsForm">
  589.         <?php echo $this->loadTemplate('comments_form'); ?>
  590.       </div>
  591.       <?php endif; ?>
  592.  
  593.       <?php $user = &JFactory::getUser(); if ($this->item->params->get('comments') == '2' && $user->guest):?>
  594.             <div><?php echo JText::_('Login to post comments');?></div>
  595.       <?php endif; ?>
  596.  
  597.   </div>
  598.   <?php endif; ?>
  599.  
  600.     <div class="itemBackToTop">
  601.         <a class="k2Anchor" href="<?php echo $this->item->link; ?>#startOfPageId<?php echo JRequest::getInt('id'); ?>"><?php echo JText::_("back to top"); ?></a>
  602.     </div>
  603.  
  604.     <div class="clr"></div>
  605. </div>
  606. <!-- End K2 Item Layout -->
Add Comment
Please, Sign In to add comment