[Linpha-cvs] SF.net SVN: linpha: [4611] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-10-31 23:05:49
|
Revision: 4611 http://svn.sourceforge.net/linpha/?rev=4611&view=rev Author: fangehrn Date: 2006-10-31 15:05:16 -0800 (Tue, 31 Oct 2006) Log Message: ----------- * use in imgview.class the width and heigth from database * updated file list support of imagemagick Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/import.php trunk/linpha2/docs/dev/TODO.txt trunk/linpha2/lib/classes/linpha.filesys.class.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.identify.class.php trunk/linpha2/lib/classes/linpha.image.class.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.import.class.php trunk/linpha2/lib/classes/linpha.metadata.class.php trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/modules/module.ajax.php trunk/linpha2/lib/modules/module.albums.php trunk/linpha2/lib/modules/module.browse.php trunk/linpha2/lib/modules/module.newimg.php trunk/linpha2/lib/modules/module.search.php trunk/linpha2/templates/default/fragments.php trunk/linpha2/templates/default/themes/default/css/global.css Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/ChangeLog 2006-10-31 23:05:16 UTC (rev 4611) @@ -1,5 +1,7 @@ 2006-10-31 flo * saving img width and height during import in database + * use in imgview.class the width and heigth from database + * updated file list support of imagemagick 2006-10-30 flo * implemented ajax login/logout Modified: trunk/linpha2/admin/import.php =================================================================== --- trunk/linpha2/admin/import.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/admin/import.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -35,7 +35,7 @@ if( isset($_POST['cmd']) && $_POST['cmd']=='import') { - echo '<h1>'.i18n("Running Import...").'</h1><br />'; + echo '<h1>'.i18n("Running Import...").'</h1>'; if(!isset($_REQUEST['album_select']) OR $_REQUEST['album_select'][0]=='all') { @@ -52,7 +52,7 @@ */ if($_REQUEST['index_import']=='index') { - echo '<h2>'.i18n("Directory Import").'</h2><br />'; + echo '<h2>'.i18n("Directory Import").'</h2>'; if($all_albums) { echo i18n("Parsing All Directories...").'<br />'; @@ -88,7 +88,7 @@ */ if($_REQUEST['index_thumbnails']!='no' OR isset($_REQUEST['index_thumbnails_delete'])) { - echo '<h2>'.i18n("Thumbnails").'</h2><br />'; + echo '<h2>'.i18n("Thumbnails").'</h2>'; $thumbnail = new LinImage(); @@ -137,7 +137,7 @@ foreach($_REQUEST['album_select'] AS $key=>$value) { $data = $GLOBALS['linpha']->db->GetRow("SELECT name FROM ".PREFIX."photos WHERE id = '".LinSql::linAddslashes($value)."'"); - echo '<h3>'.i18n("Parsing Directory:").' '.$data['name'].'</h3><br />'; + echo i18n("Parsing Directory:").' '.$data['name'].'<br />'; $sql = "SELECT id FROM ".PREFIX."photos WHERE " . "parent_id = '".LinSql::linAddslashes($value)."' AND " . @@ -191,7 +191,7 @@ echo '<br />'; } - echo '<br /><br />'; + echo '<br />'; } @@ -208,7 +208,7 @@ if( isset( $_REQUEST['index_'.$meta_value] ) && ( $_REQUEST['index_'.$meta_value] == 'index' OR isset($_REQUEST['index_'.$meta_value.'_delete']) ) ) { - echo '<h2>'.i18n("File Indexing").' ('.strtoupper($meta_value).')</h2><br />'; + echo '<h2>'.i18n("File Indexing").' ('.strtoupper($meta_value).')</h2>'; /** * get imgids to indexing, if reindex is selected: delete these entries first @@ -300,9 +300,10 @@ flush(); } } + } - echo '<br />'; + echo '<br /><br />'; } unset($array_meta_ids); } @@ -321,6 +322,8 @@ <?php echo i18n("Import").':'; ?> <br /> + +<input type="checkbox" id="index_import_detect_filechanges" name="force_update" value="true" /><label for="index_import_detect_filechanges"> <?php echo i18n("Detect File Changes"); ?></label><br /> <input type="radio" id="index_import_no" name="index_import" value="no" /><label for="index_import_no"> <?php echo i18n("No Import"); ?></label><br /> <input type="radio" id="index_import_index" name="index_import" value="index" checked="checked" /><label for="index_import_index"> <?php echo i18n("Import"); ?></label><br /> <br /> Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/docs/dev/TODO.txt 2006-10-31 23:05:16 UTC (rev 4611) @@ -4,7 +4,8 @@ ## Small Todos -- save image height and width in database to reduce file access in get_image.php and imgview() ? +- since the admin pages uses the template system, there is no update of the status during the import + thats not very user friendly ## Big Todos Modified: trunk/linpha2/lib/classes/linpha.filesys.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.filesys.class.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.filesys.class.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -237,5 +237,29 @@ return $ext; } +/** + * This function formats the filesize (byte) value to kB/MB/GB + */ +function niceFilesize($filesize, $precision) +{ + if ($filesize < 1000) { + $sizeunit = 'Bytes'; + $precision = 0; + } else { + $filesize /= 1024; + $sizeunit = 'KB'; + } + if ($filesize >= 1000) { + $filesize /= 1024; + $sizeunit = 'MB'; + } + if ($filesize >= 1000) { + $filesize /= 1024; + $sizeunit = 'GB'; + } + return number_format($filesize, $precision).' '.$sizeunit; +} + + } // end class LinFile ?> Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -99,29 +99,6 @@ } /** - * This function formats the filesize (byte) value to kB/MB/GB - */ -function niceFilesize($filesize, $precision) -{ - if ($filesize < 1000) { - $sizeunit = 'Bytes'; - $precision = 0; - } else { - $filesize /= 1024; - $sizeunit = 'KB'; - } - if ($filesize >= 1000) { - $filesize /= 1024; - $sizeunit = 'MB'; - } - if ($filesize >= 1000) { - $filesize /= 1024; - $sizeunit = 'GB'; - } - return number_format($filesize, $precision).' '.$sizeunit; -} - -/** * cut a string to the given size */ function cutString($string,$len,$with_span_title) Modified: trunk/linpha2/lib/classes/linpha.identify.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.identify.class.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.identify.class.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -345,95 +345,101 @@ 'dcm' => 109, 'dcx' => 110, 'dib' => 111, - 'dpx' => 112, - 'emf' => 113, - 'epdf' => 114, - 'epi' => 115, - 'eps' => 116, -// 'eps2' => 117, only write support -// 'eps3' => 118, only write support - 'epsf' => 119, - 'epsi' => 120, - 'ept' => 121, - 'fax' => 122, - 'fig' => 123, - 'fits' => 124, - 'fpx' => 125, -// 'gif' => 126, already - 'gplt' => 127, - 'gray' => 128, - 'hpgl' => 129, -// 'html' => 130, this type shouldn't be handled as image - 'ico' => 131, - 'jbig' => 132, - 'jng' => 133, -// 'jp2' => 134, already -// 'jpc' => 135, already -// 'jpeg' => 136, already - 'man' => 137, - 'mat' => 138, - 'miff' => 139, - 'mono' => 140, - 'mng' => 141, -// 'm2v' => 142, video -// 'mpeg' => 143, video - 'mpc' => 144, - 'msl' => 145, - 'mtv' => 146, - 'mvg' => 147, - 'otb' => 148, - 'p7' => 149, - 'palm' => 150, - 'pbm' => 151, - 'pcd' => 152, - 'pcds' => 153, - 'pcl w' => 154, - 'pcx' => 155, - 'pdb' => 156, -// 'pdf' => 157, this type shouldn't be handled as image - 'pfa' => 158, - 'pfb' => 159, - 'pgm' => 160, - 'picon' => 161, - 'pict' => 162, - 'pix' => 163, -// 'png' => 164, already - 'pnm' => 165, - 'ppm' => 166, - 'ps' => 167, - 'ps2' => 168, - 'ps3' => 169, -// 'psd' => 170, already - 'ptif' => 171, - 'pwp' => 172, - 'rad' => 173, - 'rgb' => 174, - 'rgba' => 175, - 'rla' => 176, - 'rle' => 177, - 'sct' => 178, - 'sfw' => 179, - 'sgi' => 180, - 'shtml' => 181, - 'sun' => 182, - 'svg' => 183, - 'tga' => 184, -// 'tiff' => 185, already - 'tim' => 186, - 'ttf' => 187, -// 'txt' => 188, this type shouldn't be handled as image - 'uil w' => 189, - 'uyvy' => 190, - 'vicar' => 191, - 'viff' => 192, -// 'wbmp' => 193, already - 'wmf' => 194, - 'wpg' => 195, -// 'xbm' => 196, already - 'xcf' => 197, - 'xpm' => 198, - 'xwd' => 199, - 'yuv' => 200, + 'dng' => 112, + 'dot' => 113, + 'dpx' => 114, + 'emf' => 115, + 'epdf' => 116, + 'epi' => 117, + 'eps' => 118, +// 'eps2' => 119, only write support +// 'eps3' => 120, only write support + 'epsf' => 121, + 'epsi' => 122, + 'ept' => 123, + 'fax' => 124, + 'fig' => 125, + 'fits' => 126, + 'fpx' => 127, +// 'gif' => 128, already + 'gplt' => 129, + 'gray' => 130, + 'hpgl' => 131, +// 'html' => 132, this type shouldn't be handled as image + 'ico' => 133, + 'jbig' => 134, + 'jng' => 135, +// 'jp2' => 136, already +// 'jpc' => 137, already +// 'jpeg' => 138, already +// 'man' => 139, this type shouldn't be handled as image + 'mat' => 140, + 'miff' => 141, + 'mono' => 142, + 'mng' => 143, +// 'mpeg' => 144, video +// 'm2v' => 145, video + 'mpc' => 146, + 'msl' => 147, + 'mtv' => 148, + 'mvg' => 149, + 'otb' => 150, + 'p7' => 151, + 'palm' => 152, +// 'pam' => 153, only write support + 'pbm' => 154, + 'pcd' => 155, + 'pcds' => 156, + 'pcl w' => 157, + 'pcx' => 158, + 'pdb' => 159, +// 'pdf' => 160, this type shouldn't be handled as image + 'pfa' => 161, + 'pfb' => 162, + 'pgm' => 163, + 'picon' => 164, + 'pict' => 165, + 'pix' => 166, +// 'png' => 167, already + 'pnm' => 168, + 'ppm' => 169, + 'ps' => 170, + 'ps2' => 171, + 'ps3' => 172, +// 'psd' => 173, already + 'ptif' => 174, + 'pwp' => 175, + 'rad' => 176, + 'rgb' => 177, + 'rgba' => 178, + 'rla' => 179, + 'rle' => 180, + 'sct' => 181, + 'sfw' => 182, + 'sgi' => 183, +// 'shtml' => 184, only write support + 'sun' => 185, + 'svg' => 186, + 'tga' => 187, +// 'tiff' => 188, already + 'tim' => 189, + 'tif' => 190, +// 'txt' => 191, this type shouldn't be handled as image +// 'uil' => 192, only write support + 'uyvy' => 193, + 'vicar' => 194, + 'viff' => 195, +// 'wbmp' => 196, already + 'wmf' => 197, + 'wpg' => 198, +// 'x' => 199, ? +// 'xbm' => 200, already + 'xcf' => 201, + 'xpm' => 202, + 'xwd' => 203, + 'ycbcr' => 204, + 'ycbcra' => 205, + 'yuv' => 206, // video 'mpg' => 1000, // getimagesize detects mpg as type 15, but type 15 is wbmp (look at the mimetype returned by getimagesize), pay attention... @@ -459,35 +465,36 @@ 'php' => 3002, 'asp' => 3003, - 'txt' => 4000, - 'pdf' => 4001, - 'rtf' => 4002, + 'txt' => 3050, + 'pdf' => 3051, + 'rtf' => 3052, + 'man' => 3053, // OpenOffice - 'sxw' => 5000, // OpenOffice Textdocument - 'stw' => 5001, // OpenOffice Textdocument - 'sxc' => 5002, // OpenOffice Spreadsheet - 'stc' => 5003, // OpenOffice Spreadsheet - 'sxi' => 5004, // OpenOffice Presentation - 'sti' => 5005, // OpenOffice Presentation - 'sxd' => 5006, // OpenOffice Draw - 'std' => 5007, // OpenOffice Draw - 'sxm' => 5008, // OpenOffice Formula + 'sxw' => 3100, // OpenOffice Textdocument + 'stw' => 3101, // OpenOffice Textdocument + 'sxc' => 3102, // OpenOffice Spreadsheet + 'stc' => 3103, // OpenOffice Spreadsheet + 'sxi' => 3104, // OpenOffice Presentation + 'sti' => 3105, // OpenOffice Presentation + 'sxd' => 3106, // OpenOffice Draw + 'std' => 3107, // OpenOffice Draw + 'sxm' => 3108, // OpenOffice Formula - 'sdw' => 5020, // Starwriter Textdocument - 'sdc' => 5021, // Starcalc - 'sda' => 5022, // StarImpress - 'sdd' => 5023, // StarImpress - 'sdp' => 5024, // StarImpress + 'sdw' => 3120, // Starwriter Textdocument + 'sdc' => 3121, // Starcalc + 'sda' => 3122, // StarImpress + 'sdd' => 3123, // StarImpress + 'sdp' => 3124, // StarImpress // MS Office - 'doc' => 5500, // MS Word - 'dot' => 5501, // MS Word - 'xls' => 5502, // MS Excel - 'xlt' => 5503, // MS Excel - 'ppt' => 5504, // MS Powerpoint - 'pps' => 5505, // MS Powerpoint - 'pot' => 5506, // MS Powerpoint + 'doc' => 3200, // MS Word + 'dot' => 3201, // MS Word + 'xls' => 3202, // MS Excel + 'xlt' => 3203, // MS Excel + 'ppt' => 3204, // MS Powerpoint + 'pps' => 3205, // MS Powerpoint + 'pot' => 3206, // MS Powerpoint */ 'unsupported' => 9999999 Modified: trunk/linpha2/lib/classes/linpha.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.image.class.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.image.class.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -32,12 +32,12 @@ public $photo_id, $cached_id; public $isCached; -public $img_type; public $mode; public $image_tool; +public $img_type, $org_width, $org_height, $rotate; private $src_file; -private $org_width, $org_height, $img_width, $img_height; +private $img_width, $img_height; private $img_quality; /** @@ -53,7 +53,7 @@ * check for valid id * and get img_type and rotate informations */ - $query = $GLOBALS['linpha']->db->Execute("SELECT id, img_type, rotate " . + $query = $GLOBALS['linpha']->db->Execute("SELECT id, img_type, rotate, width, height " . "FROM ".PREFIX."photos " . "WHERE id = '".LinSql::linAddslashes( $this->photo_id )."'"); @@ -91,6 +91,8 @@ */ $this->rotate = $data['rotate']; $this->img_type = $data['img_type']; + $this->org_width = $data['width']; + $this->org_height = $data['height']; $this->setCachedInfos(); /** @@ -274,9 +276,6 @@ echo i18n("You should consider start a re-import of your files/folders").'<br />'; return false; } - - - list($this->org_width,$this->org_height,$org_type) = LinIdentify::linGetImageSize( $this->src_file ); } return true; Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -24,6 +24,9 @@ */ if(!defined('LINPHA_DIR')) { exit(1); } +define('SELECT_FIELDS',PREFIX."photos.id, ".PREFIX."photos.name, ".PREFIX."photos.img_type, ". + PREFIX."photos.md5sum, ".PREFIX."photos.width, ".PREFIX."photos.height, ". + PREFIX."photos.stats_numbers, ".PREFIX."photos.time_add"); class LinImgview { @@ -33,7 +36,7 @@ public $photos; public $photos_filtered; public $use_javascript; -public $id_current, $id_parent, $img_type, $filename, $md5sum; +public $id_current, $id_parent, $img_type, $filename, $md5sum, $org_width, $org_height; private $nr_pages, $current_page; // only used if javascript disabled private $newCommentAdded = false; // used for ajax @@ -60,7 +63,7 @@ /** * set file informations */ - $current_data = $GLOBALS['linpha']->db->GetRow("SELECT id, name, img_type, parent_id, md5sum FROM ".PREFIX."photos " . + $current_data = $GLOBALS['linpha']->db->GetRow("SELECT id, name, img_type, parent_id, md5sum, width, height FROM ".PREFIX."photos " . "WHERE id = '".linSql::linAddslashes($_GET['id'])."'"); /** @@ -72,6 +75,8 @@ $this->img_type = $current_data['img_type']; $this->filename = $current_data['name']; $this->md5sum = $current_data['md5sum']; + $this->org_width = $current_data['width']; + $this->org_height = $current_data['height']; $this->id_current = $current_data['id']; /** @@ -265,6 +270,7 @@ Array( 'name' => i18n("Import"), 'value' => Array( + Array('name' => i18n("Start Import Of This Folder/File"), 'value' => LINPHA_DIR.'/admin/?cat=import&album_select[]='.$this->id_parent), Array('name' => i18n("Detect File Changes"), 'value' => $GLOBALS['linpha']->template->URL_full.'&force_update') ) ); @@ -600,7 +606,7 @@ } else { $flag_nr = 13; } - $array_image_infos = MetaData::readInformations( $full_filename, $filename, $md5sum, $flag_nr ); + $array_image_infos = MetaData::readInformations( $full_filename, $filename, $md5sum, $photo_value['width'], $photo_value['height'], $flag_nr ); $index = 'before'; $i=0; @@ -1152,24 +1158,20 @@ */ function viewImgCommon() { - /** - * get image width and height - * @todo see todo.txt wether to save width and height in database - */ - $this->src_file = LinSql::getFullImagePath( $this->id_current ); - list($this->org_width,$this->org_height,$org_type) = LinIdentify::linGetImageSize( $this->src_file ); - $this->max_width = $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; - $this->max_height = $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; - $array = LinImage::scaleToFit($this->org_width,$this->org_height,$this->max_width,$this->max_height); - $this->img_width = $array['w']; - $this->img_height = $array['h']; + $this->src_file = LinSql::getFullImagePath( $this->id_current ); + $this->max_width = $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; + $this->max_height = $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; + $array = LinImage::scaleToFit($this->org_width,$this->org_height,$this->max_width,$this->max_height); + $this->img_width = $array['w']; + $this->img_height = $array['h']; + $this->viewImgSetPrevNextThumb(); $this->viewImgStoreImageInformation(); include_once(LINPHA_DIR.'/lib/classes/linpha.metadata.class.php'); - $GLOBALS['linpha']->template->output['image_infos'] = MetaData::readInformations( $this->full_filename, $this->filename, $this->md5sum, $flag_nr=10 ); + $GLOBALS['linpha']->template->output['image_infos'] = MetaData::readInformations( $this->full_filename, $this->filename, $this->md5sum, $this->org_width, $this->org_height, $flag_nr=10 ); if(isset($_GET['force_update'])) { LinImport::updateEntry( $this->id_current , dirname($this->full_filename) , $this->filename ); Modified: trunk/linpha2/lib/classes/linpha.import.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.import.class.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.import.class.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -118,8 +118,9 @@ /** * "detect file changes", parse updated entries * not by default! (performance issues) + * and only admin can do that */ - if( isset($_GET['force_update']) ) + if( isset($_REQUEST['force_update']) && $GLOBALS['linpha']->sql->isAdmin() ) { foreach($array_update AS $key=>$value) { @@ -172,8 +173,8 @@ $GLOBALS['linpha']->db->Execute("INSERT into ".PREFIX."photos ( " . "parent_id, name, img_type, md5sum, width, height, time_add, time_mod, time_exif, rotate, stats_numbers ) " . - "VALUES ( '".$parent_id."' , '".$GLOBALS['linpha']->sql->linAddslashes($filename)."', " . - "'".$file_type."' , '".$org_width."' , '".$org_height."' , '".$md5sum."', '".time()."', '".filemtime($dirname.'/'.$filename)."', '".$time_exif."', '".$rotate."', '".$stats_number."' )"); + "VALUES ( '".$parent_id."' , '".$GLOBALS['linpha']->sql->linAddslashes($filename)."', '".$file_type."'," . + "'".$md5sum."' , '".$org_width."' , '".$org_height."' , '".time()."', '".filemtime($dirname.'/'.$filename)."', '".$time_exif."', '".$rotate."', '".$stats_number."' )"); /** * delete thumbnail if one exists with the same id @@ -315,7 +316,10 @@ "SET md5sum = '".$md5sum."', width = '".$org_width."', height = '".$org_height."', time_mod = '".filemtime($dirname.'/'.$filename)."', time_exif = '".$time_exif."', rotate = '".$rotate."' WHERE id = '".$id."'"); LinImport::updateMd5sum( $id, $data[1], $md5sum ); - LinImage::createThumbnail( $id , $file_type , $force=true ); + + $thumbnail = new LinImage(); + $_GET['force'] = true; + $thumbnail->createThumbnail($id); } } @@ -324,6 +328,12 @@ * occurs while rotating images, or if LinImport detects a change of the file * (for example: image has been edited with an external program) * + * problem: if there are two images with the same md5sum, and one image gets changed + * linpha will update the md5sum of the changed image forthe comments (for example) + * to the new value, but if we then do a "detect file changes" on the old image, + * the old image will do the same and change the md5sum of the comment back to this + * this will create a race condition + * * @todo if the file changed, it is best to re-index image * -> delete/update exif/iptc/xmp data! */ Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -73,7 +73,7 @@ /** * read image information from database */ -function readInformations($full_filename,$filename,$md5sum,$flag_nr) +function readInformations($full_filename,$filename,$md5sum,$width,$height,$flag_nr) { $query = $GLOBALS['linpha']->db->Execute("SELECT name " . "FROM ".PREFIX."meta_fields " . @@ -106,11 +106,10 @@ $value = $filename; // is already escaped break; case 'imagesize': - $value = filesize( $full_filename ); + $value = LinFilesys::niceFilesize( filesize( $full_filename ), 2 ); break; case 'dimension': - $array = LinIdentify::linGetImageSize( $full_filename ); - $value = $array[0].'x'.$array[1]; + $value = $width.'x'.$height; break; case 'thumbnail': $value = 'thumbnail'; Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/js/LinImage.js 2006-10-31 23:05:16 UTC (rev 4611) @@ -34,8 +34,11 @@ }, loadImage: function(imgId) { - IdCurrent = imgId; - menuNeedsUpdating = true; // IdCurrent changed, update menu on next hover of the menu + if(IdCurrent != imgId) + { + IdCurrent = imgId; + menuNeedsUpdating = true; // IdCurrent changed, update menu on next hover of the menu + } if(preloadXmlFinished[imgId] && typeof xmlDoc[imgId] != "undefined" ) // use typeof to work in IE { Modified: trunk/linpha2/lib/modules/module.ajax.php =================================================================== --- trunk/linpha2/lib/modules/module.ajax.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/modules/module.ajax.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -75,15 +75,6 @@ $linpha->template->URL_full = $linpha->template->URL_base.'&id='.$linpha->imgview->id_current; $_SESSION['ref_url_full'] = $linpha->template->URL_full; - if( $linpha->imgview->mode == 'image' ) - { - /** - * @todo read from database - */ - $src_file = LinSql::getFullImagePath( $linpha->imgview->id_current ); - list($linpha->imgview->org_width,$linpha->imgview->org_height,$org_type) = LinIdentify::linGetImageSize( $src_file ); - } - $linpha->imgview->setMenu(); } else // return a default menu Modified: trunk/linpha2/lib/modules/module.albums.php =================================================================== --- trunk/linpha2/lib/modules/module.albums.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/modules/module.albums.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -77,10 +77,10 @@ * * take folders first */ - $array_folders = $GLOBALS['linpha']->db->GetAssoc("SELECT id, name, img_type, md5sum, stats_numbers, time_add FROM ".PREFIX."photos " . + $array_folders = $GLOBALS['linpha']->db->GetAssoc("SELECT ".SELECT_FIELDS." FROM ".PREFIX."photos " . "WHERE img_type = '0' AND parent_id = '".$linpha->imgview->id_parent."' ORDER by ".$linpha->imgview->orderby); - $array_files = $GLOBALS['linpha']->db->GetAssoc("SELECT id, name, img_type, md5sum, stats_numbers, time_add FROM ".PREFIX."photos " . + $array_files = $GLOBALS['linpha']->db->GetAssoc("SELECT ".SELECT_FIELDS." FROM ".PREFIX."photos " . "WHERE img_type <> '0' AND img_type <> '9999999' AND parent_id = '".$linpha->imgview->id_parent."' ORDER by ".$linpha->imgview->orderby); $linpha->imgview->photos = array_merge($array_folders,$array_files); Modified: trunk/linpha2/lib/modules/module.browse.php =================================================================== --- trunk/linpha2/lib/modules/module.browse.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/modules/module.browse.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -226,9 +226,7 @@ if(isset($_GET['year']) && $_GET['year']==0) { - $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT " . - "".PREFIX."photos.id, ".PREFIX."photos.name, ".PREFIX."photos.img_type, " . - "".PREFIX."photos.md5sum, ".PREFIX."photos.stats_numbers, ".PREFIX."photos.time_add " . + $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT ".SELECT_FIELDS." ". "FROM ".PREFIX."photos " . "LEFT OUTER JOIN ".PREFIX."meta_exif " . "ON ".PREFIX."photos.md5sum = ".PREFIX."meta_exif.md5sum " . @@ -239,9 +237,7 @@ } else { - $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT " . - "".PREFIX."photos.id, ".PREFIX."photos.name, ".PREFIX."photos.img_type, " . - "".PREFIX."photos.md5sum, ".PREFIX."photos.stats_numbers, ".PREFIX."photos.time_add " . + $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT ".SELECT_FIELDS." ". "FROM ".PREFIX."photos, ".PREFIX."meta_exif " . "WHERE ".PREFIX."photos.md5sum = ".PREFIX."meta_exif.md5sum " . "AND img_type <> '0' " . Modified: trunk/linpha2/lib/modules/module.newimg.php =================================================================== --- trunk/linpha2/lib/modules/module.newimg.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/modules/module.newimg.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -71,9 +71,7 @@ if( $GLOBALS['linpha']->sql->config->value['sys_style_home_newimagesnr'] != 0 ) { - $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT " . - PREFIX."photos.id, ".PREFIX."photos.name, ".PREFIX."photos.img_type, " . - PREFIX."photos.md5sum, ".PREFIX."photos.stats_numbers, ".PREFIX."photos.time_add " . + $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT ".SELECT_FIELDS." ". "FROM ".PREFIX."photos WHERE img_type <> 0 AND img_type <> 9999999 AND time_add > ".LinSql::linAddslashes($lower_date)." ". "ORDER BY ".$linpha->imgview->orderby); } Modified: trunk/linpha2/lib/modules/module.search.php =================================================================== --- trunk/linpha2/lib/modules/module.search.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/modules/module.search.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -423,10 +423,7 @@ * set sql query string *DISTINCT */ - $sql_begin = "SELECT ".PREFIX."photos.id AS id, ".PREFIX."photos.name AS name, ". - PREFIX."photos.md5sum AS md5sum, " . - PREFIX."photos.img_type AS img_type, ". - PREFIX."photos.stats_numbers AS stats_numbers, ".PREFIX."photos.time_add AS time_add "; + $sql_begin = "SELECT ".SELECT_FIELDS." "; $sql_where = " FROM ".PREFIX."photos ". Modified: trunk/linpha2/templates/default/fragments.php =================================================================== --- trunk/linpha2/templates/default/fragments.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/templates/default/fragments.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -32,7 +32,7 @@ <li> <div> <?php if( useAjax() ) { ?> - <form action="" method="POST" onsubmit="new Ajax.Updater('menu', LINPHA_DIR + '/?cat=ajax&reloadmenu', {method: 'post', asynchronous:true, parameters:Form.serialize(this), evalScripts:true}); return false;"> + <form action="" method="POST" onsubmit="new Ajax.Updater('menu', LINPHA_DIR + '/?cat=ajax&reloadmenu&id='+IdCurrent, {method: 'post', asynchronous:true, parameters:Form.serialize(this), evalScripts:true}); return false;"> <?php } else { ?> <form action="<?php echo $this->URL_full; ?>" method="POST"> <?php } Modified: trunk/linpha2/templates/default/themes/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/global.css 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/templates/default/themes/default/css/global.css 2006-10-31 23:05:16 UTC (rev 4611) @@ -14,6 +14,7 @@ font-size: 18pt; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0px; + margin-top: 0px; margin-bottom: 5px; padding: 0px; } @@ -22,6 +23,7 @@ font-size: 14pt; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0px; + margin-top: 0px; margin-bottom: 5px; padding: 0px; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |