Sindbad~EG File Manager
<?php
/*
* @package Joomla 3.4
* Flexible Timeline module
* @copyright Copyright (C) Adrien Roussel https://www.nordmograph.com/extensions
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die('Restricted access');
$juri = JURI::base();
if($debug){
error_reporting(E_ALL);
ini_set("display_errors", 1);
var_dump($list);
}
echo '<section id="cd-timeline" class="cd-container">';
$item_icon = $juri.'modules/mod_flexible_timeline/icon/'.$icon;
foreach($list as $item)
{
$y = substr($item->date, 0, 4);
$mo = substr($item->date, 5, 2);
$d = substr($item->date, 8, 2);
$h = substr($item->date, 11, 2);
$mi = substr($item->date, 14, 2);
$data_date = $d.'/'.$mo.'/'.$y.'T'.$h.':'.$mi;
$image_intro = '';
$img_alt = '';
$item_image = '';
if($mode!='static'){
$date_obj = new DateTime( $item->date );
$formatted_date = date_format($date_obj, $date_format);
}
else
$formatted_date = $item->date;
$url ='';
if($enable_url && $mode!='static')
{
$url = str_replace('[ID]', $item->id , $url_format );
$url = str_replace('[CATID]', @$item->catid , $url );
$url = str_replace('[ALIAS]', JFilterOutput::stringURLSafe(@$item->alias) , $url );
}
if($mode=='static')
$url = $item->url;
if(strlen($item->title) > $title_limit)
$item_title = substr($item->title,0,strpos(substr($item->title,0,$title_limit),' ')).' ...';
else
$item_title = $item->title;
if($striptags)
$item_description = strip_tags($item->description);
else
$item_description = $item->description;
if(strlen($item_description) > $description_limit)
{
$item_description = substr($item_description,0,$description_limit -4);
$splitted = explode(" ",$item_description);
$keys = array_keys($splitted);
$lastKey = end($splitted);
$countlastkey = strlen($lastKey);
$item_description = substr_replace($item_description.' ','...',-($countlastkey+1),-1);
}
echo '<div class="cd-timeline-block">';
if($mode=='preset_content_latest' OR $mode=='preset_content_latest_catfiltered' OR strpos($expert_query, '#__content')!== false ){
$imgObj = json_decode($item->image);
$image_intro = $imgObj->{'image_intro'};
$img_alt = $imgObj->{'image_intro_alt'};
if($image_intro!=''){
$item_image = $juri.$image_intro;
}
}
else{
$img_alt = $item->title;
$image_prefix = str_replace('[ID]',$item->id,$image_prefix);
if(@$item->image)
$item_image = $image_prefix.$item->image;
elseif(strpos($item->image,'http' )!== false )
$item_image = $item->image;
}
echo '<div class="cd-timeline-img cd-picture">';
echo '<img src="'.$item_icon.'" width="32" height="32" alt="'.$img_alt.'" />';
echo '</div>';
echo '<div class="cd-timeline-content">';
if($item_title)
{
echo '<h3>';
if($enable_url OR ($mode=='static' && $url!='') )
{
echo '<a href="'.JRoute::_($url).'" ';
if(strpos($url , 'http' )!==false)
echo ' target="blank" ';
echo '>';
}
echo strip_tags($item_title);
if($enable_url OR ($mode=='static' && $url!='') )
echo '</a>';
echo '</h3>';
}
if($item_description){
if(@$item->image && $item_image){
echo '<img class="ftl-indesc_img" src="'.$item_image.'" alt="'.$img_alt.'" />';
}
echo '<div>'.$item_description.'</div>';
}
if($item->latitude !='' && $item->longitude!='')
{
//map
$src1 = '//maps.googleapis.com/maps/api/staticmap?size='.$map_width.'x'.$map_height;
$src1 .= '¢er='.$item->latitude.','.$item->longitude.'&zoom='.$zoom1;
$src1 .= '&maptype='.strtolower($maptype).'';
$src1 .= '&markers=size:normal';
$src1 .= '%7Ccolor:'.$marker_color;
$src1 .= '%7C' . $item->latitude . "," . $item->longitude;
if($static_client!='' && $static_signature!='')
$src1 .= '&client='.$static_client.'&signature='.$static_signature;
elseif($static_key!='')
$src1 .= '&key='.$static_key;
$src2 = '//maps.googleapis.com/maps/api/staticmap?size='.$map_width.'x'.$map_height;
$src2 .='¢er='.$item->latitude.','.$item->longitude.'&zoom='.$zoom2;
$src2 .= '&maptype='.strtolower($maptype).'';
$src2 .= '&markers=size:normal';
$src2 .= '%7Ccolor:'.$marker_color;
$src2 .= '%7C' . $item->latitude . "," . $item->longitude;
if($static_client!='' && $static_signature!='')
$src2 .= '&client='.$static_client.'&signature='.$static_signature;
elseif($static_key!='')
$src2 .= '&key='.$static_key;
$src3 = '//maps.googleapis.com/maps/api/staticmap?size='.$map_width.'x'.$map_height;
$src3 .='¢er='.$item->latitude.','.$item->longitude.'&zoom='.$zoom3;
$src3 .= '&maptype='.strtolower($maptype).'';
$src3 .= '&markers=size:normal';
$src3 .= '%7Ccolor:'.$marker_color;
$src3 .= '%7C' . $item->latitude . "," . $item->longitude;
if($static_client!='' && $static_signature!='')
$src3 .= '&client='.$static_client.'&signature='.$static_signature;
elseif($static_key!='')
$src3 .= '&key='.$static_key;
$gmap_url = 'https://maps.google.com/?ie=UTF8&hq=&ll='.$item->latitude.','.$item->longitude.'&z='.$zoom3;
if($maplink=='gmap')
echo '<a href="'.$gmap_url.'" target="_blank">';
echo '<div id="map'.$module->id.'-'.$item->id.'" width="'.$map_width.'" height="'.$map_height.'" ';
if($maplink=='zoom3')
echo ' class="hasTooltip" title="'.JText::_('MOD_FLEXTIMELINE_CLICKTOZOOMIN').'" ';
echo '></div>';
if($maplink=='gmap')
echo '</a>';
$css = '#map'.$module->id.'-'.$item->id.'{
width:'.$map_width.'px;
height:'.$map_height.'px;
background: url("'.$src1.'") no-repeat left top;
}
#map'.$module->id.'-'.$item->id.':hover{
background: url("'.$src2.'") no-repeat left top;
}';
if($maplink=='zoom3')
{
$css .= '#map'.$module->id.'-'.$item->id.':active{
background: url("'.$src3.'") no-repeat left top;
}
#map'.$module->id.'-'.$item->id.'{
cursor:pointer
}';
}
$doc->addStyleDeclaration( $css );
}
echo '<span class="cd-date"><h3>'.$formatted_date.'</h3></span>';
echo '</div>';
echo '</div>';
}
echo '</section>';
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists