getCategoryPath(), $appId, $versionId); echo html_frame_start("",'98%','',2); echo "

Category: ". $catFullPath ."
\n"; echo html_frame_end(); } /** * display the SUB apps that belong to this app */ function display_bundle($appId) { $result = query_appdb("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ". "WHERE bundleId = $appId AND appBundle.appId = appFamily.appId"); if(!$result || mysql_num_rows($result) == 0) { return; // do nothing } echo html_frame_start("","98%","",0); echo "\n\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n\n"; $c = 0; while($ob = mysql_fetch_object($result)) { //set row color $bgcolor = ($c % 2 == 0) ? "color0" : "color1"; //format desc $aDesc = explode("\n",$oApp->data->description,2); //display row echo "\n"; echo " \n"; echo " \n"; echo "\n\n"; $c++; } echo "
Application NameDescription
".stripslashes($ob->appName)."".$aDesc[0]."
\n\n"; echo html_frame_end(); } /* Show note */ function show_note($sType,$oData){ switch($sType) { case 'WARNING': $color = 'red'; $title = 'Warning'; break; case 'HOWTO'; $color = 'green'; $title = 'HOWTO'; break; default: if(!empty($oData->noteTitle)) $title = $oData->noteTitle; else $title = 'Note'; $color = 'blue'; } $s = html_frame_start("","98%",'',0); $s .= "\n"; $s .= "\n"; $s .= "\n"; if ($_SESSION['current']->isLoggedIn() && ($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isMaintainer($_REQUEST['appId'], $_REQUEST['versionId']))) { $s .= "'; } $s .= "
$title
\n"; $s .= add_br(stripslashes($oData->noteDesc)); $s .= "
"; $s .= "
"; $s .= ''; $s .= '
\n"; $s .= html_frame_end(); return $s; } /** * display the versions */ function display_versions($appId, $versions) { if ($versions) { echo html_frame_start("","98%","",0); echo "\n\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n\n"; $c = 0; while(list($idx, $ver) = each($versions)) { //set row color $bgcolor = ($c % 2 == 0) ? "color0" : "color1"; //format desc $desc = substr(stripslashes($ver->description),0,75); if(strlen($desc) == 75) $desc .= " ..."; //count comments $r_count = count_comments($appId,$ver->versionId); //display row echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n\n"; $c++; } echo "
VersionDescriptionRatingWine versionComments
".$ver->versionName."$desc  $ver->maintainer_rating$ver->maintainer_release$r_count
\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'])) { errorpage("Something went wrong with the application ID"); exit; } $appId = $_REQUEST['appId']; if(!empty($_REQUEST['versionId']) AND !is_numeric($_REQUEST['versionId'])) { errorpage("Something went wrong with the version ID"); exit; } $versionId = $_REQUEST['versionId']; if($appId && !$versionId) { $app = new Application($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, $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 "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo ' ',"\n"; echo " \n"; echo " \n"; echo " \n"; // main URL echo " \n"; // optional links $result = query_appdb("SELECT * FROM appData WHERE appId = $appId AND versionID = 0 AND type = 'url'"); if($result && mysql_num_rows($result) > 0) { echo " \n"; } // image $img = get_screenshot_img($appId); echo "\n"; echo "
Name ".stripslashes($data->appName)."
Vendor ". " ".stripslashes($vendor->vendorName)."  \n"; echo "
BUGS ". " Check for bugs in bugzilla  \n"; echo "
Votes "; echo vote_count_app_total($data->appId); echo "
URL".$appLinkURL."
Links\n"; while($ob = mysql_fetch_object($result)) { echo " ".substr(stripslashes($ob->description),0,30)."
\n"; } echo "
$img
\n"; /* close of name/vendor/bugs/url table */ echo "
\n"; // Display all supermaintainers maintainers of this application echo " \n"; echo " \n"; $other_maintainers = getSuperMaintainersUserIdsFromAppId($appId); if($other_maintainers) { while(list($index, list($userIdValue)) = each($other_maintainers)) { $oUser = new User($userIdValue); echo " \n"; } } else { echo " \n"; } // Display the app maintainer button echo " \n"; echo "
Super maintainers:
\n"; echo "
  • ".$oUser->sRealname."
  • No maintainers.Volunteer today!
    \n"; if($_SESSION['current']->isLoggedIn()) { /* are we already a maintainer? */ if($_SESSION['current']->isSuperMaintainer($appId)) /* yep */ { echo '
    '; } else /* nope */ { echo ' '; } echo " "; echo " "; echo " "; /* set superMaintainer to 1 because we are at the appFamily level */ echo "
    "; if($_SESSION['current']->isSuperMaintainer($appId) || $_SESSION['current']->hasPriv("admin")) { echo '
    '; echo '
    '; echo ''; echo '
    '; } if($_SESSION['current']->hasPriv("admin")) { $url = BASE."admin/deleteAny.php?what=appFamily&appId=".$_REQUEST['appId']."&confirmed=yes"; echo "
    "; echo '
    '; } } else { echo ' '; } echo "
    \n"; /* close of super maintainers table */ echo "
    \n"; /* close the table that contains the whole left hand side of the upper table */ // description echo " \n"; echo "
    Description
    \n"; echo add_br(stripslashes($data->description)); echo "
    \n"; echo html_frame_end("For more details and user comments, view the versions of this application."); // display versions display_versions($appId,$app->getAppVersionList()); // display bundle display_bundle($appId); // disabled for now //log_application_visit($appId); } ####################################### # We want to see a particular version # ####################################### else if($appId && $versionId) { $app = new Application($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($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, $versionId); // set URL $appLinkURL = ($ver->webPage) ? "".substr(stripslashes($ver->webPage),0,30)."": " "; // start version display echo html_frame_start("","98%","",0); echo '',"\n"; echo '',"\n"; echo "\n"; echo "\n"; // links $result = query_appdb("SELECT * FROM appData WHERE appId = $appId AND versionID = $versionId AND type = 'url'"); if($result && mysql_num_rows($result) > 0) { echo " \n"; } // rating Area echo "\n"; echo "\n"; // image $img = get_screenshot_img($appId, $versionId); echo "\n"; // display all maintainers of this application echo ""; // display the app maintainer button echo ""; if ($_SESSION['current']->isLoggedIn() && ($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isMaintainer($appId, $versionId))) { echo ""; } echo "
    Name".stripslashes($data->appName)."
    Version".stripslashes($ver->versionName)."
    Links\n"; while($ob = mysql_fetch_object($result)) { echo " ".substr(stripslashes($ob->description),0,30)."
    \n"; } echo "
    Maintainer Rating".stripslashes($ver->maintainer_rating)."
    Maintainers Version".stripslashes($ver->maintainer_release)."
    $img
    Maintainers of this application:\n"; echo ""; $other_maintainers = getMaintainersUserIdsFromAppIdVersionId($appId, $versionId); if($other_maintainers) { while(list($index, list($userIdValue)) = each($other_maintainers)) { $oUser = new User($userIdValue); echo "\n"; } } else { echo "\n"; } echo "
    "; echo "
  • ".$oUser->sRealname."
  • "; echo "No maintainers. Volunteer today!
    "; 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 '
    '; echo ""; } else { /* are we already a maintainer? */ if($_SESSION['current']->isMaintainer($appId, $versionId)) /* yep */ { echo ''; echo ""; } else /* nope */ { echo ''; } } echo ""; echo ""; echo "
    "; } else { echo '
    '; echo ''; echo '
    '; } echo "
    "; echo '
    '; echo ''; echo '
    '; $url = BASE."admin/deleteAny.php?what=appVersion&appId=".$_REQUEST['appId']."&versionId=".$_REQUEST['versionId']."&confirmed=yes"; echo "
    "; echo ''; echo '
    '; echo '
    '; echo ''; echo '
    '; echo ''; echo '
    '; echo ''; echo ''; echo '
    '; echo ''; echo '
    '; echo ''; echo ''; echo '
    '; echo "
    \n"; //Desc Image echo ""; /* close the table */ echo "
    Description
    \n"; echo add_br(stripslashes($ver->description)); echo "
    \n"; echo html_frame_end(); $rNotes = query_appdb("SELECT * FROM appNotes WHERE appId = $appId and versionId = $versionId"); while( $oNote = mysql_fetch_object($rNotes) ) { echo show_note($oNote->noteTitle,$oNote); } //TODO: code to view/add user experience record // if(!$versionId) // { // $versionId = 0; // } // Comments Section view_app_comments($appId, $versionId); } else { // Oops! Called with no params, bad llamah! errorpage('Page Called with No Params!'); exit; } ?>