Es funzt immer noch net:
Meine News.php:
<?php
# Copyright by: Manuel
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
$title = $allgAr['title'].' :: News';
$hmenu = 'News';
$design = new design ( $title , $hmenu );
function news_find_kat ($kat) {
$katpfad = 'include/images/news/';
$katjpg = $katpfad.$kat.'.jpg';
$katgif = $katpfad.$kat.'.gif';
$katpng = $katpfad.$kat.'.jpg';
if ( file_exists( $katjpg ) ) {
$pfadzumBild = $katjpg;
} elseif ( file_exists ( $katgif ) ) {
$pfadzumBild = $katgif;
} elseif ( file_exists ( $katpng ) ) {
$pfadzumBild = $katpng;
}
if ( !empty( $pfadzumBild ) ) {
$kategorie = '<img style="" src="'.$pfadzumBild.'" alt="'.$kat.'">';
} else {
$kategorie = '<b>'.$kat.'</b><br /><br />';
}
return ( $kategorie );
}
if ( !is_numeric($menu->get(1)) ) {
if($menu->get(1) == 'rss' || $menu->get(1) == 'atom')
{
#ob_clean();
$feed_type = $menu->get(1);
$abf = "SELECT MAX(news_time) AS last_update FROM prefix_news";
$erg = db_query($abf);
$row = db_fetch_assoc($erg);
$last_update = str_replace(' ', 'T', $row['last_update']) . 'Z';
$abf = "SELECT
a.news_title as title,
a.news_id as id,";
$abf .= ($feed_type == 'atom') ? 'a.news_time as datum,' : "DATE_FORMAT(a.news_time,'%a, %e %b %y %H:%i:%s') as datum,";
$abf .=
"a.news_kat as kate,
a.news_text as text,
b.name as username,
b.id as userid
FROM prefix_news as a
LEFT JOIN prefix_user as b ON a.user_id = b.id
WHERE a.news_recht = 0
ORDER BY news_time ASC LIMIT 15";
$erg = db_query($abf);
$tpl = new tpl( 'news_'.$menu->get(1).'.htm' );
header('Content-type: application/' . $menu->get(1) . '+xml');
$tpl->set_ar_out(array('FEEDTITLE' => $allgAr['title'],
'UPDATED' => $last_update), 0);
while ($row = db_fetch_assoc($erg))
{
if($feed_type == 'atom')
{
$row['datum'] = str_replace(' ', 'T', $row['datum']) . 'Z';
}
$a = explode('[PREVIEWENDE]', $row['text']);
$tpl->set_ar_out(array('TITLE' => $row['title'],
'TXT' => bbcode($a[0]),
'LINK' => 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']). '/index.php?news-' . $row['id'],
'AUTHOR' => $row['username'],
'DATE' => $row['datum'],
'ID' => $row['userid']
), 1);
}
$tpl->out(2);
exit;
}
else
{
$design->header();
$limit = $allgAr['Nlimit'];
$page = ( $menu->getA(1) == 'p' ? $menu->getE(1) : 1 );
$MPL = db_make_sites ($page , "WHERE news_recht >= ".$_SESSION['authright'] , $limit , '?news' , 'news' );
$anfang = ($page - 1) * $limit;
$tpl = new tpl ( 'news.htm' );
$abf = "SELECT
a.news_title as title,
a.news_id as id,
DATE_FORMAT(a.news_time,'%d. %m. %Y') as datum,
DATE_FORMAT(a.news_time,'%W') as dayofweek,
a.news_kat as kate,
a.news_text as text,
b.name as username
FROM prefix_news as a
LEFT JOIN prefix_user as b ON a.user_id = b.id
WHERE ".$_SESSION['authright']." <= a.news_recht
OR a.news_recht = 0
ORDER BY news_time DESC
LIMIT ".$anfang.",".$limit;
#echo '<pre>'.$abf.'</pre>';
$erg = db_query($abf);
while ($row = db_fetch_assoc($erg)) {
$k0m = db_query("SELECT COUNT(ID) FROM `prefix_koms` WHERE uid = ".$row['id']." AND cat = 'NEWS'");
$row['kom'] = db_result($k0m,0);
$row['kate'] = news_find_kat($row['kate']);
$row['datum'] = $lang[$row['dayofweek']].' '.$row['datum'];
if ( strpos ( $row['text'] , '[PREVIEWENDE]' ) !== FALSE ) {
$a = explode('[PREVIEWENDE]' , $row['text']);
$row['text'] = $a[0];
}
$row['text'] = bbcode($row['text']);
$tpl->set_ar_out($row,0);
}
$tpl->set_out('SITELINK', $MPL,1);
unset($tpl);
}
} else {
$design->header();
$nid = escape($menu->get(1), 'integer');
$row = db_fetch_object(db_query("SELECT * FROM `prefix_news` WHERE news_id = '".$nid."'"));
if ( has_right(array($row->news_recht)) ) {
$komsOK = true;
if ( $allgAr['Ngkoms'] == 0 ) {
if ( loggedin() ) {
$komsOK = true;
} else {
$komsOK = false;
}
}
if ( $allgAr['Nukoms'] == 0 ) {
$komsOK = false;
}
# kommentar add
if ( (loggedin() OR chk_antispam ('newskom')) AND $komsOK AND !empty($_POST['name']) AND !empty($_POST['txt']) ) {
$_POST['txt'] = escape($_POST['txt'],'string');
$_POST['name'] = escape($_POST['name'],'string');
db_query("INSERT INTO `prefix_koms` VALUES ('',".$nid.",'NEWS','".$_POST['name']."','".$_POST['txt']."')");
}
# kommentar add
# kommentar loeschen
if ($menu->getA(2) == 'd' AND is_numeric($menu->getE(2)) AND has_right(-7, 'news')) {
$kommentar_id = escape($menu->getE(2),'integer');
db_query("DELETE FROM prefix_koms WHERE uid = ".$nid." AND cat = 'NEWS' AND id = ".$kommentar_id);
}
# kommentar loeschen
$kategorie = news_find_kat($row->news_kat);
$textToShow = bbcode($row->news_text);
$textToShow = str_replace('[PREVIEWENDE]','',$textToShow);
if ( !empty($such) ) {
$textToShow = markword($textToShow,$such);
}
$users = '';
if (has_right(-1)) {
$readonly = 'readonly="readonly"';
$user = 'u';
}
else
{
$user = 'g';
$uquery = db_query("SELECT name FROM prefix_user");
while ($uds = db_fetch_object($uquery)) {
$username = $uds -> name;
if (!empty($users)) $users = $users.', ';
$users = $users.'"'.$username.'"';
}
}
$tpl = new tpl ( 'news.htm' );
$ar = array (
'TEXT' => $textToShow,
'KATE' => $kategorie,
'NID' => $nid,
'uname' => $_SESSION['authname'],
'ANTISPAM' => (loggedin()?'':get_antispam ('newskom', 0)),
'NAME' => $row->news_title,
'READONLY' => $readonly,
'user' => $user,
'USERS' => $users
);
$tpl->set_ar_out($ar, 2 );
if ($komsOK) {
$tpl->set_ar_out ( array ( 'NAME' => $row->news_title , 'NID' => $nid ), 3 );
}
$erg1 = db_query("SELECT text, name, id FROM `prefix_koms` WHERE uid = ".$nid." AND cat = 'NEWS' ORDER BY id DESC");
$ergAnz1 = db_num_rows($erg1);
if ( $ergAnz1 == 0 ) {
echo '<b>'.$lang['nocomments'].'</b>';
} else {
$zahl = $ergAnz1;
while ($row1 = db_fetch_assoc($erg1)) {
$row1['text'] = bbcode(trim($row1['text']));
if (has_right(-7, 'news')) {
$row1['text'] .= '<a href="index.php?news-'.$nid.'-d'.$row1['id'].'"><img src="include/images/icons/del.gif" alt="löschen" border="0" title="löschen" /></a>';
}
$tpl->set_ar_out( array('NAME' => $row1['name'], 'TEXT' => $row1['text'], 'ZAHL' => $zahl ) , 4 );
$zahl--;
}
}
}
$tpl->out(5);
}
$design->footer();
?>
Meine News.htm
<style type="text/css">
<!--
.Stil3 {font-size: 18px}
.Stil5 {font-size: 12px}
.Stil6 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
<div align="center">
<table width="468" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td height="16" colspan="2" align="center"
background="/images/news_bg.jpg" width="468">{kate}</td>
</tr>
<tr>
<td height="20" colspan="2" width="468">
<p align="center"><span class="Stil6">
<font face="Verdana, Arial, Helvetica, sans-serif"><strong>
{title} </strong></font></span>
<p align="center"><span class="Stil6">
<strong>
<font size="1" face="Verdana, Arial, Helvetica, sans-serif">von<font color="#00FFFF">
</font> </font>
<font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#00FFFF">
<a href="index.php?user-details-{id}"><font color="#00FFFF">{username}</font></a> </font>
<font size="1" face="Verdana, Arial, Helvetica, sans-serif">am</font><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#000000"> </font>
<font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#00FFFF">{datum}</font></strong></span></td>
</tr>
<tr>
<td colspan="2" width="468"><br /> <table width="468" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td>
<p align="left">{text} </td>
</tr>
</table>
<br /> </td>
</tr>
<tr>
<td width="235" height="16"> <div align="left"></div>
<div align="left"></div>
<p align="left"><i><strong><a
href="index.php?news-{id}">
<font size="1" face="Verdana, Arial, Helvetica, sans-serif">{_lang_readwholenews}</font></a></strong></i></td>
<td width="233" height="16">
<p align="right"><i><strong><a
href="index.php?news-{id}">
<font size="1" face="Verdana, Arial, Helvetica, sans-serif">{kom} {_lang_comments}</font></a></strong></i></td>
</tr>
</table>
<p>{EXPLODE} <br />
<br />
{SITELINK}</div>
<link rel="alternate" type="application/rss+xml" title="News (RSS)"
href="index.php?news-rss">
<link rel="alternate" type="application/atom+xml" title="News (Atom)"
href="index.php?news-atom">
<p align="center">{EXPLODE}
<!-- News Kommentare und Mehr lesen -->
</p>
<p align="center"> </p>
<div align="center">
<table width="468" border="0" cellspacing="0" cellpadding="0"
class="border" style="border-width:0; border-collapse:collapse" height="172">
<tr class="Chead">
<td class="Chead" width="519" height="19"><div
align="center">{KATE}</div></td>
</tr>
<tr>
<td class="Cnorm" width="519" height="20"><div align="center"><b>{NAME}</b></div></td>
</tr>
<tr>
<td class="Cnorm" height="1" width="519" style="border-bottom-style: none; border-bottom-width: medium"></td>
</tr>
<tr>
<td class="Cnorm" width="519" height="38" style="border-style: none; border-width: medium">
<p align="left">{TEXT}</td>
</tr>
<tr>
<td bgcolor="#000000" width="519" style="border-style:none; border-width:medium; " height="21">
<p align="left">
<a href="index.php?news" style="text-decoration: none"><b>
<font color="#FFFFFF">«</font></b><font color="#00FFFF"> <i>{_lang_back}</i></font></a></td>
</tr>
<tr>
<td height="25" class="Cmite" width="519" style="border-top-style: none; border-top-width: medium"> </td>
</tr>
</table>
</div>
<p align="center">
<div align="center">
<table class="border" width="468" border="0" cellspacing="0" style="border-collapse: collapse" cellpadding="0">
<tr>
<td class="Cnorm" width="519"> {EXPLODE}
<form action="index.php?news-{NID}" method="POST">
<fieldset style="width: 519; height: 155">
<legend>
<p align="left"><font color="#00FFFF">{_lang_writecomment}</font></p>
</legend>
<p align="left">
<input type="text" name="name" value="{uname}" size="20" />
<input type="submit" value="{_lang_enter}">
<br />
<textarea cols="50" rows="2" name="txt"></textarea><br />
</fieldset></form>
<br />
{EXPLODE}<br />
<div align="center" style="width: 518; height: 19">
<center>
<table width="500" border="1" cellpadding="0"
cellspacing="0" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" style="border-width: 0">
<tr>
<td style="border-style: none; border-width: medium" width="519">
<p align="left">• <font color="#00FFFF"> <b>{ZAHL}</b></font> von
<font color="#00FFFF">{NAME}</font></span> </td>
</tr>
</table>
</center>
</div>
</td>
</tr>
<tr>
<td class="Cnorm" width="518" bordercolor="#FFFFFF" style="border-style: solid; border-width: 1" bordercolorlight="#FFFFFF"> <p align="left">
{TEXT}</p>
<p> </td>
</tr>
<tr>
<td class="Cnorm" width="519"> {EXPLODE}</td>
</tr>
</table>
<div align="center">
<center>
<table border="0" cellspacing="1" width="519" id="AutoNumber1">
<tr>
<td width="519">
<p align="left">
<a href="index.php?news" style="text-decoration: none"><b>
<font color="#FFFFFF">«</font></b><font color="#00FFFF"> <i>{_lang_back}</i></font></a></td>
</tr>
</table>
</center>
</div>
<p>{EXPLODE} </p>
<table width="519" border="0" cellspacing="0" class="rand">
<tr class="mite">
<td width="65%"><b>{NAME}</b></td>
<td width="15%">{FUER}</td>
<td width="20%" align="right">{DATE}</td>
</tr>
<tr class="norm">
<td valign="top" colspan="2">{TEXT}{MEHR}</td>
<td valign="top" rowspan="2" align="center">{KATE}</td>
</tr>
<tr class="norm">
<td valign="bottom" height="20" colspan="2" align="center"> <b>{_lang_from}
{UNAME}</b> [ {KOM} <a
href="index.php?news-1&nid={ID}">{_lang_comments}</a> ] </td>
</tr>
</table>
</div>
Was hab ich falsch gemacht??
MfG Hijacker