pisg.pl 74 KB

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