summaryrefslogtreecommitdiff
path: root/feeds/index.php
blob: 3678d85cbb87f291c2a9cdd77dd696e2e7744d82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?php

require_once "../init.php";

require_once BASE . "/lib/mysql.php";
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 "                <th>\n";
    print "                  " . $arch . "\n";
    print "                </th>\n";
  };
}

function print_feeds($prefix) {
  global $print_archs;
  global $print_repos;
  foreach ($print_repos as $repo => $dummy) {
    print "              <tr>\n";
    print "                <td>\n";
    print "                  <strong>" . $repo . "</strong>\n";
    print "                </td>\n";
    foreach ($print_archs as $arch => $dummy) {
      if ($arch == '')
        continue;
      print "                <td>\n";
      print "                  <a href=\"/feeds/packages/" . $prefix . $print_archs[$arch] . $print_repos[$repo] . "\" class=\"rss\">Feed</a>\n";
      print "                </td>\n";
    }
    print "              </tr>\n";
  }
}

function print_feeds_table($prefix) {
  print "          <table class=\"pretty2\">\n";
  print "            <thead>\n";
  print "              <tr>\n";
  print_arches_header();
  print "              </tr>\n";
  print "            </thead>\n";
  print "            <tbody>\n";
  print_feeds($prefix);
  print "            </tbody>\n";
  print "          </table>\n";
}

?>
      <div id="rss-feeds" class="box">
        <h2>
          RSS Feeds
        </h2>
        <p>
          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.
        </p>
        <h3>
          News Feed
        </h3>
        <p>
          Grab the
          <a href="https://news.archlinux32.org/" class="rss" title="Arch Linux news feed">news item feed</a>
          to keep up-to-date with the latest news from the Arch Linux development staff.
        </p>
        <h3>
          Package Feeds
        </h3>
        <p>
          If you are interested in
          <a href="/feeds/packages/" class="rss" title="Arch Linux 32 package updates feed">all package updates</a>,
          then grab this feed.
<?php

print_feeds_table('');

?>
          <p>
            <s>Recently added packages.</s> (to be implemented)
          </p>
<?php

// print_feeds_table('added/');

?>
          <p>
            <s>Recently removed packages.</s> (to be implemented)
          </p>
<?php

// print_feeds_table('removed/');

?>
          <h3>
            <s>Release Feed</s>
          </h3>
          <p>
            <s>Grab the
            <a href="/feeds/releases/" class="rss" title="Arch Linux release feed">ISO release feed</a>
            if you want to help seed the ISO release torrents as they come out.
            </s> (to be implemented)
          </p>
          <h3>
            Development Feeds
          </h3>
          <p>
            Subscribe to any of the following to track bug tickets and feature requests from the
            <a href="https://bugs.archlinux32.org/" title="Arch Linux 32 Bugs">Arch Linux 32 Bugtracker</a>:
          </p>
          <table class="pretty2">
            <thead>
              <tr>
                <th>
                  Project
                </th>
<?php

foreach ($bugtracker_operations as $label => $dummy) {
  print "                <th>\n";
  print "                  Recently " . $label . " Tasks\n";
  print "                </th>\n";
}

?>
              </tr>
            </thead>
            <tbody>
<?php

foreach ($bugtracker_projects as $id => $project) {
  print "              <tr>\n";
  print "                <td>\n";
  print "                  " . $project . "\n";
  print "                </td>\n";
  foreach ($bugtracker_operations as $label => $option) {
    print "                <td>\n";
    print "                  <a href=\"https://bugs.archlinux.org/feed.php?feed_type=rss2&" . $option . "project=" . $id . "\" class=\"rss\">Feed</a>\n";
    print "                </td>\n";
  }
  print "              </tr>\n";
}

?>
            </tbody>
          </table>
        </div>
<?php

print_footer();