Make code more consistent by making it follow the appdb coding standards. Fix some spaces vs. tabs odd indenting.
This commit is contained in:
@@ -58,14 +58,14 @@ else
|
|||||||
|
|
||||||
if($aClean['thread'] > 0)
|
if($aClean['thread'] > 0)
|
||||||
{
|
{
|
||||||
$result = query_appdb("SELECT * FROM appComments WHERE commentId = ".$aClean['thread']);
|
$hResult = query_appdb("SELECT * FROM appComments WHERE commentId = ".$aClean['thread']);
|
||||||
$ob = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
if($ob)
|
if($oRow)
|
||||||
{
|
{
|
||||||
$mesTitle = "<b>Replying To ...</b> $ob->subject\n";
|
$mesTitle = "<b>Replying To ...</b> $oRow->subject\n";
|
||||||
$originator = $ob->userId;
|
$originator = $oRow->userId;
|
||||||
echo html_frame_start($ob->subject,500);
|
echo html_frame_start($oRow->subject,500);
|
||||||
echo htmlify_urls($ob->body), "<br /><br />\n";
|
echo htmlify_urls($oRow->body), "<br /><br />\n";
|
||||||
echo html_frame_end();
|
echo html_frame_end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,12 +64,12 @@ $commentIds = query_appdb("SELECT commentId from appComments ORDER BY ".
|
|||||||
"appComments.time ASC LIMIT $offset, $ItemsPerPage;");
|
"appComments.time ASC LIMIT $offset, $ItemsPerPage;");
|
||||||
while ($ob = mysql_fetch_object($commentIds))
|
while ($ob = mysql_fetch_object($commentIds))
|
||||||
{
|
{
|
||||||
$qstring = "SELECT from_unixtime(unix_timestamp(time), \"%W %M %D %Y, %k:%i\") as time, ".
|
$sQuery = "SELECT from_unixtime(unix_timestamp(time), \"%W %M %D %Y, %k:%i\") as time, ".
|
||||||
"commentId, parentId, versionId, userid, subject, body ".
|
"commentId, parentId, versionId, userid, subject, body ".
|
||||||
"FROM appComments WHERE commentId = $ob->commentId;";
|
"FROM appComments WHERE commentId = $ob->commentId;";
|
||||||
$result = query_appdb($qstring);
|
$hResult = query_appdb($sQuery);
|
||||||
/* call view_app_comment to display the comment */
|
/* call view_app_comment to display the comment */
|
||||||
$comment_ob = mysql_fetch_object($result);
|
$comment_ob = mysql_fetch_object($hResult);
|
||||||
view_app_comment($comment_ob);
|
view_app_comment($comment_ob);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ if ($aClean['sub'])
|
|||||||
if ($aClean['queueId'])
|
if ($aClean['queueId'])
|
||||||
{
|
{
|
||||||
//get data
|
//get data
|
||||||
$query = "SELECT queueId, appId, versionId,".
|
$sQuery = "SELECT queueId, appId, versionId,".
|
||||||
"userId, maintainReason, superMaintainer,".
|
"userId, maintainReason, superMaintainer,".
|
||||||
"UNIX_TIMESTAMP(submitTime) as submitTime ".
|
"UNIX_TIMESTAMP(submitTime) as submitTime ".
|
||||||
"FROM appMaintainerQueue WHERE queueId = ".$aClean['queueId'].";";
|
"FROM appMaintainerQueue WHERE queueId = ".$aClean['queueId'].";";
|
||||||
$result = query_appdb($query);
|
$hResult = query_appdb($sQuery);
|
||||||
$ob = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
$oUser = new User($ob->userId);
|
$oUser = new User($oRow->userId);
|
||||||
mysql_free_result($result);
|
mysql_free_result($hResult);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -70,7 +70,7 @@ if ($aClean['sub'])
|
|||||||
|
|
||||||
$firstDisplay = true; /* if false we need to fix up table rows appropriately */
|
$firstDisplay = true; /* if false we need to fix up table rows appropriately */
|
||||||
|
|
||||||
$other_users = getMaintainersUserIdsFromAppIdVersionId($ob->versionId);
|
$other_users = getMaintainersUserIdsFromAppIdVersionId($oRow->versionId);
|
||||||
if($other_users)
|
if($other_users)
|
||||||
{
|
{
|
||||||
$foundMaintainers = true;
|
$foundMaintainers = true;
|
||||||
@@ -88,7 +88,7 @@ if ($aClean['sub'])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$other_users = getSuperMaintainersUserIdsFromAppId($ob->appId);
|
$other_users = getSuperMaintainersUserIdsFromAppId($oRow->appId);
|
||||||
if($other_users)
|
if($other_users)
|
||||||
{
|
{
|
||||||
$foundMaintainers = true;
|
$foundMaintainers = true;
|
||||||
@@ -115,7 +115,7 @@ if ($aClean['sub'])
|
|||||||
echo '<tr valign="top"><td class="color0"><b>This user also maintains these apps:</b></td>',"\n";
|
echo '<tr valign="top"><td class="color0"><b>This user also maintains these apps:</b></td>',"\n";
|
||||||
|
|
||||||
$firstDisplay = true;
|
$firstDisplay = true;
|
||||||
$other_apps = getAppsFromUserId($ob->userId);
|
$other_apps = getAppsFromUserId($oRow->userId);
|
||||||
if($other_apps)
|
if($other_apps)
|
||||||
{
|
{
|
||||||
while(list($index, list($appIdOther, $versionIdOther, $superMaintainerOther)) = each($other_apps))
|
while(list($index, list($appIdOther, $versionIdOther, $superMaintainerOther)) = each($other_apps))
|
||||||
@@ -142,8 +142,8 @@ if ($aClean['sub'])
|
|||||||
echo "<td>User maintains no other applications</td></tr>\n";
|
echo "<td>User maintains no other applications</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$oApp = new Application($ob->appId);
|
$oApp = new Application($oRow->appId);
|
||||||
$oVersion = new Version($ob->versionId);
|
$oVersion = new Version($oRow->versionId);
|
||||||
|
|
||||||
//app name
|
//app name
|
||||||
echo '<tr valign=top><td class=color0><b>App Name</b></td>',"\n";
|
echo '<tr valign=top><td class=color0><b>App Name</b></td>',"\n";
|
||||||
@@ -155,7 +155,7 @@ if ($aClean['sub'])
|
|||||||
|
|
||||||
//maintainReason
|
//maintainReason
|
||||||
echo '<tr valign=top><td class=color0><b>Maintainer request reason</b></td>',"\n";
|
echo '<tr valign=top><td class=color0><b>Maintainer request reason</b></td>',"\n";
|
||||||
echo '<td><textarea name="maintainReason" rows=10 cols=35>'.$ob->maintainReason.'</textarea></td></tr>',"\n";
|
echo '<td><textarea name="maintainReason" rows=10 cols=35>'.$oRow->maintainReason.'</textarea></td></tr>',"\n";
|
||||||
|
|
||||||
//email response
|
//email response
|
||||||
echo '<tr valign=top><td class=color0><b>Email reply</b></td>',"\n";
|
echo '<tr valign=top><td class=color0><b>Email reply</b></td>',"\n";
|
||||||
@@ -183,11 +183,11 @@ if ($aClean['sub'])
|
|||||||
else if ($aClean['add'] && $aClean['queueId'])
|
else if ($aClean['add'] && $aClean['queueId'])
|
||||||
{
|
{
|
||||||
/* create a new user object for the maintainer */
|
/* create a new user object for the maintainer */
|
||||||
$maintainerUser = new User($ob->userId);
|
$maintainerUser = new User($oRow->userId);
|
||||||
|
|
||||||
/* add the user as a maintainer and return the statusMessage */
|
/* add the user as a maintainer and return the statusMessage */
|
||||||
$statusMessage = $maintainerUser->addAsMaintainer($ob->appId, $ob->versionId,
|
$statusMessage = $maintainerUser->addAsMaintainer($oRow->appId, $oRow->versionId,
|
||||||
$ob->superMaintainer,
|
$oRow->superMaintainer,
|
||||||
$aClean['queueId']);
|
$aClean['queueId']);
|
||||||
//done
|
//done
|
||||||
addmsg("<p><b>$statusMessage</b></p>", 'green');
|
addmsg("<p><b>$statusMessage</b></p>", 'green');
|
||||||
@@ -197,8 +197,8 @@ if ($aClean['sub'])
|
|||||||
$sEmail = $oUser->sEmail;
|
$sEmail = $oUser->sEmail;
|
||||||
if ($sEmail)
|
if ($sEmail)
|
||||||
{
|
{
|
||||||
$oApp = new Application($ob->appId);
|
$oApp = new Application($oRow->appId);
|
||||||
$oVersion = new Version($ob->versionId);
|
$oVersion = new Version($oRow->versionId);
|
||||||
$sSubject = "Application Maintainer Request Report";
|
$sSubject = "Application Maintainer Request Report";
|
||||||
$sMsg = "Your application to be the maintainer of ".$oApp->sName." ".$oVersion->sName." was rejected. ";
|
$sMsg = "Your application to be the maintainer of ".$oApp->sName." ".$oVersion->sName." was rejected. ";
|
||||||
$sMsg .= $aClean['replyText'];
|
$sMsg .= $aClean['replyText'];
|
||||||
@@ -209,10 +209,10 @@ if ($aClean['sub'])
|
|||||||
}
|
}
|
||||||
|
|
||||||
//delete main item
|
//delete main item
|
||||||
$query = "DELETE from appMaintainerQueue where queueId = ".$aClean['queueId'].";";
|
$sQuery = "DELETE from appMaintainerQueue where queueId = ".$aClean['queueId'].";";
|
||||||
$result = query_appdb($query,"unable to delete selected maintainer application");
|
$hResult = query_appdb($sQuery,"unable to delete selected maintainer application");
|
||||||
echo html_frame_start("Delete maintainer application",400,"",0);
|
echo html_frame_start("Delete maintainer application",400,"",0);
|
||||||
if($result)
|
if($hResult)
|
||||||
{
|
{
|
||||||
//success
|
//success
|
||||||
echo "<p>Maintainer application was successfully deleted from the Queue.</p>\n";
|
echo "<p>Maintainer application was successfully deleted from the Queue.</p>\n";
|
||||||
@@ -232,14 +232,14 @@ if ($aClean['sub'])
|
|||||||
echo '<form name="qform" action="adminMaintainerQueue.php" method="post" enctype="multipart/form-data">',"\n";
|
echo '<form name="qform" action="adminMaintainerQueue.php" method="post" enctype="multipart/form-data">',"\n";
|
||||||
|
|
||||||
//get available maintainers
|
//get available maintainers
|
||||||
$query = "SELECT queueId, appId, versionId,".
|
$sQuery = "SELECT queueId, appId, versionId,".
|
||||||
"userId, maintainReason,".
|
"userId, maintainReason,".
|
||||||
"superMaintainer,".
|
"superMaintainer,".
|
||||||
"submitTime as submitTime ".
|
"submitTime as submitTime ".
|
||||||
"from appMaintainerQueue;";
|
"from appMaintainerQueue;";
|
||||||
$result = query_appdb($query);
|
$hResult = query_appdb($sQuery);
|
||||||
|
|
||||||
if(!$result || !mysql_num_rows($result))
|
if(!$hResult || !mysql_num_rows($hResult))
|
||||||
{
|
{
|
||||||
//no apps in queue
|
//no apps in queue
|
||||||
echo html_frame_start("","90%");
|
echo html_frame_start("","90%");
|
||||||
@@ -269,17 +269,17 @@ if ($aClean['sub'])
|
|||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
$c = 1;
|
$c = 1;
|
||||||
while($ob = mysql_fetch_object($result))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oUser = new User($ob->userId);
|
$oUser = new User($oRow->userId);
|
||||||
$oApp = new Application($ob->appId);
|
$oApp = new Application($oRow->appId);
|
||||||
$oVersion = new Version($ob->versionId);
|
$oVersion = new Version($oRow->versionId);
|
||||||
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
|
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
|
||||||
echo "<tr class=$bgcolor>\n";
|
echo "<tr class=$bgcolor>\n";
|
||||||
echo " <td>".print_date(mysqldatetime_to_unixtimestamp($ob->submitTime))." </td>\n";
|
echo " <td>".print_date(mysqldatetime_to_unixtimestamp($oRow->submitTime))." </td>\n";
|
||||||
echo " <td>".$oApp->sName."</td>\n";
|
echo " <td>".$oApp->sName."</td>\n";
|
||||||
|
|
||||||
if($ob->superMaintainer)
|
if($oRow->superMaintainer)
|
||||||
{
|
{
|
||||||
echo "<td>N/A</td>\n";
|
echo "<td>N/A</td>\n";
|
||||||
echo "<td>Yes</td>\n";
|
echo "<td>Yes</td>\n";
|
||||||
@@ -290,7 +290,7 @@ if ($aClean['sub'])
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo " <td><a href=\"mailto:".$oUser->sEmail."\">".$oUser->sRealname."</a></td>\n";
|
echo " <td><a href=\"mailto:".$oUser->sEmail."\">".$oUser->sRealname."</a></td>\n";
|
||||||
echo " <td>[<a href=\"adminMaintainerQueue.php?sub=view&queueId=$ob->queueId\">answer</a>]</td>\n";
|
echo " <td>[<a href=\"adminMaintainerQueue.php?sub=view&queueId=$oRow->queueId\">answer</a>]</td>\n";
|
||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
$c++;
|
$c++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,12 +67,12 @@ else
|
|||||||
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">',"\n";
|
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">',"\n";
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$result = query_appdb("SELECT * FROM appData WHERE appId = $oApp->iAppId AND type = 'url' AND versionId = 0");
|
$hResult = query_appdb("SELECT * FROM appData WHERE appId = $oApp->iAppId AND type = 'url' AND versionId = 0");
|
||||||
if($result && mysql_num_rows($result) > 0)
|
if($hResult && mysql_num_rows($hResult) > 0)
|
||||||
{
|
{
|
||||||
echo '<tr><td class=color1><b>Delete</b></td><td class=color1>',"\n";
|
echo '<tr><td class=color1><b>Delete</b></td><td class=color1>',"\n";
|
||||||
echo '<b>Description</b></td><td class=color1><b>URL</b></td></tr>',"\n";
|
echo '<b>Description</b></td><td class=color1><b>URL</b></td></tr>',"\n";
|
||||||
while($ob = mysql_fetch_object($result))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$temp0 = "adelete[".$i."]";
|
$temp0 = "adelete[".$i."]";
|
||||||
$temp1 = "adescription[".$i."]";
|
$temp1 = "adescription[".$i."]";
|
||||||
@@ -81,11 +81,11 @@ else
|
|||||||
$temp4 = "aOldDesc[".$i."]";
|
$temp4 = "aOldDesc[".$i."]";
|
||||||
$temp5 = "aOldURL[".$i."]";
|
$temp5 = "aOldURL[".$i."]";
|
||||||
echo '<tr><td class=color3><input type="checkbox" name="'.$temp0.'"></td>',"\n";
|
echo '<tr><td class=color3><input type="checkbox" name="'.$temp0.'"></td>',"\n";
|
||||||
echo '<td class=color3><input size=45% type="text" name="'.$temp1.'" value ="'.stripslashes($ob->description).'"</td>',"\n";
|
echo '<td class=color3><input size=45% type="text" name="'.$temp1.'" value ="'.stripslashes($oRow->description).'"</td>',"\n";
|
||||||
echo '<td class=color3><input size=45% type="text" name="'.$temp2.'" value="'.$ob->url.'"></td></tr>',"\n";
|
echo '<td class=color3><input size=45% type="text" name="'.$temp2.'" value="'.$oRow->url.'"></td></tr>',"\n";
|
||||||
echo '<input type=hidden name="'.$temp3.'" value='.$ob->id.'>';
|
echo '<input type=hidden name="'.$temp3.'" value='.$oRow->id.'>';
|
||||||
echo '<input type=hidden name="'.$temp4.'" value="'.stripslashes($ob->description).'">';
|
echo '<input type=hidden name="'.$temp4.'" value="'.stripslashes($oRow->description).'">';
|
||||||
echo '<input type=hidden name="'.$temp5.'" value="'.$ob->url.'">',"\n";
|
echo '<input type=hidden name="'.$temp5.'" value="'.$oRow->url.'">',"\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -59,12 +59,12 @@ if(!empty($aClean['submit']))
|
|||||||
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">',"\n";
|
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">',"\n";
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$result = query_appdb("SELECT * FROM appData WHERE versionId = ".$oVersion->iVersionId." AND type = 'url'");
|
$hResult = query_appdb("SELECT * FROM appData WHERE versionId = ".$oVersion->iVersionId." AND type = 'url'");
|
||||||
if($result && mysql_num_rows($result) > 0)
|
if($hResult && mysql_num_rows($hResult) > 0)
|
||||||
{
|
{
|
||||||
echo '<tr><td class=color1><b>Delete</b></td><td class=color1>',"\n";
|
echo '<tr><td class=color1><b>Delete</b></td><td class=color1>',"\n";
|
||||||
echo '<b>Description</b></td><td class=color1><b>URL</b></td></tr>',"\n";
|
echo '<b>Description</b></td><td class=color1><b>URL</b></td></tr>',"\n";
|
||||||
while($ob = mysql_fetch_object($result))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$temp0 = "adelete[".$i."]";
|
$temp0 = "adelete[".$i."]";
|
||||||
$temp1 = "adescription[".$i."]";
|
$temp1 = "adescription[".$i."]";
|
||||||
@@ -73,11 +73,11 @@ if(!empty($aClean['submit']))
|
|||||||
$temp4 = "aOldDesc[".$i."]";
|
$temp4 = "aOldDesc[".$i."]";
|
||||||
$temp5 = "aOldURL[".$i."]";
|
$temp5 = "aOldURL[".$i."]";
|
||||||
echo '<tr><td class=color3><input type="checkbox" name="'.$temp0.'"></td>',"\n";
|
echo '<tr><td class=color3><input type="checkbox" name="'.$temp0.'"></td>',"\n";
|
||||||
echo '<td class=color3><input size="45" type="text" name="'.$temp1.'" value ="'.stripslashes($ob->description).'"</td>',"\n";
|
echo '<td class=color3><input size="45" type="text" name="'.$temp1.'" value ="'.stripslashes($oRow->description).'"</td>',"\n";
|
||||||
echo '<td class=color3><input size="45" type="text" name="'.$temp2.'" value="'.$ob->url.'"></td></tr>',"\n";
|
echo '<td class=color3><input size="45" type="text" name="'.$temp2.'" value="'.$oRow->url.'"></td></tr>',"\n";
|
||||||
echo '<input type="hidden" name="'.$temp3.'" value="'.$ob->id.'" />';
|
echo '<input type="hidden" name="'.$temp3.'" value="'.$oRow->id.'" />';
|
||||||
echo '<input type="hidden" name="'.$temp4.'" value="'.stripslashes($ob->description).'" />';
|
echo '<input type="hidden" name="'.$temp4.'" value="'.stripslashes($oRow->description).'" />';
|
||||||
echo '<input type="hidden" name="'.$temp5.'" value="'.$ob->url.'" />',"\n";
|
echo '<input type="hidden" name="'.$temp5.'" value="'.$oRow->url.'" />',"\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ if(!$_SESSION['current']->hasPriv("admin"))
|
|||||||
|
|
||||||
function build_app_list()
|
function build_app_list()
|
||||||
{
|
{
|
||||||
$result = query_appdb("SELECT appId, appName FROM appFamily ORDER BY appName");
|
$hResult = query_appdb("SELECT appId, appName FROM appFamily ORDER BY appName");
|
||||||
|
|
||||||
echo "<select name=appId size=5 onChange='this.form.submit()'>\n";
|
echo "<select name=appId size=5 onChange='this.form.submit()'>\n";
|
||||||
while($ob = mysql_fetch_object($result))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
echo "<option value=$ob->appId>$ob->appName</option>\n";
|
echo "<option value=$oRow->appId>$oRow->appName</option>\n";
|
||||||
}
|
}
|
||||||
echo "</select>\n";
|
echo "</select>\n";
|
||||||
}
|
}
|
||||||
@@ -26,14 +26,14 @@ if($cmd)
|
|||||||
{
|
{
|
||||||
if($cmd == "delete")
|
if($cmd == "delete")
|
||||||
{
|
{
|
||||||
$result = query_appdb("DELETE FROM appBundle WHERE appId = $appId AND bundleId = $bundleId");
|
$hResult = query_appdb("DELETE FROM appBundle WHERE appId = $appId AND bundleId = $bundleId");
|
||||||
if($result)
|
if($hResult)
|
||||||
addmsg("App deleted from bundle", "green");
|
addmsg("App deleted from bundle", "green");
|
||||||
}
|
}
|
||||||
if($cmd == "add")
|
if($cmd == "add")
|
||||||
{
|
{
|
||||||
$result = query_appdb("INSERT INTO appBundle VALUES ($bundleId, $appId)");
|
$hResult = query_appdb("INSERT INTO appBundle VALUES ($bundleId, $appId)");
|
||||||
if($result)
|
if($hResult)
|
||||||
addmsg("App $appId added to Bundle $bundleId", "green");
|
addmsg("App $appId added to Bundle $bundleId", "green");
|
||||||
}
|
}
|
||||||
redirectref();
|
redirectref();
|
||||||
@@ -43,10 +43,10 @@ else
|
|||||||
{
|
{
|
||||||
apidb_header("Edit Application Bundle");
|
apidb_header("Edit Application Bundle");
|
||||||
|
|
||||||
$result = query_appdb("SELECT bundleId, appBundle.appId, appName FROM appBundle, appFamily ".
|
$hResult = query_appdb("SELECT bundleId, appBundle.appId, appName FROM appBundle, appFamily ".
|
||||||
"WHERE bundleId = $bundleId AND appFamily.appId = appBundle.appId");
|
"WHERE bundleId = $bundleId AND appFamily.appId = appBundle.appId");
|
||||||
|
|
||||||
if($result && mysql_num_rows($result))
|
if($hResult && mysql_num_rows($hResult))
|
||||||
{
|
{
|
||||||
echo html_frame_start("Apps in this Bundle","300",'',0);
|
echo html_frame_start("Apps in this Bundle","300",'',0);
|
||||||
echo "<table width='100%' border=0 cellpadding=3 cellspacing=0>\n\n";
|
echo "<table width='100%' border=0 cellpadding=3 cellspacing=0>\n\n";
|
||||||
@@ -57,15 +57,15 @@ else
|
|||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
$c = 1;
|
$c = 1;
|
||||||
while($ob = mysql_fetch_object($result))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
//set row color
|
//set row color
|
||||||
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
|
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
|
||||||
|
|
||||||
$delete_link = "[<a href='editBundle.php?cmd=delete&bundleId=$bundleId&appId=$ob->appId'>delete</a>]";
|
$delete_link = "[<a href='editBundle.php?cmd=delete&bundleId=$bundleId&appId=$oRow->appId'>delete</a>]";
|
||||||
|
|
||||||
echo "<tr class=$bgcolor>\n";
|
echo "<tr class=$bgcolor>\n";
|
||||||
echo " <td>$ob->appName </td>\n";
|
echo " <td>$oRow->appName </td>\n";
|
||||||
echo " <td>$delete_link </td>\n";
|
echo " <td>$delete_link </td>\n";
|
||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
@@ -74,7 +74,6 @@ else
|
|||||||
|
|
||||||
echo "</table>\n\n";
|
echo "</table>\n\n";
|
||||||
echo html_frame_end();
|
echo html_frame_end();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<form method=post action=editBundle.php>\n";
|
echo "<form method=post action=editBundle.php>\n";
|
||||||
|
|||||||
10
appview.php
10
appview.php
@@ -47,9 +47,9 @@ function display_catpath($catId, $appId, $versionId = '')
|
|||||||
function display_bundle($appId)
|
function display_bundle($appId)
|
||||||
{
|
{
|
||||||
$oApp = new Application($appId);
|
$oApp = new Application($appId);
|
||||||
$result = query_appdb("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ".
|
$hResult = query_appdb("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ".
|
||||||
"WHERE appFamily.queued='false' AND bundleId = $appId AND appBundle.appId = appFamily.appId");
|
"WHERE appFamily.queued='false' AND bundleId = $appId AND appBundle.appId = appFamily.appId");
|
||||||
if(!$result || mysql_num_rows($result) == 0)
|
if(!$hResult || mysql_num_rows($hResult) == 0)
|
||||||
{
|
{
|
||||||
return; // do nothing
|
return; // do nothing
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,8 @@ function display_bundle($appId)
|
|||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
$c = 0;
|
$c = 0;
|
||||||
while($ob = mysql_fetch_object($result)) {
|
while($ob = mysql_fetch_object($hResult))
|
||||||
|
{
|
||||||
//set row color
|
//set row color
|
||||||
$bgcolor = ($c % 2 == 0) ? "color0" : "color1";
|
$bgcolor = ($c % 2 == 0) ? "color0" : "color1";
|
||||||
|
|
||||||
@@ -81,7 +82,8 @@ function display_bundle($appId)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Show note */
|
/* Show note */
|
||||||
function show_note($sType,$oData){
|
function show_note($sType,$oData)
|
||||||
|
{
|
||||||
global $oVersion;
|
global $oVersion;
|
||||||
|
|
||||||
switch($sType)
|
switch($sType)
|
||||||
|
|||||||
@@ -207,47 +207,47 @@ function forum_lookup_user($iUserId)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* display a single comment (in $ob)
|
* display a single comment (in $oRow)
|
||||||
*/
|
*/
|
||||||
function view_app_comment($ob)
|
function view_app_comment($oRow)
|
||||||
{
|
{
|
||||||
|
|
||||||
echo html_frame_start('','98%');
|
echo html_frame_start('','98%');
|
||||||
echo '<table width="100%" border="0" cellpadding="2" cellspacing="1">',"\n";
|
echo '<table width="100%" border="0" cellpadding="2" cellspacing="1">',"\n";
|
||||||
|
|
||||||
$ob->subject = stripslashes($ob->subject);
|
$oRow->subject = stripslashes($oRow->subject);
|
||||||
$ob->body = stripslashes($ob->body);
|
$oRow->body = stripslashes($oRow->body);
|
||||||
|
|
||||||
// message header
|
// message header
|
||||||
echo "<tr bgcolor=\"#E0E0E0\"><td><a name=Comment-".$ob->commentId."></a>\n";
|
echo "<tr bgcolor=\"#E0E0E0\"><td><a name=Comment-".$oRow->commentId."></a>\n";
|
||||||
echo " <b>".$ob->subject."</b><br />\n";
|
echo " <b>".$oRow->subject."</b><br />\n";
|
||||||
echo " by ".forum_lookup_user($ob->userId)." on ".$ob->time."<br />\n";
|
echo " by ".forum_lookup_user($oRow->userId)." on ".$oRow->time."<br />\n";
|
||||||
echo "</td></tr><tr><td>\n";
|
echo "</td></tr><tr><td>\n";
|
||||||
|
|
||||||
// body
|
// body
|
||||||
echo htmlify_urls($ob->body), "<br /><br />\n";
|
echo htmlify_urls($oRow->body), "<br /><br />\n";
|
||||||
|
|
||||||
// only add RE: once
|
// only add RE: once
|
||||||
if(eregi("RE:", $ob->subject))
|
if(eregi("RE:", $oRow->subject))
|
||||||
$subject = $ob->subject;
|
$subject = $oRow->subject;
|
||||||
else
|
else
|
||||||
$subject = "RE: ".$ob->subject;
|
$subject = "RE: ".$oRow->subject;
|
||||||
|
|
||||||
// reply post buttons
|
// reply post buttons
|
||||||
echo " [<a href=\"addcomment.php?appId=$ob->appId&versionId=$ob->versionId\"><small>post new</small></a>] \n";
|
echo " [<a href=\"addcomment.php?appId=$oRow->appId&versionId=$oRow->versionId\"><small>post new</small></a>] \n";
|
||||||
echo " [<a href=\"addcomment.php?appId=$ob->appId&versionId=$ob->versionId&subject=".
|
echo " [<a href=\"addcomment.php?appId=$oRow->appId&versionId=$oRow->versionId&subject=".
|
||||||
urlencode("$subject")."&thread=$ob->commentId\"><small>reply to this</small></a>] \n";
|
urlencode("$subject")."&thread=$oRow->commentId\"><small>reply to this</small></a>] \n";
|
||||||
|
|
||||||
echo "</td></tr>\n";
|
echo "</td></tr>\n";
|
||||||
|
|
||||||
// delete message button, for admins
|
// delete message button, for admins
|
||||||
if ($_SESSION['current']->hasPriv("admin")
|
if ($_SESSION['current']->hasPriv("admin")
|
||||||
|| $_SESSION['current']->isMaintainer($ob->versionId)
|
|| $_SESSION['current']->isMaintainer($oRow->versionId)
|
||||||
|| $_SESSION['current']->isSuperMaintainer($ob->appId))
|
|| $_SESSION['current']->isSuperMaintainer($oRow->appId))
|
||||||
{
|
{
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<td><form method=\"post\" name=\"message\" action=\"".BASE."deletecomment.php\"><input type=\"submit\" value=\"Delete\" class=\"button\">\n";
|
echo "<td><form method=\"post\" name=\"message\" action=\"".BASE."deletecomment.php\"><input type=\"submit\" value=\"Delete\" class=\"button\">\n";
|
||||||
echo "<input type=\"hidden\" name=\"commentId\" value=\"$ob->commentId\" />";
|
echo "<input type=\"hidden\" name=\"commentId\" value=\"$oRow->commentId\" />";
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
echo "</td></tr>";
|
echo "</td></tr>";
|
||||||
}
|
}
|
||||||
@@ -273,9 +273,9 @@ function grab_comments($versionId, $parentId = -1)
|
|||||||
"FROM appComments, appVersion WHERE appComments.versionId = appVersion.versionId AND appComments.versionId = '$versionId' ".
|
"FROM appComments, appVersion WHERE appComments.versionId = appVersion.versionId AND appComments.versionId = '$versionId' ".
|
||||||
$extra.
|
$extra.
|
||||||
"ORDER BY appComments.time ASC";
|
"ORDER BY appComments.time ASC";
|
||||||
$result = query_appdb($qstring);
|
$hResult = query_appdb($qstring);
|
||||||
|
|
||||||
return $result;
|
return $hResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -283,16 +283,16 @@ function grab_comments($versionId, $parentId = -1)
|
|||||||
* display nested comments
|
* display nested comments
|
||||||
* handle is a db result set
|
* handle is a db result set
|
||||||
*/
|
*/
|
||||||
function do_display_comments_nested($handle)
|
function do_display_comments_nested($hResult)
|
||||||
{
|
{
|
||||||
while($ob = mysql_fetch_object($handle))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
view_app_comment($ob);
|
view_app_comment($oRow);
|
||||||
$result = grab_comments($ob->versionId, $ob->commentId);
|
$hResult2 = grab_comments($oRow->versionId, $oRow->commentId);
|
||||||
if($result && mysql_num_rows($result))
|
if($hResult && mysql_num_rows($hResult2))
|
||||||
{
|
{
|
||||||
echo "<blockquote>\n";
|
echo "<blockquote>\n";
|
||||||
do_display_comments_nested($result);
|
do_display_comments_nested($hResult2);
|
||||||
echo "</blockquote>\n";
|
echo "</blockquote>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -301,9 +301,9 @@ function do_display_comments_nested($handle)
|
|||||||
|
|
||||||
function display_comments_nested($versionId, $threadId)
|
function display_comments_nested($versionId, $threadId)
|
||||||
{
|
{
|
||||||
$result = grab_comments($versionId, $threadId);
|
$hResult = grab_comments($versionId, $threadId);
|
||||||
|
|
||||||
do_display_comments_nested($result);
|
do_display_comments_nested($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -311,27 +311,27 @@ function display_comments_nested($versionId, $threadId)
|
|||||||
* display threaded comments
|
* display threaded comments
|
||||||
* handle is a db result set
|
* handle is a db result set
|
||||||
*/
|
*/
|
||||||
function do_display_comments_threaded($handle, $is_main)
|
function do_display_comments_threaded($hResult, $is_main)
|
||||||
{
|
{
|
||||||
if (!$is_main)
|
if (!$is_main)
|
||||||
echo "<ul>\n";
|
echo "<ul>\n";
|
||||||
|
|
||||||
while ($ob = mysql_fetch_object($handle))
|
while ($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
if ($is_main)
|
if ($is_main)
|
||||||
{
|
{
|
||||||
view_app_comment($ob);
|
view_app_comment($oRow);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
echo '<li><a href="commentview.php?appId='.$ob->appId.'&versionId='.$ob->versionId.'&threadId='.$ob->parentId.'"> '.
|
echo '<li><a href="commentview.php?appId='.$oRow->appId.'&versionId='.$oRow->versionId.'&threadId='.$oRow->parentId.'"> '.
|
||||||
$ob->subject.' </a> by '.forum_lookup_user($ob->userId).' on '.$ob->time.' </li>'."\n";
|
$oRow->subject.' </a> by '.forum_lookup_user($oRow->userId).' on '.$oRow->time.' </li>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = grab_comments($ob->versionId, $ob->commentId);
|
$hResult2 = grab_comments($oRow->versionId, $oRow->commentId);
|
||||||
if ($result && mysql_num_rows($result))
|
if ($hResult2 && mysql_num_rows($hResult2))
|
||||||
{
|
{
|
||||||
echo "<blockquote>\n";
|
echo "<blockquote>\n";
|
||||||
do_display_comments_threaded($result, 0);
|
do_display_comments_threaded($hResult2, 0);
|
||||||
echo "</blockquote>\n";
|
echo "</blockquote>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -343,9 +343,9 @@ function do_display_comments_threaded($handle, $is_main)
|
|||||||
|
|
||||||
function display_comments_threaded($versionId, $threadId = 0)
|
function display_comments_threaded($versionId, $threadId = 0)
|
||||||
{
|
{
|
||||||
$result = grab_comments($versionId, $threadId);
|
$hResult = grab_comments($versionId, $threadId);
|
||||||
|
|
||||||
do_display_comments_threaded($result, 1);
|
do_display_comments_threaded($hResult, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -354,12 +354,12 @@ function display_comments_threaded($versionId, $threadId = 0)
|
|||||||
*/
|
*/
|
||||||
function display_comments_flat($versionId)
|
function display_comments_flat($versionId)
|
||||||
{
|
{
|
||||||
$result = grab_comments($versionId);
|
$hResult = grab_comments($versionId);
|
||||||
if ($result)
|
if ($hResult)
|
||||||
{
|
{
|
||||||
while($ob = mysql_fetch_object($result))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
view_app_comment($ob);
|
view_app_comment($oRow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -374,8 +374,8 @@ function view_app_comments($versionId, $threadId = 0)
|
|||||||
$aClean['mode'] = makeSafe($_REQUEST['mode']);
|
$aClean['mode'] = makeSafe($_REQUEST['mode']);
|
||||||
|
|
||||||
// count posts
|
// count posts
|
||||||
$result = query_appdb("SELECT commentId FROM appComments WHERE versionId = $versionId");
|
$hResult = query_appdb("SELECT commentId FROM appComments WHERE versionId = $versionId");
|
||||||
$messageCount = mysql_num_rows($result);
|
$messageCount = mysql_num_rows($hResult);
|
||||||
|
|
||||||
//start comment format table
|
//start comment format table
|
||||||
echo html_frame_start("","98%",'',0);
|
echo html_frame_start("","98%",'',0);
|
||||||
|
|||||||
@@ -385,14 +385,14 @@ class distribution{
|
|||||||
/* Make a dropdown list of distributions */
|
/* Make a dropdown list of distributions */
|
||||||
function make_distribution_list($varname, $cvalue)
|
function make_distribution_list($varname, $cvalue)
|
||||||
{
|
{
|
||||||
$query = "SELECT name, distributionId FROM distributions ORDER BY name";
|
$sQuery = "SELECT name, distributionId FROM distributions ORDER BY name";
|
||||||
|
|
||||||
$result = query_appdb($query);
|
$hResult = query_appdb($sQuery);
|
||||||
if(!$result) return;
|
if(!$hResult) return;
|
||||||
|
|
||||||
echo "<select name='$varname'>\n";
|
echo "<select name='$varname'>\n";
|
||||||
echo "<option value=\"\">Choose ...</option>\n";
|
echo "<option value=\"\">Choose ...</option>\n";
|
||||||
while(list($name, $value) = mysql_fetch_row($result))
|
while(list($name, $value) = mysql_fetch_row($hResult))
|
||||||
{
|
{
|
||||||
if($value == $cvalue)
|
if($value == $cvalue)
|
||||||
echo "<option value=$value selected>$name\n";
|
echo "<option value=$value selected>$name\n";
|
||||||
@@ -407,8 +407,8 @@ function getNumberOfDistributions()
|
|||||||
$hResult = query_appdb("SELECT count(*) as num_dists FROM distributions");
|
$hResult = query_appdb("SELECT count(*) as num_dists FROM distributions");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$row = mysql_fetch_object($hResult);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $row->num_dists;
|
return $oRow->num_dists;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -419,8 +419,8 @@ function getNumberOfQueuedDistributions()
|
|||||||
$hResult = query_appdb("SELECT count(*) as num_dists FROM distributions WHERE queued='true';");
|
$hResult = query_appdb("SELECT count(*) as num_dists FROM distributions WHERE queued='true';");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$row = mysql_fetch_object($hResult);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $row->num_dists;
|
return $oRow->num_dists;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -226,14 +226,14 @@ function addmsg($text, $color = "black")
|
|||||||
*/
|
*/
|
||||||
function dumpmsgbuffer()
|
function dumpmsgbuffer()
|
||||||
{
|
{
|
||||||
$result = query_appdb("SELECT * FROM sessionMessages WHERE sessionId = '".session_id()."'");
|
$hResult = query_appdb("SELECT * FROM sessionMessages WHERE sessionId = '".session_id()."'");
|
||||||
if(!$result)
|
if(!$hResult)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while($r = mysql_fetch_object($result))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
echo html_frame_start("","300","",5);
|
echo html_frame_start("","300","",5);
|
||||||
echo "<div align=center> $r->message </div>";
|
echo "<div align=center> $oRow->message </div>";
|
||||||
echo html_frame_end(" ");
|
echo html_frame_end(" ");
|
||||||
echo "<br>\n";
|
echo "<br>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,17 +9,17 @@
|
|||||||
function getAppsFromUserId($userId)
|
function getAppsFromUserId($userId)
|
||||||
{
|
{
|
||||||
/* retrieve the list of application and order them by application name */
|
/* retrieve the list of application and order them by application name */
|
||||||
$result = query_appdb("SELECT appMaintainers.appId, versionId, superMaintainer, appName FROM ".
|
$hResult = query_appdb("SELECT appMaintainers.appId, versionId, superMaintainer, appName FROM ".
|
||||||
"appFamily, appMaintainers WHERE appFamily.appId = appMaintainers.appId ".
|
"appFamily, appMaintainers WHERE appFamily.appId = appMaintainers.appId ".
|
||||||
"AND userId = '$userId' ORDER BY appName");
|
"AND userId = '$userId' ORDER BY appName");
|
||||||
if(!$result || mysql_num_rows($result) == 0)
|
if(!$hResult || mysql_num_rows($hResult) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$retval = array();
|
$retval = array();
|
||||||
$c = 0;
|
$c = 0;
|
||||||
while($row = mysql_fetch_object($result))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$retval[$c] = array($row->appId, $row->versionId, $row->superMaintainer);
|
$retval[$c] = array($oRow->appId, $oRow->versionId, $oRow->superMaintainer);
|
||||||
$c++;
|
$c++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,13 +37,13 @@ function getMaintainersUserIdsFromAppIdVersionId($versionId)
|
|||||||
if($versionId == 0)
|
if($versionId == 0)
|
||||||
return $retval;
|
return $retval;
|
||||||
|
|
||||||
$query = "SELECT userId FROM ".
|
$sQuery = "SELECT userId FROM ".
|
||||||
"appMaintainers WHERE versionId = '$versionId';";
|
"appMaintainers WHERE versionId = '$versionId';";
|
||||||
$result = query_appdb($query);
|
$hResult = query_appdb($sQuery);
|
||||||
$c = 0;
|
$c = 0;
|
||||||
while($row = mysql_fetch_object($result))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$retval[$c] = $row->userId;
|
$retval[$c] = $oRow->userId;
|
||||||
$c++;
|
$c++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,15 +55,15 @@ function getMaintainersUserIdsFromAppIdVersionId($versionId)
|
|||||||
*/
|
*/
|
||||||
function getSuperMaintainersUserIdsFromAppId($appId)
|
function getSuperMaintainersUserIdsFromAppId($appId)
|
||||||
{
|
{
|
||||||
$query = "SELECT userId FROM ".
|
$sQuery = "SELECT userId FROM ".
|
||||||
"appMaintainers WHERE appId = '$appId' " .
|
"appMaintainers WHERE appId = '$appId' " .
|
||||||
"AND superMaintainer = '1';";
|
"AND superMaintainer = '1';";
|
||||||
$result = query_appdb($query);
|
$hResult = query_appdb($sQuery);
|
||||||
$retval = array();
|
$retval = array();
|
||||||
$c = 0;
|
$c = 0;
|
||||||
while($row = mysql_fetch_object($result))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$retval[$c] = $row->userId;
|
$retval[$c] = $oRow->userId;
|
||||||
$c++;
|
$c++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,25 +19,24 @@ class TableVE {
|
|||||||
|
|
||||||
function test($query)
|
function test($query)
|
||||||
{
|
{
|
||||||
$result = query_appdb($query);
|
$hResult = query_appdb($query);
|
||||||
$nfields = mysql_num_fields($result);
|
$nfields = mysql_num_fields($hResult);
|
||||||
$nrows = mysql_num_rows($result);
|
$nrows = mysql_num_rows($hResult);
|
||||||
$table = mysql_field_table($result, 0);
|
$table = mysql_field_table($hResult, 0);
|
||||||
|
|
||||||
echo "Table: $table <br> Fields: $nfields <br> Rows: $nrows <br> <br>\n";
|
echo "Table: $table <br> Fields: $nfields <br> Rows: $nrows <br> <br>\n";
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while($i < $nfields)
|
while($i < $nfields)
|
||||||
{
|
{
|
||||||
$type = mysql_field_type($result, $i);
|
$type = mysql_field_type($hResult, $i);
|
||||||
$name = mysql_field_name($result, $i);
|
$name = mysql_field_name($hResult, $i);
|
||||||
$len = mysql_field_len($result, $i);
|
$len = mysql_field_len($hResult, $i);
|
||||||
$flags = mysql_field_flags($result, $i);
|
$flags = mysql_field_flags($hResult, $i);
|
||||||
|
|
||||||
echo "$type | $name | $len | $flags <br>\n";
|
echo "$type | $name | $len | $flags <br>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this is a bit of a hack,
|
/* this is a bit of a hack,
|
||||||
@@ -46,7 +45,7 @@ class TableVE {
|
|||||||
*/
|
*/
|
||||||
function create($query, $table, $idcolumn)
|
function create($query, $table, $idcolumn)
|
||||||
{
|
{
|
||||||
$result = query_appdb($query);
|
$hResult = query_appdb($query);
|
||||||
$id = mysql_insert_id();
|
$id = mysql_insert_id();
|
||||||
|
|
||||||
$new_query = "SELECT * FROM $table WHERE $idcolumn = $id";
|
$new_query = "SELECT * FROM $table WHERE $idcolumn = $id";
|
||||||
@@ -60,8 +59,8 @@ class TableVE {
|
|||||||
|
|
||||||
$nrows = 0;
|
$nrows = 0;
|
||||||
|
|
||||||
$result = query_appdb($query);
|
$hResult = query_appdb($query);
|
||||||
$nrows = mysql_num_rows($result);
|
$nrows = mysql_num_rows($hResult);
|
||||||
|
|
||||||
if(debugging())
|
if(debugging())
|
||||||
{
|
{
|
||||||
@@ -70,15 +69,15 @@ class TableVE {
|
|||||||
|
|
||||||
for($i = 0; $i < $nrows; $i++)
|
for($i = 0; $i < $nrows; $i++)
|
||||||
{
|
{
|
||||||
$this->view_entry($result, $i);
|
$this->view_entry($hResult, $i);
|
||||||
echo "<br>\n";
|
echo "<br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function view_entry($result, $num)
|
function view_entry($hResult, $num)
|
||||||
{
|
{
|
||||||
$nfields = mysql_num_fields($result);
|
$nfields = mysql_num_fields($hResult);
|
||||||
$fields = mysql_fetch_array($result, MYSQL_BOTH);
|
$fields = mysql_fetch_array($hResult, MYSQL_BOTH);
|
||||||
|
|
||||||
$titleValue = $fields[$this->titleField];
|
$titleValue = $fields[$this->titleField];
|
||||||
$titleText = $this->titleText;
|
$titleText = $this->titleText;
|
||||||
@@ -99,7 +98,7 @@ class TableVE {
|
|||||||
|
|
||||||
for($i = 0; $i < $nfields; $i++)
|
for($i = 0; $i < $nfields; $i++)
|
||||||
{
|
{
|
||||||
$field = mysql_fetch_field($result, $i);
|
$field = mysql_fetch_field($hResult, $i);
|
||||||
|
|
||||||
if(ereg("^impl_(.+)$", $field->table, $arr))
|
if(ereg("^impl_(.+)$", $field->table, $arr))
|
||||||
{
|
{
|
||||||
@@ -116,20 +115,19 @@ class TableVE {
|
|||||||
|
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
echo html_frame_end();
|
echo html_frame_end();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function edit($query)
|
function edit($query)
|
||||||
{
|
{
|
||||||
$result = query_appdb($query);
|
$hResult = query_appdb($query);
|
||||||
$nrows = mysql_num_rows($result);
|
$nrows = mysql_num_rows($hResult);
|
||||||
|
|
||||||
echo "<form method=post action='".$_SERVER['PHP_SELF']."'>\n";
|
echo "<form method=post action='".$_SERVER['PHP_SELF']."'>\n";
|
||||||
|
|
||||||
for($i = 0; $i < $nrows; $i++)
|
for($i = 0; $i < $nrows; $i++)
|
||||||
{
|
{
|
||||||
$this->edit_entry($result);
|
$this->edit_entry($hResult);
|
||||||
echo "<br>\n";
|
echo "<br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,10 +139,10 @@ class TableVE {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function edit_entry($result)
|
function edit_entry($hResult)
|
||||||
{
|
{
|
||||||
$nfields = mysql_num_fields($result);
|
$nfields = mysql_num_fields($hResult);
|
||||||
$fields = mysql_fetch_array($result);
|
$fields = mysql_fetch_array($hResult);
|
||||||
|
|
||||||
echo html_frame_start(ucfirst($this->mode),"80%","",0);
|
echo html_frame_start(ucfirst($this->mode),"80%","",0);
|
||||||
echo "<table border=0 width='100%' cellspacing=0 cellpadding=2>\n";
|
echo "<table border=0 width='100%' cellspacing=0 cellpadding=2>\n";
|
||||||
@@ -153,8 +151,8 @@ class TableVE {
|
|||||||
for($i = 0; $i < $nfields; $i++)
|
for($i = 0; $i < $nfields; $i++)
|
||||||
{
|
{
|
||||||
global $testvar;
|
global $testvar;
|
||||||
$field = mysql_fetch_field($result, $i);
|
$field = mysql_fetch_field($hResult, $i);
|
||||||
$len = mysql_field_len($result, $i);
|
$len = mysql_field_len($hResult, $i);
|
||||||
|
|
||||||
if(ereg("^impl_(.+)$", $field->table, $arr))
|
if(ereg("^impl_(.+)$", $field->table, $arr))
|
||||||
{
|
{
|
||||||
@@ -175,14 +173,13 @@ class TableVE {
|
|||||||
|
|
||||||
function make_option_list($varname, $cvalue, $table, $idField, $nameField, $where = "")
|
function make_option_list($varname, $cvalue, $table, $idField, $nameField, $where = "")
|
||||||
{
|
{
|
||||||
|
$hResult = query_appdb("SELECT $idField, $nameField FROM $table $where ORDER BY $nameField");
|
||||||
$result = query_appdb("SELECT $idField, $nameField FROM $table $where ORDER BY $nameField");
|
if(!$hResult)
|
||||||
if(!$result)
|
|
||||||
return; // Oops
|
return; // Oops
|
||||||
|
|
||||||
echo "<select name='$varname'>\n";
|
echo "<select name='$varname'>\n";
|
||||||
echo "<option value=0>Choose ...</option>\n";
|
echo "<option value=0>Choose ...</option>\n";
|
||||||
while(list($id, $name) = mysql_fetch_row($result))
|
while(list($id, $name) = mysql_fetch_row($hResult))
|
||||||
{
|
{
|
||||||
if ($name == "NONAME")
|
if ($name == "NONAME")
|
||||||
continue;
|
continue;
|
||||||
@@ -190,7 +187,6 @@ class TableVE {
|
|||||||
echo "<option value=$id selected>$name\n";
|
echo "<option value=$id selected>$name\n";
|
||||||
else
|
else
|
||||||
echo "<option value=$id>$name\n";
|
echo "<option value=$id>$name\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
echo "</select>\n";
|
echo "</select>\n";
|
||||||
}
|
}
|
||||||
@@ -264,8 +260,6 @@ class TableVE {
|
|||||||
$this->entry_add_extra($field, $value);
|
$this->entry_add_extra($field, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function view_entry_output_field($field, $value, $len)
|
function view_entry_output_field($field, $value, $len)
|
||||||
{
|
{
|
||||||
if($len > 50)
|
if($len > 50)
|
||||||
@@ -293,7 +287,6 @@ class TableVE {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch($field->type)
|
switch($field->type)
|
||||||
{
|
{
|
||||||
case "string":
|
case "string":
|
||||||
@@ -341,7 +334,6 @@ class TableVE {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* required field for each table.
|
* required field for each table.
|
||||||
* When editing a query this field needs to be present in the query
|
* When editing a query this field needs to be present in the query
|
||||||
@@ -380,7 +372,6 @@ class TableVE {
|
|||||||
*/
|
*/
|
||||||
function update($vars)
|
function update($vars)
|
||||||
{
|
{
|
||||||
|
|
||||||
$tables = array();
|
$tables = array();
|
||||||
$fieldnames = array();
|
$fieldnames = array();
|
||||||
$num_entries = 0;
|
$num_entries = 0;
|
||||||
@@ -455,9 +446,6 @@ class TableVE {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_title_field($newTitleField)
|
function set_title_field($newTitleField)
|
||||||
@@ -474,7 +462,6 @@ class TableVE {
|
|||||||
{
|
{
|
||||||
$this->numberedTitles = 1;
|
$this->numberedTitles = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ class User {
|
|||||||
|
|
||||||
if($sQuery)
|
if($sQuery)
|
||||||
{
|
{
|
||||||
if($result = query_appdb($sQuery))
|
if($hResult = query_appdb($sQuery))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,31 +356,31 @@ class User {
|
|||||||
if(!$this->hasPriv("admin"))
|
if(!$this->hasPriv("admin"))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
$qstring = "SELECT count(*) as queued_apps FROM appFamily WHERE queued='true'";
|
$sQuery = "SELECT count(*) as queued_apps FROM appFamily WHERE queued='true'";
|
||||||
$result = query_appdb($qstring);
|
$hResult = query_appdb($sQuery);
|
||||||
$ob = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $ob->queued_apps;
|
return $oRow->queued_apps;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getQueuedVersionCount()
|
function getQueuedVersionCount()
|
||||||
{
|
{
|
||||||
if($this->hasPriv("admin"))
|
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
|
} else
|
||||||
{
|
{
|
||||||
/* find all queued versions of applications that the user is a super maintainer of */
|
/* 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'
|
WHERE queued='true' AND appMaintainers.superMaintainer ='1'
|
||||||
AND appVersion.appId = appMaintainers.appId
|
AND appVersion.appId = appMaintainers.appId
|
||||||
AND appMaintainers.userId ='".$this->iUserId."';";
|
AND appMaintainers.userId ='".$this->iUserId."';";
|
||||||
}
|
}
|
||||||
$result = query_appdb($qstring);
|
$hResult = query_appdb($sQuery);
|
||||||
$ob = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
|
|
||||||
/* we don't want to count the versions that are implicit in the applications */
|
/* we don't want to count the versions that are implicit in the applications */
|
||||||
/* that are in the queue */
|
/* 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()
|
function getQueuedAppDataCount()
|
||||||
{
|
{
|
||||||
$hResult = $this->getAppDataQuery(0, true, false);
|
$hResult = $this->getAppDataQuery(0, true, false);
|
||||||
$ob = mysql_fetch_object($hResult);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $ob->queued_appdata;
|
return $oRow->queued_appdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addPriv($sPriv)
|
function addPriv($sPriv)
|
||||||
@@ -582,20 +582,20 @@ class User {
|
|||||||
|
|
||||||
function getAllRejectedApps()
|
function getAllRejectedApps()
|
||||||
{
|
{
|
||||||
$result = query_appdb("SELECT appVersion.versionId, appFamily.appId
|
$hResult = query_appdb("SELECT appVersion.versionId, appFamily.appId
|
||||||
FROM appVersion, appFamily
|
FROM appVersion, appFamily
|
||||||
WHERE appFamily.appId = appVersion.appId
|
WHERE appFamily.appId = appVersion.appId
|
||||||
AND (appFamily.queued = 'rejected' OR appVersion.queued = 'rejected')
|
AND (appFamily.queued = 'rejected' OR appVersion.queued = 'rejected')
|
||||||
AND appVersion.submitterId = '".$this->iUserId."';");
|
AND appVersion.submitterId = '".$this->iUserId."';");
|
||||||
|
|
||||||
if(!$result || mysql_num_rows($result) == 0)
|
if(!$hResult || mysql_num_rows($hResult) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$retval = array();
|
$retval = array();
|
||||||
$c = 0;
|
$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++;
|
$c++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1110,9 +1110,9 @@ function get_notify_email_address_list($iAppId = null, $iVersionId = null)
|
|||||||
*/
|
*/
|
||||||
function get_number_of_users()
|
function get_number_of_users()
|
||||||
{
|
{
|
||||||
$result = query_appdb("SELECT count(*) as num_users FROM user_list;");
|
$hResult = query_appdb("SELECT count(*) as num_users FROM user_list;");
|
||||||
$row = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $row->num_users;
|
return $oRow->num_users;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1121,9 +1121,9 @@ function get_number_of_users()
|
|||||||
*/
|
*/
|
||||||
function get_active_users_within_days($days)
|
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);");
|
$hResult = query_appdb("SELECT count(*) as num_users FROM user_list WHERE stamp >= DATE_SUB(CURDATE(), interval $days day);");
|
||||||
$row = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $row->num_users;
|
return $oRow->num_users;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1146,12 +1146,12 @@ function get_inactive_users_pending_deletion()
|
|||||||
*/
|
*/
|
||||||
function user_exists($sEmail)
|
function user_exists($sEmail)
|
||||||
{
|
{
|
||||||
$result = query_appdb("SELECT userid FROM user_list WHERE email = '$sEmail'");
|
$hResult = query_appdb("SELECT userid FROM user_list WHERE email = '$sEmail'");
|
||||||
if(!$result || mysql_num_rows($result) != 1)
|
if(!$hResult || mysql_num_rows($hResult) != 1)
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $oRow->userid;
|
return $oRow->userid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,14 +119,14 @@ function make_bugzilla_version_list($varname, $cvalue)
|
|||||||
{
|
{
|
||||||
$table = BUGZILLA_DB.".versions";
|
$table = BUGZILLA_DB.".versions";
|
||||||
$where = "WHERE product_id=".BUGZILLA_PRODUCT_ID;
|
$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);
|
$hResult = query_bugzilladb($sQuery);
|
||||||
if(!$result) return;
|
if(!$hResult) return;
|
||||||
|
|
||||||
echo "<select name='$varname'>\n";
|
echo "<select name='$varname'>\n";
|
||||||
echo "<option value=\"\">Choose ...</option>\n";
|
echo "<option value=\"\">Choose ...</option>\n";
|
||||||
while(list($value) = mysql_fetch_row($result))
|
while(list($value) = mysql_fetch_row($hResult))
|
||||||
{
|
{
|
||||||
if($value == "unspecified")
|
if($value == "unspecified")
|
||||||
{
|
{
|
||||||
@@ -163,67 +163,67 @@ function make_maintainer_rating_list($varname, $cvalue)
|
|||||||
/* get the number of queued maintainers */
|
/* get the number of queued maintainers */
|
||||||
function getQueuedMaintainerCount()
|
function getQueuedMaintainerCount()
|
||||||
{
|
{
|
||||||
$qstring = "SELECT count(*) as queued_maintainers FROM appMaintainerQueue";
|
$sQuery = "SELECT count(*) as queued_maintainers FROM appMaintainerQueue";
|
||||||
$result = query_appdb($qstring);
|
$hResult = query_appdb($sQuery);
|
||||||
$ob = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $ob->queued_maintainers;
|
return $oRow->queued_maintainers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the total number of maintainers and applications in the appMaintainers table */
|
/* get the total number of maintainers and applications in the appMaintainers table */
|
||||||
function getMaintainerCount()
|
function getMaintainerCount()
|
||||||
{
|
{
|
||||||
$qstring = "SELECT count(*) as maintainers FROM appMaintainers";
|
$sQuery = "SELECT count(*) as maintainers FROM appMaintainers";
|
||||||
$result = query_appdb($qstring);
|
$hResult = query_appdb($sQuery);
|
||||||
$ob = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $ob->maintainers;
|
return $oRow->maintainers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the total number of vendors from the vendor table */
|
/* get the total number of vendors from the vendor table */
|
||||||
function getVendorCount()
|
function getVendorCount()
|
||||||
{
|
{
|
||||||
$qstring = "SELECT count(*) as vendors FROM vendor";
|
$sQuery = "SELECT count(*) as vendors FROM vendor";
|
||||||
$result = query_appdb($qstring);
|
$hResult = query_appdb($sQuery);
|
||||||
$ob = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $ob->vendors;
|
return $oRow->vendors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the number of users in the database */
|
/* Get the number of users in the database */
|
||||||
function getNumberOfComments()
|
function getNumberOfComments()
|
||||||
{
|
{
|
||||||
$result = query_appdb("SELECT count(*) as num_comments FROM appComments;");
|
$hResult = query_appdb("SELECT count(*) as num_comments FROM appComments;");
|
||||||
$row = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $row->num_comments;
|
return $oRow->num_comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the number of versions in the database */
|
/* Get the number of versions in the database */
|
||||||
function getNumberOfVersions()
|
function getNumberOfVersions()
|
||||||
{
|
{
|
||||||
$result = query_appdb("SELECT count(versionId) as num_versions FROM appVersion WHERE versionName != 'NONAME';");
|
$hResult = query_appdb("SELECT count(versionId) as num_versions FROM appVersion WHERE versionName != 'NONAME';");
|
||||||
$row = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $row->num_versions;
|
return $oRow->num_versions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the number of maintainers in the database */
|
/* Get the number of maintainers in the database */
|
||||||
function getNumberOfMaintainers()
|
function getNumberOfMaintainers()
|
||||||
{
|
{
|
||||||
$result = query_appdb("SELECT DISTINCT userId FROM appMaintainers;");
|
$hResult = query_appdb("SELECT DISTINCT userId FROM appMaintainers;");
|
||||||
return mysql_num_rows($result);
|
return mysql_num_rows($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the number of app familes in the database */
|
/* Get the number of app familes in the database */
|
||||||
function getNumberOfAppFamilies()
|
function getNumberOfAppFamilies()
|
||||||
{
|
{
|
||||||
$result = query_appdb("SELECT count(*) as num_appfamilies FROM appFamily;");
|
$hResult = query_appdb("SELECT count(*) as num_appfamilies FROM appFamily;");
|
||||||
$row = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $row->num_appfamilies;
|
return $oRow->num_appfamilies;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the number of images in the database */
|
/* Get the number of images in the database */
|
||||||
function getNumberOfImages()
|
function getNumberOfImages()
|
||||||
{
|
{
|
||||||
$result = query_appdb("SELECT count(*) as num_images FROM appData WHERE type='image';");
|
$hResult = query_appdb("SELECT count(*) as num_images FROM appData WHERE type='image';");
|
||||||
$row = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $row->num_images;
|
return $oRow->num_images;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the number of queued bug links in the database */
|
/* 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';");
|
$hResult = query_appdb("SELECT count(*) as num_buglinks FROM buglinks WHERE queued='true';");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$row = mysql_fetch_object($hResult);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $row->num_buglinks;
|
return $oRow->num_buglinks;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -244,8 +244,8 @@ function getNumberOfBugLinks()
|
|||||||
$hResult = query_appdb("SELECT count(*) as num_buglinks FROM buglinks;");
|
$hResult = query_appdb("SELECT count(*) as num_buglinks FROM buglinks;");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$row = mysql_fetch_object($hResult);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $row->num_buglinks;
|
return $oRow->num_buglinks;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -521,22 +521,22 @@ function outputSearchTableForhResult($search_words, $hResult)
|
|||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
$c = 0;
|
$c = 0;
|
||||||
while($ob = mysql_fetch_object($hResult))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
//skip if a NONAME
|
//skip if a NONAME
|
||||||
if ($ob->appName == "NONAME") { continue; }
|
if ($oRow->appName == "NONAME") { continue; }
|
||||||
|
|
||||||
//set row color
|
//set row color
|
||||||
$bgcolor = ($c % 2) ? 'color0' : 'color1';
|
$bgcolor = ($c % 2) ? 'color0' : 'color1';
|
||||||
|
|
||||||
//count versions
|
//count versions
|
||||||
$query = query_appdb("SELECT count(*) as versions FROM appVersion WHERE appId = $ob->appId AND versionName != 'NONAME' and queued = 'false'");
|
$hResult2 = query_appdb("SELECT count(*) as versions FROM appVersion WHERE appId = $oRow->appId AND versionName != 'NONAME' and queued = 'false'");
|
||||||
$y = mysql_fetch_object($query);
|
$y = mysql_fetch_object($hResult2);
|
||||||
|
|
||||||
//display row
|
//display row
|
||||||
echo "<tr class=$bgcolor>\n";
|
echo "<tr class=$bgcolor>\n";
|
||||||
echo " <td>".html_ahref($ob->appName,BASE."appview.php?appId=$ob->appId")."</td>\n";
|
echo " <td>".html_ahref($oRow->appName,BASE."appview.php?appId=$oRow->appId")."</td>\n";
|
||||||
echo " <td>".trim_description($ob->description)."</td>\n";
|
echo " <td>".trim_description($oRow->description)."</td>\n";
|
||||||
echo " <td>$y->versions </td>\n";
|
echo " <td>$y->versions </td>\n";
|
||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
|
|||||||
@@ -142,8 +142,8 @@ function getNumberOfVendors()
|
|||||||
$hResult = query_appdb("SELECT count(*) as num_vendors FROM vendor");
|
$hResult = query_appdb("SELECT count(*) as num_vendors FROM vendor");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$row = mysql_fetch_object($hResult);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
return $row->num_vendors;
|
return $oRow->num_vendors;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ function vote_count($appId, $userId = null)
|
|||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$result = query_appdb("SELECT * FROM appVotes WHERE appId = $appId AND userId = $userId");
|
$hResult = query_appdb("SELECT * FROM appVotes WHERE appId = $appId AND userId = $userId");
|
||||||
return mysql_num_rows($result);
|
return mysql_num_rows($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -34,8 +34,8 @@ function vote_count_user_total($userId = null)
|
|||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$result = query_appdb("SELECT * FROM appVotes WHERE userId = $userId");
|
$hResult = query_appdb("SELECT * FROM appVotes WHERE userId = $userId");
|
||||||
return mysql_num_rows($result);
|
return mysql_num_rows($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -44,8 +44,8 @@ function vote_count_user_total($userId = null)
|
|||||||
*/
|
*/
|
||||||
function vote_count_app_total($appId)
|
function vote_count_app_total($appId)
|
||||||
{
|
{
|
||||||
$result = query_appdb("SELECT * FROM appVotes WHERE appId = $appId");
|
$hResult = query_appdb("SELECT * FROM appVotes WHERE appId = $appId");
|
||||||
return mysql_num_rows($result);
|
return mysql_num_rows($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -98,13 +98,13 @@ function vote_get_user_votes($userId = null)
|
|||||||
if(!$userId)
|
if(!$userId)
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
$result = query_appdb("SELECT * FROM appVotes WHERE userId = $userId");
|
$hResult = query_appdb("SELECT * FROM appVotes WHERE userId = $userId");
|
||||||
if(!$result)
|
if(!$hResult)
|
||||||
return array();
|
return array();
|
||||||
|
|
||||||
$obs = array();
|
$obs = array();
|
||||||
while($ob = mysql_fetch_object($result))
|
while($oRow = mysql_fetch_object($hResult))
|
||||||
$obs[$ob->slot] = $ob;
|
$obs[$oRow->slot] = $oRow;
|
||||||
return $obs;
|
return $obs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,11 +63,11 @@ If you have screenshots or links to contribute, please browse the database and u
|
|||||||
"FROM appVotes, appFamily ".
|
"FROM appVotes, appFamily ".
|
||||||
"WHERE appVotes.appId = appFamily.appId ".
|
"WHERE appVotes.appId = appFamily.appId ".
|
||||||
"GROUP BY appId ORDER BY count DESC LIMIT 1";
|
"GROUP BY appId ORDER BY count DESC LIMIT 1";
|
||||||
$result = query_appdb($voteQuery);
|
$hResult = query_appdb($voteQuery);
|
||||||
$ob = mysql_fetch_object($result);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
|
|
||||||
$voteAppId = $ob->appId;
|
$voteAppId = $oRow->appId;
|
||||||
$voteAppName = $ob->appName;
|
$voteAppName = $oRow->appName;
|
||||||
|
|
||||||
/* don't mention the top application if there are no votes yet */
|
/* don't mention the top application if there are no votes yet */
|
||||||
if($voteAppId != "")
|
if($voteAppId != "")
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ if($_SESSION['current']->hasPriv("admin") &&
|
|||||||
function build_prefs_list()
|
function build_prefs_list()
|
||||||
{
|
{
|
||||||
global $oUser;
|
global $oUser;
|
||||||
$result = query_appdb("SELECT * FROM prefs_list ORDER BY id");
|
$hResult = query_appdb("SELECT * FROM prefs_list ORDER BY id");
|
||||||
while($result && $r = mysql_fetch_object($result))
|
while($hResult && $r = mysql_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
//skip admin options
|
//skip admin options
|
||||||
//TODO: add a field to prefs_list to flag the user level for the pref
|
//TODO: add a field to prefs_list to flag the user level for the pref
|
||||||
|
|||||||
@@ -67,11 +67,11 @@ 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 = query_appdb($catQuery);
|
$hResult = query_appdb($catQuery);
|
||||||
|
|
||||||
if($result)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$row = mysql_fetch_object($result);
|
$row = mysql_fetch_object($hResult);
|
||||||
$catParent = $row->catParent;
|
$catParent = $row->catParent;
|
||||||
|
|
||||||
array_push($cat_array, "$currentCatId");
|
array_push($cat_array, "$currentCatId");
|
||||||
@@ -168,7 +168,7 @@ if(strcasecmp($categoryId, "any") == 0)
|
|||||||
ORDER BY count DESC LIMIT $topNumber";
|
ORDER BY count DESC LIMIT $topNumber";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($result = query_appdb($sVoteQuery))
|
if($hResult = query_appdb($sVoteQuery))
|
||||||
{
|
{
|
||||||
echo html_frame_start("", "90%", '', 0);
|
echo html_frame_start("", "90%", '', 0);
|
||||||
echo html_table_begin("width='100%' align=center");
|
echo html_table_begin("width='100%' align=center");
|
||||||
@@ -176,7 +176,7 @@ if($result = query_appdb($sVoteQuery))
|
|||||||
echo "<td><font color=white>Votes</font></td></tr>\n";
|
echo "<td><font color=white>Votes</font></td></tr>\n";
|
||||||
|
|
||||||
$c = 1;
|
$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 = "<a href='appview.php?appId=$row->appId'>$row->appName</a>";
|
$link = "<a href='appview.php?appId=$row->appId'>$row->appName</a>";
|
||||||
|
|||||||
Reference in New Issue
Block a user