]> ruin.nu Git - ndwebbie.git/commitdiff
Merge branch 'master' of ruin.nu:git/ndwebbie
authorMichael Andreen <harv@ruin.nu>
Tue, 15 Jan 2008 09:27:11 +0000 (10:27 +0100)
committerMichael Andreen <harv@ruin.nu>
Tue, 15 Jan 2008 09:27:11 +0000 (10:27 +0100)
apache-conf.conf
database/clean-webbie.sql
scripts/fetchdumps.pl
scripts/ndrank.pl
scripts/parsedumps.pl
scripts/reset_hosts.pl
scripts/stats.pl
scripts/tick.pl
templates/forum.tmpl

index 2eb0caeff2e987967d68cc91507578c5a485aa25..167819fcaf538059ac1c288e932797f6a544e8ae 100644 (file)
        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>
index a03a1b5a0e2e6a99849f7c1b6e7c41de1b4fe28c..24e469c5c17f6f010c91fbda2f3be709ef4b4ff6 100644 (file)
@@ -5,11 +5,12 @@ TRUNCATE defense_requests;
 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;
@@ -27,4 +28,4 @@ ALTER SEQUENCE incomings_id_seq RESTART 1;
 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;
index efd124afc154c7688472c4e6219dab2ecace08e0..b8be1c36ca111561d5054337d18ecba75fc84b9b 100755 (executable)
@@ -27,17 +27,11 @@ use DBD::Pg qw(:pg_types);
 
 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(?,?,?,?)");
@@ -57,8 +51,8 @@ for my $type ("planet","alliance","galaxy"){
 }
 
 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);
 }
 
index cc7c12767e190b8681de3b72f44cdc663703998d..be8b1cc4f99f0cd084770c961984c97d1722290d 100755 (executable)
@@ -27,15 +27,10 @@ use DBD::Pg qw(:pg_types);
 
 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});
index f1738bf06efd7f54c9c916a08e6be40542250574..d22525fd87b776a83a393db456157ed97ac73507 100755 (executable)
@@ -30,17 +30,9 @@ use LWP::Simple;
 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;
 
index 4932f051fd74e9005ec578047fea4f9633a026b1..a86ea3c6eb0959a63a32183984ecc346e7c6c2b0 100755 (executable)
@@ -6,18 +6,12 @@ use DBI;
 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;
index ad8fc0030f013edc9510f7c5b6c0e81e05ea1fed..bcac7fe8f81274b2d182b71b677db8728e64b436 100755 (executable)
@@ -26,18 +26,11 @@ use DBI;
 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');
index bb652a875ab16a0528ad719831cf419dd8601918..6b97aa125445f78c3af359ff7c3f36d7a4a798a3 100755 (executable)
@@ -7,17 +7,11 @@ use DBD::Pg qw(:pg_types);
 
 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;
index c0aa4907d231b4c0888556417148a46415d1dad3..394264d884e013e99f558708a9360df27b0eb0da 100644 (file)
@@ -1,4 +1,4 @@
-<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>
@@ -29,7 +29,7 @@
        <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">&nbsp;<TMPL_VAR NAME=Subject>&nbsp;</a></td>
+               <td <TMPL_IF Sticky>class="sticky"</TMPL_IF>><a href="/<TMPL_VAR NAME=PAGE>?t=<TMPL_VAR NAME=Id>#NewPosts">&nbsp;<TMPL_VAR ESCAPE=NONE NAME=Subject>&nbsp;</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>
@@ -104,7 +104,7 @@ Move checked threads to: <select name="board">
        <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">&nbsp;<TMPL_VAR NAME=Subject>&nbsp;</a></td>
+               <td<TMPL_IF Sticky> class="sticky"</TMPL_IF>><a href="/<TMPL_VAR NAME=PAGE>?t=<TMPL_VAR NAME=Id>#NewPosts">&nbsp;<TMPL_VAR ESCAPE=NONE NAME=Subject>&nbsp;</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>