Location: PHPKode > projects > Enigma > Enigma2/Enigma2_Install/Blocks/Block_rquote.php
<?php
/*
*****************************************************************

 Block_rquote.php
 
*****************************************************************
LSP: Lunabyte Systems Portal
Open-Source Project Inspired by Zef Hemel (hide@address.com)
*****************************************************************
Software Version:                  LSP 2.0 "Enigma 2"
Software by:                         Lunabyte Systems (http://www.lunabyte.net)
Copyright 2002-2005 by:       Lunabyte Systems (http://www.lunabyte.net)
Support, News, Updates at:    http://www.lunabyte.net
*****************************************************************
This program is free software; you may redistribute it and/or modify it 
under the terms of the provided license as published by Lunabyte Systems.

This program is distributed in the hope that it is and will be useful,                  
but WITHOUT ANY WARRANTIES; without even any implied warranty of           
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                        

See the "LSP_license.txt" file for details of the LSP license.
The latest version can always be found at http://www.lunabyte.net.
*****************************************************************
*/

if (!defined('ENIGMA'))
	die('<b>Access Violation</b><br />Direct Access to this location is not allowed.');

// generate a random quote from the database
function Block_rquote()
{
	global $db_prefix;
	$request = db_query("
		SELECT quote, author, (id/id)*RAND() AS random
		FROM {$db_prefix}rand_quotes
		ORDER BY random
		LIMIT 1", __FILE__, __LINE__);

	$dasquote = mysql_fetch_assoc($request);
	mysql_free_result($request);

	echo '<i>', $dasquote['quote'], '</i><br /><div align="right">- ', $dasquote['author'], '</div>';
}
?>
Return current item: Enigma