All pastes #963212 Raw Edit

Unbenannt

public text v1 · immutable
#963212 ·published 2008-03-30 10:13 UTC
rendered paste body
<?php
#   Copyright by Manuel Staechele
#   Support www.ilch.de
#   Modded by Mairu für News Extended

defined ('main') or die ( 'no direct access' );

$tn_id = intval(@db_result($news_opts = db_query("SELECT v1, v2 FROM prefix_allg WHERE k = 'news' LIMIT 1"),0,0));
$abf = 'SELECT
		DATE_FORMAT(news_time,"%d.%m.%y") as datum,
		news_kat,
		news_title,
		news_id
        FROM prefix_news
				WHERE news_recht >= '.$_SESSION['authright'].' AND `show` > 0 AND `show` <= UNIX_TIMESTAMP() AND news_id != '.$tn_id.' AND archiv != 1 AND (endtime IS NULL OR endtime > UNIX_TIMESTAMP())
                ORDER BY news_time DESC
				LIMIT 0,5';
$erg = db_query($abf);
while ($row = db_fetch_object($erg)) {
		if ($row->news_kat == 'css') {
		$kat = 'CS:Source';
		} elseif ($row->news_kat == 'wc3') {
		$kat = 'Warcraft 3';
		} elseif ($row->news_kat == 'cs') {
		$kat = 'Counterstrike';
		} else {
		$kat = $row->news_kat;
		}
		$k0m  = db_query("SELECT COUNT(ID) FROM `prefix_koms` WHERE uid = ".$row->news_id." AND cat = 'NEWS'");
		$k0m  = db_result($k0m,0);
	echo '<div class="latest_news_headline">
	<a class="box" href="index.php?newsextended-'.$row->news_id.'">
	<table cellpadding="0" cellspacing="0" width="100%"><tr>
	<td width="70"><b>'.$kat.'</b></td>
	<td width="57">'.$row->datum.'</td>
	<td><b>'.((strlen($row->news_title)<30) ? $row->news_title : substr($row->news_title,0,27).'...').'</b></td>
	<td align="right">'.$k0m.' Kommentare</td>
	</tr></table></a>
	</div>';
}


?>