From fb1fc1a020c9357972a264ccdb15fb86bdea8a85 Mon Sep 17 00:00:00 2001 From: pjmattal Date: Thu, 28 Jul 2005 15:44:46 +0000 Subject: revamped front page closes #2850, #2993, and part of #2992 --- web/html/images/new.gif | Bin 0 -> 116 bytes web/html/images/rss.gif | Bin 0 -> 753 bytes web/html/index.php | 127 ++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 111 insertions(+), 16 deletions(-) create mode 100644 web/html/images/new.gif create mode 100644 web/html/images/rss.gif (limited to 'web/html') diff --git a/web/html/images/new.gif b/web/html/images/new.gif new file mode 100644 index 00000000..7df48235 Binary files /dev/null and b/web/html/images/new.gif differ diff --git a/web/html/images/rss.gif b/web/html/images/rss.gif new file mode 100644 index 00000000..d1b03eb4 Binary files /dev/null and b/web/html/images/rss.gif differ diff --git a/web/html/index.php b/web/html/index.php index ac5026b3..88413f21 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -74,40 +74,133 @@ if (isset($_REQUEST["user"]) || isset($_REQUEST["pass"])) { # html_header(); +# Big Top Level Table (Table 1) print "\n"; + +# Main front page row (split into halves) print "\n"; -print " "; +print ""; +print "
"; -print "

".__("Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h.", array('', ''))."

"; -print "

".__("If you have feedback about the AUR, please leave it in %hFlyspray%h.", array('', ''))."

"; -print "

".__("Email discussion about the AUR takes place on the %sTUR Users List%s.", array('', '')); -print "

".__("Though we can't vouch for their contents, we provide a %hlist of user repositories%h for your convenience.", array('', ''))."

"; + +# Left half of front page +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 "

".__("If you have feedback about the AUR, please leave it in %hFlyspray%h.", array('', ''))."
"; +print __("Email discussion about the AUR takes place on the %sTUR Users List%s.", array('', ''))."

"; +#print "

".__("Though we can't vouch for their contents, we provide a %hlist of user repositories%h for your convenience.", array('', ''))."

"; print "
\n"; +# PACKAGE COUNTS + +$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); +$unsupported_count = $row[0]; + +$q = "SELECT count(*) FROM Packages,PackageLocations WHERE Packages.LocationID = PackageLocations.ID AND PackageLocations.Location = 'community'"; +$result = db_query($q, $dbh); +$row = mysql_fetch_row($result); +$community_count = $row[0]; + +$q = "SELECT count(*) from Users"; +$result = db_query($q, $dbh); +$row = mysql_fetch_row($result); +$user_count = $row[0]; + +$q = "SELECT count(*) from Users,AccountTypes WHERE Users.AccountTypeID = AccountTypes.ID AND AccountTypes.AccountType = 'Trusted User'"; +$result = db_query($q, $dbh); +$row = mysql_fetch_row($result); +$tu_count = $row[0]; + +print ""; + +print ""; +print ""; +print ""; + +print ""; +print ""; +print ""; +print ""; + +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 "".__("Registered Users").""; +print "$user_count
"; +print "".__("Trusted Users").""; +print "$tu_count
"; + #Hey, how about listing the newest pacakges? :D $q = "SELECT * FROM Packages "; $q.= "WHERE DummyPkg != 1 "; $q.= "ORDER BY SubmittedTS DESC "; $q.= "LIMIT 0 , 10"; $result = db_query($q,$dbh); -print '
'.__("Recent Updates").'(rss)
'."\n"; +# Table 2 +print '
'; +print ''; +print ''; +print ''; + while ($row = mysql_fetch_assoc($result)) { - print ''; + print ''; + + print ''; + print ''; print ''."\n"; } -print '
'; +print ' '.__("Recent Updates").' '; +print '
- '; + print '
'; + + print ''; print $row["Name"]." ".$row["Version"].""; - #print ''.intval($row["ModifiedTS"]).''; + + # figure out the mod string + $mod_int = intval($row["ModifiedTS"]); + $sub_int = intval($row["SubmittedTS"]); + if ($mod_int != 0) { + $modstring = date("r", $mod_int); + } + elseif ($sub_int != 0) { + $modstring = ' '.date("r", $sub_int); + } + else { + $mod_string = "(unknown)"; + } + print ''.$modstring.''; + print '
'; +print "
"; +# End Table 2 -#print __("This is where the intro text will go."); -#print __("For now, it's just a place holder."); -#print __("It's more important to get the login functionality finished."); -#print __("After that, this can be filled in with more meaningful text."); +# Now go to the second (right) column print " "; -# XXX Is this the proper way to add some spacing between table cells? -# print "   "; print " \n"; + +# Now present the user login stuff if (!isset($_COOKIE["AURSID"])) { # the user is not logged in, give them login widgets # @@ -136,10 +229,12 @@ if (!isset($_COOKIE["AURSID"])) { print __("Logged-in as: %h%s%h", array("", username_from_sid($_COOKIE["AURSID"]), "")); } + +# Close out the right column print " "; print "\n"; print "\n"; - +# End Table 1 html_footer("Version 1.1 \$Id$"); # vim: ts=2 sw=2 noet ft=php -- cgit v1.2.3-24-g4f1b