$RECIPESPERPAGE = 10; # Members of the StarChefs staff, who submit Star Chef recipes. # The attributions given by these people are taken to be gospel. # (e.g. a recipe that one of these people says is from, say, Mario # Batelli is not written as "attributed to Mario Batelli", but # as "By Mario Batelli" $ISSTAFF['starchefs@starchefs.com'] = 1; # Meal categories. These MUST correspond with the numbers used in the # database! # ---------------------- $mealcats[0] = 'Entrees'; $mealcats[1] = 'Side Dishes'; $mealcats[2] = 'Appetizers'; $mealcats[3] = 'Desserts'; $mealcats[4] = 'Breakfast/Brunch'; $mealcats[5] = 'Salads'; # ------------------------------------------------------------------- # You should not need to edit below this line. # ------------------------------------------------------------------- $SHOWEDCHEFRECIPES = 0; # By default, we haven't shown any # chef-submitted recipes. $CONNECTED = 0; # By default, we are not connected to Oracle. # Main code global $PRINTFRIENDLY; $ili = isLoggedIn(); $ispaid = isPaidUp(); $rid = GetGlobal('id'); $infuture = 0; $inpast = 0; $uid = getUserID(); $beforepaid = 0; if ($rid != '') { $scidres = DoQuery("select starchefid from sweepstakes where id = $rid", 'qmsearch.php'); $scid = $scidres[0][0]; if (($scid > 0)) if (!isYearly()) if ($ispaid == 1) { # User paid $sql = "select count(*) from sweepstakes, mrb_users where sweepstakes.id = $rid and mrb_users.userid = $uid and floor((sweepstakes.ROTDDATE - to_date('07-JAN-1980')) / 7) < floor((mrb_users.signup - to_date('07-JAN-1980')) / 7) "; $tmpres = DoQuery($sql, 'qmsearch.php'); if ($tmpres[0][0] > 0) { $beforepaid = 1; } } else { # User not paid $tmpres = DoQuery("select count(*) from sweepstakes where id = $rid and (rotddate > sysdate)", 'qmsearch.php'); if ($tmpres[0][0] > 0) { $infuture = 1; } else { $currlocaltime = localtime(time(), 1); $currm = $currlocaltime[tm_mon] + 1; $currd = $currlocaltime[tm_mday]; $curry = $currlocaltime[tm_year] + 1900; # EXTRA SPICY curry! $curroradate = returnOraDate($currm, $currd, $curry); $tmpres = DoQuery("select count(*) from sweepstakes where id = $rid and (rotddate = '${curroradate}')", 'qmsearch.php'); if ($tmpres[0][0] < 1) { # Not today (and not in the future); hence in the past $inpast = 1; } } } } if ( (($ispaid == 0) && (($infuture == 1) || ($inpast == 1)) && ($scid > 0)) || (($ispaid == 1) && ($beforepaid == 1) && ($scid > 0)) ) { if ($infuture == 1) { print "..."; global $PARAMS; print ""; print ' '; } else { # This is a past recipe, or it's before the user paid. print "..."; global $PARAMS; print ""; print ' '; } } else { StartPageOld('Search Recipes'); if ($PRINTFRIENDLY != 1) { print ''; print 'SEARCH for RECIPES

'; print ''; print " "; print ''; CatLink('', 'SHOW ALL'); for ($cl = 0; $cl < count($mealcats); $cl++) { CatLink(${cl}, $mealcats[$cl]); } print ''; print '
'; TipBox('pennant.gif', '', 'Like our QuickMeals recipes? Want to build your own virtual "recipe box" of them? Visit myRecipeBox!'); print ''; } $recipeid = GetGlobal('id'); if ($recipeid < 1) { # RECIPE ID NOT SPECIFIED $addtobox = GetGlobal('addtobox'); if ($addtobox == 1) { print '


'; print '
'; print 'To add a recipe from StarChefs QuickMeals to your myRecipeBox, first locate a recipe you wish to add, then click "Add to myRecipeBox" next to the recipe.

You will be given the opportunity to choose which folder to place it in.

Once a recipe is in your myRecipeBox, you can edit it.'; print '


'; //print "[Take me to the recipes!]"; print '
'; } } else { # Display one specific / individual recipe. $uid = GetUserID(); $islocal = isLocalRequest(); isPaidUp(); if ($islocal != 1) { # If this is NOT a local request... $print = GetGlobal('print'); if ($print == 1) { $insquery = "insert into mrb_stats_prints (userid, recipeid, printdate) VALUES ($uid, $recipeid, sysdate)"; } else { $insquery = "insert into mrb_stats_views (userid, recipeid, viewdate) VALUES ($uid, $recipeid, sysdate)"; } DoInsert($insquery, 'qmsearch.php'); } $tmpres = DoQuery("select recipeid, foldername from mrb_folders where userid = $uid", 'qmsearch.php'); for ($sr = 0; $sr < count($tmpres); $sr++) { $rid = $tmpres[$sr][0]; $fn = $tmpres[$sr][1]; $foldered[$rid] = 1; $containingfolder[$rid] = $fn; } global $foldered; global $containingfolder; $offset = GetGlobal('offset'); $category = GetGlobal('category'); global $PARAMS; $linktomain = "${BASEPATH}/qmsearch.php?${PARAMS}"; if ($offset != '') { $theseparams = "offset=${offset}"; } else { $theseparams = ''; } if ($category != '') { if ($theseparams != '') { $theseparams .= '&'; } $theseparams .= "category=${category}"; } if ($theseparams != '') { $theseparams = "&${theseparams}"; } $linktomain .= $theseparams; if ($PRINTFRIENDLY != 1) { print "
"; print "[BACK TO SEARCH MAIN]

"; print "
"; } $recipeid = intval($recipeid); $tmpres = DoQuery("select title, id, c_date, author, name, ingredients, instructions, email from sweepstakes where title like '%_%' and id = $recipeid", 'main'); $thistitle = trim(ucwordsbetter(strtolower($tmpres[0][0]))); $thisid = trim(intval($tmpres[0][1])); $thisdate = trim($tmpres[0][2]); $tmpauthor = trim(ucwordsbetter(strtolower($tmpres[0][3]))); $tmpsubmitter = trim(ucwordsbetter(strtolower($tmpres[0][4]))); $thisingredients = InsertSpecialChars(trim($tmpres[0][5])); $thisingredients = eregi_replace("
$", '', $thisingredients); $thisingredients = html_entity_decode($thisingredients); $thisingredients = eregi_replace("(
|\n)([^\*])([^:]+):(
|\n)", "\\2\\3\n"; if (!(eregi("