ServerName nd.ruin.nu
ServerAlias webbie.ndawn.com
- ErrorLog logs/ndawn_error_log
+ ErrorLog /var/log/apache2/ndawn_error_log
<IfModule mod_log_config.c>
#TransferLog logs/ndawn_access_log
- CustomLog logs/ndawn_access_log "%h %l %u [%{%F %H:%M:%S}t] \"%r\" %>s %b %T \"%{Referer}i\" \"%{User-Agent}i\""
+ CustomLog /var/log/apache2/ndawn_access_log "%h %l %u [%{%F %H:%M:%S}t] \"%r\" %>s %b %T \"%{Referer}i\" \"%{User-Agent}i\""
</IfModule>
<IfModule mod_setenvif.c>
TRUNCATE graphs;
TRUNCATE fleet_ships;
TRUNCATE incomings;
-TRUNCATE intel;
-TRUNCATE scans;
-TRUNCATE covop_targets;
TRUNCATE raid_claims;
TRUNCATE dumps;
+TRUNCATE fleet_scans;
+TRUNCATE planet_data;
+UPDATE users SET scan_points = 0, defense_points = 0, attack_points = 0, humor_points = 0, rank = NULL, planet = NULL;
+DELETE FROM scans;
DELETE FROM raids;
DELETE FROM calls;
DELETE FROM fleets;
ALTER SEQUENCE planets_id_seq RESTART 1;
ALTER SEQUENCE raid_targets_id_seq RESTART 1;
ALTER SEQUENCE raids_id_seq RESTART 1;
-UPDATE users SET scan_points = 0, defense_points = 0, attack_points = 0, humor_points = 0, rank = NULL;
+ALTER SEQUENCE scans_id_seq RESTART 1;
use LWP::Simple;
-$0 =~ /(.*\/)[^\/]/;
-my $dir = $1;
-our $dbh;
-for my $file ("/home/whale/db.pl")
-{
- unless (my $return = do $file){
- warn "couldn't parse $file: $@" if $@;
- warn "couldn't do $file: $!" unless defined $return;
- warn "couldn't run $file" unless $return;
- }
-}
+use lib qw{/var/www/ndawn/};
+use ND::DB;
+
+our $dbh = ND::DB::DB();
+
$dbh->do("SET CLIENT_ENCODING TO 'LATIN1';");
my $insert = $dbh->prepare("INSERT INTO dumps(tick,type,modified,dump) VALUES(?,?,?,?)");
}
if ($updated){
- `${dir}parsedumps.pl $updated`;
- `${dir}ndrank.pl`;
+ `/var/www/ndawn/scripts/parsedumps.pl $updated`;
+ `/var/www/ndawn/scripts/ndrank.pl`;
$dbh->do("UPDATE misc SET value = ? WHERE id = 'TICK'", undef, $updated);
}
use LWP::Simple;
-our $dbh;
-for my $file ("/home/whale/db.pl")
-{
- unless (my $return = do $file){
- warn "couldn't parse $file: $@" if $@;
- warn "couldn't do $file: $!" unless defined $return;
- warn "couldn't run $file" unless $return;
- }
-}
+use lib qw{/var/www/ndawn/};
+use ND::DB;
+
+our $dbh = ND::DB::DB();
$dbh->begin_work;
my $st = $dbh->prepare(q{SELECT uid FROM current_planet_stats p JOIN users u ON p.id = u.planet WHERE alliance_id = 1 ORDER BY score DESC});
use lib qw{/var/www/ndawn/};
use ND::Include;
+use ND::DB;
-our $dbh;
-for my $file ("/home/whale/db.pl")
-{
- unless (my $return = do $file){
- warn "couldn't parse $file: $@" if $@;
- warn "couldn't do $file: $!" unless defined $return;
- warn "couldn't run $file" unless $return;
- }
-}
-#$dbh->trace("0","/tmp/parsedumps");
+our $dbh = ND::DB::DB();
$ND::DBH = $dbh;
use DBD::Pg qw(:pg_types);
use LWP::Simple;
+use lib qw{/var/www/ndawn/};
+use ND::DB;
-our $dbh;
-for my $file ("/home/whale/db.pl")
-{
- unless (my $return = do $file){
- warn "couldn't parse $file: $@" if $@;
- warn "couldn't do $file: $!" unless defined $return;
- warn "couldn't run $file" unless $return;
- }
-}
+our $dbh = ND::DB::DB();
-$dbh->trace("0","/tmp/scanstest");
+#$dbh->trace("0","/tmp/scanstest");
my $update = $dbh->prepare("UPDATE users SET hostmask = pnick || '.users.netgamers.org' where hostmask ilike '%.%' AND NOT hostmask ilike pnick || '.users.netgamers.org'");
$update->execute();
$dbh->disconnect;
use DBD::Pg qw(:pg_types);
use LWP::Simple;
+use lib qw{/var/www/ndawn/};
+use ND::DB;
+
+our $dbh = ND::DB::DB();
-$0 =~ /(.*\/)[^\/]/;
-my $dir = $1;
-our $dbh;
-for my $file ("/home/whale/db.pl")
-{
- unless (my $return = do $file){
- warn "couldn't parse $file: $@" if $@;
- warn "couldn't do $file: $!" unless defined $return;
- warn "couldn't run $file" unless $return;
- }
-}
$dbh->do("SET CLIENT_ENCODING TO 'LATIN1';");
my %classes = (Fighter => 'Fi', Corvette => 'Co', Frigate => 'Fr', Destroyer => 'De', Cruiser => 'Cr', Battleship => 'Bs');
use LWP::Simple;
-our $dbh;
-for my $file ("/home/whale/db.pl")
-{
- unless (my $return = do $file){
- warn "couldn't parse $file: $@" if $@;
- warn "couldn't do $file: $!" unless defined $return;
- warn "couldn't run $file" unless $return;
- }
-}
+use lib qw{/var/www/ndawn/};
+use ND::DB;
+
+our $dbh = ND::DB::DB();
-$dbh->trace("0","/tmp/scanstest");
my $update = $dbh->prepare("UPDATE misc SET value = value::int + 1 WHERE id = 'TICK'");
$update->execute();
$dbh->disconnect;
-<TMPL_IF Title><h2><TMPL_VAR NAME=Title></h2></TMPL_IF>
+<TMPL_IF Title><h2><TMPL_VAR ESCAPE=NONE NAME=Title></h2></TMPL_IF>
<TMPL_IF Category>
<h3>
<a href="/<TMPL_VAR NAME=Page>"><TMPL_VAR NAME=Category></a>
<tr class="<TMPL_IF __odd__>odd<TMPL_ELSE>even</TMPL_IF>">
<td align="center"><TMPL_VAR NAME=Unread></td>
<td align="center"><TMPL_VAR NAME=Posts></td>
- <td <TMPL_IF Sticky>class="sticky"</TMPL_IF>><a href="/<TMPL_VAR NAME=PAGE>?t=<TMPL_VAR NAME=Id>#NewPosts"> <TMPL_VAR NAME=Subject> </a></td>
+ <td <TMPL_IF Sticky>class="sticky"</TMPL_IF>><a href="/<TMPL_VAR NAME=PAGE>?t=<TMPL_VAR NAME=Id>#NewPosts"> <TMPL_VAR ESCAPE=NONE NAME=Subject> </a></td>
<td align="left"><TMPL_VAR NAME=Posting_date></td>
<td align="center"><TMPL_VAR NAME=Username></td>
<td align="left"><TMPL_VAR NAME=Last_post></td>
<tr class="<TMPL_IF __odd__>odd<TMPL_ELSE>even</TMPL_IF>">
<td align="center"><TMPL_VAR NAME=Unread></td>
<td align="center"><TMPL_VAR NAME=Posts></td>
- <td<TMPL_IF Sticky> class="sticky"</TMPL_IF>><a href="/<TMPL_VAR NAME=PAGE>?t=<TMPL_VAR NAME=Id>#NewPosts"> <TMPL_VAR NAME=Subject> </a></td>
+ <td<TMPL_IF Sticky> class="sticky"</TMPL_IF>><a href="/<TMPL_VAR NAME=PAGE>?t=<TMPL_VAR NAME=Id>#NewPosts"> <TMPL_VAR ESCAPE=NONE NAME=Subject> </a></td>
<td align="left"><TMPL_VAR NAME=Posting_date></td>
<td align="center"><TMPL_VAR NAME=Username></td>
<td align="left"><TMPL_VAR NAME=Last_post></td>