roxcoder

site.php

Nov 23rd, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.11 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package Onepage
  4.  * @author JoomShaper http://www.joomshaper.com
  5.  * @copyright Copyright (c) 2010 - 2015 JoomShaper
  6.  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
  7. */
  8.  
  9. //no direct accees
  10. defined ('_JEXEC') or die ('resticted aceess');
  11.  
  12. AddonParser::addAddon('sp_teams','sp_teams_addon');
  13. AddonParser::addAddon('sp_teams_item','sp_teams_item_addon');
  14.  
  15. $sppbTeamArray = array();
  16.  
  17. function sp_teams_addon($atts, $content){
  18.  
  19.     global $sppbTeamArray;
  20.  
  21.     extract(spAddonAtts(array(
  22.         'arrows'=>'',
  23.         'before_text'=>'',
  24.         "autoplay"=>'',
  25.         "class"=>'',
  26.         ), $atts));
  27.  
  28.     AddonParser::spDoAddon($content);
  29.  
  30.     $output= '';
  31.  
  32.     if ($before_text) {
  33.         // Before text
  34.         $output .= '<div class="sppb-team-before-text sppb-text-center" >';
  35.         $output .= '<p class="sppb-center sppb-lead">' . $before_text . '</p>';
  36.         $output .= '</div>';
  37.     }
  38.  
  39.     //Variables
  40.     $carousel_autoplay = ($autoplay)?'data-sppb-ride="sppb-carousel"':'';
  41.  
  42.     // Start carousel
  43.     $output .= '<div class="sppb-teams-wrapper sppb-carousel sppb-slide ' . $class . '" ' . $carousel_autoplay . '>';
  44.     $output .= '<div class="sppb-carousel-inner">';
  45.  
  46.     foreach(array_chunk($sppbTeamArray, 3) as $chunk_key => $sppbTeamArray) {
  47.         $output .='<div class="sppb-item ' . ( ($chunk_key==0) ? "active" : "") . ' ">';
  48.         $output .='<ul class="sppb-teams">';
  49.  
  50.         //array items
  51.         $count = count($sppbTeamArray);
  52.  
  53.         foreach ($sppbTeamArray as $key => $sppbTeam) {
  54.             $output .= '<li class="sppb-team-wrapper ' . ( ($key==0) ? "first-item  active" : "") . ( ($key==$count -1) ? "last-item" : "") . ' ">';
  55.                 $output .= '<div class="sppb-team">';
  56.  
  57.                
  58.                 $output .= '<div class="sppb-team-image-wrapper">';
  59.                     $output .= '<img class="img-thumbnail sppb-img-responsive" src="' . $sppbTeam['image'] . '" alt=" ' . $sppbTeam['title'] . ' ">';
  60.                 $output .= '</div>'; //.sppb-team-image-wrapper
  61.  
  62.  
  63.                 $output .= '<div class="sppb-team-info">';
  64.                     // Has name
  65.                     if ($sppbTeam['title']) {
  66.                         $output .= '<h3 class="sppb-team-name"> ' . $sppbTeam['title'] . ' </h3>';
  67.                     }
  68.  
  69.                     //has designation
  70.                     if ($sppbTeam['designation']) {
  71.                         $output .= '<p class="sppb-designation"> ' . $sppbTeam['designation'] . ' </p>';
  72.                     }
  73.  
  74.                     //has intro text
  75.                     if ($sppbTeam['introtext']) {
  76.                         $output .= '<p class="sppb-introtext"> ' . $sppbTeam['introtext'] . ' </p>';
  77.                     }
  78.  
  79.                     //has social
  80.                     if ($sppbTeam['facebook']
  81.                         || $sppbTeam['twitter']
  82.                         || $sppbTeam['google_plus']
  83.                         || $sppbTeam['youtube']
  84.                         || $sppbTeam['linkedin']
  85.                         || $sppbTeam['pinterest']
  86.                         || $sppbTeam['flickr']
  87.                         || $sppbTeam['dribbble']
  88.                         || $sppbTeam['behance']
  89.                         || $sppbTeam['instagram']
  90.                         ) {
  91.                         $output .= '<div class="sppb-team-social-icons">';
  92.  
  93.                         // Has facebook
  94.                         if ( $sppbTeam['facebook'] ) {
  95.                             $output .= '<a target="_blank" href="' . $sppbTeam['facebook'] . '" ><i class="fa fa-facebook"></i></a>';
  96.                         }
  97.                         // Has twitter
  98.                         if ( $sppbTeam['twitter'] ) {
  99.                             $output .= '<a target="_blank" href="' . $sppbTeam['twitter'] . '" ><i class="fa fa-twitter"></i></a>';
  100.                         }
  101.                         // Has google plus
  102.                         if ( $sppbTeam['google_plus'] ) {
  103.                             $output .= '<a target="_blank" href="' . $sppbTeam['google_plus'] . '" ><i class="fa fa-google-plus"></i></a>';
  104.                         }
  105.                         // Has youtube
  106.                         if ( $sppbTeam['youtube'] ) {
  107.                             $output .= '<a target="_blank" href="' . $sppbTeam['youtube'] . '" ><i class="fa fa-youtube"></i></a>';
  108.                         }
  109.                         // Has linkedin
  110.                         if ( $sppbTeam['linkedin'] ) {
  111.                             $output .= '<a target="_blank" href="' . $sppbTeam['linkedin'] . '" ><i class="fa fa-linkedin"></i></a>';
  112.                         }
  113.                         // Has pinterest
  114.                         if ( $sppbTeam['pinterest'] ) {
  115.                             $output .= '<a target="_blank" href="' . $sppbTeam['pinterest'] . '" ><i class="fa fa-pinterest"></i></a>';
  116.                         }
  117.                         // Has flickr
  118.                         if ( $sppbTeam['flickr'] ) {
  119.                             $output .= '<a target="_blank" href="' . $sppbTeam['flickr'] . '" ><i class="fa fa-flickr"></i></a>';
  120.                         }
  121.                         // Has dribbble
  122.                         if ( $sppbTeam['dribbble'] ) {
  123.                             $output .= '<a target="_blank" href="' . $sppbTeam['dribbble'] . '" ><i class="fa fa-dribbble"></i></a>';
  124.                         }
  125.                         // Has behance
  126.                         if ( $sppbTeam['behance'] ) {
  127.                             $output .= '<a target="_blank" href="' . $sppbTeam['behance'] . '" ><i class="fa fa-behance"></i></a>';
  128.                         }
  129.                         // Has instagram
  130.                         if ( $sppbTeam['instagram'] ) {
  131.                             $output .= '<a target="_blank" href="' . $sppbTeam['instagram'] . '" ><i class="fa fa-instagram"></i></a>';
  132.                         }
  133.  
  134.                        
  135.                         $output .= '</div>';
  136.                     }
  137.                    
  138.  
  139.  
  140.                 $output .= '</div>'; //.sppb-team-info
  141.  
  142.                 $output .= '</div>'; // ./sppb-team
  143.             $output .= '</li>';
  144.         }
  145.  
  146.         $output .='</ul>';
  147.         $output .='</div>';
  148.     }  
  149.  
  150.     //$output .= AddonParser::spDoAddon($content);
  151.     $output .= '</div>'; // /.sppb-carousel-inner
  152.  
  153.     if($arrows) {
  154.         $output .= '<a class="sppb-carousel-arrow left sppb-carousel-control" role="button" data-slide="prev"><i class="fa fa-angle-left"></i></a>';
  155.         $output .= '<a class="sppb-carousel-arrow right sppb-carousel-control" role="button" data-slide="next"><i class="fa fa-angle-right"></i></a>';
  156.     }
  157.    
  158.     $output .= '</div>'; // /.sppb-carousel
  159.  
  160.     $sppbTeamArray = array();
  161.     return $output;
  162.  
  163. }
  164. ?>
  165.  
  166. <?php
  167. function sp_teams_item_addon( $atts ){
  168.     global $sppbTeamArray;
  169.  
  170.     extract(spAddonAtts(array(
  171.         "title"         =>'',
  172.         'designation'   =>'',
  173.         "image"         =>'',
  174.         "introtext"     =>'',
  175.         "facebook"      =>'',
  176.         "twitter"       =>'',
  177.         "google_plus"   =>'',
  178.         "youtube"       =>'',
  179.         "linkedin"      =>'',
  180.         "pinterest"     =>'',
  181.         "flickr"        =>'',
  182.         "dribbble"      =>'',
  183.         "behance"       =>'',
  184.         "instagram"     =>'',
  185.         ), $atts));
  186.  
  187.  
  188.     $sppbTeamArray[] = array(
  189.         'title'         =>$title,
  190.         'designation'   =>$designation,
  191.         'image'         =>$image,
  192.         'introtext'     =>$introtext,
  193.         'facebook'      =>$facebook,
  194.         'twitter'       =>$twitter,
  195.         'google_plus'   =>$google_plus,
  196.         'youtube'       =>$youtube,
  197.         'linkedin'      =>$linkedin,
  198.         'pinterest'     =>$pinterest,
  199.         'flickr'        =>$flickr,
  200.         'dribbble'      =>$dribbble,
  201.         'behance'       =>$behance,
  202.         'instagram'     =>$instagram
  203.  
  204.     );
  205.  
  206. }
Advertisement
Add Comment
Please, Sign In to add comment