From 87e528a21a924adaa617af9d8207c759be4998c2 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 22 May 2019 13:01:14 +0200 Subject: feed.php: check for 0 arguments first to avoid warnings --- feed.php | 387 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 195 insertions(+), 192 deletions(-) diff --git a/feed.php b/feed.php index 15250f5..61c74ec 100644 --- a/feed.php +++ b/feed.php @@ -18,6 +18,200 @@ array_splice( 0, 2 ); +if (count($uri_parts) == 0) { // index page + + require_once BASE . "/lib/style.php"; + require_once BASE . "/lib/format.php"; + + print_header("RSS - Feeds"); + + $result = mysql_run_query( + "SELECT DISTINCT `architectures`.`name` FROM `architectures`" . + mysql_join_architectures_repositories() . + " WHERE `repositories`.`is_on_master_mirror`" . + " ORDER BY `name`" + ); + $archs = array(); + while ($row = $result -> fetch_assoc()) + $archs[$row['name']] = $row['name'] . '/'; + + $print_archs = array_merge( + array( + '' => '', + 'All Arches' => 'all/' + ), + $archs + ); + + $result = mysql_run_query( + "SELECT DISTINCT `repositories`.`name` FROM `repositories` WHERE `repositories`.`is_on_master_mirror` ORDER BY `name`" + ); + $repos = array(); + while ($row = $result -> fetch_assoc()) + $repos[$row['name']] = $row['name'] . '/'; + + $print_repos = array_merge( + array( + 'All Repos' => '' + ), + $repos + ); + + $bugtracker_projects = array( + 0 => 'All Projects', + 1 => 'Arch Linux 32' + ); + + $bugtracker_operations = array( + 'Opened' => '', + 'Edited' => 'topic=edit&', + 'Closed' => 'topic=clo&' + ); + + function print_arches_header() { + global $print_archs; + foreach ($print_archs as $arch => $dummy) { + print " \n"; + print " " . $arch . "\n"; + print " \n"; + }; + } + + function print_feeds($prefix) { + global $print_archs; + global $print_repos; + foreach ($print_repos as $repo => $dummy) { + print " \n"; + print " \n"; + print " " . $repo . "\n"; + print " \n"; + foreach ($print_archs as $arch => $dummy) { + if ($arch == '') + continue; + print " \n"; + print " Feed\n"; + print " \n"; + } + print " \n"; + } + } + + function print_feeds_table($prefix) { + print " \n"; + print " \n"; + print " \n"; + print_arches_header(); + print " \n"; + print " \n"; + print " \n"; + print_feeds($prefix); + print " \n"; + print "
\n"; + } + + ?> +
+

+ RSS Feeds +

+

+ Several RSS feeds are available for consumption from the Arch32 website. + The majority of these are package-related and allow feeds to be customized for the updates you care about. +

+

+ News Feed +

+

+ Grab the + news item feed + to keep up-to-date with the latest news from the Arch Linux development staff. +

+

+ Package Feeds +

+

+ If you are interested in + all package updates, + then grab this feed. + +

+ Recently added packages. (to be implemented) +

+ +

+ Recently removed packages. (to be implemented) +

+ +

+ Release Feed +

+

+ Grab the + ISO release feed + if you want to help seed the ISO release torrents as they come out. +

+

+ Development Feeds +

+

+ Subscribe to any of the following to track bug tickets and feature requests from the + Arch Linux 32 Bugtracker: +

+ + + + + $dummy) { + print " \n"; + } + + ?> + + + + $project) { + print " \n"; + print " \n"; + foreach ($bugtracker_operations as $label => $option) { + print " \n"; + } + print " \n"; + } + + ?> + +
+ Project + \n"; + print " Recently " . $label . " Tasks\n"; + print "
\n"; + print " " . $project . "\n"; + print " \n"; + print " Feed\n"; + print "
+
+ fetch_assoc()) - $archs[$row['name']] = $row['name'] . '/'; - -$print_archs = array_merge( - array( - '' => '', - 'All Arches' => 'all/' - ), - $archs -); - -$result = mysql_run_query( - "SELECT DISTINCT `repositories`.`name` FROM `repositories` WHERE `repositories`.`is_on_master_mirror` ORDER BY `name`" -); -$repos = array(); -while ($row = $result -> fetch_assoc()) - $repos[$row['name']] = $row['name'] . '/'; - -$print_repos = array_merge( - array( - 'All Repos' => '' - ), - $repos -); - -$bugtracker_projects = array( - 0 => 'All Projects', - 1 => 'Arch Linux 32' -); - -$bugtracker_operations = array( - 'Opened' => '', - 'Edited' => 'topic=edit&', - 'Closed' => 'topic=clo&' -); - -function print_arches_header() { - global $print_archs; - foreach ($print_archs as $arch => $dummy) { - print " \n"; - print " " . $arch . "\n"; - print " \n"; - }; -} - -function print_feeds($prefix) { - global $print_archs; - global $print_repos; - foreach ($print_repos as $repo => $dummy) { - print " \n"; - print " \n"; - print " " . $repo . "\n"; - print " \n"; - foreach ($print_archs as $arch => $dummy) { - if ($arch == '') - continue; - print " \n"; - print " Feed\n"; - print " \n"; - } - print " \n"; - } -} - -function print_feeds_table($prefix) { - print " \n"; - print " \n"; - print " \n"; - print_arches_header(); - print " \n"; - print " \n"; - print " \n"; - print_feeds($prefix); - print " \n"; - print "
\n"; -} - -?> -
-

- RSS Feeds -

-

- Several RSS feeds are available for consumption from the Arch32 website. - The majority of these are package-related and allow feeds to be customized for the updates you care about. -

-

- News Feed -

-

- Grab the - news item feed - to keep up-to-date with the latest news from the Arch Linux development staff. -

-

- Package Feeds -

-

- If you are interested in - all package updates, - then grab this feed. - -

- Recently added packages. (to be implemented) -

- -

- Recently removed packages. (to be implemented) -

- -

- Release Feed -

-

- Grab the - ISO release feed - if you want to help seed the ISO release torrents as they come out. -

-

- Development Feeds -

-

- Subscribe to any of the following to track bug tickets and feature requests from the - Arch Linux 32 Bugtracker: -

- - - - - $dummy) { - print " \n"; -} - -?> - - - - $project) { - print " \n"; - print " \n"; - foreach ($bugtracker_operations as $label => $option) { - print " \n"; - } - print " \n"; -} - -?> - -
- Project - \n"; - print " Recently " . $label . " Tasks\n"; - print "
\n"; - print " " . $project . "\n"; - print " \n"; - print " Feed\n"; - print "
-
-