"; } else echo ""; echo ""; $result = mysql_query("SELECT Name, Comment, Timestamp FROM t_BreakUpComment WHERE FK_BreakUpStoryID = $storyid ORDER BY PK_BreakUpCommentID ASC") or die(mysql_error()); while ($daten = mysql_fetch_array($result)) { $timestamp = date("d.m.Y - H:i", $daten[Timestamp]); ($daten[Name]) ? $name = $daten[Name] : $name = "Anonym"; echo ""; } $showcomment = true; } else { $shownext = 0; $result = mysql_query("SELECT PK_BreakUpStoryID FROM t_BreakUpStory ORDER BY PK_BreakUpStoryID DESC LIMIT 1") or die(mysql_error()); $daten = mysql_fetch_array($result); $endid = $daten[PK_BreakUpStoryID]; $result = mysql_query("SELECT PK_BreakUpStoryID FROM t_BreakUpStory ORDER BY PK_BreakUpStoryID ASC LIMIT 1") or die(mysql_error()); $daten = mysql_fetch_array($result); $firstid = $daten[PK_BreakUpStoryID]; $showprevious = true; if (!$id) $id = $endid+1; $result = mysql_query("SELECT PK_BreakUpStoryID, Titel, Story, Filename, Timestamp FROM t_BreakUpStory WHERE PK_BreakUpStoryID < $id ORDER BY PK_BreakUpStoryID DESC LIMIT 4") or die(mysql_error()); while ($daten = mysql_fetch_array($result)) { $rowfound = true; $titel= $daten[Titel]; $timestamp = date("d.m.Y - H:i", $daten[Timestamp]); ($daten[Filename]) ? $img = '' : $img = ""; echo ""; $nextid = $daten[PK_BreakUpStoryID]; $shownext ++; if ($endid == $daten[PK_BreakUpStoryID]) $showprevious = false; if ($firstid == $daten[PK_BreakUpStoryID]) $shownext = false; } if (!$rowfound) $showprevious = false; ($shownext == 4 && $nextid != $endid) ? $next = "next >>" : $next = ""; ($showprevious) ? $previous = "<< previous" : $previous = ""; $previousid = $id; } ?> " method="post" enctype="multipart/form-data">
\"\"$daten[Titel]
$daten[Titel]
",preg_replace('/\r\n|\r|\n/', '
',$daten[Story]),"

$name ($timestamp Uhr)
"; echo "",preg_replace('/\r\n|\r|\n/', '
',$daten[Comment]),"
$titel ($timestamp Uhr) $img
"; $shortstory = substr($daten[Story],0,250); $shortstory = substr($shortstory,0,strrpos ($shortstory, " ")); $shortstory = preg_replace('/\r\n|\r|\n/', '
',$shortstory); $commentresult = mysql_query("SELECT count(*) AS Anzahl FROM t_BreakUpComment WHERE FK_BreakUpStoryID = $daten[PK_BreakUpStoryID]") or die(mysql_error()); $commentrow = mysql_fetch_array($commentresult); $comment = $commentrow[Anzahl]; echo "$shortstory...
>> Kommentare ($comment) 

Name
Kommentar