Changeset 346 for trunk


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
Files:
2 deleted
2 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/.htaccess

    r344 r346  
    1111RewriteCond  %{REQUEST_FILENAME}  !-f
    1212RewriteCond  %{REQUEST_FILENAME}  !-d
    13 RewriteRule   ^(.*)$ centrala/index.php?page=$1
     13RewriteRule   ^(.*)$ centrala/index.php?$1
    1414
    1515# Pretty urls
     
    1717RewriteCond  %{REQUEST_FILENAME}  !-f
    1818RewriteCond  %{REQUEST_FILENAME}  !-d
    19 RewriteRule   ^(.*)$ index.php?page=$1
     19RewriteRule   ^(.*)$ index.php?$1
    2020
    2121
  • 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?>
  • trunk/index.php

    r345 r346  
    293293            $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel());
    294294        } else
    295         if($Panel['Module'] == 'Webcam') $Output .= $this->Panel('Kamery', $this->WebcamPanel());
     295        if(($Panel['Module'] == 'Webcam') and (array_key_exists('WebCam', $this->System->Modules)))
     296          $Output .= $this->Panel('Kamery', $this->WebcamPanel());
    296297        else if($Panel['Module'] == 'NewsGroupList') $Output .= $this->Panel('Aktuality', $this->System->Modules['News']->Show(), array('<a href="?Action=CustomizeNews">Upravit</a>'));
    297298      }
     
    316317  } else echo('Stránka nenalezena');
    317318} else
    318 {
     319{ 
    319320  $System->AddModule(new IndexPage());
    320321  $System->Modules['IndexPage']->GetOutput();
Note: See TracChangeset for help on using the changeset viewer.