Hier das Script:
MfG Floriam
PHP-Code:
$result=mysql_query('SELECT * from news ORDER BY order_by DESC');
while ($eintrag=mysql_fetch_assoc($result))
{
$sql=mysql_query('SELECT * from news_group WHERE id = '.$eintrag['group_id']);
$result_group = mysql_fetch_array($sql);
$sql_author = @mysql_query('SELECT * FROM users WHERE id = "'.$eintrag['author'].'"') or die(tech_error("Verbindung zur Datenbank ist fehlgeschlagen"));
$author = @mysql_fetch_array($sql_author) or die(tech_error("Ein Datenbankfehler ist aufgetreten"));
if(strlen($eintrag['inhalt'])>=255)
$eintrag['inhalt'] = substr($eintrag['de'],0,255)."...";
$template['newnews'] = gettemplate('news');
$template['newnews'] = ereg_replace('{icon}',$result_group['icon'],$template['newnews']);
$template['newnews'] = ereg_replace('{titel}',$eintrag['titel'],$template['newnews']);
$template['newnews'] = ereg_replace('{news}',$eintrag['inhalt'],$template['newnews']);
$template['newnews'] = ereg_replace('{news_id}',$eintrag['id'],$template['newnews']);
$template['newnews'] = ereg_replace('{gelesen}',$eintrag['reading'],$template['newnews']);
$template['newnews'] = ereg_replace('{author_id}',$author['id'],$template['newnews']);
$template['newnews'] = ereg_replace('{author}',$author['user'],$template['newnews']);
$template['newnews'] = ereg_replace('{icon}',$result_group['icon'],$template['newnews']);
$template['newnews'] = ereg_replace('{datum}',$news['datum'],$template['newnews']);
$template['newnews'] = ereg_replace('{zeit}',$news['zeit'],$template['newnews']);
}
Kommentar