Rename appData type 'image' to 'screenshot'

This commit is contained in:
Alexander Nicolaysen Sørnes
2007-03-10 23:31:47 +00:00
committed by WineHQ
parent ebb47fedc7
commit 5f6cc94def
4 changed files with 14 additions and 22 deletions

View File

@@ -106,10 +106,10 @@ if (!$aClean['iId'])
echo '<td><textarea name="sDescription" rows=10 cols=35>'.stripslashes($obj_row->description).'</textarea></td></tr>',"\n"; echo '<td><textarea name="sDescription" rows=10 cols=35>'.stripslashes($obj_row->description).'</textarea></td></tr>',"\n";
//data //data
if($obj_row->type == "image") if($obj_row->type == "screenshot")
{ {
$oScreenshot = new Screenshot($obj_row->id); $oScreenshot = new Screenshot($obj_row->id);
echo '<tr valign=top><td class=color0><b>Submited image</b></td>',"\n"; echo '<tr valign=top><td class=color0><b>Submited screenshot</b></td>',"\n";
echo '<td>'; echo '<td>';
$imgSRC = '<img width="'.$oScreenshot->get_thumbnail_width().'" height="'.$oScreenshot->get_thumbnail_height().'" src="../appimage.php?bQueued=true&iId='.$obj_row->id.'" />'; $imgSRC = '<img width="'.$oScreenshot->get_thumbnail_width().'" height="'.$oScreenshot->get_thumbnail_height().'" src="../appimage.php?bQueued=true&iId='.$obj_row->id.'" />';
// generate random tag for popup window // generate random tag for popup window
@@ -152,7 +152,7 @@ if (!$aClean['iId'])
$statusMessage = ""; $statusMessage = "";
$goodtogo = 0; $goodtogo = 0;
if($obj_row->type == "image") if($obj_row->type == "screenshot")
{ {
$oScreenshot = new Screenshot($obj_row->id); $oScreenshot = new Screenshot($obj_row->id);
$oScreenshot->unQueue(); $oScreenshot->unQueue();
@@ -186,7 +186,7 @@ if (!$aClean['iId'])
util_redirect_and_exit(apidb_fullurl("admin/adminAppDataQueue.php")); util_redirect_and_exit(apidb_fullurl("admin/adminAppDataQueue.php"));
} elseif ($aClean['sReject']) } elseif ($aClean['sReject'])
{ {
if($obj_row->type == "image") if($obj_row->type == "screenshot")
{ {
$oScreenshot = new Screenshot($obj_row->id); $oScreenshot = new Screenshot($obj_row->id);
$oScreenshot->delete(); $oScreenshot->delete();

View File

@@ -35,7 +35,7 @@ apidb_header("Screenshots");
// regenerate all screenshots // regenerate all screenshots
if($aClean['sRegenerate']) if($aClean['sRegenerate'])
{ {
$sQuery = "SELECT id FROM appData WHERE type = 'image'"; $sQuery = "SELECT id FROM appData WHERE type = 'screenshot'";
$hResult = query_parameters($sQuery); $hResult = query_parameters($sQuery);
while($oRow = mysql_fetch_object($hResult)) while($oRow = mysql_fetch_object($hResult))
{ {
@@ -64,7 +64,7 @@ if($aClean['iPage'])
$currentPage = $aClean['iPage']; $currentPage = $aClean['iPage'];
$ItemsPerPage = min($ItemsPerPage,100); $ItemsPerPage = min($ItemsPerPage,100);
$totalPages = ceil(getNumberOfImages()/$ItemsPerPage); $totalPages = ceil(appData::objectGetEntriesCount("all", "screenshot")/$ItemsPerPage);
$currentPage = min($currentPage,$totalPages); $currentPage = min($currentPage,$totalPages);
$offset = (($currentPage-1) * $ItemsPerPage); $offset = (($currentPage-1) * $ItemsPerPage);
@@ -100,7 +100,7 @@ echo "</center>";
/* query for all of the Screenshots in assending order */ /* query for all of the Screenshots in assending order */
$Ids = query_parameters("SELECT * from appData $Ids = query_parameters("SELECT * from appData
WHERE type = 'image' WHERE type = 'screenshot'
ORDER BY id ASC LIMIT ?, ?", $offset, $ItemsPerPage); ORDER BY id ASC LIMIT ?, ?", $offset, $ItemsPerPage);
$c = 1; $c = 1;
echo "<div align=center><table><tr>\n"; echo "<div align=center><table><tr>\n";

View File

@@ -36,7 +36,7 @@ class Screenshot {
FROM appData, appVersion FROM appData, appVersion
WHERE appData.versionId = appVersion.versionId WHERE appData.versionId = appVersion.versionId
AND id = '?' AND id = '?'
AND type = 'image'", $iScreenshotId); AND type = 'screenshot'", $iScreenshotId);
if($hResult) if($hResult)
{ {
$oRow = mysql_fetch_object($hResult); $oRow = mysql_fetch_object($hResult);
@@ -73,7 +73,7 @@ class Screenshot {
$hResult = query_parameters("INSERT INTO appData (versionId, type, description, queued, submitterId) ". $hResult = query_parameters("INSERT INTO appData (versionId, type, description, queued, submitterId) ".
"VALUES('?', '?', '?', '?', '?')", "VALUES('?', '?', '?', '?', '?')",
$iVersionId, "image", $sDescription, $this->bQueued?"true":"false", $iVersionId, "screenshot", $sDescription, $this->bQueued?"true":"false",
$_SESSION['current']->iUserId); $_SESSION['current']->iUserId);
if($hResult) if($hResult)
{ {
@@ -190,7 +190,7 @@ class Screenshot {
*/ */
function setDescription($sDescription) function setDescription($sDescription)
{ {
if($hResult = query_parameters("UPDATE id SET description = '?' WHERE id = '?' AND type = 'image'", if($hResult = query_parameters("UPDATE id SET description = '?' WHERE id = '?' AND type = 'screenshot'",
$sDescription, $this->iScreenshotId)) $sDescription, $this->iScreenshotId))
$this->sDescription = $sDescription; $this->sDescription = $sDescription;
} }
@@ -392,7 +392,7 @@ class Screenshot {
FROM appData, appVersion FROM appData, appVersion
WHERE appData.versionId = appVersion.versionId WHERE appData.versionId = appVersion.versionId
AND appVersion.appId = '?' AND appVersion.appId = '?'
AND type = 'image' AND type = 'screenshot'
AND appData.queued = 'false' AND appData.queued = 'false'
ORDER BY rand", $iAppId); ORDER BY rand", $iAppId);
} else if ($iVersionId) // we want a random screenshot for this version } else if ($iVersionId) // we want a random screenshot for this version
@@ -400,7 +400,7 @@ class Screenshot {
$hResult = query_parameters("SELECT id, description, RAND() AS rand $hResult = query_parameters("SELECT id, description, RAND() AS rand
FROM appData FROM appData
WHERE versionId = '?' WHERE versionId = '?'
AND type = 'image' AND type = 'screenshot'
AND queued = 'false' AND queued = 'false'
ORDER BY rand", $iVersionId); ORDER BY rand", $iVersionId);
} }
@@ -457,7 +457,7 @@ class Screenshot {
$hResult = query_parameters("SELECT appData.*, appVersion.appId as appId $hResult = query_parameters("SELECT appData.*, appVersion.appId as appId
FROM appData, appVersion FROM appData, appVersion
WHERE appVersion.versionId = appData.versionId WHERE appVersion.versionId = appData.versionId
AND type = 'image' AND type = 'screenshot'
AND appVersion.appId = '?' AND appVersion.appId = '?'
AND appData.queued = '?'", $iAppId, $bQueued); AND appData.queued = '?'", $iAppId, $bQueued);
} }
@@ -469,7 +469,7 @@ class Screenshot {
$hResult = query_parameters("SELECT appData.*, appVersion.appId as appId $hResult = query_parameters("SELECT appData.*, appVersion.appId as appId
FROM appData, appVersion FROM appData, appVersion
WHERE appVersion.versionId = appData.versionId WHERE appVersion.versionId = appData.versionId
AND type = 'image' AND type = 'screenshot'
AND appData.versionId = '?' AND appData.versionId = '?'
AND appData.queued = '?'", $iVersionId, $bQueued); AND appData.queued = '?'", $iVersionId, $bQueued);
} else } else

View File

@@ -221,14 +221,6 @@ function getNumberOfAppFamilies()
return $oRow->num_appfamilies; return $oRow->num_appfamilies;
} }
/* Get the number of images in the database */
function getNumberOfImages()
{
$hResult = query_parameters("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 */ /* Get the number of queued bug links in the database */
function getNumberOfQueuedBugLinks() function getNumberOfQueuedBugLinks()
{ {