Skip to content

Commit

Permalink
updated to v2.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbaseman committed Apr 13, 2018
1 parent fc6cd42 commit d633303
Show file tree
Hide file tree
Showing 38 changed files with 4,384 additions and 939 deletions.
17 changes: 7 additions & 10 deletions add.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
/**
*
* @category modules
* @package minigallery v2.2
* @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.2.2 and higher
* @version 2.2.0
* @lastmodified June 17, 2017
* @requirements PHP 5.6 and higher
* @version 2.5.1
* @lastmodified March 28, 2018
*
*/


if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
require_once (dirname(__FILE__).'/functions.php');
require_once (WB_PATH.'/framework/functions.php');

$res = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_minigal2 WHERE `page_id` = '$page_id' ORDER by `section_id` DESC");
Expand Down Expand Up @@ -52,10 +54,5 @@
('$page_id','$section_id','$addscripts','$maxsize','$thumbsize','$ratio','$class','$rel','$name','$description','$autoplay','$interval','$transition')");

// Create directories for this gallery
$basedir = WB_PATH.MEDIA_DIRECTORY.'/minigal2/';
$pathToFolder = $basedir.$section_id.'/';
$thumbFolder = $pathToFolder.'thumbs/';
make_dir($basedir);
make_dir($pathToFolder);
make_dir($thumbFolder);
minigallery_create_dir($section_id);
?>
177 changes: 99 additions & 78 deletions ajax.php
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;
}

43 changes: 37 additions & 6 deletions backend.css

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions backend.js

Large diffs are not rendered by default.

Binary file added blank.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
/**
*
* @category modules
* @package minigallery v2.2
* @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.2.2 and higher
* @version 2.2.0
* @lastmodified June 17, 2017
* @requirements PHP 5.6 and higher
* @version 2.5.1
* @lastmodified March 28, 2018
*
*/


if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
require_once (WB_PATH.'/framework/functions.php');

Expand Down
Binary file added edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 22 additions & 22 deletions frontend.css
100755 → 100644
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);
}
7 changes: 7 additions & 0 deletions frontend.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d633303

Please sign in to comment.