<widget interval="33" direction="upwards" width="400" height="292" thumbScale="70">
<?
   include ("/home2/thegaunt/www/common/connectdb.php");
function band_image($t_id) {
   global $link;
   $sql = "SELECT bandimage FROM photos WHERE pid = '$t_id'" ;
   $sql_result = mysql_query ($sql, $link ) or die ('request "Could not execute SQL query"');
   $row = mysql_fetch_row( $sql_result );
   return $row[0];
 };
	$result = mysql_query( "SELECT * FROM news WHERE status=1 ORDER BY id DESC LIMIT 0, 15 " );
	while ( $row = mysql_fetch_object( $result ) )
	{
	$string = "$row->article_title";
	$string2 = "$row->article_caption";
        $patterns[0] = '/ /';
		$patterns[1] = '/\'/';
		$patterns[2] = '/\//';
        $patterns[3] = '/$/';
        $patterns[4] = '/\@/';
        $patterns[5] = '/\?/';
        $patterns[6] = '/\"/';
		$replacements[0] = '-';
		$replacements[1] = '';
		$replacements[2] = '-';
        $replacements[3] = '';
        $replacements[4] = '';
        $replacements[5] = '';
        $replacements[6] = '';
		$newname = preg_replace($patterns, $replacements, $string);
		$caption = preg_replace($patterns, $replacements, $string2);
?>
	<news image="http://www.thegauntlet.com/pics/<? echo band_image($row->pid); ?>" width="180" height="120" title="<?php echo "$row->article_title"; ?>" link="http://www.thegauntlet.com/article/<?php echo "$row->bid/$row->id/$newname"; ?>.html" target="_blank" >
		<brief>
			<![CDATA[<? echo $string2; ?>]]>
		</brief>
		<full>
			<![CDATA[<? echo $string2; ?>]]>
		</full>
	</news>
<? } ?>
</widget>
