[Linpha-cvs] SF.net SVN: linpha: [4509] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <bz...@us...> - 2006-04-11 08:09:05
|
Revision: 4509 Author: bzrudi Date: 2006-04-11 01:08:38 -0700 (Tue, 11 Apr 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4509&view=rev Log Message: ----------- DB fetch mode is now set to ADODB_FETCH_ASSOC by default, no longer BOTH Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/image_fields_define.php trunk/linpha2/admin/image_fields_select.php trunk/linpha2/admin/import.php trunk/linpha2/admin/permissions_groups.php trunk/linpha2/admin/permissions_others.php trunk/linpha2/admin/permissions_read.php trunk/linpha2/admin/permissions_usergroup.php trunk/linpha2/admin/permissions_users.php trunk/linpha2/install/step10_postsettings.php trunk/linpha2/install/step8_testing.php trunk/linpha2/lib/classes/linpha.image.class.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.import.class.php trunk/linpha2/lib/classes/linpha.metadata.class.php trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/lib/modules/module.basket.php trunk/linpha2/templates/default/view_img.html.php trunk/linpha2/templates/default/view_meta.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/ChangeLog 2006-04-11 08:08:38 UTC (rev 4509) @@ -1,3 +1,9 @@ +2006-04-11 bzrudi <linpha2_AT_tuxpower_DOT_de> + * DB fetch mode is now set to ADODB_FETCH_ASSOC by default, so no need + for fetchRow(ADODB_FETCH_ASSOC) any more. If you need to fetch NUM, use this + fetchRow(ADODB_FETCH_NUM). + - replace some ASSOCS due NUM for speed improvements + 2006-04-10 bzrudi <linpha2_AT_tuxpower_DOT_de> * Database - renamed some preserved table field names. e.g. don't use "date", "name" as Modified: trunk/linpha2/admin/image_fields_define.php =================================================================== --- trunk/linpha2/admin/image_fields_define.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/admin/image_fields_define.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -64,8 +64,11 @@ /** * get builtin fields */ - $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, field_type, flags FROM ".PREFIX."meta_fields WHERE flags = '5' OR flags = '6' "); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, field_type, flags " . + "FROM ".PREFIX."meta_fields " . + "WHERE flags = '5' OR flags = '6' "); + + while($data = $query->FetchRow()) { echo '<tr><td>'; echo $data['name']; @@ -135,7 +138,7 @@ </tr> <?php - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow()) { ?> <tr> @@ -181,7 +184,7 @@ function show_add_data() { $query = $GLOBALS['linpha']->db->Execute("SELECT id, name FROM ".PREFIX."meta_fields WHERE field_type = '2'"); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow()) { ?> <h3><?php echo $data['name']; ?></h3> @@ -194,7 +197,7 @@ </tr> <?php $query2 = $GLOBALS['linpha']->db->Execute("SELECT id, name, isprivate FROM ".PREFIX."meta_category WHERE field_id = '".$data['id']."'"); - while($data2 = $query2->FetchRow(ADODB_FETCH_ASSOC)) + while($data2 = $query2->FetchRow()) { ?> <tr> Modified: trunk/linpha2/admin/image_fields_select.php =================================================================== --- trunk/linpha2/admin/image_fields_select.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/admin/image_fields_select.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -70,7 +70,7 @@ <select id="select_image_fields" name="select_image_fields[]" size="25" style="width: 200px;" multiple="multiple"> <?php $query = $GLOBALS['linpha']->db->Execute("SELECT id, name FROM ".PREFIX."meta_fields WHERE flags = '".$flag_nr."' ORDER by id"); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow()) { echo '<option value="'.$data['name'].'">'.$MetaData->getNameOfField($data['name'],true).'</option>'; } @@ -94,7 +94,7 @@ <?php $query = $GLOBALS['linpha']->db->Execute("SELECT id, name FROM ".PREFIX."meta_fields " . "WHERE flags = '1' OR flags = '5'"); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow()) { echo '<option value="builtin_'.$data['name'].'">'.i18n( ucfirst( $data['name'] ) ).'</option>'; } @@ -112,7 +112,7 @@ <?php $query = $GLOBALS['linpha']->db->Execute("SELECT id, name FROM ".PREFIX."meta_fields " . "WHERE flags = '7'"); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow()) { echo '<option value="id_'.$data['id'].'">'.$data['name'].'</option>'; } Modified: trunk/linpha2/admin/import.php =================================================================== --- trunk/linpha2/admin/import.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/admin/import.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -21,10 +21,10 @@ /** * first, only for images */ - $query = $GLOBALS['linpha']->db->Execute("SELECT id, img_type FROM ".PREFIX."photos WHERE img_type <> 0 AND img_type <> 9999999"); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + $query = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".PREFIX."photos WHERE img_type <> 0 AND img_type <> 9999999"); + while($data = $query->FetchRow(ADODB_FETCH_NUM)) { - if( ! $thumbnail->createThumbnail($data['id']) ) + if( ! $thumbnail->createThumbnail($data['0']) ) { echo "Error while creating thumbnail!<br />Error: ".$thumbnail->error_msg."<br />"; } Modified: trunk/linpha2/admin/permissions_groups.php =================================================================== --- trunk/linpha2/admin/permissions_groups.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/admin/permissions_groups.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -75,7 +75,7 @@ </tr> <?php $query = $GLOBALS['linpha']->db->Execute("SELECT id, group_name FROM ".PREFIX."groups ORDER BY group_name"); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow()) { ?> <tr> Modified: trunk/linpha2/admin/permissions_others.php =================================================================== --- trunk/linpha2/admin/permissions_others.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/admin/permissions_others.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -102,7 +102,7 @@ <select id="selectgroups" name="groups[]" size="5" style="width: 200;" multiple="multiple"> <?php $query = $GLOBALS['linpha']->db->Execute("SELECT id, group_name FROM ".PREFIX."groups ORDER by group_name"); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow()) { if(in_array($data['id'],$array_permissions)) { Modified: trunk/linpha2/admin/permissions_read.php =================================================================== --- trunk/linpha2/admin/permissions_read.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/admin/permissions_read.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -89,7 +89,7 @@ */ $array_groups = Array(); $query = $GLOBALS['linpha']->db->Execute("SELECT id, group_name FROM ".PREFIX."groups WHERE group_name <> 'admin'"); - while($data = $query->FetchRow()) + while($data = $query->FetchRow(ADODB_FETCH_NUM)) { $array_groups[$data[0]] = $data[1]; } @@ -120,7 +120,7 @@ $query = $GLOBALS['linpha']->db->Execute("SELECT name FROM ".PREFIX."photos " . "WHERE id = '".linSql::linAddslashes($_GET['id'])."'"); - $data = $query->FetchRow(); + $data = $query->FetchRow(ADODB_FETCH_NUM); ?> <form name="permission" method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_view&parent_id='.$parent_id; ?>"> <h3>Change/Add permissions of folder/file "<?php echo $data[0]; ?>"</h3> @@ -202,7 +202,7 @@ function print_dir_perms_entry( $parent_id , $recursive , $stage) { $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, img_type FROM ".PREFIX."photos WHERE parent_id = '".$parent_id."'"); - while( $data = $query->FetchRow(ADODB_FETCH_ASSOC) ) + while( $data = $query->FetchRow() ) { list($i, $perm) = $GLOBALS['linpha']->sql->getPerm( $data['id'] ); Modified: trunk/linpha2/admin/permissions_usergroup.php =================================================================== --- trunk/linpha2/admin/permissions_usergroup.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/admin/permissions_usergroup.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -6,7 +6,7 @@ */ echo '<b>'.i18n("Edit Group Members").'</b><br />'; $query = $GLOBALS['linpha']->db->Execute("SELECT id, group_name FROM ".PREFIX."groups ORDER by group_name"); -while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) +while($data = $query->FetchRow()) { echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=group&id='.$data['id'].'">'.$data['group_name'].'</a><br />'; } @@ -18,7 +18,7 @@ */ echo '<b>'.i18n("Edit User Memberships").'</b><br />'; $query = $GLOBALS['linpha']->db->Execute("SELECT id, username FROM ".PREFIX."users ORDER by username"); -while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) +while($data = $query->FetchRow()) { echo '<a href="'.LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit=user&id='.$data['id'].'">'.$data['username'].'</a><br />'; } @@ -105,8 +105,10 @@ <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_usergroup&edit='.$_GET['edit'].'&id='.$_GET['id']; ?>"> <select name="usergroup[]" size="5" style="width: 200;" multiple="multiple"> <?php - $query = $GLOBALS['linpha']->db->Execute("SELECT id, ".$other_select_name." FROM ".PREFIX.$other_table_name." ORDER by ".$other_select_name); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + $query = $GLOBALS['linpha']->db->Execute("SELECT id, ".$other_select_name." " . + "FROM ".PREFIX.$other_table_name." " . + "ORDER by ".$other_select_name); + while($data = $query->FetchRow()) { /** * check if selected @@ -121,7 +123,9 @@ $userid = LinSql::linAddslashes($_GET['id']); $groupid = $data['id']; } - $data2 = $GLOBALS['linpha']->db->GetRow("SELECT id FROM ".PREFIX."user_group WHERE user_id = '".$userid."' AND group_id = '".$groupid."'"); + $data2 = $GLOBALS['linpha']->db->GetRow("SELECT id FROM ".PREFIX."user_group " . + "WHERE user_id = '".$userid."' " . + "AND group_id = '".$groupid."'"); if(isset($data2['id'])) { $checked = ' selected="selected"'; Modified: trunk/linpha2/admin/permissions_users.php =================================================================== --- trunk/linpha2/admin/permissions_users.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/admin/permissions_users.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -91,7 +91,7 @@ * show users */ $query = $GLOBALS['linpha']->db->Execute("SELECT id, username, display_name, user_email FROM ".PREFIX."users ORDER BY username"); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow()) { ?> <tr> Modified: trunk/linpha2/install/step10_postsettings.php =================================================================== --- trunk/linpha2/install/step10_postsettings.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/install/step10_postsettings.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -83,7 +83,7 @@ $query = $linpha->db->Execute("SELECT option_value FROM ".PREFIX."config " . "WHERE option_name='sys_im_use_imagemagick'"); -$data = $query->FetchRow(); +$data = $query->FetchRow(ADODB_FETCH_NUM); if(false === $data[0]) { Modified: trunk/linpha2/install/step8_testing.php =================================================================== --- trunk/linpha2/install/step8_testing.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/install/step8_testing.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -237,7 +237,7 @@ $error = false; if($key == "SELECT") { - $data = $result->FetchRow(); + $data = $result->FetchRow(ADODB_FETCH_NUM); if( !$data OR @$data[1] != md5('the life ist beautiful')) { $error = true; Modified: trunk/linpha2/lib/classes/linpha.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.image.class.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/lib/classes/linpha.image.class.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -175,7 +175,8 @@ /** * check for valid id */ - $query = $GLOBALS['linpha']->db->Execute("SELECT id, img_type FROM ".PREFIX."photos WHERE id = '".LinSql::linAddslashes( $this->photo_id )."'"); + $query = $GLOBALS['linpha']->db->Execute("SELECT id, img_type FROM ".PREFIX."photos " . + "WHERE id = '".LinSql::linAddslashes( $this->photo_id )."'"); if($query->RecordCount() != 1) { @@ -183,15 +184,15 @@ return false; } - $data = $query->FetchRow(ADODB_FETCH_ASSOC); + $data = $query->FetchRow(ADODB_FETCH_NUM); - if( ! LinSql::photoIsAllowed( $data['id'] ) ) + if( ! LinSql::photoIsAllowed( $data['0'] ) ) { $this->error_msg = "not permitted!"; return false; } - if($this->mode == 'img' && ! LinIdentify::isSupportedImage( $data['img_type'] ) ) + if($this->mode == 'img' && ! LinIdentify::isSupportedImage( $data['1'] ) ) { $this->error_msg = "only images possible!"; return false; @@ -206,7 +207,7 @@ $this->force = false; } - $this->img_type = $data['img_type']; + $this->img_type = $data['1']; $this->setCachedInfos(); /** @@ -352,16 +353,16 @@ $query = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".PREFIX."photos WHERE parent_id = '".LinSql::linAddslashes( $this->photo_id )."'"); $array_ids = Array(); $i=0; - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow(ADODB_FETCH_NUM)) { if($i >= 4) { break; } - if( file_exists( LinImage::getCachePath('thumb',$data['id']) ) ) + if( file_exists( LinImage::getCachePath('thumb',$data['0']) ) ) { - $array_ids[] = $data['id']; + $array_ids[] = $data['0']; $i++; } } Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -813,15 +813,15 @@ for($i = 1; $i <= $nr_random_images ; ) { - $data = $query->FetchRow(ADODB_FETCH_ASSOC); - if(isset($data['id'])) + $data = $query->FetchRow(ADODB_FETCH_NUM); + if(isset($data['0'])) { - $array = LinSql::getFullFilenameFromId( $data['id'] ); + $array = LinSql::getFullFilenameFromId( $data['0'] ); $path = LinSql::getPath('album') .'/'. implode('/',$array); - if(file_exists(LinFilesys::getFullPath($path)) && LinSql::photoIsAllowed($data['id'])) + if(file_exists(LinFilesys::getFullPath($path)) && LinSql::photoIsAllowed($data['0'])) { - $GLOBALS['linpha']->template->output['random_images'][] = Array('id'=>$data['id'],'path'=>$path); + $GLOBALS['linpha']->template->output['random_images'][] = Array('id'=>$data['0'],'path'=>$path); $i++; } } Modified: trunk/linpha2/lib/classes/linpha.import.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.import.class.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/lib/classes/linpha.import.class.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -118,12 +118,12 @@ */ if($recursive) { - $query = $GLOBALS['linpha']->db->Execute("SELECT id, name " . + $query = $GLOBALS['linpha']->db->Execute("SELECT id " . "FROM ".PREFIX."photos WHERE img_type = '0' " . "AND parent_id = '".$parent_id."'"); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow(ADODB_FETCH_NUM)) { - LinImport::updateDir($data['id'], $recursive); + LinImport::updateDir($data['0'], $recursive); } } } @@ -202,9 +202,9 @@ */ $query = $GLOBALS['linpha']->db->Execute("SELECT id, name " . "FROM ".PREFIX."photos WHERE parent_id = '".$photo_id."' "); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow(ADODB_FETCH_NUM)) { - linImport::deleteEntry( $data['id'], $full_filename.'/'.$data['name']); + linImport::deleteEntry( $data['0'], $full_filename.'/'.$data['1']); } linSysLog('delete entry '.$full_filename.'<br />'); Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -75,15 +75,17 @@ */ function readInformations($full_filename,$filename,$md5sum,$flag_nr) { - $query = $GLOBALS['linpha']->db->Execute("SELECT name FROM ".PREFIX."meta_fields WHERE flags = '".$flag_nr."' ORDER by id"); - while($fields_data = $query->FetchRow(ADODB_FETCH_ASSOC)) + $query = $GLOBALS['linpha']->db->Execute("SELECT name FROM ".PREFIX."meta_fields " . + "WHERE flags = '".$flag_nr."' ORDER by id"); + + while($fields_data = $query->FetchRow(ADODB_FETCH_NUM)) { - $name = MetaData::getNameOfField( $fields_data['name'], false ); + $name = MetaData::getNameOfField( $fields_data['0'], false ); $value = ''; - $pos = strpos($fields_data['name'],'_'); - $first_part = substr($fields_data['name'],0,$pos); - $last_part = substr($fields_data['name'],$pos+1); + $pos = strpos($fields_data['0'],'_'); + $first_part = substr($fields_data['0'],0,$pos); + $last_part = substr($fields_data['0'],$pos+1); switch($first_part) { case 'builtin': Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -41,6 +41,11 @@ */ function dbConnect() { + /** + * set adodb global default to fetch ASSOC + */ + $ADODB_FETCH_MODE = 'ADODB_FETCH_ASSOC'; + if(isset($_SESSION['installmode1'])) { $db_type = $_SESSION['sql_dbtype']; @@ -110,7 +115,7 @@ } break; - } + } } if( !isset($GLOBALS['linpha']->db) OR !$GLOBALS['linpha']->db->isConnected() ) @@ -178,7 +183,7 @@ $query = $GLOBALS['linpha']->db->Execute("SELECT username, display_name FROM ".PREFIX."users ". "WHERE id = '".LinSql::linAddslashes($_COOKIE['linpha_userid'])."' ". "AND password = '".LinSql::linAddslashes($_COOKIE['linpha_password'])."'"); - if($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + if($data = $query->FetchRow()) { //linpha_log('login','notice','User '.$_POST['user_name'].": successfully logged in."); linSysLog(i18n("Successfully Logged In!<br />")); @@ -336,7 +341,7 @@ * get user_groups */ $query = $GLOBALS['linpha']->db->Execute("SELECT group_id FROM ".PREFIX."user_group WHERE user_id = '".$userid."'"); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow()) { $_SESSION['user_groups'][] = $data['group_id']; } @@ -500,16 +505,18 @@ */ function getFullFilenameFromId( $photos_id ) { - $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, parent_id FROM ".PREFIX."photos WHERE id = '".$GLOBALS['linpha']->sql->linAddslashes($photos_id)."'"); - $data = $query->FetchRow(ADODB_FETCH_ASSOC); + $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, parent_id FROM ".PREFIX."photos " . + "WHERE id = '".$GLOBALS['linpha']->sql->linAddslashes($photos_id)."'"); + $data = $query->FetchRow(); $array_names[ $photos_id ] = $data['name']; $parent_id = $data['parent_id']; for($i = 0; $parent_id != 0 ; $i++) { - $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, parent_id FROM ".PREFIX."photos WHERE id = '".$parent_id."'"); - $data = $query->FetchRow(ADODB_FETCH_ASSOC); + $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, parent_id FROM ".PREFIX."photos " . + "WHERE id = '".$parent_id."'"); + $data = $query->FetchRow(); $array_names[ $data['id'] ] = $data['name']; $parent_id = $data['parent_id']; @@ -639,10 +646,12 @@ { unset($this->value); - $query = $GLOBALS['linpha']->db->Execute("SELECT option_name, option_value FROM ".PREFIX."config"); - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + $query = $GLOBALS['linpha']->db->Execute("SELECT option_name, option_value " . + "FROM ".PREFIX."config"); + + while($data = $query->FetchRow(ADODB_FETCH_NUM)) { - $this->value[$data['option_name']] = $data['option_value']; + $this->value[$data['0']] = $data['1']; } } Modified: trunk/linpha2/lib/modules/module.basket.php =================================================================== --- trunk/linpha2/lib/modules/module.basket.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/lib/modules/module.basket.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -42,7 +42,10 @@ if( isset( $_GET['ref_id'] ) ) { - $query = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".PREFIX."photos WHERE img_type <> '0' AND parent_id = '".linSql::linAddslashes($_GET['ref_id'])."'"); + $query = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".PREFIX."photos " . + "WHERE img_type <> '0' " . + "AND parent_id = '".linSql::linAddslashes($_GET['ref_id'])."'"); + while($data = $query->FetchRow()) { if($GLOBALS['linpha']->sql->photoIsAllowed($data[0])) Modified: trunk/linpha2/templates/default/view_img.html.php =================================================================== --- trunk/linpha2/templates/default/view_img.html.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/templates/default/view_img.html.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -57,7 +57,7 @@ <br /><br /> <!-- show image comments --> - <?php while($data = $GLOBALS['linpha']->template->output['image_comments']->FetchRow(ADODB_FETCH_ASSOC)) { ?> + <?php while($data = $GLOBALS['linpha']->template->output['image_comments']->FetchRow()) { ?> <div class="comments"> <?php echo $data['meta_time']; ?> <?php echo $data['meta_author']; ?> <br /> Modified: trunk/linpha2/templates/default/view_meta.html.php =================================================================== --- trunk/linpha2/templates/default/view_meta.html.php 2006-04-10 21:28:38 UTC (rev 4508) +++ trunk/linpha2/templates/default/view_meta.html.php 2006-04-11 08:08:38 UTC (rev 4509) @@ -10,7 +10,8 @@ if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { - $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, field_type FROM ".PREFIX."meta_fields " . + $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, field_type " . + "FROM ".PREFIX."meta_fields " . "WHERE flags = '5' OR flags = '7' ORDER by id"); $num = $query->RecordCount(); ?> @@ -22,7 +23,7 @@ <td rowspan="<?php echo $num+1; ?>"><?php echo $GLOBALS['linpha']->template->output['image']; ?></td> </tr> <?php - while($data = $query->FetchRow(ADODB_FETCH_ASSOC)) + while($data = $query->FetchRow()) { ?> <tr> @@ -53,9 +54,10 @@ ?> <select name="field[<?php echo $data['id']; ?>][]" multiple="multiple" style="width: 200px;"> <?php - $cat_query = $GLOBALS['linpha']->db->Execute("SELECT id, name FROM ".PREFIX."meta_category " . + $cat_query = $GLOBALS['linpha']->db->Execute("SELECT id, name " . + "FROM ".PREFIX."meta_category " . "WHERE field_id = '".$data['id']."'"); - while($cat_data = $cat_query->FetchRow(ADODB_FETCH_ASSOC)) + while($cat_data = $cat_query->FetchRow()) { if(in_array($cat_data['id'],$array_pieces)) { $checked = ' selected="selected"'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |