2004-12-11 22:33:01 +00:00
|
|
|
<?php
|
2004-12-11 03:25:13 +00:00
|
|
|
/**********************************/
|
|
|
|
|
/* code to display an application */
|
|
|
|
|
/**********************************/
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
/**
|
|
|
|
|
* APPLICATION ENVIRONMENT
|
2004-03-15 16:22:00 +00:00
|
|
|
*/
|
|
|
|
|
include("path.php");
|
|
|
|
|
require(BASE."include/"."incl.php");
|
|
|
|
|
require(BASE."include/"."application.php");
|
|
|
|
|
require(BASE."include/"."comments.php");
|
|
|
|
|
require(BASE."include/"."appdb.php");
|
|
|
|
|
|
|
|
|
|
require(BASE."include/"."vote.php");
|
|
|
|
|
require(BASE."include/"."rating.php");
|
|
|
|
|
require(BASE."include/"."category.php");
|
|
|
|
|
|
2004-11-09 22:41:18 +00:00
|
|
|
require(BASE."include/"."maintainer.php");
|
|
|
|
|
|
2004-03-15 16:22:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// NOTE: app Owners will see this menu too, make sure we don't show admin-only options
|
|
|
|
|
function admin_menu()
|
|
|
|
|
{
|
|
|
|
|
global $apidb_root;
|
|
|
|
|
|
|
|
|
|
$m = new htmlmenu("Admin");
|
2004-12-18 01:51:56 +00:00
|
|
|
if($_REQUEST['versionId']) {
|
2004-12-11 03:25:13 +00:00
|
|
|
$m->add("Add Note", $apidb_root."admin/addAppNote.php?appId=$appId&versionId=".$_REQUEST['versionId']);
|
2004-12-10 00:18:01 +00:00
|
|
|
$m->addmisc(" ");
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
$m->add("Edit Version", $apidb_root."admin/editAppVersion.php?appId=$appId&versionId=".$_REQUEST['versionId']);
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
$url = $apidb_root."admin/deleteAny.php?what=appVersion&versionId=".$_REQUEST['versionId']."&confirmed=yes";
|
2004-12-10 00:18:01 +00:00
|
|
|
$m->add("Delete Version", "javascript:deleteURL(\"Are you sure?\", \"".$url."\")");
|
|
|
|
|
} else
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2004-12-11 03:25:13 +00:00
|
|
|
$m->add("Add Version", $apidb_root."admin/addAppVersion.php?appId=".$_REQUEST['appId']);
|
2004-12-10 00:18:01 +00:00
|
|
|
$m->addmisc(" ");
|
2004-12-11 03:25:13 +00:00
|
|
|
|
|
|
|
|
$m->add("Edit App", $apidb_root."admin/editAppFamily.php?appId=".$_REQUEST['appId']);
|
|
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
// global admin options
|
|
|
|
|
if(havepriv("admin"))
|
|
|
|
|
{
|
2004-12-11 03:25:13 +00:00
|
|
|
$url = $apidb_root."admin/deleteAny.php?what=appFamily&appId=".$_REQUEST['appId']."&confirmed=yes";
|
2004-12-10 00:18:01 +00:00
|
|
|
$m->add("Delete App", "javascript:deleteURL(\"Are you sure?\", \"".$url."\")");
|
|
|
|
|
$m->addmisc(" ");
|
2004-12-11 03:25:13 +00:00
|
|
|
$m->add("Edit Owners", $apidb_root."admin/editAppOwners.php?appId=".$_REQUEST['appId']);
|
|
|
|
|
$m->add("Edit Bundle", $apidb_root."admin/editBundle.php?bundleId=".$_REQUEST['appId']);
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$m->done();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
/**
|
|
|
|
|
* Get a random image for a particular version of an app.
|
|
|
|
|
* If the version is not set, get a random app image
|
|
|
|
|
*/
|
|
|
|
|
function get_screenshot_img($appId, $versionId="")
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
|
|
|
|
global $apidb_root;
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
if($versionId)
|
|
|
|
|
{
|
|
|
|
|
$result = mysql_query("SELECT *, RAND() AS rand FROM appData WHERE appId = $appId AND versionId = $versionId AND type = 'image' ORDER BY rand");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$result = mysql_query("SELECT *, RAND() AS rand FROM appData WHERE appId = $appId AND type = 'image' ORDER BY rand");
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
|
|
|
|
if(!$result || !mysql_num_rows($result))
|
|
|
|
|
{
|
2004-12-15 00:14:04 +00:00
|
|
|
$imgFile = "<img src='".$apidb_root."images/no_screenshot.gif' alt='No Screenshot' />";
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$ob = mysql_fetch_object($result);
|
2004-11-17 23:00:01 +00:00
|
|
|
$imgFile = "<img src='appimage.php?imageId=$ob->id&width=128&height=128' ".
|
2004-12-15 00:14:04 +00:00
|
|
|
"alt='$ob->description' />";
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$img = html_frame_start("",'128','',2);
|
2004-12-19 17:40:53 +00:00
|
|
|
if($versionId || mysql_num_rows($result))
|
|
|
|
|
$img .= "<a href='screenshots.php?appId=$appId&versionId=$versionId'>$imgFile</a>";
|
|
|
|
|
else // no link for adding app screenshot as screenshots are linked to versions
|
|
|
|
|
$img .= $imgFile;
|
2004-12-11 03:25:13 +00:00
|
|
|
$img .= html_frame_end()."<br />";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
|
|
|
|
return $img;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
/**
|
|
|
|
|
* TODO: what does it do ?
|
|
|
|
|
*/
|
2004-03-15 16:22:00 +00:00
|
|
|
function display_catpath($catId)
|
|
|
|
|
{
|
|
|
|
|
$cat = new Category($catId);
|
|
|
|
|
|
|
|
|
|
$catFullPath = make_cat_path($cat->getCategoryPath());
|
|
|
|
|
echo html_frame_start("",'98%','',2);
|
|
|
|
|
echo "<p><b>Category: ". $catFullPath ."</b><br>\n";
|
|
|
|
|
echo html_frame_end();
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* display the SUB apps that belong to this app
|
|
|
|
|
*/
|
2004-03-15 16:22:00 +00:00
|
|
|
function display_bundle($appId)
|
|
|
|
|
{
|
|
|
|
|
$result = mysql_query("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ".
|
2004-12-11 03:25:13 +00:00
|
|
|
"WHERE bundleId = $appId AND appBundle.appId = appFamily.appId");
|
2004-03-15 16:22:00 +00:00
|
|
|
if(!$result || mysql_num_rows($result) == 0)
|
2004-12-11 03:25:13 +00:00
|
|
|
{
|
|
|
|
|
return; // do nothing
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
|
|
|
|
echo html_frame_start("","98%","",0);
|
|
|
|
|
echo "<table width='100%' border=0 cellpadding=3 cellspacing=1>\n\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr class=color4>\n";
|
|
|
|
|
echo " <td><font color=white>Application Name</font></td>\n";
|
|
|
|
|
echo " <td><font color=white>Description</font></td>\n";
|
|
|
|
|
echo "</tr>\n\n";
|
|
|
|
|
|
|
|
|
|
$c = 0;
|
2004-12-11 03:25:13 +00:00
|
|
|
while($ob = mysql_fetch_object($result)) {
|
|
|
|
|
//set row color
|
|
|
|
|
$bgcolor = ($c % 2 == 0) ? "color0" : "color1";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
//format desc
|
|
|
|
|
$desc = substr(stripslashes($ob->description),0,50);
|
|
|
|
|
if(strlen($desc) == 50) $desc .= " ...";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
//display row
|
|
|
|
|
echo "<tr class=$bgcolor>\n";
|
|
|
|
|
echo " <td><a href='appview.php?appId=$ob->appId'>".stripslashes($ob->appName)."</a></td>\n";
|
|
|
|
|
echo " <td>$desc </td>\n";
|
|
|
|
|
echo "</tr>\n\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
$c++;
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
|
|
|
|
echo "</table>\n\n";
|
|
|
|
|
echo html_frame_end();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
/**
|
|
|
|
|
* display the notes for the app
|
|
|
|
|
*/
|
2004-03-15 16:22:00 +00:00
|
|
|
function display_notes($appId, $versionId = 0)
|
|
|
|
|
{
|
|
|
|
|
$result = mysql_query("SELECT noteId,noteTitle FROM appNotes ".
|
2004-12-11 03:25:13 +00:00
|
|
|
"WHERE appId = $appId AND versionId = $versionId");
|
|
|
|
|
|
2004-03-15 16:22:00 +00:00
|
|
|
if(!$result || mysql_num_rows($result) == 0)
|
|
|
|
|
{
|
|
|
|
|
// do nothing
|
2004-12-10 00:18:01 +00:00
|
|
|
return;
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "<tr class=color1><td valign=top align=right> <b>Notes</b></td><td>\n";
|
|
|
|
|
|
|
|
|
|
$c = 1;
|
|
|
|
|
while($ob = mysql_fetch_object($result))
|
2004-12-11 03:25:13 +00:00
|
|
|
{
|
|
|
|
|
// skip if NONAME
|
|
|
|
|
if ($ob->noteTitle == "NONAME" || $ob->noteTitle == "WARNING" || $ob->noteTitle == "HOWTO") { continue; }
|
|
|
|
|
|
|
|
|
|
// set link for version
|
|
|
|
|
if ($versionId != 0)
|
|
|
|
|
{
|
|
|
|
|
$versionLink = "&versionId=$versionId";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// display row
|
2004-12-19 19:30:27 +00:00
|
|
|
if (havepriv("admin") || $_SESSION['current']->is_maintainer($appId,$versionId) )
|
2004-12-10 00:18:01 +00:00
|
|
|
echo " <a href='admin/editAppNote.php?noteId=".$ob->noteId."&appId=$appId".$versionLink."'> $c. ".substr(stripslashes($ob->noteTitle),0,30)."</a><br>\n";
|
|
|
|
|
else
|
|
|
|
|
echo " <a href='noteview.php?noteId=".$ob->noteId."&appId=$appId".$versionLink."'> $c. ".substr(stripslashes($ob->noteTitle),0,30)."</a><br>\n";
|
2004-12-11 03:25:13 +00:00
|
|
|
$c++;
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
|
|
|
|
echo "</td></tr>\n";
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
/**
|
|
|
|
|
* display the versions
|
|
|
|
|
*/
|
2004-03-15 16:22:00 +00:00
|
|
|
function display_versions($appId, $versions)
|
|
|
|
|
{
|
2004-12-11 03:25:13 +00:00
|
|
|
if ($versions)
|
|
|
|
|
{
|
|
|
|
|
echo html_frame_start("","98%","",0);
|
|
|
|
|
echo "<table width='100%' border=0 cellpadding=3 cellspacing=1>\n\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr class=color4>\n";
|
|
|
|
|
echo " <td width=80><font color=white>Version</font></td>\n";
|
|
|
|
|
echo " <td><font color=white>Description</font></td>\n";
|
|
|
|
|
echo " <td width=80><font color=white class=small>Rating With Windows</font></td>\n";
|
|
|
|
|
echo " <td width=80><font color=white class=small>Rating Without Windows</font></td>\n";
|
|
|
|
|
echo " <td width=40><font color=white class=small>Comments</font></td>\n";
|
|
|
|
|
echo "</tr>\n\n";
|
|
|
|
|
|
|
|
|
|
$c = 0;
|
|
|
|
|
while(list($idx, $ver) = each($versions))
|
|
|
|
|
{
|
2004-12-10 00:18:01 +00:00
|
|
|
//set row color
|
|
|
|
|
$bgcolor = ($c % 2 == 0) ? "color0" : "color1";
|
|
|
|
|
|
|
|
|
|
//format desc
|
|
|
|
|
$desc = substr(stripslashes($ver->description),0,75);
|
|
|
|
|
if(strlen($desc) == 75)
|
2004-12-11 03:25:13 +00:00
|
|
|
$desc .= " ...";
|
|
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
//get ratings
|
|
|
|
|
$r_win = rating_stars_for_version($ver->versionId, "windows");
|
|
|
|
|
$r_fake = rating_stars_for_version($ver->versionId, "fake");
|
2004-12-11 03:25:13 +00:00
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
//count comments
|
|
|
|
|
$r_count = count_comments($appId,$ver->versionId);
|
2004-12-11 03:25:13 +00:00
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
//display row
|
|
|
|
|
echo "<tr class=$bgcolor>\n";
|
|
|
|
|
echo " <td><a href='appview.php?appId=$appId&versionId=$ver->versionId'>".$ver->versionName."</a></td>\n";
|
|
|
|
|
echo " <td>$desc </td>\n";
|
|
|
|
|
echo " <td align=center>$r_win</td>\n";
|
|
|
|
|
echo " <td align=center>$r_fake</td>\n";
|
|
|
|
|
echo " <td align=center>$r_count</td>\n";
|
|
|
|
|
echo "</tr>\n\n";
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
$c++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
echo html_frame_end("Click the Version Name to view the details of that Version");
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-03-15 20:39:12 +00:00
|
|
|
$appId = $_REQUEST['appId'];
|
|
|
|
|
$versionId = $_REQUEST['versionId'];
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
/**
|
|
|
|
|
* We want to see an application family (=no version)
|
|
|
|
|
*/
|
2004-03-15 20:39:12 +00:00
|
|
|
if(!is_numeric($appId))
|
|
|
|
|
{
|
2004-12-11 03:25:13 +00:00
|
|
|
errorpage("Something went wrong with the IDs");
|
|
|
|
|
exit;
|
2004-03-15 20:39:12 +00:00
|
|
|
}
|
|
|
|
|
|
2004-03-15 16:22:00 +00:00
|
|
|
if($appId && !$versionId)
|
|
|
|
|
{
|
2004-12-10 00:18:01 +00:00
|
|
|
$app = new Application($appId);
|
|
|
|
|
$data = $app->data;
|
|
|
|
|
if(!$data)
|
|
|
|
|
{
|
2004-12-11 03:25:13 +00:00
|
|
|
// oops! application not found or other error. do something
|
2004-12-10 00:18:01 +00:00
|
|
|
errorpage('Internal Database Access Error');
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// show Vote Menu
|
2004-12-10 00:18:01 +00:00
|
|
|
if(loggedin())
|
|
|
|
|
apidb_sidebar_add("vote_menu");
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// show Admin Menu
|
2004-12-12 22:22:21 +00:00
|
|
|
if(loggedin() && (havepriv("admin") || $_SESSION['current']->ownsApp($appId)))
|
2004-12-10 00:18:01 +00:00
|
|
|
apidb_sidebar_add("admin_menu");
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
// header
|
|
|
|
|
apidb_header("Viewing App - ".$data->appName);
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// cat display
|
2004-12-10 00:18:01 +00:00
|
|
|
display_catpath($app->data->catId);
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// set Vendor
|
2004-12-10 00:18:01 +00:00
|
|
|
$vendor = $app->getVendor();
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// set URL
|
2004-12-10 00:18:01 +00:00
|
|
|
$appLinkURL = ($data->webPage) ? "<a href='$data->webPage'>".substr(stripslashes($data->webPage),0,30)."</a>": " ";
|
2004-12-11 03:25:13 +00:00
|
|
|
|
|
|
|
|
// start display application
|
2004-12-10 00:18:01 +00:00
|
|
|
echo html_frame_start("","98%","",0);
|
2004-12-11 03:25:13 +00:00
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
echo "<tr><td class=color4 valign=top>\n";
|
|
|
|
|
echo " <table>\n";
|
|
|
|
|
echo " <tr><td>\n";
|
|
|
|
|
|
|
|
|
|
echo ' <table width="250" border=0 cellpadding=3 cellspacing=1">',"\n";
|
|
|
|
|
echo " <tr class=color0 valign=top><td width='100' align=right> <b>Name</b></td><td width='100%'> ".stripslashes($data->appName)." </td>\n";
|
|
|
|
|
echo " <tr class=color1 valign=top><td align=right> <b>Vendor</b></td><td> ".
|
|
|
|
|
" <a href='vendorview.php?vendorId=$vendor->vendorId'> ".stripslashes($vendor->vendorName)." </a> \n";
|
|
|
|
|
echo " <tr class=color0 valign=top><td align=right> <b>BUGS</b></td><td> ".
|
|
|
|
|
" <a href='bugs.php?appId=$data->appId.'> Check for bugs in bugzilla </a> \n";
|
|
|
|
|
echo " </td></tr>\n";
|
2004-12-11 03:25:13 +00:00
|
|
|
|
|
|
|
|
// display notes
|
|
|
|
|
display_notes($appId);
|
|
|
|
|
|
|
|
|
|
// main URL
|
|
|
|
|
echo " <tr class=color1 valign=top><td align=right> <b>URL</b></td><td>".$appLinkURL."</td></tr>\n";
|
|
|
|
|
|
|
|
|
|
// optional links
|
|
|
|
|
$result = mysql_query("SELECT * FROM appData WHERE appId = $appId AND type = 'url'");
|
|
|
|
|
if($result && mysql_num_rows($result) > 0)
|
2004-12-10 00:18:01 +00:00
|
|
|
{
|
2004-12-11 03:25:13 +00:00
|
|
|
echo " <tr class=color1><td valign=top align=right> <b>Links</b></td><td>\n";
|
|
|
|
|
while($ob = mysql_fetch_object($result))
|
2004-12-10 00:18:01 +00:00
|
|
|
{
|
2004-12-11 03:25:13 +00:00
|
|
|
echo " <a href='$ob->url'>".substr(stripslashes($ob->description),0,30)."</a> <br>\n";
|
2004-12-10 00:18:01 +00:00
|
|
|
}
|
2004-12-11 03:25:13 +00:00
|
|
|
echo " </td></tr>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// image
|
|
|
|
|
$img = get_screenshot_img($appId);
|
|
|
|
|
echo "<tr><td align=center colspan=2>$img</td></tr>\n";
|
|
|
|
|
|
|
|
|
|
// display app owner
|
|
|
|
|
$result = mysql_query("SELECT * FROM appOwners WHERE appId = $appId");
|
|
|
|
|
if($result && mysql_num_rows($result) > 0)
|
2004-12-10 00:18:01 +00:00
|
|
|
{
|
2004-12-11 03:25:13 +00:00
|
|
|
echo " <tr class=color0><td valign=top align=right> <b>Owner</b></td>\n";
|
2004-12-10 00:18:01 +00:00
|
|
|
echo " <td>\n";
|
2004-12-11 03:25:13 +00:00
|
|
|
while($ob = mysql_fetch_object($result))
|
2004-12-10 00:18:01 +00:00
|
|
|
{
|
|
|
|
|
$inResult = mysql_query("SELECT username,email FROM user_list WHERE userid = $ob->ownerId");
|
2004-12-11 03:25:13 +00:00
|
|
|
if ($inResult && mysql_num_rows($inResult) > 0)
|
|
|
|
|
{
|
|
|
|
|
$foo = mysql_fetch_object($inResult);
|
|
|
|
|
echo " <a href='mailto:$foo->email'>".substr(stripslashes($foo->username),0,30)."</a> <br>\n";
|
2004-12-10 00:18:01 +00:00
|
|
|
}
|
|
|
|
|
}
|
2004-12-11 03:25:13 +00:00
|
|
|
echo " </td></tr>\n";
|
2004-12-10 00:18:01 +00:00
|
|
|
}
|
|
|
|
|
echo " </table>\n"; /* close of name/vendor/bugs/url table */
|
2004-12-06 23:12:23 +00:00
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
echo " </td></tr>\n";
|
|
|
|
|
echo " <tr><td>\n";
|
2004-12-06 23:12:23 +00:00
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
// Display all supermaintainers maintainers of this application
|
|
|
|
|
echo " <table class=color4 width=250 border=1>\n";
|
|
|
|
|
echo " <tr><td align=left><b>Super maintainers:</b></td></tr>\n";
|
|
|
|
|
$other_maintainers = getSuperMaintainersUserIdsFromAppId($appId);
|
|
|
|
|
if($other_maintainers)
|
|
|
|
|
{
|
|
|
|
|
while(list($index, list($userIdValue)) = each($other_maintainers))
|
|
|
|
|
{
|
|
|
|
|
echo " <tr><td align=left>\n";
|
|
|
|
|
echo " <li>".lookupUsername($userIdValue)."</td></tr>\n";
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
echo " <tr><td align=right>No maintainers.Volunteer today!</td></tr>\n";
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
// Display the app maintainer button
|
|
|
|
|
echo " <tr><td><center>\n";
|
|
|
|
|
if(loggedin())
|
|
|
|
|
{
|
|
|
|
|
/* are we already a maintainer? */
|
2004-12-19 23:03:10 +00:00
|
|
|
if($_SESSION['current']->is_super_maintainer($appId)) /* yep */
|
2004-12-10 00:18:01 +00:00
|
|
|
{
|
|
|
|
|
echo ' <form method=post name=message action="maintainerdelete.php"><input type=submit value="Remove yourself as a super maintainer" class=button>';
|
|
|
|
|
} else /* nope */
|
|
|
|
|
{
|
|
|
|
|
echo ' <form method=post name=message action="maintainersubmit.php"><input type=submit value="Be a super maintainer of this app" class=button>';
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
echo " <input type=hidden name='appId' value=$appId>";
|
|
|
|
|
echo " <input type=hidden name='versionId' value=$versionId>";
|
|
|
|
|
echo " <input type=hidden name='superMaintainer' value=1>"; /* set superMaintainer to 1 because we are at the appFamily level */
|
|
|
|
|
echo " </form>";
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
echo ' <input type=submit value="Log in to become a super maintainer" class=button>';
|
|
|
|
|
}
|
|
|
|
|
echo " </center></td></tr>\n";
|
|
|
|
|
echo " </table>\n"; /* close of super maintainers table */
|
|
|
|
|
|
|
|
|
|
echo " </td></tr>\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
echo " <tr><td>\n";
|
|
|
|
|
echo " <center><a href='appsubmit.php?appId=$data->appId&apptype=2'> Submit New Version </a> <center>\n";
|
|
|
|
|
echo " </td></tr>\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
echo " </td></tr>\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-10 00:18:01 +00:00
|
|
|
echo " </table>\n"; /* close the table that contains the whole left hand side of the upper table */
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// description
|
2004-12-10 00:18:01 +00:00
|
|
|
echo " <td class=color2 valign=top width='100%'>\n";
|
|
|
|
|
echo " <table width='100%' border=0><tr><td width='100%' valign=top><b>Description</b><br>\n";
|
|
|
|
|
echo add_br(stripslashes($data->description));
|
|
|
|
|
|
|
|
|
|
echo " </td></tr></table>\n";
|
|
|
|
|
|
|
|
|
|
echo html_frame_end("For more details and user comments, view the versions of this application.");
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// display versions
|
2004-12-10 00:18:01 +00:00
|
|
|
display_versions($appId,$app->getAppVersionList());
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// display bundle
|
2004-12-10 00:18:01 +00:00
|
|
|
display_bundle($appId);
|
|
|
|
|
|
|
|
|
|
// disabled for now
|
|
|
|
|
//log_application_visit($appId);
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
2004-12-11 03:25:13 +00:00
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
|
# We want to see a particular version #
|
|
|
|
|
#######################################
|
2004-03-15 16:22:00 +00:00
|
|
|
else if($appId && $versionId)
|
|
|
|
|
{
|
2004-11-17 23:02:07 +00:00
|
|
|
$app = new Application($appId);
|
|
|
|
|
$data = $app->data;
|
2004-12-11 03:25:13 +00:00
|
|
|
if(!$data)
|
2004-11-17 23:02:07 +00:00
|
|
|
{
|
|
|
|
|
// Oops! application not found or other error. do something
|
|
|
|
|
errorpage('Internal Database Access Error. No App found.');
|
2004-12-11 03:25:13 +00:00
|
|
|
exit;
|
2004-11-17 23:02:07 +00:00
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-11-17 23:02:07 +00:00
|
|
|
$ver = $app->getAppVersion($versionId);
|
|
|
|
|
if(!$ver)
|
|
|
|
|
{
|
|
|
|
|
// Oops! Version not found or other error. do something
|
|
|
|
|
errorpage('Internal Database Access Error. No Version Found.');
|
2004-12-11 03:25:13 +00:00
|
|
|
exit;
|
2004-11-17 23:02:07 +00:00
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-11-17 23:02:07 +00:00
|
|
|
// rating menu
|
|
|
|
|
if(loggedin())
|
|
|
|
|
{
|
|
|
|
|
apidb_sidebar_add("rating_menu");
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-11-17 23:02:07 +00:00
|
|
|
// admin menu
|
|
|
|
|
if(loggedin() && havepriv("admin"))
|
|
|
|
|
{
|
|
|
|
|
apidb_sidebar_add("admin_menu");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// header
|
|
|
|
|
apidb_header("Viewing App Version - ".$data->appName);
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// cat
|
2004-11-17 23:02:07 +00:00
|
|
|
display_catpath($app->data->catId);
|
2004-12-11 03:25:13 +00:00
|
|
|
|
|
|
|
|
// set URL
|
2004-11-17 23:02:07 +00:00
|
|
|
$appLinkURL = ($ver->webPage) ? "<a href='$ver->webPage'>".substr(stripslashes($ver->webPage),0,30)."</a>": " ";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// start version display
|
2004-11-17 23:02:07 +00:00
|
|
|
echo html_frame_start("","98%","",0);
|
2004-12-11 03:25:13 +00:00
|
|
|
|
2004-11-17 23:02:07 +00:00
|
|
|
echo '<tr><td class=color4 valign=top>',"\n";
|
|
|
|
|
echo '<table width="250" border=0 cellpadding=3 cellspacing=1">',"\n";
|
|
|
|
|
echo "<tr class=color0 valign=top><td width=100> <b>Name</b></td><td width='100%'>".stripslashes($data->appName)."</td>\n";
|
2004-12-01 22:29:54 +00:00
|
|
|
echo "<tr class=color1 valign=top><td> <b>Version</b></td><td>".stripslashes($ver->versionName)."</td></tr>\n";
|
|
|
|
|
echo "<tr class=color0 valign=top><td> <b>URL</b></td><td>".stripslashes($appLinkURL)."</td></tr>\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// rating Area
|
2004-11-17 23:02:07 +00:00
|
|
|
$r_win = rating_stars_for_version($versionId, "windows");
|
|
|
|
|
$r_fake = rating_stars_for_version($versionId, "fake");
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-01 22:29:54 +00:00
|
|
|
echo "<tr class=color1 valign=top><td> <b>Rating</b></td><td> $r_win \n";
|
2004-11-17 23:02:07 +00:00
|
|
|
echo "<br> $r_fake </td></tr>\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// notes
|
2004-11-17 23:02:07 +00:00
|
|
|
display_notes($appId, $versionId);
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// image
|
2004-11-09 22:41:18 +00:00
|
|
|
$img = get_screenshot_img($appId, $versionId);
|
2004-11-17 23:02:07 +00:00
|
|
|
echo "<tr><td align=center colspan=2>$img</td></tr>\n";
|
2004-11-09 22:41:18 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// display all maintainers of this application
|
2004-11-09 22:41:18 +00:00
|
|
|
echo "<tr class=color0><td align=left colspan=2><b>Maintainers of this application:</b>\n";
|
|
|
|
|
echo "<table width=250 border=0>";
|
|
|
|
|
$other_maintainers = getMaintainersUserIdsFromAppIdVersionId($appId, $versionId);
|
|
|
|
|
if($other_maintainers)
|
|
|
|
|
{
|
|
|
|
|
while(list($index, list($userIdValue)) = each($other_maintainers))
|
|
|
|
|
{
|
|
|
|
|
echo "<tr class=color0><td align=left colspan=2>";
|
|
|
|
|
echo "<li>".lookupUsername($userIdValue)."</td></tr>\n";
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
echo "<tr class=color0><td align=right colspan=2>";
|
|
|
|
|
echo "No maintainers. Volunteer today!</td></tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</table></td></tr>";
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// display the app maintainer button
|
2004-11-09 22:41:18 +00:00
|
|
|
echo "<tr><td colspan = 2><center>";
|
|
|
|
|
if(loggedin())
|
|
|
|
|
{
|
2004-12-10 00:18:01 +00:00
|
|
|
/* is this user a maintainer of this version by virtue of being a super maintainer */
|
|
|
|
|
/* of this app family? */
|
2004-12-19 19:30:27 +00:00
|
|
|
if($_SESSION['current']->is_super_maintainer($appId) && !$_SESSION['current']->is_maintainer($appId, $versionId))
|
2004-11-09 22:41:18 +00:00
|
|
|
{
|
2004-12-10 00:18:01 +00:00
|
|
|
echo '<form method=post name=message action="maintainerdelete.php"><input type=submit value="Remove yourself as a supermaintainer" class=button>';
|
|
|
|
|
echo "<input type=hidden name='superMaintainer' value=1>";
|
|
|
|
|
} else
|
2004-11-09 22:41:18 +00:00
|
|
|
{
|
2004-12-10 00:18:01 +00:00
|
|
|
/* are we already a maintainer? */
|
2004-12-19 19:30:27 +00:00
|
|
|
if($_SESSION['current']->is_maintainer($appId, $versionId)) /* yep */
|
2004-12-10 00:18:01 +00:00
|
|
|
{
|
|
|
|
|
echo '<form method=post name=message action="maintainerdelete.php"><input type=submit value="Remove yourself as a maintainer" class=button>';
|
|
|
|
|
echo "<input type=hidden name='superMaintainer' value=0>";
|
|
|
|
|
} else /* nope */
|
|
|
|
|
{
|
|
|
|
|
echo '<form method=post name=message action="maintainersubmit.php"><input type=submit value="Be a maintainer for this app" class=button>';
|
|
|
|
|
}
|
2004-11-09 22:41:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "<input type=hidden name='appId' value=$appId>";
|
|
|
|
|
echo "<input type=hidden name='versionId' value=$versionId>";
|
|
|
|
|
echo "</form>";
|
|
|
|
|
} else
|
|
|
|
|
{
|
2004-12-01 22:33:48 +00:00
|
|
|
echo '<form method=post name=message action="account.php?cmd=login">';
|
2004-11-09 22:41:18 +00:00
|
|
|
echo '<input type=submit value="Log in to become an app maintainer" class=button>';
|
2004-12-01 22:33:48 +00:00
|
|
|
echo '</form>';
|
2004-11-09 22:41:18 +00:00
|
|
|
}
|
2004-11-17 23:02:07 +00:00
|
|
|
|
2004-11-09 22:41:18 +00:00
|
|
|
echo "</center></td></tr>";
|
2004-12-01 22:33:48 +00:00
|
|
|
|
2004-12-19 19:30:27 +00:00
|
|
|
if (loggedin() && (havepriv("admin") || $_SESSION['current']->is_maintainer($appId, $versionId)))
|
2004-11-17 23:02:07 +00:00
|
|
|
{
|
|
|
|
|
echo "<tr><td colspan = 2><center>";
|
2004-12-01 22:33:48 +00:00
|
|
|
echo '<form method=post name=message action=admin/editAppVersion.php?appId='.$appId.'&versionId='.$versionId.'>';
|
|
|
|
|
echo '<input type=submit value="Edit Version Info" class=button>';
|
|
|
|
|
echo '</form>';
|
|
|
|
|
echo '<form method=post name=message action=admin/addAppNote.php?appId='.$appId.'&versionId='.$versionId.'>';
|
|
|
|
|
echo '<input type=submit value="Add Note" class=button>';
|
|
|
|
|
echo '</form>';
|
|
|
|
|
echo '</form>';
|
|
|
|
|
echo '<form method=post name=message action=admin/addAppNote.php?appId='.$appId.'&versionId='.$versionId.'>';
|
|
|
|
|
echo '<input type=hidden name="noteTitle" value="HOWTO">';
|
|
|
|
|
echo '<input type=submit value="Add How To" class=button>';
|
|
|
|
|
echo '</form>';
|
|
|
|
|
echo '</form>';
|
|
|
|
|
echo '<form method=post name=message action=admin/addAppNote.php?appId='.$appId.'&versionId='.$versionId.'>';
|
|
|
|
|
echo '<input type=hidden name="noteTitle" value="WARNING">';
|
|
|
|
|
echo '<input type=submit value="Add Warning" class=button>';
|
|
|
|
|
echo '</form>';
|
2004-11-17 23:02:07 +00:00
|
|
|
echo "</center></td></tr>";
|
|
|
|
|
}
|
2004-11-09 22:41:18 +00:00
|
|
|
|
2004-12-01 22:33:48 +00:00
|
|
|
echo "</table><td class=color2 valign=top width='100%'>\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-11-17 23:02:07 +00:00
|
|
|
//Desc Image
|
|
|
|
|
echo "<table width='100%' border=0><tr><td width='100%' valign=top> <b>Description</b><br>\n";
|
|
|
|
|
echo add_br(stripslashes($ver->description));
|
|
|
|
|
echo "</td></tr>";
|
2004-11-09 22:41:18 +00:00
|
|
|
|
|
|
|
|
/* close the table */
|
|
|
|
|
echo "</table>\n";
|
2004-12-01 22:33:48 +00:00
|
|
|
|
2004-11-17 23:02:07 +00:00
|
|
|
echo html_frame_end();
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-01 22:33:48 +00:00
|
|
|
//Show Warnings
|
|
|
|
|
$result = mysql_query("SELECT * FROM appNotes WHERE appId = $appId and versionId = $versionId and noteTitle = 'WARNING'");
|
|
|
|
|
if($result && mysql_num_rows($result))
|
|
|
|
|
{
|
|
|
|
|
while($ob = mysql_fetch_object($result))
|
|
|
|
|
{
|
|
|
|
|
echo html_frame_start("","98%",'',0);
|
|
|
|
|
|
|
|
|
|
echo "<table width='100%' border=0 cellspacing=0>","\n";
|
|
|
|
|
echo "<tr width='100%' bgcolor=red align=center valign=top><td><b>Warning</b><br></td></tr>\n";
|
|
|
|
|
echo "<tr><td>\n";
|
|
|
|
|
echo add_br(stripslashes($ob->noteDesc));
|
|
|
|
|
echo "</td></tr>\n";
|
|
|
|
|
|
2004-12-19 19:30:27 +00:00
|
|
|
if (loggedin() && (havepriv("admin") || $_SESSION['current']->is_maintainer($appId, $versionId)))
|
2004-12-01 22:33:48 +00:00
|
|
|
{
|
|
|
|
|
echo "<tr width='100%' class=color1 align=center valign=top><td>";
|
|
|
|
|
echo '<form method=post name=message action=admin/editAppNote.php?noteId='.$ob->noteId.'&appId='.$appId.'&versionId='.$versionId.'>';
|
|
|
|
|
echo '<input type=submit value="Edit Warning Info" class=button>';
|
|
|
|
|
echo '</form></td></tr>';
|
|
|
|
|
}
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
echo html_frame_end();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
// show How tos
|
2004-12-01 22:33:48 +00:00
|
|
|
$result = mysql_query("SELECT * FROM appNotes WHERE appId = $appId and versionId = $versionId and noteTitle = 'HOWTO'");
|
|
|
|
|
if($result && mysql_num_rows($result))
|
|
|
|
|
{
|
|
|
|
|
while($ob = mysql_fetch_object($result))
|
|
|
|
|
{
|
|
|
|
|
echo html_frame_start("","98%",'',0);
|
|
|
|
|
|
|
|
|
|
echo "<table width='100%' border=0 cellspacing=0>","\n";
|
|
|
|
|
echo "<tr width='100%' bgcolor=green align=center valign=top><td><b>How To</b><br></td></tr>\n";
|
|
|
|
|
echo "<tr><td>\n";
|
|
|
|
|
echo add_br(stripslashes($ob->noteDesc));
|
|
|
|
|
echo "</td></tr>\n";
|
|
|
|
|
|
2004-12-19 19:30:27 +00:00
|
|
|
if (loggedin() && (havepriv("admin") || $_SESSION['current']->is_maintainer($appId, $versionId)))
|
2004-12-01 22:33:48 +00:00
|
|
|
{
|
|
|
|
|
echo "<tr width='100%' class=color1 align=center valign=top><td>";
|
|
|
|
|
echo '<form method=post name=message action=admin/editAppNote.php?noteId='.$ob->noteId.'&appId='.$appId.'&versionId='.$versionId.'>';
|
|
|
|
|
echo '<input type=submit value="Edit How to Info" class=button>';
|
|
|
|
|
echo '</form></td></tr>';
|
|
|
|
|
}
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
echo html_frame_end();
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-11-17 23:02:07 +00:00
|
|
|
//TODO: code to view/add user experience record
|
2004-12-11 03:25:13 +00:00
|
|
|
// if(!$versionId)
|
|
|
|
|
// {
|
|
|
|
|
// $versionId = 0;
|
|
|
|
|
// }
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-11-17 23:02:07 +00:00
|
|
|
// Comments Section
|
|
|
|
|
view_app_comments($appId, $versionId);
|
2004-12-11 03:25:13 +00:00
|
|
|
|
|
|
|
|
} else
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2004-12-11 03:25:13 +00:00
|
|
|
// Oops! Called with no params, bad llamah!
|
|
|
|
|
errorpage('Page Called with No Params!');
|
|
|
|
|
exit;
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
2004-12-11 03:25:13 +00:00
|
|
|
?>
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
<p> </p>
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-14 04:30:41 +00:00
|
|
|
<?php
|
2004-03-15 16:22:00 +00:00
|
|
|
apidb_footer();
|
2004-12-11 22:33:01 +00:00
|
|
|
?>
|