Thread: [Linpha-cvs] SF.net SVN: linpha: [4587] trunk/linpha2 (Page 5)
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-10-17 22:23:58
|
Revision: 4587 http://svn.sourceforge.net/linpha/?rev=4587&view=rev Author: fangehrn Date: 2006-10-17 15:23:35 -0700 (Tue, 17 Oct 2006) Log Message: ----------- 2006-10-18 flo * implemented ajax add comment * had to disable the accesskeys when not in fullscreen mode because writing text in input fields didnt worked anymore any suggestions? :-( Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.template.class.php trunk/linpha2/lib/js/LinGlobal.js trunk/linpha2/lib/js/LinImage.js trunk/linpha2/templates/default/global.html.php trunk/linpha2/templates/default/view_img.html.php trunk/linpha2/templates/default/view_img_static.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-17 20:41:49 UTC (rev 4586) +++ trunk/linpha2/ChangeLog 2006-10-17 22:23:35 UTC (rev 4587) @@ -1,3 +1,9 @@ +2006-10-18 flo + * implemented ajax add comment + * had to disable the accesskeys when not in fullscreen mode + because writing text in input fields didnt worked anymore + any suggestions? :-( + 2006-10-11 flo * implemented slideshow * implemented movefirst() and movelast() Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-17 20:41:49 UTC (rev 4586) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-17 22:23:35 UTC (rev 4587) @@ -34,6 +34,7 @@ public $use_javascript; public $id_current, $id_parent, $img_type, $filename, $md5sum; private $nr_pages, $current_page; // only used if javascript disabled +private $newCommentAdded = false; // used for ajax /** * constructor @@ -51,14 +52,6 @@ { $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_sortorder']); - /** - * set usage of javascript - */ - if(isset($_GET['use_js'])) - { - $_SESSION['use_js'] = true; - } - if(isset($_GET['id']) && $_GET['id'] != 0) { /** @@ -1091,7 +1084,7 @@ $this->viewImgCommon(); $this->viewImgComments(); - if($_SESSION['use_js']) + if( isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax']) ) { $GLOBALS['linpha']->template->setModuleName('view_img'); @@ -1146,6 +1139,11 @@ <?php } + if($this->newCommentAdded) + { + echo '<commentadded>'.i18n('Comment successfully added.').'</commentadded>'."\n"; + } + while($data = $GLOBALS['linpha']->template->output['image_comments']->FetchRow()) { ?> <comment> @@ -1205,20 +1203,23 @@ /** * save comment */ - if( isset( $_POST['cmd'] ) && $_POST['cmd']=='add_comment') + if( isset( $_POST['cmd'] ) && $_POST['cmd']=='add_comment' + && isset($_POST['inputAddCommentAuthor']) && !empty($_POST['inputAddCommentAuthor']) + && ( ( isset($_POST['inputAddCommentText']) && !empty($_POST['inputAddCommentText']) ) + || ( isset($_POST['inputAddCommentTextarea']) && !empty($_POST['inputAddCommentTextarea']) ) + ) + ) { - if( !empty($_POST['comment_textarea'])) - { - $comment = $_POST['comment_textarea']; + if( !empty($_POST['inputAddCommentTextarea'])) { + $comment = $_POST['inputAddCommentTextarea']; + } else { + $comment = $_POST['inputAddCommentText']; } - else - { - $comment = $_POST['comment_text']; - } $GLOBALS['linpha']->db->Execute("INSERT into ".PREFIX."meta_comments (meta_time, md5sum, meta_author, meta_comment)" . - "VALUES ('".time()."','".$GLOBALS['linpha']->imgview->md5sum."','".linSql::linAddslashes($_POST['author'])."'," . + "VALUES ('".time()."','".$GLOBALS['linpha']->imgview->md5sum."','".linSql::linAddslashes($_POST['inputAddCommentAuthor'])."'," . "'".linSql::linAddslashes($comment)."')"); + $this->newCommentAdded = true; // used for ajax } /** Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-17 20:41:49 UTC (rev 4586) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-17 22:23:35 UTC (rev 4587) @@ -80,11 +80,6 @@ </style> <![endif]--> -<?php if( isset( $GLOBALS['linpha']->template->output['slideshow_head'] ) ) { - echo '<!-- slideshow-->'; - echo $GLOBALS['linpha']->template->output['slideshow_head']; -} ?> - <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/prototype.js"></script> <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/LinGlobal.js"></script> <?php Modified: trunk/linpha2/lib/js/LinGlobal.js =================================================================== --- trunk/linpha2/lib/js/LinGlobal.js 2006-10-17 20:41:49 UTC (rev 4586) +++ trunk/linpha2/lib/js/LinGlobal.js 2006-10-17 22:23:35 UTC (rev 4587) @@ -5,9 +5,14 @@ */ function linSyslog(text) { - $('divSyslogText').innerHTML = text; + $('divSyslogText').innerHTML += text + '<br />'; Element.show('divSyslog'); } +function closeSyslog() +{ + $('divSyslogText').innerHTML = ''; + Element.hide('divSyslog'); +} /** * check ajax compatibilty Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-10-17 20:41:49 UTC (rev 4586) +++ trunk/linpha2/lib/js/LinImage.js 2006-10-17 22:23:35 UTC (rev 4587) @@ -286,6 +286,7 @@ /** * set comments */ + initTextareaAddComment(); $('divcomments').innerHTML = ''; if(xmlDoc[curImgId].getElementsByTagName('comment').length > 0) { @@ -367,15 +368,35 @@ // keyboardAction() // keyboardAction: function(e) { - if (e == null) { // ie - keycode = event.keyCode; - } else { // mozilla - keycode = e.which; + + if( fullscreenActive ) + { + if (e == null) { // ie + keycode = event.keyCode; + } else { // mozilla + keycode = e.which; + } + + key = String.fromCharCode(keycode).toLowerCase(); + + + if( (key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) // close fullscreen + { + myLinImage.fullscreenStop(); + } + 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(); + } } - - key = String.fromCharCode(keycode).toLowerCase(); - - if( fullscreenActive && ( (key == 'x') || (key == 'o') || (key == 'c') ) ) { // close fullscreen + + + /*if( fullscreenActive && ( (key == 'x') || (key == 'o') || (key == 'c') ) ) { // close fullscreen myLinImage.fullscreenStop(); } else if(key == 'f'){ // start/stop fullscreen if( fullscreenActive ) { @@ -391,7 +412,8 @@ } else if(key == 'n'){ // display next image myLinImage.disableKeyboardNav(); myLinImage.moveNext(); - } + }*/ + }, /** @@ -758,6 +780,56 @@ return returnarray; } + +// ----------------------------------------------------------------------------------- +// Comments +// ----------------------------------------------------------------------------------- + +function saveComment(parameters) +{ + //alert(parameters); + + //new Ajax.Updater('div_to_be_updated', '/action/here', {asynchronous:true, parameters:Form.serialize(this)}) + + + var opt = { + // Use POST + method: 'post', + // Send this lovely data + postBody: parameters + , + // asynchron, of course + asynchronous:true, + + // Handle successful response + onSuccess: saveCommentContinue, + + // Handle 404 + on404: function(t) { + alert('Error 404: location "' + t.statusText + '" was not found.'); + }, + // Handle other errors + onFailure: function(t) { + alert('Error ' + t.status + ' -- ' + t.statusText); + } + } + + new Ajax.Request(xmlUrl + '&id=' + curImgId + '&xml', opt); +} + + +function saveCommentContinue(t) +{ + xmlDoc[curImgId] = t.responseXML.documentElement; + + if(xmlDoc[curImgId].getElementsByTagName('commentadded').length > 0) + { + linSyslog( xmlDoc[curImgId].getElementsByTagName('commentadded').item(0).firstChild.data ); + } + + myLinImage.loadImage(curImgId); +} + /** * openTextarea() * @@ -766,8 +838,17 @@ */ function openTextarea() { - document.getElementById('comment_textarea').style.display = 'block'; - document.getElementById('comment_div_text').style.display = 'none'; + Element.show('inputAddCommentTextarea'); + Element.hide('divAddCommentText'); - document.getElementById('comment_textarea').value = document.getElementById('comment_input_text').value; -} \ No newline at end of file + $('inputAddCommentTextarea').value = $('inputAddCommentText').value; +} + +function initTextareaAddComment() +{ + Element.hide('inputAddCommentTextarea'); + Element.show('divAddCommentText'); + + $('inputAddCommentTextarea').value = ''; + $('inputAddCommentText').value = ''; +} Modified: trunk/linpha2/templates/default/global.html.php =================================================================== --- trunk/linpha2/templates/default/global.html.php 2006-10-17 20:41:49 UTC (rev 4586) +++ trunk/linpha2/templates/default/global.html.php 2006-10-17 22:23:35 UTC (rev 4587) @@ -18,7 +18,7 @@ <!-- syslog --> <div id="divSyslog"<?php if( ! isset($GLOBALS['linpha']->template->output['sys_log']) ) { echo ' style="display: none;"'; } ?>> - <div id="divSyslogClose"><a href="javascript:void(0);" onclick="Element.hide('divSyslog')">X</a></div> + <div id="divSyslogClose"><a href="javascript:closeSyslog();">X</a></div> <?php echo i18n("Linpha Syslog"); ?>:<br /> <div id="divSyslogText"> <?php echo $GLOBALS['linpha']->template->output['sys_log']; ?> Modified: trunk/linpha2/templates/default/view_img.html.php =================================================================== --- trunk/linpha2/templates/default/view_img.html.php 2006-10-17 20:41:49 UTC (rev 4586) +++ trunk/linpha2/templates/default/view_img.html.php 2006-10-17 22:23:35 UTC (rev 4587) @@ -49,16 +49,16 @@ <?php if($GLOBALS['linpha']->sql->checkPermission('metadata_comments')) { ?> <!-- show add comment form --> <div class="add_comment"> - <form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> + <form action="" method="POST" onsubmit="saveComment(Form.serialize(this)); return false;"> <?php echo i18n("Add Comment"); ?>:<br /> - <div id="comment_div_text"> - <input type="text" id="comment_input_text" name="comment_text" value="" tabindex="1" size="40" maxlength="40" /> + <div id="divAddCommentText"> + <input type="text" id="inputAddCommentText" name="inputAddCommentText" value="" tabindex="1" size="40" /> <a href="javascript:openTextarea()">(+)</a> </div> - <textarea style="display: none;" id="comment_textarea" name="comment_textarea" tabindex="1" rows="10" cols="50"></textarea> - <?php echo i18n("Name"); ?>: <input type="text" name="author" value="" tabindex="2" size="10" maxlength="40" /> + <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" /> <input type="hidden" name="cmd" value="add_comment" /> - <input type="submit" name="submit" value="<?php echo i18n("submit"); ?>" /> + <input type="submit" name="submit" value="<?php echo i18n("Submit"); ?>" tabindex="2" /> </form> </div> Modified: trunk/linpha2/templates/default/view_img_static.html.php =================================================================== --- trunk/linpha2/templates/default/view_img_static.html.php 2006-10-17 20:41:49 UTC (rev 4586) +++ trunk/linpha2/templates/default/view_img_static.html.php 2006-10-17 22:23:35 UTC (rev 4587) @@ -49,23 +49,23 @@ <div class="add_comment"> <form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> <?php echo i18n("Add Comment"); ?>:<br /> - <div id="comment_div_text"> - <input type="text" id="comment_input_text" name="comment_text" value="" tabindex="1" size="40" maxlength="40" /> + <div id="divAddCommentText"> + <input type="text" id="inputAddCommentText" name="inputAddCommentText" value="" tabindex="1" size="40" /> <a href="javascript:openTextarea()">(+)</a> </div> - <textarea style="display: none;" id="comment_textarea" name="comment_textarea" tabindex="1" rows="10" cols="50"></textarea> - <?php echo i18n("Name"); ?>: <input type="text" name="author" value="" tabindex="2" size="10" maxlength="40" /> + <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" /> <input type="hidden" name="cmd" value="add_comment" /> - <input type="submit" name="submit" value="<?php echo i18n("submit"); ?>" /> + <input type="submit" name="submit" value="<?php echo i18n("Submit"); ?>" tabindex="2" /> </form> </div> <script language="JavaScript" type="text/javascript"> function openTextarea() { - document.getElementById('comment_textarea').style.display = 'block'; - document.getElementById('comment_div_text').style.display = 'none'; + document.getElementById('inputAddCommentTextarea').style.display = 'block'; + document.getElementById('divAddCommentText').style.display = 'none'; - document.getElementById('comment_textarea').value = document.getElementById('comment_input_text').value; + document.getElementById('inputAddCommentTextarea').value = document.getElementById('inputAddCommentText').value; } </script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: bzrudi <bz...@ce...> - 2006-10-22 08:20:14
|
Hi all, ... > * had to disable the accesskeys when not in fullscreen mode > because writing text in input fields didnt worked anymore > any suggestions? :-( IMHO we should use the arrow keys left right <- -> for next - prev it's more intuitive, but that is still not the answer to your question ;-)... cheers bzrudi fan...@us... wrote: > Revision: 4587 > http://svn.sourceforge.net/linpha/?rev=4587&view=rev > Author: fangehrn > Date: 2006-10-17 15:23:35 -0700 (Tue, 17 Oct 2006) > > Log Message: > ----------- > 2006-10-18 flo > * implemented ajax add comment > * had to disable the accesskeys when not in fullscreen mode > because writing text in input fields didnt worked anymore > any suggestions? :-( > > Modified Paths: > -------------- > trunk/linpha2/ChangeLog > trunk/linpha2/lib/classes/linpha.imgview.class.php > trunk/linpha2/lib/classes/linpha.template.class.php > trunk/linpha2/lib/js/LinGlobal.js > trunk/linpha2/lib/js/LinImage.js > trunk/linpha2/templates/default/global.html.php > trunk/linpha2/templates/default/view_img.html.php > trunk/linpha2/templates/default/view_img_static.html.php > > Modified: trunk/linpha2/ChangeLog > =================================================================== > --- trunk/linpha2/ChangeLog 2006-10-17 20:41:49 UTC (rev 4586) > +++ trunk/linpha2/ChangeLog 2006-10-17 22:23:35 UTC (rev 4587) > @@ -1,3 +1,9 @@ > +2006-10-18 flo > + * implemented ajax add comment > + * had to disable the accesskeys when not in fullscreen mode > + because writing text in input fields didnt worked anymore > + any suggestions? :-( > + > 2006-10-11 flo > * implemented slideshow > * implemented movefirst() and movelast() > > Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php > =================================================================== > --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-17 20:41:49 UTC (rev 4586) > +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-17 22:23:35 UTC (rev 4587) > @@ -34,6 +34,7 @@ > public $use_javascript; > public $id_current, $id_parent, $img_type, $filename, $md5sum; > private $nr_pages, $current_page; // only used if javascript disabled > +private $newCommentAdded = false; // used for ajax > > /** > * constructor > @@ -51,14 +52,6 @@ > { > $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_sortorder']); > > - /** > - * set usage of javascript > - */ > - if(isset($_GET['use_js'])) > - { > - $_SESSION['use_js'] = true; > - } > - > if(isset($_GET['id']) && $_GET['id'] != 0) > { > /** > @@ -1091,7 +1084,7 @@ > $this->viewImgCommon(); > $this->viewImgComments(); > > - if($_SESSION['use_js']) > + if( isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax']) ) > { > $GLOBALS['linpha']->template->setModuleName('view_img'); > > @@ -1146,6 +1139,11 @@ > <?php > } > > + if($this->newCommentAdded) > + { > + echo '<commentadded>'.i18n('Comment successfully added.').'</commentadded>'."\n"; > + } > + > while($data = $GLOBALS['linpha']->template->output['image_comments']->FetchRow()) > { ?> > <comment> > @@ -1205,20 +1203,23 @@ > /** > * save comment > */ > - if( isset( $_POST['cmd'] ) && $_POST['cmd']=='add_comment') > + if( isset( $_POST['cmd'] ) && $_POST['cmd']=='add_comment' > + && isset($_POST['inputAddCommentAuthor']) && !empty($_POST['inputAddCommentAuthor']) > + && ( ( isset($_POST['inputAddCommentText']) && !empty($_POST['inputAddCommentText']) ) > + || ( isset($_POST['inputAddCommentTextarea']) && !empty($_POST['inputAddCommentTextarea']) ) > + ) > + ) > { > - if( !empty($_POST['comment_textarea'])) > - { > - $comment = $_POST['comment_textarea']; > + if( !empty($_POST['inputAddCommentTextarea'])) { > + $comment = $_POST['inputAddCommentTextarea']; > + } else { > + $comment = $_POST['inputAddCommentText']; > } > - else > - { > - $comment = $_POST['comment_text']; > - } > > $GLOBALS['linpha']->db->Execute("INSERT into ".PREFIX."meta_comments (meta_time, md5sum, meta_author, meta_comment)" . > - "VALUES ('".time()."','".$GLOBALS['linpha']->imgview->md5sum."','".linSql::linAddslashes($_POST['author'])."'," . > + "VALUES ('".time()."','".$GLOBALS['linpha']->imgview->md5sum."','".linSql::linAddslashes($_POST['inputAddCommentAuthor'])."'," . > "'".linSql::linAddslashes($comment)."')"); > + $this->newCommentAdded = true; // used for ajax > } > > /** > > Modified: trunk/linpha2/lib/classes/linpha.template.class.php > =================================================================== > --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-17 20:41:49 UTC (rev 4586) > +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-17 22:23:35 UTC (rev 4587) > @@ -80,11 +80,6 @@ > </style> > <![endif]--> > > -<?php if( isset( $GLOBALS['linpha']->template->output['slideshow_head'] ) ) { > - echo '<!-- slideshow-->'; > - echo $GLOBALS['linpha']->template->output['slideshow_head']; > -} ?> > - > <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/prototype.js"></script> > <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/LinGlobal.js"></script> > <?php > > Modified: trunk/linpha2/lib/js/LinGlobal.js > =================================================================== > --- trunk/linpha2/lib/js/LinGlobal.js 2006-10-17 20:41:49 UTC (rev 4586) > +++ trunk/linpha2/lib/js/LinGlobal.js 2006-10-17 22:23:35 UTC (rev 4587) > @@ -5,9 +5,14 @@ > */ > function linSyslog(text) > { > - $('divSyslogText').innerHTML = text; > + $('divSyslogText').innerHTML += text + '<br />'; > Element.show('divSyslog'); > } > +function closeSyslog() > +{ > + $('divSyslogText').innerHTML = ''; > + Element.hide('divSyslog'); > +} > > /** > * check ajax compatibilty > > Modified: trunk/linpha2/lib/js/LinImage.js > =================================================================== > --- trunk/linpha2/lib/js/LinImage.js 2006-10-17 20:41:49 UTC (rev 4586) > +++ trunk/linpha2/lib/js/LinImage.js 2006-10-17 22:23:35 UTC (rev 4587) > @@ -286,6 +286,7 @@ > /** > * set comments > */ > + initTextareaAddComment(); > $('divcomments').innerHTML = ''; > if(xmlDoc[curImgId].getElementsByTagName('comment').length > 0) > { > @@ -367,15 +368,35 @@ > // keyboardAction() > // > keyboardAction: function(e) { > - if (e == null) { // ie > - keycode = event.keyCode; > - } else { // mozilla > - keycode = e.which; > + > + if( fullscreenActive ) > + { > + if (e == null) { // ie > + keycode = event.keyCode; > + } else { // mozilla > + keycode = e.which; > + } > + > + key = String.fromCharCode(keycode).toLowerCase(); > + > + > + if( (key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) // close fullscreen > + { > + myLinImage.fullscreenStop(); > + } > + 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(); > + } > } > - > - key = String.fromCharCode(keycode).toLowerCase(); > - > - if( fullscreenActive && ( (key == 'x') || (key == 'o') || (key == 'c') ) ) { // close fullscreen > + > + > + /*if( fullscreenActive && ( (key == 'x') || (key == 'o') || (key == 'c') ) ) { // close fullscreen > myLinImage.fullscreenStop(); > } else if(key == 'f'){ // start/stop fullscreen > if( fullscreenActive ) { > @@ -391,7 +412,8 @@ > } else if(key == 'n'){ // display next image > myLinImage.disableKeyboardNav(); > myLinImage.moveNext(); > - } > + }*/ > + > }, > > /** > @@ -758,6 +780,56 @@ > return returnarray; > } > > + > +// ----------------------------------------------------------------------------------- > +// Comments > +// ----------------------------------------------------------------------------------- > + > +function saveComment(parameters) > +{ > + //alert(parameters); > + > + //new Ajax.Updater('div_to_be_updated', '/action/here', {asynchronous:true, parameters:Form.serialize(this)}) > + > + > + var opt = { > + // Use POST > + method: 'post', > + // Send this lovely data > + postBody: parameters > + , > + // asynchron, of course > + asynchronous:true, > + > + // Handle successful response > + onSuccess: saveCommentContinue, > + > + // Handle 404 > + on404: function(t) { > + alert('Error 404: location "' + t.statusText + '" was not found.'); > + }, > + // Handle other errors > + onFailure: function(t) { > + alert('Error ' + t.status + ' -- ' + t.statusText); > + } > + } > + > + new Ajax.Request(xmlUrl + '&id=' + curImgId + '&xml', opt); > +} > + > + > +function saveCommentContinue(t) > +{ > + xmlDoc[curImgId] = t.responseXML.documentElement; > + > + if(xmlDoc[curImgId].getElementsByTagName('commentadded').length > 0) > + { > + linSyslog( xmlDoc[curImgId].getElementsByTagName('commentadded').item(0).firstChild.data ); > + } > + > + myLinImage.loadImage(curImgId); > +} > + > /** > * openTextarea() > * > @@ -766,8 +838,17 @@ > */ > function openTextarea() > { > - document.getElementById('comment_textarea').style.display = 'block'; > - document.getElementById('comment_div_text').style.display = 'none'; > + Element.show('inputAddCommentTextarea'); > + Element.hide('divAddCommentText'); > > - document.getElementById('comment_textarea').value = document.getElementById('comment_input_text').value; > -} > \ No newline at end of file > + $('inputAddCommentTextarea').value = $('inputAddCommentText').value; > +} > + > +function initTextareaAddComment() > +{ > + Element.hide('inputAddCommentTextarea'); > + Element.show('divAddCommentText'); > + > + $('inputAddCommentTextarea').value = ''; > + $('inputAddCommentText').value = ''; > +} > > Modified: trunk/linpha2/templates/default/global.html.php > =================================================================== > --- trunk/linpha2/templates/default/global.html.php 2006-10-17 20:41:49 UTC (rev 4586) > +++ trunk/linpha2/templates/default/global.html.php 2006-10-17 22:23:35 UTC (rev 4587) > @@ -18,7 +18,7 @@ > > <!-- syslog --> > <div id="divSyslog"<?php if( ! isset($GLOBALS['linpha']->template->output['sys_log']) ) { echo ' style="display: none;"'; } ?>> > - <div id="divSyslogClose"><a href="javascript:void(0);" onclick="Element.hide('divSyslog')">X</a></div> > + <div id="divSyslogClose"><a href="javascript:closeSyslog();">X</a></div> > <?php echo i18n("Linpha Syslog"); ?>:<br /> > <div id="divSyslogText"> > <?php echo $GLOBALS['linpha']->template->output['sys_log']; ?> > > Modified: trunk/linpha2/templates/default/view_img.html.php > =================================================================== > --- trunk/linpha2/templates/default/view_img.html.php 2006-10-17 20:41:49 UTC (rev 4586) > +++ trunk/linpha2/templates/default/view_img.html.php 2006-10-17 22:23:35 UTC (rev 4587) > @@ -49,16 +49,16 @@ > <?php if($GLOBALS['linpha']->sql->checkPermission('metadata_comments')) { ?> > <!-- show add comment form --> > <div class="add_comment"> > - <form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> > + <form action="" method="POST" onsubmit="saveComment(Form.serialize(this)); return false;"> > <?php echo i18n("Add Comment"); ?>:<br /> > - <div id="comment_div_text"> > - <input type="text" id="comment_input_text" name="comment_text" value="" tabindex="1" size="40" maxlength="40" /> > + <div id="divAddCommentText"> > + <input type="text" id="inputAddCommentText" name="inputAddCommentText" value="" tabindex="1" size="40" /> > <a href="javascript:openTextarea()">(+)</a> > </div> > - <textarea style="display: none;" id="comment_textarea" name="comment_textarea" tabindex="1" rows="10" cols="50"></textarea> > - <?php echo i18n("Name"); ?>: <input type="text" name="author" value="" tabindex="2" size="10" maxlength="40" /> > + <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" /> > <input type="hidden" name="cmd" value="add_comment" /> > - <input type="submit" name="submit" value="<?php echo i18n("submit"); ?>" /> > + <input type="submit" name="submit" value="<?php echo i18n("Submit"); ?>" tabindex="2" /> > </form> > </div> > > > Modified: trunk/linpha2/templates/default/view_img_static.html.php > =================================================================== > --- trunk/linpha2/templates/default/view_img_static.html.php 2006-10-17 20:41:49 UTC (rev 4586) > +++ trunk/linpha2/templates/default/view_img_static.html.php 2006-10-17 22:23:35 UTC (rev 4587) > @@ -49,23 +49,23 @@ > <div class="add_comment"> > <form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> > <?php echo i18n("Add Comment"); ?>:<br /> > - <div id="comment_div_text"> > - <input type="text" id="comment_input_text" name="comment_text" value="" tabindex="1" size="40" maxlength="40" /> > + <div id="divAddCommentText"> > + <input type="text" id="inputAddCommentText" name="inputAddCommentText" value="" tabindex="1" size="40" /> > <a href="javascript:openTextarea()">(+)</a> > </div> > - <textarea style="display: none;" id="comment_textarea" name="comment_textarea" tabindex="1" rows="10" cols="50"></textarea> > - <?php echo i18n("Name"); ?>: <input type="text" name="author" value="" tabindex="2" size="10" maxlength="40" /> > + <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" /> > <input type="hidden" name="cmd" value="add_comment" /> > - <input type="submit" name="submit" value="<?php echo i18n("submit"); ?>" /> > + <input type="submit" name="submit" value="<?php echo i18n("Submit"); ?>" tabindex="2" /> > </form> > </div> > <script language="JavaScript" type="text/javascript"> > function openTextarea() > { > - document.getElementById('comment_textarea').style.display = 'block'; > - document.getElementById('comment_div_text').style.display = 'none'; > + document.getElementById('inputAddCommentTextarea').style.display = 'block'; > + document.getElementById('divAddCommentText').style.display = 'none'; > > - document.getElementById('comment_textarea').value = document.getElementById('comment_input_text').value; > + document.getElementById('inputAddCommentTextarea').value = document.getElementById('inputAddCommentText').value; > } > </script> > > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Linpha-cvs mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linpha-cvs |
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. |
From: <fan...@us...> - 2006-10-20 10:19:19
|
Revision: 4589 http://svn.sourceforge.net/linpha/?rev=4589&view=rev Author: fangehrn Date: 2006-10-20 03:18:59 -0700 (Fri, 20 Oct 2006) Log Message: ----------- updated todo list remove lightbox Modified Paths: -------------- trunk/linpha2/docs/dev/TODO.txt trunk/linpha2/docs/dev/external_libraries.txt Removed Paths: ------------- trunk/linpha2/lib/classes/lightbox/ Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2006-10-19 21:29:42 UTC (rev 4588) +++ trunk/linpha2/docs/dev/TODO.txt 2006-10-20 10:18:59 UTC (rev 4589) @@ -5,11 +5,15 @@ ## Small Todos - save image height and width in database to reduce file access in get_image.php and imgview() ? -- style forms this way http://www.cssplay.co.uk/menu/form.html - not that much colors, but with alignments and <label> ## Big Todos +- Style + - use relative font sizes instead of aboslute + - style forms this way http://www.cssplay.co.uk/menu/form.html + not that much colors, but with alignments and <label> + + - Installer - define final installer behaviour - if installation is complete, the user must delete the install/ folder ? (install/ignore_delete_install_msg.txt) @@ -25,25 +29,35 @@ https://sourceforge.net/forum/message.php?msg_id=3648731 and https://sourceforge.net/forum/message.php?msg_id=3674100 + - wait until new release is done by evan hunter ? - Videos - Video thumbnail (what about ffmpeg?) - switch between quicktime and mplayer? + - nice to have: + - ability to play flash videos + free player: FlowPlayer + convert videos in flash format: + # ffmpeg -i input_file -b bitrate -s XxY -pass 1 -passlogfile log_file video.flv + # ffmpeg -i input_file -b bitrate -s XxY -pass 2 -passlogfile log_file video.flv + for details see c't 21 / 2006 - Plugins (copy from linpha1) + - Guestbook, first apply patch with security image + - Logger + - Mailing list + - Maps + - RSS + - Statistics + - Watermark + - Old: benchmark + - Old: DB Management - ImageMagick - Bracket Support, enable by default, only if old version found, disable it, or require imagemagick > "6.1.4" -## Nice to have -- ability to play flash videos - free player: FlowPlayer - convert videos in flash format: - # ffmpeg -i input_file -b bitrate -s XxY -pass 1 -passlogfile log_file video.flv - # ffmpeg -i input_file -b bitrate -s XxY -pass 2 -passlogfile log_file video.flv - for details see c't 21 / 2006 Modified: trunk/linpha2/docs/dev/external_libraries.txt =================================================================== --- trunk/linpha2/docs/dev/external_libraries.txt 2006-10-19 21:29:42 UTC (rev 4588) +++ trunk/linpha2/docs/dev/external_libraries.txt 2006-10-20 10:18:59 UTC (rev 4589) @@ -10,35 +10,6 @@ include_once(LINPHA_DIR . "/lib/classes/smtp.class.php"); - -lightbox2.02 - - // Lightbox v2.01 - // by Lokesh Dhakar - http://www.huddletogether.com - // 3/31/06 - // - // For more information on this script, visit: - // http://huddletogether.com/projects/lightbox2/ - - - linpha changes: - - lightbox.js - - line 62 and 63 comment (replaced by own) - line 74 comment (replaced by own imageArray) - line 106 element.src = setImageUrl(src); - line 171-184 comment - line 313 remove argument imageLink - line 322 comment - line 325 - 344 comment - line 349 var lightboxTop = 20; /*arrayPageScroll[1] + (arrayPageSize[3] / 15);*/ - line 381 imgPreloader.src = setImageUrl(imageArray[activeImage][0]); - line 527 preloadNextImage.src = setImageUrl(imageArray[activeImage + 1][0]); - line 531 preloadPrevImage.src = setImageUrl(imageArray[activeImage - 1][0]); - - - PHP_JPEG_Metadata_Toolkit_1.11 CHANGES This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2006-10-25 19:52:55
|
Revision: 4590 http://svn.sourceforge.net/linpha/?rev=4590&view=rev Author: fangehrn Date: 2006-10-25 12:48:04 -0700 (Wed, 25 Oct 2006) Log Message: ----------- 2006-10-25 flo * fixed installation issues * secured $_SERVER['PHP_SELF'] Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/get_image.php trunk/linpha2/get_thumb.php trunk/linpha2/install/footer.php trunk/linpha2/install/header.php trunk/linpha2/install/header_html.php trunk/linpha2/install/index.php trunk/linpha2/install/lib.install.php trunk/linpha2/install/lib.requirements.php trunk/linpha2/install/step10_postsettings.php trunk/linpha2/install/step11_finish.php trunk/linpha2/install/step1_license.php trunk/linpha2/install/step2_requirements.php trunk/linpha2/install/step3_dbtype.php trunk/linpha2/install/step4_selectdirectories.php trunk/linpha2/install/step5_getlogin.php trunk/linpha2/install/step6_selectdatabase.php trunk/linpha2/install/step7_selectprefix.php trunk/linpha2/install/step8_testing.php trunk/linpha2/install/step9_createtables.php trunk/linpha2/lib/include/calender.php trunk/linpha2/lib/include/common.php trunk/linpha2/lib/lang/language.php trunk/linpha2/lib/plugins/watermark/func.watermark.php Added Paths: ----------- trunk/linpha2/docs/dev/security.txt Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/ChangeLog 2006-10-25 19:48:04 UTC (rev 4590) @@ -1,3 +1,7 @@ +2006-10-25 flo + * fixed installation issues + * secured $_SERVER['PHP_SELF'] + 2006-10-19 flo * added basic new images * finished comments Added: trunk/linpha2/docs/dev/security.txt =================================================================== --- trunk/linpha2/docs/dev/security.txt (rev 0) +++ trunk/linpha2/docs/dev/security.txt 2006-10-25 19:48:04 UTC (rev 4590) @@ -0,0 +1,9 @@ + +Some security related stuff, which should never be forgotten: + + +- secure $_SERVER['PHP_SELF'] (done in lib/include/common.php) + +- disable Magic Quotes (common.php) and use addslashes() on every sql query + +- check every data coming by the user (GET/POST/COOKIE) \ No newline at end of file Modified: trunk/linpha2/get_image.php =================================================================== --- trunk/linpha2/get_image.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/get_image.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -27,6 +27,8 @@ if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','.'); } +include_once(LINPHA_DIR.'/lib/include/common.php'); + /** * check for valid id */ Modified: trunk/linpha2/get_thumb.php =================================================================== --- trunk/linpha2/get_thumb.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/get_thumb.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -25,6 +25,8 @@ if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','.'); } +include_once(LINPHA_DIR.'/lib/include/common.php'); + /** * check for valid id */ Modified: trunk/linpha2/install/footer.php =================================================================== --- trunk/linpha2/install/footer.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/footer.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -17,7 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } +if(!defined('LINPHA_DIR')) { exit(1); } /** * linpha installer Modified: trunk/linpha2/install/header.php =================================================================== --- trunk/linpha2/install/header.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/header.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -17,7 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } +if(!defined('LINPHA_DIR')) { exit(1); } /** * linpha installer Modified: trunk/linpha2/install/header_html.php =================================================================== --- trunk/linpha2/install/header_html.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/header_html.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -17,7 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } +if(!defined('LINPHA_DIR')) { exit(1); } /** * linpha installer Modified: trunk/linpha2/install/index.php =================================================================== --- trunk/linpha2/install/index.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/index.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -24,7 +24,7 @@ if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } - +include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/install/lib.install.php'); /** Modified: trunk/linpha2/install/lib.install.php =================================================================== --- trunk/linpha2/install/lib.install.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/lib.install.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -17,6 +17,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +if(!defined('LINPHA_DIR')) { exit(1); } + /** * Take care of translation * @@ -199,7 +201,8 @@ { if( ! installIsAbsolutePath( $path ) ) { - $path = str_ireplace("../", " ", $path ); + //$path = str_ireplace("../", " ", $path ); + $path = realpath($path); } /** @@ -458,11 +461,38 @@ */ function initInitialDirectories($dirs) { -$init_ok = true; -echo tr("Creating Required Directories")."... "; - try { + $init_ok = true; + echo "<h2>".tr("Checking Directory Permissions")."</h2><br />"; + + /** + * checking album directory + */ + echo tr("Album Directory")."... "; + if( is_dir( $dirs['album'] ) ) + { + if( is_writable( $dirs['album'] ) ) + { + echo success_msg(); + echo '<br /> ('.$_SESSION['album_dir'].' => '.installLinRealpath( $dirs['album'] ).')'; + } + else + { + echo warning_msg(); + echo '<br /> ('.$_SESSION['album_dir'].' => '.installLinRealpath( $dirs['album'] ).')'; + echo "<br />".tr("Album Directory Not Writable. Some Features May Not Work")."<br />"; + } + } + else + { + throw new Exception(failed_msg()."<br />".$_SESSION['album_dir']."<br />".tr("No Valid Directory Found")); + } + + + echo "<br /><br />"; + echo tr("Creating Required Directories")."... "; + $array = array('sql','cache','tmp'); foreach($array AS $value) { @@ -489,7 +519,7 @@ } else { - throw new Exception(failed_msg()."<br />".tr("Please Delete Folder Manually")); + throw new Exception(failed_msg()."<br />".tr("Directory Allready Exists, Please Delete Folder Manually")); } } @@ -513,7 +543,8 @@ } catch(Exception $error) { - echo "Error: ".$error -> getMessage(); + echo $error -> getMessage(); + echo '<br /> ('.$_SESSION[$value.'_dir'].' => '.installLinRealpath( $dirs[$value] ).')<br />'; $init_ok = false; } Modified: trunk/linpha2/install/lib.requirements.php =================================================================== --- trunk/linpha2/install/lib.requirements.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/lib.requirements.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -17,6 +17,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +if(!defined('LINPHA_DIR')) { exit(1); } + /** * @package Installation */ Modified: trunk/linpha2/install/step10_postsettings.php =================================================================== --- trunk/linpha2/install/step10_postsettings.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/step10_postsettings.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -23,7 +23,7 @@ */ if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } - +include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/install/header.php'); include_once(LINPHA_DIR.'/install/lib.requirements.php'); Modified: trunk/linpha2/install/step11_finish.php =================================================================== --- trunk/linpha2/install/step11_finish.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/step11_finish.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -22,7 +22,7 @@ */ if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } - +include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR."/install/header.php"); include_once(LINPHA_DIR."/install/header_html.php"); include_once(LINPHA_DIR."/lib/classes/linpha.class.php"); Modified: trunk/linpha2/install/step1_license.php =================================================================== --- trunk/linpha2/install/step1_license.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/step1_license.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -23,7 +23,7 @@ */ if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } - +include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/install/header.php'); include_once(LINPHA_DIR.'/install/header_html.php'); Modified: trunk/linpha2/install/step2_requirements.php =================================================================== --- trunk/linpha2/install/step2_requirements.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/step2_requirements.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -23,7 +23,7 @@ * linpha installer * @package Installation */ - +include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/install/header.php'); include_once(LINPHA_DIR.'/install/lib.requirements.php'); include_once(LINPHA_DIR.'/install/header_html.php'); Modified: trunk/linpha2/install/step3_dbtype.php =================================================================== --- trunk/linpha2/install/step3_dbtype.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/step3_dbtype.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -23,7 +23,7 @@ * linpha installer * @package Installation */ - +include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/install/header.php'); /** Modified: trunk/linpha2/install/step4_selectdirectories.php =================================================================== --- trunk/linpha2/install/step4_selectdirectories.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/step4_selectdirectories.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -23,7 +23,7 @@ */ if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } - +include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/install/header.php'); $album_dir = (isset($_SESSION['album_dir']) ? $_SESSION['album_dir'] : 'albums'); @@ -73,8 +73,9 @@ (-> <?php echo installLinRealpath( installGetFullPath($album_dir) ) ?>) <br /><br /> -<h2><?php echo tr("Warning: All Existing Subdirectories Will Be Deleted"); ?></h2> <br /> +<h2 style="color: red;"><?php echo tr("Warning: All directories below will be deleted if they exists !!"); ?></h2> +<br /> <div class="boxalign"> <?php echo tr("Sql Directory").":"; ?> Modified: trunk/linpha2/install/step5_getlogin.php =================================================================== --- trunk/linpha2/install/step5_getlogin.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/step5_getlogin.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -23,7 +23,7 @@ * linpha installer * @package Installation */ - +include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/install/header.php'); /** @@ -72,38 +72,8 @@ if(isset($_POST['cmd_step4'])) { /** - * validate writable directories + * checking album, sql, cache and tmp directory */ - echo "<h2>".tr("Checking Directory Permissions")."</h2><br />"; - - /** - * checking album directory - */ - echo tr("Album Directory")."... "; - if( is_dir( $dirs['album'] ) ) - { - if( is_writable( $dirs['album'] ) ) - { - echo success_msg(); - echo '<br /> ('.$_SESSION['album_dir'].' => '.installLinRealpath( $dirs['album'] ).')'; - } - else - { - echo warning_msg(); - echo '<br /> ('.$_SESSION['album_dir'].' => '.installLinRealpath( $dirs['album'] ).')'; - echo "<br />".tr("Album Directory Not Writable. Some Features May Not Work")."<br />"; - } - } - else - { - echo failed_msg(); - echo '<br /> ('.$_SESSION['album_dir'].')'; - echo "<br />".tr("No Valid Directory Found")."!"; - } - - /** - * checking sql, cache and tmp directory - */ if(initInitialDirectories($dirs) != true) { $show_next_button = false; Modified: trunk/linpha2/install/step6_selectdatabase.php =================================================================== --- trunk/linpha2/install/step6_selectdatabase.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/step6_selectdatabase.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -23,7 +23,7 @@ * linpha installer * @package Installation */ - +include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/install/header.php'); include_once(LINPHA_DIR.'/install/header_html.php'); Modified: trunk/linpha2/install/step7_selectprefix.php =================================================================== --- trunk/linpha2/install/step7_selectprefix.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/step7_selectprefix.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -23,7 +23,7 @@ * linpha installer * @package Installation */ - +include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/install/header.php'); @@ -130,8 +130,18 @@ } break; case "sqlite": - $dirs = initSessionValues(); - initInitialDirectories($dirs); + + /** + * checking album, sql, cache and tmp directory + */ + $dirs = initSessionValues(); + if(initInitialDirectories($dirs) != true) + { + $show_next_button = false; + include_once(LINPHA_DIR.'/install/footer.php'); + exit(); + } + echo tr("Testing File Connection")."<br /><br />"; echo tr("Connecting SQLite Database")."... "; @@ -185,6 +195,8 @@ } +echo "<br /><br />"; + if(isset($error_nr)) { echo "</form>"; Modified: trunk/linpha2/install/step8_testing.php =================================================================== --- trunk/linpha2/install/step8_testing.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/step8_testing.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -23,7 +23,7 @@ * linpha installer * @package Installation */ - +include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/install/header.php'); include_once(LINPHA_DIR.'/install/header_html.php'); Modified: trunk/linpha2/install/step9_createtables.php =================================================================== --- trunk/linpha2/install/step9_createtables.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/install/step9_createtables.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -23,7 +23,7 @@ * linpha installer * @package Installation */ - +include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/install/header.php'); /** Modified: trunk/linpha2/lib/include/calender.php =================================================================== --- trunk/linpha2/lib/include/calender.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/lib/include/calender.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -18,6 +18,9 @@ */ if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','../..'); } + +include_once(LINPHA_DIR.'/lib/include/common.php'); + $style['tablebg']="#B3BCDE"; /** Modified: trunk/linpha2/lib/include/common.php =================================================================== --- trunk/linpha2/lib/include/common.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/lib/include/common.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -2,6 +2,65 @@ if(!defined('LINPHA_DIR')) { exit(1); } /** + * some common used stuff + * + * always include this file which has no "if(!defined('LINPHA_DIR')) { exit(1); }" on top + * that means: + * - index.php, get_image.php, get_thumb.php + * - admin/index.php + * - lib/include/calendar.php, lib/lang/language.php, + * - install/index.php, install/step* + */ + + +/** + * secure PHP_SELF + * + * added from linpha1 patch 1432469 + * + * short description: + * with the url http://example.com/tests/simple.php/%22%3E%3Cscript%3Ealert('xss')%3C/script%3E%3Cfoo + * PHP_SELF is: /tests/simple.php/"><script>alert('xss')</script><foo + * and thats dangerous + * + * further details about the PHP_SELF XSS problem: + * http://blog.phpdoc.info/archives/13-XSS-Woes.html + */ + /** + * Added by Roland Haeder <web...@mx...> + * + * This code came from my free mailexchange script called 'MXChange' + * Please refer the pages on http://www.mxchange.org for further details + * + */ + // Secure the PHP_SELF variable by first making all HTML code unuseable + $_SERVER['PHP_SELF'] = htmlentities($_SERVER['PHP_SELF']); + + // Split it up into path and filename + $SELF_DIR = dirname($_SERVER['PHP_SELF']); + $SELF_FILE = basename($_SERVER['PHP_SELF']); + + // Check for a .php inside the $SELF_DIR... + while (ereg(".php", $SELF_DIR)) + { + // Correct the dirname + $SELF_DIR = substr($SELF_DIR, 0, (strpos($SELF_DIR, ".php") + 4)); + // Rewrite filename... + $SELF_FILE = basename($SELF_DIR); + // ... and dirname + $SELF_DIR = dirname($SELF_DIR); + } + + // Put both together again and let's pray it is secured now... + $_SERVER['PHP_SELF'] = $SELF_DIR."/".$SELF_FILE; + + // Remove uneccessary variables + unset($SELF_DIR); + unset($SELF_FILE); + + + +/** * Magic Quotes stuff */ /** Modified: trunk/linpha2/lib/lang/language.php =================================================================== --- trunk/linpha2/lib/lang/language.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/lib/lang/language.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -28,6 +28,8 @@ if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','../..'); } +include_once(LINPHA_DIR.'/lib/include/common.php'); + print_xhtml_header(); print_menu_head(); Modified: trunk/linpha2/lib/plugins/watermark/func.watermark.php =================================================================== --- trunk/linpha2/lib/plugins/watermark/func.watermark.php 2006-10-20 10:18:59 UTC (rev 4589) +++ trunk/linpha2/lib/plugins/watermark/func.watermark.php 2006-10-25 19:48:04 UTC (rev 4590) @@ -17,7 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','../..'); } +if(!defined('LINPHA_DIR')) { exit(1); } /** * @uses get_thumbs_on_fly.php, file_download.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2006-10-25 21:33:39
|
Revision: 4591 http://svn.sourceforge.net/linpha/?rev=4591&view=rev Author: fangehrn Date: 2006-10-25 14:33:18 -0700 (Wed, 25 Oct 2006) Log Message: ----------- 2006-10-25 flo * implemented detailed view Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/image_fields_select.php trunk/linpha2/install/sql/sql.data.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/js/LinThumbnails.js trunk/linpha2/templates/default/css/view_thumb.css trunk/linpha2/templates/default/view_thumb.head.php trunk/linpha2/templates/default/view_thumbdetail.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/ChangeLog 2006-10-25 21:33:18 UTC (rev 4591) @@ -1,6 +1,7 @@ 2006-10-25 flo * fixed installation issues * secured $_SERVER['PHP_SELF'] + * implemented detailed view 2006-10-19 flo * added basic new images Modified: trunk/linpha2/admin/image_fields_select.php =================================================================== --- trunk/linpha2/admin/image_fields_select.php 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/admin/image_fields_select.php 2006-10-25 21:33:18 UTC (rev 4591) @@ -9,6 +9,7 @@ $array_menu = Array( 'image' => Array('name' => 'Image', 'link' => 'imagefields_select_image'), 'thumb' => Array('name' => 'Thumbnail', 'link' => 'imagefields_select_thumb'), + 'thumbdetail' => Array('name' => 'Thumbnail Detail View', 'link' => 'imagefields_select_thumbdetail'), 'video' => Array('name' => 'Video', 'link' => 'imagefields_select_video'), 'album' => Array('name' => 'Album', 'link' => 'imagefields_select_album') ); @@ -23,7 +24,9 @@ case 'thumb': printFieldsTable(13); break; - +case 'thumbdetail': + printFieldsTable(14); + break; case 'video': break; Modified: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/install/sql/sql.data.php 2006-10-25 21:33:18 UTC (rev 4591) @@ -191,5 +191,21 @@ $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . "(name, field_type, flags) VALUES ('builtin_description', 0, 13)"; + /** + * preselected fields for thumbnails in detail view + */ + $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_thumbnail', 0, 14)"; + $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_filename', 0, 14)"; + $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_description', 0, 14)"; + $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_imagesize', 0, 14)"; + $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_dimension', 0, 14)"; + $sql_queries[] = "INSERT INTO ".PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('exif_datetimeoriginal', 0, 14)"; + ?> Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-25 21:33:18 UTC (rev 4591) @@ -179,11 +179,9 @@ switch($_SESSION['mode_thumbview']) { case 'thumb': + case 'thumbdetail': $this->viewThumb(); break; - case 'thumbdetail': - $this->viewThumbdetail(); - break; case 'basket': $this->viewBasket(); break; @@ -327,16 +325,29 @@ ) ); - $GLOBALS['linpha']->template->output['menu_More']['view'] = - Array( - 'name' => i18n("View"), - 'value' => Array( - Array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), - Array('name' => i18n("View"), 'value' => $array_views_links), - Array('name' => i18n("Thumb Size"), 'value' => $array_tn_sizes_links), - Array('name' => i18n("Thumb Nr"), 'value' => $array_nr_links) - ) - ); + if( useAjax() ) + { + $GLOBALS['linpha']->template->output['menu_More']['view'] = + Array( + 'name' => i18n("View"), + 'value' => Array( + Array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), + Array('name' => i18n("View"), 'value' => $array_views_links), + Array('name' => i18n("Thumb Size"), 'value' => $array_tn_sizes_links), + Array('name' => i18n("Thumb Nr"), 'value' => $array_nr_links) + ) + ); + } + else + { + $GLOBALS['linpha']->template->output['menu_More']['view'] = + Array( + 'name' => i18n("View"), + 'value' => Array( + Array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), + ) + ); + } if($GLOBALS['linpha']->sql->photoIsAllowed( $this->id_parent, 'write')) { @@ -539,59 +550,8 @@ } -/** - * prepare stuff for slideshow - * @uses LinImgview::buildImgView() - */ -/*function slideshow() -{ - foreach($this->photos_filtered AS $key=>$photo_value) - { - if(LinIdentify::isSupportedImage($photo_value['img_type'])) - { - $array_entries[] = '{ 0: "'.$photo_value['id'].'", 1: "title" }'; - } - } - - if(isset($array_entries)) - { - $GLOBALS['linpha']->template->output['slideshow_head'] = - '<link rel="stylesheet" href="'.LINPHA_DIR.'/lib/classes/lightbox/css/lightbox.css" type="text/css" media="screen" />'."\n". - '<script src="'.LINPHA_DIR.'/lib/classes/lightbox/prototype.js" type="text/javascript"></script>'."\n". - '<script src="'.LINPHA_DIR.'/lib/classes/lightbox/scriptaculous.js?load=effects" type="text/javascript"></script>'."\n". - '<script src="'.LINPHA_DIR.'/lib/classes/lightbox/lightbox.js" type="text/javascript"></script>'."\n". - '<script language="JavaScript" type="text/javascript">'."\n". - 'var imageArray = ['."\n". - implode(',',$array_entries). - '];'."\n". - "\n". - 'var fileLoadingImage = "'.LINPHA_DIR.'/lib/classes/lightbox/images/loading.gif";'."\n". - 'var fileBottomNavCloseImage = "'.LINPHA_DIR.'/lib/classes/lightbox/images/closelabel.gif";'."\n". - 'function setImageUrl(id)'."\n". - '{'."\n". - 'var arrayPageSize = getPageSize();'."\n". - 'return \''.LINPHA_DIR.'/get_image.php?id=\' + imageArray[activeImage][0] + \'&width=\' + (arrayPageSize[2]-100) + \'&height=\' + (arrayPageSize[3]-100)'."\n". - '}'."\n". - "\n". - '</script>'."\n"; - - $GLOBALS['linpha']->template->output['slideshow_body'] = - '<div id="slideshow">'."\n". - '<a href="'.$GLOBALS['linpha']->template->URL_full.'">'.i18n("Close").'</a>'."\n". - '<br />'.i18n("Random Play Order").'<input type="radio" id="slideshowRandomOff" name="slideshowRandom" checked="checked" />'.i18n("No").'<input type="radio" id="slideshowRandomOn" name="slideshowRandom" />'.i18n("Yes")."\n". - '<br />'.i18n("Autoplay").'<input type="checkbox" id="slideshowAutostart" />'."\n". - '<br />'.i18n("Time Delay")."\n". - '<select id="slideshowTimeDelay"><option>3</option><option>4</option><option>5</option><option>10</option></select>'."\n". - '<br /><a href="#" onclick="myLightbox.start();">'.i18n("Start Slideshow").'<img src="'.LINPHA_DIR.'/templates/default/images/slideshow.png" border="0" /></a>'."\n". - '</div>'."\n"; - } -}*/ - - - - /** * define thumbnail view */ @@ -611,7 +571,12 @@ $md5sum = $photo_value['md5sum']; $full_filename = LinSql::getFullImagePath( $photo_value['id'] ); - $array_image_infos = MetaData::readInformations( $full_filename, $filename, $md5sum, $flag_nr=13 ); + if($_SESSION['mode_thumbview'] == 'thumbdetail') { + $flag_nr = 14; + } else { + $flag_nr = 13; + } + $array_image_infos = MetaData::readInformations( $full_filename, $filename, $md5sum, $flag_nr ); $index = 'before'; foreach($array_image_infos AS $value) @@ -627,11 +592,11 @@ { if($index == 'before') { - $GLOBALS['linpha']->template->output['thumb_infos'][$photo_value['id']][$index] .= $value['value'].'<br />'; // $value['value'] is already escaped + $GLOBALS['linpha']->template->output['thumb_infos'][$photo_value['id']]['before'] .= $value['value'].'<br />'; // $value['value'] is already escaped } elseif($index == 'after') { - $GLOBALS['linpha']->template->output['thumb_infos'][$photo_value['id']][$index] .= '<br />'.$value['value']; // $value['value'] is already escaped + $GLOBALS['linpha']->template->output['thumb_infos'][$photo_value['id']]['after'] .= $value['value'].'<br />'; // $value['value'] is already escaped } } } @@ -851,6 +816,13 @@ $this->tot_photos = count($this->photos_filtered) - $nr_folders; } +/** + * setup detailed thumbdetail view + */ +function viewThumbdetail() +{ + $GLOBALS['linpha']->template->setModuleName('view_thumbdetail'); +} @@ -984,26 +956,10 @@ } } -/** - * setup detailed thumbdetail view - */ -function viewThumbdetail() -{ - $GLOBALS['linpha']->template->setModuleName('view_thumbdetail'); -} -/** - * add comments in detailed view - */ -function viewThumbdetailSetComments() -{ - -} - - /** * setup basket view */ Modified: trunk/linpha2/lib/js/LinThumbnails.js =================================================================== --- trunk/linpha2/lib/js/LinThumbnails.js 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/lib/js/LinThumbnails.js 2006-10-25 21:33:18 UTC (rev 4591) @@ -14,10 +14,21 @@ * fine tuning * better a space more than a space too less */ -var img_spacer_width = 12; // used to calculate nr_cols -var img_spacer_height = 11; // used to calculate nr_rows -var img_div_spacer_height = 11; // used to calculate max-height of the image (depending how much text we would like to add) +if(view_mode == 'thumbdetail') +{ + var img_spacer_width = 150 + 28; // used to calculate nr_cols, 200 = width of text div, 25 = overhead + var img_spacer_height = 10; // used to calculate nr_rows + var img_div_spacer_height = 0; // used to calculate max-height of the image (depending how much text we would like to add at bottom) +} +else // 'thumb' +{ + var img_spacer_width = 12; // used to calculate nr_cols + var img_spacer_height = 11; // used to calculate nr_rows + var img_div_spacer_height = 11; // used to calculate max-height of the image (depending how much text we would like to add at bottom) +} + + /** * page numbers */ @@ -103,24 +114,28 @@ { if(i >= startup_img_nr && img_nr <= max_photos_per_page) { - if( (img_nr-1) % nr_cols == 0) - { - styletext = ' style="clear:left;"'; + if( (img_nr-1) % nr_cols == 0) { + var styletext = ' style="clear:left;"'; + } else { + var styletext = ''; } - else - { - styletext = ''; + + if(view_mode == 'thumbdetail') { + var style2text = ' style="float: left;"'; + } else { + var style2text = ''; } + divhtmltext += - '<div id="div' + i + '"' + styletext + ' class="imgdiv">' + - img_ids[i]['before'] + + '<div id="div' + i + '"' + styletext + ' class="divthumb">' + + img_ids[i]['before'] + '<div class="divimg"' + style2text + '>' + '<a href="' + link_url + '&id=' + img_ids[i]['id'] + '">' + '<img src="' + link_get_thumb + img_ids[i]['id'] + '"' + ' height="' + tn_size + '" width="' + tn_size + '" ' + ' alt="' + img_ids[i]['title'] + '" title="' + img_ids[i]['title'] + '"' + - ' class="img_thumbnail" />' + - '</a>' + img_ids[i]['after'] + '</div>'; + ' class="imgthumb" />' + + '</a></div><div class="divtext">' + img_ids[i]['after'] + '</div></div>'; /** * flush buffer of divhtmltext on end of line Modified: trunk/linpha2/templates/default/css/view_thumb.css =================================================================== --- trunk/linpha2/templates/default/css/view_thumb.css 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/templates/default/css/view_thumb.css 2006-10-25 21:33:18 UTC (rev 4591) @@ -46,20 +46,22 @@ /** * thumbnails */ - .imgdiv { - /* border: 1px #000000 solid;*/ + .divthumb { /* outer div */ margin: 3px; text-align: center; float: left; font-size: 8pt; } + .divimg { + } - .img_thumbnail { + .imgthumb { /* inner div with thumbnail */ border: 0; - /*width: auto;*/ } - .img_text { + .divtext { /* inner div with bottom or right text */ padding-left: 10px; text-align: left; - } \ No newline at end of file + width: 150px; + float: left; + } Modified: trunk/linpha2/templates/default/view_thumb.head.php =================================================================== --- trunk/linpha2/templates/default/view_thumb.head.php 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/templates/default/view_thumb.head.php 2006-10-25 21:33:18 UTC (rev 4591) @@ -5,6 +5,7 @@ var link_url = '<?php echo convert_amp($GLOBALS['linpha']->template->URL_base); ?>'; var tn_size = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>; var photos_per_page = 'auto'; +var view_mode = '<?php echo $_SESSION['mode_thumbview']; ?>'; <?php echo $GLOBALS['linpha']->template->output['files_db']."\n"; ?> </script> Modified: trunk/linpha2/templates/default/view_thumbdetail.html.php =================================================================== --- trunk/linpha2/templates/default/view_thumbdetail.html.php 2006-10-25 19:48:04 UTC (rev 4590) +++ trunk/linpha2/templates/default/view_thumbdetail.html.php 2006-10-25 21:33:18 UTC (rev 4591) @@ -1,4 +1,11 @@ +<?php +@todo not needed anymore +to be deleted + +?> + + <!-- navigation --> <?php if(isset($GLOBALS['linpha']->template->output['navigation']) && !empty($GLOBALS['linpha']->template->output['navigation'])) { ?> <div id="divnavigation"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2006-10-26 21:53:56
|
Revision: 4596 http://svn.sourceforge.net/linpha/?rev=4596&view=rev Author: fangehrn Date: 2006-10-26 14:53:15 -0700 (Thu, 26 Oct 2006) Log Message: ----------- 2006-10-26 flo * playing around with different style colors, currently a blue one... * created gdlib script which will generate the nice round corners on the fly -> it will be possible to select the color through the admin settings Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/install/sql/sql.data.php trunk/linpha2/lib/classes/linpha.admin.class.php trunk/linpha2/lib/classes/linpha.image.class.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.template.class.php trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/js/LinThumbnails.js trunk/linpha2/templates/default/basket.html.php trunk/linpha2/templates/default/filemanager.html.php trunk/linpha2/templates/default/home.html.php trunk/linpha2/templates/default/layouts/default/css/global.css trunk/linpha2/templates/default/search.html.php trunk/linpha2/templates/default/settings.html.php trunk/linpha2/templates/default/view_albcomment.html.php trunk/linpha2/templates/default/view_basket.html.php trunk/linpha2/templates/default/view_img.html.php trunk/linpha2/templates/default/view_img_static.html.php trunk/linpha2/templates/default/view_thumb.head.php trunk/linpha2/templates/default/view_thumb.html.php trunk/linpha2/templates/default/view_thumb_static.html.php trunk/linpha2/templates/default/view_thumbdetail.html.php Added Paths: ----------- trunk/linpha2/templates/default/colorsettings.php trunk/linpha2/templates/default/layouts/default/DefsThumbView.js trunk/linpha2/templates/roundcorners.php trunk/linpha2/templates/roundcorners_test.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/ChangeLog 2006-10-26 21:53:15 UTC (rev 4596) @@ -1,3 +1,8 @@ +2006-10-26 flo + * playing around with different style colors, currently a blue one... + * created gdlib script which will generate the nice round corners on the fly + -> it will be possible to select the color through the admin settings + 2006-10-25 flo * fixed installation issues * secured $_SERVER['PHP_SELF'] Modified: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/install/sql/sql.data.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -67,7 +67,8 @@ 'sys_style_thumb_nojsnrrows' => '3', 'sys_style_thumb_nojsnrcols' => '4', 'sys_style_image_quality' => '75', - 'sys_style_image_size' => '700', + 'sys_style_image_width' => '700', + 'sys_style_image_height' => '525', 'sys_style_image_nrprevnextthumbs' => '3', 'sys_user_autologin' => '1', @@ -89,7 +90,8 @@ 'sys_style_thumb_showsubfoldersseparate', 'sys_style_thumb_nojsnrrows', 'sys_style_thumb_nojsnrcols', - 'sys_style_image_size', + 'sys_style_image_width', + 'sys_style_image_height', 'sys_style_image_nrprevnextthumbs' ); Modified: trunk/linpha2/lib/classes/linpha.admin.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.admin.class.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/lib/classes/linpha.admin.class.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -56,7 +56,8 @@ 'sys_style_image_nrprevnextthumbs' => "Nr Of Previous/Next Thumbnails", 'sys_lang' => "Language", 'sys_lang_autolang' => "Autodetection of language", - 'sys_style_image_size' => "Image size", + 'sys_style_image_width' => "Max Image Width", + 'sys_style_image_height' => "Max Image Height", 'sys_style_sortorder' => "Sort order", 'sys_style_template' => "Template", 'sys_style_thumb_nojsnrcols' => "Nr Cols if Javascript deactivated", @@ -261,7 +262,8 @@ 'sys_style_thumb_nojsnrrows', 'sys_style_thumb_nojsnrcols', 'sys_style_image_quality', - 'sys_style_image_size', + 'sys_style_image_width', + 'sys_style_image_height', 'sys_style_image_nrprevnextthumbs', 'sys_user_autologin' Modified: trunk/linpha2/lib/classes/linpha.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.image.class.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/lib/classes/linpha.image.class.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -47,6 +47,92 @@ { } +function setFileInformation() +{ + /** + * check for valid id + * and get img_type and rotate informations + */ + $query = $GLOBALS['linpha']->db->Execute("SELECT id, img_type, rotate " . + "FROM ".PREFIX."photos " . + "WHERE id = '".LinSql::linAddslashes( $this->photo_id )."'"); + + if( $query->EOF ) // not a single value returned + { + $this->error_msg = "wrong id supplied!"; + return false; + } + + $data = $query->FetchRow(); + + if( ! LinSql::photoIsAllowed( $data['id'] ) ) + { + $this->error_msg = "not permitted!"; + return false; + } + + if($this->mode == 'img' && ! LinIdentify::isSupportedImage( $data['img_type'] ) ) + { + $this->error_msg = "only images possible!"; + return false; + } + + /** + * checke force parameter + */ + if( isset($_GET['force'] ) ) { + $this->force = true; + } else { + $this->force = false; + } + + /** + * set additional informations + */ + $this->rotate = $data['rotate']; + $this->img_type = $data['img_type']; + $this->setCachedInfos(); + + /** + * check if file already exists OR if forced + */ + if( file_exists( $this->output_file ) AND !$this->force ) + { + $this->isCached = true; + } + else // !file_exists() OR $this->force + { + $this->isCached = false; + + /** + * create subfolder if needed + */ + if( ! file_exists( dirname($this->output_file) ) ) + { + if( ! @mkdir( dirname($this->output_file) ) ) + { + $this->error_msg = "Cannot create folder ".dirname($this->output_file)." check permissions!"; + return false; + } + } + } + + /** + * use imagemagick or gdlib + */ + if($GLOBALS['linpha']->sql->config->value['sys_im_use_imagemagick']) + { + $this->image_tool = 'imagemagick'; + $this->imagemagick_path = $GLOBALS['linpha']->sql->config->value['sys_im_imagemagick_path']; + } + else + { + $this->image_tool = 'gdlib'; + } + + return true; +} + /** * set cached_id and output_file * in image mode set also rotate, watermark, quality, ... @@ -74,8 +160,8 @@ } else { - $this->max_width = $GLOBALS['linpha']->sql->config->value['sys_style_image_size']; - $this->max_height = $GLOBALS['linpha']->sql->config->value['sys_style_image_size']; + $this->max_width = $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; + $this->max_height = $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; } /** @@ -170,97 +256,13 @@ } -function setFileInformation() -{ - /** - * check for valid id - * and get img_type and rotate informations - */ - $query = $GLOBALS['linpha']->db->Execute("SELECT id, img_type, rotate " . - "FROM ".PREFIX."photos " . - "WHERE id = '".LinSql::linAddslashes( $this->photo_id )."'"); - - if( $query->EOF ) // not a single value returned - { - $this->error_msg = "wrong id supplied!"; - return false; - } - - $data = $query->FetchRow(); - - if( ! LinSql::photoIsAllowed( $data['id'] ) ) - { - $this->error_msg = "not permitted!"; - return false; - } - - if($this->mode == 'img' && ! LinIdentify::isSupportedImage( $data['img_type'] ) ) - { - $this->error_msg = "only images possible!"; - return false; - } - - /** - * checke force parameter - */ - if( isset($_GET['force'] ) ) { - $this->force = true; - } else { - $this->force = false; - } - - /** - * set additional informations - */ - $this->rotate = $data['rotate']; - $this->img_type = $data['img_type']; - $this->setCachedInfos(); - - /** - * check if file already exists OR if forced - */ - if( file_exists( $this->output_file ) AND !$this->force ) - { - $this->isCached = true; - } - else // !file_exists() OR $this->force - { - $this->isCached = false; - - /** - * create subfolder if needed - */ - if( ! file_exists( dirname($this->output_file) ) ) - { - if( ! @mkdir( dirname($this->output_file) ) ) - { - $this->error_msg = "Cannot create folder ".dirname($this->output_file)." check permissions!"; - return false; - } - } - } - - /** - * use imagemagick or gdlib - */ - if($GLOBALS['linpha']->sql->config->value['sys_im_use_imagemagick']) - { - $this->image_tool = 'imagemagick'; - $this->imagemagick_path = $GLOBALS['linpha']->sql->config->value['sys_im_imagemagick_path']; - } - else - { - $this->image_tool = 'gdlib'; - } - - return true; -} - +/** + * set source file informations + * + * @todo save values to database and read from there + */ function setSourceFileInformation() { - /** - * set source file informations - */ if($this->img_type != 0 && $this->img_type != 9999999) { $this->src_file = LinSql::getFullImagePath( $this->photo_id ); @@ -583,7 +585,13 @@ */ function printFileToScreen() { - Header("Content-type: image/jpeg"); + header("Content-type: image/jpeg"); + + /** + * show correct image filename wenn selecting "save as" in browser + * it works on firefox, but it does not on my IE + */ + header("Content-Disposition: inline; filename=".basename($this->src_file).";" ); readfile( $this->output_file ); } Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -430,19 +430,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="'.LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/download.png" border="0" title="'.i18n("Download Images").'" />' + '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/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="'.LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/print.png" border="0" title="'.i18n("Print Images").'" />' + '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/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="'.LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/slideshow.png" border="0" title="'.i18n("Mail Images").'" />' + '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/slideshow.png" border="0" title="'.i18n("Mail Images").'" />' .'</a>'."\n"; } /** @@ -450,7 +450,7 @@ */ 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").'" />' + '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/slideshow.png" border="0" title="'.i18n("Play Slideshow").'" />' .'</a>'."\n"; } @@ -463,19 +463,19 @@ if( $GLOBALS['linpha']->sql->checkPermission('download')) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.LINPHA_DIR.'/download_file.php?id='.$this->id_current.'">'. - '<img src="'.LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/download.png" border="0" title="'.i18n("Download Image").'" />' + '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/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="'.LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/print.png" border="0" title="'.i18n("Print Image").'" />' + '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/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="'.LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/slideshow.png" border="0" title="'.i18n("Mail Image").'" />' + '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/slideshow.png" border="0" title="'.i18n("Mail Image").'" />' .'</a>'."\n"; } @@ -484,7 +484,7 @@ */ 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").'" />' + '<img src="'.$GLOBALS['linpha']->template->layoutsimagespath.'/slideshow.png" border="0" title="'.i18n("Play Slideshow").'" />' .'</a>'."\n"; } } @@ -1130,8 +1130,8 @@ */ $this->src_file = LinSql::getFullImagePath( $this->id_current ); list($this->org_width,$this->org_height,$org_type) = LinIdentify::linGetImageSize( $this->src_file ); - $this->max_width = $GLOBALS['linpha']->sql->config->value['sys_style_image_size']; - $this->max_height = $GLOBALS['linpha']->sql->config->value['sys_style_image_size']; + $this->max_width = $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; + $this->max_height = $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; $array = LinImage::scaleToFit($this->org_width,$this->org_height,$this->max_width,$this->max_height); $this->img_width = $array['w']; $this->img_height = $array['h']; Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -24,7 +24,9 @@ */ class LinTemplate { - public $template_name; + public $template_name, $layout_name; + public $layoutimagespath; + public $bgcolor, $bodybgcolor; public $output; public $URL_base, $URL_full; @@ -35,7 +37,14 @@ function __construct() { $this->template_name = 'default'; + $this->layout_name = 'default'; + $this->bgcolor = '87cefa'; // without '#' + $this->bodybgcolor = 'dddddd'; // without '#' $this->linpha_title = "Linpha 2.0"; + + + $this->layoutsimagespath = LINPHA_DIR.'/templates/'.$this->template_name.'/layouts/'.$this->layout_name.'/images'; + } /** @@ -54,7 +63,8 @@ */ ?> <!-- css includes --> -<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/css/global.css'; ?>' type='text/css'> +<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/backgroundcolor.php?bgcolor='.$this->bgcolor.'&bodybgcolor='.$this->bodybgcolor; ?>' type='text/css'> +<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/layouts/'.$this->layout_name.'/css/global.css'; ?>' type='text/css'> <link rel='stylesheet' href='<?php $this->includeFile('css'); ?>' type='text/css'> <!-- IE hack for the menu--> <!--[if IE]> @@ -93,7 +103,7 @@ $filename = LINPHA_DIR.'/templates/'.$this->template_name.'/'.$this->head_name.'.head.php'; break; case 'css': - echo LINPHA_DIR.'/templates/'.$this->template_name.'/css/'.$this->css_name.'.css'; + echo LINPHA_DIR.'/templates/'.$this->template_name.'/layouts/'.$this->layout_name.'/css/'.$this->css_name.'.css'; break; } @@ -195,7 +205,20 @@ echo '</ul>'."\n"; } } - + + function divRoundCorners($top_bottom) + { + if($top_bottom == 'top') + { + $str = '<div class="roundtop"><img src="'.LINPHA_DIR.'/templates/roundcorners.php?color='.$this->bgcolor.'&bgcolor='.$this->bodybgcolor.'&size=15&align=tl" alt="" width="15" height="15" class="corner" style="display: none" /></div>'; + } + elseif($top_bottom == 'bottom') + { + $str = '<div class="roundbottom"><img src="'.LINPHA_DIR.'/templates/roundcorners.php?color='.$this->bgcolor.'&bgcolor='.$this->bodybgcolor.'&size=15&align=bl" alt="" width="15" height="15" class="corner" style="display: none" /></div>'; + } + + return $str; + } } // end class linTemplate ?> \ No newline at end of file Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/lib/js/LinImage.js 2006-10-26 21:53:15 UTC (rev 4596) @@ -205,11 +205,11 @@ // // showImage() - // Display image and begin preloading images. + // Display image and begin preloading next images. // showImage: function(){ Element.hide('divloading'); - new Effect.Appear('mainImage', { duration: 0.5, afterFinish: function(){ myLinImage.setImageInfoLink(); } }); + new Effect.Appear('mainImage', { duration: 0.5, afterFinish: function(){ myLinImage.setImageData(); } }); if(! fullscreenActive) { $('divimage').style.height = $('mainImage').style.height; // reset to correct height to prevent trouble if image is bigger or smaller @@ -217,13 +217,13 @@ this.enableKeyboardNav(); - this.setImageData(); - this.preloadXml(); }, setImageData: function() { + this.setImageInfoLink(); + /** * set title */ @@ -322,6 +322,12 @@ */ $('divSlideshowImgNr').innerHTML = xmlDoc[curImgId].getElementsByTagName('imgnr').item(0).firstChild.data; + + /** + * and at least, start preloading images + */ + this.preloadXml(); + }, // end function setImageData() @@ -385,11 +391,11 @@ keycode = e.which; } - if( e.ctrlKey ) + /*if( e.ctrlKey ) { alert('ctrl pressed'); return; - } + }*/ key = String.fromCharCode(keycode).toLowerCase(); Modified: trunk/linpha2/lib/js/LinThumbnails.js =================================================================== --- trunk/linpha2/lib/js/LinThumbnails.js 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/lib/js/LinThumbnails.js 2006-10-26 21:53:15 UTC (rev 4596) @@ -11,25 +11,6 @@ var nr_pages = 0; /** - * fine tuning - * better a space more than a space too less - */ -if(view_mode == 'thumbdetail') -{ - var img_spacer_width = 150 + 28; // used to calculate nr_cols, 200 = width of text div, 25 = overhead - var img_spacer_height = 10; // used to calculate nr_rows - var img_div_spacer_height = 0; // used to calculate max-height of the image (depending how much text we would like to add at bottom) -} -else // 'thumb' -{ - var img_spacer_width = 12; // used to calculate nr_cols - var img_spacer_height = 11; // used to calculate nr_rows - var img_div_spacer_height = 11; // used to calculate max-height of the image (depending how much text we would like to add at bottom) -} - - - -/** * page numbers */ var pn_left = 3; @@ -121,7 +102,7 @@ } if(view_mode == 'thumbdetail') { - var style2text = ' style="float: left;"'; + var style2text = ' divimgdetail'; } else { var style2text = ''; } @@ -129,7 +110,7 @@ divhtmltext += '<div id="div' + i + '"' + styletext + ' class="divthumb">' + - img_ids[i]['before'] + '<div class="divimg"' + style2text + '>' + + img_ids[i]['before'] + '<div class="divimg' + style2text + '">' + '<a href="' + link_url + '&id=' + img_ids[i]['id'] + '">' + '<img src="' + link_get_thumb + img_ids[i]['id'] + '"' + ' height="' + tn_size + '" width="' + tn_size + '" ' + Modified: trunk/linpha2/templates/default/basket.html.php =================================================================== --- trunk/linpha2/templates/default/basket.html.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/basket.html.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -1,7 +1,7 @@ <div id="divnavigation"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="navigation"> @@ -166,14 +166,14 @@ </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> <div id="divmain"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="main"> @@ -211,7 +211,7 @@ </form> <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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> Added: trunk/linpha2/templates/default/colorsettings.php =================================================================== --- trunk/linpha2/templates/default/colorsettings.php (rev 0) +++ trunk/linpha2/templates/default/colorsettings.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -0,0 +1,71 @@ +<?php +header("Content-Type: text/css"); + +/* + * Created on 26.10.2006 + * + * To change the template for this generated file go to + * Window - Preferences - PHPeclipse - PHP - Code Templates + */ +?> + +/** + * background color + * #divthumbnavi amd #divSlideshowControlsInner used in view_img.html.php + */ + body { + background-color: #<?php echo $_GET['bodybgcolor']; ?>; + } + + #divleft, #divmain, #divright, #divthumbnavi, #divnavigation, #divSlideshowControlsInner, .roundAlphabottomInner { + background-color: #<?php echo $_GET['bgcolor']; ?>; + } + +/** + * rounded corner stuff + */ + .roundtop { + background: url(../roundcorners.php?color=<?php echo $_GET['bgcolor']; ?>&bgcolor=<?php echo $_GET['bodybgcolor']; ?>&size=15&align=tr) no-repeat top right; + } + + .roundbottom { + background: url(../roundcorners.php?color=<?php echo $_GET['bgcolor']; ?>&bgcolor=<?php echo $_GET['bodybgcolor']; ?>&size=15&align=br) no-repeat top right; + } + + img.corner { + width: 15px; + height: 15px; + border: none; + display: block !important; + } + + .roundAlphatop { + position: relative; + /*background: url(../images/tr_alpha.gif) no-repeat top right;*/ + background: url(../roundcorners.php?color=<?php echo $_GET['bgcolor']; ?>&alpha&size=15&align=tr) no-repeat top right; + } + + .roundAlphabottom { + position: relative; + /*background: url(../images/br_alpha.gif) no-repeat top right;*/ + background: url(../roundcorners.php?color=<?php echo $_GET['bgcolor']; ?>&alpha&size=15&align=br) 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/filemanager.html.php =================================================================== --- trunk/linpha2/templates/default/filemanager.html.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/filemanager.html.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -1,6 +1,6 @@ <div id="divmain"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="main"> @@ -14,6 +14,6 @@ </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/home.html.php =================================================================== --- trunk/linpha2/templates/default/home.html.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/home.html.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -1,7 +1,5 @@ <div id="divmain"> - <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="main"> @@ -84,7 +82,5 @@ <?php } ?> </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> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Added: trunk/linpha2/templates/default/layouts/default/DefsThumbView.js =================================================================== --- trunk/linpha2/templates/default/layouts/default/DefsThumbView.js (rev 0) +++ trunk/linpha2/templates/default/layouts/default/DefsThumbView.js 2006-10-26 21:53:15 UTC (rev 4596) @@ -0,0 +1,18 @@ +/** + * fine tuning for thumb view + * maybe template specific -> place in a separate file + * + * better a space more than a space too less + */ +if(view_mode == 'thumbdetail') +{ + var img_spacer_width = 150 + 28; // used to calculate nr_cols, 150 = width of text div, 28 = overhead + var img_spacer_height = 10; // used to calculate nr_rows + var img_div_spacer_height = 0; // used to calculate max-height of the image (depending how much text we would like to add at bottom) +} +else // 'thumb' +{ + var img_spacer_width = 12; // used to calculate nr_cols + var img_spacer_height = 11; // used to calculate nr_rows + var img_div_spacer_height = 11; // used to calculate max-height of the image (depending how much text we would like to add at bottom) +} \ No newline at end of file Modified: trunk/linpha2/templates/default/layouts/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/layouts/default/css/global.css 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/layouts/default/css/global.css 2006-10-26 21:53:15 UTC (rev 4596) @@ -22,14 +22,6 @@ } /** - * background color - * #divthumbnavi amd #divSlideshowControls used in view_img.html.php - */ - #divleft, #divmain, #divright, #divthumbnavi, #divnavigation, #divSlideshowControlsInner, .roundAlphabottomInner { - background-color: #f90; - } - - /** * link button */ .button, a.button { @@ -288,51 +280,4 @@ */ -/** - * rounded corner stuff - */ - .roundtop { - background: url(../images/tr.gif) no-repeat top right; - } - - .roundbottom { - background: url(../images/br.gif) no-repeat top right; - } - - img.corner { - width: 15px; - height: 15px; - border: none; - 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/search.html.php =================================================================== --- trunk/linpha2/templates/default/search.html.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/search.html.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -27,7 +27,7 @@ ?> <div id="divmain"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="main"> @@ -95,7 +95,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 LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/expand.gif'; ?>" /></a> + <a href="javascript:div_expand('div_<?php echo $meta_type; ?>');"><img border="0" src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/expand.gif'; ?>" /></a> <br /> <div id="div_<?php echo $meta_type; ?>" style="border: 1px solid black; width: 200px;"> <?php @@ -230,7 +230,7 @@ </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> Modified: trunk/linpha2/templates/default/settings.html.php =================================================================== --- trunk/linpha2/templates/default/settings.html.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/settings.html.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -1,6 +1,6 @@ <div id="divmain"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="main"> @@ -14,6 +14,6 @@ </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_albcomment.html.php =================================================================== --- trunk/linpha2/templates/default/view_albcomment.html.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/view_albcomment.html.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -1,6 +1,6 @@ <div id="divmain"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="main"> @@ -18,6 +18,6 @@ </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_basket.html.php =================================================================== --- trunk/linpha2/templates/default/view_basket.html.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/view_basket.html.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -1,6 +1,6 @@ <div id="divnavigation"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="navigation"> @@ -19,13 +19,13 @@ </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> <div id="divmain"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="divpage_nr"> @@ -121,6 +121,6 @@ </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_img.html.php =================================================================== --- trunk/linpha2/templates/default/view_img.html.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/view_img.html.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -6,7 +6,7 @@ <div id="divthumbnavi"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="thumbnavi"> @@ -16,13 +16,13 @@ </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> <div id="divmain"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="main"> <div id="divloading"> @@ -72,7 +72,7 @@ </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> @@ -119,7 +119,7 @@ </div> <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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/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-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/view_img_static.html.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -7,7 +7,7 @@ <div id="divthumbnavi"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="thumbnavi"> @@ -21,13 +21,13 @@ </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> <div id="divmain"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="main"> <?php if($_SESSION['mode_imageview']=='meta') { ?> @@ -88,13 +88,13 @@ </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> <div id="divright"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="right"> <?php @@ -105,6 +105,6 @@ ?> </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_thumb.head.php =================================================================== --- trunk/linpha2/templates/default/view_thumb.head.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/view_thumb.head.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -10,5 +10,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/'.$GLOBALS['linpha']->template->template_name.'/layouts/'.$GLOBALS['linpha']->template->layout_name.'/DefsThumbView.js'; ?>"></script> <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/LinThumbnails.js"></script> -<script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/LinThumbnails.js"></script> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_thumb.html.php =================================================================== --- trunk/linpha2/templates/default/view_thumb.html.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/view_thumb.html.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -9,13 +9,13 @@ <?php if(isset($GLOBALS['linpha']->template->output['navigation']) && !empty($GLOBALS['linpha']->template->output['navigation'])) { ?> <div id="divnavigation"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="navigation"> <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> <?php } ?> @@ -25,7 +25,7 @@ <div id="divmain"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="divpage_nr"> @@ -42,7 +42,7 @@ <div style="clear: both;"></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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> Modified: trunk/linpha2/templates/default/view_thumb_static.html.php =================================================================== --- trunk/linpha2/templates/default/view_thumb_static.html.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/view_thumb_static.html.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -3,13 +3,13 @@ <?php if(isset($GLOBALS['linpha']->template->output['navigation']) && !empty($GLOBALS['linpha']->template->output['navigation'])) { ?> <div id="divnavigation"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="navigation"> <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> <?php } ?> @@ -19,7 +19,7 @@ <div id="divmain"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="divpage_nr"> @@ -57,6 +57,6 @@ </div> <div style="clear: both;"></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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_thumbdetail.html.php =================================================================== --- trunk/linpha2/templates/default/view_thumbdetail.html.php 2006-10-26 19:07:33 UTC (rev 4595) +++ trunk/linpha2/templates/default/view_thumbdetail.html.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -10,13 +10,13 @@ <?php if(isset($GLOBALS['linpha']->template->output['navigation']) && !empty($GLOBALS['linpha']->template->output['navigation'])) { ?> <div id="divnavigation"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="navigation"> <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> <?php } ?> @@ -25,7 +25,7 @@ <div id="divmain"> <div class="roundtop"> - <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> <div id="main"> @@ -65,6 +65,6 @@ </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" /> + <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> </div> </div> \ No newline at end of file Added: trunk/linpha2/templates/roundcorners.php =================================================================== --- trunk/linpha2/templates/roundcorners.php (rev 0) +++ trunk/linpha2/templates/roundcorners.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -0,0 +1,119 @@ +<?php +if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } + +/** + * @todo force cache on + */ + + +include_once( LINPHA_DIR.'/lib/plugins/watermark/func.watermark.php' ); + +if(!isset($_GET['color'])) +{ + $_GET['color'] = 'orange'; +} + +if(!isset($_GET['bgcolor'])) +{ + $_GET['bgcolor'] = 'white'; +} + +if(!isset($_GET['align'])) +{ + $_GET['align'] = 'tl'; +} + +if(!isset($_GET['size'])) +{ + $size = 15; +} +else +{ + $size = $_GET['size']; +} + +switch($_GET['align']) +{ +case 'tl': $cx = $size; $cy = $size; $workaround = 0; break; +case 'tr': $cx = -1; $cy = $size; $workaround = 0; break; +case 'bl': $cx = $size; $cy = 0; $workaround = 1; break; +case 'br': $cx = -1; $cy = -1; $workaround = 1; break; +} + +// create image +$image = imagecreatetruecolor($size, $size); + +// create colors +$rgb = get_rgb_from_all($_GET['color']); +$color = imagecolorallocate($image, $rgb['r'], $rgb['g'], $rgb['b']); + +if(isset($_GET['alpha'])) +{ + imageAlphaBlending($image, false); + imageSaveAlpha($image, true); + $bgcolor = imagecolorallocatealpha($image, 0, 0, 0, 127); +} +else +{ + $rgb = get_rgb_from_all($_GET['bgcolor']); + $bgcolor = imagecolorallocate($image, $rgb['r'], $rgb['g'], $rgb['b']); +} + +// fill image with background color +imagefill($image, 0, 0, $bgcolor); + + +// draw circly +imagefilledellipse($image, $cx, $cy, ($size*2), ($size*2), $color); + +// workaround +if($workaround) +{ + imageline($image, 0, 0, $size-1, 0, $color ); +} + + +// flush image +header('Content-type: image/png'); +imagepng($image); +imagedestroy($image); + + + +/* +$size = 300; +$image=imagecreatetruecolor($size, $size); + +// something to get a white background with black border +$back = imagecolorallocate($image, 255, 255, 255); +$border = imagecolorallocate($image, 0, 0, 0); +imagefilledrectangle($image, 0, 0, $size - 1, $size - 1, $back); +imagerectangle($image, 0, 0, $size - 1, $size - 1, $border); + +$yellow_x = 100; +$yellow_y = 75; +$red_x = 120; +$red_y = 165; +$blue_x = 187; +$blue_y = 125; +$radius = 150; + +// allocate colors with alpha values +$yellow = imagecolorallocatealpha($image, 255, 255, 0, 75); +$red = imagecolorallocatealpha($image, 255, 0, 0, 75); +$blue = imagecolorallocatealpha($image, 0, 0, 255, 127); + +// drawing 3 overlapped circle +imagefilledellipse($image, $yellow_x, $yellow_y, $radius, $radius, $yellow); +imagefilledellipse($image, $red_x, $red_y, $radius, $radius, $red); +imagefilledellipse($image, $blue_x, $blue_y, $radius, $radius, $blue); + +// don't forget to output a correct header! +header('Content-type: image/png'); + +// and finally, output the result +imagepng($image); +imagedestroy($image); +*/ + +?> \ No newline at end of file Added: trunk/linpha2/templates/roundcorners_test.php =================================================================== --- trunk/linpha2/templates/roundcorners_test.php (rev 0) +++ trunk/linpha2/templates/roundcorners_test.php 2006-10-26 21:53:15 UTC (rev 4596) @@ -0,0 +1,23 @@ +<body style="background: blue;"> + +<img src="roundcorners.php?align=tl" /><br /><br /> +<img src="roundcorners.php?align=tr" /><br /><br /> +<img src="roundcorners.php?align=bl" /><br /><br /> +<img src="roundcorners.php?align=br" /><br /><br /> + +<img src="roundcorners.php?align=tl&alpha" /><br /><br /> +<img src="roundcorners.php?align=tr&alpha" /><br /><br /> +<img src="roundcorners.php?align=bl&alpha" /><br /><br /> +<img src="roundcorners.php?align=br&alpha" /><br /><br /> + +<img src="roundcorners.php?align=tl&size=100&color=pink" /><br /><br /> +<img src="roundcorners.php?align=tr&size=75&color=skyblue" /><br /><br /> +<img src="roundcorners.php?align=bl&size=50&color=gray" /><br /><br /> +<img src="roundcorners.php?align=br&size=25&color=red" /><br /><br /> + +<img src="roundcorners.php?align=tl&size=100&color=pink&alpha" /><br /><br /> +<img src="roundcorners.php?align=tr&size=75&color=skyblue&alpha" /><br /><br /> +<img src="roundcorners.php?align=bl&size=50&color=gray&alpha" /><br /><br /> +<img src="roundcorners.php?align=br&size=25&color=red&alpha" /><br /><br /> + +</body> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2006-10-27 19:28:45
|
Revision: 4597 http://svn.sourceforge.net/linpha/?rev=4597&view=rev Author: fangehrn Date: 2006-10-27 12:28:12 -0700 (Fri, 27 Oct 2006) Log Message: ----------- 2006-10-27 flo * working on admin settings need to reset database Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/settings_layout.php trunk/linpha2/index.php trunk/linpha2/install/sql/sql.data.php trunk/linpha2/lib/classes/linpha.admin.class.php trunk/linpha2/lib/classes/linpha.class.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.template.class.php trunk/linpha2/templates/default/colorsettings.php trunk/linpha2/templates/default/layouts/default/css/global.css Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-26 21:53:15 UTC (rev 4596) +++ trunk/linpha2/ChangeLog 2006-10-27 19:28:12 UTC (rev 4597) @@ -1,3 +1,7 @@ +2006-10-27 flo + * working on admin settings + need to reset database + 2006-10-26 flo * playing around with different style colors, currently a blue one... * created gdlib script which will generate the nice round corners on the fly Modified: trunk/linpha2/admin/settings_layout.php =================================================================== --- trunk/linpha2/admin/settings_layout.php 2006-10-26 21:53:15 UTC (rev 4596) +++ trunk/linpha2/admin/settings_layout.php 2006-10-27 19:28:12 UTC (rev 4597) @@ -7,6 +7,7 @@ } $array_menu = Array( + 'layout' => Array('name' => 'Layout', 'link' => 'settings_layout_layout'), 'home' => Array('name' => 'Home Site', 'link' => 'settings_layout_home'), 'thumb' => Array('name' => 'Thumb View', 'link' => 'settings_layout_thumb'), 'image' => Array('name' => 'Image View', 'link' => 'settings_layout_image'), @@ -21,6 +22,30 @@ switch($cat3) { +case 'layout': + + if(isset($_POST['cmd']) && $_POST['cmd']=='saveconfig') + { + $LinAdmin->saveConfig(Array( + 'sys_style_layout_title', + 'sys_style_layout_template', + 'sys_style_layout_layout', + 'sys_style_layout_bodybgcolor', + 'sys_style_layout_elembgcolor', + 'sys_style_layout_fontcolor' + )); + } + + print_r(LinAdmin::getTemplates()); + + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_title'),'sys_style_layout_title',$LinAdmin->option_value_system['sys_style_layout_title']); + $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_template'),'sys_style_layout_template',$LinAdmin->option_value_system['sys_style_layout_template'],LinAdmin::getTemplates()); + $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_layout'),'sys_style_layout_layout',$LinAdmin->option_value_system['sys_style_layout_layout'],LinAdmin::getThemes($LinAdmin->option_value_system['sys_style_layout_template'])); + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_bodybgcolor'),'sys_style_layout_bodybgcolor',$LinAdmin->option_value_system['sys_style_layout_bodybgcolor']); + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_elembgcolor'),'sys_style_layout_elembgcolor',$LinAdmin->option_value_system['sys_style_layout_elembgcolor']); + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_fontcolor'),'sys_style_layout_fontcolor',$LinAdmin->option_value_system['sys_style_layout_fontcolor']); + + break; case 'home': $welcometxt = i18n("Add Your Own Welcome Text Here"); $data = $GLOBALS['linpha']->db->GetRow("SELECT meta_comment FROM ".PREFIX."meta_comments WHERE md5sum='welcometext'"); Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-10-26 21:53:15 UTC (rev 4596) +++ trunk/linpha2/index.php 2006-10-27 19:28:12 UTC (rev 4597) @@ -9,6 +9,7 @@ include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); $linpha = new Linpha(); $linpha->sql->startSession(); + $linpha->template = new linTemplate(); include_once(LINPHA_DIR.'/lib/include/integrity.php'); include_once(LINPHA_DIR.'/lib/include/upgrade.php'); Modified: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2006-10-26 21:53:15 UTC (rev 4596) +++ trunk/linpha2/install/sql/sql.data.php 2006-10-27 19:28:12 UTC (rev 4597) @@ -27,6 +27,7 @@ */ $options = array( 'sys_db_version' => '2', + 'sys_im_bracket_support' => $_SESSION['sys_im_bracket_support'], 'sys_im_imagemagick_path' => $_SESSION['sys_im_convert_path'], 'sys_im_use_imagemagick' => $_SESSION['sys_im_use_convert'], @@ -48,10 +49,9 @@ '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_datetime_dates' => '%a %m/%d/%Y', + 'sys_style_datetime_times' => '%I:%M:%S %p', + 'sys_style_home_showbrowsebydate' => '1', 'sys_style_home_nrrandomimages' => '4', 'sys_style_home_newimagesnr' => '4', @@ -59,6 +59,7 @@ 'sys_style_home_showalbums' => '1', 'sys_style_home_usedefaultwelcometext' => '1', 'sys_style_home_firstsortorder' => 'nameasc', + 'sys_style_thumb_size_max' => '200', 'sys_style_thumb_size_display' => '150', 'sys_style_thumb_showsubfoldersseparate' => '0', @@ -66,11 +67,22 @@ 'sys_style_thumb_selectnrimages' => 'auto,10,25,50,100,200,all', 'sys_style_thumb_nojsnrrows' => '3', 'sys_style_thumb_nojsnrcols' => '4', + 'sys_style_image_quality' => '75', 'sys_style_image_width' => '700', 'sys_style_image_height' => '525', 'sys_style_image_nrprevnextthumbs' => '3', + 'sys_style_layout_bodybgcolor' => 'dddddd', + 'sys_style_layout_elembgcolor' => '87cefa', + 'sys_style_layout_fontcolor' => '000000', + 'sys_style_layout_layout' => 'default', + 'sys_style_layout_template' => 'default', + 'sys_style_layout_title' => 'Linpha 2.0', + + 'sys_style_others_sortorder' => 'nameasc', + + 'sys_user_autologin' => '1', 'plugins_filemanager_enable' => '0', @@ -80,7 +92,7 @@ $options_user_overridable = Array( 'sys_lang', 'sys_lang_autolang', - 'sys_style_sortorder', + 'sys_style_others_sortorder', 'sys_style_template', 'sys_style_home_showbrowsebydate', 'sys_style_home_nrrandomimages', Modified: trunk/linpha2/lib/classes/linpha.admin.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.admin.class.php 2006-10-26 21:53:15 UTC (rev 4596) +++ trunk/linpha2/lib/classes/linpha.admin.class.php 2006-10-27 19:28:12 UTC (rev 4597) @@ -48,21 +48,31 @@ 'sys_image_exif' => "Use EXIF", 'sys_image_iptc' => "Use IPTC", 'sys_image_xmp' => "Use XMP", + 'sys_lang' => "Language", + 'sys_lang_autolang' => "Autodetection of language", + 'sys_style_home_nrrandomimages' => "Nr Of Random Images (0 to disable)", 'sys_style_home_showbrowsebydate' => "Show Browse By Date", 'sys_style_home_showalbums' => "Show Albums On Home Site", 'sys_style_home_firstsortorder' => "Sort Order Of First Level Albums", - 'sys_style_thumb_showsubfoldersseparate' => "Show Subfolders Separate", + 'sys_style_image_nrprevnextthumbs' => "Nr Of Previous/Next Thumbnails", - 'sys_lang' => "Language", - 'sys_lang_autolang' => "Autodetection of language", 'sys_style_image_width' => "Max Image Width", 'sys_style_image_height' => "Max Image Height", - 'sys_style_sortorder' => "Sort order", - 'sys_style_template' => "Template", + + 'sys_style_thumb_showsubfoldersseparate' => "Show Subfolders Separate", 'sys_style_thumb_nojsnrcols' => "Nr Cols if Javascript deactivated", 'sys_style_thumb_nojsnrrows' => "Nr Rows if Javascript deactivated", - 'sys_style_thumb_size_display' => "Thumb size" + 'sys_style_thumb_size_display' => "Thumb size", + + 'sys_style_others_sortorder' => "Sort order", + + 'sys_style_layout_title' => "Linpha Title", + 'sys_style_layout_template' => "Template", + 'sys_style_layout_layout' => "Layout", + 'sys_style_layout_bodybgcolor' => "Main Background Color", + 'sys_style_layout_elembgcolor' => "Elements Background Color", + 'sys_style_layout_fontcolor' => "Fonts Color" ); } @@ -304,6 +314,34 @@ } } +function getTemplates() +{ + $templatesdir = LINPHA_DIR."/templates/"; + + $file_handle = opendir($templatesdir); + $all_themes = array(); + + while( ($file = readdir($file_handle)) !== false ) + { + echo $file.'<br />'; + if(is_dir($templatesdir.$file)) + { + $all_themes[$file] = $file; + } + } + + closedir($file_handle); + + /* Sort theme files aphabetically */ + asort($all_themes); + + return $all_themes; +} + +function getThemes($template) +{ +} + } // end class LinAdmin ?> \ No newline at end of file Modified: trunk/linpha2/lib/classes/linpha.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.class.php 2006-10-26 21:53:15 UTC (rev 4596) +++ trunk/linpha2/lib/classes/linpha.class.php 2006-10-27 19:28:12 UTC (rev 4597) @@ -65,7 +65,6 @@ function __construct() { $this->sql = new linSql(); - $this->template = new linTemplate(); } } // end class Linpha Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-10-26 21:53:15 UTC (rev 4596) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-10-27 19:28:12 UTC (rev 4597) @@ -575,7 +575,7 @@ function getDateFormat() { if( i18n('special_date_format') == 'special_date_format') { - return $GLOBALS['linpha']->sql->config->value['sys_style_dates']; + return $GLOBALS['linpha']->sql->config->value['sys_style_datetime_dates']; } else { return i18n('special_date_format'); } @@ -593,7 +593,7 @@ function getTimeFormat() { if( i18n('special_time_format') == 'special_time_format') { - return $GLOBALS['linpha']->sql->config->value['sys_style_times']; + return $GLOBALS['linpha']->sql->config->value['sys_style_datetime_times']; } else { return i18n('special_time_format'); } Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-26 21:53:15 UTC (rev 4596) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-27 19:28:12 UTC (rev 4597) @@ -50,7 +50,7 @@ */ function setCurrentView($modulename) { - $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_sortorder']); + $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_others_sortorder']); if(isset($_GET['id']) && $_GET['id'] != 0) { Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-26 21:53:15 UTC (rev 4596) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-27 19:28:12 UTC (rev 4597) @@ -36,11 +36,12 @@ function __construct() { - $this->template_name = 'default'; - $this->layout_name = 'default'; - $this->bgcolor = '87cefa'; // without '#' - $this->bodybgcolor = 'dddddd'; // without '#' - $this->linpha_title = "Linpha 2.0"; + $this->template_name = $GLOBALS['linpha']->sql->config->value['sys_style_template']; + $this->layout_name = $GLOBALS['linpha']->sql->config->value['sys_style_layout']; + $this->bgcolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_elembgcolor']; + $this->bodybgcolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_bodybgcolor']; + $this->fontcolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_fontcolor']; + $this->linpha_title = $GLOBALS['linpha']->sql->config->value['sys_style_layout_title']; $this->layoutsimagespath = LINPHA_DIR.'/templates/'.$this->template_name.'/layouts/'.$this->layout_name.'/images'; @@ -63,7 +64,7 @@ */ ?> <!-- css includes --> -<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/backgroundcolor.php?bgcolor='.$this->bgcolor.'&bodybgcolor='.$this->bodybgcolor; ?>' type='text/css'> +<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/colorsettings.php?bgcolor='.$this->bgcolor.'&bodybgcolor='.$this->bodybgcolor.'&fontcolor='.$this->fontcolor; ?>' type='text/css'> <link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/layouts/'.$this->layout_name.'/css/global.css'; ?>' type='text/css'> <link rel='stylesheet' href='<?php $this->includeFile('css'); ?>' type='text/css'> <!-- IE hack for the menu--> Modified: trunk/linpha2/templates/default/colorsettings.php =================================================================== --- trunk/linpha2/templates/default/colorsettings.php 2006-10-26 21:53:15 UTC (rev 4596) +++ trunk/linpha2/templates/default/colorsettings.php 2006-10-27 19:28:12 UTC (rev 4597) @@ -22,6 +22,13 @@ } /** + * font color + */ + body { + color: #<?php echo $_GET['fontcolor']; ?>; + } + +/** * rounded corner stuff */ .roundtop { @@ -32,13 +39,6 @@ background: url(../roundcorners.php?color=<?php echo $_GET['bgcolor']; ?>&bgcolor=<?php echo $_GET['bodybgcolor']; ?>&size=15&align=br) no-repeat top right; } - img.corner { - width: 15px; - height: 15px; - border: none; - display: block !important; - } - .roundAlphatop { position: relative; /*background: url(../images/tr_alpha.gif) no-repeat top right;*/ @@ -49,23 +49,4 @@ position: relative; /*background: url(../images/br_alpha.gif) no-repeat top right;*/ background: url(../roundcorners.php?color=<?php echo $_GET['bgcolor']; ?>&alpha&size=15&align=br) 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/layouts/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/layouts/default/css/global.css 2006-10-26 21:53:15 UTC (rev 4596) +++ trunk/linpha2/templates/default/layouts/default/css/global.css 2006-10-27 19:28:12 UTC (rev 4597) @@ -205,7 +205,7 @@ text-decoration: none; color: #000000; - background: #FFFFFF; + /*background: #FFFFFF;*/ } /** @@ -240,7 +240,7 @@ } #menu ul span { - background: #ffffff url(../images/expand.gif) no-repeat 100% 100%; + background: url(../images/expand.gif) no-repeat 100% 100%; } #menu ul ul span { background: #eeeeee url(../images/expand.gif) no-repeat 100% 100%; @@ -279,5 +279,33 @@ * end menu */ +/** + * round corners stuff + * (the color and image settings are in the file "colorsettings.php" + */ + img.corner { + width: 15px; + height: 15px; + border: none; + display: block !important; + } + + .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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2006-10-27 21:11:34
|
Revision: 4603 http://svn.sourceforge.net/linpha/?rev=4603&view=rev Author: fangehrn Date: 2006-10-27 14:10:23 -0700 (Fri, 27 Oct 2006) Log Message: ----------- 2006-10-27 flo * working on admin settings need to reset database * finished setting colors through admin settings Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/index.php trunk/linpha2/admin/permissions_readwrite.php trunk/linpha2/admin/settings_layout.php trunk/linpha2/install/sql/sql.data.php trunk/linpha2/lib/classes/linpha.admin.class.php trunk/linpha2/lib/classes/linpha.template.class.php trunk/linpha2/lib/modules/module.filemanager.php trunk/linpha2/lib/plugins/watermark/func.watermark.php trunk/linpha2/templates/default/basket.html.php trunk/linpha2/templates/default/search.html.php trunk/linpha2/templates/default/settings.html.php trunk/linpha2/templates/default/themes/default/css/admin.css trunk/linpha2/templates/default/view_albcomment.html.php trunk/linpha2/templates/default/view_basket.html.php trunk/linpha2/templates/default/view_img.html.php trunk/linpha2/templates/default/view_img_static.html.php trunk/linpha2/templates/default/view_thumb.head.php trunk/linpha2/templates/default/view_thumb.html.php trunk/linpha2/templates/default/view_thumb_static.html.php trunk/linpha2/templates/default/view_thumbdetail.html.php trunk/linpha2/templates/roundcorners.php Removed Paths: ------------- trunk/linpha2/admin/admin.css Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/ChangeLog 2006-10-27 21:10:23 UTC (rev 4603) @@ -1,6 +1,8 @@ 2006-10-27 flo * working on admin settings need to reset database + + * finished setting colors through admin settings 2006-10-26 flo * playing around with different style colors, currently a blue one... Deleted: trunk/linpha2/admin/admin.css =================================================================== --- trunk/linpha2/admin/admin.css 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/admin/admin.css 2006-10-27 21:10:23 UTC (rev 4603) @@ -1,52 +0,0 @@ -form -{ - margin: 0; - padding: 0; -} - -.navlist -{ -padding: 3px 0; -margin-left: 0; -border-bottom: 1px solid #778; -font: bold 12px Verdana, sans-serif; -} - -.navlist li -{ -list-style: none; -margin: 0; -display: inline; -} - -.navlist li a -{ -padding: 3px 0.5em; -margin-left: 3px; -border: 1px solid #778; -border-bottom: none; -background: #DDE; -text-decoration: none; -} - -.navlist li a:link { color: #448; } -.navlist li a:visited { color: #667; } - -.navlist li a:hover -{ -color: #000; -background: #AAE; -border-color: #227; -} - -.navlist li a.current -{ -background: white; -border-bottom: 1px solid white; -} - - -.option_title -{ - font-weight: bold; -} \ No newline at end of file Modified: trunk/linpha2/admin/index.php =================================================================== --- trunk/linpha2/admin/index.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/admin/index.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -9,6 +9,7 @@ $linpha = new linpha(); $linpha->sql->startSession(); + $linpha->template = new linTemplate(); if(!$linpha->sql->isAdmin()) { @@ -21,13 +22,15 @@ include_once(LINPHA_DIR.'/lib/classes/linpha.admin.class.php'); $LinAdmin = new LinAdmin(); - /** - * @todo admin permission check + * output buffering, to use in template */ +ob_start(); + if( ! isset( $_GET['cat'] ) ) { + $_GET['cat'] = 'settings'; $cat1 = 'settings'; } else @@ -51,18 +54,20 @@ $cat4 = $array[3]; } } -?> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + + +/*<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel='stylesheet' href='<?php echo LINPHA_DIR.'/admin/admin.css'; ?>' type='text/css'> <link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/css/syslog.css'; ?>' type='text/css'> </head> -<body> +<body>*/ +?> <?php $array_menu = Array( - 'linpha_home' => Array('name' => 'Linpha Home', 'link' => 'linpha_home'), + //'linpha_home' => Array('name' => 'Linpha Home', 'link' => 'linpha_home'), 'settings' => Array('name' => 'Settings', 'link' => 'settings'), 'permissions' => Array('name' => 'Permissions', 'link' => 'permissions'), 'import' => Array('name' => 'Import', 'link' => 'import'), @@ -89,7 +94,7 @@ ?> -<?php if( isset($GLOBALS['linpha']->template->output['sys_log']) ) { ?> +<?php /*if( isset($GLOBALS['linpha']->template->output['sys_log']) ) { ?> <!-- syslog --> <div id="sys_log"> <div id="sys_log_close"><a href="javascript:toggleWindow()">X</a></div> @@ -99,7 +104,17 @@ </div> </div> <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/classes/syslog.js"> </script> -<?php } ?> +<?php } </body> -</html> \ No newline at end of file +</html> +*/ + +$linpha->template->output['default'] = ob_get_clean(); + +$linpha->template->setModuleName('default'); +$linpha->template->overrideModule('css','admin'); +$linpha->template->URL_full = LINPHA_DIR.'/admin/?cat='.$_GET['cat']; +$linpha->template->output['title'] = i18n("Admin"); +include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); +?> \ No newline at end of file Modified: trunk/linpha2/admin/permissions_readwrite.php =================================================================== --- trunk/linpha2/admin/permissions_readwrite.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/admin/permissions_readwrite.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -31,210 +31,211 @@ </form> <br /><hr /><br /> <?php - - if(! $GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable']) - { - exit(); - } } -/** - * save POST data - */ -if(isset($_POST['cmd']) && $_POST['cmd'] == 'save_permissions') +if($GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable']) { + /** - * insert or update + * save POST data */ - $query = $linpha->db->Execute("SELECT id FROM ".PREFIX."permissions " . - "WHERE photos_id = '".LinSql::linAddslashes($_POST['photo_id'])."' AND perm_type = '".$sql_perm_type."'"); - - /** - * if inherit is selected, delete if an entry exists - * and only if the photo_id != 0, because we can't delete - * the top permission entry!! - */ - if(isset($_POST['inherit'])) - { - if( ! $query->EOF && $_POST['photo_id'] != 0) + if(isset($_POST['cmd']) && $_POST['cmd'] == 'save_permissions') + { + /** + * insert or update + */ + $query = $linpha->db->Execute("SELECT id FROM ".PREFIX."permissions " . + "WHERE photos_id = '".LinSql::linAddslashes($_POST['photo_id'])."' AND perm_type = '".$sql_perm_type."'"); + + /** + * if inherit is selected, delete if an entry exists + * and only if the photo_id != 0, because we can't delete + * the top permission entry!! + */ + if(isset($_POST['inherit'])) { - $linpha->db->Execute("DELETE FROM ".PREFIX."permissions " . - "WHERE photos_id = '".LinSql::linAddslashes($_POST['photo_id'])."' " . - "AND perm_type = '".$sql_perm_type."'"); + if( ! $query->EOF && $_POST['photo_id'] != 0) + { + $linpha->db->Execute("DELETE FROM ".PREFIX."permissions " . + "WHERE photos_id = '".LinSql::linAddslashes($_POST['photo_id'])."' " . + "AND perm_type = '".$sql_perm_type."'"); + } } - } - else - { - if(isset($_POST['group'])) + else { - if(in_array('public',$_POST['group'])) + if(isset($_POST['group'])) { - $str_groups = 'public'; + if(in_array('public',$_POST['group'])) + { + $str_groups = 'public'; + } + else + { + $str_groups = implode(';',$_POST['group']); + } } else { - $str_groups = implode(';',$_POST['group']); + /** + * no group selected + * -> only admin has permissions + */ + $str_groups = ''; } + + if( ! $query->EOF ) + { + $linpha->db->Execute("UPDATE ".PREFIX."permissions SET permission = ';".LinSql::linAddslashes($str_groups).";' " . + "WHERE photos_id = '".LinSql::linAddslashes($_POST['photo_id'])."' AND perm_type = '".$sql_perm_type."'"); + } + else + { + $linpha->db->Execute("INSERT into ".PREFIX."permissions (photos_id, perm_type, permission) VALUES (" . + "'".LinSql::linAddslashes($_POST['photo_id'])."', '".$sql_perm_type."'," . + "';".LinSql::linAddslashes($str_groups).";' )"); + } } - else + } + + /** + * set parameters + */ + if(isset($_GET['parent_id']) && $_GET['parent_id'] != 0) + { + $parent_id = $_GET['parent_id']; + $view_mode = 'files'; + + $array = $GLOBALS['linpha']->sql->getFullFilenameFromId( LinSql::linAddslashes($parent_id) ); + + $parent_name = '<b>'.implode('/',$array).'</b>'; + $recursive = false; + } + else + { + $parent_id = 0; + $view_mode = 'folders'; + $parent_name = 'Top directory (default permission)'; + $recursive = true; + } + + /** + * get groups + */ + $array_groups = Array(); + $query = $GLOBALS['linpha']->db->Execute("SELECT id, group_name FROM ".PREFIX."groups WHERE group_name <> 'admin'"); + while($data = $query->FetchRow(ADODB_FETCH_NUM)) + { + $array_groups[$data[0]] = $data[1]; + } + + /** + * show edit/add permission dialog + */ + if(isset($_GET['cmd']) AND isset($_GET['id'])) + { + $checked = ''; + $array_perms = array(); + + /** + * check wether add or edit (insert or update) + */ + $query = $linpha->db->Execute("SELECT id FROM ".PREFIX."permissions " . + "WHERE photos_id = '".LinSql::linAddslashes($_GET['id'])."' AND perm_type = '".$sql_perm_type."'"); + + if( ! $query->EOF ) + { + list($stage, $perm) = $GLOBALS['linpha']->sql->getPerm( $_GET['id'], $sql_perm_type ); + $array_perms = explode(';',$perm); + + if(in_array('public',$array_perms)) { - /** - * no group selected - * -> only admin has permissions - */ - $str_groups = ''; + $checked = ' checked="checked"'; } + } - if( ! $query->EOF ) + $query = $GLOBALS['linpha']->db->Execute("SELECT name FROM ".PREFIX."photos " . + "WHERE id = '".LinSql::linAddslashes($_GET['id'])."'"); + $data = $query->FetchRow(ADODB_FETCH_NUM); + ?> + <form name="permission" method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id='.$parent_id; ?>"> + <h3><?php echo i18n("Change/Add permissions of folder/file"); ?> "<?php echo $data[0]; ?>"</h3> + + <?php + /** + * top folder can't be inherit + * -> make sure we cannot delete this entry! + */ + if($_GET['id'] != 0) + { + ?> + <input type="checkbox" id="group_inherit" name="inherit" value="1" /><label for="group_inherit"> <?php echo i18n("Inherit From Parent"); ?></label><br /> + <?php + } + ?> + + <input type="checkbox" id="group_admin" name="admin" value="1" checked="checked" disabled="disabled"/><label for="group_admin"> admin</label><br /> + <input type="checkbox" id="group_public" name="group[]" value="public"<?php echo $checked; ?> /><label for="group_public"> public</label><br /> + + <?php + foreach($array_groups AS $key=>$value) + { + if(in_array($key,$array_perms)) { - $linpha->db->Execute("UPDATE ".PREFIX."permissions SET permission = ';".LinSql::linAddslashes($str_groups).";' " . - "WHERE photos_id = '".LinSql::linAddslashes($_POST['photo_id'])."' AND perm_type = '".$sql_perm_type."'"); + $checked = ' checked="checked"'; } else { - $linpha->db->Execute("INSERT into ".PREFIX."permissions (photos_id, perm_type, permission) VALUES (" . - "'".LinSql::linAddslashes($_POST['photo_id'])."', '".$sql_perm_type."'," . - "';".LinSql::linAddslashes($str_groups).";' )"); + $checked = ''; } - } -} - -/** - * set parameters - */ - if(isset($_GET['parent_id']) && $_GET['parent_id'] != 0) - { - $parent_id = $_GET['parent_id']; - $view_mode = 'files'; - $array = $GLOBALS['linpha']->sql->getFullFilenameFromId( LinSql::linAddslashes($parent_id) ); - - $parent_name = '<b>'.implode('/',$array).'</b>'; - $recursive = false; - } - else - { - $parent_id = 0; - $view_mode = 'folders'; - $parent_name = 'Top directory (default permission)'; - $recursive = true; - } - -/** - * get groups - */ - $array_groups = Array(); - $query = $GLOBALS['linpha']->db->Execute("SELECT id, group_name FROM ".PREFIX."groups WHERE group_name <> 'admin'"); - while($data = $query->FetchRow(ADODB_FETCH_NUM)) - { - $array_groups[$data[0]] = $data[1]; - } - -/** - * show edit/add permission dialog - */ -if(isset($_GET['cmd']) AND isset($_GET['id'])) -{ - $checked = ''; - $array_perms = array(); - - /** - * check wether add or edit (insert or update) - */ - $query = $linpha->db->Execute("SELECT id FROM ".PREFIX."permissions " . - "WHERE photos_id = '".LinSql::linAddslashes($_GET['id'])."' AND perm_type = '".$sql_perm_type."'"); - - if( ! $query->EOF ) - { - list($stage, $perm) = $GLOBALS['linpha']->sql->getPerm( $_GET['id'], $sql_perm_type ); - $array_perms = explode(';',$perm); - - if(in_array('public',$array_perms)) - { - $checked = ' checked="checked"'; + echo '<input type="checkbox" id="group_'.$key.'" name="group[]" value="'.$key.'"'.$checked.' /><label for="group_'.$key.'"> '.$value.'</a><br />'; } + ?> + <input type="hidden" name="photo_id" value="<?php echo $_GET['id']; ?>" /> + <input type="hidden" name="parent_id" value="<?php echo $parent_id; ?>" /> + <input type="hidden" name="cmd" value="save_permissions" /> + <input type="submit" name="submit" value="save" /> + <a href="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id='.$parent_id; ?>">cancel</a> + </form> + <br /><br /> + <?php } - $query = $GLOBALS['linpha']->db->Execute("SELECT name FROM ".PREFIX."photos " . - "WHERE id = '".LinSql::linAddslashes($_GET['id'])."'"); - $data = $query->FetchRow(ADODB_FETCH_NUM); - ?> - <form name="permission" method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id='.$parent_id; ?>"> - <h3><?php echo i18n("Change/Add permissions of folder/file"); ?> "<?php echo $data[0]; ?>"</h3> - <?php /** - * top folder can't be inherit - * -> make sure we cannot delete this entry! + * print permissions */ - if($_GET['id'] != 0) - { + list($stage, $perm) = $GLOBALS['linpha']->sql->getPerm( $parent_id, $sql_perm_type ); ?> - <input type="checkbox" id="group_inherit" name="inherit" value="1" /><label for="group_inherit"> <?php echo i18n("Inherit From Parent"); ?></label><br /> + Current directoy: <?php echo $parent_name; ?> <?php - } - ?> - - <input type="checkbox" id="group_admin" name="admin" value="1" checked="checked" disabled="disabled"/><label for="group_admin"> admin</label><br /> - <input type="checkbox" id="group_public" name="group[]" value="public"<?php echo $checked; ?> /><label for="group_public"> public</label><br /> - - <?php - foreach($array_groups AS $key=>$value) - { - if(in_array($key,$array_perms)) + if(isset($_GET['parent_id']) && $_GET['parent_id'] != 0) { - $checked = ' checked="checked"'; + echo ' (<a href="'.LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id=0">Show all folders</a>)'; } - else - { - $checked = ''; - } - - echo '<input type="checkbox" id="group_'.$key.'" name="group[]" value="'.$key.'"'.$checked.' /><label for="group_'.$key.'"> '.$value.'</a><br />'; - } - ?> - <input type="hidden" name="photo_id" value="<?php echo $_GET['id']; ?>" /> - <input type="hidden" name="parent_id" value="<?php echo $parent_id; ?>" /> - <input type="hidden" name="cmd" value="save_permissions" /> - <input type="submit" name="submit" value="save" /> - <a href="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id='.$parent_id; ?>">cancel</a> - </form> - <br /><br /> - <?php -} + ?> + <br /> + <?php echo i18n("Permission Set"); ?>: <b><?php echo getReadablePerms($perm); ?></b> + (<a href="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id='.$parent_id.'&cmd=edit&id='.$parent_id; ?>">change</a>) + <br /><br /> + <table border='1'> + <tr> + <td width='200'><?php echo i18n("Name"); ?></td> + <td width='200'><?php echo i18n("Permission Set"); ?></td> + <td width='200'><?php echo i18n("Permission Inherited"); ?></td> + <td width='200'><?php echo i18n("Modifications"); ?></td> + </tr> + <?php + printDirPermsEntry( $parent_id , $recursive , $stage=0); + ?> + </table> + </form> + + <?php +} // end if plugin_filemanager_enable /** - * print permissions - */ - list($stage, $perm) = $GLOBALS['linpha']->sql->getPerm( $parent_id, $sql_perm_type ); - ?> - Current directoy: <?php echo $parent_name; ?> - <?php - if(isset($_GET['parent_id']) && $_GET['parent_id'] != 0) - { - echo ' (<a href="'.LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id=0">Show all folders</a>)'; - } - ?> - <br /> - <?php echo i18n("Permission Set"); ?>: <b><?php echo getReadablePerms($perm); ?></b> - (<a href="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id='.$parent_id.'&cmd=edit&id='.$parent_id; ?>">change</a>) - <br /><br /> - <table border='1'> - <tr> - <td width='200'><?php echo i18n("Name"); ?></td> - <td width='200'><?php echo i18n("Permission Set"); ?></td> - <td width='200'><?php echo i18n("Permission Inherited"); ?></td> - <td width='200'><?php echo i18n("Modifications"); ?></td> - </tr> - <?php - printDirPermsEntry( $parent_id , $recursive , $stage=0); - ?> - </table> - </form> - - <?php -/** * print the permission entries */ function printDirPermsEntry( $parent_id , $recursive , $stage) Modified: trunk/linpha2/admin/settings_layout.php =================================================================== --- trunk/linpha2/admin/settings_layout.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/admin/settings_layout.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -3,11 +3,11 @@ if(!isset($cat3)) { - $cat3 = 'home'; + $cat3 = 'layout'; } $array_menu = Array( - 'layout' => Array('name' => 'Layout', 'link' => 'settings_layout_layout'), + 'general' => Array('name' => 'General', 'link' => 'settings_layout_general'), 'home' => Array('name' => 'Home Site', 'link' => 'settings_layout_home'), 'thumb' => Array('name' => 'Thumb View', 'link' => 'settings_layout_thumb'), 'image' => Array('name' => 'Image View', 'link' => 'settings_layout_image'), @@ -22,10 +22,15 @@ switch($cat3) { -case 'layout': +case 'general': if(isset($_POST['cmd']) && $_POST['cmd']=='saveconfig') { + include_once(LINPHA_DIR.'/lib/plugins/watermark/func.watermark.php'); + $_POST['sys_style_layout_bodybgcolor'] = get_html_from_all($_POST['sys_style_layout_bodybgcolor']); + $_POST['sys_style_layout_elembgcolor'] = get_html_from_all($_POST['sys_style_layout_elembgcolor']); + $_POST['sys_style_layout_fontcolor'] = get_html_from_all($_POST['sys_style_layout_fontcolor']); + $LinAdmin->saveConfig(Array( 'sys_style_layout_title', 'sys_style_layout_template', @@ -36,11 +41,9 @@ )); } - print_r(LinAdmin::getTemplates()); - $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_title'),'sys_style_layout_title',$LinAdmin->option_value_system['sys_style_layout_title']); $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_template'),'sys_style_layout_template',$LinAdmin->option_value_system['sys_style_layout_template'],LinAdmin::getTemplates()); - $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_layout'),'sys_style_layout_layout',$LinAdmin->option_value_system['sys_style_layout_layout'],LinAdmin::getThemes($LinAdmin->option_value_system['sys_style_layout_template'])); + $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_theme'),'sys_style_layout_theme',$LinAdmin->option_value_system['sys_style_layout_theme'],LinAdmin::getThemes($LinAdmin->option_value_system['sys_style_layout_template'])); $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_bodybgcolor'),'sys_style_layout_bodybgcolor',$LinAdmin->option_value_system['sys_style_layout_bodybgcolor']); $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_elembgcolor'),'sys_style_layout_elembgcolor',$LinAdmin->option_value_system['sys_style_layout_elembgcolor']); $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_fontcolor'),'sys_style_layout_fontcolor',$LinAdmin->option_value_system['sys_style_layout_fontcolor']); Modified: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/install/sql/sql.data.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -76,7 +76,7 @@ 'sys_style_layout_bodybgcolor' => 'dddddd', 'sys_style_layout_elembgcolor' => '87cefa', 'sys_style_layout_fontcolor' => '000000', - 'sys_style_layout_layout' => 'default', + 'sys_style_layout_theme' => 'default', 'sys_style_layout_template' => 'default', 'sys_style_layout_title' => 'Linpha 2.0', Modified: trunk/linpha2/lib/classes/linpha.admin.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.admin.class.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/lib/classes/linpha.admin.class.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -316,14 +316,18 @@ function getTemplates() { - $templatesdir = LINPHA_DIR."/templates/"; + $templatesdir = LINPHA_DIR."/templates"; $file_handle = opendir($templatesdir); $all_themes = array(); while( ($file = readdir($file_handle)) !== false ) { - if($file != "." && $file != ".." && $file != ".svn" && is_dir($templatesdir.$file)) + if($file != "." && $file != ".." && $file != ".svn" && + is_dir($templatesdir.'/'.$file) && + file_exists($templatesdir.'/'.$file.'/global.html.php') && // do at least this check + file_exists($templatesdir.'/'.$file.'/themes') // do at least this check + ) { $all_themes[$file] = $file; } @@ -339,14 +343,14 @@ function getThemes($template) { - $templatesdir = LINPHA_DIR."/templates/".$template."/"; + $templatesdir = LINPHA_DIR."/templates/".$template."/themes"; $file_handle = opendir($templatesdir); $all_themes = array(); while( ($file = readdir($file_handle)) !== false ) { - if($file != "." && $file != ".." && $file != ".svn" && is_dir($templatesdir.$file)) + if($file != "." && $file != ".." && $file != ".svn" && is_dir($templatesdir.'/'.$file)) { $all_themes[$file] = $file; } Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -44,7 +44,7 @@ $this->linpha_title = $GLOBALS['linpha']->sql->config->value['sys_style_layout_title']; - $this->layoutsimagespath = LINPHA_DIR.'/templates/'.$this->template_name.'/layouts/'.$this->layout_name.'/images'; + $this->layoutsimagespath = LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/images'; } @@ -65,7 +65,7 @@ ?> <!-- css includes --> <link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/colorsettings.php?bgcolor='.$this->bgcolor.'&bodybgcolor='.$this->bodybgcolor.'&fontcolor='.$this->fontcolor; ?>' type='text/css'> -<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/layouts/'.$this->layout_name.'/css/global.css'; ?>' 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'> <link rel='stylesheet' href='<?php $this->includeFile('css'); ?>' type='text/css'> <!-- IE hack for the menu--> <!--[if IE]> @@ -104,7 +104,7 @@ $filename = LINPHA_DIR.'/templates/'.$this->template_name.'/'.$this->head_name.'.head.php'; break; case 'css': - echo LINPHA_DIR.'/templates/'.$this->template_name.'/layouts/'.$this->layout_name.'/css/'.$this->css_name.'.css'; + echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/'.$this->css_name.'.css'; break; } @@ -207,15 +207,35 @@ } } - function divRoundCorners($top_bottom) + function divRoundCorners($top_bottom,$alpha='') { - if($top_bottom == 'top') + if(empty($alpha)) { - $str = '<div class="roundtop"><img src="'.LINPHA_DIR.'/templates/roundcorners.php?color='.$this->bgcolor.'&bgcolor='.$this->bodybgcolor.'&size=15&align=tl" alt="" width="15" height="15" class="corner" style="display: none" /></div>'; + if($top_bottom == 'top') + { + $str = '<div class="roundtop">'; + $str .= '<img src="'.LINPHA_DIR.'/templates/roundcorners.php?color='.$this->bgcolor.'&bgcolor='.$this->bodybgcolor.'&size=15&align=tl" alt="" width="15" height="15" class="corner" style="display: none" />'; + $str .= '</div>'; + } + elseif($top_bottom == 'bottom') + { + $str = '<div class="roundbottom">'; + $str .= '<img src="'.LINPHA_DIR.'/templates/roundcorners.php?color='.$this->bgcolor.'&bgcolor='.$this->bodybgcolor.'&size=15&align=bl" alt="" width="15" height="15" class="corner" style="display: none" />'; + $str .= '</div>'; + } } - elseif($top_bottom == 'bottom') + else // currently only used in slideshow, does not work well in internet explorer { - $str = '<div class="roundbottom"><img src="'.LINPHA_DIR.'/templates/roundcorners.php?color='.$this->bgcolor.'&bgcolor='.$this->bodybgcolor.'&size=15&align=bl" alt="" width="15" height="15" class="corner" style="display: none" /></div>'; + if($top_bottom == 'top') + { + } + elseif($top_bottom == 'bottom') + { + $str = '<div class="roundAlphabottom">'; + $str .= '<div class="roundAlphabottomInner"> </div>'; + $str .= '<img src="'.LINPHA_DIR.'/templates/roundcorners.php?color='.$this->bgcolor.'&bgcolor='.$this->bodybgcolor.'&size=15&align=bl&alpha" alt="" width="15" height="15" class="AlphaCorner" style="display: none" />'; + $str .= '</div>'; + } } return $str; Modified: trunk/linpha2/lib/modules/module.filemanager.php =================================================================== --- trunk/linpha2/lib/modules/module.filemanager.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/lib/modules/module.filemanager.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -930,11 +930,12 @@ <?php -$linpha->template->output['filemanager'] = ob_get_clean(); +$linpha->template->output['default'] = ob_get_clean(); ?> <?php -$linpha->template->setModuleName('filemanager'); +$linpha->template->setModuleName('default'); +$linpha->template->overrideModule('css','filemanager'); $linpha->template->URL_full = LINPHA_DIR.'/?cat=filemanager&id='.$parent_id; $linpha->template->output['title'] = i18n("Filemanager"); include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); Modified: trunk/linpha2/lib/plugins/watermark/func.watermark.php =================================================================== --- trunk/linpha2/lib/plugins/watermark/func.watermark.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/lib/plugins/watermark/func.watermark.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -751,6 +751,39 @@ return $array_rgb; } +/** + * return html color without '#' + * + * used in linpha2 - admin - settings_layout + */ +function get_html_from_all($string) +{ + if(is_html_color($string)) + { + if(substr($string,0,1)=="#") + { + return substr($string,1,6); + } + else + { + return $string; + } + } + else + { + $str_col = get_html_from_color($string); + if(substr($str_col,0,1)=="#") + { + return substr($str_col,1,6); + } + + else + { + return '#000000'; + } + } +} + function calc_align($align, $src_w, $src_h, $dst_w, $dst_h, $pos_x, $pos_y) { /*########################################################## Modified: trunk/linpha2/templates/default/basket.html.php =================================================================== --- trunk/linpha2/templates/default/basket.html.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/default/basket.html.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -1,8 +1,6 @@ <div id="divnavigation"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="navigation"> <a style="float: left; margin-right: 2px;" class="button" href="<?php echo $_SESSION['basket_ref_url']; ?>"><?php echo i18n("Go Back"); ?></a> @@ -165,16 +163,12 @@ ?> </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> <div id="divmain"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="main"> <form name="basket_remove" action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>&cmd=remove_selected" method="POST"> @@ -210,9 +204,7 @@ <input class="button" type="submit" name="submit" value="<?php echo i18n("Remove selected"); ?>" /> </form> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> </form> \ No newline at end of file Modified: trunk/linpha2/templates/default/search.html.php =================================================================== --- trunk/linpha2/templates/default/search.html.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/default/search.html.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -26,9 +26,8 @@ } ?> <div id="divmain"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> + <div id="main"> <div class="divcolumn"> @@ -229,9 +228,7 @@ </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> <script language="JavaScript" type="text/javascript"> Modified: trunk/linpha2/templates/default/settings.html.php =================================================================== --- trunk/linpha2/templates/default/settings.html.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/default/settings.html.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -1,7 +1,5 @@ <div id="divmain"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="main"> @@ -13,7 +11,5 @@ </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/themes/default/css/admin.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/admin.css 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/default/themes/default/css/admin.css 2006-10-27 21:10:23 UTC (rev 4603) @@ -6,31 +6,31 @@ .navlist { -padding: 3px 0; -margin-left: 0; -border-bottom: 1px solid #778; -font: bold 12px Verdana, sans-serif; + padding: 3px 0; + margin-left: 0; + border-bottom: 1px solid #778; + font: bold 12px Verdana, sans-serif; } .navlist li { -list-style: none; -margin: 0; -display: inline; + list-style: none; + margin: 0; + display: inline; } .navlist li a { -padding: 3px 0.5em; -margin-left: 3px; -border: 1px solid #778; -border-bottom: none; -background: #DDE; -text-decoration: none; + padding: 3px 0.5em; + margin-left: 3px; + border: 1px solid #778; + border-bottom: none; + background: #DDE; + text-decoration: none; } .navlist li a:link { color: #448; } -.navlist li a:visited { color: #667; } +.navlist li a:visited { color: #448; } .navlist li a:hover { @@ -41,7 +41,8 @@ .navlist li a.current { -background: white; +background: #01298f; +color: #ffffff; border-bottom: 1px solid white; } Modified: trunk/linpha2/templates/default/view_albcomment.html.php =================================================================== --- trunk/linpha2/templates/default/view_albcomment.html.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/default/view_albcomment.html.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -1,7 +1,5 @@ <div id="divmain"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="main"> <form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> @@ -17,7 +15,5 @@ </form> </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_basket.html.php =================================================================== --- trunk/linpha2/templates/default/view_basket.html.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/default/view_basket.html.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -1,7 +1,5 @@ <div id="divnavigation"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="navigation"> <?php @@ -18,15 +16,11 @@ </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> <div id="divmain"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="divpage_nr"> <div id="page_nr"> @@ -120,7 +114,5 @@ </script> </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_img.html.php =================================================================== --- trunk/linpha2/templates/default/view_img.html.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/default/view_img.html.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -5,9 +5,7 @@ <?php } ?> <div id="divthumbnavi"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="thumbnavi"> <div class="thumbnavi_prevthumb" id="thumbnavi_prevthumb"></div> @@ -15,15 +13,11 @@ <div class="thumbnavi_nextthumb" id="thumbnavi_nextthumb"></div> </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> <div id="divmain"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="main"> <div id="divloading"> <img src="<?php echo LINPHA_DIR; ?>/lib/graphics/loading.gif"> @@ -71,9 +65,7 @@ <div id="divcomments" class="comments"></div> </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> @@ -117,10 +109,8 @@ <div style="clear: both;"></div> </div> - <div class="roundAlphabottom"> - <div class="roundAlphabottomInner"> </div> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl_alpha.gif'; ?>" alt="" width="15" height="15" class="AlphaCorner" style="display: none" /> - </div> + + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom','alpha'); ?> </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-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/default/view_img_static.html.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -6,9 +6,7 @@ <?php } ?> <div id="divthumbnavi"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="thumbnavi"> <div class="thumbnavi_prevthumb"> @@ -20,15 +18,11 @@ </div> </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> <div id="divmain"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="main"> <?php if($_SESSION['mode_imageview']=='meta') { ?> <!-- edit meta data - include view_meta.html --> @@ -87,15 +81,11 @@ <?php } /* end if view!=meta */ ?> </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> <div id="divright"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="right"> <?php foreach($GLOBALS['linpha']->template->output['image_infos'] AS $value) @@ -104,7 +94,5 @@ } ?> </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_thumb.head.php =================================================================== --- trunk/linpha2/templates/default/view_thumb.head.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/default/view_thumb.head.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -10,5 +10,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/'.$GLOBALS['linpha']->template->template_name.'/layouts/'.$GLOBALS['linpha']->template->layout_name.'/DefsThumbView.js'; ?>"></script> +<script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/themes/'.$GLOBALS['linpha']->template->layout_name.'/DefsThumbView.js'; ?>"></script> <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/LinThumbnails.js"></script> Modified: trunk/linpha2/templates/default/view_thumb.html.php =================================================================== --- trunk/linpha2/templates/default/view_thumb.html.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/default/view_thumb.html.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -8,15 +8,13 @@ <!-- navigation --> <?php if(isset($GLOBALS['linpha']->template->output['navigation']) && !empty($GLOBALS['linpha']->template->output['navigation'])) { ?> <div id="divnavigation"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> + <div id="navigation"> <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> <?php } ?> @@ -24,9 +22,7 @@ </div> <div id="divmain"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="divpage_nr"> <div id="page_nr"> @@ -41,9 +37,7 @@ </div> <div style="clear: both;"></div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> <script language="JavaScript" type="text/javascript"> Modified: trunk/linpha2/templates/default/view_thumb_static.html.php =================================================================== --- trunk/linpha2/templates/default/view_thumb_static.html.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/default/view_thumb_static.html.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -2,15 +2,13 @@ <!-- navigation --> <?php if(isset($GLOBALS['linpha']->template->output['navigation']) && !empty($GLOBALS['linpha']->template->output['navigation'])) { ?> <div id="divnavigation"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> + <div id="navigation"> <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> <?php } ?> @@ -18,9 +16,7 @@ </div> <div id="divmain"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="divpage_nr"> <div id="page_nr"> @@ -56,7 +52,6 @@ </div> <div style="clear: both;"></div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_thumbdetail.html.php =================================================================== --- trunk/linpha2/templates/default/view_thumbdetail.html.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/default/view_thumbdetail.html.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -9,24 +9,18 @@ <!-- navigation --> <?php if(isset($GLOBALS['linpha']->template->output['navigation']) && !empty($GLOBALS['linpha']->template->output['navigation'])) { ?> <div id="divnavigation"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="navigation"> <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> <?php } ?> <div id="divmain"> - <div class="roundtop"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> <div id="main"> @@ -64,7 +58,5 @@ ?> </div> - <div class="roundbottom"> - <img src="<?php echo $GLOBALS['linpha']->template->layoutsimagespath.'/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> - </div> + <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/roundcorners.php =================================================================== --- trunk/linpha2/templates/roundcorners.php 2006-10-27 20:02:41 UTC (rev 4602) +++ trunk/linpha2/templates/roundcorners.php 2006-10-27 21:10:23 UTC (rev 4603) @@ -1,11 +1,6 @@ <?php if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } -/** - * @todo force cache on - */ - - include_once( LINPHA_DIR.'/lib/plugins/watermark/func.watermark.php' ); if(!isset($_GET['color'])) @@ -72,48 +67,21 @@ imageline($image, 0, 0, $size-1, 0, $color ); } - // flush image -header('Content-type: image/png'); -imagepng($image); -imagedestroy($image); +Header('Content-type: image/png'); +/** + * force caching in browser + * works in firefox and internet explorer + */ +Header("Last-Modified: " . gmdate("D, d M Y H:i:s",mktime (0,0,0,1,1,2000)) . " GMT"); // Date in the past +Header("Expires: Mon, 26 Jul 2100 05:00:00 GMT"); // In other words... never expire the image +Header("Cache-Control: max-age=10000000, s-maxage=1000000, proxy-revalidate, must-revalidate"); -/* -$size = 300; -$image=imagecreatetruecolor($size, $size); -// something to get a white background with black border -$back = imagecolorallocate($image, 255, 255, 255); -$border = imagecolorallocate($image, 0, 0, 0); -imagefilledrectangle($image, 0, 0, $size - 1, $size - 1, $back); -imagerectangle($image, 0, 0, $size - 1, $size - 1, $border); - -$yellow_x = 100; -$yellow_y = 75; -$red_x = 120; -$red_y = 165; -$blue_x = 187; -$blue_y = 125; -$radius = 150; - -// allocate colors with alpha values -$yellow = imagecolorallocatealpha($image, 255, 255, 0, 75); -$red = imagecolorallocatealpha($image, 255, 0, 0, 75); -$blue = imagecolorallocatealpha($image, 0, 0, 255, 127); - -// drawing 3 overlapped circle -imagefilledellipse($image, $yellow_x, $yellow_y, $radius, $radius, $yellow); -imagefilledellipse($image, $red_x, $red_y, $radius, $radius, $red); -imagefilledellipse($image, $blue_x, $blue_y, $radius, $radius, $blue); - -// don't forget to output a correct header! -header('Content-type: image/png'); - -// and finally, output the result imagepng($image); imagedestroy($image); -*/ + ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2006-10-28 16:36:03
|
Revision: 4604 http://svn.sourceforge.net/linpha/?rev=4604&view=rev Author: fangehrn Date: 2006-10-28 09:34:50 -0700 (Sat, 28 Oct 2006) Log Message: ----------- 2006-10-28 flo * improved a lot * reset database and enjoy Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/index.php trunk/linpha2/admin/settings_layout.php trunk/linpha2/index.php trunk/linpha2/install/sql/sql.data.php trunk/linpha2/lib/classes/linpha.admin.class.php trunk/linpha2/lib/classes/linpha.image.class.php trunk/linpha2/lib/classes/linpha.import.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/js/LinGlobal.js trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/modules/module.basket.php trunk/linpha2/lib/modules/module.filemanager.php trunk/linpha2/lib/modules/module.settings.php trunk/linpha2/lib/plugins/watermark/func.watermark.php trunk/linpha2/templates/default/basket.html.php trunk/linpha2/templates/default/default.html.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/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/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.head.php trunk/linpha2/templates/default/view_thumb.html.php trunk/linpha2/templates/default/view_thumb_static.html.php Added Paths: ----------- trunk/linpha2/templates/default/themes/default/colorsettings.php Removed Paths: ------------- trunk/linpha2/templates/default/colorsettings.php trunk/linpha2/templates/default/settings.html.php trunk/linpha2/templates/default/themes/default/css/basket.css trunk/linpha2/templates/default/themes/default/css/view_thumbdetail.css trunk/linpha2/templates/default/view_thumbdetail.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/ChangeLog 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,3 +1,7 @@ +2006-10-28 flo + * improved a lot + * reset database and enjoy + 2006-10-27 flo * working on admin settings need to reset database Modified: trunk/linpha2/admin/index.php =================================================================== --- trunk/linpha2/admin/index.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/admin/index.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -9,7 +9,6 @@ $linpha = new linpha(); $linpha->sql->startSession(); - $linpha->template = new linTemplate(); if(!$linpha->sql->isAdmin()) { Modified: trunk/linpha2/admin/settings_layout.php =================================================================== --- trunk/linpha2/admin/settings_layout.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/admin/settings_layout.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -3,7 +3,7 @@ if(!isset($cat3)) { - $cat3 = 'layout'; + $cat3 = 'general'; } $array_menu = Array( @@ -24,30 +24,107 @@ { case 'general': + $color_examples = array( + '' => '', + 'blue' => 'blue', + 'orange' => 'orange' + ); + + $color_examples_values = array( + 'blue' => array( + 'bodybg' => 'DDDDDD', + 'elembg' => '87CEFA', + 'font' => '000000', + 'albumsbg' => 'D5FCF4', + 'links' => '005388', + 'linkshover' => '666666', + ), + 'orange' => array( + 'bodybg' => 'FFFFFF', + 'elembg' => 'F09000', + 'font' => '000000', + 'albumsbg' => '94580A', + 'links' => '3d3b33', + 'linkshover' => '555453', + ) + ); + if(isset($_POST['cmd']) && $_POST['cmd']=='saveconfig') { - include_once(LINPHA_DIR.'/lib/plugins/watermark/func.watermark.php'); - $_POST['sys_style_layout_bodybgcolor'] = get_html_from_all($_POST['sys_style_layout_bodybgcolor']); - $_POST['sys_style_layout_elembgcolor'] = get_html_from_all($_POST['sys_style_layout_elembgcolor']); - $_POST['sys_style_layout_fontcolor'] = get_html_from_all($_POST['sys_style_layout_fontcolor']); + if( isset($_POST['select_examples']) && !empty($_POST['select_examples']) && in_array($_POST['select_examples'],$color_examples) ) + { + $_POST['sys_style_layout_color_bodybg'] = $color_examples_values[ $_POST['select_examples'] ]['bodybg']; + $_POST['sys_style_layout_color_elembg'] = $color_examples_values[ $_POST['select_examples'] ]['elembg']; + $_POST['sys_style_layout_color_font'] = $color_examples_values[ $_POST['select_examples'] ]['font']; + $_POST['sys_style_layout_color_albumsbg'] = $color_examples_values[ $_POST['select_examples'] ]['albumsbg']; + $_POST['sys_style_layout_color_links'] = $color_examples_values[ $_POST['select_examples'] ]['links']; + $_POST['sys_style_layout_color_linkshover'] = $color_examples_values[ $_POST['select_examples'] ]['linkshover']; + } + else + { + include_once(LINPHA_DIR.'/lib/plugins/watermark/func.watermark.php'); + $_POST['sys_style_layout_color_bodybg'] = get_html_from_all($_POST['sys_style_layout_color_bodybg']); + $_POST['sys_style_layout_color_elembg'] = get_html_from_all($_POST['sys_style_layout_color_elembg']); + $_POST['sys_style_layout_color_font'] = get_html_from_all($_POST['sys_style_layout_color_font']); + $_POST['sys_style_layout_color_albumsbg'] = get_html_from_all($_POST['sys_style_layout_color_albumsbg']); + $_POST['sys_style_layout_color_links'] = get_html_from_all($_POST['sys_style_layout_color_links']); + $_POST['sys_style_layout_color_linkshover'] = get_html_from_all($_POST['sys_style_layout_color_linkshover']); + } $LinAdmin->saveConfig(Array( 'sys_style_layout_title', 'sys_style_layout_template', 'sys_style_layout_layout', - 'sys_style_layout_bodybgcolor', - 'sys_style_layout_elembgcolor', - 'sys_style_layout_fontcolor' + 'sys_style_layout_color_bodybg', + 'sys_style_layout_color_elembg', + 'sys_style_layout_color_font', + 'sys_style_layout_color_albumsbg', + 'sys_style_layout_color_links', + 'sys_style_layout_color_linkshover', )); } - + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_title'),'sys_style_layout_title',$LinAdmin->option_value_system['sys_style_layout_title']); - $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_template'),'sys_style_layout_template',$LinAdmin->option_value_system['sys_style_layout_template'],LinAdmin::getTemplates()); - $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_theme'),'sys_style_layout_theme',$LinAdmin->option_value_system['sys_style_layout_theme'],LinAdmin::getThemes($LinAdmin->option_value_system['sys_style_layout_template'])); - $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_bodybgcolor'),'sys_style_layout_bodybgcolor',$LinAdmin->option_value_system['sys_style_layout_bodybgcolor']); - $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_elembgcolor'),'sys_style_layout_elembgcolor',$LinAdmin->option_value_system['sys_style_layout_elembgcolor']); - $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_fontcolor'),'sys_style_layout_fontcolor',$LinAdmin->option_value_system['sys_style_layout_fontcolor']); + $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_template'),'sys_style_layout_template',$LinAdmin->option_value_system['sys_style_layout_template'],array('options' => LinAdmin::getTemplates())); + $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>'; + ?> + <script language="JavaScript" type="text/javascript"> + function updateSelectBox(form_select) + { + if( form_select.options[ form_select.selectedIndex ].text == '') // enable + { + document.getElementsByName('sys_style_layout_color_bodybg')[0].disabled = false; + document.getElementsByName('sys_style_layout_color_elembg')[0].disabled = false; + document.getElementsByName('sys_style_layout_color_font')[0].disabled = false; + document.getElementsByName('sys_style_layout_color_albumsbg')[0].disabled = false; + document.getElementsByName('sys_style_layout_color_links')[0].disabled = false; + document.getElementsByName('sys_style_layout_color_linkshover')[0].disabled = false; + } + else // disable + { + document.getElementsByName('sys_style_layout_color_bodybg')[0].disabled = true; + document.getElementsByName('sys_style_layout_color_elembg')[0].disabled = true; + document.getElementsByName('sys_style_layout_color_font')[0].disabled = true; + document.getElementsByName('sys_style_layout_color_albumsbg')[0].disabled = true; + document.getElementsByName('sys_style_layout_color_links')[0].disabled = true; + document.getElementsByName('sys_style_layout_color_linkshover')[0].disabled = true; + } + } + </script> + <?php + $options = array('input_settings' => ' onchange="updateSelectBox(this)"','options' => $color_examples); + $LinAdmin->printAdminConfig('select',i18n("Examples"),'select_examples','',$options); + echo '<br />'; + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_color_bodybg'),'sys_style_layout_color_bodybg',$LinAdmin->option_value_system['sys_style_layout_color_bodybg']); + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_color_elembg'),'sys_style_layout_color_elembg',$LinAdmin->option_value_system['sys_style_layout_color_elembg']); + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_color_font'),'sys_style_layout_color_font',$LinAdmin->option_value_system['sys_style_layout_color_font']); + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_color_albumsbg'),'sys_style_layout_color_albumsbg',$LinAdmin->option_value_system['sys_style_layout_color_albumsbg']); + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_color_links'),'sys_style_layout_color_links',$LinAdmin->option_value_system['sys_style_layout_color_links']); + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('sys_style_layout_color_linkshover'),'sys_style_layout_color_linkshover',$LinAdmin->option_value_system['sys_style_layout_color_linkshover']); + break; case 'home': $welcometxt = i18n("Add Your Own Welcome Text Here"); @@ -102,7 +179,7 @@ $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'],getSortOrders()); + $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_home_firstsortorder'),'sys_style_home_firstsortorder',$LinAdmin->option_value_system['sys_style_home_firstsortorder'],array('options' => getSortOrders())); break; case 'thumb': Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/index.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -9,7 +9,6 @@ include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); $linpha = new Linpha(); $linpha->sql->startSession(); - $linpha->template = new linTemplate(); include_once(LINPHA_DIR.'/lib/include/integrity.php'); include_once(LINPHA_DIR.'/lib/include/upgrade.php'); Modified: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/install/sql/sql.data.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -47,6 +47,7 @@ 'sys_path_tmp_dir' => $_SESSION['tmp_dir'], 'sys_basket_mail_max_size' => (1024*1024*2), + 'sys_basket_mail_smpthost' => 'localhost', 'sys_basket_download_limit' => '0', 'sys_style_datetime_dates' => '%a %m/%d/%Y', @@ -73,9 +74,13 @@ 'sys_style_image_height' => '525', 'sys_style_image_nrprevnextthumbs' => '3', - 'sys_style_layout_bodybgcolor' => 'dddddd', - 'sys_style_layout_elembgcolor' => '87cefa', - 'sys_style_layout_fontcolor' => '000000', + 'sys_style_layout_color_bodybg' => 'DDDDDD', // the blue design + 'sys_style_layout_color_elembg' => '87CEFA', + 'sys_style_layout_color_font' => '000000', + 'sys_style_layout_color_albumsbg' => 'D5FCF4', + 'sys_style_layout_color_links' => '005388', + 'sys_style_layout_color_linkshover' => '666666', + 'sys_style_layout_theme' => 'default', 'sys_style_layout_template' => 'default', 'sys_style_layout_title' => 'Linpha 2.0', Modified: trunk/linpha2/lib/classes/linpha.admin.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.admin.class.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/lib/classes/linpha.admin.class.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -70,9 +70,12 @@ 'sys_style_layout_title' => "Linpha Title", 'sys_style_layout_template' => "Template", 'sys_style_layout_theme' => "Theme", - 'sys_style_layout_bodybgcolor' => "Main Background Color", - 'sys_style_layout_elembgcolor' => "Elements Background Color", - 'sys_style_layout_fontcolor' => "Fonts Color" + 'sys_style_layout_color_bodybg' => "Main Background Color", + 'sys_style_layout_color_elembg' => "Elements Background Color", + 'sys_style_layout_color_font' => "Fonts Color", + 'sys_style_layout_color_albumsbg' => "Albums Background Color", + 'sys_style_layout_color_links' => "Links Color", + 'sys_style_layout_color_linkshover' => "Links Hover Color", ); } @@ -104,7 +107,7 @@ <?php } -function printAdminConfig($type,$text,$id,$value,$options=array()) +function printAdminConfig($type,$text,$id,$value,$settings=array()) { ?> <div style="width: 600px; border: 1px solid black; padding: 5px; margin-bottom: 5px;"> @@ -146,11 +149,11 @@ ?> </div> <div align="right"> - <select name="<?php echo $id; ?>" size="1"> + <select name="<?php echo $id; ?>" size="1"<?php echo (isset($settings['input_settings']) ? $settings['input_settings'] : '' ); ?>> <?php - foreach($options AS $key=>$value) + foreach($settings['options'] AS $option_key=>$option_value) { - if($key == $value) + if($option_key == $value) { $selected = ' selected="selected"'; } @@ -158,7 +161,7 @@ { $selected = ''; } - echo '<option value="'.$key.'"'.$selected.'>'.$value.'</option>'; + echo '<option value="'.$option_key.'"'.$selected.'>'.$option_value.'</option>'; } ?> </select> Modified: trunk/linpha2/lib/classes/linpha.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.image.class.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/lib/classes/linpha.image.class.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -592,6 +592,7 @@ * it works on firefox, but it does not on my IE */ header("Content-Disposition: inline; filename=".basename($this->src_file).";" ); + readfile( $this->output_file ); } Modified: trunk/linpha2/lib/classes/linpha.import.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.import.class.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/lib/classes/linpha.import.class.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -423,13 +423,15 @@ /** * get date */ - $time_exif = MetaData::convertExifDateToUnix( $meta[0][34665]['Data'][0][36867]['Data'][0] ); + if( isset($meta[0][34665]['Data'][0][36867]['Data'][0]) ) { + $time_exif = MetaData::convertExifDateToUnix( $meta[0][34665]['Data'][0][36867]['Data'][0] ); + } /** * get rotate information * turn off exif autorotate using 'sys_import_exif_autorot' */ - if( $GLOBALS['linpha']->sql->config->value['sys_import_exif_autorot'] ) + if( $GLOBALS['linpha']->sql->config->value['sys_import_exif_autorot'] && isset($meta[0][274]['Data'][0]) ) { $rotate = MetaData::getRotationByExifTag( $meta[0][274]['Data'][0] ); } Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -176,6 +176,16 @@ $this->dbConnect(); } + /** + * start template + * this must be at execatly this place, because: + * 1. it needs to be after the database is connected, because + * in the constructor of linTemplate() are configs from the db read + * 2. we need the template already in startSession(), because of the + * syslog after loggin in + */ + $GLOBALS['linpha']->template = new linTemplate(); + session_name('linpha2'); session_start(); Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -26,9 +26,11 @@ { public $template_name, $layout_name; public $layoutimagespath; - public $bgcolor, $bodybgcolor; public $output; public $URL_base, $URL_full; + + public $bgcolor, $bodybgcolor, $fontcolor, $albumsbgcolor, $linkscolor, $linkshovercolor; + private $body_name; private $head_name; @@ -38,14 +40,16 @@ { $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->bgcolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_elembgcolor']; - $this->bodybgcolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_bodybgcolor']; - $this->fontcolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_fontcolor']; $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->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']; + $this->albumsbgcolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_color_albumsbg']; + $this->linkscolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_color_links']; + $this->linkshovercolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_color_linkshover']; } /** @@ -53,10 +57,17 @@ */ function includeFile($what) { + global $tpl; + switch($what) { case 'body': $filename = LINPHA_DIR.'/templates/'.$this->template_name.'/'.$this->body_name.'.html.php'; + if(file_exists($filename)) + { + include_once( $filename ); + } + break; case 'head': /** @@ -64,9 +75,17 @@ */ ?> <!-- css includes --> -<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/colorsettings.php?bgcolor='.$this->bgcolor.'&bodybgcolor='.$this->bodybgcolor.'&fontcolor='.$this->fontcolor; ?>' type='text/css'> +<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'> <link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/global.css'; ?>' type='text/css'> -<link rel='stylesheet' href='<?php $this->includeFile('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"; +} +?> <!-- IE hack for the menu--> <!--[if IE]> <style type="text/css" media="screen"> @@ -93,25 +112,26 @@ <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/prototype.js"></script> <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/LinGlobal.js"></script> +<script type="text/javascript" language="JavaScript"> +var LINPHA_DIR = '<?php echo LINPHA_DIR; ?>'; <?php if(! isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax'])) { + echo "checkAjaxCompatibility();"; +} ?> -<script type="text/javascript" language="JavaScript">var LINPHA_DIR = '<?php echo LINPHA_DIR; ?>'; checkAjaxCompatibility();</script> -<?php -} +</script> +<?php $filename = LINPHA_DIR.'/templates/'.$this->template_name.'/'.$this->head_name.'.head.php'; + if(file_exists($filename)) + { + include_once( $filename ); + } + break; - case 'css': - echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/'.$this->css_name.'.css'; - break; + } - - if($what != 'css' && file_exists($filename)) - { - include_once( $filename ); - } } function setModuleName($name) @@ -207,35 +227,47 @@ } } - function divRoundCorners($top_bottom,$alpha='') + /** + * rounded corner stuff + */ + function divRoundCorners($top_bottom,$alpha='',$type='') { - if(empty($alpha)) + $size = 15; + + if(empty($type)) // default { - if($top_bottom == 'top') - { - $str = '<div class="roundtop">'; - $str .= '<img src="'.LINPHA_DIR.'/templates/roundcorners.php?color='.$this->bgcolor.'&bgcolor='.$this->bodybgcolor.'&size=15&align=tl" alt="" width="15" height="15" class="corner" style="display: none" />'; - $str .= '</div>'; - } - elseif($top_bottom == 'bottom') - { - $str = '<div class="roundbottom">'; - $str .= '<img src="'.LINPHA_DIR.'/templates/roundcorners.php?color='.$this->bgcolor.'&bgcolor='.$this->bodybgcolor.'&size=15&align=bl" alt="" width="15" height="15" class="corner" style="display: none" />'; - $str .= '</div>'; - } + $color = $this->bgcolor; + $bgcolor = $this->bodybgcolor; } + elseif($type=='albums') + { + $color = $this->albumsbgcolor; + $bgcolor = $this->bgcolor; + } + + if($top_bottom == 'top') + { + $alignleft = 'tl'; + $alignright = 'tr'; + } + elseif($top_bottom == 'bottom') + { + $alignleft = 'bl'; + $alignright = 'br'; + } + + if(empty($alpha)) // default + { + $str = '<div style="background: url('.LINPHA_DIR.'/templates/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignright.') no-repeat top right;">'; + $str .= '<img src="'.LINPHA_DIR.'/templates/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 { - if($top_bottom == 'top') - { - } - elseif($top_bottom == 'bottom') - { - $str = '<div class="roundAlphabottom">'; - $str .= '<div class="roundAlphabottomInner"> </div>'; - $str .= '<img src="'.LINPHA_DIR.'/templates/roundcorners.php?color='.$this->bgcolor.'&bgcolor='.$this->bodybgcolor.'&size=15&align=bl&alpha" alt="" width="15" height="15" class="AlphaCorner" style="display: none" />'; - $str .= '</div>'; - } + $str = '<div style="position: relative; background: url('.LINPHA_DIR.'/templates/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&alpha&align='.$alignright.') no-repeat top right;">'; + $str .= '<div class="roundAlphabottomInner"> </div>'; + $str .= '<img src="'.LINPHA_DIR.'/templates/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignleft.'&alpha" alt="" width="'.$size.'" height="'.$size.'" class="AlphaCorner" />'; + $str .= '</div>'; } return $str; Modified: trunk/linpha2/lib/include/basket_build_mail.php =================================================================== --- trunk/linpha2/lib/include/basket_build_mail.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/lib/include/basket_build_mail.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -163,7 +163,7 @@ $mail = new PHPMailer(); $mail->IsSmtp(); - $mail->Host = "localhost"; + $mail->Host = $GLOBALS['linpha']->sql->config->value['sys_basket_mail_smpthost']; $mail->From = $_POST['sender_address']; $mail->FromName = $_POST['sender_address']; // otherwise, a default name like "Root User" is taken $mail->AddAddress($_POST['mail_address']); @@ -212,7 +212,7 @@ /** * no exception, because we still need to delete the images */ - linSysLog(i18n("Error: E-Mail couldn't be sent. Contact the Administrator.")); + linSysLog(i18n("Error: E-Mail couldn't be sent. Contact the Administrator.").'<br />'); } $mail->ClearAddresses(); Modified: trunk/linpha2/lib/js/LinGlobal.js =================================================================== --- trunk/linpha2/lib/js/LinGlobal.js 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/lib/js/LinGlobal.js 2006-10-28 16:34:50 UTC (rev 4604) @@ -37,7 +37,7 @@ */ function checkAjaxCompatibilitySuccess(t) { - location.reload(); + location.href = document.location; linSyslog('Ajax enabled'); } Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/lib/js/LinImage.js 2006-10-28 16:34:50 UTC (rev 4604) @@ -3,7 +3,7 @@ alert('Error ' + t.status + ' -- ' + t.statusText); } -var curImgId; +var curImgId = startImgId; var nextThumbs = new Array(); var prevThumbs = new Array(); @@ -70,18 +70,39 @@ }, movePrev: function() { + if( slideshowActive ) + { + clearTimeout(ssCurrentTimerID); + } + if(prevThumbs[ prevThumbs.length - 1 ]) { Element.setOpacity('ssImgPrev',0.7); new Effect.Appear('ssImgPrev', { duration: 0.5, from: 0.7, to: 1.0 }); myLinImage.loadImage(prevThumbs[ prevThumbs.length - 1 ]); + + if( slideshowActive ) + { + clearTimeout(ssCurrentTimerID); + ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + } } else // end reached, do nothing but enable keyboard navigation again { myLinImage.enableKeyboardNav(); } + + if( slideshowActive ) + { + ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + } }, moveNext: function() { + if( slideshowActive ) + { + clearTimeout(ssCurrentTimerID); + } + if(nextThumbs[0]) { Element.setOpacity('ssImgNext',0.7); @@ -98,16 +119,41 @@ { myLinImage.enableKeyboardNav(); } + + if( slideshowActive ) + { + ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + } }, moveFirst: function() { + if( slideshowActive ) + { + clearTimeout(ssCurrentTimerID); + } + Element.setOpacity('ssImgFirst',0.7); new Effect.Appear('ssImgFirst', { duration: 0.5, from: 0.7, to: 1.0 }); myLinImage.loadImage( firstImgId ); + + if( slideshowActive ) + { + ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + } }, moveLast: function() { + if( slideshowActive ) + { + clearTimeout(ssCurrentTimerID); + } + Element.setOpacity('ssImgLast',0.7); new Effect.Appear('ssImgLast', { duration: 0.5, from: 0.7, to: 1.0 }); myLinImage.loadImage( lastImgId ); + + if( slideshowActive ) + { + ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + } }, // @@ -565,8 +611,14 @@ }, preloadImageFinished: function(imgId) { - new Effect.Appear('thumb'+imgId, { duration: 0.5, from: 0.5, to: 1.0 }); + preloadImageFinished[imgId] = true; + + if( $('thumb'+imgId) ) // maybe its not here anymore + { + new Effect.Appear('thumb'+imgId, { duration: 0.5, from: 0.5, to: 1.0 }); + } + }, fullscreenStart: function() @@ -664,7 +716,7 @@ if(nextThumbs[0] || ssLoop) { this.moveNext(); - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + //ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); } else { @@ -738,10 +790,18 @@ $('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 myLinImage = new LinImage(); - myLinImage.loadImage(startImgId); -// setMainHeight(); // defined in LinGlobal.js - window.onresize = onWindowResize; + // automatically start slideshow if requested (coming from thumbview) + if( document.location.toString().indexOf('slideshow') != -1 ) + { + myLinImage.fullscreenStart(); + } + else + { + myLinImage.loadImage(startImgId); + // setMainHeight(); // defined in LinGlobal.js + window.onresize = onWindowResize; + } } Event.observe(window, 'load', initLinImage, false); Modified: trunk/linpha2/lib/modules/module.basket.php =================================================================== --- trunk/linpha2/lib/modules/module.basket.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/lib/modules/module.basket.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -174,6 +174,6 @@ $linpha->template->setModuleName('basket'); $linpha->template->URL_full = LINPHA_DIR.'/?cat=basket'; -$linpha->template->output['title'] = i18n("Basket"); +$linpha->template->output['title'] = '<a href="'.$linpha->template->URL_full.'">'.i18n("Basket").'</a>'; include_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/global.html.php'); ?> \ No newline at end of file Modified: trunk/linpha2/lib/modules/module.filemanager.php =================================================================== --- trunk/linpha2/lib/modules/module.filemanager.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/lib/modules/module.filemanager.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -931,9 +931,7 @@ <?php $linpha->template->output['default'] = ob_get_clean(); -?> -<?php $linpha->template->setModuleName('default'); $linpha->template->overrideModule('css','filemanager'); $linpha->template->URL_full = LINPHA_DIR.'/?cat=filemanager&id='.$parent_id; Modified: trunk/linpha2/lib/modules/module.settings.php =================================================================== --- trunk/linpha2/lib/modules/module.settings.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/lib/modules/module.settings.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -248,9 +248,8 @@ <hr /> <?php -$linpha->template->output['settings'] = ob_get_clean(); - -$linpha->template->setModuleName('settings'); +$linpha->template->output['default'] = ob_get_clean(); +$linpha->template->setModuleName('default'); $linpha->template->URL_full = LINPHA_DIR.'/?cat=settings'; $linpha->template->output['title'] = i18n("Settings"); include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); Modified: trunk/linpha2/lib/plugins/watermark/func.watermark.php =================================================================== --- trunk/linpha2/lib/plugins/watermark/func.watermark.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/lib/plugins/watermark/func.watermark.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -779,7 +779,7 @@ else { - return '#000000'; + return 'ffffff'; } } } Modified: trunk/linpha2/templates/default/basket.html.php =================================================================== --- trunk/linpha2/templates/default/basket.html.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/basket.html.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,11 +1,11 @@ <div id="divnavigation"> - <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> + <?php echo $tpl->divRoundCorners('top'); ?> <div id="navigation"> <a style="float: left; margin-right: 2px;" class="button" href="<?php echo $_SESSION['basket_ref_url']; ?>"><?php echo i18n("Go Back"); ?></a> - <form name="basket_checkout" style="float: left; margin-right: 2px;" action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> - <select class="button" name="checkout_as" onchange="document.basket_checkout.submit()"> + <form name="basket_checkout" style="float: left; margin-right: 2px;" action="<?php echo $tpl->URL_full; ?>" method="POST"> + <select name="checkout_as" class="linforms" onchange="document.basket_checkout.submit()"> <option value=""><?php echo i18n("Checkout"); ?></option> <option value="download"><?php echo i18n("Download"); ?></option> <option value="mail"><?php echo i18n("Send As Mail"); ?></option> @@ -24,7 +24,7 @@ echo i18n("Select Type Of Archive"); ?> - <form name="zip_selected" action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> + <form name="zip_selected" action="<?php echo $tpl->URL_full; ?>" method="POST"> <select name="ziptype" size="1"> <?php include_once(LINPHA_DIR.'/lib/classes/archiver.class.php'); @@ -74,7 +74,7 @@ $checked_txt = ''; } ?> - <form name="mail_selected" action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> + <form name="mail_selected" action="<?php echo $tpl->URL_full; ?>" method="POST"> <table> <tr> <td width="170"><?php echo i18n("Recipient"); ?>:</td> @@ -136,7 +136,7 @@ } } </script> - <form name="print_selected" action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST" target="_blank"> + <form name="print_selected" action="<?php echo $tpl->URL_full; ?>" method="POST" target="_blank"> <br/><select name="images" size="1" onchange="update_quality_settings()"> <option value="2">2 <?php echo i18n("Images/Page"); ?></option> <option value="4" selected>4 <?php echo i18n("Images/Page"); ?></option> @@ -163,27 +163,27 @@ ?> </div> - <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> + <?php echo $tpl->divRoundCorners('bottom'); ?> </div> <div id="divmain"> - <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> + <?php echo $tpl->divRoundCorners('top'); ?> + <div id="main"> - <div id="main"> - <form name="basket_remove" action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>&cmd=remove_selected" method="POST"> + <form name="basket_remove" action="<?php echo $tpl->URL_full; ?>&cmd=remove_selected" method="POST"> <?php if( count($_SESSION['basket_ids']) > 0 ) { ?> <?php $i = 1; - foreach($GLOBALS['linpha']->template->output['basket_folders'] AS $value) + foreach($tpl->output['basket_folders'] AS $value) { echo setNavigationLine( $value, LINPHA_DIR.'/?cat=alb&id=' ).'<br />'; - foreach($GLOBALS['linpha']->template->output['basket_folder_contents'][$value] AS $sub_value) + foreach($tpl->output['basket_folder_contents'][$value] AS $sub_value) { ?> - <div class='imgdiv'> + <div style='float: left;'> <label for='<?php echo $i; ?>'><img style='cursor: pointer;' src='<?php echo LINPHA_DIR.'/get_thumb.php?id='.$sub_value; ?>' class='img_thumbnail' /></label> <br /> <input type='checkbox' id='<?php echo $i; ?>' name='img_id[]' value='<?php echo $sub_value; ?>'> @@ -194,17 +194,18 @@ echo '<div style="clear: both;"></div><br /><br />'; } ?> + <a class="button" href="<?php echo $tpl->URL_full; ?>&cmd=remove_all"><?php echo i18n("Remove all"); ?></a> + <input class="button" type="submit" name="submit" value="<?php echo i18n("Remove selected"); ?>" /> + <?php } else { echo i18n("Empty Basket"); } ?> - </div> - <a class="button" href="<?php echo $GLOBALS['linpha']->template->URL_full; ?>&cmd=remove_all"><?php echo i18n("Remove all"); ?></a> - <input class="button" type="submit" name="submit" value="<?php echo i18n("Remove selected"); ?>" /> </form> - <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> + </div> + <?php echo $tpl->divRoundCorners('bottom'); ?> </div> </form> \ No newline at end of file Deleted: trunk/linpha2/templates/default/colorsettings.php =================================================================== --- trunk/linpha2/templates/default/colorsettings.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/colorsettings.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,52 +0,0 @@ -<?php -header("Content-Type: text/css"); - -/* - * Created on 26.10.2006 - * - * To change the template for this generated file go to - * Window - Preferences - PHPeclipse - PHP - Code Templates - */ -?> - -/** - * background color - * #divthumbnavi amd #divSlideshowControlsInner used in view_img.html.php - */ - body { - background-color: #<?php echo $_GET['bodybgcolor']; ?>; - } - - #divleft, #divmain, #divright, #divthumbnavi, #divnavigation, #divSlideshowControlsInner, .roundAlphabottomInner { - background-color: #<?php echo $_GET['bgcolor']; ?>; - } - -/** - * font color - */ - body { - color: #<?php echo $_GET['fontcolor']; ?>; - } - -/** - * rounded corner stuff - */ - .roundtop { - background: url(../roundcorners.php?color=<?php echo $_GET['bgcolor']; ?>&bgcolor=<?php echo $_GET['bodybgcolor']; ?>&size=15&align=tr) no-repeat top right; - } - - .roundbottom { - background: url(../roundcorners.php?color=<?php echo $_GET['bgcolor']; ?>&bgcolor=<?php echo $_GET['bodybgcolor']; ?>&size=15&align=br) no-repeat top right; - } - - .roundAlphatop { - position: relative; - /*background: url(../images/tr_alpha.gif) no-repeat top right;*/ - background: url(../roundcorners.php?color=<?php echo $_GET['bgcolor']; ?>&alpha&size=15&align=tr) no-repeat top right; - } - - .roundAlphabottom { - position: relative; - /*background: url(../images/br_alpha.gif) no-repeat top right;*/ - background: url(../roundcorners.php?color=<?php echo $_GET['bgcolor']; ?>&alpha&size=15&align=br) no-repeat top right; - } \ No newline at end of file Modified: trunk/linpha2/templates/default/default.html.php =================================================================== --- trunk/linpha2/templates/default/default.html.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/default.html.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,11 +1,11 @@ <div id="divmain"> - <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> + <?php echo $tpl->divRoundCorners('top'); ?> <div id="main"> <?php -echo $GLOBALS['linpha']->template->output['default']; +echo $tpl->output['default']; ?> </div> - <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> + <?php echo $tpl->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/global.html.php =================================================================== --- trunk/linpha2/templates/default/global.html.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/global.html.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -2,14 +2,16 @@ /** * first output starts here */ +global $tpl; +$tpl = $GLOBALS['linpha']->template; /* @todo */ ?> <?php /*header('Content-type: text/html; charset='.$html_charset);*/ ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> -<title><?php echo $GLOBALS['linpha']->template->linpha_title; ?></title> +<title><?php echo $tpl->linpha_title; ?></title> -<?php $GLOBALS['linpha']->template->includeFile('head'); ?> +<?php $tpl->includeFile('head'); ?> </head> @@ -17,17 +19,15 @@ <body id="linBody"> <!-- syslog --> -<div id="divSyslog"<?php if( ! isset($GLOBALS['linpha']->template->output['sys_log']) ) { echo ' style="display: none;"'; } ?>> +<div id="divSyslog"<?php if( ! isset($tpl->output['sys_log']) ) { echo ' style="display: none;"'; } ?>> <div id="divSyslogClose"><a href="javascript:closeSyslog();">X</a></div> <?php echo i18n("Linpha Syslog"); ?>:<br /> - <div id="divSyslogText"> - <?php echo $GLOBALS['linpha']->template->output['sys_log']; ?> - </div> + <div id="divSyslogText"><?php echo (isset($tpl->output['sys_log']) ? $tpl->output['sys_log'] : ''); ?></div> </div> <!-- title/navigation --> <div id="title"> - <?php echo $GLOBALS['linpha']->template->linpha_title." :: ".$GLOBALS['linpha']->template->output['title']; ?> + <?php echo $tpl->linpha_title." :: ".$tpl->output['title']; ?> </div> <!-- menu --> @@ -59,7 +59,7 @@ <ul> <li> <div> - <form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> + <form action="<?php echo $tpl->URL_full; ?>" method="POST"> <?php if($GLOBALS['linpha']->sql->isLoggedIn()) { ?> <!-- logout infos --> <?php echo i18n("You Are Currently Logged In As:").' '.$_SESSION['user_name'].' ('.$_SESSION['user_displayname'].')<br />'; ?> @@ -79,14 +79,14 @@ </ul> </li> </ul> - <?php if( isset( $GLOBALS['linpha']->template->output['menu_More'] ) ) { - $GLOBALS['linpha']->template->printMenu("More"); + <?php if( isset( $tpl->output['menu_More'] ) ) { + $tpl->printMenu("More"); } ?> <!-- icons --> <div> - <?php if( isset( $GLOBALS['linpha']->template->output['menu_Icons'] ) ) { - echo $GLOBALS['linpha']->template->output['menu_Icons']; + <?php if( isset( $tpl->output['menu_Icons'] ) ) { + echo $tpl->output['menu_Icons']; } ?> </div> @@ -95,13 +95,13 @@ <ul> <li><a href="<?php echo LINPHA_DIR; ?>/?cat=settings"><?php echo i18n("My Settings"); ?></a></li> </ul> - <?php $GLOBALS['linpha']->template->printMenu("Admin",LINPHA_DIR."/admin/"); ?> + <?php $tpl->printMenu("Admin",LINPHA_DIR."/admin/"); ?> <?php } ?> </div> <div style="clear: both;"></div> <!-- end menu --> -<?php $GLOBALS['linpha']->template->includeFile('body'); ?> +<?php $tpl->includeFile('body'); ?> </body> </html> \ No newline at end of file Modified: trunk/linpha2/templates/default/home.html.php =================================================================== --- trunk/linpha2/templates/default/home.html.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/home.html.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,17 +1,17 @@ <div id="divmain"> - <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> + <?php echo $tpl->divRoundCorners('top'); ?> <div id="main"> - <?php echo $GLOBALS['linpha']->template->output['welcome']; ?> + <?php echo $tpl->output['welcome']; ?> <br /> <!-- Random Images --> - <?php if( count($GLOBALS['linpha']->template->output['random_images']) > 0 ) { ?> + <?php if( count($tpl->output['random_images']) > 0 ) { ?> <hr /> <h1><?php echo i18n("Random Images"); ?></h1> <?php - foreach($GLOBALS['linpha']->template->output['random_images'] AS $key=>$value) + foreach($tpl->output['random_images'] AS $key=>$value) { ?> <div class="div_random_img"> @@ -26,11 +26,11 @@ <?php } ?> <!-- New Images --> - <?php if( count($GLOBALS['linpha']->template->output['new_images']) > 0 ) { ?> + <?php if( count($tpl->output['new_images']) > 0 ) { ?> <hr /> <h1><?php echo i18n("New Images"); ?></h1> <?php - foreach($GLOBALS['linpha']->template->output['new_images'] AS $key=>$value) + foreach($tpl->output['new_images'] AS $key=>$value) { ?> <div class="div_new_img"> @@ -48,9 +48,9 @@ <!-- Browse by Date --> <?php if($GLOBALS['linpha']->sql->config->value['sys_style_home_showbrowsebydate'] && - !empty($GLOBALS['linpha']->template->output['browse_by_date'])) { + !empty($tpl->output['browse_by_date'])) { echo "<hr />"; - echo i18n("Browse by Date").': '.$GLOBALS['linpha']->template->output['browse_by_date']; + echo i18n("Browse by Date").': '.$tpl->output['browse_by_date']; echo "<br />"; } ?> @@ -65,6 +65,8 @@ { ?> <div class="div_folder"> + <?php echo $tpl->divRoundCorners('top','','albums'); ?> + <?php echo '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">' . '<img class="img_folder_thumbnail" src="'. LINPHA_DIR.'/get_thumb.php?id=' .$value['id'] .'" alt="thumbnail_album" /></a>'; ?> @@ -77,10 +79,12 @@ <?php echo linStrftime($value['time_add']); ?> </div> + + <?php echo $tpl->divRoundCorners('bottom','','albums'); ?> </div> <?php } ?> <?php } ?> </div> - <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> + <?php echo $tpl->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/search.html.php =================================================================== --- trunk/linpha2/templates/default/search.html.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/search.html.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -14,10 +14,10 @@ <font size="+1"><?php echo i18n("LinPHA Search Page"); ?></font> <hr noshade> <?php -if(isset($GLOBALS['linpha']->template->output['search_error'])) +if(isset($tpl->output['search_error'])) { echo '<div align="center"><b>'; - switch($GLOBALS['linpha']->template->output['search_error']) + switch($tpl->output['search_error']) { case 1: echo i18n("Search string to short, must be at least 2 characters long!"); break; case 2: echo i18n("Error, please check input!"); break; @@ -26,7 +26,7 @@ } ?> <div id="divmain"> - <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> + <?php echo $tpl->divRoundCorners('top'); ?> <div id="main"> @@ -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 $GLOBALS['linpha']->template->layoutsimagespath.'/expand.gif'; ?>" /></a> + <a href="javascript:div_expand('div_<?php echo $meta_type; ?>');"><img border="0" src="<?php echo $tpl->layoutsimagespath.'/expand.gif'; ?>" /></a> <br /> <div id="div_<?php echo $meta_type; ?>" style="border: 1px solid black; width: 200px;"> <?php @@ -228,7 +228,7 @@ </div> - <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> + <?php echo $tpl->divRoundCorners('bottom'); ?> </div> <script language="JavaScript" type="text/javascript"> Deleted: trunk/linpha2/templates/default/settings.html.php =================================================================== --- trunk/linpha2/templates/default/settings.html.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/settings.html.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,15 +0,0 @@ -<div id="divmain"> - <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> - - <div id="main"> - - -<?php -echo $GLOBALS['linpha']->template->output['settings']; -?> - - - </div> - - <?php echo $GLOBALS['linpha']->template->divRoundCorners('bottom'); ?> -</div> \ No newline at end of file Copied: trunk/linpha2/templates/default/themes/default/colorsettings.php (from rev 4601, trunk/linpha2/templates/default/colorsettings.php) =================================================================== --- trunk/linpha2/templates/default/themes/default/colorsettings.php (rev 0) +++ trunk/linpha2/templates/default/themes/default/colorsettings.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -0,0 +1,61 @@ +<?php +header("Content-Type: text/css"); + +/** + * force caching in browser + * works in firefox and internet explorer + */ +Header("Last-Modified: " . gmdate("D, d M Y H:i:s",mktime (0,0,0,1,1,2000)) . " GMT"); // Date in the past +Header("Expires: Mon, 26 Jul 2100 05:00:00 GMT"); // In other words... never expire the image +Header("Cache-Control: max-age=10000000, s-maxage=1000000, proxy-revalidate, must-revalidate"); + + +/* + * Created on 26.10.2006 + * + * To change the template for this generated file go to + * Window - Preferences - PHPeclipse - PHP - Code Templates + */ +?> + +/** + * background color + * #divthumbnavi amd #divSlideshowControlsInner used in view_img.html.php + */ + body { + background-color: #<?php echo $_GET['bodybg']; ?>; + } + + #divleft, #divmain, #divright, #divthumbnavi, #divnavigation, #divSlideshowControlsInner, .roundAlphabottomInner, .button { + background-color: #<?php echo $_GET['bg']; ?>; + } + +/** + * font color + */ + body { + color: #<?php echo $_GET['font']; ?>; + } + +/** + * albums color + */ + .div_folder { + background-color: #<?php echo $_GET['albumsbg']; ?>; + /*border: 1px solid #<?php echo $_GET['albumsborder']; ?>;*/ + } + +/** + * link/form colors + */ + a:link, a:visited, .button { + color: #<?php echo $_GET['links']; ?>; + } + a:hover, .button:hover { + color: #<?php echo $_GET['linkshover']; ?>; + } + + .linforms { + background-color: #d5eeff; + border: 1px solid grey; + } Deleted: trunk/linpha2/templates/default/themes/default/css/basket.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/basket.css 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/themes/default/css/basket.css 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,18 +0,0 @@ -#main { - margin-left: 10px; -} - -.imgdiv { - border: 1px #000000 solid; - margin: 3px; - text-align: center; - float: left; - width: 150px; - height: 150px; -} - -.img_thumbnail { - border: 0; - width: auto; - height: 130px; -} \ No newline at end of file Modified: trunk/linpha2/templates/default/themes/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/global.css 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/themes/default/css/global.css 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,49 +1,40 @@ <!-- /** * common definitions + * All 'em' calculations are based on 1 px = 0.0626em */ body { font-family: arial, helvetica, sans-serif; margin: 0px; padding: 0px; } + + + h1 { + font-size: 18pt; + font-family: Verdana, Arial, Helvetica, sans-serif; + margin: 0px; + margin-bottom: 5px; + padding: 0px; + } - a:link { - color: #666666; - text-decoration: underline; + h2 { + font-size: 14pt; + font-family: Verdana, Arial, Helvetica, sans-serif; + margin: 0px; + margin-bottom: 5px; + padding: 0px; } - a:visited { - color:#666666; - text-decoration: underline; - } - a:hover { - color:#0080D0; - text-decoration: underline; - } /** * link button */ .button, a.button { cursor: pointer; - border: 1px solid #000000; - background-color: #9ACD32; - color: #000000; - padding: 5px; - text-decoration: none; + border: 0; font-size: 10pt; + text-decoration: underline; } - a.button { /* adjust height to same as html element button, it works at least in firefox */ - padding: 6px; - padding-bottom: 7px; - } - - .button:visited, a.button:visited { - color: #000000; - } - .button:hover, a.button:hover { - color: #00FF00; - } /** @@ -103,7 +94,7 @@ padding: 0px; } #main { - padding: 5px; + padding: 10px; } /** @@ -148,7 +139,37 @@ border: 1px solid #f09; } +/** + * folder (used in home view, and maybe as subfolders) + * background-color and border-color are set in colorsettings.php + */ + .div_folder { + margin: 2px; + margin-left: 15px; + margin-bottom: 15px; + width: 700px; + } + + .div_folder_text { + height: 140px; + padding: 5px; + } + + .img_folder_thumbnail { + float: left; + + margin-left: 20px; + margin-right: 30px; + margin-top: 5px; + + width: 130px; + height: 130px; + + border: 0; + } + + /** * menu */ @@ -279,33 +300,4 @@ * end menu */ -/** - * round corners stuff - * (the color and image settings are in the file "colorsettings.php" - */ - img.corner { - width: 15px; - height: 15px; - border: none; - display: block !important; - } - - .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/themes/default/css/home.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/home.css 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/themes/default/css/home.css 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,21 +1,4 @@ -#main { - margin-left: 10px; -} - - -h1 { - font-size: 18pt; - font-family: Verdana, Arial, Helvetica, sans-serif; -} - -h2 { - font-size: 14pt; - font-family: Verdana, Arial, Helvetica, sans-serif; - margin-top: 2px; - margin-bottom: 7px; -} - hr { clear: both; } @@ -35,33 +18,7 @@ height: 130px; } -.div_folder { - position: relative; - margin: 2px; - margin-left: 15px; - margin-bottom: 15px; - padding: 5px; - - height: 151px; - width: 700px; - - background-color: #d5fcf4; - border: 1px solid #0c9; -} - -.div_folder_text { - margin-left: 180px; - height: 140px; - padding: 5px; -} - -.img_folder_thumbnail { - position: absolute; - top: 15px; - left: 20px; - - width: 130px; - height: 130px; - - border: 0; +.div_folder a +{ + text-decoration: none; } \ No newline at end of file Modified: trunk/linpha2/templates/default/themes/default/css/view_img.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/view_img.css 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/themes/default/css/view_img.css 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,14 +1,11 @@ #navigation { -/* margin: 10px 237px 10px 10px;*/ margin: 10px 10px 10px 10px; } #divmain { -/* margin: 10px 237px 10px 10px;*/ margin: 10px 10px 10px 10px; } #main { -/* text-align: center;*/ position: relative; } @@ -65,7 +62,6 @@ } .thumbnavi_prevnextthumb { - /*border: 1px solid #000000;*/ float: left; width: 80px; height: 80px; @@ -73,7 +69,6 @@ } .thumbnavi_currentthumb { - /*border: 1px solid #000000;*/ position: absolute; left: 50%; margin: 2px; @@ -98,17 +93,12 @@ * comment stuff */ .add_comment { -/* 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 { width: 70%; margin-left: 100px; @@ -117,7 +107,6 @@ .comments hr { padding: 0px; margin: 0px; -/* color: #f00;*/ background-color: #f00; height: 1px; } @@ -179,4 +168,20 @@ border: 20px solid white; } +/** + * round corners stuff (only for alpha -> currently only slideshow...) (@todo) + */ + .roundAlphabottomInner { + margin: 0px; + padding: 0px; + margin-left: 15px; + margin-right: 15px; + height: 15px; + } + + img.AlphaCorner { + position: absolute; + top: 0px; + left: 0px; + } Modified: trunk/linpha2/templates/default/themes/default/css/view_thumb.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/view_thumb.css 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/themes/default/css/view_thumb.css 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,18 +1,5 @@ /** - * not used anymore - - need this to calculate heigh of main div - * if you're gettings scrollbars, adjust the height! - * height: 12.52em; dosent work, it increases to much if we adjust browsers font-size - -#spacer_height { - height: 208px; - position: absolute; - visibility: hidden; -}*/ - -/** * page nr */ #divpage_nr { Deleted: trunk/linpha2/templates/default/themes/default/css/view_thumbdetail.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/view_thumbdetail.css 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/themes/default/css/view_thumbdetail.css 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,39 +0,0 @@ -/* deprecated */ - -#navigation { - background-color: #d5fcf4; - padding: 0; - border: 1px solid #0c9; - margin: 10px 10px 10px 237px; -} - -.div_folder { - position: relative; - margin: 2px; - margin-left: 15px; - margin-bottom: 15px; - padding: 5px; - - height: 151px; - width: 700px; - - background-color: #d5fcf4; - border: 1px solid #0c9; -} - -.div_folder_text { - margin-left: 180px; - height: 140px; - padding: 5px; -} - -.img_folder_thumbnail { - position: absolute; - top: 15px; - left: 20px; - - width: 130px; - height: auto; - - border: 0; -} \ No newline at end of file Modified: trunk/linpha2/templates/default/view_albcomment.html.php =================================================================== --- trunk/linpha2/templates/default/view_albcomment.html.php 2006-10-27 21:10:23 UTC (rev 4603) +++ trunk/linpha2/templates/default/view_albcomment.html.php 2006-10-28 16:34:50 UTC (rev 4604) @@ -1,19 +1,19 @@ <div id="divmain"> - <?php echo $GLOBALS['linpha']->template->divRoundCorners('top'); ?> + <?php echo $tpl->divRoundCorners('top'); ?> <div id="main"> - <form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> + <form action="<?php echo $tpl->URL_full; ?>" method="POST"> Author: - <input type="text" name="author" value="<?php echo $GLOBALS['linpha']->template->output['comment_author']; ?>" size="40" maxlength="255" /> + <input type="text" name="author" value="<?php echo $tpl->output['comment_author']; ?>" size="40" maxlength="255" /> <br /> - <textarea name="comment" rows="10" cols="50"><?php echo $GLOBALS['linpha']->template->output['comment_text']; ?></textarea> + <textarea name="comment" rows="10" cols="50"><?php echo $tpl->output['comment_text']; ?></textarea> <br /> <input type="hidden" name="cmd" value="add_comment" /> - <a class="button" href="<?php echo $GLOBALS['linpha']->template->URL_full.'&view=thumb'; ?>">... [truncated message content] |
From: <fan...@us...> - 2006-10-29 00:18:48
|
Revision: 4605 http://svn.sourceforge.net/linpha/?rev=4605&view=rev Author: fangehrn Date: 2006-10-28 17:18:31 -0700 (Sat, 28 Oct 2006) Log Message: ----------- 2006-10-29 flo * changed accesskey for prev/next to page up/down * improved basket view Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/modules/module.basket.php trunk/linpha2/templates/default/basket.html.php trunk/linpha2/templates/default/view_basket.html.php trunk/linpha2/templates/default/view_img.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-28 16:34:50 UTC (rev 4604) +++ trunk/linpha2/ChangeLog 2006-10-29 00:18:31 UTC (rev 4605) @@ -1,3 +1,7 @@ +2006-10-29 flo + * changed accesskey for prev/next to page up/down + * improved basket view + 2006-10-28 flo * improved a lot * reset database and enjoy Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-10-28 16:34:50 UTC (rev 4604) +++ trunk/linpha2/lib/js/LinImage.js 2006-10-29 00:18:31 UTC (rev 4605) @@ -433,48 +433,61 @@ if (e == null) { // ie keycode = event.keyCode; + ctrlKey = event.ctrlKey; } else { // mozilla keycode = e.which; + ctrlKey = e.ctrlKey; } - /*if( e.ctrlKey ) + /*if( ctrlKey ) { alert('ctrl pressed'); return; }*/ + //alert(keycode); + key = String.fromCharCode(keycode).toLowerCase(); - if ((keycode == 39) && (e.ctrlKey == true)) // ctrl + arrow right + //if ((keycode == 39) && (ctrlKey == true)) // ctrl + arrow right + if (keycode == 34) // page down { myLinImage.disableKeyboardNav(); myLinImage.moveNext(); + return false; } - else if ((keycode == 37) && (e.ctrlKey == true)) // ctrl + arrow left + //else if ((keycode == 37) && (ctrlKey == true)) // ctrl + arrow left + else if (keycode == 33) // page up { myLinImage.disableKeyboardNav(); myLinImage.movePrev(); + return false; } - else if ((keycode == 32) && (e.ctrlKey == true)) // ctrl + space + else if ((keycode == 32) && (ctrlKey == true)) // ctrl + space { myLinImage.slideshowStartStop(); } else if ((keycode == 122)) // F11 { if( fullscreenActive ) { + $('divSlideshowExit').show(); // hide exit button to force exit again with F11 myLinImage.fullscreenStop(); } else { + $('divSlideshowExit').hide(); myLinImage.fullscreenStart(); } } - else if ((keycode == 36) && (e.ctrlKey == true)) // ctrl + home + else if ((keycode == 36) && (ctrlKey == true)) // ctrl + home + //else if (keycode == 36) // home { myLinImage.moveFirst(); + return false; } - else if ((keycode == 35) && (e.ctrlKey == true)) // ctrl + end + else if ((keycode == 35) && (ctrlKey == true)) // ctrl + end + //else if (keycode == 35) // end { myLinImage.moveLast(); -// return false; + return false; } else if( fullscreenActive && ((key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) ) // close fullscreen { @@ -494,43 +507,6 @@ 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 - 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(); - }*/ - }, /** Modified: trunk/linpha2/lib/modules/module.basket.php =================================================================== --- trunk/linpha2/lib/modules/module.basket.php 2006-10-28 16:34:50 UTC (rev 4604) +++ trunk/linpha2/lib/modules/module.basket.php 2006-10-29 00:18:31 UTC (rev 4605) @@ -24,6 +24,9 @@ */ if(!defined('LINPHA_DIR')) { exit(1); } +set_time_limit(0); +ini_set('max_execution_time','1000'); + /** * parse POST data and GET commands */ @@ -171,7 +174,31 @@ $GLOBALS['linpha']->template->output['basket_folders'] = array_unique($array_folders); } + + /** + * create select form + */ + $GLOBALS['linpha']->template->output['select_checkout'] = '<option value=""></option>'."\n"; + if( $GLOBALS['linpha']->sql->checkPermission('basket_download') ) + { + $GLOBALS['linpha']->template->output['select_checkout'] .= '<option value="download"'. + (isset($_REQUEST['checkout_as']) && $_REQUEST['checkout_as'] == 'download' ? ' selected="selected"' : ''). + '>'.i18n("Download").'</option>'."\n"; + } + if( $GLOBALS['linpha']->sql->checkPermission('basket_mail') ) + { + $GLOBALS['linpha']->template->output['select_checkout'] .= '<option value="mail"'. + (isset($_REQUEST['checkout_as']) && $_REQUEST['checkout_as'] == 'mail' ? ' selected="selected"' : ''). + '>'.i18n("Send As Mail").'</option>'."\n"; + } + if( $GLOBALS['linpha']->sql->checkPermission('basket_print') ) + { + $GLOBALS['linpha']->template->output['select_checkout'] .= '<option value="print"'. + (isset($_REQUEST['checkout_as']) && $_REQUEST['checkout_as'] == 'print' ? ' selected="selected"' : ''). + '>'.i18n("Print").'</option>'."\n"; + } + $linpha->template->setModuleName('basket'); $linpha->template->URL_full = LINPHA_DIR.'/?cat=basket'; $linpha->template->output['title'] = '<a href="'.$linpha->template->URL_full.'">'.i18n("Basket").'</a>'; Modified: trunk/linpha2/templates/default/basket.html.php =================================================================== --- trunk/linpha2/templates/default/basket.html.php 2006-10-28 16:34:50 UTC (rev 4604) +++ trunk/linpha2/templates/default/basket.html.php 2006-10-29 00:18:31 UTC (rev 4605) @@ -3,29 +3,34 @@ <?php echo $tpl->divRoundCorners('top'); ?> <div id="navigation"> + <?php if(isset($_SESSION['basket_ref_url'])) { ?> <a style="float: left; margin-right: 2px;" class="button" href="<?php echo $_SESSION['basket_ref_url']; ?>"><?php echo i18n("Go Back"); ?></a> - <form name="basket_checkout" style="float: left; margin-right: 2px;" action="<?php echo $tpl->URL_full; ?>" method="POST"> + <?php } ?> + + <br /><br /> + <h1><?php echo i18n("Basket"); ?></h1> + <br /> + <form name="basket_checkout" style="margin-right: 2px;" action="<?php echo $tpl->URL_full; ?>" method="POST"> + <h2>1. <?php echo i18n("Select Checkout"); ?></h2> + <select name="checkout_as" class="linforms" onchange="document.basket_checkout.submit()"> - <option value=""><?php echo i18n("Checkout"); ?></option> - <option value="download"><?php echo i18n("Download"); ?></option> - <option value="mail"><?php echo i18n("Send As Mail"); ?></option> - <option value="print"><?php echo i18n("Print"); ?></option> + <?php echo $tpl->output['select_checkout']; ?> </select> + </form> - <?php echo i18n("Images in basket");?>: <?php echo count($_SESSION['basket_ids']); ?> - <br /><br /> + <br /> + <?php if(isset($_REQUEST['checkout_as'])) { switch($_REQUEST['checkout_as']) { case 'download': - echo '<h2>'.i18n("Basket")." - ".i18n("Download").'</h2>'; - - echo i18n("Select Type Of Archive"); + echo '<h2>2. '.i18n("Download").'</h2>'; + echo '<b>'.i18n("Select Type Of Archive").'</b>'; ?> <form name="zip_selected" action="<?php echo $tpl->URL_full; ?>" method="POST"> - <select name="ziptype" size="1"> + <select name="ziptype" class="linforms" size="1"> <?php include_once(LINPHA_DIR.'/lib/classes/archiver.class.php'); $apps = new Archive_Applications(); @@ -37,11 +42,11 @@ echo '<option value="'.$key.'">'.sprintf(i18n("Create %s Archiv"),$value).'</option>'."\n"; } ?> - </select><br /> + </select> <?php if($GLOBALS['linpha']->sql->isAdmin()) { - echo i18n("Add More Apps"); + echo '('.i18n("Add More Applications").')'; //putHelpButton('archive_apps'); echo "<br />\n\n"; } @@ -49,12 +54,12 @@ <br /> <input type="hidden" name="checkout_as" value="download" /> <input type="hidden" name="cmd" value="checkout" /> - <input type="submit" class="button" name="submit" value="<?php echo i18n("Download Archive"); ?>" /> + <input type="submit" class="button" name="submit" value="<?php echo i18n("Start Download"); ?>" /> </form> <?php break; // end checkout - download case 'mail': - echo '<h2>'.i18n("Basket")." - ".i18n("Send As Mail").'</h2>'; + echo '<h2>2. '.i18n("Send As Mail").'</h2>'; $default_text_message = ''; @@ -113,7 +118,7 @@ <?php break; // end checkout - mail case 'print': - echo '<h2>'.i18n("Basket")." - ".i18n("Print Images").'</h2>'; + echo '<h2>2. '.i18n("Print Images").'</h2>'; ?> <script language="JavaScript" type="text/javascript"> function update_quality_settings() @@ -170,6 +175,8 @@ <div id="divmain"> <?php echo $tpl->divRoundCorners('top'); ?> <div id="main"> + + <b><?php echo i18n("Images in basket").': '.count($_SESSION['basket_ids']); ?></b><br /><br /> <form name="basket_remove" action="<?php echo $tpl->URL_full; ?>&cmd=remove_selected" method="POST"> Modified: trunk/linpha2/templates/default/view_basket.html.php =================================================================== --- trunk/linpha2/templates/default/view_basket.html.php 2006-10-28 16:34:50 UTC (rev 4604) +++ trunk/linpha2/templates/default/view_basket.html.php 2006-10-29 00:18:31 UTC (rev 4605) @@ -39,16 +39,15 @@ /** * add clear float to last div on row */ - if( ($i-1) % $GLOBALS['no_js_nr_cols'] == 0) + if( ($i-1) % $GLOBALS['linpha']->sql->config->value['sys_style_thumb_nojsnrcols'] == 0) { - echo "<div style='height: ".$GLOBALS['def_tn_size']."px; clear: left;' class='imgdiv'>"; - echo "<a href='javascript:void(0)' onclick='check_from_to(".$i.",".($i+$GLOBALS['no_js_nr_cols']-1).")'>Select Row</a><br />"; - echo "<a href='javascript:void(0)' onclick='check_all()'>Select All Of This Page</a>"; + echo "<div style='height: ".$GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']."px; clear: left; float: left;'>"; + echo "<a href='javascript:void(0)' onclick='check_from_to(".$i.",".($i+$GLOBALS['linpha']->sql->config->value['sys_style_thumb_nojsnrcols']-1).")'>Select Row</a><br />"; echo "</div>"; } ?> - <div style='width: <?php echo $GLOBALS['def_tn_size']; ?>px; height: <?php echo $GLOBALS['def_tn_size']; ?>px;' class='imgdiv'> - <label for='<?php echo $i; ?>'><img style='cursor: pointer;' height='<?php echo ($GLOBALS['def_tn_size']-20); ?>' src='./get_thumb.php?id=<?php echo $value['id']; ?>' class='img_thumbnail' /></label> + <div style='width: <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>px; height: <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>px; float: left;'> + <label for='<?php echo $i; ?>'><img style='cursor: pointer;' height='<?php echo ($GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']-20); ?>' src='./get_thumb.php?id=<?php echo $value['id']; ?>' /></label> <div class="img_text"> <input type='checkbox' id='<?php echo $i; ?>' name='img_id[]' value='<?php echo $value['id']; ?>'> @@ -64,30 +63,28 @@ <div style="clear: left;"></div> <br /><br /> - <input class="button" type='submit' value='add to basket'> - <a class="button" href="<?php echo LINPHA_DIR.'?cat=basket&ref_id='.$GLOBALS['linpha']->imgview->id_current.'&cmd=add_all'; ?>">add all of this folder to basket</a> + <a href='javascript:void(0)' class="button" onclick='check_all()'><?php echo i18n("Select all of this page"); ?></a> + <input class="button" type='submit' value='<?php echo i18n("Add to basket"); ?>'> + <a class="button" href="<?php echo $GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_all'; ?>"><?php echo i18n("Add all of this folder to basket"); ?></a> <script language="JavaScript" type='text/javascript'> var checkflag = 0; function check_all() { if (checkflag == 0) // check all { checkflag = 1; - //var return_value = "remove selection"; } else // clear all { checkflag = 0; - //var return_value = "check all of this page"; } - for (var i = 0; i < document.forms[0].length; i++) + for (var i = 0; i < document.getElementsByName('img_id[]').length; i++) { - elem = document.forms[0].elements[i]; + elem = document.getElementsByName('img_id[]')[i]; if (elem.type == "checkbox") { elem.checked = checkflag; } } - return return_value; } function check_from_to(i_start,i_end) Modified: trunk/linpha2/templates/default/view_img.html.php =================================================================== --- trunk/linpha2/templates/default/view_img.html.php 2006-10-28 16:34:50 UTC (rev 4604) +++ trunk/linpha2/templates/default/view_img.html.php 2006-10-29 00:18:31 UTC (rev 4605) @@ -103,7 +103,7 @@ <div id="divSlideshowImgNr" style="float: left; margin-left: 40px; "></div> - <div style="float: left; margin-left: 40px; "> + <div id="divSlideshowExit" style="float: left; margin-left: 40px; "> <a href="javascript:myLinImage.fullscreenStop()"><img src="<?php echo LINPHA_DIR; ?>/lib/graphics/ss_stop.gif" width="25" height="25" border="0" alt="Exit" title="<?php echo i18n("Exit Fullscreen"); ?>" ></a> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2006-10-29 13:25:20
|
Revision: 4607 http://svn.sourceforge.net/linpha/?rev=4607&view=rev Author: fangehrn Date: 2006-10-29 05:24:46 -0800 (Sun, 29 Oct 2006) Log Message: ----------- * added new version csshover.htc * fixed thumbview spacers to best fit in firefox, opera and internet explorer Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/docs/dev/external_libraries.txt trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.template.class.php trunk/linpha2/lib/js/LinThumbnails.js trunk/linpha2/templates/default/themes/default/DefsThumbView.js trunk/linpha2/templates/default/themes/default/css/global.css trunk/linpha2/templates/default/themes/default/css/view_thumb.css trunk/linpha2/templates/default/view_thumb.head.php trunk/linpha2/templates/default/view_thumb.html.php Added Paths: ----------- trunk/linpha2/templates/misc/roundcorners.php trunk/linpha2/templates/misc/roundcorners_test.php Removed Paths: ------------- trunk/linpha2/templates/default/themes/default/css/csshover.htc trunk/linpha2/templates/roundcorners.php trunk/linpha2/templates/roundcorners_test.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/ChangeLog 2006-10-29 13:24:46 UTC (rev 4607) @@ -1,6 +1,8 @@ 2006-10-29 flo * changed accesskey for prev/next to page up/down * improved basket view + * added new version csshover.htc + * fixed thumbview spacers to best fit in firefox, opera and internet explorer 2006-10-28 flo * improved a lot Modified: trunk/linpha2/docs/dev/external_libraries.txt =================================================================== --- trunk/linpha2/docs/dev/external_libraries.txt 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/docs/dev/external_libraries.txt 2006-10-29 13:24:46 UTC (rev 4607) @@ -1,7 +1,15 @@ +- csshover.htc V1.42.060206 -phpmail.class.php +- scriptaculous 1.6.4 (contains prototype) +- prototype 1.5.0_rc1 +- adodb + +- getid3 + +- phpmail.class.php + line 560 from @@ -10,7 +18,7 @@ include_once(LINPHA_DIR . "/lib/classes/smtp.class.php"); -PHP_JPEG_Metadata_Toolkit_1.11 +- PHP_JPEG_Metadata_Toolkit_1.11 CHANGES ------- Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-29 13:24:46 UTC (rev 4607) @@ -579,6 +579,7 @@ $array_image_infos = MetaData::readInformations( $full_filename, $filename, $md5sum, $flag_nr ); $index = 'before'; + $i=0; foreach($array_image_infos AS $value) { /** @@ -593,14 +594,17 @@ if($index == 'before') { $GLOBALS['linpha']->template->output['thumb_infos'][$photo_value['id']]['before'] .= $value['value'].'<br />'; // $value['value'] is already escaped + $i++; } elseif($index == 'after') { $GLOBALS['linpha']->template->output['thumb_infos'][$photo_value['id']]['after'] .= $value['value'].'<br />'; // $value['value'] is already escaped + $i++; } } } + $this->nr_text_lines = $i; // used in LinThumbnails.js to calculate the space for the thumb height $GLOBALS['linpha']->template->output['thumb_infos'][$photo_value['id']]['title'] = $photo_value['name']; // $photo_value['name'] is already escaped } Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-29 13:24:46 UTC (rev 4607) @@ -98,7 +98,7 @@ <!--[if lt IE 7]> <style type="text/css" media="screen"> body { - behavior: url(templates/default/css/csshover.htc); + behavior: url(templates/misc/csshover.htc); /* enable span:hover */ font-size: 100%; } @@ -258,15 +258,15 @@ if(empty($alpha)) // default { - $str = '<div style="background: url('.LINPHA_DIR.'/templates/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignright.') no-repeat top right;">'; - $str .= '<img src="'.LINPHA_DIR.'/templates/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignleft.'" alt="" width="'.$size.'" height="'.$size.'" class="corner" />'; + $str = '<div style="background: url('.LINPHA_DIR.'/misc/templates/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignright.') no-repeat top right;">'; + $str .= '<img src="'.LINPHA_DIR.'/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_DIR.'/templates/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&alpha&align='.$alignright.') no-repeat top right;">'; + $str = '<div style="position: relative; background: url('.LINPHA_DIR.'/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_DIR.'/templates/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignleft.'&alpha" alt="" width="'.$size.'" height="'.$size.'" class="AlphaCorner" />'; + $str .= '<img src="'.LINPHA_DIR.'/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/js/LinThumbnails.js =================================================================== --- trunk/linpha2/lib/js/LinThumbnails.js 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/lib/js/LinThumbnails.js 2006-10-29 13:24:46 UTC (rev 4607) @@ -23,6 +23,8 @@ function display_images() { +// alert( $('main')['offsetHeight'] ); + /** * set correct main height only if photos_per_page == auto * needs to be in display_images! @@ -35,8 +37,8 @@ switch( photos_per_page ) { case 'auto': - var nr_cols = Math.floor( document.getElementById('main')['offsetWidth'] / (tn_size + img_spacer_width) ); - var nr_rows = Math.floor( document.getElementById('main')['offsetHeight'] / (tn_size + img_spacer_height + img_div_spacer_height) ); + var nr_cols = Math.floor( (document.getElementById('main')['offsetWidth']-main_spacer_width) / (tn_size + img_spacer_width) ); + var nr_rows = Math.floor( (document.getElementById('main')['offsetHeight']-main_spacer_height) / (tn_size + img_spacer_height + (img_div_spacer_height*nr_text_lines) ) ); var max_photos_per_page = nr_rows * nr_cols; break; case 'all': @@ -87,36 +89,35 @@ var img_nr = 1; var startup_img_nr = (current_page - 1)*max_photos_per_page; - var DivMain = document.getElementById("main"); - DivMain.innerHTML=''; + $('main').innerHTML=''; divhtmltext = ''; + if(view_mode == 'thumbdetail') { + var style2text = ' divimgdetail'; + var style3text = 'divtextdetail'; + } else { + var style2text = ''; + var style3text = 'divtext'; + } + for (i in img_ids) { if(i >= startup_img_nr && img_nr <= max_photos_per_page) { if( (img_nr-1) % nr_cols == 0) { - var styletext = ' style="clear:left;"'; - } else { - var styletext = ''; + //var styletext = ' style="clear:left;"'; + divhtmltext += '<div style="clear: left;"></div>'; } - if(view_mode == 'thumbdetail') { - var style2text = ' divimgdetail'; - } else { - var style2text = ''; - } - - divhtmltext += - '<div id="div' + i + '"' + styletext + ' class="divthumb">' + + '<div id="divthumb' + i + '" class="divthumb">' + img_ids[i]['before'] + '<div class="divimg' + style2text + '">' + '<a href="' + link_url + '&id=' + img_ids[i]['id'] + '">' + '<img src="' + link_get_thumb + img_ids[i]['id'] + '"' + ' height="' + tn_size + '" width="' + tn_size + '" ' + ' alt="' + img_ids[i]['title'] + '" title="' + img_ids[i]['title'] + '"' + ' class="imgthumb" />' + - '</a></div><div class="divtext">' + img_ids[i]['after'] + '</div></div>'; + '</a></div><div class="' + style3text + '">' + img_ids[i]['after'] + '</div></div>'; /** * flush buffer of divhtmltext on end of line @@ -127,7 +128,7 @@ */ if( (img_nr-1) % nr_cols == 0) { - DivMain.innerHTML += divhtmltext; + $('main').innerHTML += divhtmltext; divhtmltext = ''; } @@ -135,9 +136,19 @@ } } - DivMain.innerHTML += divhtmltext; + $('main').innerHTML += divhtmltext; } +/** + * resize_window, use this function between because internet explorer triggers the resize event to fast + */ +var timerResize; +function resize_window() +{ + clearTimeout(timerResize); + timerResize=setTimeout(display_images,250); +} + function goto_page(nr) { current_page = nr; @@ -426,8 +437,6 @@ location.href = link_url + '&id=' + img_ids[0]['id'] + '&slideshow'; } -/** - * function view_source_code() removed - * use firefox extension "Aardvark" - * much nicer ;-) - */ \ No newline at end of file +Event.observe(window, 'load', display_images, false); +Event.observe(window, 'resize', resize_window, false); + \ No newline at end of file Modified: trunk/linpha2/templates/default/themes/default/DefsThumbView.js =================================================================== --- trunk/linpha2/templates/default/themes/default/DefsThumbView.js 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/templates/default/themes/default/DefsThumbView.js 2006-10-29 13:24:46 UTC (rev 4607) @@ -4,15 +4,19 @@ * * better a space more than a space too less */ + +var main_spacer_width = 20; // padding left and right +var main_spacer_height = 0; + if(view_mode == 'thumbdetail') { - var img_spacer_width = 150 + 28; // used to calculate nr_cols, 150 = width of text div, 28 = overhead - var img_spacer_height = 10; // used to calculate nr_rows - var img_div_spacer_height = 0; // used to calculate max-height of the image (depending how much text we would like to add at bottom) + var img_spacer_width = 162; // used to calculate nr_cols, 150 = width of text div, 12 = space between thumbs + var img_spacer_height = 4; // used to calculate nr_rows, 4 = space between thumbs + var img_div_spacer_height = 0; // in detail mode, we dont have any text at bottom of the image } else // 'thumb' { - var img_spacer_width = 12; // used to calculate nr_cols - var img_spacer_height = 11; // used to calculate nr_rows - var img_div_spacer_height = 11; // used to calculate max-height of the image (depending how much text we would like to add at bottom) + var img_spacer_width = 4; // used to calculate nr_cols, 4 = space between thumbs + var img_spacer_height = 4; // used to calculate nr_rows, 4 = space between thumbs + var img_div_spacer_height = 16; // used to calculate max-height of the image (this value is multiplied with the number of text lines (filename, etc.) } \ No newline at end of file Deleted: trunk/linpha2/templates/default/themes/default/css/csshover.htc =================================================================== --- trunk/linpha2/templates/default/themes/default/css/csshover.htc 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/templates/default/themes/default/css/csshover.htc 2006-10-29 13:24:46 UTC (rev 4607) @@ -1,115 +0,0 @@ -<attach event="ondocumentready" handler="parseStylesheets" /> -<script> -/** - * Whatever:hover - V1.41.050927 - hover & active - * ------------------------------------------------------------ - * (c) 2005 - Peter Nederlof - * Peterned - http://www.xs4all.nl/~peterned/ - * License - http://creativecommons.org/licenses/LGPL/2.1/ - * - * Whatever:hover is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * Whatever:hover 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 - * Lesser General Public License for more details. - * - * Credits and thanks to: - * Arnoud Berendsen, Martin Reurings, Robert Hanson - * - * howto: body { behavior:url("csshover.htc"); } - * ------------------------------------------------------------ - */ - -var csshoverReg = /(^|\s)(([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(hover|active)/i, -currentSheet, doc = window.document, hoverEvents = [], activators = { - onhover:{on:'onmouseover', off:'onmouseout'}, - onactive:{on:'onmousedown', off:'onmouseup'} -} - -function parseStylesheets() { - if(!/MSIE (5|6)/.test(navigator.userAgent)) return; - window.attachEvent('onunload', unhookHoverEvents); - var sheets = doc.styleSheets, l = sheets.length; - for(var i=0; i<l; i++) - parseStylesheet(sheets[i]); -} - function parseStylesheet(sheet) { - if(sheet.imports) { - try { - var imports = sheet.imports, l = imports.length; - for(var i=0; i<l; i++) parseStylesheet(sheet.imports[i]); - } catch(securityException){} - } - - try { - var rules = (currentSheet = sheet).rules, l = rules.length; - for(var j=0; j<l; j++) parseCSSRule(rules[j]); - } catch(securityException){} - } - - function parseCSSRule(rule) { - var select = rule.selectorText, style = rule.style.cssText; - if(!csshoverReg.test(select) || !style) return; - - var pseudo = select.replace(/[^:]+:([a-z-]+).*/i, 'on$1'); - var newSelect = select.replace(/(\.([a-z0-9_-]+):[a-z]+)|(:[a-z]+)/gi, '.$2' + pseudo); - var className = (/\.([a-z0-9_-]*on(hover|active))/i).exec(newSelect)[1]; - var affected = select.replace(/:(hover|active).*$/, ''); - var elements = getElementsBySelect(affected); - if(elements.length == 0) return; - - currentSheet.addRule(newSelect, style); - for(var i=0; i<elements.length; i++) - new HoverElement(elements[i], className, activators[pseudo]); - } - -function HoverElement(node, className, events) { - if(!node.hovers) node.hovers = {}; - if(node.hovers[className]) return; - node.hovers[className] = true; - hookHoverEvent(node, events.on, function() { node.className += ' ' + className; }); - hookHoverEvent(node, events.off, function() { node.className = node.className.replace(new RegExp('\\s+'+className, 'g'),''); }); -} - function hookHoverEvent(node, type, handler) { - node.attachEvent(type, handler); - hoverEvents[hoverEvents.length] = { - node:node, type:type, handler:handler - }; - } - - function unhookHoverEvents() { - for(var e,i=0; i<hoverEvents.length; i++) { - e = hoverEvents[i]; - e.node.detachEvent(e.type, e.handler); - } - } - -function getElementsBySelect(rule) { - var parts, nodes = [doc]; - parts = rule.split(' '); - for(var i=0; i<parts.length; i++) { - nodes = getSelectedNodes(parts[i], nodes); - } return nodes; -} - function getSelectedNodes(select, elements) { - var result, node, nodes = []; - var identify = (/\#([a-z0-9_-]+)/i).exec(select); - if(identify) return [doc.getElementById(identify[1])]; - - var classname = (/\.([a-z0-9_-]+)/i).exec(select); - var tagName = select.replace(/(\.|\#|\:)[a-z0-9_-]+/i, ''); - var classReg = classname? new RegExp('\\b' + classname[1] + '\\b'):false; - for(var i=0; i<elements.length; i++) { - result = tagName? elements[i].all.tags(tagName):elements[i].all; - for(var j=0; j<result.length; j++) { - node = result[j]; - if(classReg && !classReg.test(node.className)) continue; - nodes[nodes.length] = node; - } - } return nodes; - } -</script> \ No newline at end of file Modified: trunk/linpha2/templates/default/themes/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/global.css 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/templates/default/themes/default/css/global.css 2006-10-29 13:24:46 UTC (rev 4607) @@ -94,7 +94,9 @@ padding: 0px; } #main { - padding: 10px; + padding: 0px; + padding-left: 10px; + padding-right: 10px; } /** @@ -191,7 +193,7 @@ /** * hover */ - #menu a:hover, #menu span:hover { + #menu li a:hover, #menu span:hover { background: #bbbbbb; } @@ -228,6 +230,15 @@ color: #000000; /*background: #FFFFFF;*/ } + #menu ul span { + background: url(../images/expand.gif) no-repeat 100% 100%; + } + + + #menu li { + position: relative; + } + /** * only two or more level elements @@ -259,10 +270,6 @@ border-top-width: 0px; background: #eeeeee; } - - #menu ul span { - background: url(../images/expand.gif) no-repeat 100% 100%; - } #menu ul ul span { background: #eeeeee url(../images/expand.gif) no-repeat 100% 100%; } @@ -271,23 +278,19 @@ * the most important thing * enable/disable submenus */ - #menu li { - position: relative; - } + div#menu ul ul, + div#menu ul li:hover ul ul, + div#menu ul ul li:hover ul ul + { + display: none; + } + div#menu ul li:hover ul, + div#menu ul ul li:hover ul, + div#menu ul ul ul li:hover ul + { + display: block; + } - div#menu ul ul, - div#menu ul li:hover ul ul, - div#menu ul ul li:hover ul ul - { - display: none; - } - div#menu ul li:hover ul, - div#menu ul ul li:hover ul, - div#menu ul ul ul li:hover ul - { - display: block; - } - /** * third stage, switch to horizontal menu entries */ Modified: trunk/linpha2/templates/default/themes/default/css/view_thumb.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/view_thumb.css 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/templates/default/themes/default/css/view_thumb.css 2006-10-29 13:24:46 UTC (rev 4607) @@ -33,23 +33,44 @@ /** * thumbnails */ + #main { + /*border: 1px solid black;*/ + } + .divthumb { /* outer div */ - margin: 3px; + margin: 0px; + padding: 0px; + margin-right: 5px; + margin-bottom: 5px; + text-align: center; float: left; font-size: 8pt; } .divimg { /* inner div with thumbnail */ + margin: 0px; + padding: 0px; } .divimgdetail { /* in detail mode, additional to .divimg */ + margin: 0px; + padding: 0px; float: left; } .imgthumb { /* thumbnail */ + margin: 0px; + padding: 0px; border: 0; } .divtext { /* inner div with bottom or right text */ - padding-left: 10px; + margin: 0px; + padding: 0px; + text-align: center; + } + .divtextdetail { + margin: 0px; + padding: 0px; + padding-left: 5px; text-align: left; width: 150px; /* hardcoded in LinThumbnails.js */ float: left; Modified: trunk/linpha2/templates/default/view_thumb.head.php =================================================================== --- trunk/linpha2/templates/default/view_thumb.head.php 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/templates/default/view_thumb.head.php 2006-10-29 13:24:46 UTC (rev 4607) @@ -6,6 +6,7 @@ var tn_size = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>; var photos_per_page = 'auto'; var view_mode = '<?php echo $_SESSION['mode_thumbview']; ?>'; +var nr_text_lines = <?php echo $GLOBALS['linpha']->imgview->nr_text_lines; ?>; <?php echo $tpl->output['files_db']."\n"; ?> </script> Modified: trunk/linpha2/templates/default/view_thumb.html.php =================================================================== --- trunk/linpha2/templates/default/view_thumb.html.php 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/templates/default/view_thumb.html.php 2006-10-29 13:24:46 UTC (rev 4607) @@ -1,10 +1,4 @@ -<script language="JavaScript" type="text/javascript"> -<!-- - window.onresize = display_images; -//--> -</script> - <!-- navigation --> <?php if(isset($tpl->output['navigation']) && !empty($tpl->output['navigation'])) { ?> <div id="divnavigation"> @@ -39,7 +33,3 @@ <?php echo $tpl->divRoundCorners('bottom'); ?> </div> - -<script language="JavaScript" type="text/javascript"> -display_images(); -</script> \ No newline at end of file Copied: trunk/linpha2/templates/misc/roundcorners.php (from rev 4603, trunk/linpha2/templates/roundcorners.php) =================================================================== --- trunk/linpha2/templates/misc/roundcorners.php (rev 0) +++ trunk/linpha2/templates/misc/roundcorners.php 2006-10-29 13:24:46 UTC (rev 4607) @@ -0,0 +1,87 @@ +<?php +if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','../..'); } + +include_once( LINPHA_DIR.'/lib/plugins/watermark/func.watermark.php' ); + +if(!isset($_GET['color'])) +{ + $_GET['color'] = 'orange'; +} + +if(!isset($_GET['bgcolor'])) +{ + $_GET['bgcolor'] = 'white'; +} + +if(!isset($_GET['align'])) +{ + $_GET['align'] = 'tl'; +} + +if(!isset($_GET['size'])) +{ + $size = 15; +} +else +{ + $size = $_GET['size']; +} + +switch($_GET['align']) +{ +case 'tl': $cx = $size; $cy = $size; $workaround = 0; break; +case 'tr': $cx = -1; $cy = $size; $workaround = 0; break; +case 'bl': $cx = $size; $cy = 0; $workaround = 1; break; +case 'br': $cx = -1; $cy = -1; $workaround = 1; break; +} + +// create image +$image = imagecreatetruecolor($size, $size); + +// create colors +$rgb = get_rgb_from_all($_GET['color']); +$color = imagecolorallocate($image, $rgb['r'], $rgb['g'], $rgb['b']); + +if(isset($_GET['alpha'])) +{ + imageAlphaBlending($image, false); + imageSaveAlpha($image, true); + $bgcolor = imagecolorallocatealpha($image, 0, 0, 0, 127); +} +else +{ + $rgb = get_rgb_from_all($_GET['bgcolor']); + $bgcolor = imagecolorallocate($image, $rgb['r'], $rgb['g'], $rgb['b']); +} + +// fill image with background color +imagefill($image, 0, 0, $bgcolor); + + +// draw circly +imagefilledellipse($image, $cx, $cy, ($size*2), ($size*2), $color); + +// workaround +if($workaround) +{ + imageline($image, 0, 0, $size-1, 0, $color ); +} + +// flush image +Header('Content-type: image/png'); + +/** + * force caching in browser + * works in firefox and internet explorer + */ +Header("Last-Modified: " . gmdate("D, d M Y H:i:s",mktime (0,0,0,1,1,2000)) . " GMT"); // Date in the past +Header("Expires: Mon, 26 Jul 2100 05:00:00 GMT"); // In other words... never expire the image +Header("Cache-Control: max-age=10000000, s-maxage=1000000, proxy-revalidate, must-revalidate"); + + + +imagepng($image); +imagedestroy($image); + + +?> \ No newline at end of file Copied: trunk/linpha2/templates/misc/roundcorners_test.php (from rev 4601, trunk/linpha2/templates/roundcorners_test.php) =================================================================== --- trunk/linpha2/templates/misc/roundcorners_test.php (rev 0) +++ trunk/linpha2/templates/misc/roundcorners_test.php 2006-10-29 13:24:46 UTC (rev 4607) @@ -0,0 +1,23 @@ +<body style="background: blue;"> + +<img src="roundcorners.php?align=tl" /><br /><br /> +<img src="roundcorners.php?align=tr" /><br /><br /> +<img src="roundcorners.php?align=bl" /><br /><br /> +<img src="roundcorners.php?align=br" /><br /><br /> + +<img src="roundcorners.php?align=tl&alpha" /><br /><br /> +<img src="roundcorners.php?align=tr&alpha" /><br /><br /> +<img src="roundcorners.php?align=bl&alpha" /><br /><br /> +<img src="roundcorners.php?align=br&alpha" /><br /><br /> + +<img src="roundcorners.php?align=tl&size=100&color=pink" /><br /><br /> +<img src="roundcorners.php?align=tr&size=75&color=skyblue" /><br /><br /> +<img src="roundcorners.php?align=bl&size=50&color=gray" /><br /><br /> +<img src="roundcorners.php?align=br&size=25&color=red" /><br /><br /> + +<img src="roundcorners.php?align=tl&size=100&color=pink&alpha" /><br /><br /> +<img src="roundcorners.php?align=tr&size=75&color=skyblue&alpha" /><br /><br /> +<img src="roundcorners.php?align=bl&size=50&color=gray&alpha" /><br /><br /> +<img src="roundcorners.php?align=br&size=25&color=red&alpha" /><br /><br /> + +</body> \ No newline at end of file Deleted: trunk/linpha2/templates/roundcorners.php =================================================================== --- trunk/linpha2/templates/roundcorners.php 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/templates/roundcorners.php 2006-10-29 13:24:46 UTC (rev 4607) @@ -1,87 +0,0 @@ -<?php -if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','..'); } - -include_once( LINPHA_DIR.'/lib/plugins/watermark/func.watermark.php' ); - -if(!isset($_GET['color'])) -{ - $_GET['color'] = 'orange'; -} - -if(!isset($_GET['bgcolor'])) -{ - $_GET['bgcolor'] = 'white'; -} - -if(!isset($_GET['align'])) -{ - $_GET['align'] = 'tl'; -} - -if(!isset($_GET['size'])) -{ - $size = 15; -} -else -{ - $size = $_GET['size']; -} - -switch($_GET['align']) -{ -case 'tl': $cx = $size; $cy = $size; $workaround = 0; break; -case 'tr': $cx = -1; $cy = $size; $workaround = 0; break; -case 'bl': $cx = $size; $cy = 0; $workaround = 1; break; -case 'br': $cx = -1; $cy = -1; $workaround = 1; break; -} - -// create image -$image = imagecreatetruecolor($size, $size); - -// create colors -$rgb = get_rgb_from_all($_GET['color']); -$color = imagecolorallocate($image, $rgb['r'], $rgb['g'], $rgb['b']); - -if(isset($_GET['alpha'])) -{ - imageAlphaBlending($image, false); - imageSaveAlpha($image, true); - $bgcolor = imagecolorallocatealpha($image, 0, 0, 0, 127); -} -else -{ - $rgb = get_rgb_from_all($_GET['bgcolor']); - $bgcolor = imagecolorallocate($image, $rgb['r'], $rgb['g'], $rgb['b']); -} - -// fill image with background color -imagefill($image, 0, 0, $bgcolor); - - -// draw circly -imagefilledellipse($image, $cx, $cy, ($size*2), ($size*2), $color); - -// workaround -if($workaround) -{ - imageline($image, 0, 0, $size-1, 0, $color ); -} - -// flush image -Header('Content-type: image/png'); - -/** - * force caching in browser - * works in firefox and internet explorer - */ -Header("Last-Modified: " . gmdate("D, d M Y H:i:s",mktime (0,0,0,1,1,2000)) . " GMT"); // Date in the past -Header("Expires: Mon, 26 Jul 2100 05:00:00 GMT"); // In other words... never expire the image -Header("Cache-Control: max-age=10000000, s-maxage=1000000, proxy-revalidate, must-revalidate"); - - - -imagepng($image); -imagedestroy($image); - - -?> \ No newline at end of file Deleted: trunk/linpha2/templates/roundcorners_test.php =================================================================== --- trunk/linpha2/templates/roundcorners_test.php 2006-10-29 13:12:56 UTC (rev 4606) +++ trunk/linpha2/templates/roundcorners_test.php 2006-10-29 13:24:46 UTC (rev 4607) @@ -1,23 +0,0 @@ -<body style="background: blue;"> - -<img src="roundcorners.php?align=tl" /><br /><br /> -<img src="roundcorners.php?align=tr" /><br /><br /> -<img src="roundcorners.php?align=bl" /><br /><br /> -<img src="roundcorners.php?align=br" /><br /><br /> - -<img src="roundcorners.php?align=tl&alpha" /><br /><br /> -<img src="roundcorners.php?align=tr&alpha" /><br /><br /> -<img src="roundcorners.php?align=bl&alpha" /><br /><br /> -<img src="roundcorners.php?align=br&alpha" /><br /><br /> - -<img src="roundcorners.php?align=tl&size=100&color=pink" /><br /><br /> -<img src="roundcorners.php?align=tr&size=75&color=skyblue" /><br /><br /> -<img src="roundcorners.php?align=bl&size=50&color=gray" /><br /><br /> -<img src="roundcorners.php?align=br&size=25&color=red" /><br /><br /> - -<img src="roundcorners.php?align=tl&size=100&color=pink&alpha" /><br /><br /> -<img src="roundcorners.php?align=tr&size=75&color=skyblue&alpha" /><br /><br /> -<img src="roundcorners.php?align=bl&size=50&color=gray&alpha" /><br /><br /> -<img src="roundcorners.php?align=br&size=25&color=red&alpha" /><br /><br /> - -</body> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2006-10-29 13:35:56
|
Revision: 4608 http://svn.sourceforge.net/linpha/?rev=4608&view=rev Author: fangehrn Date: 2006-10-29 05:35:39 -0800 (Sun, 29 Oct 2006) Log Message: ----------- * fixed thumbview spacers to best fit in firefox, opera and internet explorer Modified Paths: -------------- trunk/linpha2/lib/classes/linpha.template.class.php trunk/linpha2/templates/default/themes/default/DefsThumbView.js Removed Paths: ------------- trunk/linpha2/templates/default/themes/default/images/bl.gif trunk/linpha2/templates/default/themes/default/images/bl_alpha.gif trunk/linpha2/templates/default/themes/default/images/br.gif trunk/linpha2/templates/default/themes/default/images/br_alpha.gif trunk/linpha2/templates/default/themes/default/images/tl.gif trunk/linpha2/templates/default/themes/default/images/tl_alpha.gif trunk/linpha2/templates/default/themes/default/images/tr.gif trunk/linpha2/templates/default/themes/default/images/tr_alpha.gif Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-29 13:24:46 UTC (rev 4607) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-29 13:35:39 UTC (rev 4608) @@ -258,7 +258,7 @@ if(empty($alpha)) // default { - $str = '<div style="background: url('.LINPHA_DIR.'/misc/templates/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignright.') no-repeat top right;">'; + $str = '<div style="background: url('.LINPHA_DIR.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignright.') no-repeat top right;">'; $str .= '<img src="'.LINPHA_DIR.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignleft.'" alt="" width="'.$size.'" height="'.$size.'" class="corner" />'; $str .= '</div>'; } Modified: trunk/linpha2/templates/default/themes/default/DefsThumbView.js =================================================================== --- trunk/linpha2/templates/default/themes/default/DefsThumbView.js 2006-10-29 13:24:46 UTC (rev 4607) +++ trunk/linpha2/templates/default/themes/default/DefsThumbView.js 2006-10-29 13:35:39 UTC (rev 4608) @@ -16,7 +16,7 @@ } else // 'thumb' { - var img_spacer_width = 4; // used to calculate nr_cols, 4 = space between thumbs + var img_spacer_width = 7; // used to calculate nr_cols, 4 = space between thumbs var img_spacer_height = 4; // used to calculate nr_rows, 4 = space between thumbs var img_div_spacer_height = 16; // used to calculate max-height of the image (this value is multiplied with the number of text lines (filename, etc.) } \ No newline at end of file Deleted: trunk/linpha2/templates/default/themes/default/images/bl.gif =================================================================== (Binary files differ) Deleted: trunk/linpha2/templates/default/themes/default/images/bl_alpha.gif =================================================================== (Binary files differ) Deleted: trunk/linpha2/templates/default/themes/default/images/br.gif =================================================================== (Binary files differ) Deleted: trunk/linpha2/templates/default/themes/default/images/br_alpha.gif =================================================================== (Binary files differ) Deleted: trunk/linpha2/templates/default/themes/default/images/tl.gif =================================================================== (Binary files differ) Deleted: trunk/linpha2/templates/default/themes/default/images/tl_alpha.gif =================================================================== (Binary files differ) Deleted: trunk/linpha2/templates/default/themes/default/images/tr.gif =================================================================== (Binary files differ) Deleted: trunk/linpha2/templates/default/themes/default/images/tr_alpha.gif =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2006-10-29 23:56:13
|
Revision: 4609 http://svn.sourceforge.net/linpha/?rev=4609&view=rev Author: fangehrn Date: 2006-10-29 15:55:17 -0800 (Sun, 29 Oct 2006) Log Message: ----------- 2006-10-30 flo * implemented ajax login/logout * implemented "view at" * implemented ajax menuReload -> while navigating through the images, the menu is not actual anymore -> now, the menu gets reloaded on mouseover if it needs updating * and maybe some other stuff Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/docs/dev/TODO.txt trunk/linpha2/index.php trunk/linpha2/install/sql/sql.data.php trunk/linpha2/lib/classes/linpha.admin.class.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.import.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/upgrade.php trunk/linpha2/lib/js/LinGlobal.js trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/js/LinThumbnails.js trunk/linpha2/lib/modules/module.ajax.php trunk/linpha2/lib/modules/module.filemanager.php trunk/linpha2/templates/default/basket.html.php trunk/linpha2/templates/default/global.html.php trunk/linpha2/templates/default/themes/default/css/admin.css trunk/linpha2/templates/default/themes/default/css/global.css trunk/linpha2/templates/default/themes/default/css/view_img.css 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_thumb.html.php trunk/linpha2/templates/default/view_thumb_static.html.php Added Paths: ----------- trunk/linpha2/lib/modules/module.empty.php trunk/linpha2/templates/default/fragments.php Removed Paths: ------------- trunk/linpha2/templates/default/themes/default/css/view_basket.css Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/ChangeLog 2006-10-29 23:55:17 UTC (rev 4609) @@ -1,3 +1,12 @@ +2006-10-30 flo + * implemented ajax login/logout + * implemented "view at" + * implemented ajax menuReload + -> while navigating through the images, the menu is not actual anymore + -> now, the menu gets reloaded on mouseover if it needs updating + + * and maybe some other stuff + 2006-10-29 flo * changed accesskey for prev/next to page up/down * improved basket view Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/docs/dev/TODO.txt 2006-10-29 23:55:17 UTC (rev 4609) @@ -8,12 +8,6 @@ ## Big Todos -- Style - - use relative font sizes instead of aboslute - - style forms this way http://www.cssplay.co.uk/menu/form.html - not that much colors, but with alignments and <label> - - - Installer - define final installer behaviour - if installation is complete, the user must delete the install/ folder ? (install/ignore_delete_install_msg.txt) @@ -58,12 +52,12 @@ - - - - DONE ==== +- Style + - use relative font sizes instead of aboslute + - style forms this way http://www.cssplay.co.uk/menu/form.html + not that much colors, but with alignments and <label> - Better Javascript detection Currently the no-javscript site is loaded with a javascript location.href to the javascript enabled site -> High Pageload, LinSysLog doesnt work Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/index.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -47,6 +47,9 @@ case 'newimg': include_once(LINPHA_DIR.'/lib/modules/module.newimg.php'); break; +case 'empty': + include_once(LINPHA_DIR.'/lib/modules/module.empty.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-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/install/sql/sql.data.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -73,6 +73,7 @@ 'sys_style_image_width' => '700', 'sys_style_image_height' => '525', 'sys_style_image_nrprevnextthumbs' => '3', + 'sys_style_image_useeffects' => '1', 'sys_style_layout_color_bodybg' => 'DDDDDD', // the blue design 'sys_style_layout_color_elembg' => '87CEFA', Modified: trunk/linpha2/lib/classes/linpha.admin.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.admin.class.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/classes/linpha.admin.class.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -188,6 +188,8 @@ } } + linSysLog(i18n("Settings saved.")); + /** * update config array */ @@ -304,6 +306,7 @@ 'sys_style_home_showalbums', 'sys_style_home_usedefaultwelcometext', 'sys_style_thumb_showsubfoldersseparate', + 'sys_style_image_useeffects', 'sys_user_autologin', 'plugins_filemanager_enable' ); Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -273,10 +273,12 @@ { if( ! isset( $GLOBALS['linpha']->template->output['sys_log'] ) ) { - $GLOBALS['linpha']->template->output['sys_log'] = ''; + $GLOBALS['linpha']->template->output['sys_log'] = $str; } - - $GLOBALS['linpha']->template->output['sys_log'] .= $str; + else + { + $GLOBALS['linpha']->template->output['sys_log'] .= '<br />'.$str; + } } /** Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -28,6 +28,7 @@ class LinImgview { public $mode; // 'home', 'thumb', 'image' +public $modulename; // 'albums', 'browse', ... public $tot_photos; public $photos; public $photos_filtered; @@ -50,6 +51,8 @@ */ function setCurrentView($modulename) { + $this->modulename = $modulename; + $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_others_sortorder']); if(isset($_GET['id']) && $_GET['id'] != 0) @@ -108,12 +111,12 @@ /** * on top view, reset current view */ - if($modulename=='albums') + if($this->modulename=='albums') { $this->mode = 'home'; $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_home_firstsortorder']); } - else // $modulename=='browse' | 'search' , others will come.. + else // $this->modulename=='browse' | 'search' , others will come.. { $this->mode = 'thumb'; @@ -156,17 +159,16 @@ if(isset($_GET['admin_cmd'])) { $this->adminCommands(); } - /*if(isset($_GET['slideshow'])) { - $this->slideshow(); - }*/ - /** - * set admin menu and more menu - * this should be done after adminCommands, because of - * "nr images in basket" is changed in adminCommands() - */ - $this->setMenu(); + /** + * set ref urls + * used in basket and ajax reloadmenu + */ + $_SESSION['ref_url_full'] = $GLOBALS['linpha']->template->URL_full; + $_SESSION['ref_url_base'] = $GLOBALS['linpha']->template->URL_base; + $_SESSION['ref_modulename'] = $this->modulename; + /** * set mode specific things */ @@ -202,8 +204,18 @@ } break; } + /** + * set admin menu and more menu + * - this should be done after adminCommands, because of + * "nr images in basket" is changed in adminCommands() + * + * - this should be done after viewImg(), because of $org_width and $org_height in "View at" + */ + $this->setMenu(); + + /** * at this point, there should be absolut no output */ include_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/global.html.php'); @@ -244,7 +256,6 @@ */ function setMenu() { - /** * Menu Admin */ @@ -293,28 +304,12 @@ $array_sort_orders_links[] = Array('name' => i18n($value), 'value' => $GLOBALS['linpha']->template->URL_full.'&order_by='.$value); } - $_SESSION['basket_ref_url'] = $GLOBALS['linpha']->template->URL_full; $open_basket_link = LINPHA_DIR.'/?cat=basket'; switch($this->mode) { case 'thumb': - $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectsizes']); - foreach($array AS $value) - { - $array_tn_sizes_links[] = Array('name' => $value.' '.i18n("Pixel"), 'value' => 'javascript:set_tn_size('.$value.')'); - } - $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectnrimages']); - foreach($array AS $value) - { - $array_nr_links[] = Array('name' => $value, 'value' =>"javascript:set_nr_images('".$value."')"); - } - - $array_views_links[] = Array('name' => i18n("Normal"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=thumb'); - $array_views_links[] = Array('name' => i18n("Detail"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=thumbdetail'); - - $GLOBALS['linpha']->template->output['menu_More']['basket'] = Array( 'name' => i18n("Basket"), @@ -327,6 +322,21 @@ if( useAjax() ) { + $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectsizes']); + foreach($array AS $value) + { + $array_tn_sizes_links[] = Array('name' => $value.' '.i18n("Pixel"), 'value' => 'javascript:set_tn_size('.$value.')'); + } + + $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectnrimages']); + foreach($array AS $value) + { + $array_nr_links[] = Array('name' => $value, 'value' =>"javascript:set_nr_images('".$value."')"); + } + + $array_views_links[] = Array('name' => i18n("Normal"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=thumb'); + $array_views_links[] = Array('name' => i18n("Detail"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=thumbdetail'); + $GLOBALS['linpha']->template->output['menu_More']['view'] = Array( 'name' => i18n("View"), @@ -371,20 +381,34 @@ case 'image': $GLOBALS['linpha']->template->output['menu_More']['basket'] = - Array( + array( 'name' => i18n("Basket"), - 'value' => Array( - Array('name' => i18n("Add To Basket"), 'value' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_this'), - Array('name' => i18n("Open Basket").' ('.count($_SESSION['basket_ids']).' '.i18n("Images").')', 'value' => $open_basket_link) + 'value' => array( + array('name' => i18n("Add To Basket"), 'value' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_this'), + array('name' => i18n("Open Basket").' ('.count($_SESSION['basket_ids']).' '.i18n("Images").')', 'value' => $open_basket_link) ) ); $GLOBALS['linpha']->template->output['menu_More']['view'] = - Array( + array( 'name' => i18n("View"), - 'value' => Array( - Array('name' => i18n("Sort"), 'value' => $array_sort_orders_links) + 'value' => array( + array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), + array('name' => i18n("View at"), 'value' => + array( + array('name' => '640x480', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=640&height=480', 'target' => '_blank'), + array('name' => '800x600', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=800&height=600', 'target' => '_blank'), + array('name' => '1024x768', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=1024&height=768', 'target' => '_blank'), + array('name' => '1280x800', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=1280&height=800', 'target' => '_blank'), + array('name' => '1280x960', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=1280&height=960', 'target' => '_blank'), + array('name' => '1280x1024', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=1280&height=1024', 'target' => '_blank'), + array('name' => '1600x1200', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=1600&height=1200', 'target' => '_blank'), + array('name' => '1920x1200', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=1920&height=1200', 'target' => '_blank'), + array('name' => $this->org_width.'x'.$this->org_height.' '.i18n("Fullscreen").')', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width='.$this->org_width.'&height='.$this->org_height, 'target' => '_blank'), + ) + ) ) ); + if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { @@ -446,7 +470,7 @@ .'</a>'."\n"; } /** - * slideshow icons + * slideshow icon */ if( useAjax() ) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="javascript:slideshowStartFromThumbview()">'. @@ -480,7 +504,7 @@ } /** - * slideshow icons + * slideshow icon */ if( useAjax() ) { $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="javascript:myLinImage.fullscreenStart()">'. Modified: trunk/linpha2/lib/classes/linpha.import.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.import.class.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/classes/linpha.import.class.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -90,7 +90,7 @@ { if($dryrun) { - linSysLog(i18n("Delete Entry").": ".htmlspecialchars($dirname.'/'.$value,ENT_QUOTES)."<br />"); + linSysLog(i18n("Delete Entry").": ".htmlspecialchars($dirname.'/'.$value,ENT_QUOTES)); $deleted_keys[] = $key; } else @@ -106,7 +106,7 @@ { if($dryrun) { - linSysLog(i18n("New Entry").": ".htmlspecialchars($dirname.'/'.$value,ENT_QUOTES)."<br />"); + linSysLog(i18n("New Entry").": ".htmlspecialchars($dirname.'/'.$value,ENT_QUOTES)); } else { @@ -164,7 +164,7 @@ */ function addNewEntry( $parent_id , $dirname , $filename , $recursive ) { - linSysLog(i18n("New").': '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES).'<br />'); + linSysLog(i18n("New").': '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); list($md5sum,$file_type,$stats_number,$time_exif,$rotate) = LinImport::getFileInformation($dirname,$filename); @@ -233,7 +233,7 @@ LinImport::deleteEntry( $data['id'], $full_filename.'/'.$data['name']); } - linSysLog(i18n("Delete Entry").': '.htmlspecialchars($full_filename,ENT_QUOTES).'<br />'); + linSysLog(i18n("Delete Entry").': '.htmlspecialchars($full_filename,ENT_QUOTES)); /** * delete thumbnail and image in cache folder @@ -281,7 +281,7 @@ */ if($file_type != $data[0]) { - linSysLog(i18n("Detected a change of file_type in:")." ".htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES).'<br />'); + linSysLog(i18n("Detected a change of file_type in:")." ".htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); $GLOBALS['linpha']->db->Execute("UPDATE ".PREFIX."photos " . "SET img_type = '".$file_type."', stats_numbers = '".$stats_number."' " . "WHERE id = '".$id."'"); @@ -296,7 +296,7 @@ */ if($md5sum != $data[1]) { - linSysLog(sprintf(i18n("File %s changed, updating data..."),htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES))."<br />"); + linSysLog(sprintf(i18n("File %s changed, updating data..."),htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES))); $GLOBALS['linpha']->db->Execute("UPDATE ".PREFIX."photos " . "SET md5sum = '".$md5sum."' WHERE id = '".$id."'"); @@ -356,22 +356,22 @@ $ext = LinFilesys::getFileExtFromPath($filename); if($filename{0} == '.') { - linSysLog(htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is Hidden")."<br />"); + linSysLog(htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is Hidden")); $file_type = 9999999; } elseif( in_array( $filename, LinImport::getIgnoreFilelist() ) ) { - linSysLog(htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is In The Ignore List")."<br />"); + linSysLog(htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is In The Ignore List")); $file_type = 9999999; } elseif( in_array($ext, LinImport::getIgnoreFileext() ) ) { - linSysLog(htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is In The Ignore List")."<br />"); + linSysLog(htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is In The Ignore List")); $file_type = 9999999; } elseif( !is_readable( $dirname.'/'.$filename) ) { - linSysLog(htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is Not Readable")."<br />"); + linSysLog(htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is Not Readable")); $file_type = 9999999; } /** @@ -440,7 +440,7 @@ } else { - linSysLog('Error: what am i? '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES).'<br />'); + linSysLog('Error: what am i? '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); } return array($md5sum,$file_type,$stats_number,$time_exif,$rotate); Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -203,7 +203,7 @@ if($data = $query->FetchRow()) { //linpha_log('login','notice','User '.$_POST['user_name'].": successfully logged in."); - linSysLog(i18n("Successfully Logged In!<br />")); + linSysLog(i18n("Successfully Logged In!")); $this->setUserInformation($data['username'],$_COOKIE['linpha_userid'],$data['display_name']); } @@ -233,6 +233,8 @@ setcookie('linpha_userid'); // delete cookie linpha_userid setcookie('linpha_password'); // delete cookie linpha_password } + + linSysLog(i18n("Logged out.")); } elseif($_POST['cmd']=='login') { @@ -255,7 +257,7 @@ * @todo */ //linpha_log('login','notice','User '.$_POST['user_name'].": successfully logged in."); - linSysLog(i18n("Successfully Logged In!")."<br />"); + linSysLog(i18n("Successfully Logged In!")); $this->setUserInformation($_POST['username'],$data['id'],$data['display_name']); @@ -277,7 +279,7 @@ */ //linpha_log('login','error','User '.$_POST['user_name'].": login failed!"); - linSysLog(i18n("Login Failed!")."<br />"); + linSysLog(i18n("Login Failed!")); } } } Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -86,35 +86,35 @@ echo "<link rel='stylesheet' href='".$filename."' type='text/css'>\n"; } ?> - <!-- IE hack for the menu--> <!--[if IE]> <style type="text/css" media="screen"> - #menu a, #menu span - { - width: 50px; - } + #menu ul { width: 1em; } /* this will be a *min* width */ + #menu ul ul { width: 12em; } + #menu ul li { float: left; width: 100%; } </style> <![endif]--> <!--[if lt IE 7]> <style type="text/css" media="screen"> - body { - behavior: url(templates/misc/csshover.htc); /* enable span:hover */ - font-size: 100%; - } - - #menu ul li a {height: 1%;} - - #menu a, #menu span { - font: bold 0.7em/1.4em arial, helvetica, sans-serif; - } + body { behavior: url(<?php echo LINPHA_DIR; ?>/templates/misc/csshover.htc); font-size: 100%; } + #menu ul li a { height: 1%; } + #menu a, #menu span { font: bold 0.7em/1.4em arial, helvetica, sans-serif; } </style> <![endif]--> <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/prototype.js"></script> <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/LinGlobal.js"></script> <script type="text/javascript" language="JavaScript"> -var LINPHA_DIR = '<?php echo LINPHA_DIR; ?>'; -<?php +var LINPHA_DIR = '<?php echo LINPHA_DIR; ?>'; +var IdCurrent = <?php +if( isset($GLOBALS['linpha']->imgview->id_current) ) { + echo $GLOBALS['linpha']->imgview->id_current; +} elseif( isset($_GET['id'])) { + echo $_GET['id']; +} else { + echo 0; +} +echo ';'."\n"; + if(! isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax'])) { echo "checkAjaxCompatibility();"; @@ -157,6 +157,20 @@ } } + /** + * print the whole menu + * @uses global.html.php, module.ajax.php + */ + function printMenus($comingfrom_ajax=false) + { + $fragment = 'menu'; + include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); + + if($comingfrom_ajax && isset($this->output['sys_log']) && !empty($this->output['sys_log'])) + { + echo '<script language="JavaScript" type="text/javascript">linSyslog("'.$this->output['sys_log'].'");</script>'; + } + } /** * print the main menu entries (more, admin, ...) @@ -167,7 +181,7 @@ { echo "\n".'<ul>'."\n"; echo "\t".'<li><a href="'.$link.'">'.i18n($index).'</a>'."\n"; - echo "\n".'<ul>'."\n"; + echo "\n".'</ul>'."\n"; } else { @@ -180,13 +194,18 @@ { echo "\t".'<li><span>'.i18n($index).' </span>'."\n"; } - echo "\n".'<ul>'."\n"; + echo "\n".'<ul id="menu'.$index.'" onmouseover="reloadMenu()">'."\n"; foreach($GLOBALS['linpha']->template->output['menu_'.$index] AS $key=>$value) { if(!is_array($value['value'])) { - echo "\t".'<li><a href="'.$value['value'].'">'.$value['name'].'</a></li>'."\n"; + if(isset($value['target'])) { + $target_str = ' target="'.$value['target'].'"'; + } else { + $target_str = ''; + } + echo "\t".'<li><a href="'.$value['value'].'"'.$target_str.'>'.$value['name'].'</a></li>'."\n"; } else { @@ -198,7 +217,12 @@ { if(!is_array($sub_value['value'])) { - echo "\t\t".'<li><a href="'.$sub_value['value'].'">'.$sub_value['name'].'</a></li>'."\n"; + if(isset($sub_value['target'])) { + $target_str = ' target="'.$sub_value['target'].'"'; + } else { + $target_str = ''; + } + echo "\t\t".'<li><a href="'.$sub_value['value'].'"'.$target_str.'>'.$sub_value['name'].'</a></li>'."\n"; } else { @@ -208,7 +232,15 @@ foreach($sub_value['value'] AS $subsub_value) { - echo "\t\t\t".'<li><a href="'.$subsub_value['value'].'">'.$subsub_value['name'].'</a></li>'."\n"; + + + if(isset($subsub_value['target'])) { + $target_str = ' target="'.$subsub_value['target'].'"'; + } else { + $target_str = ''; + } + echo "\t\t\t".'<li><a href="'.$subsub_value['value'].'"'.$target_str.'>'.$subsub_value['name'].'</a></li>'."\n"; + } echo "\t\t".'</ul>'."\n"; Modified: trunk/linpha2/lib/include/basket_build_mail.php =================================================================== --- trunk/linpha2/lib/include/basket_build_mail.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/include/basket_build_mail.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -212,7 +212,7 @@ /** * no exception, because we still need to delete the images */ - linSysLog(i18n("Error: E-Mail couldn't be sent. Contact the Administrator.").'<br />'); + linSysLog(i18n("Error: E-Mail couldn't be sent. Contact the Administrator.")); } $mail->ClearAddresses(); Modified: trunk/linpha2/lib/include/upgrade.php =================================================================== --- trunk/linpha2/lib/include/upgrade.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/include/upgrade.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -32,7 +32,7 @@ if($dbversion < 2) { - linSysLog("DB update 2 (add metadata values)<br />"); + linSysLog("DB update 2 (add metadata values)"); //$GLOBALS['linpha']->db->Execute("INSERT into ".PREFIX."meta_fields (name, field_type, flags) VALUES ('thumbnail',0,1)"); Modified: trunk/linpha2/lib/js/LinGlobal.js =================================================================== --- trunk/linpha2/lib/js/LinGlobal.js 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/js/LinGlobal.js 2006-10-29 23:55:17 UTC (rev 4609) @@ -41,6 +41,43 @@ linSyslog('Ajax enabled'); } +function AjaxPost(parameters,successFunction) +{ + var opt = { + // Use POST + method: 'post', + // Send this lovely data + postBody: parameters + , + // asynchron, of course + asynchronous:true, + + // Handle successful response + onSuccess: successFunction, + + // Handle 404 + on404: function(t) { + alert('Error 404: location "' + t.statusText + '" was not found.'); + }, + // Handle other errors + onFailure: function(t) { + alert('Error ' + t.status + ' -- ' + t.statusText); + } + } + + new Ajax.Request(xmlUrl + '&id=' + curImgId + '&xml', opt); +} + +var menuNeedsUpdating = false; +function reloadMenu() +{ + if( menuNeedsUpdating ) + { + new Ajax.Updater('menu', LINPHA_DIR + '/?cat=ajax&reloadmenu&id='+IdCurrent, {method: 'get', asynchronous:true, evalScripts:true}); + menuNeedsUpdating = false; + } +} + /** * setMainHeight * Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/js/LinImage.js 2006-10-29 23:55:17 UTC (rev 4609) @@ -3,7 +3,6 @@ alert('Error ' + t.status + ' -- ' + t.statusText); } -var curImgId = startImgId; var nextThumbs = new Array(); var prevThumbs = new Array(); @@ -35,7 +34,8 @@ }, loadImage: function(imgId) { - curImgId = imgId; + IdCurrent = imgId; + menuNeedsUpdating = true; // IdCurrent changed, update menu on next hover of the menu if(preloadXmlFinished[imgId] && typeof xmlDoc[imgId] != "undefined" ) // use typeof to work in IE { @@ -59,7 +59,7 @@ xmlDoc[loadedimgid] = t.responseXML.documentElement; preloadXmlFinished[loadedimgid] = true; - if( loadedimgid == curImgId ) // coming from loadImage() + if( loadedimgid == IdCurrent ) // coming from loadImage() { myLinImage.changeImage(); } @@ -163,7 +163,7 @@ /** * set height of outer div to prevent the whole page getting smaller, and if the image is loaded getting bigger again - * but we want no activities in background + * but in fullscreen, we want no activities in background */ if(! fullscreenActive) { $('divimage').style.height = $('mainImage').style.height; @@ -176,17 +176,20 @@ Element.hide('mainImage'); // hide mainimage while changing image to prevent flicker Element.hide('divinfolinks'); - if(! preloadImageFinished[curImgId] ) + if(! preloadImageFinished[IdCurrent] ) { Element.show('divloading'); } + + //$('thumbnavi_prevthumb').innerHTML = ''; + //$('thumbnavi_nextthumb').innerHTML = ''; /** * set image width and height */ - var orgWidth = xmlDoc[curImgId].getElementsByTagName('imgwidth').item(0).firstChild.data; - var orgHeight = xmlDoc[curImgId].getElementsByTagName('imgheight').item(0).firstChild.data; + var orgWidth = xmlDoc[IdCurrent].getElementsByTagName('imgwidth').item(0).firstChild.data; + var orgHeight = xmlDoc[IdCurrent].getElementsByTagName('imgheight').item(0).firstChild.data; var sizeArray = scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); var imgWidth = sizeArray[0]; var imgHeight = sizeArray[1]; @@ -194,7 +197,7 @@ /** * preload image */ - var currentImgSrc = imageSrc + curImgId + '&width=' + imgWidth + '&height=' + imgHeight; + var currentImgSrc = imageSrc + IdCurrent + '&width=' + imgWidth + '&height=' + imgHeight; imgPreloader = new Image(); /** @@ -205,7 +208,7 @@ * and hence the image was not resized correctly in resizeImageContainer() !!! */ imgPreloader.onload=function(){ - preloadImageFinished[curImgId] = true; + preloadImageFinished[IdCurrent] = true; $('mainImage').src = currentImgSrc; myLinImage.resizeImageContainer(imgWidth, imgHeight); } @@ -255,12 +258,26 @@ // showImage: function(){ Element.hide('divloading'); - new Effect.Appear('mainImage', { duration: 0.5, afterFinish: function(){ myLinImage.setImageData(); } }); + + if( useEffects ) + { + new Effect.Appear('mainImage', { duration: 0.5, afterFinish: function(){ myLinImage.setImageData(); } }); + } + else + { + Element.show('mainImage'); + this.setImageData() + } if(! fullscreenActive) { $('divimage').style.height = $('mainImage').style.height; // reset to correct height to prevent trouble if image is bigger or smaller } + /** + * set title + */ + $('title').innerHTML = xmlDoc[IdCurrent].getElementsByTagName('title').item(0).firstChild.data; + this.enableKeyboardNav(); }, @@ -269,27 +286,22 @@ setImageData: function() { this.setImageInfoLink(); - - /** - * set title - */ - $('title').innerHTML = xmlDoc[curImgId].getElementsByTagName('title').item(0).firstChild.data; /** * set current thumb */ - $('thumbnavi_currentthumb').innerHTML = '<a href="javascript:myLinImage.loadImage(' + curImgId + ')"><img class="img_currentthumb" src="' + thumbSrc + curImgId + '" /></a>'; + $('thumbnavi_currentthumb').innerHTML = '<a href="javascript:myLinImage.loadImage(' + IdCurrent + ')"><img class="img_currentthumb" src="' + thumbSrc + IdCurrent + '" /></a>'; /** * set prev thumbs */ $('thumbnavi_prevthumb').innerHTML = ''; prevThumbs = new Array(); - if(xmlDoc[curImgId].getElementsByTagName('prevthumb').length > 0) + if(xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) { - for(var i = 0; i < xmlDoc[curImgId].getElementsByTagName('prevthumb').length; i++) + for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length; i++) { - var thumbId = xmlDoc[curImgId].getElementsByTagName('prevthumb').item(i).firstChild.data; + var thumbId = xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; prevThumbs[i] = thumbId; this.setPrevNextThumb(thumbId, 'thumbnavi_prevthumb'); } @@ -300,11 +312,11 @@ */ $('thumbnavi_nextthumb').innerHTML = ''; nextThumbs = new Array(); - if(xmlDoc[curImgId].getElementsByTagName('nextthumb').length > 0) + if(xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) { - for(var i = 0; i < xmlDoc[curImgId].getElementsByTagName('nextthumb').length; i++) + for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) { - var thumbId = xmlDoc[curImgId].getElementsByTagName('nextthumb').item(i).firstChild.data; + var thumbId = xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; nextThumbs[i] = thumbId; this.setPrevNextThumb(thumbId, 'thumbnavi_nextthumb'); } @@ -313,13 +325,13 @@ /** * set meta data */ - if(xmlDoc[curImgId].getElementsByTagName('meta').length > 0) + if(xmlDoc[IdCurrent].getElementsByTagName('meta').length > 0) { $('divmeta').innerHTML = ''; - for(var i = 0; i < xmlDoc[curImgId].getElementsByTagName('meta').length; i++) + for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('meta').length; i++) { - var meta = xmlDoc[curImgId].getElementsByTagName('meta').item(i); + var meta = xmlDoc[IdCurrent].getElementsByTagName('meta').item(i); var metaname = document.createTextNode( meta.getElementsByTagName('name').item(0).firstChild.data + ': ' ); var metavalue = document.createTextNode( meta.getElementsByTagName('value').item(0).firstChild.data ); @@ -334,11 +346,11 @@ */ initTextareaAddComment(); $('divcomments').innerHTML = ''; - if(xmlDoc[curImgId].getElementsByTagName('comment').length > 0) + if(xmlDoc[IdCurrent].getElementsByTagName('comment').length > 0) { - for(var i = 0; i < xmlDoc[curImgId].getElementsByTagName('comment').length; i++) + for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('comment').length; i++) { - var tagcomment = xmlDoc[curImgId].getElementsByTagName('comment').item(i); + var tagcomment = xmlDoc[IdCurrent].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 ); @@ -366,7 +378,7 @@ * set image nr * currently only in slideshow used */ - $('divSlideshowImgNr').innerHTML = xmlDoc[curImgId].getElementsByTagName('imgnr').item(0).firstChild.data; + $('divSlideshowImgNr').innerHTML = xmlDoc[IdCurrent].getElementsByTagName('imgnr').item(0).firstChild.data; /** @@ -521,11 +533,11 @@ preloadXml: function() { // preload nextthumb from left to right - if(xmlDoc[curImgId].getElementsByTagName('nextthumb').length > 0) + if(xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) { - for(var i = 0; i < xmlDoc[curImgId].getElementsByTagName('nextthumb').length; i++) + for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) { - var imgId = xmlDoc[curImgId].getElementsByTagName('nextthumb').item(i).firstChild.data; + var imgId = xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; if(! preloadXmlFinished[imgId]) { this.loadImageXml(imgId); @@ -538,11 +550,11 @@ } // preload prevthumb from right to left - if(xmlDoc[curImgId].getElementsByTagName('prevthumb').length > 0) + if(xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) { - for(var i = xmlDoc[curImgId].getElementsByTagName('prevthumb').length-1; i >= 0; i--) + for(var i = xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length-1; i >= 0; i--) { - var imgId = xmlDoc[curImgId].getElementsByTagName('prevthumb').item(i).firstChild.data; + var imgId = xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; if(! preloadXmlFinished[imgId]) { this.loadImageXml(imgId); @@ -668,7 +680,7 @@ /** * reload image with old position and size */ - this.loadImage( curImgId ); + this.loadImage( IdCurrent ); }, slideshowStartStop: function() @@ -748,7 +760,7 @@ maxImageWidth = linInnerWidth - 70; maxImageHeight = linInnerHeight - 120; - myLinImage.loadImage( curImgId ); + myLinImage.loadImage( IdCurrent ); } else { @@ -774,7 +786,7 @@ } else { - myLinImage.loadImage(startImgId); + myLinImage.loadImage(IdCurrent); // setMainHeight(); // defined in LinGlobal.js window.onresize = onWindowResize; } @@ -893,49 +905,17 @@ // Comments // ----------------------------------------------------------------------------------- -function saveComment(parameters) -{ - //alert(parameters); - //new Ajax.Updater('div_to_be_updated', '/action/here', {asynchronous:true, parameters:Form.serialize(this)}) - - - var opt = { - // Use POST - method: 'post', - // Send this lovely data - postBody: parameters - , - // asynchron, of course - asynchronous:true, - - // Handle successful response - onSuccess: saveCommentContinue, - - // Handle 404 - on404: function(t) { - alert('Error 404: location "' + t.statusText + '" was not found.'); - }, - // Handle other errors - onFailure: function(t) { - alert('Error ' + t.status + ' -- ' + t.statusText); - } - } - - new Ajax.Request(xmlUrl + '&id=' + curImgId + '&xml', opt); -} - - -function saveCommentContinue(t) +function saveComment(t) { - xmlDoc[curImgId] = t.responseXML.documentElement; + xmlDoc[IdCurrent] = t.responseXML.documentElement; - if(xmlDoc[curImgId].getElementsByTagName('commentadded').length > 0) + if(xmlDoc[IdCurrent].getElementsByTagName('commentadded').length > 0) { - linSyslog( xmlDoc[curImgId].getElementsByTagName('commentadded').item(0).firstChild.data ); + linSyslog( xmlDoc[IdCurrent].getElementsByTagName('commentadded').item(0).firstChild.data ); } - myLinImage.loadImage(curImgId); + myLinImage.loadImage(IdCurrent); } /** Modified: trunk/linpha2/lib/js/LinThumbnails.js =================================================================== --- trunk/linpha2/lib/js/LinThumbnails.js 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/js/LinThumbnails.js 2006-10-29 23:55:17 UTC (rev 4609) @@ -42,7 +42,7 @@ var max_photos_per_page = nr_rows * nr_cols; break; case 'all': - var nr_cols = Math.floor( document.getElementById('main')['offsetWidth'] / (tn_size + img_spacer_width) ); + var nr_cols = Math.floor( (document.getElementById('main')['offsetWidth']-main_spacer_width) / (tn_size + img_spacer_width) ); var max_photos_per_page = tot_photos; var nr_rows = Math.ceil(max_photos_per_page / nr_cols); break; @@ -50,11 +50,12 @@ /** * ceil max_photos_per_page to complet the row! */ - var nr_cols = Math.floor( document.getElementById('main')['offsetWidth'] / (tn_size + img_spacer_width) ); - var nr_rows = Math.ceil( photos_per_page / nr_cols); + var nr_cols = Math.floor( (document.getElementById('main')['offsetWidth']-main_spacer_width-5) / (tn_size + img_spacer_width) ); /* -5 -> scrollbars */ + var nr_rows = Math.ceil( photos_per_page / nr_cols); var max_photos_per_page = nr_rows * nr_cols; break; } + /** * at least on image per page */ Modified: trunk/linpha2/lib/modules/module.ajax.php =================================================================== --- trunk/linpha2/lib/modules/module.ajax.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/modules/module.ajax.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -35,7 +35,7 @@ /** * force ajax disable */ -if(isset($_GET['disable_ajax'])) +elseif(isset($_GET['disable_ajax'])) { $_SESSION['disable_ajax'] = true; echo 'disable_ajax saved'; @@ -43,7 +43,7 @@ /** * re-enable */ -if(isset($_GET['enable_ajax'])) +elseif(isset($_GET['enable_ajax'])) { if(isset($_SESSION['disable_ajax'])) { @@ -55,5 +55,43 @@ echo 'enable_ajax saved (but was not disabled before)'; } } - - ?> \ No newline at end of file + +/** + * reload menu + * + * the login itself is done automatically in startSession() because we are using the same form names etc. + */ +elseif(isset($_GET['reloadmenu'])) +{ + if( isset($_GET['id']) AND isset($_SESSION['ref_url_base']) ) + { + + include_once(LINPHA_DIR . '/lib/classes/linpha.imgview.class.php'); + $linpha->imgview = new linImgview(); + + $linpha->imgview->setCurrentView($_SESSION['ref_modulename']); + + $linpha->template->URL_base = $_SESSION['ref_url_base']; + $linpha->template->URL_full = $linpha->template->URL_base.'&id='.$linpha->imgview->id_current; + $_SESSION['ref_url_full'] = $linpha->template->URL_full; + + if( $linpha->imgview->mode == 'image' ) + { + /** + * @todo read from database + */ + $src_file = LinSql::getFullImagePath( $linpha->imgview->id_current ); + list($linpha->imgview->org_width,$linpha->imgview->org_height,$org_type) = LinIdentify::linGetImageSize( $src_file ); + } + + $linpha->imgview->setMenu(); + } + else // return a default menu + { + + } + + $linpha->template->printMenus($comingfrom_ajax=true); +} + +?> \ No newline at end of file Added: trunk/linpha2/lib/modules/module.empty.php =================================================================== --- trunk/linpha2/lib/modules/module.empty.php (rev 0) +++ trunk/linpha2/lib/modules/module.empty.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -0,0 +1,36 @@ +<?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. + */ + +/** + * Filemanager + * @package Modules + */ + +if(!defined('LINPHA_DIR')) { exit(1); } + + +$linpha->template->output['default'] = ''; + +$linpha->template->setModuleName('default'); +$linpha->template->URL_full = LINPHA_DIR.'/?cat=empty'; +$linpha->template->output['title'] = i18n("empty"); +include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); + +?> \ No newline at end of file Modified: trunk/linpha2/lib/modules/module.filemanager.php =================================================================== --- trunk/linpha2/lib/modules/module.filemanager.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/lib/modules/module.filemanager.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -285,7 +285,7 @@ $GLOBALS['linpha']->db->Execute("UPDATE ".PREFIX."photos SET name = '".LinSql::linAddslashes($new_name)."' " . "WHERE id = '".LinSql::linAddslashes($_POST['file_id'])."'"); - linSysLog(i18n("Successfully Renamed!")."<br />"); + linSysLog(i18n("Successfully Renamed!")); } else { @@ -294,9 +294,9 @@ i18n("Error While Renaming File/Folder \"%s\" to \"%s\"!"), htmlspecialchars($full_filename,ENT_QUOTES), htmlspecialchars($parent_dirname.'/'.$new_name,ENT_QUOTES) - ).'<br />' + ) ); - linSysLog(i18n($str_checkpermissions).'<br />'); + linSysLog(i18n($str_checkpermissions)); } break; @@ -361,7 +361,7 @@ i18n("Successfully Moved \"%s\" to \"%s\"!"), htmlspecialchars($full_sourcename,ENT_QUOTES), htmlspecialchars($full_destparentname.'/'.basename($full_sourcename),ENT_QUOTES) - ) . "<br />" + ) ); } else @@ -371,9 +371,9 @@ i18n("Error While Moving Files/Folders \"%s\" to \"%s\"!"), htmlspecialchars($full_sourcename,ENT_QUOTES), htmlspecialchars($full_destparentname.'/'.basename($full_sourcename),ENT_QUOTES) - ).'<br />' + ) ); - linSysLog(i18n($str_checkpermissions).'<br />'); + linSysLog(i18n($str_checkpermissions)); } } /** @@ -403,7 +403,7 @@ i18n("Successfully Copied \"%s\" to \"%s\"!"), $full_sourcename, $full_destparentname.'/'.basename($full_sourcename) - ) . "<br />" + ) ); } else @@ -413,9 +413,9 @@ i18n("Error While Copying Files/Folders \"%s\" to \"%s\"!"), htmlspecialchars($full_sourcename,ENT_QUOTES), htmlspecialchars($full_destparentname.'/'.basename($full_sourcename),ENT_QUOTES) - ).'<br />' + ) ); - linSysLog(i18n($str_checkpermissions).'<br />'); + linSysLog(i18n($str_checkpermissions)); } } else @@ -425,9 +425,9 @@ i18n("Error While Copying Files/Folders \"%s\" to \"%s\"!"), htmlspecialchars($full_sourcename,ENT_QUOTES), htmlspecialchars($full_destparentname.'/'.basename($full_sourcename),ENT_QUOTES) - ).'<br />' + ) ); - linSysLog(i18n($str_checkpermissions).'<br />'); + linSysLog(i18n($str_checkpermissions)); } } } @@ -455,14 +455,14 @@ if(file_exists($full_filename)) { - linSysLog(i18n("Error While Deleting Files/Folders")." \"".htmlspecialchars($full_filename,ENT_QUOTES)."\"".'<br />'); - linSysLog(i18n($str_checkpermissions).'<br />'); + linSysLog(i18n("Error While Deleting Files/Folders")." \"".htmlspecialchars($full_filename,ENT_QUOTES)."\""); + linSysLog(i18n($str_checkpermissions)); } else { LinImport::deleteEntry( $value, $full_filename); - linSysLog(i18n("File/Folder deleted successfully!").'<br />'); + linSysLog(i18n("File/Folder deleted successfully!")); } } break; @@ -487,17 +487,17 @@ if( @mkdir( $full_filename .'/'. $new_name )) { - linSysLog(i18n("Folder Created Successfully!").'<br />'); + linSysLog(i18n("Folder Created Successfully!")); if( ! $linpha->sql->config->value['sys_import_autoimport'] ) { - linSysLog(i18n($str_autoimportdisabled).'<br />'); + linSysLog(i18n($str_autoimportdisabled)); } } else { - linSysLog(i18n("Error While Creating Folder")." \"".htmlspecialchars($new_name,ENT_QUOTES)."\"".'<br />'); - linSysLog(i18n($str_checkpermissions).'<br />'); + linSysLog(i18n("Error While Creating Folder")." \"".htmlspecialchars($new_name,ENT_QUOTES)."\""); + linSysLog(i18n($str_checkpermissions)); } break; case 'changeperm': @@ -521,12 +521,12 @@ if(@chmod($full_filename,intval($mode,8))) { - linSysLog(i18n("Permissions Changed Successfully!").'<br />'); + linSysLog(i18n("Permissions Changed Successfully!")); } else { - linSysLog(i18n("Error While Changing Permissions!").'<br />'); - linSysLog(i18n($str_checkpermissions).'<br />'); + linSysLog(i18n("Error While Changing Permissions!")); + linSysLog(i18n($str_checkpermissions)); } break; } // end switch($_POST['file_action']) @@ -624,7 +624,7 @@ { if( ! $linpha->sql->config->value['sys_import_autoimport'] ) { - linSysLog(i18n($str_autoimportdisabled).'<br />'); + linSysLog(i18n($str_autoimportdisabled)); } } break; Modified: trunk/linpha2/templates/default/basket.html.php =================================================================== --- trunk/linpha2/templates/default/basket.html.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/templates/default/basket.html.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -3,8 +3,8 @@ <?php echo $tpl->divRoundCorners('top'); ?> <div id="navigation"> - <?php if(isset($_SESSION['basket_ref_url'])) { ?> - <a style="float: left; margin-right: 2px;" class="button" href="<?php echo $_SESSION['basket_ref_url']; ?>"><?php echo i18n("Go Back"); ?></a> + <?php if(isset($_SESSION['ref_url_full'])) { ?> + <a style="float: left; margin-right: 2px;" class="button" href="<?php echo $_SESSION['ref_url_full']; ?>"><?php echo i18n("Go Back"); ?></a> <?php } ?> <br /><br /> Added: trunk/linpha2/templates/default/fragments.php =================================================================== --- trunk/linpha2/templates/default/fragments.php (rev 0) +++ trunk/linpha2/templates/default/fragments.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -0,0 +1,79 @@ +<?php + +switch($fragment) +{ +case 'menu': +?> + <ul style="margin-left: 50px;"> + <li><a href="<?php echo LINPHA_DIR; ?>/"><?php echo i18n("Home"); ?></a></li> + </ul> + <ul> + <li><span><?php echo i18n("Search"); ?> </span> + <ul> + <li><a href="<?php echo LINPHA_DIR; ?>/?cat=search"><?php echo i18n("Extended Search"); ?></a></li> + <li> + <div> + <form method="GET" action="<?php echo LINPHA_DIR; ?>/?cat=search"> + <input type="text" class="linForms" name="search_text" value="" /> + <input type="hidden" name="button[meta][all]" value="1" /> + <input type="hidden" name="cmd" value="search" /> + <input type="hidden" name="cat" value="search" /> + <input type="submit" name="submit" value="<?php echo i18n("Search"); ?>" /> + </form> + </div> + </li> + </ul> + </li> + </ul> + <ul> + <li> + <span><?php echo i18n("Login"); ?> </span> + <ul id="menuLogin"> + <li> + <div> + <?php if( useAjax() ) { ?> + <form action="" method="POST" onsubmit="new Ajax.Updater('menu', LINPHA_DIR + '/?cat=ajax&reloadmenu', {method: 'post', asynchronous:true, parameters:Form.serialize(this), evalScripts:true}); return false;"> + <?php } else { ?> + <form action="<?php echo $this->URL_full; ?>" method="POST"> + <?php } + if($GLOBALS['linpha']->sql->isLoggedIn()) { ?> + <?php echo i18n("Welcome").' '.$_SESSION['user_name'].' ('.$_SESSION['user_displayname'].')<br />'; ?> + <input type="hidden" name="cmd" value="logout" /> + <input type="submit" name="submit" value="<?php echo i18n("Logout"); ?>" /> + <?php } else { ?> + <!-- login infos --> + <label for="formUsername" style="display: block; float: left; width: 80px;"><?php echo i18n("Username"); ?>: </label><input style="width: 105px;" class="linForms" type="text" name="username" value="" id="formUsername" /><br /> + <label for="formPassword" style="display: block; float: left; width: 80px;"><?php echo i18n("Password"); ?>: </label><input style="width: 105px;" class="linForms" type="password" name="password" value="" id="formPassword" /><br /> + <?php if($GLOBALS['linpha']->sql->config->value['sys_user_autologin']) { ?><input type="checkbox" name="rememberme" value="true" id="formCheckboxRemember" /><label for="formCheckboxRemember"><?php echo i18n("Remember Me"); ?></label><?php } ?> + <input type="hidden" name="cmd" value="login" /> + <input type="submit" name="submit" value="<?php echo i18n("Login"); ?>" /> + <?php } ?> + + </form> + </div> + </li> + </ul> + </li> + </ul> + <?php if( isset( $this->output['menu_More'] ) ) { + $this->printMenu("More"); + } ?> + + <!-- icons --> + <div> + <?php if( isset( $this->output['menu_Icons'] ) ) { + echo $this->output['menu_Icons']; + } ?> + </div> + + <!-- my settings and admin links --> + <?php if($GLOBALS['linpha']->sql->isLoggedIn()) { ?> + <ul> + <li><a href="<?php echo LINPHA_DIR; ?>/?cat=settings"><?php echo i18n("My Settings"); ?></a></li> + </ul> + <?php $this->printMenu("Admin",LINPHA_DIR."/admin/"); ?> + <?php } ?> +<?php +break; +} +?> Modified: trunk/linpha2/templates/default/global.html.php =================================================================== --- trunk/linpha2/templates/default/global.html.php 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/templates/default/global.html.php 2006-10-29 23:55:17 UTC (rev 4609) @@ -32,75 +32,14 @@ <!-- menu --> <div id="menu"> - <ul> - <li><a href="<?php echo LINPHA_DIR; ?>/"><?php echo i18n("Home"); ?></a></li> - </ul> - <ul> - <li><span><?php echo i18n("Search"); ?> </span> - <ul> - <li><a href="<?php echo LINPHA_DIR; ?>/?cat=search"><?php echo i18n("Extended Search"); ?></a></li> - <li> - <div> - <form method="GET" action="<?php echo LINPHA_DIR; ?>/?cat=search"> - <input type="text" name="search_text" value="" /> - <input type="hidden" name="button[meta][all]" value="1" /> - <input type="hidden" name="cmd" value="search" /> - <input type="hidden" name="cat" value="search" /> - <input type="submit" name="submit" value="<?php echo i18n("Search"); ?>" /> - </form> - </div> - </li> - </ul> - </li> - </ul> - <ul> - <li> - <span><?php echo i18n("Login"); ?> </span> - <ul> - <li> - <div> - <form action="<?php echo $tpl->URL_full; ?>" method="POST"> - <?php if($GLOBALS['linpha']->sql->isLoggedIn()) { ?> - <!-- logout infos --> - <?php echo i18n("You Are Currently Logged In As:").' '.$_SESSION['user_name'].' ('.$_SESSION['user_displayname'].')<br />'; ?> - <input type="hidden" name="cmd" value="logout" /> - <input type="submit" name="submit" value="<?php echo i18n("Logout"); ?>" /> - <?php } else { ?> - <!-- login infos --> - <label for="formUsername" style="display: block; float: left; width: 80px;"><?php echo i18n("Username"); ?>: </label><input style="width: 105px;" type="text" name="username" value="" id="formUsername" /><br /> - <label for="formPassword" style="display: block; float: left; width: 80px;"><?php echo i18n("Password"); ?>: </label><input style="width: 105px;" type="password" name="password" value="" id="formPassword" /><br /> - <?php if($GLOBALS['linpha']->sql->config->value['sys_user_autologin']) { ?><input type="checkbox" name="rememberme" value="true" id="formCheckboxRemember" /><label for="formCheckboxRemember"><?php echo i18n("Remember Me"); ?></label><?php } ?> - <input type="hidden" name="cmd" value="login" /> - <input type="submit" name="submit" value="<?php echo i18n("Login"); ?>" /> - <?php } ?> - </form> - </div> - </li> - </ul> - </li> - </ul> - <?php if( isset( $tpl->output['menu_More'] ) ) { - $tpl->printMenu("More"); - } ?> - - <!-- icons --> - <div> - <?php if( isset( $tpl->output['menu_Icons'] ) ) { - echo $tpl->output['menu_Icons']; - } ?> - </div> - - <?php if($GLOBALS['linpha']->sql->isLoggedIn()) { ?> - <!-- my settings and admin links --> - <ul> - <li><a href="<?php echo LINPHA_DIR; ?>/?cat=settings"><?php echo i18n("My Settings"); ?></a></li> - </ul> - <?php $tpl->printMenu("Admin",LINPHA_DIR."/admin/"); ?> - <?php } ?> + <?php $tpl->printMenus(); ?> </div> + <div style="clear: both;"></div> <!-- end menu --> + + <?php $tpl->includeFile('body'); ?> </body> Modified: trunk/linpha2/templates/default/themes/default/css/admin.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/admin.css 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/templates/default/themes/default/css/admin.css 2006-10-29 23:55:17 UTC (rev 4609) @@ -4,50 +4,52 @@ padding: 0; } -.navlist +.option_title { - padding: 3px 0; - margin-left: 0; - border-bottom: 1px solid #778; - font: bold 12px Verdana, sans-serif; + font-weight: bold; } -.navlist li -{ - list-style: none; - margin: 0; - display: inline; -} - -.navlist li a -{ - padding: 3px 0.5em; - margin-left: 3px; - border: 1px solid #778; - border-bottom: none; - background: #DDE; - text-decoration: none; -} - -.navlist li a:link { color: #448; } -.navlist li a:visited { color: #448; } - -.navlist li a:hover -{ -color: #000; -background: #AAE; -border-color: #227; -} - -.navlist li a.current -{ -background: #01298f; -color: #ffffff; -border-bottom: 1px solid white; -} - - -.option_title -{ - font-weight: bold; -} \ No newline at end of file +/** + * menu + */ + .navlist + { + padding: 3px 0; + margin-left: 0; + border-bottom: 1px solid #778; + font: bold 12px Verdana, sans-serif; + } + + .navlist li + { + list-style: none; + margin: 0; + display: inline; + } + + .navlist li a + { + padding: 3px 0.5em; + margin-left: 3px; + border: 1px solid #778; + border-bottom: none; + background: #DDE; + text-decoration: none; + } + + .navlist li a:link { color: #448; } + .navlist li a:visited { color: #448; } + + .navlist li a:hover + { + color: #000; + background: #AAE; + border-color: #227; + } + + .navlist li a.current + { + background: #01298f; + color: #ffffff; + border-bottom: 1px solid white; + } \ No newline at end of file Modified: trunk/linpha2/templates/default/themes/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/global.css 2006-10-29 13:35:39 UTC (rev 4608) +++ trunk/linpha2/templates/default/themes/default/css/global.css 2006-10-29 23:55:17 UTC (rev 4609) @@ -5,7 +5,7 @@ */ body { font-family: arial, helvetica, sans-serif; - margin: 0px; + margin: 10px; padding: 0px; } @@ -42,9 +42,9 @@ */ #title { - margin-top: 10px; + margin: 0; margin-bottom: 20px; - margin-left: 100px; + margin-left: 90px; font-size: 25pt; } @@ -59,30 +59,16 @@ } /** - * left - */ - #divleft - { - position: absolute; - top: 120px; - left: 10px; - } - #left - { - width: 205px; - - padding: 5px; - margin: 0px; - } - -/** * navigation */ #divnavigation { - margin: 0px 10px 10px 10px; + margin: 0; + margin-bottom: 10px; + padding: 0; } #navigation { + margin: 0; padding: 5px; } @@ -90,31 +76,17 @@ * main */ #divmain { - margin: 0px 10px 10px 10px; - padding: 0px; + margin: 0; + padding: 0; } #main { + margin: 0; padding: 0px; padding-left: 10px; padding-right: 10px; } /** - * right - * - * @todo not used anymore, but in static view.. - */ - #divright - { - margin: 10px 10px 10px 10px; - } - #right - { - padding: 5px; - margin: 0px; - } - -/** * syslog */ #divSysLog { @@ -125,6 +97,7 @@ z-index: 10; + margin: 0; padding: 5px; border: 1px solid #FFD500; @@ -135,7 +108,11 @@ position: absolute; right: 0; top: 0; + z-index: 10; + + margin: 0; + padding: 0; background-color: #ffd5ee; border: 1px solid #f09; @@ -149,21 +126,26 @@ margin: 2px; margin-left: 15px; margin-bottom: 15px; + padding: 0; width: 700px; } .div_folder_text { - height: 140px; + margin: 0; padding: 5px; + + height: 140px; } .img_folder_thumbnail { - float: left; - + margin: 0; margin-left: 20px; margin-right: 30px; margin-top: 5px; + padding: 0; + + float: left; width: 130px; height: 130px; @@ -176,7 +158,11 @@ * menu */ #menu { - margin-left: 50px; + margin: 0; + padding: 0; + + width: 100%; + float: left; } /** @@ -189,33 +175,31 @@ padding: 0; float: left; } - - /** - * hover - */ - #menu li a:hover, #menu span:hover { - background: #bbbbbb; + #menu div a { + margin: 0; + padding: 0; + float: left; } /** * first level elements - */ + */ #menu ul { list-style: none; + margin: 0; margin-left: 5px; margin-right: 5px; padding: 0; + + width: auto; float: left; - white-space: nowrap; border-top: 1px solid #000000; - } - /** - * first level elements - */ - #menu ul a, #menu ul span { + white-space: nowrap; + } + #menu ul a, #menu ul span, #menu ul div { display: block; margin: 0; @@ -226,79 +210,78 @@ text-align: center; text-decoration: none; - + color: #000000; - /*background: #FFFFFF;*/ } + #menu ul a:hover, #menu ul span:hover { + background: #bbbbbb; + } #menu ul span { background: url(../images/expand.gif) no-repeat 100% 100%; } - #menu li { - position: relative; - } - - /** - * only two or more level elements - */ + * second and more level elements + */ #menu ul ul { position: absolute; z-index: 500; + + border: 0; + background: #eeeeee; /** * relativ to parent element! be careful */ - font-size: 1em; margin: 0; padding: 0; + font-size: 1em; + } #menu ul ul a, #menu ul ul span, #menu ul ul div { - display: block; - margin: 0; padding-left: 5px; - padding-right: 5px; + padding-right: 15px; padding-top: 2px; padding-bottom: 2px; + border-width: 1px; + border-style: solid; + border-color: #ccc #888 #555 #bbb; text-align: left; - text-decoration: none; - - border: 1px solid #000000; - border-top-width: 0px; - background: #eeeeee; } #menu ul ul span { background: #eeeeee url(../images/expand.gif) no-repeat 100% 100%; } /** - * the most important thing - * enable/disable submenus - */ - div... [truncated message content] |
From: <fan...@us...> - 2006-10-31 21:32:04
|
Revision: 4610 http://svn.sourceforge.net/linpha/?rev=4610&view=rev Author: fangehrn Date: 2006-10-31 13:31:46 -0800 (Tue, 31 Oct 2006) Log Message: ----------- 2006-10-31 flo * saving img width and height during import in database Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/install/lib.install.php trunk/linpha2/install/sql/sql.data.php trunk/linpha2/install/sql/sql.mysql.php trunk/linpha2/install/sql/sql.oci8po.php trunk/linpha2/install/sql/sql.postgres.php trunk/linpha2/install/sql/sql.sqlite.php trunk/linpha2/lib/classes/linpha.import.class.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-29 23:55:17 UTC (rev 4609) +++ trunk/linpha2/ChangeLog 2006-10-31 21:31:46 UTC (rev 4610) @@ -1,3 +1,6 @@ +2006-10-31 flo + * saving img width and height during import in database + 2006-10-30 flo * implemented ajax login/logout * implemented "view at" Modified: trunk/linpha2/install/lib.install.php =================================================================== --- trunk/linpha2/install/lib.install.php 2006-10-29 23:55:17 UTC (rev 4609) +++ trunk/linpha2/install/lib.install.php 2006-10-31 21:31:46 UTC (rev 4610) @@ -201,8 +201,16 @@ { if( ! installIsAbsolutePath( $path ) ) { - //$path = str_ireplace("../", " ", $path ); - $path = realpath($path); + if(file_exists($path)) + { + $path = realpath($path); + } + else + { + // remove first ../ because we are here in the install directory + $path = substr($path,3,strlen($path)-3); + $path = realpath(LINPHA_DIR).'/'.$path; + } } /** @@ -215,6 +223,18 @@ $path = substr($path,0,$len-1); } + /** + * unify slashes + */ + if(strpos( PHP_OS, 'WIN' ) !== FALSE) + { + $path = str_replace('/','\\',$path); + } + else + { + $path = str_replace('\\','/',$path); + } + return $path; } @@ -428,7 +448,7 @@ foreach($array AS $value) { /** - * remove '/' if not already done + * remove ending slash if not already done */ $len = strlen( $_POST[$value.'_dir'] ); $lastsign = substr( $_POST[$value.'_dir'], $len-1); Modified: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2006-10-29 23:55:17 UTC (rev 4609) +++ trunk/linpha2/install/sql/sql.data.php 2006-10-31 21:31:46 UTC (rev 4610) @@ -110,7 +110,18 @@ 'sys_style_thumb_nojsnrcols', 'sys_style_image_width', 'sys_style_image_height', - 'sys_style_image_nrprevnextthumbs' + 'sys_style_image_nrprevnextthumbs' => '3', + 'sys_style_image_useeffects' => '1', + + 'sys_style_layout_color_bodybg' => 'DDDDDD', // the blue design + 'sys_style_layout_color_elembg' => '87CEFA', + 'sys_style_layout_color_font' => '000000', + 'sys_style_layout_color_albumsbg' => 'D5FCF4', + 'sys_style_layout_color_links' => '005388', + 'sys_style_layout_color_linkshover' => '666666', + + 'sys_style_layout_theme' => 'default', + 'sys_style_layout_template' => 'default', ); /** Modified: trunk/linpha2/install/sql/sql.mysql.php =================================================================== --- trunk/linpha2/install/sql/sql.mysql.php 2006-10-29 23:55:17 UTC (rev 4609) +++ trunk/linpha2/install/sql/sql.mysql.php 2006-10-31 21:31:46 UTC (rev 4610) @@ -64,6 +64,8 @@ "img_type INT NOT NULL default '0', " . "name VARCHAR(255) NOT NULL, " . "md5sum VARCHAR(32) NOT NULL default '', " . + "width INT NOT NULL default '0', " . + "height INT NOT NULL default '0', " . "time_add INT NOT NULL default '0', " . "time_mod INT NOT NULL default '0', " . "time_exif INT NOT NULL default '0', " . Modified: trunk/linpha2/install/sql/sql.oci8po.php =================================================================== --- trunk/linpha2/install/sql/sql.oci8po.php 2006-10-29 23:55:17 UTC (rev 4609) +++ trunk/linpha2/install/sql/sql.oci8po.php 2006-10-31 21:31:46 UTC (rev 4610) @@ -59,6 +59,8 @@ "img_type NUMBER(10) DEFAULT '0', " . "name VARCHAR2(255) NOT NULL, " . "md5sum VARCHAR2(32), " . + "width NUMBER(10) default '0', " . + "height NUMBER(10) default '0', " . "time_add NUMBER(12) DEFAULT '0', " . "time_mod NUMBER(12) DEFAULT '0', " . "time_exif NUMBER(12) DEFAULT '0', " . Modified: trunk/linpha2/install/sql/sql.postgres.php =================================================================== --- trunk/linpha2/install/sql/sql.postgres.php 2006-10-29 23:55:17 UTC (rev 4609) +++ trunk/linpha2/install/sql/sql.postgres.php 2006-10-31 21:31:46 UTC (rev 4610) @@ -59,6 +59,8 @@ "img_type INT NOT NULL default '0', " . "name VARCHAR(255) NOT NULL, " . "md5sum VARCHAR(32) NOT NULL default '', " . + "width INT NOT NULL default '0', " . + "height INT NOT NULL default '0', " . "time_add INT NOT NULL default '0', " . "time_mod INT NOT NULL default '0', " . "time_exif INT NOT NULL default '0', " . Modified: trunk/linpha2/install/sql/sql.sqlite.php =================================================================== --- trunk/linpha2/install/sql/sql.sqlite.php 2006-10-29 23:55:17 UTC (rev 4609) +++ trunk/linpha2/install/sql/sql.sqlite.php 2006-10-31 21:31:46 UTC (rev 4610) @@ -59,6 +59,8 @@ "img_type INTEGER NOT NULL default '0', " . "name VARCHAR(255) NOT NULL, " . "md5sum VARCHAR(32) NOT NULL default '', " . + "width INTEGER NOT NULL default '0', " . + "height INTEGER NOT NULL default '0', " . "time_add INTEGER NOT NULL default '0', " . "time_mod INTEGER NOT NULL default '0', " . "time_exif INTEGER NOT NULL default '0', " . Modified: trunk/linpha2/lib/classes/linpha.import.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.import.class.php 2006-10-29 23:55:17 UTC (rev 4609) +++ trunk/linpha2/lib/classes/linpha.import.class.php 2006-10-31 21:31:46 UTC (rev 4610) @@ -167,12 +167,13 @@ linSysLog(i18n("New").': '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); - list($md5sum,$file_type,$stats_number,$time_exif,$rotate) = LinImport::getFileInformation($dirname,$filename); + list($md5sum,$file_type,$org_width,$org_height,$stats_number,$time_exif,$rotate) = + LinImport::getFileInformation($dirname,$filename); $GLOBALS['linpha']->db->Execute("INSERT into ".PREFIX."photos ( " . - "parent_id, name, img_type, md5sum, time_add, time_mod, time_exif, rotate, stats_numbers ) " . + "parent_id, name, img_type, md5sum, width, height, time_add, time_mod, time_exif, rotate, stats_numbers ) " . "VALUES ( '".$parent_id."' , '".$GLOBALS['linpha']->sql->linAddslashes($filename)."', " . - "'".$file_type."' , '".$md5sum."', '".time()."', '".filemtime($dirname.'/'.$filename)."', '".$time_exif."', '".$rotate."', '".$stats_number."' )"); + "'".$file_type."' , '".$org_width."' , '".$org_height."' , '".$md5sum."', '".time()."', '".filemtime($dirname.'/'.$filename)."', '".$time_exif."', '".$rotate."', '".$stats_number."' )"); /** * delete thumbnail if one exists with the same id @@ -271,24 +272,36 @@ */ function updateEntry( $id , $dirname , $filename ) { - list($md5sum,$file_type,$stats_number,$time_exif,$rotate) = LinImport::getFileInformation($dirname,$filename); + list($md5sum,$file_type,$org_width,$org_height,$stats_number,$time_exif,$rotate) + = LinImport::getFileInformation($dirname,$filename); $data = $GLOBALS['linpha']->db->GetRow("SELECT img_type, md5sum " . "FROM ".PREFIX."photos WHERE id = '".$id."'"); /** * update file_type + * + * on change of file_type, change: + * - img_type + * - width and height + * - time_exif + * - stats_numbers */ if($file_type != $data[0]) { linSysLog(i18n("Detected a change of file_type in:")." ".htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); $GLOBALS['linpha']->db->Execute("UPDATE ".PREFIX."photos " . - "SET img_type = '".$file_type."', stats_numbers = '".$stats_number."' " . + "SET img_type = '".$file_type."', width = '".$org_width."', height = '".$org_height."', time_exif = '".$time_exif."', stats_numbers = '".$stats_number."' " . "WHERE id = '".$id."'"); } /** * update md5sum + * + * on change of md5sum, change: + * - width and height + * - time_exif, time_mod + * - rotate ?) */ /** * @todo hey, thats a nice feature! we are now able to detect @@ -299,7 +312,7 @@ linSysLog(sprintf(i18n("File %s changed, updating data..."),htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES))); $GLOBALS['linpha']->db->Execute("UPDATE ".PREFIX."photos " . - "SET md5sum = '".$md5sum."' WHERE id = '".$id."'"); + "SET md5sum = '".$md5sum."', width = '".$org_width."', height = '".$org_height."', time_mod = '".filemtime($dirname.'/'.$filename)."', time_exif = '".$time_exif."', rotate = '".$rotate."' WHERE id = '".$id."'"); LinImport::updateMd5sum( $id, $data[1], $md5sum ); LinImage::createThumbnail( $id , $file_type , $force=true ); @@ -352,6 +365,8 @@ $stats_number = 0; $time_exif = "0"; $rotate = "0"; + $org_width = "0"; + $org_height = "0"; $ext = LinFilesys::getFileExtFromPath($filename); if($filename{0} == '.') @@ -443,7 +458,7 @@ linSysLog('Error: what am i? '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); } - return array($md5sum,$file_type,$stats_number,$time_exif,$rotate); + return array($md5sum,$file_type,$org_width,$org_height,$stats_number,$time_exif,$rotate); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2006-10-31 23:05:49
|
Revision: 4611 http://svn.sourceforge.net/linpha/?rev=4611&view=rev Author: fangehrn Date: 2006-10-31 15:05:16 -0800 (Tue, 31 Oct 2006) Log Message: ----------- * use in imgview.class the width and heigth from database * updated file list support of imagemagick Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/import.php trunk/linpha2/docs/dev/TODO.txt trunk/linpha2/lib/classes/linpha.filesys.class.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.identify.class.php trunk/linpha2/lib/classes/linpha.image.class.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.import.class.php trunk/linpha2/lib/classes/linpha.metadata.class.php trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/modules/module.ajax.php trunk/linpha2/lib/modules/module.albums.php trunk/linpha2/lib/modules/module.browse.php trunk/linpha2/lib/modules/module.newimg.php trunk/linpha2/lib/modules/module.search.php trunk/linpha2/templates/default/fragments.php trunk/linpha2/templates/default/themes/default/css/global.css Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/ChangeLog 2006-10-31 23:05:16 UTC (rev 4611) @@ -1,5 +1,7 @@ 2006-10-31 flo * saving img width and height during import in database + * use in imgview.class the width and heigth from database + * updated file list support of imagemagick 2006-10-30 flo * implemented ajax login/logout Modified: trunk/linpha2/admin/import.php =================================================================== --- trunk/linpha2/admin/import.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/admin/import.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -35,7 +35,7 @@ if( isset($_POST['cmd']) && $_POST['cmd']=='import') { - echo '<h1>'.i18n("Running Import...").'</h1><br />'; + echo '<h1>'.i18n("Running Import...").'</h1>'; if(!isset($_REQUEST['album_select']) OR $_REQUEST['album_select'][0]=='all') { @@ -52,7 +52,7 @@ */ if($_REQUEST['index_import']=='index') { - echo '<h2>'.i18n("Directory Import").'</h2><br />'; + echo '<h2>'.i18n("Directory Import").'</h2>'; if($all_albums) { echo i18n("Parsing All Directories...").'<br />'; @@ -88,7 +88,7 @@ */ if($_REQUEST['index_thumbnails']!='no' OR isset($_REQUEST['index_thumbnails_delete'])) { - echo '<h2>'.i18n("Thumbnails").'</h2><br />'; + echo '<h2>'.i18n("Thumbnails").'</h2>'; $thumbnail = new LinImage(); @@ -137,7 +137,7 @@ foreach($_REQUEST['album_select'] AS $key=>$value) { $data = $GLOBALS['linpha']->db->GetRow("SELECT name FROM ".PREFIX."photos WHERE id = '".LinSql::linAddslashes($value)."'"); - echo '<h3>'.i18n("Parsing Directory:").' '.$data['name'].'</h3><br />'; + echo i18n("Parsing Directory:").' '.$data['name'].'<br />'; $sql = "SELECT id FROM ".PREFIX."photos WHERE " . "parent_id = '".LinSql::linAddslashes($value)."' AND " . @@ -191,7 +191,7 @@ echo '<br />'; } - echo '<br /><br />'; + echo '<br />'; } @@ -208,7 +208,7 @@ if( isset( $_REQUEST['index_'.$meta_value] ) && ( $_REQUEST['index_'.$meta_value] == 'index' OR isset($_REQUEST['index_'.$meta_value.'_delete']) ) ) { - echo '<h2>'.i18n("File Indexing").' ('.strtoupper($meta_value).')</h2><br />'; + echo '<h2>'.i18n("File Indexing").' ('.strtoupper($meta_value).')</h2>'; /** * get imgids to indexing, if reindex is selected: delete these entries first @@ -300,9 +300,10 @@ flush(); } } + } - echo '<br />'; + echo '<br /><br />'; } unset($array_meta_ids); } @@ -321,6 +322,8 @@ <?php echo i18n("Import").':'; ?> <br /> + +<input type="checkbox" id="index_import_detect_filechanges" name="force_update" value="true" /><label for="index_import_detect_filechanges"> <?php echo i18n("Detect File Changes"); ?></label><br /> <input type="radio" id="index_import_no" name="index_import" value="no" /><label for="index_import_no"> <?php echo i18n("No Import"); ?></label><br /> <input type="radio" id="index_import_index" name="index_import" value="index" checked="checked" /><label for="index_import_index"> <?php echo i18n("Import"); ?></label><br /> <br /> Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/docs/dev/TODO.txt 2006-10-31 23:05:16 UTC (rev 4611) @@ -4,7 +4,8 @@ ## Small Todos -- save image height and width in database to reduce file access in get_image.php and imgview() ? +- since the admin pages uses the template system, there is no update of the status during the import + thats not very user friendly ## Big Todos Modified: trunk/linpha2/lib/classes/linpha.filesys.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.filesys.class.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.filesys.class.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -237,5 +237,29 @@ return $ext; } +/** + * This function formats the filesize (byte) value to kB/MB/GB + */ +function niceFilesize($filesize, $precision) +{ + if ($filesize < 1000) { + $sizeunit = 'Bytes'; + $precision = 0; + } else { + $filesize /= 1024; + $sizeunit = 'KB'; + } + if ($filesize >= 1000) { + $filesize /= 1024; + $sizeunit = 'MB'; + } + if ($filesize >= 1000) { + $filesize /= 1024; + $sizeunit = 'GB'; + } + return number_format($filesize, $precision).' '.$sizeunit; +} + + } // end class LinFile ?> Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -99,29 +99,6 @@ } /** - * This function formats the filesize (byte) value to kB/MB/GB - */ -function niceFilesize($filesize, $precision) -{ - if ($filesize < 1000) { - $sizeunit = 'Bytes'; - $precision = 0; - } else { - $filesize /= 1024; - $sizeunit = 'KB'; - } - if ($filesize >= 1000) { - $filesize /= 1024; - $sizeunit = 'MB'; - } - if ($filesize >= 1000) { - $filesize /= 1024; - $sizeunit = 'GB'; - } - return number_format($filesize, $precision).' '.$sizeunit; -} - -/** * cut a string to the given size */ function cutString($string,$len,$with_span_title) Modified: trunk/linpha2/lib/classes/linpha.identify.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.identify.class.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.identify.class.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -345,95 +345,101 @@ 'dcm' => 109, 'dcx' => 110, 'dib' => 111, - 'dpx' => 112, - 'emf' => 113, - 'epdf' => 114, - 'epi' => 115, - 'eps' => 116, -// 'eps2' => 117, only write support -// 'eps3' => 118, only write support - 'epsf' => 119, - 'epsi' => 120, - 'ept' => 121, - 'fax' => 122, - 'fig' => 123, - 'fits' => 124, - 'fpx' => 125, -// 'gif' => 126, already - 'gplt' => 127, - 'gray' => 128, - 'hpgl' => 129, -// 'html' => 130, this type shouldn't be handled as image - 'ico' => 131, - 'jbig' => 132, - 'jng' => 133, -// 'jp2' => 134, already -// 'jpc' => 135, already -// 'jpeg' => 136, already - 'man' => 137, - 'mat' => 138, - 'miff' => 139, - 'mono' => 140, - 'mng' => 141, -// 'm2v' => 142, video -// 'mpeg' => 143, video - 'mpc' => 144, - 'msl' => 145, - 'mtv' => 146, - 'mvg' => 147, - 'otb' => 148, - 'p7' => 149, - 'palm' => 150, - 'pbm' => 151, - 'pcd' => 152, - 'pcds' => 153, - 'pcl w' => 154, - 'pcx' => 155, - 'pdb' => 156, -// 'pdf' => 157, this type shouldn't be handled as image - 'pfa' => 158, - 'pfb' => 159, - 'pgm' => 160, - 'picon' => 161, - 'pict' => 162, - 'pix' => 163, -// 'png' => 164, already - 'pnm' => 165, - 'ppm' => 166, - 'ps' => 167, - 'ps2' => 168, - 'ps3' => 169, -// 'psd' => 170, already - 'ptif' => 171, - 'pwp' => 172, - 'rad' => 173, - 'rgb' => 174, - 'rgba' => 175, - 'rla' => 176, - 'rle' => 177, - 'sct' => 178, - 'sfw' => 179, - 'sgi' => 180, - 'shtml' => 181, - 'sun' => 182, - 'svg' => 183, - 'tga' => 184, -// 'tiff' => 185, already - 'tim' => 186, - 'ttf' => 187, -// 'txt' => 188, this type shouldn't be handled as image - 'uil w' => 189, - 'uyvy' => 190, - 'vicar' => 191, - 'viff' => 192, -// 'wbmp' => 193, already - 'wmf' => 194, - 'wpg' => 195, -// 'xbm' => 196, already - 'xcf' => 197, - 'xpm' => 198, - 'xwd' => 199, - 'yuv' => 200, + 'dng' => 112, + 'dot' => 113, + 'dpx' => 114, + 'emf' => 115, + 'epdf' => 116, + 'epi' => 117, + 'eps' => 118, +// 'eps2' => 119, only write support +// 'eps3' => 120, only write support + 'epsf' => 121, + 'epsi' => 122, + 'ept' => 123, + 'fax' => 124, + 'fig' => 125, + 'fits' => 126, + 'fpx' => 127, +// 'gif' => 128, already + 'gplt' => 129, + 'gray' => 130, + 'hpgl' => 131, +// 'html' => 132, this type shouldn't be handled as image + 'ico' => 133, + 'jbig' => 134, + 'jng' => 135, +// 'jp2' => 136, already +// 'jpc' => 137, already +// 'jpeg' => 138, already +// 'man' => 139, this type shouldn't be handled as image + 'mat' => 140, + 'miff' => 141, + 'mono' => 142, + 'mng' => 143, +// 'mpeg' => 144, video +// 'm2v' => 145, video + 'mpc' => 146, + 'msl' => 147, + 'mtv' => 148, + 'mvg' => 149, + 'otb' => 150, + 'p7' => 151, + 'palm' => 152, +// 'pam' => 153, only write support + 'pbm' => 154, + 'pcd' => 155, + 'pcds' => 156, + 'pcl w' => 157, + 'pcx' => 158, + 'pdb' => 159, +// 'pdf' => 160, this type shouldn't be handled as image + 'pfa' => 161, + 'pfb' => 162, + 'pgm' => 163, + 'picon' => 164, + 'pict' => 165, + 'pix' => 166, +// 'png' => 167, already + 'pnm' => 168, + 'ppm' => 169, + 'ps' => 170, + 'ps2' => 171, + 'ps3' => 172, +// 'psd' => 173, already + 'ptif' => 174, + 'pwp' => 175, + 'rad' => 176, + 'rgb' => 177, + 'rgba' => 178, + 'rla' => 179, + 'rle' => 180, + 'sct' => 181, + 'sfw' => 182, + 'sgi' => 183, +// 'shtml' => 184, only write support + 'sun' => 185, + 'svg' => 186, + 'tga' => 187, +// 'tiff' => 188, already + 'tim' => 189, + 'tif' => 190, +// 'txt' => 191, this type shouldn't be handled as image +// 'uil' => 192, only write support + 'uyvy' => 193, + 'vicar' => 194, + 'viff' => 195, +// 'wbmp' => 196, already + 'wmf' => 197, + 'wpg' => 198, +// 'x' => 199, ? +// 'xbm' => 200, already + 'xcf' => 201, + 'xpm' => 202, + 'xwd' => 203, + 'ycbcr' => 204, + 'ycbcra' => 205, + 'yuv' => 206, // video 'mpg' => 1000, // getimagesize detects mpg as type 15, but type 15 is wbmp (look at the mimetype returned by getimagesize), pay attention... @@ -459,35 +465,36 @@ 'php' => 3002, 'asp' => 3003, - 'txt' => 4000, - 'pdf' => 4001, - 'rtf' => 4002, + 'txt' => 3050, + 'pdf' => 3051, + 'rtf' => 3052, + 'man' => 3053, // OpenOffice - 'sxw' => 5000, // OpenOffice Textdocument - 'stw' => 5001, // OpenOffice Textdocument - 'sxc' => 5002, // OpenOffice Spreadsheet - 'stc' => 5003, // OpenOffice Spreadsheet - 'sxi' => 5004, // OpenOffice Presentation - 'sti' => 5005, // OpenOffice Presentation - 'sxd' => 5006, // OpenOffice Draw - 'std' => 5007, // OpenOffice Draw - 'sxm' => 5008, // OpenOffice Formula + 'sxw' => 3100, // OpenOffice Textdocument + 'stw' => 3101, // OpenOffice Textdocument + 'sxc' => 3102, // OpenOffice Spreadsheet + 'stc' => 3103, // OpenOffice Spreadsheet + 'sxi' => 3104, // OpenOffice Presentation + 'sti' => 3105, // OpenOffice Presentation + 'sxd' => 3106, // OpenOffice Draw + 'std' => 3107, // OpenOffice Draw + 'sxm' => 3108, // OpenOffice Formula - 'sdw' => 5020, // Starwriter Textdocument - 'sdc' => 5021, // Starcalc - 'sda' => 5022, // StarImpress - 'sdd' => 5023, // StarImpress - 'sdp' => 5024, // StarImpress + 'sdw' => 3120, // Starwriter Textdocument + 'sdc' => 3121, // Starcalc + 'sda' => 3122, // StarImpress + 'sdd' => 3123, // StarImpress + 'sdp' => 3124, // StarImpress // MS Office - 'doc' => 5500, // MS Word - 'dot' => 5501, // MS Word - 'xls' => 5502, // MS Excel - 'xlt' => 5503, // MS Excel - 'ppt' => 5504, // MS Powerpoint - 'pps' => 5505, // MS Powerpoint - 'pot' => 5506, // MS Powerpoint + 'doc' => 3200, // MS Word + 'dot' => 3201, // MS Word + 'xls' => 3202, // MS Excel + 'xlt' => 3203, // MS Excel + 'ppt' => 3204, // MS Powerpoint + 'pps' => 3205, // MS Powerpoint + 'pot' => 3206, // MS Powerpoint */ 'unsupported' => 9999999 Modified: trunk/linpha2/lib/classes/linpha.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.image.class.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.image.class.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -32,12 +32,12 @@ public $photo_id, $cached_id; public $isCached; -public $img_type; public $mode; public $image_tool; +public $img_type, $org_width, $org_height, $rotate; private $src_file; -private $org_width, $org_height, $img_width, $img_height; +private $img_width, $img_height; private $img_quality; /** @@ -53,7 +53,7 @@ * check for valid id * and get img_type and rotate informations */ - $query = $GLOBALS['linpha']->db->Execute("SELECT id, img_type, rotate " . + $query = $GLOBALS['linpha']->db->Execute("SELECT id, img_type, rotate, width, height " . "FROM ".PREFIX."photos " . "WHERE id = '".LinSql::linAddslashes( $this->photo_id )."'"); @@ -91,6 +91,8 @@ */ $this->rotate = $data['rotate']; $this->img_type = $data['img_type']; + $this->org_width = $data['width']; + $this->org_height = $data['height']; $this->setCachedInfos(); /** @@ -274,9 +276,6 @@ echo i18n("You should consider start a re-import of your files/folders").'<br />'; return false; } - - - list($this->org_width,$this->org_height,$org_type) = LinIdentify::linGetImageSize( $this->src_file ); } return true; Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -24,6 +24,9 @@ */ if(!defined('LINPHA_DIR')) { exit(1); } +define('SELECT_FIELDS',PREFIX."photos.id, ".PREFIX."photos.name, ".PREFIX."photos.img_type, ". + PREFIX."photos.md5sum, ".PREFIX."photos.width, ".PREFIX."photos.height, ". + PREFIX."photos.stats_numbers, ".PREFIX."photos.time_add"); class LinImgview { @@ -33,7 +36,7 @@ public $photos; public $photos_filtered; public $use_javascript; -public $id_current, $id_parent, $img_type, $filename, $md5sum; +public $id_current, $id_parent, $img_type, $filename, $md5sum, $org_width, $org_height; private $nr_pages, $current_page; // only used if javascript disabled private $newCommentAdded = false; // used for ajax @@ -60,7 +63,7 @@ /** * set file informations */ - $current_data = $GLOBALS['linpha']->db->GetRow("SELECT id, name, img_type, parent_id, md5sum FROM ".PREFIX."photos " . + $current_data = $GLOBALS['linpha']->db->GetRow("SELECT id, name, img_type, parent_id, md5sum, width, height FROM ".PREFIX."photos " . "WHERE id = '".linSql::linAddslashes($_GET['id'])."'"); /** @@ -72,6 +75,8 @@ $this->img_type = $current_data['img_type']; $this->filename = $current_data['name']; $this->md5sum = $current_data['md5sum']; + $this->org_width = $current_data['width']; + $this->org_height = $current_data['height']; $this->id_current = $current_data['id']; /** @@ -265,6 +270,7 @@ Array( 'name' => i18n("Import"), 'value' => Array( + Array('name' => i18n("Start Import Of This Folder/File"), 'value' => LINPHA_DIR.'/admin/?cat=import&album_select[]='.$this->id_parent), Array('name' => i18n("Detect File Changes"), 'value' => $GLOBALS['linpha']->template->URL_full.'&force_update') ) ); @@ -600,7 +606,7 @@ } else { $flag_nr = 13; } - $array_image_infos = MetaData::readInformations( $full_filename, $filename, $md5sum, $flag_nr ); + $array_image_infos = MetaData::readInformations( $full_filename, $filename, $md5sum, $photo_value['width'], $photo_value['height'], $flag_nr ); $index = 'before'; $i=0; @@ -1152,24 +1158,20 @@ */ function viewImgCommon() { - /** - * get image width and height - * @todo see todo.txt wether to save width and height in database - */ - $this->src_file = LinSql::getFullImagePath( $this->id_current ); - list($this->org_width,$this->org_height,$org_type) = LinIdentify::linGetImageSize( $this->src_file ); - $this->max_width = $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; - $this->max_height = $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; - $array = LinImage::scaleToFit($this->org_width,$this->org_height,$this->max_width,$this->max_height); - $this->img_width = $array['w']; - $this->img_height = $array['h']; + $this->src_file = LinSql::getFullImagePath( $this->id_current ); + $this->max_width = $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; + $this->max_height = $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; + $array = LinImage::scaleToFit($this->org_width,$this->org_height,$this->max_width,$this->max_height); + $this->img_width = $array['w']; + $this->img_height = $array['h']; + $this->viewImgSetPrevNextThumb(); $this->viewImgStoreImageInformation(); include_once(LINPHA_DIR.'/lib/classes/linpha.metadata.class.php'); - $GLOBALS['linpha']->template->output['image_infos'] = MetaData::readInformations( $this->full_filename, $this->filename, $this->md5sum, $flag_nr=10 ); + $GLOBALS['linpha']->template->output['image_infos'] = MetaData::readInformations( $this->full_filename, $this->filename, $this->md5sum, $this->org_width, $this->org_height, $flag_nr=10 ); if(isset($_GET['force_update'])) { LinImport::updateEntry( $this->id_current , dirname($this->full_filename) , $this->filename ); Modified: trunk/linpha2/lib/classes/linpha.import.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.import.class.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.import.class.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -118,8 +118,9 @@ /** * "detect file changes", parse updated entries * not by default! (performance issues) + * and only admin can do that */ - if( isset($_GET['force_update']) ) + if( isset($_REQUEST['force_update']) && $GLOBALS['linpha']->sql->isAdmin() ) { foreach($array_update AS $key=>$value) { @@ -172,8 +173,8 @@ $GLOBALS['linpha']->db->Execute("INSERT into ".PREFIX."photos ( " . "parent_id, name, img_type, md5sum, width, height, time_add, time_mod, time_exif, rotate, stats_numbers ) " . - "VALUES ( '".$parent_id."' , '".$GLOBALS['linpha']->sql->linAddslashes($filename)."', " . - "'".$file_type."' , '".$org_width."' , '".$org_height."' , '".$md5sum."', '".time()."', '".filemtime($dirname.'/'.$filename)."', '".$time_exif."', '".$rotate."', '".$stats_number."' )"); + "VALUES ( '".$parent_id."' , '".$GLOBALS['linpha']->sql->linAddslashes($filename)."', '".$file_type."'," . + "'".$md5sum."' , '".$org_width."' , '".$org_height."' , '".time()."', '".filemtime($dirname.'/'.$filename)."', '".$time_exif."', '".$rotate."', '".$stats_number."' )"); /** * delete thumbnail if one exists with the same id @@ -315,7 +316,10 @@ "SET md5sum = '".$md5sum."', width = '".$org_width."', height = '".$org_height."', time_mod = '".filemtime($dirname.'/'.$filename)."', time_exif = '".$time_exif."', rotate = '".$rotate."' WHERE id = '".$id."'"); LinImport::updateMd5sum( $id, $data[1], $md5sum ); - LinImage::createThumbnail( $id , $file_type , $force=true ); + + $thumbnail = new LinImage(); + $_GET['force'] = true; + $thumbnail->createThumbnail($id); } } @@ -324,6 +328,12 @@ * occurs while rotating images, or if LinImport detects a change of the file * (for example: image has been edited with an external program) * + * problem: if there are two images with the same md5sum, and one image gets changed + * linpha will update the md5sum of the changed image forthe comments (for example) + * to the new value, but if we then do a "detect file changes" on the old image, + * the old image will do the same and change the md5sum of the comment back to this + * this will create a race condition + * * @todo if the file changed, it is best to re-index image * -> delete/update exif/iptc/xmp data! */ Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -73,7 +73,7 @@ /** * read image information from database */ -function readInformations($full_filename,$filename,$md5sum,$flag_nr) +function readInformations($full_filename,$filename,$md5sum,$width,$height,$flag_nr) { $query = $GLOBALS['linpha']->db->Execute("SELECT name " . "FROM ".PREFIX."meta_fields " . @@ -106,11 +106,10 @@ $value = $filename; // is already escaped break; case 'imagesize': - $value = filesize( $full_filename ); + $value = LinFilesys::niceFilesize( filesize( $full_filename ), 2 ); break; case 'dimension': - $array = LinIdentify::linGetImageSize( $full_filename ); - $value = $array[0].'x'.$array[1]; + $value = $width.'x'.$height; break; case 'thumbnail': $value = 'thumbnail'; Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/js/LinImage.js 2006-10-31 23:05:16 UTC (rev 4611) @@ -34,8 +34,11 @@ }, loadImage: function(imgId) { - IdCurrent = imgId; - menuNeedsUpdating = true; // IdCurrent changed, update menu on next hover of the menu + if(IdCurrent != imgId) + { + IdCurrent = imgId; + menuNeedsUpdating = true; // IdCurrent changed, update menu on next hover of the menu + } if(preloadXmlFinished[imgId] && typeof xmlDoc[imgId] != "undefined" ) // use typeof to work in IE { Modified: trunk/linpha2/lib/modules/module.ajax.php =================================================================== --- trunk/linpha2/lib/modules/module.ajax.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/modules/module.ajax.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -75,15 +75,6 @@ $linpha->template->URL_full = $linpha->template->URL_base.'&id='.$linpha->imgview->id_current; $_SESSION['ref_url_full'] = $linpha->template->URL_full; - if( $linpha->imgview->mode == 'image' ) - { - /** - * @todo read from database - */ - $src_file = LinSql::getFullImagePath( $linpha->imgview->id_current ); - list($linpha->imgview->org_width,$linpha->imgview->org_height,$org_type) = LinIdentify::linGetImageSize( $src_file ); - } - $linpha->imgview->setMenu(); } else // return a default menu Modified: trunk/linpha2/lib/modules/module.albums.php =================================================================== --- trunk/linpha2/lib/modules/module.albums.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/modules/module.albums.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -77,10 +77,10 @@ * * take folders first */ - $array_folders = $GLOBALS['linpha']->db->GetAssoc("SELECT id, name, img_type, md5sum, stats_numbers, time_add FROM ".PREFIX."photos " . + $array_folders = $GLOBALS['linpha']->db->GetAssoc("SELECT ".SELECT_FIELDS." FROM ".PREFIX."photos " . "WHERE img_type = '0' AND parent_id = '".$linpha->imgview->id_parent."' ORDER by ".$linpha->imgview->orderby); - $array_files = $GLOBALS['linpha']->db->GetAssoc("SELECT id, name, img_type, md5sum, stats_numbers, time_add FROM ".PREFIX."photos " . + $array_files = $GLOBALS['linpha']->db->GetAssoc("SELECT ".SELECT_FIELDS." FROM ".PREFIX."photos " . "WHERE img_type <> '0' AND img_type <> '9999999' AND parent_id = '".$linpha->imgview->id_parent."' ORDER by ".$linpha->imgview->orderby); $linpha->imgview->photos = array_merge($array_folders,$array_files); Modified: trunk/linpha2/lib/modules/module.browse.php =================================================================== --- trunk/linpha2/lib/modules/module.browse.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/modules/module.browse.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -226,9 +226,7 @@ if(isset($_GET['year']) && $_GET['year']==0) { - $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT " . - "".PREFIX."photos.id, ".PREFIX."photos.name, ".PREFIX."photos.img_type, " . - "".PREFIX."photos.md5sum, ".PREFIX."photos.stats_numbers, ".PREFIX."photos.time_add " . + $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT ".SELECT_FIELDS." ". "FROM ".PREFIX."photos " . "LEFT OUTER JOIN ".PREFIX."meta_exif " . "ON ".PREFIX."photos.md5sum = ".PREFIX."meta_exif.md5sum " . @@ -239,9 +237,7 @@ } else { - $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT " . - "".PREFIX."photos.id, ".PREFIX."photos.name, ".PREFIX."photos.img_type, " . - "".PREFIX."photos.md5sum, ".PREFIX."photos.stats_numbers, ".PREFIX."photos.time_add " . + $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT ".SELECT_FIELDS." ". "FROM ".PREFIX."photos, ".PREFIX."meta_exif " . "WHERE ".PREFIX."photos.md5sum = ".PREFIX."meta_exif.md5sum " . "AND img_type <> '0' " . Modified: trunk/linpha2/lib/modules/module.newimg.php =================================================================== --- trunk/linpha2/lib/modules/module.newimg.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/modules/module.newimg.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -71,9 +71,7 @@ if( $GLOBALS['linpha']->sql->config->value['sys_style_home_newimagesnr'] != 0 ) { - $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT " . - PREFIX."photos.id, ".PREFIX."photos.name, ".PREFIX."photos.img_type, " . - PREFIX."photos.md5sum, ".PREFIX."photos.stats_numbers, ".PREFIX."photos.time_add " . + $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT ".SELECT_FIELDS." ". "FROM ".PREFIX."photos WHERE img_type <> 0 AND img_type <> 9999999 AND time_add > ".LinSql::linAddslashes($lower_date)." ". "ORDER BY ".$linpha->imgview->orderby); } Modified: trunk/linpha2/lib/modules/module.search.php =================================================================== --- trunk/linpha2/lib/modules/module.search.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/lib/modules/module.search.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -423,10 +423,7 @@ * set sql query string *DISTINCT */ - $sql_begin = "SELECT ".PREFIX."photos.id AS id, ".PREFIX."photos.name AS name, ". - PREFIX."photos.md5sum AS md5sum, " . - PREFIX."photos.img_type AS img_type, ". - PREFIX."photos.stats_numbers AS stats_numbers, ".PREFIX."photos.time_add AS time_add "; + $sql_begin = "SELECT ".SELECT_FIELDS." "; $sql_where = " FROM ".PREFIX."photos ". Modified: trunk/linpha2/templates/default/fragments.php =================================================================== --- trunk/linpha2/templates/default/fragments.php 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/templates/default/fragments.php 2006-10-31 23:05:16 UTC (rev 4611) @@ -32,7 +32,7 @@ <li> <div> <?php if( useAjax() ) { ?> - <form action="" method="POST" onsubmit="new Ajax.Updater('menu', LINPHA_DIR + '/?cat=ajax&reloadmenu', {method: 'post', asynchronous:true, parameters:Form.serialize(this), evalScripts:true}); return false;"> + <form action="" method="POST" onsubmit="new Ajax.Updater('menu', LINPHA_DIR + '/?cat=ajax&reloadmenu&id='+IdCurrent, {method: 'post', asynchronous:true, parameters:Form.serialize(this), evalScripts:true}); return false;"> <?php } else { ?> <form action="<?php echo $this->URL_full; ?>" method="POST"> <?php } Modified: trunk/linpha2/templates/default/themes/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/global.css 2006-10-31 21:31:46 UTC (rev 4610) +++ trunk/linpha2/templates/default/themes/default/css/global.css 2006-10-31 23:05:16 UTC (rev 4611) @@ -14,6 +14,7 @@ font-size: 18pt; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0px; + margin-top: 0px; margin-bottom: 5px; padding: 0px; } @@ -22,6 +23,7 @@ font-size: 14pt; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0px; + margin-top: 0px; margin-bottom: 5px; padding: 0px; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2006-11-01 17:55:02
|
Revision: 4612 http://svn.sourceforge.net/linpha/?rev=4612&view=rev Author: fangehrn Date: 2006-11-01 09:54:09 -0800 (Wed, 01 Nov 2006) Log Message: ----------- 2006-11-01 flo * implemented linpha_log() Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/permissions_readwrite.php trunk/linpha2/admin/permissions_usergroup.php trunk/linpha2/admin/settings_features.php trunk/linpha2/docs/dev/TODO.txt trunk/linpha2/get_image.php trunk/linpha2/get_thumb.php trunk/linpha2/install/lib.install.php trunk/linpha2/install/lib.requirements.php trunk/linpha2/install/sql/sql.data.php trunk/linpha2/install/step2_requirements.php trunk/linpha2/lib/adodb/adodb-errorhandler.inc.php trunk/linpha2/lib/classes/archiver.config.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.import.class.php trunk/linpha2/lib/classes/linpha.metadata.class.php trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/lib/classes/linpha.template.class.php trunk/linpha2/lib/include/common.php trunk/linpha2/lib/js/LinGlobal.js trunk/linpha2/lib/modules/module.ajax.php trunk/linpha2/lib/modules/module.albums.php trunk/linpha2/lib/modules/module.basket.php trunk/linpha2/lib/modules/module.browse.php trunk/linpha2/lib/modules/module.filemanager.php trunk/linpha2/lib/modules/module.newimg.php trunk/linpha2/lib/modules/module.search.php trunk/linpha2/lib/plugins/watermark/func.watermark.php trunk/linpha2/templates/default/fragments.php trunk/linpha2/templates/default/view_basket.html.php trunk/linpha2/templates/default/view_img_static.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/ChangeLog 2006-11-01 17:54:09 UTC (rev 4612) @@ -1,3 +1,6 @@ +2006-11-01 flo + * implemented linpha_log() + 2006-10-31 flo * saving img width and height during import in database * use in imgview.class the width and heigth from database Modified: trunk/linpha2/admin/permissions_readwrite.php =================================================================== --- trunk/linpha2/admin/permissions_readwrite.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/admin/permissions_readwrite.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -22,9 +22,8 @@ ); } + $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('plugins_filemanager_enable'),'plugins_filemanager_enable',$LinAdmin->option_value_system['plugins_filemanager_enable']); - $LinAdmin->printAdminConfig('radio',i18n("Enable Filemanager For Non-Admin Users"),'plugins_filemanager_enable'); - ?> <input type="hidden" name="cmd" value="saveconfig" /> <input type="submit" name="submit" value="<?php echo i18n("Submit"); ?>" /> @@ -33,7 +32,7 @@ <?php } -if($GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable']) +if($cat2 == 'view' OR ($cat2 == 'write' AND $GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable'] )) { /** @@ -102,7 +101,7 @@ */ if(isset($_GET['parent_id']) && $_GET['parent_id'] != 0) { - $parent_id = $_GET['parent_id']; + $parent_id = intval($_GET['parent_id']); $view_mode = 'files'; $array = $GLOBALS['linpha']->sql->getFullFilenameFromId( LinSql::linAddslashes($parent_id) ); @@ -131,7 +130,7 @@ /** * show edit/add permission dialog */ - if(isset($_GET['cmd']) AND isset($_GET['id'])) + if(isset($_GET['cmd']) && $_GET['cmd']=='edit') { $checked = ''; $array_perms = array(); @@ -140,11 +139,11 @@ * check wether add or edit (insert or update) */ $query = $linpha->db->Execute("SELECT id FROM ".PREFIX."permissions " . - "WHERE photos_id = '".LinSql::linAddslashes($_GET['id'])."' AND perm_type = '".$sql_perm_type."'"); + "WHERE photos_id = '".LinSql::linAddslashes($linpha->template->idCurrent)."' AND perm_type = '".$sql_perm_type."'"); if( ! $query->EOF ) { - list($stage, $perm) = $GLOBALS['linpha']->sql->getPerm( $_GET['id'], $sql_perm_type ); + list($stage, $perm) = $GLOBALS['linpha']->sql->getPerm( $linpha->template->idCurrent, $sql_perm_type ); $array_perms = explode(';',$perm); if(in_array('public',$array_perms)) @@ -154,7 +153,7 @@ } $query = $GLOBALS['linpha']->db->Execute("SELECT name FROM ".PREFIX."photos " . - "WHERE id = '".LinSql::linAddslashes($_GET['id'])."'"); + "WHERE id = '".LinSql::linAddslashes($linpha->template->idCurrent)."'"); $data = $query->FetchRow(ADODB_FETCH_NUM); ?> <form name="permission" method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id='.$parent_id; ?>"> @@ -165,7 +164,7 @@ * top folder can't be inherit * -> make sure we cannot delete this entry! */ - if($_GET['id'] != 0) + if($linpha->template->idCurrent != 0) { ?> <input type="checkbox" id="group_inherit" name="inherit" value="1" /><label for="group_inherit"> <?php echo i18n("Inherit From Parent"); ?></label><br /> @@ -191,7 +190,7 @@ echo '<input type="checkbox" id="group_'.$key.'" name="group[]" value="'.$key.'"'.$checked.' /><label for="group_'.$key.'"> '.$value.'</a><br />'; } ?> - <input type="hidden" name="photo_id" value="<?php echo $_GET['id']; ?>" /> + <input type="hidden" name="photo_id" value="<?php echo $linpha->template->idCurrent; ?>" /> <input type="hidden" name="parent_id" value="<?php echo $parent_id; ?>" /> <input type="hidden" name="cmd" value="save_permissions" /> <input type="submit" name="submit" value="save" /> Modified: trunk/linpha2/admin/permissions_usergroup.php =================================================================== --- trunk/linpha2/admin/permissions_usergroup.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/admin/permissions_usergroup.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -5,7 +5,7 @@ * get groups */ echo '<b>'.i18n("Edit Group Members").'</b><br />'; -$query = $GLOBALS['linpha']->db->Execute("SELECT id, group_name FROM ".PREFIX."groups ORDER by group_name"); +$query = $linpha->db->Execute("SELECT id, group_name FROM ".PREFIX."groups ORDER by group_name"); while($data = $query->FetchRow()) { echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=group&id='.$data['id'].'">'.$data['group_name'].'</a><br />'; @@ -17,7 +17,7 @@ * get users */ echo '<b>'.i18n("Edit User Memberships").'</b><br />'; -$query = $GLOBALS['linpha']->db->Execute("SELECT id, username FROM ".PREFIX."users ORDER by username"); +$query = $linpha->db->Execute("SELECT id, username FROM ".PREFIX."users ORDER by username"); while($data = $query->FetchRow()) { echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=user&id='.$data['id'].'">'.$data['username'].'</a><br />'; @@ -59,7 +59,7 @@ /** * delete all entries of current user */ - $GLOBALS['linpha']->db->Execute("DELETE FROM ".PREFIX."user_group WHERE ".$column_name." = '".LinSql::linAddslashes($_GET['id'])."'"); + $linpha->db->Execute("DELETE FROM ".PREFIX."user_group WHERE ".$column_name." = '".LinSql::linAddslashes($linpha->template->idCurrent)."'"); /** * add new entries if exists @@ -71,14 +71,14 @@ if($_GET['edit']=='group') { $userid = LinSql::linAddslashes($value); - $groupid = LinSql::linAddslashes($_GET['id']); + $groupid = LinSql::linAddslashes($linpha->template->idCurrent); } elseif($_GET['edit']=='user') { - $userid = LinSql::linAddslashes($_GET['id']); + $userid = LinSql::linAddslashes($linpha->template->idCurrent); $groupid = LinSql::linAddslashes($value); } - $GLOBALS['linpha']->db->Execute("INSERT into ".PREFIX."user_group (user_id, group_id) VALUES ('".$userid."','".$groupid."')"); + $linpha->db->Execute("INSERT into ".PREFIX."user_group (user_id, group_id) VALUES ('".$userid."','".$groupid."')"); } } } @@ -86,7 +86,7 @@ /** * get informations */ - $data = $GLOBALS['linpha']->db->GetRow("SELECT ".$select_name." FROM ".PREFIX.$table_name." WHERE id = '".LinSql::linAddslashes($_GET['id'])."'"); + $data = $linpha->db->GetRow("SELECT ".$select_name." FROM ".PREFIX.$table_name." WHERE id = '".LinSql::linAddslashes($linpha->template->idCurrent)."'"); echo '<b>'; if($_GET['edit']=='user') { @@ -102,10 +102,10 @@ * get all groups/users */ ?> - <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit='.$_GET['edit'].'&id='.$_GET['id']; ?>"> + <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit='.$_GET['edit'].'&id='.$linpha->template->idCurrent; ?>"> <select name="usergroup[]" size="5" style="width: 200;" multiple="multiple"> <?php - $query = $GLOBALS['linpha']->db->Execute("SELECT id, ".$other_select_name." " . + $query = $linpha->db->Execute("SELECT id, ".$other_select_name." " . "FROM ".PREFIX.$other_table_name." " . "ORDER by ".$other_select_name); while($data = $query->FetchRow()) @@ -116,14 +116,14 @@ if($_GET['edit']=='group') { $userid = $data['id']; - $groupid = LinSql::linAddslashes($_GET['id']); + $groupid = LinSql::linAddslashes($linpha->template->idCurrent); } elseif($_GET['edit']=='user') { - $userid = LinSql::linAddslashes($_GET['id']); + $userid = LinSql::linAddslashes($linpha->template->idCurrent); $groupid = $data['id']; } - $data2 = $GLOBALS['linpha']->db->GetRow("SELECT id FROM ".PREFIX."user_group " . + $data2 = $linpha->db->GetRow("SELECT id FROM ".PREFIX."user_group " . "WHERE user_id = '".$userid."' " . "AND group_id = '".$groupid."'"); if(isset($data2['id'])) Modified: trunk/linpha2/admin/settings_features.php =================================================================== --- trunk/linpha2/admin/settings_features.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/admin/settings_features.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -7,7 +7,8 @@ } $array_menu = Array( - 'others' => Array('name' => 'Others', 'link' => 'settings_features_others') + 'log' => Array('name' => 'Logging', 'link' => 'settings_features_log'), + 'others' => Array('name' => 'Others', 'link' => 'settings_features_others'), ); LinAdmin::printAdminMenu($array_menu,$cat3); @@ -18,22 +19,65 @@ switch($cat3) { -case 'others': + +case 'log': + /** * save settings */ if(isset($_POST['cmd']) && $_POST['cmd']=='saveconfig') { $LinAdmin->saveConfig(Array( + 'plugins_log_filename', + 'plugins_log_syslog_enable', + 'plugins_log_syslog_add_events', + 'plugins_log_email_enable', + 'plugins_log_email_add_events', + 'plugins_log_email_to', + 'plugins_log_email_headers', + 'plugins_log_email_subject' + )); + } + + echo '<br /><h2>'.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 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']); + + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_syslog_add_events'),'plugins_log_syslog_add_events',$LinAdmin->option_value_system['plugins_log_syslog_add_events']); + 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>'; + $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']); + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_email_headers'),'plugins_log_email_headers',$LinAdmin->option_value_system['plugins_log_email_headers']); + + $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_email_add_events'),'plugins_log_email_add_events',$LinAdmin->option_value_system['plugins_log_email_add_events']); + 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"); + + break; + +case 'others': + /** + * save settings + */ + /* if(isset($_POST['cmd']) && $_POST['cmd']=='saveconfig') + { + $LinAdmin->saveConfig(Array( 'sys_image_exif', 'sys_image_iptc', 'sys_image_xmp' )); } - $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_image_exif'),'sys_image_exif',$option_value_system['sys_image_exif']); - $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_image_iptc'),'sys_image_iptc',$option_value_system['sys_image_iptc']); - $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_image_xmp'),'sys_image_xmp',$option_value_system['sys_image_xmp']); + $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_image_exif'),'sys_image_exif',$LinAdmin->option_value_system['sys_image_exif']); + $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_image_iptc'),'sys_image_iptc',$LinAdmin->option_value_system['sys_image_iptc']); + $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_image_xmp'),'sys_image_xmp',$LinAdmin->option_value_system['sys_image_xmp']);*/ break; + } ?> \ No newline at end of file Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/docs/dev/TODO.txt 2006-11-01 17:54:09 UTC (rev 4612) @@ -6,6 +6,7 @@ ## Small Todos - since the admin pages uses the template system, there is no update of the status during the import thats not very user friendly +- escape exif data ## Big Todos Modified: trunk/linpha2/get_image.php =================================================================== --- trunk/linpha2/get_image.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/get_image.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -34,9 +34,13 @@ */ try { - if(!isset( $_GET['id'] ) ) + include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); + $linpha = new linpha(); + $linpha->sql->startSession(); + + if( $linpha->template->idCurrent == 0 ) { - throw new Exception("no id supplied!"); + throw new Exception("no valid id supplied!"); } /** @@ -54,12 +58,8 @@ $overrideSettings['rotate'] = intval($_GET['rotate']); } - include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); - $linpha = new linpha(); - $linpha->sql->startSession(); - $image = new LinImage(); - if( ! $image->createImage($_GET['id'],$overrideSettings) ) // returns false if no permission + if( ! $image->createImage($linpha->template->idCurrent, $overrideSettings) ) // returns false if no permission { throw new Exception("Error while creating image!<br />Error: ".$image->error_msg); } @@ -69,6 +69,7 @@ catch(Exception $error) { echo "Error: ".$error -> getMessage(); + linLog(LOG_TYPE_IMPORT,LOG_ERR,'image',$error->getMessage()); } Modified: trunk/linpha2/get_thumb.php =================================================================== --- trunk/linpha2/get_thumb.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/get_thumb.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -32,16 +32,17 @@ */ try { - if(!isset( $_GET['id'] ) ) - { - throw new Exception("no id supplied!"); - } - include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); $linpha = new linpha(); $linpha->sql->startSession(); + + if( $linpha->template->idCurrent == 0 ) + { + throw new Exception("no valid id supplied!"); + } $thumbnail = new LinImage(); + /** * set necessary infos to display image if exists @@ -49,7 +50,7 @@ * * returns false if no permission */ - if( ! $thumbnail->createThumbnail($_GET['id']) ) + if( ! $thumbnail->createThumbnail($linpha->template->idCurrent) ) { throw new Exception("Error while creating thumbnail!<br />Error: ".$thumbnail->error_msg); } @@ -59,6 +60,7 @@ catch(Exception $error) { echo "Error: ".$error -> getMessage(); + linLog(LOG_TYPE_IMPORT,LOG_ERR,'thumbnail',$error->getMessage()); } Modified: trunk/linpha2/install/lib.install.php =================================================================== --- trunk/linpha2/install/lib.install.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/install/lib.install.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -72,40 +72,7 @@ return $str; } // end tr() -/** -* don't know where to place this part -* other.php is the only one which is also included during the installation -* any ideas? maybe we have to create a new file common_startup.php for example -* -* Note: The PATH_SEPARATOR was introduced with PHP 4.3.0-RC2. -*/ -if(!defined('PATH_SEPARATOR')) -{ - if(installGetOS()=='win') - { - define('PATH_SEPARATOR',';'); - } - else - { - define('PATH_SEPARATOR',':'); - } -} -/** - * getOS, use this name as getOS will be declard in linpha.class.php also - */ -function installGetOS() -{ - if(strtoupper(substr(PHP_OS,0,3)) == 'WIN') - { - return "win"; - } - else - { - return "unix"; - } -} - function installGetPATH($array_path) { /** Modified: trunk/linpha2/install/lib.requirements.php =================================================================== --- trunk/linpha2/install/lib.requirements.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/install/lib.requirements.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -24,7 +24,7 @@ */ function installCheckConvert() { - if(installGetOS()=='win') { + if( LIN_OS == 'win' ) { $convert = 'convert.exe'; } else { $convert = 'convert'; Modified: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/install/sql/sql.data.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -88,9 +88,18 @@ 'sys_style_others_sortorder' => 'nameasc', + 'sys_user_autologin' => '1', - 'sys_user_autologin' => '1', - + + 'plugins_log_filename' => 'var/linpha.log', + 'plugins_log_syslog_enable' => '0', + 'plugins_log_syslog_add_events' => '', + 'plugins_log_email_enable' => '0', + 'plugins_log_email_add_events' => '', + 'plugins_log_email_to' => 'LinPHA Logger<log@'.$_SERVER["HTTP_HOST"].'>', + 'plugins_log_email_headers' => 'From:LinPHA Logger<noreply@'.$_SERVER["HTTP_HOST"].'>', + 'plugins_log_email_subject' => 'Linpha Log', + 'plugins_filemanager_enable' => '0', 'plugins_filemanager_nruploads' => '5' ); Modified: trunk/linpha2/install/step2_requirements.php =================================================================== --- trunk/linpha2/install/step2_requirements.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/install/step2_requirements.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -245,7 +245,7 @@ * checking posix extension * only if we are we are on unix */ - if(installGetOS() != "win") + if( LIN_OS != "win" ) { print_line_left("Posix Extension"); if(installCheckPosix()) Modified: trunk/linpha2/lib/adodb/adodb-errorhandler.inc.php =================================================================== --- trunk/linpha2/lib/adodb/adodb-errorhandler.inc.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/lib/adodb/adodb-errorhandler.inc.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -64,16 +64,26 @@ * and optionally, port number, of the socket receiving the debug information. * 3 message is appended to the file destination */ - if (defined('ADODB_ERROR_LOG_TYPE')) { + /*if (defined('ADODB_ERROR_LOG_TYPE')) { $t = date('Y-m-d H:i:s'); if (defined('ADODB_ERROR_LOG_DEST')) error_log("($t) $s", ADODB_ERROR_LOG_TYPE, ADODB_ERROR_LOG_DEST); else error_log("($t) $s", ADODB_ERROR_LOG_TYPE); - } + }*/ + /** + * if adodb errorhandler is used, the function $db->ErrorMsg() does not work + * anymore + * -> output the error to screen + * -> no need anymore for : + * if(!$create) { echo $GLOBALS['db']->ErrorMsg().'<br />'; } + */ + echo $s.'<br />'; + + linLog(LOG_TYPE_DB,LOG_ERR,'db',$s); //print "<p>$s</p>"; - trigger_error($s,ADODB_ERROR_HANDLER_TYPE); + //trigger_error($s,ADODB_ERROR_HANDLER_TYPE); } ?> Modified: trunk/linpha2/lib/classes/archiver.config.php =================================================================== --- trunk/linpha2/lib/classes/archiver.config.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/lib/classes/archiver.config.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -43,7 +43,7 @@ * OR bzrudi AT tuxpower DOT de */ -switch(getOS()) +switch( LIN_OS ) { case 'unix': // tar @@ -188,7 +188,7 @@ /** * @todo !Freebyte Zip http://www.freebyte.com/fbzip/#cmd * @todo Ultimate Zip http://www.ultimatezip.com/download.htm -@todo Arj http://arj.sourceforge.net/ + * @todo Arj http://arj.sourceforge.net/ */ //$this->path_delimiter = ';'; Modified: trunk/linpha2/lib/classes/linpha.admin.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.admin.class.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/lib/classes/linpha.admin.class.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -76,6 +76,17 @@ 'sys_style_layout_color_albumsbg' => "Albums Background Color", 'sys_style_layout_color_links' => "Links Color", 'sys_style_layout_color_linkshover' => "Links Hover Color", + + 'plugins_log_filename' => "Log to this filename", + 'plugins_log_syslog_enable' => "Send important messages to syslog", + 'plugins_log_syslog_add_events' => "Additional log events sent to syslog", + 'plugins_log_email_enable' => "Send important messages by email", + 'plugins_log_email_add_events' => "Additional log events sent by email", + 'plugins_log_email_to' => "Recipient", + 'plugins_log_email_headers' => "Extra headers", + 'plugins_log_email_subject' => "Subject", + + 'plugins_filemanager_enable' => "Enable Filemanager For Non-Admin Users", ); } @@ -308,6 +319,8 @@ 'sys_style_thumb_showsubfoldersseparate', 'sys_style_image_useeffects', 'sys_user_autologin', + 'plugins_log_syslog_enable', + 'plugins_log_email_enable', 'plugins_filemanager_enable' ); } Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -244,7 +244,8 @@ /** - * linpha syslog window, shows up system info like "images added" + * LinPHA user logging function + * shows up system info in the browser like "images added" */ function linSysLog($str) { @@ -299,24 +300,7 @@ } } - /** - * returns the Operating System used - * used to enable/disable OS related features - */ -function getOS() -{ - if(strtoupper(substr(PHP_OS,0,3)) == 'WIN') - { - return "win"; - } - else - { - return "unix"; - } -} - -/** * returns an array with the sort orders */ function getSortOrders() @@ -376,7 +360,7 @@ */ function linEscapeString($str) { - if(getOS() == 'win') + if( LIN_OS == 'win' ) { /** * replace forward slash with backslash, need this for powerarchiver for @@ -578,6 +562,11 @@ } } +/** + * switch between Ajax and static view + * takes care if we explicit disable ajax + * even if we could use it + */ function useAjax() { if( isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax']) ) @@ -590,4 +579,219 @@ } } + +/** + * LinPHA internal logging function + * + * Types: + * LOG_TYPE_IMPORT + * LOG_TYPE_UPDATE + * LOG_TYPE_USER + * LOG_TYPE_DB + * LOG_TYPE_META + * LOG_TYPE_FILEMANAGER + * LOG_TYPE_GUESTBOOK + * + * Severity: + * LOG_EMERG 1 System ist unbrauchbar. + * LOG_ALERT 1 Aktion ist sofort erforderlich. + * LOG_CRIT 1 Kritischer Zustand. + * LOG_ERR 4 Fehler aufgetreten. + * LOG_WARNING 5 Warnung aufgetreten. + * LOG_NOTICE 6 Normale, aber wichtige, Meldung. + * LOG_INFO 6 Informative Meldung. + * LOG_DEBUG 6 Debug-Level-Meldung. + * + * Action: + * login, logout, rotate + * fm_others, fm_upload, fm_delete, fm_move, fm_copy, fm_rename, fm_create_folder, fm_perm + * + * + * @param string $type log types + * @param string $severity from notice - fatal error + * @param string $text + */ +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) + { + case LOG_TYPE_IMPORT: $type_msg = 'IMPORT'; break; + case LOG_TYPE_UPDATE: $type_msg = 'UPDATE'; break; + case LOG_TYPE_USER: $type_msg = 'USER'; break; + case LOG_TYPE_DB: $type_msg = 'DATABASE'; break; + case LOG_TYPE_META: $type_msg = 'COMMENTS'; break; + case LOG_TYPE_FILEMANAGER: $type_msg = 'FILEMANAGER'; break; + case LOG_TYPE_GUESTBOOK: $type_msg = 'GUESTBOOK'; break; + } + + /** + * Set Log Severity Output Message + */ + switch($severity) + { + case LOG_EMERG: $severity_msg = 'EMERGENCY ERROR'; break; + //case LOG_ALERT: $severity_msg = 'ALERT'; break; // same as LOG_EMERG + //case LOG_CRIT: $severity_msg = 'CRITICAL ERROR'; break; // same as LOG_EMERG + case LOG_ERR: $severity_msg = 'ERROR'; break; + case LOG_WARNING: $severity_msg = 'WARNING'; break; + case LOG_NOTICE: $severity_msg = 'NOTICE'; break; + case LOG_INFO: $severity_msg = 'INFO'; break; + //case LOG_DEBUG: $severity_msg = 'DEBUG'; break; // same as LOG_DEBUG + } + + /** + * Setup Log Time Output Message & Remote IP + */ + $time = linStrftime(time()); + $ip = $_SERVER["REMOTE_ADDR"]; + if( !isset($_SESSION['user_name'])) { + $user = 'anonymous'; + } else { + $user = $_SESSION['user_name']; + } + + /** + * don't trust $text (contains $_GET and $_POST data) + * see also linpha advisory http://secunia.com/advisories/18808/ + * and for more details http://retrogod.altervista.org/linpha_10_local.html + */ + $text = htmlspecialchars($text, ENT_QUOTES); + + /** + * Process Log + */ + if( !isset($GLOBALS['linpha']->sql->config->value) ) // database not connected! + { + error_log("$time | $severity_msg | $type_msg | $ip | $user | $text".LIN_NL, 3, LINPHA_DIR.'/var/db_error.log' ); + } + else + { + /** + * filename + */ + error_log("$time | $severity_msg | $type_msg | $ip | $user | $text".LIN_NL, 3, $GLOBALS['linpha']->sql->config->value['plugins_log_filename'] ); + + /** + * email + */ + if( $GLOBALS['linpha']->sql->config->value['plugins_log_email_enable'] ) + { + if( $severity <= LOG_WARNING OR + strpos($GLOBALS['linpha']->sql->config->value['plugins_log_email_add_events'], $event) !== false ) + { + mail( + $GLOBALS['linpha']->sql->config->value['plugins_log_email_to'], + $GLOBALS['linpha']->sql->config->value['plugins_log_email_subject'], + "$time | $severity_msg | $type_msg | $ip | $ip | $user | $text", + $GLOBALS['linpha']->sql->config->value['plugins_log_email_headers'] + ); + } + } + + /** + * syslog + */ + if( $GLOBALS['linpha']->sql->config->value['plugins_log_syslog_enable'] && + $severity <= LOG_WARNING ) + { + /** + * In Windows NT, use the following values of priority: + * 1 = error, + * 2-5 = warning + * 6 = info + */ + + if( LIN_OS == 'win' ) + { + if( $severity <= LOG_ERR ) + { + $severity = 1; + } + } + + syslog($severity, "LinPHA $severity_msg | $type_msg | $ip | $user | $text"); + } + } +} + +/** + * format user inputs and autoformat urls and mailaddresses + */ +function htmltag($post) +{ + $post = htmlspecialchars($post, ENT_QUOTES); + + //###### URL + // the next two parts converts http://linpha.sf.net to [url]http://linpha.sf.net[/url] + // and www.sourceforge.net to [url]http://www.sourceforge.net[/url] + // im the third part converts [url]http://linpha.sf.net[/url] to <a href="http://linpha.sf.net">http://linpha.sf.net</a> + + // 1. part + // detect url if it is after one of the following signs: ' ', '\r' or '\n' + $post=eregi_replace("([ \r\n])http://([^ ,\r\n]*)","\\1[url]http://\\2[/url]",$post); + $post=eregi_replace("([ \r\n])https://([^ ,\r\n]*)","\\1[url]https://\\2[/url]",$post); + $post=eregi_replace("([ \r\n])ftp://([^ ,\r\n]*)","\\1[url]ftp://\\2[/url]",$post); + $post=eregi_replace("([ \r\n])www\\.([^ ,\r\n]*)","\\1[url]http://www.\\2[/url]",$post); + + // 2. part + // detect url if the url is in the beginning of the string + $post=eregi_replace("^http://([^ ,\r\n]*)","[url]http://\\1[/url]",$post); + $post=eregi_replace("^https://([^ ,\r\n]*)","[url]https://\\1[/url]",$post); + $post=eregi_replace("^ftp://([^ ,\r\n]*)","[url]ftp://\\1[/url]",$post); + $post=eregi_replace("^www\\.([^ ,\r\n]*)","[url]http://www.\\1[/url]",$post); + + // 3. part + $post=preg_replace("/\[url\](.*)\[\/url\]/iUms","<a href=\"\\1\" target=_blank>\\1</a>",$post); + $post=preg_replace("/\[url=(.*)\](.*)\[\/url\]/iUms","<a href=\"\\1\" target=_blank>\\2</a>",$post); + //##### + + + // e-mail + $post= eregi_replace('([_a-z0-9-]+(\.[_a-z0-9-]+)*@[_a-z0-9-]+(\.[_a-z]+)+)','<a href="mailto:\\1">\\1</a>',$post); + + // formatting + $post = str_replace("[hr]","<hr>",$post); + $post=preg_replace("/\[b\](.*)\[\/b\]/iUms","<b>\\1</b>",$post); + $post=preg_replace("/\[i\](.*)\[\/i\]/iUms","<i>\\1</i>",$post); + $post=preg_replace("/\[s\](.*)\[\/s\]/iUms","<strike>\\1</strike>",$post); + $post=preg_replace("/\[u\](.*)\[\/u\]/iUms","<u>\\1</u>",$post); + $post=preg_replace("/\[h1\](.*)\[\/h1\]/iUms","<h1>\\1</h1>",$post); + $post=preg_replace("/\[h2\](.*)\[\/h2\]/iUms","<h2>\\1</h2>",$post); + $post=preg_replace("/\[h3\](.*)\[\/h3\]/iUms","<h3>\\1</h3>",$post); + $post=preg_replace("/\[h4\](.*)\[\/h4\]/iUms","<h4>\\1</h4>",$post); + $post=preg_replace("/\[h5\](.*)\[\/h5\]/iUms","<h5>\\1</h5>",$post); + + + //code + $post=preg_replace("/\[code\](.*)\[\/code\]/msiU", "<blockquote><pre><smallfont><hr>\\1<hr></smallfont></pre></blockquote>", $post); + + // image + $post=preg_replace("/\[img\](.*)\[\/img\]/iUms","<img src=\"\\1\" border=\"0\">",$post); + + // center + $post=preg_replace("/\[center\](.*)\[\/center\]/iUms","<center>\\1</center>",$post); + + // colors + $post=preg_replace("/\[green\](.*)\[\/green\]/iUms","<span style=\"color:green\">\\1</span>",$post); + $post=preg_replace("/\[yellow\](.*)\[\/yellow\]/iUms","<span style=\"color:yellow\">\\1</span>",$post); + $post=preg_replace("/\[red\](.*)\[\/red\]/iUms","<span style=\"color:red\">\\1</span>",$post); + $post=preg_replace("/\[blue\](.*)\[\/blue\]/iUms","<span style=\"color:blue\">\\1</span>",$post); + $post=preg_replace("/\[white\](.*)\[\/white\]/iUms","<span style=\"color:white\">\\1</span>",$post); + $post=preg_replace("/\[black\](.*)\[\/black\]/iUms","<span style=\"color:black\">\\1</span>",$post); + + $post=preg_replace("/\[color=(.*)\](.*)\[\/color\]/iUms","<span style=\"color:\\1\">\\2</span>",$post); + + // <br /> + $post= nl2br($post); + + return $post; +} + ?> \ No newline at end of file Modified: trunk/linpha2/lib/classes/linpha.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.image.class.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/lib/classes/linpha.image.class.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -304,6 +304,8 @@ return false; } + linLog(LOG_TYPE_IMPORT,LOG_INFO,'thumbnail',"Creating thumbnail ".$this->photo_id); + /** * image thumbnail */ @@ -331,6 +333,7 @@ if( ! file_exists( $this->output_file ) ) { + $this->error_msg = "Output File Doesnt Exists"; return false; } } @@ -411,6 +414,8 @@ if( ! $this->isCached OR $this->force ) { + linLog(LOG_TYPE_IMPORT,LOG_INFO,'image',"Creating image ".$this->photo_id); + /** * include the create image script */ @@ -422,6 +427,7 @@ if( ! file_exists( $this->output_file ) ) { + $this->error_msg = "Output File Doesnt Exists"; return false; } @@ -603,19 +609,25 @@ * @param imageressource $src_img pointer to the source image * @param int $angle angle to rotate * @author flo - * @todo maybe we should use linpha_log if imagerotate() doesn't exists */ function imageRotateGd(& $src_img, $angle) { - if(function_exists('imagerotate') && $angle != "0") + if(function_exists('imagerotate')) { - /** - * flip $angle, because with this function, left means right, and right means left :-) - */ - $angle = 360 - $angle; - $angle = $angle % 360; - $src_img = imagerotate($src_img,$angle,0); + if($angle != "0") + { + /** + * flip $angle, because with this function, left means right, and right means left :-) + */ + $angle = 360 - $angle; + $angle = $angle % 360; + $src_img = imagerotate($src_img,$angle,0); + } } + else + { + linLog(LOG_TYPE_META,LOG_WARNING,'rotate',"Cannot rotate image becuase the function imagerotate() doesnt exists, consider upgrading your php version"); + } } } // end class linImage Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -36,7 +36,7 @@ public $photos; public $photos_filtered; public $use_javascript; -public $id_current, $id_parent, $img_type, $filename, $md5sum, $org_width, $org_height; +public $id_parent, $img_type, $filename, $md5sum, $org_width, $org_height; private $nr_pages, $current_page; // only used if javascript disabled private $newCommentAdded = false; // used for ajax @@ -49,7 +49,7 @@ /** - * set current view and set fileinfos of $_GET['id'] + * set current view and set fileinfos of $GLOBALS['linpha']->template->idCurrent ($_GET['id']) * @param string $modulname (album, browse, search, ...) */ function setCurrentView($modulename) @@ -58,13 +58,33 @@ $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_others_sortorder']); - if(isset($_GET['id']) && $_GET['id'] != 0) + if( $GLOBALS['linpha']->template->idCurrent == 0 ) { /** + * on top view, reset current view + */ + if($this->modulename=='albums') + { + $this->mode = 'home'; + $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_home_firstsortorder']); + } + else // $this->modulename=='browse' | 'search' , others will come.. + { + $this->mode = 'thumb'; + + if( ! isset($_SESSION['mode_thumbview']) ) + { + $_SESSION['mode_thumbview'] = 'thumb'; + } + } + } + else + { + /** * set file informations */ $current_data = $GLOBALS['linpha']->db->GetRow("SELECT id, name, img_type, parent_id, md5sum, width, height FROM ".PREFIX."photos " . - "WHERE id = '".linSql::linAddslashes($_GET['id'])."'"); + "WHERE id = '".linSql::linAddslashes($GLOBALS['linpha']->template->idCurrent)."'"); /** * check for valid id @@ -77,7 +97,6 @@ $this->md5sum = $current_data['md5sum']; $this->org_width = $current_data['width']; $this->org_height = $current_data['height']; - $this->id_current = $current_data['id']; /** * switch between thumb_view and img_view @@ -106,32 +125,10 @@ else // no valid id supplied { $this->mode = 'home'; - $this->id_current = 0; + $GLOBALS['linpha']->template->idCurrent = 0; } } - else // ( ! isset($_GET['id'] OR $_GET['id']==0) ) - { - $this->id_current = 0; - - /** - * on top view, reset current view - */ - if($this->modulename=='albums') - { - $this->mode = 'home'; - $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_home_firstsortorder']); - } - else // $this->modulename=='browse' | 'search' , others will come.. - { - $this->mode = 'thumb'; - if( ! isset($_SESSION['mode_thumbview']) ) - { - $_SESSION['mode_thumbview'] = 'thumb'; - } - } - } - if($this->mode == 'thumb' && isset($_GET['view'])) { $_SESSION['mode_thumbview'] = $_GET['view']; @@ -146,7 +143,7 @@ */ if( ! isset( $this->id_parent) ) { - $this->id_parent = $this->id_current; + $this->id_parent = $GLOBALS['linpha']->template->idCurrent; } } @@ -262,24 +259,36 @@ function setMenu() { /** + * Menu My Settings + */ + if($GLOBALS['linpha']->sql->isLoggedIn()) + { + if( $GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable'] OR $GLOBALS['linpha']->sql->isAdmin()) + { + $GLOBALS['linpha']->template->output['menu_My Settings']['filemanager'] = + array('name' => i18n("Filemanager"), 'value' => LINPHA_DIR.'/?cat=filemanager'); + } + } + + /** * Menu Admin */ if($GLOBALS['linpha']->sql->isAdmin()) { $GLOBALS['linpha']->template->output['menu_Admin']['import'] = - Array( + array( 'name' => i18n("Import"), - 'value' => Array( - Array('name' => i18n("Start Import Of This Folder/File"), 'value' => LINPHA_DIR.'/admin/?cat=import&album_select[]='.$this->id_parent), - Array('name' => i18n("Detect File Changes"), 'value' => $GLOBALS['linpha']->template->URL_full.'&force_update') + 'value' => array( + array('name' => i18n("Start Import Of This Folder/File"), 'value' => LINPHA_DIR.'/admin/?cat=import&album_select[]='.$this->id_parent), + array('name' => i18n("Detect File Changes"), 'value' => $GLOBALS['linpha']->template->URL_full.'&force_update') ) ); $GLOBALS['linpha']->template->output['menu_Admin']['permissions'] = - Array( + array( 'name' => i18n("Permissions"), - 'value' => Array( - Array('name' => i18n("Set Permissions"), 'value' => LINPHA_DIR.'/admin/?cat=permissions_view&cmd=edit&id='.$this->id_current) + 'value' => array( + array('name' => i18n("Set Permissions"), 'value' => LINPHA_DIR.'/admin/?cat=permissions_view&cmd=edit&id='.$GLOBALS['linpha']->template->idCurrent) ) ); @@ -289,7 +298,7 @@ /** * append to "admin - import" entry */ - $GLOBALS['linpha']->template->output['menu_Admin']['import']['value'][] = Array( + $GLOBALS['linpha']->template->output['menu_Admin']['import']['value'][] = array( 'name' => i18n("Recreate This Thumbnail"), 'value' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=recreate' ); @@ -307,7 +316,7 @@ $array = getSortOrders(); foreach($array AS $value) { - $array_sort_orders_links[] = Array('name' => i18n($value), 'value' => $GLOBALS['linpha']->template->URL_full.'&order_by='.$value); + $array_sort_orders_links[] = array('name' => i18n($value), 'value' => $GLOBALS['linpha']->template->URL_full.'&order_by='.$value); } $open_basket_link = LINPHA_DIR.'/?cat=basket'; @@ -317,12 +326,12 @@ case 'thumb': $GLOBALS['linpha']->template->output['menu_More']['basket'] = - Array( + array( 'name' => i18n("Basket"), - 'value' => Array( - Array('name' => i18n("Add All To Basket"), 'value' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_all'), - Array('name' => i18n("Switch To Basket View"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=basket'), - Array('name' => i18n("Open Basket").' ('.count($_SESSION['basket_ids']).' '.i18n("Images").')', 'value' => $open_basket_link) + 'value' => array( + array('name' => i18n("Add All To Basket"), 'value' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_all'), + array('name' => i18n("Switch To Basket View"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=basket'), + array('name' => i18n("Open Basket").' ('.count($_SESSION['basket_ids']).' '.i18n("Images").')', 'value' => $open_basket_link) ) ); @@ -331,36 +340,36 @@ $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectsizes']); foreach($array AS $value) { - $array_tn_sizes_links[] = Array('name' => $value.' '.i18n("Pixel"), 'value' => 'javascript:set_tn_size('.$value.')'); + $array_tn_sizes_links[] = array('name' => $value.' '.i18n("Pixel"), 'value' => 'javascript:set_tn_size('.$value.')'); } $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectnrimages']); foreach($array AS $value) { - $array_nr_links[] = Array('name' => $value, 'value' =>"javascript:set_nr_images('".$value."')"); + $array_nr_links[] = array('name' => $value, 'value' =>"javascript:set_nr_images('".$value."')"); } - $array_views_links[] = Array('name' => i18n("Normal"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=thumb'); - $array_views_links[] = Array('name' => i18n("Detail"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=thumbdetail'); + $array_views_links[] = array('name' => i18n("Normal"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=thumb'); + $array_views_links[] = array('name' => i18n("Detail"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=thumbdetail'); $GLOBALS['linpha']->template->output['menu_More']['view'] = - Array( + array( 'name' => i18n("View"), - 'value' => Array( - Array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), - Array('name' => i18n("View"), 'value' => $array_views_links), - Array('name' => i18n("Thumb Size"), 'value' => $array_tn_sizes_links), - Array('name' => i18n("Thumb Nr"), 'value' => $array_nr_links) + 'value' => array( + array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), + array('name' => i18n("View"), 'value' => $array_views_links), + array('name' => i18n("Thumb Size"), 'value' => $array_tn_sizes_links), + array('name' => i18n("Thumb Nr"), 'value' => $array_nr_links) ) ); } else { $GLOBALS['linpha']->template->output['menu_More']['view'] = - Array( + array( 'name' => i18n("View"), - 'value' => Array( - Array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), + 'value' => array( + array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), ) ); } @@ -375,11 +384,11 @@ if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { $GLOBALS['linpha']->template->output['menu_More']['metainfo'] = - Array( + array( 'name' => i18n("Metainfo"), - 'value' => Array( - Array('name' => i18n("Edit Album Comment"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=albcomment'), - Array('name' => i18n("Edit Album Information"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=meta') + 'value' => array( + array('name' => i18n("Edit Album Comment"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=albcomment'), + array('name' => i18n("Edit Album Information"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=meta') ) ); } @@ -401,15 +410,15 @@ array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), array('name' => i18n("View at"), 'value' => array( - array('name' => '640x480', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=640&height=480', 'target' => '_blank'), - array('name' => '800x600', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=800&height=600', 'target' => '_blank'), - array('name' => '1024x768', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=1024&height=768', 'target' => '_blank'), - array('name' => '1280x800', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=1280&height=800', 'target' => '_blank'), - array('name' => '1280x960', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=1280&height=960', 'target' => '_blank'), - array('name' => '1280x1024', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=1280&height=1024', 'target' => '_blank'), - array('name' => '1600x1200', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=1600&height=1200', 'target' => '_blank'), - array('name' => '1920x1200', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width=1920&height=1200', 'target' => '_blank'), - array('name' => $this->org_width.'x'.$this->org_height.' '.i18n("Fullscreen").')', 'value' => LINPHA_DIR.'/get_image.php?id='.$this->id_current.'&width='.$this->org_width.'&height='.$this->org_height, 'target' => '_blank'), + array('name' => '640x480', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=640&height=480', 'target' => '_blank'), + array('name' => '800x600', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=800&height=600', 'target' => '_blank'), + array('name' => '1024x768', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1024&height=768', 'target' => '_blank'), + array('name' => '1280x800', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=800', 'target' => '_blank'), + array('name' => '1280x960', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=960', 'target' => '_blank'), + array('name' => '1280x1024', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=1024', 'target' => '_blank'), + array('name' => '1600x1200', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1600&height=1200', 'target' => '_blank'), + array('name' => '1920x1200', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1920&height=1200', 'target' => '_blank'), + array('name' => $this->org_width.'x'.$this->org_height.' '.i18n("Fullscreen").')', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width='.$this->org_width.'&height='.$this->org_height, 'target' => '_blank'), ) ) ) @@ -436,10 +445,10 @@ if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { $GLOBALS['linpha']->template->output['menu_More']['metainfo'] = - Array( + array( 'name' => i18n("Metainfo"), - 'value' => Array( - Array('name' => i18n("Edit Image Information"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=meta') + 'value' => array( + array('name' => i18n("Edit Image Information"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=meta') ) ); } @@ -492,7 +501,7 @@ */ if( $GLOBALS['linpha']->sql->checkPermission('download')) { - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.LINPHA_DIR.'/download_file.php?id='.$this->id_current.'">'. + $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").'" />' .'</a>'."\n"; } @@ -534,7 +543,7 @@ { $thumbnail = new LinImage(); $_GET['force'] = true; - $thumbnail->createThumbnail($this->id_current); + $thumbnail->createThumbnail($GLOBALS['linpha']->template->idCurrent); } break; case 'rotate_left': @@ -568,7 +577,7 @@ /** * coming from imgview, mode=viewImg */ - $_SESSION['basket_ids'][] = $this->id_current; + $_SESSION['basket_ids'][] = $GLOBALS['linpha']->template->idCurrent; if($_GET['admin_cmd'] == 'basket_add_this_with_checkout') { @@ -946,7 +955,7 @@ */ function viewHomeSetImages($key,$optionname,$sql) { - $GLOBALS['linpha']->template->output[$key] = Array(); + $GLOBALS['linpha']->template->output[$key] = array(); if($GLOBALS['linpha']->sql->config->value[$optionname] != 0) { @@ -978,7 +987,7 @@ if(file_exists($path) && LinSql::photoIsAllowed($data['0'])) { - $GLOBALS['linpha']->template->output[$key][] = Array('id'=>$data['0'],'path'=>$path); + $GLOBALS['linpha']->template->output[$key][] = array('id'=>$data['0'],'path'=>$path); $i++; } } @@ -1024,12 +1033,12 @@ */ $query = $GLOBALS['linpha']->db->Execute("SELECT id " . "FROM ".PREFIX."meta_comments " . - "WHERE md5sum = '".$GLOBALS['linpha']->imgview->id_current."'"); + "WHERE md5sum = '".$GLOBALS['linpha']->template->idCurrent."'"); if( $query->EOF ) { $GLOBALS['linpha']->db->Execute("INSERT into ".PREFIX."meta_comments (meta_time, md5sum, meta_author, meta_comment)" . - "VALUES ('".time()."','".$GLOBALS['linpha']->imgview->id_current."','".linSql::linAddslashes($_POST['author'])."'," . + "VALUES ('".time()."','".$GLOBALS['linpha']->template->idCurrent."','".linSql::linAddslashes($_POST['author'])."'," . "'".linSql::linAddslashes($_POST['comment'])."')"); } else // update @@ -1038,7 +1047,7 @@ "meta_time = '".time()."', ". "meta_author = '".linSql::linAddslashes($_POST['author'])."', " . "meta_comment = '".linSql::linAddslashes($_POST['comment'])."' " . - "WHERE md5sum = '".$GLOBALS['linpha']->imgview->id_current."'"); + "WHERE md5sum = '".$GLOBALS['linpha']->template->idCurrent."'"); } } @@ -1105,7 +1114,7 @@ echo '<?xml version="1.0" ?>'."\n"; ?> <root> -<imgid><?php echo $this->id_current; ?></imgid> +<imgid><?php echo $GLOBALS['linpha']->template->idCurrent; ?></imgid> <imgwidth><?php echo $this->org_width; ?></imgwidth> <imgheight><?php echo $this->org_height; ?></imgheight> <imgnr><?php printf(i18n("Image %s of %s"),$this->current_key+1,count($this->photos_filtered)); ?></imgnr> @@ -1158,7 +1167,7 @@ */ function viewImgCommon() { - $this->src_file = LinSql::getFullImagePath( $this->id_current ); + $this->src_file = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); $this->max_width = $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; $this->max_height = $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; @@ -1174,7 +1183,7 @@ $GLOBALS['linpha']->template->output['image_infos'] = MetaData::readInformations( $this->full_filename, $this->filename, $this->md5sum, $this->org_width, $this->org_height, $flag_nr=10 ); if(isset($_GET['force_update'])) { - LinImport::updateEntry( $this->id_current , dirname($this->full_filename) , $this->filename ); + LinImport::updateEntry( $GLOBALS['linpha']->template->idCurrent , dirname($this->full_filename) , $this->filename ); } } @@ -1224,7 +1233,7 @@ */ function viewImgStoreImageInformation() { - $this->full_filename = LinSql::getFullImagePath( $this->id_current ); + $this->full_filename = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); /** * set image informations @@ -1301,7 +1310,7 @@ */ foreach($this->photos_filtered AS $key=>$value) { - if($value['id'] == $this->id_current) + if($value['id'] == $GLOBALS['linpha']->template->idCurrent) { $this->current_key = $key; break; Modified: trunk/linpha2/lib/classes/linpha.import.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.import.class.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/lib/classes/linpha.import.class.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -152,6 +152,7 @@ catch(Exception $error) { linSysLog(i18n("Error during import files/folders").": ".$error -> getMessage()); + linLog(LOG_TYPE_IMPORT,LOG_ERR,'import_others',"Error during import files/folders: ".$error -> getMessage()); } } @@ -165,7 +166,8 @@ */ function addNewEntry( $parent_id , $dirname , $filename , $recursive ) { - linSysLog(i18n("New").': '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); + linSysLog(i18n("Import").': '.i18n("New").': '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); + linLog(LOG_TYPE_IMPORT,LOG_NOTICE,'import_new',"New: ".$dirname.'/'.$filename); list($md5sum,$file_type,$org_width,$org_height,$stats_number,$time_exif,$rotate) = @@ -235,7 +237,9 @@ LinImport::deleteEntry( $data['id'], $full_filename.'/'.$data['name']); } - linSysLog(i18n("Delete Entry").': '.htmlspecialchars($full_filename,ENT_QUOTES)); + linSysLog(i18n("Import").': '.i18n("Delete").': '.htmlspecialchars($full_filename,ENT_QUOTES)); + linLog(LOG_TYPE_IMPORT,LOG_NOTICE,'import_delete',"Delete: ".$full_filename); + /** * delete thumbnail and image in cache folder @@ -290,7 +294,9 @@ */ if($file_type != $data[0]) { - linSysLog(i18n("Detected a change of file_type in:")." ".htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); + linSysLog(i18n("Import").': '.i18n("Detected a change of file type, update entry of:").' '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); + linLog(LOG_TYPE_IMPORT,LOG_NOTICE,'import_update',"Detected a change of file type, update entry of: ".$dirname.'/'.$filename); + $GLOBALS['linpha']->db->Execute("UPDATE ".PREFIX."photos " . "SET img_type = '".$file_type."', width = '".$org_width."', height = '".$org_height."', time_exif = '".$time_exif."', stats_numbers = '".$stats_number."' " . "WHERE id = '".$id."'"); @@ -310,8 +316,9 @@ */ if($md5sum != $data[1]) { - linSysLog(sprintf(i18n("File %s changed, updating data..."),htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES))); - + linSysLog(i18n("Import").': '.i18n("Detected a change of file data, update entry of:").' '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); + linLog(LOG_TYPE_IMPORT,LOG_NOTICE,'import_update',"Detected a change of file data, update entry of: ".$dirname.'/'.$filename); + $GLOBALS['linpha']->db->Execute("UPDATE ".PREFIX."photos " . "SET md5sum = '".$md5sum."', width = '".$org_width."', height = '".$org_height."', time_mod = '".filemtime($dirname.'/'.$filename)."', time_exif = '".$time_exif."', rotate = '".$rotate."' WHERE id = '".$id."'"); @@ -381,22 +388,26 @@ $ext = LinFilesys::getFileExtFromPath($filename); if($filename{0} == '.') { - linSysLog(htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is Hidden")); + linSysLog(i18n("Import").': '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is Hidden")); + linLog(LOG_TYPE_IMPORT,LOG_NOTICE,'import_fileinfo',$dirname.'/'.$filename." Is Hidden"); $file_type = 9999999; } elseif( in_array( $filename, LinImport::getIgnoreFilelist() ) ) { - linSysLog(htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is In The Ignore List")); + linSysLog(i18n("Import").': '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is In The Ignore List")); + linLog(LOG_TYPE_IMPORT,LOG_NOTICE,'import_fileinfo',$dirname.'/'.$filename." Is In The Ignore List"); $file_type = 9999999; } elseif( in_array($ext, LinImport::getIgnoreFileext() ) ) { - linSysLog(htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is In The Ignore List")); + linSysLog(i18n("Import").': '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is In The Ignore List Of File Types")); + linLog(LOG_TYPE_IMPORT,LOG_NOTICE,'import_fileinfo',$dirname.'/'.$filename." Is In The Ignore List Of File Types"); $file_type = 9999999; } elseif( !is_readable( $dirname.'/'.$filename) ) { - linSysLog(htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is Not Readable")); + linSysLog(i18n("Import").': '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)." ".i18n("Is Not Readable")); + linLog(LOG_TYPE_IMPORT,LOG_NOTICE,'import_fileinfo',$dirname.'/'.$filename." Is Not Readable"); $file_type = 9999999; } /** @@ -465,7 +476,8 @@ } else { - linSysLog('Error: what am i? '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); + linSysLog(i18n("Import").': Error: what am i? '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); + linLog(LOG_TYPE_IMPORT,LOG_NOTICE,'import_fileinfo','Error: what am i? '.htmlspecialchars($dirname.'/'.$filename,ENT_QUOTES)); } return array($md5sum,$file_type,$org_width,$org_height,$stats_number,$time_exif,$rotate); Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -125,7 +125,7 @@ $value = htmlspecialchars($meta_data['meta_data'],ENT_QUOTES); } } - case 'id': + case 'id': // own fields $meta_data = $GLOBALS['linpha']->db->GetRow("SELECT meta_data " . "FROM ".PREFIX."meta_data " . "WHERE field_id = '".$data['id']."' " . Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-10-31 23:05:16 UTC (rev 4611) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-01 17:54:09 UTC (rev 4612) @@ -67,7 +67,14 @@ } else { - die("Error: cannot get config file 'config.sql.php'"); + linLog(LOG_TYPE_DB,LOG_EMERG,'db_connect',"Cannot connect to the database !!! Cannot get config file ./var/config.sql.php"); + + echo "Cannot connect to the database, please contact admin!!!<br />"; + echo "Cannot get config file './var/config.sql.php'<br />"; + + include(LINPHA_DIR."/include/db_connect_error.html"); + + exit(1); } } @@ -144,6 +151,15 @@ } else { + if( isset($GLOBALS['linpha']->db) ) + { + linLog(LOG_TYPE_DB,LOG_EMERG,'db_connect',"Cannot connect to database: ".$GLOBALS['linpha']->db->ErrorMsg()); + } + else + { + linLog(LOG_TYPE_DB,LOG_EMERG,'db_connect',"Cannot connect to database!"); + } + include(LINPHA_DIR."/include/db_connect_error.html"); } exit(1); @@ -152,7 +168,7 @@ /** * register sub class linSqlConfig - * (not during install, because we wont have any config table yet) + * (not during install, because we dont have any config table yet) */ if( ! isset($_SESSION['installmode2']) ) { @@ -185,7 +201,13 @@ * syslog after loggin in */ $GLOBALS['linpha']->template = new linTemplate(); - + + if(!isset($_GET['id'])) { + $GLOBALS['linpha']->template->idCurrent = 0; + } else { + $GLOBALS['linpha']->template->idCurrent = intval($_GET['id']); + } + session_name('linpha2'); session_start(); @@ -202,7 +224,7 @@ "AND password = '".LinSql::linAddslashes($_COOKIE['linpha_password'])."'"); if($data = $query->FetchRow()) { - //linpha_log('login','notice','User '.$_POST['user_name'].": successfully logged in."); + linLog(LOG_TYPE_USER,LOG_NOTICE,'login','User '.$_P... [truncated message content] |
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. |
From: <fan...@us...> - 2006-11-02 22:36:24
|
Revision: 4618 http://svn.sourceforge.net/linpha/?rev=4618&view=rev Author: fangehrn Date: 2006-11-02 14:35:50 -0800 (Thu, 02 Nov 2006) Log Message: ----------- * implemented back/forward/reload browser functions in ajax mode thanks to http://www.galileocomputing.de/openbook/javascript_ajax/ Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.template.class.php trunk/linpha2/lib/js/LinGlobal.js trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/modules/module.filemanager.php trunk/linpha2/templates/default/themes/vertical-nav/css/view_img.css Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-11-02 20:27:40 UTC (rev 4617) +++ trunk/linpha2/ChangeLog 2006-11-02 22:35:50 UTC (rev 4618) @@ -7,6 +7,8 @@ if making only a few changes * added a "vertical align of thumbs" theme for the poor guys without a widescreen tft :-P + * implemented back/forward/reload browser functions in ajax mode + thanks to http://www.galileocomputing.de/openbook/javascript_ajax/ 2006-11-01 flo * implemented linpha_log() Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-02 20:27:40 UTC (rev 4617) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-02 22:35:50 UTC (rev 4618) @@ -1108,8 +1108,6 @@ */ function viewImgXml() { - - header('Content-type: text/xml'); echo '<?xml version="1.0" ?>'."\n"; ?> Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-02 20:27:40 UTC (rev 4617) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-02 22:35:50 UTC (rev 4618) @@ -126,7 +126,7 @@ <script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_DIR; ?>/lib/js/LinGlobal.js"></script> <script type="text/javascript" language="JavaScript"> var LINPHA_DIR = '<?php echo LINPHA_DIR; ?>'; -var IdCurrent = <?php echo $this->idCurrent; ?>; +var startIdCurrent = <?php echo $this->idCurrent; ?>; <?php if(! isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax'])) { Modified: trunk/linpha2/lib/js/LinGlobal.js =================================================================== --- trunk/linpha2/lib/js/LinGlobal.js 2006-11-02 20:27:40 UTC (rev 4617) +++ trunk/linpha2/lib/js/LinGlobal.js 2006-11-02 22:35:50 UTC (rev 4618) @@ -128,3 +128,13 @@ $('main').style.height = newHeight; } + +function fOnError(txt_message, url, line) { + var txt = "Error occured...\n\n"; + txt += "Message: " + txt_message + "\n"; + txt += "URL: " + url + "\n"; + txt += "Line: " + line; + alert(txt); +} +window.onerror = fOnError; + Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-11-02 20:27:40 UTC (rev 4617) +++ trunk/linpha2/lib/js/LinImage.js 2006-11-02 22:35:50 UTC (rev 4618) @@ -3,6 +3,7 @@ alert('Error ' + t.status + ' -- ' + t.statusText); } +var IdCurrent; var nextThumbs = new Array(); var prevThumbs = new Array(); @@ -19,6 +20,8 @@ var preloadImageFinished = new Array(); // set to true after preload completed var preloadXmlFinished = new Array(); +var curLocationHash; + var borderSize = 0; var resizeDuration = 0.5; @@ -38,8 +41,11 @@ { IdCurrent = imgId; menuNeedsUpdating = true; // IdCurrent changed, update menu on next hover of the menu + location.hash = 'idCurrent='+IdCurrent; } + curLocationHash = location.hash; // update current Hash, this value is periodically checked to reload the image if neccessary + if(preloadXmlFinished[imgId] && typeof xmlDoc[imgId] != "undefined" ) // use typeof to work in IE { this.changeImage(); @@ -781,9 +787,50 @@ $('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 myLinImage = new LinImage(); + + /** + * doing something very important! + * rebuild the browsers histroy back, forware and reload functions + * if we have a #idCurrent=xyz in the url use this as the id + */ + if( document.location.hash.indexOf('idCurrent') != -1 ) + { + IdCurrent = document.location.hash.substr(11); + } + else + { + IdCurrent = startIdCurrent; + } + + /** + * and again something important + * rebuild the browsers histroy back, forware and reload functions + * periodically check if the url has changed + * if so, load the new id + */ + curLocationHash = location.hash; + window.setInterval(function() + { + if (curLocationHash != location.hash) + { + if( document.location.hash.substr(11) != '' ) + { + IdCurrent = document.location.hash.substr(11); + + } + else // location.hash contains no '#idCurrent', we're back on start + { + IdCurrent = startIdCurrent; + } + + myLinImage.loadImage(IdCurrent); + } + }, 500); + + // automatically start slideshow if requested (coming from thumbview) - if( document.location.toString().indexOf('slideshow') != -1 ) + if( document.location.search.indexOf('slideshow') != -1 ) { myLinImage.fullscreenStart(); } Modified: trunk/linpha2/lib/modules/module.filemanager.php =================================================================== --- trunk/linpha2/lib/modules/module.filemanager.php 2006-11-02 20:27:40 UTC (rev 4617) +++ trunk/linpha2/lib/modules/module.filemanager.php 2006-11-02 22:35:50 UTC (rev 4618) @@ -289,7 +289,7 @@ { throw new Exception(i18n("Rename File/Folder Failed!"). htmlspecialchars($full_filename,ENT_QUOTES).' '.i18n("to").' '.htmlspecialchars($parent_dirname.'/'.$new_name,ENT_QUOTES). - LIN_LF.i18n($str_checkpermissions) + LIN_NL.i18n($str_checkpermissions) ); } @@ -335,7 +335,7 @@ i18n("Cannot Copy/Move to Folder \"%s\" because its not writable!"), htmlspecialchars($full_destparentname,ENT_QUOTES) ). - LIN_LF. + LIN_NL. i18n($str_checkpermissions) ); } @@ -473,6 +473,11 @@ $data = $linpha->db->GetRow("SELECT parent_id FROM ".PREFIX."photos " . "WHERE id = '".LinSql::linAddslashes($value)."'"); + if( !isset($data['parent_id']) ) + { + throw new Exception(i18n("This file doesn't exists anymore!").' file id: '.$value); + } + /** * check write permission of parent folder */ @@ -684,7 +689,7 @@ } // end try() catch(Exception $error) { - linSysLog("Error: ".str_replace(LIN_LF,"<br />",$error -> getMessage())); + linSysLog("Error: ".str_replace(LIN_NL,"<br />",$error -> getMessage())); linLog(LOG_TYPE_FILEMANAGER,LOG_ERR,'fm_'.$_REQUEST['file_action'],$error->getMessage()); } Modified: trunk/linpha2/templates/default/themes/vertical-nav/css/view_img.css =================================================================== --- trunk/linpha2/templates/default/themes/vertical-nav/css/view_img.css 2006-11-02 20:27:40 UTC (rev 4617) +++ trunk/linpha2/templates/default/themes/vertical-nav/css/view_img.css 2006-11-02 22:35:50 UTC (rev 4618) @@ -9,7 +9,7 @@ position: relative; height: auto; - min-height: 640px; + min-height: 650px; width: 120px; } @@ -57,7 +57,7 @@ margin-left: 130px; } #main { - min-height: 640px; + min-height: 650px; } #divright { clear: left; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2006-11-03 18:59:40
|
Revision: 4620 http://svn.sourceforge.net/linpha/?rev=4620&view=rev Author: fangehrn Date: 2006-11-03 10:58:34 -0800 (Fri, 03 Nov 2006) Log Message: ----------- 2006-11-03 flo * startet making linpha includable by other web pages - introduced new constants: - LINPHA_DIR only in PHP context, include() etc. - LINPHA_LINK on the client side: clickable links - LINPHA_CLIENT on the client side: access ressources in the linpha folder include of css + js files, get_thumb/image.php if you have better, more intuitive names, please tell me - changed the linpha2/?cat to linpha2/?linCat i think we need to change also at least the id to linId for example to prevent interferences if the wegpage also uses an id in the url what about $_POST['cmd'] ...? ooooo * maybe there are broken things now... Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/index.php trunk/linpha2/lib/classes/linpha.class.php trunk/linpha2/lib/classes/linpha.filesys.class.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/classes/linpha.template.class.php trunk/linpha2/lib/include/basket_build_print.php trunk/linpha2/lib/include/common.php trunk/linpha2/lib/js/LinGlobal.js trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/modules/module.albums.php trunk/linpha2/lib/modules/module.basket.php trunk/linpha2/lib/modules/module.browse.php trunk/linpha2/lib/modules/module.empty.php trunk/linpha2/lib/modules/module.filemanager.php trunk/linpha2/lib/modules/module.newimg.php trunk/linpha2/lib/modules/module.search.php trunk/linpha2/lib/modules/module.settings.php trunk/linpha2/templates/default/basket.html.php trunk/linpha2/templates/default/fragments.php trunk/linpha2/templates/default/home.html.php trunk/linpha2/templates/default/search.html.php trunk/linpha2/templates/default/themes/vertical-nav/css/view_img.css 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_thumb.head.php trunk/linpha2/templates/default/view_thumb_static.html.php trunk/linpha2/templates/default_old/index.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/ChangeLog 2006-11-03 18:58:34 UTC (rev 4620) @@ -1,3 +1,19 @@ +2006-11-03 flo + * startet making linpha includable by other web pages + - introduced new constants: + - LINPHA_DIR only in PHP context, include() etc. + - LINPHA_LINK on the client side: clickable links + - LINPHA_CLIENT on the client side: access ressources in the linpha folder + include of css + js files, get_thumb/image.php + if you have better, more intuitive names, please tell me + - changed the linpha2/?cat to linpha2/?linCat + i think we need to change also at least the id to linId for example + to prevent interferences if the wegpage also uses an id in the url + what about $_POST['cmd'] ...? ooooo + + * maybe there are broken things now... + + 2006-11-02 flo * changed template system: - include all the default files Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/index.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -14,15 +14,15 @@ include_once(LINPHA_DIR.'/lib/include/integrity.php'); include_once(LINPHA_DIR.'/lib/include/upgrade.php'); - if(!isset($_GET['cat'])) + if(!isset($_GET['linCat'])) { - $_GET['cat'] = 'alb'; + $_GET['linCat'] = 'alb'; } /** * open modules */ -switch($_GET['cat']) +switch($_GET['linCat']) { case 'alb': include_once(LINPHA_DIR.'/lib/modules/module.albums.php'); Modified: trunk/linpha2/lib/classes/linpha.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.class.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/classes/linpha.class.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -31,7 +31,7 @@ { if(! file_exists( LINPHA_DIR.'/var/config.dir.php') ) { - header('Location: '.LINPHA_DIR.'/install/'); + header('Location: '.LINPHA_CLIENT.'/install/'); exit(); } @@ -57,7 +57,6 @@ */ include_once(LINPHA_DIR.'/lib/lang/lang.German.php'); - class Linpha { public $db, $sql, $template; @@ -65,6 +64,38 @@ function __construct() { $this->sql = new linSql(); + + /** + * some defines + * @todo if linpha not included, use only folder /linpha2/? as link url + */ + if(!defined('LINPHA_LINK')) + { + if( strpos($_SERVER['PHP_SELF'],'index.php') !== false ) + { + $new_phpself = substr($_SERVER['PHP_SELF'],0,strlen($_SERVER['PHP_SELF'])-strlen('index.php')); + } + else + { + $new_phpself = $_SERVER['PHP_SELF']; + } + + + // append '?' to easier append later variables + if( strpos($new_phpself,'?') === false ) + { + define('LINPHA_LINK',$new_phpself.'?'); + } + else + { + define('LINPHA_LINK',$new_phpself); + } + } + + if(!defined('LINPHA_CLIENT')) + { + define('LINPHA_CLIENT', LinFilesys::cleanPath( dirname($_SERVER['PHP_SELF']).'/'.LINPHA_DIR ) ); + } } } // end class Linpha Modified: trunk/linpha2/lib/classes/linpha.filesys.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.filesys.class.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/classes/linpha.filesys.class.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -260,6 +260,34 @@ return number_format($filesize, $precision).' '.$sizeunit; } +/** + * get a clean path + * input: ..//./../dir4//./dir5/dir6/..//dir7/ + * output: ../../dir4/dir5/dir7/ + * + * thanks to http://ch2.php.net/realpath + */ +function cleanPath($path) { + $result = array(); + // $pathA = preg_split('/[\/\\\]/', $path); + $pathA = explode('/', $path); + if (!$pathA[0]) + $result[] = ''; + foreach ($pathA AS $key => $dir) { + if ($dir == '..') { + if (end($result) == '..') { + $result[] = '..'; + } elseif (!array_pop($result)) { + $result[] = '..'; + } + } elseif ($dir && $dir != '.') { + $result[] = $dir; + } + } + if (!end($pathA)) + $result[] = ''; + return implode('/', $result); +} } // end class LinFile ?> Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -676,7 +676,7 @@ /** * filename */ - error_log("$time | $severity_msg | $type_msg | $ip | $user | $text".LIN_NL, 3, $GLOBALS['linpha']->sql->config->value['plugins_log_filename'] ); + error_log("$time | $severity_msg | $type_msg | $ip | $user | $text".LIN_NL, 3, LinFilesys::getFullPath($GLOBALS['linpha']->sql->config->value['plugins_log_filename']) ); /** * email Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -218,7 +218,7 @@ $this->setMenu(); /** - * at this point, there should be absolut no output + * at this point, there should be absolute no output */ include_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/global.html.php'); } @@ -266,7 +266,7 @@ if( $GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable'] OR $GLOBALS['linpha']->sql->isAdmin()) { $GLOBALS['linpha']->template->output['menu_My Settings']['filemanager'] = - array('name' => i18n("Filemanager"), 'value' => LINPHA_DIR.'/?cat=filemanager'); + array('name' => i18n("Filemanager"), 'value' => LINPHA_LINK.'&linCat=filemanager'); } } @@ -279,7 +279,7 @@ array( 'name' => i18n("Import"), 'value' => array( - array('name' => i18n("Start Import Of This Folder/File"), 'value' => LINPHA_DIR.'/admin/?cat=import&album_select[]='.$this->id_parent), + array('name' => i18n("Start Import Of This Folder/File"), 'value' => LINPHA_CLIENT.'/admin/?cat=import&album_select[]='.$this->id_parent), array('name' => i18n("Detect File Changes"), 'value' => $GLOBALS['linpha']->template->URL_full.'&force_update') ) ); @@ -288,7 +288,7 @@ array( 'name' => i18n("Permissions"), 'value' => array( - array('name' => i18n("Set Permissions"), 'value' => LINPHA_DIR.'/admin/?cat=permissions_view&cmd=edit&id='.$GLOBALS['linpha']->template->idCurrent) + array('name' => i18n("Set Permissions"), 'value' => LINPHA_CLIENT.'/admin/?cat=permissions_view&cmd=edit&id='.$GLOBALS['linpha']->template->idCurrent) ) ); @@ -319,7 +319,7 @@ $array_sort_orders_links[] = array('name' => i18n($value), 'value' => $GLOBALS['linpha']->template->URL_full.'&order_by='.$value); } - $open_basket_link = LINPHA_DIR.'/?cat=basket'; + $open_basket_link = LINPHA_LINK.'&linCat=basket'; switch($this->mode) { @@ -378,7 +378,7 @@ { $GLOBALS['linpha']->template->output['menu_More']['edit']['name'] = i18n("Edit"); $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['name'] = i18n("Open Filemanager"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_DIR.'/?cat=filemanager&id='.$this->id_parent; + $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&id='.$this->id_parent; } if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) @@ -410,15 +410,15 @@ array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), array('name' => i18n("View at"), 'value' => array( - array('name' => '640x480', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=640&height=480', 'target' => '_blank'), - array('name' => '800x600', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=800&height=600', 'target' => '_blank'), - array('name' => '1024x768', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1024&height=768', 'target' => '_blank'), - array('name' => '1280x800', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=800', 'target' => '_blank'), - array('name' => '1280x960', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=960', 'target' => '_blank'), - array('name' => '1280x1024', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=1024', 'target' => '_blank'), - array('name' => '1600x1200', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1600&height=1200', 'target' => '_blank'), - array('name' => '1920x1200', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1920&height=1200', 'target' => '_blank'), - array('name' => $this->org_width.'x'.$this->org_height.' '.i18n("Fullscreen").')', 'value' => LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width='.$this->org_width.'&height='.$this->org_height, 'target' => '_blank'), + array('name' => '640x480', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=640&height=480', 'target' => '_blank'), + array('name' => '800x600', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=800&height=600', 'target' => '_blank'), + array('name' => '1024x768', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1024&height=768', 'target' => '_blank'), + array('name' => '1280x800', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=800', 'target' => '_blank'), + array('name' => '1280x960', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=960', 'target' => '_blank'), + array('name' => '1280x1024', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=1024', 'target' => '_blank'), + array('name' => '1600x1200', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1600&height=1200', 'target' => '_blank'), + array('name' => '1920x1200', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1920&height=1200', 'target' => '_blank'), + array('name' => $this->org_width.'x'.$this->org_height.' '.i18n("Fullscreen").')', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width='.$this->org_width.'&height='.$this->org_height, 'target' => '_blank'), ) ) ) @@ -438,7 +438,7 @@ { $GLOBALS['linpha']->template->output['menu_More']['edit']['name'] = i18n("Edit"); $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['name'] = i18n("Open Filemanager"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_DIR.'/?cat=filemanager&id='.$this->id_parent; + $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&id='.$this->id_parent; } @@ -501,7 +501,7 @@ */ if( $GLOBALS['linpha']->sql->checkPermission('download')) { - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.LINPHA_DIR.'/download_file.php?id='.$GLOBALS['linpha']->template->idCurrent.'">'. + $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.LINPHA_CLIENT.'/download_file.php?id='.$GLOBALS['linpha']->template->idCurrent.'">'. '<img src="'.$GLOBALS['linpha']->template->themeFile('images/download.png').'" border="0" title="'.i18n("Download Image").'" />' .'</a>'."\n"; } @@ -568,7 +568,7 @@ if($_GET['admin_cmd'] == 'basket_add_all_with_checkout') { - header("Location: ".LINPHA_DIR."/?cat=basket&checkout_as=".$_GET['checkout_as']); + header("Location: ".LINPHA_LINK."&linCat=basket&checkout_as=".$_GET['checkout_as']); exit(); } break; @@ -581,7 +581,7 @@ if($_GET['admin_cmd'] == 'basket_add_this_with_checkout') { - header("Location: ".LINPHA_DIR."/?cat=basket&checkout_as=".$_GET['checkout_as']); + header("Location: ".LINPHA_LINK."&linCat=basket&checkout_as=".$_GET['checkout_as']); exit(); } break; @@ -846,7 +846,7 @@ { if($value['img_type'] == 0) { - $GLOBALS['linpha']->template->output['navigation'] .= '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">'.$value['name'].'</a><br />'; + $GLOBALS['linpha']->template->output['navigation'] .= '<a href="'.LINPHA_LINK.'&linCat=alb&id='.$value['id'].'">'.$value['name'].'</a><br />'; $nr_folders++; } } @@ -942,7 +942,7 @@ $data = $GLOBALS['linpha']->db->GetRow("SELECT count(datetimeoriginal) FROM ".PREFIX."meta_exif WHERE datetimeoriginal LIKE '".$i."%'"); if($data[0]>0) { - $GLOBALS['linpha']->template->output['browse_by_date'] .= '<a href="'.LINPHA_DIR.'/?cat=browse&year='.$i.'">'.$i.'</a> ('.$data[0].'), '; + $GLOBALS['linpha']->template->output['browse_by_date'] .= '<a href="'.LINPHA_LINK.'&linCat=browse&year='.$i.'">'.$i.'</a> ('.$data[0].'), '; } } } @@ -1290,7 +1290,7 @@ $str = '<div class="thumbnavi_'.$class.'thumb">' . '<a href="'.$GLOBALS['linpha']->template->URL_base.'&id='.$id.'">' - . '<img class="img_'.$class.'thumb" src="'.LINPHA_DIR.'/get_thumb.php?id='.$id.'" /></a>' + . '<img class="img_'.$class.'thumb" src="'.LINPHA_CLIENT.'/get_thumb.php?id='.$id.'" /></a>' . '<br />'.$name.'</div>'."\n"; return $str; Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -736,6 +736,8 @@ * calculate correct path for cookie * needs always to be the linpha root folder * for example: http://localhost/linpha/index.php -> must be /linpha/ + * + * @todo what if linpha is included from another directory? */ /** * get directory and append needed ending slash Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -80,31 +80,31 @@ <!-- css includes --> <!-- colorsettings.php --> -<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/default/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'> <?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=". +<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'> <?php } ?> <!-- global.css --> -<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$this->template_name.'/themes/default/css/global.css'; ?>' type='text/css'> +<link rel='stylesheet' href='<?php echo LINPHA_CLIENT.'/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"; +<link rel='stylesheet' href='<?php echo LINPHA_CLIENT.'/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'> +<link rel='stylesheet' href='<?php echo LINPHA_CLIENT.'/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'> +<link rel='stylesheet' href='<?php echo LINPHA_CLIENT.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/'.$this->css_name.'.css'; ?>' type='text/css'> <?php } ?> <!--[if IE]> @@ -116,17 +116,19 @@ <![endif]--> <!--[if lt IE 7]> <style type="text/css" media="screen"> - body { behavior: url(<?php echo LINPHA_DIR; ?>/templates/misc/csshover.htc); font-size: 100%; } + body { behavior: url(<?php echo LINPHA_CLIENT; ?>/templates/misc/csshover.htc); font-size: 100%; } #menu ul li a { height: 1%; } #menu a, #menu span { font: bold 0.7em/1.4em arial, helvetica, sans-serif; } </style> <![endif]--> -<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_DIR; ?>/lib/js/prototype.js"></script> -<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_DIR; ?>/lib/js/LinGlobal.js"></script> +<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/prototype.js"></script> +<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/LinGlobal.js"></script> <script type="text/javascript" language="JavaScript"> -var LINPHA_DIR = '<?php echo LINPHA_DIR; ?>'; +var LINPHA_LINK = '<?php echo LINPHA_LINK; ?>'; +var LINPHA_CLIENT = '<?php echo LINPHA_CLIENT; ?>'; var startIdCurrent = <?php echo $this->idCurrent; ?>; +var IdCurrent = startIdCurrent; <?php if(! isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax'])) { @@ -181,11 +183,10 @@ if($GLOBALS['linpha']->sql->isLoggedIn()) { echo '<!-- my settings and admin links -->'."\n"; - $this->printMenu("My Settings",LINPHA_DIR."/?cat=settings"); - $this->printMenu("Admin",LINPHA_DIR."/admin/"); + $this->printMenu("My Settings",LINPHA_LINK."&linCat=settings"); + $this->printMenu("Admin",LINPHA_CLIENT."/admin/"); } - if($comingfrom_ajax && isset($this->output['sys_log']) && !empty($this->output['sys_log'])) { echo '<script language="JavaScript" type="text/javascript">linSyslog("'.$this->output['sys_log'].'");</script>'; @@ -310,15 +311,15 @@ if(empty($alpha)) // default { - $str = '<div style="background: url('.LINPHA_DIR.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignright.') no-repeat top right;">'; - $str .= '<img src="'.LINPHA_DIR.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignleft.'" alt="" width="'.$size.'" height="'.$size.'" class="corner" />'; + $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_DIR.'/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_DIR.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignleft.'&alpha" alt="" width="'.$size.'" height="'.$size.'" class="AlphaCorner" />'; + $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>'; } @@ -329,11 +330,11 @@ { 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; + return LINPHA_CLIENT.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/'.$filename; } else { - return LINPHA_DIR.'/templates/'.$this->template_name.'/themes/default/'.$filename; + return LINPHA_CLIENT.'/templates/'.$this->template_name.'/themes/default/'.$filename; } } } // end class linTemplate Modified: trunk/linpha2/lib/include/basket_build_print.php =================================================================== --- trunk/linpha2/lib/include/basket_build_print.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/include/basket_build_print.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -173,7 +173,7 @@ */ echo "\n\t\t".'<td width="'.$print_w.'" height="'.$print_h.'">'; echo '<img width="'.$img_w.'" height="'.$img_h.'" '. - 'src="'.LINPHA_DIR.'/get_image.php?'. + 'src="'.LINPHA_CLIENT.'/get_image.php?'. 'id='.$image_id.'&'. 'width='.$nw.'&'. 'height='.$nh.'&'. Modified: trunk/linpha2/lib/include/common.php =================================================================== --- trunk/linpha2/lib/include/common.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/include/common.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -12,67 +12,7 @@ * - install/index.php, install/step* */ -if(strtoupper(substr(PHP_OS,0,3)) == 'WIN') -{ - define('LIN_NL',"\r\n"); - define('LIN_OS',"win"); -} -else -{ - define('LIN_NL',"\n"); - define('LIN_OS',"unix"); -} - - - /** - * secure PHP_SELF - * - * added from linpha1 patch 1432469 - * - * short description: - * with the url http://example.com/tests/simple.php/%22%3E%3Cscript%3Ealert('xss')%3C/script%3E%3Cfoo - * PHP_SELF is: /tests/simple.php/"><script>alert('xss')</script><foo - * and thats dangerous - * - * further details about the PHP_SELF XSS problem: - * http://blog.phpdoc.info/archives/13-XSS-Woes.html - */ - /** - * Added by Roland Haeder <web...@mx...> - * - * This code came from my free mailexchange script called 'MXChange' - * Please refer the pages on http://www.mxchange.org for further details - * - */ - // Secure the PHP_SELF variable by first making all HTML code unuseable - $_SERVER['PHP_SELF'] = htmlentities($_SERVER['PHP_SELF']); - - // Split it up into path and filename - $SELF_DIR = dirname($_SERVER['PHP_SELF']); - $SELF_FILE = basename($_SERVER['PHP_SELF']); - - // Check for a .php inside the $SELF_DIR... - while (ereg(".php", $SELF_DIR)) - { - // Correct the dirname - $SELF_DIR = substr($SELF_DIR, 0, (strpos($SELF_DIR, ".php") + 4)); - // Rewrite filename... - $SELF_FILE = basename($SELF_DIR); - // ... and dirname - $SELF_DIR = dirname($SELF_DIR); - } - - // Put both together again and let's pray it is secured now... - $_SERVER['PHP_SELF'] = $SELF_DIR."/".$SELF_FILE; - - // Remove uneccessary variables - unset($SELF_DIR); - unset($SELF_FILE); - - - -/** * Magic Quotes stuff */ /** @@ -134,4 +74,64 @@ $HTTP_POST_VARS = $_POST; $HTTP_COOKIE_VARS = $_COOKIE; } -?> + +/** + * secure PHP_SELF + * + * added from linpha1 patch 1432469 + * + * short description: + * with the url http://example.com/tests/simple.php/%22%3E%3Cscript%3Ealert('xss')%3C/script%3E%3Cfoo + * PHP_SELF is: /tests/simple.php/"><script>alert('xss')</script><foo + * and thats dangerous + * + * further details about the PHP_SELF XSS problem: + * http://blog.phpdoc.info/archives/13-XSS-Woes.html + */ + /** + * Added by Roland Haeder <web...@mx...> + * + * This code came from my free mailexchange script called 'MXChange' + * Please refer the pages on http://www.mxchange.org for further details + * + */ + // Secure the PHP_SELF variable by first making all HTML code unuseable + $_SERVER['PHP_SELF'] = htmlentities($_SERVER['PHP_SELF']); + + // Split it up into path and filename + $SELF_DIR = dirname($_SERVER['PHP_SELF']); + $SELF_FILE = basename($_SERVER['PHP_SELF']); + + // Check for a .php inside the $SELF_DIR... + while (ereg(".php", $SELF_DIR)) + { + // Correct the dirname + $SELF_DIR = substr($SELF_DIR, 0, (strpos($SELF_DIR, ".php") + 4)); + // Rewrite filename... + $SELF_FILE = basename($SELF_DIR); + // ... and dirname + $SELF_DIR = dirname($SELF_DIR); + } + + // Put both together again and let's pray it is secured now... + $_SERVER['PHP_SELF'] = $SELF_DIR."/".$SELF_FILE; + + // Remove uneccessary variables + unset($SELF_DIR); + unset($SELF_FILE); + +/** + * some defines + */ +if(strtoupper(substr(PHP_OS,0,3)) == 'WIN') +{ + define('LIN_NL',"\r\n"); + define('LIN_OS',"win"); +} +else +{ + define('LIN_NL',"\n"); + define('LIN_OS',"unix"); +} + +?> \ No newline at end of file Modified: trunk/linpha2/lib/js/LinGlobal.js =================================================================== --- trunk/linpha2/lib/js/LinGlobal.js 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/js/LinGlobal.js 2006-11-03 18:58:34 UTC (rev 4620) @@ -29,14 +29,14 @@ * * use this on every page and not only on home page, because if user is linked directly to an image * - * ajax may be disabled with ./?cat=ajax&disable_ajax - * and may be re-enabled with ./?cat=ajax&enable_ajax + * ajax may be disabled with ./?linCat=ajax&disable_ajax + * and may be re-enabled with ./?linCat=ajax&enable_ajax * * http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request */ function checkAjaxCompatibility() { - new Ajax.Request(LINPHA_DIR + '/?cat=ajax&use_js', {method:'get', asynchronous:true, onSuccess:checkAjaxCompatibilitySuccess} ); + new Ajax.Request(LINPHA_CLIENT + '/?linCat=ajax&use_js', {method:'get', asynchronous:true, onSuccess:checkAjaxCompatibilitySuccess} ); } /** @@ -81,7 +81,7 @@ { if( menuNeedsUpdating ) { - new Ajax.Updater('menu', LINPHA_DIR + '/?cat=ajax&reloadmenu&id='+IdCurrent, {method: 'get', asynchronous:true, evalScripts:true}); + new Ajax.Updater('menu', LINPHA_CLIENT + '/?linCat=ajax&reloadmenu&id='+IdCurrent, {method: 'get', asynchronous:true, evalScripts:true}); menuNeedsUpdating = false; } } Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/js/LinImage.js 2006-11-03 18:58:34 UTC (rev 4620) @@ -3,7 +3,6 @@ alert('Error ' + t.status + ' -- ' + t.statusText); } -var IdCurrent; var nextThumbs = new Array(); var prevThumbs = new Array(); @@ -797,10 +796,6 @@ { IdCurrent = document.location.hash.substr(11); } - else - { - IdCurrent = startIdCurrent; - } /** * and again something important Modified: trunk/linpha2/lib/modules/module.albums.php =================================================================== --- trunk/linpha2/lib/modules/module.albums.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/modules/module.albums.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -47,8 +47,8 @@ /** * set some infos */ - $linpha->template->URL_base = LINPHA_DIR.'/?cat=alb'; - $linpha->template->URL_full = LINPHA_DIR.'/?cat=alb&id='.$linpha->template->idCurrent; + $linpha->template->URL_base = LINPHA_LINK.'&linCat=alb'; + $linpha->template->URL_full = LINPHA_LINK.'&linCat=alb&id='.$linpha->template->idCurrent; $linpha->imgview->setCurrentView('albums'); @@ -63,7 +63,7 @@ /** * set navigation line */ - $GLOBALS['linpha']->template->output['title'] = setNavigationLine( $linpha->template->idCurrent, LINPHA_DIR.'/?cat=alb&id=' ); + $GLOBALS['linpha']->template->output['title'] = setNavigationLine( $linpha->template->idCurrent, LINPHA_LINK.'&linCat=alb&id=' ); /** Modified: trunk/linpha2/lib/modules/module.basket.php =================================================================== --- trunk/linpha2/lib/modules/module.basket.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/modules/module.basket.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -202,7 +202,7 @@ $linpha->template->setModuleName('basket'); -$linpha->template->URL_full = LINPHA_DIR.'/?cat=basket'; +$linpha->template->URL_full = LINPHA_LINK.'&linCat=basket'; $linpha->template->output['title'] = '<a href="'.$linpha->template->URL_full.'">'.i18n("Basket").'</a>'; include_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/global.html.php'); ?> \ No newline at end of file Modified: trunk/linpha2/lib/modules/module.browse.php =================================================================== --- trunk/linpha2/lib/modules/module.browse.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/modules/module.browse.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -40,7 +40,7 @@ */ $linpha->imgview->setCurrentView('browse'); - $url_base = LINPHA_DIR.'/?cat=browse'; + $url_base = LINPHA_LINK.'&linCat=browse'; $url_append = ''; if(isset($_GET['year'])) { Modified: trunk/linpha2/lib/modules/module.empty.php =================================================================== --- trunk/linpha2/lib/modules/module.empty.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/modules/module.empty.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -57,7 +57,7 @@ $linpha->template->output['default'] = ''; $linpha->template->setModuleName('default'); -$linpha->template->URL_full = LINPHA_DIR.'/?cat=empty'; +$linpha->template->URL_full = LINPHA_LINK.'&linCat=empty'; $linpha->template->output['title'] = i18n("empty"); include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); Modified: trunk/linpha2/lib/modules/module.filemanager.php =================================================================== --- trunk/linpha2/lib/modules/module.filemanager.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/modules/module.filemanager.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -132,7 +132,7 @@ } ?> - <form method="POST" action="<?php echo LINPHA_DIR.'/?cat=filemanager&id='.$parent_id; ?>"> + <form method="POST" action="<?php echo LINPHA_LINK.'&linCat=filemanager&id='.$parent_id; ?>"> <?php switch($_REQUEST['file_action']) { @@ -728,10 +728,10 @@ }*/ } -echo i18n("Current Folder:").' '.setNavigationLine( $parent_id, LINPHA_DIR.'/?cat=filemanager&id').'<br />'; +echo i18n("Current Folder:").' '.setNavigationLine( $parent_id, LINPHA_LINK.'&linCat=filemanager&id').'<br />'; ?> -<form method="POST" action="<?php echo LINPHA_DIR.'/?cat=filemanager&id='.$parent_id; ?>"> +<form method="POST" action="<?php echo LINPHA_LINK.'&linCat=filemanager&id='.$parent_id; ?>"> <div id="filemanager"> <table> <tr> @@ -746,7 +746,7 @@ { $data = $linpha->db->GetRow("SELECT name, parent_id FROM ".PREFIX."photos WHERE id = '".LinSql::linAddslashes($parent_id)."'"); ?> - <a href="<?php echo LINPHA_DIR.'/?cat=filemanager&id='.$data['parent_id']; ?>">..</a> + <a href="<?php echo LINPHA_LINK.'&linCat=filemanager&id='.$data['parent_id']; ?>">..</a> <?php } ?> @@ -817,7 +817,7 @@ if($uid == $filestat['uid']) { - $file_permissions = '<a href="'.LINPHA_DIR.'/?cat=filemanager&cmd=file_action&file_action=changeperm&checkedfiles[]='.$data['id'].'">'. $perm . '</a>'; + $file_permissions = '<a href="'.LINPHA_LINK.'&linCat=filemanager&cmd=file_action&file_action=changeperm&checkedfiles[]='.$data['id'].'">'. $perm . '</a>'; } else { @@ -851,7 +851,7 @@ <?php if($data['img_type']==0) { - echo '<a href="'.LINPHA_DIR.'/?cat=filemanager&id='.$data['id'].'">'.htmlspecialchars($data['name'],ENT_QUOTES).'</a>'; + echo '<a href="'.LINPHA_LINK.'&linCat=filemanager&id='.$data['id'].'">'.htmlspecialchars($data['name'],ENT_QUOTES).'</a>'; } else { @@ -908,7 +908,7 @@ </form> <br /><br /> -<form method="POST" action="<?php echo LINPHA_DIR.'/?cat=filemanager&id='.$parent_id; ?>"> +<form method="POST" action="<?php echo LINPHA_LINK.'&linCat=filemanager&id='.$parent_id; ?>"> <input type="text" class="linforms" name="folder_name" value="" /> <input type="hidden" name="cmd" value="do_file_action" /> <input type="hidden" name="file_action" value="create_folder" /> @@ -917,7 +917,7 @@ <br /> <h2><?php echo i18n("Upload Files"); ?></h2> -<form method="POST" enctype="multipart/form-data" action="<?php echo LINPHA_DIR.'/?cat=filemanager&id='.$parent_id; ?>"> +<form method="POST" enctype="multipart/form-data" action="<?php echo LINPHA_LINK.'&linCat=filemanager&id='.$parent_id; ?>"> <?php echo i18n("Choose files you would like to upload. Choose desired action to accomplish upon succesful upload."); echo '<br />'; @@ -989,7 +989,7 @@ $linpha->template->setModuleName('default'); $linpha->template->overrideModule('css','filemanager'); -$linpha->template->URL_full = LINPHA_DIR.'/?cat=filemanager&id='.$parent_id; +$linpha->template->URL_full = LINPHA_LINK.'&linCat=filemanager&id='.$parent_id; $linpha->template->output['title'] = i18n("Filemanager"); include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); ?> Modified: trunk/linpha2/lib/modules/module.newimg.php =================================================================== --- trunk/linpha2/lib/modules/module.newimg.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/modules/module.newimg.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -35,13 +35,13 @@ include_once(LINPHA_DIR . '/lib/classes/linpha.imgview.class.php'); $linpha->imgview = new linImgview(); $linpha->imgview->setCurrentView('newimg'); - $linpha->template->URL_base = LINPHA_DIR.'/?cat=newimg'; - $linpha->template->URL_full = LINPHA_DIR.'/?cat=newimg&id='.$linpha->template->idCurrent; + $linpha->template->URL_base = LINPHA_LINK.'&linCat=newimg'; + $linpha->template->URL_full = LINPHA_LINK.'&linCat=newimg&id='.$linpha->template->idCurrent; /** * write navigation and date links */ - $GLOBALS['linpha']->template->output['title'] = '<a href="'.LINPHA_DIR.'/?cat=newimg">'.i18n("New Images").'</a>'; + $GLOBALS['linpha']->template->output['title'] = '<a href="'.LINPHA_LINK.'&linCat=newimg">'.i18n("New Images").'</a>'; $GLOBALS['linpha']->template->output['navigation'] = ''; /** Modified: trunk/linpha2/lib/modules/module.search.php =================================================================== --- trunk/linpha2/lib/modules/module.search.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/modules/module.search.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -98,8 +98,8 @@ include_once(LINPHA_DIR . '/lib/classes/linpha.imgview.class.php'); $linpha->imgview = new linImgview(); $linpha->imgview->setCurrentView('search'); - $linpha->template->URL_base = LINPHA_DIR.'/?cat=search'; - $linpha->template->URL_full = LINPHA_DIR.'/?cat=search&id='.$linpha->template->idCurrent; + $linpha->template->URL_base = LINPHA_LINK.'&linCat=search'; + $linpha->template->URL_full = LINPHA_LINK.'&linCat=search&id='.$linpha->template->idCurrent; $linpha->template->output['title'] = i18n("Search"); @@ -447,9 +447,9 @@ $GLOBALS['linpha']->template->output['navigation'] = ''; } $GLOBALS['linpha']->template->output['navigation'] .= - '<a class="button" href="'.LINPHA_DIR.'/?cat=search&cmd=new">'. + '<a class="button" href="'.LINPHA_LINK.'&linCat=search&cmd=new">'. i18n("New Search").'</a>'. - '<a class="button" href="'.LINPHA_DIR.'/?cat=search&cmd=edit">'. + '<a class="button" href="'.LINPHA_LINK.'&linCat=search&cmd=edit">'. i18n("Edit Search").'</a>'; $linpha->imgview->buildImgView(); @@ -457,7 +457,7 @@ else { $linpha->template->setModuleName('search'); - $linpha->template->URL_full = LINPHA_DIR.'/?cat=search'; + $linpha->template->URL_full = LINPHA_LINK.'&linCat=search'; $linpha->template->output['title'] = i18n("Search"); include_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/global.html.php'); } Modified: trunk/linpha2/lib/modules/module.settings.php =================================================================== --- trunk/linpha2/lib/modules/module.settings.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/lib/modules/module.settings.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -34,7 +34,7 @@ if( ! $GLOBALS['linpha']->sql->isLoggedIn()) { linSysLog(i18n("Please Login!")); - $_GET['cat'] = 'alb'; + $_GET['linCat'] = 'alb'; include_once(LINPHA_DIR.'/lib/modules/module.albums.php'); exit(); } @@ -187,7 +187,7 @@ ?> <h2><?php echo i18n("Change User Information"); ?></h2> -<form method="POST" action="./?cat=settings"> +<form method="POST" action="./?linCat=settings"> <?php $LinAdmin->printAdminConfig('text',i18n("Username"),'username',$user_data['username']); $LinAdmin->printAdminConfig('text',i18n("Display Name"),'display_name',$user_data['display_name']); @@ -199,7 +199,7 @@ <hr /> <h2><?php echo i18n("Change Password"); ?></h2> -<form method="POST" name="change_password" action="./?cat=settings"> +<form method="POST" name="change_password" action="./?linCat=settings"> <?php $LinAdmin->printAdminConfig('password',i18n("Old Password"),'old_password',''); $LinAdmin->printAdminConfig('password',i18n("New Password"),'new_password',''); @@ -222,7 +222,7 @@ <hr /> <h2><?php echo i18n("Change User Settings"); ?></h2> -<form method="POST" action="./?cat=settings"> +<form method="POST" action="./?linCat=settings"> <?php foreach($options AS $value) { @@ -241,7 +241,7 @@ <input type="submit" name="submit" value="<?php echo i18n("Submit"); ?>" class="button" /> </form> -<form method="POST" action="./?cat=settings"> +<form method="POST" action="./?linCat=settings"> <input type="hidden" name="cmd" value="loaddefault" /> <input type="submit" name="submit" value="<?php echo i18n("Load default values"); ?>" class="button" /> </form> @@ -250,7 +250,7 @@ <?php $linpha->template->output['default'] = ob_get_clean(); $linpha->template->setModuleName('default'); -$linpha->template->URL_full = LINPHA_DIR.'/?cat=settings'; +$linpha->template->URL_full = LINPHA_LINK.'&linCat=settings'; $linpha->template->output['title'] = i18n("Settings"); include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); ?> \ No newline at end of file Modified: trunk/linpha2/templates/default/basket.html.php =================================================================== --- trunk/linpha2/templates/default/basket.html.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/templates/default/basket.html.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -186,12 +186,12 @@ $i = 1; foreach($tpl->output['basket_folders'] AS $value) { - echo setNavigationLine( $value, LINPHA_DIR.'/?cat=alb&id=' ).'<br />'; + echo setNavigationLine( $value, LINPHA_LINK.'&linCat=alb&id=' ).'<br />'; foreach($tpl->output['basket_folder_contents'][$value] AS $sub_value) { ?> <div style='float: left;'> - <label for='<?php echo $i; ?>'><img style='cursor: pointer;' src='<?php echo LINPHA_DIR.'/get_thumb.php?id='.$sub_value; ?>' class='img_thumbnail' /></label> + <label for='<?php echo $i; ?>'><img style='cursor: pointer;' src='<?php echo LINPHA_CLIENT.'/get_thumb.php?id='.$sub_value; ?>' class='img_thumbnail' /></label> <br /> <input type='checkbox' id='<?php echo $i; ?>' name='img_id[]' value='<?php echo $sub_value; ?>'> </div> Modified: trunk/linpha2/templates/default/fragments.php =================================================================== --- trunk/linpha2/templates/default/fragments.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/templates/default/fragments.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -5,19 +5,19 @@ case 'menu': ?> <ul style="margin-left: 50px;"> - <li><a href="<?php echo LINPHA_DIR; ?>/"><?php echo i18n("Home"); ?></a></li> + <li><a href="<?php echo LINPHA_LINK; ?>&linCat=alb"><?php echo i18n("Home"); ?></a></li> </ul> <ul> <li><span><?php echo i18n("Search"); ?> </span> <ul> - <li><a href="<?php echo LINPHA_DIR; ?>/?cat=search"><?php echo i18n("Extended Search"); ?></a></li> + <li><a href="<?php echo LINPHA_LINK; ?>&linCat=search"><?php echo i18n("Extended Search"); ?></a></li> <li> <div> - <form method="GET" action="<?php echo LINPHA_DIR; ?>/?cat=search"> + <form method="GET" action="<?php echo LINPHA_LINK; ?>&linCat=search"> <input type="text" class="linForms" name="search_text" value="" /> <input type="hidden" name="button[meta][all]" value="1" /> <input type="hidden" name="cmd" value="search" /> - <input type="hidden" name="cat" value="search" /> + <input type="hidden" name="linCat" value="search" /> <input type="submit" name="submit" value="<?php echo i18n("Search"); ?>" /> </form> </div> @@ -32,7 +32,7 @@ <li> <div> <?php if( useAjax() ) { ?> - <form action="" method="POST" onsubmit="new Ajax.Updater('menu', LINPHA_DIR + '/?cat=ajax&reloadmenu&id='+IdCurrent, {method: 'post', asynchronous:true, parameters:Form.serialize(this), evalScripts:true}); return false;"> + <form action="" method="POST" onsubmit="new Ajax.Updater('menu', LINPHA_CLIENT + '/?linCat=ajax&reloadmenu&id='+IdCurrent, {method: 'post', asynchronous:true, parameters:Form.serialize(this), evalScripts:true}); return false;"> <?php } else { ?> <form action="<?php echo $this->URL_full; ?>" method="POST"> <?php } Modified: trunk/linpha2/templates/default/home.html.php =================================================================== --- trunk/linpha2/templates/default/home.html.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/templates/default/home.html.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -15,8 +15,8 @@ { ?> <div class="div_random_img"> - <?php echo '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">' - . '<img class="img_random_thumbnail" title="'.htmlentities($value['path']).'" src="'. LINPHA_DIR.'/get_thumb.php?id=' .$value['id'] .'" alt="randomimage" /></a>'; ?> + <?php echo '<a href="'.LINPHA_LINK.'&linCat=alb&id='.$value['id'].'">' + . '<img class="img_random_thumbnail" title="'.htmlentities($value['path']).'" src="'. LINPHA_CLIENT.'/get_thumb.php?id=' .$value['id'] .'" alt="randomimage" /></a>'; ?> <br /><br /> </div> <?php @@ -34,15 +34,15 @@ { ?> <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>'; ?> + <?php echo '<a href="'.LINPHA_LINK.'&linCat=newimg&id='.$value['id'].'">' + . '<img class="img_new_thumbnail" title="'.htmlspecialchars($value['path'],ENT_QUOTES).'" src="'. LINPHA_CLIENT.'/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 echo '<a href="'.LINPHA_LINK.'&linCat=newimg">'.i18n('Show All New Images').'</a>'; ?> <?php } ?> <!-- Browse by Date --> @@ -67,11 +67,11 @@ <div class="div_folder"> <?php echo $tpl->divRoundCorners('top','','albums'); ?> - <?php echo '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">' - . '<img class="img_folder_thumbnail" src="'. LINPHA_DIR.'/get_thumb.php?id=' .$value['id'] .'" alt="thumbnail_album" /></a>'; ?> + <?php echo '<a href="'.LINPHA_LINK.'&linCat=alb&id='.$value['id'].'">' + . '<img class="img_folder_thumbnail" src="'. LINPHA_CLIENT.'/get_thumb.php?id=' .$value['id'] .'" alt="thumbnail_album" /></a>'; ?> <div class="div_folder_text"> - <h2><?php echo '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">'.$value['name'].'</a>'; ?></h2> + <h2><?php echo '<a href="'.LINPHA_LINK.'&linCat=alb&id='.$value['id'].'">'.$value['name'].'</a>'; ?></h2> <?php echo $value['stats_numbers'].' '.i18n("Photos"); ?> Modified: trunk/linpha2/templates/default/search.html.php =================================================================== --- trunk/linpha2/templates/default/search.html.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/templates/default/search.html.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -10,7 +10,7 @@ } </style> -<img src="<?php echo LINPHA_DIR; ?>/lib/graphics/xmag.jpg" alt="Searching Linpha"> +<img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/xmag.jpg" alt="Searching Linpha"> <font size="+1"><?php echo i18n("LinPHA Search Page"); ?></font> <hr noshade> <?php @@ -31,10 +31,10 @@ <div id="main"> <div class="divcolumn"> - <form name="searchform" method="GET" action="<?php echo LINPHA_DIR; ?>/"> + <form name="searchform" method="GET" action="<?php echo LINPHA_LINK; ?>/"> <input type="submit" class="button" name="sub" value=" <?php echo i18n("Search"); ?> "> - <a class="button" href="<?php echo LINPHA_DIR; ?>/?cat=search&cmd=new"><?php echo i18n("Reset"); ?></a> + <a class="button" href="<?php echo LINPHA_LINK; ?>&linCat=search&cmd=new"><?php echo i18n("Reset"); ?></a> <br /><br /> <!-- search text box //--> @@ -124,8 +124,8 @@ <!-- date --> <!-- exif date --> <?php echo i18n("Date"); ?> (EXIF) - <a class="FromTo" href="javascript:void(0);" onclick="var loginWin = window.open('<?php echo LINPHA_DIR; ?>/lib/include/calender.php?form=date_from_exif','Calender','height=250,width=300,scrollbars=no,menubar=no,status=no');" target="_top"><?php echo i18n("From"); ?></a> / - <a class="FromTo" href="javascript:void(0);" onclick="var loginWin = window.open('<?php echo LINPHA_DIR; ?>/lib/include/calender.php?form=date_to_exif','Calender','height=250,width=250,scrollbars=no,menubar=no,status=no');" target="_top"><?php echo i18n("To"); ?></a> + <a class="FromTo" href="javascript:void(0);" onclick="var loginWin = window.open('<?php echo LINPHA_CLIENT; ?>/lib/include/calender.php?form=date_from_exif','Calender','height=250,width=300,scrollbars=no,menubar=no,status=no');" target="_top"><?php echo i18n("From"); ?></a> / + <a class="FromTo" href="javascript:void(0);" onclick="var loginWin = window.open('<?php echo LINPHA_CLIENT; ?>/lib/include/calender.php?form=date_to_exif','Calender','height=250,width=250,scrollbars=no,menubar=no,status=no');" target="_top"><?php echo i18n("To"); ?></a> </span><br /> <input type="text" id="date_from_exif" name="date_from_exif" value="<?php echo @$_REQUEST['date_from_exif']; ?>" style="width: 80px;"> / @@ -140,8 +140,8 @@ { ?> <span><?php echo $data['name']; ?> - <a href="javascript:void(0);" onclick="var loginWin = window.open('<?php echo LINPHA_DIR; ?>/lib/include/calender.php?form=date_from_<?php echo $data['id']; ?>','Calender','height=250,width=300,scrollbars=no,menubar=no,status=no');" target="_top"><?php echo i18n("From"); ?></a> / - <a href="javascript:void(0);" onclick="var loginWin = window.open('<?php echo LINPHA_DIR; ?>/lib/include/calender.php?form=date_to_<?php echo $data['id']; ?>','Calender','height=250,width=250,scrollbars=no,menubar=no,status=no');" target="_top"><?php echo i18n("To"); ?></a> + <a href="javascript:void(0);" onclick="var loginWin = window.open('<?php echo LINPHA_CLIENT; ?>/lib/include/calender.php?form=date_from_<?php echo $data['id']; ?>','Calender','height=250,width=300,scrollbars=no,menubar=no,status=no');" target="_top"><?php echo i18n("From"); ?></a> / + <a href="javascript:void(0);" onclick="var loginWin = window.open('<?php echo LINPHA_CLIENT; ?>/lib/include/calender.php?form=date_to_<?php echo $data['id']; ?>','Calender','height=250,width=250,scrollbars=no,menubar=no,status=no');" target="_top"><?php echo i18n("To"); ?></a> </span><br /> <input type="text" id="date_from_<?php echo $data['id']; ?>" name="date_from[<?php echo $data['id']; ?>]" value="<?php echo @$_REQUEST['date_from'][$data['id']]; ?>" style="width: 80px;"> / <input type="text" id="date_to_<?php echo $data['id']; ?>" name="date_to[<?php echo $data['id']; ?>]" value="<?php echo @$_REQUEST['date_to'][$data['id']]; ?>" style="width: 80px;"><br /><br /> @@ -219,7 +219,7 @@ <!-- submit //--> <div> <input type="hidden" name="cmd" value="search" /> - <input type="hidden" name="cat" value="search" /> + <input type="hidden" name="linCat" value="search" /> </div> </div> <div style="clear: both;"></div> Modified: trunk/linpha2/templates/default/themes/vertical-nav/css/view_img.css =================================================================== --- trunk/linpha2/templates/default/themes/vertical-nav/css/view_img.css 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/templates/default/themes/vertical-nav/css/view_img.css 2006-11-03 18:58:34 UTC (rev 4620) @@ -10,9 +10,10 @@ position: relative; margin-left: 10px; - height: auto; + + width: 120px; min-height: 650px; - width: 120px; + height:expression( "650px" ); /* ie hack */ } #thumbnavi_prevthumb { Modified: trunk/linpha2/templates/default/view_basket.html.php =================================================================== --- trunk/linpha2/templates/default/view_basket.html.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/templates/default/view_basket.html.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -12,7 +12,7 @@ <a href="<?php echo $tpl->URL_full.'&view=thumb'; ?>"><?php echo i18n("Back To Normal View"); ?></a> <br /> <?php echo i18n("Images In Basket"); ?>: <?php echo count($_SESSION['basket_ids']); ?> - (<a href="<?php echo LINPHA_DIR.'?cat=basket&ref_id='.$GLOBALS['linpha']->template->idCurrent; ?>"><?php echo i18n("Open Basket"); ?></a>) + (<a href="<?php echo LINPHA_LINK.'&linCat=basket&ref_id='.$GLOBALS['linpha']->template->idCurrent; ?>"><?php echo i18n("Open Basket"); ?></a>) </div> @@ -30,7 +30,7 @@ </div> </div> - <form name='basket' action='<?php echo LINPHA_DIR.'/?cat=basket&cmd=add_selected&ref_id='.$GLOBALS['linpha']->template->idCurrent; ?>' method='POST'> + <form name='basket' action='<?php echo LINPHA_LINK.'&linCat=basket&cmd=add_selected&ref_id='.$GLOBALS['linpha']->template->idCurrent; ?>' method='POST'> <div id="main"> <?php $i = 1; Modified: trunk/linpha2/templates/default/view_img.head.php =================================================================== --- trunk/linpha2/templates/default/view_img.head.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/templates/default/view_img.head.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -1,8 +1,8 @@ <script language="JavaScript" type="text/javascript"> -var xmlUrl = '<?php echo convert_amp($tpl->URL_base); ?>'; -var imageSrc = '<?php echo LINPHA_DIR.'/get_image.php?id='; ?>'; -var thumbSrc = '<?php echo LINPHA_DIR.'/get_thumb.php?id='; ?>'; +var xmlUrl = '<?php echo str_replace(LINPHA_LINK,LINPHA_CLIENT.'/?',convert_amp($tpl->URL_base)); ?>'; +var imageSrc = '<?php echo LINPHA_CLIENT.'/get_image.php?id='; ?>'; +var thumbSrc = '<?php echo LINPHA_CLIENT.'/get_thumb.php?id='; ?>'; var maxImageWidth = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; ?>; var maxImageHeight = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; ?>; var startImgHeight = <?php echo $GLOBALS['linpha']->imgview->img_height; ?>; @@ -11,5 +11,5 @@ var useEffects = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_useeffects']; ?>; </script> -<script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/scriptaculous.js?load=effects,builder"></script> -<script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/js/LinImage.js"> </script> +<script type="text/javascript" language="javascript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/scriptaculous.js?load=effects,builder"></script> +<script type="text/javascript" language="javascript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/LinImage.js"> </script> Modified: trunk/linpha2/templates/default/view_img.html.php =================================================================== --- trunk/linpha2/templates/default/view_img.html.php 2006-11-03 10:02:16 UTC (rev 4619) +++ trunk/linpha2/templates/default/view_img.html.php 2006-11-03 18:58:34 UTC (rev 4620) @@ -30,7 +30,7 @@ <?php echo $tpl->divRoundCorners('top'); ?> <div id="main"> <div id="divloading"> - <img src="<?php echo LINPHA_DIR; ?>/lib/graphics/loading.gif"> + <img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/loading.gif"> </div> <noscript><h1><?php echo i18n("If you have just disabled Javascript, you will need to restart your browser."); ?></h1></noscript> @@ -83,12 +83,12 @@ <div id="divSlideshowControls" style="display: none;"> <div id="divSlideshowControlsInner"> <div style="float: left; margin-left: 10px; "> - <a href="javascript:myLinImage.moveFirst()"><img id="ssImgFirst" src="<?php echo LINPHA_DIR; ?>/lib/graphics/ss_first.gif" width="25" height="25" border="0" alt="First" title="<?php echo i18n("First"); ?>" /></a> - <a href="javascript:myLinImage.movePrev()"><img id="ssImgPrev" src="<?php echo LINPHA_DIR; ?>/lib/graphics/ss_previous.gif" width="25" height="25" border="0" alt="Previous" title="<?php echo i18n("Previous"); ?>" /></a> - <a href="javascript:myLinImage.slideshowStartStop()"><img id="ssImgStart" src="<?php echo LINPHA_DIR; ?>/lib/graphics/ss_play.gif" width="25" height="25" border="0" alt="Play" title="<?php echo i18n("Play/Pause"); ?>" /></a> - <!--<a href="javascript:myLinImage.slideshowStop()"><img id="ssImgStop" src="<?php echo LINPHA_DIR; ?>/lib/graphics/ss_stop.gif" width="25" height="25" border="0" alt="Stop" title="<?php echo i18n("Stop"); ?>" /></a>--> - <a href="javascript:myLinImage.moveNext()"><img id="ssImgNext" src="<?php echo LINPHA_DIR; ?>/lib/graphics/ss_next.gif" width="25" height="25" border="0" alt="Next" title="<?php echo i18n("Next"); ?>" /></a> - <a href="javascript:myLinImage.moveLast()"><img id="ssImgLast" src="<?php echo LINPHA_DIR; ?>/lib/graphics/ss_last.gif" width="25" height="25" border="0" alt="Last" title="<?php echo i18n("Last"); ?>" /></a> + <a href="javascript:myLinImage.moveFirst()"><img id="ssImgFirst" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_first.gif" width="25" height="25" border="0" alt="First" title="<?php echo i18n("First"); ?>" /></a> + <a href="javascript:myLinImage.movePrev()"><img id="ssImgPrev" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_previous.gif" width="25" height="25" border="0" alt="Previous" title="<?php echo i18n("Previous"); ?>" /></a> + <a href="javascript:myLinImage.slideshowStartStop()"><img id="ssImgStart" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_play.gif" width="25" height="25" border="0" alt="Play" title="<?php echo i18n("Play/Pause"); ?>" /></a> + <!--<a href="javascript:myLinImage.slideshowStop()"><img id="ssImgStop" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_stop.gif" width="25" height="25" border="0" alt="Stop" title="<?php echo i18n("Stop"); ?>" /></a>--> + <a href="javascript:myLinImage.moveNext()"><img id="ssImgNext" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_next.gif" width="25" height="25" border="0" alt="Next" title="<?php echo i18n("Next"); ?>" /></a> + <a href="javascript:myLinImage.moveLast()"><img id="ssImgLast" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_last.gif" width="25" height="25" border="0" alt="Last" title="<?php echo i18n("Last"); ?>" /></a> </... [truncated message content] |
From: <fan...@us...> - 2006-11-03 23:02:10
|
Revision: 4621 http://svn.sourceforge.net/linpha/?rev=4621&view=rev Author: fangehrn Date: 2006-11-03 15:01:21 -0800 (Fri, 03 Nov 2006) Log Message: ----------- * startet making linpha includable by other web pages * fixed problem with folder thumbnail on specific imagemagick version Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/index.php trunk/linpha2/index.php trunk/linpha2/install/step2_requirements.php trunk/linpha2/lib/classes/archiver.class.php trunk/linpha2/lib/classes/image/imagemagick/thumbnail_folder.php trunk/linpha2/lib/classes/linpha.class.php trunk/linpha2/lib/classes/linpha.functions.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/modules/module.ajax.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/css/global.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.head.php trunk/linpha2/templates/default/view_thumb.html.php trunk/linpha2/templates/default/view_thumb_static.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/ChangeLog 2006-11-03 23:01:21 UTC (rev 4621) @@ -12,8 +12,50 @@ what about $_POST['cmd'] ...? ooooo * maybe there are broken things now... - + * fixed problem with folder thumbnail on specific imagemagick version + * short howto include linpha in your website: +------- +<?php + /** + * first linpha include, must be before any output startet + */ + define('LINPHA_DIR','./linpha'); // relative path to the linpha folder + //define('LINPHA_LINK','/dev/guggenew/?cat=18'); // optional, link url for browsing + include(LINPHA_DIR.'/index.php'); +?> +<html> +<head> +<?php + /** + * second linpha include, must be in the header part + * (css + javascript definitions) + */ + $GLOBALS['linpha']->template->includeFile('head'); +?> +</head> +<body> +<?php + /** + * optional linpha include for menu and title + */ + echo $linTpl->output['title'].'<br />'; + echo '<div id="menu">'; + $GLOBALS['linpha']->template->printMenus('search,more,icons'); + echo '</div>'; +?> + +<?php + /** + * third linpha include, the main part + */ + $GLOBALS['linpha']->template->includeFile('body'); +?> +</body> +</html> +------- + + 2006-11-02 flo * changed template system: - include all the default files Modified: trunk/linpha2/admin/index.php =================================================================== --- trunk/linpha2/admin/index.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/admin/index.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -7,6 +7,15 @@ include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); + /** + * overwrite LINPHA_LINK because the menu should not point to linpha/admin/ but to linpha/ + * + * this must be after include of linpha.class.php + * and before $linpha = new linpha() + */ + define('LINPHA_LINK', LinFilesys::cleanPath( dirname($_SERVER['PHP_SELF']).'/'.LINPHA_DIR ).'/?' ); + + $linpha = new linpha(); $linpha->sql->startSession(); Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/index.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -1,13 +1,19 @@ <?php -if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','.'); } +if(defined('LINPHA_DIR')) { + define('LINPHA_IS_INCLUDED',1); +} else { + define('LINPHA_DIR','.'); +} + include_once(LINPHA_DIR.'/lib/include/common.php'); /** * some init stuff */ include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); + global $linpha; $linpha = new Linpha(); $linpha->sql->startSession(); Modified: trunk/linpha2/install/step2_requirements.php =================================================================== --- trunk/linpha2/install/step2_requirements.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/install/step2_requirements.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -407,6 +407,7 @@ { echo "<h2>".tr("!!! INSTALLATION ABORTED !!!")."</h2><br />"; echo tr("There was at least one serious error - continue at your own risk"); + echo "<br /><br />"; } include_once(LINPHA_DIR.'/install/footer.php'); Modified: trunk/linpha2/lib/classes/archiver.class.php =================================================================== --- trunk/linpha2/lib/classes/archiver.class.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/lib/classes/archiver.class.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -228,7 +228,7 @@ */ include(LINPHA_DIR.'/lib/classes/archiver.config.php'); - $this->array_path = get_PATH('PATH'); + $this->array_path = LinFunc::get_PATH('PATH'); } function getCommand($ziptype) @@ -283,7 +283,7 @@ * * get_PATH remove directories not allowed by safemode or open_basedir */ - $array_lookfor = get_PATH($this->apps[$app]['look_for']); + $array_lookfor = LinFunc::get_PATH($this->apps[$app]['look_for']); foreach($array_lookfor AS $value) { if(file_exists($value.'/'.$this->apps[$app]['executable'])) Modified: trunk/linpha2/lib/classes/image/imagemagick/thumbnail_folder.php =================================================================== --- trunk/linpha2/lib/classes/image/imagemagick/thumbnail_folder.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/lib/classes/image/imagemagick/thumbnail_folder.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -41,23 +41,23 @@ LinFilesys::linExec("convert ". LinImage::getCachePath('thumb',$value) . " -resize 80x80 ".$tmp_folder."/".$i.".jpg" ); } - LinFilesys::linExec("convert -size 180x180 xc:lemonchiffon -mattecolor peru -frame 9x9+3+3 ".$this->output_file); + LinFilesys::linExec("convert -size 180x180 xc:lemonchiffon -mattecolor peru -frame 9x9+3+3 ".$this->output_file); for($i=1; $i<=count($array_ids); $i++ ) { switch($i) { case 1: - LinFilesys::linExec("composite -geometry +10+10 ".$tmp_folder."/1.jpg ".$this->output_file." ".$this->output_file); + LinFilesys::linExec("composite -compose atop -geometry +10+10 ".$tmp_folder."/1.jpg ".$this->output_file." ".$this->output_file); break; case 2: - LinFilesys::linExec("composite -geometry +100+10 ".$tmp_folder."/2.jpg ".$this->output_file." ".$this->output_file); + LinFilesys::linExec("composite -compose atop -geometry +100+10 ".$tmp_folder."/2.jpg ".$this->output_file." ".$this->output_file); break; case 3: - LinFilesys::linExec("composite -geometry +10+100 ".$tmp_folder."/3.jpg ".$this->output_file." ".$this->output_file); + LinFilesys::linExec("composite -compose atop -geometry +10+100 ".$tmp_folder."/3.jpg ".$this->output_file." ".$this->output_file); break; case 4: - LinFilesys::linExec("composite -geometry +100+100 ".$tmp_folder."/4.jpg ".$this->output_file." ".$this->output_file); + LinFilesys::linExec("composite -compose atop -geometry +100+100 ".$tmp_folder."/4.jpg ".$this->output_file." ".$this->output_file); break; } } Modified: trunk/linpha2/lib/classes/linpha.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.class.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/lib/classes/linpha.class.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -24,24 +24,6 @@ */ if(!defined('LINPHA_DIR')) { exit(1); } -/** - * installation check - */ - if(!isset($_SESSION['installmode2'])) - { - if(! file_exists( LINPHA_DIR.'/var/config.dir.php') ) - { - header('Location: '.LINPHA_CLIENT.'/install/'); - exit(); - } - - if( file_exists( LINPHA_DIR.'/install' ) && !file_exists(LINPHA_DIR.'/install/ignore_delete_install_msg.txt') ) - { - echo "For security reasons, you have to delete the <b>./install</b> folder before you can continue!"; - exit(); - } - } - include_once(LINPHA_DIR.'/lib/classes/linpha.sql.class.php'); include_once(LINPHA_DIR.'/lib/classes/linpha.template.class.php'); @@ -67,35 +49,52 @@ /** * some defines - * @todo if linpha not included, use only folder /linpha2/? as link url */ - if(!defined('LINPHA_LINK')) - { - if( strpos($_SERVER['PHP_SELF'],'index.php') !== false ) + if(!defined('LINPHA_LINK')) { - $new_phpself = substr($_SERVER['PHP_SELF'],0,strlen($_SERVER['PHP_SELF'])-strlen('index.php')); + if( strpos($_SERVER['PHP_SELF'],'index.php') !== false ) + { + $new_phpself = substr($_SERVER['PHP_SELF'],0,strlen($_SERVER['PHP_SELF'])-strlen('index.php')); + } + else + { + $new_phpself = $_SERVER['PHP_SELF']; + } + + + // append '?' to easier append later variables + if( strpos($new_phpself,'?') === false ) + { + define('LINPHA_LINK',$new_phpself.'?'); + } + else + { + define('LINPHA_LINK',$new_phpself); + } } - else + + if(!defined('LINPHA_CLIENT')) { - $new_phpself = $_SERVER['PHP_SELF']; + define('LINPHA_CLIENT', LinFilesys::cleanPath( dirname($_SERVER['PHP_SELF']).'/'.LINPHA_DIR ) ); } - - // append '?' to easier append later variables - if( strpos($new_phpself,'?') === false ) - { - define('LINPHA_LINK',$new_phpself.'?'); - } - else - { - define('LINPHA_LINK',$new_phpself); - } - } - - if(!defined('LINPHA_CLIENT')) - { - define('LINPHA_CLIENT', LinFilesys::cleanPath( dirname($_SERVER['PHP_SELF']).'/'.LINPHA_DIR ) ); - } + /** + * installation check + */ + if(!isset($_SESSION['installmode2'])) + { + if(! file_exists( LINPHA_DIR.'/var/config.dir.php') ) + { + header('Location: '.LINPHA_CLIENT.'/install/'); + exit(); + } + + if( file_exists( LINPHA_DIR.'/install' ) && !file_exists(LINPHA_DIR.'/install/ignore_delete_install_msg.txt') ) + { + echo "For security reasons, you have to delete the <b>./install</b> folder before you can continue!"; + exit(); + } + } } } // end class Linpha Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -25,6 +25,21 @@ /** + * 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) @@ -165,58 +180,83 @@ } /** - * Take care of translation - * - * This simple method takes care of all translation related stuff. - * If option tr_learn is set - all new entries will be autolearned. - * @param string $text phrase/word to translate + * format user inputs and autoformat urls and mailaddresses */ -function i18n($text) +function htmltag($post) { - global $translate; - $tr_learn = true; //autolearn new language entries + $post = htmlspecialchars($post, ENT_QUOTES); - /** - * translation starts here - */ - if(true == isset($translate[$text])) - { - $str = "$translate[$text]"; - } - else - { - $str = "$text"; - } + //###### URL + // the next two parts converts http://linpha.sf.net to [url]http://linpha.sf.net[/url] + // and www.sourceforge.net to [url]http://www.sourceforge.net[/url] + // im the third part converts [url]http://linpha.sf.net[/url] to <a href="http://linpha.sf.net">http://linpha.sf.net</a> - /** - * autolearn new language entries defined by tr() function. - */ - if($tr_learn == true) - { - $tmpfile = LINPHA_DIR."/var/lang.temp.txt"; + // 1. part + // detect url if it is after one of the following signs: ' ', '\r' or '\n' + $post=eregi_replace("([ \r\n])http://([^ ,\r\n]*)","\\1[url]http://\\2[/url]",$post); + $post=eregi_replace("([ \r\n])https://([^ ,\r\n]*)","\\1[url]https://\\2[/url]",$post); + $post=eregi_replace("([ \r\n])ftp://([^ ,\r\n]*)","\\1[url]ftp://\\2[/url]",$post); + $post=eregi_replace("([ \r\n])www\\.([^ ,\r\n]*)","\\1[url]http://www.\\2[/url]",$post); - if(false == file_exists("$tmpfile")) - { - if(false == touch("$tmpfile")) - { - echo "Unable to create ".$tmpfile." - please check permissions"; - } - } - - $filedata = file("$tmpfile"); + // 2. part + // detect url if the url is in the beginning of the string + $post=eregi_replace("^http://([^ ,\r\n]*)","[url]http://\\1[/url]",$post); + $post=eregi_replace("^https://([^ ,\r\n]*)","[url]https://\\1[/url]",$post); + $post=eregi_replace("^ftp://([^ ,\r\n]*)","[url]ftp://\\1[/url]",$post); + $post=eregi_replace("^www\\.([^ ,\r\n]*)","[url]http://www.\\1[/url]",$post); - if(false == in_array($text."\n", $filedata)) - { - $filedata[] = $text."\n"; - natcasesort($filedata); // Sort an array using a case insensitive "natural order" algorithm - file_put_contents($tmpfile, $filedata); - } - } + // 3. part + $post=preg_replace("/\[url\](.*)\[\/url\]/iUms","<a href=\"\\1\" target=_blank>\\1</a>",$post); + $post=preg_replace("/\[url=(.*)\](.*)\[\/url\]/iUms","<a href=\"\\1\" target=_blank>\\2</a>",$post); + //##### + + + // e-mail + $post= eregi_replace('([_a-z0-9-]+(\.[_a-z0-9-]+)*@[_a-z0-9-]+(\.[_a-z]+)+)','<a href="mailto:\\1">\\1</a>',$post); - return $str; + // formatting + $post = str_replace("[hr]","<hr>",$post); + $post=preg_replace("/\[b\](.*)\[\/b\]/iUms","<b>\\1</b>",$post); + $post=preg_replace("/\[i\](.*)\[\/i\]/iUms","<i>\\1</i>",$post); + $post=preg_replace("/\[s\](.*)\[\/s\]/iUms","<strike>\\1</strike>",$post); + $post=preg_replace("/\[u\](.*)\[\/u\]/iUms","<u>\\1</u>",$post); + $post=preg_replace("/\[h1\](.*)\[\/h1\]/iUms","<h1>\\1</h1>",$post); + $post=preg_replace("/\[h2\](.*)\[\/h2\]/iUms","<h2>\\1</h2>",$post); + $post=preg_replace("/\[h3\](.*)\[\/h3\]/iUms","<h3>\\1</h3>",$post); + $post=preg_replace("/\[h4\](.*)\[\/h4\]/iUms","<h4>\\1</h4>",$post); + $post=preg_replace("/\[h5\](.*)\[\/h5\]/iUms","<h5>\\1</h5>",$post); + + + //code + $post=preg_replace("/\[code\](.*)\[\/code\]/msiU", "<blockquote><pre><smallfont><hr>\\1<hr></smallfont></pre></blockquote>", $post); + + // image + $post=preg_replace("/\[img\](.*)\[\/img\]/iUms","<img src=\"\\1\" border=\"0\">",$post); + + // center + $post=preg_replace("/\[center\](.*)\[\/center\]/iUms","<center>\\1</center>",$post); + + // colors + $post=preg_replace("/\[green\](.*)\[\/green\]/iUms","<span style=\"color:green\">\\1</span>",$post); + $post=preg_replace("/\[yellow\](.*)\[\/yellow\]/iUms","<span style=\"color:yellow\">\\1</span>",$post); + $post=preg_replace("/\[red\](.*)\[\/red\]/iUms","<span style=\"color:red\">\\1</span>",$post); + $post=preg_replace("/\[blue\](.*)\[\/blue\]/iUms","<span style=\"color:blue\">\\1</span>",$post); + $post=preg_replace("/\[white\](.*)\[\/white\]/iUms","<span style=\"color:white\">\\1</span>",$post); + $post=preg_replace("/\[black\](.*)\[\/black\]/iUms","<span style=\"color:black\">\\1</span>",$post); + + $post=preg_replace("/\[color=(.*)\](.*)\[\/color\]/iUms","<span style=\"color:\\1\">\\2</span>",$post); + + // <br /> + $post= nl2br($post); -} // end tr() - + return $post; +} + +} // end class LinFunc + + + + /** * print a nice navigation line with links on each entry */ @@ -242,24 +282,7 @@ return $str; } - /** - * LinPHA user logging function - * shows up system info in the browser like "images added" - */ -function linSysLog($str) -{ - if( ! isset( $GLOBALS['linpha']->template->output['sys_log'] ) ) - { - $GLOBALS['linpha']->template->output['sys_log'] = $str; - } - else - { - $GLOBALS['linpha']->template->output['sys_log'] .= '<br />'.$str; - } -} - -/** * functions to create a html select form with all albums */ function buildAlbumSelect($with_all_albs_entry) @@ -340,7 +363,6 @@ return $array; } - /** * we have to use & in links (W3C), but in javascript we cannot use &! */ @@ -350,79 +372,6 @@ } /** -* escape string for use in exec() (especially for convert), not in any other -* function like fopen etc. -* -* @author flo -* @param string $str string to exec -* @return string escape string -* @package filesys -*/ -function linEscapeString($str) -{ - if( LIN_OS == 'win' ) - { - /** - * replace forward slash with backslash, need this for powerarchiver for - * downloading albums, because powerarchiver cannot handle forward - * slashes in paths, does this disturb somewhere?? - */ - $str = str_replace("/","\\",$str); - - /** - * escape string with ("), -> call exec always without (") - * for example: exec('convert "'.escape_string($input).'" "'.escape_string($output).'") is FALSE !!! - * escape with (") because under windows we cannot have double quotes in filenames, in contrast to single quotes! - */ - - $str = '"'.$str.'"'; - } - else - { - /** - * do not escape string with safemode, because if safemode is on, - * strings are escaped automatically - * - * see http://ch.php.net/manual/en/features.safe-mode.functions.php - * exec() You can only execute executables within the - * safe_mode_exec_dir. For practical reasons it's currently not allowed - * to have .. components in the path to the executable. escapeshellcmd() - * is executed on the argument of this function. - */ - - /** - * done: maybe we should this replace with the php builtin function - * escapeshellcmd() - * - * now we should get the same results wether safe mode is on or off - */ - /*$str = str_replace("\\","\\\\",$str); - - //$str = escapeshellcmd($str); - - $array = Array('"','\'','(',')','[',']','{','}','*','?','!','`','=','&','@',' ',':',';'); - - foreach($array AS $value) - { - $str = str_replace($value,'\\'.$value,$str); - }*/ - //} - /** - * what is the better solution: - * 1. convert albums/dir\ with\ spaces/test.jpg tmp/test.jpg - * or - * 2. convert "albums/dir with spaces/test.jpg" "tmp/test.jpg" - * - * 1. negativ: if safemode is on it doesn't work anymore because the - * backslashes are escaped too - */ - $str = str_replace('"','\"',$str); - $str = '"'.$str.'"'; - } - return $str; -} - -/** * some functions to calculate the page rendering time * this is very useful while trying to speed up LinPHA :-) */ @@ -453,9 +402,6 @@ } -$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. @@ -611,13 +557,6 @@ * @param string $severity from notice - fatal error * @param string $text */ -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) @@ -637,13 +576,13 @@ switch($severity) { case LOG_EMERG: $severity_msg = 'EMERGENCY ERROR'; break; - //case LOG_ALERT: $severity_msg = 'ALERT'; break; // same as LOG_EMERG - //case LOG_CRIT: $severity_msg = 'CRITICAL ERROR'; break; // same as LOG_EMERG + case LOG_ALERT: $severity_msg = 'ALERT'; break; + case LOG_CRIT: $severity_msg = 'CRITICAL ERROR'; break; case LOG_ERR: $severity_msg = 'ERROR'; break; case LOG_WARNING: $severity_msg = 'WARNING'; break; case LOG_NOTICE: $severity_msg = 'NOTICE'; break; case LOG_INFO: $severity_msg = 'INFO'; break; - //case LOG_DEBUG: $severity_msg = 'DEBUG'; break; // same as LOG_DEBUG + case LOG_DEBUG: $severity_msg = 'DEBUG'; break; } /** @@ -722,76 +661,146 @@ } /** - * format user inputs and autoformat urls and mailaddresses + * LinPHA user logging function + * shows up system info in the browser like "images added" */ -function htmltag($post) +function linSysLog($str) { - $post = htmlspecialchars($post, ENT_QUOTES); + if( ! isset( $GLOBALS['linpha']->template->output['sys_log'] ) ) + { + $GLOBALS['linpha']->template->output['sys_log'] = $str; + } + else + { + $GLOBALS['linpha']->template->output['sys_log'] .= '<br />'.$str; + } +} + +/** + * Take care of translation + * + * This simple method takes care of all translation related stuff. + * If option tr_learn is set - all new entries will be autolearned. + * @param string $text phrase/word to translate + */ +function i18n($text) +{ + global $translate; + $tr_learn = true; //autolearn new language entries - //###### URL - // the next two parts converts http://linpha.sf.net to [url]http://linpha.sf.net[/url] - // and www.sourceforge.net to [url]http://www.sourceforge.net[/url] - // im the third part converts [url]http://linpha.sf.net[/url] to <a href="http://linpha.sf.net">http://linpha.sf.net</a> + /** + * translation starts here + */ + if(true == isset($translate[$text])) + { + $str = "$translate[$text]"; + } + else + { + $str = "$text"; + } - // 1. part - // detect url if it is after one of the following signs: ' ', '\r' or '\n' - $post=eregi_replace("([ \r\n])http://([^ ,\r\n]*)","\\1[url]http://\\2[/url]",$post); - $post=eregi_replace("([ \r\n])https://([^ ,\r\n]*)","\\1[url]https://\\2[/url]",$post); - $post=eregi_replace("([ \r\n])ftp://([^ ,\r\n]*)","\\1[url]ftp://\\2[/url]",$post); - $post=eregi_replace("([ \r\n])www\\.([^ ,\r\n]*)","\\1[url]http://www.\\2[/url]",$post); + /** + * autolearn new language entries defined by tr() function. + */ + if($tr_learn == true) + { + $tmpfile = LINPHA_DIR."/var/lang.temp.txt"; - // 2. part - // detect url if the url is in the beginning of the string - $post=eregi_replace("^http://([^ ,\r\n]*)","[url]http://\\1[/url]",$post); - $post=eregi_replace("^https://([^ ,\r\n]*)","[url]https://\\1[/url]",$post); - $post=eregi_replace("^ftp://([^ ,\r\n]*)","[url]ftp://\\1[/url]",$post); - $post=eregi_replace("^www\\.([^ ,\r\n]*)","[url]http://www.\\1[/url]",$post); + if(false == file_exists("$tmpfile")) + { + if(false == touch("$tmpfile")) + { + echo "Unable to create ".$tmpfile." - please check permissions"; + } + } + + $filedata = file("$tmpfile"); - // 3. part - $post=preg_replace("/\[url\](.*)\[\/url\]/iUms","<a href=\"\\1\" target=_blank>\\1</a>",$post); - $post=preg_replace("/\[url=(.*)\](.*)\[\/url\]/iUms","<a href=\"\\1\" target=_blank>\\2</a>",$post); - //##### + if(false == in_array($text."\n", $filedata)) + { + $filedata[] = $text."\n"; + natcasesort($filedata); // Sort an array using a case insensitive "natural order" algorithm + file_put_contents($tmpfile, $filedata); + } + } + + return $str; +} // end tr() - // e-mail - $post= eregi_replace('([_a-z0-9-]+(\.[_a-z0-9-]+)*@[_a-z0-9-]+(\.[_a-z]+)+)','<a href="mailto:\\1">\\1</a>',$post); - - // formatting - $post = str_replace("[hr]","<hr>",$post); - $post=preg_replace("/\[b\](.*)\[\/b\]/iUms","<b>\\1</b>",$post); - $post=preg_replace("/\[i\](.*)\[\/i\]/iUms","<i>\\1</i>",$post); - $post=preg_replace("/\[s\](.*)\[\/s\]/iUms","<strike>\\1</strike>",$post); - $post=preg_replace("/\[u\](.*)\[\/u\]/iUms","<u>\\1</u>",$post); - $post=preg_replace("/\[h1\](.*)\[\/h1\]/iUms","<h1>\\1</h1>",$post); - $post=preg_replace("/\[h2\](.*)\[\/h2\]/iUms","<h2>\\1</h2>",$post); - $post=preg_replace("/\[h3\](.*)\[\/h3\]/iUms","<h3>\\1</h3>",$post); - $post=preg_replace("/\[h4\](.*)\[\/h4\]/iUms","<h4>\\1</h4>",$post); - $post=preg_replace("/\[h5\](.*)\[\/h5\]/iUms","<h5>\\1</h5>",$post); - - - //code - $post=preg_replace("/\[code\](.*)\[\/code\]/msiU", "<blockquote><pre><smallfont><hr>\\1<hr></smallfont></pre></blockquote>", $post); - - // image - $post=preg_replace("/\[img\](.*)\[\/img\]/iUms","<img src=\"\\1\" border=\"0\">",$post); - - // center - $post=preg_replace("/\[center\](.*)\[\/center\]/iUms","<center>\\1</center>",$post); - - // colors - $post=preg_replace("/\[green\](.*)\[\/green\]/iUms","<span style=\"color:green\">\\1</span>",$post); - $post=preg_replace("/\[yellow\](.*)\[\/yellow\]/iUms","<span style=\"color:yellow\">\\1</span>",$post); - $post=preg_replace("/\[red\](.*)\[\/red\]/iUms","<span style=\"color:red\">\\1</span>",$post); - $post=preg_replace("/\[blue\](.*)\[\/blue\]/iUms","<span style=\"color:blue\">\\1</span>",$post); - $post=preg_replace("/\[white\](.*)\[\/white\]/iUms","<span style=\"color:white\">\\1</span>",$post); - $post=preg_replace("/\[black\](.*)\[\/black\]/iUms","<span style=\"color:black\">\\1</span>",$post); - - $post=preg_replace("/\[color=(.*)\](.*)\[\/color\]/iUms","<span style=\"color:\\1\">\\2</span>",$post); - - // <br /> - $post= nl2br($post); +/** +* escape string for use in exec() (especially for convert), not in any other +* function like fopen etc. +* +* @author flo +* @param string $str string to exec +* @return string escape string +* @package filesys +*/ +function linEscapeString($str) +{ + if( LIN_OS == 'win' ) + { + /** + * replace forward slash with backslash, need this for powerarchiver for + * downloading albums, because powerarchiver cannot handle forward + * slashes in paths, does this disturb somewhere?? + */ + $str = str_replace("/","\\",$str); - return $post; + /** + * escape string with ("), -> call exec always without (") + * for example: exec('convert "'.escape_string($input).'" "'.escape_string($output).'") is FALSE !!! + * escape with (") because under windows we cannot have double quotes in filenames, in contrast to single quotes! + */ + + $str = '"'.$str.'"'; + } + else + { + /** + * do not escape string with safemode, because if safemode is on, + * strings are escaped automatically + * + * see http://ch.php.net/manual/en/features.safe-mode.functions.php + * exec() You can only execute executables within the + * safe_mode_exec_dir. For practical reasons it's currently not allowed + * to have .. components in the path to the executable. escapeshellcmd() + * is executed on the argument of this function. + */ + + /** + * done: maybe we should this replace with the php builtin function + * escapeshellcmd() + * + * now we should get the same results wether safe mode is on or off + */ + /*$str = str_replace("\\","\\\\",$str); + + //$str = escapeshellcmd($str); + + $array = Array('"','\'','(',')','[',']','{','}','*','?','!','`','=','&','@',' ',':',';'); + + foreach($array AS $value) + { + $str = str_replace($value,'\\'.$value,$str); + }*/ + //} + /** + * what is the better solution: + * 1. convert albums/dir\ with\ spaces/test.jpg tmp/test.jpg + * or + * 2. convert "albums/dir with spaces/test.jpg" "tmp/test.jpg" + * + * 1. negativ: if safemode is on it doesn't work anymore because the + * backslashes are escaped too + */ + $str = str_replace('"','\"',$str); + $str = '"'.$str.'"'; + } + return $str; } + ?> \ No newline at end of file Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -201,7 +201,16 @@ * syslog after loggin in */ $GLOBALS['linpha']->template = new linTemplate(); + global $linTpl; + $linTpl = $GLOBALS['linpha']->template; + + /** + * set idCurrent + * add support for static links + * linpha2/index.php/album1/file.jpg + * will set the correct id + */ if(isset($_GET['id'])) { $GLOBALS['linpha']->template->idCurrent = intval($_GET['id']); @@ -227,8 +236,15 @@ } } - session_name('linpha2'); - session_start(); + /** + * maybe the session is already started + * this should be no problem, hopefully + */ + if (session_id() == '') + { + session_name('linpha2'); + session_start(); + } /** * read cookie Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -60,7 +60,7 @@ */ function includeFile($what) { - global $tpl; + global $linTpl; switch($what) { @@ -176,17 +176,58 @@ * print the whole menu * @uses global.html.php, module.ajax.php */ - function printMenus($comingfrom_ajax=false) + function printMenus($modules,$comingfrom_ajax=false) { - $fragment = 'menu'; - include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); + if(strpos($modules,'home') !== false) + { + $fragment = 'home'; + include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); + } - if($GLOBALS['linpha']->sql->isLoggedIn()) { - echo '<!-- my settings and admin links -->'."\n"; - $this->printMenu("My Settings",LINPHA_LINK."&linCat=settings"); - $this->printMenu("Admin",LINPHA_CLIENT."/admin/"); + if(strpos($modules,'search') !== false) + { + $fragment = 'search'; + include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); } + + if(strpos($modules,'login') !== false) + { + $fragment = 'login'; + include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); + } + + + if(strpos($modules,'more') !== false) + { + if( isset( $this->output['menu_More'] ) ) { + $this->printMenu("More"); + } + } + + if(strpos($modules,'icons') !== false) + { + $fragment = 'icons'; + include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); + } + + + if(strpos($modules,'settings') !== false) + { + if($GLOBALS['linpha']->sql->isLoggedIn()) { + echo '<!-- my settings -->'."\n"; + $this->printMenu("My Settings",LINPHA_LINK."&linCat=settings"); + } + } + + if(strpos($modules,'admin') !== false) + { + if($GLOBALS['linpha']->sql->isLoggedIn()) { + echo '<!-- admin links -->'."\n"; + $this->printMenu("Admin",LINPHA_CLIENT."/admin/"); + } + } + if($comingfrom_ajax && isset($this->output['sys_log']) && !empty($this->output['sys_log'])) { echo '<script language="JavaScript" type="text/javascript">linSyslog("'.$this->output['sys_log'].'");</script>'; Modified: trunk/linpha2/lib/include/basket_build_mail.php =================================================================== --- trunk/linpha2/lib/include/basket_build_mail.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/lib/include/basket_build_mail.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -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 = getMemoryLimit()) === false) +if(($mem_limit = LinFunc::getMemoryLimit()) === false) { $no_mem_limit = true; } Modified: trunk/linpha2/lib/include/basket_build_print.php =================================================================== --- trunk/linpha2/lib/include/basket_build_print.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/lib/include/basket_build_print.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -182,7 +182,7 @@ if($printsettings[$_POST['images']]['show_filenames']) { echo "<br/><font size='-1'>"; - echo cutString(basename($full_filename),15,0); + echo LinFunc::cutString(basename($full_filename),15,0); echo "</font>"; } Modified: trunk/linpha2/lib/js/LinGlobal.js =================================================================== --- trunk/linpha2/lib/js/LinGlobal.js 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/lib/js/LinGlobal.js 2006-11-03 23:01:21 UTC (rev 4621) @@ -5,16 +5,18 @@ */ function linSyslog(text) { - if( $('divSyslogText').innerHTML == '' ) + if( typeof $('divSyslogText') != 'undefined' ) { - $('divSyslogText').innerHTML += text; + if( $('divSyslogText').innerHTML == '' ) + { + $('divSyslogText').innerHTML += text; + } + else + { + $('divSyslogText').innerHTML += '<br />' + text; + } + Element.show('divSyslog'); } - else - { - $('divSyslogText').innerHTML += '<br />' + text; - } - - Element.show('divSyslog'); } function closeSyslog() { @@ -36,7 +38,7 @@ */ function checkAjaxCompatibility() { - new Ajax.Request(LINPHA_CLIENT + '/?linCat=ajax&use_js', {method:'get', asynchronous:true, onSuccess:checkAjaxCompatibilitySuccess} ); + new Ajax.Request(LINPHA_LINK + '&linCat=ajax&use_js', {method:'get', asynchronous:true, onSuccess:checkAjaxCompatibilitySuccess} ); } /** @@ -45,8 +47,11 @@ */ function checkAjaxCompatibilitySuccess(t) { - location.href = document.location; - linSyslog('Ajax enabled'); + if( t.responseText == 'use_js saved' ) + { + location.href = document.location; + linSyslog('Ajax enabled'); + } } function AjaxPost(parameters,successFunction) @@ -73,7 +78,7 @@ } } - new Ajax.Request(xmlUrl + '&id=' + curImgId + '&xml', opt); + new Ajax.Request(xmlUrl + '&id=' + IdCurrent + '&xml', opt); } var menuNeedsUpdating = false; @@ -81,7 +86,7 @@ { if( menuNeedsUpdating ) { - new Ajax.Updater('menu', LINPHA_CLIENT + '/?linCat=ajax&reloadmenu&id='+IdCurrent, {method: 'get', asynchronous:true, evalScripts:true}); + new Ajax.Updater('menu', LINPHA_LINK + '&linCat=ajax&reloadmenu&id='+IdCurrent, {method: 'get', asynchronous:true, evalScripts:true}); menuNeedsUpdating = false; } } Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/lib/js/LinImage.js 2006-11-03 23:01:21 UTC (rev 4621) @@ -284,7 +284,10 @@ /** * set title */ - $('title').innerHTML = xmlDoc[IdCurrent].getElementsByTagName('title').item(0).firstChild.data; + if( typeof $('title') != 'undefined' ) + { + $('title').innerHTML = xmlDoc[IdCurrent].getElementsByTagName('title').item(0).firstChild.data; + } this.enableKeyboardNav(); Modified: trunk/linpha2/lib/modules/module.ajax.php =================================================================== --- trunk/linpha2/lib/modules/module.ajax.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/lib/modules/module.ajax.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -29,7 +29,7 @@ if(isset($_GET['use_js'])) { $_SESSION['use_js'] = true; - echo 'use_js saved'; + echo 'use_js saved'; // if need to change, change also in LinGlobal.js ! } /** @@ -82,7 +82,9 @@ } - $linpha->template->printMenus($comingfrom_ajax=true); + $linpha->template->printMenus('home,search,login,more,icons,settings,admin',$comingfrom_ajax=true); } +exit(); // important if linpha is included from another webpage + ?> \ No newline at end of file Modified: trunk/linpha2/templates/default/basket.html.php =================================================================== --- trunk/linpha2/templates/default/basket.html.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/basket.html.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -1,6 +1,6 @@ <div id="divnavigation"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="navigation"> <?php if(isset($_SESSION['ref_url_full'])) { ?> @@ -10,11 +10,11 @@ <br /><br /> <h1><?php echo i18n("Basket"); ?></h1> <br /> - <form name="basket_checkout" style="margin-right: 2px;" action="<?php echo $tpl->URL_full; ?>" method="POST"> + <form name="basket_checkout" style="margin-right: 2px;" action="<?php echo $linTpl->URL_full; ?>" method="POST"> <h2>1. <?php echo i18n("Select Checkout"); ?></h2> <select name="checkout_as" class="linforms" onchange="document.basket_checkout.submit()"> - <?php echo $tpl->output['select_checkout']; ?> + <?php echo $linTpl->output['select_checkout']; ?> </select> </form> @@ -29,7 +29,7 @@ echo '<h2>2. '.i18n("Download").'</h2>'; echo '<b>'.i18n("Select Type Of Archive").'</b>'; ?> - <form name="zip_selected" action="<?php echo $tpl->URL_full; ?>" method="POST"> + <form name="zip_selected" action="<?php echo $linTpl->URL_full; ?>" method="POST"> <select name="ziptype" class="linforms" size="1"> <?php include_once(LINPHA_DIR.'/lib/classes/archiver.class.php'); @@ -79,7 +79,7 @@ $checked_txt = ''; } ?> - <form name="mail_selected" action="<?php echo $tpl->URL_full; ?>" method="POST"> + <form name="mail_selected" action="<?php echo $linTpl->URL_full; ?>" method="POST"> <table> <tr> <td width="170"><?php echo i18n("Recipient"); ?>:</td> @@ -141,7 +141,7 @@ } } </script> - <form name="print_selected" action="<?php echo $tpl->URL_full; ?>" method="POST" target="_blank"> + <form name="print_selected" action="<?php echo $linTpl->URL_full; ?>" method="POST" target="_blank"> <br/><select name="images" size="1" onchange="update_quality_settings()"> <option value="2">2 <?php echo i18n("Images/Page"); ?></option> <option value="4" selected>4 <?php echo i18n("Images/Page"); ?></option> @@ -168,26 +168,26 @@ ?> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> <div id="divmain"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="main"> <b><?php echo i18n("Images in basket").': '.count($_SESSION['basket_ids']); ?></b><br /><br /> - <form name="basket_remove" action="<?php echo $tpl->URL_full; ?>&cmd=remove_selected" method="POST"> + <form name="basket_remove" action="<?php echo $linTpl->URL_full; ?>&cmd=remove_selected" method="POST"> <?php if( count($_SESSION['basket_ids']) > 0 ) { ?> <?php $i = 1; - foreach($tpl->output['basket_folders'] AS $value) + foreach($linTpl->output['basket_folders'] AS $value) { echo setNavigationLine( $value, LINPHA_LINK.'&linCat=alb&id=' ).'<br />'; - foreach($tpl->output['basket_folder_contents'][$value] AS $sub_value) + foreach($linTpl->output['basket_folder_contents'][$value] AS $sub_value) { ?> <div style='float: left;'> @@ -201,7 +201,7 @@ echo '<div style="clear: both;"></div><br /><br />'; } ?> - <a class="button" href="<?php echo $tpl->URL_full; ?>&cmd=remove_all"><?php echo i18n("Remove all"); ?></a> + <a class="button" href="<?php echo $linTpl->URL_full; ?>&cmd=remove_all"><?php echo i18n("Remove all"); ?></a> <input class="button" type="submit" name="submit" value="<?php echo i18n("Remove selected"); ?>" /> <?php @@ -212,7 +212,7 @@ </form> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> </form> \ No newline at end of file Modified: trunk/linpha2/templates/default/default.html.php =================================================================== --- trunk/linpha2/templates/default/default.html.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/default.html.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -1,11 +1,11 @@ <div id="divmain"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="main"> <?php -echo $tpl->output['default']; +echo $linTpl->output['default']; ?> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/fragments.php =================================================================== --- trunk/linpha2/templates/default/fragments.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/fragments.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -2,11 +2,15 @@ switch($fragment) { -case 'menu': +case 'home': ?> <ul style="margin-left: 50px;"> <li><a href="<?php echo LINPHA_LINK; ?>&linCat=alb"><?php echo i18n("Home"); ?></a></li> </ul> +<?php +break; +case 'search': +?> <ul> <li><span><?php echo i18n("Search"); ?> </span> <ul> @@ -25,6 +29,10 @@ </ul> </li> </ul> +<?php +break; +case 'login': +?> <ul> <li> <span><?php echo i18n("Login"); ?> </span> @@ -55,10 +63,10 @@ </ul> </li> </ul> - <?php if( isset( $this->output['menu_More'] ) ) { - $this->printMenu("More"); - } ?> - +<?php +break; +case 'icons': +?> <!-- icons --> <div> <?php if( isset( $this->output['menu_Icons'] ) ) { Modified: trunk/linpha2/templates/default/global.html.php =================================================================== --- trunk/linpha2/templates/default/global.html.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/global.html.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -1,17 +1,18 @@ <?php +if(!defined('LINPHA_IS_INCLUDED')) { + /** * first output starts here */ -global $tpl; -$tpl = $GLOBALS['linpha']->template; /* @todo */ +global $linTpl; ?> <?php /*header('Content-type: text/html; charset='.$html_charset);*/ ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> -<title><?php echo $tpl->linpha_title; ?></title> +<title><?php echo $linTpl->linpha_title; ?></title> -<?php $tpl->includeFile('head'); ?> +<?php $linTpl->includeFile('head'); ?> </head> @@ -19,20 +20,20 @@ <body id="linBody"> <!-- syslog --> -<div id="divSyslog"<?php if( ! isset($tpl->output['sys_log']) ) { echo ' style="display: none;"'; } ?>> +<div id="divSyslog"<?php if( ! isset($linTpl->output['sys_log']) ) { echo ' style="display: none;"'; } ?>> <div id="divSyslogClose"><a href="javascript:closeSyslog();">X</a></div> <?php echo i18n("Linpha Syslog"); ?>:<br /> - <div id="divSyslogText"><?php echo (isset($tpl->output['sys_log']) ? $tpl->output['sys_log'] : ''); ?></div> + <div id="divSyslogText"><?php echo (isset($linTpl->output['sys_log']) ? $linTpl->output['sys_log'] : ''); ?></div> </div> <!-- title/navigation --> <div id="title"> - <?php echo $tpl->linpha_title." :: ".$tpl->output['title']; ?> + <?php echo $linTpl->linpha_title." :: ".$linTpl->output['title']; ?> </div> <!-- menu --> <div id="menu"> - <?php $tpl->printMenus(); ?> + <?php $linTpl->printMenus('home,search,login,more,icons,settings,admin'); ?> </div> <div style="clear: both;"></div> @@ -40,7 +41,11 @@ -<?php $tpl->includeFile('body'); ?> +<?php $linTpl->includeFile('body'); ?> </body> -</html> \ No newline at end of file +</html> +<?php + +} // end if(!defined('LINPHA_IS_INCLUDED')) +?> \ No newline at end of file Modified: trunk/linpha2/templates/default/home.html.php =================================================================== --- trunk/linpha2/templates/default/home.html.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/home.html.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -1,17 +1,17 @@ <div id="divmain"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="main"> - <?php echo $tpl->output['welcome']; ?> + <?php echo $linTpl->output['welcome']; ?> <br /> <!-- Random Images --> - <?php if( count($tpl->output['random_images']) > 0 ) { ?> + <?php if( count($linTpl->output['random_images']) > 0 ) { ?> <hr /> <h1><?php echo i18n("Random Images"); ?></h1> <?php - foreach($tpl->output['random_images'] AS $key=>$value) + foreach($linTpl->output['random_images'] AS $key=>$value) { ?> <div class="div_random_img"> @@ -26,11 +26,11 @@ <?php } ?> <!-- New Images --> - <?php if( count($tpl->output['new_images']) > 0 ) { ?> + <?php if( count($linTpl->output['new_images']) > 0 ) { ?> <hr /> <h1><?php echo i18n("New Images"); ?></h1> <?php - foreach($tpl->output['new_images'] AS $key=>$value) + foreach($linTpl->output['new_images'] AS $key=>$value) { ?> <div class="div_new_img"> @@ -48,9 +48,9 @@ <!-- Browse by Date --> <?php if($GLOBALS['linpha']->sql->config->value['sys_style_home_showbrowsebydate'] && - !empty($tpl->output['browse_by_date'])) { + !empty($linTpl->output['browse_by_date'])) { echo "<hr />"; - echo i18n("Browse by Date").': '.$tpl->output['browse_by_date']; + echo i18n("Browse by Date").': '.$linTpl->output['browse_by_date']; echo "<br />"; } ?> @@ -65,7 +65,7 @@ { ?> <div class="div_folder"> - <?php echo $tpl->divRoundCorners('top','','albums'); ?> + <?php echo $linTpl->divRoundCorners('top','','albums'); ?> <?php echo '<a href="'.LINPHA_LINK.'&linCat=alb&id='.$value['id'].'">' . '<img class="img_folder_thumbnail" src="'. LINPHA_CLIENT.'/get_thumb.php?id=' .$value['id'] .'" alt="thumbnail_album" /></a>'; ?> @@ -80,11 +80,11 @@ </div> - <?php echo $tpl->divRoundCorners('bottom','','albums'); ?> + <?php echo $linTpl->divRoundCorners('bottom','','albums'); ?> </div> <?php } ?> <?php } ?> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/search.html.php =================================================================== --- trunk/linpha2/templates/default/search.html.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/search.html.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -14,10 +14,10 @@ <font size="+1"><?php echo i18n("LinPHA Search Page"); ?></font> <hr noshade> <?php -if(isset($tpl->output['search_error'])) +if(isset($linTpl->output['search_error'])) { echo '<div align="center"><b>'; - switch($tpl->output['search_error']) + switch($linTpl->output['search_error']) { case 1: echo i18n("Search string to short, must be at least 2 characters long!"); break; case 2: echo i18n("Error, please check input!"); break; @@ -26,7 +26,7 @@ } ?> <div id="divmain"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="main"> @@ -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->themeFile('images/expand.gif'); ?>" /></a> + <a href="javascript:div_expand('div_<?php echo $meta_type; ?>');"><img border="0" src="<?php echo $linTpl->themeFile('images/expand.gif'); ?>" /></a> <br /> <div id="div_<?php echo $meta_type; ?>" style="border: 1px solid black; width: 200px;"> <?php @@ -228,7 +228,7 @@ </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> <script language="JavaScript" type="text/javascript"> Modified: trunk/linpha2/templates/default/themes/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/global.css 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/themes/default/css/global.css 2006-11-03 23:01:21 UTC (rev 4621) @@ -231,7 +231,7 @@ z-index: 500; border: 0; - background: #eeeeee; + background-color: #eeeeee; /** * relativ to parent element! be careful @@ -253,9 +253,6 @@ border-color: #ccc #888 #555 #bbb; text-align: left; } - #menu ul ul span { - background: #eeeeee url(../images/expand.gif) no-repeat 100% 100%; - } /** * third stage, switch to horizontal menu entries Modified: trunk/linpha2/templates/default/view_albcomment.html.php =================================================================== --- trunk/linpha2/templates/default/view_albcomment.html.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/view_albcomment.html.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -1,19 +1,19 @@ <div id="divmain"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="main"> - <form action="<?php echo $tpl->URL_full; ?>" method="POST"> + <form action="<?php echo $linTpl->URL_full; ?>" method="POST"> Author: - <input type="text" name="author" value="<?php echo $tpl->output['comment_author']; ?>" size="40" maxlength="255" /> + <input type="text" name="author" value="<?php echo $linTpl->output['comment_author']; ?>" size="40" maxlength="255" /> <br /> - <textarea name="comment" rows="10" cols="50"><?php echo $tpl->output['comment_text']; ?></textarea> + <textarea name="comment" rows="10" cols="50"><?php echo $linTpl->output['comment_text']; ?></textarea> <br /> <input type="hidden" name="cmd" value="add_comment" /> - <a class="button" href="<?php echo $tpl->URL_full.'&view=thumb'; ?>">back</a> + <a class="button" href="<?php echo $linTpl->URL_full.'&view=thumb'; ?>">back</a> <input type="submit" class="button" name="submit" value="submit" /> </form> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_basket.html.php =================================================================== --- trunk/linpha2/templates/default/view_basket.html.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/view_basket.html.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -1,32 +1,32 @@ <div id="divnavigation"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="navigation"> <?php - if(isset($tpl->output['navigation']) && !empty($tpl->output['navigation'])) + if(isset($linTpl->output['navigation']) && !empty($linTpl->output['navigation'])) { - echo $tpl->output['navigation'].'<br /><br />'; + echo $linTpl->output['navigation'].'<br /><br />'; } ?> - <a href="<?php echo $tpl->URL_full.'&view=thumb'; ?>"><?php echo i18n("Back To Normal View"); ?></a> + <a href="<?php echo $linTpl->URL_full.'&view=thumb'; ?>"><?php echo i18n("Back To Normal View"); ?></a> <br /> <?php echo i18n("Images In Basket"); ?>: <?php echo count($_SESSION['basket_ids']); ?> (<a href="<?php echo LINPHA_LINK.'&linCat=basket&ref_id='.$GLOBALS['linpha']->template->idCurrent; ?>"><?php echo i18n("Open Basket"); ?></a>) </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> <div id="divmain"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="divpage_nr"> <div id="page_nr"> - <div id="page_nr_left" class="page_nr_divs"><?php echo $tpl->output['page_nr_left']; ?></div> - <div id="page_nr_middle" class="page_nr_divs page_nr_maindiv"><?php echo $tpl->output['page_nr']; ?></div> - <div id="page_nr_right" class="page_nr_divs"><?php echo $tpl->output['page_nr_right']; ?></div> + <div id="page_nr_left" class="page_nr_divs"><?php echo $linTpl->output['page_nr_left']; ?></div> + <div id="page_nr_middle" class="page_nr_divs page_nr_maindiv"><?php echo $linTpl->output['page_nr']; ?></div> + <div id="page_nr_right" class="page_nr_divs"><?php echo $linTpl->output['page_nr_right']; ?></div> </div> </div> @@ -111,5 +111,5 @@ </script> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_img.head.php =================================================================== --- trunk/linpha2/templates/default/view_img.head.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/view_img.head.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -1,6 +1,6 @@ <script language="JavaScript" type="text/javascript"> -var xmlUrl = '<?php echo str_replace(LINPHA_LINK,LINPHA_CLIENT.'/?',convert_amp($tpl->URL_base)); ?>'; +var xmlUrl = '<?php echo convert_amp($linTpl->URL_base); ?>'; var imageSrc = '<?php echo LINPHA_CLIENT.'/get_image.php?id='; ?>'; var thumbSrc = '<?php echo LINPHA_CLIENT.'/get_thumb.php?id='; ?>'; var maxImageWidth = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; ?>; Modified: trunk/linpha2/templates/default/view_img.html.php =================================================================== --- trunk/linpha2/templates/default/view_img.html.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/view_img.html.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -1,20 +1,20 @@ <!-- navigation --> -<?php if(isset($tpl->output['navigation']) && !empty($tpl->output['navigation'])) { ?> +<?php if(isset($linTpl->output['navigation']) && !empty($linTpl->output['navigation'])) { ?> <div id="divnavigation"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="navigation"> - <?php echo $tpl->output['navigation']; ?> + <?php echo $linTpl->output['navigation']; ?> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> <?php } ?> <!-- thumbnails --> <div id="divthumbnavi"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="thumbnavi"> <div id="thumbnavi_prevthumb"></div> @@ -22,12 +22,12 @@ <div id="thumbnavi_nextthumb"></div> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> <!-- main --> <div id="divmain"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="main"> <div id="divloading"> <img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/loading.gif"> @@ -75,7 +75,7 @@ <div id="divcomments" class="comments"></div> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> @@ -120,7 +120,7 @@ <div style="clear: both;"></div> </div> - <?php echo $tpl->divRoundCorners('bottom','alpha'); ?> + <?php echo $linTpl->divRoundCorners('bottom','alpha'); ?> </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-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/view_img_static.html.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -1,42 +1,42 @@ <!-- navigation --> -<?php if(isset($tpl->output['navigation']) && !empty($tpl->output['navigation'])) { ?> +<?php if(isset($linTpl->output['navigation']) && !empty($linTpl->output['navigation'])) { ?> <div id="divnavigation"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="navigation"> - <?php echo $tpl->output['navigation']; ?> + <?php echo $linTpl->output['navigation']; ?> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> <?php } ?> <!-- thumbnails --> <div id="divthumbnavi"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="thumbnavi"> <div id="thumbnavi_prevthumb"> - <?php echo $tpl->output['prev_thumb']; ?> + <?php echo $linTpl->output['prev_thumb']; ?> </div> <div id="thumbnavi_currentthumb"> - <?php echo $tpl->output['current_thumb']; ?> + <?php echo $linTpl->output['current_thumb']; ?> </div> <div id="thumbnavi_nextthumb"> - <?php echo $tpl->output['next_thumb']; ?> + <?php echo $linTpl->output['next_thumb']; ?> </div> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> <div id="divmain"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="main"> <?php if($_SESSION['mode_imageview']=='meta') { ?> <!-- edit meta data - include view_meta.html --> - <?php include_once(LINPHA_DIR.'/templates/'.$tpl->template_name.'/view_meta.html.php'); + <?php include_once(LINPHA_DIR.'/templates/'.$linTpl->template_name.'/view_meta.html.php'); } else { ?> <!-- show image --> @@ -51,7 +51,7 @@ <?php if($GLOBALS['linpha']->sql->checkPermission('metadata_comments')) { ?> <!-- show add comment form --> <div class="add_comment"> - <form action="<?php echo $tpl->URL_full; ?>" method="POST"> + <form action="<?php echo $linTpl->URL_full; ?>" method="POST"> <?php echo i18n("Add Comment"); ?>:<br /> <div id="divAddCommentText"> <input type="text" id="inputAddCommentText" class="linforms" name="inputAddCommentText" value="" tabindex="1" style="width: 300px" /> @@ -80,7 +80,7 @@ <!-- show image comments --> <div class="comments"> - <?php while($data = $tpl->output['image_comments']->FetchRow()) { ?> + <?php while($data = $linTpl->output['image_comments']->FetchRow()) { ?> <?php echo linStrftime($data['meta_time']).' '.i18n("by").' '.htmlspecialchars($data['meta_author'],ENT_QUOTES); ?> <hr /> <?php echo htmlspecialchars($data['meta_comment'],ENT_QUOTES); ?> @@ -91,18 +91,18 @@ <?php } /* end if view!=meta */ ?> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> <div id="divright"> - <?php echo $tpl->divRoundCorners('top'); ?> + <?php echo $linTpl->divRoundCorners('top'); ?> <div id="right"> <?php - foreach($tpl->output['image_infos'] AS $value) + foreach($linTpl->output['image_infos'] AS $value) { echo $value['name'].': '.$value['value'].'<br />'; } ?> </div> - <?php echo $tpl->divRoundCorners('bottom'); ?> + <?php echo $linTpl->divRoundCorners('bottom'); ?> </div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_meta.html.php =================================================================== --- trunk/linpha2/templates/default/view_meta.html.php 2006-11-03 18:58:34 UTC (rev 4620) +++ trunk/linpha2/templates/default/view_meta.html.php 2006-11-03 23:01:21 UTC (rev 4621) @@ -10,7 +10,7 @@ width: 300px; } </style> -<a href="<?php echo $tpl->URL_full.'&view=img'; ?>">Back to normal view</a> +<a href="<?php echo $linTpl->URL_full.'&view=img'; ?>">Back to normal view</a> <h1><?php i18n("Edit Image Imformation"); ?></h1> <?php @@ -26,12 +26,12 @@ "WHERE flags = '5' OR flags = '7' ORDER by id"); ?> -<form action="<?php echo $tpl->URL_full; ?>" method="POST"> +<form action="<?php echo $linTpl->URL_full; ?>" method="POST"> <table border='1'> <tr> <td width="150"><b><?php i18n("Name"); ?></b></td> <td width="200"><b><?php i18n("Value"); ?></b></td> - <td rowspan="<?php echo $num_query['0']+1; ?>"><?php echo $tpl... [truncated message content] |
From: <fan...@us...> - 2006-11-05 13:44:39
|
Revision: 4622 http://svn.sourceforge.net/linpha/?rev=4622&view=rev Author: fangehrn Date: 2006-11-05 05:43:49 -0800 (Sun, 05 Nov 2006) Log Message: ----------- 2006-11-05 flo * change the linpha2/?id to linpha2/?linId * reorganized javascript classes and functions there should be now no problem when including from other websites * testing a new way of updating the menu using this javascript code 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 Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/permissions_groups.php trunk/linpha2/admin/permissions_readwrite.php trunk/linpha2/admin/permissions_usergroup.php trunk/linpha2/admin/permissions_users.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_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.ajax.php trunk/linpha2/lib/modules/module.albums.php trunk/linpha2/lib/modules/module.browse.php trunk/linpha2/lib/modules/module.filemanager.php trunk/linpha2/lib/modules/module.newimg.php trunk/linpha2/lib/modules/module.search.php trunk/linpha2/linpha2.specs.txt trunk/linpha2/templates/default/basket.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/themes/default/DefsThumbView.js 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_thumb.head.php trunk/linpha2/templates/default/view_thumb_static.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-11-03 23:01:21 UTC (rev 4621) +++ trunk/linpha2/ChangeLog 2006-11-05 13:43:49 UTC (rev 4622) @@ -1,3 +1,12 @@ +2006-11-05 flo + * change the linpha2/?id to linpha2/?linId + * reorganized javascript classes and functions + there should be now no problem when including from other websites + * testing a new way of updating the menu using this javascript code + 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 + 2006-11-03 flo * startet making linpha includable by other web pages - introduced new constants: Modified: trunk/linpha2/admin/permissions_groups.php =================================================================== --- trunk/linpha2/admin/permissions_groups.php 2006-11-03 23:01:21 UTC (rev 4621) +++ trunk/linpha2/admin/permissions_groups.php 2006-11-05 13:43:49 UTC (rev 4622) @@ -108,7 +108,7 @@ <?php } ?> </form> - <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=group&id='.$data['id']; ?>"> + <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=group&linId='.$data['id']; ?>"> <input type="submit" value="<?php echo i18n("Edit Group Members"); ?>" style="float: left;"> </form> </td> Modified: trunk/linpha2/admin/permissions_readwrite.php =================================================================== --- trunk/linpha2/admin/permissions_readwrite.php 2006-11-03 23:01:21 UTC (rev 4621) +++ trunk/linpha2/admin/permissions_readwrite.php 2006-11-05 13:43:49 UTC (rev 4622) @@ -215,7 +215,7 @@ ?> <br /> <?php echo i18n("Permission Set"); ?>: <b><?php echo getReadablePerms($perm); ?></b> - (<a href="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id='.$parent_id.'&cmd=edit&id='.$parent_id; ?>">change</a>) + (<a href="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id='.$parent_id.'&cmd=edit&linId='.$parent_id; ?>">change</a>) <br /><br /> <table border='1'> <tr> @@ -288,11 +288,11 @@ if($i != 0) { - echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_'.$GLOBALS['cat2'].'&parent_id='.$GLOBALS['parent_id'].'&cmd=edit&id='.$data['id'].'">add</a>'; + echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_'.$GLOBALS['cat2'].'&parent_id='.$GLOBALS['parent_id'].'&cmd=edit&linId='.$data['id'].'">add</a>'; } else { - echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_'.$GLOBALS['cat2'].'&parent_id='.$GLOBALS['parent_id'].'&cmd=edit&id='.$data['id'].'">change</a>'; + echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_'.$GLOBALS['cat2'].'&parent_id='.$GLOBALS['parent_id'].'&cmd=edit&linId='.$data['id'].'">change</a>'; } echo '</td></tr>'; Modified: trunk/linpha2/admin/permissions_usergroup.php =================================================================== --- trunk/linpha2/admin/permissions_usergroup.php 2006-11-03 23:01:21 UTC (rev 4621) +++ trunk/linpha2/admin/permissions_usergroup.php 2006-11-05 13:43:49 UTC (rev 4622) @@ -8,7 +8,7 @@ $query = $linpha->db->Execute("SELECT id, group_name FROM ".PREFIX."groups ORDER by group_name"); while($data = $query->FetchRow()) { - echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=group&id='.$data['id'].'">'.$data['group_name'].'</a><br />'; + echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=group&linId='.$data['id'].'">'.$data['group_name'].'</a><br />'; } echo '<br /><br />'; @@ -20,7 +20,7 @@ $query = $linpha->db->Execute("SELECT id, username FROM ".PREFIX."users ORDER by username"); while($data = $query->FetchRow()) { - echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=user&id='.$data['id'].'">'.$data['username'].'</a><br />'; + echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=user&linId='.$data['id'].'">'.$data['username'].'</a><br />'; } ?> <br /><hr /><br /> @@ -102,7 +102,7 @@ * get all groups/users */ ?> - <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit='.$_GET['edit'].'&id='.$linpha->template->idCurrent; ?>"> + <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit='.$_GET['edit'].'&linId='.$linpha->template->idCurrent; ?>"> <select name="usergroup[]" size="5" style="width: 200;" multiple="multiple"> <?php $query = $linpha->db->Execute("SELECT id, ".$other_select_name." " . Modified: trunk/linpha2/admin/permissions_users.php =================================================================== --- trunk/linpha2/admin/permissions_users.php 2006-11-03 23:01:21 UTC (rev 4621) +++ trunk/linpha2/admin/permissions_users.php 2006-11-05 13:43:49 UTC (rev 4622) @@ -165,7 +165,7 @@ <input type="submit" value="<?php echo i18n("Modify User"); ?>" style="float: left;"> </form> - <form name="edit_groups" method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=user&id='.$data['id']; ?>"> + <form name="edit_groups" method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=user&linId='.$data['id']; ?>"> <input type="submit" name="edit_groups" value="<?php echo i18n("Edit Groups"); ?>" style="float: left;"> </form> Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-03 23:01:21 UTC (rev 4621) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-05 13:43:49 UTC (rev 4622) @@ -49,7 +49,7 @@ /** - * set current view and set fileinfos of $GLOBALS['linpha']->template->idCurrent ($_GET['id']) + * set current view and set fileinfos of $GLOBALS['linpha']->template->idCurrent ($_GET['linId']) * @param string $modulname (album, browse, search, ...) */ function setCurrentView($modulename) @@ -288,7 +288,7 @@ array( 'name' => i18n("Permissions"), 'value' => array( - array('name' => i18n("Set Permissions"), 'value' => LINPHA_CLIENT.'/admin/?cat=permissions_view&cmd=edit&id='.$GLOBALS['linpha']->template->idCurrent) + array('name' => i18n("Set Permissions"), 'value' => LINPHA_CLIENT.'/admin/?cat=permissions_view&cmd=edit&linId='.$GLOBALS['linpha']->template->idCurrent) ) ); @@ -340,13 +340,13 @@ $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectsizes']); foreach($array AS $value) { - $array_tn_sizes_links[] = array('name' => $value.' '.i18n("Pixel"), 'value' => 'javascript:set_tn_size('.$value.')'); + $array_tn_sizes_links[] = array('name' => $value.' '.i18n("Pixel"), 'value' => 'javascript:myLinThumbnails.setTnSize('.$value.')'); } $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectnrimages']); foreach($array AS $value) { - $array_nr_links[] = array('name' => $value, 'value' =>"javascript:set_nr_images('".$value."')"); + $array_nr_links[] = array('name' => $value, 'value' =>"javascript:myLinThumbnails.setNrImages('".$value."')"); } $array_views_links[] = array('name' => i18n("Normal"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=thumb'); @@ -378,7 +378,7 @@ { $GLOBALS['linpha']->template->output['menu_More']['edit']['name'] = i18n("Edit"); $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['name'] = i18n("Open Filemanager"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&id='.$this->id_parent; + $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&linId='.$this->id_parent; } if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) @@ -410,15 +410,15 @@ array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), array('name' => i18n("View at"), 'value' => array( - array('name' => '640x480', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=640&height=480', 'target' => '_blank'), - array('name' => '800x600', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=800&height=600', 'target' => '_blank'), - array('name' => '1024x768', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1024&height=768', 'target' => '_blank'), - array('name' => '1280x800', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=800', 'target' => '_blank'), - array('name' => '1280x960', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=960', 'target' => '_blank'), - array('name' => '1280x1024', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=1024', 'target' => '_blank'), - array('name' => '1600x1200', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1600&height=1200', 'target' => '_blank'), - array('name' => '1920x1200', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1920&height=1200', 'target' => '_blank'), - array('name' => $this->org_width.'x'.$this->org_height.' '.i18n("Fullscreen").')', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width='.$this->org_width.'&height='.$this->org_height, 'target' => '_blank'), + array('name' => '640x480', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=640&height=480', 'target' => '_blank'), + array('name' => '800x600', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=800&height=600', 'target' => '_blank'), + array('name' => '1024x768', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1024&height=768', 'target' => '_blank'), + array('name' => '1280x800', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=800', 'target' => '_blank'), + array('name' => '1280x960', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=960', 'target' => '_blank'), + array('name' => '1280x1024', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=1024', 'target' => '_blank'), + array('name' => '1600x1200', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1600&height=1200', 'target' => '_blank'), + array('name' => '1920x1200', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1920&height=1200', 'target' => '_blank'), + array('id' => 'linLiViewAtFullscreen', 'name' => $this->org_width.'x'.$this->org_height.' ('.i18n("Fullscreen").')', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width='.$this->org_width.'&height='.$this->org_height, 'target' => '_blank'), ) ) ) @@ -438,7 +438,7 @@ { $GLOBALS['linpha']->template->output['menu_More']['edit']['name'] = i18n("Edit"); $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['name'] = i18n("Open Filemanager"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&id='.$this->id_parent; + $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&linId='.$this->id_parent; } @@ -488,7 +488,7 @@ * slideshow icon */ if( useAjax() ) { - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="javascript:slideshowStartFromThumbview()">'. + $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"; } @@ -665,7 +665,7 @@ * this is a normal javascript array * just another kind of definition... */ - $GLOBALS['linpha']->template->output['files_db'] = 'var img_ids = ['."\n"; + $GLOBALS['linpha']->template->output['files_db'] = 'var linImgIds = ['."\n"; if($this->tot_photos > 0) // check if not all entries were folders { foreach($this->photos_filtered AS $key=>$value) @@ -846,7 +846,7 @@ { if($value['img_type'] == 0) { - $GLOBALS['linpha']->template->output['navigation'] .= '<a href="'.LINPHA_LINK.'&linCat=alb&id='.$value['id'].'">'.$value['name'].'</a><br />'; + $GLOBALS['linpha']->template->output['navigation'] .= '<a href="'.LINPHA_LINK.'&linCat=alb&linId='.$value['id'].'">'.$value['name'].'</a><br />'; $nr_folders++; } } @@ -1116,7 +1116,7 @@ <imgwidth><?php echo $this->org_width; ?></imgwidth> <imgheight><?php echo $this->org_height; ?></imgheight> <imgnr><?php printf(i18n("Image %s of %s"),$this->current_key+1,count($this->photos_filtered)); ?></imgnr> -<title><?php echo str_replace('<','<',$GLOBALS['linpha']->template->linpha_title." :: ".$GLOBALS['linpha']->template->output['title']); ?></title> +<title><?php /* oh, what an evil hack */ echo str_replace('<','<',$GLOBALS['linpha']->template->linpha_title." :: ".$GLOBALS['linpha']->template->output['title']); ?></title> <?php if(isset($this->xmldata['prev_thumb'])) { foreach($this->xmldata['prev_thumb'] AS $value) @@ -1289,8 +1289,8 @@ $name = $this->photos_filtered[$key]['name']; $str = '<div class="thumbnavi_'.$class.'thumb">' - . '<a href="'.$GLOBALS['linpha']->template->URL_base.'&id='.$id.'">' - . '<img class="img_'.$class.'thumb" src="'.LINPHA_CLIENT.'/get_thumb.php?id='.$id.'" /></a>' + . '<a href="'.$GLOBALS['linpha']->template->URL_base.'&linId='.$id.'">' + . '<img class="img_'.$class.'thumb" src="'.LINPHA_CLIENT.'/get_thumb.php?linId='.$id.'" /></a>' . '<br />'.$name.'</div>'."\n"; return $str; Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-03 23:01:21 UTC (rev 4621) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-05 13:43:49 UTC (rev 4622) @@ -211,9 +211,9 @@ * linpha2/index.php/album1/file.jpg * will set the correct id */ - if(isset($_GET['id'])) + if(isset($_GET['linId'])) { - $GLOBALS['linpha']->template->idCurrent = intval($_GET['id']); + $GLOBALS['linpha']->template->idCurrent = intval($_GET['linId']); } else { Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-03 23:01:21 UTC (rev 4621) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-05 13:43:49 UTC (rev 4622) @@ -127,12 +127,13 @@ <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 startIdCurrent = <?php echo $this->idCurrent; ?>; var IdCurrent = startIdCurrent; <?php if(! isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax'])) { - echo "checkAjaxCompatibility();"; + echo "myLinGlobal.checkAjaxCompatibility();"."\n"; } ?> </script> @@ -230,7 +231,7 @@ if($comingfrom_ajax && isset($this->output['sys_log']) && !empty($this->output['sys_log'])) { - echo '<script language="JavaScript" type="text/javascript">linSyslog("'.$this->output['sys_log'].'");</script>'; + echo '<script language="JavaScript" type="text/javascript">myLinGlobal.linSyslog("'.$this->output['sys_log'].'");</script>'; } } @@ -256,7 +257,7 @@ { echo "\t".'<li><span>'.i18n($index).' </span>'."\n"; } - echo "\n".'<ul id="menu'.$index.'" onmouseover="reloadMenu()">'."\n"; + echo "\n".'<ul id="menu'.$index.'" onmouseover="myLinGlobal.reloadMenu()">'."\n"; foreach($GLOBALS['linpha']->template->output['menu_'.$index] AS $key=>$value) { @@ -267,7 +268,14 @@ } else { $target_str = ''; } - echo "\t".'<li><a href="'.$value['value'].'"'.$target_str.'>'.$value['name'].'</a></li>'."\n"; + + if(isset($value['id'])) { + $id_str = ' id="'.$value['id'].'"'; + } else { + $id_str = ''; + } + + echo "\t".'<li'.$id_str.'><a href="'.$value['value'].'"'.$target_str.'>'.$value['name'].'</a></li>'."\n"; } else { @@ -284,7 +292,14 @@ } else { $target_str = ''; } - echo "\t\t".'<li><a href="'.$sub_value['value'].'"'.$target_str.'>'.$sub_value['name'].'</a></li>'."\n"; + + if(isset($sub_value['id'])) { + $id_str = ' id="'.$sub_value['id'].'"'; + } else { + $id_str = ''; + } + + echo "\t\t".'<li'.$id_str.'><a href="'.$sub_value['value'].'"'.$target_str.'>'.$sub_value['name'].'</a></li>'."\n"; } else { @@ -294,15 +309,20 @@ foreach($sub_value['value'] AS $subsub_value) { - - if(isset($subsub_value['target'])) { $target_str = ' target="'.$subsub_value['target'].'"'; } else { $target_str = ''; } - echo "\t\t\t".'<li><a href="'.$subsub_value['value'].'"'.$target_str.'>'.$subsub_value['name'].'</a></li>'."\n"; + if(isset($subsub_value['id'])) { + $id_str = ' id="'.$subsub_value['id'].'"'; + } else { + $id_str = ''; + } + + echo "\t\t\t".'<li'.$id_str.'><a href="'.$subsub_value['value'].'"'.$target_str.'>'.$subsub_value['name'].'</a></li>'."\n"; + } echo "\t\t".'</ul>'."\n"; Modified: trunk/linpha2/lib/include/basket_build_print.php =================================================================== --- trunk/linpha2/lib/include/basket_build_print.php 2006-11-03 23:01:21 UTC (rev 4621) +++ trunk/linpha2/lib/include/basket_build_print.php 2006-11-05 13:43:49 UTC (rev 4622) @@ -174,7 +174,7 @@ echo "\n\t\t".'<td width="'.$print_w.'" height="'.$print_h.'">'; echo '<img width="'.$img_w.'" height="'.$img_h.'" '. 'src="'.LINPHA_CLIENT.'/get_image.php?'. - 'id='.$image_id.'&'. + 'linId='.$image_id.'&'. 'width='.$nw.'&'. 'height='.$nh.'&'. ($_POST['l_or_h_quality'] == 'h' ? "quality=80&" : ''). // if high quality selected, set quality to 80 (anything higher than 80 isn't meaningful), if low quality selected, no quality is given, and so get_thumbs_on_fly.php takes the default quality Modified: trunk/linpha2/lib/js/LinGlobal.js =================================================================== --- trunk/linpha2/lib/js/LinGlobal.js 2006-11-03 23:01:21 UTC (rev 4621) +++ trunk/linpha2/lib/js/LinGlobal.js 2006-11-05 13:43:49 UTC (rev 4622) @@ -1,145 +1,213 @@ /** - * dynamically open syslog - * used in ajax context + * class and global definitions */ -function linSyslog(text) +var LinGlobal = Class.create(); +var myLinGlobal; + +LinGlobal.prototype = { - if( typeof $('divSyslogText') != 'undefined' ) + /** + * initialize() + * Constructor runs on completion of the DOM loading. + */ + initialize: function() { - if( $('divSyslogText').innerHTML == '' ) + this.menuNeedsUpdating = false; + + this.linInnerWidth = 0; + this.linInnerHeight = 0; + this.linPageXOffset = 0; + this.linPageYOffset = 0; + }, + + /** + * dynamically open syslog + * used in ajax context + */ + linSyslog: function(text) + { + if( typeof $('divSyslogText') != 'undefined' ) { - $('divSyslogText').innerHTML += text; + if( $('divSyslogText').innerHTML == '' ) + { + $('divSyslogText').innerHTML += text; + } + else + { + $('divSyslogText').innerHTML += '<br />' + text; + } + + this.setScrollSize(); + $('divSyslog').style.top = this.linPageYOffset + 15; + $('divSyslog').style.left = this.linPageXOffset + 15; + Element.show('divSyslog'); } + }, + closeSyslog: function() + { + $('divSyslogText').innerHTML = ''; + Element.hide('divSyslog'); + }, + + /** + * check ajax compatibilty + * will be on every page view until it was successfully + * then, the page will be reloaded + * + * use this on every page and not only on home page, because if user is linked directly to an image + * + * ajax may be disabled with ./?linCat=ajax&disable_ajax + * and may be re-enabled with ./?linCat=ajax&enable_ajax + * + * http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request + */ + checkAjaxCompatibility: function() + { + new Ajax.Request(LINPHA_LINK + '&linCat=ajax&use_js', {method:'get', asynchronous:true, onSuccess:myLinGlobal.checkAjaxCompatibilitySuccess} ); + }, + + /** + * reload page, now with ajax activated + * will be called if the request in checkAjaxCompatibility() was successfully + */ + checkAjaxCompatibilitySuccess: function(t) + { + if( t.responseText == 'use_js saved' ) + { + location.href = document.location; + this.linSyslog('Ajax enabled'); + } + }, + + AjaxPost: function(parameters,successFunction) + { + var opt = { + // Use POST + method: 'post', + // Send this lovely data + postBody: parameters + , + // asynchron, of course + asynchronous:true, + + // Handle successful response + onSuccess: successFunction, + + // Handle 404 + on404: function(t) { + alert('Error 404: location "' + t.statusText + '" was not found.'); + }, + // Handle other errors + onFailure: function(t) { + alert('Error ' + t.status + ' -- ' + t.statusText); + } + } + + new Ajax.Request(xmlUrl + '&linId=' + IdCurrent + '&xml', opt); + }, + + reloadMenu: function() + { + if( this.menuNeedsUpdating ) + { + new Ajax.Updater('menu', LINPHA_LINK + '&linCat=ajax&reloadmenu&linId='+IdCurrent, {method: 'get', asynchronous:true, evalScripts:true}); + this.menuNeedsUpdating = false; + } + }, + + /** + * setWindowSize() + * + * sets two variables of the inner window width and height + * takes care of browser incompatibilities + */ + setWindowSize: function() + { + /** + * browser incompatibilities... + */ + if (window.innerHeight) // all except Explorer + { + this.linInnerWidth = self.innerWidth; + this.linInnerHeight = self.innerHeight; + } + else if (document.body && document.body.offsetWidth) + { + this.linInnerWidth = document.body.offsetWidth; + this.linInnerHeight = document.body.offsetHeight; + } else { - $('divSyslogText').innerHTML += '<br />' + text; - } - Element.show('divSyslog'); - } -} -function closeSyslog() -{ - $('divSyslogText').innerHTML = ''; - Element.hide('divSyslog'); -} + this.linInnerWidth = 500; + this.linInnerHeight = 300; + } + }, -/** - * check ajax compatibilty - * will be on every page view until it was successfully - * then, the page will be reloaded - * - * use this on every page and not only on home page, because if user is linked directly to an image - * - * ajax may be disabled with ./?linCat=ajax&disable_ajax - * and may be re-enabled with ./?linCat=ajax&enable_ajax - * - * http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request - */ -function checkAjaxCompatibility() -{ - new Ajax.Request(LINPHA_LINK + '&linCat=ajax&use_js', {method:'get', asynchronous:true, onSuccess:checkAjaxCompatibilitySuccess} ); -} - -/** - * reload page, now with ajax activated - * will be called if the request in checkAjaxCompatibility() was successfully - */ -function checkAjaxCompatibilitySuccess(t) -{ - if( t.responseText == 'use_js saved' ) + /** + * setMainHeight + * + * sets the height in thumb and image view of the "divmain" + */ + setMainHeight: function() { - location.href = document.location; - linSyslog('Ajax enabled'); - } -} - -function AjaxPost(parameters,successFunction) -{ - var opt = { - // Use POST - method: 'post', - // Send this lovely data - postBody: parameters - , - // asynchron, of course - asynchronous:true, + this.setWindowSize(); - // Handle successful response - onSuccess: successFunction, - - // Handle 404 - on404: function(t) { - alert('Error 404: location "' + t.statusText + '" was not found.'); - }, - // Handle other errors - onFailure: function(t) { - alert('Error ' + t.status + ' -- ' + t.statusText); + var newHeight = this.linInnerHeight - $('main').offsetTop - 40; // 35 = 15 (bottom rounded corners) + 10 (margin-bottom) + 15 (??) + if(newHeight < 100) + { + newHeight = 100; } - } - - new Ajax.Request(xmlUrl + '&id=' + IdCurrent + '&xml', opt); -} - -var menuNeedsUpdating = false; -function reloadMenu() -{ - if( menuNeedsUpdating ) + + $('main').style.height = newHeight; + }, + + /** + * setScrollSize + * + * sets two variables with the scroll offset + * takes care of browser incompatibilites + */ + setScrollSize: function() { - new Ajax.Updater('menu', LINPHA_LINK + '&linCat=ajax&reloadmenu&id='+IdCurrent, {method: 'get', asynchronous:true, evalScripts:true}); - menuNeedsUpdating = false; + if (self.pageYOffset) // all except Explorer + { + this.linPageXOffset = self.pageXOffset; + this.linPageYOffset = self.pageYOffset; + } + else if (document.documentElement && document.documentElement.scrollTop) + // Explorer 6 Strict + { + this.linPageXOffset = document.documentElement.scrollLeft; + this.linPageYOffset = document.documentElement.scrollTop; + } + else if (document.body) // all other Explorers + { + this.linPageXOffset = document.body.scrollLeft; + this.linPageYOffset = document.body.scrollTop; + } + }, + + fOnError: function(txt_message, url, line) { + var txt = "Error occured...\n\n"; + txt += "Message: " + txt_message + "\n"; + txt += "URL: " + url + "\n"; + txt += "Line: " + line; + alert(txt); } } /** - * setMainHeight + * initLinGlobal() * - * sets the height in thumb and image view of the "divmain" + * create the class object */ -var linInnerWidth, linInnerHeight; - -function getWindowSize() +function initLinGlobal() { - /** - * browser incompatibilities... - */ - if (window.innerHeight) // all except Explorer - { - linInnerWidth = self.innerWidth; - linInnerHeight = self.innerHeight; - } - else if (document.body && document.body.offsetWidth) - { - linInnerWidth = document.body.offsetWidth; - linInnerHeight = document.body.offsetHeight; - } - else - { - linInnerWidth = 500; - linInnerHeight = 300; - } -} + myLinGlobal = new LinGlobal(); -function setMainHeight() -{ - getWindowSize(); - - var newHeight = linInnerHeight - $('main').offsetTop - 40; // 35 = 15 (bottom rounded corners) + 10 (margin-bottom) + 15 (??) - if(newHeight < 100) - { - newHeight = 100; - } - - $('main').style.height = newHeight; + Event.observe(window, 'error', myLinGlobal.fOnError, false); } - -function fOnError(txt_message, url, line) { - var txt = "Error occured...\n\n"; - txt += "Message: " + txt_message + "\n"; - txt += "URL: " + url + "\n"; - txt += "Line: " + line; - alert(txt); -} -window.onerror = fOnError; - +//Event.observe(window, 'load', initLinGlobal, false); +initLinGlobal(); Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-11-03 23:01:21 UTC (rev 4621) +++ trunk/linpha2/lib/js/LinImage.js 2006-11-05 13:43:49 UTC (rev 4622) @@ -1,51 +1,63 @@ -var errFunc = function(t) { - alert('Error ' + t.status + ' -- ' + t.statusText); -} +/** + * class and global definitions + */ +var LinImage = Class.create(); +var myLinImage; -var nextThumbs = new Array(); -var prevThumbs = new Array(); +LinImage.prototype = { + + /** + * initialize() + * + * Constructor runs on completion of the DOM loading. + */ + initialize: function() + { + this.imgInfoColorNotActive = $('divinfolinks').style.color; + this.imgInfoColorActive = $('hrefinfolinks').style.color; + this.imgInfoShowHide = 'hide'; -var fullscreenActive = false; -var fullscreenOldMaxWidth, fullscreenOldMaxHeight; -var slideshowActive = false; -var ssCurrentTimerID; -var ssCurrentDelay = 5000; -var ssRandom = false; -var ssLoop = false; -var xmlDoc = new Array(); -var preloadImage = new Array(); // image array, will contain a lot of preloaded images -var preloadImageFinished = new Array(); // set to true after preload completed -var preloadXmlFinished = new Array(); + this.fullscreenActive = false; + this.fullscreenOldMaxWidth, this.fullscreenOldMaxHeight; + this.slideshowActive = false; + this.ssCurrentTimerID; + this.ssCurrentDelay = 5000; + this.ssRandom = false; + this.ssLoop = false; + + this.xmlDoc = new Array(); + this.nextThumbs = new Array(); + this.prevThumbs = new Array(); + this.preloadImageSrc = new Array(); // image array, will contain a lot of preloaded images + this.finishedPreloadedImages = new Array(); // set to true after preload completed + this.preloadXmlFinished = new Array(); + + this.curLocationHash; + this.timerResize; + + this.testarray = new Array(); + this.testarray[0] = 'test 2'; -var curLocationHash; + }, -var borderSize = 0; -var resizeDuration = 0.5; -var LinImage = Class.create(); -var myLinImage; + // ----------------------------------------------------------------------------------- + // functions to load xml data of images + // ----------------------------------------------------------------------------------- -LinImage.prototype = { - - // initialize() - // Constructor runs on completion of the DOM loading. - // - initialize: function() { - }, - loadImage: function(imgId) { if(IdCurrent != imgId) { IdCurrent = imgId; - menuNeedsUpdating = true; // IdCurrent changed, update menu on next hover of the menu + //myLinGlobal.menuNeedsUpdating = true; // IdCurrent changed, update menu on next hover of the menu location.hash = 'idCurrent='+IdCurrent; } - curLocationHash = location.hash; // update current Hash, this value is periodically checked to reload the image if neccessary + this.curLocationHash = location.hash; // update current Hash, this value is periodically checked to reload the image if neccessary - if(preloadXmlFinished[imgId] && typeof xmlDoc[imgId] != "undefined" ) // use typeof to work in IE + if(this.preloadXmlFinished[imgId] && typeof this.xmlDoc[imgId] != "undefined" ) // use typeof to work in IE { this.changeImage(); } @@ -57,15 +69,23 @@ loadImageXml: function(imgId) { // http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request - new Ajax.Request(xmlUrl + '&id=' + imgId + '&xml', {method:'get', asynchronous:true, onSuccess:this.loadImageContinue, onFailure:errFunc} ); + new Ajax.Request( + xmlUrl + '&linId=' + imgId + '&xml', + { + method:'get', + asynchronous:true, + onSuccess:this.loadImageContinue, + onFailure: function(t) { alert('Error ' + t.status + ' -- ' + t.statusText); } + } + ); }, loadImageContinue: function(t) { var loadedimgid = t.responseXML.documentElement.getElementsByTagName('imgid').item(0).firstChild.data; // save xml data - xmlDoc[loadedimgid] = t.responseXML.documentElement; - preloadXmlFinished[loadedimgid] = true; + myLinImage.xmlDoc[loadedimgid] = t.responseXML.documentElement; + myLinImage.preloadXmlFinished[loadedimgid] = true; if( loadedimgid == IdCurrent ) // coming from loadImage() { @@ -77,22 +97,27 @@ } }, + + // ----------------------------------------------------------------------------------- + // Navigation functions + // ----------------------------------------------------------------------------------- + movePrev: function() { - if( slideshowActive ) + if( this.slideshowActive ) { - clearTimeout(ssCurrentTimerID); + clearTimeout(this.ssCurrentTimerID); } - if(prevThumbs[ prevThumbs.length - 1 ]) + 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 }); - myLinImage.loadImage(prevThumbs[ prevThumbs.length - 1 ]); + myLinImage.loadImage(this.prevThumbs[ this.prevThumbs.length - 1 ]); - if( slideshowActive ) + if( this.slideshowActive ) { - clearTimeout(ssCurrentTimerID); - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + clearTimeout(this.ssCurrentTimerID); + this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); } } else // end reached, do nothing but enable keyboard navigation again @@ -100,24 +125,24 @@ myLinImage.enableKeyboardNav(); } - if( slideshowActive ) + if( this.slideshowActive ) { - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); } }, moveNext: function() { - if( slideshowActive ) + if( this.slideshowActive ) { - clearTimeout(ssCurrentTimerID); + clearTimeout(this.ssCurrentTimerID); } - if(nextThumbs[0]) + if(this.nextThumbs[0]) { Element.setOpacity('ssImgNext',0.7); new Effect.Appear('ssImgNext', { duration: 0.5, from: 0.7, to: 1.0 }); - myLinImage.loadImage(nextThumbs[0]); + myLinImage.loadImage(this.nextThumbs[0]); } - else if( ssLoop ) + else if( this.ssLoop ) { Element.setOpacity('ssImgNext',0.7); new Effect.Appear('ssImgNext', { duration: 0.5, from: 0.7, to: 1.0 }); @@ -128,63 +153,67 @@ myLinImage.enableKeyboardNav(); } - if( slideshowActive ) + if( this.slideshowActive ) { - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); } }, moveFirst: function() { - if( slideshowActive ) + if( this.slideshowActive ) { - clearTimeout(ssCurrentTimerID); + clearTimeout(this.ssCurrentTimerID); } Element.setOpacity('ssImgFirst',0.7); new Effect.Appear('ssImgFirst', { duration: 0.5, from: 0.7, to: 1.0 }); myLinImage.loadImage( firstImgId ); - if( slideshowActive ) + if( this.slideshowActive ) { - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); } }, moveLast: function() { - if( slideshowActive ) + if( this.slideshowActive ) { - clearTimeout(ssCurrentTimerID); + clearTimeout(this.ssCurrentTimerID); } Element.setOpacity('ssImgLast',0.7); new Effect.Appear('ssImgLast', { duration: 0.5, from: 0.7, to: 1.0 }); myLinImage.loadImage( lastImgId ); - if( slideshowActive ) + if( this.slideshowActive ) { - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); } }, - // - // changeImage() - // + // ----------------------------------------------------------------------------------- + // Change image functions + // ----------------------------------------------------------------------------------- + + /** + * changeImage() + */ changeImage: function() { /** * set height of outer div to prevent the whole page getting smaller, and if the image is loaded getting bigger again * but in fullscreen, we want no activities in background */ - if(! fullscreenActive) { + if(! this.fullscreenActive) { $('divimage').style.height = $('mainImage').style.height; } /** * hide elements during transition */ - hideImgInfoNow(); // hide meta text immediately + this.hideImgInfoNow(); // hide meta text immediately Element.hide('mainImage'); // hide mainimage while changing image to prevent flicker Element.hide('divinfolinks'); - if(! preloadImageFinished[IdCurrent] ) + if(! this.finishedPreloadedImages[IdCurrent] ) { Element.show('divloading'); } @@ -196,9 +225,9 @@ /** * set image width and height */ - var orgWidth = xmlDoc[IdCurrent].getElementsByTagName('imgwidth').item(0).firstChild.data; - var orgHeight = xmlDoc[IdCurrent].getElementsByTagName('imgheight').item(0).firstChild.data; - var sizeArray = scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); + var orgWidth = this.xmlDoc[IdCurrent].getElementsByTagName('imgwidth').item(0).firstChild.data; + var orgHeight = this.xmlDoc[IdCurrent].getElementsByTagName('imgheight').item(0).firstChild.data; + var sizeArray = this.scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); var imgWidth = sizeArray[0]; var imgHeight = sizeArray[1]; @@ -216,16 +245,16 @@ * and hence the image was not resized correctly in resizeImageContainer() !!! */ imgPreloader.onload=function(){ - preloadImageFinished[IdCurrent] = true; + myLinImage.finishedPreloadedImages[IdCurrent] = true; $('mainImage').src = currentImgSrc; myLinImage.resizeImageContainer(imgWidth, imgHeight); } imgPreloader.src = currentImgSrc; }, - // - // resizeImageContainer() - // + /** + * resizeImageContainer() + */ resizeImageContainer: function( imgWidth, imgHeight) { // get current height and width @@ -260,16 +289,17 @@ this.showImage(); }, - // - // showImage() - // Display image and begin preloading next images. - // + /** + * showImage() + * + * Display image and begin preloading next images. + */ showImage: function(){ Element.hide('divloading'); if( useEffects ) { - new Effect.Appear('mainImage', { duration: 0.5, afterFinish: function(){ myLinImage.setImageData(); } }); + new Effect.Appear('mainImage', { duration: 0.5, afterFinish: function(){ myLinImage.setImageData(); } }); } else { @@ -277,7 +307,8 @@ this.setImageData() } - if(! fullscreenActive) { + if(! this.fullscreenActive) + { $('divimage').style.height = $('mainImage').style.height; // reset to correct height to prevent trouble if image is bigger or smaller } @@ -286,17 +317,38 @@ */ if( typeof $('title') != 'undefined' ) { - $('title').innerHTML = xmlDoc[IdCurrent].getElementsByTagName('title').item(0).firstChild.data; + $('title').innerHTML = this.xmlDoc[IdCurrent].getElementsByTagName('title').item(0).firstChild.data; } this.enableKeyboardNav(); - }, + /** + * setImageData() + */ + setImageData: function() + { + this.setImageInfoLink(); // show the "info" link, must be called after Appear('mainImage') - setImageData: function() { - - this.setImageInfoLink(); + /** + * update the menu + */ + /** + * 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 ); + + /** + * replace the width and height dimensions of the view at fullscreen link + */ + var orgWidth = this.xmlDoc[IdCurrent].getElementsByTagName('imgwidth').item(0).firstChild.data; + var orgHeight = this.xmlDoc[IdCurrent].getElementsByTagName('imgheight').item(0).firstChild.data; + $('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 @@ -307,13 +359,13 @@ * set prev thumbs */ $('thumbnavi_prevthumb').innerHTML = ''; - prevThumbs = new Array(); - if(xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) + this.prevThumbs = new Array(); + if(this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) { - for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length; i++) + for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length; i++) { - var thumbId = xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; - prevThumbs[i] = thumbId; + var thumbId = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; + this.prevThumbs[i] = thumbId; this.setPrevNextThumb(thumbId, 'thumbnavi_prevthumb'); } } @@ -322,13 +374,13 @@ * set next thumbs */ $('thumbnavi_nextthumb').innerHTML = ''; - nextThumbs = new Array(); - if(xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) + this.nextThumbs = new Array(); + if(this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) { - for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) + for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) { - var thumbId = xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; - nextThumbs[i] = thumbId; + var thumbId = this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; + this.nextThumbs[i] = thumbId; this.setPrevNextThumb(thumbId, 'thumbnavi_nextthumb'); } } @@ -336,13 +388,13 @@ /** * set meta data */ - if(xmlDoc[IdCurrent].getElementsByTagName('meta').length > 0) + if(this.xmlDoc[IdCurrent].getElementsByTagName('meta').length > 0) { $('divmeta').innerHTML = ''; - for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('meta').length; i++) + for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('meta').length; i++) { - var meta = xmlDoc[IdCurrent].getElementsByTagName('meta').item(i); + var meta = this.xmlDoc[IdCurrent].getElementsByTagName('meta').item(i); var metaname = document.createTextNode( meta.getElementsByTagName('name').item(0).firstChild.data + ': ' ); var metavalue = document.createTextNode( meta.getElementsByTagName('value').item(0).firstChild.data ); @@ -355,13 +407,13 @@ /** * set comments */ - initTextareaAddComment(); + this.initTextareaAddComment(); $('divcomments').innerHTML = ''; - if(xmlDoc[IdCurrent].getElementsByTagName('comment').length > 0) + if(this.xmlDoc[IdCurrent].getElementsByTagName('comment').length > 0) { - for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('comment').length; i++) + for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('comment').length; i++) { - var tagcomment = xmlDoc[IdCurrent].getElementsByTagName('comment').item(i); + var tagcomment = this.xmlDoc[IdCurrent].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 ); @@ -389,7 +441,7 @@ * set image nr * currently only in slideshow used */ - $('divSlideshowImgNr').innerHTML = xmlDoc[IdCurrent].getElementsByTagName('imgnr').item(0).firstChild.data; + $('divSlideshowImgNr').innerHTML = this.xmlDoc[IdCurrent].getElementsByTagName('imgnr').item(0).firstChild.data; /** @@ -398,8 +450,13 @@ this.preloadXml(); - }, // end function setImageData() + }, + /** + * setPrevNextThumb() + * + * code to generate a thumbnail with a <div><a><img> tag + */ setPrevNextThumb: function(thumbId, divId) { var ElemImg = Builder.node('img', {id: 'thumb'+thumbId, className: 'img_prevnextthumb', src: thumbSrc + thumbId}); @@ -410,48 +467,37 @@ ElemDiv.appendChild( ElemA ); $(divId).appendChild(ElemDiv); - if(! preloadImageFinished[thumbId]) { + if(! this.finishedPreloadedImages[thumbId]) { Element.setOpacity('thumb'+thumbId,0.5); } }, + + // ----------------------------------------------------------------------------------- + // Keyboard actions + // ----------------------------------------------------------------------------------- + /** - * setImageInfoLink - * - * set positions of info link - * could only be done after image has been completly loaded + * enableKeyboardNav() */ - setImageInfoLink: function() - { - if(! fullscreenActive) - { - $('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'); - } - }, - - // - // enableKeyboardNav() - // enableKeyboardNav: function() { document.onkeydown = this.keyboardAction; }, - // - // disableKeyboardNav() - // + /** + * disableKeyboardNav() + */ disableKeyboardNav: function() { document.onkeydown = ''; }, - // - // keyboardAction() - // - // very nice - // http://www.mediaevent.de/javascript/needful_tables.html - // + /** + * keyboardAction() + * + * very nice + * http://www.mediaevent.de/javascript/needful_tables.html + */ keyboardAction: function(e) { if (e == null) { // ie @@ -492,7 +538,7 @@ } else if ((keycode == 122)) // F11 { - if( fullscreenActive ) { + if( this.fullscreenActive ) { $('divSlideshowExit').show(); // hide exit button to force exit again with F11 myLinImage.fullscreenStop(); } else { @@ -512,26 +558,31 @@ myLinImage.moveLast(); return false; } - else if( fullscreenActive && ((key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) ) // close fullscreen + else if( this.fullscreenActive && ((key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) ) // close fullscreen { myLinImage.fullscreenStop(); } - else if(fullscreenActive && key == 's') // start/stop slideshow + else if(this.fullscreenActive && key == 's') // start/stop slideshow { myLinImage.slideshowStartStop(); } - else if(fullscreenActive && key == 'p') // display previous image + else if(this.fullscreenActive && key == 'p') // display previous image { myLinImage.disableKeyboardNav(); myLinImage.movePrev(); } - else if(fullscreenActive && key == 'n') // display next image + else if(this.fullscreenActive && key == 'n') // display next image { myLinImage.disableKeyboardNav(); myLinImage.moveNext(); } }, + + // ----------------------------------------------------------------------------------- + // Preload functions + // ----------------------------------------------------------------------------------- + /** * preloadXml() * Preload previous and next images. @@ -544,16 +595,17 @@ preloadXml: function() { // preload nextthumb from left to right - if(xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) + if(this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) { - for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) + for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) { - var imgId = xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; - if(! preloadXmlFinished[imgId]) + var imgId = this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; + + if(! this.preloadXmlFinished[imgId]) { this.loadImageXml(imgId); } - else if(! preloadImageFinished[imgId] ) + else if(! this.finishedPreloadedImages[imgId] ) { this.preloadImage(imgId); } @@ -561,16 +613,16 @@ } // preload prevthumb from right to left - if(xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) + if(this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) { - for(var i = xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length-1; i >= 0; i--) + for(var i = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length-1; i >= 0; i--) { - var imgId = xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; - if(! preloadXmlFinished[imgId]) + var imgId = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; + if(! this.preloadXmlFinished[imgId]) { this.loadImageXml(imgId); } - else if(! preloadImageFinished[imgId] ) + else if(! this.finishedPreloadedImages[imgId] ) { this.preloadImage(imgId); } @@ -583,35 +635,34 @@ * * will be called after getting the xml data */ - preloadImage: function(imgId) { - if(! preloadImageFinished[imgId] ) + preloadImage: function(imgId) + { + if(! this.finishedPreloadedImages[imgId] ) { /** * set image width and height */ - var orgWidth = xmlDoc[imgId].getElementsByTagName('imgwidth').item(0).firstChild.data; - var orgHeight = xmlDoc[imgId].getElementsByTagName('imgheight').item(0).firstChild.data; - var sizeArray = scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); + var orgWidth = this.xmlDoc[imgId].getElementsByTagName('imgwidth').item(0).firstChild.data; + var orgHeight = this.xmlDoc[imgId].getElementsByTagName('imgheight').item(0).firstChild.data; + var sizeArray = this.scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); var imgWidth = sizeArray[0]; var imgHeight = sizeArray[1]; - var currentImgSrc = imageSrc + imgId + '&width=' + imgWidth + '&height=' + imgHeight; - /** * preload image */ - preloadImage[imgId] = new Image(); + this.preloadImageSrc[imgId] = new Image(); - preloadImage[imgId].onload=function(){ + this.preloadImageSrc[imgId].onload=function(){ myLinImage.preloadImageFinished(imgId); } - preloadImage[imgId].src = currentImgSrc; + this.preloadImageSrc[imgId].src = imageSrc + imgId + '&width=' + imgWidth + '&height=' + imgHeight; } }, preloadImageFinished: function(imgId) { - preloadImageFinished[imgId] = true; + this.finishedPreloadedImages[imgId] = true; if( $('thumb'+imgId) ) // maybe its not here anymore { @@ -619,16 +670,21 @@ } }, + + + // ----------------------------------------------------------------------------------- + // Slideshow functions + // ----------------------------------------------------------------------------------- fullscreenStart: function() { - fullscreenActive = true; + this.fullscreenActive = true; /** * save old values to restore if slideshow ends */ - fullscreenOldMaxWidth = maxImageWidth; - fullscreenOldMaxHeight = maxImageHeight; + this.fullscreenOldMaxWidth = maxImageWidth; + this.fullscreenOldMaxHeight = maxImageHeight; /** * disable scrollbars @@ -653,17 +709,15 @@ */ onWindowResize(); }, - - fullscreenStop: function() { - fullscreenActive = false; + this.fullscreenActive = false; /** * restore max image size */ - maxImageWidth = fullscreenOldMaxWidth; - maxImageHeight = fullscreenOldMaxHeight; + maxImageWidth = this.fullscreenOldMaxWidth; + maxImageHeight = this.fullscreenOldMaxHeight; /** * re-enable scrollbars @@ -673,7 +727,7 @@ /** * delete preloaded images after stopping fullscreen */ - preloadImageFinished = new Array(); + this.finishedPreloadedImages = new Array(); /** * end slideshow with some superduper effects @@ -697,75 +751,242 @@ slideshowStartStop: function() { // start Slideshow - if(! slideshowActive) + if(! this.slideshowActive) { - slideshowActive = true; + this.slideshowActive = true; Element.setOpacity('ssImgStart',0.7); - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); } else // stop Slideshow { - slideshowActive = false; + this.slideshowActive = false; Element.setOpacity('ssImgStart',1); - clearTimeout(ssCurrentTimerID); + clearTimeout(this.ssCurrentTimerID); } }, slideshowPlay: function() { - if(nextThumbs[0] || ssLoop) + if(this.nextThumbs[0] || this.ssLoop) { this.moveNext(); - //ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); + //this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); } else { // force stop slideshow - slideshowActive = true; + this.slideshowActive = true; this.slideshowStartStop(); } }, slideshowChangeDelay: function() { - ssCurrentDelay = $('ssDelay').options[ $('ssDelay').selectedIndex ].value * 1000; + this.ssCurrentDelay = $('ssDelay').options[ $('ssDelay').selectedIndex ].value * 1000; //document.optionsForm.delay.options[document.optionsForm.delay.selectedIndex].value * 1000; }, slideshowChangeLoop: function() { - if(! ssLoop) { - ssLoop = true; + if(! this.ssLoop) { + this.ssLoop = true; Element.setOpacity('ssImgLoop',0.7); } else { - ssLoop = false; + this.ssLoop = false; Element.setOpacity('ssImgLoop',1); } }, slideshowChangeRandom: function() { - if(! ssRandom) { - ssRandom = true; + if(! this.ssRandom) { + this.ssRandom = true; Element.setOpacity('ssImgRandom',0.7); } else { - ssRandom = false; + this.ssRandom = false; Element.setOpacity('ssImgRandom',1); } alert('This feature is currently not implemented, do we really need that?'); + }, + + + // ----------------------------------------------------------------------------------- + // Image info functions + // ----------------------------------------------------------------------------------- + + /** + * setImageInfoLink() + * + * positions the info link on bottom right of the image + * could only be done after image is not hidden anymore + * + * if this can be done without javascript, please tell me + */ + 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'); + }, + + /** + * showImgInfo() + * + * 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' + * so it is possible to set the colors in the css template (and not in javascript file) + */ + showImgInfo: function() + { + /** + * make visible/invisible + */ + if( this.imgInfoShowHide == 'hide' ) + { + this.imgInfoShowHide = 'show'; + + /** + * set position + */ + $('divmeta').style.top = $('mainImage').offsetTop + 50; + $('divmeta').style.left = $('mainImage').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 }); + + $('hrefinfolinks').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 }); + + $('hrefinfolinks').style.color = this.imgInfoColorActive; + } + }, + hideImgInfoNow: function() + { + $('divmeta').style.display = 'none'; + Element.setOpacity('divimage',1); + this.imgInfoShowHide = 'hide'; + + $('hrefinfolinks').style.color = this.imgInfoColorActive; + }, + + /** + * returns an array(width, height) with the correct size to fit + * in dst_w and dst_h + */ + scaleToFit: function(src_w,src_h,dst_w,dst_h,no_increase) + { + if(src_h == 0 || src_w == 0) + { + return new Array(0, 0); + } + + var img_relation = src_w / src_h; + + // Image is smaller than screen, no resize required + if ((src_w <= dst_w) && (src_h <= dst_h) && no_increase) + { + var returnarray = new Array( Math.round(src_w), Math.round(src_h) ); + } + else + { + /* + The image is way bigger than the screen, resize maintaining aspect ratio + + $src_w, $src_h: original image sizes + $dst_w, $dst_h: screen width and height + $img_relation = $src_w/$src_h; + + Either $dst_w decisive or $dst_h, usually $dst_h + */ + + var tmp_height = dst_w / img_relation; // calc the new height with screen width + if (tmp_height > dst_h) // we were wrong, it's still widther than screen -> $dst_h is decisive + { + var returnarray = new Array( Math.round(img_relation*dst_h), Math.round(dst_h) ); + } + else + { + var returnarray = new Array( Math.round(dst_w), Math.round(tmp_height) ); + } + } + + return returnarray; + }, + + + // ----------------------------------------------------------------------------------- + // Comments + // ----------------------------------------------------------------------------------- + + saveComment: function(t) + { + this.xmlDoc[IdCurrent] = t.responseXML.documentElement; + + if(this.xmlDoc[IdCurrent].getElementsByTagName('commentadded').length > 0) + { + myLinGlobal.linSyslog( this.xmlDoc[IdCurrent].getElementsByTagName('commentadded').item(0).firstChild.data ); + } + + myLinImage.loa... [truncated message content] |
From: bzrudi <bz...@tu...> - 2006-11-07 09:48:20
|
Hi all, seems that the latest changes causes high CPU load. Every menu item takes about 3 sec. to show up. Also browsing via thumb navi and showing the main images is extremely slow. At least at my box. Not sure if it is as of this change or because of any earlier or later change, but it sure is a performance issue ;-) cheers bzrudi fan...@us... wrote: > Revision: 4622 > http://svn.sourceforge.net/linpha/?rev=4622&view=rev > Author: fangehrn > Date: 2006-11-05 05:43:49 -0800 (Sun, 05 Nov 2006) > > Log Message: > ----------- > 2006-11-05 flo > * change the linpha2/?id to linpha2/?linId > * reorganized javascript classes and functions > there should be now no problem when including from other websites > * testing a new way of updating the menu using this javascript code > 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 > > Modified Paths: > -------------- > trunk/linpha2/ChangeLog > trunk/linpha2/admin/permissions_groups.php > trunk/linpha2/admin/permissions_readwrite.php > trunk/linpha2/admin/permissions_usergroup.php > trunk/linpha2/admin/permissions_users.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_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.ajax.php > trunk/linpha2/lib/modules/module.albums.php > trunk/linpha2/lib/modules/module.browse.php > trunk/linpha2/lib/modules/module.filemanager.php > trunk/linpha2/lib/modules/module.newimg.php > trunk/linpha2/lib/modules/module.search.php > trunk/linpha2/linpha2.specs.txt > trunk/linpha2/templates/default/basket.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/themes/default/DefsThumbView.js > 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_thumb.head.php > trunk/linpha2/templates/default/view_thumb_static.html.php > > Modified: trunk/linpha2/ChangeLog > =================================================================== > --- trunk/linpha2/ChangeLog 2006-11-03 23:01:21 UTC (rev 4621) > +++ trunk/linpha2/ChangeLog 2006-11-05 13:43:49 UTC (rev 4622) > @@ -1,3 +1,12 @@ > +2006-11-05 flo > + * change the linpha2/?id to linpha2/?linId > + * reorganized javascript classes and functions > + there should be now no problem when including from other websites > + * testing a new way of updating the menu using this javascript code > + 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 > + > 2006-11-03 flo > * startet making linpha includable by other web pages > - introduced new constants: > > Modified: trunk/linpha2/admin/permissions_groups.php > =================================================================== > --- trunk/linpha2/admin/permissions_groups.php 2006-11-03 23:01:21 UTC (rev 4621) > +++ trunk/linpha2/admin/permissions_groups.php 2006-11-05 13:43:49 UTC (rev 4622) > @@ -108,7 +108,7 @@ > <?php } ?> > </form> > > - <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=group&id='.$data['id']; ?>"> > + <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=group&linId='.$data['id']; ?>"> > <input type="submit" value="<?php echo i18n("Edit Group Members"); ?>" style="float: left;"> > </form> > </td> > > Modified: trunk/linpha2/admin/permissions_readwrite.php > =================================================================== > --- trunk/linpha2/admin/permissions_readwrite.php 2006-11-03 23:01:21 UTC (rev 4621) > +++ trunk/linpha2/admin/permissions_readwrite.php 2006-11-05 13:43:49 UTC (rev 4622) > @@ -215,7 +215,7 @@ > ?> > <br /> > <?php echo i18n("Permission Set"); ?>: <b><?php echo getReadablePerms($perm); ?></b> > - (<a href="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id='.$parent_id.'&cmd=edit&id='.$parent_id; ?>">change</a>) > + (<a href="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'&parent_id='.$parent_id.'&cmd=edit&linId='.$parent_id; ?>">change</a>) > <br /><br /> > <table border='1'> > <tr> > @@ -288,11 +288,11 @@ > > if($i != 0) > { > - echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_'.$GLOBALS['cat2'].'&parent_id='.$GLOBALS['parent_id'].'&cmd=edit&id='.$data['id'].'">add</a>'; > + echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_'.$GLOBALS['cat2'].'&parent_id='.$GLOBALS['parent_id'].'&cmd=edit&linId='.$data['id'].'">add</a>'; > } > else > { > - echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_'.$GLOBALS['cat2'].'&parent_id='.$GLOBALS['parent_id'].'&cmd=edit&id='.$data['id'].'">change</a>'; > + echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_'.$GLOBALS['cat2'].'&parent_id='.$GLOBALS['parent_id'].'&cmd=edit&linId='.$data['id'].'">change</a>'; > } > echo '</td></tr>'; > > > Modified: trunk/linpha2/admin/permissions_usergroup.php > =================================================================== > --- trunk/linpha2/admin/permissions_usergroup.php 2006-11-03 23:01:21 UTC (rev 4621) > +++ trunk/linpha2/admin/permissions_usergroup.php 2006-11-05 13:43:49 UTC (rev 4622) > @@ -8,7 +8,7 @@ > $query = $linpha->db->Execute("SELECT id, group_name FROM ".PREFIX."groups ORDER by group_name"); > while($data = $query->FetchRow()) > { > - echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=group&id='.$data['id'].'">'.$data['group_name'].'</a><br />'; > + echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=group&linId='.$data['id'].'">'.$data['group_name'].'</a><br />'; > } > > echo '<br /><br />'; > @@ -20,7 +20,7 @@ > $query = $linpha->db->Execute("SELECT id, username FROM ".PREFIX."users ORDER by username"); > while($data = $query->FetchRow()) > { > - echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=user&id='.$data['id'].'">'.$data['username'].'</a><br />'; > + echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=user&linId='.$data['id'].'">'.$data['username'].'</a><br />'; > } > ?> > <br /><hr /><br /> > @@ -102,7 +102,7 @@ > * get all groups/users > */ > ?> > - <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit='.$_GET['edit'].'&id='.$linpha->template->idCurrent; ?>"> > + <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit='.$_GET['edit'].'&linId='.$linpha->template->idCurrent; ?>"> > <select name="usergroup[]" size="5" style="width: 200;" multiple="multiple"> > <?php > $query = $linpha->db->Execute("SELECT id, ".$other_select_name." " . > > Modified: trunk/linpha2/admin/permissions_users.php > =================================================================== > --- trunk/linpha2/admin/permissions_users.php 2006-11-03 23:01:21 UTC (rev 4621) > +++ trunk/linpha2/admin/permissions_users.php 2006-11-05 13:43:49 UTC (rev 4622) > @@ -165,7 +165,7 @@ > <input type="submit" value="<?php echo i18n("Modify User"); ?>" style="float: left;"> > </form> > > - <form name="edit_groups" method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=user&id='.$data['id']; ?>"> > + <form name="edit_groups" method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=user&linId='.$data['id']; ?>"> > <input type="submit" name="edit_groups" value="<?php echo i18n("Edit Groups"); ?>" style="float: left;"> > </form> > > > Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php > =================================================================== > --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-03 23:01:21 UTC (rev 4621) > +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-05 13:43:49 UTC (rev 4622) > @@ -49,7 +49,7 @@ > > > /** > - * set current view and set fileinfos of $GLOBALS['linpha']->template->idCurrent ($_GET['id']) > + * set current view and set fileinfos of $GLOBALS['linpha']->template->idCurrent ($_GET['linId']) > * @param string $modulname (album, browse, search, ...) > */ > function setCurrentView($modulename) > @@ -288,7 +288,7 @@ > array( > 'name' => i18n("Permissions"), > 'value' => array( > - array('name' => i18n("Set Permissions"), 'value' => LINPHA_CLIENT.'/admin/?cat=permissions_view&cmd=edit&id='.$GLOBALS['linpha']->template->idCurrent) > + array('name' => i18n("Set Permissions"), 'value' => LINPHA_CLIENT.'/admin/?cat=permissions_view&cmd=edit&linId='.$GLOBALS['linpha']->template->idCurrent) > ) > ); > > @@ -340,13 +340,13 @@ > $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectsizes']); > foreach($array AS $value) > { > - $array_tn_sizes_links[] = array('name' => $value.' '.i18n("Pixel"), 'value' => 'javascript:set_tn_size('.$value.')'); > + $array_tn_sizes_links[] = array('name' => $value.' '.i18n("Pixel"), 'value' => 'javascript:myLinThumbnails.setTnSize('.$value.')'); > } > > $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectnrimages']); > foreach($array AS $value) > { > - $array_nr_links[] = array('name' => $value, 'value' =>"javascript:set_nr_images('".$value."')"); > + $array_nr_links[] = array('name' => $value, 'value' =>"javascript:myLinThumbnails.setNrImages('".$value."')"); > } > > $array_views_links[] = array('name' => i18n("Normal"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=thumb'); > @@ -378,7 +378,7 @@ > { > $GLOBALS['linpha']->template->output['menu_More']['edit']['name'] = i18n("Edit"); > $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['name'] = i18n("Open Filemanager"); > - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&id='.$this->id_parent; > + $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&linId='.$this->id_parent; > } > > if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) > @@ -410,15 +410,15 @@ > array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), > array('name' => i18n("View at"), 'value' => > array( > - array('name' => '640x480', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=640&height=480', 'target' => '_blank'), > - array('name' => '800x600', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=800&height=600', 'target' => '_blank'), > - array('name' => '1024x768', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1024&height=768', 'target' => '_blank'), > - array('name' => '1280x800', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=800', 'target' => '_blank'), > - array('name' => '1280x960', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=960', 'target' => '_blank'), > - array('name' => '1280x1024', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=1024', 'target' => '_blank'), > - array('name' => '1600x1200', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1600&height=1200', 'target' => '_blank'), > - array('name' => '1920x1200', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width=1920&height=1200', 'target' => '_blank'), > - array('name' => $this->org_width.'x'.$this->org_height.' '.i18n("Fullscreen").')', 'value' => LINPHA_CLIENT.'/get_image.php?id='.$GLOBALS['linpha']->template->idCurrent.'&width='.$this->org_width.'&height='.$this->org_height, 'target' => '_blank'), > + array('name' => '640x480', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=640&height=480', 'target' => '_blank'), > + array('name' => '800x600', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=800&height=600', 'target' => '_blank'), > + array('name' => '1024x768', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1024&height=768', 'target' => '_blank'), > + array('name' => '1280x800', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=800', 'target' => '_blank'), > + array('name' => '1280x960', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=960', 'target' => '_blank'), > + array('name' => '1280x1024', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=1024', 'target' => '_blank'), > + array('name' => '1600x1200', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1600&height=1200', 'target' => '_blank'), > + array('name' => '1920x1200', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1920&height=1200', 'target' => '_blank'), > + array('id' => 'linLiViewAtFullscreen', 'name' => $this->org_width.'x'.$this->org_height.' ('.i18n("Fullscreen").')', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width='.$this->org_width.'&height='.$this->org_height, 'target' => '_blank'), > ) > ) > ) > @@ -438,7 +438,7 @@ > { > $GLOBALS['linpha']->template->output['menu_More']['edit']['name'] = i18n("Edit"); > $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['name'] = i18n("Open Filemanager"); > - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&id='.$this->id_parent; > + $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&linId='.$this->id_parent; > } > > > @@ -488,7 +488,7 @@ > * slideshow icon > */ > if( useAjax() ) { > - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="javascript:slideshowStartFromThumbview()">'. > + $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"; > } > @@ -665,7 +665,7 @@ > * this is a normal javascript array > * just another kind of definition... > */ > - $GLOBALS['linpha']->template->output['files_db'] = 'var img_ids = ['."\n"; > + $GLOBALS['linpha']->template->output['files_db'] = 'var linImgIds = ['."\n"; > if($this->tot_photos > 0) // check if not all entries were folders > { > foreach($this->photos_filtered AS $key=>$value) > @@ -846,7 +846,7 @@ > { > if($value['img_type'] == 0) > { > - $GLOBALS['linpha']->template->output['navigation'] .= '<a href="'.LINPHA_LINK.'&linCat=alb&id='.$value['id'].'">'.$value['name'].'</a><br />'; > + $GLOBALS['linpha']->template->output['navigation'] .= '<a href="'.LINPHA_LINK.'&linCat=alb&linId='.$value['id'].'">'.$value['name'].'</a><br />'; > $nr_folders++; > } > } > @@ -1116,7 +1116,7 @@ > <imgwidth><?php echo $this->org_width; ?></imgwidth> > <imgheight><?php echo $this->org_height; ?></imgheight> > <imgnr><?php printf(i18n("Image %s of %s"),$this->current_key+1,count($this->photos_filtered)); ?></imgnr> > -<title><?php echo str_replace('<','<',$GLOBALS['linpha']->template->linpha_title." :: ".$GLOBALS['linpha']->template->output['title']); ?></title> > +<title><?php /* oh, what an evil hack */ echo str_replace('<','<',$GLOBALS['linpha']->template->linpha_title." :: ".$GLOBALS['linpha']->template->output['title']); ?></title> > <?php > if(isset($this->xmldata['prev_thumb'])) { > foreach($this->xmldata['prev_thumb'] AS $value) > @@ -1289,8 +1289,8 @@ > $name = $this->photos_filtered[$key]['name']; > > $str = '<div class="thumbnavi_'.$class.'thumb">' > - . '<a href="'.$GLOBALS['linpha']->template->URL_base.'&id='.$id.'">' > - . '<img class="img_'.$class.'thumb" src="'.LINPHA_CLIENT.'/get_thumb.php?id='.$id.'" /></a>' > + . '<a href="'.$GLOBALS['linpha']->template->URL_base.'&linId='.$id.'">' > + . '<img class="img_'.$class.'thumb" src="'.LINPHA_CLIENT.'/get_thumb.php?linId='.$id.'" /></a>' > . '<br />'.$name.'</div>'."\n"; > > return $str; > > Modified: trunk/linpha2/lib/classes/linpha.sql.class.php > =================================================================== > --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-03 23:01:21 UTC (rev 4621) > +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-05 13:43:49 UTC (rev 4622) > @@ -211,9 +211,9 @@ > * linpha2/index.php/album1/file.jpg > * will set the correct id > */ > - if(isset($_GET['id'])) > + if(isset($_GET['linId'])) > { > - $GLOBALS['linpha']->template->idCurrent = intval($_GET['id']); > + $GLOBALS['linpha']->template->idCurrent = intval($_GET['linId']); > } > else > { > > Modified: trunk/linpha2/lib/classes/linpha.template.class.php > =================================================================== > --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-03 23:01:21 UTC (rev 4621) > +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-05 13:43:49 UTC (rev 4622) > @@ -127,12 +127,13 @@ > <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 startIdCurrent = <?php echo $this->idCurrent; ?>; > var IdCurrent = startIdCurrent; > <?php > if(! isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax'])) > { > - echo "checkAjaxCompatibility();"; > + echo "myLinGlobal.checkAjaxCompatibility();"."\n"; > } > ?> > </script> > @@ -230,7 +231,7 @@ > > if($comingfrom_ajax && isset($this->output['sys_log']) && !empty($this->output['sys_log'])) > { > - echo '<script language="JavaScript" type="text/javascript">linSyslog("'.$this->output['sys_log'].'");</script>'; > + echo '<script language="JavaScript" type="text/javascript">myLinGlobal.linSyslog("'.$this->output['sys_log'].'");</script>'; > } > } > > @@ -256,7 +257,7 @@ > { > echo "\t".'<li><span>'.i18n($index).' </span>'."\n"; > } > - echo "\n".'<ul id="menu'.$index.'" onmouseover="reloadMenu()">'."\n"; > + echo "\n".'<ul id="menu'.$index.'" onmouseover="myLinGlobal.reloadMenu()">'."\n"; > > foreach($GLOBALS['linpha']->template->output['menu_'.$index] AS $key=>$value) > { > @@ -267,7 +268,14 @@ > } else { > $target_str = ''; > } > - echo "\t".'<li><a href="'.$value['value'].'"'.$target_str.'>'.$value['name'].'</a></li>'."\n"; > + > + if(isset($value['id'])) { > + $id_str = ' id="'.$value['id'].'"'; > + } else { > + $id_str = ''; > + } > + > + echo "\t".'<li'.$id_str.'><a href="'.$value['value'].'"'.$target_str.'>'.$value['name'].'</a></li>'."\n"; > } > else > { > @@ -284,7 +292,14 @@ > } else { > $target_str = ''; > } > - echo "\t\t".'<li><a href="'.$sub_value['value'].'"'.$target_str.'>'.$sub_value['name'].'</a></li>'."\n"; > + > + if(isset($sub_value['id'])) { > + $id_str = ' id="'.$sub_value['id'].'"'; > + } else { > + $id_str = ''; > + } > + > + echo "\t\t".'<li'.$id_str.'><a href="'.$sub_value['value'].'"'.$target_str.'>'.$sub_value['name'].'</a></li>'."\n"; > } > else > { > @@ -294,15 +309,20 @@ > > foreach($sub_value['value'] AS $subsub_value) > { > - > - > if(isset($subsub_value['target'])) { > $target_str = ' target="'.$subsub_value['target'].'"'; > } else { > $target_str = ''; > } > - echo "\t\t\t".'<li><a href="'.$subsub_value['value'].'"'.$target_str.'>'.$subsub_value['name'].'</a></li>'."\n"; > > + if(isset($subsub_value['id'])) { > + $id_str = ' id="'.$subsub_value['id'].'"'; > + } else { > + $id_str = ''; > + } > + > + echo "\t\t\t".'<li'.$id_str.'><a href="'.$subsub_value['value'].'"'.$target_str.'>'.$subsub_value['name'].'</a></li>'."\n"; > + > } > > echo "\t\t".'</ul>'."\n"; > > Modified: trunk/linpha2/lib/include/basket_build_print.php > =================================================================== > --- trunk/linpha2/lib/include/basket_build_print.php 2006-11-03 23:01:21 UTC (rev 4621) > +++ trunk/linpha2/lib/include/basket_build_print.php 2006-11-05 13:43:49 UTC (rev 4622) > @@ -174,7 +174,7 @@ > echo "\n\t\t".'<td width="'.$print_w.'" height="'.$print_h.'">'; > echo '<img width="'.$img_w.'" height="'.$img_h.'" '. > 'src="'.LINPHA_CLIENT.'/get_image.php?'. > - 'id='.$image_id.'&'. > + 'linId='.$image_id.'&'. > 'width='.$nw.'&'. > 'height='.$nh.'&'. > ($_POST['l_or_h_quality'] == 'h' ? "quality=80&" : ''). // if high quality selected, set quality to 80 (anything higher than 80 isn't meaningful), if low quality selected, no quality is given, and so get_thumbs_on_fly.php takes the default quality > > Modified: trunk/linpha2/lib/js/LinGlobal.js > =================================================================== > --- trunk/linpha2/lib/js/LinGlobal.js 2006-11-03 23:01:21 UTC (rev 4621) > +++ trunk/linpha2/lib/js/LinGlobal.js 2006-11-05 13:43:49 UTC (rev 4622) > @@ -1,145 +1,213 @@ > > /** > - * dynamically open syslog > - * used in ajax context > + * class and global definitions > */ > -function linSyslog(text) > +var LinGlobal = Class.create(); > +var myLinGlobal; > + > +LinGlobal.prototype = > { > - if( typeof $('divSyslogText') != 'undefined' ) > + /** > + * initialize() > + * Constructor runs on completion of the DOM loading. > + */ > + initialize: function() > { > - if( $('divSyslogText').innerHTML == '' ) > + this.menuNeedsUpdating = false; > + > + this.linInnerWidth = 0; > + this.linInnerHeight = 0; > + this.linPageXOffset = 0; > + this.linPageYOffset = 0; > + }, > + > + /** > + * dynamically open syslog > + * used in ajax context > + */ > + linSyslog: function(text) > + { > + if( typeof $('divSyslogText') != 'undefined' ) > { > - $('divSyslogText').innerHTML += text; > + if( $('divSyslogText').innerHTML == '' ) > + { > + $('divSyslogText').innerHTML += text; > + } > + else > + { > + $('divSyslogText').innerHTML += '<br />' + text; > + } > + > + this.setScrollSize(); > + $('divSyslog').style.top = this.linPageYOffset + 15; > + $('divSyslog').style.left = this.linPageXOffset + 15; > + Element.show('divSyslog'); > } > + }, > + closeSyslog: function() > + { > + $('divSyslogText').innerHTML = ''; > + Element.hide('divSyslog'); > + }, > + > + /** > + * check ajax compatibilty > + * will be on every page view until it was successfully > + * then, the page will be reloaded > + * > + * use this on every page and not only on home page, because if user is linked directly to an image > + * > + * ajax may be disabled with ./?linCat=ajax&disable_ajax > + * and may be re-enabled with ./?linCat=ajax&enable_ajax > + * > + * http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request > + */ > + checkAjaxCompatibility: function() > + { > + new Ajax.Request(LINPHA_LINK + '&linCat=ajax&use_js', {method:'get', asynchronous:true, onSuccess:myLinGlobal.checkAjaxCompatibilitySuccess} ); > + }, > + > + /** > + * reload page, now with ajax activated > + * will be called if the request in checkAjaxCompatibility() was successfully > + */ > + checkAjaxCompatibilitySuccess: function(t) > + { > + if( t.responseText == 'use_js saved' ) > + { > + location.href = document.location; > + this.linSyslog('Ajax enabled'); > + } > + }, > + > + AjaxPost: function(parameters,successFunction) > + { > + var opt = { > + // Use POST > + method: 'post', > + // Send this lovely data > + postBody: parameters > + , > + // asynchron, of course > + asynchronous:true, > + > + // Handle successful response > + onSuccess: successFunction, > + > + // Handle 404 > + on404: function(t) { > + alert('Error 404: location "' + t.statusText + '" was not found.'); > + }, > + // Handle other errors > + onFailure: function(t) { > + alert('Error ' + t.status + ' -- ' + t.statusText); > + } > + } > + > + new Ajax.Request(xmlUrl + '&linId=' + IdCurrent + '&xml', opt); > + }, > + > + reloadMenu: function() > + { > + if( this.menuNeedsUpdating ) > + { > + new Ajax.Updater('menu', LINPHA_LINK + '&linCat=ajax&reloadmenu&linId='+IdCurrent, {method: 'get', asynchronous:true, evalScripts:true}); > + this.menuNeedsUpdating = false; > + } > + }, > + > + /** > + * setWindowSize() > + * > + * sets two variables of the inner window width and height > + * takes care of browser incompatibilities > + */ > + setWindowSize: function() > + { > + /** > + * browser incompatibilities... > + */ > + if (window.innerHeight) // all except Explorer > + { > + this.linInnerWidth = self.innerWidth; > + this.linInnerHeight = self.innerHeight; > + } > + else if (document.body && document.body.offsetWidth) > + { > + this.linInnerWidth = document.body.offsetWidth; > + this.linInnerHeight = document.body.offsetHeight; > + } > else > { > - $('divSyslogText').innerHTML += '<br />' + text; > - } > - Element.show('divSyslog'); > - } > -} > -function closeSyslog() > -{ > - $('divSyslogText').innerHTML = ''; > - Element.hide('divSyslog'); > -} > + this.linInnerWidth = 500; > + this.linInnerHeight = 300; > + } > + }, > > -/** > - * check ajax compatibilty > - * will be on every page view until it was successfully > - * then, the page will be reloaded > - * > - * use this on every page and not only on home page, because if user is linked directly to an image > - * > - * ajax may be disabled with ./?linCat=ajax&disable_ajax > - * and may be re-enabled with ./?linCat=ajax&enable_ajax > - * > - * http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request > - */ > -function checkAjaxCompatibility() > -{ > - new Ajax.Request(LINPHA_LINK + '&linCat=ajax&use_js', {method:'get', asynchronous:true, onSuccess:checkAjaxCompatibilitySuccess} ); > -} > - > -/** > - * reload page, now with ajax activated > - * will be called if the request in checkAjaxCompatibility() was successfully > - */ > -function checkAjaxCompatibilitySuccess(t) > -{ > - if( t.responseText == 'use_js saved' ) > + /** > + * setMainHeight > + * > + * sets the height in thumb and image view of the "divmain" > + */ > + setMainHeight: function() > { > - location.href = document.location; > - linSyslog('Ajax enabled'); > - } > -} > - > -function AjaxPost(parameters,successFunction) > -{ > - var opt = { > - // Use POST > - method: 'post', > - // Send this lovely data > - postBody: parameters > - , > - // asynchron, of course > - asynchronous:true, > + this.setWindowSize(); > > - // Handle successful response > - onSuccess: successFunction, > - > - // Handle 404 > - on404: function(t) { > - alert('Error 404: location "' + t.statusText + '" was not found.'); > - }, > - // Handle other errors > - onFailure: function(t) { > - alert('Error ' + t.status + ' -- ' + t.statusText); > + var newHeight = this.linInnerHeight - $('main').offsetTop - 40; // 35 = 15 (bottom rounded corners) + 10 (margin-bottom) + 15 (??) > + if(newHeight < 100) > + { > + newHeight = 100; > } > - } > - > - new Ajax.Request(xmlUrl + '&id=' + IdCurrent + '&xml', opt); > -} > - > -var menuNeedsUpdating = false; > -function reloadMenu() > -{ > - if( menuNeedsUpdating ) > + > + $('main').style.height = newHeight; > + }, > + > + /** > + * setScrollSize > + * > + * sets two variables with the scroll offset > + * takes care of browser incompatibilites > + */ > + setScrollSize: function() > { > - new Ajax.Updater('menu', LINPHA_LINK + '&linCat=ajax&reloadmenu&id='+IdCurrent, {method: 'get', asynchronous:true, evalScripts:true}); > - menuNeedsUpdating = false; > + if (self.pageYOffset) // all except Explorer > + { > + this.linPageXOffset = self.pageXOffset; > + this.linPageYOffset = self.pageYOffset; > + } > + else if (document.documentElement && document.documentElement.scrollTop) > + // Explorer 6 Strict > + { > + this.linPageXOffset = document.documentElement.scrollLeft; > + this.linPageYOffset = document.documentElement.scrollTop; > + } > + else if (document.body) // all other Explorers > + { > + this.linPageXOffset = document.body.scrollLeft; > + this.linPageYOffset = document.body.scrollTop; > + } > + }, > + > + fOnError: function(txt_message, url, line) { > + var txt = "Error occured...\n\n"; > + txt += "Message: " + txt_message + "\n"; > + txt += "URL: " + url + "\n"; > + txt += "Line: " + line; > + alert(txt); > } > } > > /** > - * setMainHeight > + * initLinGlobal() > * > - * sets the height in thumb and image view of the "divmain" > + * create the class object > */ > -var linInnerWidth, linInnerHeight; > - > -function getWindowSize() > +function initLinGlobal() > { > - /** > - * browser incompatibilities... > - */ > - if (window.innerHeight) // all except Explorer > - { > - linInnerWidth = self.innerWidth; > - linInnerHeight = self.innerHeight; > - } > - else if (document.body && document.body.offsetWidth) > - { > - linInnerWidth = document.body.offsetWidth; > - linInnerHeight = document.body.offsetHeight; > - } > - else > - { > - linInnerWidth = 500; > - linInnerHeight = 300; > - } > -} > + myLinGlobal = new LinGlobal(); > > -function setMainHeight() > -{ > - getWindowSize(); > - > - var newHeight = linInnerHeight - $('main').offsetTop - 40; // 35 = 15 (bottom rounded corners) + 10 (margin-bottom) + 15 (??) > - if(newHeight < 100) > - { > - newHeight = 100; > - } > - > - $('main').style.height = newHeight; > + Event.observe(window, 'error', myLinGlobal.fOnError, false); > } > > - > -function fOnError(txt_message, url, line) { > - var txt = "Error occured...\n\n"; > - txt += "Message: " + txt_message + "\n"; > - txt += "URL: " + url + "\n"; > - txt += "Line: " + line; > - alert(txt); > -} > -window.onerror = fOnError; > - > +//Event.observe(window, 'load', initLinGlobal, false); > +initLinGlobal(); > > Modified: trunk/linpha2/lib/js/LinImage.js > =================================================================== > --- trunk/linpha2/lib/js/LinImage.js 2006-11-03 23:01:21 UTC (rev 4621) > +++ trunk/linpha2/lib/js/LinImage.js 2006-11-05 13:43:49 UTC (rev 4622) > @@ -1,51 +1,63 @@ > > -var errFunc = function(t) { > - alert('Error ' + t.status + ' -- ' + t.statusText); > -} > +/** > + * class and global definitions > + */ > +var LinImage = Class.create(); > +var myLinImage; > > -var nextThumbs = new Array(); > -var prevThumbs = new Array(); > +LinImage.prototype = { > + > + /** > + * initialize() > + * > + * Constructor runs on completion of the DOM loading. > + */ > + initialize: function() > + { > + this.imgInfoColorNotActive = $('divinfolinks').style.color; > + this.imgInfoColorActive = $('hrefinfolinks').style.color; > + this.imgInfoShowHide = 'hide'; > > -var fullscreenActive = false; > -var fullscreenOldMaxWidth, fullscreenOldMaxHeight; > -var slideshowActive = false; > -var ssCurrentTimerID; > -var ssCurrentDelay = 5000; > -var ssRandom = false; > -var ssLoop = false; > > -var xmlDoc = new Array(); > -var preloadImage = new Array(); // image array, will contain a lot of preloaded images > -var preloadImageFinished = new Array(); // set to true after preload completed > -var preloadXmlFinished = new Array(); > + this.fullscreenActive = false; > + this.fullscreenOldMaxWidth, this.fullscreenOldMaxHeight; > + this.slideshowActive = false; > + this.ssCurrentTimerID; > + this.ssCurrentDelay = 5000; > + this.ssRandom = false; > + this.ssLoop = false; > + > + this.xmlDoc = new Array(); > + this.nextThumbs = new Array(); > + this.prevThumbs = new Array(); > + this.preloadImageSrc = new Array(); // image array, will contain a lot of preloaded images > + this.finishedPreloadedImages = new Array(); // set to true after preload completed > + this.preloadXmlFinished = new Array(); > + > + this.curLocationHash; > + this.timerResize; > + > + this.testarray = new Array(); > + this.testarray[0] = 'test 2'; > > -var curLocationHash; > + }, > > -var borderSize = 0; > -var resizeDuration = 0.5; > > -var LinImage = Class.create(); > -var myLinImage; > + // ----------------------------------------------------------------------------------- > + // functions to load xml data of images > + // ----------------------------------------------------------------------------------- > > -LinImage.prototype = { > - > - // initialize() > - // Constructor runs on completion of the DOM loading. > - // > - initialize: function() { > - }, > - > loadImage: function(imgId) { > if(IdCurrent != imgId) > { > IdCurrent = imgId; > - menuNeedsUpdating = true; // IdCurrent changed, update menu on next hover of the menu > + //myLinGlobal.menuNeedsUpdating = true; // IdCurrent changed, update menu on next hover of the menu > location.hash = 'idCurrent='+IdCurrent; > } > > - curLocationHash = location.hash; // update current Hash, this value is periodically checked to reload the image if neccessary > + this.curLocationHash = location.hash; // update current Hash, this value is periodically checked to reload the image if neccessary > > - if(preloadXmlFinished[imgId] && typeof xmlDoc[imgId] != "undefined" ) // use typeof to work in IE > + if(this.preloadXmlFinished[imgId] && typeof this.xmlDoc[imgId] != "undefined" ) // use typeof to work in IE > { > this.changeImage(); > } > @@ -57,15 +69,23 @@ > > loadImageXml: function(imgId) { > // http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request > - new Ajax.Request(xmlUrl + '&id=' + imgId + '&xml', {method:'get', asynchronous:true, onSuccess:this.loadImageContinue, onFailure:errFunc} ); > + new Ajax.Request( > + xmlUrl + '&linId=' + imgId + '&xml', > + { > + method:'get', > + asynchronous:true, > + onSuccess:this.loadImageContinue, > + onFailure: function(t) { alert('Error ' + t.status + ' -- ' + t.statusText); } > + } > + ); > }, > > loadImageContinue: function(t) { > var loadedimgid = t.responseXML.documentElement.getElementsByTagName('imgid').item(0).firstChild.data; > > // save xml data > - xmlDoc[loadedimgid] = t.responseXML.documentElement; > - preloadXmlFinished[loadedimgid] = true; > + myLinImage.xmlDoc[loadedimgid] = t.responseXML.documentElement; > + myLinImage.preloadXmlFinished[loadedimgid] = true; > > if( loadedimgid == IdCurrent ) // coming from loadImage() > { > @@ -77,22 +97,27 @@ > } > }, > > + > + // ----------------------------------------------------------------------------------- > + // Navigation functions > + // ----------------------------------------------------------------------------------- > + > movePrev: function() { > - if( slideshowActive ) > + if( this.slideshowActive ) > { > - clearTimeout(ssCurrentTimerID); > + clearTimeout(this.ssCurrentTimerID); > } > > - if(prevThumbs[ prevThumbs.length - 1 ]) > + 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 }); > - myLinImage.loadImage(prevThumbs[ prevThumbs.length - 1 ]); > + myLinImage.loadImage(this.prevThumbs[ this.prevThumbs.length - 1 ]); > > - if( slideshowActive ) > + if( this.slideshowActive ) > { > - clearTimeout(ssCurrentTimerID); > - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); > + clearTimeout(this.ssCurrentTimerID); > + this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); > } > } > else // end reached, do nothing but enable keyboard navigation again > @@ -100,24 +125,24 @@ > myLinImage.enableKeyboardNav(); > } > > - if( slideshowActive ) > + if( this.slideshowActive ) > { > - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); > + this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); > } > }, > moveNext: function() { > - if( slideshowActive ) > + if( this.slideshowActive ) > { > - clearTimeout(ssCurrentTimerID); > + clearTimeout(this.ssCurrentTimerID); > } > > - if(nextThumbs[0]) > + if(this.nextThumbs[0]) > { > Element.setOpacity('ssImgNext',0.7); > new Effect.Appear('ssImgNext', { duration: 0.5, from: 0.7, to: 1.0 }); > - myLinImage.loadImage(nextThumbs[0]); > + myLinImage.loadImage(this.nextThumbs[0]); > } > - else if( ssLoop ) > + else if( this.ssLoop ) > { > Element.setOpacity('ssImgNext',0.7); > new Effect.Appear('ssImgNext', { duration: 0.5, from: 0.7, to: 1.0 }); > @@ -128,63 +153,67 @@ > myLinImage.enableKeyboardNav(); > } > > - if( slideshowActive ) > + if( this.slideshowActive ) > { > - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); > + this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); > } > }, > moveFirst: function() { > - if( slideshowActive ) > + if( this.slideshowActive ) > { > - clearTimeout(ssCurrentTimerID); > + clearTimeout(this.ssCurrentTimerID); > } > > Element.setOpacity('ssImgFirst',0.7); > new Effect.Appear('ssImgFirst', { duration: 0.5, from: 0.7, to: 1.0 }); > myLinImage.loadImage( firstImgId ); > > - if( slideshowActive ) > + if( this.slideshowActive ) > { > - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); > + this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); > } > }, > moveLast: function() { > - if( slideshowActive ) > + if( this.slideshowActive ) > { > - clearTimeout(ssCurrentTimerID); > + clearTimeout(this.ssCurrentTimerID); > } > > Element.setOpacity('ssImgLast',0.7); > new Effect.Appear('ssImgLast', { duration: 0.5, from: 0.7, to: 1.0 }); > myLinImage.loadImage( lastImgId ); > > - if( slideshowActive ) > + if( this.slideshowActive ) > { > - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); > + this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); > } > }, > > - // > - // changeImage() > - // > + // ----------------------------------------------------------------------------------- > + // Change image functions > + // ----------------------------------------------------------------------------------- > + > + /** > + * changeImage() > + */ > changeImage: function() { > > /** > * set height of outer div to prevent the whole page getting smaller, and if the image is loaded getting bigger again > * but in fullscreen, we want no activities in background > */ > - if(! fullscreenActive) { > + if(! this.fullscreenActive) { > $('divimage').style.height = $('mainImage').style.height; > } > > /** > * hide elements during transition > */ > - hideImgInfoNow(); // hide meta text immediately > + this.hideImgInfoNow(); // hide meta text immediately > Element.hide('mainImage'); // hide mainimage while changing image to prevent flicker > Element.hide('divinfolinks'); > > - if(! preloadImageFinished[IdCurrent] ) > + if(! this.finishedPreloadedImages[IdCurrent] ) > { > Element.show('divloading'); > } > @@ -196,9 +225,9 @@ > /** > * set image width and height > */ > - var orgWidth = xmlDoc[IdCurrent].getElementsByTagName('imgwidth').item(0).firstChild.data; > - var orgHeight = xmlDoc[IdCurrent].getElementsByTagName('imgheight').item(0).firstChild.data; > - var sizeArray = scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); > + var orgWidth = this.xmlDoc[IdCurrent].getElementsByTagName('imgwidth').item(0).firstChild.data; > + var orgHeight = this.xmlDoc[IdCurrent].getElementsByTagName('imgheight').item(0).firstChild.data; > + var sizeArray = this.scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); > var imgWidth = sizeArray[0]; > var imgHeight = sizeArray[1]; > > @@ -216,16 +245,16 @@ > * and hence the image was not resized correctly in resizeImageContainer() !!! > */ > imgPreloader.onload=function(){ > - preloadImageFinished[IdCurrent] = true; > + myLinImage.finishedPreloadedImages[IdCurrent] = true; > $('mainImage').src = currentImgSrc; > myLinImage.resizeImageContainer(imgWidth, imgHeight); > } > imgPreloader.src = currentImgSrc; > }, > > - // > - // resizeImageContainer() > - // > + /** > + * resizeImageContainer() > + */ > resizeImageContainer: function( imgWidth, imgHeight) { > > // get current height and width > @@ -260,16 +289,17 @@ > this.showImage(); > }, > > - // > - // showImage() > - // Display image and begin preloading next images. > - // > + /** > + * showImage() > + * > + * Display image and begin preloading next images. > + */ > showImage: function(){ > Element.hide('divloading'); > > if( useEffects ) > { > - new Effect.Appear('mainImage', { duration: 0.5, afterFinish: function(){ myLinImage.setImageData(); } }); > + new Effect.Appear('mainImage', { duration: 0.5, afterFinish: function(){ myLinImage.setImageData(); } }); > } > else > { > @@ -277,7 +307,8 @@ > this.setImageData() > } > > - if(! fullscreenActive) { > + if(! this.fullscreenActive) > + { > $('divimage').style.height = $('mainImage').style.height; // reset to correct height to prevent trouble if image is bigger or smaller > } > > @@ -286,17 +317,38 @@ > */ > if( typeof $('title') != 'undefined' ) > { > - $('title').innerHTML = xmlDoc[IdCurrent].getElementsByTagName('title').item(0).firstChild.data; > + $('title').innerHTML = this.xmlDoc[IdCurrent].getElementsByTagName('title').item(0).firstChild.data; > } > > this.enableKeyboardNav(); > - > }, > > + /** > + * setImageData() > + */ > + setImageData: function() > + { > + this.setImageInfoLink(); // show the "info" link, must be called after Appear('mainImage') > > - setImageData: function() { > - > - this.setImageInfoLink(); > + /** > + * update the menu > + */ > + /** > + * 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 ); > + > + /** > + * replace the width and height dimensions of the view at fullscreen link > + */ > + var orgWidth = this.xmlDoc[IdCurrent].getElementsByTagName('imgwidth').item(0).firstChild.data; > + var orgHeight = this.xmlDoc[IdCurrent].getElementsByTagName('imgheight').item(0).firstChild.data; > + $('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 > @@ -307,13 +359,13 @@ > * set prev thumbs > */ > $('thumbnavi_prevthumb').innerHTML = ''; > - prevThumbs = new Array(); > - if(xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) > + this.prevThumbs = new Array(); > + if(this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) > { > - for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length; i++) > + for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length; i++) > { > - var thumbId = xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; > - prevThumbs[i] = thumbId; > + var thumbId = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; > + this.prevThumbs[i] = thumbId; > this.setPrevNextThumb(thumbId, 'thumbnavi_prevthumb'); > } > } > @@ -322,13 +374,13 @@ > * set next thumbs > */ > $('thumbnavi_nextthumb').innerHTML = ''; > - nextThumbs = new Array(); > - if(xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) > + this.nextThumbs = new Array(); > + if(this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) > { > - for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) > + for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) > { > - var thumbId = xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; > - nextThumbs[i] = thumbId; > + var thumbId = this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; > + this.nextThumbs[i] = thumbId; > this.setPrevNextThumb(thumbId, 'thumbnavi_nextthumb'); > } > } > @@ -336,13 +388,13 @@ > /** > * set meta data > */ > - if(xmlDoc[IdCurrent].getElementsByTagName('meta').length > 0) > + if(this.xmlDoc[IdCurrent].getElementsByTagName('meta').length > 0) > { > $('divmeta').innerHTML = ''; > > - for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('meta').length; i++) > + for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('meta').length; i++) > { > - var meta = xmlDoc[IdCurrent].getElementsByTagName('meta').item(i); > + var meta = this.xmlDoc[IdCurrent].getElementsByTagName('meta').item(i); > var metaname = document.createTextNode( meta.getElementsByTagName('name').item(0).firstChild.data + ': ' ); > var metavalue = document.createTextNode( meta.getElementsByTagName('value').item(0).firstChild.data ); > > @@ -355,13 +407,13 @@ > /** > * set comments > */ > - initTextareaAddComment(); > + this.initTextareaAddComment(); > $('divcomments').innerHTML = ''; > - if(xmlDoc[IdCurrent].getElementsByTagName('comment').length > 0) > + if(this.xmlDoc[IdCurrent].getElementsByTagName('comment').length > 0) > { > - for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('comment').length; i++) > + for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('comment').length; i++) > { > - var tagcomment = xmlDoc[IdCurrent].getElementsByTagName('comment').item(i); > + var tagcomment = this.xmlDoc[IdCurrent].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 ); > @@ -389,7 +441,7 @@ > * set image nr > * currently only in slideshow used > */ > - $('divSlideshowImgNr').innerHTML = xmlDoc[IdCurrent].getElementsByTagName('imgnr').item(0).firstChild.data; > + $('divSlideshowImgNr').innerHTML = this.xmlDoc[IdCurrent].getElementsByTagName('imgnr').item(0).firstChild.data; > > > /** > @@ -398,8 +450,13 @@ > this.preloadXml(); > > > - }, // end function setImageData() > + }, > > + /** > + * setPrevNextThumb() > + * > + * code to generate a thumbnail with a <div><a><img> tag > + */ > setPrevNextThumb: function(thumbId, divId) > { > var ElemImg = Builder.node('img', {id: 'thumb'+thumbId, className: 'img_prevnextthumb', src: thumbSrc + thumbId}); > @@ -410,48 +467,37 @@ > ElemDiv.appendChild( ElemA ); > $(divId).appendChild(ElemDiv); > > - if(! preloadImageFinished[thumbId]) { > + if(! this.finishedPreloadedImages[thumbId]) { > Element.setOpacity('thumb'+thumbId,0.5); > } > > }, > > + > + // ----------------------------------------------------------------------------------- > + // Keyboard actions > + // ----------------------------------------------------------------------------------- > + > /** > - * setImageInfoLink > - * > - * set positions of info link > - * could only be done after image has been completly loaded > + * enableKeyboardNav() > */ > - setImageInfoLink: function() > - { > - if(! fullscreenActive) > - { > - $('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'); > - } > - }, > - > - // > - // enableKeyboardNav() > - // > enableKeyboardNav: function() { > document.onkeydown = this.keyboardAction; > }, > > - // > - // disableKeyboardNav() > - // > + /** > + * disableKeyboardNav() > + */ > disableKeyboardNav: function() { > document.onkeydown = ''; > }, > > - // > - // keyboardAction() > - // > - // very nice > - // http://www.mediaevent.de/javascript/needful_tables.html > - // > + /** > + * keyboardAction() > + * > + * very nice > + * http://www.mediaevent.de/javascript/needful_tables.html > + */ > keyboardAction: function(e) { > > if (e == null) { // ie > @@ -492,7 +538,7 @@ > } > else if ((keycode == 122)) // F11 > { > - if( fullscreenActive ) { > + if( this.fullscreenActive ) { > $('divSlideshowExit').show(); // hide exit button to force exit again with F11 > myLinImage.fullscreenStop(); > } else { > @@ -512,26 +558,31 @@ > myLinImage.moveLast(); > return false; > } > - else if( fullscreenActive && ((key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) ) // close fullscreen > + else if( this.fullscreenActive && ((key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) ) // close fullscreen > { > myLinImage.fullscreenStop(); > } > - else if(fullscreenActive && key == 's') // start/stop slideshow > + else if(this.fullscreenActive && key == 's') // start/stop slideshow > { > myLinImage.slideshowStartStop(); > } > - else if(fullscreenActive && key == 'p') // display previous image > + else if(this.fullscreenActive && key == 'p') // display previous image > { > myLinImage.disableKeyboardNav(); > myLinImage.movePrev(); > } > - else if(fullscreenActive && key == 'n') // display next image > + else if(this.fullscreenActive && key == 'n') // display next image > { > myLinImage.disableKeyboardNav(); > myLinImage.moveNext(); > } > }, > > + > + // ----------------------------------------------------------------------------------- > + // Preload functions > + // ----------------------------------------------------------------------------------- > + > /** > * preloadXml() > * Preload previous and next images. > @@ -544,16 +595,17 @@ > preloadXml: function() { > > // preload nextthumb from left to right > - if(xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) > + if(this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) > { > - for(var i = 0; i < xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) > + for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) > { > - var imgId = xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; > - if(! preloadXmlFinished[imgId]) > + var imgId = this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; > + > + if(! this.preloadXmlFinished[imgId]) > { > this.loadImageXml(imgId); > } > - else if(! preloadImageFinished[imgId] ) > + else if(! this.finishedPreloadedImages[imgId] ) > { > this.preloadImage(imgId); > } > @@ -561,16 +613,16 @@ > } > > // preload prevthumb from right to left > - if(xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) > + if(this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) > { > - for(var i = xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length-1; i >= 0; i--) > + for(var i = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length-1; i >= 0; i--) > { > - var imgId = xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; > - if(! preloadXmlFinished[imgId]) > + var imgId = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; > + if(! this.preloadXmlFinished[imgId]) > { > this.loadImageXml(imgId); > } > - else if(! preloadImageFinished[imgId] ) > + else if(! this.finishedPreloadedImages[imgId] ) > { > this.preloadImage(imgId); > } > @@ -583,35 +635,34 @@ > * > * will be called after getting the xml data > */ > - preloadImage: function(imgId) { > - if(! preloadImageFinished[imgId] ) > + preloadImage: function(imgId) > + { > + if(! this.finishedPreloadedImages[imgId] ) > { > /** > * set image width and height > */ > - var orgWidth = xmlDoc[imgId].getElementsByTagName('imgwidth').item(0).firstChild.data; > - var orgHeight = xmlDoc[imgId].getElementsByTagName('imgheight').item(0).firstChild.data; > - var sizeArray = scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); > + var orgWidth = this.xmlDoc[imgId].getElementsByTagName('imgwidth').item(0).firstChild.data; > + var orgHeight = this.xmlDoc[imgId].getElementsByTagName('imgheight').item(0).firstChild.data; > + var sizeArray = this.scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); > var imgWidth = sizeArray[0]; > var imgHeight = sizeArray[1]; > > - var currentImgSrc = imageSrc + imgId + '&width=' + imgWidth + '&height=' + imgHeight; > - > /** > * preload image > */ > - preloadImage[imgId] = new Image(); > + this.preloadImageSrc[imgId] = new Image(); > > - preloadImage[imgId].onload=function(){ > + this.preloadImageSrc[imgId].onload=function(){ > myLinImage.preloadImageFinished(imgId); > } > - preloadImage[imgId].src = currentImgSrc; > + this.preloadImageSrc[imgId].src = imageSrc + imgId + '&width=' + imgWidth + '&height=' + imgHeight; > } > }, > > preloadImageFinished: function(imgId) { > > - preloadImageFinished[imgId] = true; > + this.finishedPreloadedImages[imgId] = true; > > if( $('thumb'+imgId) ) // maybe its not here anymore > { > @@ -619,16 +670,21 @@ > } > > }, > + > + > + // ----------------------------------------------------------------------------------- > + // Slideshow functions > + // ----------------------------------------------------------------------------------- > > fullscreenStart: function() > { > - fullscreenActive = true; > + this.fullscreenActive = true; > > /** > * save old values to restore if slideshow ends > */ > - fullscreenOldMaxWidth = maxImageWidth; > - fullscreenOldMaxHeight = maxImageHeight; > + this.fullscreenOldMaxWidth = maxImageWidth; > + this.fullscreenOldMaxHeight = maxImageHeight; > > /** > * disable scrollbars > @@ -653,17 +709,15 @@ > */ > onWindowResize(); > }, > - > - > fullscreenStop: function() > { > - fullscreenActive = false; > + this.fullscreenActive = false; > > /** > * restore max image size > */ > - maxImageWidth = fullscreenOldMaxWidth; > - maxImageHeight = fullscreenOldMaxHeight; > + maxImageWidth = this.fullscreenOldMaxWidth; > + maxImageHeight = this.fullscreenOldMaxHeight; > > /** > * re-enable scrollbars > @@ -673,7 +727,7 @@ > /** > * delete preloaded images after stopping fullscreen > */ > - preloadImageFinished = new Array(); > + this.finishedPreloadedImages = new Array(); > > /** > * end slideshow with some superduper effects > @@ -697,75 +751,242 @@ > slideshowStartStop: function() > { > // start Slideshow > - if(! slideshowActive) > + if(! this.slideshowActive) > { > - slideshowActive = true; > + this.slideshowActive = true; > Element.setOpacity('ssImgStart',0.7); > - ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); > + this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); > } > else // stop Slideshow > { > - slideshowActive = false; > + this.slideshowActive = false; > Element.setOpacity('ssImgStart',1); > - clearTimeout(ssCurrentTimerID); > + clearTimeout(this.ssCurrentTimerID); > } > }, > slideshowPlay: function() > { > - if(nextThumbs[0] || ssLoop) > + if(this.nextThumbs[0] || this.ssLoop) > { > this.moveNext(); > - //ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", ssCurrentDelay); > + //this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); > } > else > { > // force stop slideshow > - slideshowActive = true; > + this.slideshowActive = true; > this.slideshowStartStop(); > } > }, > > slideshowChangeDelay: function() > { > - ssCurrentDelay = $('ssDelay').options[ $('ssDelay').selectedIndex ].value * 1000; > + this.ssCurrentDelay = $('ssDelay').options[ $('ssDelay').selectedIndex ].value * 1000; > //document.optionsForm.delay.options[document.optionsForm.delay.selectedIndex].value * 1000; > }, > slideshowChangeLoop: function() > { > - if(! ssLoop) { > - ssLoop = true; > + if(! this.ssLoop) { > + this.ssLoop = true; > Element.setOpacity('ssImgLoop',0.7); > } else { > - ssLoop = false; > + this.ssLoop = false; > Element.setOpacity('ssImgLoop',1); > } > }, > slideshowChangeRandom: function() > { > - if(! ssRandom) { > - ssRandom = true; > + if(! this.ssRandom) { > + this.ssRandom = true; > Element.setOpacity('ssImgRandom',0.7); > } else { > - ssRandom = false; > + this.ssRandom = false; > Element.setOpacity('ssImgRandom',1); > } > alert('This feature is currently not implemented, do we really need that?'); > + }, > + > + > + // ----------------------------------------------------------------------------------- > + // Image info functions > + // ----------------------------------------------------------------------------------- > + > + /** > + * setImageInfoLink() > + * > + * positions the info link on bottom right of the image > + * could onl... [truncated message content] |
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] |
From: <fan...@us...> - 2006-11-06 22:53:18
|
Revision: 4624 http://svn.sourceforge.net/linpha/?rev=4624&view=rev Author: fangehrn Date: 2006-11-06 14:52:41 -0800 (Mon, 06 Nov 2006) Log Message: ----------- 2006-11-06 flo * fixed some bugs * testing new folder thumbnail but they are to big in png format Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/index.php trunk/linpha2/lib/classes/image/imagemagick/thumbnail_folder.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.image.class.php trunk/linpha2/lib/classes/linpha.metadata.class.php trunk/linpha2/lib/classes/linpha.template.class.php trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/js/LinThumbnails.js trunk/linpha2/templates/default/fragments.php trunk/linpha2/templates/default/themes/default/colorsettings.php trunk/linpha2/templates/default/themes/default/css/global.css trunk/linpha2/templates/default/themes/default/css/view_img.css trunk/linpha2/templates/default/themes/default/css/view_thumb.css Added Paths: ----------- trunk/linpha2/lib/graphics/thumb_folder.png Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/ChangeLog 2006-11-06 22:52:41 UTC (rev 4624) @@ -1,3 +1,8 @@ +2006-11-06 flo + * fixed some bugs + * testing new folder thumbnail + but they are to big in png format + 2006-11-05 flo * change the linpha2/?id to linpha2/?linId * reorganized javascript classes and functions Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/index.php 2006-11-06 22:52:41 UTC (rev 4624) @@ -1,8 +1,9 @@ <?php - if(defined('LINPHA_DIR')) { - define('LINPHA_IS_INCLUDED',1); + if(!defined('LINPHA_IS_INCLUDED')) { + define('LINPHA_IS_INCLUDED',1); + } } else { define('LINPHA_DIR','.'); } Modified: trunk/linpha2/lib/classes/image/imagemagick/thumbnail_folder.php =================================================================== --- trunk/linpha2/lib/classes/image/imagemagick/thumbnail_folder.php 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/lib/classes/image/imagemagick/thumbnail_folder.php 2006-11-06 22:52:41 UTC (rev 4624) @@ -38,26 +38,27 @@ */ for($i=1; list($key,$value) = each($array_ids) ; $i++) { - LinFilesys::linExec("convert ". LinImage::getCachePath('thumb',$value) . " -resize 80x80 ".$tmp_folder."/".$i.".jpg" ); + LinFilesys::linExec("convert ". LinImage::getCachePath('thumb',$value) . " -quality 70 -resize 80x80 ".$tmp_folder."/".$i.".jpg" ); } - LinFilesys::linExec("convert -size 180x180 xc:lemonchiffon -mattecolor peru -frame 9x9+3+3 ".$this->output_file); +// LinFilesys::linExec("convert -size 182x182 xc:lemonchiffon -mattecolor peru -frame 9x9+3+3 -quality 70 ".$this->output_file); for($i=1; $i<=count($array_ids); $i++ ) { switch($i) { case 1: - LinFilesys::linExec("composite -compose atop -geometry +10+10 ".$tmp_folder."/1.jpg ".$this->output_file." ".$this->output_file); + //LinFilesys::linExec("composite -compose atop -geometry +15+15 -quality 70 ".$tmp_folder."/1.jpg ".$this->output_file." ".$this->output_file); + LinFilesys::linExec("composite -compose atop -geometry +15+15 -quality 70 ".$tmp_folder."/1.jpg ".LINPHA_DIR."/lib/graphics/thumb_folder.png ".$this->output_file); break; case 2: - LinFilesys::linExec("composite -compose atop -geometry +100+10 ".$tmp_folder."/2.jpg ".$this->output_file." ".$this->output_file); + LinFilesys::linExec("composite -compose atop -geometry +105+15 -quality 70 ".$tmp_folder."/2.jpg ".$this->output_file." ".$this->output_file); break; case 3: - LinFilesys::linExec("composite -compose atop -geometry +10+100 ".$tmp_folder."/3.jpg ".$this->output_file." ".$this->output_file); + LinFilesys::linExec("composite -compose atop -geometry +15+105 -quality 70 ".$tmp_folder."/3.jpg ".$this->output_file." ".$this->output_file); break; case 4: - LinFilesys::linExec("composite -compose atop -geometry +100+100 ".$tmp_folder."/4.jpg ".$this->output_file." ".$this->output_file); + LinFilesys::linExec("composite -compose atop -geometry +105+105 -quality 70 ".$tmp_folder."/4.jpg ".$this->output_file." ".$this->output_file); break; } } Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-11-06 22:52:41 UTC (rev 4624) @@ -26,7 +26,7 @@ /** * get content of the systems PATH variable and remove dirs not in open_basedir and safe_mode_exec_dir (only if activated) */ -function inGetPATH($array_path) +function linGetPATH($array_path) { /** * use the path variable instead of own array Modified: trunk/linpha2/lib/classes/linpha.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.image.class.php 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/lib/classes/linpha.image.class.php 2006-11-06 22:52:41 UTC (rev 4624) @@ -145,7 +145,15 @@ if($this->mode == 'thumb') { $this->cached_id = $this->photo_id; - $this->output_file = LinImage::getCachePath($this->mode,$this->cached_id); + if($this->img_type == 0) + { + $this->output_file = LinImage::getCachePath($this->mode,$this->cached_id).'.png'; + } + else + { + $this->output_file = LinImage::getCachePath($this->mode,$this->cached_id); + } + } elseif($this->mode == 'img') { @@ -590,7 +598,14 @@ */ function printFileToScreen() { - header("Content-type: image/jpeg"); + if( $this->img_type == 0 ) + { + header("Content-type: image/png"); + } + else + { + header("Content-type: image/jpeg"); + } /** * show correct image filename wenn selecting "save as" in browser Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-11-06 22:52:41 UTC (rev 4624) @@ -103,7 +103,7 @@ switch($last_part) { case 'filename': - $value = $filename; // is already escaped + $value = '<span title="'.$filename.'">'.$filename.'</span>'; // is already escaped break; case 'imagesize': $value = LinFilesys::niceFilesize( filesize( $full_filename ), 2 ); Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-06 22:52:41 UTC (rev 4624) @@ -373,7 +373,7 @@ 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 .= '<img src="'.LINPHA_CLIENT.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignleft.'" alt="" width="'.$size.'" height="'.$size.'" class="corner" />'; + $str .= '<img src="'.LINPHA_CLIENT.'/templates/misc/roundcorners.php?color='.$color.'&bgcolor='.$bgcolor.'&size='.$size.'&align='.$alignleft.'" alt="" width="'.$size.'" height="'.$size.'" />'; $str .= '</div>'; } else // currently only used in slideshow, does not work well in internet explorer Added: trunk/linpha2/lib/graphics/thumb_folder.png =================================================================== (Binary files differ) Property changes on: trunk/linpha2/lib/graphics/thumb_folder.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/lib/js/LinImage.js 2006-11-06 22:52:41 UTC (rev 4624) @@ -543,7 +543,7 @@ } else if ((keycode == 122)) // F11 { - if( this.fullscreenActive ) { + if( myLinImage.fullscreenActive ) { $('linDivSlideshowExit').show(); // hide exit button to force exit again with F11 myLinImage.fullscreenStop(); } else { @@ -563,20 +563,20 @@ myLinImage.moveLast(); return false; } - else if( this.fullscreenActive && ((key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) ) // close fullscreen + else if( myLinImage.fullscreenActive && ((key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) ) // close fullscreen { myLinImage.fullscreenStop(); } - else if(this.fullscreenActive && key == 's') // start/stop slideshow + else if(myLinImage.fullscreenActive && key == 's') // start/stop slideshow { myLinImage.slideshowStartStop(); } - else if(this.fullscreenActive && key == 'p') // display previous image + else if(myLinImage.fullscreenActive && key == 'p') // display previous image { myLinImage.disableKeyboardNav(); myLinImage.movePrev(); } - else if(this.fullscreenActive && key == 'n') // display next image + else if(myLinImage.fullscreenActive && key == 'n') // display next image { myLinImage.disableKeyboardNav(); myLinImage.moveNext(); @@ -702,7 +702,7 @@ * start slideshow with some superduper effects */ Effect.Appear('linDivSlideshowOverlay', { queue: 'end', duration: 1.0, from: 0.0, to: 0.9 }); - Effect.BlindDown('linDivSlideshowControls', { queue: 'end'} ); + Effect.BlindDown('linDivSlideshowControlsOuter', { queue: 'end'} ); Element.show('linDivSlideshowImage'); /** @@ -739,7 +739,7 @@ /** * end slideshow with some superduper effects */ - Effect.Fold('linDivSlideshowControls', { queue: 'end'} ); + Effect.Fold('linDivSlideshowControlsOuter', { queue: 'end'} ); Effect.Fade('linDivSlideshowOverlay', { queue: 'end', duration: 0.5, from: 0.9, to: 0.0 } ); Element.hide('linDivSlideshowImage'); @@ -767,7 +767,7 @@ else // stop Slideshow { this.slideshowActive = false; - Element.setOpacity('ssImgStart',1); + Element.setOpacity('linSsImgStart',1); clearTimeout(this.ssCurrentTimerID); } }, Modified: trunk/linpha2/lib/js/LinThumbnails.js =================================================================== --- trunk/linpha2/lib/js/LinThumbnails.js 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/lib/js/LinThumbnails.js 2006-11-06 22:52:41 UTC (rev 4624) @@ -107,11 +107,13 @@ divhtmltext = ''; if(linViewMode == 'thumbdetail') { + var style1text = ''; var style2text = ' linDivImgDetail'; - var style3text = 'linDivTextDetail'; + var style3text = 'class="linDivTextDetail"'; } else { + var style1text = ' style="width: ' + linTnSize + '"'; var style2text = ''; - var style3text = 'linDivText'; + var style3text = 'class="linDivText"'; } /** @@ -136,14 +138,14 @@ } divhtmltext += - '<div id="linDivThumb' + index + '" class="linDivThumb">' + + '<div id="linDivThumb' + index + '" class="linDivThumb"' + style1text + '>' + 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="linImgThumb" />' + - '</a></div><div class="' + style3text + '">' + linImgIds[index]['after'] + '</div></div>'; + '</a></div><div ' + style3text + '>' + linImgIds[index]['after'] + '</div></div>'; /** * flush buffer of divhtmltext on end of line Modified: trunk/linpha2/templates/default/fragments.php =================================================================== --- trunk/linpha2/templates/default/fragments.php 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/templates/default/fragments.php 2006-11-06 22:52:41 UTC (rev 4624) @@ -40,7 +40,7 @@ <li> <div> <?php if( linUseAjax() ) { ?> - <form action="" method="POST" onsubmit="new Ajax.Updater('menu', LINPHA_CLIENT + '/?linCat=ajax&reloadmenu&linId='+IdCurrent, {method: 'post', asynchronous:true, parameters:Form.serialize(this), evalScripts:true}); return false;"> + <form action="" method="POST" onsubmit="new Ajax.Updater('linDivMenu', LINPHA_CLIENT + '/?linCat=ajax&reloadmenu&linId='+IdCurrent, {method: 'post', asynchronous:true, parameters:Form.serialize(this), evalScripts:true}); return false;"> <?php } else { ?> <form action="<?php echo $this->URL_full; ?>" method="POST"> <?php } @@ -88,7 +88,7 @@ </div> <div style="float: left; margin-left: 40px; "> - <select id="linSsDelay" name="delay" size="1" onchange="myLinImage.slideshowChangeDelay()" title="<?php echo i18n("Delay"); ?>"> + <select id="linSsDelay" name="delay" size="1" class="linForms" onchange="myLinImage.slideshowChangeDelay()" title="<?php echo i18n("Delay"); ?>"> <option value="3">3 s</option> <option value="4">4 s</option> <option value="5" selected="selected">5 s</option> Modified: trunk/linpha2/templates/default/themes/default/colorsettings.php =================================================================== --- trunk/linpha2/templates/default/themes/default/colorsettings.php 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/templates/default/themes/default/colorsettings.php 2006-11-06 22:52:41 UTC (rev 4624) @@ -33,7 +33,7 @@ /** * font color */ - body { + body, #linDivMenu ul a, #linDivMenu ul span, #linDivMenu ul div { color: #<?php echo $_GET['font']; ?>; } @@ -58,3 +58,13 @@ background-color: #d5eeff; border: 1px solid grey; } + +/** + * menu + */ + #linDivMenu ul a:hover, #linDivMenu ul span:hover { + background: #bbbbbb; + } + #linDivMenu ul ul { + background-color: #eeeeee; + } Modified: trunk/linpha2/templates/default/themes/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/global.css 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/templates/default/themes/default/css/global.css 2006-11-06 22:52:41 UTC (rev 4624) @@ -214,11 +214,7 @@ text-align: center; text-decoration: none; - color: #000000; } - #linDivMenu ul a:hover, #linDivMenu ul span:hover { - background: #bbbbbb; - } #linDivMenu ul span { background: url(../images/expand.gif) no-repeat 100% 100%; } @@ -232,7 +228,6 @@ z-index: 500; border: 0; - background-color: #eeeeee; /** * relativ to parent element! be careful Modified: trunk/linpha2/templates/default/themes/default/css/view_img.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/view_img.css 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/templates/default/themes/default/css/view_img.css 2006-11-06 22:52:41 UTC (rev 4624) @@ -129,7 +129,7 @@ background-color: #000; } - #linDivSlideshowControls + #linDivSlideshowControlsOuter { position: absolute; top: 0px; @@ -143,7 +143,7 @@ z-index: 91; } - #linDivSlideshowControlsInner + #linDivSlideshowControls { padding: 5px; margin: 0px; Modified: trunk/linpha2/templates/default/themes/default/css/view_thumb.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/view_thumb.css 2006-11-05 17:42:35 UTC (rev 4623) +++ trunk/linpha2/templates/default/themes/default/css/view_thumb.css 2006-11-06 22:52:41 UTC (rev 4624) @@ -46,6 +46,7 @@ text-align: center; float: left; font-size: 8pt; + } .linDivImg { /* inner div with thumbnail */ margin: 0px; @@ -65,7 +66,12 @@ .linDivText { /* inner div with bottom or right text */ margin: 0px; padding: 0px; + padding-left: 5px; + padding-right: 5px; text-align: center; + + white-space: nowrap; + overflow: hidden; } .linDivTextDetail { margin: 0px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |