include('menu.php'); ?>
|
print($welcomeMessage); ?>
$query = "SELECT * FROM `BF_News` ORDER BY `Date` DESC";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
$id = $row['NewsID'];
$title = strtoupper(stripslashes($row['Title']));
strlen($row['Text']) > 300 ? $text = strip_tags(substr(stripslashes($row['Text']), 0, 300)) . '....' : $text = strip_tags(stripslashes($row['Text']));
$date = date("l, j F Y", strtotime($row['Date']));
$newsImg = 'img/default.jpg';
//now get the image
$query = "SELECT * FROM `BF_Image` WHERE `Table` = 'BF_News' AND `RowID` = '$id' ORDER BY `IsMainPhoto` DESC";
$result2 = mysql_query($query);
if(mysql_num_rows($result2) > 0)
{
$row2 = mysql_fetch_array($result2);
$newsImg = 'photos/' . $row2['ThumbLink'];
}
?>
| |
|
print($title); ?>
print($date); ?>
print($text); ?>
read more |
}
?>
|
|