Måske du kan hjælpe mig, synes ikke helt jeg får det til at fungere:
<?php
include('inc.config.php');
$query = mysql_query("SELECT *,DATE_FORMAT(date,'%e/%c-%Y %T') AS date FROM news WHERE id=".$_GET['id']."");
$row = mysql_fetch_assoc($query);
function LinkedText($text)
{
$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\">\\0</a>",
ereg_replace("www[^<>[:space:]]+[[:alnum:]/]", "
http://\\0",
str_replace("
http://www", "www", $text)));
return $text;
}
echo '<h2>'.$row['title'].'</h2>';
echo '<p><b>'.$row['synopsis'].'</b></p>';
echo empty($row['image']) ? '' : '<p align="center"><img src="files/'.$row['image'].'" class="image">';
echo '</p>';
echo nl2br($row['text']);
echo '<br><br><p>Skrevet af '.$row['author'].', '.$row['date'].'</p>';
echo '<div class="hr"></div>';
$query = mysql_query("SELECT *,DATE_FORMAT(date,'%e/%c-%Y %T') AS date FROM comments WHERE parent=".$_GET['id']." ORDER BY id ASC");
if (mysql_num_rows($query) > 0) {
echo '<a name="Kommentarer"></a><h2>Kommentarer</h2>';
while ($row = mysql_fetch_assoc($query)) {
echo empty($row['email']) ? htmlspecialchars($row['name']) : '<a href="mailto:'.$row['email'].'">'.htmlspecialchars($row['name']).'</a>';
echo ' ('.$row['date'].')<br><br>';
echo nl2br(htmlspecialchars($row['text']));
echo '<div class="hr"></div>';
}
}
?>