<div class="nNewsOut padd5">
<?php
	$hnews1 = "SELECT * FROM pages WHERE page_on = '3' AND page_show='1' ORDER BY page_id LIMIT 1";	
	if(!$resulthnews1 = dbQuery($hnews1)) {
		die('DB Error');
	} 
	while ( $rowHnws = mysql_fetch_array($resulthnews1) ) {
		echo'<h1 class="clr1 tleft padd1 fwe3 txt17">
		'.$rowHnws['page_title'].'</h1><div class="clear"></div><ul class="ulcss">';
		$homenews1 = "SELECT * FROM contents WHERE content_on = '1' AND page_id='".$rowHnws['page_id']."' AND content_upid = '0' AND content_show = '1' ORDER BY content_date DESC LIMIT 2";	
		if(!$resultltns1 = dbQuery($homenews1)) {
		die('DB Error');
		}
		while ( $rowbnws = mysql_fetch_array($resultltns1) ) {
			$sqlm = "SELECT * FROM files WHERE content_id = " . $rowbnws['content_id'] . " AND file_type='main_picture' ORDER BY id DESC LIMIT 1";	
			if(!$resultm = dbQuery($sqlm)) {
				die('DB Error');
			}
			$path = '';
			$rowm = mysql_fetch_array($resultm);
			if($rowm && $rowm['path'] != '' && file_exists($upload_folder . $rowm['path']))
			$path = '<img alt="' . $rowm['title'] . '" src="' . $upload_folder . $rowm['path'] . '" 
			style="">';
			echo'<li class="wd2">
				<div class="hnswimh">'.$path.'</div>
				<a href="index.php?pid='.$rowbnws['page_id'].'&nid='.$rowbnws['content_id'].'" class="clr5 txt14 padd2 fwe4">'.$rowbnws['content_title'].'</a>
				<div class="padd8">				
				<h1 class="clr4 fleft opc txt14 fwe4">'.$rowbnws['content_edate'].'</h1>
				</div>
				<div class="clear"></div>
			</li>';
		}
		echo'<ul>';
	}
	?>		

</div>