summaryrefslogtreecommitdiffstats
path: root/staticweb/man.pl
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-12-16 11:05:49 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-12-16 11:05:49 +0800
commit16c3a9991961588f43d6d280cc93317d29d242dc (patch)
tree02c74c7053cca01ce2b723198c6116961e413e17 /staticweb/man.pl
parentecd00f1452bbfe0305ff6ce46e1436ba4b9f2bd8 (diff)
downloadpttbbs-16c3a9991961588f43d6d280cc93317d29d242dc.tar
pttbbs-16c3a9991961588f43d6d280cc93317d29d242dc.tar.gz
pttbbs-16c3a9991961588f43d6d280cc93317d29d242dc.tar.bz2
pttbbs-16c3a9991961588f43d6d280cc93317d29d242dc.tar.lz
pttbbs-16c3a9991961588f43d6d280cc93317d29d242dc.tar.xz
pttbbs-16c3a9991961588f43d6d280cc93317d29d242dc.tar.zst
pttbbs-16c3a9991961588f43d6d280cc93317d29d242dc.zip
use Compress::Zlib to save disk space
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1413 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'staticweb/man.pl')
-rwxr-xr-xstaticweb/man.pl10
1 files changed, 8 insertions, 2 deletions
diff --git a/staticweb/man.pl b/staticweb/man.pl
index 4e9c2ed3..6afb7410 100755
--- a/staticweb/man.pl
+++ b/staticweb/man.pl
@@ -12,6 +12,7 @@ use Data::Serializer;
use Time::HiRes qw/gettimeofday tv_interval/;
use b2g;
use POSIX;
+use Compress::Zlib;
use vars qw/%db $brdname $fpath $isgb %b2g/;
@@ -88,7 +89,12 @@ sub articlemode
{
my(%th);
$th{tmpl} = 'article.html';
+
+ # ㄓ unzip, 璶ぃ礛穦年奔 :p
$th{content} = $db{$fpath};
+ $th{content} = Compress::Zlib::memGunzip($th{content})
+ if( $db{_gzip} );
+
$th{content} =~ s/\033\[.*?m//g;
$th{content} =~ s|(http://[\w\-\.\:\/\,@\?=~]+)|<a href="$1">$1</a>|gs;
@@ -98,9 +104,9 @@ sub articlemode
$th{content} =~
s|祇獺: у金金龟穨|祇獺: <a href="http://blog.ptt.cc">у金金龟穨</a>|gs;
$th{content} =~
- s|ptt\.csie\.ntu\.edu\.tw|<a href="telnet://ptt.csie.ntu.edu.tw">ptt.csie.ntu.edu.tw</a>|gs;
+ s|ptt\.cc|<a href="telnet://ptt.cc">ptt.cc</a>|gs;
$th{content} =~
- s|ptt\.twbbs\.org|<a href="telnet://ptt.csie.ntu.edu.tw">ptt.twbbs.org</a>|gs;
+ s|ptt\.twbbs\.org|<a href="telnet://ptt.cc">ptt.twbbs.org</a>|gs;
$th{content} =~ s/([\xA1-\xF9].)/$b2g{$1}/eg if( $isgb );
#Encode::from_to($th{content}, 'big5', 'gbk') if( $isgb );