summaryrefslogtreecommitdiff
path: root/pages/news.php
diff options
context:
space:
mode:
authordeva <deva>2008-10-06 18:13:56 +0000
committerdeva <deva>2008-10-06 18:13:56 +0000
commit415e90a2e059ea32f6851dfb9b3c018b0a731a81 (patch)
treea2e7d809f4783f521a3a985716a26a6543acfc9d /pages/news.php
parentcce5e7710295021b41d9aaecc503a60fb99256be (diff)
Put the webpages in.
Diffstat (limited to 'pages/news.php')
-rw-r--r--pages/news.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/pages/news.php b/pages/news.php
new file mode 100644
index 0000000..9d2f857
--- /dev/null
+++ b/pages/news.php
@@ -0,0 +1,58 @@
+<div class="header">
+ <div class="header_news">
+ <div class="header_text">News</div>
+ </div>
+</div>
+<a href="rss.xml" class="rss"></a>
+<a href="rss.xml" class="rsstitle">Syndicate</a>
+<?php
+
+include_once($UTIL_DIR . "/newsletter.php");
+
+if($action == "subscribe") {
+
+ $regexp = "^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$";
+
+ if($email != "your@email.here" &&
+ ereg($regexp, $email, $regs)) {
+ $mailinglist = new Mailinglist($DATA_DIR . "/mailinglist.xml");
+ $mailinglist->subscribe($email);
+ echo "<p>You have now been subscribed to the DIE newsletter...</p>\n";
+ } else {
+ echo "<p><strong><em>" . $email . "</em> is not a valid email address...</strong></p>\n";
+ }
+}
+
+if($action == "unsubscribe") {
+ $mailinglist = new Mailinglist($DATA_DIR . "/mailinglist.xml");
+ $mailinglist->unsubscribe($email);
+ echo "<p>You have now been unsubscribed from the DIE newsletter...</p>\n";
+}
+
+?>
+<div class="news_form">
+<form action="?page=news&amp;action=subscribe" method="post">
+<p style="text-align: center;">
+Subscribe to low-traffic mailinglist:<br/>
+Email: <input name="email" value="your@email.here"/>
+<button type="submit">Subscribe</button>
+</p>
+</form>
+</div>
+<?php
+include_once($UTIL_DIR."/news.php");
+
+$news = new News($DATA_DIR."/news.xml");
+
+if($show == "all") {
+ $news->show(-1, "all");
+} else {
+ $news->show(4, "main");
+?>
+
+<div class="more">
+<a href="?page=news&amp;show=all">more &gt;&gt;</a>
+</div>
+<?php
+}
+?>