[Linpha-cvs] SF.net SVN: linpha: [4623] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-11-05 17:48:43
|
Revision: 4623 http://svn.sourceforge.net/linpha/?rev=4623&view=rev Author: fangehrn Date: 2006-11-05 09:42:35 -0800 (Sun, 05 Nov 2006) Log Message: ----------- * unified linpha functions * unified linpha templates and css files Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/image_fields_select.php trunk/linpha2/admin/import.php trunk/linpha2/admin/permissions_others.php trunk/linpha2/admin/permissions_readwrite.php trunk/linpha2/admin/settings_features.php trunk/linpha2/admin/settings_layout.php trunk/linpha2/lib/classes/archiver.class.php trunk/linpha2/lib/classes/linpha.admin.class.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.image.class.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/include/basket_build_mail.php trunk/linpha2/lib/include/basket_build_print.php trunk/linpha2/lib/js/LinGlobal.js trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/js/LinThumbnails.js trunk/linpha2/lib/modules/module.albums.php trunk/linpha2/lib/modules/module.basket.php trunk/linpha2/lib/modules/module.filemanager.php trunk/linpha2/lib/modules/module.settings.php trunk/linpha2/templates/default/basket.html.php trunk/linpha2/templates/default/default.html.php trunk/linpha2/templates/default/fragments.php trunk/linpha2/templates/default/global.html.php trunk/linpha2/templates/default/home.html.php trunk/linpha2/templates/default/search.html.php trunk/linpha2/templates/default/themes/default/colorsettings.php trunk/linpha2/templates/default/themes/default/css/admin.css trunk/linpha2/templates/default/themes/default/css/filemanager.css trunk/linpha2/templates/default/themes/default/css/global.css trunk/linpha2/templates/default/themes/default/css/home.css trunk/linpha2/templates/default/themes/default/css/view_img.css trunk/linpha2/templates/default/themes/default/css/view_thumb.css trunk/linpha2/templates/default/themes/vertical-nav/css/view_img.css trunk/linpha2/templates/default/view_albcomment.html.php trunk/linpha2/templates/default/view_basket.html.php trunk/linpha2/templates/default/view_img.head.php trunk/linpha2/templates/default/view_img.html.php trunk/linpha2/templates/default/view_img_static.html.php trunk/linpha2/templates/default/view_meta.html.php trunk/linpha2/templates/default/view_thumb.html.php trunk/linpha2/templates/default/view_thumb_static.html.php trunk/linpha2/templates/infos.txt Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/ChangeLog 2006-11-05 17:42:35 UTC (rev 4623) @@ -6,6 +6,8 @@ replace( /linId=[0-9]*/g , "linId=" + IdCurrent ); its just an search/replace of 'linId=x' in the menu its very fast (about 0 - 15ms) and its executed every time the image changes + * unified linpha functions + * unified linpha templates and css files 2006-11-03 flo * startet making linpha includable by other web pages Modified: trunk/linpha2/admin/image_fields_select.php =================================================================== --- trunk/linpha2/admin/image_fields_select.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/admin/image_fields_select.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -223,7 +223,7 @@ obj = document.getElementById('select_image_fields'); NewEntry = new Option( document.form_image_fields.title_name.value, document.form_image_fields.title_name.value, false, true ); - NewEntry.className = "option_title"; + NewEntry.className = "linSelectOptionTitle"; obj.options[obj.options.length] = NewEntry; document.form_image_fields.title_name.value = ""; } Modified: trunk/linpha2/admin/import.php =================================================================== --- trunk/linpha2/admin/import.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/admin/import.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -35,7 +35,7 @@ if( isset($_POST['cmd']) && $_POST['cmd']=='import') { - echo '<h1>'.i18n("Running Import...").'</h1>'; + echo '<h1 class="linStyle">'.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>'; + echo '<h2 class="linStyle">'.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>'; + echo '<h2 class="linStyle">'.i18n("Thumbnails").'</h2>'; $thumbnail = new LinImage(); @@ -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>'; + echo '<h2 class="linStyle">'.i18n("File Indexing").' ('.strtoupper($meta_value).')</h2>'; /** * get imgids to indexing, if reindex is selected: delete these entries first @@ -310,13 +310,13 @@ } -echo '<h1>'.i18n("Import").'</h1>'; +echo '<h1 class="linStyle">'.i18n("Import").'</h1>'; echo i18n("Select Folders For Import/Update:"); ?> <br /> <form action="./?cat=import" method="POST"> <select name="album_select[]" size="10" multiple="multiple" style="width: 500px;"> -<?php buildAlbumSelect($with_all_albs_entry=true); ?> +<?php linBuildAlbumSelect($with_all_albs_entry=true); ?> </select> <br /><br /> @@ -360,7 +360,7 @@ /** * dry-run */ -echo '<h2>'.i18n("Stuff Not Up-To-Date").'</h2>'; +echo '<h2 class="linStyle">'.i18n("Stuff Not Up-To-Date").'</h2>'; /** * import Modified: trunk/linpha2/admin/permissions_others.php =================================================================== --- trunk/linpha2/admin/permissions_others.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/admin/permissions_others.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -77,7 +77,7 @@ $data = $GLOBALS['linpha']->db->GetRow("SELECT permission FROM ".PREFIX."permissions " . "WHERE perm_type = '".LinSql::linAddslashes($key)."'"); - $array_permissions = explodeAndSlice(';',$data['permission']); + $array_permissions = linExplodeAndSlice(';',$data['permission']); if(in_array('public',$array_permissions)) { Modified: trunk/linpha2/admin/permissions_readwrite.php =================================================================== --- trunk/linpha2/admin/permissions_readwrite.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/admin/permissions_readwrite.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -322,7 +322,7 @@ { global $array_groups; - $array = explodeAndSlice(';',$perm); + $array = linExplodeAndSlice(';',$perm); $str = ''; foreach($array AS $value) Modified: trunk/linpha2/admin/settings_features.php =================================================================== --- trunk/linpha2/admin/settings_features.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/admin/settings_features.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -39,10 +39,10 @@ )); } - echo '<br /><h2>'.i18n("Filename").'</h2>'; + echo '<br /><h2 class="linStyle">'.i18n("Filename").'</h2>'; $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_filename'),'plugins_log_filename',$LinAdmin->option_value_system['plugins_log_filename']); - echo '<br /><h2>'.i18n("Syslog").'</h2>'; + echo '<br /><h2 class="linStyle">'.i18n("Syslog").'</h2>'; echo i18n("(Event log in Windows)"); $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('plugins_log_syslog_enable'),'plugins_log_syslog_enable',$LinAdmin->option_value_system['plugins_log_syslog_enable']); @@ -50,7 +50,7 @@ echo i18n("Comma separated list. Valid events: login, logout, rotate, comments, guestbook, fm_others, fm_upload, fm_delete, fm_move, fm_copy, fm_rename, fm_create_folder, fm_perm"); echo '<br />'; - echo '<br /><h2>'.i18n("Email").'</h2>'; + echo '<br /><h2 class="linStyle">'.i18n("Email").'</h2>'; $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('plugins_log_email_enable'),'plugins_log_email_enable',$LinAdmin->option_value_system['plugins_log_email_enable']); $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_email_to'),'plugins_log_email_to',$LinAdmin->option_value_system['plugins_log_email_to']); $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_email_subject'),'plugins_log_email_subject',$LinAdmin->option_value_system['plugins_log_email_subject']); Modified: trunk/linpha2/admin/settings_layout.php =================================================================== --- trunk/linpha2/admin/settings_layout.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/admin/settings_layout.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -89,7 +89,7 @@ $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_theme'),'sys_style_layout_theme',$LinAdmin->option_value_system['sys_style_layout_theme'],array('options' => LinAdmin::getThemes($LinAdmin->option_value_system['sys_style_layout_template']))); - echo '<h2>'.i18n("Colors").'</h2>'; + echo '<h2 class="linStyle">'.i18n("Colors").'</h2>'; ?> <script language="JavaScript" type="text/javascript"> function updateSelectBox(form_select) @@ -173,13 +173,13 @@ $LinAdmin->printAdminConfig('radio',i18n("Use Default Welcome Text"),'sys_style_home_usedefaultwelcometext',$LinAdmin->option_value_system['sys_style_home_usedefaultwelcometext']); ?> - <textarea name="welcometext" rows="10" cols="50"><?php echo htmlspecialchars($welcometxt,ENT_QUOTES); ?></textarea> + <textarea name="welcometext" rows="10" cols="50" class="linForms"><?php echo htmlspecialchars($welcometxt,ENT_QUOTES); ?></textarea> <br /><br /><br /> <?php $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_home_nrrandomimages'),'sys_style_home_nrrandomimages',$LinAdmin->option_value_system['sys_style_home_nrrandomimages']); $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_style_home_showbrowsebydate'),'sys_style_home_showbrowsebydate',$LinAdmin->option_value_system['sys_style_home_showbrowsebydate']); $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_style_home_showalbums'),'sys_style_home_showalbums',$LinAdmin->option_value_system['sys_style_home_showalbums']); - $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_home_firstsortorder'),'sys_style_home_firstsortorder',$LinAdmin->option_value_system['sys_style_home_firstsortorder'],array('options' => getSortOrders())); + $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_home_firstsortorder'),'sys_style_home_firstsortorder',$LinAdmin->option_value_system['sys_style_home_firstsortorder'],array('options' => linGetSortOrders())); break; case 'thumb': Modified: trunk/linpha2/lib/classes/archiver.class.php =================================================================== --- trunk/linpha2/lib/classes/archiver.class.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/lib/classes/archiver.class.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -228,7 +228,7 @@ */ include(LINPHA_DIR.'/lib/classes/archiver.config.php'); - $this->array_path = LinFunc::get_PATH('PATH'); + $this->array_path = linGetPATH('PATH'); } function getCommand($ziptype) @@ -283,7 +283,7 @@ * * get_PATH remove directories not allowed by safemode or open_basedir */ - $array_lookfor = LinFunc::get_PATH($this->apps[$app]['look_for']); + $array_lookfor = linGetPATH($this->apps[$app]['look_for']); foreach($array_lookfor AS $value) { if(file_exists($value.'/'.$this->apps[$app]['executable'])) Modified: trunk/linpha2/lib/classes/linpha.admin.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.admin.class.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/lib/classes/linpha.admin.class.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -93,7 +93,7 @@ function printAdminMenu($array_menu,$active) { ?> - <ul class="navlist"> + <ul class="linUlMenu"> <?php foreach($array_menu AS $key=>$value) { @@ -151,7 +151,7 @@ ?> </div> <div align="right"> - <input type="<?php echo $type; ?>" name="<?php echo $id; ?>" value="<?php echo htmlspecialchars($value, ENT_QUOTES); ?>" maxlength="255" style="width: 200px;" /> + <input type="<?php echo $type; ?>" name="<?php echo $id; ?>" value="<?php echo htmlspecialchars($value, ENT_QUOTES); ?>" class="linForms" maxlength="255" style="width: 200px;" /> <?php break; @@ -160,7 +160,7 @@ ?> </div> <div align="right"> - <select name="<?php echo $id; ?>" size="1"<?php echo (isset($settings['input_settings']) ? $settings['input_settings'] : '' ); ?>> + <select name="<?php echo $id; ?>" size="1"<?php echo (isset($settings['input_settings']) ? $settings['input_settings'] : '' ); ?> class="linForms"> <?php foreach($settings['options'] AS $option_key=>$option_value) { Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -23,26 +23,10 @@ * @package Functions */ - /** - * defines for linLog() - */ -define('LOG_TYPE_IMPORT', 0); -define('LOG_TYPE_UPDATE', 1); -define('LOG_TYPE_USER', 2); -define('LOG_TYPE_DB', 3); -define('LOG_TYPE_META', 4); -define('LOG_TYPE_FILEMANAGER', 5); -define('LOG_TYPE_GUESTBOOK', 6); - - -class LinFunc -{ - -/** * get content of the systems PATH variable and remove dirs not in open_basedir and safe_mode_exec_dir (only if activated) */ -function get_PATH($array_path) +function inGetPATH($array_path) { /** * use the path variable instead of own array @@ -91,7 +75,7 @@ * get the memory limit set in php.ini * if php was compiled without memory_limit */ -function getMemoryLimit() +function linGetMemoryLimit() { $memlimit=ini_get('memory_limit'); if(empty($memlimit)) @@ -116,7 +100,7 @@ /** * cut a string to the given size */ -function cutString($string,$len,$with_span_title) +function linCutString($string,$len,$with_span_title) { $append = '...'; @@ -136,13 +120,12 @@ { return $string; } - } /** * cut string where are words longer than $len not to break page design */ -function cutOverloadedStrings($str,$len) +function linCutOverloadedStrings($str,$len) { if(strlen($str)>$len) //only check long strings { @@ -182,7 +165,7 @@ /** * format user inputs and autoformat urls and mailaddresses */ -function htmltag($post) +function linHtmlTag($post) { $post = htmlspecialchars($post, ENT_QUOTES); @@ -252,15 +235,10 @@ return $post; } -} // end class LinFunc - - - - /** * print a nice navigation line with links on each entry */ -function setNavigationLine( $id, $link ) +function linSetNavigationLine( $id, $link ) { $str = '<a href="'.$link.'=0">></a> '; @@ -285,7 +263,7 @@ /** * functions to create a html select form with all albums */ -function buildAlbumSelect($with_all_albs_entry) +function linBuildAlbumSelect($with_all_albs_entry) { ?> @@ -301,10 +279,10 @@ echo '<option value="all"'.$select.'>'.i18n("All Albums").'</option>'."\n"; } - buildAlbumSelectSubEntry(0,''); + linBuildAlbumSelectSubEntry(0,''); } -function buildAlbumSelectSubEntry($id,$text) +function linBuildAlbumSelectSubEntry($id,$text) { $query = $GLOBALS['linpha']->db->Execute("SELECT id, name FROM ".PREFIX."photos WHERE parent_id = '".$id."' AND img_type = '0' ORDER by name"); while($data = $query->FetchRow()) @@ -319,14 +297,14 @@ } echo '<option value="'.$data['id'].'"'.$select.'>'.$text.'/'.htmlspecialchars($data['name'],ENT_QUOTES).'</option>'."\n"; - buildAlbumSelectSubEntry($data['id'],$text.'/'.htmlspecialchars($data['name'],ENT_QUOTES)); + linBuildAlbumSelectSubEntry($data['id'],$text.'/'.htmlspecialchars($data['name'],ENT_QUOTES)); } } /** * returns an array with the sort orders */ -function getSortOrders() +function linGetSortOrders() { return Array( 'nameasc' => i18n("Name Asc"), @@ -339,7 +317,7 @@ /** * return the correct sql order string */ -function getSqlSortOrder($order) +function linGetSqlSortOrder($order) { switch($order) { @@ -355,7 +333,7 @@ * * should be moved to "others" */ -function explodeAndSlice($del,$string) +function linExplodeAndSlice($del,$string) { $array = explode($del,$string); $array = array_slice($array,1,-1); @@ -366,7 +344,7 @@ /** * we have to use & in links (W3C), but in javascript we cannot use &! */ -function convert_amp($url) +function linConvertAmp($url) { return str_replace('&','&',$url); } @@ -375,27 +353,27 @@ * some functions to calculate the page rendering time * this is very useful while trying to speed up LinPHA :-) */ -function startTimer($string) +function linStartTimer($string) { global $timer; - $timer[$string]=getRenderTime(); + $timer[$string]=linGetRenderTime(); } /** * some functions to calculate the page rendering time * this is very useful while trying to speed up LinPHA :-) */ -function stopTimer($string) +function linStopTimer($string) { global $timer; - return number_format(getRenderTime()-$timer[$string],4); + return number_format(linGetRenderTime()-$timer[$string],4); } /** * some functions to calculate the page rendering time * this is very useful while trying to speed up LinPHA :-) */ -function getRenderTime() +function linGetRenderTime() { list ($usec, $sec)=explode(" ", microtime()); return ((float)$usec + (float)$sec); @@ -443,7 +421,7 @@ $arr_day_long = Array(i18n('Sunday'),i18n('Monday'),i18n('Tuesday'),i18n('Wednesday'),i18n('Thursday'),i18n('Friday'),i18n('Saturday')); /* weekdays */ if(empty($str_format)) { - $str_format = getDateFormat().' '.getTimeFormat(); + $str_format = linGetDateFormat().' '.linGetTimeFormat(); } if($timestamp == 'now' OR empty($timestamp)) { @@ -456,9 +434,9 @@ $month_in_decimal = $month_in_decimal[1]; } - $str_format = str_replace("%c", getDateFormat().' '.getTimeFormat(), $str_format); - $str_format = str_replace("%x", getDateFormat(), $str_format); - $str_format = str_replace("%X", getTimeFormat(), $str_format); + $str_format = str_replace("%c", linGetDateFormat().' '.linGetTimeFormat(), $str_format); + $str_format = str_replace("%x", linGetDateFormat(), $str_format); + $str_format = str_replace("%X", linGetTimeFormat(), $str_format); $str_format = str_replace("%a", $arr_day_short[$weekday_in_decimal], $str_format); $str_format = str_replace("%A", $arr_day_long[$weekday_in_decimal], $str_format); @@ -481,7 +459,7 @@ * @return string time format string for use in strftime() * @package time */ -function getDateFormat() +function linGetDateFormat() { if( i18n('special_date_format') == 'special_date_format') { return $GLOBALS['linpha']->sql->config->value['sys_style_datetime_dates']; @@ -499,7 +477,7 @@ * @return string time format string for use in strftime() * @package time */ -function getTimeFormat() +function linGetTimeFormat() { if( i18n('special_time_format') == 'special_time_format') { return $GLOBALS['linpha']->sql->config->value['sys_style_datetime_times']; @@ -513,7 +491,7 @@ * takes care if we explicit disable ajax * even if we could use it */ -function useAjax() +function linUseAjax() { if( isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax']) ) { @@ -557,6 +535,16 @@ * @param string $severity from notice - fatal error * @param string $text */ +/** + * defines for linLog() + */ +define('LOG_TYPE_IMPORT', 0); +define('LOG_TYPE_UPDATE', 1); +define('LOG_TYPE_USER', 2); +define('LOG_TYPE_DB', 3); +define('LOG_TYPE_META', 4); +define('LOG_TYPE_FILEMANAGER', 5); +define('LOG_TYPE_GUESTBOOK', 6); function linLog($type,$severity,$event,$text) { switch($type) Modified: trunk/linpha2/lib/classes/linpha.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.image.class.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/lib/classes/linpha.image.class.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -419,9 +419,9 @@ /** * include the create image script */ - startTimer("createimage"); + linStartTimer("createimage"); include(LINPHA_DIR.'/lib/classes/image/'.$this->image_tool.'/image.php'); - $time = stopTimer("createimage") * 1000000; + $time = linStopTimer("createimage") * 1000000; //echo $time; exit(); Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -56,7 +56,7 @@ { $this->modulename = $modulename; - $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_others_sortorder']); + $this->orderby = linGetSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_others_sortorder']); if( $GLOBALS['linpha']->template->idCurrent == 0 ) { @@ -66,7 +66,7 @@ if($this->modulename=='albums') { $this->mode = 'home'; - $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_home_firstsortorder']); + $this->orderby = linGetSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_home_firstsortorder']); } else // $this->modulename=='browse' | 'search' , others will come.. { @@ -313,7 +313,7 @@ /** * more than one time used stuff */ - $array = getSortOrders(); + $array = linGetSortOrders(); foreach($array AS $value) { $array_sort_orders_links[] = array('name' => i18n($value), 'value' => $GLOBALS['linpha']->template->URL_full.'&order_by='.$value); @@ -335,7 +335,7 @@ ) ); - if( useAjax() ) + if( linUseAjax() ) { $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectsizes']); foreach($array AS $value) @@ -487,7 +487,7 @@ /** * slideshow icon */ - if( useAjax() ) { + if( linUseAjax() ) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="javascript:myLinThumbnails.loadSlideshow()">'. '<img src="'.$GLOBALS['linpha']->template->themeFile('images/slideshow.png').'" border="0" title="'.i18n("Play Slideshow").'" />' .'</a>'."\n"; @@ -521,7 +521,7 @@ /** * slideshow icon */ - if( useAjax() ) { + if( linUseAjax() ) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="javascript:myLinImage.fullscreenStart()">'. '<img src="'.$GLOBALS['linpha']->template->themeFile('images/slideshow.png').'" border="0" title="'.i18n("Play Slideshow").'" />' .'</a>'."\n"; @@ -651,7 +651,7 @@ /** * switch between javascript */ - if( useAjax() ) + if( linUseAjax() ) { $GLOBALS['linpha']->template->setModuleName('view_thumb'); @@ -884,7 +884,7 @@ */ if($GLOBALS['linpha']->sql->config->value['sys_style_home_usedefaultwelcometext']) { - $GLOBALS['linpha']->template->output['welcome'] = '<h1>'.i18n("Welcome").'</h1>'. + $GLOBALS['linpha']->template->output['welcome'] = '<h1 class="linStyle">'.i18n("Welcome").'</h1>'. i18n("Hi, this is the home of \"The PHP Photo Archive\" " . "<a href=\"http://linpha.sf.net\">aka LinPHA</a>.").'<br />'; } @@ -1086,7 +1086,7 @@ $this->viewImgCommon(); $this->viewImgComments(); - if( useAjax() ) + if( linUseAjax() ) { $GLOBALS['linpha']->template->setModuleName('view_img'); @@ -1288,9 +1288,9 @@ $id = $this->photos_filtered[$key]['id']; $name = $this->photos_filtered[$key]['name']; - $str = '<div class="thumbnavi_'.$class.'thumb">' + $str = '<div class="linDivThumbnavi_'.$class.'">' . '<a href="'.$GLOBALS['linpha']->template->URL_base.'&linId='.$id.'">' - . '<img class="img_'.$class.'thumb" src="'.LINPHA_CLIENT.'/get_thumb.php?linId='.$id.'" /></a>' + . '<img class="linImgThumbnavi_'.$class.'" src="'.LINPHA_CLIENT.'/get_thumb.php?linId='.$id.'" /></a>' . '<br />'.$name.'</div>'."\n"; return $str; @@ -1337,7 +1337,7 @@ } else { - $GLOBALS['linpha']->template->output['prev_thumb'] .= $this->viewImgThumbHtml( $this->current_key - $i , 'prevnext' ); + $GLOBALS['linpha']->template->output['prev_thumb'] .= $this->viewImgThumbHtml( $this->current_key - $i , 'PrevNext' ); } } } @@ -1356,7 +1356,7 @@ } else { - $GLOBALS['linpha']->template->output['next_thumb'] .= $this->viewImgThumbHtml( $this->current_key + ($i+1) , 'prevnext' ); + $GLOBALS['linpha']->template->output['next_thumb'] .= $this->viewImgThumbHtml( $this->current_key + ($i+1) , 'PrevNext' ); } } } @@ -1370,7 +1370,7 @@ } else { - $GLOBALS['linpha']->template->output['current_thumb'] = $this->viewImgThumbHtml( $this->current_key , 'current' ); + $GLOBALS['linpha']->template->output['current_thumb'] = $this->viewImgThumbHtml( $this->current_key , 'Current' ); } } Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -511,7 +511,7 @@ } list($stage,$perm) = LinSql::getPerm( $photo_id, $sql_perm_type ); - $array_photo_perm = explodeAndSlice(';',$perm); + $array_photo_perm = linExplodeAndSlice(';',$perm); foreach($array_photo_perm AS $value) { @@ -551,7 +551,7 @@ $data = $GLOBALS['linpha']->db->GetRow("SELECT permission FROM ".PREFIX."permissions " . "WHERE perm_type = '".LinSql::linAddslashes($perm_type)."'"); - $array_permissions = explodeAndSlice(';',$data['permission']); + $array_permissions = linExplodeAndSlice(';',$data['permission']); if(in_array('public',$array_permissions)) { Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -81,14 +81,14 @@ <!-- colorsettings.php --> <link rel='stylesheet' href='<?php echo LINPHA_CLIENT.'/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'> + '?bg='.$this->bgcolor.'&bodybg='.$this->bodybgcolor.'&font='.$this->fontcolor. + '&albumsbg='.$this->albumsbgcolor.'&links='.$this->linkscolor.'&linkshover='.$this->linkshovercolor; ?>' type='text/css'> <?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_CLIENT.'/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'> + $this->bgcolor."&bodybg=".$this->bodybgcolor."&font=".$this->fontcolor. + "&albumsbg=".$this->albumsbgcolor."&links=".$this->linkscolor."&linkshover=".$this->linkshovercolor; ?>' type='text/css'> <?php } ?> <!-- global.css --> @@ -127,7 +127,7 @@ <script type="text/javascript" language="JavaScript"> var LINPHA_LINK = '<?php echo LINPHA_LINK; ?>'; var LINPHA_CLIENT = '<?php echo LINPHA_CLIENT; ?>'; -var linUrlBase = '<?php echo convert_amp($linTpl->URL_base); ?>'; +var linUrlBase = '<?php echo linConvertAmp($linTpl->URL_base); ?>'; var startIdCurrent = <?php echo $this->idCurrent; ?>; var IdCurrent = startIdCurrent; <?php @@ -181,20 +181,20 @@ { if(strpos($modules,'home') !== false) { - $fragment = 'home'; + $fragment = 'menu_home'; include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); } if(strpos($modules,'search') !== false) { - $fragment = 'search'; + $fragment = 'menu_search'; include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); } if(strpos($modules,'login') !== false) { - $fragment = 'login'; + $fragment = 'menu_login'; include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); } @@ -208,7 +208,7 @@ if(strpos($modules,'icons') !== false) { - $fragment = 'icons'; + $fragment = 'menu_icons'; include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); } @@ -372,13 +372,13 @@ if(empty($alpha)) // default { - $str = '<div style="background: url('.LINPHA_CLIENT.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignright.') no-repeat top right;">'; + $str = '<div style="background: url('.LINPHA_CLIENT.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignright.') no-repeat top right;">'; $str .= '<img src="'.LINPHA_CLIENT.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignleft.'" alt="" width="'.$size.'" height="'.$size.'" class="corner" />'; $str .= '</div>'; } else // currently only used in slideshow, does not work well in internet explorer { - $str = '<div style="position: relative; background: url('.LINPHA_CLIENT.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&alpha&align='.$alignright.') no-repeat top right;">'; + $str = '<div style="position: relative; background: url('.LINPHA_CLIENT.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&alpha&align='.$alignright.') no-repeat top right;">'; $str .= '<div class="roundAlphabottomInner"> </div>'; $str .= '<img src="'.LINPHA_CLIENT.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignleft.'&alpha" alt="" width="'.$size.'" height="'.$size.'" class="AlphaCorner" />'; $str .= '</div>'; Modified: trunk/linpha2/lib/include/basket_build_mail.php =================================================================== --- trunk/linpha2/lib/include/basket_build_mail.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/lib/include/basket_build_mail.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -37,7 +37,7 @@ $at_least_one_image = false; $max_mail_size = $GLOBALS['linpha']->sql->config->value['sys_basket_mail_max_size']; -if(($mem_limit = LinFunc::getMemoryLimit()) === false) +if(($mem_limit = linGetMemoryLimit()) === false) { $no_mem_limit = true; } Modified: trunk/linpha2/lib/include/basket_build_print.php =================================================================== --- trunk/linpha2/lib/include/basket_build_print.php 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/lib/include/basket_build_print.php 2006-11-05 17:42:35 UTC (rev 4623) @@ -182,7 +182,7 @@ if($printsettings[$_POST['images']]['show_filenames']) { echo "<br/><font size='-1'>"; - echo LinFunc::cutString(basename($full_filename),15,0); + echo linCutString(basename($full_filename),15,0); echo "</font>"; } Modified: trunk/linpha2/lib/js/LinGlobal.js =================================================================== --- trunk/linpha2/lib/js/LinGlobal.js 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/lib/js/LinGlobal.js 2006-11-05 17:42:35 UTC (rev 4623) @@ -27,27 +27,27 @@ */ linSyslog: function(text) { - if( typeof $('divSyslogText') != 'undefined' ) + if( typeof $('linDivSyslogText') != 'undefined' ) { - if( $('divSyslogText').innerHTML == '' ) + if( $('linDivSyslogText').innerHTML == '' ) { - $('divSyslogText').innerHTML += text; + $('linDivSyslogText').innerHTML += text; } else { - $('divSyslogText').innerHTML += '<br />' + text; + $('linDivSyslogText').innerHTML += '<br />' + text; } this.setScrollSize(); - $('divSyslog').style.top = this.linPageYOffset + 15; - $('divSyslog').style.left = this.linPageXOffset + 15; - Element.show('divSyslog'); + $('linDivSyslog').style.top = this.linPageYOffset + 15; + $('linDivSyslog').style.left = this.linPageXOffset + 15; + Element.show('linDivSyslog'); } }, closeSyslog: function() { - $('divSyslogText').innerHTML = ''; - Element.hide('divSyslog'); + $('linDivSyslogText').innerHTML = ''; + Element.hide('linDivSyslog'); }, /** @@ -147,19 +147,19 @@ /** * setMainHeight * - * sets the height in thumb and image view of the "divmain" + * sets the height in thumb and image view of the "linDivMainOuter" */ setMainHeight: function() { this.setWindowSize(); - var newHeight = this.linInnerHeight - $('main').offsetTop - 40; // 35 = 15 (bottom rounded corners) + 10 (margin-bottom) + 15 (??) + var newHeight = this.linInnerHeight - $('linDivMain').offsetTop - 40; // 35 = 15 (bottom rounded corners) + 10 (margin-bottom) + 15 (??) if(newHeight < 100) { newHeight = 100; } - $('main').style.height = newHeight; + $('linDivMain').style.height = newHeight; }, /** Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/lib/js/LinImage.js 2006-11-05 17:42:35 UTC (rev 4623) @@ -14,13 +14,13 @@ */ initialize: function() { - this.imgInfoColorNotActive = $('divinfolinks').style.color; - this.imgInfoColorActive = $('hrefinfolinks').style.color; + this.imgInfoColorNotActive = $('linDivInfoLink').style.color; + this.imgInfoColorActive = $('linHrefInfoLink').style.color; this.imgInfoShowHide = 'hide'; this.fullscreenActive = false; - this.fullscreenOldMaxWidth, this.fullscreenOldMaxHeight; + this.fullscreenOldMaxWidth, this.fullscreenOldMaxHeight, this.previousBodyOverflow; this.slideshowActive = false; this.ssCurrentTimerID; this.ssCurrentDelay = 5000; @@ -110,8 +110,8 @@ if(this.prevThumbs[ this.prevThumbs.length - 1 ]) { - Element.setOpacity('ssImgPrev',0.7); - new Effect.Appear('ssImgPrev', { duration: 0.5, from: 0.7, to: 1.0 }); + Element.setOpacity('linSsImgPrev',0.7); + new Effect.Appear('linSsImgPrev', { duration: 0.5, from: 0.7, to: 1.0 }); myLinImage.loadImage(this.prevThumbs[ this.prevThumbs.length - 1 ]); if( this.slideshowActive ) @@ -138,14 +138,14 @@ if(this.nextThumbs[0]) { - Element.setOpacity('ssImgNext',0.7); - new Effect.Appear('ssImgNext', { duration: 0.5, from: 0.7, to: 1.0 }); + Element.setOpacity('linSsImgNext',0.7); + new Effect.Appear('linSsImgNext', { duration: 0.5, from: 0.7, to: 1.0 }); myLinImage.loadImage(this.nextThumbs[0]); } else if( this.ssLoop ) { - Element.setOpacity('ssImgNext',0.7); - new Effect.Appear('ssImgNext', { duration: 0.5, from: 0.7, to: 1.0 }); + Element.setOpacity('linSsImgNext',0.7); + new Effect.Appear('linSsImgNext', { duration: 0.5, from: 0.7, to: 1.0 }); this.moveFirst(); } else // end reached, do nothing but enable keyboard navigation again @@ -164,8 +164,8 @@ clearTimeout(this.ssCurrentTimerID); } - Element.setOpacity('ssImgFirst',0.7); - new Effect.Appear('ssImgFirst', { duration: 0.5, from: 0.7, to: 1.0 }); + Element.setOpacity('linSsImgFirst',0.7); + new Effect.Appear('linSsImgFirst', { duration: 0.5, from: 0.7, to: 1.0 }); myLinImage.loadImage( firstImgId ); if( this.slideshowActive ) @@ -179,8 +179,8 @@ clearTimeout(this.ssCurrentTimerID); } - Element.setOpacity('ssImgLast',0.7); - new Effect.Appear('ssImgLast', { duration: 0.5, from: 0.7, to: 1.0 }); + Element.setOpacity('linSsImgLast',0.7); + new Effect.Appear('linSsImgLast', { duration: 0.5, from: 0.7, to: 1.0 }); myLinImage.loadImage( lastImgId ); if( this.slideshowActive ) @@ -203,19 +203,19 @@ * but in fullscreen, we want no activities in background */ if(! this.fullscreenActive) { - $('divimage').style.height = $('mainImage').style.height; + $('linDivMainimage').style.height = $('linImgMainimage').style.height; } /** * hide elements during transition */ this.hideImgInfoNow(); // hide meta text immediately - Element.hide('mainImage'); // hide mainimage while changing image to prevent flicker - Element.hide('divinfolinks'); + Element.hide('linImgMainimage'); // hide mainimage while changing image to prevent flicker + Element.hide('linDivInfoLink'); if(! this.finishedPreloadedImages[IdCurrent] ) { - Element.show('divloading'); + Element.show('linDivloading'); } //$('thumbnavi_prevthumb').innerHTML = ''; @@ -246,7 +246,7 @@ */ imgPreloader.onload=function(){ myLinImage.finishedPreloadedImages[IdCurrent] = true; - $('mainImage').src = currentImgSrc; + $('linImgMainimage').src = currentImgSrc; myLinImage.resizeImageContainer(imgWidth, imgHeight); } imgPreloader.src = currentImgSrc; @@ -258,8 +258,8 @@ resizeImageContainer: function( imgWidth, imgHeight) { // get current height and width - /*this.wCur = $('mainImage').offsetWidth; - this.hCur = $('mainImage').offsetHeight; + /*this.wCur = $('linImgMainimage').offsetWidth; + this.hCur = $('linImgMainimage').offsetHeight; // scalars based on change from old to new this.xScale = ((imgWidth + (borderSize * 2)) / this.wCur) * 100; @@ -269,8 +269,8 @@ wDiff = (this.wCur - borderSize * 2) - imgWidth; hDiff = (this.hCur - borderSize * 2) - imgHeight; - if(!( hDiff == 0)){ new Effect.Scale('mainImage', this.yScale, {scaleX: false, duration: resizeDuration, queue: 'front'}); } - if(!( wDiff == 0)){ new Effect.Scale('mainImage', this.xScale, {scaleY: false, delay: resizeDuration, duration: resizeDuration}); } + if(!( hDiff == 0)){ new Effect.Scale('linImgMainimage', this.yScale, {scaleX: false, duration: resizeDuration, queue: 'front'}); } + if(!( wDiff == 0)){ new Effect.Scale('linImgMainimage', this.xScale, {scaleY: false, delay: resizeDuration, duration: resizeDuration}); } // if new and old image are same size and no scaling transition is necessary, // do a quick pause to prevent image flicker. @@ -278,8 +278,8 @@ if (navigator.appVersion.indexOf("MSIE")!=-1){ pause(250); } else { pause(100);} }*/ - $('mainImage').style.width = imgWidth; - $('mainImage').style.height = imgHeight; + $('linImgMainimage').style.width = imgWidth; + $('linImgMainimage').style.height = imgHeight; /*Element.setHeight('prevLink', imgHeight); @@ -295,29 +295,29 @@ * Display image and begin preloading next images. */ showImage: function(){ - Element.hide('divloading'); + Element.hide('linDivloading'); if( useEffects ) { - new Effect.Appear('mainImage', { duration: 0.5, afterFinish: function(){ myLinImage.setImageData(); } }); + new Effect.Appear('linImgMainimage', { duration: 0.5, afterFinish: function(){ myLinImage.setImageData(); } }); } else { - Element.show('mainImage'); + Element.show('linImgMainimage'); this.setImageData() } if(! this.fullscreenActive) { - $('divimage').style.height = $('mainImage').style.height; // reset to correct height to prevent trouble if image is bigger or smaller + $('linDivMainimage').style.height = $('linImgMainimage').style.height; // reset to correct height to prevent trouble if image is bigger or smaller } /** * set title */ - if( typeof $('title') != 'undefined' ) + if( typeof $('linDivTitle') != 'undefined' ) { - $('title').innerHTML = this.xmlDoc[IdCurrent].getElementsByTagName('title').item(0).firstChild.data; + $('linDivTitle').innerHTML = this.xmlDoc[IdCurrent].getElementsByTagName('title').item(0).firstChild.data; } this.enableKeyboardNav(); @@ -328,18 +328,21 @@ */ setImageData: function() { - this.setImageInfoLink(); // show the "info" link, must be called after Appear('mainImage') + this.setImageInfoLink(); // show the "info" link, must be called after Appear('linImgMainimage') /** * update the menu */ + if( typeof $('linDivMenu') != 'undefined' ) + { /** * replace the image ids in the menu * replace( /linId=[0-9]* /g , "linId=" + IdCurrent ); * its just an search/replace of 'linId=x' in the menu * its very fast (about 0 - 15ms) and its executed every time the image changes */ - $('menu').innerHTML = $('menu').innerHTML.replace( /linId=[0-9]*/g , "linId=" + IdCurrent ); + $('linDivMenu').innerHTML = $('linDivMenu').innerHTML.replace( /linId=[0-9]*/g , "linId=" + IdCurrent ); + /** * replace the width and height dimensions of the view at fullscreen link @@ -349,16 +352,17 @@ $('linLiViewAtFullscreen').innerHTML = $('linLiViewAtFullscreen').innerHTML.replace( /width=[0-9]*/ , "width=" + orgWidth ); $('linLiViewAtFullscreen').innerHTML = $('linLiViewAtFullscreen').innerHTML.replace( /height=[0-9]*/ , "height=" + orgHeight ); $('linLiViewAtFullscreen').innerHTML = $('linLiViewAtFullscreen').innerHTML.replace( /[0-9]*x[0-9]*/ , orgWidth + "x" + orgHeight ); + } /** * set current thumb */ - $('thumbnavi_currentthumb').innerHTML = '<a href="javascript:myLinImage.loadImage(' + IdCurrent + ')"><img class="img_currentthumb" src="' + thumbSrc + IdCurrent + '" /></a>'; + $('linDivThumbnavi_Current').innerHTML = '<a href="javascript:myLinImage.loadImage(' + IdCurrent + ')"><img class="linImgThumbnavi_Current" src="' + thumbSrc + IdCurrent + '" /></a>'; /** * set prev thumbs */ - $('thumbnavi_prevthumb').innerHTML = ''; + $('linDivThumbnavi_Prev').innerHTML = ''; this.prevThumbs = new Array(); if(this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) { @@ -366,14 +370,14 @@ { var thumbId = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; this.prevThumbs[i] = thumbId; - this.setPrevNextThumb(thumbId, 'thumbnavi_prevthumb'); + this.setPrevNextThumb(thumbId, 'linDivThumbnavi_Prev'); } } /** * set next thumbs */ - $('thumbnavi_nextthumb').innerHTML = ''; + $('linDivThumbnavi_Next').innerHTML = ''; this.nextThumbs = new Array(); if(this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) { @@ -381,16 +385,16 @@ { var thumbId = this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; this.nextThumbs[i] = thumbId; - this.setPrevNextThumb(thumbId, 'thumbnavi_nextthumb'); + this.setPrevNextThumb(thumbId, 'linDivThumbnavi_Next'); } } - + /** * set meta data */ if(this.xmlDoc[IdCurrent].getElementsByTagName('meta').length > 0) { - $('divmeta').innerHTML = ''; + $('linDivMeta').innerHTML = ''; for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('meta').length; i++) { @@ -398,17 +402,18 @@ var metaname = document.createTextNode( meta.getElementsByTagName('name').item(0).firstChild.data + ': ' ); var metavalue = document.createTextNode( meta.getElementsByTagName('value').item(0).firstChild.data ); - $('divmeta').appendChild(metaname); - $('divmeta').appendChild(metavalue); - $('divmeta').appendChild( document.createElement("br") ); + $('linDivMeta').appendChild(metaname); + $('linDivMeta').appendChild(metavalue); + $('linDivMeta').appendChild( document.createElement("br") ); } } - + /** * set comments */ this.initTextareaAddComment(); - $('divcomments').innerHTML = ''; + $('linDivComments').innerHTML = ''; + if(this.xmlDoc[IdCurrent].getElementsByTagName('comment').length > 0) { for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('comment').length; i++) @@ -418,12 +423,12 @@ var commentauthor = document.createTextNode( tagcomment.getElementsByTagName('author').item(0).firstChild.data ); var commenttext = document.createTextNode( tagcomment.getElementsByTagName('text').item(0).firstChild.data ); - $('divcomments').appendChild(commenttime); - $('divcomments').appendChild(commentauthor); - $('divcomments').appendChild( document.createElement("hr") ); - $('divcomments').appendChild(commenttext); - $('divcomments').appendChild( document.createElement("br") ); - $('divcomments').appendChild( document.createElement("br") ); + $('linDivComments').appendChild(commenttime); + $('linDivComments').appendChild(commentauthor); + $('linDivComments').appendChild( document.createElement("hr") ); + $('linDivComments').appendChild(commenttext); + $('linDivComments').appendChild( document.createElement("br") ); + $('linDivComments').appendChild( document.createElement("br") ); /*var ElemDiv = document.createElement("div"); ElemDiv.setAttribute('class','comments'); @@ -433,15 +438,15 @@ ElemDiv.appendChild(commenttext); ElemDiv.appendChild( document.createElement("br") ); - $('divcomments').appendChild(ElemDiv);*/ + $('linDivComments').appendChild(ElemDiv);*/ } } - + /** * set image nr * currently only in slideshow used */ - $('divSlideshowImgNr').innerHTML = this.xmlDoc[IdCurrent].getElementsByTagName('imgnr').item(0).firstChild.data; + $('linDivSlideshowImgNr').innerHTML = this.xmlDoc[IdCurrent].getElementsByTagName('imgnr').item(0).firstChild.data; /** @@ -459,9 +464,9 @@ */ setPrevNextThumb: function(thumbId, divId) { - var ElemImg = Builder.node('img', {id: 'thumb'+thumbId, className: 'img_prevnextthumb', src: thumbSrc + thumbId}); + var ElemImg = Builder.node('img', {id: 'thumb'+thumbId, className: 'linImgThumbnavi_PrevNext', src: thumbSrc + thumbId}); var ElemA = Builder.node('a', {href: 'javascript:myLinImage.loadImage(' + thumbId + ')'}); - var ElemDiv = Builder.node('div', {className: 'thumbnavi_prevnextthumb'}); + var ElemDiv = Builder.node('div', {className: 'linDivThumbnavi_PrevNext'}); ElemA.appendChild( ElemImg ); ElemDiv.appendChild( ElemA ); @@ -539,10 +544,10 @@ else if ((keycode == 122)) // F11 { if( this.fullscreenActive ) { - $('divSlideshowExit').show(); // hide exit button to force exit again with F11 + $('linDivSlideshowExit').show(); // hide exit button to force exit again with F11 myLinImage.fullscreenStop(); } else { - $('divSlideshowExit').hide(); + $('linDivSlideshowExit').hide(); myLinImage.fullscreenStart(); } } @@ -618,6 +623,7 @@ for(var i = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length-1; i >= 0; i--) { var imgId = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; + if(! this.preloadXmlFinished[imgId]) { this.loadImageXml(imgId); @@ -689,25 +695,26 @@ /** * disable scrollbars */ + this.previousBodyOverflow = document.getElementsByTagName("body")[0].style.overflow; document.getElementsByTagName("body")[0].style.overflow='hidden'; /** * start slideshow with some superduper effects */ - Effect.Appear('divSlideshowOverlay', { queue: 'end', duration: 1.0, from: 0.0, to: 0.9 }); - Effect.BlindDown('divSlideshowControls', { queue: 'end'} ); - Element.show('divSlideshowImage'); + Effect.Appear('linDivSlideshowOverlay', { queue: 'end', duration: 1.0, from: 0.0, to: 0.9 }); + Effect.BlindDown('linDivSlideshowControls', { queue: 'end'} ); + Element.show('linDivSlideshowImage'); /** * steal the mainimage */ - $('divimage').innerHTML = ''; - $('divSlideshowImage').innerHTML = '<img id="mainImage" style="display: none;" class="imgSlideshow">'; + $('linDivMainimage').innerHTML = ''; + $('linDivSlideshowImage').innerHTML = '<img id="linImgMainimage" style="display: none;" class="linImgSlideshow">'; /** * reload image with new position and size */ - onWindowResize(); + this.resizeWindow(); }, fullscreenStop: function() { @@ -722,7 +729,7 @@ /** * re-enable scrollbars */ - document.getElementsByTagName("body")[0].style.overflow='auto'; + document.getElementsByTagName("body")[0].style.overflow = this.previousBodyOverflow; /** * delete preloaded images after stopping fullscreen @@ -732,15 +739,15 @@ /** * end slideshow with some superduper effects */ - Effect.Fold('divSlideshowControls', { queue: 'end'} ); - Effect.Fade('divSlideshowOverlay', { queue: 'end', duration: 0.5, from: 0.9, to: 0.0 } ); - Element.hide('divSlideshowImage'); + Effect.Fold('linDivSlideshowControls', { queue: 'end'} ); + Effect.Fade('linDivSlideshowOverlay', { queue: 'end', duration: 0.5, from: 0.9, to: 0.0 } ); + Element.hide('linDivSlideshowImage'); /** * give back the mainimage */ - $('divSlideshowImage').innerHTML = ''; - $('divimage').innerHTML = '<img id="mainImage" style="display: none;">'; + $('linDivSlideshowImage').innerHTML = ''; + $('linDivMainimage').innerHTML = '<img id="linImgMainimage" style="display: none;">'; /** * reload image with old position and size @@ -754,7 +761,7 @@ if(! this.slideshowActive) { this.slideshowActive = true; - Element.setOpacity('ssImgStart',0.7); + Element.setOpacity('linSsImgStart',0.7); this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); } else // stop Slideshow @@ -781,27 +788,27 @@ slideshowChangeDelay: function() { - this.ssCurrentDelay = $('ssDelay').options[ $('ssDelay').selectedIndex ].value * 1000; + this.ssCurrentDelay = $('linSsDelay').options[ $('linSsDelay').selectedIndex ].value * 1000; //document.optionsForm.delay.options[document.optionsForm.delay.selectedIndex].value * 1000; }, slideshowChangeLoop: function() { if(! this.ssLoop) { this.ssLoop = true; - Element.setOpacity('ssImgLoop',0.7); + Element.setOpacity('linSsImgLoop',0.7); } else { this.ssLoop = false; - Element.setOpacity('ssImgLoop',1); + Element.setOpacity('linSsImgLoop',1); } }, slideshowChangeRandom: function() { if(! this.ssRandom) { this.ssRandom = true; - Element.setOpacity('ssImgRandom',0.7); + Element.setOpacity('linSsImgRandom',0.7); } else { this.ssRandom = false; - Element.setOpacity('ssImgRandom',1); + Element.setOpacity('linSsImgRandom',1); } alert('This feature is currently not implemented, do we really need that?'); }, @@ -821,9 +828,9 @@ */ setImageInfoLink: function() { - $('divinfolinks').style.top = $('mainImage').offsetTop + $('mainImage').offsetHeight; - $('divinfolinks').style.left = $('mainImage').offsetLeft + $('mainImage').offsetWidth - 50; // 50: value of view_img.css width = 50px; can't get width with javascript because element is hidden - Element.show('divinfolinks'); + $('linDivInfoLink').style.top = $('linImgMainimage').offsetTop + $('linImgMainimage').offsetHeight; + $('linDivInfoLink').style.left = $('linImgMainimage').offsetLeft + $('linImgMainimage').offsetWidth - 50; // 50: value of view_img.css width = 50px; can't get width with javascript because element is hidden + Element.show('linDivInfoLink'); }, /** @@ -832,7 +839,7 @@ * fade out the image, show the meta infos, sets the color of the "Info" link to another * * idea: - * swap the colors of <a> and <div> tag (id 'hrefinfolinks' and 'divinfolinks' + * swap the colors of <a> and <div> tag (id 'linHrefInfoLink' and 'linDivInfoLink' * so it is possible to set the colors in the css template (and not in javascript file) */ showImgInfo: function() @@ -847,31 +854,31 @@ /** * set position */ - $('divmeta').style.top = $('mainImage').offsetTop + 50; - $('divmeta').style.left = $('mainImage').offsetLeft + 50; + $('linDivMeta').style.top = $('linImgMainimage').offsetTop + 50; + $('linDivMeta').style.left = $('linImgMainimage').offsetLeft + 50; - new Effect.Appear('divmeta', { duration: 0.5 }); //, from: 0.0, to: 1.0 - new Effect.Fade('divimage', { duration: 1, from: 1.0, to: 0.2 }); + new Effect.Appear('linDivMeta', { duration: 0.5 }); //, from: 0.0, to: 1.0 + new Effect.Fade('linDivMainimage', { duration: 1, from: 1.0, to: 0.2 }); - $('hrefinfolinks').style.color = this.imgInfoColorNotActive; + $('linHrefInfoLink').style.color = this.imgInfoColorNotActive; } else { this.imgInfoShowHide = 'hide'; - new Effect.Fade('divmeta', { duration: 1 }); // , from: 1.0, to: 0.0 - new Effect.Appear('divimage', { duration: 0.5, from: 0.2, to: 1.0 }); + new Effect.Fade('linDivMeta', { duration: 1 }); // , from: 1.0, to: 0.0 + new Effect.Appear('linDivMainimage', { duration: 0.5, from: 0.2, to: 1.0 }); - $('hrefinfolinks').style.color = this.imgInfoColorActive; + $('linHrefInfoLink').style.color = this.imgInfoColorActive; } }, hideImgInfoNow: function() { - $('divmeta').style.display = 'none'; - Element.setOpacity('divimage',1); + $('linDivMeta').style.display = 'none'; + Element.setOpacity('linDivMainimage',1); this.imgInfoShowHide = 'hide'; - $('hrefinfolinks').style.color = this.imgInfoColorActive; + $('linHrefInfoLink').style.color = this.imgInfoColorActive; }, /** @@ -943,19 +950,19 @@ */ openTextarea: function() { - Element.show('divAddCommentTextarea'); - Element.hide('divAddCommentText'); + Element.show('linDivAddCommentTextarea'); + Element.hide('linDivAddCommentText'); - $('inputAddCommentTextarea').value = $('inputAddCommentText').value; + $('linInputAddCommentTextarea').value = $('linInputAddCommentText').value; }, initTextareaAddComment: function() { - Element.hide('divAddCommentTextarea'); - Element.show('divAddCommentText'); + Element.hide('linDivAddCommentTextarea'); + Element.show('linDivAddCommentText'); - $('inputAddCommentTextarea').value = ''; - $('inputAddCommentText').value = ''; + $('linInputAddCommentTextarea').value = ''; + $('linInputAddCommentText').value = ''; }, @@ -981,16 +988,16 @@ */ function linImageWrapper() { - if(this.fullscreenActive) + if(myLinImage.fullscreenActive) { /** * delete preloaded images after starting fullscreen and resizing window */ - this.finishedPreloadedImages = new Array(); + myLinImage.finishedPreloadedImages = new Array(); - getWindowSize(); - maxImageWidth = linInnerWidth - 70; - maxImageHeight = linInnerHeight - 120; + myLinGlobal.setWindowSize(); + maxImageWidth = myLinGlobal.linInnerWidth - 70; + maxImageHeight = myLinGlobal.linInnerHeight - 120; myLinImage.loadImage( IdCurrent ); } @@ -1006,8 +1013,8 @@ */ function initLinImage() { - $('divimage').style.height = startImgHeight; // initial sets correct height at begin and not after the image is loaded - $('mainImage').style.height = startImgHeight; // initial sets correct height at begin and not after the image is loaded + $('linDivMainimage').style.height = startImgHeight; // initial sets correct height at begin and not after the image is loaded + $('linImgMainimage').style.height = startImgHeight; // initial sets correct height at begin and not after the image is loaded myLinImage = new LinImage(); /** @@ -1044,6 +1051,19 @@ myLinImage.loadImage(IdCurrent); } }, 1000); + + + /** + * append the slideshow divs to the body + * we need to append to body to be sure to get the real fullscreen + * even if we are locked in another div + */ + var objBody = document.getElementsByTagName("body").item(0); + objBody.appendChild( Builder.node('div', {id: "linDivSlideshowOverlay", style: "display: none;"}) ); + objBody.appendChild( Builder.node('div', {id: "linDivSlideshowImage", style: "display: none;"}) ); + objBody.appendChild( Builder.node('div', {id: "linDivSlideshowControlsOuter", style: "display: none;"}) ); + + $('linDivSlideshowControlsOuter').innerHTML = linSlideshowHtml; // automatically start slideshow if requested (coming from thumbview) Modified: trunk/linpha2/lib/js/LinThumbnails.js =================================================================== --- trunk/linpha2/lib/js/LinThumbnails.js 2006-11-05 13:43:49 UTC (rev 4622) +++ trunk/linpha2/lib/js/LinThumbnails.js 2006-11-05 17:42:35 UTC (rev 4623) @@ -50,12 +50,12 @@ switch( linPhotosPerPage ) { case 'auto': - var nr_cols = Math.floor( (document.getElementById('main')['offsetWidth']-linMainSpacerWidth) / (linTnSize + linImgSpacerWidth) ); - var nr_rows = Math.floor( (document.getElementById('main')['offsetHeight']-linMainSpacerHeight) / (linTnSize + linImgSpacerHeight + (linImgDivSpacerHeight*linNrTextLines) ) ); + var nr_cols = Math.floor( (document.getElementById('linDivMain')['offsetWidth']-linMainSpacerWidth) / (linTnSize + linImgSpacerWidth) ); + var nr_rows = Math.floor( (document.getElementById('linDivMain')['offsetHeight']-linMainSpacerHeight) / (linTnSize + linImgSpacerHeight + (linImgDivSpacerHeight*linNrTextLines) ) ); var max_photos_per_page = nr_rows * nr_cols; break; case 'all': - var nr_cols = Math.floor( (document.getElementById('main')['offsetWidth']-linMainSpacerWidth) / (linTnSize + linImgSpacerWidth) ); + var nr_cols = Math.floor( (document.getElementById('linDivMain')['offsetWidth']-linMainSpacerWidth) / (linTnSize + linImgSpacerWidth) ); var max_photos_per_page = linTotPhotos; var nr_rows = Math.ceil(max_photos_per_page / nr_cols); break; @@ -63,7 +63,7 @@ /** * ceil max_photos_per_page to complet the row! */ - var nr_cols = Math.floor( (document.getElementById('main')['offsetWidth']-linMainSpacerWidth-5) / (linTnSize + linImgSpacerWidth) ); /* -5 -> scrollbars */ + var nr_cols = Math.floor( (document.getElementById('linDivMain')['offsetWidth']-linMainSpacerWidth-5) / (linTnSize + linImgSpacerWidth) ); /* -5 -> scrollbars */ var nr_rows = Math.ceil( linPhotosPerPage / nr_cols); var max_photos_per_page = nr_rows * nr_cols; break; @@ -103,15 +103,15 @@ var img_nr = 1; var startup_img_nr = (this.currentPage - 1)*max_photos_per_page; - $('main').innerHTML=''; + $('linDivMain').innerHTML=''; divhtmltext = ''; if(linViewMode == 'thumbdetail') { - var style2text = ' divimgdetail'; - var style3text = 'divtextdetail'; + var style2text = ' linDivImgDetail'; + var style3text = 'linDivTextDetail'; } else { var style2text = ''; - var style3text = 'divtext'; + var style3text = 'linDivText'; } /** @@ -136,13 +136,13 @@ } divhtmltext += - '<div id="divthumb' + index + '" class="divthumb">' + - linImgIds[index]['before'] + '<div class="divimg' + style2text + '">' + + '<div id="linDivThumb' + index + '" class="linDivThumb">' + + linImgIds[index]['before'] + '<div class="linDivImg' + style2text + '">' + '<a href="' + linUrlBase + '&linId=' + linImgIds[index]['id'] + '">' + '<img src="' + LINPHA_CLIENT + '/get_thumb.php?linId=' + linImgIds[index]['id'] + '"' + ' height="' + linTnSize + '" width="' + linTnSize + '" ' + ' alt="' + linImgIds[index]['title'] + '" title="' + linImgIds[index]['title'] + '"' + - ' class="imgthumb" />' + + ' class="linImgThumb" />' + '</a></div><div class="' + style3text + '">' + linImgIds[index]['after'] + '</div></div>'; /** @@ -154,7 +154,7 @@ */ if( (img_nr-1) % nr_cols == 0) { - $(... [truncated message content] |