diff options
Diffstat (limited to '')
-rw-r--r-- | admin.php | 1 | ||||
-rw-r--r-- | admin/batch_manager_global.php | 7 | ||||
-rw-r--r-- | admin/include/functions.php | 1 | ||||
-rw-r--r-- | admin/themes/default/template/admin.tpl | 3 | ||||
-rw-r--r-- | admin/themes/default/template/thumbnail.tpl | 162 | ||||
-rw-r--r-- | admin/thumbnail.php | 140 |
6 files changed, 0 insertions, 314 deletions
@@ -179,7 +179,6 @@ $template->assign( 'U_RECENT_SET'=> $link_start.'batch_manager&cat=recent', 'U_BATCH'=> $link_start.'batch_manager', 'U_TAGS'=> $link_start.'tags', - 'U_THUMBNAILS'=> $link_start.'thumbnail', 'U_USERS'=> $link_start.'user_list', 'U_GROUPS'=> $link_start.'group_list', 'U_PERMALINKS'=> $link_start.'permalinks', diff --git a/admin/batch_manager_global.php b/admin/batch_manager_global.php index aa019ef4a..7eb833898 100644 --- a/admin/batch_manager_global.php +++ b/admin/batch_manager_global.php @@ -415,7 +415,6 @@ DELETE $updates[$field] = $value; } save_upload_form_config($updates); - $template->delete_compiled_templates(); } trigger_action('element_set_global_action', $action, $collection); @@ -758,12 +757,6 @@ $template->assign( ) ); -function regenerateThumbnails_prefilter($content, $smarty) -{ - return str_replace('{$thumbnail.TN_SRC}', '{$thumbnail.TN_SRC}?rand='.md5(uniqid(rand(), true)), $content); -} -$template->set_prefilter('batch_manager_global', 'regenerateThumbnails_prefilter'); - trigger_action('loc_end_element_set_global'); //----------------------------------------------------------- sending html code diff --git a/admin/include/functions.php b/admin/include/functions.php index a863d6679..2696292ab 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -2015,7 +2015,6 @@ function get_active_menu($menu_page) case 'stats': case 'history': case 'maintenance': - case 'thumbnail': case 'comments': case 'updates': return 4; diff --git a/admin/themes/default/template/admin.tpl b/admin/themes/default/template/admin.tpl index 393cf7157..f4e52cb2c 100644 --- a/admin/themes/default/template/admin.tpl +++ b/admin/themes/default/template/admin.tpl @@ -70,9 +70,6 @@ jQuery(document).ready(function(){ldelim} <li><a href="{$U_SITE_MANAGER}">{'Site manager'|@translate}</a></li> {/if} <li><a href="{$U_HISTORY_STAT}">{'History'|@translate}</a></li> -{if $ENABLE_SYNCHRONIZATION} - <li><a href="{$U_THUMBNAILS}">{'Thumbnails'|@translate}</a></li> -{/if} <li><a href="{$U_MAINTENANCE}">{'Maintenance'|@translate}</a></li> {if isset($U_PENDING_COMMENTS)} <li><a href="{$U_PENDING_COMMENTS}">{'Pending Comments'|@translate}</a></li> diff --git a/admin/themes/default/template/thumbnail.tpl b/admin/themes/default/template/thumbnail.tpl deleted file mode 100644 index b02e80bfa..000000000 --- a/admin/themes/default/template/thumbnail.tpl +++ /dev/null @@ -1,162 +0,0 @@ -{combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.js'} - -{footer_script} -var width_str = '{'Width'|@translate}'; -var height_str = '{'Height'|@translate}'; -var max_width_str = '{'Maximum Width'|@translate}'; -var max_height_str = '{'Maximum Height'|@translate}'; -var remaining = '{'photos without thumbnail (jpeg and png only)'|@translate}'; -var todo = {$TOTAL_NB_REMAINING}; -var done = 0; - -{literal} -var queuedManager = $.manageAjax.create('queued', { - queue: true, - cacheResponse: false, - maxRequests: 3, - complete: function() { - jQuery("#thumb_remaining").text(todo-(++done) + ' ' + remaining); - if (todo == done) { - jQuery('.waiting_bar, #thumb_remaining, .properties').hide(); - } - } -}); - -function processThumbs(width,height,crop,follow_orientation) { - jQuery('tr.nothumb').each(function() { - var image_path = jQuery(this).find('td.filepath').text(); - var td=this; - queuedManager.add({ - type: 'GET', - url: 'ws.php', - data: { - method: 'pwg.images.resizeThumbnail', - image_path: image_path, - maxwidth: width, - maxheight: height, - crop: crop, - follow_orientation: follow_orientation, - format:'json' - }, - dataType: 'json', - success: (function(row) { return function(data) { - if (data.stat =='ok') { - if (todo < 200) - jQuery(row).find('td.thumbpic').html('<img src="'+data.result.destination+'"/>'); - jQuery(row).find('td.thumbdim').html(""+data.result.width+" x "+data.result.height); - jQuery(row).find('td.thumbgentime').html(""+data.result.time); - jQuery(row).find('td.thumbsize').html(""+data.result.size); - jQuery(row).removeClass("nothumb"); - } else { - jQuery(row).find('td.thumbdim').html('#ERR#'+data.err+"# : "+data.message); - jQuery(row).removeClass("nothumb"); - jQuery(row).addClass("error"); - } - } - })(td) - }); - }); -} - -function toggleCropFields() { - if (jQuery("#thumb_crop").is(':checked')) { - jQuery("label[for='thumb_maxwidth']").text(width_str); - jQuery("label[for='thumb_maxheight']").text(height_str); - jQuery("#thumb_follow_orientation_li").show(); - } - else { - jQuery("label[for='thumb_maxwidth']").text(max_width_str); - jQuery("label[for='thumb_maxheight']").text(max_height_str); - jQuery("#thumb_follow_orientation_li").hide(); - } -} - -jQuery(document).ready(function(){ - jQuery('input#proceed').click (function () { - var width = jQuery('input[name="thumb_maxwidth"]').val(); - var height = jQuery('input[name="thumb_maxheight"]').val(); - var crop = jQuery('#thumb_crop').is(':checked'); - var follow_orientation = jQuery('#thumb_follow_orientation').is(':checked'); - jQuery(".waiting_bar").toggle(); - if (todo < 200) - jQuery('.thumbpic').show(); - jQuery('.thumbgentime, .thumbsize, .thumbdim').show(); - processThumbs(width,height,crop,follow_orientation); - }); - - toggleCropFields(); - jQuery("#thumb_crop").click(function () {toggleCropFields()}); - - jQuery('.thumbpic, .thumbgentime, .thumbsize, .thumbdim').hide(); -}); -{/literal}{/footer_script} - -<div class="titrePage"> - <h2>{'Thumbnail creation'|@translate}</h2> -</div> - -{if !empty($remainings) } -<form method="post" action="{$params.F_ACTION}" class="properties"> - - <fieldset> - <legend>{'Thumbnail creation'|@translate}</legend> - - <ul> - <li> - <span class="property"><label for="thumb_crop">{'Crop'|@translate}</label></span> - <input type="checkbox" name="thumb_crop" id="thumb_crop" {$values.thumb_crop}> - </li> - <li id="thumb_follow_orientation_li"> - <span class="property"><label for="thumb_follow_orientation">{'Follow Orientation'|@translate}</label></span> - <input type="checkbox" name="thumb_follow_orientation" id="thumb_follow_orientation" {$values.thumb_follow_orientation}> - </li> - <li> - <span class="property"><label for="thumb_maxwidth">{'Maximum Width'|@translate}</label></span> - <input type="text" name="thumb_maxwidth" id="thumb_maxwidth" value="{$values.thumb_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate} - </li> - <li> - <span class="property"><label for="thumb_maxheight">{'Maximum Height'|@translate}</label></span> - <input type="text" name="thumb_maxheight" id="thumb_maxheight" value="{$values.thumb_maxheight}" size="4" maxlength="4"> {'pixels'|@translate} - </li> - <li> - <span class="property"><label for="thumb_quality">{'Image Quality'|@translate}</label></span> - <input type="text" name="thumb_quality" id="thumb_quality" value="{$values.thumb_quality}" size="3" maxlength="3"> % - </li> - </ul> - </fieldset> - - <p class="waiting_bar"><input type="button" name="submit" id="proceed" value="{'Submit'|@translate}"></p> - <p class="waiting_bar" style="display:none;">{'Please wait...'|@translate}<br><img src="admin/themes/default/images/ajax-loader-bar.gif"></p> -</form> - -<div class="admin"><span id="thumb_remaining">{$TOTAL_NB_REMAINING} {'photos without thumbnail (jpeg and png only)'|@translate}</span></div> -<table style="width:100%;"> - <tr class="throw"> - <th> </th> - <th style="width:60%;">{'Path'|@translate}</th> - <th>{'Filesize'|@translate}</th> - <th>{'Dimensions'|@translate}</th> - <th class="thumbpic">{'Thumbnail'|@translate}</th> - <th class="thumbgentime">{'generated in'|@translate}</th> - <th class="thumbsize">{'Filesize'|@translate}</th> - <th class="thumbdim">{'Dimensions'|@translate}</th> - </tr> - {foreach from=$remainings item=elt name=remain_loop} - <tr class="{if $smarty.foreach.remain_loop.index is odd}row1{else}row2{/if} nothumb item" id="th_{$smarty.foreach.remain_loop.iteration}"> - <td>{$smarty.foreach.remain_loop.iteration}</td> - <td class="filepath">{$elt.PATH}</td> - <td>{$elt.FILESIZE_IMG}</td> - <td>{$elt.WIDTH_IMG} x {$elt.HEIGHT_IMG}</td> - <td class="thumbpic"><img src="admin/themes/default/images/ajax-loader.gif"></td> - <td class="thumbgentime"> </td> - <td class="thumbsize"> </td> - <td class="thumbdim"> </td> - </tr> - {/foreach} -</table> -{else} -<p style="text-align:left;margin:20px;"> -<b>{'No missing thumbnail'|@translate}</b><br><br> -{'If you want to regenerate thumbnails, please go to the <a href="%s">Batch Manager</a>.'|@translate|@sprintf:"admin.php?page=batch_manager"} -</p> -{/if}
\ No newline at end of file diff --git a/admin/thumbnail.php b/admin/thumbnail.php deleted file mode 100644 index 7ccea0536..000000000 --- a/admin/thumbnail.php +++ /dev/null @@ -1,140 +0,0 @@ -<?php -// +-----------------------------------------------------------------------+ -// | Piwigo - a PHP based photo gallery | -// +-----------------------------------------------------------------------+ -// | Copyright(C) 2008-2012 Piwigo Team http://piwigo.org | -// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | -// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | -// +-----------------------------------------------------------------------+ -// | This program is free software; you can redistribute it and/or modify | -// | it under the terms of the GNU General Public License as published by | -// | the Free Software Foundation | -// | | -// | This program is distributed in the hope that it will be useful, but | -// | WITHOUT ANY WARRANTY; without even the implied warranty of | -// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | -// | General Public License for more details. | -// | | -// | You should have received a copy of the GNU General Public License | -// | along with this program; if not, write to the Free Software | -// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | -// | USA. | -// +-----------------------------------------------------------------------+ - -include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); -include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php'); - -check_status(ACCESS_ADMINISTRATOR); - -// +-----------------------------------------------------------------------+ -// | Load configuration | -// +-----------------------------------------------------------------------+ -$upload_form_config = get_upload_form_config(); - -$form_values = array(); - -foreach ($upload_form_config as $param_shortname => $param) -{ - $param_name = 'upload_form_'.$param_shortname; - $form_values[$param_shortname] = $conf[$param_name]; -} - -// +-----------------------------------------------------------------------+ -// | search pictures without thumbnails | -// +-----------------------------------------------------------------------+ -$wo_thumbnails = array(); - -// what is the directory to search in ? -$query = ' -SELECT galleries_url FROM '.SITES_TABLE.' - WHERE galleries_url NOT LIKE \'http://%\' -;'; -$result = pwg_query($query); -while ( $row=pwg_db_fetch_assoc($result) ) -{ - $basedir = preg_replace('#/*$#', '', $row['galleries_url']); - $fs = get_fs($basedir); - - // because isset is one hundred time faster than in_array - $fs['thumbnails'] = array_flip($fs['thumbnails']); - - foreach ($fs['elements'] as $path) - { - // only pictures need thumbnails - if (in_array(get_extension($path), $conf['picture_ext'])) - { - $dirname = dirname($path); - $filename = basename($path); - - // only files matching the authorized filename pattern can be considered - // as "without thumbnail" - if (!preg_match('/^[a-zA-Z0-9-_.]+$/', $filename)) - { - continue; - } - - // searching the element - $filename_wo_ext = get_filename_wo_extension($filename); - $tn_ext = ''; - $base_test = $dirname.'/'.$conf['dir_thumbnail'].'/'; - $base_test.= $conf['prefix_thumbnail'].$filename_wo_ext.'.'; - foreach ($conf['picture_ext'] as $ext) - { - if (isset($fs['thumbnails'][$base_test.$ext])) - { - $tn_ext = $ext; - break; - } - } - - if (empty($tn_ext)) - { - array_push($wo_thumbnails, $path); - } - } - } // next element -} // next site id - -// +-----------------------------------------------------------------------+ -// | form & pictures without thumbnails display | -// +-----------------------------------------------------------------------+ -$template->set_filenames( array('thumbnail'=>'thumbnail.tpl') ); - -if (count($wo_thumbnails) > 0) -{ - foreach ($wo_thumbnails as $path) - { - list($width, $height) = getimagesize($path); - $size = floor(filesize($path) / 1024).' KB'; - - $template->append( - 'remainings', - array( - 'PATH'=>$path, - 'FILESIZE_IMG'=>$size, - 'WIDTH_IMG'=>$width, - 'HEIGHT_IMG'=>$height, - ) - ); - } -} - -foreach (array_keys($upload_form_config) as $field) -{ - if (is_bool($upload_form_config[$field]['default'])) - { - $form_values[$field] = $form_values[$field] ? 'checked="checked"' : ''; - } -} - -$template->assign( - array( - 'F_ACTION' => get_root_url().'admin.php?page=thumbnail', - 'values' => $form_values, - 'TOTAL_NB_REMAINING' => count($wo_thumbnails), - 'U_HELP' => get_root_url().'admin/popuphelp.php?page=thumbnail', - ) -); - -$template->assign_var_from_handle('ADMIN_CONTENT', 'thumbnail'); -?> |