Added Tell-A-Friend v2.2 -> Added version list. -> Added ability to only allow purchasing customers to be affiliates. -> Added giveaway product functionality. -> Added affiliate emailing. -> Added a few bug fixes. v2.3 -> Added code for parsing PHP in templates. -> Updated code that decides who gets OTO sale. -> Major Security update tracks purchases by IP and only allows Completed payments to be redirected to the download page. -> Added ability to only allow OTO customers to get commissions on the OTO. -> Added ability to disable download emails from automatically being sent. -> Added support for all PayPal currencies. -> BUG FIX: Corrected 48 hour extension of download link to add 48 hours to THIS moment. -> Added script configure util (config.php) */ $sys_version = 2.3; include("settings.php"); function searchKeywords($url){ $parts = parse_url($url); $host = str_replace("www.", "", $parts["host"]); $keywords = ""; parse_str($parts["query"], $vars); if(strpos(" $host", "google")){ $keywords = urldecode($vars["q"]); } elseif(strpos(" $host", "yahoo")){ $keywords = urldecode($vars["p"]); } elseif(strpos(" $host", "live")){ $keywords = urldecode($vars["q"]); } elseif($vars["keywords"]){ $keywords = urldecode($vars["keywords"]); } elseif($vars["query"]){ $keywords = urldecode($vars["query"]); } else{ $keywords = urldecode($vars["q"]); } return $keywords; } function evalPHP($template){ # Make all settings.php variables accessible to template PHP code. global $sys_admin_username, $sys_admin_password, $sys_domain, $sys_support_address, $sys_script_folder, $sys_template_folder, $sys_default_email, $sys_item_name, $sys_item_number, $sys_item_cost, $sys_oto, $sys_oto_name, $sys_oto_number, $sys_oto_cost, $sys_oto_percent, $sys_item_cancel_url, $sys_expire_hours, $sys_blocked, $sys_secure_dl, $sys_tell_subject, $sys_tell_body, $sys_purchasers_only, $sys_purchasers_override, $sys_giveaway_product, $sys_oto_purchasers_only, $sys_oto_purchasers_override; # Eval all php code in a template and plug result into output. $output = ""; $last = 0; $i = strpos($template, "", $i); $phpcode = trim(str_replace(array(""), "", substr($template, $i, $i2 - $i))); $val = eval($phpcode); $output .= $val; $last = $i2 + 3; $i = strpos($template, "", $i); $phpcode = trim(str_replace(array(""), "", substr($output, $i, $i2 - $i))); $val = eval("return $phpcode;"); $output2 .= $val; $last = $i2 + 3; $i = strpos($output, " "; } elseif($_GET["tries"]<11){ # Give one minute for PayPal to post IPN record before giving up and showing an error. if(!isset($_GET["tries"])){ $tries = 1; } else{ $tries = $_GET["tries"] + 1; } $seconds = 60 - ($tries * 5); echo "

Waiting for PayPal confirmation of purchase, please wait...

$seconds seconds left...

(This page will refresh every 5 seconds until PayPal provides confirmation.)

"; } else{ # IP not found in records. Show error message. if(substr($sys_support_address, 0, 7)=="http://"){ $eaddress = $sys_support_address; } else{ $eaddress = "mailto:$sys_support_address"; } echo " Purchase record not found.

We apologize for the inconvenience, but there was a problem confirming your purchase. Please contact our technical support staff for your download link at:

$eaddress

Please paste a copy of your PayPal receipt into your message for verification.

NOTICE: If you paid with an eCheck or bank draft, the download link will be emailed to you automatically after the payment clears.

Click here to continue.

"; setcookie("first", 0, time()-3600, "/", "." . $sys_domain); } exit; } # Clear first cookie. setcookie("first", 0, time()-3600, "/", "." . $sys_domain); if(isset($_GET["e"])){ # Make sure this account hasn't been blocked. if(!strpos(" $sys_blocked", $_GET["e"])){ # Set cookie and redirect visitor if it's through an affiliate link. # Set privacy policy for IE6/WinXP users. # If you don't do this, a lot of IE browsers wont accept the cookie. header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"'); setcookie("aff", $_GET["e"], time()+31536000, "/", "." . $sys_domain); if($sys_purchasers_only){ if(strpos(strtolower(" $sys_purchasers_override"), strtolower($_GET["e"]))){ # Affiliate is in over-ride list. Let them sell. $sellit = true; } else{ # Verify that this paypal email address is in our ipn.txt $sellit = false; $sales = @file($sys_template_folder . "ipn.txt"); foreach($sales as $sale){ $sale = explode("|", $sale); if(strtolower($sale[4])==strtolower($_GET["e"])){ # They're a customer. $sellit = true; break; } } } } else{ # Let anybody sell the product. $sellit = true; } if($sellit){ if($_GET["taf"]){ header("Location: $sys_script_folder?taf=1"); } else{ header("Location: $sys_script_folder"); } } else{ # Show a message indicating that only people who bought can sell. showTemplate($sys_template_folder . "customersonly.html"); } exit; } else{ # Inform visitor that this customers link has been blocked # for fradulent activity. $filename = $sys_template_folder . "fraud.html"; showTemplate($filename); exit; } } # Keep paypal email on hand at all times. if(isset($_COOKIE["aff"])){ $email = $_COOKIE["aff"]; } else{ $email = $sys_default_email; } if($action==""){ # Save referrer. if(isset($_GET["taf"])){ setcookie("ref", "TELL-A-FRIEND", time()+31536000, "/", "." . $sys_domain); } else{ setcookie("ref", $_SERVER["HTTP_REFERER"], time()+31536000, "/", "." . $sys_domain); } # Show sales letter. $filename = $sys_template_folder . "salesletter.html"; # Set test cookie to make sure this will work for user. #setcookie("cookietest", true, time()+31536000, "/", "." . $sys_domain); } elseif($action=="giveaway"){ if($sys_giveaway_product){ # This is a giveaway product. Set cookies for squeeze page. setcookie("first", time(), time()+600, "/", "." . $sys_domain); setcookie("ordered", time(), time()+($sys_expire_hours * 3600), "/", "." . $sys_domain); setcookie("giveaway", time(), time()+($sys_expire_hours * 3600), "/", "." . $sys_domain); # Send them on. header("Location: index.php?action=squeeze"); exit; } } elseif($action=="order"){ # An order. Great! :) if(!$sys_currency){ # Default to USD. $sys_currency = "USD"; } # First, make sure cookies work for this user (since they are required). #if(isset($_COOKIE["cookietest"])){ if(1){ # Yup. Send them through the order process. if(isset($_GET["oto"])){ # Buying OTO. if(!isset($_COOKIE["aff"])){ # No affiliate. Use primary email address. $email = $sys_default_email; } else{ $checksale = true; if($sys_oto_purchasers_only){ $checksale = false; # Restrict OTO commissions to OTO purchasers only. $sale = getOTOSalesRecord($_COOKIE["aff"]); if(is_array($sale)){ # They are an OTO customer. $checksale = true; } } if($checksale){ # Use sales data to figure out who should get next OTO sale. $sales = @file($sys_template_folder . "ipn.txt"); $afftotal = 0; $affsales = 0; foreach($sales as $sale){ $sale = explode("|", $sale); if($sale[2] == $sys_oto_number && strtolower($sale[13]) == strtolower($_COOKIE["aff"])){ # OTO sale referred by affiliate. $afftotal++; if(strtolower($sale[3]) == strtolower($_COOKIE["aff"])){ # Affiliate got the OTO sale. $affsales++; } } } if($afftotal > 0){ $affper = $affsales / $afftotal; } else{ $affper = 0; } if($affper<=$sys_oto_percent){ # Give OTO to affiliate. $email = $_COOKIE["aff"]; } else{ # Give OTO to vendor. $email = $sys_default_email; } } else{ # Send payment to vendor. $email = $sys_default_email; } /* Old selection code. srand(); $r = rand(1, 100); if($r<=$sys_oto_percent){ # Send OTO to affiliate. $email = $_COOKIE["aff"]; } else{ # Use primary. $email = $sys_default_email; } */ } $item_name = $sys_oto_name; $item_number = $sys_oto_number; $item_cost = $sys_oto_cost; $item_download_url = "http://$sys_domain" . $sys_script_folder . "?action=downloadoto"; #$item_download_url = "http://$sys_domain" . $sys_script_folder; $item_cancel_url = $sys_item_cancel_url; $item_ipn_url = "http://$sys_domain" . $sys_script_folder . "ipn.php"; setcookie("oto", time(), time()+($sys_expire_hours * 3600), "/", "." . $sys_domain); } else{ # Regular purchase. $item_name = $sys_item_name; $item_number = $sys_item_number; $item_cost = $sys_item_cost; $item_download_url = "http://$sys_domain" . $sys_script_folder . "?action=squeeze"; #$item_download_url = "http://$sys_domain" . $sys_script_folder; $item_cancel_url = $sys_item_cancel_url; $item_ipn_url = "http://$sys_domain" . $sys_script_folder . "ipn.php"; } setcookie("first", time(), time()+600, "/", "." . $sys_domain); # Set ordered cookie. setcookie("ordered", time(), time()+($sys_expire_hours * 3600), "/", "." . $sys_domain); # Get customer IP address. $ip = $_SERVER["REMOTE_ADDR"]; # Use meta-refresh instead of header() redirect. # header() seems to cause session issues with PayPal. echo " Please wait...

You will be redirected to the PayPal checkout in 5 seconds.

Remember to click RETURN TO MERCHANT after checkout or you will not receive your download.

"; exit; } } elseif($action=="download" && isset($_REQUEST["id"])){ # Check that: 1) ID is valid and 2) download has not timed out. $id = $_REQUEST["id"]; $fh = @fopen($sys_template_folder . "ipn.txt", "r"); $invalid = true; $records = array(); $changes = false; while($rec = @fgets($fh)){ $rec = str_replace("\n", "", $rec); if(trim($rec)){ $record = explode("|", $rec); if($record[0]==$id){ $invalid = false; # Valid ID. Check timeout. if(time()<=$record[9]){ # Still active. Set cookies and show download. setcookie("ordered", time(), $record[9], "/", "." . $sys_domain); if($record[2]==$sys_oto_number){ # One-time offer download. Set cookie and show download. setcookie("oto", time(), $record[9], "/", "." . $sys_domain); $filename = $sys_template_folder . "downloadoto.html"; } else{ # Already squeezed, show download page. $filename = $sys_template_folder . "download.html"; } } else{ # Expired. $filename = $sys_template_folder . "downloadexpired.html"; } $rec = ""; for($i=0;$i0){ # Replace message vars. $subject = str_replace("[SENDER]", $sendername, $sys_tell_subject); $subject = str_replace("[PAYPAL]", $senderpaypal, $subject); $body = str_replace("[SENDER]", $sendername, $sys_tell_body); $body = str_replace("[PAYPAL]", $senderpaypal, $body); $headers = "From: $sendername<$senderpaypal> X-Sender: $sendername<$senderpaypal> X-Mailer: PHP " . phpversion() . " X-Priority: 3 Return-Path: $sendername<$senderpaypal> Reply-To: $sendername<$senderpaypal>"; # Read number of tell-a-friend mails sent to date. $tafcount = @file_get_contents($sys_template_folder . "tellafriend.txt"); if(!$tafcount){ $tafcount = 0; } # Send the message. foreach($emails as $email){ if($email){ @mail($email, $subject, $body, $headers); $tafcount++; } } # Write new count. $fh = @fopen($sys_template_folder . "tellafriend.txt", "w+"); @fwrite($fh, $tafcount); @fclose($fh); # Thanks! echo "Thanks! A message has been sent to the people you entered into the form."; exit; } else{ # Mail can only be sent from this domain. echo "Mail can only be sent from $sys_domain."; exit; } } else{ echo "Your name and PayPal email address are required."; exit; } } elseif($action=="remove"){ # Remove affiliate from email list. if($_REQUEST["email"]){ $fh = @fopen($sys_template_folder . "unsubs.txt", "a+"); @fwrite($fh, $_REQUEST["email"] . "\n"); @fclose($fh); echo "

You will no longer receive email from $sys_item_name.

"; exit; } } elseif($action=="downloadfile"){ # } # All other actions require that user has ordered and # cookie is set. If it's not, then it's expired. elseif(isset($_COOKIE["ordered"])){ # Kill "first" cookie if($action=="oto"){ # Show oto page. $filename = $sys_template_folder . "oto.html"; } elseif($action=="squeeze"){ $sale = getIPSalesRecord(); if(is_array($sale)|isset($_COOKIE["giveaway"])){ # Show name squeeze page. $filename = $sys_template_folder . "squeeze.html"; } else{ # Not safe, show expired. $filename = $sys_template_folder . "downloadexpired.html"; } } elseif($action=="download"){ $sale = getIPSalesRecord(); if(is_array($sale)|isset($_COOKIE["giveaway"])){ if($sys_oto && !isset($_GET["dl"])){ # Show OTO page. $filename = $sys_template_folder . "oto.html"; } else{ # Show download page. $filename = $sys_template_folder . "download.html"; } } else{ # Not safe, show expired. $filename = $sys_template_folder . "downloadexpired.html"; } } elseif($action=="downloadoto" && isset($_COOKIE["oto"])){ $sale = getIPSalesRecord(true); if(is_array($sale)){ # Show OTO download page. $filename = $sys_template_folder . "downloadoto.html"; } else{ # Invalid IP. $filename = $sys_template_folder . "downloadexpired.html"; } } elseif($action=="downloadoto"){ # Show expired since visitor doesn't have oto cookie. $filename = $sys_template_folder . "downloadexpired.html"; } else{ # Expired. $filename = $sys_template_folder . "downloadexpired.html"; } } elseif($action=="order" && !isset($_COOKIE["cookietest"])){ # No cookies. Show error. $filename = $sys_template_folder . "nocookies.html"; } elseif($action){ # Cookie's gone. Download has expired. $filename = $sys_template_folder . "downloadexpired.html"; } if($action=="admin"){ # Get username/password for admin area. echo "
Admin Login

username
password

"; exit; } elseif($action=="adminlogin"){ # Verify admin username/password. if($_POST["username"] == $sys_admin_username && $_POST["password"] == $sys_admin_password){ # Valid. Cookie and redirect. setcookie("admin", true); header("Location: $_SERVER[PHP_SELF]?action=adminmenu"); exit; } else{ echo "Invalid username or password."; exit; } } if($_COOKIE["admin"]){ $adminheader = "Admin Panel

$7 Secrets Scripts v$sys_version

"; $adminfooter = "
times square food times square food imagine biaggi s recipes tomato soup biaggi s recipes tomato soup life antipasto relish recipes antipasto relish recipes mean thai food eureka ca thai food eureka ca song yoghurt cheese recipes yoghurt cheese recipes type becks grove dinner theater becks grove dinner theater multiply book real american food loosemeat book real american food loosemeat morning recipe and beef wellington recipe and beef wellington stay messy bread recipe messy bread recipe common beach picnic food beach picnic food listen mgm character breakfast mgm character breakfast mass food intake in cats food intake in cats feed hawaii food imports hawaii food imports hold thai food speers road thai food speers road capital recipe chinese cherry sauce dip recipe chinese cherry sauce dip describe make iced tea recipe make iced tea recipe carry micro grill cooking guide micro grill cooking guide but biotec food biotec food clothe breaking news dog food breaking news dog food mine american home cooking one skillet meals american home cooking one skillet meals experience picture of some food pyramid picture of some food pyramid cut macrel recipe macrel recipe simple armour star sliced dried beef recipes armour star sliced dried beef recipes took grey goose cranberry recipe grey goose cranberry recipe center xyence energy drinks at gnc xyence energy drinks at gnc joy san diego food stamps san diego food stamps subject isomil baby food isomil baby food deal rapides parish school board lunch fees rapides parish school board lunch fees natural greek coffee recipes greek coffee recipes arrange food stamp requirements ohio food stamp requirements ohio thing teaspoon ground recipes chicken crock pot teaspoon ground recipes chicken crock pot count whole foods mill valley ca whole foods mill valley ca character fromm foods and order fromm foods and order village side effects to energy drinks side effects to energy drinks cold very old recipes very old recipes smile food service newspaper articials food service newspaper articials guide recipe hot artichoke and crab dip recipe hot artichoke and crab dip early christian seder meal recipes christian seder meal recipes look picnic games supplies picnic games supplies term food industries viscosity food industries viscosity substance una style pizza crust recipes una style pizza crust recipes depend recipe downsizing conversion calculator recipe downsizing conversion calculator those recipe for marinated sirloin tips recipe for marinated sirloin tips create carmel frosting recipe carmel frosting recipe art toad in the hole british recipes toad in the hole british recipes tone gift basket food gourmet gift basket food gourmet your jalopeno poppers recipes jalopeno poppers recipes stretch grilled vegetables recipe butter grilled vegetables recipe butter wonder the new orleans cooking experience the new orleans cooking experience experience a good friend recipe a good friend recipe many recipe for pineapple upside down cake recipe for pineapple upside down cake pay baked stuffed green peppers recipe baked stuffed green peppers recipe print birthday meal specials restaurants birthday meal specials restaurants sail guiness meatball recipe guiness meatball recipe life okalhoma food coop okalhoma food coop begin cooking oil nutrition cooking oil nutrition he food label for barbeque baked lays food label for barbeque baked lays possible lunch vocabulary in french lunch vocabulary in french finish waterfront bed and breakfast waterfront bed and breakfast which lavender spice culinary lavender spice culinary catch souther corn bake recipe souther corn bake recipe fear dog food northside ohio dog food northside ohio either mexican food wilmington de mexican food wilmington de particular the food netword the food netword less healthy snack bar recipe healthy snack bar recipe while winco foods april 1 2007 winco foods april 1 2007 degree native chicago foods native chicago foods red recipe for stuffed pork roast recipe for stuffed pork roast dear spagetti and meatball recipe spagetti and meatball recipe eye food license for sale food license for sale center cucumber and tomato salad recipes cucumber and tomato salad recipes bit lane countys food handlers test lane countys food handlers test is loma linda vegetarian foods loma linda vegetarian foods roll food banners food banners continue recipe for chocolate covered citrus peel recipe for chocolate covered citrus peel shall what is russian food what is russian food language recipes with chick peas recipes with chick peas inch oatbread recipe oatbread recipe there recipe for mayonnaise recipe for mayonnaise fraction dinner prep ahead dinner prep ahead also tofu recipe cilantro tofu recipe cilantro number waterfowl recipe waterfowl recipe than tom jerry batter recipe tom jerry batter recipe men plants and food chain plants and food chain human bill knapp recipe bill knapp recipe snow food shelf duluth mn food shelf duluth mn station holy land organic foods holy land organic foods case crock pot meals few ingredient crock pot meals few ingredient danger bread maker roll recipes bread maker roll recipes rope tiny dinner table tiny dinner table least thai food in santa monica thai food in santa monica pay praireland foods praireland foods east cooking spaghetti for 135 people cooking spaghetti for 135 people hurry goat cheese making recipe goat cheese making recipe finish sermione bed and breakfast sermione bed and breakfast ground recipe parmesan recipe parmesan noon beans enchilada vegetarian recipe beans enchilada vegetarian recipe market yang rou chuan recipe yang rou chuan recipe must brattleboro food coop brattleboro food coop fresh recipe for strawberry french toast recipe for strawberry french toast go school lunch law school lunch law determine recipe for holistic dog food recipe for holistic dog food do raw diet recipe raw diet recipe thought sloppy joe meat recipe sloppy joe meat recipe edge you can t beat cooking mama you can t beat cooking mama collect tempeh recipes tempeh recipes were reviews gourmet foods online reviews gourmet foods online pound information on alaskan food information on alaskan food hot yarmouth deluxe bed breakfast yarmouth deluxe bed breakfast own cooking vacations in perugia italy cooking vacations in perugia italy sail dean foods plans dean foods plans atom greek foods gyro greek foods gyro require mosaic tile food network mosaic tile food network whole about kudlers fine foods about kudlers fine foods were low fat bisquick recipes low fat bisquick recipes gray food network turkey dinners food network turkey dinners protect vegas largest drinks vegas largest drinks love vieux carre dinner plates vieux carre dinner plates track 1620 s food 1620 s food war sirloin roast recipes sirloin roast recipes gave food recipe easy recipe cookie recipe food recipe easy recipe cookie recipe distant filet mignon oven recipe filet mignon oven recipe separate eagle brand pasta recipe eagle brand pasta recipe law recipe for beef jerky recipe for beef jerky decimal organic dog food recipes organic dog food recipes shall food production by state food production by state require murder mystery dinner theater and maryland murder mystery dinner theater and maryland master health food and distributors health food and distributors our purine food percentages purine food percentages hope recipe for mcdonalds tarter sauce recipe for mcdonalds tarter sauce nor soldier recipie food soldier recipie food home wat a lunch wat a lunch evening pan fried rice noodle recipe pan fried rice noodle recipe eat chinese food seasonings chinese food seasonings particular food road tasted food road tasted law dumb boy recipe dumb boy recipe sell chicago green drinks chicago green drinks age chestnut with vegetables recipes chestnut with vegetables recipes light chocolate wet cake recipe chocolate wet cake recipe town beets fresh recipe beets fresh recipe fire chickpea pancake recipe chickpea pancake recipe nor putting salt into cooking pasta putting salt into cooking pasta catch ready made meals olympia washington ready made meals olympia washington large 3 bean chili recipe 3 bean chili recipe land keema recipes keema recipes colony outdoor dog food containers outdoor dog food containers stream b 12 energy drinks b 12 energy drinks be varnish recipe using super glue varnish recipe using super glue rail recipe of mexican food recipe of mexican food sight ktunaxa food ktunaxa food meet drinks to warm you up drinks to warm you up turn chicken garlic onion soup recipe chicken garlic onion soup recipe letter cooking sandhill crane cooking sandhill crane case osso bucca recipe osso bucca recipe shall smoked pork baby back ribs recipe smoked pork baby back ribs recipe master licorice candy recipe licorice candy recipe country hot toddy cheesecake recipe hot toddy cheesecake recipe she girl drinks horse girl drinks horse since recipe for wine sauce recipe for wine sauce smell cipollini onions recipe cipollini onions recipe area adams water ground style corn meal adams water ground style corn meal crowd indigestion before food indigestion before food before recipes that last for a week recipes that last for a week list roadhouse fruity drink recipes roadhouse fruity drink recipes caught cold hot wings recipe cold hot wings recipe matter new london dinner cruise new london dinner cruise station ky bulk foods ky bulk foods bring bannana pepper recipes bannana pepper recipes laugh three main nutrients in food three main nutrients in food dry foods with high protien content foods with high protien content do rare egg quiche recipe rare egg quiche recipe piece homemde wine recipes homemde wine recipes air oat scones recipe oat scones recipe shell diabetic carrot cake recipe diabetic carrot cake recipe look desserts recipes from san salvador desserts recipes from san salvador fall recipes roasts recipes roasts red mauger bed and breakfast mauger bed and breakfast share recipe souvlakia recipe souvlakia village digsy s dinner oasis digsy s dinner oasis engine cooking gov surplus food cooking gov surplus food broke alaska bear bed and breakfast alaska bear bed and breakfast tire bed breakfast omaha ne bed breakfast omaha ne such food allergin posters food allergin posters speech corsican foods corsican foods govern lima beans recipe lima beans recipe low culinary gift clubs culinary gift clubs heard culinary schools texas culinary schools texas hunt ability to digest food remove gallbladder ability to digest food remove gallbladder word a z foods alma ark a z foods alma ark atom buffallo chicken dip recipe buffallo chicken dip recipe girl italian pasta vegetable sauce recipe italian pasta vegetable sauce recipe dog who invented canned foods who invented canned foods garden fat free pie crust recipe fat free pie crust recipe cat pumpkin cookies recipe pumpkin cookies recipe opposite passion fruit recipe passion fruit recipe out ladybugs picnic ladybugs picnic thus natural skin recipes for ethnic skin natural skin recipes for ethnic skin yellow food distributors northwest usa food distributors northwest usa circle recipes for ricotta pie recipes for ricotta pie view cooking swai cooking swai sand homemade dog food recipe raw meat homemade dog food recipe raw meat than birdhouse gourd recipes birdhouse gourd recipes begin supplier for food grade ink supplier for food grade ink open renaissance food drink renaissance food drink wire bed and breakfast business negatives bed and breakfast business negatives silver recipes for mustard based bbq sauce recipes for mustard based bbq sauce bit for breakfast florida for breakfast florida flat buttermilk ingredients cooking buttermilk ingredients cooking once sweet buttermilk bread machine recipe sweet buttermilk bread machine recipe sharp cooking jobs in michigan cooking jobs in michigan hot missouri food stam programs outsourcing missouri food stam programs outsourcing rich honeygo rd food white marsh honeygo rd food white marsh rock recipe nancy s deli spirals recipe nancy s deli spirals base when dinner is hearty when dinner is hearty letter asian broccoli and mushrooms recipe asian broccoli and mushrooms recipe stay recipes with buffalo recipes with buffalo bone cooking fish in olive oil cooking fish in olive oil market castle cooking castle cooking from cooking supplies in tucker ga cooking supplies in tucker ga stop bed and breakfast san diego bed and breakfast san diego proper rhubarb strawberry jello pie recipe rhubarb strawberry jello pie recipe station food stamps in ga food stamps in ga shell grinding bologna in food processor grinding bologna in food processor like iron cast food grinder iron cast food grinder very recipe for cheese enchiladas recipe for cheese enchiladas air artichoke and spinach salad recipe artichoke and spinach salad recipe stone kid friendly easter food recipes kid friendly easter food recipes beauty waldorf lunch waldorf lunch sit recipe fava asperagus recipe fava asperagus boat food preservative phosphoric acid food preservative phosphoric acid kind foods with good carbs foods with good carbs behind food allergy nutrition food allergy nutrition vowel hard boiled egg recipe hard boiled egg recipe provide shredding and cooking shredding and cooking safe irish corned beef and cabbage recipes irish corned beef and cabbage recipes weather latinas and food latinas and food particular singing throat foods avoid drink singing throat foods avoid drink period amadou and mariam senegal fast food amadou and mariam senegal fast food nothing paloma blanca mexican food menu paloma blanca mexican food menu cloud filipino coconut recipe filipino coconut recipe quotient cheap drinks new orleans cheap drinks new orleans drink lean pork recipes lean pork recipes energy 10 inch pie recipe 10 inch pie recipe enter low fat turkey meatloaf recipe low fat turkey meatloaf recipe feel all american food festivals food tv all american food festivals food tv game dinner themes for a familyu dinner themes for a familyu ago easy hush puppy recipe easy hush puppy recipe crease dantech food systems dantech food systems glad barnett 395 premier food disposal barnett 395 premier food disposal share food processing center unl food processing center unl wire performance food group nj performance food group nj at birthday dinner recipe birthday dinner recipe captain redstone meadery recipe redstone meadery recipe compare homemade recipe for amaretto homemade recipe for amaretto follow recipe teething cracker recipe teething cracker began natural cholesterol lowering foods natural cholesterol lowering foods vowel recipe contest beans recipe contest beans map information on food labels information on food labels big turnip greens seasoning recipe vegaterian turnip greens seasoning recipe vegaterian substance stouffer s meals stouffer s meals certain king chicken recipe king chicken recipe spoke recipes with gummi worms recipes with gummi worms offer protein shake recipes with unflavored protein protein shake recipes with unflavored protein west pierogi filling recipes pierogi filling recipes captain grace prayers before meal grace prayers before meal should the supreme meal the supreme meal neck organic food distributors wb organic food distributors wb buy swiss chocolate souffle cake recipes swiss chocolate souffle cake recipes feed organic dog food gold organic dog food gold verb smithfield recipe smithfield recipe sight weekly cooking menu recipes weekly cooking menu recipes watch cooking time for fried chicken cooking time for fried chicken fast cinnamon bacon recipe cinnamon bacon recipe basic snow pudding and recipe snow pudding and recipe don't colorado food waste colorado food waste event sweet poached pears diabetic dessert recipe sweet poached pears diabetic dessert recipe space brown deli mustard recipe brown deli mustard recipe less bed breakfast gulfport fl bed breakfast gulfport fl excite gluten free peanut butter cookie recipe gluten free peanut butter cookie recipe sun phillo dough recipes coconut oil phillo dough recipes coconut oil yard coke cola soft drinks coke cola soft drinks gray effects of fast food 07 effects of fast food 07 though 2007 miss food city pageant 2007 miss food city pageant success recipe southwest chicken salad recipe southwest chicken salad could prison guys fucking food prison guys fucking food had recipes for beer cheese recipes for beer cheese clear food columus took food columus took machine foods with high saturated fats foods with high saturated fats life fawnskin bed and breakfast fawnskin bed and breakfast force burns cat and dog food burns cat and dog food begin add on breakfast bar add on breakfast bar cow cat treat recipe cat treat recipe grew lemon bars recipe barefoot contessa lemon bars recipe barefoot contessa so gourmet takeout food warren ri gourmet takeout food warren ri like isomil baby food isomil baby food produce maple recipes maple recipes plant cuisinart dlc x plus 20 cup food processor cuisinart dlc x plus 20 cup food processor force irish drinks reciptes irish drinks reciptes neck recipe for coconut shirmp sauce recipe for coconut shirmp sauce once 1906 food drug sulfonamides 1906 food drug sulfonamides heat german food baskets german food baskets poem reheat food safe reheat food safe ice chablis dill sauce recipe chablis dill sauce recipe use flank steak coke recipe flank steak coke recipe master recipe for ramaki recipe for ramaki guess whole wheat buttermilk waffle recipes whole wheat buttermilk waffle recipes mine easy boneless chicken recipe easy boneless chicken recipe ten stores accepting food stamps stores accepting food stamps wood emergency food security and nutrition assessment emergency food security and nutrition assessment quotient recipe plum jelly recipe plum jelly sea dairy queen smoothie recipe dairy queen smoothie recipe either creamy coleslaw secret recipe creamy coleslaw secret recipe whole overnight frnech toast breakfast casserole overnight frnech toast breakfast casserole much pacific west coast food pacific west coast food got green foods green foods vowel food science recruiters food science recruiters suggest recipe low carb pasta recipe low carb pasta take aromatherapy recipe white clay aromatherapy recipe white clay sister pork barbque recipe pork barbque recipe say adult insulated lunch bag adult insulated lunch bag meat leek and potato gratin recipes leek and potato gratin recipes effect recipe for popeyes biscuits recipe for popeyes biscuits hat souplantation tuna tarragon recipe souplantation tuna tarragon recipe seem italian lunch menu italian lunch menu love designer lunch bag designer lunch bag create peanut snack food manufacturers peanut snack food manufacturers magnet speckled gravy recipe speckled gravy recipe can food places near fountain valley food places near fountain valley dollar dinner prep ahead dinner prep ahead gun steamed clams recipes steamed clams recipes stand food recipes running with the bulls food recipes running with the bulls gave recipes with eagle bran milk recipes with eagle bran milk master northrop bed and breakfast northrop bed and breakfast proper food preservative phosphoric acid food preservative phosphoric acid character low fat slow cookers recipes low fat slow cookers recipes port food allergies in children food allergies in children lay health food health food healthy coffee health food health food healthy coffee gold eagle brand cookie recipes eagle brand cookie recipes give cabinet food warmers two door cabinet food warmers two door sugar barber food coupons barber food coupons pose recepies for cooking wild rabbit recepies for cooking wild rabbit piece chinese pork by recipe chinese pork by recipe travel fish odor cooking fish odor cooking dream easy chocolate pudding recipes easy chocolate pudding recipes solution casabella bed and breakfast st augustine casabella bed and breakfast st augustine through food cures of the bible food cures of the bible song hot bloody mary recipe hot bloody mary recipe state dog foods for loose stools dog foods for loose stools stand mill valley bed breakfast mill valley bed breakfast loud business lunch deduction business lunch deduction grass washngton apple recipe washngton apple recipe brought mexican garnishes corn meal mexican garnishes corn meal live recipes for lemon pecan cake recipes for lemon pecan cake oil food irradiation food irradiation remember spanish omlet recipe spanish omlet recipe fill peaches flambe recipe peaches flambe recipe molecule bed and breakfast in saratoga bed and breakfast in saratoga boat peekskille bed breakfast peekskille bed breakfast always spanish food clip art spanish food clip art second blue fin tuna recipes blue fin tuna recipes lady gigner ale drinks gigner ale drinks happy m d feline cat food m d feline cat food room dry apple recipe dry apple recipe bird cooking parsnip cooking parsnip vowel poisones food for dogs poisones food for dogs five great green bean recipes great green bean recipes turn spicy pepper chicken recipe spicy pepper chicken recipe mark light cheesecake recipe light cheesecake recipe ease chili recipes from cooking light magazine chili recipes from cooking light magazine check veal picata recipe veal picata recipe meet baked spaguetti recipe baked spaguetti recipe apple crockpot stuffing recipe crockpot stuffing recipe get recipes lentil patties recipes lentil patties job breaded and baked chicken parts recipes breaded and baked chicken parts recipes bar award winning lobster bisque recipe award winning lobster bisque recipe drink spinach fritata recipe spinach fritata recipe then bi lo foods bi lo foods up personalized food plates personalized food plates girl jewish blessings meals jewish blessings meals deep careers on culinary arts in virginia careers on culinary arts in virginia metal thai food delivered jacksonville florida thai food delivered jacksonville florida produce exotic food recipes exotic food recipes suffix shrimp jambalya recipe shrimp jambalya recipe bit coffee house drinks coffee house drinks ground technological innovations for organic foods technological innovations for organic foods begin ultimate roast chicken recipe ultimate roast chicken recipe mind seder meal in wheation illinois seder meal in wheation illinois box bed and breakfast s in sidney bc bed and breakfast s in sidney bc electric invite food plot southington ohio invite food plot southington ohio whose menu food petfood menu food petfood past food not to eat before sleep food not to eat before sleep dad recipe for peanut butter icing recipe for peanut butter icing lead scotcheroos recipe scotcheroos recipe care liquid smook recipes liquid smook recipes bright recipe pie cream of coconut recipe pie cream of coconut ran recipe master cleanse recipe master cleanse moon usda grab and go breakfast usda grab and go breakfast salt peaches flambe recipe peaches flambe recipe write clearwater foods nova scotia clearwater foods nova scotia born the shed vt burger recipe the shed vt burger recipe total agar agar dessert chinese recipe agar agar dessert chinese recipe speech low calorie food index low calorie food index edge recipes red wine soups recipes red wine soups tall texas tea recipe texas tea recipe glass recipes with couscous recipes with couscous famous gluten free birthday cake recipe gluten free birthday cake recipe pair smoked bbq recipes smoked bbq recipes science singapore food wine festivals shows events singapore food wine festivals shows events salt recipes for blufish recipes for blufish strong chocolate coconut squares recipe chocolate coconut squares recipe circle subway teriyaki chicken recipe subway teriyaki chicken recipe free pete dionne cooking winterhaven florida pete dionne cooking winterhaven florida arrive food in cambodia food in cambodia yes brunch casseroles recipes brunch casseroles recipes ever gluten free food kids gluten free food kids effect big 8 food store big 8 food store gold hogmany meal hogmany meal condition generic baby food generic baby food case southern university symposium food southern university symposium food rise harraseeket lunch south freeport harraseeket lunch south freeport save chicken sausage recipes chicken sausage recipes art bed and breakfast lewes delaware bed and breakfast lewes delaware enough korean food erie pa korean food erie pa ask health food stores in northridge ca health food stores in northridge ca began busetto busetto foods busetto busetto foods self bed and breakfast strathfillan bed and breakfast strathfillan lie simple ukraine food simple ukraine food here hooded warbler food hooded warbler food fine samjin agriculture and food enterprise samjin agriculture and food enterprise thing green bean recipe bouillon green bean recipe bouillon keep cream of carrot soup recipes cream of carrot soup recipes toward mediterrenean diet recipes mediterrenean diet recipes fell low fat crabcake recipe low fat crabcake recipe grand american home cooking american home cooking several recipe for valentine cookies recipe for valentine cookies block list of contamiated iams cat food list of contamiated iams cat food reason cooking industrial cooking industrial stretch pumpkin cake roll recipe pumpkin cake roll recipe neck gourmey bean soup recipe gourmey bean soup recipe are poisoned cat and dog food poisoned cat and dog food door breaded and baked chicken parts recipes breaded and baked chicken parts recipes land food blues food blues speak
"; # Admin functions. if($action=="adminmenu"){ # Get tell-a-friend count. $taf = @file_get_contents($sys_template_folder . "tellafriend.txt"); if(!$taf){ $taf = 0; } echo " $adminheader

Admin Panel

  1. Show All Sales
  2. Show Last 50 Sales
  3. Show Last 100 Sales
  4. Show My Sales
  5. Referrer Report
  6. Referrer Domains Report
  7. My Sales Referrer Report
  8. My Sales Referrer Domains Report
  9. Affiliates Report
  10. Email Affiliates
  11. Export Purchases to CSV
  12. Logout

$taf people have been emailed using the tell-a-friend script.

$adminfooter "; exit; } elseif($action=="adminbuys"|$action=="adminmine"){ # Show all customers. $records = @file($sys_template_folder . "ipn.txt"); $count = 0; $count = $_REQUEST["count"]; if($records){ $rcount = count($records); } else{ $rcount = 0; $records = array(); } if($count){ $showing = "last $count"; } else{ $showing = "all $rcount"; } if($action=="adminmine"){ $showing = "only sales paid to you"; } echo " $adminheader Back to Menu

Clicking the EXPIRES link will add another $sys_expire_hours hours to the customer's download link expiration.

$rcount total records. Showing $showing. Your sales are highlighted. "; $bgcolor = "#ffffff"; $c = $rcount; foreach($records as $rec){ $c--; if(!$count | $c<=$count){ $rec = str_replace("\n", "", $rec); if(trim($rec)){ $record = explode("|", $rec); $date = ""; if($record[11]){ $date = date("Y-m-d H:i:s", $record[11]); } $expires = date("Y-m-d H:i:s", $record[9]); if($record[3]==$sys_default_email){ # Our sale. Yay! :) $bgcolor = "#ffffcc"; } $show = true; if($action=="adminmine"){ if($record[3]!=$sys_default_email){ $show = false; } } if($show){ echo " "; } if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else{ $bgcolor = "#ffffff"; } } } } echo "
PayPal Receipt ID Item Number Affiliate Email Customer Email First Name Last Name Payment Bought Expires
$record[0] $record[2] $record[3] $record[4] $record[5] $record[6] $record[8] $date $expires
$adminfooter"; exit; } elseif($action=="adminexport"){ # Export purchase records to CSV. $first = true; header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=export.csv"); header("Content-Transfer-Encoding: binary"); $records = @file($sys_template_folder . "ipn.txt"); if($records){ foreach($records as $rec){ $rec = str_replace("\n", "", $rec); if(trim($rec)){ if($first){ # Output headers. echo '"PayPal Receipt ID","Item Name","Item Number","Affiliate Email","Customer Email","First Name","Last Name","Company","Payment","Bought","Expires"' . "\r\n"; $first = false; } $record = explode("|", $rec); $date = ""; if($record[11]){ $date = date("Y-m-d H:i:s", $record[11]); } $expires = date("Y-m-d H:i:s", $record[9]); echo "\"$record[0]\",\"$record[1]\",\"$record[2]\",\"$record[3]\",\"$record[4]\",\"$record[5]\",\"$record[6]\",\"$record[7]\",\"$record[8]\",\"$date\",\"$expires\"\r\n"; } } } exit; } elseif($action=="adminrefs"|$action=="adminrefsmine"){ # Show referrer report. $records = @file($sys_template_folder . "ipn.txt"); $count = 0; $count = $_REQUEST["count"]; if($records){ $rcount = count($records); } else{ $rcount = 0; $records = array(); } if($count){ $showing = "last $count"; } else{ $showing = "all $rcount"; } if($action=="adminrefsmine"){ $showing = "only sales paid to you"; } echo " $adminheader Back to Menu

$rcount total records. Showing $showing. Your sales are highlighted. "; $bgcolor = "#ffffff"; $c = $rcount; $refs = array(); foreach($records as $rec){ $c--; if(!$count | $c<=$count){ $rec = str_replace("\n", "", $rec); if(trim($rec)){ $record = explode("|", $rec); $date = ""; if($record[11]){ $date = date("Y-m-d H:i:s", $record[11]); } $expires = date("Y-m-d H:i:s", $record[9]); if($record[3]==$sys_default_email){ # Our sale. Yay! :) $bgcolor = "#ffffcc"; } $show = true; if($action=="adminrefsmine"){ if($record[3]!=$sys_default_email){ $show = false; } } if($show){ if(strlen($record[12])>100){ $ref = substr($record[12], 0, 98) . ".."; } else{ $ref = $record[12]; } if(isset($refs[$record[12]])){ $refs[$record[12]]++; } else{ $refs[$record[12]]=1; } } } } } arsort($refs); foreach($refs as $ref => $sales){ $parts = parse_url($ref); $host = str_replace("www.", "", $parts["host"]); $keywords = searchKeywords($ref); if(strlen($ref)>100){ $sref = substr($ref, 0, 98) . ".."; } else{ $sref = $ref; } echo " "; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else{ $bgcolor = "#ffffff"; } } echo "
Referrer Domain Keywords Sales
$sref $host $keywords $sales
$adminfooter"; exit; } elseif($action=="adminrefdomains"|$action=="adminrefdomainsmine"){ # Show referrer report. $records = @file($sys_template_folder . "ipn.txt"); $count = 0; $count = $_REQUEST["count"]; if($records){ $rcount = count($records); } else{ $rcount = 0; $records = array(); } if($count){ $showing = "last $count"; } else{ $showing = "all $rcount"; } if($action=="adminrefdomainsmine"){ $showing = "only sales paid to you"; } echo " $adminheader Back to Menu

$rcount total records. Showing $showing. Your sales are highlighted. "; $bgcolor = "#ffffff"; $c = $rcount; $refs = array(); foreach($records as $rec){ $c--; if(!$count | $c<=$count){ $rec = str_replace("\n", "", $rec); if(trim($rec)){ $record = explode("|", $rec); $date = ""; if($record[11]){ $date = date("Y-m-d H:i:s", $record[11]); } $expires = date("Y-m-d H:i:s", $record[9]); if($record[3]==$sys_default_email){ # Our sale. Yay! :) $bgcolor = "#ffffcc"; } $show = true; if($action=="adminrefdomainsmine"){ if($record[3]!=$sys_default_email){ $show = false; } } if($show){ $parts = parse_url($record[12]); $host = str_replace("www.", "", $parts["host"]); if(isset($refs[$host])){ $refs[$host]++; } else{ $refs[$host]=1; } } } } } arsort($refs); foreach($refs as $ref => $sales){ echo " "; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else{ $bgcolor = "#ffffff"; } } echo "
Domain Sales
$ref $sales
$adminfooter"; exit; } elseif($action=="adminaffiliates"){ # Show referrer report. $records = @file($sys_template_folder . "ipn.txt"); $count = 0; $count = $_REQUEST["count"]; if($records){ $rcount = count($records); } else{ $rcount = 0; $records = array(); } if($count){ $showing = "last $count"; } else{ $showing = "all $rcount"; } echo " $adminheader Back to Menu

$rcount total records. Showing $showing. Your sales are highlighted. "; $bgcolor = "#ffffff"; $c = $rcount; $refs = array(); foreach($records as $rec){ $c--; if(!$count | $c<=$count){ $rec = str_replace("\n", "", $rec); if(trim($rec)){ $record = explode("|", $rec); $date = ""; if($record[11]){ $date = date("Y-m-d H:i:s", $record[11]); } $expires = date("Y-m-d H:i:s", $record[9]); if($record[3]==$sys_default_email){ # Our sale. Yay! :) $bgcolor = "#ffffcc"; } if(isset($refs[$record[3]])){ $refs[$record[3]]++; } else{ $refs[$record[3]]=1; } } } } arsort($refs); foreach($refs as $ref => $sales){ echo " "; if($bgcolor=="#ffffff"){ $bgcolor = "#eeeeee"; } else{ $bgcolor = "#ffffff"; } } echo "
Affiliate Sales
$ref $sales
$adminfooter"; exit; } elseif($action=="adminextend"){ # Extend duration of purchase download link. $id = $_REQUEST["id"]; $records = @file($sys_template_folder . "ipn.txt"); $recs = array(); if($records){ foreach($records as $rec){ $rec = str_replace("\n", "", $rec); if(trim($rec)){ $record = explode("|", $rec); if($record[0]==$id){ # Extend this record. $changes = true; $record[9] = time() + (3600 * $sys_expire_hours); $rec = ""; for($i=0;$iBack to Menu

Link expiration has been extended by $sys_expire_hours hours.

Give customer this link to download:

http://$sys_domain" . $sys_script_folder . "?action=download&id=$id

$adminfooter "; } else{ echo " Back to Menu

No matching purchase record found.

"; } exit; } elseif($action=="adminemailaffiliates"){ # Show affiliate mailer form. echo " $adminheader Back to Menu

Email Subject:

Email Body:

Only send to affiliates with at least sales.

$adminfooter "; exit; } elseif($action=="adminemailaffiliates2"){ # Send a mailer to all affiliates who aren't unsubed. # -- First read unsub file. $unsubs = @file($sys_template_folder . "unsubs.txt"); if(!is_array($unsubs)){ # No unsubs. $removed = array(); } else{ $removed = array(); foreach($unsubs as $aff){ $aff = str_replace(array("\r", "\n"), "", $aff); $removed[$aff] = true; } } # Read IPN file and get unique affiliates. $affiliates = array(); $sales = @file($sys_template_folder . "ipn.txt"); foreach($sales as $sale){ $sale = explode("|", $sale); if(!isset($affiliates[$sale[3]])){ $affiliates[$sale[3]] = 1; } else{ $affiliates[$sale[3]]++; } } if(substr($sys_support_address, 0, 7)=="http://"){ $eaddress = "noreply@$sys_domain"; } else{ $eaddress = $sys_support_address; } $headers = "From: $sys_item_name<$eaddress> X-Sender: $sys_item_name<$eaddress> X-Mailer: PHP " . phpversion() . " X-Priority: 3 Return-Path: $sys_item_name<$eaddress> Reply-To: $sys_item_name<$eaddress>"; $affs = array(); $esubject = $_POST["esubject"]; $ebody = stripslashes($_POST["ebody"]); $ebody .= "\n===\nTo stop receiving emails from $sys_item_name, click this link:\nhttp://$sys_domain" . $sys_script_folder . "?action=remove&email=[EMAIL]"; foreach($affiliates as $aff => $sales){ if(!$removed[$aff] && $sales >= $_POST["esales"]){ $affs[] = $aff; } } echo " $adminheader

    Sending " . count($affs) . " emails...

    "; foreach($affs as $aff){ # Send the mailer. $sendbody = str_replace("[EMAIL]", $aff, $ebody); @mail($aff, $esubject, $sendbody, $headers); echo "
  1. $aff ..
    "; flush(); } echo " $adminfooter
Back to Menu "; exit; } elseif($action=="adminlogout"){ # Logout. setcookie("admin", "", time() - 3600); header("Location: $_SERVER[PHP_SELF]"); exit; } } # If we made it here, this needs to be cleared. setcookie("first", 0, time()-3600, "/", "." . $sys_domain); if($filename){ # Show appropriate page. showTemplate($filename); } else{ # Odd. echo " There was a problem processing your request. Please send the following information in a ticket to AskJonLeger.com:

af:$_COOKIE[aff]
ct:$_COOKIE[cookietest]
or:$_COOKIE[ordered]
ot:$_COOKIE[oto]
ac:$action

"; } ?>