From f2a8fe893c12b768d32f0ddfd5f975ee2db6799d Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Sat, 22 Aug 2009 16:04:05 +0200 Subject: [PATCH] Removed some functions that aren't used anymore --- Include.pm | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/Include.pm b/Include.pm index 7f96057..6af489a 100644 --- a/Include.pm +++ b/Include.pm @@ -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; -- 2.39.2