[Linpha-cvs] SF.net SVN: linpha: [4570] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-10-03 06:05:52
|
Revision: 4570 http://svn.sourceforge.net/linpha/?rev=4570&view=rev Author: fangehrn Date: 2006-10-02 23:05:34 -0700 (Mon, 02 Oct 2006) Log Message: ----------- 2006-10-03 flo * working on an ajax image view... ;-) Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/install/step4_selectdirectories.php trunk/linpha2/install/step5_getlogin.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/templates/default/view_img_static.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-02 19:34:03 UTC (rev 4569) +++ trunk/linpha2/ChangeLog 2006-10-03 06:05:34 UTC (rev 4570) @@ -1,3 +1,6 @@ +2006-10-03 flo + * working on an ajax image view... ;-) + 2006-10-02 flo * working on an ajax image view... ;-) Modified: trunk/linpha2/install/step4_selectdirectories.php =================================================================== --- trunk/linpha2/install/step4_selectdirectories.php 2006-10-02 19:34:03 UTC (rev 4569) +++ trunk/linpha2/install/step4_selectdirectories.php 2006-10-03 06:05:34 UTC (rev 4570) @@ -99,7 +99,9 @@ </div> (-> <?php echo installLinRealpath( installGetFullPath($tmp_dir) ); ?>) <br /><br /> +<input type="hidden" name="cmd_step4" value="save"> + <?php $array_check = array( Modified: trunk/linpha2/install/step5_getlogin.php =================================================================== --- trunk/linpha2/install/step5_getlogin.php 2006-10-02 19:34:03 UTC (rev 4569) +++ trunk/linpha2/install/step5_getlogin.php 2006-10-03 06:05:34 UTC (rev 4570) @@ -29,30 +29,34 @@ /** * validate settings */ -if(!isset($_POST['album_dir']) OR empty($_POST['album_dir']) OR - !isset($_POST['sql_dir']) OR empty($_POST['sql_dir']) OR - !isset($_POST['cache_dir']) OR empty($_POST['cache_dir']) OR - !isset($_POST['tmp_dir']) OR empty($_POST['tmp_dir']) ) +if(isset($_POST['cmd_step4'])) { - include_once(LINPHA_DIR.'/install/header_html.php'); - - echo tr("Validating Information")."... "; - echo failed_msg(); - echo "<br />".tr("Please Fill In All Fields").""; + if(!isset($_POST['album_dir']) OR empty($_POST['album_dir']) OR + !isset($_POST['sql_dir']) OR empty($_POST['sql_dir']) OR + !isset($_POST['cache_dir']) OR empty($_POST['cache_dir']) OR + !isset($_POST['tmp_dir']) OR empty($_POST['tmp_dir']) ) + { + include_once(LINPHA_DIR.'/install/header_html.php'); - echo "</form>"; - $show_next_button = false; + echo tr("Validating Information")."... "; + echo failed_msg(); + echo "<br />".tr("Please Fill In All Fields").""; + + echo "</form>"; + $show_next_button = false; + + include_once(LINPHA_DIR.'/install/footer.php'); + exit(); + } + else + { + /** + * save settings from previous page + */ + $dirs = initSessionValues(); + } - include_once(LINPHA_DIR.'/install/footer.php'); - exit(); -} - /** - * save settings from previous page - */ - $dirs = initSessionValues(); - - /** * goto manual mode */ if(isset($_SESSION['install_mode']) && $_SESSION['install_mode'] =="manual") @@ -60,49 +64,53 @@ header("Location: manual_install.php"); exit(); } + +} - include_once(LINPHA_DIR.'/install/header_html.php'); -/** - * validate writable directories - */ - 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'] ) ) +if(isset($_POST['cmd_step4'])) +{ + /** + * validate writable directories + */ + echo "<h2>".tr("Checking Directory Permissions")."</h2><br />"; + + /** + * checking album directory + */ + echo tr("Album Directory")."... "; + if( is_dir( $dirs['album'] ) ) { - echo success_msg(); - echo '<br /> ('.$_SESSION['album_dir'].' => '.installLinRealpath( $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 warning_msg(); - echo '<br /> ('.$_SESSION['album_dir'].' => '.installLinRealpath( $dirs['album'] ).')'; - echo "<br />".tr("Album Directory Not Writable. Some Features May Not Work")."<br />"; + echo failed_msg(); + echo '<br /> ('.$_SESSION['album_dir'].')'; + echo "<br />".tr("No Valid Directory Found")."!"; } - } - 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; - include_once(LINPHA_DIR.'/install/footer.php'); - exit(); - } + + /** + * checking sql, cache and tmp directory + */ + if(initInitialDirectories($dirs) != true) + { + $show_next_button = false; + include_once(LINPHA_DIR.'/install/footer.php'); + exit(); + } +} ?> <br /><br /> <hr /> Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-02 19:34:03 UTC (rev 4569) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-03 06:05:34 UTC (rev 4570) @@ -1086,13 +1086,37 @@ */ function viewImgAjax() { - print_r($GLOBALS['linpha']->template->output); - - /** - * @todo fetch comments - */ +?> +<xml> +<?php +foreach($this->xmldata['prev_thumb'] AS $value) +{ + echo '<prev_thumb>'.$value.'</prev_thumb>'."\n"; } +foreach($this->xmldata['next_thumb'] AS $value) +{ + echo '<next_thumb>'.$value.'</next_thumb>'."\n"; +} +foreach($GLOBALS['linpha']->template->output['image_infos'] AS $value) +{ ?> +<meta> + <name><?php echo $value['name']; ?></name><value><?php echo $value['value']; ?></value> +</meta> +<?php +} + +while($data = $GLOBALS['linpha']->template->output['image_comments']->FetchRow()) +{ ?> +<comment> + <time><?php echo $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> +<?php } + +} // end viewImgAjax() + /** * stuff used Img and Meta view * @uses LinImageview::viewImg @@ -1255,7 +1279,14 @@ { if($this->current_key >= $i) { - $GLOBALS['linpha']->template->output['prev_thumb'] .= $this->viewImgThumbHtml( $this->current_key - $i , 'prevnext' ); + if(isset($_GET['xml'])) + { + $this->xmldata['prev_thumb'][] = $this->photos_filtered[$this->current_key - $i]['id']; + } + else + { + $GLOBALS['linpha']->template->output['prev_thumb'] .= $this->viewImgThumbHtml( $this->current_key - $i , 'prevnext' ); + } } } @@ -1267,7 +1298,14 @@ { if($this->current_key < ( count($this->photos_filtered) - ($i+1) ) ) { - $GLOBALS['linpha']->template->output['next_thumb'] .= $this->viewImgThumbHtml($this->current_key + ($i+1) ,'prevnext'); + if(isset($_GET['xml'])) + { + $this->xmldata['next_thumb'][] = $this->photos_filtered[$this->current_key + ($i+1)]['id']; + } + else + { + $GLOBALS['linpha']->template->output['next_thumb'] .= $this->viewImgThumbHtml( $this->current_key + ($i+1) , 'prevnext' ); + } } } @@ -1275,9 +1313,13 @@ /** * set current image and thumb */ - $GLOBALS['linpha']->template->output['image'] = LINPHA_DIR.'/get_image.php?id=' . $this->photos_filtered[$this->current_key]['id']; - - $GLOBALS['linpha']->template->output['current_thumb'] = $this->viewImgThumbHtml( $this->current_key , 'current' ); + if(isset($_GET['xml'])) + { + } + else + { + $GLOBALS['linpha']->template->output['current_thumb'] = $this->viewImgThumbHtml( $this->current_key , 'current' ); + } } /** Modified: trunk/linpha2/templates/default/view_img_static.html.php =================================================================== --- trunk/linpha2/templates/default/view_img_static.html.php 2006-10-02 19:34:03 UTC (rev 4569) +++ trunk/linpha2/templates/default/view_img_static.html.php 2006-10-03 06:05:34 UTC (rev 4570) @@ -42,7 +42,7 @@ } else { ?> <!-- show image --> - <img id="mainimage" src="<?php echo $GLOBALS['linpha']->template->output['image']; ?>" /> + <img id="mainimage" src="<?php echo LINPHA_DIR.'/get_image.php?id='.$GLOBALS['linpha']->imgview->id_current; ?>" /> <br /><br /> <!-- comments --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |