Advertisement
Ford

Logserver

May 2nd, 2012
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 19.78 KB | None | 0 0
  1. ;LogServer by Ford_Lawnmower irc.geekshed.net #Script-Help
  2. menu channel,status,menubar {
  3.   LogServer: dialog $iif($dialog(LogServer),-v,-m LogServer) LogServer
  4. }
  5. #LogServerServer On
  6. On *:Socklisten:LogServer: sockaccept $+(Chanlogs.,$network,$chan,$ticks,$r(1,1000))
  7. On *:Sockread:Chanlogs.*: {
  8.   var %Chanlogs | sockread %Chanlogs
  9.   if ($regex(%Chanlogs,/GET\s\/(.*)\sHTTP\//)) {
  10.     var %filename $+(LogServer/,$recode($regml(1)))
  11.     hinc LogServer AccessCount
  12.     if ($file(%filename).size) {
  13.       var %filelen $v1, %maxsend 1024
  14.       sockwrite -n $sockname HTTP/1.1 200 OK
  15.       sockwrite -n $sockname Content-Type: text/html
  16.       sockwrite -n $sockname Content-Length: $file(%filename).size
  17.       sockwrite -n $sockname
  18.       sockmark $sockname %filename 0 %maxsend $iif($ceil($calc(%filelen / %maxsend)),$v1,1)
  19.     }
  20.     else {
  21.       sockwrite -n $sockname HTTP/1.0 400 Bad Request
  22.       sockwrite -n $sockname Connection: close
  23.       sockclose $sockname
  24.     }
  25.   }
  26. }
  27. On *:Sockwrite:Chanlogs.*: {
  28.   tokenize 32 $sock($sockname).mark
  29.   if ($4) {
  30.     bread $1-3 &binvar
  31.     sockwrite -n $sockname &binvar
  32.     sockmark $sockname $1 $calc($2 + $3) $3 $calc($4 - 1)
  33.     bunset &binvar
  34.   }
  35.   else {
  36.     sockwrite -n $sockname
  37.     sockwrite -n $sockname Connection: close
  38.     sockclose $sockname  
  39.   }
  40. }
  41. #LogServerServer End
  42. #LogServerLogging on
  43. On *:Text:*:#: WriteLogs $event $chan $nick $1-
  44. On *:Action:*:#: WriteLogs $event $chan * $nick $1-
  45. On *:Join:#: WriteLogs $event $chan * $nick Joins $chan
  46. On *:Part:#: WriteLogs $event $chan * $nick Parts $chan $+($chr(40),$1-,$chr(41))
  47. On *:Kick:#: WriteLogs $event $chan * $nick Kicked $knick Out of $chan $+($chr(40),$1-,$chr(41))
  48. On *:RawMode:#: WriteLogs $event $chan * $nick Sets Mode(s) $1-
  49. On *:Nick: WriteAllLogs $event <chan> $newnick * $nick Changes Nick to $newnick
  50. On *:Quit: WriteAllLogs $event <chan> $nick * $nick Quits $network $+($chr(40),$1-,$chr(41))
  51. On *:Topic:#: WriteLogs $event $chan * $nick Changes Topic to: $1-
  52. On *:Input:#: {
  53.   if ($left($1,1) != / && !$ctrlenter) { WriteLogs me $chan $nick $1- }
  54. }
  55. On *:Start: {
  56.   if (!$hget(LogServer)) hmake LogServer 5
  57.   if ($file(LogServer.hsh).size) hload LogServer LogServer.hsh
  58.   if ($hget(LogServer,Server)) LogServerStart $hget(LogServer,Port)
  59. }
  60. On *:Unload: hfree LogServer
  61. #LogServerLogging End
  62. On *:Dialog:LogServer:init:*: LogServerInit $dname
  63. On *:Dialog:LogServer:close:*: {
  64.   if ($hget(LogServer)) hsave $v1 $+($v1,.hsh)
  65. }
  66. On *:Dialog:LogServer:Sclick:*: {
  67.   if ($did == 1) {
  68.     didtok -ra $dname 2 32 $chans($did(1))
  69.     did -c $dname 2 1
  70.     LogServerWriteDialog
  71.   }
  72.   elseif ($did == 2) LogServerWriteDialog
  73.   elseif ($did < 25) {
  74.     LogServerWriteHash
  75.     if (($findtok(23 24,$did,32)) && ($did(23).state)) LogServerStart $did(21)
  76.     elseif ($did == 22) $iif($did(22).state,.enable,.disable) #LogServerLogging
  77.   }
  78.   elseif ($did == 50) url -a $+($did(20),:,$did(21),/,$did(1),/,$urlencode($did(2)),/,$urlencode($did(2)),.html)
  79. }
  80. dialog LogServer {
  81.   title "Log Server"
  82.   size -1 -1 234 253
  83.   option dbu
  84.   combo 1, 8 22 100 10, drop
  85.   combo 2, 125 22 100 10, drop
  86.   combo 3, 8 50 69 10, drop
  87.   combo 4, 82 50 69 10, drop
  88.   combo 5, 157 50 69 10, drop
  89.   combo 6, 8 69 69 10, drop
  90.   combo 7, 82 69 69 10, drop
  91.   combo 8, 157 69 69 10, drop
  92.   combo 9, 8 88 69 10, drop
  93.   combo 10, 82 88 69 10, drop
  94.   combo 11, 157 88 69 10, drop
  95.   combo 12, 8 107 69 10, drop
  96.   combo 13, 82 107 69 10, drop
  97.   edit "", 14, 31 132 196 10, autohs
  98.   combo 15, 31 144 62 11, drop
  99.   combo 16, 120 144 41 11, drop
  100.   combo 17, 185 144 41 11, drop
  101.   radio "On", 18, 18 171 26 10, group push
  102.   radio "Off", 19, 18 186 26 10, push
  103.   edit "", 20, 132 171 83 10, autohs
  104.   edit "", 21, 132 186 83 10, autohs
  105.   check "Logging On", 22, 33 213 50 10
  106.   check "Server On", 23, 126 213 50 10
  107.   button "Save", 24, 146 239 37 12
  108.   button "Quit", 25, 194 239 37 12, Cancel
  109.   text "Network:", 26, 8 13 27 8
  110.   text "Channel:", 27, 125 13 25 8
  111.   text "Join:", 28, 8 42 25 8
  112.   text "Part:", 29, 82 42 25 8
  113.   text "Quit:", 30, 157 42 25 8
  114.   text "Kick:", 31, 8 61 25 8
  115.   text "RawMode:", 32, 82 61 29 8
  116.   text "Nick:", 33, 157 61 25 8
  117.   text "Text:", 34, 8 80 25 8
  118.   text "Action:", 35, 82 80 25 8
  119.   text "Input:", 36, 157 80 25 8
  120.   text "Topic:", 37, 8 99 25 8
  121.   text "Host Name:", 38, 85 171 31 8
  122.   text "Server Port:", 39, 85 186 31 8
  123.   text "Text:", 40, 4 132 25 8, right
  124.   text "Color:", 41, 4 144 25 8, right
  125.   text "Size:", 42, 94 144 25 8, right
  126.   text "Style:", 43, 162 144 22 8, right
  127.   text "", 44, 2 242 141 8  
  128.   box "Colors", 45, 3 33 228 91
  129.   box "Logging", 46, 3 160 56 40
  130.   box "Server Information", 47, 69 160 162 40
  131.   box "Master Switch", 48, 3 202 229 25
  132.   box "Headers", 49, 3 124 228 34
  133.   link "", 50, 3 229 228 8
  134.   text "Background:", 51, 82 99 33 8
  135. }
  136. alias -l LogServerStart {
  137.   .enable #LogServerServer
  138.   if ($1 != $sock(LogServer).port) {
  139.     if ($sock(LogServer)) sockclose LogServer
  140.     if ($portfree($1)) {
  141.       socklisten LogServer $1
  142.       .enable #LogServerServer
  143.     }
  144.     else {
  145.       if ($dialog(LogServer)) {
  146.         did -u LogServer 23
  147.         hadd LogServer server 0
  148.         .disable #LogServerServer
  149.       }
  150.       var %noop $input(Port $1 is already in use! Server status is Off!,o,LogServer)
  151.     }
  152.   }
  153. }
  154. alias -l urlencode return $regsubex($1-,/([^a-z0-9])/ig,% $+ $base($asc(\t),10,16,2))
  155. alias -l recode return $regsubex($1-,/%([0-9a-f]{2})/gi,$chr($base(\t,16,10)))
  156. alias -l tag return <a $+(class=",$1,">)
  157. alias -l WriteLogs {
  158.   if ($gettok($hget(LogServer,$+($network,$2)),2,32)) {
  159.     var %timestamp $+($tag(c1),[,</a>,$tag(c2),$time(hh),</a>,$tag(c1),:,</a>,$tag(c2),$time(nnTT),</a>,$tag(c1),]</a>)
  160.     var %nickstamp $+($tag(c1),$chr(40),</a>,$tag(c2),$symbol($2,$3),$3,</a>,$tag(c1),$chr(41),</a>)
  161.     var %events join part text me action kick nick rawmode quit topic
  162.     var %CurrentLog $+(LogServer\,$network,\,$2,\,$2,.html)
  163.     if (!$isdir($+(LogServer\,$network))) {
  164.       if (!$isdir(LogServer)) { mkdir LogServer }
  165.       mkdir $+(LogServer\,$network)
  166.       mkdir $+(Logserver\,$network,\,$2)
  167.     }
  168.     elseif ($findtok(%events,$1,32)) {
  169.       var %match $gettok(%events,$v1,32)
  170.       if (!$isdir($+(LogServer\,$network,\,$2))) mkdir $+(Logserver\,$network,\,$2)
  171.       if (!$exists($+(LogServer\,$network,\,$2,\,$2,.html))) {
  172.         LogServerWriteStyle $Hash2Color($+($2,$chr(32),$hget(LogServer,$+($network,$2))))
  173.         .timer -o 1 2 write -l30 %CurrentLog Logging started $fulldate <br>
  174.       }
  175.       if ($gettok($hget(LogServer,$+($network,$2)),1,32) != $day) {
  176.         if ($v1 && $file(%CurrentLog).size) { .copy -o %CurrentLog $+(LogServer\,$network,\,$2,\,$asctime($calc($ctime - 86400),mm-dd-yyyy),.html) }
  177.         write -c %CurrentLog
  178.         LogServerWriteStyle $Hash2Color($+($2,$chr(32),$hget(LogServer,$+($network,$2))))
  179.         .timer -o 1 2 write -l30 %CurrentLog Logging started $fulldate <br>
  180.         .timer -o 1 3 write $+(-il,$calc($lines(%CurrentLog) - 1)) %CurrentLog $+(%timestamp,$chr(32),%nickstamp,$chr(32),$tag(%match),$parseurl($HTMLFormat($strip($noeval($4-)))),</a><br>)
  181.         hadd Logserver $+($network,$2)) $puttok($hget(LogServer,$+($network,$2)),$day,1,32)
  182.         var %indexfile $+(LogServer\,$network,\,$2,\index.html)
  183.         if ($exists(%indexfile)) {
  184.           var %adding $+(LogServer\,$network,\,$2,\,$asctime($calc($ctime - 86400),mm-dd-yyyy),.html), %add $nopath(%adding)
  185.           write -il4 $qt(%indexfile) $+(<tr><td><a href=",$urlencode(%add),">,$gettok(%add,1,46),</a></td><td>Size: $bytes($file(%adding).size,3).suf, $&
  186.             </td><td>Created: $asctime($file(%adding).ctime) </td><td>Last Modified: $asctime($file(%adding).mtime),$&
  187.             </td></tr>)
  188.         }
  189.         if (!$exists(%indexfile)) {
  190.           Reinitializeindexs
  191.           WriteChannelIndexHeaders $+(LogServer\,$network,\,$2)
  192.         }
  193.       }
  194.       else {
  195.         if ($1 == topic) {
  196.           write -l29 %CurrentLog Topic is: $strip($mIRC2HTML($parseurl($chan($2).topic))) <br>
  197.           .timer -o 1 2 write $+(-il,$calc($lines(%CurrentLog) - 1)) %CurrentLog $+(%timestamp,$chr(32),%nickstamp,$chr(32),$tag(%match),$parseurl($HTMLFormat($strip($noeval($4-)))),</a><br>)
  198.         }
  199.         else {
  200.           write $+(-il,$calc($lines(%CurrentLog) - 1)) %CurrentLog $+(%timestamp,$chr(32),%nickstamp,$chr(32),$tag(%match),$parseurl($HTMLFormat($strip($noeval($4-)))),</a><br>)
  201.         }
  202.       }
  203.     }
  204.   }
  205. }  
  206. alias -l WriteAllLogs {
  207.   var %chans $comchan($3,0),%count 1
  208.   while (%count <= %chans) {
  209.     WriteLogs $1 $comchan($3,%count) $4-
  210.     inc %count
  211.   }
  212. }
  213. alias -l symbol return $iif($remove($nick($1,$2).pnick,$2),$left($v1,1))
  214. alias -l parseurl {
  215.   return $regsubex($1-,/((http:\/\/|www\.)[^\s^\x5d^\x29]*)/gi,$+(<a target="_blank" href=",\1,">,\1,</a>))
  216. }
  217. alias -l chans { scon $netid($1) return $!regsubex($str(.,$chan(0)),/./g,$+($chr(32),$chan(\n))) }
  218. alias -l NetScID {
  219.   var %net $1, %netid $regsubex($str(.,$scon(0)),/./g,$iif($scon(\n).network == %net,\n,$null))
  220.   scon %netid return $!cid
  221. }
  222. alias -l nets { return $regsubex($str(.,$scon(0)),/./g,$+($chr(32),$scon(\n).network)) }
  223. alias -l netid {
  224.   var %netcount $scon(0)
  225.   while %netcount {
  226.     if ($scon(%netcount).network == $1) { return %netcount }
  227.     dec %netcount
  228.   }
  229. }
  230. alias -l LogServerInit {
  231.   var %colors black silver gray white maroon red purple fuchsia green lime olive yellow navy blue teal aqua
  232.   didtok -a $1 1 32 $nets
  233.   did -c $1 1 1
  234.   didtok -a $1 2 32 $chans($did(1))
  235.   did -c $1 2 1
  236.   didtok -a $1 3-13,15 32 %colors
  237.   didtok -a $1 16 32 $regsubex($str(.,50),/./g,$+($chr(32),\n))
  238.   didtok -a $1 17 32 b i u b/i b/u i/u b/i/u
  239.   LogServerWriteDialog
  240. }
  241. alias -l LogServerWriteDialog {
  242.   if ($hget(LogServer,$+($did(1),$did(2)))) {
  243.     tokenize 32 $v1
  244.     did -c $dname $iif($2,18,19)
  245.     did -u $dname $iif($2,19,18)
  246.     var %start 3
  247.     while (%start <= 16) {
  248.       if (%start < 14) { did -c $dname %start $($+($,%start),3) }
  249.       else { did -c $dname $calc(%start + 1) $($+($,%start),3) }
  250.       inc %start
  251.     }
  252.     did -ra $dname 14 $19-
  253.     did -ra $dname 20 $hget(LogServer,Host)
  254.     did -ra $dname 21 $hget(LogServer,Port)
  255.     did $iif($hget(LogServer,logging),-c,-u) $dname 22
  256.     did $iif($hget(LogServer,server),-c,-u) $dname 23
  257.     did -ra $dname 50 Logserver for $did(2) on $did(1)
  258.   }
  259.   else LogServerDefaults $dname
  260. }
  261. alias -l LogServerDefaults {
  262.   var %key 0 0 9 9 2 6 6 14 7 11 15 13 4 0 14 30 1,%start 3
  263.   while (%start <= 17) {
  264.     did -c $1 %start $gettok(%key,%start,32)
  265.     inc %start
  266.   }
  267.   did -ra $1 14 Log File for $did($1,2) on $did($1,1)
  268.   did -ra $1 20 $iif($hget(LogServer,Host),$v1,http://127.0.0.1)
  269.   did -ra $1 21 $iif($hget(LogServer,Port),$v1,1337)
  270.   did -c $1 19
  271.   did -u $1 18
  272.   did -ra $dname 50 Logserver for $did(2) on $did(1)
  273. }
  274. alias -l LogServerWriteHash {
  275.   var %EventInfo $regsubex($str(.,11),/./g,$+($chr(32),$did($calc(\n + 2)).sel))
  276.   var %HeaderInfo $regsubex($str(.,3),/./g,$+($chr(32),$did($calc(\n + 14)).sel))
  277.   var %day $iif($gettok($hget(LogServer,$+($did(1),$did(2))),1,32),$v1,0)
  278.   hadd -m LogServer $+($did(1),$did(2)) %day $did(18).state %EventInfo %HeaderInfo $did(20) $did(21) $did(14)
  279.   hadd LogServer Server $did(22).state
  280.   hadd LogServer Logging $did(23).state
  281.   hadd LogServer Host $did(20)
  282.   hadd LogServer Port $did(21)
  283.   LogServerWriteStyle $regsubex($str(.,13),/./g,$+($chr(32),$did(\n))) $regsubex($str(.,3),/./g,$+($chr(32),$did($calc(\n + 14)))) $did(14)
  284. }
  285. alias -l LogServerWriteStyle {
  286.   var %WriteKey 0 0 0 join part quit kick rawmode nick text action me topic, %LogFile $+(LogServer\,$1,\,$2,\,$2,.html)
  287.   if (!$isdir($+(LogServer\,$1,\,$2))) {
  288.     if (!$isdir(LogServer)) mkdir LogServer
  289.     if (!$isdir($+(LogServer\,$1))) mkdir $+(LogServer\,$1)
  290.     if (!$isdir($+(LogServer\,$1,\,$2))) mkdir $+(LogServer\,$1,\,$2)
  291.   }
  292.   write -l1 %LogFile <html>
  293.   write -l2 %LogFile <head>
  294.   write -l3 %LogFile <style type="text/css">
  295.   var %start 4
  296.   while (%start <= 12) {
  297.     write $+(-l,%start) %LogFile $+(a.,$gettok(%WriteKey,%start,32)) $chr(123) color: $($+($,$calc(%start - 1),;),3) background: $+($13,;) $chr(125)
  298.     inc %start
  299.   }
  300.   write -l13 %LogFile
  301.   write -l14 %LogFile
  302.   write -l15 %LogFile h1 $chr(123) color: $+($14,;) background: $+($13,;) font-size: $+($15,pt;) $TextFormat($16) $chr(125)
  303.   write -l16 %LogFile a.c1 $chr(123) color: lime; background: $+($13,;) font-weight: bold; $chr(125)
  304.   write -l17 %LogFile a.c2 $chr(123) color: red; background: $+($13,;) $chr(125)
  305.   write -l18 %LogFile body $chr(123) color: $+($iif($13 == white,black,white),;) background-color: $+($13,;) background-image: none; $chr(125)
  306.   var %start 19
  307.   while (%start <= 24) {
  308.     write $+(-l,%start) %LogFile
  309.     inc %start
  310.   }  
  311.   write -l25 %LogFile </style>
  312.   write -l26 %LogFile </head>
  313.   write -l27 %LogFile <body>
  314.   write -l28 %LogFile <h1> $17- </h1><br>
  315.   scid $NetScID($1)
  316.   write -l29 %LogFile Topic is: $strip($mIRC2HTML($parseurl($chan($2).topic))) <br>
  317.   if ($lines(%LogFile) == 29) {
  318.     write -l30 %LogFile
  319.     write -l31 %LogFile </body>
  320.     write -l32 %LogFile </html>
  321.   }
  322. }
  323. alias -l Hash2Color {
  324.   var %ColorKey black silver gray white maroon red purple fuchsia green lime olive yellow navy blue teal aqua
  325.   var %len $gettok($1-,0,32), %StyleKey b i u b/i b/u i/u b/i/u, %count 3, %result
  326.   while (%count <= %len) {
  327.     if (%count > 3 && %count < 16) { %result = $+(%result,$chr(32),$gettok(%ColorKey,$gettok($1-,%count,32),32)) }
  328.     elseif (%count == 17) { %result = $+(%result,$chr(32),$gettok(%StyleKey,$gettok($1-,%count,32),32)) }
  329.     elseif (%count > 19 || %count == 16) { %result = $+(%result,$chr(32),$gettok($1-,%count,32)) }
  330.     inc %count
  331.   }
  332.   return $network $gettok($1-,1,32) %result
  333. }
  334. alias LWrite {
  335.   ;;
  336.   tokenize 1 $1-
  337.   var %file $1, %start $2, %count 3
  338.   while (%count <= $0) {
  339.     echo -a write $+(-l,%start) %file $($+($,%count),2)
  340.     inc %start
  341.     inc %count
  342.   }
  343. }
  344. alias -l mIRC2HTML return $regsubex($1-,/([0-9]{1,2})(?:\x2C[0-9]{1,2})?/g,$+($iif(\n != 1,</font>),<font color= $mIRC2Color($int(\1)),>))) $+ $iif($regml(0),</font>)
  345. alias -l mIRC2Color {
  346.   var %key white black blue green red maroon purple olive yellow lime teal aqua namy fuchsia gray silver
  347.   return $qt($gettok(%key,$calc($1 + 1),32))
  348. }
  349. alias -l TextFormat return $replacex($1,/,$chr(32),b,font-weight: bold; ,i,font-style: italic;,u,text-decoration: underline;)
  350. alias -l HTMLFormat return $regsubex($1-,/([<>\[\]\{\}\(\)]{1})/g,$+(&#x,$base($asc(\t),10,16),;))
  351. alias LSUpdate {
  352.   var %dirs1 $finddir(Logserver,*,0,1)
  353.   while (%dirs1) {
  354.     echo -gat Processing $finddir(Logserver,*,%dirs1,1)
  355.     .timer 1 $calc(%dirs1 * 20) UpdateTransfer $qt($finddir(Logserver,*,%dirs1,1))
  356.     dec %dirs1
  357.   }
  358. }
  359. alias -l UpdateTransfer {
  360.   var %dirs2 $findfile($1-,*,0,1), %dir $1-
  361.   echo -gat Processing %dir
  362.   while (%dirs2) {
  363.     var %file $findfile($1-,*,%dirs2,1)
  364.     if ($regex(%file,/(.*)(#.*)(\d\d-\d\d-[\d]{4}.html)/)) {
  365.       var %newdir $+($regml(1),$regml(2))
  366.       if (!$isdir(%newdir)) mkdir %newdir
  367.       .copy $qt(%file) $qt($+(%newdir,\,$regml(3)))
  368.       .remove $qt(%file)
  369.     }
  370.     else echo -gat copy %file $qt($+($gettok(%file,1--2,46),\,$nopath(%file)))
  371.     dec %dirs2
  372.   }
  373.   echo -gat Directory %dir complete!
  374. }
  375. alias initializeindex {
  376.   var %dir $finddir(Logserver,*,0,1), %chan, %dir2, %current, %rem, %remchan
  377.   write -c $+(Logserver,/,index.html) <html><center> $str(<img src="/favicon.ico"/>,10) </center>
  378.   write $+(Logserver,/,index.html) <p><h2><center><b> mIRC LogServer Network Index </b></center></h2></p>
  379.   while (%dir) {
  380.     %current = $nopath($finddir(Logserver,*,%dir,1))
  381.     %dir2 =  $finddir($finddir(Logserver,*,%dir,1),*,0,1)
  382.     while (%dir2) {
  383.       %chan = $nopath($finddir($finddir(Logserver,*,%dir,1),*,%dir2,1))
  384.       tokenize 32 $hget(LogServer,$+(%current,%chan))
  385.       if (%rem != %current) {
  386.         write -c $+(Logserver,/,%current,/,index.html) <html><center> $str(<img $+(src=",/favicon.ico,"/>),10) </center>
  387.         write $+(Logserver,/,%current,/,index.html) <p><h2><center><b> mIRC LogServer Channel Index for %current </b></center></h2></p>
  388.         write $+(Logserver,/,index.html) $+(<a href=",%current,/,index.html,"><h2><p style="text-align:center">,%current,</a></h2>)
  389.         %rem = %current
  390.       }
  391.       write $+(Logserver,/,%current,/,index.html) $+(<a href=",$urlencode(%chan),/,index.html,"><h2><p style="text-align:center">,%chan,</a></h2>)
  392.       .timer 1 $calc(%dir2 * 20) LogServerWriteIndex $finddir($finddir(Logserver,*,%dir,1),*,%dir2,1)
  393.       dec %dir2
  394.     }
  395.     write $+(Logserver,/,%current,/,index.html) </html>
  396.     dec %dir
  397.   }
  398.   write $+(Logserver,/,index.html) </html>
  399. }
  400. alias -l LogServerWriteIndex {
  401.   var %counter 1, %count $findfile($1-,*.html,0,1), %record, %current, %file $+($nofile($findfile($1-,*.html,%count,1)),index.html)
  402.   write -c $qt(%file) <html><center> $str(<img $+(src=",/favicon.ico,"/>),10) </center>
  403.   write $qt(%file) <p><h2><center><b> mIRC LogServer Log Index for $nopath($1-) on $gettok($1-,-2,92) </b></center></h2></p><br><table border="1">
  404.   echo -gat writing index for $nopath($1-) on $gettok($1-,-2,92) to %file
  405.   while (%counter <= %count) {
  406.     %current = $findfile($1-,*.html,%counter,1)
  407.     %record = $nopath(%current)
  408.     write $qt(%file) $+(<tr><td><a href=",$urlencode(%record),">,$gettok(%record,1--2,46),</a></td><td>Size: $bytes($file(%current).size,3).suf, $&
  409.       </td><td>Created: $asctime($file(%current).ctime) </td><td>Last Modified: $asctime($file(%current).mtime),$&
  410.       </td></tr>)
  411.     inc %counter
  412.   }
  413.   write $qt(%file) </table></html>
  414. }
  415. alias -l WriteChannelIndexHeaders {
  416.   var %counter 1, %count $findfile($1-,*.html,0,1), %record, %current, %file $+($nofile($findfile($1-,*.html,%count,1)),index.html)
  417.   write -c $qt(%file) <html><center> $str(<img $+(src=",/favicon.ico,"/>),10) </center>
  418.   write $qt(%file) <p><h2><center><b> mIRC LogServer Log Index for $nopath($1-) on $gettok($1-,-2,92) </b></center></h2></p><br><table border="1">
  419.   while (%counter <= %count) {
  420.     %current = $findfile($1-,*.html,%counter,1)
  421.     %record = $nopath(%current)
  422.     write $qt(%file) $+(<tr><td><a href=",$urlencode(%record),">,$gettok(%record,1--2,46),</a></td><td>Size: $bytes($file(%current).size,3).suf, $&
  423.       </td><td>Created: $asctime($file(%current).ctime) </td><td>Last Modified: $asctime($file(%current).mtime),$&
  424.       </td></tr>)
  425.     inc %counter
  426.   }
  427.   write $qt(%file) </table></html>
  428. }
  429. alias -l noeval {
  430.   return $replace($regsubex($1-,/([\$\|\%\[\]\}\{][^\s]*)/g,$+($chr(2),\t,$chr(2))),$chr(124),$chr(166))
  431. }
  432. alias -l Reinitializeindexs {
  433.   var %dir $finddir(Logserver,*,0,1), %chan, %dir2, %current, %rem, %remchan
  434.   write -c $+(Logserver,/,index.html) <html><center> $str(<img src="/favicon.ico"/>,10) </center>
  435.   write $+(Logserver,/,index.html) <p><h2><center><b> mIRC LogServer Network Index </b></center></h2></p>
  436.   while (%dir) {
  437.     %current = $nopath($finddir(Logserver,*,%dir,1))
  438.     %dir2 =  $finddir($finddir(Logserver,*,%dir,1),*,0,1)
  439.     while (%dir2) {
  440.       %chan = $nopath($finddir($finddir(Logserver,*,%dir,1),*,%dir2,1))
  441.       tokenize 32 $hget(LogServer,$+(%current,%chan))
  442.       if (%rem != %current) {
  443.         write -c $+(Logserver,/,%current,/,index.html) <html><center> $str(<img $+(src=",/favicon.ico,"/>),10) </center>
  444.         write $+(Logserver,/,%current,/,index.html) <p><h2><center><b> mIRC LogServer Channel Index for %current </b></center></h2></p>
  445.         write $+(Logserver,/,index.html) $+(<a href=",%current,/,index.html,"><h2><p style="text-align:center">,%current,</a></h2>)
  446.         %rem = %current
  447.       }
  448.       write $+(Logserver,/,%current,/,index.html) $+(<a href=",$urlencode(%chan),/,index.html,"><h2><p style="text-align:center">,%chan,</a></h2>)
  449.       dec %dir2
  450.     }
  451.     write $+(Logserver,/,%current,/,index.html) </html>
  452.     dec %dir
  453.   }
  454.   write $+(Logserver,/,index.html) </html>
  455. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement