spidertree-cvs Mailing List for SpiderTree
Status: Pre-Alpha
Brought to you by:
spiderr
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
(17) |
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
|---|
|
From: <sp...@us...> - 2004-11-20 20:07:37
|
Update of /cvsroot/spidertree/spidertree/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14108/templates Modified Files: spidertree_edit_album.tpl spidertree_header.tpl spidertree_user_main.tpl Added Files: megapixel.tpl Log Message: bring up to speed for CLYDE --- NEW FILE: megapixel.tpl --- <table border="1" cellspacing="1" cellpadding="5"> <tr> <td align="center" valign="top"><b>Megapixel</b></td> <td align="center" valign="top"><b>Dimensions</b></td> <td align="center" valign="top"><b>Print Size @ 300 dpi</b></td> <td align="center" valign="top"><b>Example size without scaling</b></td> </tr> <tr> <td align="center" valign="top">0.3</td> <td align="center" valign="top">640 x 480</td> <td align="center" valign="top">1.6" x 2.13"</td> <td align="left" valign="top">Passport Photo</td> </tr> <tr> <td align="center" valign="top">1.3</td> <td align="center" valign="top">1280 x 1024</td> <td align="center" valign="top">3.2" x 4.3"</td> <td align="left" valign="top">Wallet Photo</td> </tr> <tr> <td align="center" valign="top">2.1</td> <td align="center" valign="top">1600 x 1200</td> <td align="center" valign="top">4" x 5.3"</td> <td align="left" valign="top">Small Print</td> </tr> <tr> <td align="center" valign="top">3.3</td> <td align="center" valign="top">2048 x 1536</td> <td align="center" valign="top">5.1" x 6.8"</td> <td align="left" valign="top">Standard Print</td> </tr> <tr> <td align="center" valign="top">4.1</td> <td align="center" valign="top">2272 x 1704</td> <td align="center" valign="top">7.7" x 5.8"</td> <td align="left" valign="top">Enlarged Print</td> </tr> <tr> <td align="center" valign="top">5.2</td> <td align="center" valign="top">2560 x 1920</td> <td align="center" valign="top">6.4" x 8.5"</td> <td align="left" valign="top">2/3 Sheet of Letter Paper</td> </tr> <tr> <td align="center" valign="top">6.3</td> <td align="center" valign="top">2800 x 2100</td> <td align="center" valign="top">7.0" x 9.3"</td> <td align="left" valign="top">3/4 Sheet of Letter Paper</td> </tr> <tr> <td align="center" valign="top">7.0</td> <td align="center" valign="top">3000 x 2300</td> <td align="center" valign="top">7.6" x 10.0"</td> <td align="left" valign="top">7/8 Sheet of Letter Paper</td> </tr> <tr> <td align="center" valign="top">8.0</td> <td align="center" valign="top">3264 x 2448</td> <td align="center" valign="top">8.1" x 10.8"</td> <td align="left" valign="top">Full Sheet of Letter Paper</td> </tr> </table> Index: spidertree_edit_album.tpl =================================================================== RCS file: /cvsroot/spidertree/spidertree/templates/spidertree_edit_album.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- spidertree_edit_album.tpl 9 Feb 2004 06:23:03 -0000 1.2 +++ spidertree_edit_album.tpl 20 Nov 2004 20:07:28 -0000 1.3 @@ -24,7 +24,7 @@ </td> {sectionelse} <td align="center"> - <img src="{$tiki_url.spidertree_url}images/empty_album.gif" border="0"/><br />No Images + <img src="{$gTikiLoc.SPIDERTREE_PKG_URL}images/empty_album.gif" border="0"/><br />No Images </td> {/section} </tr> Index: spidertree_header.tpl =================================================================== RCS file: /cvsroot/spidertree/spidertree/templates/spidertree_header.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- spidertree_header.tpl 7 Feb 2004 18:25:20 -0000 1.2 +++ spidertree_header.tpl 20 Nov 2004 20:07:28 -0000 1.3 @@ -3,7 +3,7 @@ <table width="750" cellspacing="0" cellpadding="4" border="0"> <tr> <td class="stheader" width="160" class="ygtb" nowrap="nowrap"> <nobr><b class="b">{$siteTitle} Photos</b></nobr></td> - <td><a href="{$tiki_url.spidertree_url}start.php">Upload & Share Photos Now!</a></td> + <td><a href="{$gTikiLoc.SPIDERTREE_PKG_URL}start.php">Upload & Share Photos Now!</a></td> </tr> </table> <br/> Index: spidertree_user_main.tpl =================================================================== RCS file: /cvsroot/spidertree/spidertree/templates/spidertree_user_main.tpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- spidertree_user_main.tpl 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ spidertree_user_main.tpl 20 Nov 2004 20:07:28 -0000 1.2 @@ -1,7 +1,7 @@ <table border="0"> <tr> <td align="center" valign="middle"> - <a href="album.php"><img src="{$tiki_url.spidertree_url}images/create_album.gif" /><br />Create Album</a> + <a href="album.php"><img src="{$gTikiLoc.SPIDERTREE_PKG_URL}images/create_album.gif" /><br />Create Album</a> </td> {section name=ix loop=$albums} {if $albums[ix].thumbnail} |
|
From: <sp...@us...> - 2004-11-20 20:07:36
|
Update of /cvsroot/spidertree/spidertree/edit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14108/edit Modified Files: album.php album_list_inc.php image.php index.php Log Message: bring up to speed for CLYDE Index: album.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/edit/album.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- album.php 21 Apr 2004 20:18:45 -0000 1.8 +++ album.php 20 Nov 2004 20:07:26 -0000 1.9 @@ -1,33 +1,34 @@ <?php require_once('../../tiki_setup_inc.php'); - + require_once('../setup_inc.php'); + global $FORM, $gAlbum; - $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_edit_album.tpl'); + $spidertree_body = 'tikipackage:spidertree/spidertree_edit_album.tpl'; if( isset( $fAlbumSave ) ) { $new = empty( $gAlbum->mALID ); if( $gAlbum->store( $FORM ) ) { if( $new ) { - $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_upload.tpl'); + $spidertree_body = 'tikipackage:spidertree/spidertree_upload.tpl'; } else { include_once( 'album_list_inc.php' ); } $smarty->assign_by_ref( 'album', $FORM ); } else { - $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_edit_album_info.tpl'); + $spidertree_body = 'tikipackage:spidertree/spidertree_edit_album_info.tpl'; $smarty->assign_by_ref( 'FORM', $FORM ); $smarty->assign_by_ref( 'ERRORS', $gAlbum->mErrors ); } } elseif( isset( $fAlbumEditInfo ) ) { $smarty->assign_by_ref( 'FORM', $gAlbum->mRow ); - $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_edit_album_info.tpl'); + $spidertree_body = 'tikipackage:spidertree/spidertree_edit_album_info.tpl'; } elseif( empty( $gAlbum->mALID ) ) { - $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_edit_album_info.tpl'); + $spidertree_body = 'tikipackage:spidertree/spidertree_edit_album_info.tpl'; } else { $gAlbum->loadImages(); $smarty->assign_by_ref( 'images', $gAlbum->mImages ); $smarty->assign_by_ref( 'FORM', $gAlbum->mRow ); } - renderSpiderTree(); + renderSpiderTree( $spidertree_body ); ?> Index: album_list_inc.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/edit/album_list_inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- album_list_inc.php 21 Apr 2004 20:18:45 -0000 1.2 +++ album_list_inc.php 20 Nov 2004 20:07:27 -0000 1.3 @@ -3,5 +3,5 @@ $albums = &$album->getAlbums( $gTreeUser->mUserId ); $smarty->assign_by_ref( 'albums', $albums ); $smarty->assign_by_ref( 'FORM', $FORM ); - $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_user_main.tpl'); + $spidertree_body = 'tikipackage:spidertree/spidertree_user_main.tpl'; ?> Index: image.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/edit/image.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- image.php 21 Apr 2004 20:18:45 -0000 1.2 +++ image.php 20 Nov 2004 20:07:27 -0000 1.3 @@ -1,5 +1,6 @@ <?php require_once('../../tiki_setup_inc.php'); + require_once('../setup_inc.php'); global $FORM, $gImage; $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_edit_image.tpl'); Index: index.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/edit/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.php 21 Apr 2004 20:18:45 -0000 1.2 +++ index.php 20 Nov 2004 20:07:27 -0000 1.3 @@ -1,7 +1,8 @@ <?php require_once('../../tiki_setup_inc.php'); + require_once('../setup_inc.php'); include_once( 'album_list_inc.php' ); - renderSpiderTree(); + renderSpiderTree( $spidertree_body ); ?> |
|
From: <sp...@us...> - 2004-11-20 20:07:36
|
Update of /cvsroot/spidertree/spidertree In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14108 Modified Files: index.php setup_inc.php start.php thumbnailer.php tiki_setup_inc.php Log Message: bring up to speed for CLYDE Index: index.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.php 21 Apr 2004 20:18:44 -0000 1.2 +++ index.php 20 Nov 2004 20:07:25 -0000 1.3 @@ -1,8 +1,6 @@ <?php require_once('../tiki_setup_inc.php'); + require_once('setup_inc.php'); - $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_home.tpl'); - - renderSpiderTree(); - + renderSpiderTree( 'tikipackage:spidertree/spidertree_home.tpl' ); ?> Index: setup_inc.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/setup_inc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- setup_inc.php 21 Apr 2004 20:18:44 -0000 1.6 +++ setup_inc.php 20 Nov 2004 20:07:25 -0000 1.7 @@ -1,18 +1,6 @@ <?php // $Header$ - define( 'SPIDERTREE_CLASS_PATH', dirname( __FILE__ ).'/classes/' ); - - // hash containing all global Spidertree specific settings - global $gSpidertree, $gTreeUser, $smarty, $FORM; - $gSpidertree = array(); - - // load up site specific settings - require_once( 'config_inc.php' ); - - // create an album global var if we have an album ID - require_once( SPIDERTREE_CLASS_PATH.'SAlbum.php'); - global $fALID, $gAlbum; if( isset( $fALID ) ) { $FORM['alid'] = $fALID; @@ -39,4 +27,10 @@ $smarty->assign( 'SPIDERTREE_PKG_NAME', SPIDERTREE_PKG_NAME ); -?> \ No newline at end of file + + function renderSpiderTree( $pTemplate ) { + global $gTikiSystem; + $gTikiSystem->display( $pTemplate ); + } + +?> Index: start.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/start.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- start.php 21 Apr 2004 20:18:44 -0000 1.2 +++ start.php 20 Nov 2004 20:07:25 -0000 1.3 @@ -1,8 +1,7 @@ <?php require_once('../tiki_setup_inc.php'); + require_once('setup_inc.php'); - $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_start.tpl'); - - renderSpiderTree(); + renderSpiderTree( 'tikipackage:spidertree/spidertree_start.tpl' ); ?> Index: thumbnailer.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/thumbnailer.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- thumbnailer.php 21 Apr 2004 20:18:44 -0000 1.2 +++ thumbnailer.php 20 Nov 2004 20:07:25 -0000 1.3 @@ -1,6 +1,7 @@ <?php require_once( '../tiki_setup_inc.php' ); + require_once( 'setup_inc.php' ); global $dbTiki; Index: tiki_setup_inc.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/tiki_setup_inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- tiki_setup_inc.php 22 Apr 2004 06:59:06 -0000 1.2 +++ tiki_setup_inc.php 20 Nov 2004 20:07:25 -0000 1.3 @@ -1,22 +1,38 @@ <?php - global $siteTitle, $gTikiSystem, $gTikiUser, $user; - $gTreeUser = &$gTikiUser; + // $Header$ - $gTikiSystem->registerPackage( 'SpiderTree', dirname( __FILE__ ).'/' ); + // Compatibility environments + define( 'ENV_TIKIWIKI', 'tikiwiki' ); - require_once( SPIDERTREE_PKG_PATH.'setup_inc.php' ); + // hash containing all global Spidertree specific settings + global $gSpidertree, $gTreeUser, $smarty, $FORM; + $gSpidertree = array(); - define( 'STREE_BASE_CLASS', KERNEL_PKG_PATH.'TikiBase.php' ); + // Tikiwiki setup +# if( $gSpidertree['environment'] == ENV_TIKIWIKI ) { - $smarty->assign('siteTitle', $siteTitle.' Photos' ); + global $siteTitle, $gTikiSystem; + $gTikiSystem->registerPackage( 'SpiderTree', dirname( __FILE__).'/' ); + if( $gTikiSystem->isPackageActive( 'search' ) ) { + define( 'STREE_BASE_CLASS', KERNEL_PKG_PATH.'TikiBase.php' ); + require_once( 'classes/SUserTikiwiki.php' ); + + $smarty->assign('mid', SPIDERTREE_PKG_PATH.'templates/spidertree.tpl'); + $smarty->assign('siteTitle', $siteTitle.' Photos' ); - $gTikiSystem->registerAppMenu( 'spidertree', 'Photos', SPIDERTREE_PKG_URL.'index.php', 'tikipackage:'.SPIDERTREE_PKG_NAME.'/menu_spidertree.tpl' ); + $gTikiSystem->registerAppMenu( 'SpiderTree', 'Galleries', SPIDERTREE_PKG_URL, '', 'galleries'); + $gTreeUser = new SUserTikiwiki(); + } +# } - function renderSpiderTree() { - global $gTikiSystem; - $gTikiSystem->display( "tikipackage:".SPIDERTREE_PKG_NAME."/spidertree.tpl" ); - } + define( 'SPIDERTREE_CLASS_PATH', SPIDERTREE_PKG_PATH.'/classes/' ); + // load up site specific settings + require_once( 'config_inc.php' ); + + // create an album global var if we have an album ID + require_once( SPIDERTREE_CLASS_PATH.'SAlbum.php'); -?> \ No newline at end of file + +?> |
|
From: <sp...@us...> - 2004-11-20 20:07:36
|
Update of /cvsroot/spidertree/spidertree/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14108/classes Modified Files: SUserBase.php SUserTikiwiki.php Log Message: bring up to speed for CLYDE Index: SUserBase.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SUserBase.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SUserBase.php 21 Apr 2004 20:18:45 -0000 1.5 +++ SUserBase.php 20 Nov 2004 20:07:26 -0000 1.6 @@ -30,9 +30,8 @@ * @access public */ -require_once( STREE_BASE_CLASS ); -class SUser extends TikiUser { +class SUserBase extends TikiUser { // {{{ properties // }}} @@ -48,7 +47,7 @@ function SUserBase( $iUID=NULL ) { $this->mUID = $iUID; - TikiBase::TikiBase(); + TikiUser::TikiUser(); } // }}} @@ -68,25 +67,27 @@ } -function mkdir_p($target){ - if(file_exists($target) || is_dir($target)) - return 0; - if(substr($target, 0, 1) != '/') - $target = "/$target"; - if(eregi('\.\.', $target) || eregi("[^a-zA-Z0-9\._\-\/]", $target)) - return 0; - if( mkdir( $target ) ){ - return 1; - } - if( mkdir_p(substr($target, 0, (strrpos($target, '/')))) == 1) { - if( mkdir_p($target) == 1 ) +if( !function_exists( 'mkdir_p' ) ) { + function mkdir_p($target){ + if(file_exists($target) || is_dir($target)) + return 0; + if(substr($target, 0, 1) != '/') + $target = "/$target"; + if(eregi('\.\.', $target) || eregi("[^a-zA-Z0-9\._\-\/]", $target)) + return 0; + if( mkdir( $target ) ){ return 1; - else + } + if( mkdir_p(substr($target, 0, (strrpos($target, '/')))) == 1) { + if( mkdir_p($target) == 1 ) + return 1; + else + return 0; + } + else { return 0; } - else { - return 0; - } + } } ?> Index: SUserTikiwiki.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SUserTikiwiki.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- SUserTikiwiki.php 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ SUserTikiwiki.php 20 Nov 2004 20:07:26 -0000 1.2 @@ -30,7 +30,7 @@ * @access public */ -require_once( 'SUserBase.php' ); +require_once( SPIDERTREE_PKG_PATH.'classes/SUserBase.php' ); class SUserTikiwiki extends SUserBase { // {{{ properties |
|
From: <sp...@us...> - 2004-04-22 08:05:17
|
Update of /cvsroot/spidertree/spidertree/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5910/templates Modified Files: menu_spidertree.tpl spidertree_menu.tpl Log Message: use registerPackage Index: menu_spidertree.tpl =================================================================== RCS file: /cvsroot/spidertree/spidertree/templates/menu_spidertree.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- menu_spidertree.tpl 21 Apr 2004 20:18:54 -0000 1.1 +++ menu_spidertree.tpl 22 Apr 2004 06:59:07 -0000 1.2 @@ -1,5 +1,6 @@ -{if $user} -<a href="{$gTikiLoc.PHPBB_PKG_URL}search.php?search_id=newposts">{tr}View posts since last visit{/tr}</a><br /> -<a href="{$gTikiLoc.PHPBB_PKG_URL}search.php?search_id=egosearch">{tr}View your posts{/tr}</a><br /> -<a href="{$gTikiLoc.PHPBB_PKG_URL}search.php?search_id=unanswered">{tr}View unanswered posts{/tr}</a><br /> -{/if} +<div id="spidertreemenu" style="{$mnu_spidertreemenu}"> +<a class="menuoption" href="{$gTikiLoc.SPIDERTREE_PKG_URL}index.php" class="linkmenu">{tr}Browse All Photos{/tr}</a> +<a class="menuoption" href="{$gTikiLoc.SPIDERTREE_PKG_URL}edit/" class="linkmenu">{tr}Your Photos{/tr}</a> +<a class="menuoption" href="{$gTikiLoc.SPIDERTREE_PKG_URL}edit/album.php" class="linkmenu">{tr}Create Album{/tr}</a> +<a class="menuoption" href="{$gTikiLoc.SPIDERTREE_PKG_URL}edit/upload.php" class="linkmenu">{tr}Upload Photos{/tr}</a> +</div> Index: spidertree_menu.tpl =================================================================== RCS file: /cvsroot/spidertree/spidertree/templates/spidertree_menu.tpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- spidertree_menu.tpl 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ spidertree_menu.tpl 22 Apr 2004 06:59:07 -0000 1.2 @@ -2,12 +2,12 @@ {if $feature_menusfolderstyle eq 'y'} <a class="separator" href="javascript:icntoggle('spidertreemenu');"><img src="img/icons/fo.gif" style="border: 0" name="spidertreemenuicn" alt="{tr}WikiMenu{/tr}"/></a> {else}<a class="separator" href="javascript:toggle('spidertreemenu');">[-]</a>{/if} - <a class="separator" href="{$tiki_url.spidertree_url}index.php">{tr}Photos{/tr}</a> + <a class="separator" href="{$gTikiLoc.SPIDERTREE_PKG_URL}index.php">{tr}Photos{/tr}</a> {if $feature_menusfolderstyle ne 'y'}<a class="separator" href="javascript:toggle('spidertreemenu');">[+]</a>{/if} </div> <div id="spidertreemenu" style="{$mnu_spidertreemenu}"> - <a href="{$tiki_url.spidertree_url}index.php" class="linkmenu">{tr}Browse All Photos{/tr}</a><br /> - <a href="{$tiki_url.spidertree_url}edit/" class="linkmenu">{tr}Your Photos{/tr}</a><br /> - <a href="{$tiki_url.spidertree_url}edit/album.php" class="linkmenu">{tr}Create Album{/tr}</a><br /> - <a href="{$tiki_url.spidertree_url}edit/upload.php" class="linkmenu">{tr}Upload Photos{/tr}</a><br /> + <a href="{$gTikiLoc.SPIDERTREE_PKG_URL}index.php" class="linkmenu">{tr}Browse All Photos{/tr}</a><br /> + <a href="{$gTikiLoc.SPIDERTREE_PKG_URL}edit/" class="linkmenu">{tr}Your Photos{/tr}</a><br /> + <a href="{$gTikiLoc.SPIDERTREE_PKG_URL}edit/album.php" class="linkmenu">{tr}Create Album{/tr}</a><br /> + <a href="{$gTikiLoc.SPIDERTREE_PKG_URL}edit/upload.php" class="linkmenu">{tr}Upload Photos{/tr}</a><br /> </div> |
|
From: <sp...@us...> - 2004-04-22 08:01:55
|
Update of /cvsroot/spidertree/spidertree In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5910 Modified Files: tiki_setup_inc.php Log Message: use registerPackage Index: tiki_setup_inc.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/tiki_setup_inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tiki_setup_inc.php 21 Apr 2004 20:18:44 -0000 1.1 +++ tiki_setup_inc.php 22 Apr 2004 06:59:06 -0000 1.2 @@ -2,12 +2,7 @@ global $siteTitle, $gTikiSystem, $gTikiUser, $user; $gTreeUser = &$gTikiUser; - if( !defined( 'SPIDERTREE_PKG_PATH' ) ) { - define( 'SPIDERTREE_PKG_PATH', dirname( __FILE__ ).'/' ); - } - - $spiderTreeDir = basename(dirname(__FILE__)); - define( 'SPIDERTREE_PKG_NAME', $spiderTreeDir ); + $gTikiSystem->registerPackage( 'SpiderTree', dirname( __FILE__ ).'/' ); require_once( SPIDERTREE_PKG_PATH.'setup_inc.php' ); @@ -15,7 +10,7 @@ $smarty->assign('siteTitle', $siteTitle.' Photos' ); - $gTikiSystem->registerAppMenu( 'spidertree', 'Photos', constant( strtoupper( $spiderTreeDir ).'_PKG_URL' ).'index.php', 'tikipackage:'.$phpBBDir.'/menu_phpbb.tpl' ); + $gTikiSystem->registerAppMenu( 'spidertree', 'Photos', SPIDERTREE_PKG_URL.'index.php', 'tikipackage:'.SPIDERTREE_PKG_NAME.'/menu_spidertree.tpl' ); function renderSpiderTree() { |
Update of /cvsroot/spidertree/spidertree In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6308 Modified Files: config_inc.php index.php setup_inc.php start.php thumbnailer.php user_main.php Added Files: tiki_setup_inc.php Log Message: updates for TikiPro -Bonnie- --- NEW FILE: tiki_setup_inc.php --- <?php global $siteTitle, $gTikiSystem, $gTikiUser, $user; $gTreeUser = &$gTikiUser; if( !defined( 'SPIDERTREE_PKG_PATH' ) ) { define( 'SPIDERTREE_PKG_PATH', dirname( __FILE__ ).'/' ); } $spiderTreeDir = basename(dirname(__FILE__)); define( 'SPIDERTREE_PKG_NAME', $spiderTreeDir ); require_once( SPIDERTREE_PKG_PATH.'setup_inc.php' ); define( 'STREE_BASE_CLASS', KERNEL_PKG_PATH.'TikiBase.php' ); $smarty->assign('siteTitle', $siteTitle.' Photos' ); $gTikiSystem->registerAppMenu( 'spidertree', 'Photos', constant( strtoupper( $spiderTreeDir ).'_PKG_URL' ).'index.php', 'tikipackage:'.$phpBBDir.'/menu_phpbb.tpl' ); function renderSpiderTree() { global $gTikiSystem; $gTikiSystem->display( "tikipackage:".SPIDERTREE_PKG_NAME."/spidertree.tpl" ); } ?> Index: config_inc.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/config_inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- config_inc.php 9 Feb 2004 06:23:02 -0000 1.3 +++ config_inc.php 21 Apr 2004 20:18:44 -0000 1.4 @@ -1,8 +1,6 @@ <?php define( 'STREE_DB_PREFIX', '' ); - $gSpidertree['environment'] = ENV_TIKIWIKI; - $gSpidertree['content_url'] = 'uploads/'; $gSpidertree['content_path'] = SPIDERTREE_PKG_PATH.$gSpidertree['content_url']; ?> Index: index.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/index.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- index.php 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ index.php 21 Apr 2004 20:18:44 -0000 1.2 @@ -1,8 +1,8 @@ <?php - require_once('../setup_inc.php'); + require_once('../tiki_setup_inc.php'); - $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_home.tpl'); + $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_home.tpl'); renderSpiderTree(); - + ?> Index: setup_inc.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/setup_inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- setup_inc.php 9 Feb 2004 06:23:02 -0000 1.5 +++ setup_inc.php 21 Apr 2004 20:18:44 -0000 1.6 @@ -1,9 +1,7 @@ <?php // $Header$ - define( 'SPIDERTREE_CLASS_PATH', SPIDERTREE_PKG_PATH.'/classes/' ); - // Compatibility environments - define( 'ENV_TIKIWIKI', 'tikiwiki' ); + define( 'SPIDERTREE_CLASS_PATH', dirname( __FILE__ ).'/classes/' ); // hash containing all global Spidertree specific settings global $gSpidertree, $gTreeUser, $smarty, $FORM; @@ -11,21 +9,6 @@ // load up site specific settings require_once( 'config_inc.php' ); - - // Tikiwiki setup - if( $gSpidertree['environment'] == ENV_TIKIWIKI ) { - - global $siteTitle, $tikilib; - define( 'STREE_BASE_CLASS', KERNEL_PKG_PATH.'TikiBase.php' ); - require_once( 'classes/SUserTikiwiki.php' ); - - $smarty->assign('mid', SPIDERTREE_PKG_PATH.'templates/spidertree.tpl'); - $smarty->assign('siteTitle', $siteTitle.' Photos' ); - - $tikilib->registerAppMenu( 'spidertree', 'spidertree_menu.tpl' ); - - $gTreeUser = new SUserTikiwiki(); - } // create an album global var if we have an album ID require_once( SPIDERTREE_CLASS_PATH.'SAlbum.php'); @@ -36,7 +19,8 @@ } elseif( empty( $FORM['alid'] ) ) { $FORM['alid'] = NULL; // prevent Undefined variable warning } - $gAlbum = new SAlbum( $FORM['alid'], $gTreeUser->mUID ); + + $gAlbum = new SAlbum( $FORM['alid'], $gTreeUser->mUserId ); if( $gAlbum->load() ) { $smarty->assign_by_ref('album', $gAlbum->mRow ); } @@ -53,11 +37,6 @@ $smarty->assign_by_ref('image', $gImage->mRow ); } + $smarty->assign( 'SPIDERTREE_PKG_NAME', SPIDERTREE_PKG_NAME ); - - function renderSpiderTree() { - global $smarty; - $smarty->display("tiki.tpl"); - } - -?> +?> \ No newline at end of file Index: start.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/start.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- start.php 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ start.php 21 Apr 2004 20:18:44 -0000 1.2 @@ -1,8 +1,8 @@ <?php - require_once('../setup_inc.php'); + require_once('../tiki_setup_inc.php'); + + $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_start.tpl'); - $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_start.tpl'); - renderSpiderTree(); ?> Index: thumbnailer.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/thumbnailer.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- thumbnailer.php 13 Feb 2004 06:54:55 -0000 1.1 +++ thumbnailer.php 21 Apr 2004 20:18:44 -0000 1.2 @@ -1,6 +1,6 @@ <?php - require_once( '../setup_inc.php' ); + require_once( '../tiki_setup_inc.php' ); global $dbTiki; Index: user_main.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/user_main.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- user_main.php 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ user_main.php 21 Apr 2004 20:18:44 -0000 1.2 @@ -1,6 +1,6 @@ <?php - require_once('../setup_inc.php'); + require_once('../tiki_setup_inc.php'); $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_user_main.tpl'); |
|
From: <sp...@us...> - 2004-04-21 20:20:16
|
Update of /cvsroot/spidertree/spidertree/edit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6308/edit Modified Files: album.php album_list_inc.php image.php index.php upload.php Log Message: updates for TikiPro -Bonnie- Index: album.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/edit/album.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- album.php 9 Feb 2004 06:23:02 -0000 1.7 +++ album.php 21 Apr 2004 20:18:45 -0000 1.8 @@ -1,28 +1,28 @@ <?php - require_once('../../setup_inc.php'); - + require_once('../../tiki_setup_inc.php'); + global $FORM, $gAlbum; - $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_edit_album.tpl'); + $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_edit_album.tpl'); if( isset( $fAlbumSave ) ) { $new = empty( $gAlbum->mALID ); if( $gAlbum->store( $FORM ) ) { if( $new ) { - $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_upload.tpl'); + $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_upload.tpl'); } else { include_once( 'album_list_inc.php' ); } $smarty->assign_by_ref( 'album', $FORM ); } else { - $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_edit_album_info.tpl'); + $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_edit_album_info.tpl'); $smarty->assign_by_ref( 'FORM', $FORM ); $smarty->assign_by_ref( 'ERRORS', $gAlbum->mErrors ); } } elseif( isset( $fAlbumEditInfo ) ) { $smarty->assign_by_ref( 'FORM', $gAlbum->mRow ); - $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_edit_album_info.tpl'); + $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_edit_album_info.tpl'); } elseif( empty( $gAlbum->mALID ) ) { - $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_edit_album_info.tpl'); + $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_edit_album_info.tpl'); } else { $gAlbum->loadImages(); $smarty->assign_by_ref( 'images', $gAlbum->mImages ); Index: album_list_inc.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/edit/album_list_inc.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- album_list_inc.php 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ album_list_inc.php 21 Apr 2004 20:18:45 -0000 1.2 @@ -1,6 +1,7 @@ <?php - $albums = &$gTreeUser->getAlbums(); + $album = new SAlbum(); + $albums = &$album->getAlbums( $gTreeUser->mUserId ); $smarty->assign_by_ref( 'albums', $albums ); $smarty->assign_by_ref( 'FORM', $FORM ); - $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_user_main.tpl'); + $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_user_main.tpl'); ?> Index: image.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/edit/image.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- image.php 9 Feb 2004 06:23:02 -0000 1.1 +++ image.php 21 Apr 2004 20:18:45 -0000 1.2 @@ -1,8 +1,8 @@ <?php - require_once('../../setup_inc.php'); + require_once('../../tiki_setup_inc.php'); global $FORM, $gImage; - $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_edit_image.tpl'); + $smarty->assign('spidertree_body','tikipackage:'.SPIDERTREE_PKG_NAME.'/spidertree_edit_image.tpl'); if( isset( $fImageSave ) ) { } Index: index.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/edit/index.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- index.php 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ index.php 21 Apr 2004 20:18:45 -0000 1.2 @@ -1,5 +1,5 @@ <?php - require_once('../../setup_inc.php'); + require_once('../../tiki_setup_inc.php'); include_once( 'album_list_inc.php' ); Index: upload.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/edit/upload.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- upload.php 9 Feb 2004 06:23:02 -0000 1.5 +++ upload.php 21 Apr 2004 20:18:45 -0000 1.6 @@ -1,5 +1,5 @@ <?php - require_once('../../setup_inc.php'); + require_once('../../tiki_setup_inc.php'); if( isset($HTTP_POST_FILES['UPLOAD']) ) { $gAlbum->processUpload( $HTTP_POST_FILES ); |
|
From: <sp...@us...> - 2004-04-21 20:20:13
|
Update of /cvsroot/spidertree/spidertree/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6308/classes Modified Files: SAlbum.php SImage.php SUserBase.php Log Message: updates for TikiPro -Bonnie- Index: SAlbum.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SAlbum.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- SAlbum.php 13 Feb 2004 06:54:55 -0000 1.8 +++ SAlbum.php 21 Apr 2004 20:18:44 -0000 1.9 @@ -1,18 +1,18 @@ <?php // +----------------------------------------------------------------------+ -// | PHP version 4.?? +// | PHP version 4.?? // +----------------------------------------------------------------------+ -// | Copyright (c) 2003 tikwiki.org +// | Copyright (c) 2003 tikwiki.org // +----------------------------------------------------------------------+ // | Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // | All Rights Reserved. See copyright.txt for details and a complete list of authors. // | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details -// | -// | For comments, please use PEAR documentation standards!!! +// | +// | For comments, please use PEAR documentation standards!!! // | -> see http://pear.php.net/manual/en/standards.comments.php -// | and http://www.phpdoc.org/ +// | and http://www.phpdoc.org/ // +----------------------------------------------------------------------+ -// | Authors: spider <sp...@st...> +// | Authors: spider <sp...@st...> // +----------------------------------------------------------------------+ // // $Id$ @@ -40,14 +40,14 @@ class SAlbum extends TikiBase { // {{{ properties - + /** The album id **/ var $mALID; /** The acct id that owns this album **/ var $mUID; /** Array of images for this album, hash indexed my image_id **/ var $mImages; - + // }}} // {{{ SAlbum constructor @@ -65,8 +65,8 @@ TikiBase::TikiBase(); } // }}} - - + + // {{{ load /** * Define and load Smarty components @@ -113,8 +113,8 @@ return( count( $this->mErrors ) == 0 ); } // }}} - - + + // {{{ verify /** * This verifies data integrity. NOTE: pass by reference is crucial, because some modifications @@ -129,7 +129,7 @@ foreach( array_keys($pParams) as $key ) { $pParams[$key] = trim( $pParams[$key] ); } - + // url name was not passed in, we can try to make one... if( empty( $pParams['url'] ) ) { if( isset( $pParams['title'] ) ) { @@ -162,7 +162,7 @@ // {{{ store /** - * this method stores the data. + * this method stores the data. * * @param inParams hash of values to store in database * @return TRUE if successful, FALSE if not. mErrors will hold error strings @@ -188,7 +188,7 @@ return( count( $this->mErrors ) == 0 ); } // }}} - + // {{{ expunge /** * this method removes a "row" from the database @@ -252,9 +252,22 @@ } // }}} + function getAlbums( $pUserId ) { + $ret = NULL; + if( $this->mUID ) { + $ret = array(); + $sql = "SELECT * FROM album WHERE user_id=? ORDER BY path"; + $rs = $this->db->Execute($sql, array( $pUserId ) ); + while( !$rs->EOF ) { + array_push( $ret, $rs->fields ); + $rs->MoveNext(); + } + } + return $ret; + } } - + ?> Index: SImage.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SImage.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SImage.php 13 Feb 2004 06:54:55 -0000 1.5 +++ SImage.php 21 Apr 2004 20:18:45 -0000 1.6 @@ -1,18 +1,18 @@ <?php // +----------------------------------------------------------------------+ -// | PHP version 4.?? +// | PHP version 4.?? // +----------------------------------------------------------------------+ -// | Copyright (c) 2003 tikwiki.org +// | Copyright (c) 2003 tikwiki.org // +----------------------------------------------------------------------+ // | Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // | All Rights Reserved. See copyright.txt for details and a complete list of authors. // | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details -// | -// | For comments, please use PEAR documentation standards!!! +// | +// | For comments, please use PEAR documentation standards!!! // | -> see http://pear.php.net/manual/en/standards.comments.php -// | and http://www.phpdoc.org/ +// | and http://www.phpdoc.org/ // +----------------------------------------------------------------------+ -// | Authors: spider <sp...@st...> +// | Authors: spider <sp...@st...> // +----------------------------------------------------------------------+ // // $Id$ @@ -45,12 +45,12 @@ class SImage extends TikiBase { // {{{ properties - + /** The image id **/ var $mIMID; /** The acct id that owns this image **/ var $mUID; - + // }}} // {{{ SImage constructor @@ -68,8 +68,8 @@ TikiBase::TikiBase(); } // }}} - - + + // {{{ load /** * Define and load Smarty components @@ -82,7 +82,7 @@ global $gSpidertree; //debug(); if( !empty( $this->mIMID ) ) { - $sql = "SELECT i.*, i.image_id AS imid + $sql = "SELECT i.*, i.image_id AS imid FROM ".STREE_DB_PREFIX."image i WHERE i.image_id=?"; $rs = $this->mDB->Execute($sql, array( $this->mIMID ) ); if( empty($rs) || empty( $rs->fields['image_id'] ) ) { @@ -115,7 +115,7 @@ $this->mErrors['user'] = 'You must be logged in to create an image.'; } else { // move the uploaded file - if( empty($this->IMID ) ) { + if( empty($this->IMID ) ) { $pParams['new_image_id'] = $this->mDB->GenID( 'image_id_seq' ); $pParams['file_name'] = $pParams['new_image_id'].'.'.substr( $pParams['dest_name'], 0, (255-($pParams['new_image_id'] % 10) ) ); if( move_uploaded_file( $pParams['tmp_loc'], getUploadPath( $this->mUID ).$pParams['file_name'] ) ) { @@ -126,8 +126,8 @@ $this->mErrors['upload'] = 'Could not store uploaded file '.basename( $pParams['dest_loc'] ).'.'; } } - - + + if( empty( $pParams['ALID'] ) || !is_numeric( $pParams['ALID'] ) ) { // need to select user's root album $pParams['ALID'] = $this->getRootAlbum( $this->mUID ); @@ -147,7 +147,7 @@ // {{{ store /** - * this method stores the data. + * this method stores the data. * * @param inParams hash of values to store in database * @return TRUE if successful, FALSE if not. mErrors will hold error strings @@ -175,19 +175,19 @@ //pvd( $pParams ); //print "sql $sql"; $rs = $this->mDB->Execute($sql, $bindVars ); - + if( $new ) { // insert into thumbnail queue $sql2 = "INSERT INTO ".STREE_DB_PREFIX."thumbnail_queue ( image_id ) VALUES ( ? )"; $rs = $this->mDB->Execute($sql2, array( $pParams['IMID'] ) ); } - + $this->mDB->CompleteTrans(); } return( count( $this->mErrors ) == 0 ); } // }}} - + // {{{ expunge /** * this method removes a "row" from the database @@ -232,13 +232,13 @@ } else { $ret = $rs->fields['album_id']; } - + } return( count( $this->mErrors ) == 0 ); } // }}} - - + + function getFileInfo () { if( isset( $this->mRow['file_path'] ) ) { } @@ -259,7 +259,7 @@ $this->mDB->CompleteTrans(); } } - + } @@ -303,7 +303,7 @@ } else { $ret = SPIDERTREE_PKG_URL.'images/generating_thumbnails.gif'; } - + return $ret; } @@ -312,9 +312,9 @@ // Snagged from Gallery for reference - + function getDimensions($file, $regs=false) { - global $gallery; + global $gallery; if ($regs === false) $regs = getimagesize($file); @@ -323,7 +323,7 @@ else if (isDebugging()) echo "<br>" .sprintf(_("PHP's %s unable to determine dimensions."), "getimagesize()") ."<br>"; - + // Just in case php can't determine dimensions. switch($gallery->app->graphics) @@ -335,8 +335,8 @@ NetPBM("pnmfile", "--allimages")); break; case "ImageMagick": - // This fails under windows, IM isn't returning parsable status output. - list($lines, $status) = + // This fails under windows, IM isn't returning parsable status output. + list($lines, $status) = exec_internal(ImCmd("identify", fs_import_filename($file))); break; default: @@ -369,7 +369,7 @@ } function resize_image($src, $dest, $target=0, $target_fs=0, $keepProfiles=0) { - global $gallery; + global $gallery; if (!strcmp($src,$dest)) { $useTemp = true; @@ -387,8 +387,8 @@ if ($target === 'off') { $target = 0; } - - // Check for images smaller then target size, don't blow them up. + + // Check for images smaller then target size, don't blow them up. $regs = getDimensions($src, $regs); if ((empty($target) || ($regs[0] <= $target && $regs[1] <= $target)) && (empty($target_fs) || ((int) fs_filesize($src) >> 10) <= $target_fs)) { @@ -411,14 +411,14 @@ if (!isset($quality)) { $quality=$gallery->album->fields['last_quality']; } - processingMsg(" ". sprintf(_("target file size %d kbytes"), + processingMsg(" ". sprintf(_("target file size %d kbytes"), $target_fs)."\n"); do { compress_image($src, $out, $target, $quality, $keepProfiles); $prev_quality=$quality; printf(_("-> file size %d kbytes"), round($filesize)); - processingMsg(" " . sprintf(_("trying quality %d%%"), + processingMsg(" " . sprintf(_("trying quality %d%%"), $quality)); clearstatcache(); $filesize= (int) fs_filesize($out) >> 10; @@ -443,7 +443,7 @@ $quality++; } } - } while ($max_quality-$min_quality > 2 && + } while ($max_quality-$min_quality > 2 && abs(($filesize-$target_fs)/$target_fs) > .02 ); $gallery->album->fields['last_quality']=$prev_quality; @@ -520,7 +520,7 @@ $args = '-xy'; } else if (!strcmp($target, 'tv')) { // Because of NetPBM inconsistencies, the only - // way to do this transformation on *all* + // way to do this transformation on *all* // versions of NetPBM is to pipe two separate // operations in sequence. Versions >= 10.13 // have the new -xform flag, and versions <= @@ -532,14 +532,14 @@ $args2 = ' | ' . NetPBM('pnmflip', '-r180'); } else { $args = ''; - } + } $err = exec_wrapper(toPnmCmd($src) . ' | ' . NetPBM('pnmflip', $args) . $args2 . - ' | ' . fromPnmCmd($out)); + ' | ' . fromPnmCmd($out)); - // copy exif headers from original image to rotated image + // copy exif headers from original image to rotated image if (isset($gallery->app->use_exif)) { $path = $gallery->app->use_exif; exec_internal(fs_import_filename($path, 1) . " -te $srcFile $outFile"); @@ -547,7 +547,7 @@ break; case "ImageMagick": if (!strcmp($target, '-90')) { - $im_cmd = '-rotate 90'; + $im_cmd = '-rotate 90'; } else if (!strcmp($target, '180')) { $im_cmd = '-rotate 180'; } else if (!strcmp($target, '90')) { @@ -563,8 +563,8 @@ } else { $im_cmd = ''; } - - + + $src = fs_import_filename($src); $out = fs_import_filename($out); $err = exec_wrapper(ImCmd('convert', "$im_cmd $srcFile $outFile")); @@ -574,7 +574,7 @@ echo "<br>". _("You have no graphics package configured for use!") ."<br>"; return 0; break; - } + } } if (fs_file_exists("$out") && fs_filesize("$out") > 0) { @@ -591,7 +591,7 @@ function cut_image($src, $dest, $x, $y, $width, $height) { - global $gallery; + global $gallery; if (!strcmp($src,$dest)) { $useTemp = true; $out = "$dest.tmp"; @@ -665,7 +665,7 @@ // Preserve comment, EXIF data if a JPEG if $keepProfiles is set. $err = exec_wrapper(ImCmd('convert', "-quality $quality " . ($target ? "-size ${target}x${target} " : '') - . ($keepProfiles ? ' ' : ' +profile \'*\' ') + . ($keepProfiles ? ' ' : ' +profile \'*\' ') . $src . ($target ? " -geometry ${target}x${target} " : '') . $out)); @@ -827,7 +827,7 @@ $filename = "\"$filename\""; } } - + return $filename; } @@ -838,4 +838,5 @@ + ?> Index: SUserBase.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SUserBase.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SUserBase.php 9 Feb 2004 06:23:02 -0000 1.4 +++ SUserBase.php 21 Apr 2004 20:18:45 -0000 1.5 @@ -1,18 +1,18 @@ <?php // +----------------------------------------------------------------------+ -// | PHP version 4.?? +// | PHP version 4.?? // +----------------------------------------------------------------------+ -// | Copyright (c) 2003 tikwiki.org +// | Copyright (c) 2003 tikwiki.org // +----------------------------------------------------------------------+ // | Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // | All Rights Reserved. See copyright.txt for details and a complete list of authors. // | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details -// | -// | For comments, please use PEAR documentation standards!!! +// | +// | For comments, please use PEAR documentation standards!!! // | -> see http://pear.php.net/manual/en/standards.comments.php -// | and http://www.phpdoc.org/ +// | and http://www.phpdoc.org/ // +----------------------------------------------------------------------+ -// | Authors: spider <sp...@st...> +// | Authors: spider <sp...@st...> // +----------------------------------------------------------------------+ // // $Id$ @@ -32,15 +32,9 @@ require_once( STREE_BASE_CLASS ); -class SUserBase extends TikiBase { +class SUser extends TikiUser { // {{{ properties - - /** The user id **/ - var $mUID; - - /** A "row" of data for this user, in associative has format **/ - var $mRow; - + // }}} // {{{ SUserBase constructor @@ -71,9 +65,9 @@ } return $ret; } - + } - + function mkdir_p($target){ if(file_exists($target) || is_dir($target)) return 0; @@ -93,6 +87,6 @@ else { return 0; } -} +} ?> |
|
From: <sp...@us...> - 2004-04-21 20:19:59
|
Update of /cvsroot/spidertree/spidertree/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6308/templates Modified Files: spidertree.tpl spidertree_edit_album_info.tpl Added Files: menu_spidertree.tpl Log Message: updates for TikiPro -Bonnie- --- NEW FILE: menu_spidertree.tpl --- {if $user} <a href="{$gTikiLoc.PHPBB_PKG_URL}search.php?search_id=newposts">{tr}View posts since last visit{/tr}</a><br /> <a href="{$gTikiLoc.PHPBB_PKG_URL}search.php?search_id=egosearch">{tr}View your posts{/tr}</a><br /> <a href="{$gTikiLoc.PHPBB_PKG_URL}search.php?search_id=unanswered">{tr}View unanswered posts{/tr}</a><br /> {/if} Index: spidertree.tpl =================================================================== RCS file: /cvsroot/spidertree/spidertree/templates/spidertree.tpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- spidertree.tpl 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ spidertree.tpl 21 Apr 2004 20:18:56 -0000 1.2 @@ -1,3 +1,3 @@ -{include file="tikipackage:spidertree/spidertree_header.tpl"} +{include file="tikipackage:`$SPIDERTREE_PKG_NAME`/spidertree_header.tpl"} {include file=$spidertree_body} Index: spidertree_edit_album_info.tpl =================================================================== RCS file: /cvsroot/spidertree/spidertree/templates/spidertree_edit_album_info.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- spidertree_edit_album_info.tpl 9 Feb 2004 06:23:03 -0000 1.2 +++ spidertree_edit_album_info.tpl 21 Apr 2004 20:18:56 -0000 1.3 @@ -1,9 +1,10 @@ <form enctype="multipart/form-data" method="post" action="album.php" id="editpageform"> + <input type="hidden" name="FORM[alid]" value="{$FORM.alid}" /> -<table class="stdialog" border="0"> +<table class="panel" border="0"> <tr> - <td colspan="2" class="stdialogtop"><h2>{if $FORM.alid}Edit Album: {$FORM.title}{else}Create New Album{/if}</h2></td> + <td colspan="2"><h2 class="paneltitle">{if $FORM.alid}Edit Album: {$FORM.title}{else}Create New Album{/if}</h2></td> </tr> <tr> <td colspan="2"><h3>Name and Description</h3></td> @@ -64,7 +65,7 @@ <td> <b>Password Protected</b><br/> Only those who know the following password can access this album. - + <p> <b>Question:</b><br/> Enter a question that visitors to this gallery will be prompted to answer.<br/> |
|
From: <sp...@us...> - 2004-02-13 07:00:23
|
Update of /cvsroot/spidertree/spidertree/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25018/classes Modified Files: SAlbum.php SImage.php Log Message: first pass at quasi-working thumbnails Index: SAlbum.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SAlbum.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- SAlbum.php 9 Feb 2004 06:23:02 -0000 1.7 +++ SAlbum.php 13 Feb 2004 06:54:55 -0000 1.8 @@ -98,7 +98,7 @@ * @return TRUE if successful, FALSE if not. mErrors will hold error strings * @access public **/ - function loadImages( $iImageSize=IMAGE_SIZE_SMALL ) { + function loadImages( $iImageSize=IMAGE_SIZE_THUMB ) { if( !empty( $this->mALID ) ) { $sql = "SELECT i.* FROM ".STREE_DB_PREFIX."album a, ".STREE_DB_PREFIX."album_map am, ".STREE_DB_PREFIX."image i WHERE a.album_id=? AND am.album_id=a.album_id AND am.image_id=i.image_id"; Index: SImage.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SImage.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SImage.php 9 Feb 2004 06:23:02 -0000 1.4 +++ SImage.php 13 Feb 2004 06:54:55 -0000 1.5 @@ -38,9 +38,10 @@ require_once( KERNEL_PKG_PATH.'TikiBase.php' ); define( 'IMAGE_SIZE_ORIGINAL', 'upload' ); -define( 'IMAGE_SIZE_SMALL', 'small' ); -define( 'IMAGE_SIZE_MEDIUM', 'medium' ); -define( 'IMAGE_SIZE_LARGE', 'large' ); +define( 'IMAGE_SIZE_THUMB', '120' ); +define( 'IMAGE_SIZE_SMALL', '200' ); +define( 'IMAGE_SIZE_MEDIUM', '400' ); +define( 'IMAGE_SIZE_LARGE', '800' ); class SImage extends TikiBase { // {{{ properties @@ -243,6 +244,22 @@ } } + function generateThumbnails() { + $sizeArray = array( IMAGE_SIZE_LARGE, IMAGE_SIZE_MEDIUM, IMAGE_SIZE_SMALL, IMAGE_SIZE_THUMB ); + if( $this->mUID && (isset( $this->mRow['file_name'] ) || ($this->load() && isset( $this->mRow['file_name'] ) ) ) ) { + $this->mDB->StartTrans(); + foreach( $sizeArray as $dim ) { + $exec = "convert -size ".$dim."x".$dim." ".getImagePath( $this->mRow['file_name'], $this->mUID, IMAGE_SIZE_ORIGINAL )." +profile '*' -resize ".$dim."x".$dim." ".getImagePath( $this->mRow['file_name'], $this->mUID, $dim ); +$ret = exec( $exec ); +pvd( $ret ); + // update existing row + $sql = "UPDATE ".STREE_DB_PREFIX."thumbnail_queue SET end_date=?"; + + } + $this->mDB->CompleteTrans(); + } + } + } @@ -254,7 +271,7 @@ global $gSpidertree; $ret = NULL; if( is_numeric( $iUID ) ) { - $userDir = $gSpidertree['content_path'].'/'.getUserPath(); + $userDir = $gSpidertree['content_path'].'/'.getUserPath( $iUID ); mkdir_p( $userDir ); mkdir_p( $userDir.IMAGE_SIZE_ORIGINAL ); mkdir_p( $userDir.IMAGE_SIZE_SMALL ); @@ -270,6 +287,12 @@ } +function getImagePath( $iFileName, $iUID, $iImageSize ) { + global $gSpidertree; + $path = $gSpidertree['content_path'].getUserPath( $iUID ).$iImageSize.'/'; + mkdir_p( $path ); + return $path.$iFileName; +} function getImageURL( $iFileName, $iUID, $iImageSize ) { global $gSpidertree; @@ -345,6 +368,99 @@ return array(0, 0); } +function resize_image($src, $dest, $target=0, $target_fs=0, $keepProfiles=0) { + global $gallery; + + if (!strcmp($src,$dest)) { + $useTemp = true; + $out = "$dest.tmp"; + } + else { + $out = $dest; + $useTemp = false; + } + + $regs = getimagesize($src); + if ($regs[2] !== 2 && $regs[2] !== 3) { + $target_fs = 0; // can't compress other images + } + if ($target === 'off') { + $target = 0; + } + + // Check for images smaller then target size, don't blow them up. + $regs = getDimensions($src, $regs); + if ((empty($target) || ($regs[0] <= $target && $regs[1] <= $target)) + && (empty($target_fs) || ((int) fs_filesize($src) >> 10) <= $target_fs)) { + if ($useTemp == false) { + fs_copy($src, $dest); + } + processingMsg(" ". _("No resizing required")); + return 1; + } + $target=min($target, max($regs[0],$regs[1])); + + if ($target_fs == 0) { + compress_image($src, $out, $target, $gallery->app->jpegImageQuality, $keepProfiles); + } else { + $filesize = (int) fs_filesize($src) >> 10; + $max_quality=$gallery->app->jpegImageQuality; + $min_quality=5; + $max_filesize=$filesize; + $min_filesize=0; + if (!isset($quality)) { + $quality=$gallery->album->fields['last_quality']; + } + processingMsg(" ". sprintf(_("target file size %d kbytes"), + $target_fs)."\n"); + + do { + compress_image($src, $out, $target, $quality, $keepProfiles); + $prev_quality=$quality; + printf(_("-> file size %d kbytes"), round($filesize)); + processingMsg(" " . sprintf(_("trying quality %d%%"), + $quality)); + clearstatcache(); + $filesize= (int) fs_filesize($out) >> 10; + if ($filesize < $target_fs) { + $min_quality=$quality; + $min_filesize=$filesize; + } else if ($filesize > $target_fs){ + $max_quality=$quality; + $max_filesize=$filesize; + } else if ($filesize == $target_fs){ + $min_quality=$quality; + $max_quality=$quality; + $min_filesize=$filesize; + $max_filesize=$filesize; + } + $quality=($max_quality + $min_quality)/2; + $quality=round($quality); + if ($quality==$prev_quality) { + if ($filesize==$max_filesize) { + $quality--; + } else { + $quality++; + } + } + } while ($max_quality-$min_quality > 2 && + abs(($filesize-$target_fs)/$target_fs) > .02 ); + + $gallery->album->fields['last_quality']=$prev_quality; + printf(_("-> file size %d kbytes"), round($filesize)); + processingMsg(_("Done.")); + } + if (fs_file_exists("$out") && fs_filesize("$out") > 0) { + if ($useTemp) { + fs_copy($out, $dest); + fs_unlink($out); + } + return 1; + } else { + return 0; + } +} + function rotate_image($src, $dest, $target, $type) { global $gallery; @@ -644,6 +760,79 @@ } } +function exec_wrapper($cmd) { + global $gallery; + + list($results, $status) = exec_internal($cmd); + + if ($status == $gallery->app->expectedExecStatus) { + return 0; + } else { + if ($results) { + gallery_error(join("<br>", $results)); + } + return 1; + } +} + +function exec_internal($cmd) { + global $gallery; + + $debugfile = ""; + if (isDebugging()) { + print "<p><b>". _("Executing:") ."<ul>$cmd</ul></b>"; + $debugfile = tempnam($gallery->app->tmpDir, "dbg"); + } + + fs_exec($cmd, $results, $status, $debugfile); + + if (isDebugging()) { + print "<br>" . _("Results:") ." <pre>"; + if ($results) { + print join("\n", $results); + } else { + print "<b>" ._("none") ."</b>"; + } + print "</pre>"; + + if (file_exists($debugfile)) { + print "<br> ". _("Error messages:") .": <pre>"; + if ($fd = fs_fopen($debugfile, "r")) { + while (!feof($fd)) { + $buf = fgets($fd, 4096); + print $buf; + } + fclose($fd); + } + unlink($debugfile); + print "</pre>"; + } + print "<br> ". sprintf(_("Status: %s (expected %s)"), + $status, $gallery->app->expectedExecStatus); + } + + return array($results, $status); +} + +function fs_exec($cmd, &$results, &$status, $debugfile="") { + if (!empty($debugfile)) { + $cmd = "($cmd) 2>$debugfile"; + } + return exec($cmd, $results, $status); +} + +function fs_import_filename($filename, $for_exec=1) { + if ($for_exec) { + if (strstr($filename, " ")) { + $filename = "\"$filename\""; + } + } + + return $filename; +} + + + */ |
|
From: <sp...@us...> - 2004-02-13 07:00:22
|
Update of /cvsroot/spidertree/spidertree In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25018 Added Files: thumbnailer.php Log Message: first pass at quasi-working thumbnails --- NEW FILE: thumbnailer.php --- <?php require_once( '../setup_inc.php' ); global $dbTiki; $dbTiki->StartTrans(); $sql = "SELECT tq.image_id, i.user_id FROM thumbnail_queue tq, image i WHERE tq.begin_date IS NULL AND tq.image_id=i.image_id ORDER BY tq.create_date LIMIT 10 FOR UPDATE"; $rs = $dbTiki->Execute($sql ); $processIMID = array(); while( !$rs->EOF ) { $processIMID[$rs->fields['image_id']] = $rs->fields['user_id']; $sql2 = "UPDATE thumbnail_queue SET begin_date='now' WHERE image_id=?"; $rs2 = $dbTiki->Execute( $sql2, array( $rs->fields['image_id'] ) ); $rs->MoveNext(); } $dbTiki->CompleteTrans(); foreach( array_keys( $processIMID ) as $IMID ) { $image = new SImage( $IMID, $processIMID[$IMID] ); $image->generateThumbnails(); } ?> |
Update of /cvsroot/spidertree/spidertree/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20017/templates Modified Files: spidertree_edit_album.tpl spidertree_edit_album_info.tpl spidertree_upload.tpl Added Files: spidertree_edit_image.tpl Log Message: uploads now working, thumbnailing still non-existent --- NEW FILE: spidertree_edit_image.tpl --- {if $image.imid} <img src="{$image.file_url}" /> imid: {$image.imid} {/if} Index: spidertree_edit_album.tpl =================================================================== RCS file: /cvsroot/spidertree/spidertree/templates/spidertree_edit_album.tpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- spidertree_edit_album.tpl 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ spidertree_edit_album.tpl 9 Feb 2004 06:23:03 -0000 1.2 @@ -1,18 +1,37 @@ -{if $FORM.ALID} +{if $FORM.alid} <form enctype="multipart/form-data" method="post" action="album.php" id="editpageform"> -<input type="hidden" name="FORM[ALID]" value="{$FORM.ALID}" /> -<table class="stdialog" border="0"> +<input type="hidden" name="FORM[alid]" value="{$FORM.alid}" /> +<table class="stdialog" border="0" cellpadding="3"> <tr> <td colspan="2" class="stdialogtop"> <h2>Album: {$FORM.title}</h2> <span class="stsubmenu"> - <a href="upload.php?fALID={$FORM.ALID}">Add Photos</a> <b>|</b> - <a href="album.php?fAlbumEditInfo=1&fALID={$FORM.ALID}">Edit Album Info</a> <b>|</b> + <a href="upload.php?fALID={$FORM.alid}">Add Photos</a> <b>|</b> + <a href="album.php?fAlbumEditInfo=1&fALID={$FORM.alid}">Edit Album Info</a> <b>|</b> <a href="">Move</a>, <a href="">Copy</a>, <a href="">Delete</a>, or <a href="">Edit</a> Checked Photos<b>|</b> </span> </td> </tr> + +<tr> + <td colspan="2"> + +<table cellpadding="5"> +<tr> +{section name=ix loop=$images} + <td align="center"><a href="image.php?fIMID={$images[ix].image_id}"><img src="{$images[ix].file_url}" border="0"/><br />{$images[ix].title}</a> + </td> +{sectionelse} + <td align="center"> + <img src="{$tiki_url.spidertree_url}images/empty_album.gif" border="0"/><br />No Images + </td> +{/section} +</tr> +</table> + + </td> +</tr> <tr> <td colspan="2" class="stdialogbottom"> <input type="submit" name="fAlbumSave" value="Save Album" class="stbutton" /> Index: spidertree_edit_album_info.tpl =================================================================== RCS file: /cvsroot/spidertree/spidertree/templates/spidertree_edit_album_info.tpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- spidertree_edit_album_info.tpl 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ spidertree_edit_album_info.tpl 9 Feb 2004 06:23:03 -0000 1.2 @@ -1,9 +1,9 @@ <form enctype="multipart/form-data" method="post" action="album.php" id="editpageform"> -<input type="hidden" name="FORM[ALID]" value="{$FORM.ALID}" /> +<input type="hidden" name="FORM[alid]" value="{$FORM.alid}" /> <table class="stdialog" border="0"> <tr> - <td colspan="2" class="stdialogtop"><h2>{if $FORM.ALID}Edit Album: {$FORM.title}{else}Create New Album{/if}</h2></td> + <td colspan="2" class="stdialogtop"><h2>{if $FORM.alid}Edit Album: {$FORM.title}{else}Create New Album{/if}</h2></td> </tr> <tr> <td colspan="2"><h3>Name and Description</h3></td> @@ -80,7 +80,7 @@ <input type="submit" name="fAlbumSave" value="Save Album" class="stbutton" /> </form> <form enctype="multipart/form-data" method="post" action="album.php" id="editpageform"> -<input type="hidden" name="FORM[ALID]" value="{$FORM.ALID}" /> +<input type="hidden" name="FORM[alid]" value="{$FORM.alid}" /> <input type="submit" name="fAlbumCancel" value="Cancel" class="stbutton" /> </td> </form> Index: spidertree_upload.tpl =================================================================== RCS file: /cvsroot/spidertree/spidertree/templates/spidertree_upload.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- spidertree_upload.tpl 8 Feb 2004 02:20:31 -0000 1.3 +++ spidertree_upload.tpl 9 Feb 2004 06:23:03 -0000 1.4 @@ -1,6 +1,6 @@ <form enctype="multipart/form-data" method="post" action="upload.php" id="editpageform"> -<input type="hidden" name="FORM[ALID]" value="{$album.ALID}" /> +<input type="hidden" name="FORM[alid]" value="{$album.alid}" /> <table class="stdialog" border="0"> <tr> <td colspan="2" class="stdialogtop"> @@ -11,16 +11,42 @@ {assign var="rows" value=10} {section name=ix loop=$rows} <tr> - <td align="right" valign="center">New Photo {$smarty.section.ix.rownum}:</td> + <td align="right" valign="center" nowrap="nowrap">New Photo {$smarty.section.ix.rownum}:</td> <td><input type="file" size="40" name="UPLOAD[{$smarty.section.ix.rownum}]" /></td> </tr> {/section} <tr> + <td colspan="2"></td> +</tr> +<tr> + <td colspan="2"><b>Downsize Images:</b></td> +</tr> +<tr> + <td colspan="2"> + <p>If you would like to resize your original image, select the maximum size below. + <br/>NOTE: This will only shrink the image if it is larger than the selected size. If your image is already smaller than the selected size, it will not be resized at all. +</p>Reduce size to: +<select> +<option value="">Don't Resize</option> +<option value="640">0.3 MegaPixel ( 640 x 480 )</option> +<option value="640">0.8 MegaPixel ( 1024 x 768 )</option> +<option value="1280">1.3 MegaPixel ( 1280 x 1024 )</option> +<option value="1600">2.1 MegaPixel ( 1600 x 1200 )</option> +<option value="2048">3.3 MegaPixel ( 2048 x 1536 )</option> +<option value="2272">4.1 MegaPixel ( 2272 x 1704 )</option> +<option value="2560">5.2 MegaPixel ( 2560 x 1920 )</option> +<option value="2800">6.3 MegaPixel ( 2800 x 2100 )</option> +<option value="3000">7.0 MegaPixel ( 3000 x 2300 )</option> +<option value="3264">8.0 MegaPixel ( 3264 x 2448 )</option> +</select> + </td> +</tr> +<tr> <td colspan="2" class="stdialogbottom"> <input type="submit" name="fAlbumUpload" value="Add Now" class="stbutton" /> </form> <form enctype="multipart/form-data" method="post" action="album.php" id="editpageform"> -<input type="hidden" name="FORM[ALID]" value="{$album.ALID}" /> +<input type="hidden" name="FORM[alid]" value="{$album.alid}" /> <input type="submit" name="fAlbumCancel" value="Cancel" class="stbutton" /> </td> </form> |
|
From: <sp...@us...> - 2004-02-09 06:26:13
|
Update of /cvsroot/spidertree/spidertree/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20017/images Added Files: generating_thumbnails.gif Log Message: uploads now working, thumbnailing still non-existent --- NEW FILE: generating_thumbnails.gif --- (This appears to be a binary file; contents omitted.) |
|
From: <sp...@us...> - 2004-02-09 06:26:13
|
Update of /cvsroot/spidertree/spidertree In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20017 Modified Files: config_inc.php setup_inc.php Log Message: uploads now working, thumbnailing still non-existent Index: config_inc.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/config_inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- config_inc.php 7 Feb 2004 21:04:32 -0000 1.2 +++ config_inc.php 9 Feb 2004 06:23:02 -0000 1.3 @@ -2,5 +2,7 @@ define( 'STREE_DB_PREFIX', '' ); $gSpidertree['environment'] = ENV_TIKIWIKI; - $gSpidertree['content_path'] = SPIDERTREE_PKG_PATH.'uploads'; + + $gSpidertree['content_url'] = 'uploads/'; + $gSpidertree['content_path'] = SPIDERTREE_PKG_PATH.$gSpidertree['content_url']; ?> Index: setup_inc.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/setup_inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- setup_inc.php 7 Feb 2004 21:04:32 -0000 1.4 +++ setup_inc.php 9 Feb 2004 06:23:02 -0000 1.5 @@ -6,7 +6,7 @@ define( 'ENV_TIKIWIKI', 'tikiwiki' ); // hash containing all global Spidertree specific settings - global $gSpidertree, $gTreeUser, $smarty; + global $gSpidertree, $gTreeUser, $smarty, $FORM; $gSpidertree = array(); // load up site specific settings @@ -27,20 +27,34 @@ $gTreeUser = new SUserTikiwiki(); } - // create a album global var if we have an album ID + // create an album global var if we have an album ID require_once( SPIDERTREE_CLASS_PATH.'SAlbum.php'); - global $fALID, $FORM, $gAlbum; + global $fALID, $gAlbum; if( isset( $fALID ) ) { - $FORM['ALID'] = $fALID; - } elseif( empty( $FORM['ALID'] ) ) { - $FORM['ALID'] = NULL; // prevent Undefined variable warning + $FORM['alid'] = $fALID; + } elseif( empty( $FORM['alid'] ) ) { + $FORM['alid'] = NULL; // prevent Undefined variable warning } - $gAlbum = new SAlbum( $FORM['ALID'], $gTreeUser->mUID ); + $gAlbum = new SAlbum( $FORM['alid'], $gTreeUser->mUID ); if( $gAlbum->load() ) { $smarty->assign_by_ref('album', $gAlbum->mRow ); } + // create an image global var if we have an album ID + global $fIMID, $gImage; + if( isset( $fIMID ) ) { + $FORM['imid'] = $fIMID; + } elseif( empty( $FORM['imid'] ) ) { + $FORM['imid'] = NULL; // prevent Undefined variable warning + } + $gImage = new SImage( $FORM['imid'], $gTreeUser->mUID ); + if( $gImage->load() ) { + $smarty->assign_by_ref('image', $gImage->mRow ); + } + + + function renderSpiderTree() { global $smarty; $smarty->display("tiki.tpl"); |
|
From: <sp...@us...> - 2004-02-09 06:26:12
|
Update of /cvsroot/spidertree/spidertree/edit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20017/edit Modified Files: album.php upload.php Added Files: image.php Log Message: uploads now working, thumbnailing still non-existent --- NEW FILE: image.php --- <?php require_once('../../setup_inc.php'); global $FORM, $gImage; $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_edit_image.tpl'); if( isset( $fImageSave ) ) { } renderSpiderTree(); ?> Index: album.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/edit/album.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- album.php 8 Feb 2004 02:20:31 -0000 1.6 +++ album.php 9 Feb 2004 06:23:02 -0000 1.7 @@ -4,13 +4,11 @@ global $FORM, $gAlbum; $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_edit_album.tpl'); - if( isset( $fAlbumSave ) ) { $new = empty( $gAlbum->mALID ); if( $gAlbum->store( $FORM ) ) { if( $new ) { $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_upload.tpl'); -pvd( $FORM ); } else { include_once( 'album_list_inc.php' ); } @@ -26,6 +24,8 @@ } elseif( empty( $gAlbum->mALID ) ) { $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_edit_album_info.tpl'); } else { + $gAlbum->loadImages(); + $smarty->assign_by_ref( 'images', $gAlbum->mImages ); $smarty->assign_by_ref( 'FORM', $gAlbum->mRow ); } Index: upload.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/edit/upload.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- upload.php 7 Feb 2004 21:05:35 -0000 1.4 +++ upload.php 9 Feb 2004 06:23:02 -0000 1.5 @@ -2,7 +2,7 @@ require_once('../../setup_inc.php'); if( isset($HTTP_POST_FILES['UPLOAD']) ) { - $gAlbum->processUpload( $HTTP_POST_FILES, $gTreeUser->getUploadPath() ); + $gAlbum->processUpload( $HTTP_POST_FILES ); $smarty->assign_by_ref( 'FORM', $FORM ); $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_edit_album.tpl'); } else { |
|
From: <sp...@us...> - 2004-02-09 06:26:12
|
Update of /cvsroot/spidertree/spidertree/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20017/classes Modified Files: SAlbum.php SImage.php SUserBase.php Log Message: uploads now working, thumbnailing still non-existent Index: SAlbum.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SAlbum.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- SAlbum.php 8 Feb 2004 02:37:16 -0000 1.6 +++ SAlbum.php 9 Feb 2004 06:23:02 -0000 1.7 @@ -45,6 +45,8 @@ var $mALID; /** The acct id that owns this album **/ var $mUID; + /** Array of images for this album, hash indexed my image_id **/ + var $mImages; // }}} @@ -75,7 +77,7 @@ **/ function load() { if( !empty( $this->mALID ) ) { - $sql = "SELECT *, subpath(path, -1) AS url FROM ".STREE_DB_PREFIX."album WHERE album_id=?"; + $sql = "SELECT *, subpath(path, -1) AS url, album_id AS alid FROM ".STREE_DB_PREFIX."album WHERE album_id=?"; $rs = $this->mDB->Execute($sql, array( $this->mALID ) ); if( empty($rs) || empty( $rs->fields['album_id'] ) ) { $this->mErrors['load'] = 'Album could not be loaded.'; @@ -86,6 +88,32 @@ } return( count( $this->mErrors ) == 0 ); } + // }}} + + // {{{ loadImages + /** + * Define and load Smarty components + * + * @param none + * @return TRUE if successful, FALSE if not. mErrors will hold error strings + * @access public + **/ + function loadImages( $iImageSize=IMAGE_SIZE_SMALL ) { + if( !empty( $this->mALID ) ) { + $sql = "SELECT i.* FROM ".STREE_DB_PREFIX."album a, ".STREE_DB_PREFIX."album_map am, ".STREE_DB_PREFIX."image i + WHERE a.album_id=? AND am.album_id=a.album_id AND am.image_id=i.image_id"; + $rs = $this->mDB->Execute($sql, array( $this->mALID ) ); + $this->mImages = array(); + while( !$rs->EOF ) { + $rs->fields['file_url'] = getImageURL( $rs->fields['file_name'], $rs->fields['user_id'], $iImageSize ); + array_push( $this->mImages, $rs->fields ); + $rs->MoveNext(); + } + } + return( count( $this->mErrors ) == 0 ); + } + // }}} + // {{{ verify /** @@ -184,21 +212,24 @@ * @return TRUE if successful, FALSE if not. mErrors will hold error strings * @access public **/ - function processUpload( &$pPostFiles, $iDestPath ) { + function processUpload( &$pPostFiles ) { +debug(99); $files = &$pPostFiles['UPLOAD']; + $this->mDB->StartTrans(); foreach( array_keys( $files['size'] ) as $i ) { if( $files['size'][$i] > 0 ) { $imageHash['tmp_loc'] = $files['tmp_name'][$i]; - $imageHash['dest_loc'] = $iDestPath.$files['name'][$i]; + $imageHash['dest_name'] = $files['name'][$i]; $imageHash['size'] = $files['size'][$i]; $image = new SImage( NULL, $this->mUID ); if( $image->store( $imageHash ) ) { - $this->addImage( ); + $this->addImage( $image->mIMID ); } else { pvd( $image->mErrors ); } } } + $this->mDB->CompleteTrans(); } // }}} @@ -213,8 +244,10 @@ function addImage( $iImageMixed ) { if( isset( $this->mALID ) && isset( $this->mUID ) ) { if( is_numeric( $iImageMixed ) ) { - $sql = "INSERT"; + $sql = "INSERT INTO album_map ( album_id, image_id ) VALUES ( ?, ? )"; } + $rs = $this->mDB->Execute($sql, array( $this->mALID, $iImageMixed ) ); + $this->mDB->CompleteTrans(); } } // }}} Index: SImage.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SImage.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SImage.php 8 Feb 2004 02:09:43 -0000 1.3 +++ SImage.php 9 Feb 2004 06:23:02 -0000 1.4 @@ -37,6 +37,11 @@ require_once( KERNEL_PKG_PATH.'TikiBase.php' ); +define( 'IMAGE_SIZE_ORIGINAL', 'upload' ); +define( 'IMAGE_SIZE_SMALL', 'small' ); +define( 'IMAGE_SIZE_MEDIUM', 'medium' ); +define( 'IMAGE_SIZE_LARGE', 'large' ); + class SImage extends TikiBase { // {{{ properties @@ -72,20 +77,24 @@ * @return TRUE if successful, FALSE if not. mErrors will hold error strings * @access public **/ - function load() { + function load( $iImageSize = IMAGE_SIZE_LARGE ) { + global $gSpidertree; +//debug(); if( !empty( $this->mIMID ) ) { - $sql = "SELECT * FROM ".STREE_DB_PREFIX."image WHERE image_id=?"; + $sql = "SELECT i.*, i.image_id AS imid + FROM ".STREE_DB_PREFIX."image i WHERE i.image_id=?"; $rs = $this->mDB->Execute($sql, array( $this->mIMID ) ); if( empty($rs) || empty( $rs->fields['image_id'] ) ) { - $this->mErrors['load'] = 'Album could not be loaded.'; + $this->mErrors['load'] = 'Image could not be loaded.'; } else { $this->mRow = $rs->fields; + $this->mRow['file_url'] = getImageURL( $rs->fields['file_name'], $rs->fields['user_id'], $iImageSize ); $this->mRow['IMID'] = $rs->fields['image_id']; } } return( count( $this->mErrors ) == 0 ); } - + // {{{ verify /** * This verifies data integrity. NOTE: pass by reference is crucial, because some modifications @@ -106,10 +115,11 @@ } else { // move the uploaded file if( empty($this->IMID ) ) { - if( move_uploaded_file( $pParams['tmp_loc'], $pParams['dest_loc'] ) ) { - $pParams['file_name'] = basename( $pParams['dest_loc'] ); + $pParams['new_image_id'] = $this->mDB->GenID( 'image_id_seq' ); + $pParams['file_name'] = $pParams['new_image_id'].'.'.substr( $pParams['dest_name'], 0, (255-($pParams['new_image_id'] % 10) ) ); + if( move_uploaded_file( $pParams['tmp_loc'], getUploadPath( $this->mUID ).$pParams['file_name'] ) ) { if( empty( $pParams['title'] ) ) { - $pParams['title'] = substr( $pParams['file_name'], 0, strrpos( $pParams['file_name'], '.' ) ); + $pParams['title'] = substr( $pParams['dest_name'], 0, strrpos( $pParams['dest_name'], '.' ) ); } } else { $this->mErrors['upload'] = 'Could not store uploaded file '.basename( $pParams['dest_loc'] ).'.'; @@ -153,7 +163,7 @@ $sql = "UPDATE ".STREE_DB_PREFIX."image SET title=? WHERE user_id=? AND image_id=?"; $bindVars = array( $pParams['title'], $this->mUID, $pParams['IMID'] ); } else { - $pParams['IMID'] = $this->mDB->GenID( 'image_id_seq' ); + $pParams['IMID'] = $pParams['new_image_id']; $this->mIMID = $pParams['IMID']; // insert new row @@ -226,8 +236,417 @@ return( count( $this->mErrors ) == 0 ); } // }}} + + + function getFileInfo () { + if( isset( $this->mRow['file_path'] ) ) { + } + } + +} + +function getUserPath( $iUID ) { + return round( ($iUID / 1000) ).'/'.$iUID.'/'; } + +function getUploadPath( $iUID ) { + global $gSpidertree; + $ret = NULL; + if( is_numeric( $iUID ) ) { + $userDir = $gSpidertree['content_path'].'/'.getUserPath(); + mkdir_p( $userDir ); + mkdir_p( $userDir.IMAGE_SIZE_ORIGINAL ); + mkdir_p( $userDir.IMAGE_SIZE_SMALL ); + mkdir_p( $userDir.IMAGE_SIZE_MEDIUM ); + mkdir_p( $userDir.IMAGE_SIZE_LARGE ); + $ret = $userDir.IMAGE_SIZE_ORIGINAL.'/'; + if( !file_exists( $ret ) ) { +print "ERROR making upload path"; + } +pvd( $ret ); + } + return $ret; +} + + + +function getImageURL( $iFileName, $iUID, $iImageSize ) { + global $gSpidertree; + $tailPath = getUserPath( $iUID ).$iImageSize.'/'.$iFileName; + $fullPath = SPIDERTREE_PKG_PATH.$gSpidertree['content_url'].$tailPath; + if( file_exists( $fullPath ) ) { + $ret = SPIDERTREE_PKG_URL.$gSpidertree['content_url'].$tailPath; + } else { + $ret = SPIDERTREE_PKG_URL.'images/generating_thumbnails.gif'; + } + return $ret; +} + + +/* + + +// Snagged from Gallery for reference + +function getDimensions($file, $regs=false) { + global $gallery; + + if ($regs === false) + $regs = getimagesize($file); + if (($regs[0] > 1) && ($regs[1] > 1)) + return array($regs[0], $regs[1]); + else if (isDebugging()) + echo "<br>" .sprintf(_("PHP's %s unable to determine dimensions."), + "getimagesize()") ."<br>"; + + + // Just in case php can't determine dimensions. + switch($gallery->app->graphics) + { + case "NetPBM": + list($lines, $status) = + exec_internal(toPnmCmd($file) . + " | " . + NetPBM("pnmfile", "--allimages")); + break; + case "ImageMagick": + // This fails under windows, IM isn't returning parsable status output. + list($lines, $status) = + exec_internal(ImCmd("identify", fs_import_filename($file))); + break; + default: + if (isDebugging()) + echo "<br>" . _("You have no graphics package configured for use!") ."<br>"; + return array(0, 0); + break; + } + + if ($status == $gallery->app->expectedExecStatus) { + foreach ($lines as $line) { + switch($gallery->app->graphics) + { + case "NetPBM": + if (ereg("([0-9]+) by ([0-9]+)", $line, $regs)) + return array($regs[1], $regs[2]); + break; + case "ImageMagick": + if (ereg("([0-9]+)x([0-9]+)", $line, $regs)) + return array($regs[1], $regs[2]); + break; + } + } + } + + if (isDebugging()) + echo "<br>Unable to determine image dimensions!<br>"; + + return array(0, 0); +} + + +function rotate_image($src, $dest, $target, $type) { + global $gallery; + + if (!strcmp($src,$dest)) { + $useTemp = true; + $out = "$dest.tmp"; + } + else { + $out = $dest; + } + + $outFile = fs_import_filename($out, 1); + $srcFile = fs_import_filename($src, 1); + + $type = strtolower($type); + if (isset($gallery->app->use_jpegtran) && !empty($gallery->app->use_jpegtran) && ($type === 'jpg' || $type === 'jpeg')) { + if (!strcmp($target, '-90')) { + $args = '-rotate 90'; + } else if (!strcmp($target, '180')){ + $args = '-rotate 180'; + } else if (!strcmp($target, '90')) { + $args = '-rotate 270'; + } else if (!strcmp($target, 'fv')) { + $args = '-flip vertical'; + } else if (!strcmp($target, 'fh')) { + $args = '-flip horizontal'; + } else if (!strcmp($target, 'tr')) { + $args = '-transpose'; + } else if (!strcmp($target, 'tv')) { + $args = '-transverse'; + } else { + $args = ''; + } + + $path = $gallery->app->use_jpegtran; + // -copy all ensures all headers (i.e. EXIF) are copied to the rotated image + exec_internal(fs_import_filename($path, 1) . " $args -copy all -outfile $outFile $srcFile"); + } else { + switch($gallery->app->graphics) + { + case "NetPBM": + $args2 = ''; + if (!strcmp($target, '-90')) { + // NetPBM's docs mix up CW and CCW... + // We'll do it right. + $args = '-r270'; + } else if (!strcmp($target, '180')) { + $args = '-r180'; + } else if (!strcmp($target, '90')) { + $args = '-r90'; + } else if (!strcmp($target, 'fv')) { + $args = '-tb'; + } else if (!strcmp($target, 'fh')) { + $args = '-lr'; + } else if (!strcmp($target, 'tr')) { + $args = '-xy'; + } else if (!strcmp($target, 'tv')) { + // Because of NetPBM inconsistencies, the only + // way to do this transformation on *all* + // versions of NetPBM is to pipe two separate + // operations in sequence. Versions >= 10.13 + // have the new -xform flag, and versions <= + // 10.6 could take the '-xy -r180' commands in + // sequence, but versions 10.7--> 10.12 can't + // do *either*, so we're left with this little + // workaround. -Beckett 9/9/2003 + $args = '-xy'; + $args2 = ' | ' . NetPBM('pnmflip', '-r180'); + } else { + $args = ''; + } + + $err = exec_wrapper(toPnmCmd($src) . ' | ' . + NetPBM('pnmflip', $args) . + $args2 . + ' | ' . fromPnmCmd($out)); + + // copy exif headers from original image to rotated image + if (isset($gallery->app->use_exif)) { + $path = $gallery->app->use_exif; + exec_internal(fs_import_filename($path, 1) . " -te $srcFile $outFile"); + } + break; + case "ImageMagick": + if (!strcmp($target, '-90')) { + $im_cmd = '-rotate 90'; + } else if (!strcmp($target, '180')) { + $im_cmd = '-rotate 180'; + } else if (!strcmp($target, '90')) { + $im_cmd = '-rotate -90'; + } else if (!strcmp($target, 'fv')) { + $im_cmd = '-flip'; + } else if (!strcmp($target, 'fh')) { + $im_cmd = '-flop'; + } else if (!strcmp($target, 'tr')) { + $im_cmd = '-affine 0,1,1,0,0,0 -transform'; + } else if (!strcmp($target, 'tv')) { + $im_cmd = '-affine 0,-1,-1,0,0,0 -transform'; + } else { + $im_cmd = ''; + } + + + $src = fs_import_filename($src); + $out = fs_import_filename($out); + $err = exec_wrapper(ImCmd('convert', "$im_cmd $srcFile $outFile")); + break; + default: + if (isDebugging()) + echo "<br>". _("You have no graphics package configured for use!") ."<br>"; + return 0; + break; + } + } + + if (fs_file_exists("$out") && fs_filesize("$out") > 0) { + if ($useTemp) { + fs_copy($out, $dest); + fs_unlink($out); + } + return 1; + } else { + return 0; + } +} + + + +function cut_image($src, $dest, $x, $y, $width, $height) { + global $gallery; + if (!strcmp($src,$dest)) { + $useTemp = true; + $out = "$dest.tmp"; + } + else { + $out = $dest; + } + + switch($gallery->app->graphics) + { + case "NetPBM": + $err = exec_wrapper(toPnmCmd($src) . + " | " . + NetPBM("pnmcut") . + " $x $y $width $height" . + " | " . + fromPnmCmd($out)); + break; + case "ImageMagick": + $src = fs_import_filename($src); + $out = fs_import_filename($out); + $err = exec_wrapper(ImCmd("convert", "-crop " . + $width ."x". $height ."+". $x ."+". $y . + " $src $out")); + break; + default: + if (isDebugging()) + echo "<br>" . _("You have no graphics package configured for use!") ."<br>"; + return 0; + break; + } + + if (fs_file_exists("$out") && fs_filesize("$out") > 0) { + if ($useTemp) { + fs_copy($out, $dest); + fs_unlink($out); + } + return 1; + } else { + return 0; + } +} + +function compress_image($src, $out, $target, $quality, $keepProfiles=false) { + global $gallery; + + if ($target === 'off') { + $target = ''; + } + switch($gallery->app->graphics) { + case "NetPBM": + $err = exec_wrapper(toPnmCmd($src) . + (($target > 0) ? (' | ' .NetPBM('pnmscale', + " -xysize $target $target")) : '') + . ' | ' . fromPnmCmd($out, $quality)); + // copy over EXIF data if a JPEG if $keepProfiles is + // set. Unfortunately, we can't also keep comments. + if ($keepProfiles && eregi('\.jpe?g$', $src)) { + if (isset($gallery->app->use_exif)) { + exec_wrapper(fs_import_filename($gallery->app->use_exif, 1) . ' -te ' + . fs_import_filename($src, 1) . ' ' + . fs_import_filename($out, 1)); + } else { + processingMsg(_('Unable to preserve EXIF data (jhead not installed)') . "\n"); + } + } + break; + case "ImageMagick": + $src = fs_import_filename($src); + $out = fs_import_filename($out); + // Preserve comment, EXIF data if a JPEG if $keepProfiles is set. + $err = exec_wrapper(ImCmd('convert', "-quality $quality " + . ($target ? "-size ${target}x${target} " : '') + . ($keepProfiles ? ' ' : ' +profile \'*\' ') + . $src + . ($target ? " -geometry ${target}x${target} " : '') + . $out)); + break; + default: + if (isDebugging()) + echo "<br>" . _("You have no graphics package configured for use!")."<br>"; + return 0; + break; + } +} + +function toPnmCmd($file) { + global $gallery; + + if (eregi("\.png\$", $file)) { + $cmd = "pngtopnm"; + } else if (eregi("\.jpe?g\$", $file)) { + if (isDebugging()) { + $cmd = "jpegtopnm"; + } else { + $cmd = "jpegtopnm"; + } + } else if (eregi("\.gif\$", $file)) { + $cmd = "giftopnm"; + } + + if (!empty($cmd)) { + return NetPBM($cmd) . + " " . + fs_import_filename($file); + } else { + gallery_error(sprintf(_("Unknown file type: %s"), $file)); + return ""; + } +} + +function fromPnmCmd($file, $quality=NULL) { + global $gallery; + if ($quality == NULL) { + $quality=$gallery->app->jpegImageQuality; + } + + if (eregi("\.png(\.tmp)?\$", $file)) { + $cmd = NetPBM("pnmtopng"); + } else if (eregi("\.jpe?g(\.tmp)?\$", $file)) { + $cmd = NetPBM($gallery->app->pnmtojpeg, + "--quality=" . $quality); + } else if (eregi("\.gif(\.tmp)?\$", $file)) { + $cmd = NetPBM("ppmquant", "256") . " | " . NetPBM("ppmtogif"); + } + + if ($cmd) { + return "$cmd > " . fs_import_filename($file); + } else { + gallery_error(sprintf(_("Unknown file type: %s"), $file)); + return ""; + } +} + +function netPbm($cmd, $args="") { + global $gallery; + + $cmd = fs_import_filename($gallery->app->pnmDir . "/$cmd"); + if (!isDebugging()) { + $cmd .= " --quiet"; + } + $cmd .= " $args"; + return $cmd; +} + +function ImCmd($cmd, $args = "") { + global $gallery; + + $cmd = fs_import_filename($gallery->app->ImPath . "/$cmd"); + $cmd .= " $args"; + return $cmd; +} + +function exec_wrapper($cmd) { + global $gallery; + + list($results, $status) = exec_internal($cmd); + + if ($status == $gallery->app->expectedExecStatus) { + return 0; + } else { + if ($results) { + gallery_error(join("<br>", $results)); + } + return 1; + } +} + +*/ + + + ?> Index: SUserBase.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SUserBase.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SUserBase.php 8 Feb 2004 02:09:43 -0000 1.3 +++ SUserBase.php 9 Feb 2004 06:23:02 -0000 1.4 @@ -72,20 +72,6 @@ return $ret; } - function getUploadPath() { - global $gSpidertree; - $ret = NULL; - if( $this->mUID ) { - $groupDir = '/'.($this->mUID % 1000).'/'; - $ret = $gSpidertree['content_path'].$groupDir.$this->mUID.'/'; - mkdir_p( $ret ); - if( !file_exists( $ret ) ) { -print "ERROR making upload path"; - } - } - return $ret; - } - } function mkdir_p($target){ |
|
From: <sp...@us...> - 2004-02-09 06:26:12
|
Update of /cvsroot/spidertree/spidertree/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20017/db Modified Files: spidertree.PGModel spidertree_create.sql Log Message: uploads now working, thumbnailing still non-existent Index: spidertree.PGModel =================================================================== RCS file: /cvsroot/spidertree/spidertree/db/spidertree.PGModel,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- spidertree.PGModel 8 Feb 2004 02:09:44 -0000 1.3 +++ spidertree.PGModel 9 Feb 2004 06:23:02 -0000 1.4 @@ -65,14 +65,16 @@ <PGIndexColumn OID="1" Order="" Name="user_id" NextOID="1" /> </PGIndex> </PGTable> - <PGTable width="201" x="511" TextField="2" Align="68" y="41" LineColor="#000000" FillStyle="Solid" LineWidth="1" FontUnderline="0" FillColor="#ffffff" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="5" height="247" FontBold="0" FontItalic="0" ScriptCreate="1" TextFlag="2048" FontStrikeOut="0" Name="image" id="0x8483020" NextOID="13" ScriptCreateDrop="1" FontFamily="Sans" > - <sink x="0.120773" y="0.931174" OID="12" id="0x84dbb68" /> + <PGTable width="201" x="511" TextField="2" Align="68" y="41" LineColor="#000000" FillStyle="Solid" LineWidth="1" FontUnderline="0" FillColor="#ffffff" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="5" height="247" FontBold="0" FontItalic="0" ScriptCreate="1" TextFlag="2048" FontStrikeOut="0" Name="image" id="0x8483020" NextOID="16" ScriptCreateDrop="1" FontFamily="Sans" > + <sink x="0.0348259" y="0.048583" OID="15" id="0x8485300" /> <sink x="0.0879121" y="0.0836653" OID="7" id="0x84bbeb0" /> <PGColumn PrimaryKey="1" OID="2" DataType="integer" Name="image_id" NextOID="1" Mandatory="1" /> <PGColumn ForeignKey="1" OID="8" DataType="integer" Name="user_id" NextOID="1" Mandatory="1" /> - <PGColumn OID="9" DataType="timestamp" Name="create_date" Default="'now'" NextOID="1" /> - <PGColumn OID="10" DataType="timestamp" Name="modify_date" Default="'now'" NextOID="1" /> + <PGColumn OID="9" DataType="timestamp" Name="create_date" Default="'now'" NextOID="1" Mandatory="1" /> + <PGColumn OID="10" DataType="timestamp" Name="modify_date" Default="'now'" NextOID="1" Mandatory="1" /> <PGColumn OID="11" DataType="integer" Name="size" NextOID="1" Mandatory="1" /> + <PGColumn OID="13" DataType="integer" Name="x" NextOID="1" Mandatory="1" /> + <PGColumn OID="14" DataType="integer" Name="y" NextOID="1" Mandatory="1" /> <PGColumn OID="3" Length="256" DataType="varchar" Name="file_name" NextOID="1" Mandatory="1" /> <PGColumn OID="4" Length="256" DataType="varchar" Name="title" NextOID="1" Mandatory="1" /> <PGColumn OID="5" DataType="text" Name="descr" NextOID="1" /> @@ -94,7 +96,7 @@ <point x="373" y="61" OID="2" id="0x8548520" /> <point x="528" y="61" sinkobjectid="0x8483020" OID="3" id="0x85ec498" sinkid="0x84bbeb0" /> <texthandle x="0.0447761" y="0.243243" OID="4" /> - <ColumnRef OID="5" Child="album_id" Parent="image_id" NextOID="1" /> + <ColumnRef OID="5" Child="image_id" Parent="image_id" NextOID="1" /> </PGReference> <PGReference TextField="3" Align="68" LineColor="#000000" FillStyle="none" LineWidth="1" EndArrowDirection="41" EndArrowType="2" FontUnderline="0" FillColor="#000000" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="3" BeginArrowDirection="0" BeginArrowType="0" FontBold="0" Child="album_map" FontItalic="0" ScriptCreate="1" Parent="album" EndTruncate="1" TextFlag="2048" FontStrikeOut="0" Name="album_map_album_ref" BeginTruncate="1" id="0x8555d28" NextOID="6" ScriptCreateDrop="1" FontFamily="Sans" > <point x="347" y="106" sinkobjectid="0x8624950" OID="1" id="0x8615d58" sinkid="0x854c2e8" /> @@ -103,20 +105,23 @@ <texthandle x="0.171233" y="0.326087" OID="4" /> <ColumnRef OID="5" Child="album_id" Parent="album_id" NextOID="1" /> </PGReference> - <PGTable width="201" x="511" TextField="2" Align="68" y="335" LineColor="#000000" FillStyle="Solid" LineWidth="1" FontUnderline="0" FillColor="#ffffff" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="9" height="97" FontBold="0" FontItalic="0" ScriptCreate="1" TextFlag="2048" FontStrikeOut="0" Name="thumbnail_queue" id="0x861a328" NextOID="8" ScriptCreateDrop="1" FontFamily="Sans" > - <sink x="0.124378" y="0.0927835" OID="7" id="0x86901c0" /> + <PGTable width="201" x="260" TextField="2" Align="68" y="186" LineColor="#000000" FillStyle="Solid" LineWidth="1" FontUnderline="0" FillColor="#ffffff" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="9" height="117" FontBold="0" FontItalic="0" ScriptCreate="1" TextFlag="2048" FontStrikeOut="0" Name="thumbnail_queue" id="0x861a328" NextOID="10" ScriptCreateDrop="1" FontFamily="Sans" > + <sink x="0.482587" y="0.179487" OID="9" id="0x856b940" /> <PGColumn PrimaryKey="1" ForeignKey="1" OID="2" DataType="integer" Name="image_id" NextOID="1" Mandatory="1" /> <PGColumn OID="3" DataType="timestamp" Name="create_date" Default="'now'" NextOID="1" Mandatory="1" ><![CDATA[Date inserted into the queue]]></PGColumn> <PGColumn OID="4" DataType="timestamp" Name="begin_date" NextOID="1" /> <PGColumn OID="5" DataType="timestamp" Name="end_date" NextOID="1" /> + <PGColumn OID="8" DataType="integer" Name="resize_original" NextOID="1" ><![CDATA[if the original image is to be resized, this holds that max pixel dimensions in X & Y]]></PGColumn> <PGIndex Unique="1" OID="6" Name="thumbnail_queue_image_id_idx" NextOID="2" > <PGIndexColumn OID="1" Order="" Name="image_id" NextOID="1" /> </PGIndex> </PGTable> - <PGReference TextField="3" Align="68" LineColor="#000000" FillStyle="none" LineWidth="1" EndArrowDirection="1108554241" EndArrowType="2" FontUnderline="0" FillColor="#000000" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="8" BeginArrowDirection="136613992" BeginArrowType="0" FontBold="0" Child="thumbnail_queue" FontItalic="0" ScriptCreate="1" Parent="image" EndTruncate="1" TextFlag="2048" FontStrikeOut="0" Name="thumbnail_queue_image_ref" BeginTruncate="1" id="0x8699058" NextOID="5" ScriptCreateDrop="1" FontFamily="Sans" > - <point x="536" y="344" sinkobjectid="0x861a328" OID="1" id="0x84d8ec8" sinkid="0x86901c0" /> - <point x="535" y="271" sinkobjectid="0x8483020" OID="2" id="0x84d0b08" sinkid="0x84dbb68" /> - <texthandle x="6" y="0.608247" OID="3" /> + <PGReference TextField="3" Align="68" LineColor="#000000" FillStyle="none" LineWidth="1" EndArrowDirection="1108554241" EndArrowType="2" FontUnderline="0" FillColor="#000000" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="8" BeginArrowDirection="136613992" BeginArrowType="0" FontBold="0" Child="thumbnail_queue" FontItalic="0" ScriptCreate="1" Parent="image" EndTruncate="1" TextFlag="2048" FontStrikeOut="0" Name="thumbnail_queue_image_ref" BeginTruncate="1" id="0x8699058" NextOID="7" ScriptCreateDrop="1" FontFamily="Sans" > + <point x="357" y="207" sinkobjectid="0x861a328" OID="1" id="0x84d8ec8" sinkid="0x856b940" /> + <point x="356" y="161" OID="5" id="0x8573e30" /> + <point x="472" y="161" OID="6" id="0x856ca78" /> + <point x="518" y="53" sinkobjectid="0x8483020" OID="2" id="0x84d0b08" sinkid="0x8485300" /> + <texthandle x="0.0434783" y="0.792453" OID="3" /> <ColumnRef OID="4" Child="image_id" Parent="image_id" NextOID="1" /> </PGReference> </PGModel> Index: spidertree_create.sql =================================================================== RCS file: /cvsroot/spidertree/spidertree/db/spidertree_create.sql,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- spidertree_create.sql 8 Feb 2004 02:09:44 -0000 1.3 +++ spidertree_create.sql 9 Feb 2004 06:23:02 -0000 1.4 @@ -56,9 +56,11 @@ ( image_id integer NOT NULL, user_id integer NOT NULL, - create_date timestamp DEFAULT 'now', - modify_date timestamp DEFAULT 'now', + create_date timestamp NOT NULL DEFAULT 'now', + modify_date timestamp NOT NULL DEFAULT 'now', size integer NOT NULL, + x integer NOT NULL, + y integer NOT NULL, file_name varchar(256) NOT NULL, title varchar(256) NOT NULL, descr text, @@ -80,7 +82,7 @@ ); ALTER TABLE album_map ADD CONSTRAINT album_map_image_ref - FOREIGN KEY ( album_id ) + FOREIGN KEY ( image_id ) REFERENCES image ( image_id ) NOT DEFERRABLE; ALTER TABLE album_map ADD CONSTRAINT album_map_album_ref @@ -94,9 +96,11 @@ create_date timestamp NOT NULL DEFAULT 'now', begin_date timestamp, end_date timestamp, + resize_original integer, PRIMARY KEY (image_id) ); COMMENT ON COLUMN thumbnail_queue.create_date IS 'Date inserted into the queue'; +COMMENT ON COLUMN thumbnail_queue.resize_original IS 'if the original image is to be resized, this holds that max pixel dimensions in X & Y'; CREATE UNIQUE INDEX thumbnail_queue_image_id_idx ON thumbnail_queue ( image_id |
|
From: <sp...@us...> - 2004-02-08 02:40:14
|
Update of /cvsroot/spidertree/spidertree/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2165/spidertree/classes Modified Files: SAlbum.php Log Message: more uploading Index: SAlbum.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SAlbum.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SAlbum.php 8 Feb 2004 02:09:43 -0000 1.5 +++ SAlbum.php 8 Feb 2004 02:37:16 -0000 1.6 @@ -192,7 +192,9 @@ $imageHash['dest_loc'] = $iDestPath.$files['name'][$i]; $imageHash['size'] = $files['size'][$i]; $image = new SImage( NULL, $this->mUID ); - if( !$image->store( $imageHash ) ) { + if( $image->store( $imageHash ) ) { + $this->addImage( ); + } else { pvd( $image->mErrors ); } } @@ -200,6 +202,25 @@ } // }}} + // {{{ processUpload + /** + * accepts a HTTP_POST_FILES var, saves the images, and adds them to this album + * + * @param $pPostFiles a $HTTP_POST_FILES varible with 'UPLOAD' as the hash to use + * @return TRUE if successful, FALSE if not. mErrors will hold error strings + * @access public + **/ + function addImage( $iImageMixed ) { + if( isset( $this->mALID ) && isset( $this->mUID ) ) { + if( is_numeric( $iImageMixed ) ) { + $sql = "INSERT"; + } + } + } + // }}} + + + } |
|
From: <sp...@us...> - 2004-02-08 02:23:29
|
Update of /cvsroot/spidertree/spidertree/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31575/templates Modified Files: spidertree_upload.tpl Log Message: uploads getting to disk, and shoved in database. Index: spidertree_upload.tpl =================================================================== RCS file: /cvsroot/spidertree/spidertree/templates/spidertree_upload.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- spidertree_upload.tpl 7 Feb 2004 18:25:20 -0000 1.2 +++ spidertree_upload.tpl 8 Feb 2004 02:20:31 -0000 1.3 @@ -1,6 +1,6 @@ <form enctype="multipart/form-data" method="post" action="upload.php" id="editpageform"> -<input type="hidden" name="FORM[ALID]" value="{$FORM.ALID}" /> +<input type="hidden" name="FORM[ALID]" value="{$album.ALID}" /> <table class="stdialog" border="0"> <tr> <td colspan="2" class="stdialogtop"> @@ -20,7 +20,7 @@ <input type="submit" name="fAlbumUpload" value="Add Now" class="stbutton" /> </form> <form enctype="multipart/form-data" method="post" action="album.php" id="editpageform"> -<input type="hidden" name="FORM[ALID]" value="{$FORM.ALID}" /> +<input type="hidden" name="FORM[ALID]" value="{$album.ALID}" /> <input type="submit" name="fAlbumCancel" value="Cancel" class="stbutton" /> </td> </form> |
|
From: <sp...@us...> - 2004-02-08 02:23:29
|
Update of /cvsroot/spidertree/spidertree/edit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31575/edit Modified Files: album.php Log Message: uploads getting to disk, and shoved in database. Index: album.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/edit/album.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- album.php 7 Feb 2004 21:05:35 -0000 1.5 +++ album.php 8 Feb 2004 02:20:31 -0000 1.6 @@ -10,14 +10,16 @@ if( $gAlbum->store( $FORM ) ) { if( $new ) { $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_upload.tpl'); +pvd( $FORM ); } else { include_once( 'album_list_inc.php' ); } + $smarty->assign_by_ref( 'album', $FORM ); } else { $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_edit_album_info.tpl'); + $smarty->assign_by_ref( 'FORM', $FORM ); $smarty->assign_by_ref( 'ERRORS', $gAlbum->mErrors ); } - $smarty->assign_by_ref( 'FORM', $FORM ); } elseif( isset( $fAlbumEditInfo ) ) { $smarty->assign_by_ref( 'FORM', $gAlbum->mRow ); $smarty->assign('spidertree_body','tikipackage:spidertree/spidertree_edit_album_info.tpl'); |
|
From: <sp...@us...> - 2004-02-08 02:12:41
|
Update of /cvsroot/spidertree/spidertree/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29744/classes Modified Files: SAlbum.php SImage.php SUserBase.php Log Message: uploads getting to disk, and shoved in database. |
|
From: <sp...@us...> - 2004-02-08 02:12:41
|
Update of /cvsroot/spidertree/spidertree/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29744/db Modified Files: spidertree.PGModel spidertree_create.sql Log Message: uploads getting to disk, and shoved in database. |
|
From: <sp...@us...> - 2004-02-07 21:29:02
|
Update of /cvsroot/spidertree/spidertree/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11249/classes Modified Files: SAlbum.php SImage.php Log Message: more upload stuff, slowly getting there Index: SAlbum.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SAlbum.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SAlbum.php 7 Feb 2004 21:05:35 -0000 1.3 +++ SAlbum.php 7 Feb 2004 21:25:52 -0000 1.4 @@ -178,6 +178,14 @@ } // }}} + // {{{ processUpload + /** + * accepts a HTTP_POST_FILES var, saves the images, and adds them to this album + * + * @param $pPostFiles a $HTTP_POST_FILES varible with 'UPLOAD' as the hash to use + * @return TRUE if successful, FALSE if not. mErrors will hold error strings + * @access public + **/ function processUpload( &$pPostFiles, $iDestPath ) { $files = &$pPostFiles['UPLOAD']; foreach( array_keys( $files['size'] ) as $i ) { @@ -186,6 +194,7 @@ } } } + // }}} } Index: SImage.php =================================================================== RCS file: /cvsroot/spidertree/spidertree/classes/SImage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SImage.php 7 Feb 2004 21:05:35 -0000 1.1 +++ SImage.php 7 Feb 2004 21:25:52 -0000 1.2 @@ -156,7 +156,7 @@ //pvd( $pParams ); //print "sql $sql"; $rs = $this->mDB->Execute($sql, array( $pParams['title'], $pParams['path'], $this->mUID, $pParams['IMID'] ) ); - +pvd( $pParams ); $this->mDB->CompleteTrans(); } return( count( $this->mErrors ) == 0 ); @@ -178,15 +178,6 @@ } // }}} - function processUpload( &$pPostFiles, $iDestPath ) { - $files = &$pPostFiles['UPLOAD']; - foreach( array_keys( $files['size'] ) as $i ) { - if( $files['size'][$i] > 0 ) { - move_uploaded_file( $files['tmp_name'][$i], $iDestPath.$files['name'][$i] ); - } - } - } - } |
|
From: <sp...@us...> - 2004-02-07 21:08:32
|
Update of /cvsroot/spidertree/spidertree/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7635/db Modified Files: spidertree.PGModel spidertree_create.sql Log Message: working on upload Index: spidertree.PGModel =================================================================== RCS file: /cvsroot/spidertree/spidertree/db/spidertree.PGModel,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- spidertree.PGModel 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ spidertree.PGModel 7 Feb 2004 21:05:35 -0000 1.2 @@ -1,4 +1,4 @@ -<PGModel Align="68" DisplayFlags="1" LineColor="#000000" FillStyle="none" LineWidth="1" FontUnderline="0" FillColor="#ffffff" LineStyle="Solid" FontColor="#000000" FontPointSize="9" DatabaseType="PostgreSQL" FontBold="0" DatabaseName="spidertree" FontItalic="0" Author="Christian Fowler" TextFlag="2048" FontStrikeOut="0" Name="Spidertree" Version="1.0" NextOID="2" FontFamily="Helvetica [Urw]" > +<PGModel Align="68" DisplayFlags="1" LineColor="#000000" FillStyle="none" LineWidth="1" FontUnderline="0" FillColor="#ffffff" LineStyle="Solid" FontColor="#000000" FontPointSize="9" DatabaseType="PostgreSQL" FontBold="0" DatabaseName="spidertree" FontItalic="0" Author="Christian Fowler" TextFlag="2048" FontStrikeOut="0" Name="Spidertree" Version="1.0" NextOID="8" FontFamily="Helvetica [Urw]" > <Validation> <Rule Name="Reference name missing" Value="Warning" /> <Rule Name="Reference name duplicate" Value="Warning" /> @@ -47,9 +47,14 @@ <Rule Name="Inherit derived table missing" Value="Error" /> <Rule Name="Inherit base table missing" Value="Error" /> </Validation> - <PGTable width="185" x="57" TextField="2" Align="68" y="50" LineColor="#000000" FillStyle="Solid" LineWidth="1" FontUnderline="0" FillColor="#ffffff" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="1" height="112" FontBold="0" FontItalic="0" ScriptCreate="1" TextFlag="2048" FontStrikeOut="0" Name="album" id="0x83fbe70" NextOID="8" ScriptCreateDrop="1" FontFamily="Luxi Sans" > + <PGSequence OID="4" ScriptCreate="1" Name="album_id_seq" NextOID="1" ScriptCreateDrop="1" /> + <PGSequence OID="7" ScriptCreate="1" Name="image_id_seq" NextOID="1" ScriptCreateDrop="0" /> + <PGTable width="185" x="31" TextField="2" Align="68" y="41" LineColor="#000000" FillStyle="Solid" LineWidth="1" FontUnderline="0" FillColor="#ffffff" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="1" height="168" FontBold="0" FontItalic="0" ScriptCreate="1" TextFlag="2048" FontStrikeOut="0" Name="album" id="0x83fbe70" NextOID="11" ScriptCreateDrop="1" FontFamily="Sans" > + <sink x="0.924324" y="0.119048" OID="8" id="0x860cc00" /> <PGColumn PrimaryKey="1" OID="1" DataType="integer" Name="album_id" NextOID="1" Mandatory="1" /> <PGColumn ForeignKey="1" OID="6" DataType="integer" Name="user_id" NextOID="1" Mandatory="1" /> + <PGColumn OID="9" DataType="timestamp" Name="create_date" Default="'now'" NextOID="1" Mandatory="1" /> + <PGColumn OID="10" DataType="timestamp" Name="modify_date" Default="'now'" NextOID="1" Mandatory="1" /> <PGColumn OID="4" DataType="ltree" Name="path" NextOID="1" Mandatory="1" /> <PGColumn OID="2" Length="256" DataType="varchar" Name="title" NextOID="1" Mandatory="1" /> <PGColumn OID="3" DataType="bit" Name="is_private" NextOID="1" /> @@ -60,4 +65,37 @@ <PGIndexColumn OID="1" Order="" Name="user_id" NextOID="1" /> </PGIndex> </PGTable> + <PGTable width="182" x="505" TextField="2" Align="68" y="41" LineColor="#000000" FillStyle="Solid" LineWidth="1" FontUnderline="0" FillColor="#ffffff" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="5" height="251" FontBold="0" FontItalic="0" ScriptCreate="1" TextFlag="2048" FontStrikeOut="0" Name="image" id="0x8483020" NextOID="8" ScriptCreateDrop="0" FontFamily="Sans" > + <sink x="0.0879121" y="0.0836653" OID="7" id="0x84bbeb0" /> + <PGColumn PrimaryKey="1" OID="2" DataType="integer" Name="image_id" NextOID="1" Mandatory="1" /> + <PGColumn OID="3" Length="256" DataType="varchar" Name="file_name" NextOID="1" Mandatory="1" /> + <PGColumn OID="4" Length="256" DataType="varchar" Name="title" NextOID="1" Mandatory="1" /> + <PGColumn OID="5" DataType="text" Name="descr" NextOID="1" /> + <PGIndex Unique="1" OID="6" Name="image_image_id_idx" NextOID="2" > + <PGIndexColumn OID="1" Order="" Name="image_id" NextOID="1" /> + </PGIndex> + </PGTable> + <PGTable width="136" x="290" TextField="2" Align="68" y="88" LineColor="#000000" FillStyle="Solid" LineWidth="1" FontUnderline="0" FillColor="#ffffff" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="6" height="59" FontBold="0" FontItalic="0" ScriptCreate="1" TextFlag="2048" FontStrikeOut="0" Name="album_map" id="0x8624950" NextOID="6" ScriptCreateDrop="0" FontFamily="Sans" > + <sink x="0.419118" y="0.305085" OID="1" id="0x854c2e8" /> + <sink x="0.610294" y="0.745763" OID="2" id="0x861ac98" /> + <PGColumn ForeignKey="1" OID="3" DataType="integer" Name="album_id" NextOID="1" Mandatory="1" /> + <PGColumn ForeignKey="1" OID="4" DataType="integer" Name="image_id" NextOID="1" Mandatory="1" /> + <PGIndex OID="5" Name="album_map_album_id_idx" NextOID="2" > + <PGIndexColumn OID="1" Order="" Name="album_id" NextOID="1" /> + </PGIndex> + </PGTable> + <PGReference TextField="3" Align="68" LineColor="#000000" FillStyle="none" LineWidth="1" EndArrowDirection="520550350" EndArrowType="2" FontUnderline="0" FillColor="#000000" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="2" BeginArrowDirection="-872351970" BeginArrowType="0" FontBold="0" Child="album_map" FontItalic="0" ScriptCreate="1" Parent="image" EndTruncate="1" TextFlag="2048" FontStrikeOut="0" Name="album_map_image_ref" BeginTruncate="1" id="0x8625e98" NextOID="6" ScriptCreateDrop="0" FontFamily="Sans" > + <point x="373" y="132" sinkobjectid="0x8624950" OID="1" id="0x8549f48" sinkid="0x861ac98" /> + <point x="373" y="61" OID="2" id="0x8548520" /> + <point x="521" y="62" sinkobjectid="0x8483020" OID="3" id="0x85ec498" sinkid="0x84bbeb0" /> + <texthandle x="0.0447761" y="0.243243" OID="4" /> + <ColumnRef OID="5" Child="album_id" Parent="image_id" NextOID="1" /> + </PGReference> + <PGReference TextField="3" Align="68" LineColor="#000000" FillStyle="none" LineWidth="1" EndArrowDirection="41" EndArrowType="2" FontUnderline="0" FillColor="#000000" LineStyle="Solid" FontColor="#000000" FontPointSize="9" OID="3" BeginArrowDirection="0" BeginArrowType="0" FontBold="0" Child="album_map" FontItalic="0" ScriptCreate="1" Parent="album" EndTruncate="1" TextFlag="2048" FontStrikeOut="0" Name="album_map_album_ref" BeginTruncate="1" id="0x8555d28" NextOID="6" ScriptCreateDrop="0" FontFamily="Sans" > + <point x="347" y="106" sinkobjectid="0x8624950" OID="1" id="0x8615d58" sinkid="0x854c2e8" /> + <point x="347" y="61" OID="2" id="0x8624f68" /> + <point x="202" y="61" sinkobjectid="0x83fbe70" OID="3" id="0x84f7cb8" sinkid="0x860cc00" /> + <texthandle x="0.171233" y="0.326087" OID="4" /> + <ColumnRef OID="5" Child="album_id" Parent="album_id" NextOID="1" /> + </PGReference> </PGModel> Index: spidertree_create.sql =================================================================== RCS file: /cvsroot/spidertree/spidertree/db/spidertree_create.sql,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- spidertree_create.sql 7 Feb 2004 16:21:28 -0000 1.1.1.1 +++ spidertree_create.sql 7 Feb 2004 21:05:35 -0000 1.2 @@ -9,6 +9,17 @@ -- +--------------------------------------------------------- -- | DROP -- +--------------------------------------------------------- +DROP SEQUENCE image_id_seq; +CREATE TABLE temp AS SELECT * FROM album_map; +DROP TABLE album_map; +CREATE TABLE album_map AS SELECT * FROM temp; +DROP TABLE temp; +CREATE TABLE temp AS SELECT * FROM album_map; +DROP TABLE album_map; +CREATE TABLE album_map AS SELECT * FROM temp; +DROP TABLE temp; +DROP TABLE album_map; +DROP TABLE image; DROP SEQUENCE album_id_seq; DROP TABLE album; -- +--------------------------------------------------------- @@ -18,6 +29,8 @@ ( album_id integer NOT NULL, user_id integer NOT NULL, + create_date timestamp NOT NULL DEFAULT 'now', + modify_date timestamp NOT NULL DEFAULT 'now', path ltree NOT NULL, title varchar(256) NOT NULL, is_private bit, @@ -34,3 +47,35 @@ ); CREATE SEQUENCE album_id_seq; +CREATE TABLE image +( + image_id integer NOT NULL, + file_name varchar(256) NOT NULL, + title varchar(256) NOT NULL, + descr text, + PRIMARY KEY (image_id) +); +CREATE UNIQUE INDEX image_image_id_idx ON image +( + image_id +); + +CREATE TABLE album_map +( + album_id integer NOT NULL, + image_id integer NOT NULL +); +CREATE INDEX album_map_album_id_idx ON album_map +( + album_id +); + +ALTER TABLE album_map ADD CONSTRAINT album_map_image_ref + FOREIGN KEY ( album_id ) + REFERENCES image ( image_id ) + NOT DEFERRABLE; +ALTER TABLE album_map ADD CONSTRAINT album_map_album_ref + FOREIGN KEY ( album_id ) + REFERENCES album ( album_id ) + NOT DEFERRABLE; +CREATE SEQUENCE image_id_seq; |