news.class.php
<?
while ($get_news=@mysql_fetch_array($news)){
$commentcount = mysql_query("select * from comments where newsid = $get_news[ID]");
$count = mysql_num_rows($commentcount);
$postdate=date("m.d.y",$get_news[date]);
$time=date("H:i",$get_news[date]);
$found=1;
$user = mysql_query("SELECT * FROM trg_users WHERE displayname = '$get_news[author]'");
$get_icon = @mysql_fetch_array($user);
$icon = $get_icon[icon];
$email = $get_icon[email];
$get_news[news] = ereg_replace("\[link=(www.)([^]]+)\]([^]]+)\[/link\]", "<a href='
http://\\1\\2' target='_blank'>\\1\\2</a>", $get_news[news]);
$get_news[news] = ereg_replace("\[mail=([^]]+)\]([^]]+)\[/mail\]", "<a href='mailto:\\1'>\\1</a>", get_news[news]);
?>
<font class="over"><? echo "$get_news[headline]"; ?></FONT><BR>
<font class="af">Skrevet af <B><A HREF="mailto:<? echo "$email"; ?>"><? echo "$get_news[author]"; ?></A></B> kl. <? echo "$time"; ?> den <? echo "$postdate"; ?></font><BR><BR>
<? echo "$get_news[news]"; ?>
<BR><hr width="100%" size="1" noshade color="#F2F2F2">
<?
if($allowcomments==1){
if($count==0){
?>
<A HREF="<? echo "$PHP_SELF"; ?>?page=comments&ID=<? echo "$get_news[ID]"; ?>"><? echo "$count"; ?> Kommentarer</A>
<BR><hr width="100%" size="1" noshade color="#F2F2F2"><BR>
<?
}
if($count==1){
?>
<A HREF="<? echo "$PHP_SELF"; ?>?page=comments&ID=<? echo "$get_news[ID]"; ?>"><? echo "$count"; ?> Kommentarer</A>
<BR><hr width="100%" size="1" noshade color="#F2F2F2"><BR>
<?
}
if($count>1){
?>
<A HREF="<? echo "$PHP_SELF"; ?>?page=comments&ID=<? echo "$get_news[ID]"; ?>"><? echo "$count"; ?> Kommentarer</A>
<BR><hr width="100%" size="1" noshade color="#F2F2F2"><BR>
<?
}
}else{
?><BR><?
}
?>
<?
}
?>