Changeset 31245 for extensions/GDThumb/main.inc.php
- Timestamp:
- Jul 20, 2015, 1:45:59 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GDThumb/main.inc.php
r31134 r31245 2 2 /* 3 3 Plugin Name: gdThumb 4 Version: 1.0.1 74 Version: 1.0.18 5 5 Description: Apply Masonry style to album or image thumbs 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=771 … … 19 19 // | Plugin constants | 20 20 // +-----------------------------------------------------------------------+ 21 define('GDTHUMB_VERSION', '1.0.1 7');21 define('GDTHUMB_VERSION', '1.0.18'); 22 22 define('GDTHUMB_ID', basename(dirname(__FILE__))); 23 23 define('GDTHUMB_PATH' , PHPWG_PLUGINS_PATH . GDTHUMB_ID . '/'); … … 28 28 if (!isset($conf['gdThumb'])): 29 29 include(dirname(__FILE__).'/config_default.inc.php'); 30 31 $query = ' 32 INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) 33 VALUES ("gdThumb" , "'.addslashes(serialize($config_default)).'" , "GDThumb plugin parameters");'; 34 pwg_query($query); 30 conf_update_param('gdThumb', $config_default); 35 31 load_conf_from_db(); 36 32 endif; … … 113 109 $template->set_filename( 'index_thumbnails', dirname(__FILE__) . '/template/gdthumb_thumb.tpl'); 114 110 $template->assign('GDThumb', $confTemp); 115 $template->assign('GDThumb_derivative_params', ImageStdParams::get_custom(9999, $confTemp['height'])); 111 if (($confTemp['method'] == "slide") || ($confTemp['method'] == "square")): 112 $template->assign('GDThumb_derivative_params', ImageStdParams::get_custom($confTemp['height'], 9999)); 113 else: 114 $template->assign('GDThumb_derivative_params', ImageStdParams::get_custom(9999, $confTemp['height'])); 115 endif; 116 116 117 117 if ($confTemp['big_thumb'] and !empty($tpl_vars[0])): 118 $derivative_params = ImageStdParams::get_custom(9999, 2 * $confTemp['height'] + $confTemp['margin']); 118 if (($confTemp['method'] == "slide") || ($confTemp['method'] == "square")): 119 $derivative_params = ImageStdParams::get_custom(2 * $confTemp['height'] + $confTemp['margin'], 9999); 120 else: 121 $derivative_params = ImageStdParams::get_custom(9999, 2 * $confTemp['height'] + $confTemp['margin']); 122 endif; 119 123 $template->assign('GDThumb_big', new DerivativeImage($derivative_params, $tpl_vars[0]['src_image'])); 120 124 endif; … … 132 136 $template->set_filename( 'index_category_thumbnails', dirname(__FILE__) . '/template/gdthumb_cat.tpl'); 133 137 $template->assign('GDThumb', $confTemp); 134 $template->assign('GDThumb_derivative_params', ImageStdParams::get_custom(9999, $confTemp['height'])); 138 if (($confTemp['method'] == "slide") || ($confTemp['method'] == "square")): 139 $template->assign('GDThumb_derivative_params', ImageStdParams::get_custom($confTemp['height'], 9999)); 140 else: 141 $template->assign('GDThumb_derivative_params', ImageStdParams::get_custom(9999, $confTemp['height'])); 142 endif; 135 143 136 144 if ($confTemp['big_thumb'] and !empty($tpl_vars[0])): 137 145 $id = $tpl_vars[0]["representative_picture_id"]; 138 146 if (($id) && ($rep = $tpl_vars[0]["representative"])): 139 $derivative_params = ImageStdParams::get_custom(9999, 2 * $confTemp['height'] + $confTemp['margin']); 147 if (($confTemp['method'] == "slide") || ($confTemp['method'] == "square")): 148 $derivative_params = ImageStdParams::get_custom(2 * $confTemp['height'] + $confTemp['margin'], 9999); 149 else: 150 $derivative_params = ImageStdParams::get_custom(9999, 2 * $confTemp['height'] + $confTemp['margin']); 151 endif; 140 152 $template->assign('GDThumb_big', new DerivativeImage($derivative_params, $rep['src_image'])); 141 153 endif;
Note: See TracChangeset
for help on using the changeset viewer.