'; $sql="SELECT l.fob_id, l.merchant_id, l.fob_nm, s.width_no, s.height_no, s.align_cd, l.img_url, l.link_url, l.tag_url, l.display_txt, l.html, date_format(l.end_dt,'%m/%e/%Y') end_dt, info_tag, l.weight, l.cj_id FROM FOB_Listing l LEFT JOIN Ad_Size s ON l.size_id = s.size_id WHERE l.category_id = $category_id and l.active_yn = 'Y' and l.start_dt <= curdate() and l.end_dt >= now() and l.size_id = s.size_id ORDER BY l.weight DESC"; echo '

Random Coupons

'; if ($result=mysql_query($sql)) { while ($row=mysql_fetch_row($result)) { list($fob_id, $merchant_id, $fob_nm, $width_no, $height_no, $align_cd, $img_url, $link_url, $tag_url, $display_txt, $html, $end_dt, $info_tag, $weight, $cj_id, $can_id, $store_nm) = $row; $endStr = ($end_dt=="" or substr($end_dt,0,2) == '00')? '' : ' [ends '.$end_dt.']'; $endStr .= ($weight==1)? "\n" : "

\n"; $infoTag =($info_tag==1) ? $ipTag : ''; if ($weight == 1) { if ($mainSection) { $mainSection = false; echo "

Text Ads

\n\n"; echo $tags; } if ($can_id > 0) { list($merchant_id, $sod, $store_nm, $top_ad, $txt) = sqlRow('SELECT merchant_id, sod_dt, store_nm, top_ad, html_txt FROM Golden_Can WHERE can_id = '.$can_id); $titleStr = $store_nm; } else { $store_nm = 'Explore Stores'; $merchant_id = 0; $sod = '0000-00-00'; $titleStr = 'select online stores.'; } fobHead(2, 'Browse Stores', 'A Fountain of Bargains - '.$store_nm, 'Quickly browse the inventory of '.$titleStr, 'shop online',false, true); //echo showBlob($blob_id); //listCat($category_id); if($can_id > 0) { if ($top_ad != '') echo '
'.$top_ad.'
'; echo '

'.$store_nm.'

'; echo '

'.$txt.'

'; // if ($merchant_id > 0) listMerCoup($merchant_id); } elseif ($gccDisp == 1){ echo '

Popular Store Coupons

This page shows a complete list of active online coupons and sales from the select stores listed below followed by a random listing of sales from all over the Internet. You can find more great internet deals on the sales page and deal of the day steals on the loss leader page.

'; } else { echo '

Popular Internet Stores

This program lets you browse and search the invetory of select stores affiliated with the Community Color directory project. Click on the item to purchase from the store. Proceeds from sales benefite the Community Color project.

'; } $SID="cbc3923c-fb44-4d0d-aebb-97fe39c6b9e7"; $IPAddress = urlencode($_SERVER['REMOTE_ADDR']); $UserAgent = urlencode($_SERVER['HTTP_USER_AGENT']); $Host=urlencode($_SERVER['HTTP_HOST']); $PageURL=urlencode($_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING']); $URL="http://si.goldencan.com/GetData.aspx?ver=2.0&SID=".$SID; $URL=$URL.'&Host='.$Host; $URL = $URL.'&PageURL='.$PageURL; $URL = $URL.'&IPAddress='.$IPAddress; $URL = $URL.'&UserAgent='.$UserAgent; // buffer the ids for the stores to make the linking easeir. if ($btn=='buff') { $str = @file_get_contents($URL); $lastPos = 1; while(($start=strpos($str,'gcsiteid',$lastPos)) !== false) { $start += 9; $lastPos = $start; $lenA = strpos($str,'&',$start) - $start; $gcid = ($lenA > 0)? substr($str,$start,$lenA) : 'error'; $startB = strpos($str,'gccid',$start); if ($startB > 0) { $startB +=6; $lenB = strpos($str,'"',$startB) - $startB; $gcCat = ($lenB > 0)? substr($str,$startB,$lenB) : 'errorB'; } echo '

ID '.$gcid.', cat '.$gcCat.'

'; execSQL('UPDATE Golden_Can SET cat_id = '.$gcCat.' WHERE can_id = '.$gcid,'',''); } } else { include($URL); } if ($can_id == 0) { showCoupons(); } if ($sod == '0000-00-00') { fobFoot('more shopping'); } else { fobFoot('more on '.$store_nm.''); } ?>