$ND::TEMPLATE->param(Targets => listTargets());
}
$TEMPLATE->param(Coords => param('coords') ? param('coords') : '1:1:1');
+ my ($css) = $DBH->selectrow_array(q{SELECT css FROM users WHERE uid = $1},undef,$ND::UID);
+ $TEMPLATE->param(CSS => $css);
}
$TEMPLATE->param(Error => $ERROR);
--- /dev/null
+#**************************************************************************
+# Copyright (C) 2006 by Michael Andreen <harvATruinDOTnu> *
+# *
+# This program is free software; you can redistribute it and/or modify *
+# it under the terms of the GNU General Public License as published by *
+# the Free Software Foundation; either version 2 of the License, or *
+# (at your option) any later version. *
+# *
+# This program is distributed in the hope that it will be useful, *
+# but WITHOUT ANY WARRANTY; without even the implied warranty of *
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+# GNU General Public License for more details. *
+# *
+# You should have received a copy of the GNU General Public License *
+# along with this program; if not, write to the *
+# Free Software Foundation, Inc., *
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+#**************************************************************************/
+
+package ND::Web::Pages::Settings;
+use strict;
+use warnings FATAL => 'all';
+use ND::Include;
+use CGI qw/:standard/;
+use ND::Web::Include;
+
+$ND::PAGES{settings} = {parse => \&parse, process => \&process, render=> \&render};
+
+sub parse {
+ my ($uri) = @_;
+}
+
+sub process {
+
+}
+
+sub render {
+ my ($DBH,$BODY) = @_;
+
+ $ND::TEMPLATE->param(TITLE => 'Edit site preferences');
+
+ if (defined param 'cmd'){
+ if(param('cmd') eq 'stylesheet'){
+ my $query = $DBH->prepare(q{UPDATE users SET css = NULLIF($2,'') WHERE uid = $1});
+ $query->execute($ND::UID,escapeHTML(param 'stylesheet')) or $ND::ERROR .= p $DBH->errstr;
+ }
+ }
+ my ($css) = $DBH->selectrow_array(q{SELECT css FROM users WHERE uid = $1},undef,$ND::UID);
+ my @stylesheets = ({Style => ''});
+ $css = '' unless defined $css;
+ while (<stylesheets/*.css>){
+ if(m{stylesheets/(\w+)\.css}){
+ push @stylesheets,{Style => $1, Selected => $1 eq $css ? 1 : 0};
+ }
+ }
+ $BODY->param(StyleSheets => \@stylesheets);
+ return $BODY;
+}
+
+1;
+++ /dev/null
-body {
- padding-left: 15em;
- /*padding-right: 12em;*/
- font-family: sans-serif;
- color: black;
- background-color: #D9D9D9;
-}
-#leftbar,#rightbar{
- padding: 0;
- margin: 0;
- position: absolute;
- width: 14em;
- top: 1em;
-}
-#leftbar{
- left: 1em;
-}
-#rightbar{
- right: 1em;
-}
-
-legend {
- color: black;
- background: white;
- border-style: solid;
- border-width: 1px;
- padding: 1px;
-}
-table.boards td {
- /*border-style: solid;
- border-width: 1px;*/
- padding: 2px;
- border-collapse: separate;
- border-spacing: 15pt;
- font-size: larger;
-}
-table.boards{
- border-collapse: separate;
- border-spacing: 5px;
-}
-table.boards th {
- font-size: larger;
-}
-table.boards tr.even {
- background: white;
-}
-
-table.boards a {
- text-decoration: none;
- width: 100%;
- display: block;
-}
-fieldset.forum-post {
- width: 40em;
-}
-fieldset.forum-post legend b {
- font-size: larger;
-}
-div.leftinfo{
- float: left;
- padding-right: 2em;
-}
-p.claimlinks{
- clear: both;
-}
-
-ul.linkbar {
- list-style-type: none;
- width: 13.5em;
- padding: 0;
- margin: 0;
-}
-ul.linkbar li {
- background: white;
- color: black;
- margin: 0.5em 0;
- padding: 0.3em;
- /*border-right: 1em solid black;*/
-}
-ul.linkbar a {
- text-decoration: none;
- width: 100%;
- display: block;
-}
-input.coordsinput {
- width: 4em;
-}
-input.small {
- width: 1.7em;
-}
-tr.odd {
- background: white;
- color: black;
-}
-tr.total {
- background: black;
- color: red;
-}
-
-td.ingal{
- background: blue;
- color: black;
-}
-td.Defend{
- background: green;
- color: black;
-}
-td.AllyDef{
- background: #00FF00;
- color: black;
-}
-td.Attack{
- background: red;
- color: black;
-}
-
-a.Unclaim{
- color: green;
-}
-input.Unclaim{
- background: green;
-}
-a.Claim{
- color: blue;
-}
-a.Join{
- color: #00AAAA;
-}
-input.Join{
- background: #00AAAA;
-}
-
-td.Friendly{
- background: green;
- color: black;
-}
-td.Friendly a{
- color: yellow;
- background: green;
-}
-td.Hostile{
- background: red;
- color: black;
-}
-td.NAP{
- background: blue;
- color: white;
-}
-td.NAP a{
- color: yellow;
- background: blue;
-}
-table.old{
- border: outset 1pt;
- border-collapse: separate;
- border-color: red;
-}
-
-table.closedPlanet{
- border: outset 2pt;
- border-collapse: separate;
- border-color: red;
-}
-li.bash{
- color: #FF9933;
-}
-div.clear {
- clear: both;
- height: 0;
- margin: 0;
- padding: 0;
- line-height: 0.0;
- font-size: 1px;
-}
-
-td.LowestPrio{
- background: red;
- color: black;
-}
-td.MediumPrio{
- background: yellow;
- color: black;
-}
-td.HighestPrio{
- background: green;
- color: black;
-}
use ND::Web::Pages::PlanetNaps;
use ND::Web::Pages::Motd;
use ND::Web::Pages::Forum;
+use ND::Web::Pages::Settings;
--- /dev/null
+body
+{
+ padding-left: 15em;
+ font-size: medium;
+ color: gray;
+ font-family: Sans-Serif;
+ background-color: #f5f5f5;
+}
+#leftbar, #rightbar
+{
+ padding-right: 0px;
+ padding-left: 0px;
+ font-weight: bold;
+ padding-bottom: 0px;
+ margin: 0px;
+ width: 14em;
+ color: olive;
+ padding-top: 0px;
+ position: absolute;
+ top: 1em;
+}
+#leftbar{
+ left: 1em;
+}
+#rightbar{
+ right: 1em;
+}
+
+legend {
+ color: black;
+ background: white;
+ border-style: solid;
+ border-width: 1px;
+ padding: 1px;
+}
+table.boards td
+{
+ border-right: #990000 thin solid;
+ padding-right: 2px;
+ border-top: #990000 thin solid;
+ padding-left: 2px;
+ font-size: larger;
+ padding-bottom: 2px;
+ border-left: #990000 thin solid;
+ padding-top: 2px;
+ border-bottom: #990000 thin solid;
+ border-collapse: separate;
+ border-spacing: 15pt;
+}
+table.boards{
+ border-collapse: separate;
+ border-spacing: 5px;
+}
+table.boards th
+{
+ font-weight: bold;
+ font-size: larger;
+ color: #990000;
+}
+table.boards tr.even {
+ background: white;
+}
+
+table.boards a {
+ text-decoration: none;
+ width: 100%;
+ display: block;
+}
+fieldset.forum-post {
+ width: 40em;
+}
+fieldset.forum-post legend b {
+ font-size: larger;
+}
+div.leftinfo{
+ float: left;
+ padding-right: 2em;
+}
+p.claimlinks{
+ clear: both;
+}
+
+ul.linkbar
+{
+ padding-right: 0px;
+ padding-left: 0px;
+ padding-bottom: 0px;
+ margin: 0px;
+ width: 13.5em;
+ color: #000033;
+ padding-top: 0px;
+}
+ul.linkbar li {
+ background: white;
+ color: black;
+ margin: 0.5em 0;
+ padding: 0.3em;
+ /*border-right: 1em solid black;*/
+}
+ul.linkbar a {
+ text-decoration: none;
+ width: 100%;
+ display: block;
+}
+input.coordsinput {
+ width: 4em;
+}
+input.small {
+ width: 1.7em;
+}
+tr.odd {
+ background: white;
+ color: black;
+}
+tr.total {
+ background: black;
+ color: red;
+}
+
+td.ingal{
+ background: blue;
+ color: black;
+}
+td.Defend{
+ background: green;
+ color: black;
+}
+td.AllyDef
+{
+ background: #ccff00;
+ color: black;
+}
+td.Attack
+{
+ background: tomato;
+ color: black;
+}
+
+a.Unclaim{
+ color: #336666;
+}
+input.Unclaim{
+ background: #336666;
+}
+a.Claim{
+ color: blue;
+}
+a.Join{
+ color: #00AAAA;
+}
+input.Join{
+ background: #00AAAA;
+}
+
+td.Friendly
+{
+ font-weight: bold;
+ background: #ccff00;
+ color: darkolivegreen;
+}
+td.Friendly a
+{
+ font-weight: bold;
+ font-size: larger;
+ background: #ccff00;
+ color: white;
+}
+td.Hostile
+{
+ font-weight: bold;
+ background: tomato;
+ color: black;
+}
+td.NAP
+{
+ background: turquoise;
+ color: white;
+}
+td.NAP a
+{
+ font-weight: bold;
+ font-size: larger;
+ color: white;
+ background: turquoise;
+}
+table.old{
+ border: outset 1pt;
+ border-collapse: separate;
+ border-color: red;
+}
+
+table.closedPlanet
+{
+ border-right: maroon 2pt outset;
+ border-top: maroon 2pt outset;
+ border-left: maroon 2pt outset;
+ border-bottom: maroon 2pt outset;
+ border-collapse: separate;
+}
+li.bash
+{
+ color: #336666;
+}
+div.clear {
+ clear: both;
+ height: 0;
+ margin: 0;
+ padding: 0;
+ line-height: 0.0;
+ font-size: 1px;
+}
+
+td.LowestPrio{
+ background: tomato;
+ color: white;
+}
+td.MediumPrio
+{
+ background: #b3b169;
+ color: white;
+}
+td.HighestPrio
+{
+ background: #336666;
+ color: white;
+}
--- /dev/null
+body {
+ padding-left: 15em;
+ /*padding-right: 12em;*/
+ font-family: sans-serif;
+ color: black;
+ background-color: #D9D9D9;
+}
+#leftbar,#rightbar{
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ width: 14em;
+ top: 1em;
+}
+#leftbar{
+ left: 1em;
+}
+#rightbar{
+ right: 1em;
+}
+
+legend {
+ color: black;
+ background: white;
+ border-style: solid;
+ border-width: 1px;
+ padding: 1px;
+}
+table.boards td {
+ /*border-style: solid;
+ border-width: 1px;*/
+ padding: 2px;
+ border-collapse: separate;
+ border-spacing: 15pt;
+ font-size: larger;
+}
+table.boards{
+ border-collapse: separate;
+ border-spacing: 5px;
+}
+table.boards th {
+ font-size: larger;
+}
+table.boards tr.even {
+ background: white;
+}
+
+table.boards a {
+ text-decoration: none;
+ width: 100%;
+ display: block;
+}
+fieldset.forum-post {
+ width: 40em;
+}
+fieldset.forum-post legend b {
+ font-size: larger;
+}
+div.leftinfo{
+ float: left;
+ padding-right: 2em;
+}
+p.claimlinks{
+ clear: both;
+}
+
+ul.linkbar {
+ list-style-type: none;
+ width: 13.5em;
+ padding: 0;
+ margin: 0;
+}
+ul.linkbar li {
+ background: white;
+ color: black;
+ margin: 0.5em 0;
+ padding: 0.3em;
+ /*border-right: 1em solid black;*/
+}
+ul.linkbar a {
+ text-decoration: none;
+ width: 100%;
+ display: block;
+}
+input.coordsinput {
+ width: 4em;
+}
+input.small {
+ width: 1.7em;
+}
+tr.odd {
+ background: white;
+ color: black;
+}
+tr.total {
+ background: black;
+ color: red;
+}
+
+td.ingal{
+ background: blue;
+ color: black;
+}
+td.Defend{
+ background: green;
+ color: black;
+}
+td.AllyDef{
+ background: #00FF00;
+ color: black;
+}
+td.Attack{
+ background: red;
+ color: black;
+}
+
+a.Unclaim{
+ color: green;
+}
+input.Unclaim{
+ background: green;
+}
+a.Claim{
+ color: blue;
+}
+a.Join{
+ color: #00AAAA;
+}
+input.Join{
+ background: #00AAAA;
+}
+
+td.Friendly{
+ background: green;
+ color: black;
+}
+td.Friendly a{
+ color: yellow;
+ background: green;
+}
+td.Hostile{
+ background: red;
+ color: black;
+}
+td.NAP{
+ background: blue;
+ color: white;
+}
+td.NAP a{
+ color: yellow;
+ background: blue;
+}
+table.old{
+ border: outset 1pt;
+ border-collapse: separate;
+ border-color: red;
+}
+
+table.closedPlanet{
+ border: outset 2pt;
+ border-collapse: separate;
+ border-color: red;
+}
+li.bash{
+ color: #FF9933;
+}
+div.clear {
+ clear: both;
+ height: 0;
+ margin: 0;
+ padding: 0;
+ line-height: 0.0;
+ font-size: 1px;
+}
+
+td.LowestPrio{
+ background: red;
+ color: black;
+}
+td.MediumPrio{
+ background: yellow;
+ color: black;
+}
+td.HighestPrio{
+ background: green;
+ color: black;
+}
--- /dev/null
+<form action="<TMPL_VAR NAME=PAGE>" method="post"><fieldset> <legend>Style</legend>
+ <input type="hidden" name="page" value="<TMPL_VAR NAME=PAGE>"/>
+ <input type="hidden" name="cmd" value="stylesheet"/>
+ Stylesheet: <select name="stylesheet">
+ <TMPL_LOOP StyleSheets>
+ <option value="<TMPL_VAR NAME=Style>" <TMPL_IF NAME=Selected>selected="selected"</TMPL_IF>><TMPL_VAR NAME=Style></option>
+ </TMPL_LOOP>
+ </select>
+ <br/><input type="submit" value="Change"/>
+</fieldset></form>
<head>
<title>NewDawn: <TMPL_VAR NAME=TITLE></title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
- <link rel="stylesheet" type="text/css" href="/nd.css"/>
+ <link rel="stylesheet" type="text/css" href="/stylesheets/<TMPL_IF CSS><TMPL_VAR NAME=CSS><TMPL_ELSE>nd</TMPL_IF>.css"/>
<script type="text/javascript" src="/raid.js"></script>
<TMPL_VAR NAME=HEADER>
</head>
<div id="leftbar">
<ul class="linkbar">
<li><a href="/main">Main page</a></li>
+ <li><a href="/settings">Settings</a></li>
<li><a href="/forum">Forum</a></li>
<li><a href="/forum/allUnread">New posts <TMPL_IF UnreadPosts>(<b><TMPL_VAR NAME=UnreadPosts></b>)</TMPL_IF></a></li>
</ul> <p>Tick: <TMPL_VAR NAME=TICK></p>