"; $strBackLinkClass="backLink"; $strStyleSheet = isset($strStyleSheet) ? $strStyleSheet : ""; $strIframe = isset($strIframe) ? $strIframe : "" ; if (( $_SERVER["HTTP_HOST"]=="127.0.0.1" || $_SERVER["HTTP_HOST"]=="localhost" || $_SERVER["HTTP_HOST"]=="dev." || $_SERVER["HTTP_HOST"]=="117.195.193.15" || $_SERVER["HTTP_HOST"]=="www.boatwizardwebsolutions.co.uk" || $_SERVER["HTTP_HOST"]=="www.boatwizardwebsolutions.com" || $_SERVER["HTTP_HOST"]=="boatwizardwebsolutions.com" || $_SERVER["HTTP_HOST"]=="www.boats-search.com" || $_SERVER["HTTP_HOST"]=="www.boatwizardwebsolutions.co.uk")) { $BaseURL="http://www.yachtworld.com"; if ($_GET["rPage"]!="") { $sURL=$BaseURL.str_replace("rPage=","",replace_query_ASP()); } else { $sURL=$BaseURL."/privatelabel/listing/cache/pl_search_results.jsp?".replace_query_ASP().""; //Yacht Lisiting $_SESSION['searchResultsURL']=str_replace($BaseURL,"",$sURL); //Response.Write("Change Search Criteria

") //sURL = "/privatelabel/listing/pl_boat_detail.jsp?&units=Feet&checked_boats=1448887&slim=pp254585&" 'Yacht Detail print "".$strBackText.""; //To Open Printer Friendly version in Same Window remove comment from below print statment. //print "
Printer Friendly Version
"; //To Open Printer Friendly version in New Window remove comment from below print statment. print "
Printer Friendly Version
"; } if ($sURL!= "" && (strpos($_GET["rPage"],"pl_search_results.jsp") ? strpos($_GET["rPage"],"pl_search_results.jsp")+1 : 0)>0 ) { $_SESSION['searchResultsURL']=str_replace($BaseURL,"",$sURL); } // replace Msxml2.ServerXMLHTTP with PHP might . //die($sURL); $result = get_web_page($sURL); //die($result['content']); if($result['http_code']!=200) { $pageHTML = "

An Error Occurred

Sorry, but we are not able to complete the search at the moment.

Error Code: 200

"; } else { $pageHTML = $result['content']; } //print_r($result); function drawImage($idNumber,$pp) { global $pageHTML , $out; // $idNumber = $out[1][] passed as a param $imgPath = ""; for ($i=1; $i<=5; $i=$i+1) { $imgPath=$imgPath.substr(substr($idNumber,0,$i),strlen(substr($idNumber,0,$i))-(strlen(substr($idNumber,0,$i))-($i-1)))."/"; } // |<---- this is 169 characters -------------------------------------------------------------------------------------------------------------------------------------------------------------->| // Add hyperlink to thumbnail image preg_match("/&boat_id={$idNumber}&primary_photo_id=\d+/", $pageHTML, $match); preg_match("/&primary_photo_id=\d+/", $match[0], $match); preg_match("/\d+/", $match[0], $match); if(preg_match("/&boat_id={$idNumber}&primary_photo_id={$match[0]}&primary_photo_url=.*[A-Za-z0-9_%\.]&back/", $pageHTML)){ preg_match("/&boat_id={$idNumber}&primary_photo_id={$match[0]}&primary_photo_url=.*[A-Za-z0-9_%\.]&back/", $pageHTML, $newurlmatch); preg_match("/&primary_photo_url=.*[A-Za-z0-9_%\.]&back/", $newurlmatch[0], $newurlmatch); preg_match("/http.*[A-Za-z0-9_%\.].jpg/", $newurlmatch[0], $newurlmatch); $imgNewSrc=urldecode($newurlmatch[0])."?w=300&h=300&t=".time(); $imgPath=""; } else{ $imgPath=""; } //$imgPath=str_replace("_1_thumb.jpg",$imgPath,$pageHTML); // |<---------- this 54 characters if boat_id is 7 digits -------------->| $pageHTML=str_replace("",$imgPath,$pageHTML); return; } //.gmmktime(0, 0, 0, 1, 1, 1970)." preg_match_all("" , $pageHTML,$out, PREG_PATTERN_ORDER); //print_r($out); foreach ($out[1] as $tempID) { drawImage($tempID,$pp); } // hurrah , lets call the most confusing function . // $strBackText="\"Back\""; // $strBackLinkClass="backLink"; //die($_SERVER['QUERY_STRING']); $_SESSION['searchResultsURL'] = isset($_SESSION['searchResultsURL']) ? $_SESSION['searchResultsURL'] : ""; if (strpos($_SERVER['QUERY_STRING'],"pl_boat_detail_handler.jsp") == true) { if ($_SESSION['searchResultsURL']==FALSE ) { $init_html = "".$strBackText."
"; //To Open Printer Friendly Version in Same Window remove comment from below statment. //$init_html .= "
Printer Friendly Version
"; //To Open Printer Friendly version in New Window remove comment from below statment. $init_html .= "
Printer Friendly Version
"; } else { //Response.Write("Change Search Criteria

") } } if ((strpos($_GET["rPage"],"pl_search_results.jsp") ? strpos($_GET["rPage"],"pl_search_results.jsp")+1 : 0)>0) { //Response.Write("Change Search Criteria

") print "".$strBackText.""; //To Open Printer Friendly version in Same Window remove comment from below print statment. //print "
Printer Friendly Version
"; //To Open Printer Friendly version in New Window remove comment from below print statment. print "
Printer Friendly Version
"; } if (strpos($_GET["rPage"],"pl_display_photo.jsp") == TRUE) { print "".$strBackText.""; //To Open Printer Friendly version in Same Window remove comment from below print statment. //print "
Printer Friendly Version
"; //To Open Printer Friendly version in New Window remove comment from below print statment. print "
Printer Friendly Version
"; } if ((strpos($_GET["rPage"],"photo_gallery.jsp") ? strpos($_GET["rPage"],"photo_gallery.jsp")+1 : 0)>0) { print "".$strBackText.""; //To Open Printer Friendly version in Same Window remove comment from below print statment. //print "
Printer Friendly Version
"; //To Open Printer Friendly version in New Window remove comment from below print statment. print "
Printer Friendly Version
"; } if ((strpos($_GET["rPage"],"pl_boat_full_detail.jsp") ? strpos($_GET["rPage"],"pl_boat_full_detail.jsp")+1 : 0)>0 || (strpos($_GET["rPage"],"pl_ts_boat_full_detail.jsp") ? strpos($_GET["rPage"],"pl_ts_boat_full_detail.jsp")+1 : 0)>0) { print "".$strBackText.""; //To Open Printer Friendly version in Same Window remove comment from below print statment. //print "
Printer Friendly Version
"; //To Open Printer Friendly version in New Window remove comment from below print statment. print "
Printer Friendly Version
"; } //die(); //Remove unnecessary html & change href's $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("width=650 bgcolor=\"#FFFFFF\"","width=\"100%\"",$pageHTML); $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("summary=\"search_results\"","summary=\"search_results\" width=\"100%\"",$pageHTML); //Replace images // Remove comment of following line to hide Full specification's Available icon from listing. // $pageHTML=str_replace("\"*\"","",$pageHTML); // Replaces images of Full Specification Available foreach ($out[1] as $tempID) { $pageHTML=preg_replace("/\"\*\"/","\"Full ",$pageHTML,1); } // Remove comment of following line to hide Photo Gallary icon from listing. // $pageHTML=str_replace("","",$pageHTML); // Replace images of Photo's Available foreach ($out[1] as $tempID) { $pageHTML=preg_replace("//","\"Photos",$pageHTML,1); } $pageHTML=str_replace("","\"Photos ",$pageHTML); $pageHTML=str_replace("","\"Fairline",$pageHTML); // Remove comment of following line to remove key of Full Specification at bottom // $pageHTML=str_replace("=Full Specs,","",$pageHTML); $pageHTML=str_replace("","",$pageHTML); // Remove comment of following line to remove key of Photo Gallary at bottom $pageHTML=str_replace("=Photos,","=Photos     ",$pageHTML); $pageHTML=str_replace("","",$pageHTML); // Remove comment of following line to remove key of Video Brochure at Bottom $pageHTML=str_replace("\"video=Video Brochure","",$pageHTML); //Form $region = isset($_GET["region"]) ? $_GET["region"] : "" ; $pageHTML=str_replace("
","",$pageHTML); $pageHTML=str_replace("".chr(10)."
 ","   ",$pageHTML); $pageHTML=str_replace(" ","",$pageHTML); // Below code will give border to existing HTML table which helps for modification // $pageHTML=str_replace("border=\"0\"","border=\"1\"",$pageHTML); //Paging image links $pageHTML=str_replace("","\"Next",$pageHTML); $pageHTML=str_replace("","\"Previous",$pageHTML); //Replace hyperlinks $pageHTML=str_replace("href=\"../../","href=\"?rPage=/privatelabel/",$pageHTML); $pageHTML=str_replace("href='../","href='?rPage=/privatelabel/",$pageHTML); $pageHTML=str_replace("href=\"/privatelabel/","href=\"?rPage=/privatelabel/",$pageHTML); $pageHTML=str_replace("href='/privatelabel/","href='?rPage=/privatelabel/",$pageHTML); $pageHTML=str_replace("href=\"../listing/","href=\"?rPage=/privatelabel/listing/",$pageHTML); $pageHTML=str_replace("href=/privatelabel/","href=?rPage=/privatelabel/",$pageHTML); //other tags $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("type=\"button\"","type=\"button\" class=\"hidden\" style=\"margin-top: 4px; \"",$pageHTML); $pageHTML=str_replace("type=\"submit\"","type=\"submit\" class=\"hidden\" style=\"margin-top: 4px; \"",$pageHTML); $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("
","",$pageHTML); $pageHTML=str_replace("\"Foreign","Foreign Currency Exchange",$pageHTML); $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("
","",$pageHTML); $pageHTML=str_replace("
","
",$pageHTML); //fix table width on specs page $pageHTML=str_replace("width=95%","",$pageHTML); $pageHTML=str_replace("width=90%","",$pageHTML); $pageHTML=str_replace("","
",$pageHTML); //fix link target for contact link at bottom of boat details page $pageHTML=str_replace("target=\"_self\"","target=\"_blank\"",$pageHTML); //Remove Codes column $pageHTML=str_replace("Codes","",$pageHTML); $codesArray = array("P U T D ST  ", "P N T D ST  ", "C U O D ST  ", "C U T D ST  ", "C U S D ST  ", "P U T O ST  ", "C U O O ST  ", "C U T O ST  ", "P N S O ST  ", "C U T D FG  ", "C N S D ST  ", "P N S D ST  ", "P U S O ST  ", "C U S O ST  ", "C N T D ST  ", "C N O D ST  ", "P U T D AL  ", "C U O D AL  ", "C N O O ST  ", "P N T D AL  ", "P U S D ST  ", "S U T D CP  ", "S U T D FG  ", "S U S D ST  ", "P N O D ST  ", "C U O D FG  ", "P U O O O  ", "P U T D FG  ", "P N T O ST  ", "S U T D AL  ", "C U T D O  ", "P U O D ST  ", "C N O O O  ", "P U O O ST  ", "S U T D ST  ", "C U S D AL  ", "C N O D O  ", "S U S D AL  ", "P N T D W  ", "C U T D AL  ", "P U O D AL  ", "P N T D CP  ", "C U O O W  ", "S U S D FG  ", "P N O O AL  ", "P U O D FG  ", "S N T D ST  ", "P U T D W  ", "C U T D CP  ", "P N T D FG  ", "P U T D CP  ", "C N T D O  ", "S U S D W  ", "S U T D W  ", "S N T D W  ", "S N S D AL  ", "C N T O O  ", "P N O O O  ", "P N T D O  ", "P N S G ST  ", "C U T D W  ", "P N O D AL  ", "P U T D O  ", "S U S D CP  ", "P U O D W  ", "C U S D W  ", "P U S D AL  ", "C N O D AL  ", "P N S D O  ", "P U S D FG  ", "S N T D CP  ", "C U T G ST  ", "S N S D ST  ", "P N O D O  ", "P N O D FG  ", "C U O D O  ", "P U O D CP  ", "  N T D AL  ", "P U T O AL  ", "C U S D FG  ", "S U S D O  ", "P U T G AL  ", "S N S D CP  ", "P N S D FG  ", "P N O O ST  ", "P U T O CP  ", "S N T D FG  ", "S N S D W  ", "C N T D FG  ", "S U S G ST  ", "P N O O FG  ", "P U T D FC  ", "P U S D W  ", "P N O D CP  ", "P U S D O  ", "P N S D CP  ", "S U T D O  ", "C U S O O  ", "P U O O    ", "P U T G FG  ", "C U O D CP  ", "C U O O O  ", "S U O O CP  ", "S N O O AL  ", "S U O O FG  ", "C U T D FC  ", "S U S O O  ", "S U O D W  ", "P N T G AL  ", "P U S D    ", "S N S D FG  ", "P U S D CP  ", "P N T G FG  ", "P N T O FG  ", "  N T D CP  ", "P U O G FG  ", "S N T D AL  ", "P U S G AL  ", "S N T O FG  ", "P U T O FG  ", "  N T D FG  ", "S U O   O  ", "P U O O W  ", "C U O D W  ", "P U O G AL  ", "S N T O CP  ", "S U S G AL  ", "P U T G ST  ", "C N S D FG  ", "P U T   AL  ", "S U T G W  ", "C N T D CP  ", "P U T O W  ", "S U S O ST  ", "S U S D FC  ", "P N S D AL  ", "P N T D FC  ", "S U S O AL  ", "P U T O O  ", "S U S O W  ", "S U O O ST  ", "S U T G FG  ", "P U O O AL  ", "C U T G CP  ", "S U O O W  ", "P U T O    ", "S U O D ST  ", "S N S O O  ", "S U S O FG  ", "C U S D CP  ", "C U T G AL  ", "C U T G FG  ", "P U T G W  ", "P U S G ST  ", "P U S G FG  ", "S U S D    ", "P U S G O  ", "S U T O FG  ", "P U T G O  ", "P U O O CP  ", "S U O D CP  ", "P U T G CP  ", "P U O O FG  ", "P U O D O  ", "  U S D FG  ", "C U T G O  ", "P N T O CP  ", "S U T G CP  ", "P N S D    ", "C U S D O  ", "P U T D    ", "S U S G W  ", "S U S G CP  ", "S U T O O  ", "P N T O O  ", "P U S O    ", "  U T D FG  ", "P N O D W  ", "C N T D AL  ", "S U S G FG  ", "C U S G ST  ", "P N S D W  ", "P U O G W  ", "P U S O O  ", "P U S O FG  ", "S U O D FG  ", "S U S   CP  ", "C N S D W  ", "P U S O W  ", "P U S G W  ", "P U S O AL  ", "P U O   FG  ", "  N O D FG  ", "P N T G CP  ", "P U O G CP  ", "S U O D AL  ", "S U O D O  ", "S N S D O  ", "C U T G W  ", "P U O D    ", "S U S O    ", "S N S O FG  ", "P U O G O  ", "  N S D FG  ", "P N O G FG  ", "P U T   W  ", "P U T   FG  ", "C N T G FG  ", "S U S G O  ", "P N S G FG  ", "P N S O FG  ", "C U O G AL  ", "  N O D ST  ", "S N O O FG  ", "P U O   CP  ", "C N T G AL  ", "S U T   FG  ", "P N S O O  ", "C U T O AL  ", "C U O O AL  ", "S U S   FG  ", "S N O D FG  ", "P N S G CP  ", "S N S D    ", "P U S G CP  ", "S N T G CP  ", "  U S D O  ", "P U T   CP  ", "P N O   W  ", "C U S G AL  ", "C U S O AL  ", "C U S G CP  ", "P N T G O  ", "P U S G    ", "P N S O    ", "C U S O FG  ", "P N O G CP  ", "S N S G FG  ", "P U S D FC  ", "C U S G FG  ", "P N T G W  ", "P U T   O  ", "P N O G AL  ", "S U S G    ", "S U T   O  ", "  N O G FG  ", "S U T G AL  ", "C U O O FG  ", "P U S   W  ", "  N S D W  ", "S N S G CP  ", "S U S   W  ", "  N T G FG  ", "P U S   FG  ", "C U S G O  ", "S U T   FG  ", "P N O O CP  ", "S U O G FG  ", "S U S O CP  ", "P N S G AL  ", "S U O O O  ", "S U O   W  ", "S N T G FG  ", "C N S D AL  ", "P N S G W  ", "S N O O CP  ", "P U S   O  ", "  U S G FG  ", "S N S O    ", "C N O O AL  ", "P U S   CP  ", "C N S G ST  ", "S U O G CP  ", "S U O   FG  ", "  N S G FG  ", "  N T O FG  ", "P N O      ", "C U S G W  ", "C U T O O  ", "P N S O AL  ", "P N S G O  ", "S N O O O  ", "S N S O CP  ", "S U S   O  ", "C N S D O  ", "C N S G O  ", "S N O G FG  ", "P U S   AL  ", "  N S G O  ", "P U S O CP  ", "C N S O FG  ", "P N O O W  ", "C N S G FG  ", "S U O G W  ", "C N S G AL  ", "C N O O FG  ", "C N O O W  ", "C U T O FG  ", "P N S O CP  ", "  N S O FG  ", "  N O O O  ", "P U O   AL  ", "P N O   FG  ", "  U O      "); $pageHTML=str_replace($codesArray, "", $pageHTML); $contact_btn_str = " Contact Us About This Boat"; $pageHTML=str_replace(">\"Boat" , ">", $pageHTML); $pageHTML=str_replace(">Boat Loans" , ">", $pageHTML); $pageHTML=str_replace(">\"Boat" , ">", $pageHTML); $pageHTML=str_replace(">Boat Insurance" , ">", $pageHTML); $pageHTML=str_replace(">\"Boat" , ">", $pageHTML); $pageHTML=str_replace(">Boat Transport" , ">", $pageHTML); $pageHTML=str_replace(">Full specs"," class=\"btn\">Full Specification",$pageHTML); $pageHTML=str_replace(">\"Photo" , " class=\"btn\">Video Brochure", $pageHTML); $pageHTML=str_replace(">Full specs"," class=\"btn\">Full Specification",$pageHTML); preg_match_all("||" ,$pageHTML,$out,PREG_OFFSET_CAPTURE); foreach($out[0] as $x) { if(isset($x[0])) { $pageHTML = str_replace($x[0],"\"Photos" ,$pageHTML); } } $pageHTML=str_replace(">\"Photo"," class=\"btn\">Photo Gallery" . $contact_btn_str,$pageHTML); $pageHTML=str_replace(">\"Photo"," class=\"btn\">Photo Gallery" . $contact_btn_str,$pageHTML); $pageHTML=str_replace(">Email",">",$pageHTML); $pageHTML=str_replace(">\"Email\"",">",$pageHTML); $pageHTML=str_replace(">\"Email\"",">",$pageHTML); $pageHTML=str_replace("
","
",$pageHTML); $pageHTML=str_replace("Click on one boat to view the full listing, or ","",$pageHTML); //End If preg_match_all("/

(.*)<\/h3>/" ,$pageHTML,$out,PREG_OFFSET_CAPTURE); if(isset($out[0][0][0])) { $pageHTML=str_replace($out[0][0][0],"",$pageHTML); } preg_match_all("|
(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n|" , $pageHTML,$out,PREG_OFFSET_CAPTURE); // the above expression is tooo bad , but ok for the time being , could'nt think of any other way which worked . $mValue=str_replace(chr(10),"",$out[0][0][0]); $mValue=str_replace("'","\"",$mValue); $mValue=str_replace("

","",$mValue); $mValue=str_replace("
","",$mValue); $mValue=str_replace("","",$mValue); $mValue=str_replace("","",$mValue); $mValue=str_replace("","",$mValue); $mValue=str_replace("","",$mValue); $mValue=str_replace("class=\"hideOnPrint\"","id=\"hideOnPrint\"",$mValue); $mValue=str_replace("\"Warranty","",$mValue); $pageHTML=str_replace($out[0][0][0],$mValue,$pageHTML); //Search Results table column headings // preg_match_all("|(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n|" , // $pageHTML,$out,PREG_OFFSET_CAPTURE); // $pageHTML=str_replace($out[0][0][0],"",$pageHTML); // $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("class=blue","",$pageHTML); // Adding below line had aligned all the column heading in Listing page.Its very imp. for alignment of heading. $pageHTML=str_replace("
Boats","style=\"text-align: right;\">Type Of Boat",$pageHTML); $pageHTML=str_replace(">Length"," style=\"text-align: right;\">Length",$pageHTML); $pageHTML=str_replace("target=\"_self\">Email", "target=\"_self\" class=\"btnEmail\">", $pageHTML); //Photo Gallery Page $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("href=../listing","href=?rPage=/privatelabel/listing",$pageHTML); $pageHTML=str_replace("","",$pageHTML); $pageHTML=str_replace("table width=\"616\"","table width=\"100%\"",$pageHTML); $pageHTML=str_replace("bgcolor=\"#5A79BB\"","class=\"galleryNav\"",$pageHTML); $pageHTML=str_replace("color:#ffff00;","color:white;",$pageHTML); $pageHTML=str_replace("style=\"width:615px;","style=\"width:600px;",$pageHTML); $pageHTML=str_replace("target=\"_blank\" >Email Us",">Contact Us",$pageHTML); $pageHTML=str_replace("style=\"text-decoration:none; color:white;\"","style=\"text-decoration: none; color: #333333; text-align: right;\"",$pageHTML); $pageHTML=str_replace("style=\"color:#ffff00; height:21px; overflow:auto; ","style=\"color: #333333; font-weight: bold;",$pageHTML); $pageHTML=str_replace("style=\"color:white; height:21px; overflow:auto; padding:1px\"","style=\"color:#333333; font-weight: bold; height:21px; overflow:auto; padding:1px\"",$pageHTML); preg_match_all("|The URL has moved |" ,$pageHTML,$out,PREG_OFFSET_CAPTURE); if(isset($out[0][0][0])) { $pageHTML = str_replace($out[0][0][0],"" ,$pageHTML); } preg_match_all("//" ,$pageHTML,$out,PREG_OFFSET_CAPTURE); foreach($out[0] as $x => $y) { $pageHTML = str_replace($y[0],"",$pageHTML); } $pageHTML = str_replace("P=Power, S=Sail
N=New, U=Used
S=Single, T=Twin, D=Diesel, G=Gas/Petrol
W=Wood, ST=Steel, AL=Aluminum, FG=Fiberglass, CP=Composite, FC=Ferro-Cement","",$pageHTML); $pageHTML = str_replace("
O=Other/None,","",$pageHTML); // $pageHTML = str_replace(pageHTML, , "
\"Photo's Photographs Available
\"FullFull Specification
") $pageHTML = $init_html . $pageHTML; $pageHTML = str_replace("
","",$pageHTML); $pageHTML = str_replace("#apost#","'",$pageHTML); echo $pageHTML; } // this one is for the last else end if , though doesent make sense to me . ?>