0x1998 - MANAGER
Edit File: alternate.php
<?php /** * @version $Id: mod_jdownloads_featured.php * @package mod_jdownloads_featured * @copyright (C) 2018 Arno Betz * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * @author Arno Betz http://www.jDownloads.com */ // this is an alternate layout without tables - it used only <div> tags defined('_JEXEC') or die; JHTML::_('bootstrap.tooltip'); // Path to the mime type image folder (for file symbols) $file_pic_folder = JDHelper::getFileTypeIconPath($jdparams->get('selected_file_type_icon_set')); $html = ''; if ($files){ $html = '<div class="moduletable'.$moduleclass_sfx.'" style="padding: 5px;">'; if ($text_before <> ''){ $html .= '<div style="padding-bottom: 5px;">'.$text_before.'</div>'; } for ($i=0; $i<count($files); $i++) { $has_no_file = false; if (!$files[$i]->url_download && !$files[$i]->other_file_id && !$files[$i]->extern_file){ // only a document without file $has_no_file = true; } // get the first image as thumbnail when it exist $thumbnail = ''; $first_image = ''; $images = explode("|",$files[$i]->images); if (isset($images[0])) $first_image = $images['0']; $version = $params->get('short_version', ''); // short the file title? if ($sum_char > 0){ $gesamt = strlen($files[$i]->title) + strlen($files[$i]->release) + strlen($short_version) +1; if ($gesamt > $sum_char){ $files[$i]->title = JString::substr($files[$i]->title, 0, $sum_char).$short_char; $files[$i]->release = ''; } } // create the viewed category text if ($cat_show && $files[$i]->catid > 1) { if ($cat_show_type == 'containing') { $cat_show_text2 = $cat_show_text.$files[$i]->category_title; } else { if ($files[$i]->category_cat_dir_parent){ $cat_show_text2 = $cat_show_text.$files[$i]->category_cat_dir_parent.'/'.$files[$i]->category_cat_dir; } else { $cat_show_text2 = $cat_show_text.$files[$i]->category_cat_dir; } } } else { $cat_show_text2 = ''; } // create the link if ($files[$i]->link == '-'){ // the user have the access to view this item if ($detail_view == '1'){ if ($detail_view_config == 0){ // the details view is deactivated in jD config so the // link must start directly the download process if ($direct_download_config == 1){ if (!$has_no_file){ $link = JRoute::_('index.php?option='.$option.'&task=download.send&id='.$files[$i]->slug.'&catid='.$files[$i]->catid.'&m=0'); } else { // create a link to the Downloads category as this download has not a file if ($files[$i]->menuc_cat_itemid){ $link = JRoute::_('index.php?option='.$option.'&view=category&catid='.$files[$i]->catid.'&Itemid='.$files[$i]->menuc_cat_itemid); } else { $link = JRoute::_('index.php?option='.$option.'&view=category&catid='.$files[$i]->catid.'&Itemid='.$Itemid); } } } else { // link to the summary page if (!$has_no_file){ $link = JRoute::_('index.php?option='.$option.'&view=summary&id='.$files[$i]->slug.'&catid='.$files[$i]->catid); } else { // create a link to the Downloads category as this download has not a file if ($files[$i]->menuc_cat_itemid){ $link = JRoute::_('index.php?option='.$option.'&view=category&catid='.$files[$i]->catid.'&Itemid='.$files[$i]->menuc_cat_itemid); } else { $link = JRoute::_('index.php?option='.$option.'&view=category&catid='.$files[$i]->catid.'&Itemid='.$Itemid); } } } } else { // create a link to the details view if ($files[$i]->menuf_itemid){ $link = JRoute::_('index.php?option='.$option.'&view=download&id='.$files[$i]->slug.'&catid='.$files[$i]->catid.'&Itemid='.$files[$i]->menuf_itemid); } else { if ($files[$i]->menuc_cat_itemid){ $link = JRoute::_('index.php?option='.$option.'&view=download&id='.$files[$i]->slug.'&catid='.$files[$i]->catid.'&Itemid='.$files[$i]->menuc_cat_itemid); } else { $link = JRoute::_('index.php?option='.$option.'&view=download&id='.$files[$i]->slug.'&catid='.$files[$i]->catid.'&Itemid='.$Itemid); } } } } else { // create a link to the Downloads category if ($files[$i]->menuc_cat_itemid){ $link = JRoute::_('index.php?option='.$option.'&view=category&catid='.$files[$i]->catid.'&Itemid='.$files[$i]->menuc_cat_itemid); } else { $link = JRoute::_('index.php?option='.$option.'&view=category&catid='.$files[$i]->catid.'&Itemid='.$Itemid); } } } else { $link = $files[$i]->link; } if (!$files[$i]->release) $version = ''; // add mime file pic $size = 0; $files_pic = ''; $number = ''; if ($view_pics){ $size = (int)$view_pics_size; $files_pic = '<a href="'.$link.'"><img src="'.$file_pic_folder.$files[$i]->file_pic.'" width="'.$size.'" height="'.$size.'" style="border: 0px; vertical-align: top;"'.' alt="'.substr($files[$i]->file_pic, 0, -4).'-'.$i.'"/></a>'; } if ($view_numerical_list){ $num = $i+1; $number = "$num. "; } // add description in tooltip if ($view_tooltip && $files[$i]->description != ''){ $link_text = '<a href="'.$link.'">'.JHTML::tooltip(strip_tags(substr($files[$i]->description,0,$view_tooltip_length)).$short_char,JText::_('MOD_JDOWNLOADS_FEATURED_DESCRIPTION_TITLE'),$files[$i]->title.' '.$version.$files[$i]->release,$files[$i]->title.' '.$version.$files[$i]->release).'</a>'; } else { $link_text = '<a href="'.$link.'">'.$files[$i]->title.' '.$version.$files[$i]->release.'</a>'; } $html .= '<div style="padding-bottom: 3px; text-align: '.$alignment.';">'.$number.$files_pic.$link_text.'</div>'; // add the creation date if ($view_date) { if ($files[$i]->created){ if ($view_date_same_line){ $html .= '<div style="padding-bottom: 3px; float:'.$date_alignment.';"><small>'.JHTML::date($files[$i]->created, $date_format).'</small></div>'; } else { $html .= '<div style="padding-bottom: 3px; text-align:'.$date_alignment.';"><small>'.JHTML::date($files[$i]->created, $date_format).'</small></div>'; } } } // add the first download screenshot when exists and activated in options if ($view_thumbnails){ if ($first_image){ $thumbnail = '<a href="'.$link.'"><img class="img" src="'.$thumbfolder.$first_image.'" style="padding:5px;border:'.$border.'" width="'.$view_thumbnails_size.'" height="'.$view_thumbnails_size.'"alt="'.substr($first_image, 0, -4).'-'.$i.'"/></a>'; } else { if ($view_thumbnails_dummy){ $thumbnail = '<a href="'.$link.'"><img class="img" src="'.$thumbfolder.'no_pic.gif" style="padding:5px;border:'.$border.'" width="'.$view_thumbnails_size.'" height="'.$view_thumbnails_size.'" alt="no_pic-'.$i.'"/></a>'; } } if ($thumbnail) $html .= '<div style="padding-bottom: 3px; text-align:'.$alignment.'">'.$thumbnail.'</div>'; } // add category info if ($cat_show_text2) { if ($cat_show_as_link){ if ($files[$i]->menuc_cat_itemid){ $html .= '<div style="padding-bottom: 3px; text-align:'.$alignment.'; font-size:'.$cat_show_text_size.'; color:'.$cat_show_text_color.';"><a href="index.php?option='.$option.'&view=category&catid='.$files[$i]->catid.'&Itemid='.$files[$i]->menuc_cat_itemid.'">'.$cat_show_text2.'</a></div>'; } else { $html .= '<div style="padding-bottom: 3px; text-align:'.$alignment.'; font-size:'.$cat_show_text_size.'; color:'.$cat_show_text_color.';"><a href="index.php?option='.$option.'&view=category&catid='.$files[$i]->catid.'&Itemid='.$Itemid.'">'.$cat_show_text2.'</a></div>'; } } else { $html .= '<div style="padding-bottom: 3px; text-align:'.$alignment.'; font-size:'.$cat_show_text_size.'; color:'.$cat_show_text_color.';">'.$cat_show_text2.'</div>'; } } } if ($text_after <> ''){ $html .= '<div style="padding-top: 5px;">'.$text_after.'</div>'; } echo $html.'</div>'; } ?>