require_once 'conf.php'; require_once THISBASEDIR.'/lib-func/common.php'; require_once THISBASEDIR.'/lib-func/SiteData.php'; require_once THISBASEDIR.'/lib-func/mysqlConnector.php'; require_once THISBASEDIR.'/lib-func/LinkFormat.php'; require_once THISBASEDIR.'/lib-func/Pager.php'; require_once THISBASEDIR.'/lib-func/Form.php'; require_once THISBASEDIR.'/configuration/conf.php'; require_once THISBASEDIR.'/configuration/conf.php'; require_once THISBASEDIR.'/adsense-content.php'; /* print "
"; print_r($_GET); print ""; exit; */ $formObj = new Form($_GET); // initialize $dbObj = new MySQLConnector(array('host'=>HOST,'user'=>DBUSER,'password'=>DBPASS,'database'=>DBNAME)); $siteDataObj = new SiteData($dbObj); $stateDataArr = getStateArr($dbObj); $breedsdDataArr = getBreedsArr($dbObj); $dirLink = ""; /* RECORDING HITS LEGEND All classifieds breederID, breedID, classifiedID are NULL and pageType = classified By Breed breederID, stateID, classifiedID are NULL, breedID is numeric and pageType = classified By State breederID, breedID, classifiedID are NULL, stateID is numeric and pageType = classified Specific classified breedID and stateID is NULL, breederID and classifiedID are numeric and pageType = classified */ if(!isset($_GET['page']))$_GET['page'] = 1; if(isset($_GET['showall'])){ // show all classifieds $query = "SELECT classifieds.title, classifieds.dateAdded, classifieds.type, state.stateName, breeders.name, breeders.linkName,breeders.city, classifieds.id, COUNT(classifiedImages.id) AS imgCount FROM (classifieds LEFT JOIN classifiedImages ON classifieds.id = classifiedImages.ownerID AND classifiedImages.imageData != ''),breeders,state,breeds WHERE classifieds.expires >= NOW() AND classifieds.ownerID = breeders.id AND breeders.active = 1 AND state.id = breeders.state AND classifieds.category = breeds.id GROUP BY classifieds.id ORDER BY IF(breeders.expires >=NOW(),0,1), classifieds.dateAdded DESC, classifieds.id DESC"; $pg=&new Pager($dbObj,$query,40); $resArr = $pg->displayRecords($_GET['page'],"puppy-for-sale"); if(count($resArr['results'])>0){ $html = "
Sorry, we do not have any listings at this time
"; } $pageTitle = "Hunting Dogs and Puppies For Sale"; $metaDescription = "View gun dog breeder classified ads for puppy litters, finished and started dogs for sale in all gun dog breeds and locations"; $metaKeywords = "puppy for sale, started dog, finished, litter, bird dog, puppies, gun dogs, sporting breeds, dog breeders, classified, ads, hunting"; // record hit //$dbObj->performQuery("INSERT INTO traffic SET mark = NOW(), referringIP = '{$_SERVER['REMOTE_ADDR']}', type = 'incoming', pageType='classified'"); } else if(isset($_GET['breed']) && $_GET['breed']!= "you-must-select-a-breed"){ // show classifieds by breed $html = ""; $query = "SELECT id,breeds,description FROM breeds WHERE breeds LIKE '".$dbObj->cleanInput(LinkFormat::stripDashes($_GET['breed']))."'"; $dbObj->performQuery($query); if($row = $dbObj->fetchRow()){ $cbreed = $row['breeds']; $breedID = $row['id']; } else { print ""; exit; $html = showImproperRequest(); $pageTitle = "Error"; } $stateQuery = ""; $stateSearchLink = ""; if (isset($_GET['state']) && is_numeric($_GET['state'])&& $_GET['state']>0){ $stateQuery = "AND breeders.state = ".@$dbObj->cleanInput($_GET['state']); $stateSearchLink = "&state={$_GET['state']}"; } $featuredHTML = getFeaturedClassifieds($dbObj,$siteDataObj,'breed',$breedID,$cbreed); $query = "SELECT classifieds.title, classifieds.dateAdded,classifieds.type, state.stateName, breeders.name, breeders.linkName, breeders.city, breeders.expires, classifieds.id, COUNT(classifiedImages.id) AS imgCount FROM (classifieds LEFT JOIN classifiedImages ON classifieds.id = classifiedImages.ownerID AND classifiedImages.imageData != ''),breeders,state,breeds WHERE classifieds.expires >= NOW() AND classifieds.ownerID = breeders.id AND breeders.active = 1 AND state.id = breeders.state AND breeds.breeds LIKE '".Linkformat::stripDashes($_GET['breed'])."' AND classifieds.category = breeds.id $stateQuery GROUP BY classifieds.id ORDER BY IF(breeders.expires >=NOW(),0,1), classifieds.dateAdded DESC"; $pg=&new Pager($dbObj,$query,40); $resArr = $pg->displayRecords($_GET['page'],"","breed={$_GET['breed']}&submit=SEARCH".$stateSearchLink); if(count($resArr['results'])>0){ $html = "$featuredHTMLAbout the ".$cbreed."
".$row['description']."
Sorry, we do not have any listings for this gun dog breed
"; $html .= "mobilemobileSiteURL.$_SERVER['PHP_SELF']."\">Click here to do another search.
"; } $pageTitle = "$cbreed Hunting Dogs and $cbreed Puppies For Sale"; $metaDescription = "View all $cbreed hunting dog puppies for sale including new litters, stud dogs, started and finished dogs for sale"; $metaKeywords = "$cbreed, $cbreed puppies, hunting dogs, puppies for sale, sporting dog breed, classified ad, dog for sale, puppies, puppy litter, started, finished, bird, hunting, gun dog breeders"; // record hit //$dbObj->performQuery("INSERT INTO traffic SET mark = NOW(), referringIP = '{$_SERVER['REMOTE_ADDR']}', breedID = (SELECT id FROM breeds WHERE breeds LIKE '".Linkformat::stripDashes($_GET['breed'])."'), type = 'incoming', pageType='classified'"); } else if(isset($_GET['state'])){ // show classifieds by state // check that state exists in database if(is_numeric($_GET['state'])){ $dbObj->performQuery("SELECT * FROM state WHERE id = {$_GET['state']}"); } else { $dbObj->performQuery("SELECT * FROM state WHERE stateName LIKE '".Linkformat::stripDashes($_GET['state'])."'"); } if($dbObj->getNumRows()==0){ $html = showImproperRequest(); $pageTitle = "Error"; } else { $stateData = $dbObj->fetchRow(); $_GET['state'] = $stateData['stateName']; } $featuredHTML = getFeaturedClassifieds($dbObj,$siteDataObj,'state',$stateData['id'],$stateData['stateName']); $query = "SELECT classifieds.title,classifieds.type, classifieds.dateAdded, state.stateName, breeders.name, breeders.linkName, breeders.city, classifieds.id, breeds.breeds, COUNT(classifiedImages.id) AS imgCount FROM (classifieds LEFT JOIN classifiedImages ON classifieds.id = classifiedImages.ownerID AND classifiedImages.imageData != ''),breeders,state,breeds WHERE classifieds.expires >= NOW() AND classifieds.ownerID = breeders.id AND breeders.active = 1 AND state.id = breeders.state AND state.stateName LIKE '".Linkformat::stripDashes($_GET['state'])."' AND classifieds.category = breeds.id GROUP BY classifieds.id ORDER BY IF(breeders.expires >=NOW(),0,1), classifieds.dateAdded DESC"; $pg=&new Pager($dbObj,$query,40); $resArr = $pg->displayRecords($_GET['page'],$_GET['state']); if(count($resArr['results'])>0){ $html = "$featuredHTMLSorry, we do not currently have any classified ad listings for puppies for sale in ".Linkformat::stripDashes($_GET['state'])."
"; $html .= "mobileSiteURL.$_SERVER['PHP_SELF']."\">Click here to do another search.
"; } $dirLink = ""; $pageTitle = "Hunting Dogs and Puppies for sale in ".Linkformat::stripDashes($_GET['state']); $metaDescription = "View gun dog classified ads offering hunting dog puppies for sale in ".Linkformat::stripDashes($_GET['state'])." for all hunting dog breeds "; $metaKeywords = ""; // record hit //$dbObj->performQuery("INSERT INTO traffic SET mark = NOW(), referringIP = '{$_SERVER['REMOTE_ADDR']}', stateID = (SELECT id FROM state WHERE stateName LIKE '".Linkformat::stripDashes($_GET['state'])."'), type = 'incoming', pageType='classified'"); } else if(isset($_GET['id']) && is_numeric($_GET['id'])){ // show specific classified $query = "SELECT classifieds.*, breeders.name, breeders.linkName, breeders.id as breederID, state.stateName, breeds.breeds as breedName, breeds.id as breedID, breeders.city, breeders.expires as bExpired FROM classifieds,breeders,state,breeds WHERE breeders.state = state.id AND classifieds.ownerID = breeders.id AND breeders.active = 1 AND breeds.id = classifieds.category AND classifieds.id = ".$_GET['id']; $dbObj->performQuery($query); if($row = $dbObj->fetchRow()){ if(strtotime($row['bExpired'])>strtotime("now")){ $paid=1; $dataContainerClass = "dataContainer2"; } else { $dataContainerClass = "dataContainer"; } $html= ""; $breederID = $row['breederID']; $breedsID = $row['breedID']; $description = $row['description']; $cBreed = $row['breedName']; $formObj->postVars['breed'] = LinkFormat::adddashes($row['breedName'],lcase); $pageTitle = "{$row['title']} - {$row['breedName']}s in ".((trim($row['city'])!="")?"{$row['city']}, ":"")."{$row['stateName']} - {$row['name']} "; $query = "SELECT count(id) as recCount FROM classifiedImages WHERE ownerId = ".$_GET['id']." AND imageData != ''"; $dbObj->performQuery($query); if($crow = $dbObj->fetchRow()){ if($crow['recCount']>0) { //$html .="{$imageRow['imgDescription']}
"; $html .= "";
$dbObj->performQuery("SELECT title, id FROM pedigrees WHERE id IN({$row['pedigrees']})");
while($pRow = $dbObj->fetchRow()){
$html .= "{$pRow['title']}
";
}
$html .= "
"; } $metaDescription = showFirst($description,255); $metaKeywords = "$cBreed for sale, $cBreed puppies, started {$cBreed}s, finished, studs, puppy, litter, dog breeder"; // get classifieds for sidemenu by breed $sideMenuHTML = getSMClassifieds($dbObj,$siteDataObj,'breed',$breedsID,$cBreed); // record hit $dbObj->performQuery("INSERT INTO traffic SET mark = NOW(), referringIP = '{$_SERVER['REMOTE_ADDR']}', classifiedID = {$_GET['id']}, breederID= $breederID, type = 'incoming', pageType='classified'"); } else { $html = showImproperRequest(); } } else if(isset($_GET['show'])){ switch($_GET['show']){ case "litterAnnouncements": $pageTitle = "Hunting Dogs For Sale - Litter Announcements"; $metaDescription = "View all hunting dog puppies for sale and gun dog Litter Announcements with bird dogs for sale"; $metaKeywords = "Puppies for sale, Litter Announcements, bird dog pups, puppy classified ads, dog for sale, puppies, puppy litter, started, lab, brittany, gsp, german shorthaired pointer, bird, hunting, gun dog breeders"; $fileName = "litter_announcements"; $showType = "litter announcement"; $sqlType = "Litter Announcement"; break; case "startedDogs": $pageTitle = "Started Hunting Dogs For Sale - Started Bird Dogs"; $metaDescription = "View all started dog gun dog classifieds"; $metaKeywords = "Started dog classifieds, started bird dog, classified ad, started dog for sale, started gun dog, finished, bird dog, hunting, gun dog breeders"; $fileName = "started_dogs"; $showType = "started dog"; $sqlType = 'Started Dog'; break; case "finishedDogs": $pageTitle = "Finished Dogs For Sale - Finished Hunting Dogs"; $metaDescription = "View all finished gun dog classifieds"; $metaKeywords = "Finished dog classifieds, sporting dog breed, classified ad, finished dog for sale, finished bird dog, started, finished, bird, hunting, gun dog breeders"; $fileName = "finished_dogs"; $showType = "finished dog"; $sqlType = 'Finished Dog'; break; case "studFee": $pageTitle = "Stud Fees - Hunting Dog Studs"; $metaDescription = "View all gun dog stud fee classifieds"; $metaKeywords = "Stud fee classifieds, stud fees, classified ad, stud dog for sale, hunting dog stud, german shorthair stud, brittany, lab stud, bird dog stud, hunting, gun dog breeders"; $fileName = "stud_fee"; $showType = "stud fee"; break; case "dogTraining": $pageTitle = "Dog Training / Gear For Sale Classifieds"; $metaDescription = "View all gun dog training and gear for sale classified ads"; $metaKeywords = "Dog training classifieds, gun dog trainers, professional, obedience, gear for sale, force fetch, wing and shot, started, finished, bird dog training, hunting, gun dog breeders"; $fileName = "dog_training"; $showType = "dog training"; break; default: break; } $html = '
'; } else { if($_SERVER['REQUEST_URI'] =="/mobile/viewClassifieds.html"){ header('Location: '.$siteDataObj -> mobileSiteURL.'/index.html', true, 301); } else { $html = showImproperRequest(); } } ?>