Replaced mysql_query() with query_appdb()
This commit is contained in:
@@ -110,7 +110,7 @@ if($apps)
|
|||||||
$bgcolor = ($c % 2) ? "color0" : "color1";
|
$bgcolor = ($c % 2) ? "color0" : "color1";
|
||||||
|
|
||||||
//get number of versions
|
//get number of versions
|
||||||
$query = mysql_query("SELECT count(*) as versions FROM appVersion WHERE appId = $id AND versionName != 'NONAME'");
|
$query = query_appdb("SELECT count(*) as versions FROM appVersion WHERE appId = $id AND versionName != 'NONAME'");
|
||||||
$ob = mysql_fetch_object($query);
|
$ob = mysql_fetch_object($query);
|
||||||
|
|
||||||
//format desc
|
//format desc
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ if( ( $width AND !is_numeric($width) ) || ( $height AND !is_numeric($height) ) )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($imageId AND is_numeric($imageId) )
|
if($imageId AND is_numeric($imageId) )
|
||||||
$result = mysql_query("SELECT * FROM appData WHERE id = $imageId");
|
$result = query_appdb("SELECT * FROM appData WHERE id = $imageId");
|
||||||
|
|
||||||
else if($appId AND $versionId AND is_numeric($appId) AND is_numeric($versionId) )
|
else if($appId AND $versionId AND is_numeric($appId) AND is_numeric($versionId) )
|
||||||
$result = mysql_query("SELECT * FROM appData WHERE appId = $appId AND ".
|
$result = query_appdb("SELECT * FROM appData WHERE appId = $appId AND ".
|
||||||
"versionId = $versionId AND type = 'image' LIMIT 1");
|
"versionId = $versionId AND type = 'image' LIMIT 1");
|
||||||
else
|
else
|
||||||
handle_error("IDs wrong");
|
handle_error("IDs wrong");
|
||||||
|
|||||||
2
bugs.php
2
bugs.php
@@ -29,7 +29,7 @@ function display_catpath($catId, $appId, $versionId = '')
|
|||||||
/* display the SUB apps that belong to this app */
|
/* display the SUB apps that belong to this app */
|
||||||
function display_bundle($appId)
|
function display_bundle($appId)
|
||||||
{
|
{
|
||||||
$result = mysql_query("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ".
|
$result = query_appdb("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ".
|
||||||
"WHERE bundleId = $appId AND appBundle.appId = appFamily.appId");
|
"WHERE bundleId = $appId AND appBundle.appId = appFamily.appId");
|
||||||
if(!$result || mysql_num_rows($result) == 0)
|
if(!$result || mysql_num_rows($result) == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ if(!havepriv("admin"))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$user = new User();
|
$user = new User();
|
||||||
$result = mysql_query("SELECT stamp, userid, username, realname, ".
|
$result = query_appdb("SELECT stamp, userid, username, realname, ".
|
||||||
"created, status, perm FROM user_list WHERE ".
|
"created, status, perm FROM user_list WHERE ".
|
||||||
"userid = '$userid'", $user->link);
|
"userid = '$userid'", $user->link);
|
||||||
if(!$result)
|
if(!$result)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ if($confirmed)
|
|||||||
}
|
}
|
||||||
/* echo html_frame_start("Removing",400,"",0);
|
/* echo html_frame_start("Removing",400,"",0);
|
||||||
*/
|
*/
|
||||||
$result = mysql_query($query);
|
$result = query_appdb($query);
|
||||||
if($result)
|
if($result)
|
||||||
{
|
{
|
||||||
if($superMaintainer)
|
if($superMaintainer)
|
||||||
|
|||||||
@@ -86,14 +86,7 @@ if($_REQUEST['maintainReason'])
|
|||||||
addslashes($_REQUEST['superMaintainer'])."',".
|
addslashes($_REQUEST['superMaintainer'])."',".
|
||||||
"NOW()".");";
|
"NOW()".");";
|
||||||
|
|
||||||
mysql_query($query);
|
if (query_appdb($query))
|
||||||
|
|
||||||
if ($error = mysql_error())
|
|
||||||
{
|
|
||||||
echo "<p><font color=red><b>Error:</b></font></p>\n";
|
|
||||||
echo "<p>$error</p>\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
echo "<p>Your maintainer request has been submitted for Review. You should hear back\n";
|
echo "<p>Your maintainer request has been submitted for Review. You should hear back\n";
|
||||||
echo "soon about the status of your submission</p>\n";
|
echo "soon about the status of your submission</p>\n";
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function build_prefs_list()
|
|||||||
{
|
{
|
||||||
opendb();
|
opendb();
|
||||||
|
|
||||||
$result = mysql_query("SELECT * FROM prefs_list ORDER BY id");
|
$result = query_appdb("SELECT * FROM prefs_list ORDER BY id");
|
||||||
while($r = mysql_fetch_object($result))
|
while($r = mysql_fetch_object($result))
|
||||||
{
|
{
|
||||||
//skip admin options
|
//skip admin options
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
/*******************************************************************/
|
/*******************************************************************/
|
||||||
/* this script expects appId and optionally versionId as arguments */
|
/* this script expects appId and optionally versionId as arguments */
|
||||||
/* OR */
|
/* OR */
|
||||||
@@ -26,7 +26,7 @@ if($_REQUEST['cmd'])
|
|||||||
|
|
||||||
if(debugging()) addmsg("<p align=center><b>query:</b> $str_query </p>","green");
|
if(debugging()) addmsg("<p align=center><b>query:</b> $str_query </p>","green");
|
||||||
|
|
||||||
if (mysql_query($str_query))
|
if (query_appdb($str_query))
|
||||||
{
|
{
|
||||||
$int_id = mysql_insert_id();
|
$int_id = mysql_insert_id();
|
||||||
|
|
||||||
@@ -35,13 +35,13 @@ if($_REQUEST['cmd'])
|
|||||||
// whoops, copy failed. do something
|
// whoops, copy failed. do something
|
||||||
errorpage("debug: copy failed; (".$_FILES['imagefile']['tmp_name'].";".$_FILES['imagefile']['name']);
|
errorpage("debug: copy failed; (".$_FILES['imagefile']['tmp_name'].";".$_FILES['imagefile']['name']);
|
||||||
$str_query = "DELETE FROM appData WHERE id = '".$int_id."'";
|
$str_query = "DELETE FROM appData WHERE id = '".$int_id."'";
|
||||||
mysql_query($str_query);
|
query_appdb($str_query);
|
||||||
exit;
|
exit;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// we have to update the entry now that we know it's name
|
// we have to update the entry now that we know it's name
|
||||||
$str_query = "UPDATE appData SET url = '".$int_id."' WHERE id = '".$int_id."'";
|
$str_query = "UPDATE appData SET url = '".$int_id."' WHERE id = '".$int_id."'";
|
||||||
if (mysql_query($str_query))
|
if (query_appdb($str_query))
|
||||||
{
|
{
|
||||||
//success
|
//success
|
||||||
$email = getNotifyEmailAddressList($_REQUEST['appId'], $_REQUEST['versionId']);
|
$email = getNotifyEmailAddressList($_REQUEST['appId'], $_REQUEST['versionId']);
|
||||||
@@ -80,7 +80,7 @@ if($_REQUEST['cmd'])
|
|||||||
|
|
||||||
if(debugging()) addmsg("<p align=center><b>query:</b> $str_query </p>","green");
|
if(debugging()) addmsg("<p align=center><b>query:</b> $str_query </p>","green");
|
||||||
|
|
||||||
if (mysql_query($str_query))
|
if (query_appdb($str_query))
|
||||||
{
|
{
|
||||||
$int_queueId = mysql_insert_id();
|
$int_queueId = mysql_insert_id();
|
||||||
|
|
||||||
@@ -89,13 +89,13 @@ if($_REQUEST['cmd'])
|
|||||||
// whoops, copy failed. do something
|
// whoops, copy failed. do something
|
||||||
errorpage("debug: copy failed; (".$_FILES['imagefile']['tmp_name'].";".$_FILES['imagefile']['name']);
|
errorpage("debug: copy failed; (".$_FILES['imagefile']['tmp_name'].";".$_FILES['imagefile']['name']);
|
||||||
$str_query = "DELETE FROM appDataQueue WHERE queueId = '".$int_queueId."'";
|
$str_query = "DELETE FROM appDataQueue WHERE queueId = '".$int_queueId."'";
|
||||||
mysql_query($str_query);
|
query_appdb($str_query);
|
||||||
exit;
|
exit;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// we have to update the queued entry now that we know its name
|
// we have to update the queued entry now that we know its name
|
||||||
$str_query = "UPDATE appDataQueue SET url = '".$int_queueId."' WHERE queueId = '".$int_queueId."'";
|
$str_query = "UPDATE appDataQueue SET url = '".$int_queueId."' WHERE queueId = '".$int_queueId."'";
|
||||||
if (mysql_query($str_query))
|
if (query_appdb($str_query))
|
||||||
{
|
{
|
||||||
//success
|
//success
|
||||||
$email = getNotifyEmailAddressList($_REQUEST['appId'], $_REQUEST['versionId']);
|
$email = getNotifyEmailAddressList($_REQUEST['appId'], $_REQUEST['versionId']);
|
||||||
@@ -133,7 +133,7 @@ if($_REQUEST['cmd'])
|
|||||||
$_SESSION['current']->is_maintainer($_REQUEST['appId'],
|
$_SESSION['current']->is_maintainer($_REQUEST['appId'],
|
||||||
$_REQUEST['versionId']))
|
$_REQUEST['versionId']))
|
||||||
{
|
{
|
||||||
$result = mysql_query("DELETE FROM appData WHERE id = ".$_REQUEST['imageId']);
|
$result = query_appdb("DELETE FROM appData WHERE id = ".$_REQUEST['imageId']);
|
||||||
if($result)
|
if($result)
|
||||||
{
|
{
|
||||||
$email = getNotifyEmailAddressList($_REQUEST['appId'], $_REQUEST['versionId']);
|
$email = getNotifyEmailAddressList($_REQUEST['appId'], $_REQUEST['versionId']);
|
||||||
@@ -167,9 +167,9 @@ if($_REQUEST['cmd'])
|
|||||||
|
|
||||||
// we didn't issue any command
|
// we didn't issue any command
|
||||||
if($_REQUEST['versionId'])
|
if($_REQUEST['versionId'])
|
||||||
$result = mysql_query("SELECT * FROM appData WHERE type = 'image' AND appId = ".$_REQUEST['appId']." AND versionId = ".$_REQUEST['versionId']);
|
$result = query_appdb("SELECT * FROM appData WHERE type = 'image' AND appId = ".$_REQUEST['appId']." AND versionId = ".$_REQUEST['versionId']);
|
||||||
else
|
else
|
||||||
$result = mysql_query("SELECT * FROM appData WHERE type = 'image' AND appId = ".$_REQUEST['appId']." ORDER BY versionId");
|
$result = query_appdb("SELECT * FROM appData WHERE type = 'image' AND appId = ".$_REQUEST['appId']." ORDER BY versionId");
|
||||||
|
|
||||||
$app=new Application($_REQUEST['appId']);
|
$app=new Application($_REQUEST['appId']);
|
||||||
apidb_header("Screenshots");
|
apidb_header("Screenshots");
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ $search = str_replace("'", "\\'", $_REQUEST['q']);
|
|||||||
$search = "%$search%";
|
$search = "%$search%";
|
||||||
|
|
||||||
$query = "SELECT * FROM appFamily WHERE appName != 'NONAME' AND appName LIKE '$search' ORDER BY appName";
|
$query = "SELECT * FROM appFamily WHERE appName != 'NONAME' AND appName LIKE '$search' ORDER BY appName";
|
||||||
$result = mysql_query($query);
|
$result = query_appdb($query);
|
||||||
|
|
||||||
apidb_header("Search Results");
|
apidb_header("Search Results");
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ else
|
|||||||
$bgcolor = ($c % 2) ? 'color0' : 'color1';
|
$bgcolor = ($c % 2) ? 'color0' : 'color1';
|
||||||
|
|
||||||
//count versions
|
//count versions
|
||||||
$query = mysql_query("SELECT count(*) as versions FROM appVersion WHERE appId = $ob->appId AND versionName != 'NONAME'");
|
$query = query_appdb("SELECT count(*) as versions FROM appVersion WHERE appId = $ob->appId AND versionName != 'NONAME'");
|
||||||
$y = mysql_fetch_object($query);
|
$y = mysql_fetch_object($query);
|
||||||
|
|
||||||
//format desc
|
//format desc
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ if(!$vendorId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//get vendor, die with error if no match
|
//get vendor, die with error if no match
|
||||||
$result = mysql_query("SELECT * FROM vendor WHERE vendorId = $vendorId");
|
$result = query_appdb("SELECT * FROM vendor WHERE vendorId = $vendorId");
|
||||||
if(!$result || mysql_num_rows($result) != 1) {
|
if(!$result || mysql_num_rows($result) != 1) {
|
||||||
errorpage("Invalid vendor ID!");
|
errorpage("Invalid vendor ID!");
|
||||||
exit;
|
exit;
|
||||||
@@ -44,7 +44,7 @@ if ($vendor->vendorURL) {
|
|||||||
echo "Vendor URL: <a href='$vendor->vendorURL'>$vendor->vendorURL</a> <br />\n";
|
echo "Vendor URL: <a href='$vendor->vendorURL'>$vendor->vendorURL</a> <br />\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = mysql_query("SELECT * FROM appFamily WHERE vendorId = $vendorId ORDER BY appName");
|
$result = query_appdb("SELECT * FROM appFamily WHERE vendorId = $vendorId ORDER BY appName");
|
||||||
if($result)
|
if($result)
|
||||||
{
|
{
|
||||||
echo "<br />Applications by $vendor->vendorName<br /><ol>\n";
|
echo "<br />Applications by $vendor->vendorName<br /><ol>\n";
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ if($catId != 0)
|
|||||||
{
|
{
|
||||||
$catQuery = "SELECT appCategory.catName, appCategory.catParent ".
|
$catQuery = "SELECT appCategory.catName, appCategory.catParent ".
|
||||||
"FROM appCategory WHERE appCategory.catId = '$currentCatId';";
|
"FROM appCategory WHERE appCategory.catId = '$currentCatId';";
|
||||||
$result = mysql_query($catQuery);
|
$result = query_appdb($catQuery);
|
||||||
|
|
||||||
if($result)
|
if($result)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user