' . $query);
while ($row = mysql_fetch_assoc($result)) {
$debug = $row['debug'];
$main_showtitle = $row['main_showtitle'];
$main_showdate = $row['main_showdate'];
$main_showauth = $row['main_showauth'];
$main_showauthweb = $row['main_showauthweb'];
if($debug==1){
error_reporting(E_ALL);
}
echo("
Bovennatuurlijk.com Quotes
");
if(isset($_GET['id'])){
/*Begin code for retrieving a single testimonial record.*/
$id = (int) $_GET['id'];
echo ("Dit is de volledige quote. Wil je ook een quote
toevoegen??
\n"); //Create the initial table
/* this query will get a particular testimonial, depending on the ID passed in the URL*/
$query = ("SELECT id,active,author,authorweb,authorwebname,title,testtext," .
"DATE_FORMAT(postdate, '%M %D, %Y') as date " .
"FROM ".$prefix."testimonials WHERE id=$id");
$result = mysql_query ($query) or die('MySQL error: ' . mysql_error() . ' ' . $query);
$result_rows = mysql_num_rows($result);
/*Shut them down if the record does not exist.*/
if($result_rows==0){
echo ("
De opgevraagde quote bestaat niet.
|
");
}else{
/*Let them know that the testimonial is suspended, then call the cops because
they should not be trying to view it, and are probably part of the Taliban.*/
for($i=0; $i<$result_rows; $i++){
$row = mysql_fetch_array($result);
$active = $row['active'];
if($active != 1){
echo("
De opgevraagde quote is niet actief.
|
");
}else{
/*Finally, we get to view a freaking testimonial!*/
$date = $row['date'];
$author = $row['author'];
$authorweb = $row['authorweb'];
$authorwebname = $row['authorwebname'];
$title = $row['title'];
$testtext = $row['testtext'];
/* display the data */
echo("
| ");
if($main_showtitle == 1) {
echo(" $title");
}
echo(" |
| ");
if($main_showauth == 1) {
echo("Geplaatst door: $author ");
}
if($authorweb != "") {
if($main_showauthweb == 1) {
echo("- Website: $authorwebname");
}
}
echo("
|
|
$testtext
|
");
}
}
}
echo (" |
");
}else{
/*This creates a page to show ALL of the testimonials, since no ID was passed via the URL.*/
echo ("Dit is een compleet overzicht van de quotes. Wil je ook een quote
toevoegen?
\n"); //Create the initial table
/*Doing the data grab for all active testimonials*/
$query = ("SELECT id,active,author,authorweb,authorwebname,title,testtext," .
"DATE_FORMAT(postdate, '%M %D, %Y') as date " .
"FROM ".$prefix."testimonials WHERE active=1 ORDER BY postdate DESC");
$result = mysql_query ($query) or die('MySQL error: ' . mysql_error() . ' ' . $query);
while ($row = mysql_fetch_assoc ($result)) {
/* display testimonials in a simple table */
$date = $row['date'];
$author = $row['author'];
$authorweb = $row['authorweb'];
$authorwebname = $row['authorwebname'];
$title = $row['title'];
$testtext = $row['testtext'];
/* display the data */
echo("
| ");
if($main_showtitle == 1) {
echo(" $title");
}
echo(" |
| ");
if($main_showauth == 1) {
echo("Geplaatst door: $author ");
}
if($authorweb != "") {
if($main_showauthweb == 1) {
echo("- Website: $authorwebname");
}
}
echo("
|
|
$testtext
|
");
}
echo (" |
");
}
}
/*Da global foot is so pretty, you need to see it all the time.*/
echo("
");
?>