Skip to content

Commit

Permalink
fixed bug on counting files of directory that has thumbnail specified
Browse files Browse the repository at this point in the history
modified queries
  • Loading branch information
goldsky committed May 9, 2013
1 parent 470c56d commit 2b7fc12
Show file tree
Hide file tree
Showing 28 changed files with 119 additions and 110 deletions.
2 changes: 1 addition & 1 deletion assets/modules/easy2/.version
@@ -1 +1 @@
1.4.12-pl
1.4.13-rc1
4 changes: 4 additions & 0 deletions assets/modules/easy2/changes.english.txt
Expand Up @@ -3,6 +3,10 @@
) _) / \\___ \ ) / / __/ ( (_ \/ \/ (_/\/ (_/\ ) _) ) / ) /
(____)\_/\_/(____/(__/ (____) \___/\_/\_/\____/\____/(____)(__\_)(__/

***************** 1.4.13-rc1 ******************
+ fixed bug on counting files of directory that has thumbnail specified
+ modified queries

***************** 1.4.12-pl ******************
+ replaced mysql_escape_string to mysql_real_escape_string on comments.easy2gallery.php

Expand Down
6 changes: 3 additions & 3 deletions assets/modules/easy2/comments.easy2gallery.php
Expand Up @@ -34,7 +34,7 @@
sh_err('MySQL query error for configs');
die;
} else {
while ($row = mysql_fetch_array($e2g_res)) {
while ($row = mysql_fetch_assoc($e2g_res)) {
$e2g[$row['cfg_key']] = $row['cfg_val'];
}
}
Expand Down Expand Up @@ -149,7 +149,7 @@
. 'AND STATUS=1 ORDER BY id DESC '
. 'LIMIT ' . ($cpn * $e2g['ecl']) . ', ' . $e2g['ecl']);
$i = 0;
while ($l = mysql_fetch_array($res, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($res)) {

$l['i'] = $i % 2;

Expand Down Expand Up @@ -254,7 +254,7 @@ function getChunk($name) {

$res = mysql_query('SELECT * FROM ' . $table_prefix . "site_htmlsnippets WHERE name='" . mysql_real_escape_string($name) . "'");
if (mysql_num_rows($res) > 0) {
$row = mysql_fetch_array($res, MYSQL_ASSOC);
$row = mysql_fetch_assoc($res);
return $row['snippet'];
} else {
return false;
Expand Down
2 changes: 1 addition & 1 deletion assets/modules/easy2/extras/tv.easy2gallery.php
Expand Up @@ -19,7 +19,7 @@

$childrenDirs = array();
if ($queryDir) {
while ($l = mysql_fetch_array($queryDir, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($queryDir)) {
$childrenDirs[$l['cat_id']]['parent_id'] = $l['parent_id'];
$childrenDirs[$l['cat_id']]['cat_id'] = $l['cat_id'];
$childrenDirs[$l['cat_id']]['cat_name'] = $l['cat_name'];
Expand Down
Expand Up @@ -27,7 +27,7 @@
if (!$q)
die(__FILE__ . ': MySQL query error for configs');
else {
while ($row = mysql_fetch_array($q)) {
while ($row = mysql_fetch_assoc($q)) {
$e2g[$row['cfg_key']] = $row['cfg_val'];
}
}
Expand Down
Expand Up @@ -27,7 +27,7 @@
if (!$q)
die(__FILE__ . ': MySQL query error for configs');
else {
while ($row = mysql_fetch_array($q)) {
while ($row = mysql_fetch_assoc($q)) {
$e2g[$row['cfg_key']] = $row['cfg_val'];
}
}
Expand Down Expand Up @@ -94,7 +94,7 @@
die($msg);
}
$fetchDirs = array();
while ($l = mysql_fetch_array($querySelectDirs, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($querySelectDirs)) {
$fetchDirs[$l['cat_name']] = $l;
}
mysql_free_result($querySelectDirs);
Expand All @@ -113,7 +113,7 @@
die($msg);
}
$fetchFiles = array();
while ($l = mysql_fetch_array($querySelectFiles, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($querySelectFiles)) {
$fetchFiles[$l['filename']] = $l;
}
mysql_free_result($querySelectFiles);
Expand Down
Expand Up @@ -27,7 +27,7 @@
if (!$q)
die(__FILE__ . ': MySQL query error for configs');
else {
while ($row = mysql_fetch_array($q)) {
while ($row = mysql_fetch_assoc($q)) {
$e2g[$row['cfg_key']] = $row['cfg_val'];
}
}
Expand Down Expand Up @@ -86,7 +86,7 @@
die($msg);
}
$fetchDirs = array();
while ($l = mysql_fetch_array($querySelectDirs, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($querySelectDirs)) {
$fetchDirs[$l['cat_name']] = $l;
}
mysql_free_result($querySelectDirs);
Expand All @@ -103,7 +103,7 @@
die($msg);
}
$fetchFiles = array();
while ($l = mysql_fetch_array($querySelectFiles, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($querySelectFiles)) {
$fetchFiles[$l['filename']] = $l;
}
mysql_free_result($querySelectFiles);
Expand Down
Expand Up @@ -27,7 +27,7 @@
if (!$q)
die(__FILE__ . ': MySQL query error for configs');
else {
while ($row = mysql_fetch_array($q)) {
while ($row = mysql_fetch_assoc($q)) {
$e2g[$row['cfg_key']] = $row['cfg_val'];
}
}
Expand Down Expand Up @@ -95,7 +95,7 @@

$rows = array(); // for return
$mdirs = array();
while ($l = mysql_fetch_array($querySelectDirs, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($querySelectDirs)) {
$mdirs[$l['cat_name']] = $l;
}
mysql_free_result($querySelectDirs);
Expand Down Expand Up @@ -386,7 +386,7 @@
die($msg);
}
$mfiles = array();
while ($l = mysql_fetch_array($querySelectFiles, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($querySelectFiles)) {
$mfiles[$l['filename']] = $l;
}
mysql_free_result($querySelectFiles);
Expand Down
Expand Up @@ -27,7 +27,7 @@
if (!$q)
die(__FILE__ . ': MySQL query error for configs');
else {
while ($row = mysql_fetch_array($q)) {
while ($row = mysql_fetch_assoc($q)) {
$e2g[$row['cfg_key']] = $row['cfg_val'];
}
}
Expand Down Expand Up @@ -95,7 +95,7 @@

$rows = array(); // for return
$mdirs = array();
while ($l = mysql_fetch_array($querySelectDirs, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($querySelectDirs)) {
$mdirs[$l['cat_name']] = $l;
}
mysql_free_result($querySelectDirs);
Expand Down Expand Up @@ -459,7 +459,7 @@
die($msg);
}
$mfiles = array();
while ($l = mysql_fetch_array($querySelectFiles, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($querySelectFiles)) {
$mfiles[$l['filename']] = $l;
}
mysql_free_result($querySelectFiles);
Expand Down
Expand Up @@ -27,7 +27,7 @@
if (!$q)
die(__FILE__ . ': MySQL query error for configs');
else {
while ($row = mysql_fetch_array($q)) {
while ($row = mysql_fetch_assoc($q)) {
$e2g[$row['cfg_key']] = $row['cfg_val'];
}
}
Expand Down Expand Up @@ -85,7 +85,7 @@
}

$fetchDirs = array();
while ($l = mysql_fetch_array($querySelectDirs, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($querySelectDirs)) {
$fetchDirs[$l['cat_name']] = $l;
}
mysql_free_result($querySelectDirs);
Expand All @@ -104,7 +104,7 @@
}

$fetchFiles = array();
while ($l = mysql_fetch_array($querySelectFiles, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($querySelectFiles)) {
$fetchFiles[$l['filename']] = $l;
}
mysql_free_result($querySelectFiles);
Expand Down
Expand Up @@ -27,7 +27,7 @@
if (!$q)
die(__FILE__ . ': MySQL query error for configs');
else {
while ($row = mysql_fetch_array($q)) {
while ($row = mysql_fetch_assoc($q)) {
$e2g[$row['cfg_key']] = $row['cfg_val'];
}
}
Expand Down Expand Up @@ -85,7 +85,7 @@
}

$fetchDirs = array();
while ($l = mysql_fetch_array($querySelectDirs, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($querySelectDirs)) {
$fetchDirs[$l['cat_name']] = $l;
}
mysql_free_result($querySelectDirs);
Expand All @@ -104,7 +104,7 @@
}

$fetchFiles = array();
while ($l = mysql_fetch_array($querySelectFiles, MYSQL_ASSOC)) {
while ($l = mysql_fetch_assoc($querySelectFiles)) {
$fetchFiles[$l['filename']] = $l;
}
mysql_free_result($querySelectFiles);
Expand Down
Expand Up @@ -27,7 +27,7 @@
if (!$q)
die(__FILE__ . ': MySQL query error for configs');
else {
while ($row = mysql_fetch_array($q)) {
while ($row = mysql_fetch_assoc($q)) {
$e2g[$row['cfg_key']] = $row['cfg_val'];
}
}
Expand Down
14 changes: 7 additions & 7 deletions assets/modules/easy2/includes/models/TTree.class.php
Expand Up @@ -57,7 +57,7 @@ function insert($name, $parentId = 1) {
$this->error = 'Parent ID not found (INSERT)';
return false;
}
$parent = mysql_fetch_array($result, MYSQL_ASSOC);
$parent = mysql_fetch_assoc($result);

// Update the all root parents' data first.
$query = 'UPDATE ' . $this->table . ' SET '
Expand Down Expand Up @@ -117,7 +117,7 @@ function update($id, $name, $parentId = false) {
. $this->id . ' = ' . $id;

$result = mysql_query($query);
$c = mysql_fetch_array($result, MYSQL_ASSOC);
$c = mysql_fetch_assoc($result);

if ($c[$this->parent] != $parentId) {
if (!$this->replace($id, $parentId, $c))
Expand Down Expand Up @@ -159,7 +159,7 @@ function replace($id, $to_id, $c = false) {
$result_select_c = mysql_query($select_c);

// set the old parent's handler variable
$c = mysql_fetch_array($result_select_c, MYSQL_ASSOC);
$c = mysql_fetch_assoc($result_select_c);
}

// Данные о новой родительской ветви
Expand All @@ -174,7 +174,7 @@ function replace($id, $to_id, $c = false) {
return false;
}
// set the new parent's handler variable
$to = mysql_fetch_array($result_select_to, MYSQL_ASSOC);
$to = mysql_fetch_assoc($result_select_to);

// ***************************************** ERROR HANDLERS **************************************** //

Expand Down Expand Up @@ -359,7 +359,7 @@ function delete($id) {
}

// get the parent's data
$cat = mysql_fetch_array($result, MYSQL_ASSOC);
$cat = mysql_fetch_assoc($result);

// Список вложенний
// List of nested ???
Expand Down Expand Up @@ -402,7 +402,7 @@ function reindex() {
}

// get the parent's data
$cat = mysql_fetch_array($result, MYSQL_ASSOC);
$cat = mysql_fetch_assoc($result);

// ************** SET MARGIN VALUE OF THE deleted branches AS THE RENUMBERING CONTROL ************** //
$razn = $cat[$this->right] - $cat[$this->left] + 1;
Expand Down Expand Up @@ -470,7 +470,7 @@ function sql2array($sql, $keyField='') {

function result2array($q, $keyField='') {
$Result = array();
while ($Data = mysql_fetch_array($q, MYSQL_ASSOC))
while ($Data = mysql_fetch_assoc($q))
if (empty($keyField))
$Result[] = $Data;
//else $Result[$Data[$keyField]] = $Data;
Expand Down

0 comments on commit 2b7fc12

Please sign in to comment.