\n";
echo html_frame_end("Click the Version Name to view the details of that Version");
}
}
/**
* We want to see an application family (=no version).
*/
if(!is_numeric($_REQUEST['appId']) && !is_numeric($_REQUEST['versionId']))
{
errorpage("Something went wrong with the application or version id");
exit;
}
if($_REQUEST['appId'])
{
$app = new Application($_REQUEST['appId']);
$data = $app->data;
if(!$data)
{
// oops! application not found or other error. do something
errorpage('Internal Database Access Error');
exit;
}
// show Vote Menu
if($_SESSION['current']->isLoggedIn())
apidb_sidebar_add("vote_menu");
// header
apidb_header("Viewing App - ".$data->appName);
// cat display
display_catpath($app->data->catId, $_REQUEST['appId']);
// set Vendor
$vendor = $app->getVendor();
// set URL
$appLinkURL = ($data->webPage) ? "".substr(stripslashes($data->webPage),0,30)."": " ";
// start display application
echo html_frame_start("","98%","",0);
echo "";
echo "
\n"; /* close of super maintainers table */
echo "
\n";
echo " \n";
echo "
\n"; /* close the table that contains the whole left hand side of the upper table */
// description
echo "
\n";
echo "
Description\n";
echo $data->description;
echo "
\n";
echo html_frame_end("For more details and user comments, view the versions of this application.");
// display versions
display_versions($_REQUEST['appId'],$app->getAppVersionList());
// display bundle
display_bundle($_REQUEST['appId']);
// disabled for now
//log_application_visit($_REQUEST['appId']);
}
/*
* We want to see a particular version.
*/
else if($_REQUEST['versionId'])
{
//FIXME: get rid of appId references everywhere, as version is enough.
$sQuery = "SELECT appId FROM appVersion WHERE versionId = '".$_REQUEST['versionId']."'";
$hResult = query_appdb($sQuery);
$oRow = mysql_fetch_object($hResult);
$appId = $oRow->appId;
$app = new Application($oRow->appId);
$data = $app->data;
if(!$data)
{
// Oops! application not found or other error. do something
errorpage('Internal Database Access Error. No App found.');
exit;
}
$ver = $app->getAppVersion($_REQUEST['versionId']);
if(!$ver)
{
// Oops! Version not found or other error. do something
errorpage('Internal Database Access Error. No Version Found.');
exit;
}
// header
apidb_header("Viewing App Version - ".$data->appName);
// cat
display_catpath($app->data->catId, $appId, $_REQUEST['versionId']);
// set URL
$appLinkURL = ($ver->webPage) ? "".substr(stripslashes($ver->webPage),0,30)."": " ";
// start version display
echo html_frame_start("","98%","",0);
echo "";
echo '
',"\n";
echo '
',"\n";
echo "
Name
".stripslashes($data->appName)."
\n";
echo "
Version
".stripslashes($ver->versionName)."
\n";
// links
$result = query_appdb("SELECT * FROM appData WHERE versionID = ".$_REQUEST['versionId']." AND type = 'url'");
if($result && mysql_num_rows($result) > 0)
{
echo "
";
if($_SESSION['current']->isLoggedIn())
{
/* is this user a maintainer of this version by virtue of being a super maintainer */
/* of this app family? */
if($_SESSION['current']->isSuperMaintainer($appId))
{
echo '";
} else
{
echo '';
}
echo "
";
if ($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isMaintainer($_REQUEST['versionId']))
{
echo "