[Linpha-cvs] SF.net SVN: linpha: [4614] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-11-02 20:00:16
|
Revision: 4614 http://svn.sourceforge.net/linpha/?rev=4614&view=rev Author: fangehrn Date: 2006-11-02 11:38:14 -0800 (Thu, 02 Nov 2006) Log Message: ----------- Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/settings_layout.php trunk/linpha2/index.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/lib/classes/linpha.template.class.php trunk/linpha2/lib/modules/module.empty.php trunk/linpha2/templates/default/search.html.php trunk/linpha2/templates/default/themes/default/css/view_img.css trunk/linpha2/templates/default/view_img_static.html.php trunk/linpha2/templates/default/view_thumb.head.php Added Paths: ----------- trunk/linpha2/templates/default/themes/vertical-nav/ trunk/linpha2/templates/default/themes/vertical-nav/css/ trunk/linpha2/templates/infos.txt Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-11-01 17:57:39 UTC (rev 4613) +++ trunk/linpha2/ChangeLog 2006-11-02 19:38:14 UTC (rev 4614) @@ -1,3 +1,13 @@ +2006-11-02 flo + * changed template system: + - include all the default files + and if theme != default and theme file exists + append theme file + this will cause we dont have to copy the whole theme folder + if making only a few changes + * added a "vertical align of thumbs" theme for the poor guys + without a widescreen tft :-P + 2006-11-01 flo * implemented linpha_log() * unified the use of $_GET['id'] Modified: trunk/linpha2/admin/settings_layout.php =================================================================== --- trunk/linpha2/admin/settings_layout.php 2006-11-01 17:57:39 UTC (rev 4613) +++ trunk/linpha2/admin/settings_layout.php 2006-11-02 19:38:14 UTC (rev 4614) @@ -74,7 +74,7 @@ $LinAdmin->saveConfig(Array( 'sys_style_layout_title', 'sys_style_layout_template', - 'sys_style_layout_layout', + 'sys_style_layout_theme', 'sys_style_layout_color_bodybg', 'sys_style_layout_color_elembg', 'sys_style_layout_color_font', Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-11-01 17:57:39 UTC (rev 4613) +++ trunk/linpha2/index.php 2006-11-02 19:38:14 UTC (rev 4614) @@ -1,6 +1,7 @@ <?php if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','.'); } + include_once(LINPHA_DIR.'/lib/include/common.php'); /** Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-01 17:57:39 UTC (rev 4613) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-02 19:38:14 UTC (rev 4614) @@ -469,19 +469,19 @@ if( $GLOBALS['linpha']->sql->checkPermission('basket_download')) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.$GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_all_with_checkout&checkout_as=download">'. - '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/download.png" border="0" title="'.i18n("Download Images").'" />' + '<img src="'.$GLOBALS['linpha']->template->themeFile('images/download.png').'" border="0" title="'.i18n("Download Images").'" />' .'</a>'."\n"; } if( $GLOBALS['linpha']->sql->checkPermission('basket_print')) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.$GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_all_with_checkout&checkout_as=print">'. - '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/print.png" border="0" title="'.i18n("Print Images").'" />' + '<img src="'.$GLOBALS['linpha']->template->themeFile('images/print.png').'" border="0" title="'.i18n("Print Images").'" />' .'</a>'."\n"; } if( $GLOBALS['linpha']->sql->checkPermission('basket_mail')) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.$GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_all_with_checkout&checkout_as=mail">'. - '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/slideshow.png" border="0" title="'.i18n("Mail Images").'" />' + '<img src="'.$GLOBALS['linpha']->template->themeFile('images/slideshow.png').'" border="0" title="'.i18n("Mail Images").'" />' .'</a>'."\n"; } /** @@ -489,7 +489,7 @@ */ if( useAjax() ) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="javascript:slideshowStartFromThumbview()">'. - '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/slideshow.png" border="0" title="'.i18n("Play Slideshow").'" />' + '<img src="'.$GLOBALS['linpha']->template->themeFile('images/slideshow.png').'" border="0" title="'.i18n("Play Slideshow").'" />' .'</a>'."\n"; } @@ -502,19 +502,19 @@ if( $GLOBALS['linpha']->sql->checkPermission('download')) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.LINPHA_DIR.'/download_file.php?id='.$GLOBALS['linpha']->template->idCurrent.'">'. - '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/download.png" border="0" title="'.i18n("Download Image").'" />' + '<img src="'.$GLOBALS['linpha']->template->themeFile('images/download.png').'" border="0" title="'.i18n("Download Image").'" />' .'</a>'."\n"; } if( $GLOBALS['linpha']->sql->checkPermission('basket_print')) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.$GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_this_with_checkout&checkout_as=print">'. - '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/print.png" border="0" title="'.i18n("Print Image").'" />' + '<img src="'.$GLOBALS['linpha']->template->themeFile('images/print.png').'" border="0" title="'.i18n("Print Image").'" />' .'</a>'."\n"; } if( $GLOBALS['linpha']->sql->checkPermission('basket_mail')) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.$GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_this_with_checkout&checkout_as=mail">'. - '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/slideshow.png" border="0" title="'.i18n("Mail Image").'" />' + '<img src="'.$GLOBALS['linpha']->template->themeFile('images/slideshow.png').'" border="0" title="'.i18n("Mail Image").'" />' .'</a>'."\n"; } @@ -523,7 +523,7 @@ */ if( useAjax() ) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="javascript:myLinImage.fullscreenStart()">'. - '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/slideshow.png" border="0" title="'.i18n("Play Slideshow").'" />' + '<img src="'.$GLOBALS['linpha']->template->themeFile('images/slideshow.png').'" border="0" title="'.i18n("Play Slideshow").'" />' .'</a>'."\n"; } } Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-01 17:57:39 UTC (rev 4613) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-02 19:38:14 UTC (rev 4614) @@ -202,11 +202,30 @@ */ $GLOBALS['linpha']->template = new linTemplate(); - if(!isset($_GET['id'])) { - $GLOBALS['linpha']->template->idCurrent = 0; - } else { + if(isset($_GET['id'])) + { $GLOBALS['linpha']->template->idCurrent = intval($_GET['id']); } + else + { + if( isset($_SERVER['PATH_INFO']) ) + { + $id = LinSql::getIdFromFullFilename( substr($_SERVER['PATH_INFO'],1) ); // PATH_INFO starts with a '/' -> remove this + + if($id === false) + { + $GLOBALS['linpha']->template->idCurrent = 0; + } + else + { + $GLOBALS['linpha']->template->idCurrent = $id; + } + } + else + { + $GLOBALS['linpha']->template->idCurrent = 0; + } + } session_name('linpha2'); session_start(); @@ -580,6 +599,37 @@ } /** + * returns the id of the given full filename + */ +function getIdFromFullFilename( $full_filename ) +{ + if( empty($full_filename)) + { + return false; + } + + $array_filenames = explode('/', $full_filename ); + $parent_id = 0; + + foreach($array_filenames AS $value) + { + $query = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".PREFIX."photos " . + "WHERE parent_id = '".LinSql::linAddslashes($parent_id)."' AND " . + "name = '".LinSql::linAddslashes($value)."'"); + $data = $query->FetchRow(); + + if( !isset($data['id']) OR empty($data['id'])) + { + return false; + } + + $parent_id = $data['id']; + } + + return $data['id']; +} + +/** * returns an array with the full pathname of the given id */ function getFullFilenameFromId( $photos_id ) Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-01 17:57:39 UTC (rev 4613) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-02 19:38:14 UTC (rev 4614) @@ -40,12 +40,13 @@ { $this->idCurrent = 0; + /** + * @todo secure template_name and layout_name because they are used in include() + */ $this->template_name = $GLOBALS['linpha']->sql->config->value['sys_style_layout_template']; $this->layout_name = $GLOBALS['linpha']->sql->config->value['sys_style_layout_theme']; $this->linpha_title = $GLOBALS['linpha']->sql->config->value['sys_style_layout_title']; - $this->layoutsimagespath = LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/images'; - $this->bgcolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_color_elembg']; $this->bodybgcolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_color_bodybg']; $this->fontcolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_color_font']; @@ -77,17 +78,35 @@ */ ?> <!-- css includes --> -<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name. - '/colorsettings.php?bg='.$this->bgcolor.'&bodybg='.$this->bodybgcolor.'&font='.$this->fontcolor. + +<!-- colorsettings.php --> +<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/default/colorsettings.php'. + '?bg='.$this->bgcolor.'&bodybg='.$this->bodybgcolor.'&font='.$this->fontcolor. '&albumsbg='.$this->albumsbgcolor.'&links='.$this->linkscolor.'&linkshover='.$this->linkshovercolor; ?>' type='text/css'> -<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/global.css'; ?>' type='text/css'> -<?php -$filename = LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/'.$this->css_name.'.css'; -if(file_exists($filename)) -{ - echo "<link rel='stylesheet' href='".$filename."' type='text/css'>\n"; -} -?> +<?php if($this->layout_name != 'default' && + file_exists(LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/colorsettings.php')) +{ ?> +<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name."/colorsettings.php?bg=". + $this->bgcolor."&bodybg=".$this->bodybgcolor."&font=".$this->fontcolor. + "&albumsbg=".$this->albumsbgcolor."&links=".$this->linkscolor."&linkshover=".$this->linkshovercolor; ?>' type='text/css'> +<?php } ?> + +<!-- global.css --> +<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/default/css/global.css'; ?>' type='text/css'> +<?php if($this->layout_name != 'default' && + file_exists(LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/global.css')) +{ ?> +<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/global.css'; ?>' type='text/css'>\n"; +<?php } ?> + +<!-- body css --> +<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/default/css/'.$this->css_name.'.css'; ?>' type='text/css'> +<?php if($this->layout_name != 'default' && + file_exists(LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/'.$this->css_name.'.css')) +{ ?> +<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/'.$this->css_name.'.css'; ?>' type='text/css'> +<?php } ?> + <!--[if IE]> <style type="text/css" media="screen"> #menu ul { width: 1em; } /* this will be a *min* width */ @@ -108,7 +127,6 @@ <script type="text/javascript" language="JavaScript"> var LINPHA_DIR = '<?php echo LINPHA_DIR; ?>'; var IdCurrent = <?php echo $this->idCurrent; ?>; - <?php if(! isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax'])) { @@ -306,6 +324,18 @@ return $str; } + + function themeFile( $filename ) + { + if( file_exists( LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/'.$filename ) ) + { + return LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/'.$filename; + } + else + { + return LINPHA_DIR.'/templates/'.$this->template_name.'/themes/default/'.$filename; + } + } } // end class linTemplate ?> \ No newline at end of file Modified: trunk/linpha2/lib/modules/module.empty.php =================================================================== --- trunk/linpha2/lib/modules/module.empty.php 2006-11-01 17:57:39 UTC (rev 4613) +++ trunk/linpha2/lib/modules/module.empty.php 2006-11-02 19:38:14 UTC (rev 4614) @@ -25,7 +25,35 @@ if(!defined('LINPHA_DIR')) { exit(1); } +echo $_SERVER['PHP_SELF'].'<br />'; + +if( isset($_SERVER['PATH_INFO']) ) +{ + echo $_SERVER['PATH_INFO'].'<br />'; + + $name = substr($_SERVER['PATH_INFO'],1); + echo $name.'<br />'; + + $id = LinSql::getIdFromFullFilename($name); + + + echo '<br /><br /><br />'; + + if($id === false) + { + echo 'false!'; + } + else + { + echo 'not false!<br />'; + echo $id.'<br />'; + } +} + + +exit(); + $linpha->template->output['default'] = ''; $linpha->template->setModuleName('default'); Modified: trunk/linpha2/templates/default/search.html.php =================================================================== --- trunk/linpha2/templates/default/search.html.php 2006-11-01 17:57:39 UTC (rev 4613) +++ trunk/linpha2/templates/default/search.html.php 2006-11-02 19:38:14 UTC (rev 4614) @@ -94,7 +94,7 @@ ?> <br /><b><?php echo i18n("Search").strtoupper($meta_type); ?></b><br /> <input type="checkbox" id="b_<?php echo $meta_type; ?>_all" name="button[<?php echo $meta_type; ?>][all]" value="1"<?php echo isset($_REQUEST['b_'.$meta_type.'_all']) ? ' checked' : ''; ?> onClick="check_all('b_<?php echo $meta_type; ?>_all','<?php echo $meta_type; ?>')"><label for="b_<?php echo $meta_type; ?>_all"><b><?php echo i18n("All"); ?></b></label> - <a href="javascript:div_expand('div_<?php echo $meta_type; ?>');"><img border="0" src="<?php echo $tpl->layoutsimagespath.'/expand.gif'; ?>" /></a> + <a href="javascript:div_expand('div_<?php echo $meta_type; ?>');"><img border="0" src="<?php echo $tpl->themeFile('images/expand.gif'); ?>" /></a> <br /> <div id="div_<?php echo $meta_type; ?>" style="border: 1px solid black; width: 200px;"> <?php Modified: trunk/linpha2/templates/default/themes/default/css/view_img.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/view_img.css 2006-11-01 17:57:39 UTC (rev 4613) +++ trunk/linpha2/templates/default/themes/default/css/view_img.css 2006-11-02 19:38:14 UTC (rev 4614) @@ -1,5 +1,6 @@ #divmain { + margin-bottom: 10px; } #main { position: relative; Modified: trunk/linpha2/templates/default/view_img_static.html.php =================================================================== --- trunk/linpha2/templates/default/view_img_static.html.php 2006-11-01 17:57:39 UTC (rev 4613) +++ trunk/linpha2/templates/default/view_img_static.html.php 2006-11-02 19:38:14 UTC (rev 4614) @@ -12,15 +12,18 @@ </div> <?php } ?> +<!-- thumbnails --> <div id="divthumbnavi"> <?php echo $tpl->divRoundCorners('top'); ?> <div id="thumbnavi"> - <div class="thumbnavi_prevthumb"> + <div id="thumbnavi_prevthumb"> <?php echo $tpl->output['prev_thumb']; ?> </div> - <?php echo $tpl->output['current_thumb']; ?> - <div class="thumbnavi_nextthumb"> + <div id="thumbnavi_currentthumb"> + <?php echo $tpl->output['current_thumb']; ?> + </div> + <div id="thumbnavi_nextthumb"> <?php echo $tpl->output['next_thumb']; ?> </div> </div> Modified: trunk/linpha2/templates/default/view_thumb.head.php =================================================================== --- trunk/linpha2/templates/default/view_thumb.head.php 2006-11-01 17:57:39 UTC (rev 4613) +++ trunk/linpha2/templates/default/view_thumb.head.php 2006-11-02 19:38:14 UTC (rev 4614) @@ -11,5 +11,5 @@ </script> <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/scriptaculous.js?load=builder"></script> -<script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR.'/templates/'.$tpl->template_name.'/themes/'.$tpl->layout_name.'/DefsThumbView.js'; ?>"></script> +<script type="text/javascript" language="javascript" src="<?php echo $tpl->themeFile('DefsThumbView.js'); ?>"></script> <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/LinThumbnails.js"></script> Added: trunk/linpha2/templates/infos.txt =================================================================== --- trunk/linpha2/templates/infos.txt (rev 0) +++ trunk/linpha2/templates/infos.txt 2006-11-02 19:38:14 UTC (rev 4614) @@ -0,0 +1,23 @@ + +CSS sort order: + + position: absolute; + left: 50%; + + float: left; + + border-top: 1px solid #000000; + + white-space: nowrap; + list-style: none; + font-size: 0.5em; + text-align: center; + + + width: 80px; + height: 80px; + + margin: 0; + margin-left: 5px; + margin-right: 5px; + padding: 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |