-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
4,384 additions
and
939 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,100 @@ | ||
<?php | ||
/** | ||
* | ||
* @category modules | ||
* @package minigallery v2.2 | ||
* @author Dev4me / Ruud Eisinga | ||
* @link http://www.allwww.nl/ | ||
* @license http://www.gnu.org/licenses/gpl.html | ||
* @platform WebsiteBaker 2.8.x | ||
* @requirements PHP 5.2.2 and higher | ||
* @version 2.2.0 | ||
* @lastmodified June 17, 2017 | ||
* | ||
*/ | ||
|
||
require('../../config.php'); | ||
require( dirname(__FILE__).'/functions.php') ; | ||
require_once(WB_PATH.'/framework/class.admin.php'); | ||
$admin = new admin('Modules', 'module_view', false, false); | ||
if (!($admin->is_authenticated() || !$admin->get_permission("minigal2", 'module'))) { | ||
die("Go away"); | ||
} | ||
|
||
if(isset($_POST['section_id']) && is_numeric($_POST['section_id'])) { | ||
$section_id = (int)$_POST['section_id']; | ||
$basedir = WB_PATH.MEDIA_DIRECTORY.'/minigal2/'; | ||
$baseurl = WB_URL.MEDIA_DIRECTORY.'/minigal2/'; | ||
$curdir = $section_id."/"; | ||
$pathToFolder = $basedir.$section_id.'/'; | ||
$thumbFolder = $pathToFolder.'thumbs/'; | ||
make_dir($basedir); | ||
make_dir($pathToFolder); | ||
make_dir($thumbFolder); | ||
$overwrite = true; | ||
} else { | ||
die(); | ||
} | ||
|
||
if(isAjax()) { | ||
if(isset($_POST['function'])) { | ||
$f = $_POST['function']; | ||
if($f == 'upload') { | ||
$get_settings = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_minigal2 WHERE section_id = '$section_id'"); | ||
$settings = $get_settings->fetchRow(); | ||
$maxsize = $settings['maxsize']; | ||
$thumbsize = $settings['thumbsize']; | ||
$ratio = $settings['ratio']; | ||
$message = ""; | ||
minigallery_save_upload ( 'file', $maxsize , $thumbsize, $ratio, $pathToFolder, $thumbFolder, $overwrite, $message ) ; | ||
die ($message); | ||
} | ||
if($f == 'reload') { | ||
$i = getMiniGalleryImageList($basedir,$curdir,$baseurl,$section_id); | ||
die($i); | ||
} | ||
if($f == 'delete') { | ||
$filename = $_POST['file']; | ||
if(file_exists($pathToFolder.$filename)) unlink($pathToFolder.$filename); | ||
if(file_exists($thumbFolder.$filename)) unlink($thumbFolder.$filename); | ||
die("ok"); | ||
} | ||
if($f == 'deleteall') { | ||
make_dir($basedir); | ||
rm_full_dir($thumbFolder); | ||
rm_full_dir($pathToFolder); | ||
make_dir($pathToFolder); | ||
make_dir($thumbFolder); | ||
die(""); | ||
} | ||
|
||
} | ||
} | ||
|
||
|
||
function isAjax() { | ||
$isAjax = isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'; | ||
return $isAjax; | ||
} | ||
<?php | ||
/** | ||
* | ||
* @category modules | ||
* @package minigallery v2.5 | ||
* @author Dev4me / Ruud Eisinga | ||
* @link http://www.allwww.nl/ | ||
* @license http://www.gnu.org/licenses/gpl.html | ||
* @platform WebsiteBaker 2.8.x | ||
* @requirements PHP 5.6 and higher | ||
* @version 2.5.1 | ||
* @lastmodified March 28, 2018 | ||
* | ||
*/ | ||
|
||
|
||
require('../../config.php'); | ||
require(dirname(__FILE__).'/info.php'); | ||
require(dirname(__FILE__).'/functions.php') ; | ||
require_once(WB_PATH.'/framework/class.admin.php'); | ||
$admin = new admin('Modules', 'module_view', false, false); | ||
if (!($admin->is_authenticated() || !$admin->get_permission("minigal2", 'module'))) { | ||
die("Go away"); | ||
} | ||
|
||
$basedir = WB_PATH.MEDIA_DIRECTORY.'/'.$image_path.'/'; | ||
$baseurl = WB_URL.MEDIA_DIRECTORY.'/'.$image_path.'/'; | ||
|
||
|
||
if(isset($_POST['section_id']) && is_numeric($_POST['section_id'])) { | ||
$section_id = (int)$_POST['section_id']; | ||
$curdir = $section_id."/"; | ||
$pathToFolder = $basedir.$section_id.'/'; | ||
$thumbFolder = $pathToFolder.'thumbs/'; | ||
make_dir($basedir); | ||
make_dir($pathToFolder); | ||
make_dir($thumbFolder); | ||
$overwrite = true; | ||
} else { | ||
die(); | ||
} | ||
|
||
if(isAjax()) { | ||
if(isset($_POST['function'])) { | ||
$f = $_POST['function']; | ||
if($f == 'upload') { | ||
$get_settings = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_minigal2 WHERE section_id = '$section_id'"); | ||
$settings = $get_settings->fetchRow(); | ||
$maxsize = $settings['maxsize']; | ||
$maxheight = $settings['maxheight']; | ||
$thumbsize = $settings['thumbsize']; | ||
$ratio = $settings['ratio']; | ||
$thumbheight = $thumbsize; | ||
if(!$ratio) { | ||
$thumbsize = 100000; // set width to high value, we want only the height | ||
} | ||
$message = ""; | ||
minigallery_save_upload ( 'file', $maxsize , $maxheight, $thumbsize, $thumbheight, $ratio, $pathToFolder, $thumbFolder, $overwrite, $message ) ; | ||
die ($message); | ||
} | ||
if($f == 'reload') { | ||
$i = getMiniGalleryImageList($basedir,$curdir,$baseurl,$section_id); | ||
die($i); | ||
} | ||
if($f == 'delete') { | ||
$filename = $_POST['file']; | ||
if(file_exists($pathToFolder.$filename)) unlink($pathToFolder.$filename); | ||
if(file_exists($thumbFolder.$filename)) unlink($thumbFolder.$filename); | ||
die("ok"); | ||
} | ||
if($f == 'deleteall') { | ||
make_dir($basedir); | ||
rm_full_dir($thumbFolder); | ||
rm_full_dir($pathToFolder); | ||
make_dir($pathToFolder); | ||
make_dir($thumbFolder); | ||
die(""); | ||
} | ||
if($f == 'caption' ) { | ||
$filename = $database->escapeString($_POST['file']); | ||
$caption = $database->escapeString($_POST['caption']); | ||
minigallery_save_caption ( $section_id, $filename , $caption ); | ||
$i = getMiniGalleryImageList($basedir,$curdir,$baseurl,$section_id); | ||
die($i); | ||
} | ||
if($f == 'sort' ) { | ||
$sorting = $database->escapeString(implode('|',$_POST['arr'])); | ||
minigallery_save_sorting ( $section_id, $sorting ); | ||
die(); | ||
} | ||
|
||
} | ||
} | ||
|
||
|
||
function isAjax() { | ||
$isAjax = isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'; | ||
return $isAjax; | ||
} | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
.minigallery { /* main container per gallery */ | ||
margin: 0 0 10px 0; | ||
} | ||
.minigallery h1 { /* title - if added */ | ||
font-size: 18px; | ||
} | ||
.minigallery .mgdescription { | ||
font-style: italic; | ||
margin: 10px 0; | ||
} | ||
|
||
.minigallery .mgimages { /* the images container. */ | ||
|
||
} | ||
.minigallery a { /* the thumbnail images, floating left to position them next to eachother */ | ||
position: relative; | ||
float: left; | ||
} | ||
.minigallery img { /* the thumbnails could be styled and positioned here */ | ||
border:1px solid #fff; | ||
margin:0 2px 5px 0 ; | ||
.flex-images { overflow: hidden; position: relative; } | ||
.flex-images .item { float: left; margin: 5px; background: #eee; box-sizing: content-box; overflow: hidden; position: relative; } | ||
.flex-images .item img { display: block; width: auto; height: 100%; max-width: none; } | ||
.flex-images .item .caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 4px 6px; font-size: 13px; color: #fff; background: #222; background: rgba(0,0,0,.7); } | ||
.flex-images .item .caption { | ||
-webkit-transform: scaleY(0); | ||
-o-transform: scaleY(0); | ||
-ms-transform: scaleY(0); | ||
transform: scaleY(0); | ||
-webkit-transform-origin: bottom; | ||
-o-transform-origin: bottom; | ||
-ms-transform-origin: bottom; | ||
transform-origin: bottom; | ||
-webkit-transition: -webkit-transform 0.26s ease-out; | ||
-o-transition: -o-transform 0.26s ease; | ||
-ms-transition: -ms-transform 0.26s ease; | ||
transition: transform 0.26s ease; | ||
} | ||
.minigallery .clr { /* used to clear the floating images */ | ||
clear:both; | ||
.flex-images .item:hover .caption { | ||
-webkit-transform: scaleY(1); | ||
-o-transform: scaleY(1); | ||
-ms-transform: scaleY(1); | ||
transform: scaleY(1); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.