roxcoder

Untitled

Feb 8th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.83 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package     SP Simple Portfolio
  4.  *
  5.  * @copyright   Copyright (C) 2010 - 2015 JoomShaper. All rights reserved.
  6.  * @license     GNU General Public License version 2 or later.
  7.  */
  8.  
  9. defined('_JEXEC') or die();
  10.  
  11. require_once JPATH_COMPONENT . '/helpers/helper.php';
  12. SpsimpleportfolioHelper::generateMeta($this->item);
  13.  
  14.  
  15. $doc = JFactory::getDocument();
  16. $doc->addStylesheet( JURI::root(true) . '/components/com_spsimpleportfolio/assets/css/spsimpleportfolio.css' );
  17.  
  18. $tags = SpsimpleportfolioHelper::getTags( (array) $this->item->spsimpleportfolio_tag_id );
  19. $newtags = array();
  20. foreach ($tags as $tag) {
  21.     $newtags[]   = $tag->title;
  22. }
  23.  
  24. //video
  25. if($this->item->video) {
  26.     $video = parse_url($this->item->video);
  27.  
  28.     switch($video['host']) {
  29.         case 'youtu.be':
  30.         $video_id   = trim($video['path'],'/');
  31.         $video_src  = '//www.youtube.com/embed/' . $video_id;
  32.         break;
  33.  
  34.         case 'www.youtube.com':
  35.         case 'youtube.com':
  36.         parse_str($video['query'], $query);
  37.         $video_id   = $query['v'];
  38.         $video_src  = '//www.youtube.com/embed/' . $video_id;
  39.         break;
  40.  
  41.         case 'vimeo.com':
  42.         case 'www.vimeo.com':
  43.         $video_id   = trim($video['path'],'/');
  44.         $video_src  = "//player.vimeo.com/video/" . $video_id;
  45.     }
  46.  
  47. }
  48.  
  49. ?>
  50.  
  51. <div id="sp-simpleportfolio" class="sp-simpleportfolio sp-simpleportfolio-view-item">
  52.    
  53.  
  54.     <div class="sp-simpleportfolio-details clearfix">
  55.  
  56.         <div class="sp-simpleportfolio-description">
  57.             <h2><?php echo $this->item->title; ?></h2>
  58.             <?php echo $this->item->description; ?>
  59.         </div>
  60.  
  61.         <div class="sp-simpleportfolio-meta">
  62.  
  63.             <div class="sp-simpleportfolio-created">
  64.                 <h4><?php echo JText::_('COM_SPSIMPLEPORTFOLIO_PROJECT_DATE'); ?></h4>
  65.                 <?php echo JHtml::_('date', $this->item->created_on, JText::_('DATE_FORMAT_LC3')); ?>
  66.             </div>
  67.  
  68.             <div class="sp-simpleportfolio-tags">
  69.                 <h4><?php echo JText::_('COM_SPSIMPLEPORTFOLIO_PROJECT_CATEGORIES'); ?></h4>
  70.                 <?php echo implode(', ', $newtags); ?>
  71.             </div>
  72.  
  73.             <?php if ($this->item->url) { ?>
  74.             <div class="sp-simpleportfolio-link">
  75.                 <a class="btn btn-primary" target="_blank" href="<?php echo $this->item->url; ?>"><?php echo JText::_('COM_SPSIMPLEPORTFOLIO_VIEW_PROJECT'); ?></a>
  76.             </div>
  77.             <?php } ?>
  78.         </div>
  79.        
  80.     </div>
  81.     <div class="sp-simpleportfolio-image">
  82.         <?php if($this->item->video) { ?>
  83.         <div class="sp-simpleportfolio-embed">
  84.             <iframe src="<?php echo $video_src; ?>" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
  85.         </div>
  86.         <?php } else { ?>
  87.         <?php if($this->item->image) { ?>
  88.         <img class="sp-simpleportfolio-img" src="<?php echo $this->item->image; ?>" alt="<?php echo $this->item->title; ?>">
  89.         <?php } else { ?>
  90.         <img class="sp-simpleportfolio-img" src="<?php echo $this->item->thumbnail; ?>" alt="<?php echo $this->item->title; ?>">
  91.         <?php } ?>
  92.         <?php } ?>
  93.     </div>
  94. </div>
Advertisement
Add Comment
Please, Sign In to add comment