[Linpha-cvs] SF.net SVN: linpha: [4591] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-10-25 21:33:39
|
Revision: 4591 http://svn.sourceforge.net/linpha/?rev=4591&view=rev Author: fangehrn Date: 2006-10-25 14:33:18 -0700 (Wed, 25 Oct 2006) Log Message: ----------- 2006-10-25 flo * implemented detailed view Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/image_fields_select.php trunk/linpha2/install/sql/sql.data.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/js/LinThumbnails.js trunk/linpha2/templates/default/css/view_thumb.css trunk/linpha2/templates/default/view_thumb.head.php trunk/linpha2/templates/default/view_thumbdetail.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/ChangeLog 2006-10-25 21:33:18 UTC (rev 4591) @@ -1,6 +1,7 @@ 2006-10-25 flo * fixed installation issues * secured $_SERVER['PHP_SELF'] + * implemented detailed view 2006-10-19 flo * added basic new images Modified: trunk/linpha2/admin/image_fields_select.php =================================================================== --- trunk/linpha2/admin/image_fields_select.php 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/admin/image_fields_select.php 2006-10-25 21:33:18 UTC (rev 4591) @@ -9,6 +9,7 @@ $array_menu = Array( 'image' => Array('name' => 'Image', 'link' => 'imagefields_select_image'), 'thumb' => Array('name' => 'Thumbnail', 'link' => 'imagefields_select_thumb'), + 'thumbdetail' => Array('name' => 'Thumbnail Detail View', 'link' => 'imagefields_select_thumbdetail'), 'video' => Array('name' => 'Video', 'link' => 'imagefields_select_video'), 'album' => Array('name' => 'Album', 'link' => 'imagefields_select_album') ); @@ -23,7 +24,9 @@ case 'thumb': printFieldsTable(13); break; - +case 'thumbdetail': + printFieldsTable(14); + break; case 'video': break; Modified: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/install/sql/sql.data.php 2006-10-25 21:33:18 UTC (rev 4591) @@ -191,5 +191,21 @@ $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . "(name, field_type, flags) VALUES ('builtin_description', 0, 13)"; + /** + * preselected fields for thumbnails in detail view + */ + $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_thumbnail', 0, 14)"; + $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_filename', 0, 14)"; + $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_description', 0, 14)"; + $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_imagesize', 0, 14)"; + $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_dimension', 0, 14)"; + $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('exif_datetimeoriginal', 0, 14)"; + ?> Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-25 21:33:18 UTC (rev 4591) @@ -179,11 +179,9 @@ switch($_SESSION['mode_thumbview']) { case 'thumb': + case 'thumbdetail': $this->viewThumb(); break; - case 'thumbdetail': - $this->viewThumbdetail(); - break; case 'basket': $this->viewBasket(); break; @@ -327,16 +325,29 @@ ) ); - $GLOBALS['linpha']->template->output['menu_More']['view'] = - Array( - 'name' => i18n("View"), - 'value' => Array( - Array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), - Array('name' => i18n("View"), 'value' => $array_views_links), - Array('name' => i18n("Thumb Size"), 'value' => $array_tn_sizes_links), - Array('name' => i18n("Thumb Nr"), 'value' => $array_nr_links) - ) - ); + if( useAjax() ) + { + $GLOBALS['linpha']->template->output['menu_More']['view'] = + Array( + 'name' => i18n("View"), + 'value' => Array( + Array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), + Array('name' => i18n("View"), 'value' => $array_views_links), + Array('name' => i18n("Thumb Size"), 'value' => $array_tn_sizes_links), + Array('name' => i18n("Thumb Nr"), 'value' => $array_nr_links) + ) + ); + } + else + { + $GLOBALS['linpha']->template->output['menu_More']['view'] = + Array( + 'name' => i18n("View"), + 'value' => Array( + Array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), + ) + ); + } if($GLOBALS['linpha']->sql->photoIsAllowed( $this->id_parent, 'write')) { @@ -539,59 +550,8 @@ } -/** - * prepare stuff for slideshow - * @uses LinImgview::buildImgView() - */ -/*function slideshow() -{ - foreach($this->photos_filtered AS $key=>$photo_value) - { - if(LinIdentify::isSupportedImage($photo_value['img_type'])) - { - $array_entries[] = '{ 0: "'.$photo_value['id'].'", 1: "title" }'; - } - } - - if(isset($array_entries)) - { - $GLOBALS['linpha']->template->output['slideshow_head'] = - '<link rel="stylesheet" href="'.LINPHA_DIR.'/lib/classes/lightbox/css/lightbox.css" type="text/css" media="screen" />'."\n". - '<script src="'.LINPHA_DIR.'/lib/classes/lightbox/prototype.js" type="text/javascript"></script>'."\n". - '<script src="'.LINPHA_DIR.'/lib/classes/lightbox/scriptaculous.js?load=effects" type="text/javascript"></script>'."\n". - '<script src="'.LINPHA_DIR.'/lib/classes/lightbox/lightbox.js" type="text/javascript"></script>'."\n". - '<script language="JavaScript" type="text/javascript">'."\n". - 'var imageArray = ['."\n". - implode(',',$array_entries). - '];'."\n". - "\n". - 'var fileLoadingImage = "'.LINPHA_DIR.'/lib/classes/lightbox/images/loading.gif";'."\n". - 'var fileBottomNavCloseImage = "'.LINPHA_DIR.'/lib/classes/lightbox/images/closelabel.gif";'."\n". - 'function setImageUrl(id)'."\n". - '{'."\n". - 'var arrayPageSize = getPageSize();'."\n". - 'return \''.LINPHA_DIR.'/get_image.php?id=\' + imageArray[activeImage][0] + \'&width=\' + (arrayPageSize[2]-100) + \'&height=\' + (arrayPageSize[3]-100)'."\n". - '}'."\n". - "\n". - '</script>'."\n"; - - $GLOBALS['linpha']->template->output['slideshow_body'] = - '<div id="slideshow">'."\n". - '<a href="'.$GLOBALS['linpha']->template->URL_full.'">'.i18n("Close").'</a>'."\n". - '<br />'.i18n("Random Play Order").'<input type="radio" id="slideshowRandomOff" name="slideshowRandom" checked="checked" />'.i18n("No").'<input type="radio" id="slideshowRandomOn" name="slideshowRandom" />'.i18n("Yes")."\n". - '<br />'.i18n("Autoplay").'<input type="checkbox" id="slideshowAutostart" />'."\n". - '<br />'.i18n("Time Delay")."\n". - '<select id="slideshowTimeDelay"><option>3</option><option>4</option><option>5</option><option>10</option></select>'."\n". - '<br /><a href="#" onclick="myLightbox.start();">'.i18n("Start Slideshow").'<img src="'.LINPHA_DIR.'/templates/default/images/slideshow.png" border="0" /></a>'."\n". - '</div>'."\n"; - } -}*/ - - - - /** * define thumbnail view */ @@ -611,7 +571,12 @@ $md5sum = $photo_value['md5sum']; $full_filename = LinSql::getFullImagePath( $photo_value['id'] ); - $array_image_infos = MetaData::readInformations( $full_filename, $filename, $md5sum, $flag_nr=13 ); + if($_SESSION['mode_thumbview'] == 'thumbdetail') { + $flag_nr = 14; + } else { + $flag_nr = 13; + } + $array_image_infos = MetaData::readInformations( $full_filename, $filename, $md5sum, $flag_nr ); $index = 'before'; foreach($array_image_infos AS $value) @@ -627,11 +592,11 @@ { if($index == 'before') { - $GLOBALS['linpha']->template->output['thumb_infos'][$photo_value['id']][$index] .= $value['value'].'<br />'; // $value['value'] is already escaped + $GLOBALS['linpha']->template->output['thumb_infos'][$photo_value['id']]['before'] .= $value['value'].'<br />'; // $value['value'] is already escaped } elseif($index == 'after') { - $GLOBALS['linpha']->template->output['thumb_infos'][$photo_value['id']][$index] .= '<br />'.$value['value']; // $value['value'] is already escaped + $GLOBALS['linpha']->template->output['thumb_infos'][$photo_value['id']]['after'] .= $value['value'].'<br />'; // $value['value'] is already escaped } } } @@ -851,6 +816,13 @@ $this->tot_photos = count($this->photos_filtered) - $nr_folders; } +/** + * setup detailed thumbdetail view + */ +function viewThumbdetail() +{ + $GLOBALS['linpha']->template->setModuleName('view_thumbdetail'); +} @@ -984,26 +956,10 @@ } } -/** - * setup detailed thumbdetail view - */ -function viewThumbdetail() -{ - $GLOBALS['linpha']->template->setModuleName('view_thumbdetail'); -} -/** - * add comments in detailed view - */ -function viewThumbdetailSetComments() -{ - -} - - /** * setup basket view */ Modified: trunk/linpha2/lib/js/LinThumbnails.js =================================================================== --- trunk/linpha2/lib/js/LinThumbnails.js 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/lib/js/LinThumbnails.js 2006-10-25 21:33:18 UTC (rev 4591) @@ -14,10 +14,21 @@ * fine tuning * better a space more than a space too less */ -var img_spacer_width = 12; // used to calculate nr_cols -var img_spacer_height = 11; // used to calculate nr_rows -var img_div_spacer_height = 11; // used to calculate max-height of the image (depending how much text we would like to add) +if(view_mode == 'thumbdetail') +{ + var img_spacer_width = 150 + 28; // used to calculate nr_cols, 200 = width of text div, 25 = overhead + var img_spacer_height = 10; // used to calculate nr_rows + var img_div_spacer_height = 0; // used to calculate max-height of the image (depending how much text we would like to add at bottom) +} +else // 'thumb' +{ + var img_spacer_width = 12; // used to calculate nr_cols + var img_spacer_height = 11; // used to calculate nr_rows + var img_div_spacer_height = 11; // used to calculate max-height of the image (depending how much text we would like to add at bottom) +} + + /** * page numbers */ @@ -103,24 +114,28 @@ { if(i >= startup_img_nr && img_nr <= max_photos_per_page) { - if( (img_nr-1) % nr_cols == 0) - { - styletext = ' style="clear:left;"'; + if( (img_nr-1) % nr_cols == 0) { + var styletext = ' style="clear:left;"'; + } else { + var styletext = ''; } - else - { - styletext = ''; + + if(view_mode == 'thumbdetail') { + var style2text = ' style="float: left;"'; + } else { + var style2text = ''; } + divhtmltext += - '<div id="div' + i + '"' + styletext + ' class="imgdiv">' + - img_ids[i]['before'] + + '<div id="div' + i + '"' + styletext + ' class="divthumb">' + + img_ids[i]['before'] + '<div class="divimg"' + style2text + '>' + '<a href="' + link_url + '&id=' + img_ids[i]['id'] + '">' + '<img src="' + link_get_thumb + img_ids[i]['id'] + '"' + ' height="' + tn_size + '" width="' + tn_size + '" ' + ' alt="' + img_ids[i]['title'] + '" title="' + img_ids[i]['title'] + '"' + - ' class="img_thumbnail" />' + - '</a>' + img_ids[i]['after'] + '</div>'; + ' class="imgthumb" />' + + '</a></div><div class="divtext">' + img_ids[i]['after'] + '</div></div>'; /** * flush buffer of divhtmltext on end of line Modified: trunk/linpha2/templates/default/css/view_thumb.css =================================================================== --- trunk/linpha2/templates/default/css/view_thumb.css 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/templates/default/css/view_thumb.css 2006-10-25 21:33:18 UTC (rev 4591) @@ -46,20 +46,22 @@ /** * thumbnails */ - .imgdiv { - /* border: 1px #000000 solid;*/ + .divthumb { /* outer div */ margin: 3px; text-align: center; float: left; font-size: 8pt; } + .divimg { + } - .img_thumbnail { + .imgthumb { /* inner div with thumbnail */ border: 0; - /*width: auto;*/ } - .img_text { + .divtext { /* inner div with bottom or right text */ padding-left: 10px; text-align: left; - } \ No newline at end of file + width: 150px; + float: left; + } Modified: trunk/linpha2/templates/default/view_thumb.head.php =================================================================== --- trunk/linpha2/templates/default/view_thumb.head.php 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/templates/default/view_thumb.head.php 2006-10-25 21:33:18 UTC (rev 4591) @@ -5,6 +5,7 @@ var link_url = '<?php echo convert_amp($GLOBALS['linpha']->template->URL_base); ?>'; var tn_size = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>; var photos_per_page = 'auto'; +var view_mode = '<?php echo $_SESSION['mode_thumbview']; ?>'; <?php echo $GLOBALS['linpha']->template->output['files_db']."\n"; ?> </script> Modified: trunk/linpha2/templates/default/view_thumbdetail.html.php =================================================================== --- trunk/linpha2/templates/default/view_thumbdetail.html.php 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/templates/default/view_thumbdetail.html.php 2006-10-25 21:33:18 UTC (rev 4591) @@ -1,4 +1,11 @@ +<?php +@todo not needed anymore +to be deleted + +?> + + <!-- navigation --> <?php if(isset($GLOBALS['linpha']->template->output['navigation']) && !empty($GLOBALS['linpha']->template->output['navigation'])) { ?> <div id="divnavigation"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |