pisg.pl 74 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219
  1. #!/usr/bin/perl -w
  2. use strict;
  3. use Getopt::Long;
  4. # pisg - Perl IRC Statistics Generator
  5. #
  6. # Copyright (C) 2001 <Morten 'LostStar' Brix Pedersen> - morten@wtf.dk
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. my ($channel, $logfile, $format, $network, $outputfile, $maintainer,
  22. $pagehead, $usersfile, $imagepath, $logdir, $lang, $bgcolor, $text, $hbgcolor,
  23. $hcolor, $hicell, $hicell2, $tdcolor, $tdtop, $link, $vlink, $hlink, $headline,
  24. $rankc, $minquote, $maxquote, $activenicks, $activenicks2, $topichistory,
  25. $pic1, $pic2, $nicktracking, $timeoffset, $version, $debug, $debugfile);
  26. # Values that _MUST_ be set below (unless you pass them on commandline)
  27. $channel = "#channel"; # The name of your channel.
  28. $logfile = "channel.log"; # The exact filename of the logfile
  29. $format = "mIRC"; # logfile format. see FORMATS file
  30. $network = "SomeIRCNet"; # Network the channels is using.
  31. $outputfile = "index.html"; # The name of the html file to be generated
  32. $maintainer = "MAINTAINER"; # The maintainer or bot which makes the logfile
  33. $pagehead = "none"; # Some 'page header' file which you want to
  34. # include in top of the stats
  35. $usersfile = "users.cfg"; # Path to users config file (aliases, ignores,
  36. # pics and more, see users.cfg for examples)
  37. $imagepath = ""; # If your user pictures is located
  38. # some special directory, set the path here.
  39. $logdir = ""; # If you specify a path to a dir here, then
  40. # pisg will take that dir, and parse ALL
  41. # logfiles in it, and create 1 HTML file
  42. # from it
  43. $lang = 'EN'; # Language to use:
  44. # EN | DE | DK | FR | ES | PL
  45. # Here you can set the colors for your stats page..
  46. $bgcolor = "#dedeee"; # Background color of the page
  47. $text = "black"; # Normal text color
  48. $hbgcolor = "#666699"; # Background color in headlines
  49. $hcolor = "white"; # Text color in headline
  50. $hicell = "#BABADD"; # Background color in highlighted cells
  51. $hicell2 = "#CCCCCC"; # Background color in highlighted cells
  52. $tdcolor = "black"; # Color of text in tables
  53. $tdtop = "#C8C8DD"; # Top color in some tables.
  54. $link = "#0b407a"; # Color of links
  55. $vlink = "#0b407a"; # Color of visited links
  56. $hlink = "#0b407a"; # Color of hovered links
  57. $headline = "#000000"; # Border color of headlines
  58. $rankc = "#CCCCCC"; # Colors of 'ranks' (1,2,3,4)
  59. $pic1 = "pipe-blue.png"; # Bar-graphic-file for normal times
  60. $pic2 = "pipe-purple.png"; # Bar-graphic-file for top-times
  61. # Other things that you might set, but not everyone cares about them
  62. $minquote = "25"; # Minimal value of letters for a random quote
  63. $maxquote = "65"; # Maximum value of letters for a random quote
  64. $activenicks = "25"; # Number of nicks to show in the 'top 25'
  65. $activenicks2 = "30"; # Nicks to show in 'these didnt make it...'
  66. $topichistory = "3"; # How many topics to show in 'latest topics'
  67. $nicktracking = 0; # Track nickchanges and create aliases (can
  68. # be slow, so it's disabled by default)
  69. $timeoffset = "+0"; # A time offset on the stats page - if your
  70. # country has a different timezone than the
  71. # machine where the stats are being
  72. # generated, then for example do +1
  73. # to add 1 hour to the time
  74. # You shouldn't care about anything below this point
  75. $debug = 0; # 0 = Debugging off, 1 = Debugging on
  76. $debugfile = "debug.log"; # Path to debug file(must be set if $debug == 1)
  77. $version = "v0.17-cvs";
  78. my ($lines, $kicked, $gotkicked, $smile, $longlines, $time, $timestamp, %alias,
  79. $normalline, $actionline, $thirdline, @ignore, $line, $processtime, @topics,
  80. %monologue, %kicked, %gotkick, %line, %length, %qpercent, %lpercent, %sadface,
  81. %smile, $nicks, %longlines, %mono, %times, %question, %loud, $totallength,
  82. %gaveop, %tookop, %joins, %actions, %sayings, %wordcount, %lastused,
  83. $colorcode, $boldcode, $underlinecode, $reversecode, $plaincode, %gotban,
  84. %setban, %foul, $days, $oldtime, $lastline, $actions, $normals, %userpics,
  85. %userlinks, %T, $repeated, $lastnormal);
  86. sub main
  87. {
  88. init_pisg(); # Init commandline arguments and other things
  89. init_lineformats(); # Attempt to set line formats in compliance with user specification (--format)
  90. init_users_config(); # Init users config. (Aliases, ignores etc.)
  91. init_debug(); # Init the debugging file
  92. if ($logdir) {
  93. parse_dir(); # Run through all logfiles in dir
  94. } else {
  95. parse_file($logfile); # Run through the whole logfile
  96. }
  97. create_html(); # Create the HTML
  98. # (look here if you want to remove some of the
  99. # stats which you don't care about)
  100. close_debug(); # Close the debugging file
  101. print "\nFile was parsed succesfully in $processtime on $time.\n";
  102. }
  103. sub init_pisg
  104. {
  105. print "pisg $version - Perl IRC Statistics Generator\n\n";
  106. get_cmdlineoptions();
  107. $timestamp = time;
  108. if ($timeoffset =~ /\+(\d+)/) {
  109. # We must plus some hours to the time
  110. $timestamp += 3600 * $1; # 3600 seconds per hour
  111. } elsif ($timeoffset =~ /-(\d+)/) {
  112. # We must remove some hours from the time
  113. $timestamp -= 3600 * $1; # 3600 seconds per hour
  114. }
  115. # Set useful values.
  116. $days = 1;
  117. $oldtime = "00";
  118. $lastline = "";
  119. $actions = "0";
  120. $normals = "0";
  121. $boldcode = chr(2);
  122. $colorcode = chr(3);
  123. $plaincode = chr(15);
  124. $reversecode = chr(22);
  125. $underlinecode = chr(31);
  126. $time = localtime($timestamp);
  127. $repeated = 0;
  128. $lastnormal = "";
  129. print "Statistics for channel $channel \@ $network by $maintainer\n\n";
  130. print "Using language template: $lang\n\n" if ($lang ne 'EN');
  131. }
  132. sub init_lineformats {
  133. # These are the regular expressions which matches the lines in the logfile,
  134. # and looks different if it's xchat, mIRC or whatever.
  135. # If you want to add support for a new format - you first have to add the
  136. # regex here, and then you also have to modify the parse subroutines called
  137. # 'parse_normalline()', 'parse_actionline()' and 'parse_thirdline()'
  138. if ($format eq 'xchat') {
  139. $normalline = '^(\d+):\d+:\d+ <([^>]+)>\s+(.*)';
  140. $actionline = '^(\d+):\d+:\d+ \*\s+(\S+) (.*)';
  141. $thirdline = '^(\d+):(\d+):\d+ .--\s+(\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (.*)';
  142. } elsif ($format eq 'mIRC') {
  143. $normalline = '^\[(\d+):\d+\] <([^>]+)> (.*)';
  144. $actionline = '^\[(\d+):\d+\] \* (\S+) (.*)';
  145. $thirdline = '^\[(\d+):(\d+)\] \*\*\* (\S+) (\S+) (\S+) (\S+) (\S+)(.*)';
  146. } elsif ($format eq 'eggdrop') {
  147. $normalline = '^\[(\d+):\d+\] <([^>]+)> (.*)';
  148. $actionline = '^\[(\d+):\d+\] Action: (\S+) (.*)';
  149. $thirdline = '^\[(\d+):(\d+)\] (\S+) (\S+) (\S+) (\S+)(.*)';
  150. } elsif ($format eq 'bxlog') {
  151. $normalline = '^\[\d+ \w+\/(\d+):\d+\] <([^>]+)> (.*)';
  152. $actionline = '^\[\d+ \w+\/(\d+):\d+\] \* (\S+) (.*)';
  153. $thirdline = '^\[\d+ \w+\/(\d+):(\d+)\] \S (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (.*)';
  154. } elsif ($format eq 'grufti') {
  155. $normalline = '^\[(\d+):\d+\] <([^>]+)> (.*)';
  156. $actionline = '^\[(\d+):\d+\] \* (\S+) (.*)';
  157. $thirdline = '^\[(\d+):(\d+)\] (\S+) (\S+) (\S+) (\S+) (\S+) (\S+)(.*)';
  158. } else {
  159. die("Logfile format not supported, check \$format setting.\n");
  160. }
  161. }
  162. sub init_users_config
  163. {
  164. if (open(USERS, $usersfile)) {
  165. my $lineno = 0;
  166. while (<USERS>)
  167. {
  168. $lineno++;
  169. my $line = $_;
  170. next if /^#/;
  171. if ($line =~ /<user.*>/) {
  172. my $nick;
  173. if ($line =~ /nick="([^"]+)"/) {
  174. $nick = $1;
  175. } else {
  176. print STDERR "Warning: no nick specified in $usersfile on line $lineno\n";
  177. next;
  178. }
  179. if ($line =~ /alias="([^"]+)"/) {
  180. my @thisalias = split(/\s+/, $1);
  181. push(@{ $alias{$nick} }, @thisalias);
  182. }
  183. if ($line =~ /pic="([^"]+)"/) {
  184. $userpics{$nick} = $1;
  185. }
  186. if ($line =~ /link="([^"]+)"/) {
  187. $userlinks{$nick} = $1;
  188. }
  189. if ($line =~ /ignore="Y"/i) {
  190. push(@ignore, $nick);
  191. }
  192. }
  193. }
  194. close(USERS);
  195. }
  196. }
  197. sub init_debug
  198. {
  199. if ($debug) {
  200. print "[ Debugging => $debugfile ]\n";
  201. open(DEBUG,"> $debugfile") or print STDERR "$0: Unable to open debug
  202. file($debugfile): $!\n";
  203. debug("*** pisg debug file for $logfile\n");
  204. }
  205. }
  206. sub parse_dir
  207. {
  208. print "Going into $logdir and parsing all files there...\n\n";
  209. my $files = `ls $logdir`;
  210. my @filesarray = split(/\n/, $files);
  211. # Add trailing slash when it's not there..
  212. if (substr($logdir, -1) ne '/') {
  213. $logdir =~ s/(.*)/$1\//;
  214. }
  215. foreach my $file (@filesarray) {
  216. $file = $logdir . $file;
  217. parse_file($file);
  218. }
  219. }
  220. sub parse_file
  221. {
  222. my $file = shift;
  223. # This parses the file..
  224. print "Analyzing log($file) in '$format' format...\n";
  225. open (LOGFILE, $file) or die("$0: Unable to open logfile($file): $!\n");
  226. while($line = <LOGFILE>) {
  227. $lines++; # Increment number of lines.
  228. # Strip mIRC color codes
  229. $line =~ s/$colorcode\d{1,2},\d{1,2}//g;
  230. $line =~ s/$colorcode\d{0,2}//g;
  231. # Strip mIRC bold, plain, reverse and underline codes
  232. $line =~ s/[$boldcode$underlinecode$reversecode$plaincode]//g;
  233. my $hashref;
  234. # Match normal lines.
  235. if ($hashref = parse_normalline($line)) {
  236. my ($hour, $nick, $saying, $i);
  237. for ($i = 0; $i <= $repeated; $i++) {
  238. if ($i > 0) {
  239. $hashref = parse_normalline($lastnormal);
  240. $lines++; #Increment number of lines for repeated lines
  241. }
  242. $hour = $hashref->{hour};
  243. $nick = find_alias($hashref->{nick});
  244. $saying = $hashref->{saying};
  245. # Timestamp collecting
  246. $times{$hour}++;
  247. unless (grep /^\Q$nick\E$/i, @ignore) {
  248. $normals++;
  249. $line{$nick}++;
  250. # Count up monologues
  251. if ($lastline eq $nick) {
  252. $mono{$nick}++;
  253. if ($mono{$nick} == "5") {
  254. $monologue{$nick}++;
  255. $mono{$nick} = 0;
  256. }
  257. } else {
  258. $mono{$nick} = 0;
  259. }
  260. $lastline = $nick;
  261. my $l = length($saying);
  262. if ($l > $minquote && $l < $maxquote) {
  263. $saying = htmlentities($saying);
  264. # Creates $hash{nick}[n] - a hash of an array.
  265. push (@{ $sayings{$nick} }, $saying);
  266. $longlines{$nick}++;
  267. }
  268. $question{$nick}++
  269. if ($saying =~ /\?/);
  270. $loud{$nick}++
  271. if ($saying =~ /!/);
  272. $foul{$nick}++
  273. if ($saying =~ /ass|fuck|bitch|shit|scheisse|scheiße|kacke|arsch|ficker|ficken|schlampe/);
  274. # Who smiles the most?
  275. # A regex matching al lot of smilies
  276. $smile{$nick}++
  277. if ($saying =~ /[8;:=][ ^-o]?[)pPD}\]>]/);
  278. $sadface{$nick}++
  279. if ($saying =~ /[8;:=][ ^-]?[\(\[\\\/{]/);
  280. # Don't count http:// as a :/ face
  281. $sadface{$nick}--
  282. if ($saying =~ /\w+:\/\//);
  283. foreach my $word (split(/[\s,!?.:;)(]+/, $saying)) {
  284. # remove uninteresting words
  285. next unless (length($word) > 5);
  286. # ignore contractions
  287. next if ($word =~ m/'..?$/);
  288. $wordcount{$word}++ unless (grep /^\Q$word\E$/i, @ignore);
  289. $lastused{$word} = $nick;
  290. }
  291. $length{$nick} += $l;
  292. $totallength += $l;
  293. }
  294. }
  295. $lastnormal = $line;
  296. $repeated = 0;
  297. }
  298. # Match action lines.
  299. elsif ($hashref = parse_actionline($line)) {
  300. my ($hour, $nick, $saying);
  301. $hour = $hashref->{hour};
  302. $nick = find_alias($hashref->{nick});
  303. $saying = $hashref->{saying};
  304. # Timestamp collecting
  305. $times{$hour}++;
  306. unless (grep /^\Q$nick\E$/i, @ignore) {
  307. $actions++;
  308. $line{$nick}++;
  309. my $len = length($saying);
  310. $length{$nick} += $len;
  311. $totallength += $len;
  312. }
  313. }
  314. # Match *** lines.
  315. elsif ($hashref = parse_thirdline($line)) {
  316. my ($hour, $min, $nick, $kicker, $newtopic, $newmode, $newjoin, $newnick);
  317. $hour = $hashref->{hour};
  318. $min = $hashref->{min};
  319. $nick = find_alias($hashref->{nick});
  320. $kicker = $hashref->{kicker};
  321. $newtopic = $hashref->{newtopic};
  322. $newmode = $hashref->{newmode};
  323. $newjoin = $hashref->{newjoin};
  324. $newnick = $hashref->{newnick};
  325. # Timestamp collecting
  326. $times{$hour}++;
  327. unless (grep /^\Q$nick\E$/i, @ignore) {
  328. if (defined($kicker)) {
  329. unless (grep /^\Q$kicker\E$/i, @ignore) {
  330. $gotkick{$nick}++;
  331. $kicked{$kicker}++;
  332. }
  333. } elsif (defined($newtopic)) {
  334. my $tcount = @topics;
  335. $topics[$tcount]{topic} = htmlentities($newtopic);
  336. $topics[$tcount]{nick} = $nick;
  337. $topics[$tcount]{hour} = $hour;
  338. $topics[$tcount]{min} = $min;
  339. # Strip off the quotes (')
  340. $topics[$tcount]{topic} =~ s/^\'(.*)\'$/$1/;
  341. } elsif (defined($newmode)) {
  342. my @opchange = opchanges($newmode);
  343. unless (exists $gaveop{$nick}) { $gaveop{$nick} = 0 }
  344. $gaveop{$nick} += $opchange[0] if $opchange[0];
  345. $tookop{$nick} += $opchange[1] if $opchange[1];
  346. } elsif (defined($newjoin)) {
  347. $joins{$nick}++;
  348. } elsif (defined($newnick) && ($nicktracking == 1)) {
  349. if (find_alias($newnick) eq $newnick) {
  350. if (defined($alias{$nick}) && !defined($alias{$newnick})) {
  351. push (@{$alias{$nick}}, $newnick);
  352. } elsif (defined($alias{$newnick}) && !defined($alias{$nick})) {
  353. push (@{$alias{$newnick}}, $nick);
  354. } elsif ($nick =~ /Guest/) {
  355. push (@{$alias{$newnick}}, ($newnick, $nick));
  356. } else {
  357. push (@{$alias{$nick}}, ($nick, $newnick));
  358. }
  359. }
  360. }
  361. }
  362. if ($hour < $oldtime) { $days++ }
  363. $oldtime = $hour;
  364. }
  365. }
  366. close(LOGFILE);
  367. my ($sec,$min,$hour) = gmtime(time - $^T);
  368. $processtime = sprintf("%02d hours, %02d minutes and %02d seconds", $hour, $min, $sec);
  369. $nicks = scalar keys %line;
  370. print "Finished analyzing log, $days days total.\n";
  371. }
  372. # Here is the 3 parse sub routines, their function is to return a hash with
  373. # the elements in the line. This is where we add the format dependent stuff.
  374. sub parse_normalline
  375. {
  376. # Parse a normal line - returns a hash with 'hour', 'nick' and 'saying'
  377. my $line = shift;
  378. my %hash;
  379. if ($line =~ /$normalline/) {
  380. debug("[$lines] Normal: $1 $2 $3");
  381. if (($format eq 'mIRC') || ($format eq 'xchat') || ($format eq
  382. 'eggdrop') || ($format eq 'bxlog') || ($format eq 'grufti')) {
  383. $hash{hour} = $1;
  384. $hash{nick} = $2;
  385. $hash{saying} = $3;
  386. } else {
  387. die("Format not supported?!\n");
  388. }
  389. return \%hash;
  390. } else {
  391. return;
  392. }
  393. }
  394. sub parse_actionline
  395. {
  396. # Parse an action line - returns a hash with 'hour', 'nick' and 'saying'
  397. my $line = shift;
  398. my %hash;
  399. if ($line =~ /$actionline/) {
  400. debug("[$lines] Action: $1 $2 $3");
  401. if (($format eq 'mIRC') || ($format eq 'xchat') || ($format eq
  402. 'eggdrop') || $format eq 'bxlog' || ($format eq 'grufti')) {
  403. $hash{hour} = $1;
  404. $hash{nick} = $2;
  405. $hash{saying} = $3;
  406. } else {
  407. die("Format not supported?!\n");
  408. }
  409. return \%hash;
  410. } else {
  411. return;
  412. }
  413. }
  414. sub parse_thirdline
  415. {
  416. # Parses the 'third' line - (the third line is everything else, like
  417. # topic changes, mode changes, kicks, etc.)
  418. # parse_thirdline() have to return a hash with the following keys, for
  419. # every format:
  420. # hour - the hour we're in (for timestamp loggin)
  421. # min - the minute we're in (for timestamp loggin)
  422. # nick - the nick
  423. # kicker - the nick which were kicked (if any)
  424. # newtopic - the new topic (if any)
  425. # newmode - a deop or an op, must be '+o' or '-o'
  426. # newjoin - a new nick which has joined the channel
  427. # newnick - a person has changed nick and this is the new nick
  428. my $line = shift;
  429. my %hash;
  430. if ($line =~ /$thirdline/) {
  431. if ($7) {
  432. debug("[$lines] ***: $1 $2 $3 $4 $5 $6 $7");
  433. } else {
  434. debug("[$lines] ***: $1 $2 $3 $4 $5 $6");
  435. }
  436. if ($format eq 'mIRC') {
  437. $hash{hour} = $1;
  438. $hash{min} = $2;
  439. $hash{nick} = $3;
  440. if (($4.$5) eq 'waskicked') {
  441. $hash{kicker} = $7;
  442. } elsif (($4.$5) eq 'changestopic') {
  443. $hash{newtopic} = "$7 $8";
  444. } elsif (($4.$5) eq 'setsmode:') {
  445. $hash{newmode} = $6;
  446. } elsif (($4.$5) eq 'hasjoined') {
  447. $hash{newjoin} = $3;
  448. } elsif (($4.$5) eq 'nowknown') {
  449. $hash{newnick} = $8;
  450. }
  451. } elsif ($format eq 'xchat') {
  452. $hash{hour} = $1;
  453. $hash{min} = $2;
  454. $hash{nick} = $3;
  455. if (($4.$5) eq 'haskicked') {
  456. $hash{kicker} = $3;
  457. $hash{nick} = $6;
  458. } elsif (($4.$5) eq 'haschanged') {
  459. $hash{newtopic} = $9;
  460. } elsif (($4.$5) eq 'giveschannel') {
  461. $hash{newmode} = '+o';
  462. } elsif (($4.$5) eq 'removeschannel') {
  463. $hash{newmode} = '-o';
  464. } elsif (($5.$6) eq 'hasjoined') {
  465. $hash{newjoin} = $1;
  466. } elsif (($5.$6) eq 'nowknown') {
  467. $hash{newnick} = $8;
  468. }
  469. } elsif ($format eq 'eggdrop') {
  470. $hash{hour} = $1;
  471. $hash{min} = $2;
  472. $hash{nick} = $3;
  473. if (($4.$5) eq 'kickedfrom') {
  474. $7 =~ /^ by ([\S]+):.*/;
  475. $hash{kicker} = $1;
  476. } elsif ($3 eq 'Topic') {
  477. $7 =~ /^ by ([\S]+)![\S]+: (.*)/;
  478. $hash{nick} = $1;
  479. $hash{newtopic} = $2;
  480. } elsif (($4.$5) eq 'modechange') {
  481. $hash{newmode} = $6;
  482. $7 =~ /^ .+ by ([\S]+)!.*/;
  483. $hash{nick} = $1;
  484. $hash{newmode} =~ s/^\'//;
  485. } elsif ($5 eq 'joined') {
  486. $hash{newjoin} = $3;
  487. } elsif (($3.$4) eq 'Nickchange:') {
  488. $hash{nick} = $5;
  489. $7 =~ /([\S]+)/;
  490. $hash{newnick} = $1;
  491. } elsif (($3.$4.$5) eq 'Lastmessagerepeated') {
  492. $repeated = $6;
  493. }
  494. } elsif ($format eq 'bxlog') {
  495. $hash{hour} = $1;
  496. $hash{min} = $2;
  497. $hash{nick} = $3;
  498. if ($5 eq 'kicked') {
  499. $hash{kicker} = $9;
  500. $hash{kicker} =~ s/!.*$//;
  501. } elsif ($3 eq 'Topic') {
  502. $hash{nick} = substr($5, 0, -1);
  503. $hash{newtopic} = "$6 $7 $8 $9 $10";
  504. } elsif ($5 eq '[+o') {
  505. $hash{newmode} = '+o';
  506. $hash{newmode} = substr($6, 0, -1);
  507. } elsif ($5 eq '[-o') {
  508. $hash{newmode} = '-o';
  509. $hash{newmode} = substr($6, 0, -1);
  510. } elsif (($4.$5) eq 'hasjoined') {
  511. $hash{newjoin} = $1;
  512. } elsif (($4.$5) eq 'isknown') {
  513. $hash{newnick} = $6;
  514. }
  515. $hash{nick} =~ s/!.*$//;
  516. } elsif ($format eq 'grufti') {
  517. $hash{hour} = $1;
  518. $hash{min} = $2;
  519. $hash{nick} = $3;
  520. if ($5 eq 'kicked') {
  521. $hash{kicker} = $3;
  522. $hash{nick} = $6;
  523. } elsif (($4.$5) eq 'haschanged') {
  524. $hash{newtopic} = $9;
  525. } elsif (($4.$5) eq 'modechange') {
  526. $hash{newmode} = substr($6, 1);
  527. $hash{nick} = substr($9, 1);
  528. } elsif ($5 eq 'joined') {
  529. $hash{newjoin} = $1;
  530. } elsif (($3.$4) eq 'Nickchange') {
  531. $hash{nick} = $7;
  532. $hash{newnick} = $9;
  533. }
  534. } else {
  535. die("Format not supported?!\n");
  536. }
  537. return \%hash;
  538. } else {
  539. return;
  540. }
  541. }
  542. sub opchanges
  543. {
  544. my @modes = split(//, $_[0]);
  545. my ($mode,$plus) = ("",0);
  546. my ($gaveop,$tookop) = (0,0);
  547. foreach (@modes) {
  548. if (/^\+$/) { $plus = 1; next; }
  549. elsif (/^-$/) { $plus = 0; next; }
  550. else { next unless /^o$/ }
  551. if ($plus) { $gaveop++ } else { $tookop++ }
  552. }
  553. my @out = ($gaveop,$tookop);
  554. return @out;
  555. }
  556. sub htmlentities
  557. {
  558. my $str = shift;
  559. $str =~ s/\&/\&amp;/g;
  560. $str =~ s/\</\&lt;/g;
  561. $str =~ s/\>/\&gt;/g;
  562. return $str;
  563. }
  564. sub html
  565. {
  566. my $html = shift;
  567. print OUTPUT $html . "\n";
  568. }
  569. sub template_text
  570. {
  571. # This function is for the homemade template system. It receives a name
  572. # of a template and a hash with the fields in the template to update to
  573. # its corresponding value
  574. my $template = shift;
  575. my %hash = @_;
  576. my $text;
  577. if (!$T{$lang}{$template}) {
  578. # Fall back to English if the language template doesn't exist
  579. $text = $T{EN}{$template};
  580. }
  581. $text = $T{$lang}{$template};
  582. if (!$text) {
  583. die("No such template $template\n");
  584. }
  585. foreach my $key (sort keys %hash) {
  586. $text =~ s/\[:$key\]/$hash{$key}/;
  587. $text =~ s/ü/&uuml;/g;
  588. $text =~ s/ö/&ouml;/g;
  589. $text =~ s/ä/&auml;/g;
  590. $text =~ s/ß/&szlig;/g;
  591. $text =~ s/å/&aring;/g;
  592. $text =~ s/æ/&aelig;/g;
  593. $text =~ s/ø/&oslash;/g;
  594. }
  595. return $text;
  596. }
  597. sub replace_links
  598. {
  599. # Sub to replace urls and e-mail addys to links
  600. my $str = shift;
  601. my $nick = shift;
  602. if ($nick) {
  603. $str =~ s/(http|https|ftp|telnet|news)(:\/\/[-a-zA-Z0-9_]+.[-a-zA-Z0-9.,_~=:;&@%?#\/+]+)/<a href="$1$2" target="_blank" title="Open in new window: $1$2">$nick<\/a>/g;
  604. $str =~ s/([-a-zA-Z0-9._]+@[-a-zA-Z0-9_]+.[-a-zA-Z0-9._]+)/<a href="mailto:$1" title="Mail to $nick">$nick<\/a>/g;
  605. } else {
  606. $str =~ s/(http|https|ftp|telnet|news)(:\/\/[-a-zA-Z0-9_]+.[-a-zA-Z0-9.,_~=:;&@%?#\/+]+)/<a href="$1$2" target="_blank" title="Open in new window: $1$2">$1$2<\/a>/g;
  607. $str =~ s/([-a-zA-Z0-9._]+@[-a-zA-Z0-9_]+.[-a-zA-Z0-9._]+)/<a href="mailto:$1" title="Mail to $1">$1<\/a>/g;
  608. }
  609. return $str;
  610. }
  611. sub debug
  612. {
  613. if ($debug) {
  614. my $debugline = $_[0] . "\n";
  615. print DEBUG $debugline;
  616. }
  617. }
  618. sub find_alias
  619. {
  620. my $nick = shift;
  621. foreach (keys %alias) {
  622. return $_ if (grep /^\Q$nick\E$/i, @{$alias{$_}});
  623. }
  624. return $nick;
  625. }
  626. sub create_html
  627. {
  628. # This is where all subroutines get executed, you can actually design
  629. # your own layout here, the lines should be self-explainable
  630. print "Now generating HTML($outputfile)...\n";
  631. open (OUTPUT, "> $outputfile") or die("$0: Unable to open outputfile($outputfile): $!\n");
  632. htmlheader();
  633. pageheader();
  634. activetimes();
  635. activenicks();
  636. headline(template_text('bignumtopic'));
  637. html("<table width=\"614\">\n"); # Needed for sections
  638. questions();
  639. loudpeople();
  640. mostsmiles();
  641. mostsad();
  642. longlines();
  643. shortlines();
  644. html("</table>"); # Needed for sections
  645. mostusedword();
  646. mostreferenced();
  647. headline(template_text('othernumtopic'));
  648. html("<table width=\"614\">\n"); # Needed for sections
  649. gotkicks();
  650. mostkicks();
  651. mostop();
  652. mostmonologues();
  653. mostjoins();
  654. mostfoul();
  655. html("</table>"); # Needed for sections
  656. headline(template_text('latesttopic'));
  657. html("<table width=\"614\">\n"); # Needed for sections
  658. lasttopics();
  659. html("</table>"); # Needed for sections
  660. my %hash = ( lines => $lines );
  661. html(template_text('totallines', %hash) . "<br><br>");
  662. htmlfooter();
  663. close(OUTPUT);
  664. }
  665. sub activetimes
  666. {
  667. # The most actives times on the channel
  668. my (%output, $tbgcolor);
  669. &headline(template_text('activetimestopic'));
  670. my @toptime = sort { $times{$b} <=> $times{$a} } keys %times;
  671. my $highest_value = $times{$toptime[0]};
  672. my @now = localtime($timestamp);
  673. my $image;
  674. for my $hour (sort keys %times) {
  675. debug("Time: $hour => ". $times{$hour});
  676. if ($toptime[0] == $hour) {
  677. $image = $pic2;
  678. } else {
  679. $image = $pic1;
  680. }
  681. my $size = ($times{$hour} / $highest_value) * 100;
  682. my $percent = ($times{$hour} / $lines) * 100;
  683. $percent =~ s/(\.\d)\d+/$1/;
  684. if ($timeoffset =~ /\+(\d+)/) {
  685. # We must plus some hours to the time
  686. $hour += $1;
  687. $hour = $hour % 24;
  688. if ($hour < 10) { $hour = "0" . $hour; }
  689. } elsif ($timeoffset =~ /-(\d+)/) {
  690. # We must remove some hours from the time
  691. $hour -= $1;
  692. $hour = $hour % 24;
  693. if ($hour < 10) { $hour = "0" . $hour; }
  694. }
  695. $output{$hour} = "<td align=\"center\" valign=\"bottom\" class=\"asmall\">$percent%<br><img src=\"$image\" width=\"15\" height=\"$size\" alt=\"$percent\"></td>\n";
  696. }
  697. html("<table border=\"0\" width=\"614\"><tr>\n");
  698. for ($b = 0; $b < 24; $b++) {
  699. if ($b < 10) { $a = "0" . $b; } else { $a = $b; }
  700. if (!defined($output{$a}) || $output{$a} eq "") {
  701. html("<td align=\"center\" valign=\"bottom\" class=\"asmall\">0%</td>");
  702. } else {
  703. html($output{$a});
  704. }
  705. }
  706. html("</tr><tr>");
  707. for ($b = 0; $b < 24; $b++) {
  708. if ($now[2] == $b) { $tbgcolor = "\#AAAAAA"; } else { $tbgcolor = "\#CCCCCC"; }
  709. html("<td bgcolor=\"$tbgcolor\" align=\"center\" class=\"small\">$b</td>");
  710. }
  711. html("</tr></table>");
  712. }
  713. sub activenicks
  714. {
  715. # The most active nicks (those who wrote most lines)
  716. my $randomline;
  717. &headline(template_text('activenickstopic'));
  718. html("<table border=\"0\" width=\"614\"><tr>");
  719. html("<td>&nbsp;</td><td bgcolor=\"$tdtop\"><b>" . template_text('nick') . "</b></td><td bgcolor=\"$tdtop\"><b>" . template_text('numberlines') ."</b></td><td bgcolor=\"$tdtop\"><b>". template_text('randquote') ."</b></td>");
  720. if (%userpics) {
  721. html("<td bgcolor=\"$tdtop\"><b>" . template_text('userpic') ."</b></td>");
  722. }
  723. html("</tr>");
  724. my @active = sort { $line{$b} <=> $line{$a} } keys %line;
  725. if ($activenicks > $nicks) {
  726. $activenicks = $nicks;
  727. print "Note: There was less nicks in the logfile than your specificied there to be in most active nicks...\n";
  728. }
  729. my ($nick, $visiblenick);
  730. my $i = 1;
  731. for (my $c = 0; $c < $activenicks; $c++) {
  732. $nick = $active[$c];
  733. $visiblenick = $active[$c];
  734. if (!$longlines{$nick}) {
  735. $randomline = "";
  736. } else {
  737. my $rand = rand($longlines{$nick});
  738. $randomline = $sayings{$nick}[$rand];
  739. }
  740. # Convert URLs and e-mail addys to links
  741. $randomline = replace_links($randomline);
  742. # Add a link to the nick if there is any
  743. if ($userlinks{$nick}) {
  744. $visiblenick = replace_links($userlinks{$nick}, $nick);
  745. }
  746. my $h = $hicell;
  747. $h =~ s/^#//;
  748. $h = hex $h;
  749. my $h2 = $hicell2;
  750. $h2 =~ s/^#//;
  751. $h2 = hex $h2;
  752. my $f_b = $h & 0xff;
  753. my $f_g = ($h & 0xff00) >> 8;
  754. my $f_r = ($h & 0xff0000) >> 16;
  755. my $t_b = $h2 & 0xff;
  756. my $t_g = ($h2 & 0xff00) >> 8;
  757. my $t_r = ($h2 & 0xff0000) >> 16;
  758. my $col_b = sprintf "%0.2x", abs int(((($t_b - $f_b) / $activenicks) * +$c) + $f_b);
  759. my $col_g = sprintf "%0.2x", abs int(((($t_g - $f_g) / $activenicks) * +$c) + $f_g);
  760. my $col_r = sprintf "%0.2x", abs int(((($t_r - $f_r) / $activenicks) * +$c) + $f_r);
  761. html("<tr><td bgcolor=\"$rankc\" align=\"left\">");
  762. my $line = $line{$nick};
  763. html("$i</td><td bgcolor=\"#$col_r$col_g$col_b\">$visiblenick</td><td bgcolor=\"#$col_r$col_g$col_b\">$line</td><td bgcolor=\"#$col_r$col_g$col_b\">");
  764. html("\"$randomline\"</td>");
  765. if ($userpics{$nick}) {
  766. html("<td bgcolor=\"#$col_r$col_g$col_b\" align=\"center\"><img valign=\"middle\" src=\"$imagepath$userpics{$nick}\"></td>");
  767. }
  768. html("</tr>");
  769. $i++;
  770. }
  771. html("</table><br>");
  772. # ALMOST AS ACTIVE NICKS
  773. @active = sort { $line{$b} <=> $line{$a} } keys %line;
  774. my $nickstoshow = $activenicks + $activenicks2;
  775. unless ($nickstoshow > $nicks) {
  776. html("<br><b><i>" . template_text('nottop') . "</i></b><table><tr>");
  777. for (my $c = $activenicks; $c < $nickstoshow; $c++) {
  778. unless ($c % 5) { unless ($c == $activenicks) { html("</tr><tr>"); } }
  779. html("<td bgcolor=\"$rankc\" class=\"small\">");
  780. my $nick = $active[$c];
  781. my $lines = $line{$nick};
  782. html("$nick ($lines)</td>");
  783. }
  784. html("</table>");
  785. }
  786. }
  787. sub mostusedword
  788. {
  789. # Lao the infamous word usage statistics
  790. my %usages;
  791. foreach my $word (sort keys %wordcount) {
  792. next if exists $line{$word};
  793. $usages{$word} = $wordcount{$word};
  794. }
  795. my @popular = sort { $usages{$b} <=> $usages{$a} } keys %usages;
  796. if (@popular) {
  797. &headline(template_text('mostwordstopic'));
  798. html("<table border=\"0\" width=\"614\"><tr>");
  799. html("<td>&nbsp;</td><td bgcolor=\"$tdtop\"><b>" . template_text('word') . "</b></td>");
  800. html("<td bgcolor=\"$tdtop\"><b>" . template_text('numberuses') . "</b></td>");
  801. html("<td bgcolor=\"$tdtop\"><b>" . template_text('lastused') . "</b></td>");
  802. for(my $i = 0; $i < 10; $i++) {
  803. last unless $i < $#popular;
  804. my $a = $i + 1;
  805. my $popular = $popular[$i];
  806. my $wordcount = $wordcount{$popular[$i]};
  807. my $lastused = $lastused{$popular[$i]};
  808. html("<tr><td bgcolor=\"$rankc\"><b>$a</b>");
  809. html("<td bgcolor=\"$hicell\">$popular</td>");
  810. html("<td bgcolor=\"$hicell\">$wordcount</td>");
  811. html("<td bgcolor=\"$hicell\">$lastused</td>");
  812. html("</tr>");
  813. }
  814. html("</table>");
  815. }
  816. }
  817. sub mostreferenced
  818. {
  819. my %usages;
  820. foreach my $word (sort keys %wordcount) {
  821. next unless exists $line{$word};
  822. $usages{$word} = $wordcount{$word};
  823. }
  824. my @popular = sort { $usages{$b} <=> $usages{$a} } keys %usages;
  825. if (@popular) {
  826. &headline(template_text('referencetopic'));
  827. html("<table border=\"0\" width=\"614\"><tr>");
  828. html("<td>&nbsp;</td><td bgcolor=\"$tdtop\"><b>" . template_text('nick') . "</b></td>");
  829. html("<td bgcolor=\"$tdtop\"><b>" . template_text('numberuses') . "</b></td>");
  830. html("<td bgcolor=\"$tdtop\"><b>" . template_text('lastused') . "</b></td>");
  831. for(my $i = 0; $i < 5; $i++) {
  832. last unless $i < $#popular;
  833. my $a = $i + 1;
  834. my $popular = $popular[$i];
  835. my $wordcount = $wordcount{$popular[$i]};
  836. my $lastused = $lastused{$popular[$i]};
  837. html("<tr><td bgcolor=\"$rankc\"><b>$a</b>");
  838. html("<td bgcolor=\"$hicell\">$popular</td>");
  839. html("<td bgcolor=\"$hicell\">$wordcount</td>");
  840. html("<td bgcolor=\"$hicell\">$lastused</td>");
  841. html("</tr>");
  842. }
  843. html("</table>");
  844. }
  845. }
  846. sub questions
  847. {
  848. # Persons who asked the most questions
  849. foreach my $nick (sort keys %question) {
  850. if ($line{$nick} > 100) {
  851. $qpercent{$nick} = ($question{$nick} / $line{$nick}) * 100;
  852. $qpercent{$nick} =~ s/(\.\d)\d+/$1/;
  853. }
  854. }
  855. my @question = sort { $qpercent{$b} <=> $qpercent{$a} } keys %qpercent;
  856. if (@question) {
  857. my %hash = (
  858. nick => $question[0],
  859. per => $qpercent{$question[0]}
  860. );
  861. my $text = template_text('question1', %hash);
  862. html("<tr><td bgcolor=\"$hicell\">$text");
  863. if (@question >= 2) {
  864. my %hash = (
  865. nick => $question[1],
  866. per => $qpercent{$question[1]}
  867. );
  868. my $text = template_text('question2', %hash);
  869. html("<br><span class=\"small\">$text</span>");
  870. }
  871. html("</td></tr>");
  872. } else {
  873. html("<tr><td bgcolor=\"$hicell\">" . template_text('question3') . "</td></tr>");
  874. }
  875. }
  876. sub loudpeople
  877. {
  878. # The ones who speak LOUDLY!
  879. foreach my $nick (sort keys %loud) {
  880. if ($line{$nick} > 100) {
  881. $lpercent{$nick} = ($loud{$nick} / $line{$nick}) * 100;
  882. $lpercent{$nick} =~ s/(\.\d)\d+/$1/;
  883. }
  884. }
  885. my @loud = sort { $lpercent{$b} <=> $lpercent{$a} } keys %lpercent;
  886. if (@loud) {
  887. my %hash = (
  888. nick => $loud[0],
  889. per => $lpercent{$loud[0]}
  890. );
  891. my $text = template_text('loud1', %hash);
  892. html("<tr><td bgcolor=\"$hicell\">$text");
  893. if (@loud >= 2) {
  894. my %hash = (
  895. nick => $loud[1],
  896. per => $lpercent{$loud[1]}
  897. );
  898. my $text = template_text('loud2', %hash);
  899. html("<br><span class=\"small\">$text</span>");
  900. }
  901. html("</td></tr>");
  902. } else {
  903. my $text = template_text('loud3');
  904. html("<tr><td bgcolor=\"$hicell\">$text</td></tr>");
  905. }
  906. }
  907. sub gotkicks
  908. {
  909. # The persons who got kicked the most
  910. my @gotkick = sort { $gotkick{$b} <=> $gotkick{$a} } keys %gotkick;
  911. if (@gotkick) {
  912. my %hash = (
  913. nick => $gotkick[0],
  914. kicks => $gotkick{$gotkick[0]}
  915. );
  916. my $text = template_text('gotkick1', %hash);
  917. html("<tr><td bgcolor=\"$hicell\">$text");
  918. if (@gotkick >= 2) {
  919. my %hash = (
  920. nick => $gotkick[1],
  921. kicks => $gotkick{$gotkick[1]}
  922. );
  923. my $text = template_text('gotkick2', %hash);
  924. html("<br><span class=\"small\">$text</span>");
  925. }
  926. html("</td></tr>");
  927. }
  928. }
  929. sub mostjoins
  930. {
  931. my @joins = sort { $joins{$b} <=> $joins{$a} } keys %joins;
  932. if (@joins) {
  933. my %hash = (
  934. nick => $joins[0],
  935. joins => $joins{$joins[0]}
  936. );
  937. my $text = template_text('joins', %hash);
  938. html("<tr><td bgcolor=\"$hicell\">$text</td></tr>");
  939. }
  940. }
  941. sub mostkicks
  942. {
  943. # The person who got kicked the most
  944. my @kicked = sort { $kicked{$b} <=> $kicked{$a} } keys %kicked;
  945. if (@kicked) {
  946. my %hash = (
  947. nick => $kicked[0],
  948. kicked => $kicked{$kicked[0]}
  949. );
  950. my $text = template_text('kick1', %hash);
  951. html("<tr><td bgcolor=\"$hicell\">$text");
  952. if (@kicked >= 2) {
  953. my %hash = (
  954. oldnick => $kicked[0],
  955. nick => $kicked[1],
  956. kicked => $kicked{$kicked[1]}
  957. );
  958. my $text = template_text('kick2', %hash);
  959. html("<br><span class=\"small\">$text</span>");
  960. }
  961. html("</td></tr>");
  962. } else {
  963. my $text = template_text('kick3');
  964. html("<tr><td bgcolor=\"$hicell\">$text</td></tr>");
  965. }
  966. }
  967. sub mostmonologues
  968. {
  969. # The person who had the most monologues (speaking to himself)
  970. my @monologue = sort { $monologue{$b} <=> $monologue{$a} } keys %monologue;
  971. if (@monologue) {
  972. my %hash = (
  973. nick => $monologue[0],
  974. monos => $monologue{$monologue[0]}
  975. );
  976. my $text = template_text('mono1', %hash);
  977. html("<tr><td bgcolor=\"$hicell\">$text");
  978. if (@monologue >= 2) {
  979. my %hash = (
  980. nick => $monologue[1],
  981. monos => $monologue{$monologue[1]}
  982. );
  983. my $text = template_text('mono2', %hash);
  984. html("<br><span class=\"small\">$text</span>");
  985. }
  986. html("</td></tr>");
  987. }
  988. }
  989. sub longlines
  990. {
  991. my %len;
  992. # The person(s) who wrote the longest lines
  993. foreach my $nick (sort keys %length) {
  994. if ($line{$nick} > 100) {
  995. $len{$nick} = $length{$nick} / $line{$nick};
  996. $len{$nick} =~ s/(\.\d)\d+/$1/;
  997. }
  998. }
  999. my @len = sort { $len{$b} <=> $len{$a} } keys %len;
  1000. my $all_lines = $normals + $actions;
  1001. my $totalaverage;
  1002. if ($all_lines > 0) {
  1003. $totalaverage = $totallength / $all_lines;
  1004. $totalaverage =~ s/(\.\d)\d+/$1/;
  1005. }
  1006. if (@len) {
  1007. my %hash = (
  1008. nick => $len[0],
  1009. letters => $len{$len[0]}
  1010. );
  1011. my $text = template_text('long1', %hash);
  1012. html("<tr><td bgcolor=\"$hicell\">$text<br>");
  1013. if (@len >= 2) {
  1014. %hash = (
  1015. channel => $channel,
  1016. avg => $totalaverage
  1017. );
  1018. $text = template_text('long2', %hash);
  1019. html("<span class=\"small\">$text</span></td></tr>");
  1020. }
  1021. }
  1022. }
  1023. sub shortlines
  1024. {
  1025. # This sub should be combined with the longlines sub at some point.. it
  1026. # does basically the same thing.
  1027. my %len;
  1028. # The person(s) who wrote the shortest lines
  1029. foreach my $nick (sort keys %length) {
  1030. if ($line{$nick} > 5) {
  1031. $len{$nick} = $length{$nick} / $line{$nick};
  1032. $len{$nick} =~ s/(\.\d)\d+/$1/;
  1033. }
  1034. }
  1035. my @len = sort { $len{$a} <=> $len{$b} } keys %len;
  1036. if (@len) {
  1037. my %hash = (
  1038. nick => $len[0],
  1039. letters => $len{$len[0]}
  1040. );
  1041. my $text = template_text('short1', %hash);
  1042. html("<tr><td bgcolor=\"$hicell\">$text<br>");
  1043. if (@len >= 2) {
  1044. %hash = (
  1045. nick => $len[1],
  1046. letters => $len{$len[1]}
  1047. );
  1048. $text = template_text('short2', %hash);
  1049. html("<span class=\"small\">$text</span></td></tr>");
  1050. }
  1051. }
  1052. }
  1053. sub mostfoul
  1054. {
  1055. my %spercent;
  1056. foreach my $nick (sort keys %foul) {
  1057. if ($line{$nick} > 15) {
  1058. $spercent{$nick} = ($foul{$nick} / $line{$nick}) * 100;
  1059. $spercent{$nick} =~ s/(\.\d)\d+/$1/;
  1060. }
  1061. }
  1062. my @foul = sort { $spercent{$b} <=> $spercent{$a} } keys %spercent;
  1063. if (@foul) {
  1064. my %hash = (
  1065. nick => $foul[0],
  1066. per => $spercent{$foul[0]}
  1067. );
  1068. my $text = template_text('foul1', %hash);
  1069. html("<tr><td bgcolor=\"$hicell\">$text");
  1070. if (@foul >= 2) {
  1071. my %hash = (
  1072. nick => $foul[1],
  1073. per => $spercent{$foul[1]}
  1074. );
  1075. my $text = template_text('foul2', %hash);
  1076. html("<br><span class=\"small\">$text</span>");
  1077. }
  1078. html("</td></tr>");
  1079. } else {
  1080. my %hash = (
  1081. channel => $channel
  1082. );
  1083. my $text = template_text('foul3', %hash);
  1084. html("<tr><td bgcolor=\"$hicell\">$text</td></tr>");
  1085. }
  1086. }
  1087. sub mostsad
  1088. {
  1089. my %spercent;
  1090. foreach my $nick (sort keys %sadface) {
  1091. if ($line{$nick} > 100) {
  1092. $spercent{$nick} = ($sadface{$nick} / $line{$nick}) * 100;
  1093. $spercent{$nick} =~ s/(\.\d)\d+/$1/;
  1094. }
  1095. }
  1096. my @sadface = sort { $spercent{$b} <=> $spercent{$a} } keys %spercent;
  1097. if (@sadface) {
  1098. my %hash = (
  1099. nick => $sadface[0],
  1100. per => $spercent{$sadface[0]}
  1101. );
  1102. my $text = template_text('sad1', %hash);
  1103. html("<tr><td bgcolor=\"$hicell\">$text");
  1104. if (@sadface >= 2) {
  1105. my %hash = (
  1106. nick => $sadface[1],
  1107. per => $spercent{$sadface[1]}
  1108. );
  1109. my $text = template_text('sad2', %hash);
  1110. html("<br><span class=\"small\">$text</span>");
  1111. }
  1112. html("</td></tr>");
  1113. } else {
  1114. my %hash = (
  1115. channel => $channel
  1116. );
  1117. my $text = template_text('sad3', %hash);
  1118. html("<tr><td bgcolor=\"$hicell\">$text</td></tr>");
  1119. }
  1120. }
  1121. sub mostop
  1122. {
  1123. my @ops = sort { $gaveop{$b} <=> $gaveop{$a} } keys %gaveop;
  1124. my @deops = sort { $tookop{$b} <=> $tookop{$a} } keys %tookop;
  1125. if (@ops) {
  1126. my %hash = (
  1127. nick => $ops[0],
  1128. ops => $gaveop{$ops[0]}
  1129. );
  1130. my $text = template_text('mostop1', %hash);
  1131. html("<tr><td bgcolor=\"$hicell\">$text");
  1132. if (@ops >= 2) {
  1133. my %hash = (
  1134. nick => $ops[1],
  1135. ops => $gaveop{$ops[1]}
  1136. );
  1137. my $text = template_text('mostop2', %hash);
  1138. html("<br><span class=\"small\">$text</span>");
  1139. }
  1140. html("</td></tr>");
  1141. } else {
  1142. my %hash = ( channel => $channel );
  1143. my $text = template_text('mostop3', %hash);
  1144. html("<tr><td bgcolor=\"$hicell\">$text</td></tr>");
  1145. }
  1146. if (@deops) {
  1147. my %hash = (
  1148. channel => $channel,
  1149. nick => $deops[0],
  1150. deops => $tookop{$deops[0]}
  1151. );
  1152. my $text = template_text('mostdeop1', %hash);
  1153. html("<tr><td bgcolor=\"$hicell\">$text");
  1154. if (@deops >= 2) {
  1155. my %hash = (
  1156. nick => $deops[1],
  1157. deops => $tookop{$deops[1]}
  1158. );
  1159. my $text = template_text('mostdeop2', %hash);
  1160. html("<br><span class=\"small\">$text</span>");
  1161. }
  1162. html("</td></tr>");
  1163. } else {
  1164. my %hash = ( channel => $channel );
  1165. my $text = template_text('mostdeop3', %hash);
  1166. html("<tr><td bgcolor=\"$hicell\">$text");
  1167. }
  1168. }
  1169. sub mostsmiles
  1170. {
  1171. # The person(s) who smiled the most :-)
  1172. my %spercent;
  1173. foreach my $nick (sort keys %smile) {
  1174. if ($line{$nick} > 100) {
  1175. $spercent{$nick} = ($smile{$nick} / $line{$nick}) * 100;
  1176. $spercent{$nick} =~ s/(\.\d)\d+/$1/;
  1177. }
  1178. }
  1179. my @smiles = sort { $spercent{$b} <=> $spercent{$a} } keys %spercent;
  1180. if (@smiles) {
  1181. my %hash = (
  1182. nick => $smiles[0],
  1183. per => $spercent{$smiles[0]}
  1184. );
  1185. my $text = template_text('smiles1', %hash);
  1186. html("<tr><td bgcolor=\"$hicell\">$text");
  1187. if (@smiles >= 2) {
  1188. my %hash = (
  1189. nick => $smiles[1],
  1190. per => $spercent{$smiles[1]}
  1191. );
  1192. my $text = template_text('smiles2', %hash);
  1193. html("<br><span class=\"small\">$text</span>");
  1194. }
  1195. html("</td></tr>");
  1196. } else {
  1197. my %hash = (
  1198. channel => $channel
  1199. );
  1200. my $text = template_text('smiles3', %hash);
  1201. html("<tr><td bgcolor=\"$hicell\">$text</td></tr>");
  1202. }
  1203. }
  1204. sub lasttopics
  1205. {
  1206. debug("Total number of topics: ". scalar @topics);
  1207. if (@topics) {
  1208. my $ltopic = @topics - 1;
  1209. my $tlimit = 0;
  1210. $topichistory -= 1;
  1211. if ($ltopic > $topichistory) { $tlimit = $ltopic - $topichistory; }
  1212. for (my $i = $ltopic; $i >= $tlimit; $i--) {
  1213. $topics[$i]{"topic"} = replace_links($topics[$i]{"topic"});
  1214. my $topic = $topics[$i]{topic};
  1215. my $nick = $topics[$i]{nick};
  1216. my $hour = $topics[$i]{hour};
  1217. my $min = $topics[$i]{min};
  1218. html("<tr><td bgcolor=\"$hicell\"><i>$topic</i></td>");
  1219. html("<td bgcolor=\"$hicell\">By <b>$nick</b> at <b>$hour:$min</b></td></tr>");
  1220. }
  1221. } else {
  1222. html("<tr><td bgcolor=\"$hicell\">" . template_text('notopic') ."</td></tr>");
  1223. }
  1224. }
  1225. # Some HTML subs
  1226. sub htmlheader
  1227. {
  1228. print OUTPUT <<HTML;
  1229. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  1230. <html>
  1231. <head>
  1232. <title>$channel @ $network channel statistics</title>
  1233. <style type="text/css">
  1234. a { text-decoration: none }
  1235. a:link { color: $link; }
  1236. a:visited { color: $vlink; }
  1237. a:hover { text-decoration: underline; color: $hlink }
  1238. body {
  1239. background-color: $bgcolor;
  1240. font-family: verdana, arial, sans-serif;
  1241. font-size: 13px;
  1242. color: $text;
  1243. }
  1244. td {
  1245. font-family: verdana, arial, sans-serif;
  1246. font-size: 13px;
  1247. color: $tdcolor;
  1248. }
  1249. .title {
  1250. font-family: tahoma, arial, sans-serif;
  1251. font-size: 16px;
  1252. font-weight: bold;
  1253. }
  1254. .headline { color: $hcolor; }
  1255. .small { font-family: verdana, arial, sans-serif; font-size: 10px; }
  1256. .asmall { font-family: arial narrow, sans-serif; font-size: 10px }
  1257. </style></head>
  1258. <body>
  1259. <div align="center">
  1260. HTML
  1261. my %hash = (
  1262. channel => $channel,
  1263. network => $network,
  1264. maintainer => $maintainer,
  1265. time => $time,
  1266. days => $days,
  1267. nicks => $nicks,
  1268. channel => $channel
  1269. );
  1270. print OUTPUT "<span class=\"title\">" . template_text('pagetitle1', %hash) . "</span><br>";
  1271. print OUTPUT "<br>" . template_text('pagetitle2', %hash) . "<br>";
  1272. print OUTPUT template_text('pagetitle3', %hash) . "<br><br>";
  1273. }
  1274. sub htmlfooter
  1275. {
  1276. print OUTPUT <<HTML;
  1277. <span class="small">
  1278. Stats generated by <a href="http://www.wtf.dk/hp/index.php?page=pisg" title="Go to the pisg homepage">pisg</a> $version<br>
  1279. pisg by <a href="http://www.wtf.dk/hp/" title="Go to the authors homepage">Morten "LostStar" Brix Pedersen</a> and others<br>
  1280. Stats generated in $processtime
  1281. </span>
  1282. </div>
  1283. </body>
  1284. </html>
  1285. HTML
  1286. }
  1287. sub headline
  1288. {
  1289. my ($title) = @_;
  1290. print OUTPUT <<HTML;
  1291. <br>
  1292. <table width="610" cellpadding="1" cellspacing="0" border="0">
  1293. <tr>
  1294. <td bgcolor="$headline">
  1295. <table width="100%" cellpadding="2" cellspacing="0" border="0" align="center">
  1296. <tr>
  1297. <td bgcolor="$hbgcolor" class="text10">
  1298. <div align="center" class="headline"><b>$title</b></div>
  1299. </td>
  1300. </tr>
  1301. </table>
  1302. </td>
  1303. </tr>
  1304. </table>
  1305. HTML
  1306. }
  1307. sub pageheader
  1308. {
  1309. if ($pagehead ne 'none') {
  1310. open(PAGEHEAD, $pagehead) or die("$0: Unable to open $pagehead for reading: $!\n");
  1311. while (<PAGEHEAD>) {
  1312. html($_);
  1313. }
  1314. }
  1315. }
  1316. sub close_debug
  1317. {
  1318. if ($debug) {
  1319. close(DEBUG) or print STDERR "$0: Cannot close debugfile($debugfile): $!\n";
  1320. }
  1321. }
  1322. sub get_cmdlineoptions
  1323. {
  1324. my $tmp;
  1325. # Commandline options
  1326. my $help;
  1327. my $usage = <<END_USAGE;
  1328. Usage: pisg.pl [-c channel] [-l logfile] [-o outputfile] [-m
  1329. maintainer] [-f format] [-n network] [-d logdir] [-a aliasfile]
  1330. [-i ignorefile] [-h]
  1331. -c --channel=xxx : Set channel name
  1332. -l --logfile=xxx : Log file to parse
  1333. -o --outfile=xxx : Name of html file to create
  1334. -m --maintainer=xxx : Channel/statistics maintainer
  1335. -f --format=xxx : Logfile format [see FORMATS file]
  1336. -n --network=xxx : IRC Network this channel is on.
  1337. -d --dir=xxx : Analyze all files in this dir. Ignores logfile.
  1338. -u --usersfile=xxx : Users config file
  1339. -h --help : Output this message and exit (-? also works).
  1340. Example:
  1341. \$ pisg.pl -n IRCnet -f xchat -o suid.html -c \\#channel -l logfile.log
  1342. As always, all options may also be defined by editing the source and calling
  1343. pisg without arguments.
  1344. END_USAGE
  1345. if (GetOptions('channel=s' => \$channel,
  1346. 'logfile=s' => \$logfile,
  1347. 'format=s' => \$format,
  1348. 'network=s' => \$network,
  1349. 'maintainer=s' => \$maintainer,
  1350. 'outfile=s' => \$outputfile,
  1351. 'dir=s' => \$logdir,
  1352. 'ignorefile=s' => \$tmp,
  1353. 'aliasfile=s' => \$tmp,
  1354. 'usersfile=s' => \$usersfile,
  1355. 'help|?' => \$help
  1356. ) == 0 or $help) {
  1357. die($usage);
  1358. }
  1359. if (@ARGV) {
  1360. if ($ARGV[0]) { $channel = $ARGV[0]; }
  1361. if ($ARGV[1]) { $logfile = $ARGV[1]; }
  1362. if ($ARGV[2]) { $outputfile = $ARGV[2]; }
  1363. if ($ARGV[3]) { $maintainer = $ARGV[3]; }
  1364. }
  1365. if ($tmp) {
  1366. die("The aliasfile and ignorefile has been obsoleted by the new
  1367. userscfg, please use that instead [look in users.cfg]\n");
  1368. }
  1369. }
  1370. ### English
  1371. $T{EN}{mostop1} = "<b>[:nick]</b> donated [:ops] ops in the channel...";
  1372. $T{EN}{mostop2} = "<b>[:nick]</b> was also very polite: [:ops] from her/him";
  1373. $T{EN}{mostop3} = "Strange, no op was given on [:channel]!";
  1374. $T{EN}{mostdeop1} = "<b>[:nick]</b> is the channel sheriff with [:deops] deops...";
  1375. $T{EN}{mostdeop2} = "<b>[:nick]</b> deoped [:deops] users";
  1376. $T{EN}{mostdeop3} = "Wow, no op was taken on [:channel]!";
  1377. $T{EN}{question1} = "<b>[:nick]</b> is either stupid or just making many questions... [:per]% lines contained a question!";
  1378. $T{EN}{question2} = "<b>[:nick]</b> didn't know that much either, [:per]% of his lines were questions";
  1379. $T{EN}{question3} = "Nobody asked questions here, just geniuses at this channel?";
  1380. $T{EN}{loud1} = "Loudest one was <b>[:nick]</b> who yelled [:per]% of the time!";
  1381. $T{EN}{loud2} = "Another <i>old yeller</i> was <b>[:nick]</b> who shouted [:per]% of the time!";
  1382. $T{EN}{loud3} = "Nobody raised an exclamation mark, wow.";
  1383. $T{EN}{gotkick1} = "<b>[:nick]</b> wasn't very popular, got kicked [:kicks] times!";
  1384. $T{EN}{gotkick2} = "<b>[:nick]</b> seemed to be hated too, [:kicks] kicks were received";
  1385. $T{EN}{joins} = "<b>[:nick]</b> couldn't decide to stay or to go, [:joins] joins during this reporting period!";
  1386. $T{EN}{kick1} = "<b>[:nick]</b> is insane or just a fair op, kicked a total of [:kicked] people!";
  1387. $T{EN}{kick2} = "[:oldnick]'s faithfull follower, <b>[:nick]</b>, kicked about [:kicked] people";
  1388. $T{EN}{kick3} = "Nice oppers here, no one got kicked!";
  1389. $T{EN}{mono1} = "<b>[:nick]</b> is talking to himself a lot, wrote over 5 lines in a row [:monos] times!";
  1390. $T{EN}{mono2} = "Another lonely one was <b>[:nick]</b>, who managed to hit [:monos] times";
  1391. $T{EN}{long1} = "<b>[:nick]</b> wrote longest lines, average of [:letters] per line...";
  1392. $T{EN}{long2} = "Channel average on [:channel] was [:avg] letters per line";
  1393. $T{EN}{short1} = "<b>[:nick]</b> wrote shortest lines, average of [:letters] per line...";
  1394. $T{EN}{short2} = "[:nick] was tight-lipped, too, averaging [:letters]";
  1395. $T{EN}{foul1} = "<b>[:nick]</b> has quite a potty mouth, [:per]% lines contained foul language";
  1396. $T{EN}{foul2} = "<b>[:nick]</b> also makes sailors blush, [:per]% of the time";
  1397. $T{EN}{foul3} = "Nobody is foul-mouthed at [:channel]! Get out much?";
  1398. $T{EN}{smiles1} = "<b>[:nick]</b> brings happiness to the world, [:per]% lines contained smiling faces :)";
  1399. $T{EN}{smiles2} = "<b>[:nick]</b> isn't a sad person either, who smiled [:per]% of the time";
  1400. $T{EN}{smiles3} = "Nobody smiles at [:channel]! Cheer up guys and girls.";
  1401. $T{EN}{sad1} = "<b>[:nick]</b> seems to be sad at the moment, [:per]% lines contained sad faces :(";
  1402. $T{EN}{sad2} = "<b>[:nick]</b> is also a sad person, who cried [:per]% of the time";
  1403. $T{EN}{sad3} = "Nobody is sad at [:channel]! What a happy channel :-)";
  1404. $T{EN}{notopic} = "A topic was never set on this channel";
  1405. ## Topics
  1406. $T{EN}{bignumtopic} = "Big numbers";
  1407. $T{EN}{othernumtopic} = "Other interesting numbers";
  1408. $T{EN}{latesttopic} = "Latest Topics";
  1409. $T{EN}{activetimestopic} = "Most active times";
  1410. $T{EN}{activenickstopic} = "Most active nicks";
  1411. $T{EN}{mostwordstopic} = "Most used words";
  1412. $T{EN}{referencetopic} = "Most referenced nick";
  1413. ## Other text
  1414. $T{EN}{totallines} = "Total number of lines: [:lines]";
  1415. $T{EN}{nick} = "Nick";
  1416. $T{EN}{numberlines} = "Number of lines";
  1417. $T{EN}{randquote} = "Random quote";
  1418. $T{EN}{userpic} = "Userpic";
  1419. $T{EN}{nottop} = "These didn't make it to the top:";
  1420. $T{EN}{word} = "Word";
  1421. $T{EN}{numberuses} = "Number of Uses";
  1422. $T{EN}{lastused} = "Last Used by";
  1423. $T{EN}{pagetitle1} = "[:channel] @ [:network] stats by [:maintainer]";
  1424. $T{EN}{pagetitle2} = "Statistics generated on [:time]";
  1425. $T{EN}{pagetitle3} = "During this [:days]\-days reporting period, a total number of <b>[:nicks]</b> different nicks were represented on [:channel].";
  1426. ### German
  1427. $T{DE}{mostop1} = "<b>[:nick]</b> vergab [:ops] ops im Channel...";
  1428. $T{DE}{mostop2} = "<b>[:nick]</b> war auch sehr zuvorkommend: [:ops] von ihm/ihr";
  1429. $T{DE}{mostop3} = "Komisch, kein op wurde in [:channel] vergeben!";
  1430. $T{DE}{mostdeop1} = "<b>[:nick]</b> ist die Channel-Polizei. Er/Sie hat [:deops] Usern das @ wieder weggenommen...";
  1431. $T{DE}{mostdeop2} = "<b>[:nick]</b> nahm [:deops] Usern das @ wieder weg.";
  1432. $T{DE}{mostdeop3} = "Wow, niemand wurde deopped in [:channel]!";
  1433. $T{DE}{question1} = "<b>[:nick]</b> hat wohl in der Schule nicht gut aufgepasst... [:per]% seiner Zeilen enthielten eine Frage!";
  1434. $T{DE}{question2} = "<b>[:nick]</b> weiss wohl auch nicht viel, [:per]% seiner Zeilen waren Fragen";
  1435. $T{DE}{question3} = "Niemand hat hier was gefragt, sollte das etwa ein Channel voller Genies sein? ;)";
  1436. $T{DE}{loud1} = "Am lautesten war <b>[:nick]</b> der [:per]% der Zeit geschrieen hat!";
  1437. $T{DE}{loud2} = "Ein anderer <i>Schreihals</i> war <b>[:nick]</b> der/die [:per]% der Zeit rumgeschrieen hat!";
  1438. $T{DE}{loud3} = "Niemand hat ein Ausrufungszeichen benutzt, wow... Zurückhaltende User im Channel ;)";
  1439. $T{DE}{gotkick1} = "<b>[:nick]</b> war wohl der Channelclown, er/sie wurde [:kicks] mal gekickt!";
  1440. $T{DE}{gotkick2} = "<b>[:nick]</b> konnte sich scheinbar auch nicht benehmen, [:kicks] kicks für ihn/sie";
  1441. $T{DE}{joins} = "<b>[:nick]</b> konnte sich nicht entscheiden im Channel zu bleiben oder zu gehen, [:joins] joins während des Statistik-Zeitraums!";
  1442. $T{DE}{kick1} = "Ist <b>[:nick]</b> jetzt einfach nur ein fairer Op oder macht ihm/ihr das Spass? Er/Sie kickte [:kicked] User!";
  1443. $T{DE}{kick2} = "[:oldnick]'s würdiger Nachfolger, <b>[:nick]</b>, er/sie kickte [:kicked] User";
  1444. $T{DE}{kick3} = "Nette Opper hier, niemand wurde gekickt!";
  1445. $T{DE}{mono1} = "<b>[:nick]</b> spricht viel mit sich selbst, er/sie schrieb über 5 Zeilen in einer Reihe und das [:monos] mal!";
  1446. $T{DE}{mono2} = "Ein anderes einsames Herz ist <b>[:nick]</b>, der/die [:monos] mal mit sich selbst redete";
  1447. $T{DE}{long1} = "<b>[:nick]</b> ist die Labertasche im Channel Er/Sie schrieb die längste Zeile mit durchschnittlich [:letters] Buchstaben pro Zeile...";
  1448. $T{DE}{long2} = "Channel-Durchschnitt in [:channel] war [:avg] Buchstaben pro Zeile";
  1449. $T{DE}{short1} = "<b>[:nick]</b> ist nicht sehr Mitteilungsbedürftig. Er/Sie schrieb die kürzeste Zeile mit durchschnittlich [:letters] Buchstaben pro Zeile...";
  1450. $T{DE}{short2} = "[:nick] war auch sehr kurzfassend, durchschnittlich [:letters] Buchstaben pro Zeile";
  1451. $T{DE}{foul1} = "<b>[:nick]</b> hat in seiner/ihrer Jugend keine Erziehung genossen, [:per]% seiner/ihrer S&auml;tze enthielten Schimpfworte!";
  1452. $T{DE}{foul2} = "<b>[:nick]</b> war [:per]% der Zeit unartig (Ob da der Weihnachtsman noch kommt?)";
  1453. $T{DE}{foul3} = "Alle gut erzogen in [:channel], niemand hat Schimpfworte benutzt!";
  1454. $T{DE}{smiles1} = "<b>[:nick]</b> ist ein fröhlicher Mensch, [:per]% seiner/ihrer Zeilen enthielt ein fröhliches Smily :)";
  1455. $T{DE}{smiles2} = "<b>[:nick]</b> scheint auch glücklich zu sein. Er/Sie \"smilte\" [:per]% der Zeit";
  1456. $T{DE}{smiles3} = "Niemand \"smilte\" in [:channel]! Los Leute legt mal wieder ein Lächeln auf :)";
  1457. $T{DE}{sad1} = "<b>[:nick]</b> scheint im Moment nicht gut drauf zu sein, [:per]% seiner/ihrer Zeilen enthielten ein trauriges Smily :(";
  1458. $T{DE}{sad2} = "<b>[:nick]</b> ist auch eine traurige Person, die [:per]% der Zeit geweint hat";
  1459. $T{DE}{sad3} = "Niemand ist traurig in [:channel]! Was für ein fröhlicher Channel :)";
  1460. $T{DE}{notopic} = "In diesem Channel wurde kein Topic gesetzt";
  1461. ## Topics
  1462. $T{DE}{bignumtopic} = "Die Zahlen sprechen für sich :)";
  1463. $T{DE}{othernumtopic} = "Andere interessante Zahlen";
  1464. $T{DE}{latesttopic} = "Letzte Topics";
  1465. $T{DE}{activetimestopic} = "Wann war am meisten los?";
  1466. $T{DE}{activenickstopic} = "Wer quatscht am meisten?";
  1467. $T{DE}{mostwordstopic} = "Am meisten benutzte Wörter";
  1468. $T{DE}{referencetopic} = "Begehrte Nicks :)";
  1469. ## Other text
  1470. $T{DE}{totallines} = "Gesamtanzahl der Zeilen: [:lines]";
  1471. $T{DE}{nick} = "Nick";
  1472. $T{DE}{numberlines} = "Anzahl der Zeilen";
  1473. $T{DE}{randquote} = "Zufalls quote";
  1474. $T{DE}{userpic} = "Userbild";
  1475. $T{DE}{nottop} = "Sie haben es nicht an die Spitze geschafft:";
  1476. $T{DE}{word} = "Wort";
  1477. $T{DE}{numberuses} = "Wie oft benutzt";
  1478. $T{DE}{lastused} = "Zuletzt benutzt von";
  1479. $T{DE}{pagetitle1} = "[:channel] @ [:network] stats erstellt von [:maintainer]";
  1480. $T{DE}{pagetitle2} = "Statistik erstellt am [:time]";
  1481. $T{DE}{pagetitle3} = "Während des Statistikzeitraums von [:days] Tage(n) wurden <b>[:nicks]</b> verschiedene Nicks in [:channel] gezählt.";
  1482. ### Danish
  1483. $T{DK}{mostop1} = "<b>[:nick]</b> gav [:ops] op status i kanalen...";
  1484. $T{DK}{mostop2} = "<b>[:nick]</b> var også venlig at gi': [:ops] fra sig";
  1485. $T{DK}{mostop3} = "Underligt, ingen har fået op på [:channel] endnu!";
  1486. $T{DK}{mostdeop1} = "<b>[:nick]</b> holder orden på [:channel] med [:deops] deops...";
  1487. $T{DK}{mostdeop2} = "<b>[:nick]</b> deoppede [:deops] brugere";
  1488. $T{DK}{mostdeop3} = "Hmm, der var ingen som fik op på [:channel]!";
  1489. $T{DK}{question1} = "<b>[:nick]</b> må være rimelig dum eller efterligner bare Spørge-Jørgen... [:per]% af hans linjer var spørgsmål!";
  1490. $T{DK}{question2} = "<b>[:nick]</b> var heller ingen Einstein, [:per]% af hans linjer var også spørgsmål";
  1491. $T{DK}{question3} = "Ingen spørgsmål på denne kanal. De må sørme være kloge!";
  1492. $T{DK}{loud1} = "Den mest larmende var <b>[:nick]</b>, som råbte [:per]% af tiden!";
  1493. $T{DK}{loud2} = "En anden skrigehals var <b>[:nick]</b>, som råbte [:per]% af tiden!";
  1494. $T{DK}{loud3} = "Der er ingen som råber. Leger de stilleleg?";
  1495. $T{DK}{gotkick1} = "<b>[:nick]</b> er ret upopulær, blev sparket ud [:kicks] gange!";
  1496. $T{DK}{gotkick2} = "<b>[:nick]</b> er heller ikke nogen Elvis, [:kicks] gange fik han sparket";
  1497. $T{DK}{joins} = "<b>[:nick]</b> er lidt forvirret. Han har været inde og ude af kanalen [:joins] gange!";
  1498. $T{DK}{kick1} = "<b>[:nick]</b> er magtsygt eller ved hvordan han/hun skal kontrollere sine fjender. Han har sparket [:kicked] folk ud af kanalen!";
  1499. $T{DK}{kick2} = "[:oldnick] har en efterfølger. <b>[:nick]</b> sparkede [:kicked] folk ud af kanalen";
  1500. $T{DK}{kick3} = "Venlige operatører må man sige. Ingen har fået sparket!";
  1501. $T{DK}{mono1} = "<b>[:nick]</b> snakker meget med sig selv. Han har skrevet over 5 linjer på en gang, [:monos] gange!";
  1502. $T{DK}{mono2} = "En anden ensom person var <b>[:nick]</b>, som snakkede til sig selv [:monos] gange";
  1503. $T{DK}{long1} = "<b>[:nick]</b> skriver meget lange sætninger. Gennemsnittet er [:letters] bogstaver pr. linje...";
  1504. $T{DK}{long2} = "Gennemsnittet på [:channel] er [:avg] bogstaver pr. linje";
  1505. $T{DK}{short1} = "<b>[:nick]</b> skrev de korteste linjer. Gennemsnittet er [:letters] bogstaver pr. linje...";
  1506. $T{DK}{short2} = "[:nick] skriver også korte linjer, med et gennesnit på [:letters]";
  1507. $T{DK}{foul1} = "<b>[:nick]</b> er lidt stor i munden, [:per]% af linjerne indholte uhøfligt sprog";
  1508. $T{DK}{foul2} = "<b>[:nick]</b> burde også vaske munden med sæbe med at det han fyrer af, [:per]% af tiden";
  1509. $T{DK}{foul3} = "Ingen rapkæftede på [:channel]!";
  1510. $T{DK}{smiles1} = "<b>[:nick]</b> er altid glad, [:per]% af linjerne havde glade ansigter :)";
  1511. $T{DK}{smiles2} = "<b>[:nick]</b> er heller ikke en trist person, som smilede [:per]% af tiden";
  1512. $T{DK}{smiles3} = "Ingen smiler på [:channel]! Op med humøret drenge og piger.";
  1513. $T{DK}{sad1} = "<b>[:nick]</b> er meget ked af det for tiden, [:per]% af linjerne havde sørgelige ansigter :(";
  1514. $T{DK}{sad2} = "<b>[:nick]</b> er også en trist person, som græd [:per]% af tiden";
  1515. $T{DK}{sad3} = "Ingen er kede af det på [:channel]! Sikke en glad kanal :-)";
  1516. $T{DK}{notopic} = "A topic was never set on this channel";
  1517. ## Topics
  1518. $T{DK}{bignumtopic} = "Store numre";
  1519. $T{DK}{othernumtopic} = "Andre interessante numre";
  1520. $T{DK}{latesttopic} = "Sidst nyeste topics";
  1521. $T{DK}{activetimestopic} = "Mest aktive tider";
  1522. $T{DK}{activenickstopic} = "Mest aktive nicks";
  1523. $T{DK}{mostwordstopic} = "Mest brugte ord";
  1524. $T{DK}{referencetopic} = "Mest tiltalte nicks";
  1525. ## Other text
  1526. $T{DK}{totallines} = "Hele antal linjer: [:lines]";
  1527. $T{DK}{nick} = "Nick";
  1528. $T{DK}{numberlines} = "Antal linjer";
  1529. $T{DK}{randquote} = "Tilfældig sætning";
  1530. $T{DK}{userpic} = "Brugerbillede";
  1531. $T{DK}{nottop} = "Disse nåede ikke til tops:";
  1532. $T{DK}{word} = "Ord";
  1533. $T{DK}{numberuses} = "Antal forbrug";
  1534. $T{DK}{lastused} = "Sidst brugt af";
  1535. $T{DK}{pagetitle1} = "[:channel] @ [:network] statistikker af [:maintainer]";
  1536. $T{DK}{pagetitle2} = "Statistikker lavet d. [:time]";
  1537. $T{DK}{pagetitle3} = "Igennem denne [:days]\-dages periode, har der været <b>[:nicks]</b> forskellige nicks på [:channel].";
  1538. ### French
  1539. # Not exactly the translation but something fun
  1540. # Time translation needs more update
  1541. $T{FR}{mostop1} = "<b>[:nick]</b> a donné [:ops] ops sur le channel...";
  1542. $T{FR}{mostop2} = "<b>[:nick]</b> est aussi très poli : [:ops] ops de sa part";
  1543. $T{FR}{mostop3} = "Etrange, aucun op n'a été donné sur [:channel]!";
  1544. $T{FR}{mostdeop1} = "<b>[:nick]</b> est le shérif avec [:deops] deops...";
  1545. $T{FR}{mostdeop2} = "<b>[:nick]</b> a deopé [:deops] utilisateurs";
  1546. $T{FR}{mostdeop3} = "Wow, aucun op n'a été retiré sur [:channel]!";
  1547. $T{FR}{question1} = "<b>[:nick]</b> est soit stupide soit trop curieux... [:per]% de ses lignes contiennent une question!";
  1548. $T{FR}{question2} = "<b>[:nick]</b> n'en connait pas davantage, [:per]% de ses lignes étaient des questions";
  1549. $T{FR}{question3} = "Personne ne pose de question ici, tous des génies sur ce channel?";
  1550. $T{FR}{loud1} = "Le plus bruyant est <b>[:nick]</b> qui gueule [:per]% du temps!";
  1551. $T{FR}{loud2} = "Un autre <i>vieux raleur</i> est <b>[:nick]</b> qui braille [:per]% du temps!";
  1552. $T{FR}{loud3} = "Personne ne s'exclame ici, wow.";
  1553. $T{FR}{gotkick1} = "<b>[:nick]</b> n'est pas trés populaire, kické [:kicks] fois!";
  1554. $T{FR}{gotkick2} = "<b>[:nick]</b> n'a pas d'ami non plus, [:kicks] kicks reçus";
  1555. $T{FR}{joins} = "<b>[:nick]</b> ne sait pas s'il doit rester ou partir, [:joins] visites durant cette période!";
  1556. $T{FR}{kick1} = "<b>[:nick]</b> est malade ou alors aime bien jouer, son kick a sévi [:kicked] fois!";
  1557. $T{FR}{kick2} = "Un disciple de [:oldnick], <b>[:nick]</b>, a kické [:kicked] personnes";
  1558. $T{FR}{kick3} = "Les ops sont sympas ici, personne n'a été kické!";
  1559. $T{FR}{mono1} = "<b>[:nick]</b> se parle à lui-meme trés souvent, il a écrit plus de 5 lignes d'un coup à [:monos] reprises!";
  1560. $T{FR}{mono2} = "Un autre incompris est <b>[:nick]</b>, qui a tenté de le dépasser à [:monos] reprises";
  1561. $T{FR}{long1} = "<b>[:nick]</b> a écrit les lignes les plus longues, avec en moyenne [:letters] lettres par ligne...";
  1562. $T{FR}{long2} = "La moyenne sur [:channel] est de [:avg] lettres par ligne";
  1563. $T{FR}{short1} = "<b>[:nick]</b> a écrit les lignes les plus courtes, avec en moyenne [:letters] lettres par ligne...";
  1564. $T{FR}{short2} = "[:nick] n'a pas grand chose a dire non plus, en moyenne [:letters]";
  1565. $T{FR}{foul1} = "<b>[:nick]</b> a du mal a s'exprimer, [:per]% de ses lignes contiennent des mots incompréhensibles";
  1566. $T{FR}{foul2} = "<b>[:nick]</b> parle aussi comme un chartier, [:per]% du temps";
  1567. $T{FR}{foul3} = "Personne n'a de problème pour parler sur [:channel]! Pendant combien de temps encore?";
  1568. $T{FR}{smiles1} = "<b>[:nick]</b> apporte un peu de gaiété dans le monde, [:per]% de ses lignes contiennent un smiley :)";
  1569. $T{FR}{smiles2} = "<b>[:nick]</b> n'est pas triste non plus, il sourit [:per]% du temps";
  1570. $T{FR}{smiles3} = "Personne ne sourit sur [:channel]! Allez faites un effort quoi!";
  1571. $T{FR}{sad1} = "<b>[:nick]</b> semble un peu triste en ce moment, [:per]% de ses lignes contiennent un smiley :(";
  1572. $T{FR}{sad2} = "<b>[:nick]</b> est aussi bien triste, il pleure [:per]% du temps";
  1573. $T{FR}{sad3} = "Personne n'est triste sur [:channel]! Quel channel merveilleux :-)";
  1574. $T{FR}{notopic} = "Il n'y a jamais eu de topic sur ce channel";
  1575. ## Topics
  1576. $T{FR}{bignumtopic} = "Les gros chiffres";
  1577. $T{FR}{othernumtopic} = "D'autres chiffres intéressants";
  1578. $T{FR}{latesttopic} = "Les derniers topics";
  1579. $T{FR}{activetimestopic} = "Les périodes d'intense activité";
  1580. $T{FR}{activenickstopic} = "Les nicks les plus actifs";
  1581. $T{FR}{mostwordstopic} = "Les mots les plus utilisés";
  1582. $T{FR}{referencetopic} = "Les mots les plus utilisés dans la conversation";
  1583. ## Other text
  1584. $T{FR}{totallines} = "Nombre total de lignes: [:lines]";
  1585. $T{FR}{nick} = "Nick";
  1586. $T{FR}{numberlines} = "Nombre de lignes";
  1587. $T{FR}{randquote} = "Citation typique";
  1588. $T{FR}{userpic} = "Image";
  1589. $T{FR}{nottop} = "Ne sont pas dans le classement";
  1590. $T{FR}{word} = "Mot";
  1591. $T{FR}{numberuses} = "Nombre d'occurences";
  1592. $T{FR}{lastused} = "Dernière utilisation par";
  1593. $T{FR}{pagetitle1} = "[:channel] @ [:network] stats par [:maintainer]";
  1594. $T{FR}{pagetitle2} = "Statistiques générées le [:time]";
  1595. $T{FR}{pagetitle3} = "Durant cette periode de [:days] jours, <b>[:nicks]</b> nicks différents sont apparus sur [:channel].";
  1596. ### Spanish
  1597. $T{ES}{mostop1} = "<b>[:nick]</b> ha dado [:ops] ops en el canal...";
  1598. $T{ES}{mostop2} = "<b>[:nick]</b> también reparte ensaimadas: [:ops] nada menos";
  1599. $T{ES}{mostop3} = "Es raro, pero ningún op ha sido dado en [:channel]!";
  1600. $T{ES}{mostdeop1} = "<b>[:nick]</b> es el malo del canal, le ha quitado la @ a [:deops] personas";
  1601. $T{ES}{mostdeop2} = "<b>[:nick]</b> le ha quitado la @ a [:deops] personas";
  1602. $T{ES}{mostdeop3} = "Increible, pero nadie ha tenido @ en el canal [:channel]!";
  1603. $T{ES}{question1} = "<b>[:nick]</b> necesitaba más horas de guardería cuando era pequeño, el [:per]% de sus lineas contienen una pregunta!";
  1604. $T{ES}{question2} = "<b>[:nick]</b> tampoco se entera de mucho, el [:per]% de sus lineas son preguntas";
  1605. $T{ES}{question3} = "Nadie hace preguntas aquí, esto parece un canal de genios";
  1606. $T{ES}{loud1} = "La persona que grita más es <b>[:nick]</b> que escribe con exclamaciones el [:per]% del tiempo!";
  1607. $T{ES}{loud2} = "Quien no se queda atrás gritando es <b>[:nick]</b> lo hace el [:per]% del tiempo!";
  1608. $T{ES}{loud3} = "Nadie ha escrito frases con exclamaciones.";
  1609. $T{ES}{gotkick1} = "<b>[:nick]</b> ha sido algo capullo y por eso lo echamos [:kicks] veces!";
  1610. $T{ES}{gotkick2} = "<b>[:nick]</b> tambien nos toca bastante las narices, por eso lo echamos [:kicks] veces";
  1611. $T{ES}{joins} = "<b>[:nick]</b> no sabe si irse o quedarse, lo he visto [:joins] veces entrando en el canal!";
  1612. $T{ES}{kick1} = "<b>[:nick]</b> actua como operador con mano dura, ha echado a [:kicked] personas!";
  1613. $T{ES}{kick2} = "[:oldnick] tiene un seguidor aferrimo, <b>[:nick]</b>, ha echado a [:kicked] personas";
  1614. $T{ES}{kick3} = "Es maja la gente de aquí, nadie ha sido kikeado!";
  1615. $T{ES}{mono1} = "<b>[:nick]</b> no tiene amigos, ha escrito más de 5 lineas seguidas en [:monos] ocasiones!";
  1616. $T{ES}{mono2} = "Otra persona solitaria es <b>[:nick]</b>, que ha echo lo mismo [:monos] veces";
  1617. $T{ES}{long1} = "<b>[:nick]</b> escribe más que Cervantes con unas [:letters] letras por linea...";
  1618. $T{ES}{long2} = "La media de [:channel] es de [:avg] letras por linea";
  1619. $T{ES}{short1} = "<b>[:nick]</b> es la persona más vaga escribiendo, con una media de [:letters] letras por linea...";
  1620. $T{ES}{short2} = "[:nick] no se queda atrás, con una media de [:letters]";
  1621. $T{ES}{foul1} = "<b>[:nick]</b> necesita que le laven la boca con jabón lagarto, un [:per]% de sus lineas contienen palabrotas y tacos";
  1622. $T{ES}{foul2} = "<b>[:nick]</b> tambien es algo bestia, dice tacos el [:per]% del tiempo";
  1623. $T{ES}{foul3} = "Parece que todo el mundo habla correctamente en [:channel]! Se desahogan fuera?";
  1624. $T{ES}{smiles1} = "<b>[:nick]</b> parece que se hubiera fumado una compresa usada, el [:per]% de sus lineas contienen caritas sonrientes :)";
  1625. $T{ES}{smiles2} = "<b>[:nick]</b> habrá fumado otra cosa, está sonriendo el [:per]% del tiempo";
  1626. $T{ES}{smiles3} = "Nadie ha sonrreido en [:channel]! Arriba esos animos!!.";
  1627. $T{ES}{sad1} = "<b>[:nick]</b> parece disgustado, el [:per]% de sus lineas contienen caras tristes :(";
  1628. $T{ES}{sad2} = "<b>[:nick]</b> tambien está triste el [:per]% del tiempo";
  1629. $T{ES}{sad3} = "Nadie está triste en [:channel]! Aquí somos todos felices :-)";
  1630. $T{ES}{notopic} = "Nunca se ha utilizado el topic en el canal";
  1631. ## Topics
  1632. $T{ES}{bignumtopic} = "Acerca de nuestra gente";
  1633. $T{ES}{othernumtopic} = "Otras cosas interesantes";
  1634. $T{ES}{latesttopic} = "Últimos Topics";
  1635. $T{ES}{activetimestopic} = "Horas más frecuentadas";
  1636. $T{ES}{activenickstopic} = "La gente que más habla";
  1637. $T{ES}{mostwordstopic} = "Las palabras más utilizadas";
  1638. $T{ES}{referencetopic} = "Las personas de las que más se habla";
  1639. ## Other text
  1640. $T{ES}{totallines} = "Número total de lineas: [:lines]";
  1641. $T{ES}{nick} = "Nick";
  1642. $T{ES}{numberlines} = "Número de lineas";
  1643. $T{ES}{randquote} = "Frase al azar";
  1644. $T{ES}{userpic} = "Foto";
  1645. $T{ES}{nottop} = "Ellos tambien están, aunque hablan menos:";
  1646. $T{ES}{word} = "Palabra";
  1647. $T{ES}{numberuses} = "Número de usos";
  1648. $T{ES}{lastused} = "Usada por última vez";
  1649. $T{ES}{pagetitle1} = "[:channel] @ [:network] estadisticas por [:maintainer]";
  1650. $T{ES}{pagetitle2} = "Estadisticas generadas en [:time]";
  1651. $T{ES}{pagetitle3} = "Durante los [:days] dias de estadisticas, [:nicks] nicks distintos han pasado por[:channel].";
  1652. ### Polish
  1653. $T{PL}{mostop1} = "<b>[:nick]</b> lubi rozdawac opy, robiac to [:ops] razy...";
  1654. $T{PL}{mostop2} = "Milo ze strony <b>[:nick]</b> - zyskuje popularnosc nadajac [:ops] opow.";
  1655. $T{PL}{mostop3} = "Dziwne, nie dano zadnego opa na [:channel]!";
  1656. $T{PL}{mostdeop1} = "<b>[:nick]</b> jest kanalowym szeryfem odbierajac [:deops] opow...";
  1657. $T{PL}{mostdeop2} = "<b>[:nick]</b> zdeopowal [:deops] uzytkownikow";
  1658. $T{PL}{mostdeop3} = "Wow, zaden op nie zostal odebrany na [:channel]!";
  1659. $T{PL}{question1} = "<b>[:nick]</b> jest glupi albo zadaje wiele pytan... [:per]% linii zawieralo pytania!";
  1660. $T{PL}{question2} = "<b>[:nick]</b> rowniez nie wie zbyt wiele, [:per]% linii bylo pytaniami";
  1661. $T{PL}{question3} = "Nikt o nic nie pyta na kanale - czyzby sami geniusze?";
  1662. $T{PL}{loud1} = "Najglosniejszym okazal/a sie <b>[:nick]</b> krzczac przez [:per]% czasu!";
  1663. $T{PL}{loud2} = "Kolejnym krzykaczem byl <b>[:nick]</b> ktory wrzeszczal przez [:per]% czasu!";
  1664. $T{PL}{loud3} = "Nikt nic nie wykrzykiwal na kanale, wow.";
  1665. $T{PL}{gotkick1} = "<b>[:nick]</b> nie zalapal o co chodzilo operatorom za pierwszym razem i zostal skopany [:kicks] razy!";
  1666. $T{PL}{gotkick2} = "<b>[:nick]</b> nie jest tu chyba zbyt lubiany - wylatywal [:kicks] razy";
  1667. $T{PL}{joins} = "<b>[:nick]</b> zastanawial sie nad \"byc albo nie byc\", [:joins] razy wchodzil na kanal!";
  1668. $T{PL}{kick1} = "<b>[:nick]</b> jest szalony lub stara sie byc konsekwentny, wykopal [:kicked] osob";
  1669. $T{PL}{kick2} = "<b>[:nick]</b> idac w slad za [:oldnick] wykopal [:kicked] osob";
  1670. $T{PL}{kick3} = "Mamy tutaj milych operatorow, nikt nie zostal wykopany!";
  1671. $T{PL}{mono1} = "<b>[:nick]</b> uwielbia mowic sam do siebie, albo inni za nim nie nadazaja, pisal monologi [:monos] razy!";
  1672. $T{PL}{mono2} = "Kolejny samotnikiem okazal sie <b>[:nick]</b>, ktory pisal bez towarzystwa [:monos] razy";
  1673. $T{PL}{long1} = "<b>[:nick]</b> pisal najdluzsze linie, o sredniej dlugosci [:letters] liter...";
  1674. $T{PL}{long2} = "Srednia dla kanalu [:channel] byla [:avg] liter w linii";
  1675. $T{PL}{short1} = "<b>[:nick]</b> staral sie pisac zwiezle, srednio [:letters] liter w linii...";
  1676. $T{PL}{short2} = "[:nick] wybakiwal krotkie wypowiedzi srednio [:letters]";
  1677. $T{PL}{foul1} = "<b>[:nick]</b> ma niewyparzona gebe, [:per]% linii zawieralo bluzgi";
  1678. $T{PL}{foul2} = "<b>[:nick]</b> klnie jak szefc (albo i gorzej), przez [:per]% czasu";
  1679. $T{PL}{foul3} = "Nikt nie jest klnie na [:channel]! Czesto wychodza?";
  1680. $T{PL}{smiles1} = "<b>[:nick]</b> usmiechal sie glupawo, albo byl bardzo szczeliwy bo [:per]% linii zawieralo usmiechniete miny :)";
  1681. $T{PL}{smiles2} = "<b>[:nick]</b> mial powody do radosci smiejac sie przez [:per]% czasu spedzonego na kanale";
  1682. $T{PL}{smiles3} = "Nikt sie nie usmiechal na [:channel]! Prosze o usmiech panie i panowie.";
  1683. $T{PL}{sad1} = "<b>[:nick]</b> wyglada na smutna osobe, [:per]% linii zawieralo smutne miny :(";
  1684. $T{PL}{sad2} = "<b>[:nick]</b> nie czuje sie najlepiej na kanale smucac sie przez [:per]% czasu";
  1685. $T{PL}{sad3} = "Nikt nie jest smutny na [:channel]! Coz za szczesliwy kanal :-)";
  1686. $T{PL}{notopic} = "Czyzby nigdy nie ustawiono tematu na tym kanale?";
  1687. ## Topics
  1688. $T{PL}{bignumtopic} = "Wielkie liczby";
  1689. $T{PL}{othernumtopic} = "Inne interesujace liczby";
  1690. $T{PL}{latesttopic} = "Ostatnie tematy";
  1691. $T{PL}{activetimestopic} = "Najaktywniejsze pory";
  1692. $T{PL}{activenickstopic} = "Najaktywniejsze nicki";
  1693. $T{PL}{mostwordstopic} = "Najczesciej uzywane slowa";
  1694. $T{PL}{referencetopic} = "Najczesciej wywolywany nick";
  1695. ## Other text
  1696. $T{PL}{totallines} = "Calkowita liczba linii: [:lines]";
  1697. $T{PL}{nick} = "Nick";
  1698. $T{PL}{numberlines} = "Liczba linii";
  1699. $T{PL}{randquote} = "Losowy cytat";
  1700. $T{PL}{userpic} = "Userpic";
  1701. $T{PL}{nottop} = "Oni nie dostali sie do czolowki:";
  1702. $T{PL}{word} = "Wyraz";
  1703. $T{PL}{numberuses} = "Liczba uzyc";
  1704. $T{PL}{lastused} = "Ostatnio uzywany przez";
  1705. $T{PL}{pagetitle1} = "[:channel] @ [:network] stats by [:maintainer]";
  1706. $T{PL}{pagetitle2} = "Statystyka wygenerowana [:time]";
  1707. $T{PL}{pagetitle3} = "W przedziale [:days]\-dni, <b>[:nicks]</b> roznych nickow odwiedzilo kanal [:channel].";
  1708. &main(); # Run the script