You last visited: Today at 15:39
Advertisement
How can I change it?
Discussion on How can I change it? within the Shaiya Private Server forum part of the Shaiya category.
12/15/2012, 23:30
#1
elite*gold: 0
Join Date: Apr 2012
Posts: 52
Received Thanks: 13
How can I change it?
Code:
[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Game Chats::</title>
<style type="text/css">
</style>
<META NAME="Generator" CONTENT="Battle for Dwater">
<META NAME="Author" CONTENT="Battle for Dwater team">
</HEAD>
<BODY bgcolor=black >
<?php
//SECURE THE CONNECTION
function sql_quote( $value )
{
if( get_magic_quotes_gpc() )
{
$value = stripslashes( $value );
}
//check if this function exists
if( function_exists( "mysql_real_escape_string" ) )
{
$value = mysql_real_escape_string( $value );
}
//for PHP version < 4.3.0 use addslashes
else
{
$value = addslashes( $value );
}
return $value;
}
//CHANGE IT WHIT YOUR IP, USER AND PASSWORD, MAKE SURE TO LEAVE THE " " !!! OR IT WONT WORK
$IP="127.0.0.1";
$USER="Shaiya";
$PASS="Shaiya123";
// Connect to the server
if (!$link = @mssql_connect("$IP","$USER","$PASS"))
{
print "Failed to connect to MSSQL server<br>";
};
// select PS_ChatLog
if (!@mssql_select_db("PS_ChatLog",$link))
{
print "Failed to select database<br>";
};
// select PS_GameData
if (!@mssql_select_db("PS_GameData",$link))
{
print "Failed to select database<br>";
};
date_default_timezone_set('EET');
echo "<center>";
echo "<br /><font size=5 face=arial color=white><b><i>Game Chat<br /></font>";echo"<i><font size=3 face=arial color=aaaaaa>";echo date('l jS \of F Y h:i:s A');echo" EST<br /></font></i>";
Echo " <small><font face=arial color=white>Self Refresh - $timer Secs</font></small><br/><br/></i></b>";
//Echo " <small><font face=arial size=2 color=white>Dont get what they say? <a href='http://www.wordreference.com'>wordreference.com</a> is your answer</font></small><br/><br/>";
echo "
<table border=0 style='table-layout:fixed' cellpadding=3 cellspacing=0><col width=100>
<tr>
<tr>
<td WIDTH=120 BGCOLOR=#222222><b><font size=2 face=arial color=white><b>Date</td>
<td WIDTH=500 BGCOLOR=#111111><font size=2 face=arial color=white><b>Light</td>
<td WIDTH=500 BGCOLOR=#222222><font size=2 face=arial color=white><b>Dark</td>
</tr>
<tr>
</table>";
echo "<br />";
//SELECT THE LINES IN THE CHAT LOG TABLE
$result = mssql_query("SELECT TOP 90000 CharID, ChatType, TargetName, ChatData, ChatTime,row, MapID FROM [PS_ChatLog].[dbo].[ChatLog] ORDER BY row DESC", $link);
//ADDING THE PROPER COLOR AND TAG TO THE CHATS
while($row = mssql_fetch_array($result)){
if($row[1]==1){
$chatcolor="<font size=1 face=arial color=white>";}
else{
if($row[1]==2){
$chatcolor="<font size=1 face=arial color=ff374f>[Whisper]";}
else{
if($row[1]==3){
$chatcolor="<font size=1 face=arial color=pink>[Guild]";}
else{
if($row[1]==4){
$chatcolor="<font size=1 face=arial color=7affa0>[Party]";}
else{
if($row[1]==5){
$chatcolor="<font size=1 face=arial color=fff669>[Trade]";}
else{
if($row[1]==6){
$chatcolor="<font size=1 face=arial color=red>[Yelling]";}
else{
if($row[1]==7){
$chatcolor="<font size=1 face=arial color=7800ff>[Area]";}
}
}
}
}
}
}
$date = "<font size=1 face=arial color=white>$row[4] ";
//ADDING NAMES AND DIVIDE LIGHTS FROM DARKS
$light = mssql_query("SELECT CharID, CharName, Family FROM [PS_GameData].[dbo].[Chars] WHERE CharID = '$row[0]' AND Family <= 1", $link);
$dark = mssql_query("SELECT CharID, CharName, Family FROM [PS_GameData].[dbo].[Chars] WHERE CharID = '$row[0]' AND Family >= 2", $link);
//ADDING THE NAME OF A PMer
if($row[2] <> NULL){
$target="PM to $row[2]: ";}
else{
$target="";}
//PRINTING LIGHTS AND DARKS CHATS
echo"
<table border=0 cellpadding=2 cellspacing=1>
<tr>
<tr>";
echo"<td WIDTH=120 BGCOLOR=#222222>";
echo "$date</td>";
echo"<td WIDTH=500 BGCOLOR=#111111>";
while ($row2 = mssql_fetch_array($light)){
echo "$chatcolor".$row2[1]." (map ".$row[6]."): ".$target."".$row[3]."</td>";
}
echo"<td WIDTH=500 BGCOLOR=#222222>";
while ($row3 = mssql_fetch_array($dark)){
echo "$chatcolor".$row3[1]." (map ".$row[6]."): ".$target."".$row[3]."</td>";
}
echo"
</tr>
<tr>
</table>";
}
echo "</center>";
@mssql_free_result($result);
@mssql_free_result($light);
@mssql_free_result($dark);
mssql_close($link);
?>
</BODY>
</HTML>
[/CODE]
How can I change it to show only trade and normal chat ?
Thanks.
12/16/2012, 07:43
#2
elite*gold: 92
Join Date: Aug 2009
Posts: 739
Received Thanks: 975
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Game Chats::</title>
<style type="text/css">
</style>
<META NAME="Generator" CONTENT="Battle for Dwater">
<META NAME="Author" CONTENT="Battle for Dwater team">
</HEAD>
<BODY bgcolor=black >
<?php
//SECURE THE CONNECTION
function sql_quote( $value )
{
if( get_magic_quotes_gpc() )
{
$value = stripslashes( $value );
}
//check if this function exists
if( function_exists( "mysql_real_escape_string" ) )
{
$value = mysql_real_escape_string( $value );
}
//for PHP version < 4.3.0 use addslashes
else
{
$value = addslashes( $value );
}
return $value;
}
//CHANGE IT WHIT YOUR IP, USER AND PASSWORD, MAKE SURE TO LEAVE THE " " !!! OR IT WONT WORK
$IP="127.0.0.1";
$USER="Shaiya";
$PASS="Shaiya123";
// Connect to the server
if (!$link = @mssql_connect("$IP","$USER","$PASS"))
{
print "Failed to connect to MSSQL server<br>";
};
// select PS_ChatLog
if (!@mssql_select_db("PS_ChatLog",$link))
{
print "Failed to select database<br>";
};
// select PS_GameData
if (!@mssql_select_db("PS_GameData",$link))
{
print "Failed to select database<br>";
};
date_default_timezone_set('EET');
echo "<center>";
echo "<br /><font size=5 face=arial color=white><b><i>Game Chat<br /></font>";echo"<i><font size=3 face=arial color=aaaaaa>";echo date('l jS \of F Y h:i:s A');echo" EST<br /></font></i>";
Echo " <small><font face=arial color=white>Self Refresh - $timer Secs</font></small><br/><br/></i></b>";
//Echo " <small><font face=arial size=2 color=white>Dont get what they say? <a href='http://www.wordreference.com'>wordreference.com</a> is your answer</font></small><br/><br/>";
echo "
<table border=0 style='table-layout:fixed' cellpadding=3 cellspacing=0><col width=100>
<tr>
<tr>
<td WIDTH=120 BGCOLOR=#222222><b><font size=2 face=arial color=white><b>Date</td>
<td WIDTH=500 BGCOLOR=#111111><font size=2 face=arial color=white><b>Light</td>
<td WIDTH=500 BGCOLOR=#222222><font size=2 face=arial color=white><b>Dark</td>
</tr>
<tr>
</table>";
echo "<br />";
//SELECT THE LINES IN THE CHAT LOG TABLE
$result = mssql_query("SELECT TOP 90000 CharID, ChatType, ChatData, ChatTime,row FROM [PS_ChatLog].[dbo].[ChatLog] ORDER BY row DESC", $link);
//ADDING THE PROPER COLOR AND TAG TO THE CHATS
while($row = mssql_fetch_array($result)){
if($row[1]==1){
$chatcolor="<font size=1 face=arial color=white>";}
else{
if($row[1]==5){
$chatcolor="<font size=1 face=arial color=fff669>[Trade]";}
else{
if($row[1]==6){
$chatcolor="<font size=1 face=arial color=red>[Yelling]";}
}
}
}
}
}
}
$date = "<font size=1 face=arial color=white>$row[4] ";
//ADDING NAMES AND DIVIDE LIGHTS FROM DARKS
$light = mssql_query("SELECT CharID, CharName, Family FROM [PS_GameData].[dbo].[Chars] WHERE CharID = '$row[0]' AND Family <= 1", $link);
$dark = mssql_query("SELECT CharID, CharName, Family FROM [PS_GameData].[dbo].[Chars] WHERE CharID = '$row[0]' AND Family >= 2", $link);
//ADDING THE NAME OF A PMer
if($row[2] <> NULL){
$target="PM to $row[2]: ";}
else{
$target="";}
//PRINTING LIGHTS AND DARKS CHATS
echo"
<table border=0 cellpadding=2 cellspacing=1>
<tr>
<tr>";
echo"<td WIDTH=120 BGCOLOR=#222222>";
echo "$date</td>";
echo"<td WIDTH=500 BGCOLOR=#111111>";
while ($row2 = mssql_fetch_array($light)){
echo "$chatcolor".$row2[1]." (map ".$row[6]."): ".$target."".$row[3]."</td>";
}
echo"<td WIDTH=500 BGCOLOR=#222222>";
while ($row3 = mssql_fetch_array($dark)){
echo "$chatcolor".$row3[1]." (map ".$row[6]."): ".$target."".$row[3]."</td>";
}
echo"
</tr>
<tr>
</table>";
}
echo "</center>";
@mssql_free_result($result);
@mssql_free_result($light);
@mssql_free_result($dark);
mssql_close($link);
?>
</BODY>
</HTML>
Should work. If not, come back.
12/16/2012, 20:51
#3
elite*gold: 0
Join Date: Apr 2012
Posts: 52
Received Thanks: 13
Code:
//ADDING THE PROPER COLOR AND TAG TO THE CHATS
while($row = mssql_fetch_array($result)){
if($row[1]==1){
$chatcolor="<font size=1 face=arial color=white>";}
else{
if($row[1]==5){
$chatcolor="<font size=1 face=arial color=fff669>[Trade]";}
else{
if($row[1]==6){
$chatcolor="<font size=1 face=arial color=red>[Yelling]";}
}
}
}
}
}
}
Here I deleted 4 "}"
Code:
//ADDING THE PROPER COLOR AND TAG TO THE CHATS
while($row = mssql_fetch_array($result)){
if($row[1]==1){
$chatcolor="<font size=1 face=arial color=white>";}
else{
if($row[1]==5){
$chatcolor="<font size=1 face=arial color=fff669>[Trade]";}
else{
if($row[1]==6){
$chatcolor="<font size=1 face=arial color=red>[Yelling]";}
}
}
I made it like thisand it worked but still showing pms and other chats with errors.
Errors:
For dark PMs
Code:
Notice: Undefined offset: 6 in C:\wamp\www\index.php on line 130
For Light PMs
Code:
Notice: Undefined offset: 6 in C:\wamp\www\index.php on line 125
12/16/2012, 23:34
#4
elite*gold: 576
Join Date: Mar 2011
Posts: 348
Received Thanks: 997
Try the following code - I also fixed the auto refresh.
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <title>Game Chats::</title> <style type="text/css"> </style> <META NAME="Generator" CONTENT="Battle for Dwater"> <META NAME="Author" CONTENT="Battle for Dwater team"> </HEAD> <BODY bgcolor=black ><?php //SET REFRESH RATE IN SECONDS $timer = 10 ; //SECURE THE CONNECTION function sql_quote ( $value ) { if( get_magic_quotes_gpc () ) { $value = stripslashes ( $value ); } //check if this function exists if( function_exists ( "mysql_real_escape_string" ) ) { $value = mysql_real_escape_string ( $value ); } //for PHP version < 4.3.0 use addslashes else { $value = addslashes ( $value ); } return $value ; } //CHANGE IT WHIT YOUR IP, USER AND PASSWORD, MAKE SURE TO LEAVE THE " " !!! OR IT WONT WORK $IP = "127.0.0.1" ; $USER = "Shaiya" ; $PASS = "Shaiya123" ; // Connect to the server if (! $link = @ mssql_connect ( " $IP " , " $USER " , " $PASS " )) { print "Failed to connect to MSSQL server<br>" ; }; // select PS_ChatLog if (!@ mssql_select_db ( "PS_ChatLog" , $link )) { print "Failed to select database<br>" ; }; // select PS_GameData if (!@ mssql_select_db ( "PS_GameData" , $link )) { print "Failed to select database<br>" ; }; date_default_timezone_set ( 'EET' ); echo "<center>" ; echo "<br /><font size=5 face=arial color=white><b><i>Game Chat<br /></font>" ;echo "<i><font size=3 face=arial color=aaaaaa>" ;echo date ( 'l jS \of F Y h:i:s A' );echo " EST<br /></font></i>" ; Echo " <small><font face=arial color=white>Self Refresh - $timer Secs</font></small><br/><br/></i></b>" ; //Echo " <small><font face=arial size=2 color=white>Dont get what they say? <a href='http://www.wordreference.com'>wordreference.com</a> is your answer</font></small><br/><br/>"; echo " <table border=0 style='table-layout:fixed' cellpadding=3 cellspacing=0><col width=100> <tr> <tr> <td WIDTH=120 BGCOLOR=#222222><b><font size=2 face=arial color=white><b>Date</td> <td WIDTH=500 BGCOLOR=#111111><font size=2 face=arial color=white><b>Light</td> <td WIDTH=500 BGCOLOR=#222222><font size=2 face=arial color=white><b>Dark</td> </tr> <tr> </table>" ; echo "<br />" ; //SELECT THE LINES IN THE CHAT LOG TABLE $result = mssql_query ( "SELECT TOP 90000 CharID, ChatType, ChatData, ChatTime,row FROM [PS_ChatLog].[dbo].[ChatLog] ORDER BY row DESC" , $link ); //ADDING THE PROPER COLOR AND TAG TO THE CHATS while( $row = mssql_fetch_array ( $result )){ if( $row [ 1 ]== 1 ){ $chatcolor = "<font size=1 face=arial color=white>" ;} else{ if( $row [ 1 ]== 5 ){ $chatcolor = "<font size=1 face=arial color=fff669>[Trade]" ;} else{ if( $row [ 1 ]== 6 ){ $chatcolor = "<font size=1 face=arial color=red>[Yelling]" ;} } } } $date = "<font size=1 face=arial color=white> $row [ 4 ] " ; //ADDING NAMES AND DIVIDE LIGHTS FROM DARKS $light = mssql_query ( "SELECT CharID, CharName, Family FROM [PS_GameData].[dbo].[Chars] WHERE CharID = ' $row [ 0 ] ' AND Family <= 1" , $link ); $dark = mssql_query ( "SELECT CharID, CharName, Family FROM [PS_GameData].[dbo].[Chars] WHERE CharID = ' $row [ 0 ] ' AND Family >= 2" , $link ); //ADDING THE NAME OF A PMer if( $row [ 2 ] <> NULL ){ $target = "PM to $row [ 2 ] : " ;} else{ $target = "" ;} //PRINTING LIGHTS AND DARKS CHATS echo " <table border=0 cellpadding=2 cellspacing=1> <tr> <tr>" ; echo "<td WIDTH=120 BGCOLOR=#222222>" ; echo " $date </td>" ; echo "<td WIDTH=500 BGCOLOR=#111111>" ; while ( $row2 = mssql_fetch_array ( $light )){ echo " $chatcolor " . $row2 [ 1 ]. " (map " . $row [ 6 ]. "): " . $target . "" . $row [ 3 ]. "</td>" ; } echo "<td WIDTH=500 BGCOLOR=#222222>" ; while ( $row3 = mssql_fetch_array ( $dark )){ echo " $chatcolor " . $row3 [ 1 ]. " (map " . $row [ 6 ]. "): " . $target . "" . $row [ 3 ]. "</td>" ; } echo " </tr> <tr> </table>" ; echo "</center>" ; @ mssql_free_result ( $result ); @ mssql_free_result ( $light ); @ mssql_free_result ( $dark ); mssql_close ( $link ); echo '<head><META HTTP-EQUIV="Refresh" CONTENT="' . $timer . '"></head>' ; ?> </BODY> </HTML>
12/17/2012, 01:44
#5
elite*gold: 0
Join Date: Apr 2012
Posts: 52
Received Thanks: 13
It is not working.There is no error given.As if the half of the page is missing.
Attached Images
gzd2t.jpg
(24.5 KB, 22 views)
12/17/2012, 18:16
#6
elite*gold: 576
Join Date: Mar 2011
Posts: 348
Received Thanks: 997
I'm sorry about it. The following code should work for you.
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <title>Game Chats::</title> <style type="text/css"></style> <META NAME="Generator" CONTENT="Battle for Dwater"> <META NAME="Author" CONTENT="Battle for Dwater team"> </HEAD> <BODY bgcolor=black > <?php //SET REFRESH RATE IN SECONDS $timer = 10 ; //SECURE THE CONNECTION function sql_quote ( $value ) { if( get_magic_quotes_gpc () ) { $value = stripslashes ( $value ); } //check if this function exists if( function_exists ( "mysql_real_escape_string" ) ) { $value = mysql_real_escape_string ( $value ); } //for PHP version < 4.3.0 use addslashes else { $value = addslashes ( $value ); } return $value ; } //CHANGE IT WHIT YOUR IP, USER AND PASSWORD, MAKE SURE TO LEAVE THE " " !!! OR IT WONT WORK $IP = "127.0.0.1" ; $USER = "Shaiya" ; $PASS = "Shaiya123" ; // Connect to the server if (! $link = @ mssql_connect ( " $IP " , " $USER " , " $PASS " )) { print "Failed to connect to MSSQL server<br>" ; }; // select PS_ChatLog if (!@ mssql_select_db ( "PS_ChatLog" , $link )) { print "Failed to select database<br>" ; }; // select PS_GameData if (!@ mssql_select_db ( "PS_GameData" , $link )) { print "Failed to select database<br>" ; }; date_default_timezone_set ( 'EET' ); echo "<center>" ; echo "<br /><font size=5 face=arial color=white><b><i>Game Chat<br /></font>" ;echo "<i><font size=3 face=arial color=aaaaaa>" ;echo date ( 'l jS \of F Y h:i:s A' );echo " EST<br /></font></i>" ; Echo " <small><font face=arial color=white>Self Refresh - $timer Secs</font></small><br/><br/></i></b>" ; //Echo " <small><font face=arial size=2 color=white>Dont get what they say? <a href='http://www.wordreference.com'>wordreference.com</a> is your answer</font></small><br/><br/>"; echo " <table border=0 style='table-layout:fixed' cellpadding=3 cellspacing=0><col width=100> <tr> <tr> <td WIDTH=120 BGCOLOR=#222222><b><font size=2 face=arial color=white><b>Date</td> <td WIDTH=500 BGCOLOR=#111111><font size=2 face=arial color=white><b>Light</td> <td WIDTH=500 BGCOLOR=#222222><font size=2 face=arial color=white><b>Dark</td> </tr> <tr> </table>" ; echo "<br />" ; //SELECT THE LINES IN THE CHAT LOG TABLE $result = mssql_query ( "SELECT TOP 90000 CharID, ChatType, ChatData, ChatTime,row FROM [PS_ChatLog].[dbo].[ChatLog] ORDER BY row DESC" , $link ); //ADDING THE PROPER COLOR AND TAG TO THE CHATS while( $row = mssql_fetch_array ( $result )){ if( $row [ 1 ]== 1 ){ $chatcolor = "<font size=1 face=arial color=white>" ;} else{ if( $row [ 1 ]== 5 ){ $chatcolor = "<font size=1 face=arial color=fff669>[Trade]" ;} else{ if( $row [ 1 ]== 6 ){ $chatcolor = "<font size=1 face=arial color=red>[Yelling]" ;} } } $date = "<font size=1 face=arial color=white> $row [ 4 ] " ; //ADDING NAMES AND DIVIDE LIGHTS FROM DARKS $light = mssql_query ( "SELECT CharID, CharName, Family FROM [PS_GameData].[dbo].[Chars] WHERE CharID = ' $row [ 0 ] ' AND Family <= 1" , $link ); $dark = mssql_query ( "SELECT CharID, CharName, Family FROM [PS_GameData].[dbo].[Chars] WHERE CharID = ' $row [ 0 ] ' AND Family >= 2" , $link ); //ADDING THE NAME OF A PMer if( $row [ 2 ] <> NULL ){ $target = "PM to $row [ 2 ] : " ;} else{ $target = "" ;} //PRINTING LIGHTS AND DARKS CHATS echo " <table border=0 cellpadding=2 cellspacing=1> <tr> <tr>" ; echo "<td WIDTH=120 BGCOLOR=#222222>" ; echo " $date </td>" ; echo "<td WIDTH=500 BGCOLOR=#111111>" ; while ( $row2 = mssql_fetch_array ( $light )){ echo " $chatcolor " . $row2 [ 1 ]. " (map " . $row [ 6 ]. "): " . $target . "" . $row [ 3 ]. "</td>" ; } echo "<td WIDTH=500 BGCOLOR=#222222>" ; while ( $row3 = mssql_fetch_array ( $dark )){ echo " $chatcolor " . $row3 [ 1 ]. " (map " . $row [ 6 ]. "): " . $target . "" . $row [ 3 ]. "</td>" ; } echo " </tr> <tr> </table>" ; } echo "</center>" ; @ mssql_free_result ( $result ); @ mssql_free_result ( $light ); @ mssql_free_result ( $dark ); mssql_close ( $link ); echo '<head><META HTTP-EQUIV="Refresh" CONTENT="' . $timer . '"></head>' ; ?> </BODY> </HTML>
12/17/2012, 20:14
#7
elite*gold: 0
Join Date: Apr 2012
Posts: 52
Received Thanks: 13
For dark pms
Code:
Notice: Undefined offset: 6 in C:\wamp\www\index.php on line 129
For light pms
Code:
Notice: Undefined offset: 6 in C:\wamp\www\index.php on line 124
12/18/2012, 00:33
#8
elite*gold: 576
Join Date: Mar 2011
Posts: 348
Received Thanks: 997
Okay, I'm pretty sure this one will work for you.
It will show the top 1000 rows instead of the top 90000 rows by the way..
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <title>Game Chats</title> <style type="text/css"> </style> <META NAME="Generator" CONTENT="Battle for Dwater"> <META NAME="Author" CONTENT="Battle for Dwater team"> </HEAD> <BODY bgcolor=black ><?php //SET REFRESH RATE IN SECONDS $timer = 10 ; //SECURE THE CONNECTION function sql_quote ( $value ) { if( get_magic_quotes_gpc () ) { $value = stripslashes ( $value ); } //check if this function exists if( function_exists ( "mysql_real_escape_string" ) ) { $value = mysql_real_escape_string ( $value ); } //for PHP version < 4.3.0 use addslashes else { $value = addslashes ( $value ); } return $value ; } //CHANGE IT WHIT YOUR IP, USER AND PASSWORD, MAKE SURE TO LEAVE THE " " !!! OR IT WONT WORK $IP = "127.0.0.1" ; $USER = "Shaiya" ; $PASS = "Shaiya123" ; // Connect to the server if (! $link = @ mssql_connect ( " $IP " , " $USER " , " $PASS " )) { print "Failed to connect to MSSQL server<br>" ; }; // select PS_ChatLog if (!@ mssql_select_db ( "PS_ChatLog" , $link )) { print "Failed to select database<br>" ; }; // select PS_GameData if (!@ mssql_select_db ( "PS_GameData" , $link )) { print "Failed to select database<br>" ; }; date_default_timezone_set ( 'EET' ); echo "<center>" ; echo "<br /><font size=5 face=arial color=white><b><i>Game Chat<br /></font>" ;echo "<i><font size=3 face=arial color=aaaaaa>" ;echo date ( 'l jS \of F Y h:i:s A' );echo " EST<br /></font></i>" ; Echo " <small><font face=arial color=white>Self Refresh - $timer Secs</font></small><br/><br/></i></b>" ; //Echo " <small><font face=arial size=2 color=white>Dont get what they say? <a href='http://www.wordreference.com'>wordreference.com</a> is your answer</font></small><br/><br/>"; echo " <table border=0 style='table-layout:fixed' cellpadding=3 cellspacing=0><col width=100> <tr> <tr> <td WIDTH=120 BGCOLOR=#222222><b><font size=2 face=arial color=white><b>Date</td> <td WIDTH=500 BGCOLOR=#111111><font size=2 face=arial color=white><b>Light</td> <td WIDTH=500 BGCOLOR=#222222><font size=2 face=arial color=white><b>Dark</td> </tr> <tr> </table>" ; echo "<br />" ; //SELECT THE LINES IN THE CHAT LOG TABLE $result = mssql_query ( "SELECT TOP 1000 CharID, ChatType, TargetName, ChatData, ChatTime,row, MapID FROM [PS_ChatLog].[dbo].[ChatLog] ORDER BY row DESC" , $link ); //ADDING THE PROPER COLOR AND TAG TO THE CHATS while( $row = mssql_fetch_array ( $result )){ if( $row [ 1 ]== 1 ){ $chatcolor = "<font size=1 face=arial color=white>" ;} else{ if( $row [ 1 ]== 5 ){ $chatcolor = "<font size=1 face=arial color=fff669>[Trade]" ;} else{ if( $row [ 1 ]== 6 ){ $chatcolor = "<font size=1 face=arial color=red>[Yelling]" ;} } } $date = "<font size=1 face=arial color=white> $row [ 4 ] " ; //ADDING NAMES AND DIVIDE LIGHTS FROM DARKS $light = mssql_query ( "SELECT CharID, CharName, Family FROM [PS_GameData].[dbo].[Chars] WHERE CharID = ' $row [ 0 ] ' AND Family <= 1" , $link ); $dark = mssql_query ( "SELECT CharID, CharName, Family FROM [PS_GameData].[dbo].[Chars] WHERE CharID = ' $row [ 0 ] ' AND Family >= 2" , $link ); //PRINTING LIGHTS AND DARKS CHATS echo " <table border=0 cellpadding=2 cellspacing=1> <tr> <tr>" ; echo "<td WIDTH=120 BGCOLOR=#222222>" ; echo " $date </td>" ; echo "<td WIDTH=500 BGCOLOR=#111111>" ; while ( $row2 = mssql_fetch_array ( $light )){ echo " $chatcolor " . $row2 [ 1 ]. " (map " . $row [ 6 ]. "): " . $target . "" . $row [ 3 ]. "</td>" ; } echo "<td WIDTH=500 BGCOLOR=#222222>" ; while ( $row3 = mssql_fetch_array ( $dark )){ echo " $chatcolor " . $row3 [ 1 ]. " (map " . $row [ 6 ]. "): " . $target . "" . $row [ 3 ]. "</td>" ; } echo " </tr> <tr> </table>" ; } echo "</center>" ; @ mssql_free_result ( $result ); @ mssql_free_result ( $light ); @ mssql_free_result ( $dark ); mssql_close ( $link ); echo '<head><META HTTP-EQUIV="Refresh" CONTENT="' . $timer . '"></head>' ; ?> </BODY> </HTML>
12/18/2012, 00:53
#9
elite*gold: 0
Join Date: Apr 2012
Posts: 52
Received Thanks: 13
Error for dark party chat
Code:
Notice: Undefined variable: chatcolor in C:\wamp\www\index.php on line 126
Notice: Undefined variable: target in C:\wamp\www\index.php on line 126
Errors for light party chat
Code:
Notice: Undefined variable: target in C:\wamp\www\index.php on line 121
All times are GMT +1. The time now is 15:41 .