]> ruin.nu Git - ND.git/commitdiff
Removed some functions that aren't used anymore
authorMichael Andreen <harv@ruin.nu>
Sat, 22 Aug 2009 14:04:05 +0000 (16:04 +0200)
committerMichael Andreen <harv@ruin.nu>
Sat, 22 Aug 2009 14:04:05 +0000 (16:04 +0200)
Include.pm

index 7f960575681d7a31c8166e6f69e1655c44e293c0..6af489ae86660977d2f528a295c1b9fa64ec02cb 100644 (file)
@@ -25,7 +25,7 @@ require Exporter;
 
 our @ISA = qw/Exporter/;
 
-our @EXPORT = qw/min max parseValue prettyValue log_message intel_log def_log unread_query pa_xp/;
+our @EXPORT = qw/min max parseValue prettyValue pa_xp/;
 
 sub min {
     my ($x,$y) = @_;
@@ -37,7 +37,6 @@ sub max {
     return ($x < $y ? $y : $x);
 }
 
-
 sub parseValue {
        if (defined $_[0] && $_[0] =~ /^(-?\d+(?:\.\d+)?)([khMG])?$/){
                return $1 unless defined $2;
@@ -67,28 +66,6 @@ sub prettyValue {
        return sprintf('%'.$decimals.'f%s', $value,$unit);
 }
 
-
-sub log_message {
-       my ($uid, $message) = @_;
-       my $log = $ND::DBH->prepare_cached(q{INSERT INTO forum_posts (ftid,uid,message) VALUES(
-               (SELECT ftid FROM users WHERE uid = $1),$1,$2)});
-       $log->execute($uid,$message) or $ND::ERROR .= p($ND::DBH->errstr);
-}
-
-sub intel_log {
-       my ($uid,$planet, $message) = @_;
-       my $log = $ND::DBH->prepare_cached(q{INSERT INTO forum_posts (ftid,uid,message) VALUES(
-               (SELECT ftid FROM planets WHERE id = $3),$1,$2)});
-       $log->execute($uid,$message,$planet) or $ND::ERROR .= p($ND::DBH->errstr);
-}
-
-sub def_log {
-       my ($uid,$call, $message) = @_;
-       my $log = $ND::DBH->prepare_cached(q{INSERT INTO forum_posts (ftid,uid,message) VALUES(
-               (SELECT ftid FROM calls WHERE id = $3),$1,$2)});
-       $log->execute($uid,$message,$call) or $ND::ERROR .= p($ND::DBH->errstr);
-}
-
 sub pa_xp {
        my ($roids,$ascore,$avalue,$tscore,$tvalue) = @_;
        my $bravery = (max(0,min(2,$tscore/$ascore)-0.2)) * (min(2,$tvalue/$avalue)-0.1);
@@ -96,18 +73,4 @@ sub pa_xp {
 
 }
 
-sub unread_query {
-       return q{
-               SELECT count(*) AS unread, count(NULLIF(fp.time > (SELECT max(time)
-                   FROM forum_thread_visits WHERE uid = $1),FALSE)) AS new        
-               FROM forum_threads ft                                              
-                       JOIN forum_posts fp USING (ftid)                               
-                       LEFT OUTER JOIN (SELECT * FROM forum_thread_visits             
-                               WHERE uid = $1) ftv ON ftv.ftid = ft.ftid                  
-               WHERE (ftv.time IS NULL OR fp.time > ftv.time) AND fbid > 0        
-                       AND fbid IN (SELECT fbid FROM forum_access                     
-                               WHERE gid IN (SELECT groups($1)))         
-               };
-}
-
 1;