\n";
- echo html_frame_start("Viewing $titleValue $titleText","80%","",0);
- echo "\n";
+ echo html_frame_start("Viewing $titleValue $titleText","80%","",0);
+ echo "\n";
- for($i = 0; $i < $nfields; $i++)
- {
- $field = mysql_fetch_field($result, $i);
+ for($i = 0; $i < $nfields; $i++)
+ {
+ $field = mysql_fetch_field($hResult, $i);
if(ereg("^impl_(.+)$", $field->table, $arr))
{
@@ -108,214 +107,208 @@ class TableVE {
$cur_impl = $arr[1];
}
- echo " $field->name ";
- echo "";
- $this->view_entry_output_field($field, $fields[$i], 0);
- echo " \n";
- }
+ echo " $field->name ";
+ echo "";
+ $this->view_entry_output_field($field, $fields[$i], 0);
+ echo " \n";
+ }
echo "
\n";
echo html_frame_end();
-
}
function edit($query)
{
- $result = query_appdb($query);
- $nrows = mysql_num_rows($result);
+ $hResult = query_appdb($query);
+ $nrows = mysql_num_rows($hResult);
echo "\n";
+ echo "\n";
}
- function edit_entry($result)
+ function edit_entry($hResult)
{
- $nfields = mysql_num_fields($result);
- $fields = mysql_fetch_array($result);
+ $nfields = mysql_num_fields($hResult);
+ $fields = mysql_fetch_array($hResult);
- echo html_frame_start(ucfirst($this->mode),"80%","",0);
- echo "\n";
+ echo html_frame_start(ucfirst($this->mode),"80%","",0);
+ echo "\n";
- $cur_impl = null;
+ $cur_impl = null;
for($i = 0; $i < $nfields; $i++)
+ {
+ global $testvar;
+ $field = mysql_fetch_field($hResult, $i);
+ $len = mysql_field_len($hResult, $i);
+
+ if(ereg("^impl_(.+)$", $field->table, $arr))
{
- global $testvar;
- $field = mysql_fetch_field($result, $i);
- $len = mysql_field_len($result, $i);
-
- if(ereg("^impl_(.+)$", $field->table, $arr))
- {
- if($cur_impl != $arr[1])
- echo " ".ucfirst($arr[1])." Implementation \n";
- $cur_impl = $arr[1];
- }
-
- echo " $field->name ";
- echo " ";
- $this->edit_entry_output_field($field, $fields[$i], $len);
- echo " \n";
+ if($cur_impl != $arr[1])
+ echo " ".ucfirst($arr[1])." Implementation \n";
+ $cur_impl = $arr[1];
}
+ echo " $field->name ";
+ echo " ";
+ $this->edit_entry_output_field($field, $fields[$i], $len);
+ echo " \n";
+ }
+
echo "
\n";
- echo html_frame_end();
+ echo html_frame_end();
}
function make_option_list($varname, $cvalue, $table, $idField, $nameField, $where = "")
{
-
- $result = query_appdb("SELECT $idField, $nameField FROM $table $where ORDER BY $nameField");
- if(!$result)
- return; // Oops
+ $hResult = query_appdb("SELECT $idField, $nameField FROM $table $where ORDER BY $nameField");
+ if(!$hResult)
+ return; // Oops
- echo "\n";
- echo "Choose ... \n";
- while(list($id, $name) = mysql_fetch_row($result))
- {
- if ($name == "NONAME")
- continue;
- if($id == $cvalue)
- echo "$name\n";
- else
- echo " $name\n";
-
- }
- echo " \n";
+ echo "\n";
+ echo "Choose ... \n";
+ while(list($id, $name) = mysql_fetch_row($hResult))
+ {
+ if ($name == "NONAME")
+ continue;
+ if($id == $cvalue)
+ echo "$name\n";
+ else
+ echo " $name\n";
+ }
+ echo " \n";
}
function edit_entry_output_field($field, $value, $len)
{
- static $idx = 0;
+ static $idx = 0;
- $idx++;
- if($len > 50)
- $len = 50;
+ $idx++;
+ if($len > 50)
+ $len = 50;
- $varname = "FIELD_".$field->table."___".$field->name."[]";
- echo " \n";
+ $varname = "FIELD_".$field->table."___".$field->name."[]";
+ echo " \n";
- if($field->name == "appId" && $field->table != "appFamily")
- {
- $this->make_option_list($varname, $value, "appFamily", "appId", "appName");
- return;
- }
+ if($field->name == "appId" && $field->table != "appFamily")
+ {
+ $this->make_option_list($varname, $value, "appFamily", "appId", "appName");
+ return;
+ }
- if($field->name == "vendorId" && $field->table != "vendor")
- {
- $this->make_option_list($varname, $value, "vendor", "vendorId", "vendorName");
- return;
- }
+ if($field->name == "vendorId" && $field->table != "vendor")
+ {
+ $this->make_option_list($varname, $value, "vendor", "vendorId", "vendorName");
+ return;
+ }
- if($field->name == "catId" && $field->table != "appCategory")
- {
- $this->make_option_list($varname, $value, "appCategory", "catId", "catName");
- return;
- }
+ if($field->name == "catId" && $field->table != "appCategory")
+ {
+ $this->make_option_list($varname, $value, "appCategory", "catId", "catName");
+ return;
+ }
- if($field->name == "catParent")
- {
- $this->make_option_list($varname, $value, "appCategory", "catId", "catName");
- return;
- }
+ if($field->name == "catParent")
+ {
+ $this->make_option_list($varname, $value, "appCategory", "catId", "catName");
+ return;
+ }
- if($field->name == "keywords")
- {
- echo "\n";
- return;
- }
+ if($field->name == "keywords")
+ {
+ echo "\n";
+ return;
+ }
- switch($field->type)
- {
- case "string":
- case "enum":
- case "int":
- case "text":
- echo " \n";
- break;
- case "blob":
- echo "\n";
- break;
- case "timestamp":
- $time = mysqltimestamp_to_unixtimestamp($value);
- echo print_date($time);
- break;
- case "datetime":
- $time = mysqldatetime_to_unixtimestamp($value);
- echo print_date($time);
- break;
- default:
- echo "$value \n";
- break;
- }
+ switch($field->type)
+ {
+ case "string":
+ case "enum":
+ case "int":
+ case "text":
+ echo " \n";
+ break;
+ case "blob":
+ echo "\n";
+ break;
+ case "timestamp":
+ $time = mysqltimestamp_to_unixtimestamp($value);
+ echo print_date($time);
+ break;
+ case "datetime":
+ $time = mysqldatetime_to_unixtimestamp($value);
+ echo print_date($time);
+ break;
+ default:
+ echo "$value \n";
+ break;
+ }
- $this->entry_add_extra($field, $value);
+ $this->entry_add_extra($field, $value);
}
-
-
function view_entry_output_field($field, $value, $len)
{
if($len > 50)
$len = 50;
- //FIXME: need a better way for special cases
- if(!$value && $field->name == "comments")
- {
- echo "none";
- return;
- }
- if(!$value && ($field->name == "location" || $field->name == "quality"))
- {
- echo "unknown";
- return;
- }
+ //FIXME: need a better way for special cases
+ if(!$value && $field->name == "comments")
+ {
+ echo "none";
+ return;
+ }
+ if(!$value && ($field->name == "location" || $field->name == "quality"))
+ {
+ echo "unknown";
+ return;
+ }
if($field->name == "lastmodby")
- {
- $user = new user();
- $name = $user->lookup_realname($value);
- if(!$name)
- $name = "system";
- echo "$name ($value)";
- return;
- }
+ {
+ $user = new user();
+ $name = $user->lookup_realname($value);
+ if(!$name)
+ $name = "system";
+ echo "$name ($value)";
+ return;
+ }
-
switch($field->type)
- {
- case "string":
- case "enum":
- case "int":
- case "blob":
- echo "$value \n";
- break;
- case "timestamp":
- $time = mysqltimestamp_to_unixtimestamp($value);
- echo print_date($time);
- break;
- case "datetime":
- $time = mysqldatetime_to_unixtimestamp($value);
- echo print_date($time);
- break;
- default:
- echo "$value \n";
- break;
- }
+ {
+ case "string":
+ case "enum":
+ case "int":
+ case "blob":
+ echo "$value \n";
+ break;
+ case "timestamp":
+ $time = mysqltimestamp_to_unixtimestamp($value);
+ echo print_date($time);
+ break;
+ case "datetime":
+ $time = mysqldatetime_to_unixtimestamp($value);
+ echo print_date($time);
+ break;
+ default:
+ echo "$value \n";
+ break;
+ }
- $this->entry_add_extra($field, $value);
+ $this->entry_add_extra($field, $value);
}
@@ -324,22 +317,21 @@ class TableVE {
*/
function entry_add_extra($field, $value)
{
- /*
+ /*
* add extra stuff to certain fields
*/
if($field->name == "mslink" && $value)
- {
- echo html_imagebutton("Go!", $value);
- }
-
- if($field->name == "apiname")
- {
- echo html_imagebutton("Wine LXR", "http://twine.codeweavers.com/lxr/ident?i=$value");
- echo html_imagebutton("Wine API", "http://www.winehq.com/WineAPI/$value.html");
- }
- }
+ {
+ echo html_imagebutton("Go!", $value);
+ }
+ if($field->name == "apiname")
+ {
+ echo html_imagebutton("Wine LXR", "http://twine.codeweavers.com/lxr/ident?i=$value");
+ echo html_imagebutton("Wine API", "http://www.winehq.com/WineAPI/$value.html");
+ }
+ }
/*
@@ -359,18 +351,18 @@ class TableVE {
function get_id($name)
{
- reset($this->table_ids);
- while(list($table, $id) = each($this->table_ids))
- {
- $r = "^$table$";
- //echo "Checking $r against $name \n";
- if(ereg($r, $name))
- {
- //echo "ID for $name -> $id \n";
- return $id;
- }
- }
- return null;
+ reset($this->table_ids);
+ while(list($table, $id) = each($this->table_ids))
+ {
+ $r = "^$table$";
+ //echo "Checking $r against $name \n";
+ if(ereg($r, $name))
+ {
+ //echo "ID for $name -> $id \n";
+ return $id;
+ }
+ }
+ return null;
}
/**
@@ -380,101 +372,96 @@ class TableVE {
*/
function update($vars)
{
-
- $tables = array();
- $fieldnames = array();
- $num_entries = 0;
+ $tables = array();
+ $fieldnames = array();
+ $num_entries = 0;
- while(list($varname, $arr) = each($vars))
- {
- if(!ereg("^FIELD_([a-zA-Z_]+)___(.+)$", $varname, $regs))
- continue;
+ while(list($varname, $arr) = each($vars))
+ {
+ if(!ereg("^FIELD_([a-zA-Z_]+)___(.+)$", $varname, $regs))
+ continue;
- $tables[$regs[1]][] = $regs[2];
- $fieldnames[$regs[2]] = $arr;
- $num_entries = sizeof($arr);
- }
+ $tables[$regs[1]][] = $regs[2];
+ $fieldnames[$regs[2]] = $arr;
+ $num_entries = sizeof($arr);
+ }
- while(list($table, $fields) = each($tables))
- {
- echo " $table (".$this->get_id($table).") ";
+ while(list($table, $fields) = each($tables))
+ {
+ echo " $table (".$this->get_id($table).") ";
- if($fieldnames[$this->get_id($table)])
- echo "OK!";
+ if($fieldnames[$this->get_id($table)])
+ echo "OK!";
- echo " \n";
+ echo " \n";
- for($i = 0; $i < sizeof($fields); $i++)
- echo "- $fields[$i] \n";
+ for($i = 0; $i < sizeof($fields); $i++)
+ echo "- $fields[$i] \n";
- echo " \n";
- }
+ echo " \n";
+ }
- for($i = 0; $i < $num_entries; $i++)
- {
- reset($tables);
- while(list($table, $fields) = each($tables))
- {
- $update = "UPDATE $table SET ";
-
- $count = sizeof($fields);
- reset($fields);
- while(list($idx, $field) = each($fields))
- {
- $count--;
+ for($i = 0; $i < $num_entries; $i++)
+ {
+ reset($tables);
+ while(list($table, $fields) = each($tables))
+ {
+ $update = "UPDATE $table SET ";
+
+ $count = sizeof($fields);
+ reset($fields);
+ while(list($idx, $field) = each($fields))
+ {
+ $count--;
- if($this->table_ids[$table] == $field)
- {
- continue;
- }
- $key = "FIELD_".$table."___".$field;
- $type = $vars["TYPE_$key"][$i];
+ if($this->table_ids[$table] == $field)
+ {
+ continue;
+ }
+ $key = "FIELD_".$table."___".$field;
+ $type = $vars["TYPE_$key"][$i];
- if($type == "int")
- $update .= "$field = ".$vars[$key][$i];
- else
- $update .= "$field = '".addslashes($vars[$key][$i])."'";
+ if($type == "int")
+ $update .= "$field = ".$vars[$key][$i];
+ else
+ $update .= "$field = '".addslashes($vars[$key][$i])."'";
- if($count)
- $update .= ", ";
- }
+ if($count)
+ $update .= ", ";
+ }
- $value = $fieldnames[$this->get_id($table)][$i];
+ $value = $fieldnames[$this->get_id($table)][$i];
- $update .= " WHERE ".$this->get_id($table)." = $value";
+ $update .= " WHERE ".$this->get_id($table)." = $value";
- if(query_appdb($update))
- {
- addmsg("Database Operation Complete!","green");
- }
-
- if(ereg("^impl_.+$", $table))
- {
- $value = $fieldnames["apiid"][$i];
- query_appdb("UPDATE $table SET lastmodby = ".$_SESSION['current']->userid." WHERE apiid = $value");
- }
- }
- }
-
-
+ if(query_appdb($update))
+ {
+ addmsg("Database Operation Complete!","green");
+ }
+ if(ereg("^impl_.+$", $table))
+ {
+ $value = $fieldnames["apiid"][$i];
+ query_appdb("UPDATE $table SET lastmodby = ".$_SESSION['current']->userid." WHERE apiid = $value");
+ }
+ }
+ }
}
function set_title_field($newTitleField)
{
- $this->titleField = $newTitleField;
+ $this->titleField = $newTitleField;
}
function set_title_text($newTitleText)
{
- $this->titleText = $newTitleText;
+ $this->titleText = $newTitleText;
}
function set_numbered_titles()
{
- $this->numberedTitles = 1;
+ $this->numberedTitles = 1;
}
-
};
?>
diff --git a/include/user.php b/include/user.php
index 9d74c0d..9dc084e 100644
--- a/include/user.php
+++ b/include/user.php
@@ -342,7 +342,7 @@ class User {
if($sQuery)
{
- if($result = query_appdb($sQuery))
+ if($hResult = query_appdb($sQuery))
return true;
}
@@ -356,31 +356,31 @@ class User {
if(!$this->hasPriv("admin"))
return 0;
- $qstring = "SELECT count(*) as queued_apps FROM appFamily WHERE queued='true'";
- $result = query_appdb($qstring);
- $ob = mysql_fetch_object($result);
- return $ob->queued_apps;
+ $sQuery = "SELECT count(*) as queued_apps FROM appFamily WHERE queued='true'";
+ $hResult = query_appdb($sQuery);
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->queued_apps;
}
function getQueuedVersionCount()
{
if($this->hasPriv("admin"))
{
- $qstring = "SELECT count(*) as queued_versions FROM appVersion WHERE queued='true'";
+ $sQuery = "SELECT count(*) as queued_versions FROM appVersion WHERE queued='true'";
} else
{
/* find all queued versions of applications that the user is a super maintainer of */
- $qstring = "SELECT count(*) as queued_versions FROM appVersion, appMaintainers
+ $sQuery = "SELECT count(*) as queued_versions FROM appVersion, appMaintainers
WHERE queued='true' AND appMaintainers.superMaintainer ='1'
AND appVersion.appId = appMaintainers.appId
AND appMaintainers.userId ='".$this->iUserId."';";
}
- $result = query_appdb($qstring);
- $ob = mysql_fetch_object($result);
+ $hResult = query_appdb($sQuery);
+ $oRow = mysql_fetch_object($hResult);
/* we don't want to count the versions that are implicit in the applications */
/* that are in the queue */
- return $ob->queued_versions - $this->getQueuedAppCount();
+ return $oRow->queued_versions - $this->getQueuedAppCount();
}
@@ -388,8 +388,8 @@ class User {
function getQueuedAppDataCount()
{
$hResult = $this->getAppDataQuery(0, true, false);
- $ob = mysql_fetch_object($hResult);
- return $ob->queued_appdata;
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->queued_appdata;
}
function addPriv($sPriv)
@@ -582,20 +582,20 @@ class User {
function getAllRejectedApps()
{
- $result = query_appdb("SELECT appVersion.versionId, appFamily.appId
+ $hResult = query_appdb("SELECT appVersion.versionId, appFamily.appId
FROM appVersion, appFamily
WHERE appFamily.appId = appVersion.appId
AND (appFamily.queued = 'rejected' OR appVersion.queued = 'rejected')
AND appVersion.submitterId = '".$this->iUserId."';");
- if(!$result || mysql_num_rows($result) == 0)
+ if(!$hResult || mysql_num_rows($hResult) == 0)
return;
$retval = array();
$c = 0;
- while($row = mysql_fetch_object($result))
+ while($oRow = mysql_fetch_object($hResult))
{
- $retval[$c] = array($row->appId, $row->versionId);
+ $retval[$c] = array($oRow->appId, $oRow->versionId);
$c++;
}
@@ -1110,9 +1110,9 @@ function get_notify_email_address_list($iAppId = null, $iVersionId = null)
*/
function get_number_of_users()
{
- $result = query_appdb("SELECT count(*) as num_users FROM user_list;");
- $row = mysql_fetch_object($result);
- return $row->num_users;
+ $hResult = query_appdb("SELECT count(*) as num_users FROM user_list;");
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->num_users;
}
@@ -1121,9 +1121,9 @@ function get_number_of_users()
*/
function get_active_users_within_days($days)
{
- $result = query_appdb("SELECT count(*) as num_users FROM user_list WHERE stamp >= DATE_SUB(CURDATE(), interval $days day);");
- $row = mysql_fetch_object($result);
- return $row->num_users;
+ $hResult = query_appdb("SELECT count(*) as num_users FROM user_list WHERE stamp >= DATE_SUB(CURDATE(), interval $days day);");
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->num_users;
}
@@ -1146,12 +1146,12 @@ function get_inactive_users_pending_deletion()
*/
function user_exists($sEmail)
{
- $result = query_appdb("SELECT userid FROM user_list WHERE email = '$sEmail'");
- if(!$result || mysql_num_rows($result) != 1)
+ $hResult = query_appdb("SELECT userid FROM user_list WHERE email = '$sEmail'");
+ if(!$hResult || mysql_num_rows($hResult) != 1)
return 0;
else
{
- $oRow = mysql_fetch_object($result);
+ $oRow = mysql_fetch_object($hResult);
return $oRow->userid;
}
}
diff --git a/include/util.php b/include/util.php
index ce8cd4b..5b01733 100644
--- a/include/util.php
+++ b/include/util.php
@@ -71,9 +71,9 @@ function get_remote()
global $REMOTE_HOST, $REMOTE_ADDR;
if($REMOTE_HOST)
- $ip = $REMOTE_HOST;
+ $ip = $REMOTE_HOST;
else
- $ip = $REMOTE_ADDR;
+ $ip = $REMOTE_ADDR;
return $ip;
}
@@ -101,12 +101,12 @@ function get_xml_tag ($file, $mode = null)
if ($mode and file_exists($file))
{
$fp = @fopen($file, "r");
- $data = fread($fp, filesize($file));
- @fclose($fp);
- if (eregi("<" . $mode . ">(.*)" . $mode . ">", $data, $out))
- {
- return $out[1];
- }
+ $data = fread($fp, filesize($file));
+ @fclose($fp);
+ if (eregi("<" . $mode . ">(.*)" . $mode . ">", $data, $out))
+ {
+ return $out[1];
+ }
}
else
{
@@ -119,14 +119,14 @@ function make_bugzilla_version_list($varname, $cvalue)
{
$table = BUGZILLA_DB.".versions";
$where = "WHERE product_id=".BUGZILLA_PRODUCT_ID;
- $query = "SELECT value FROM $table $where ORDER BY value";
+ $sQuery = "SELECT value FROM $table $where ORDER BY value";
- $result = query_bugzilladb($query);
- if(!$result) return;
+ $hResult = query_bugzilladb($sQuery);
+ if(!$hResult) return;
echo "\n";
echo "Choose ... \n";
- while(list($value) = mysql_fetch_row($result))
+ while(list($value) = mysql_fetch_row($hResult))
{
if($value == "unspecified")
{
@@ -163,67 +163,67 @@ function make_maintainer_rating_list($varname, $cvalue)
/* get the number of queued maintainers */
function getQueuedMaintainerCount()
{
- $qstring = "SELECT count(*) as queued_maintainers FROM appMaintainerQueue";
- $result = query_appdb($qstring);
- $ob = mysql_fetch_object($result);
- return $ob->queued_maintainers;
+ $sQuery = "SELECT count(*) as queued_maintainers FROM appMaintainerQueue";
+ $hResult = query_appdb($sQuery);
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->queued_maintainers;
}
/* get the total number of maintainers and applications in the appMaintainers table */
function getMaintainerCount()
{
- $qstring = "SELECT count(*) as maintainers FROM appMaintainers";
- $result = query_appdb($qstring);
- $ob = mysql_fetch_object($result);
- return $ob->maintainers;
+ $sQuery = "SELECT count(*) as maintainers FROM appMaintainers";
+ $hResult = query_appdb($sQuery);
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->maintainers;
}
/* get the total number of vendors from the vendor table */
function getVendorCount()
{
- $qstring = "SELECT count(*) as vendors FROM vendor";
- $result = query_appdb($qstring);
- $ob = mysql_fetch_object($result);
- return $ob->vendors;
+ $sQuery = "SELECT count(*) as vendors FROM vendor";
+ $hResult = query_appdb($sQuery);
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->vendors;
}
/* Get the number of users in the database */
function getNumberOfComments()
{
- $result = query_appdb("SELECT count(*) as num_comments FROM appComments;");
- $row = mysql_fetch_object($result);
- return $row->num_comments;
+ $hResult = query_appdb("SELECT count(*) as num_comments FROM appComments;");
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->num_comments;
}
/* Get the number of versions in the database */
function getNumberOfVersions()
{
- $result = query_appdb("SELECT count(versionId) as num_versions FROM appVersion WHERE versionName != 'NONAME';");
- $row = mysql_fetch_object($result);
- return $row->num_versions;
+ $hResult = query_appdb("SELECT count(versionId) as num_versions FROM appVersion WHERE versionName != 'NONAME';");
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->num_versions;
}
/* Get the number of maintainers in the database */
function getNumberOfMaintainers()
{
- $result = query_appdb("SELECT DISTINCT userId FROM appMaintainers;");
- return mysql_num_rows($result);
+ $hResult = query_appdb("SELECT DISTINCT userId FROM appMaintainers;");
+ return mysql_num_rows($hResult);
}
/* Get the number of app familes in the database */
function getNumberOfAppFamilies()
{
- $result = query_appdb("SELECT count(*) as num_appfamilies FROM appFamily;");
- $row = mysql_fetch_object($result);
- return $row->num_appfamilies;
+ $hResult = query_appdb("SELECT count(*) as num_appfamilies FROM appFamily;");
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->num_appfamilies;
}
/* Get the number of images in the database */
function getNumberOfImages()
{
- $result = query_appdb("SELECT count(*) as num_images FROM appData WHERE type='image';");
- $row = mysql_fetch_object($result);
- return $row->num_images;
+ $hResult = query_appdb("SELECT count(*) as num_images FROM appData WHERE type='image';");
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->num_images;
}
/* Get the number of queued bug links in the database */
@@ -232,8 +232,8 @@ function getNumberOfQueuedBugLinks()
$hResult = query_appdb("SELECT count(*) as num_buglinks FROM buglinks WHERE queued='true';");
if($hResult)
{
- $row = mysql_fetch_object($hResult);
- return $row->num_buglinks;
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->num_buglinks;
}
return 0;
}
@@ -244,8 +244,8 @@ function getNumberOfBugLinks()
$hResult = query_appdb("SELECT count(*) as num_buglinks FROM buglinks;");
if($hResult)
{
- $row = mysql_fetch_object($hResult);
- return $row->num_buglinks;
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->num_buglinks;
}
return 0;
}
@@ -521,22 +521,22 @@ function outputSearchTableForhResult($search_words, $hResult)
echo "\n\n";
$c = 0;
- while($ob = mysql_fetch_object($hResult))
+ while($oRow = mysql_fetch_object($hResult))
{
//skip if a NONAME
- if ($ob->appName == "NONAME") { continue; }
+ if ($oRow->appName == "NONAME") { continue; }
//set row color
$bgcolor = ($c % 2) ? 'color0' : 'color1';
//count versions
- $query = query_appdb("SELECT count(*) as versions FROM appVersion WHERE appId = $ob->appId AND versionName != 'NONAME' and queued = 'false'");
- $y = mysql_fetch_object($query);
+ $hResult2 = query_appdb("SELECT count(*) as versions FROM appVersion WHERE appId = $oRow->appId AND versionName != 'NONAME' and queued = 'false'");
+ $y = mysql_fetch_object($hResult2);
//display row
echo "\n";
- echo " ".html_ahref($ob->appName,BASE."appview.php?appId=$ob->appId")." \n";
- echo " ".trim_description($ob->description)." \n";
+ echo " ".html_ahref($oRow->appName,BASE."appview.php?appId=$oRow->appId")." \n";
+ echo " ".trim_description($oRow->description)." \n";
echo " $y->versions \n";
echo " \n\n";
diff --git a/include/vendor.php b/include/vendor.php
index 420b9c8..12e92b6 100644
--- a/include/vendor.php
+++ b/include/vendor.php
@@ -142,8 +142,8 @@ function getNumberOfVendors()
$hResult = query_appdb("SELECT count(*) as num_vendors FROM vendor");
if($hResult)
{
- $row = mysql_fetch_object($hResult);
- return $row->num_vendors;
+ $oRow = mysql_fetch_object($hResult);
+ return $oRow->num_vendors;
}
return 0;
}
diff --git a/include/vote.php b/include/vote.php
index bc2ffa0..da8656a 100644
--- a/include/vote.php
+++ b/include/vote.php
@@ -17,8 +17,8 @@ function vote_count($appId, $userId = null)
else
return 0;
}
- $result = query_appdb("SELECT * FROM appVotes WHERE appId = $appId AND userId = $userId");
- return mysql_num_rows($result);
+ $hResult = query_appdb("SELECT * FROM appVotes WHERE appId = $appId AND userId = $userId");
+ return mysql_num_rows($hResult);
}
@@ -34,8 +34,8 @@ function vote_count_user_total($userId = null)
else
return 0;
}
- $result = query_appdb("SELECT * FROM appVotes WHERE userId = $userId");
- return mysql_num_rows($result);
+ $hResult = query_appdb("SELECT * FROM appVotes WHERE userId = $userId");
+ return mysql_num_rows($hResult);
}
@@ -44,8 +44,8 @@ function vote_count_user_total($userId = null)
*/
function vote_count_app_total($appId)
{
- $result = query_appdb("SELECT * FROM appVotes WHERE appId = $appId");
- return mysql_num_rows($result);
+ $hResult = query_appdb("SELECT * FROM appVotes WHERE appId = $appId");
+ return mysql_num_rows($hResult);
}
@@ -98,13 +98,13 @@ function vote_get_user_votes($userId = null)
if(!$userId)
return array();
}
- $result = query_appdb("SELECT * FROM appVotes WHERE userId = $userId");
- if(!$result)
+ $hResult = query_appdb("SELECT * FROM appVotes WHERE userId = $userId");
+ if(!$hResult)
return array();
$obs = array();
- while($ob = mysql_fetch_object($result))
- $obs[$ob->slot] = $ob;
+ while($oRow = mysql_fetch_object($hResult))
+ $obs[$oRow->slot] = $oRow;
return $obs;
}
diff --git a/index.php b/index.php
index b5e91da..4a8b9ba 100644
--- a/index.php
+++ b/index.php
@@ -63,11 +63,11 @@ If you have screenshots or links to contribute, please browse the database and u
"FROM appVotes, appFamily ".
"WHERE appVotes.appId = appFamily.appId ".
"GROUP BY appId ORDER BY count DESC LIMIT 1";
- $result = query_appdb($voteQuery);
- $ob = mysql_fetch_object($result);
+ $hResult = query_appdb($voteQuery);
+ $oRow = mysql_fetch_object($hResult);
- $voteAppId = $ob->appId;
- $voteAppName = $ob->appName;
+ $voteAppId = $oRow->appId;
+ $voteAppName = $oRow->appName;
/* don't mention the top application if there are no votes yet */
if($voteAppId != "")
diff --git a/preferences.php b/preferences.php
index 4c091ea..9915ee4 100644
--- a/preferences.php
+++ b/preferences.php
@@ -54,8 +54,8 @@ if($_SESSION['current']->hasPriv("admin") &&
function build_prefs_list()
{
global $oUser;
- $result = query_appdb("SELECT * FROM prefs_list ORDER BY id");
- while($result && $r = mysql_fetch_object($result))
+ $hResult = query_appdb("SELECT * FROM prefs_list ORDER BY id");
+ while($hResult && $r = mysql_fetch_object($hResult))
{
//skip admin options
//TODO: add a field to prefs_list to flag the user level for the pref
diff --git a/votestats.php b/votestats.php
index 30bc6c9..7430c52 100644
--- a/votestats.php
+++ b/votestats.php
@@ -67,11 +67,11 @@ if($catId != 0)
{
$catQuery = "SELECT appCategory.catName, appCategory.catParent ".
"FROM appCategory WHERE appCategory.catId = '$currentCatId';";
- $result = query_appdb($catQuery);
+ $hResult = query_appdb($catQuery);
- if($result)
+ if($hResult)
{
- $row = mysql_fetch_object($result);
+ $row = mysql_fetch_object($hResult);
$catParent = $row->catParent;
array_push($cat_array, "$currentCatId");
@@ -168,7 +168,7 @@ if(strcasecmp($categoryId, "any") == 0)
ORDER BY count DESC LIMIT $topNumber";
}
-if($result = query_appdb($sVoteQuery))
+if($hResult = query_appdb($sVoteQuery))
{
echo html_frame_start("", "90%", '', 0);
echo html_table_begin("width='100%' align=center");
@@ -176,11 +176,11 @@ if($result = query_appdb($sVoteQuery))
echo "Votes \n";
$c = 1;
- while($row = mysql_fetch_object($result))
+ while($row = mysql_fetch_object($hResult))
{
- $bgcolor = ($c % 2) ? "color0" : "color1";
+ $bgcolor = ($c % 2) ? "color0" : "color1";
$link = "$row->appName ";
- echo "$c. $link $row->count \n";
+ echo "$c. $link $row->count \n";
$c++;
}