From 435ca35087b6e75426fc5988d1c593e4e1cdff7a Mon Sep 17 00:00:00 2001 From: Martin Hecht Date: Fri, 13 Apr 2018 22:27:29 +0200 Subject: [PATCH] updated to v2.2.0 --- admin/scripts/backend.functions.php | 14 ++++++- info.php | 6 +-- init.php | 65 ++++++++++++++--------------- templates/default/css/default.css | 6 +-- themes/default/css/default.css | 3 +- themes/default/modify_cat.htt | 8 +--- upgrade.php | 2 +- view.php | 14 +++++-- 8 files changed, 64 insertions(+), 54 deletions(-) diff --git a/admin/scripts/backend.functions.php b/admin/scripts/backend.functions.php index 71e434a..b5d73cf 100644 --- a/admin/scripts/backend.functions.php +++ b/admin/scripts/backend.functions.php @@ -234,8 +234,8 @@ function getFolderStructureIterator( /*---------------------------------------------------------------------------------------------------*/ // /*----------------------------------- glob routines -----------------------------------------------*/ - function scanGlobTree ($sPath, $sPattern = '[a-zA-Z0-9_~@]*'){ - return (\glob($sPath.$sPattern, \GLOB_MARK)); // \GLOB_ONLYDIR| + function scanGlobTree ($sPath, $sPattern = '{,^.}[a-zA-Z0-9_~@]*'){ + return (\glob($sPath.$sPattern, \GLOB_BRACE|\GLOB_MARK)); // \GLOB_ONLYDIR| } /** @@ -662,6 +662,16 @@ function getCategories($galerie, $searchCategorie = '', $modus = 1, $rekursiv = $catParents = $searchCategorie.str_replace(WB_PATH.$MediaRel, '',$catParents);//$path // $catParents = ($catParents==''?'Root':$catParents); if ($catParents!='' && is_readable($path.$catParents)){ +/* + $sAllowedExtensions = implode(',', $aAllowedExtensions); + function scanGlobTree ($sPath, $sPattern = '{,^.}[a-zA-Z0-9_~@]*'){ + return (\glob($sPath.$sPattern, \GLOB_BRACE|\GLOB_MARK)); // \GLOB_ONLYDIR| + } + $sSearchFilter = DIRECTORY_SEPARATOR.'{,.}{'.$sAllowedExtensions.'}'; + $sSearchFilter = '*'; + $aFilesInDir = (\glob($path.$catParents.$sSearchFilter, \GLOB_BRACE)); // \GLOB_ONLYDIR +*/ +// $aFilesInDir = glob ($sSearchFilter, GLOB_BRACE); $sSearchFilter = '/*.{'.$sAllowedExtensions.'}'; $aFilesInDir = scanGlobTree($path.$catParents, $sSearchFilter); if (is_array($aFilesInDir) && sizeof($aFilesInDir)){ diff --git a/info.php b/info.php index ec6812e..fd6f233 100644 --- a/info.php +++ b/info.php @@ -26,11 +26,11 @@ if (!defined('SYSTEM_RUN')) { header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); flush(); exit; } $module_directory = 'foldergallery'; -$module_name = 'Foldergallery v3.0.0-dev5'; +$module_name = 'Foldergallery v2.2.0'; $module_function = 'page'; -$module_version = '3.0.0-dev5'; +$module_version = '2.2.0'; $module_status = ''; -$module_platform = '2.11.0'; +$module_platform = '2.10.0'; $module_author = 'Jürg Rast, schliffer, Bianka Martinovic, Chio, Pumpi, Luisehahne'; $module_license = 'GNU General Public License'; diff --git a/init.php b/init.php index b28a07d..a7744f7 100644 --- a/init.php +++ b/init.php @@ -41,36 +41,35 @@ /* -------------------------------------------------------- */ $sCallingScript = $_SERVER['SCRIPT_NAME']; - $globalStarted = \preg_match('/upgrade\-script\.php$/', $sCallingScript); - $sWbVersion = ($globalStarted && \defined('VERSION') ? VERSION : WB_VERSION); + $globalStarted = preg_match('/upgrade\-script\.php$/', $sCallingScript); + $sWbVersion = ($globalStarted && defined('VERSION') ? VERSION : WB_VERSION); switch ($iSteps): case 5: - $sAddonPath = \dirname(\dirname(\dirname(__DIR__))); + $sAddonPath = dirname(dirname(dirname(__DIR__))); break; case 4: - $sAddonPath = \dirname(\dirname(__DIR__)); + $sAddonPath = dirname(dirname(__DIR__)); break; case 3: - $sAddonPath = \dirname(__DIR__); + $sAddonPath = dirname(__DIR__); break; case 2: default: $sAddonPath = __DIR__; endswitch; - $bExcecuteCommand = false; // needed for simple Dispatcher - $sAddonName = \basename($sAddonPath); + $sAddonName = basename($sAddonPath); // An associative array that by default contains the contents of $_GET, $_POST and $_COOKIE. $aRequestVars = $_REQUEST; - if (\is_readable(\dirname(__DIR__).'/SimpleCommandDispatcher.inc')) {require(\dirname(__DIR__).'/SimpleCommandDispatcher.inc');} + if (is_readable(dirname(__DIR__).'/SimpleCommandDispatcher.inc')) {require(dirname(__DIR__).'/SimpleCommandDispatcher.inc');} // if (isset($sAddonBaseDir)) { exit; } // $sCallingScript = $_SERVER['SCRIPT_NAME']; /*--------------------------------------------------------------------------------------------------------*/ $unixPath = (function ($string){ - return \str_replace('\\', '/', $string); + return str_replace('\\', '/', $string); }); /*--------------------------------------------------------------------------------------------------------*/ /** @@ -80,7 +79,7 @@ function index_exists($table_name, $index_name, $number_fields = 0) { global $database; - $number_fields = \intval($number_fields); + $number_fields = intval($number_fields); $keys = 0; $sql = 'SHOW INDEX FROM `'.$table_name.'`'; if (($res_keys = $database->query($sql))) { @@ -119,9 +118,9 @@ function UpdateKeyValue($table, $key, $value = '', array $aExtraFields) global $database; if( !is_array($key)) { - if (\trim($key) != '' ) + if( trim($key) != '' ) { - $key = array( \trim($key) => \trim($value) ); + $key = array( trim($key) => trim($value) ); } else { $key = []; } @@ -141,7 +140,7 @@ function UpdateKeyValue($table, $key, $value = '', array $aExtraFields) $iFirst++; } } - $aExtraFieldsList = \array_intersect_key($aTmp, $aExtraFields); + $aExtraFieldsList = array_intersect_key($aTmp, $aExtraFields); foreach($aExtraFieldsList as $sName=>$sValue){ $sExtraFields .= '`'.$sName.'` = \''.$sValue.'\', '; } @@ -156,7 +155,7 @@ function UpdateKeyValue($table, $key, $value = '', array $aExtraFields) . 'WHERE `s_name` = \''.$index.'\' ' . (($aIndexField['0']!='') ? 'AND '. $aIndexField['0'] : ''); - if ($database->get_one($sql)) + if($database->get_one($sql)) { $sql = 'UPDATE '; $sql_where = 'WHERE `s_name` LIKE \''.$index.'\''; @@ -174,7 +173,7 @@ function UpdateKeyValue($table, $key, $value = '', array $aExtraFields) $retval[]=$database->get_error(); } } - return ((\sizeof($retval)==0) ? true : $retval); + return ((sizeof($retval)==0) ? true : $retval); }; } /*--------------------------------------------------------------------------------------*/ @@ -192,26 +191,26 @@ function UpdateKeyValue($table, $key, $value = '', array $aExtraFields) if(!$color) return false; $color = trim($color); $result = false; - if (\preg_match("/^[0-9ABCDEFabcdef\#]+$/i", $color)){ + if(preg_match("/^[0-9ABCDEFabcdef\#]+$/i", $color)){ $hex = str_replace('#','', $color); if(!$hex) return false; if(strlen($hex) == 3): - $result['r'] = \hexdec(\substr($hex,0,1).\substr($hex,0,1)); - $result['g'] = \hexdec(\substr($hex,1,1).\substr($hex,1,1)); - $result['b'] = \hexdec(\substr($hex,2,1).\substr($hex,2,1)); + $result['r'] = hexdec(substr($hex,0,1).substr($hex,0,1)); + $result['g'] = hexdec(substr($hex,1,1).substr($hex,1,1)); + $result['b'] = hexdec(substr($hex,2,1).substr($hex,2,1)); else: - $result['r'] = \hexdec(\substr($hex,0,2)); - $result['g'] = \hexdec(\substr($hex,2,2)); - $result['b'] = \hexdec(\substr($hex,4,2)); + $result['r'] = hexdec(substr($hex,0,2)); + $result['g'] = hexdec(substr($hex,2,2)); + $result['b'] = hexdec(substr($hex,4,2)); endif; - }elseif (\preg_match("/^[0-9]+(,| |.)+[0-9]+(,| |.)+[0-9]+$/i", $color)){ - $rgbstr = \str_replace(array(',',' ','.'), ':', $color); - $rgbarr = \explode(":", $rgbstr); + }elseif (preg_match("/^[0-9]+(,| |.)+[0-9]+(,| |.)+[0-9]+$/i", $color)){ + $rgbstr = str_replace(array(',',' ','.'), ':', $color); + $rgbarr = explode(":", $rgbstr); $result = '#'; - $result .= \str_pad(\dechex($rgbarr[0]), 2, "0", \STR_PAD_LEFT); - $result .= \str_pad(\dechex($rgbarr[1]), 2, "0", \STR_PAD_LEFT); - $result .= \str_pad(\dechex($rgbarr[2]), 2, "0", \STR_PAD_LEFT); - $result = \strtoupper($result); + $result .= str_pad(dechex($rgbarr[0]), 2, "0", STR_PAD_LEFT); + $result .= str_pad(dechex($rgbarr[1]), 2, "0", STR_PAD_LEFT); + $result .= str_pad(dechex($rgbarr[2]), 2, "0", STR_PAD_LEFT); + $result = strtoupper($result); }else{ $result = false; } @@ -220,19 +219,19 @@ function UpdateKeyValue($table, $key, $value = '', array $aExtraFields) $convertToCategory = (function ($sList) { - if (\is_array($sList)){ + if (is_array($sList)){ return $sList; } // return preg_split('/[\s,=+\;\:\.\/\|]+/', $sList, -1, PREG_SPLIT_NO_EMPTY); - return \preg_split('/[,=+\;\:\/\|]+/', $sList, -1, \PREG_SPLIT_NO_EMPTY); + return preg_split('/[,=+\;\:\/\|]+/', $sList, -1, PREG_SPLIT_NO_EMPTY); }); $convertToArray = (function ($sList) { - if (\is_array($sList)){ + if (is_array($sList)){ return $sList; } - return \preg_split('/[\s,=+\;\:\.\|]+/', $sList, -1, \PREG_SPLIT_NO_EMPTY); + return preg_split('/[\s,=+\;\:\.\|]+/', $sList, -1, PREG_SPLIT_NO_EMPTY); }); /*--------------------------------------------------------------------------------------*/ diff --git a/templates/default/css/default.css b/templates/default/css/default.css index 6a005da..5c3d5d0 100644 --- a/templates/default/css/default.css +++ b/templates/default/css/default.css @@ -33,7 +33,7 @@ div.images{overflow:hidden;padding:0.525em;} div.images div{overflow:hidden;padding:0.525em;text-align:center;white-space:normal;} ul.photostyle{list-style:none;margin:0 0 5px 0;padding:0;display:inline;text-align:center;} ul.photostyle li{padding:4px;border-radius:5px 5px 5px 5px;-webkit-border-radius:5px 5px 5px 5px;-moz-border-radius:5px 5px 5px 5px;} -ul.photostyle li{display:inline-block;list-style-type:none;padding-right:0.1225em;} +ul.photostyle li{display:inline;list-style-type:none;padding-right:0.1225em;} ul.photostyle li a img{border:0 none;} .htt-caption{display:block;} ul.categories{list-style:none;margin:0 0 5px 0;} @@ -44,7 +44,7 @@ ul.categories li a img{max-width:100%;transition:0.5s ease;-o-transition:0.5s ea .clear{clear:left;padding-top:0px;border:0px none #000000;border-bottom:1px none #000000;} .cat-naslov{font-size:12px;text-align:center;margin-top:2px;line-height:1;padding:0 1px 0 1px;} div.categories{border-radius:0.525em;box-shadow:0 0 1px #888888;display:inline-block;margin:0.125em;background:#fff;overflow:hidden;position:relative;} -div.categories:hover{box-shadow:0 0 10px #888888;} +div.categories:hover{box-shadow:0 0 6px #888888;} div.categories .categories-image{width:100%;} .categories-info{backface-visibility:hidden;background:#fff none repeat scroll 0 0;padding:0.525em;position:absolute;transition:all 0.4s ease 0s;z-index:10;} div.pagination{text-align:left !important;} @@ -62,7 +62,7 @@ div.categories-info{height:100%;padding:0.925em 0.5525em;margin-top:-40%;} div.categories-info div.pagination{width:100%;padding-top:relative;} div.categories-info div.pagination ul{width:100%;position:absolute;margin-left:0 !important;} div.categories-info div.pagination ul{margin:auto 0.0em;padding:0;text-align:center;left:0;} -div.categories{padding-bottom:10.025%;height:11.925em;box-shadow:0px 0px 6px #888888;} +div.categories{padding-bottom:10.025%;height:11.925em;} div.categories-info div.pagination ul{bottom:40%;position:relative;} div.categories .social-media li{margin-right:4px;} div.categories .social-media li:last-child{margin-right:0;} diff --git a/themes/default/css/default.css b/themes/default/css/default.css index 2fd9055..98ee88b 100644 --- a/themes/default/css/default.css +++ b/themes/default/css/default.css @@ -102,5 +102,4 @@ input[type=range ],::-moz-range-track,::-ms-track{-webkit-appearance:normal;back .level-10{font-weight:bold;color:#959595;} img.fg{margin-bottom:3px!important;} .thumbb{max-height:100px;margin:10px 0 10px 0;} -input[type="radio"]+ label,input[type="checkbox"]+ label,input[type="checkbox"]+ td label{font-weight:normal;padding:0 1.325em 0 0.825em;vertical-align:middle;} - +input[type="radio"]+ label,input[type="checkbox"]+ label,input[type="checkbox"]+ td label{font-weight:normal;padding:0 1.325em 0 0.825em;vertical-align:middle;} \ No newline at end of file diff --git a/themes/default/modify_cat.htt b/themes/default/modify_cat.htt index 1650a14..8e6d23f 100644 --- a/themes/default/modify_cat.htt +++ b/themes/default/modify_cat.htt @@ -306,18 +306,12 @@ console.info(elm); includeExif: true, orient: true, sizes: [ - {name: "", maxSize: (upSettings.maxImageSize < 1600 ? upSettings.maxImageSize : 1536 ) } + {name: "", maxSize: (upSettings.maxImageSize<1600?upSettings.maxImageSize:1536 ) } ] }, text: { failUpload: 'Upload files are failed', }, - callbacks: { - onAllComplete: function() { - alert('done'); - document.location.href="{AddonUrl}/admin/sync.php?page_id="+upSettings.pageID+"§ion_id="+upSettings.sectionID; - } - }, debug: true }); qq(document.getElementById("trigger-upload")).attach("click", function() { diff --git a/upgrade.php b/upgrade.php index d99e867..42608b9 100644 --- a/upgrade.php +++ b/upgrade.php @@ -26,7 +26,7 @@ // check if upgrade startet by upgrade-script to echo a message $globalStarted = preg_match('/upgrade\-script\.php$/', $_SERVER["SCRIPT_NAME"]); $sWbVersion = ($globalStarted && defined('VERSION') ? VERSION : WB_VERSION); - Translate::getInstance()->enableAddon(ADMIN_DIRECTORY.'\\addons'); + Translate::getInstance()->enableAddon(ADMIN_DIRECTORY.'\\addons'); if (is_writable(WB_PATH.'/temp/cache')) { Translate::getInstance()->clearCache(); } diff --git a/view.php b/view.php index 97c2742..5ab7736 100644 --- a/view.php +++ b/view.php @@ -451,6 +451,8 @@ $katcount[$ix] = ''; }; +/* +*/ if($katcount[$ix] == "1") { $katcount[$ix].= " ".$MOD_FOLDERGALLERY['1PICTURE']; } else if($katcount[$ix] == "2") { @@ -469,6 +471,10 @@ $katcount[$ix].= " ".$MOD_FOLDERGALLERY['PICTURES']; } }; +/* +print '
function '.__FUNCTION__.'( '.$iRatio.' );  filename: '.basename(__FILE__).'  line: '.__LINE__.' -> 
'; +print_r( $bilder ); print '
'; flush (); // ob_flush();;sleep(10); die(); +*/ $sCatGalleryLink = $unterKats[$ix]['link']; $sCatThumbUrl = (!is_dir($unterKats[$ix]['thumb'])? $unterKats[$ix]['thumb']:''); $sCatName = $unterKats[$ix]['name']; @@ -476,7 +482,6 @@ $isEmpty = ((intval($katcount[$ix])==0)?true:$isEmpty); $bIsThumbLink = ($sCatThumbUrl); if ($isEmpty &&!$bIsAdmin){continue;} - $aCategorie = array( 'CAT_LINK' => $sCatGalleryLink, 'THUMB_LINK' => $sCatThumbUrl.'?t='.time(), @@ -487,7 +492,10 @@ 'IsEmpty' =>$isEmpty ); $t->set_var($aCategorie); - +/* +print '
function '.__FUNCTION__.'( '.''.' );  filename: '.basename(__FILE__).'  line: '.__LINE__.' -> 
'; +print_r( $aCategorie ); print '
'; flush (); // ob_flush();;sleep(10); die(); +*/ $iRatio = (float)($thumbPresets[$settings ['loadPreset']]['thumb_ratio']); $iRatio = (float)($iRatio>1?$iRatio:1.34); $catWidth = (float)$settings['tbSettings']['image_x']; @@ -632,7 +640,7 @@ $sImageFile = function ($sImage) use ($ImgInfo){ return __DIR__.'/preview.php?img='.$sImage; // ' }; - $sFilename = $url.$pathToFolder.$sOrginalFilename; + $sFilename = $pathToFolder.$sOrginalFilename; // $sImageFilename = $sImageFile($pathToFolder.$sOrginalFilename); $aShowImages = [