From 0cf3c5ea8bd2799e1354aa2008edb542e01635ba Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Sun, 8 Jun 2008 01:12:55 +0800 Subject: Split html from front page html from the index page has been moved to a template file (front_page.php) needs indentation really bad Signed-off-by: Callan Barrett --- web/html/index.php | 155 ++--------------------------------------- web/template/front_page.php | 165 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 169 insertions(+), 151 deletions(-) create mode 100644 web/template/front_page.php (limited to 'web') diff --git a/web/html/index.php b/web/html/index.php index 895fc8af..e530a852 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -2,84 +2,20 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../lib' . PATH_SEPARATOR . '../lang'); -# include("index_po.inc"); include("pkgfuncs_po.inc"); # Add to handle the i18n of My Packages include("aur.inc"); set_lang(); check_sid(); html_header(__("Home")); -# Big Top Level Table (Table 1) -echo "
\n"; -echo "
AUR ".__("Home")."
\n"; -echo "
\n"; -echo "\n"; - -# MAIN: Top -echo "\n"; -print ""; -print ""; - -# MAIN: Bottom Left -print ""; -print ""; -print ""; -print "\n"; -print "
"; -print "

".__("Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR TU Guidelines%h for more information.", array('', '', '', ''))."
"; -print __("Contributed PKGBUILDs must conform to the %hArch Packaging Standards%h otherwise they will be deleted!", array('', ''))."

"; -print "

".__("Remember to vote for your favourite packages!")."
"; -print __("The most popular packages will be provided as binary packages in [community].")."

"; -print "
"; - -#Hey, how about listing the newest pacakges? :D +# Hey, how about listing the newest pacakges? :D $q = "SELECT * FROM Packages "; $q.= "WHERE DummyPkg != 1 "; $q.= "ORDER BY GREATEST(SubmittedTS,ModifiedTS) DESC "; $q.= "LIMIT 0 , 10"; -$result = db_query($q,$dbh); -# Table 2 -print ''; -print ''; -print ''; -print ''; - -while ($row = mysql_fetch_assoc($result)) { - print ''; - print ''; - print ''; - print ''."\n"; -} -print ""; -print ""; -print "
'; -print ' '.__("Recent Updates").' '; -print '
'; - - print ''; - print $row["Name"]." ".$row["Version"].""; - - print ''; - - # figure out the mod string - $mod_int = intval($row["ModifiedTS"]); - $sub_int = intval($row["SubmittedTS"]); - if ($mod_int != 0) { - $modstring = gmdate("r", $mod_int); - } - elseif ($sub_int != 0) { - $modstring = ' '.gmdate("r", $sub_int); - } - else { - $mod_string = "(unknown)"; - } - print ''.$modstring.''; - print '
"; -# End Table 2 - -# MAIN: Bottom Right -print "
"; +$result_newest = db_query($q,$dbh); # AUR STATISTICS - $q = "SELECT count(*) FROM Packages,PackageLocations WHERE Packages.LocationID = PackageLocations.ID AND PackageLocations.Location = 'unsupported'"; $result = db_query($q, $dbh); $row = mysql_fetch_row($result); @@ -121,22 +57,6 @@ if (!empty($user)) { $row = mysql_fetch_row($result); $flagged_outdated = $row[0]; - print ""; - - print ""; - print ""; - print ""; - - # Number of packages in unsupported - print ""; - print ""; - print ""; - print ""; - # If the user is a TU calculate the number of the packages $atype = account_from_sid($_COOKIE["AURSID"]); @@ -145,79 +65,12 @@ if (!empty($user)) { $result = db_query($q, $dbh); $row = mysql_fetch_row($result); $maintainer_community_count = $row[0]; - - print ""; - print ""; - print ""; - print ""; } - - # Number of outdated packages - print ""; - print ""; - print ""; - print ""; - - print "
"; - print "".__("My Statistics").""; - print "
"; - print "".__("Packages in unsupported").""; - print "$maintainer_unsupported_count
"; - print "".__("Packages in [community]").""; - print "$maintainer_community_count
"; - print "".__("Out-of-date").""; - print "$flagged_outdated

"; } -print ""; - -print ""; -print ""; -print ""; - -print ""; -print ""; -print ""; -print ""; - -print ""; -print ""; -print ""; -print ""; +include('front_page.php'); -print ""; -print ""; -print ""; -print ""; - -print ""; -print ""; -print ""; -print ""; - -print ""; -print ""; -print ""; -print ""; - -print "
"; -print "".__("Statistics").""; -print "
"; -print "".__("Packages in unsupported").""; -print "$unsupported_count
"; -print "".__("Packages in [community]").""; -print "$community_count
"; -print "".__("Packages added or updated in the past 7 days").""; -print "$update_count
"; -print "".__("Registered Users").""; -print "$user_count
"; -print "".__("Trusted Users").""; -print "$tu_count
"; - -# Close out the right column -print "
\n"; -# End Table 1 -echo "
".__("DISCLAIMER").""; -echo "
"; -echo "
"; html_footer(AUR_VERSION); + # vim: ts=2 sw=2 noet ft=php ?> diff --git a/web/template/front_page.php b/web/template/front_page.php new file mode 100644 index 00000000..ab6ace2a --- /dev/null +++ b/web/template/front_page.php @@ -0,0 +1,165 @@ +
+
+AUR +
+
+ + + + + + + +
+

+ +' + ,'' + ,'' + ,'' + ) + ); +?> + +
+ +must conform to the %hArch Packaging Standards%h otherwise they will be deleted!" + ,array('' + ,'' + ) + ); +?> + +

+

+ +
+ +

+
+ + + + + + + + + + + + + + + + +
+ +
+"> + + + '.gmdate("r", $sub_int); +else: + $mod_string = "(unknown)"; +endif; +?> + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+
+
\ No newline at end of file -- cgit v1.2.3-24-g4f1b