Changeset 4 for www/sunrisechat/webchatframe.php
- Timestamp:
- Jan 14, 2008, 9:48:39 PM (17 years ago)
- Location:
- www
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
www
-
Property svn:ignore
set to
config.php
php_script_error.log
-
Property svn:ignore
set to
-
www/sunrisechat/webchatframe.php
r1 r4 1 <? 2 header('Refresh: 5');3 session_start();1 <?php 2 include('../global.php'); 3 header('Refresh: 5'); 4 4 5 5 echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 6 6 <html><head><title>Chat frame</title> 7 8 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">9 7 <meta http-equiv="Content-Language" content="cs"> 8 <meta http-equiv="Content-Type" content="text/html; charset='.$Config['Web']['Charset'].'"> 9 </head><body>'); 10 10 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'); 11 if(array_key_exists('nick',$_GET)) 12 { 13 $_SESSION['nick'] = $_GET['nick']; 14 include_once('webchatsend.php'); 15 Send('Alive',''); 16 } 21 17 22 23 18 $List = array(); 19 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;">'); 24 20 25 DB_Select('sunrisechat_history','*,UNIX_TIMESTAMP(time)',' roomtype=0 ORDER BY time DESC LIMIT 0,24');26 while($List[] = DB_Row());27 28 29 30 31 32 33 34 35 36 37 21 $DbResult = $Database->select('sunrisechat_history','*,UNIX_TIMESTAMP(time)',' roomtype=0 ORDER BY time DESC LIMIT 0,24'); 22 while($List[] = $DbResult->fetch_array()); 23 array_pop($List); 24 $List = array_reverse($List); 25 foreach($List as $Row) 26 { 27 $Text = htmlspecialchars($Row['text']); 28 if(substr($Text,0,strlen($_SESSION['nick'])) == $_SESSION['nick']) $Text = '<strong><'.$Row['nick'].'> '.$Text.'</strong>'; 29 else $Text = '<'.$Row['nick'].'> '.$Text; 30 echo('['.date('H:i:s',$Row['UNIX_TIMESTAMP(time)']).'] <span style="color: #'.dechex($Row['color']).'">'.$Text.'</span><br>'); 31 } 32 echo('</td></tr></table> 33 </body></html>'); 38 34 ?>
Note:
See TracChangeset
for help on using the changeset viewer.