$url = $_SERVER['REQUEST_URI'];
$array = explode("/", $url);
$string = $array[1];
$string2 = strip_tags($array[2]);
//If they haven't made a search, build the search term from the url strings
if ($string !== "search") {
if (($string) && ($string2 == "")) { $searchterm = $string; }
if (($string) && ($string2)) { $searchterm = "$string $string2"; }
$searchterm = str_replace("_"," ",$searchterm);
} //end of no search
//Variables from front page
if (($string == "search") && ($string2 == "")) {
$searchterm = strip_tags($_POST['searchterm']);
$onsale = strip_tags($_POST['onsale']);
}
if (($string == "search") && ($string2)) { $searchterm = strip_tags($string2); $searchterm = str_replace("_"," ",$searchterm); $searchterm = str_replace("+"," ",$searchterm); }
//variables associated with pagination - if these exist, overwrite searchterm
$search_term = strip_tags($_GET['search_term']);
$search_results_base= strip_tags($_GET['search_results_base']);
if (($string == "search") && ($search_term)) { $searchterm = $search_term; }
?>
if ($select == "") { echo "Looking for sports memorabilia or great sports collectibles? Buying a gift for a sports fan? Purchase Sports Memorabilia from Sports Store!"; } ?>
if (($team == "") && ($league)) { echo "Find $league $display_league sports memorabilia or great $league sports collectibles? Buy $league Christmas gifts for $display_league fans. Purchase $league $display_league products today!"; } ?>
if (($team) && ($league) && ($department == "")) { echo "Christmas $league: $team memorabilia $team collectibles. Gift ideas for the $league, $team sports fan!"; } ?>
if (($team) && ($league) && ($department)) { echo "$league $display_league: $team $department. Purchase your $team $league $display_league merchandise. $department products make great gifts for $team fans!"; } ?>
|
|
$adtype = '728x90'; include ("inc/ads.php"); ?>
|
//------------------------------------------------Start of if there is no search made or team/league selected----------------------------------------------------------// ?>
if ($searchterm == "") { ?>
Sports Memorabilia and Collectibles
$adtype = '120x600'; include ("inc/ads.php"); ?>
|
Welcome to SportsPool.com's online sports memorabilia and sports collectibles shopping mall. Here you will find quality sports merchandise for the fans of MLB Baseball, NFL Football, NBA Basketball, NHL Hockey, NASCAR Autoracing and U.S. College Sports.
//------------------------------By Search----------------------------// ?>
To help you quickly and easily find the merchandise you are looking for:
(*If you see no results after doing a search, please try a different search phrase.)
//------------------------------End of By Search----------------------------// ?>

$adtype = '468x15'; include ("inc/ads.php"); ?>
There are many places online to purchase official team and league licensed merchandise. We realize that in order to be successful selling sports memorabilia, we must provide our customers with great prices, superior products and impeccable service.
We constantly are searching for great deals on volume of all sports gear, allowing us to pass on the savings to you. This purchasing power gives us the ability to offer great quality sports merchandise at low prices.
Our Mission:
To make each customer's experience so positive that they make us their primary source for sports team related merchandise!
NFL Football Memorabilia:
MLB Baseball Memorabilia:
NBA Basketball Memorabilia:
State College Memorabilia:
|

include ("inc/champions.php"); ?>
|
} ?>
//----------------------------------End of if no search or team / league has been selected-------------------------------------------------------------------------// ?>
//----------------------------------------If searchterm is available-------------------------------------------------------------------//
if ($searchterm) {
//connect to avantlink database
mysql_pconnect("localhost","indemand","T0utjaca1") or die("Unable to connect to SQL server");
mysql_select_db("affiliates_avantlink") or die("Unable to select database");
//assign the date and url - we need these for the sql checks
$date = date('Ymd');
//figure out the refresh period.
$refresh = date('Ymd', strtotime('-7 days'));
$pageURL = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
//So we have two ways they get to this part, either from searching or by category
//If they get here by a search, do a dynamic API lookup. If they get here by going through
//a category, check if it's got the html in the database
if ($string !== "search") {
//First, we check if the url they are at has a current html entry in the database. If so, we set it to display
$query = "select html from search_results where (url = '$pageURL') and (date >= '$refresh')";
$query2 = mysql_query($query) or die(mysql_error());
$query3 = mysql_fetch_array($query2);
$sql_html = $query3['html'];
//If there is current html info in the database, assign it to the display variable
if ($sql_html) { $strSearchResultHtml = $sql_html; echo ""; }
} else { $sql_html = ""; }
//If there is nothing in the database, perform an API lookup as normal
if ($sql_html == "") {
echo "";
//for the purposes of making our categories look like real urls, we've replaced all the pluses with underscore...need to fix that for this to work
$searchterm = str_replace("_","+",$searchterm);
$affiliate_id = 127807; // *** Insert your affiliate id here ***
$website_id = 153951; // *** Insert your website id here ***
$datafeed_id ="3430"; // ** This is the new Fanatics Complete feed ***
$strUrl = "http://www.avantlink.com/api.php";
$strUrl .= "?module=ProductSearch";
$strUrl .= "&affiliate_id=$affiliate_id";
$strUrl .= "&website_id=$website_id";
$strUrl .= "&datafeed_ids=$datafeed_id";
$strUrl .= "&output=html";
$strUrl .= "&search_term=" . urlencode($searchterm);
//Added by me to make the results better
if ($onsale) { $strUrl .= "&search_on_sale_only=1"; }
if ($search_category) { $strUrl .= "&search_category=$search_category"; }
//Hopefully results page stuff
$results = "http://memorabilia.sportspool.com/search/";
if ($search_category) { $results .= "$search_category/"; }
$strUrl .= "&search_results_base=$search_results_base";
$strUrl .= "&search_results_pagination_base=$results";
$strUrl .= "&search_results_sort_order=Product+Name%7Cdesc";
// Restrict to just a few merchants specializing in outdoors' related items
$strUrl .= "&merchant_ids=11081";
$strUrl .= "&search_results_layout=grid4";
$strUrl .= "&search_results_count=12";
// Show the product image & name, merchant name, product price & description
// $strUrl .= "&search_results_fields=Thumbnail+Image|Product+Name|Merchant+Name|Retail+Price|Abbreviated+Description|Buy+URL|Match+Result";
$strUrl .= "&search_results_fields=Thumbnail+Image|Product+Name|Retail+Price|Abbreviated+Description";
// Give preference to the highest-priced products
$strUrl .= "&search_results_sort_order=Retail+Price|desc";
// Make the actual API request
$strSearchResultHtml = file_get_contents($strUrl);
//If they are doing a team/league check, then add it to the database. No point in saving search entrees.
if ($string !== "search") {
//if we've looked up new html data for this url and got no results with todays date, make sure there is nothing in the database to confuse things
$delete = "delete from search_results where (url = '$pageURL')";
$delete2 = mysql_query($delete) or die(mysql_error());
//Clean the returned HTML from the API for inclusion into the mysql database
$sql_html = addslashes($strSearchResultHtml);
//Add the returned html to the database so it's available next time a visitor checks this page
$insert_query = "insert into search_results (url,date,html) values ('$pageURL','$date','$sql_html')";
$insert_query2 = mysql_query($insert_query) or die(mysql_error());
}
}
// Display the final results (note the CSS styles that are used
// to make the search results look more presentable)
echo ""; ?>
//Just the Search Results title
$strHtml = " [Home] >> Results for '";
if ($searchterm) {
$searchterm = str_replace("%20", " ", $searchterm);
$searchterm = str_replace("+++", "+", $searchterm);
$strHtml .= $searchterm;
}
$strHtml .= "'";
echo $strHtml;
//Remove slashes from strSearchResultHtml added from magic_quotes_runtime
$strSearchResultHtml = stripslashes($strSearchResultHtml);
echo $strSearchResultHtml;
echo " ";
}
//-----------------------------------------------End of if searchterm is available------------------------------------------------------------// ?>
|
include ("inc/footer.inc"); ?>
|