Ignore:
Timestamp:
Jan 17, 2012, 2:10:21 PM (13 years ago)
Author:
chronos
Message:
  • Upraveno: Historie chatu přesunuta do samostatného systémového modulu.
Location:
trunk/Modules/Chat
Files:
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Chat/Chat.php

    r343 r346  
    11<?php
    2 
    3 include_once('../global.php');
    4 
    52
    63class ChatHistory extends Page
     
    1815  {
    1916    global $MonthNames;
    20 
     17   
    2118    if(!$this->System->Models['User']->CheckPermission('Chat', 'Display')) return('Nemáte oprávnění');
    2219
    23     if(array_key_exists('date',$_GET)) $Date = $_GET['date']; else $Date = date('Y-m-d');
    24     $DateParts = explode('-',$Date);
     20    if(array_key_exists('date', $_GET)) $Date = $_GET['date'];
     21      else $Date = date('Y-m-d');
     22    $DateParts = explode('-', $Date);
    2523
    2624    $DbResult = $this->Database->select('ChatHistory', 'MAX(Time), MIN(Time)');
    2725    $RowTotal = $DbResult->fetch_array();
    2826
    29     $StartDateTimeParts = explode(' ',$RowTotal['MIN(Time)']);
    30     $StartDateParts = explode('-',$StartDateTimeParts[0]);
    31     $EndDateTimeParts = explode(' ',$RowTotal['MAX(Time)']);
    32     $EndDateParts = explode('-',$EndDateTimeParts[0]);
     27    $StartDateTimeParts = explode(' ', $RowTotal['MIN(Time)']);
     28    $StartDateParts = explode('-', $StartDateTimeParts[0]);
     29    $EndDateTimeParts = explode(' ', $RowTotal['MAX(Time)']);
     30    $EndDateParts = explode('-', $EndDateTimeParts[0]);
    3331
    3432    if(!array_key_exists('year', $_SESSION)) $_SESSION['year'] = date('Y', time());
     
    8280}
    8381
    84 $System->AddModule(new ChatHistory());
    85 $System->Modules['ChatHistory']->GetOutput();
     82class ModuleChat extends Module
     83{
     84  function __construct($Database, $System)
     85  {
     86    parent::__construct($Database, $System);
     87    $this->Name = 'Chat';
     88    $this->Version = '1.0';
     89    $this->Creator = 'Chronos';
     90    $this->License = 'GNU/GPL';
     91    $this->Description = 'Show history of IRC chat and previous SunriseChat';
     92    $this->Dependencies = array();
     93    $this->Models = array();
     94  }
     95 
     96  function Init()
     97  {
     98    $this->System->Pages['chat'] = 'ChatHistory';
     99  } 
     100}
    86101
    87102?>
Note: See TracChangeset for help on using the changeset viewer.