query: $query

",green); } if (mysql_query($query)) { //success $email = getNotifyEmailAddressList($appId, $versionId); if($email) { $fullAppName = "Application: ".lookupAppName($appId)." Version: ".lookupVersionName($appId, $versionId); $ms .= APPDB_ROOT."screenshots.php?appId=$appId&versionId=$versionId"."\n"; $ms .= "\n"; $ms .= ($_SESSION['current']->username ? $_SESSION['current']->username : "Anonymous")." added screenshot ".$screenshot_desc." to ".$fullAppName."\n"; $ms .= "\n"; $ms .= STANDARD_NOTIFY_FOOTER; mail(stripslashes($email), "[AppDB] ".$fullAppName ,$ms); } else { $email = "no one"; } addmsg("mesage sent to: ".$email, green); addmsg("The image was successfully added into the database", "green"); redirect(apidb_fullurl("screenshots.php?appId=$appId&versionId=$versionId")); } else { //error $statusMessage = "

Database Error!
".mysql_error()."

\n"; addmsg($statusMessage, "red"); } } else { if($cmd == "delete") { $result = mysql_query("DELETE FROM appData WHERE id = $imageId"); if($result) { $email = getNotifyEmailAddressList($appId, $versionId); if($email) { $fullAppName = "Application: ".lookupAppName($appId)." Version: ".lookupVersionName($appId, $versionId); $ms .= APPDB_ROOT."screenshots.php?appId=$appId&versionId=$versionId"."\n"; $ms .= "\n"; $ms .= ($_SESSION['current']->username ? $_SESSION['current']->username : "Anonymous")." deleted screenshot from ".$fullAppName."\n"; $ms .= "\n"; $ms .= STANDARD_NOTIFY_FOOTER; mail(stripslashes($email), "[AppDB] ".$fullAppName ,$ms); } else { $email = "no one"; } addmsg("mesage sent to: ".$email, green); addmsg("Image deleted", "green"); redirect(apidb_fullurl("screenshots.php?appId=$appId&versionId=$versionId")); } else { addmsg("Failed to delete image: ".mysql_error(), "red"); redirect(apidb_fullurl("screenshots.php?appId=$appId&versionId=$versionId")); } } } } exit; } $result = mysql_query("SELECT * FROM appData WHERE type = 'image' AND appId = $appId AND versionId = $versionId"); if((!$result || !mysql_num_rows($result)) && (!havepriv("admin") && !isMaintainer($appId, $versionId))) { errorpage("No Screenshots Found","There are no screenshots currently linked to this application."); exit; } else { apidb_header("Screenshots"); if($result && mysql_num_rows($result)) { echo html_frame_start("Screenshot Gallery",500); // display thumbnails $c = 1; echo "
\n"; while($ob = mysql_fetch_object($result)) { //set img tag $imgSRC = ''.$ob->description.''; //get image size $size = getimagesize("data/screenshots/".$ob->url); //generate random tag for popup window $randName = generate_passwd(5); //set image link based on user pref $img = ''.$imgSRC.''; if (loggedin()) { if ($_SESSION['current']->getpref("window:screenshot") == "no") { $img = ''.$imgSRC.''; } } //display image echo "\n"; //end row if counter of 3 if ($c % 3 == 0) { echo "\n"; } $c++; } echo "
\n"; echo html_frame_start(substr(stripslashes($ob->description),0,20),128,"",0); echo $img; //show admin delete link if(loggedin() && (havepriv("admin") || isMaintainer($appId, $versionId))) { echo ""; } echo html_frame_end(" "); echo "

\n"; echo html_frame_end("Click thumbnail to view image in new window."); } if(havepriv("admin") || isMaintainer($appId, $versionId)) { //image upload box echo '
',"\n"; echo html_frame_start("Upload Screenshot","400","",0); echo '',"\n"; echo '',"\n"; echo '',"\n"; echo '',"\n"; echo '
Image
Description
',"\n"; echo html_frame_end(); echo '',"\n"; echo '',"\n"; echo '',"\n"; echo '
',"\n"; } echo html_back_link(1); apidb_footer(); } ?>