\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 $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 "
"; # 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); $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]; $targstamp = intval(strtotime("-7 days")); $q = "SELECT count(*) from Packages WHERE (Packages.SubmittedTS >= $targstamp OR Packages.ModifiedTS >= $targstamp)"; $result = db_query($q, $dbh); $row = mysql_fetch_row($result); $update_count = $row[0]; # Added the user statistcs. # Added by: dsa $user = username_from_sid($_COOKIE["AURSID"]); if (!empty($user)) { $q = "SELECT count(*) FROM Packages,PackageLocations,Users WHERE Packages.MaintainerUID = Users.ID AND Packages.LocationID = PackageLocations.ID AND PackageLocations.Location = 'unsupported' AND Users.Username='".mysql_real_escape_string($user)."'"; $result = db_query($q, $dbh); $row = mysql_fetch_row($result); $maintainer_unsupported_count = $row[0]; $q = "SELECT count(*) FROM Packages,Users WHERE Packages.OutOfDate = 1 AND Packages.MaintainerUID = Users.ID AND Users.Username='".mysql_real_escape_string($user)."'"; $result = db_query($q, $dbh); $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"]); if ($atype == 'Trusted User') { $q = "SELECT count(*) FROM Packages,PackageLocations,Users WHERE Packages.MaintainerUID = Users.ID AND Packages.LocationID = PackageLocations.ID AND PackageLocations.Location = 'community' AND Users.Username='".mysql_real_escape_string($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 ""; 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 ?>