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

function cfeed($title, $text, $code)
/*
bool cfeed(...)
	string $title
		Title of the new feed message
	string $text
		Contents of the new feed message
	string code
		Code of the new feed message,
		each code has another
cfeed() returns
	true by success
	false by failure
*/
{
	switch ($code)
	{
		case 'usermessage':
			$priority = 9;
		break;
		case 'special':
			$priority = 7;
		break;
		case 'configchange':
			$priority = 6;
		break;
		case 'songchange':
			$priority = 5;
		break;
		case 'chartupdate':
			$priority = 4;
		break;
		case 'playerchange':
			$priority = 3;
		break;
		case 'forumchange':
			$priority = 2;
		break;
		case 'scorechange':
			$priority = 1;
		break;
		default:
			die(trigger_error("Code $code is not defined!"));
		break;
	}
	$sql = "INSERT INTO `contest_news` (`title`, `text`, `code`, `priority`) VALUES  ('" . addslashes($title) . "', '" . addslashes($text) . "', '$code', '$priority')";
	mysql_query($sql);
}

?>
Return current item: Fretsweb