[Linpha-cvs] SF.net SVN: linpha: [4588] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-10-19 21:30:24
|
Revision: 4588 http://svn.sourceforge.net/linpha/?rev=4588&view=rev Author: fangehrn Date: 2006-10-19 14:29:42 -0700 (Thu, 19 Oct 2006) Log Message: ----------- 2006-10-19 flo * added basic new images * finished comments * added linStrftime() * todo: view mode: group by [folder, date, category] Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/docs/dev/important stuff.txt trunk/linpha2/index.php trunk/linpha2/install/sql/sql.data.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/lang/lang.German.php trunk/linpha2/templates/default/css/global.css trunk/linpha2/templates/default/css/home.css trunk/linpha2/templates/default/css/view_img.css trunk/linpha2/templates/default/home.html.php trunk/linpha2/templates/default/view_img.html.php trunk/linpha2/templates/default/view_img_static.html.php Added Paths: ----------- trunk/linpha2/lib/modules/module.newimg.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/ChangeLog 2006-10-19 21:29:42 UTC (rev 4588) @@ -1,3 +1,9 @@ +2006-10-19 flo + * added basic new images + * finished comments + * added linStrftime() + * todo: view mode: group by [folder, date, category] + 2006-10-18 flo * implemented ajax add comment * had to disable the accesskeys when not in fullscreen mode Modified: trunk/linpha2/docs/dev/important stuff.txt =================================================================== --- trunk/linpha2/docs/dev/important stuff.txt 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/docs/dev/important stuff.txt 2006-10-19 21:29:42 UTC (rev 4588) @@ -32,6 +32,8 @@ echo "Error: ".$error -> getMessage(); } +- $GLOBALS['linpha']->sql->config->value['sys_'] + - some common language strings "Successfully updated data." "Submit" Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/index.php 2006-10-19 21:29:42 UTC (rev 4588) @@ -44,6 +44,9 @@ case 'ajax': include_once(LINPHA_DIR.'/lib/modules/module.ajax.php'); break; +case 'newimg': + include_once(LINPHA_DIR.'/lib/modules/module.newimg.php'); + break; } ?> \ No newline at end of file Modified: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/install/sql/sql.data.php 2006-10-19 21:29:42 UTC (rev 4588) @@ -48,10 +48,14 @@ 'sys_basket_mail_max_size' => (1024*1024*2), 'sys_basket_download_limit' => '0', + 'sys_style_dates' => '%a %m/%d/%Y', + 'sys_style_times' => '%I:%M:%S %p', 'sys_style_sortorder' => 'nameasc', 'sys_style_template' => 'default', 'sys_style_home_showbrowsebydate' => '1', 'sys_style_home_nrrandomimages' => '4', + 'sys_style_home_newimagesnr' => '4', + 'sys_style_home_newimagesage' => '7', 'sys_style_home_showalbums' => '1', 'sys_style_home_usedefaultwelcometext' => '1', 'sys_style_home_firstsortorder' => 'nameasc', Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-10-19 21:29:42 UTC (rev 4588) @@ -148,6 +148,46 @@ } /** + * cut string where are words longer than $len not to break page design + */ +function cutOverloadedStrings($str,$len) +{ + if(strlen($str)>$len) //only check long strings + { + if(eregi(" ", $str)) // do we have a space in str + { + $words = explode(" ", $str); + $cut = false; + + while(list($key,$value) = each($words)) // check wordlength of ALL words in string + { + if(strlen($value)>$len) { + $cut = true; + $cut_word = substr_replace($value, '...', ($len-3)); + $translate = array($value => $cut_word); + $verified_string = strtr($str, $translate); + } + } + + if(!$cut) + { + + $verified_string = $str; + } + } + else + { + $verified_string=substr_replace($str, '...', $len); //cut + } + } + else + { + $verified_string=$str; + } + return $verified_string; +} + +/** * Take care of translation * * This simple method takes care of all translation related stuff. @@ -449,4 +489,126 @@ return ((float)$usec + (float)$sec); } + +$date_format = "%a %d. %b %Y"; +$time_format = "%H:%M:%S"; + +/** +* this function extends the php strftime with the localizations of linpha +* because the respective locales aren't installed on most systems. +* +* %a - abbreviated weekday name according to the current locale +* %A - full weekday name according to the current locale +* %b - abbreviated month name according to the current locale +* %B - full month name according to the current locale +* +* %c - preferred date and time representation for the current locale +* %x - preferred date representation for the current locale without the time +* %X - preferred time representation for the current locale without the date +* +* %w - day of the week as a decimal, Sunday being 0 +* %m - month as a decimal number (range 01 to 12) +* +* @author flo +* @param string $str_format optional, date and time format string, if empty default time format is used +* @param int $timestamp optional, unix timestamp, if empty time() is used +* @return string formatted date and time string +* @package time +*/ +/* +If the time and date format in your country is different with these formats, +please set it to the right format. Otherwise, leave it as it is. +See http://www.php.net/manual/en/function.strftime.php for definitions. +(Don't apply this to the english language file, the default date and time format are +set in the options page of linpha. This is because the date format is different within +the english spoken countries.) +*/ +function linStrftime($timestamp='now',$str_format='') +{ + /** + * if making any changes in these arrays, all language files needs updating + */ + $arr_month_short = Array('1' => i18n('Jan'),'2' => i18n('Feb'),'3' => i18n('Mar'),'4' => i18n('Apr'),'5' => i18n('May'),'6' => i18n('Jun'),'7' => i18n('Jul'),'8' => i18n('Aug'),'9' => i18n('Sep'),'10' => i18n('Oct'),'11' => i18n('Nov'),'12' => i18n('Dec')); /* abrevations of months */ + $arr_month_long = Array('1' => i18n('January'),'2' => i18n('February'),'3' => i18n('March'),'4' => i18n('April'),'5' => i18n('May'),'6' => i18n('June'),'7' => i18n('July'),'8' => i18n('August'),'9' => i18n('September'),'10' => i18n('October'),'11' => i18n('November'),'12' => i18n('December')); /* months */ + $arr_day_short = Array(i18n('Sun'),i18n('Mon'),i18n('Tue'),i18n('Wed'),i18n('Thu'),i18n('Fri'),i18n('Sat')); /* abrevations of weekdays */ + $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(); + } + + if($timestamp == 'now' OR empty($timestamp)) { + $timestamp = time(); + } + + $weekday_in_decimal = strftime("%w", $timestamp); + $month_in_decimal = strftime("%m", $timestamp); // pay attention: %m is '01 to 12', and not '1 to 12' + if($month_in_decimal < 10) { + $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("%a", $arr_day_short[$weekday_in_decimal], $str_format); + $str_format = str_replace("%A", $arr_day_long[$weekday_in_decimal], $str_format); + + if(!empty($month_in_decimal)) + { + $str_format = str_replace("%b", $arr_month_short[$month_in_decimal], $str_format); + $str_format = str_replace("%B", $arr_month_long[$month_in_decimal], $str_format); + } + + return strftime($str_format,$timestamp); +} + +/** +* Get date format string +* if it isn't defined in the current language file (for example in the english language file) +* the date format string is read from the linpha_config table +* +* @author flo +* @return string time format string for use in strftime() +* @package time +*/ +function getDateFormat() +{ + if( i18n('special_date_format') == 'special_date_format') { + return $GLOBALS['linpha']->sql->config->value['sys_style_dates']; + } else { + return i18n('special_date_format'); + } +} + +/** +* Get time format string +* if it isn't defined in the current language file (for example in the english language file) +* the time format string is read from the linpha_config table +* +* @author flo +* @return string time format string for use in strftime() +* @package time +*/ +function getTimeFormat() +{ + if( i18n('special_time_format') == 'special_time_format') { + return $GLOBALS['linpha']->sql->config->value['sys_style_times']; + } else { + return i18n('special_time_format'); + } +} + +function useAjax() +{ + if( isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax']) ) + { + return true; + } + else + { + return false; + } +} + ?> \ No newline at end of file Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-19 21:29:42 UTC (rev 4588) @@ -437,7 +437,7 @@ /** * slideshow icons */ - if( $_SESSION['use_js']) { + if( useAjax() ) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="javascript:slideshowStartFromThumbview()">'. '<img src="'.LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/slideshow.png" border="0" title="'.i18n("Play Slideshow").'" />' .'</a>'."\n"; @@ -471,7 +471,7 @@ /** * slideshow icons */ - if( $_SESSION['use_js']) { + if( useAjax() ) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="javascript:myLinImage.fullscreenStart()">'. '<img src="'.LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/slideshow.png" border="0" title="'.i18n("Play Slideshow").'" />' .'</a>'."\n"; @@ -643,7 +643,7 @@ /** * switch between javascript */ - if(isset($_SESSION['use_js'])) + if( useAjax() ) { $GLOBALS['linpha']->template->setModuleName('view_thumb'); @@ -886,7 +886,11 @@ } } - $this->viewHomeSetRandomImages(); + $days = $GLOBALS['linpha']->sql->config->value['sys_style_home_newimagesage']; + $days_in_sec = $days*60*60*24; + $lower_date = time()-$days_in_sec; + $this->viewHomeSetImages('new_images','sys_style_home_newimagesnr',' AND time_add > '.LinSql::linAddslashes($lower_date)); + $this->viewHomeSetImages('random_images','sys_style_home_nrrandomimages',''); $this->viewHomeSetBrowseByDate(); } @@ -932,14 +936,13 @@ } /** - * setup random imgages view - * @todo check if the file exists and if we have permissions to view the image + * setup random and new imgages view */ -function viewHomeSetRandomImages() +function viewHomeSetImages($key,$optionname,$sql) { - $GLOBALS['linpha']->template->output['random_images'] = Array(); + $GLOBALS['linpha']->template->output[$key] = Array(); - if($GLOBALS['linpha']->sql->config->value['sys_style_home_nrrandomimages'] != 0) + if($GLOBALS['linpha']->sql->config->value[$optionname] != 0) { switch(DB_TYPE) { @@ -957,10 +960,10 @@ break; } - $nr_random_images = $GLOBALS['linpha']->sql->config->value['sys_style_home_nrrandomimages']; - $query = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".PREFIX."photos WHERE img_type <> 0 AND img_type <> 9999999 ORDER BY ".$str_random); + $nr_images = $GLOBALS['linpha']->sql->config->value[$optionname]; + $query = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".PREFIX."photos WHERE img_type <> 0 AND img_type <> 9999999".$sql." ORDER BY ".$str_random); - for($i = 1; $i <= $nr_random_images ; ) + for($i = 1; $i <= $nr_images ; ) { $data = $query->FetchRow(ADODB_FETCH_NUM); if(isset($data['0'])) @@ -969,7 +972,7 @@ if(file_exists($path) && LinSql::photoIsAllowed($data['0'])) { - $GLOBALS['linpha']->template->output['random_images'][] = Array('id'=>$data['0'],'path'=>$path); + $GLOBALS['linpha']->template->output[$key][] = Array('id'=>$data['0'],'path'=>$path); $i++; } } @@ -1084,7 +1087,7 @@ $this->viewImgCommon(); $this->viewImgComments(); - if( isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax']) ) + if( useAjax() ) { $GLOBALS['linpha']->template->setModuleName('view_img'); @@ -1147,7 +1150,7 @@ while($data = $GLOBALS['linpha']->template->output['image_comments']->FetchRow()) { ?> <comment> - <time><?php echo $data['meta_time']; ?></time> + <time><?php echo linStrftime($data['meta_time']); ?></time> <author><?php echo htmlspecialchars($data['meta_author'],ENT_QUOTES); ?></author> <text><?php echo htmlspecialchars($data['meta_comment'],ENT_QUOTES); ?></text> </comment> Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-10-19 21:29:42 UTC (rev 4588) @@ -176,6 +176,7 @@ $this->dbConnect(); } + session_name('linpha2'); session_start(); /** Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/lib/js/LinImage.js 2006-10-19 21:29:42 UTC (rev 4588) @@ -36,8 +36,8 @@ loadImage: function(imgId) { curImgId = imgId; - - if(preloadXmlFinished[imgId] && xmlDoc[imgId] != "undefined") + + if(preloadXmlFinished[imgId] && typeof xmlDoc[imgId] != "undefined" ) // use typeof to work in IE { this.changeImage(); } @@ -292,12 +292,19 @@ { for(var i = 0; i < xmlDoc[curImgId].getElementsByTagName('comment').length; i++) { - var comment = xmlDoc[curImgId].getElementsByTagName('comment').item(i); - var commenttime = document.createTextNode( comment.getElementsByTagName('time').item(0).firstChild.data + ' ' ); - var commentauthor = document.createTextNode( comment.getElementsByTagName('author').item(0).firstChild.data ); - var commenttext = document.createTextNode( comment.getElementsByTagName('text').item(0).firstChild.data ); + var tagcomment = xmlDoc[curImgId].getElementsByTagName('comment').item(i); + var commenttime = document.createTextNode( tagcomment.getElementsByTagName('time').item(0).firstChild.data + ' by ' ); + var commentauthor = document.createTextNode( tagcomment.getElementsByTagName('author').item(0).firstChild.data ); + var commenttext = document.createTextNode( tagcomment.getElementsByTagName('text').item(0).firstChild.data ); - var ElemDiv = document.createElement("div"); + $('divcomments').appendChild(commenttime); + $('divcomments').appendChild(commentauthor); + $('divcomments').appendChild( document.createElement("hr") ); + $('divcomments').appendChild(commenttext); + $('divcomments').appendChild( document.createElement("br") ); + $('divcomments').appendChild( document.createElement("br") ); + + /*var ElemDiv = document.createElement("div"); ElemDiv.setAttribute('class','comments'); ElemDiv.appendChild(commenttime); ElemDiv.appendChild(commentauthor); @@ -305,7 +312,7 @@ ElemDiv.appendChild(commenttext); ElemDiv.appendChild( document.createElement("br") ); - $('divcomments').appendChild(ElemDiv); + $('divcomments').appendChild(ElemDiv);*/ } } @@ -367,35 +374,93 @@ // // keyboardAction() // + // very nice + // http://www.mediaevent.de/javascript/needful_tables.html + // keyboardAction: function(e) { - if( fullscreenActive ) + if (e == null) { // ie + keycode = event.keyCode; + } else { // mozilla + keycode = e.which; + } + + if( e.ctrlKey ) { - if (e == null) { // ie - keycode = event.keyCode; - } else { // mozilla - keycode = e.which; - } - - key = String.fromCharCode(keycode).toLowerCase(); + alert('ctrl pressed'); + return; + } + + key = String.fromCharCode(keycode).toLowerCase(); - - if( (key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) // close fullscreen - { + if ((keycode == 39) && (e.ctrlKey == true)) // ctrl + arrow right + { + myLinImage.disableKeyboardNav(); + myLinImage.moveNext(); + } + else if ((keycode == 37) && (e.ctrlKey == true)) // ctrl + arrow left + { + myLinImage.disableKeyboardNav(); + myLinImage.movePrev(); + } + else if ((keycode == 32) && (e.ctrlKey == true)) // ctrl + space + { + myLinImage.slideshowStartStop(); + } + else if ((keycode == 122)) // F11 + { + if( fullscreenActive ) { myLinImage.fullscreenStop(); + } else { + myLinImage.fullscreenStart(); } - else if(key == 's'){ // start/stop slideshow - myLinImage.slideshowStartStop(); - } else if(key == 'p'){ // display previous image - myLinImage.disableKeyboardNav(); - myLinImage.movePrev(); - } else if(key == 'n'){ // display next image - myLinImage.disableKeyboardNav(); - myLinImage.moveNext(); - } } + else if ((keycode == 36) && (e.ctrlKey == true)) // ctrl + home + { + myLinImage.moveFirst(); + } + else if ((keycode == 35) && (e.ctrlKey == true)) // ctrl + end + { + myLinImage.moveLast(); +// return false; + } + else if( fullscreenActive && ((key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) ) // close fullscreen + { + myLinImage.fullscreenStop(); + } + else if(fullscreenActive && key == 's') // start/stop slideshow + { + myLinImage.slideshowStartStop(); + } + else if(fullscreenActive && key == 'p') // display previous image + { + myLinImage.disableKeyboardNav(); + myLinImage.movePrev(); + } + else if(fullscreenActive && key == 'n') // display next image + { + myLinImage.disableKeyboardNav(); + myLinImage.moveNext(); + } +/* if (!e) var e = window.event; + + * } + else if ((38 == key) && (true == e.ctrlKey)) { //ctrl + arrow up + link_id = 'page_up'; + } + else + link_id = 'page_next'; + } + else if ((40 == key) && (true == e.ctrlKey)) { //ctrl + arrow down + if (slideshow) { + slideshow(); + } + }*/ + + + /*if( fullscreenActive && ( (key == 'x') || (key == 'o') || (key == 'c') ) ) { // close fullscreen myLinImage.fullscreenStop(); } else if(key == 'f'){ // start/stop fullscreen @@ -627,6 +692,7 @@ ssRandom = false; Element.setOpacity('ssImgRandom',1); } + alert('This feature is currently not implemented, do we really need that?'); } } @@ -838,7 +904,7 @@ */ function openTextarea() { - Element.show('inputAddCommentTextarea'); + Element.show('divAddCommentTextarea'); Element.hide('divAddCommentText'); $('inputAddCommentTextarea').value = $('inputAddCommentText').value; @@ -846,7 +912,7 @@ function initTextareaAddComment() { - Element.hide('inputAddCommentTextarea'); + Element.hide('divAddCommentTextarea'); Element.show('divAddCommentText'); $('inputAddCommentTextarea').value = ''; Modified: trunk/linpha2/lib/lang/lang.German.php =================================================================== --- trunk/linpha2/lib/lang/lang.German.php 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/lib/lang/lang.German.php 2006-10-19 21:29:42 UTC (rev 4588) @@ -1,5 +1,51 @@ <?php + $translate = array ( +"special_date_format" => "%a %d. %b %Y", // this are not set in the english language file, because they differ from usa and uk, if language +"special_time_format" => "%H:%M:%S", // is english, the values are taken from the config table + +"Jan" => "Jan", // abrevations of months +"Feb" => "Feb", +"Mar" => "Mär", +"Apr" => "Apr", +"May" => "Mai", +"Jun" => "Jun", +"Jul" => "Jul", +"Aug" => "Aug", +"Sep" => "Sep", +"Oct" => "Okt", +"Nov" => "Nov", +"Dec" => "Dez", + +"January" => "Januar", // months +"February" => "Februar", +"March" => "März", +"April" => "April", +"May" => "Mai", +"June" => "Juni", +"July" => "Juli", +"August" => "August", +"September" => "September", +"October" => "Oktober", +"November" => "November", +"December" => "Dezember", + +"Sun" => "So", // abrevations of weekdays +"Mon" => "Mo", +"Tue" => "Di", +"Wed" => "Mi", +"Thu" => "Do", +"Fri" => "Fr", +"Sat" => "Sa", + +"Sunday" => "Sonntag", // weekdays +"Monday" => "Montag", +"Tuesday" => "Dienstag", +"Wednesday" => "Mittwoch", +"Thursday" => "Donnerstag", +"Friday" => "Freitag", +"Saturday" => "Samstag", + "home" => "Home", "admin" => "Admin", "login" => "Anmelden", Added: trunk/linpha2/lib/modules/module.newimg.php =================================================================== --- trunk/linpha2/lib/modules/module.newimg.php (rev 0) +++ trunk/linpha2/lib/modules/module.newimg.php 2006-10-19 21:29:42 UTC (rev 4588) @@ -0,0 +1,87 @@ +<?php +/* +* Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> +* Florian Angehrn +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/** + * Navigation view related methods and functions + * @package Modules + */ +if(!defined('LINPHA_DIR')) { exit(1); } + +/** + * @todo temporary set configs + */ +$order_by = 'name ASC'; + +/** + * init + */ + include_once(LINPHA_DIR . '/lib/classes/linpha.imgview.class.php'); + $linpha->imgview = new linImgview(); + +/** + * set some infos + */ + $linpha->imgview->setCurrentView('newimg'); + $linpha->template->URL_base = LINPHA_DIR.'/?cat=newimg'; + + + if(isset($_GET['id'])) + { + $linpha->template->URL_full = LINPHA_DIR.'/?cat=newimg&id='.$_GET['id']; + } + else + { + $linpha->template->URL_full = LINPHA_DIR.'/?cat=newimg'; + } + + +/** + * write navigation and date links + */ + $GLOBALS['linpha']->template->output['title'] = '<a href="'.LINPHA_DIR.'/?cat=newimg">'.i18n("New Images").'</a>'; + $GLOBALS['linpha']->template->output['navigation'] = ''; + +/** + * get photos + */ + + $days = $GLOBALS['linpha']->sql->config->value['sys_style_home_newimagesage']; + $days_in_sec = $days*60*60*24; + $lower_date = time()-$days_in_sec; + + + + 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 " . + "FROM ".PREFIX."photos WHERE img_type <> 0 AND img_type <> 9999999 AND time_add > ".LinSql::linAddslashes($lower_date)." ". + "ORDER BY ".$linpha->imgview->orderby); + } + else + { + $linpha->imgview->photos = Array(); + } + + +$linpha->imgview->buildImgView(); +?> \ No newline at end of file Modified: trunk/linpha2/templates/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/css/global.css 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/templates/default/css/global.css 2006-10-19 21:29:42 UTC (rev 4588) @@ -25,7 +25,7 @@ * background color * #divthumbnavi amd #divSlideshowControls used in view_img.html.php */ - #divleft, #divmain, #divright, #divthumbnavi, #divnavigation, #divSlideshowControls { + #divleft, #divmain, #divright, #divthumbnavi, #divnavigation, #divSlideshowControlsInner, .roundAlphabottomInner { background-color: #f90; } @@ -306,4 +306,33 @@ display: block !important; } + .roundAlphatop { + position: relative; + background: url(../images/tr_alpha.gif) no-repeat top right; + } + + .roundAlphabottom { + position: relative; + background: url(../images/br_alpha.gif) no-repeat top right; + } + + + .roundAlphabottomInner { + margin: 0px; + padding: 0px; + margin-left: 15px; + margin-right: 15px; + height: 15px; + } + + img.AlphaCorner { + position: absolute; + top: 0px; + left: 0px; + width: 15px; + height: 15px; + border: none; + display: block !important; + } + --> \ No newline at end of file Modified: trunk/linpha2/templates/default/css/home.css =================================================================== --- trunk/linpha2/templates/default/css/home.css 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/templates/default/css/home.css 2006-10-19 21:29:42 UTC (rev 4588) @@ -23,12 +23,12 @@ .div_random { } -.div_random_img { +.div_random_img, .div_new_img { float: left; margin-left: 40px; } -.img_random_thumbnail { +.img_random_thumbnail, .img_new_thumbnail { border: 0; width: 130px; Modified: trunk/linpha2/templates/default/css/view_img.css =================================================================== --- trunk/linpha2/templates/default/css/view_img.css 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/templates/default/css/view_img.css 2006-10-19 21:29:42 UTC (rev 4588) @@ -98,24 +98,32 @@ * comment stuff */ .add_comment { - color: #036; +/* color: #036;*/ width: 600px; text-align: left; margin-left: 100px; + font-size: 8pt; } .add_comment input, .add_comment textarea { background-color: #d5eeff; + border: 1px solid grey; } .comments { - border: 1px solid #09f; - width: 200px; - margin: 5px; - margin-left: 150px; + width: 70%; + margin-left: 100px; + font-size: 8pt; } + .comments hr { + padding: 0px; + margin: 0px; +/* color: #f00;*/ + background-color: #f00; + height: 1px; + } /** - * slieshow + * slideshow */ #divSlideshowOverlay { Modified: trunk/linpha2/templates/default/home.html.php =================================================================== --- trunk/linpha2/templates/default/home.html.php 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/templates/default/home.html.php 2006-10-19 21:29:42 UTC (rev 4588) @@ -11,7 +11,7 @@ <!-- Random Images --> <?php if( count($GLOBALS['linpha']->template->output['random_images']) > 0 ) { ?> <hr /> - <h1><?php echo i18n("Random images"); ?></h1> + <h1><?php echo i18n("Random Images"); ?></h1> <?php foreach($GLOBALS['linpha']->template->output['random_images'] AS $key=>$value) { @@ -26,6 +26,26 @@ ?> <div style="clear: both;"></div> <?php } ?> + + <!-- New Images --> + <?php if( count($GLOBALS['linpha']->template->output['new_images']) > 0 ) { ?> + <hr /> + <h1><?php echo i18n("New Images"); ?></h1> + <?php + foreach($GLOBALS['linpha']->template->output['new_images'] AS $key=>$value) + { + ?> + <div class="div_new_img"> + <?php echo '<a href="'.LINPHA_DIR.'/?cat=newimg&id='.$value['id'].'">' + . '<img class="img_new_thumbnail" title="'.htmlspecialchars($value['path'],ENT_QUOTES).'" src="'. LINPHA_DIR.'/get_thumb.php?id=' .$value['id'] .'" alt="newimage" /></a>'; ?> + <br /><br /> + </div> + <?php + } + ?> + <div style="clear: both;"></div> + <?php echo '<a href="'.LINPHA_DIR.'/?cat=newimg">'.i18n('Show All New Images').'</a>'; ?> + <?php } ?> <!-- Browse by Date --> <?php @@ -56,7 +76,7 @@ <?php echo $value['stats_numbers'].' '.i18n("Photos"); ?> <br /> - <?php echo strftime("%x %X",$value['time_add']); ?> + <?php echo linStrftime($value['time_add']); ?> </div> </div> Modified: trunk/linpha2/templates/default/view_img.html.php =================================================================== --- trunk/linpha2/templates/default/view_img.html.php 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/templates/default/view_img.html.php 2006-10-19 21:29:42 UTC (rev 4588) @@ -52,11 +52,13 @@ <form action="" method="POST" onsubmit="saveComment(Form.serialize(this)); return false;"> <?php echo i18n("Add Comment"); ?>:<br /> <div id="divAddCommentText"> - <input type="text" id="inputAddCommentText" name="inputAddCommentText" value="" tabindex="1" size="40" /> + <input type="text" id="inputAddCommentText" name="inputAddCommentText" value="" tabindex="1" style="width: 300px" /> <a href="javascript:openTextarea()">(+)</a> </div> - <textarea style="display: none;" id="inputAddCommentTextarea" name="inputAddCommentTextarea" tabindex="1" rows="10" cols="50"></textarea> - <?php echo i18n("Name"); ?>: <input type="text" name="inputAddCommentAuthor" value="" tabindex="2" size="10" maxlength="255" /> + <div id="divAddCommentTextarea" style="display: none;"> + <textarea id="inputAddCommentTextarea" name="inputAddCommentTextarea" tabindex="1" rows="10" style="width: 300px"></textarea> + </div> + <?php echo i18n("Name"); ?>: <input type="text" name="inputAddCommentAuthor" value="" tabindex="2" size="10" style="width: 100px" maxlength="255" /> <input type="hidden" name="cmd" value="add_comment" /> <input type="submit" name="submit" value="<?php echo i18n("Submit"); ?>" tabindex="2" /> </form> @@ -66,7 +68,7 @@ <?php } /* end if checkPermission('metadata_comments') */ ?> <!-- show image comments --> - <div id="divcomments"></div> + <div id="divcomments" class="comments"></div> </div> <div class="roundbottom"> @@ -115,8 +117,9 @@ <div style="clear: both;"></div> </div> - <div class="roundbottom"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <div class="roundAlphabottom"> + <div class="roundAlphabottomInner"> </div> + <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/bl_alpha.gif'; ?>" alt="" width="15" height="15" class="AlphaCorner" style="display: none" /> </div> </div> <div id="divSlideshowImage" style="display: none;"></div> Modified: trunk/linpha2/templates/default/view_img_static.html.php =================================================================== --- trunk/linpha2/templates/default/view_img_static.html.php 2006-10-17 22:23:35 UTC (rev 4587) +++ trunk/linpha2/templates/default/view_img_static.html.php 2006-10-19 21:29:42 UTC (rev 4588) @@ -50,11 +50,13 @@ <form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> <?php echo i18n("Add Comment"); ?>:<br /> <div id="divAddCommentText"> - <input type="text" id="inputAddCommentText" name="inputAddCommentText" value="" tabindex="1" size="40" /> + <input type="text" id="inputAddCommentText" name="inputAddCommentText" value="" tabindex="1" style="width: 300px" /> <a href="javascript:openTextarea()">(+)</a> </div> - <textarea style="display: none;" id="inputAddCommentTextarea" name="inputAddCommentTextarea" tabindex="1" rows="10" cols="50"></textarea> - <?php echo i18n("Name"); ?>: <input type="text" name="inputAddCommentAuthor" value="" tabindex="2" size="10" maxlength="255" /> + <div id="divAddCommentTextarea" style="display: none;"> + <textarea id="inputAddCommentTextarea" name="inputAddCommentTextarea" tabindex="1" rows="10" style="width: 300px"></textarea> + </div> + <?php echo i18n("Name"); ?>: <input type="text" name="inputAddCommentAuthor" value="" tabindex="2" size="10" style="width: 100px" maxlength="255" /> <input type="hidden" name="cmd" value="add_comment" /> <input type="submit" name="submit" value="<?php echo i18n("Submit"); ?>" tabindex="2" /> </form> @@ -72,15 +74,15 @@ <br /><br /> <?php } /* end if checkPermission('metadata_comments') */ ?> - <!-- show image comments --> + <!-- show image comments --> + <div class="comments"> <?php while($data = $GLOBALS['linpha']->template->output['image_comments']->FetchRow()) { ?> - <div class="comments"> - <?php echo $data['meta_time']; ?> <?php echo htmlspecialchars($data['meta_author'],ENT_QUOTES); ?> - <br /> + <?php echo linStrftime($data['meta_time']).' '.i18n("by").' '.htmlspecialchars($data['meta_author'],ENT_QUOTES); ?> + <hr /> <?php echo htmlspecialchars($data['meta_comment'],ENT_QUOTES); ?> <br /><br /> - </div> <?php } ?> + </div> <?php } /* end if view!=meta */ ?> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |