include_once('../include/procs.php'); ?>
$id = $_GET['id'];
$qry = mysql_query("SELECT language FROM recipeindex WHERE id=".$id);
if ($row = mysql_fetch_array($qry)) {
if (($row[0] == "D") && ($_SERVER['HTTP_HOST'] == 'www.recipedatabase.eu')) {
if (!checkBot()) { mysql_query(sprintf("INSERT INTO RezeptDB_extension.links_outdated (id,site,pathname) VALUES (%d,'%s','%s')",$id,$_SERVER['HTTP_HOST'],$_SERVER['REQUEST_URI'])); }
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.cuisine.at'.$_SERVER['REQUEST_URI']);
header('Connection: close');
exit();
};
if (($row[0] == "E") && (($_SERVER['HTTP_HOST'] == 'www.cuisine.at') || ($_SERVER['HTTP_HOST'] == 'rezepte.pocketspoon.de'))) {
if (!checkBot()) { mysql_query(sprintf("INSERT INTO RezeptDB_extension.links_outdated (id,site,pathname) VALUES (%d,'%s','%s')",$id,$_SERVER['HTTP_HOST'],$_SERVER['REQUEST_URI'])); }
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.recipedatabase.eu'.$_SERVER['REQUEST_URI']);
header('Connection: close');
exit();
};
} else {
mysql_query("UPDATE recipe_replacements SET hops=$lp,last_hopped=NOW() WHERE recipenumber=$id");
if (!checkBot()) { mysql_query(sprintf("INSERT INTO RezeptDB_extension.links_outdated (id,site,pathname) VALUES (%d,'%s','%s')",$id,$_SERVER['HTTP_HOST'],$_SERVER['REQUEST_URI'])); }
$rowid = mysql_insert_id();
$lp = 0;
$final = false;
do {
$qry = mysql_query("SELECT replaced_by FROM recipe_replacements WHERE recipenumber=".$id);
if ($row = mysql_fetch_array($qry)) {
$id = $row[0];
$lp++;
} else {
$final = true;
};
} while (($lp<50) && (!$final));
$qry = mysql_query("SELECT filename FROM recipeindex WHERE id=$id");
if ($row = mysql_fetch_array($qry)) {
header('HTTP/1.1 301 Moved Permanently');
header(sprintf('Location: http://%s/%s',$_SERVER['HTTP_HOST'],$row[0]));
header('Connection: close');
exit();
} else {
mysql_query("UPDATE RezeptDB_extension SET priority=1 WHERE rowid=$rowid");
header('HTTP/1.1 404 Not Found');
header('Location: http://'.$_SERVER['HTTP_HOST'].'/404.html');
header('Connection: close');
exit();
}
}
if (!checkBot()) {
checkViewLimit();
searchengineRedirectLog();
/*
$lp = 0;
$rn = $id;
$final = false;
do {
$qry = mysql_query("SELECT replaced_by FROM recipe_replacements WHERE recipenumber=$rn");
if ($row = mysql_fetch_array($qry)) {
$rn = $row[0];
$lp++;
} else {
$final = true;
};
} while (($lp<10) && (!$final));
if ($lp != 0) {
mysql_query("UPDATE recipe_replacements SET hops=$lp,last_hopped=NOW() WHERE recipenumber=$id");
};
if (($final) && ($lp != 0)) {
if (($id != $rn) && (!checkBot())) {
mysql_query(sprintf("INSERT INTO RezeptDB_extension.links_outdated (id,site,pathname) VALUES (%d,'%s','%s')",$id,$_SERVER['HTTP_HOST'],$_SERVER['REQUEST_URI']));
}
$id = $rn;
};
*/
mysql_query("UPDATE statistics SET views=views+1 WHERE day=CURDATE()");
mysql_query("UPDATE statistics_viewtime SET views=views+1 WHERE minutes=FLOOR(TIME_TO_SEC(NOW())/60)");
}
if (strpos(" ".$_SERVER["HTTP_USER_AGENT"],"Googlebot")) {
mysql_query("UPDATE statistics SET google_botscans=google_botscans+1 WHERE day=CURDATE()");
}
//$qry = mysql_query("SELECT xmltitle,description,recipe FROM recipeinfo where id=$id");
$qry = mysql_query("SELECT I.xmltitle,I.description,M.recipe FROM recipeinfo I JOIN mealmaster_recipe M ON I.id=M.id where I.id=$id");
if ($row = mysql_fetch_array($qry)) {
$title = $row[0];
$description = $row[1];
$recipe = $row[2];
} else {
$title = 'RECIPE MISSING';
$description = '';
$recipt = '';
};
$page_content = gettext('Rezept')." ".$title;
$page_topic = gettext('Rezept')." ".$title;
$page_description = $description." - ".gettext('Rezept')." ".$title;
$page_title = gettext('Rezept')." ".$title." :: ".preg_replace("/(.*)\.(.*\..*)/","$2",$_SERVER['HTTP_HOST']);
if ($title != "RECIPE MISSING") {
$page_addheader = '';
} else {
$page_addheader = '';
};
include("../include/header_searchengine.php");
if ($format == "mealmaster") {
$qry = mysql_query("SELECT recipe FROM mealmaster_recipe WHERE id=$id");
$row = mysql_fetch_array($qry);
print "\n";
print "";
print "\n";
print "
".$row[0]."\n"; } else { $qry = mysql_query("SELECT recipe FROM shortxml_recipe WHERE id=$id"); $row = mysql_fetch_array($qry); $xml = str_replace("","&#",str_replace("&#","",str_replace("ä","ä",str_replace("ö","ö", str_replace("ü","ü",$row[0]))))); // Dresdner Stollen mit Markenbezeichnung versehen // http://www.intern.de/news/neue--meldungen/--200911056465.html $xml = preg_replace('/(Dresdner (Stollen|Christstollen|Weihnachtsstollen))/','$1 ®',$xml); print "\n"; print '