summaryrefslogtreecommitdiffstats
path: root/site
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-02-22 10:10:56 (EST)
committer Francis Rowe <info@gluglug.org.uk>2015-02-22 10:10:56 (EST)
commit4c23306fe6fe2f678d61884a20a6ff49907134a7 (patch)
tree3f8bc53d418fd3d516a55e8ae0e14984676f125b /site
parent19806e7d84e559a167a2e75076ce4b47e9d7dfeb (diff)
downloadlibreboot.org-4c23306fe6fe2f678d61884a20a6ff49907134a7.zip
libreboot.org-4c23306fe6fe2f678d61884a20a6ff49907134a7.tar.gz
libreboot.org-4c23306fe6fe2f678d61884a20a6ff49907134a7.tar.bz2
Download page: separate FTP mirrors into their own subsection
Diffstat (limited to 'site')
-rw-r--r--site/download/index.php19
-rw-r--r--site/variables.template.php36
2 files changed, 41 insertions, 14 deletions
diff --git a/site/download/index.php b/site/download/index.php
index d21da16..1026dd9 100644
--- a/site/download/index.php
+++ b/site/download/index.php
@@ -121,23 +121,18 @@
are highly recommended.
</p>
- <ul>
<?php
- if (count($lbHttpMirror)>0) {
- for ($server=0; $server<count($lbHttpMirror); $server++) {
+ /* show HTTP mirrors */
+ echo list_items($lbHttpMirror,"HTTP mirrors not added yet.",0,count($lbHttpMirror));
?>
- <li><a href="<?php echo $lbHttpMirror[$server]; ?>"><?php echo $lbHttpMirror[$server]; ?></a></li>
+ <h2 id="ftp">FTP mirrors</h2>
<?php
- }
- } else {
+ /* show HTTP mirrors */
+ echo list_items($lbFtpMirror,"FTP mirrors not added yet.",0,count($lbFtpMirror));
?>
- <li>HTTP mirrors not added yet.</li>
-<?php
- }
-?>
- </ul>
+
- <h2 id="mirror">Mirroring <?php echo $lbProjectName; ?></h2>
+ <h2 id="mirror">Rsync mirrors (for mirroring <?php echo $lbProjectName; ?>)</h2>
<p>
Create a directory in your web server document root (e.g. <?php echo $lbProjectName; ?>/),
and add one of these to your crontab:
diff --git a/site/variables.template.php b/site/variables.template.php
index 98bda0b..54a95a1 100644
--- a/site/variables.template.php
+++ b/site/variables.template.php
@@ -20,6 +20,35 @@
<?php
/* Copy this to variables.php, and adapt for your needs */
+ /*
+ * ------FUNCTIONS:
+ */
+
+ /* Generic function for showing a list of URLs */
+ function list_items($arrayMirrors,$strNotFoundMessage,$forIndexStart,$forIndexbelow) {
+?>
+ <ul>
+<?php
+ if (count($arrayMirrors)>0) {
+ for ($server=$forIndexStart; $server<$forIndexbelow; $server++) {
+?>
+ <li><a href="<?php echo $arrayMirrors[$server]; ?>"><?php echo $arrayMirrors[$server]; ?></a></li>
+<?php
+ }
+ } else {
+?>
+ <li><?php echo strNotFoundMessage; ?></li>
+<?php
+ }
+?>
+ </ul>
+<?php
+ }
+
+ /*
+ * ------DATA:
+ */
+
/* Project name
* NOTE: Not all parts of the site use this, because
* parts of the site talking about things that are very
@@ -51,11 +80,14 @@
$lbHttpMirror = array(
"http://www.libreboot.org/release/",
"https://freedombox.org/libreboot/",
- "http://www.mirrorservice.org/sites/libreboot.org/release/",
+ "http://www.mirrorservice.org/sites/libreboot.org/release/"
+ );
+ /* HTTP mirrors (for release archives) */
+ $lbFtpMirror = array(
"ftp://ftp.mirrorservice.org/sites/libreboot.org/release/"
);
- /* rsync servers. Put the main one first */
+ /* rsync servers (for release archives). Put the main one first */
$lbRsyncServer = array (
"libreboot.org::mirrormirror",
"rsync://rsync.mirrorservice.org/libreboot.org/release/"