| Current Path : /home/antonen/chenglong.lt/modules/mod_flippingbook/ |
| Current File : /home/antonen/chenglong.lt/modules/mod_flippingbook/helper.php |
<?php
/**
* @package mod_flippingbook - Flipping Book
* @version 2.0.3
* @created Oct 2020
* @author PluginJar.com
* @email support@pluginjar.com
* @website https://www.pluginjar.com
* @support https://www.pluginjar.com/premium-support-board.html
* @copyright Copyright (C) 2020 - 2021 PluginJar.com. All rights reserved.
* @license GNU General Public License version 2 and above
*/
defined('_JEXEC') or die;
// class
class ModFlippingbookHelper
{
public static function getImages( $site_uri, $imagefolder,$excludedimages ) {
$images_only_array = array();
$images_exculded_array = array();
$all_files = glob("".$imagefolder."/*.*");
$excludedimagesarr = explode(',',$excludedimages);
foreach($excludedimagesarr as $imgkey => $imgval ){
array_push($images_exculded_array,''.$imagefolder.'/'.$imgval.'');
}
for ($i=0; $i<count($all_files); $i++)
{
$image_name = $all_files[$i];
$supported_format = array('gif','jpg','jpeg','png');
$ext = strtolower(pathinfo($image_name, PATHINFO_EXTENSION));
if (in_array($ext, $supported_format))
{
if(!in_array($image_name,$images_exculded_array)){
array_push($images_only_array,''.$site_uri.''.$image_name.'');
}
} else {
continue;
}
}
return $images_only_array;
}
}