$val) { $mystuff .= "$key has the value $val\n"; } $to = 'valerie@cdkitchen.com'; $from = 'onlynew@cdkitchen.com'; $subject = 'testing'; $bvmessage = $mystuff; mail($to,$subject,$bvmessage,"From: {$from}", "-f$from"); */ $getcats = (isset($_REQUEST['getcats']) ? $_REQUEST['getcats'] : null); if ($getcats){ $agallery=0; if(substr($getcats, -1) != '/' && !stristr($getcats, '.')) { $changeurl = trim($getcats).'/'; @header ('HTTP/1.1 301 Moved Permanently'); @header ('Location: https://www.cdkitchen.com'.$changeurl.''); exit; } @include "/home/chilidog/public_html/connector.inc.php"; $pieces = explode('/', $getcats); $howmanypieces = count($pieces); $cookflag=''; /* if ($pieces[$howmanypieces-2]== '30-60-minutes'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $cookflag = '30-60 minutes'; $cookurl = '30-60-minutes/'; } if ($pieces[$howmanypieces-2]== 'under-30-minutes'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $cookflag = '< 30 minutes'; $cookurl = 'under-30-minutes/'; } if ($pieces[$howmanypieces-2]== '1-2-hours'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $cookflag = '1-2 hrs'; $cookurl = '1-2-hours/'; } if ($pieces[$howmanypieces-2]== '2-5-hours'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $cookflag = '2-5 hrs'; $cookurl = '2-5-hours/'; } if ($pieces[$howmanypieces-2]== 'over-5-hours'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $cookflag = '> 5 hrs'; $cookurl = 'over-5-hours/'; } */ //get rid of photo gallery //if (stristr($pieces[$howmanypieces-2], 'photo-gallery')){ //$getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); //$agallery=1; //} //if ($getcats == '/recipes/halloween/photo-gallery/'){ //$getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); //$getcats=95; //$agallery=1; //} //get rid of newest by cat //if ($pieces[$howmanypieces-2] == 'newest'){ //$getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); //$shownewrecipesonly = 1; //} /* if ($pieces[$howmanypieces-2] == 'a-z'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $showalpha = 1; $alphaurl = 'a-z/'; } */ /* Cook Method Sort */ $methodflag=''; $methodurl=''; /* if ($pieces[$howmanypieces-2]== 'stovetop' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'stovetop'; $methodurl = 'stovetop/'; } */ /*if ($pieces[$howmanypieces-2]== 'stovetop'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'stovetop'; $methodurl = 'stovetop/'; } if ($pieces[$howmanypieces-2]== 'stovetop'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'stovetop'; $methodurl = 'stovetop/'; } */ /* if ($pieces[$howmanypieces-2]== 'outdoor-grill' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'outdoor grill'; $methodurl = 'outdoor-grill/'; } if ($pieces[$howmanypieces-2]== 'oven' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'oven'; $methodurl = 'oven/'; } if ($pieces[$howmanypieces-2]== 'indoor-grill' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'indoor grill'; $methodurl = 'indoor-grill/'; } if ($pieces[$howmanypieces-2]== 'deep-fryer' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'deep fryer'; $methodurl = 'deep-fryer/'; } if ($pieces[$howmanypieces-2]== 'electric-skillet-wok' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'electric skillet/wok'; $methodurl = 'electric-skillet-wok/'; } if ($pieces[$howmanypieces-2]== 'crockpot' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'crockpot'; $methodurl = 'crockpot/'; } if ($pieces[$howmanypieces-2]== 'pressure-cooker' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'pressure cooker'; $methodurl = 'pressure-cooker/'; } if ($pieces[$howmanypieces-2]== 'roaster-oven' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'roaster oven'; $methodurl = 'roaster-oven/'; } if ($pieces[$howmanypieces-2]== 'waffle-maker' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'waffle maker'; $methodurl = 'waffle-maker/'; } if ($pieces[$howmanypieces-2]== 'microwave' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'microwave'; $methodurl = 'microwave/'; } if ($pieces[$howmanypieces-2]== 'bread-machine' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'bread machine'; $methodurl = 'bread-machine/'; } if ($pieces[$howmanypieces-2]== 'dehydrator' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'dehydrator'; $methodurl = 'dehydrator/'; } if ($pieces[$howmanypieces-2]== 'smoker' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'smoker'; $methodurl = 'smoker/'; } if ($pieces[$howmanypieces-2]== 'campfire' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'campfire'; $methodurl = 'campfire/'; } if ($pieces[$howmanypieces-2]== 'convection-oven' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'convection oven'; $methodurl = 'convection-oven/'; } if ($pieces[$howmanypieces-2]== 'sandwich-maker' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'sandwich maker'; $methodurl = 'sandwich-maker/'; } if ($pieces[$howmanypieces-2]== 'rice-cooker-steamer' && !stristr($pieces[2], 'cooking-method')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $methodflag = 'rice cooker/steamer'; $methodurl = 'rice-cooker-steamer/'; } */ /* Calorie Counts */ /* if ($pieces[$howmanypieces-2]== 'under-100-calories'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $nutriflag = '100'; $nutriurl = 'under-100-calories/'; } if ($pieces[$howmanypieces-2]== '100-200-calories'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $nutriflag = '200'; $nutriurl = '100-200-calories/'; } if ($pieces[$howmanypieces-2]== '200-300-calories'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $nutriflag = '300'; $nutriurl = '200-300-calories/'; } if ($pieces[$howmanypieces-2]== '300-400-calories'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $nutriflag = '400'; $nutriurl = '300-400-calories/'; } if ($pieces[$howmanypieces-2]== '400-500-calories'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $nutriflag = '500'; $nutriurl = '400-500-calories/'; } if ($pieces[$howmanypieces-2]== 'over-500-calories'){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $nutriflag = '1000'; $nutriurl = 'over-500-calories/'; } if ($pieces[$howmanypieces-2]== 'low-carb' && !stristr($pieces[2], 'healthy-diet')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $nutriflag = 'low carb'; $nutriurl = 'low-carb/'; } if ($pieces[$howmanypieces-2]== 'low-fat' && !stristr($pieces[2], 'healthy-diet')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $nutriflag = 'low fat'; $nutriurl = 'low-fat/'; } if ($pieces[$howmanypieces-2]== 'low-sodium' && !stristr($pieces[2], 'healthy-diet')){ $getcats = str_replace($pieces[$howmanypieces-2].'/','',$getcats); $nutriflag = 'low sodium'; $nutriurl = 'low-sodium/'; } */ if (stristr($pieces[$howmanypieces-1], 'menu')){ $getcats = str_replace($pieces[$howmanypieces-1],'',$getcats); $whatpage=str_replace('menu','',$pieces[$howmanypieces-1]); $page=str_replace('.html','',$whatpage); if ($page && !is_numeric($page)){ $to = 'valerie@cdkitchen.com'; $from = 'onlynew@cdkitchen.com'; $subject = '404 in redirect isnt numeric'; $useragent = $_SERVER['HTTP_USER_AGENT']; $foundme = $_SERVER['HTTP_REFERER']; $domain = $_SERVER['REMOTE_ADDR']; $message = "$useragent found me by $foundme using ip $domain"; $message .= "getcats:$getcats zcat: $zcat"; //mail($to,$subject,$message,"From: {$from}", "-f$from"); @header("HTTP/1.0 404 Not Found"); @include '/home/chilidog/public_html/start.php'; exit; } $menu=1; } /* if (stristr($getcats,'/recipes/cooking-method/crockpot/cat/')){ $stripme=str_replace('/recipes/cooking-method/crockpot/cat/','',$getcats); $stripme=str_replace('/','',$stripme); $queryd11 = 'SELECT cdk__categories_new.urlpath as urlpath from cdk__categories_new,cdk__categories_lookup where cdk__categories_lookup.oldcat='.$stripme.' and cdk__categories_new.cat=cdk__categories_lookup.crockerykitchen limit 1'; $resultd11 = @mysql_query($queryd11); while($rowd11 = @mysql_fetch_array($resultd11)) { $aurlpath = $rowd11['urlpath']; } if (strlen($aurlpath) > 2){ $getcats = $aurlpath; }else{ $getcats = '/recipes/cooking-method/crockpot/'; } $to = 'valerie@cdkitchen.com'; $from = 'onlynew@cdkitchen.com'; $subject = $aurlpath.' not zcat what'; $message = "getcats:$getcats zcat: $zcat"; mail($to,$subject,$message,"From: {$from}", "-f$from"); header ('HTTP/1.1 301 Moved Permanently'); header ('Location: http://www.cdkitchen.com'.$getcats.''); exit; } */ function findthecat($getcats) { $cservememcache = @new Memcache; @include "/home/chilidog/public_html/mcacheconn.php"; if (!@$cservememcache->connect("$datacip", $datacport)) { @$cservememcache->connect("$datacip", $datacport); } $cservesetname = 'bwhatcatisit-'.$getcats; $cserve = @$cservememcache->get($cservesetname); if (!$cserve) { $result_1 = @mysql_query('select cat from cdk__categories_new where BINARY urlpath="'.mysql_real_escape_string($getcats).'" limit 1'); while($row_1 = mysql_fetch_array($result_1)){ $zcat = $row_1[cat]; } $cserve = $zcat; @$cservememcache->set($cservesetname, $cserve, false, 604800); //save it for 60 seconds, uncompressed } return $cserve; } $zcat =findthecat($getcats); if ($zcat==261){ @header ('HTTP/1.1 301 Moved Permanently'); @header ('Location: https://www.cdkitchen.com/recipes/'); exit; } if (!$zcat) { $to = 'valerie@cdkitchen.com'; $from = 'onlynew@cdkitchen.com'; $subject = 'not zcat what'; //$useragent = $_SERVER['HTTP_USER_AGENT']; //$foundme = $_SERVER['HTTP_REFERER']; //$domain = $_SERVER['REMOTE_ADDR']; $message = "$useragent found me by $foundme using ip $domain"; $message .= "getcats:$getcats zcat: $zcat"; //mail($to,$subject,$message,"From: {$from}", "-f$from"); @header("HTTP/1.0 410 Not Found"); @include '/home/chilidog/public_html/start.php'; exit; } @include '/home/chilidog/public_html/recipes/index.html'; //@include '/home/chilidog/public_html/recipes/category2016.php'; }else{ $to = 'valerie@cdkitchen.com'; $from = 'onlynew@cdkitchen.com'; $subject = 'all else not zcat what'; $useragent = $_SERVER['HTTP_USER_AGENT']; $foundme = $_SERVER['HTTP_REFERER']; $domain = $_SERVER['REMOTE_ADDR']; $message = "$useragent found me by $foundme using ip $domain"; $message .= "getcats:$getcats zcat: $zcat"; //mail($to,$subject,$message,"From: {$from}", "-f$from"); @header("HTTP/1.0 410 Not Found"); @include '/home/chilidog/public_html/start.php'; exit; } ?>