index.php:
<html>
<script language="JavaScript" src="http://play.frag-executors.com/chat/calendar3.js"></script>
<body>
<?php
require "config.php";
$conn=mysql_connect($dbhost,$dbuser,$dbpassword) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$vps=200;
if (isset($_GET['page'])){$page = $_GET['page'];}
$page = intval($page);
$x="";
$date=date("Y-m-d");
if (isset($HTTP_POST_VARS['date']))
{
$x = "where date='".$HTTP_POST_VARS['date']."'";
$date=$HTTP_POST_VARS['date'];
}
else if(isset($_GET['date']))
{
$x = "where date='".$_GET['date']."'";
$date=$_GET['date'];
}
$tmp_query2="SELECT COUNT(*) FROM amx_chat_log ".$x.";";
$count=mysql_result(mysql_query($tmp_query2), 0);
if(($page+1)*$vps>=$count)$site_end=$count;
else $site_end=($page+1)*$vps;
echo "<title>Chat Logger SQL Example</title>";
echo "<h2 align=center>Chat log page: ".($page+1)."</h2>";
echo "<p>Messages: ".$page*$vps."-".$site_end." / ".$count."</p>";
echo "<form method='POST' name='sdate' action='index.php'>";
echo "Date: <input type='text' name='date' size='20' value='".date("Y-m-d")."'>";
echo "<a href='javascript:cal.popup();'>";
echo "<img src='img/cal.gif' width='16' height='16' border='0' alt='Click Here to Pick up the date'></a><input type='submit' value='Search' name='B1'></form>";
echo "<hr><body bgcolor='#FFFFFF'><font face='Verdana' size=2>";
$tmp_query="select *from amx_chat_log ".$x." order by id DESC LIMIT ".($page * $vps).", {$vps};";
if ($count > $vps)
{
echo "<p>";
for ($i = 0; $i < $count / $vps; $i++)
{
if ($i <> 0)
{
echo " | ";
}
if ($page == $i)
{
echo "<b>".($i + 1)."</b>";
}
else
{
echo "<a href=\"{$_SERVER['PHP_SELF']}?page={$i}";
if(isset($HTTP_POST_VARS['date']))
echo "&&date=".$HTTP_POST_VARS['date'];
else if(isset($_GET['date']))
echo "&&date=".$_GET['date'];
echo "\">".($i + 1)."</a>";
}
}
echo "</p>";
}
$query = mysql_query($tmp_query) or die(mysql_error());
if(mysql_num_rows($query) < 1)
{
echo "no results";
}
while ($data = mysql_fetch_array($query))
{
if($data['team']=="(Counter-Terrorist)")$name_color="blue";
else if($data['team']=="(Terrorist)")$name_color="red";
else $name_color="gray";
echo $data['date']." ".$data['time']." <".$data['authid']."> <";
echo $data['ip']."> <font color=".$name_color.">";
if(!$data['alive'])echo "*DEAD*";
if($data['team']=="*DEAD*")echo "*SPEC*";
else
{
if($data['cmd']=="say_team")echo $data['team'];
}
echo $data['name']."</font> : <font color=green>".$data['message']."</font><br>";
}
?><style type="text/css">
<!--
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
-->
</style>
<hr />
<p align="center"><a href="http://forums.alliedmods.net/showthread.php?p=611123#post611123">AMXX Chat Log SQL</a> PHP Example<br />
Copyright: <a href="mailto:[email protected]">Aake</a>.<br />
<a href="http://naputtaja.no-ip.org">Naputtaja</a></p>
<script language="JavaScript">
var cal = new calendar3(document.forms['sdate'].elements['date']);
cal.year_scroll = true;
cal.time_comp = false;
</script>
</body>
</html>Obecnie na stronie www wyświetla mi sie tylko taka część SID: STEAM_0:1:33852


Dodatki SourceMod



Temat jest zamknięty








