Changeset 32
- Timestamp:
- Jan 30, 2008, 6:55:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/sunrisechat/history.php
r4 r32 8 8 $DateParts = explode('-',$Date); 9 9 10 $DbResult = $Database->select('sunrisechat_history','MAX(time), MIN(time)');10 $DbResult = $Database->select('sunrisechat_history','MAX(time), MIN(time)'); 11 11 $RowTotal = $DbResult->fetch_array(); 12 12 … … 22 22 } 23 23 24 if(!array_key_exists('year', $_SESSION)) $_SESSION['year'] = date('Y', time()); 25 if(array_key_exists('year', $_GET)) $_SESSION['year'] = addslashes($_GET['year']); 26 27 if(!array_key_exists('month', $_SESSION)) $_SESSION['month'] = date('n', time()); 28 if(array_key_exists('month', $_GET)) $_SESSION['month'] = addslashes($_GET['month']); 29 24 30 echo('<div style="font-size: small;">'); 25 31 for($Year = $EndDateParts[0]; $Year >= $StartDateParts[0]; $Year--) 26 32 { 27 echo('<div style="border-style: solid; border-bottom-color: gray; border-width: 0 0 1 0; margin-bottom: 3px; padding-bottom: 2px;">'.$Year.'</div> 28 <div style="margin-left: 15px; margin-right: 15px;">'); 29 if($Year == $StartDateParts[0]) $StartMonth = ($StartDateParts[1]+0); else $StartMonth = 1; 30 if($Year == $EndDateParts[0]) $EndMonth = ($EndDateParts[1]+0); else $EndMonth = 12; 31 for($Month = $EndMonth; $Month >= $StartMonth; $Month--) 33 if($_SESSION['year'] == $Year) 32 34 { 33 // echo('<div><span>'); 34 echo('<div style="border-style: solid; border-bottom-color: gray; border-width: 0 0 1 0; margin-bottom: 3px; padding-bottom: 2px;">'.$MonthNames[$Month].' 35 <span style="position: absolute; left: 100px;">'); 36 if(($Year == $StartDateParts[0]) and ($Month == $StartDateParts[1])) $StartDay = ($StartDateParts[2]+0); else $StartDay = 1; 37 if(($Year == $EndDateParts[0]) and ($Month == $EndDateParts[1])) $EndDay = ($EndDateParts[2]+0); else $EndDay = date('t',mktime(0,0,0,$Month,0,$Year)); 38 for($Day = $StartDay; $Day <= $EndDay; $Day++) 39 { 35 echo('<div style="border-style: solid; border-bottom-color: gray; border-width: 0 0 1 0; margin-bottom: 3px; padding-bottom: 2px;">'.$Year.'</div> 36 <div style="margin-left: 15px; margin-right: 15px;">'); 37 if($Year == $StartDateParts[0]) $StartMonth = ($StartDateParts[1]+0); else $StartMonth = 1; 38 if($Year == $EndDateParts[0]) $EndMonth = ($EndDateParts[1]+0); else $EndMonth = 12; 39 for($Month = $EndMonth; $Month >= $StartMonth; $Month--) 40 { 41 if($_SESSION['month'] == $Month) 42 { 43 // echo('<div><span>'); 44 echo('<div style="border-style: solid; border-bottom-color: gray; border-width: 0 0 1 0; margin-bottom: 3px; padding-bottom: 2px;">'.$MonthNames[$Month].' 45 <span style="position: absolute; left: 100px;">'); 46 if(($Year == $StartDateParts[0]) and ($Month == $StartDateParts[1])) $StartDay = ($StartDateParts[2]+0); else $StartDay = 1; 47 if(($Year == $EndDateParts[0]) and ($Month == $EndDateParts[1])) $EndDay = ($EndDateParts[2]+0); else $EndDay = date('t',mktime(0,0,0,$Month,0,$Year)); 48 for($Day = $StartDay; $Day <= $EndDay; $Day++) 49 { 40 50 // $Date = $Year.'-'.$Month.'-'.$Day; 41 51 //DB_Select('sunrisechat_history','COUNT(*)',"roomtype=0 AND time>'".$Date." 00:00:00' AND time<'".$Date." //23:59:59'"); 42 52 // $CR = DB_Row(); 43 53 // $Text = '<a href="history.php?date='.$Year.'-'.$Month.'-'.$Day.'">'.$Day.'('.$CR['COUNT(*)'].')</a> '; 44 $Text = '<a href="history.php?date='.$Year.'-'.$Month.'-'.$Day.'">'.$Day.'</a> '; 54 $Text = '<a href="history.php?date='.$Year.'-'.$Month.'-'.$Day.'">'.$Day.'</a> '; 55 flush(); 56 if(($DateParts[0] == $Year) and ($DateParts[1] == $Month) and ($DateParts[2] == $Day)) $Text = '<strong style="border-style: solid; border-width: 1; border-color: black; padding-left: 3px;">'.$Text.'</strong>'; 57 echo($Text); 58 } 59 echo('</span></div>'); 60 } else echo('<span style="border-style: solid; border-bottom-color: gray; border-width: 0 0 0 0; margin-bottom: 3px; padding-bottom: 2px;"><a href="?month='.$Month.'">'.$MonthNames[$Month].'</a></span> '); 61 } 62 echo('</div>'); 63 } else echo('<div style="border-style: solid; border-bottom-color: gray; border-width: 0 0 1 0; margin-bottom: 3px; padding-bottom: 2px;"><a href="?year='.$Year.'">'.$Year.'</a></div>'); 64 } 65 echo('</div><div style="border-style: solid; border-bottom-color: gray; border-width: 0 0 1 0; margin-bottom: 3px; padding-bottom: 2px;"></div>'); 66 67 $DbResult = $Database->select('sunrisechat_history','nick,color,text,UNIX_TIMESTAMP(time)',"roomtype=0 AND time>'".$Date." 00:00:00' AND time<'".$Date." 23:59:59' ORDER BY time DESC"); 68 //echo('Vpis posledn�h 100 zpr�:<br>'); 69 echo('<div style="font-size: small;">'); 70 while($Row = $DbResult->fetch_array()) 71 { 72 $Text = $Row['text'];; 73 // StrTr($Row['text'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 74 echo('['.date('d.m.Y H:i:s',$Row['UNIX_TIMESTAMP(time)']).'] <span style="color: #'.dechexr($Row['color']).'"><strong><'.$Row['nick'].'></strong> '.(htmlspecialchars($Text)).'</span><br>'); 45 75 flush(); 46 if(($DateParts[0] == $Year) and ($DateParts[1] == $Month) and ($DateParts[2] == $Day)) $Text = '<strong style="border-style: solid; border-width: 1; border-color: black; padding-left: 3px;">'.$Text.'</strong>';47 echo($Text);48 76 } 49 echo('</span></div>'); 50 } 51 echo('</div>'); 52 } 53 echo('</div>'); 54 55 $DbResult = $Database->select('sunrisechat_history','nick,color,text,UNIX_TIMESTAMP(time)',"roomtype=0 AND time>'".$Date." 00:00:00' AND time<'".$Date." 23:59:59' ORDER BY time DESC"); 56 //echo('Výpis posledních 100 zpráv:<br>'); 57 echo('<div style="font-size: small;">'); 58 while($Row = $DbResult->fetch_array()) 59 { 60 $Text = $Row['text'];; 61 // StrTr($Row['text'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 62 echo('['.date('d.m.Y H:i:s',$Row['UNIX_TIMESTAMP(time)']).'] <span style="color: #'.dechexr($Row['color']).'"><strong><'.$Row['nick'].'></strong> '.(htmlspecialchars($Text)).'</span><br>'); 63 flush(); 64 } 65 echo('</div>'); 77 echo('</div>'); 66 78 67 ShowFooter();79 ShowFooter(); 68 80 ?>
Note:
See TracChangeset
for help on using the changeset viewer.