';
//if (!$loggedIn){
//header ("Location: https://recipebox.cdkitchen.com/$pagelogin");
//}
if (!$submitted){
@header ("Location: https://recipebox.cdkitchen.com/");
exit;
}
if ($loggedIn == false){
@include '/home/chilidog/public_html/recipes/views.php';
}
include "commentdb.php";
$isRecipe = 1;
$postId = $ridx;
//comment function
$recbreadcrumb = '↞ recipe box start page';
$returnlink = 'https://recipebox.cdkitchen.com/'.$submitted.'/'.$ridx.'/recipe.html';
$printlink = 'https://recipebox.cdkitchen.com/'.$submitted.'/'.$ridx.'/print.html';
$canon = $returnlink;
$indent=200;
function thread($postId,$isBlog,$isRecipe,$submitted,$userId) {
if ($isBlog ==1){
$whattype = ' and blogid='.$postId.'';
$posttype = 'blog';
}else{
$whattype = ' and rboxid='.$postId.'';
$posttype='recipe';
}
$parent_id = 0;
$commentlist = @mysql_query("SELECT * FROM user_comments WHERE allow=1 and acctId=".mysql_real_escape_string($submitted)."".$whattype."");
// if we have comments to display, display them, if not, exit.
if ($commentlist != NULL) {
// echo "
"; // the
is what creates the indent
while ($myrow = @mysql_fetch_array($commentlist)) {
$comments = stripslashes($myrow["comment"]);
$comments = str_replace("\n\n",'
',$comments);
$postedate = date('F j, Y g:i a', strtotime($myrow["whattime"]));
$posterId = $myrow["userId"];
$getusername = @mysql_query("SELECT username FROM user WHERE userId=$posterId");
while ($gmyrow = @mysql_fetch_array($getusername)) {
$postername = $gmyrow['username'];
}
if ($userId == $submitted || $userId=='468' || $userId == $posterId){
$deletelink = '
\n";
if ($parent_id){
$indent=$indent+100;
}else{
$indent =$indent;
}
// thread($postId,$isBlog,$isRecipe,$acctId); // run through
// the function again, this is what creates the
// threading effect
}
// echo "
";
}
return $mystuff;
}
//end comment function
//if(!preg_match("/Googlebot/i",$_SERVER['HTTP_USER_AGENT'])&&!preg_match("/yahoo/i",$_SERVER['HTTP_USER_AGENT']) &&!preg_match("/bingbot/i",$_SERVER['HTTP_USER_AGENT']) &&!preg_match("/msnbot/i",$_SERVER['HTTP_USER_AGENT']) || preg_match('~(bot|crawl|index|spider)~i', $_SERVER['HTTP_USER_AGENT'])){
//skip_agents is in getdetails
$dontlog=0;
$arebot= $_SERVER['REMOTE_ADDR'];
if (substr($areuhacker, 0, 6)=='50.17.' ||
substr($areuhacker, 0, 6)=='50.17.'){
$dontlog=1;
}
if(!preg_match($skip_agents, $_SERVER['HTTP_USER_AGENT'])|| $dontlog==0){
$visitIP = $_SERVER['REMOTE_ADDR'];
$thispage = 'myrecipes';
if ($userId && $userId != $submitted){
$sqlc = "select userId from user_visits where box_visited=$submitted and section='".$thispage."' and postid=$ridx and visit_date=date(NOW()) and visitIP='".mysql_real_escape_string($visitIP)."'";
$resultc = @mysql_query($sqlc);
$num1=@mysql_num_rows($resultc);
if (!$num1){
$sql = "insert into user_visits (userId, box_visited, section,postid,visit_date, visitIP";
$sql .= ") VALUES ( ";
$sql .= "$userId,$submitted, '".$thispage."',$ridx,date(NOW()),'$visitIP')";
$result = @mysql_query($sql);
$gsql = "update user_hitcount set hitcount=hitcount+1 where userId=$submitted limit 1";
$gresult = @mysql_query($gsql);
}
}elseif (!$userId){
$sqlc = "select userId from user_visits where box_visited=$submitted and section='".$thispage."' and postid=$ridx and visit_date=date(NOW()) and visitIP='".mysql_real_escape_string($visitIP)."'";
$resultc = @mysql_query($sqlc);
$num1=@mysql_num_rows($resultc);
if (!$num1){
$sql = "insert into user_visits (userId, box_visited, section, postid,visit_date, visitIP";
$sql .= ") VALUES ( ";
$sql .= "0,$submitted, '".$thispage."',$ridx,date(NOW()),'$visitIP')";
$result = @mysql_query($sql);
$gsql = "update user_hitcount set hitcount=hitcount+1 where userId=$submitted limit 1";
$gresult = @mysql_query($gsql);
}
}}
$rquery3 = "SELECT username,realname FROM user where userId=".mysql_real_escape_string($submitted)." limit 1";
$rresult3 = @mysql_query($rquery3);
while($rrow3 = @mysql_fetch_array($rresult3))
{
if (strlen($rrow3[realname]) > 1){
$photobyname = $rrow3[realname];
}else{
$photobyname = $rrow3[username];
}
}
foreach (glob("/home/chilidog/public_html/recipebox/users/".$submitted."_thumb.*") as $filename) {
$showpic = str_replace('/home/chilidog/public_html/recipebox/users/','',$filename);
//$bigpic = str_replace('_thumb','',$showpic);
// $myimg = '';
$myimg = ' ';
}
if (!$myimg){
$myimg = '';
}
//$showallarts .=$myimg.''.$photobyname.'\'s Recipe';
//$showallarts .=' Page url: https://recipebox.cdkitchen.com/'.$submitted.'/myrecipes.html ';
$aboutrecipe1 .=$myimg.'view my recipes';
//
$myrecipes =' Page url: https://recipebox.cdkitchen.com/'.$submitted.'/myrecipes.html ';
// $hitsquery = "SELECT count(idx) as hitcount FROM user_visits where box_visited=".mysql_real_escape_string($submitted)."";
$hitsquery = "SELECT hitcount FROM user_hitcount where userId=".mysql_real_escape_string($submitted)."";
$hitresult = @mysql_query($hitsquery);
while($hitrow = @mysql_fetch_array($hitresult))
{
$sitehits = $hitrow[hitcount];
$sitehits = number_format($sitehits, 0, "", ",");
//$showallarts .=''.$photobyname.'\'s webpage has been visited '.$sitehits.' times';
// $aboutrecipe .=''.$photobyname.'\'s visits: '.$sitehits.'';
}
$hitsquery = "SELECT count(idx) as hitcount FROM user_visits where box_visited=".mysql_real_escape_string($submitted)." and section='myrecipes' and postid=$ridx";
$hitresult = @mysql_query($hitsquery);
while($hitrow = @mysql_fetch_array($hitresult))
{
$sitehits = $hitrow[hitcount];
$sitehits = number_format($sitehits, 0, "", ",");
//$showallarts .=''.$photobyname.'\'s webpage has been visited '.$sitehits.' times';
$aboutrecipe ='this recipe viewed '.$sitehits.' times';
}
//include("/home/chilidog/public_html/recipebox/mininav.html");
if ($loggedIn==true){
$rec_breadcrumb='
';
//end comment section
/*related recipes*/
function rbox_related_recipes($ridx,$pagetitle) {
$cservememcache = @new Memcache;
@include "/home/chilidog/public_html/mcacheconn.php";
if (!@$cservememcache->connect("$datacip", $datacport)) { @$cservememcache->connect("$datacip", $datacport); }
$cservesetname = 'rbox_related_member_recipe_viewrecipehtmlx-'.$ridx;
$cserve = @$cservememcache->get($cservesetname);
if (!$cserve) {
$aq3next = 'SELECT user_recipes.idx,user_recipes.title as nexttitle,user_recipes.idx as nextlink,user_recipes.userId as userId,rbox_user as relateduser,user_recipes.description,user_recipes.photo,SUBSTRING(user_recipes.recbody,1,200) as nodescript, MATCH (user_recipes.title) AGAINST (\''.addslashes($pagetitle).'\') AS score from user_recipes where idx != '.$ridx.' and user_recipes.public="T" and user_recipes.approved=1 and user_recipes.misc != "VW" and MATCH (user_recipes.title) AGAINST (\''.addslashes($pagetitle).'\') group by user_recipes.title having score > 7 order by score desc,user_recipes.datesub desc limit 5';
//echo "";
$ar3next = @mysql_query($aq3next);
$next_num_rows = @mysql_num_rows($ar3next);
if ($next_num_rows < 2){
}else{
$morerecipes ='
';
}
$morerecipes.=' view more member recipes ';
}
$cserve = $morerecipes;
@$cservememcache->set($cservesetname, $cserve, false, 604800); //save it for 60 seconds, uncompressed
}
//return the array
return $cserve;
}
$morerecipes =rbox_related_recipes($ridx,$pagetitle);
$showallarts .=$morerecipes;
function rbox_cdk_related_recipes($pagetitle) {
$cservememcache = @new Memcache;
@include "/home/chilidog/public_html/mcacheconn.php";
if (!@$cservememcache->connect("$datacip", $datacport)) { @$cservememcache->connect("$datacip", $datacport); }
$cservesetname = 'rbox_related_cdk_recipe_recipehtmlx-'.$pagetitle;
$cserve = @$cservememcache->get($cservesetname);
if (!$cserve) {
$nextprev='';
$aq3next = 'SELECT cdklinks.title as nexttitle,cdklinks.link2 as nextlink,cdkrecipeseo__recipes1.newimgdir as minilogodir,cdklinks.mid as logomid,cdklinks.is_img as is_img2,MATCH (new_search.s_all) AGAINST (\''.addslashes($pagetitle).'\') AS score from cdklinks,cdkrecipeseo__recipes1,new_search where cdklinks.DB=3 and cdklinks.link2=new_search.link2 and (cdkrecipeseo__recipes1.smalllogo=1 or cdklinks.is_img=1) and cdklinks.mid=cdkrecipeseo__recipes1.mid and MATCH (s_all) AGAINST (\''.addslashes($pagetitle).'\') and cdkrecipeseo__recipes1.noindex3=0 and cdklinks.showmod <=NOW() group by cdklinks.title having score > 7 order by cdklinks.is_img desc,score desc,cdklinks.idx asc limit 10';
//echo $aq3next;
$ar3next = mysql_query($aq3next);
$next_num_rows = mysql_num_rows($ar3next);
if ($next_num_rows < 4){
}else{
$morerecipes ='
related CDKitchen recipes
';
while($arow3next = mysql_fetch_array($ar3next))
{
$nexttitle = stripslashes($arow3next['nexttitle']);
$logomid = $arow3next['logomid'];
$nextlink = $arow3next['nextlink'];
$is_img2 = $arow3next['is_img2'];
$minilogodir = $arow3next['minilogodir'];
if ($is_img2==1){
$qimg2 = "SELECT imgurl as imgurl2 FROM cdkimages where mid=".$logomid." order by prio desc,uploaddate desc limit 1";
$rimg2 = mysql_query($qimg2);
while($rowimg2 = mysql_fetch_array($rimg2))
{
$nextlinkimg = $rowimg2['imgurl2'];
}
}else{
$nextlinkimg = 'https://www.cdkitchen.com/recipes/images/sharing/'.$minilogodir.'/'.$logomid.'-small.png';
}
//$nextrecipe .= '