Ignore:
Timestamp:
Jan 14, 2008, 9:48:39 PM (16 years ago)
Author:
george
Message:

Upraveno: Změna přístupu k databázi na třídu rozšířenou mysqli.
Upraveno: Sjednocení
Upraveno: Změna kódování všech stránek na UTF-8.
Odstraňeno: Staré nepotřebné soubory.

Location:
www
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • www

    • Property svn:ignore set to
      config.php
      php_script_error.log
  • www/sunrisechat/webchatframe.php

    r1 r4  
    1 <?
    2   header('Refresh: 5');
    3   session_start();
     1<?php
     2include('../global.php');
     3header('Refresh: 5');
    44 
    5   echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     5echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    66<html><head><title>Chat frame</title>
    7   <meta http-equiv="Content-Language" content="cs">
    8   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
    9   </head><body>');
     7<meta http-equiv="Content-Language" content="cs">
     8<meta http-equiv="Content-Type" content="text/html; charset='.$Config['Web']['Charset'].'">
     9</head><body>');
    1010 
    11   if(array_key_exists('nick',$_GET))
    12   {
    13     $_SESSION['nick'] = $_GET['nick']; 
    14     include_once('webchatsend.php');
    15     Send('Alive',''); 
    16   }
    17  
    18   include_once('/a/html/is/db.php');
    19   DB_Init('localhost','root','','is');
    20   DB_Query('SET CHARACTER SET latin2');
     11if(array_key_exists('nick',$_GET))
     12{
     13  $_SESSION['nick'] = $_GET['nick']; 
     14  include_once('webchatsend.php');
     15  Send('Alive',''); 
     16}
    2117 
    22   $List = array();
    23   echo('<table style="height: 100; font-family: Arial;" width="100%" cellspacing="0" cellpadding="2" border="1" bgcolor="#d0d0d0"><tr><td bgcolor="#ffffff" width="90%" valign="top" style="font-size: 14px;">');
     18$List = array();
     19echo('<table style="height: 100; font-family: Arial;" width="100%" cellspacing="0" cellpadding="2" border="1" bgcolor="#d0d0d0"><tr><td bgcolor="#ffffff" width="90%" valign="top" style="font-size: 14px;">');
    2420
    25   DB_Select('sunrisechat_history','*,UNIX_TIMESTAMP(time)',' roomtype=0 ORDER BY time DESC LIMIT 0,24');
    26   while($List[] = DB_Row());
    27   array_pop($List);
    28   $List = array_reverse($List);
    29   foreach($List as $Row)
    30   {
    31     $Text = htmlspecialchars($Row['text']);
    32     if(substr($Text,0,strlen($_SESSION['nick'])) == $_SESSION['nick']) $Text = '<strong>&lt;'.$Row['nick'].'&gt; '.$Text.'</strong>';
    33     else $Text = '&lt;'.$Row['nick'].'&gt; '.$Text;
    34     echo('['.date('H:i:s',$Row['UNIX_TIMESTAMP(time)']).'] <span style="color: #'.dechex($Row['color']).'">'.$Text.'</span><br>');
    35   }
    36   echo('</td></tr></table>
    37   </body></html>');
     21$DbResult = $Database->select('sunrisechat_history','*,UNIX_TIMESTAMP(time)',' roomtype=0 ORDER BY time DESC LIMIT 0,24');
     22while($List[] = $DbResult->fetch_array());
     23array_pop($List);
     24$List = array_reverse($List);
     25foreach($List as $Row)
     26{
     27  $Text = htmlspecialchars($Row['text']);
     28  if(substr($Text,0,strlen($_SESSION['nick'])) == $_SESSION['nick']) $Text = '<strong>&lt;'.$Row['nick'].'&gt; '.$Text.'</strong>';
     29  else $Text = '&lt;'.$Row['nick'].'&gt; '.$Text;
     30  echo('['.date('H:i:s',$Row['UNIX_TIMESTAMP(time)']).'] <span style="color: #'.dechex($Row['color']).'">'.$Text.'</span><br>');
     31}
     32echo('</td></tr></table>
     33</body></html>');
    3834?>
Note: See TracChangeset for help on using the changeset viewer.