Changeset 98


Ignore:
Timestamp:
Jul 31, 2008, 4:13:02 PM (16 years ago)
Author:
george
Message:
  • Přidáno: Podpora pro IRC chat. IRC bot pro sledování historie a ukládání zpráv do databáze.
Location:
devel/www
Files:
1 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • devel/www/chat/irc_bot.php

    r94 r98  
    11<?php
    22
    3 // PHP IRC bot
    4 // Based on HARVESTER IRC BOT by Harvie
     3include('../global.php');
    54
    65class IRCBot
     
    109  var $Port = 6667;
    1110  var $Channel = "#zdechov";
    12   var $Nick = "BigBrother";
     11  var $Nick = "History";
    1312  var $JokeFileName = "jokes.txt";
    1413  var $File;
     
    4241  function Run()
    4342  {
     43    global $Database;
     44
    4445    while(!fwrite($this->File, ''))
    4546    {
     
    7071      }
    7172
     73      // Log messages to database
     74      if(strpos($Line, 'PRIVMSG') !== false)
     75      {
     76        $LineParts = explode(':', $Line);
     77        $Text = $LineParts[2];
     78        $LineParts2 = explode(' ', $LineParts[1]);
     79        $LineParts3 = explode('@', $LineParts2[0]);
     80        $Host = $LineParts3[1];
     81        $LineParts4 = explode('!', $LineParts3[0]);
     82        $Nick = $LineParts4[0];
     83        $Database->insert('ChatHistory', array('Nick' => $Nick, 'Text' => $Text, 'Host' => $Host, 'Time' => 'NOW()', 'RoomName' => 'Všichni'));
     84      }
     85
    7286      $Commands = explode(':', $Line);
    7387      foreach($Commands as $Index => $Item)
     
    90104          $this->Say('Ja jsem Harvester.');
    91105          /*
    92           irc_say( $sfp, "Harvester - Posle vizitku", $nick, $channel );
     106          irc_say( $sfp, "Bot - Posle vizitku", $nick, $channel );
    93107          irc_say( $sfp, "hhelp - vypise tuto napovedu", $nick, $channel );
    94108          irc_say( $sfp, "hsay:Message - Posle zpravu", $nick, $channel );
  • devel/www/code.php

    r96 r98  
    560560  {
    561561    if($code = array_search($string[$i].$string[($i + 1)], $coding))
    562       $string = substr($string, 0, $i).chr($code).substr($string,$i + 2);
     562      $string = substr($string, 0, $i).chr($code).substr($string, $i + 2);
    563563  }
    564564  return $string;
  • devel/www/finance/bills.php

    r87 r98  
    11<?php
    22//include_once('global.php');
    3 include_once('code.php');
    43
    54class Bill extends Module
  • devel/www/index.php

    r96 r98  
    1616      array('Seznam uživatelů', '/userlist.php', 'comp.gif'),
    1717      array('Seznam počítačů', '/hostlist.php', 'comp.gif'),
    18       array('Historie SunriseChatu', '/sunrisechat/history.php', 'sunrisechat.gif', array('Sunrisechat', 'Display')),
    19       array('Webový SunriseChatu', '/sunrisechat/webchat.php', 'sunrisechat.gif', array('Sunrisechat', 'Webchat')),
     18      array('Historie chatu', '/chat/history.php', 'sunrisechat.gif', array('Chat', 'Display')),
     19      array('Webový chat', 'http://embed.mibbit.com/?server=game.zdechov.net%3A6667&channel=%23zdechov&forcePrompt=true&charset=windows-1250', 'sunrisechat.gif'),
    2020      array('Diskusní fórum', '/forum/', 'discus.gif'),
    2121      array('WebMail', 'https://centrala.zdechov.net/cgi-bin/openwebmail/openwebmail.pl', 'openwebmail.gif'),
  • devel/www/style.css

    r96 r98  
    196196}
    197197
    198 .SunriseChatHistory .Year
     198.ChatHistory .Year
    199199{
    200200  border-style: solid;
     
    205205}
    206206
    207 .SunriseChatHistory .Year .YearContent
     207.ChatHistory .Year .YearContent
    208208{
    209209  margin-left: 15px;
     
    211211}
    212212
    213 .SunriseChatHistory .Year .YearContent .Months
     213.ChatHistory .Year .YearContent .Months
    214214{
    215215  border-style: solid;
     
    220220}
    221221
    222 .SunriseChatHistory .Year .YearContent .Months span
     222.ChatHistory .Year .YearContent .Months span
    223223{
    224224  position: absolute;
     
    226226}
    227227
    228 .SunriseChatHistory .YearContent .Months span strong
     228.ChatHistory .YearContent .Months span strong
    229229{
    230230  border-style: solid;
     
    234234}
    235235
    236 .SunriseChatHistoryText
     236.ChatHistoryText
    237237{
    238238  font-size: small;
  • devel/www/sunrisechat/history.php

    r89 r98  
    22
    33include_once('../global.php');
    4 include_once('../style.php');
    5 include('../page.php');
    64
    75
    8 class SunriseChatHistory extends page
     6class SunriseChatHistory extends Page
    97{
    108  var $FullTitle = 'Výpis z historie SunriseChatu';
Note: See TracChangeset for help on using the changeset viewer.