";
echo "Search Results in Doubles for \"".str_replace("Ñ","ñ",rtrim(ltrim($propersearchstring)))."\" | | ";
while ($row = mysql_fetch_assoc($result)) {
$name = rtrim($row['Name']);
$card = rtrim($row['Card']);
$price = rtrim($row['Price']);
$sort = rtrim($row['Sort']);
$name=str_replace(" ^","",$name);
$name=str_replace("^ ","",$name);
$card=str_replace("^ ","",$card);
$card=str_replace(" ^","",$card);
$sort=str_replace("^ ","",$sort);
$sort=str_replace(" ^","",$sort);
$aname=$card.$name;
$aname=strtolower($aname);
$aname=str_replace(" ","",$aname);
$aname=str_replace(".","",$aname);
$aname=str_replace("&","",$aname);
//$aname=str_replace("/","",$aname);
$aname=str_replace("'","",$aname);
$aname=str_replace("-","",$aname);
$aname=str_replace("(","",$aname);
$aname=str_replace(")","",$aname);
$aname=str_replace("#","",$aname);
$name = str_replace("\\","",$name);
$name = str_replace(" ^","",$name);
$name = str_replace("[ Auto ]","",$name);
$name = preg_replace ("/\[[^\].]*\]/","",$name);
$i++;
$firstletter = array();
$cardarray = array();
$card =strtolower($card);
if (strpos($card,"/") != false)
{$slashpos=strpos($card,"/")+1;
$slashflag=1;}
else {$slashflag=0;}
$cardarray = preg_split("/[\s\/]/ ",$card);
$card="";
for ($n=0;$n";
if ($i < 10) {echo " ";} elseif ($i<100) {echo " ";}
if ($i%2 ==1) {$backgroundstyle="style=\"color:black;background-color:darkgray\" ";$fontcolor=black;} else {$backgroundstyle="";$fontcolor="white";}
echo $i.".";
$nbspvar =" ";
if (strlen($name) > 80) { $offset = 0; // initial offset is 0
$spaceCounter = 0;
// Check the rest of the string for spaces
while($offset = strpos($name," ",$offset + 1)){
if ($offset > 40 && $offset < 64 && strpos($name,"#")!=$offset - 1)
{$breakpoint = $offset;}
}
}
if (strpos($name,"(") != false) {
$parenthesecheckers = substr($name,strpos($name,"(")+1,1);
if ($parenthesecheckers !="" && preg_match("/[p123456789]/",$parenthesecheckers)) {
$suffix = substr($name,strpos($name,"("));
$name = substr($name,0,strpos($name,"("));}
else {$suffix="";} }
else {$suffix="";}
$card=str_replace("/ ","/",$card);
if (strpos($name,"Mc")>0) {
$mcpos=strpos($name,"Mc");
$lettertoupper = substr($name,$mcpos+2,1);
$name = substr_replace($name,strtoupper($lettertoupper),$mcpos+2,1);}
if (strpos($name,"(")==1 ) {
$parenthpos=strpos($name,"(");
$lettertoupper = substr($name,$parenthpos+1,1);
$name = substr_replace($name,strtoupper($lettertoupper),$parenthpos+1,1);}
$numbersignstrpos=strpos($card,"#");
$descandcardnumber = substr($card,$numbersignstrpos+2);
$originaldescandcardnumber=$descandcardnumber;
$firstspaceafter=strpos($descandcardnumber," ");
if ($firstspaceafter=="") {$cardnumber=strtoupper($descandcardnumber);
$card=str_replace($descandcardnumber,$cardnumber,$card);
} else {
$cardnumber = substr($descandcardnumber,0,$firstspaceafter);
$originalcardnumber=$cardnumber;
$cardnumber=strtoupper($cardnumber);
$descandcardnumber=str_replace($originalcardnumber,$cardnumber,$descandcardnumber);}
$card = str_replace($originaldescandcardnumber,$descandcardnumber,$card);
$card=str_replace("AUTO","Auto",$card);
$card=str_replace("Spx","SPx",$card);
$card=str_replace("Sspc","SSPC",$card);
$card=str_replace("O-pee-chee","O-Pee-Chee",$card);
$card=str_replace("^ ","",$card);
$card=str_replace(" ^","",$card);
if (strpos($name,"'")>0 ) {$apospos=strpos($name,"'");
$lettertoupper = substr($name,$apospos+5,1);
$name = substr_replace($name,strtoupper($lettertoupper),$apospos+5,1);}
$name = str_replace("?n","án;",$name);
$name = str_replace("?","ñ",$name);
$name = str_replace("Ño","ño",$name);
$card = str_replace("Non-astros","Non-Astros",$card);
$card = str_replace("'S","'s",$card);
$card = str_replace("Sp Authentic","SP Authentic",$card);
$card = str_replace("Focus Je ","Focus JE ",$card);
$card = str_replace(" Ud "," UD ",$card);
$card = str_replace(" Lb "," LB ",$card);
if (substr($name,0,9) !="1977 TCMA" && substr($name,0,9) !="1978 TCMA") {
if (substr($name,5,6) !="Choice") {
$name = preg_replace("/# 0(?=[1-9])/", "# ", $name);} else
{
$name = preg_replace("/# 000(?=[1-9])/", "# 0", $name);
$name = preg_replace("/# 00(?=[1-9])/", "# ", $name);
}
$name = preg_replace("/# 000(?=[1-9])/", "# ", $name);
$name = preg_replace("/# 00(?=[1-9])/", "# ", $name);
}
$name = preg_replace("/ - 000(?=[1-9])/", "- ", $name);
$name = preg_replace("/ - 00(?=[1-9])/", "- ", $name);
$name = preg_replace("/ - 0(?=[1-9])/", "- ", $name);
$name = preg_replace("/P000(?=[1-9])/", "P", $name);
$name = preg_replace("/P00(?=[1-9])/", "P", $name);
$name = preg_replace("/P0(?=[1-9])/", "P", $name);
$name = preg_replace("/C000(?=[1-9])/", "C", $name); $name = preg_replace("/C00(?=[1-9])/", "C", $name);
$name = preg_replace("/C0(?=[1-9])/", "C", $name);
$name = preg_replace("/UH000(?=[1-9])/", "UH", $name); $name = preg_replace("/UH00(?=[1-9])/", "UH", $name);
$name = preg_replace("/UH0(?=[1-9])/", "UH", $name);
$name = preg_replace("/US-000(?=[1-9])/", "US-", $name); $name = preg_replace("/US-00(?=[1-9])/", "US-", $name);
$name = preg_replace("/US-0(?=[1-9])/", "US-", $name);
$name = preg_replace("/T000(?=[1-9])/", "T", $name); $name = preg_replace("/T00(?=[1-9])/", "T", $name);
$name = preg_replace("/T0(?=[1-9])/", "T", $name);
$name = preg_replace("/10000/", "10,000", $name);
$name = preg_replace("/Topps Chrome Red Xfractor/", "Topps Chrome (Red) Xfractor", $name);
$name = preg_replace("/Topps Chrome Update Red Xfractor/", "Topps Chrome Update (Red) Xfractor", $name);
$name = preg_replace("/2004 Topps Chrome White Refractor/", "2004 Topps Chrome (White) Refractor", $name);
$name = preg_replace("/2005 Topps Chrome White Refractor/", "2005 Topps Chrome (White) Refractor", $name);
if (strpos($name,"First 2,000 Printed") != false)
{$name = str_replace("First 2,000 Printed","",$name);
$first2000flag=1;}
if (strpos($name,"one of 2000") != false)
{$name = str_replace("one of 2000","",$name);
$oneof2000flag=1;}
if (strpos($name,"one of 500") != false)
{$name = str_replace("one of 500","",$name);
$oneof500flag=1;}
if (strpos($name,"Rated Rookie") != false)
{$name = str_replace("Rated Rookie","",$name);
$ratedrookieflag=1;}
if ($first2000flag==1) {echo "1st 2,000 Printed"; $first2000flag=0;}
if ($oneof2000flag==1) {echo "one of 2000"; $oneof2000flag=0;}
if ($oneof500flag==1) {echo "one of 500"; $oneof500flag=0;}
if ($ratedrookieflag==1) {echo "Rated Rookie"; $ratedrookieflag=0;}
$playerinitial =substr($sort,0,1);
$asciicode=ord($playerinitial);
if ($asciicode> 64 && $asciicode < 72) {$doublespage="";}
if ($asciicode> 71 && $asciicode < 80) {$doublespage="2";}
if ($asciicode> 79) {$doublespage="3";}
echo $suffix.$card." ".$name." | ";
echo "";
echo number_format($price,2)." | \r\n"; }
if ($i=="") {$i=0;
echo "Sorry, but feel free to try again! | "; }
} else
{ $i=0;
echo "Please enter a search.";}
if ($i ==1) {$cardtense="Card";} else {$cardtense = "Cards";}
echo " |
| ".$i." Different ".$cardtense;
if ($i>0) {echo " ";
echo " | ";
if ($searchstring) {mysql_close ($connid);}
}
|