summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-26 15:47:04 +0200
committerErich Eckner <git@eckner.net>2018-04-26 15:47:14 +0200
commit5eb4ae1264ddbbb277c13d04b0db56341e940908 (patch)
tree05dac5079f96817783a10180636fc3e40bb075eb
parentc0e46f92d6e8cd6cdc8ca76c38b576d9ba10c66c (diff)
downloadarchweb32-5eb4ae1264ddbbb277c13d04b0db56341e940908.tar.xz
lib/style.php: new to reduce duplicate code
-rw-r--r--lib/style.php65
-rw-r--r--packages/index.php59
-rw-r--r--packages/pkginfo.php61
3 files changed, 77 insertions, 108 deletions
diff --git a/lib/style.php b/lib/style.php
new file mode 100644
index 0000000..b7e35ad
--- /dev/null
+++ b/lib/style.php
@@ -0,0 +1,65 @@
+<?php
+
+function print_header($title) {
+?>
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>Arch Linux 32 - <?php print $title; ?></title>
+ <link rel="stylesheet" type="text/css" href="/static/archweb.css" media="screen, projection" />
+ <link rel="icon" type="image/x-icon" href="/static/favicon.ico" />
+ <link rel="shortcut icon" type="image/x-icon" href="/static/favicon.ico" />
+ </head>
+ <body class="">
+ <div id="archnavbar" class="anb-packages">
+ <div id="archnavbarlogo">
+ <h1><a href="/" title="Return to the main page">Arch Linux</a></h1>
+ </div>
+ <div id="archnavbarmenu">
+ <ul id="archnavbarlist">
+ <li id="anb-home"><a href="https://www.archlinux32.org/">Home</a></li>
+ <li id="anb-news"><a href="https://news.archlinux32.org/">News</a></li>
+ <li id="anb-packages"><a href="https://packages.archlinux32.org/">Packages</a></li>
+ <li id="anb-forums"><a href="https://bbs.archlinux32.org/">Forums</a></li>
+ <li id="anb-bugs"><a href="https://bugs.archlinux32.org/" title="Report and track bugs">Bugs</a></li>
+ <li id="anb-mailing-list"><a href="https://lists.archlinux.org/listinfo/arch-ports">Mailing List</a></li>
+ <li id="anb-download"><a href="https://www.archlinux32.org/download/" title="Get Arch Linux">Download</a></li>
+ <li id="anb-arch-linux-official"><a href="https://www.archlinux.org/">Arch Linux Official</a></li>
+ </ul>
+ </div>
+ </div>
+ <div id="content">
+<?php
+}
+
+function print_footer() {
+?>
+ <div id="footer">
+ <p>
+ Copyright © 2002-2018 <a href="mailto:jvinet@zeroflux.org" title="Contact Judd Vinet">Judd Vinet</a> and <a href="mailto:aaron@archlinux.org" title="Contact Aaron Griffin">Aaron Griffin</a>.
+ </p>
+ <p>
+ The Arch Linux name and logo are recognized <a href="https://wiki.archlinux.org/index.php/DeveloperWiki:TrademarkPolicy" title="Arch Linux Trademark Policy">trademarks</a>. Some rights reserved.
+ </p>
+ <p>
+ The registered trademark Linux® is used pursuant to a sublicense from LMI, the exclusive licensee of Linus Torvalds, owner of the mark on a world-wide basis.
+ </p>
+ </div>
+ </div>
+ <script type="application/ld+json">
+ {
+ "@context": "http://schema.org",
+ "@type": "WebSite",
+ "url": "/",
+ "potentialAction": {
+ "@type": "SearchAction",
+ "target": "/?q={search_term}",
+ "query-input": "required name=search_term"
+ }
+ }
+ </script>
+ </body>
+</html>
+<?php
+}
diff --git a/packages/index.php b/packages/index.php
index b2fea4d..c0f4921 100644
--- a/packages/index.php
+++ b/packages/index.php
@@ -1,6 +1,7 @@
<?php
include "lib/mysql.php";
+ include "lib/style.php";
foreach (array("bugs","sort") as $expected_param)
if (! isset($_GET[$expected_param]))
@@ -276,34 +277,9 @@
};
+ print_header("Package Search");
+
?>
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8" />
- <title>Arch Linux 32 - Package Search</title>
- <link rel="stylesheet" type="text/css" href="/static/archweb.css" media="screen, projection" />
- <link rel="icon" type="image/x-icon" href="/static/favicon.ico" />
- <link rel="shortcut icon" type="image/x-icon" href="/static/favicon.ico" />
- </head>
- <body class="">
-<?php show_warning_on_offline_slave(); ?>
- <div id="archnavbar" class="anb-packages">
- <div id="archnavbarlogo"><h1><a href="/" title="Return to the main page">Arch Linux</a></h1></div>
- <div id="archnavbarmenu">
- <ul id="archnavbarlist">
- <li id="anb-home"><a href="https://www.archlinux32.org/">Home</a></li>
- <li id="anb-news"><a href="https://news.archlinux32.org/">News</a></li>
- <li id="anb-packages"><a href="https://packages.archlinux32.org/">Packages</a></li>
- <li id="anb-forums"><a href="https://bbs.archlinux32.org/">Forums</a></li>
- <li id="anb-bugs"><a href="https://bugs.archlinux32.org/" title="Report and track bugs">Bugs</a></li>
- <li id="anb-mailing-list"><a href="https://lists.archlinux.org/listinfo/arch-ports">Mailing List</a></li>
- <li id="anb-download"><a href="https://www.archlinux32.org/download/" title="Get Arch Linux">Download</a></li>
- <li id="anb-arch-linux-official"><a href="https://www.archlinux.org/">Arch Linux Official</a></li>
- </ul>
- </div>
- </div>
- <div id="content">
<div id="pkglist-search" class="box filter-criteria">
<h2>Package Search</h2>
<form id="pkg-search" method="get" action="/">
@@ -442,29 +418,6 @@ if (count($exact_matches) > 0) {
detailed information about packages located in the 32 bit repositories.
</p>
</div>
- <div id="footer">
- <p>
- Copyright © 2002-2018 <a href="mailto:jvinet@zeroflux.org" title="Contact Judd Vinet">Judd Vinet</a> and <a href="mailto:aaron@archlinux.org" title="Contact Aaron Griffin">Aaron Griffin</a>.
- </p>
- <p>
- The Arch Linux name and logo are recognized <a href="https://wiki.archlinux.org/index.php/DeveloperWiki:TrademarkPolicy" title="Arch Linux Trademark Policy">trademarks</a>. Some rights reserved.
- </p>
- <p>
- The registered trademark Linux® is used pursuant to a sublicense from LMI, the exclusive licensee of Linus Torvalds, owner of the mark on a world-wide basis.
- </p>
- </div>
- </div>
- <script type="application/ld+json">
- {
- "@context": "http://schema.org",
- "@type": "WebSite",
- "url": "/",
- "potentialAction": {
- "@type": "SearchAction",
- "target": "/?q={search_term}",
- "query-input": "required name=search_term"
- }
- }
- </script>
- </body>
-</html>
+<?php
+
+ print_footer();
diff --git a/packages/pkginfo.php b/packages/pkginfo.php
index 06ca8dd..4c0e337 100644
--- a/packages/pkginfo.php
+++ b/packages/pkginfo.php
@@ -1,6 +1,7 @@
<?php
include "lib/mysql.php";
+ include "lib/style.php";
$json_content = json_decode(
file_get_contents(
@@ -228,36 +229,9 @@
while ($row = $mysql_result -> fetch_assoc())
$elsewhere[] = $row;
+ print_header($content["Name"] . " " . $content["Version"] . " (" . $content["Architecture"] . ")");
+
?>
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8" />
- <title>Arch Linux 32 - <?php print $content["Name"] . " " . $content["Version"] . " (" . $content["Architecture"]; ?>)</title>
- <link rel="stylesheet" type="text/css" href="/static/archweb.css" media="screen, projection" />
- <link rel="icon" type="image/x-icon" href="/static/favicon.ico" />
- <link rel="shortcut icon" type="image/x-icon" href="/static/favicon.ico" />
- </head>
- <body class="">
-<?php show_warning_on_offline_slave(); ?>
- <div id="archnavbar" class="anb-packages">
- <div id="archnavbarlogo">
- <h1><a href="/" title="Return to the main page">Arch Linux</a></h1>
- </div>
- <div id="archnavbarmenu">
- <ul id="archnavbarlist">
- <li id="anb-home"><a href="https://www.archlinux32.org/">Home</a></li>
- <li id="anb-news"><a href="https://news.archlinux32.org/">News</a></li>
- <li id="anb-packages"><a href="https://packages.archlinux32.org/">Packages</a></li>
- <li id="anb-forums"><a href="https://bbs.archlinux32.org/">Forums</a></li>
- <li id="anb-bugs"><a href="https://bugs.archlinux32.org/" title="Report and track bugs">Bugs</a></li>
- <li id="anb-mailing-list"><a href="https://lists.archlinux.org/listinfo/arch-ports">Mailing List</a></li>
- <li id="anb-download"><a href="https://www.archlinux32.org/download/" title="Get Arch Linux">Download</a></li>
- <li id="anb-arch-linux-official"><a href="https://www.archlinux.org/">Arch Linux Official</a></li>
- </ul>
- </div>
- </div>
- <div id="content">
<div id="archdev-navbar">
</div>
<div id="pkgdetails" class="box">
@@ -531,29 +505,6 @@ if (count($elsewhere)>0) {
</div>
</div>
</div>
- <div id="footer">
- <p>
- Copyright © 2002-2018 <a href="mailto:jvinet@zeroflux.org" title="Contact Judd Vinet">Judd Vinet</a> and <a href="mailto:aaron@archlinux.org" title="Contact Aaron Griffin">Aaron Griffin</a>.
- </p>
- <p>
- The Arch Linux name and logo are recognized <a href="https://wiki.archlinux.org/index.php/DeveloperWiki:TrademarkPolicy" title="Arch Linux Trademark Policy">trademarks</a>. Some rights reserved.
- </p>
- <p>
- The registered trademark Linux® is used pursuant to a sublicense from LMI, the exclusive licensee of Linus Torvalds, owner of the mark on a world-wide basis.
- </p>
- </div>
- </div>
- <script type="application/ld+json">
- {
- "@context": "http://schema.org",
- "@type": "WebSite",
- "url": "/",
- "potentialAction": {
- "@type": "SearchAction",
- "target": "/?q={search_term}",
- "query-input": "required name=search_term"
- }
- }
- </script>
- </body>
-</html>
+<?php
+
+ print_footer();