include("path.php"); require(BASE."include/"."incl.php"); global $current; /*========================================================================= * * this script expects appId and versionId as arguments * * OR * * cmd and imageId */ if($cmd) { if(havepriv("admin") || 1) //FIXME should check ownsApp() again { if($cmd == "delete") { $result = mysql_query("DELETE FROM appData WHERE id = $imageId"); if($result) addmsg("Image deleted", "green"); else addmsg("Failed to delete image: ".mysql_error(), "red"); redirectref(); exit; } } exit; } $result = mysql_query("SELECT * FROM appData WHERE type = 'image' AND appId = $appId AND versionId = $versionId"); if(!$result || !mysql_num_rows($result)) { errorpage("No Screenshots Found","There are no screenshots currently linked to this application."); exit; } else { apidb_header("Screenshots"); echo html_frame_start("Screenshot Gallery",500); // display thumbnails $c = 1; echo "
| \n"; echo html_frame_start(substr(stripslashes($ob->description),0,20),128,"",0); echo $img; //show admin delete link if(loggedin() && (havepriv("admin") || $current->ownsApp($appId))) { echo ""; } echo html_frame_end(" "); echo " | \n"; //end row if counter of 3 if ($c % 3 == 0) { echo "