-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_news.php
15 lines (13 loc) · 723 Bytes
/
index_news.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
$result = mysql_query("SELECT NewsIndex, Datetime, Headline, News FROM news ORDER BY Datetime DESC LIMIT 0,1");
while($row = mysql_fetch_array($result)){
echo "<p class='head3 white pad'>" . $row['Headline'] . "</p>";
echo "<p class='head2 yellow pad'>" . newsdate($row['Datetime']) . "</p>";
echo "<p class='pad lyellow'>" . bbcode(substr($row['News'], 0, strcspn($row['News'], '~')));
$newsindex = $row['NewsIndex'];
$rcomments = mysql_query("SELECT NewsIndex, COUNT(NewsCommentIndex) FROM news_comment WHERE NewsIndex = $newsindex");
$rowc = mysql_fetch_array($rcomments);
echo " <a href='news/$newsindex/' class='yellow'>More & comments (" . $rowc['COUNT(NewsCommentIndex)'] . ")</a>";
echo "</p>";
}
?>