diff --git a/browse_newest_apps.php b/browse_newest_apps.php new file mode 100644 index 0000000..5075089 --- /dev/null +++ b/browse_newest_apps.php @@ -0,0 +1,69 @@ + 200 || $aClean['iNumVersions'] < 0) + $aClean['iNumVersions'] = 25; + +apidb_header("Browse Newest Applications"); + +/* selector for how many versions to view */ +echo "
"; +echo "How many versions to display:"; +echo ""; + +echo ' '; +echo '
'; +echo '
'; + +/* Query the database for the n newest versions */ +$hResult = query_parameters("SELECT appId, appName, description, submitTime FROM appFamily WHERE + queued = 'false' ORDER BY appId DESC LIMIT ?", + $aClean['iNumVersions']); + +if($hResult) +{ + echo html_frame_start("", "90%", '', 0); + echo html_table_begin("width=\"100%\" align=\"center\""); + echo "\n"; + echo "Submission Date\n"; + echo "Application\n"; + echo "Description\n"; + + $c = 1; + while($row = mysql_fetch_object($hResult)) + { + $bgcolor = ($c % 2) ? "color0" : "color1"; + $link = "appId\"> $row->appName "; + echo ""; + echo "".print_short_date(mysqltimestamp_to_unixtimestamp($oApp->sSubmitTime))."\n"; + echo "$link \n"; + echo "$row->description \n"; + $c++; + } + + echo html_table_end(); + echo html_frame_end(); +} + +apidb_footer(); + +?> diff --git a/include/sidebar.php b/include/sidebar.php index abdc7f5..d73c414 100644 --- a/include/sidebar.php +++ b/include/sidebar.php @@ -23,6 +23,7 @@ function global_sidebar_menu() { $g->add("AppDB Home", BASE); $g->add("Screenshots", BASE."viewScreenshots.php"); $g->add("Browse Apps", BASE."appbrowse.php"); + $g->add("Browse Newest Apps", BASE."browse_newest_apps.php"); $g->add("Browse Apps by Rating", BASE."browse_by_rating.php"); $g->add("Top 25", BASE."votestats.php"); $g->add("Submit Application", BASE."appsubmit.php?sSub=view&sAppType=application"); diff --git a/include/util.php b/include/util.php index 6d26bef..b985966 100644 --- a/include/util.php +++ b/include/util.php @@ -63,14 +63,18 @@ function values($arr) } -/* - * format date - */ +// print the month, day, year, hour, minute, second function print_date($sTimestamp) { return date("F d Y H:i:s", $sTimestamp); } +// print the month, day and year +function print_short_date($sTimestamp) +{ + return date("F d Y", $sTimestamp); +} + function mysqltimestamp_to_unixtimestamp($sTimestamp) { $d = substr($sTimestamp,6,2); // day