[Linpha-cvs] SF.net SVN: linpha: [4521] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-04-12 16:32:53
|
Revision: 4521 Author: fangehrn Date: 2006-04-12 09:32:29 -0700 (Wed, 12 Apr 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4521&view=rev Log Message: ----------- * replace some recordCount() with EOF Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/image_fields_define.php trunk/linpha2/admin/permissions_read.php trunk/linpha2/lib/classes/thumbnails.js Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-04-12 16:10:57 UTC (rev 4520) +++ trunk/linpha2/ChangeLog 2006-04-12 16:32:29 UTC (rev 4521) @@ -1,3 +1,6 @@ +2006-04-12 flo + * replace some recordCount() with EOF + 2006-04-12 bzrudi <linpha2_AT_tuxpower_DOT_de> * added ORACLE EXPRESS DB support, still some things open but at least the basics work :-) Modified: trunk/linpha2/admin/image_fields_define.php =================================================================== --- trunk/linpha2/admin/image_fields_define.php 2006-04-12 16:10:57 UTC (rev 4520) +++ trunk/linpha2/admin/image_fields_define.php 2006-04-12 16:32:29 UTC (rev 4521) @@ -121,23 +121,12 @@ /** * get own fields */ - /** - * @todo check if this works for all databases, record count makes - * some dbs extreme slowly and should be diabled by default - */ - $number_query = $GLOBALS['linpha']->db->GetRow("SELECT id, name, field_type, flags " . - "FROM ".PREFIX."meta_fields " . - "WHERE flags = '7' " . - "OR flags = '8'"); - $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, field_type, flags " . "FROM ".PREFIX."meta_fields " . "WHERE flags = '7' " . "OR flags = '8'"); -// if($query->RecordCount()>0) - - if(true == $number_query) //at least we found a single record + if( ! $query->EOF ) { ?> <h3>Own fields</h3> Modified: trunk/linpha2/admin/permissions_read.php =================================================================== --- trunk/linpha2/admin/permissions_read.php 2006-04-12 16:10:57 UTC (rev 4520) +++ trunk/linpha2/admin/permissions_read.php 2006-04-12 16:32:29 UTC (rev 4521) @@ -11,21 +11,9 @@ { /** * insert or update - * @todo WARNING Check if this worls for all dbs!! */ - //$query = $linpha->db->Execute("SELECT id FROM ".PREFIX."permissions WHERE photos_id = '".$linpha->sql->linAddslashes($_POST['photo_id'])."'"); - //$num = $query->RecordCount(); - - $query = $linpha->db->GetRow("SELECT id FROM ".PREFIX."permissions " . - "WHERE photos_id = '".$linpha->sql->linAddslashes($_POST['photo_id'])."'"); - if(true == $query) - { - $num = 10; //set > 0 - } - else - { - $num = 0; - } + $query = $linpha->db->Execute("SELECT id FROM ".PREFIX."permissions " . + "WHERE photos_id = '".LinSql::linAddslashes($_POST['photo_id'])."'"); /** * if inherit is selected, delete if an entry exists @@ -34,10 +22,10 @@ */ if(isset($_POST['inherit'])) { - if($num != 0 && $_POST['photo_id'] != 0) + if( ! $query->EOF && $_POST['photo_id'] != 0) { $linpha->db->Execute("DELETE FROM ".PREFIX."permissions " . - "WHERE photos_id = '".$linpha->sql->linAddslashes($_POST['photo_id'])."'"); + "WHERE photos_id = '".LinSql::linAddslashes($_POST['photo_id'])."'"); } } else @@ -62,16 +50,16 @@ $str_groups = ''; } - if($num != 0) + if( ! $query->EOF ) { - $linpha->db->Execute("UPDATE ".PREFIX."permissions SET permission = ';".$linpha->sql->linAddslashes($str_groups).";' " . - "WHERE photos_id = '".$linpha->sql->linAddslashes($_POST['photo_id'])."'"); + $linpha->db->Execute("UPDATE ".PREFIX."permissions SET permission = ';".LinSql::linAddslashes($str_groups).";' " . + "WHERE photos_id = '".LinSql::linAddslashes($_POST['photo_id'])."'"); } else { $linpha->db->Execute("INSERT into ".PREFIX."permissions (photos_id, perm_type, permission) VALUES (" . - "'".$linpha->sql->linAddslashes($_POST['photo_id'])."', 'read'," . - "';".$linpha->sql->linAddslashes($str_groups).";' )"); + "'".LinSql::linAddslashes($_POST['photo_id'])."', 'read'," . + "';".LinSql::linAddslashes($str_groups).";' )"); } } } @@ -84,7 +72,7 @@ $parent_id = $_GET['parent_id']; $view_mode = 'files'; - $array = $GLOBALS['linpha']->sql->getFullFilenameFromId( linSql::linAddslashes($parent_id) ); + $array = $GLOBALS['linpha']->sql->getFullFilenameFromId( LinSql::linAddslashes($parent_id) ); $parent_name = '<b>'.implode('/',$array).'</b>'; $recursive = false; @@ -117,22 +105,11 @@ /** * check wether add or edit (insert or update) - * @todo WARNING !!! */ -// $query = $linpha->db->Execute("SELECT id FROM ".PREFIX."permissions WHERE photos_id = '".linSql::linAddslashes($_GET['id'])."'"); -// $num = $query->RecordCount(); - $query = $linpha->db->GetRow("SELECT id FROM ".PREFIX."permissions " . - "WHERE photos_id = '".linSql::linAddslashes($_GET['id'])."'"); - if(true == $query) - { - $num = 10; //set > 0 - } - else - { - $num = 0; - } + $query = $linpha->db->Execute("SELECT id FROM ".PREFIX."permissions " . + "WHERE photos_id = '".LinSql::linAddslashes($_GET['id'])."'"); - if( $num > 0 ) + if( ! $query->EOF ) { list($stage, $perm) = $GLOBALS['linpha']->sql->getPerm( $_GET['id'] ); $array_perms = explode(';',$perm); @@ -144,7 +121,7 @@ } $query = $GLOBALS['linpha']->db->Execute("SELECT name FROM ".PREFIX."photos " . - "WHERE id = '".linSql::linAddslashes($_GET['id'])."'"); + "WHERE id = '".LinSql::linAddslashes($_GET['id'])."'"); $data = $query->FetchRow(ADODB_FETCH_NUM); ?> <form name="permission" method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_view&parent_id='.$parent_id; ?>"> Modified: trunk/linpha2/lib/classes/thumbnails.js =================================================================== --- trunk/linpha2/lib/classes/thumbnails.js 2006-04-12 16:10:57 UTC (rev 4520) +++ trunk/linpha2/lib/classes/thumbnails.js 2006-04-12 16:32:29 UTC (rev 4521) @@ -138,13 +138,14 @@ '<div id="div' + i + '"' + htmltext + ' class="imgdiv">' + img_ids[i]['before'] + '<a href="' + link_url + "&id=" + img_ids[i]['id'] + '">' + - '<img src="' + link_get_thumb + img_ids[i]['id'] + '" height="' + tn_size + - '" alt="' + img_ids[i]['title'] + '" title="' + + '<img src="' + link_get_thumb + img_ids[i]['id'] + '"' + + ' height="' + tn_size + '"' + ' width="' + tn_size + '" ' + ' alt="' + img_ids[i]['title'] + '" title="' + img_ids[i]['title'] + '" class="img_thumbnail" />' + '</a>' + img_ids[i]['after'] + '</div>'; /** - * flush buffer on end of line + * flush buffer of divhtmltext on end of line * with this buffer, we're 3-4 as fast as without !! * see also http://www.softwaresecretweapons.com/jspwiki/Wiki.jsp?page=JavascriptStringConcatenation !! */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |