Location: PHPKode > projects > Fretsweb > fretsweb-1.2/fretsweb/admin/log.php
<?php

/*
Fretsweb - A Frets on Fire chart server
Copyright (C) 2009, Daan Sprenkels

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

function clog( $text )
{
	if( strlen( $text ) > 200 )
		$text = substr( $text, 0, 200 );

	$query = "INSERT INTO contest_logs (text) VALUES ( '" . addslashes($text) . "' )";	
	mysql_query( $query );
}

function printlog()
{
	$query = "SELECT timestamp,text FROM contest_logs";
	$res = mysql_query( $query );
	while( $row = mysql_fetch_assoc( $res ) ){
		echo "<tr><td style=\"width:180;\">" . $row['timestamp'] . "</td><td>" . htmlspecialchars($row['text']) . "</td></tr>";
	}
}

?>
Return current item: Fretsweb