debugclass = new deBugger(); $this->debugclass->debugit("", "", get_class($this).":redirectClass()"); $this->search123_basefeedurl = "http://click.search123.uk.com/cgi-bin/clickthru.cgi?"; $this->ov_basefeedurl = "http://www6.overture.com/"; $this->infospace_basefeedurl = "http://msxml.infospace.com/uk.inc.fsp2uk/"; } ######################################################################################## function initializeRedirect() { ######################################################################################## $this->debugclass->debugit("", "", get_class($this).":initializeRedirect()"); if ($this->blnSearch123 === true) { $this->feedtype = "search123"; } elseif ($this->blnOverture === true) { $this->feedtype = "overture"; } elseif ($this->blnInfospace === true) { $this->feedtype = "infospace"; } elseif ($this->blnGeneric === true) { $this->feedtype = "generic"; } $this->debugclass->debugit("feedtype", $this->feedtype); if (!isset($this->error)) { if (isset($this->feedtype)) { $this->redirect(); } else { $this->errorCode(0); } } } ######################################################################################## function redirect() { ######################################################################################## $this->debugclass->debugit("", "", get_class($this).":redirect()"); // get core values $this->maxbid = $_GET['maxbid']; $this->debugclass->debugit("Got maxbid", $this->maxbid); $this->title = $_GET['title']; $this->debugclass->debugit("Got title", $this->title); $this->position = $_GET['pos']; $this->debugclass->debugit("Got position", $this->position); ######################################################################################## switch ($this->feedtype) { ######################################################################################## ######################################################################################## case "search123": // handles all search123 feeds ######################################################################################## $this->debugclass->debugit("Executing search123 redirect"); $EI = $_GET['EI']; $Q = $_GET['Q']; $NGT = $_GET['NGT']; $x = $_GET['x']; $IP = $_GET['IP']; $UID = $_GET['UID']; $urlappend = "EI=".$EI."&Q=".urlencode($Q)."&NGT=".$NGT."&x=".$x."&IP=".$IP."&UID=".$UID; $this->redir = $this->search123_basefeedurl.$urlappend; break; ######################################################################################## case "infospace": // handles all infospace feeds ######################################################################################## $this->debugclass->debugit("Executing Infospace Redirect"); //BY INSTALLING OR USING THIS PROGRAM, THE INDIVIDUAL LICENSING THE REDIR.PHP ("MEMBER" OR "YOU") CONSENTS TO BE BOUND BY ALL PORTIONS OF THIS AGREEMENT //1a. InfoSpace grants to Member a limited, revocable, non-exclusive and non-transferable license to reproduce and use solely for personal purposes the executable code version of the REDIR.PHP software. This license does not entitle Member to receive from InfoSpace any hard-copy documentation, technical support, telephone assistance, or enhancements or updates to the REDIR.PHP. //1b. Except as otherwise expressly permitted in this Agreement, Member may not: (i) modify or create any derivative works of the REDIR.PHP or any documentation furnished in connection with it; (ii) decompile, disassemble, reverse engineer, or otherwise attempt to derive the source code for any of the REDIR.PHP (except to the extent applicable laws specifically prohibit such restriction); (iii) redistribute, encumber, sell, rent, lease, sublicense, or otherwise transfer rights to any of the REDIR.PHP ; (iv) remove or alter any trademark, logo, copyright or other proprietary notices, legends, symbols or labels in the REDIR.PHP ; or (v) agree with anyone to do any of the foregoing. //2. Modifications to the REDIR.PHP //InfoSpace reserves the rights to modify or discontinue the REDIR.PHP at any time without notice to Member, and InfoSpace shall not be liable to Member or any third party should InfoSpace exercise its rights to modify or discontinue all or any of the REDIR.PHP. //3. Proprietary Rights. //Title, ownership rights, and intellectual property rights in the REDIR.PHP software shall remain in InfoSpace and/or its suppliers. Member acknowledges such ownership and intellectual property rights and will not take any action to jeopardize, limit or interfere in any manner with InfoSpace's or its suppliers' ownership of or rights with respect to the REDIR.PHP. The REDIR.PHP is protected by copyright and other intellectual property laws and by international treaties. Title and related rights in the content accessed through the REDIR.PHP is the property of the applicable content owner and is protected by applicable law. The license granted under this Agreement gives Member no rights to such content. //4. Disclaimer of Warranties //INFOSPACE PROVIDES THE REDIR.PHP (INCLUDING, WITHOUT LIMITATION, ALL CONTENT, SOFTWARE, AND MATERIALS ACCESSIBLE BY OR THROUGH THE REDIR.PHP ) TO MEMBER "AS IS," WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT; ANY WARRANTY THAT INFORMATION OBTAINED THROUGH THE REDIR.PHP IS ACCURATE OR RELIABLE; ANY WARRANTY THAT THE REDIR.PHP WILL MEET MEMBER'S REQUIREMENTS OR THAT ACCESS TO, OR USE OF, THE REDIR.PHP WILL BE UNINTERRUPTED, TIMELY, SECURE OR ERROR-FREE. THE ENTIRE RISK ARISING OUT OF THE USE OF THE REDIR.PHP REMAINS WITH MEMBER. //5. Limitation of Liability //INFOSPACE'S LIABILITY UNDER THIS AGREEMENT SHALL BE LIMITED TO DIRECT, OBJECTIVELY MEASURABLE DAMAGES. INFOSPACE WILL NOT BE HELD LIABLE FOR ANY INDIRECT OR SPECULATIVE DAMAGES (INCLUDING, WITHOUT LIMITING THE FOREGOING, CONSEQUENTIAL, INCIDENTAL, AND SPECIAL DAMAGES) INCLUDING, BUT NOT LIMITED TO, LOSS OF USE, INJURY TO REPUTATION, BUSINESS INTERRUPTIONS, AND LOSS OF PROFITS, REGARDLESS OF WHETHER INFOSPACE HAD ADVANCE NOTICE OF THE POSSIBILITY OF ANY SUCH DAMAGES. INFOSPACE'S TOTAL LIABILITY TO MEMBER FOR ANY CLAIM ARISING OUT OF OR RELATING TO THE REDIR.PHP, WHETHER IN CONTRACT, TORT OR OTHER BASIS. //6. Indemnification //Member hereby releases, holds harmless, and indemnifies InfoSpace and its affiliates (and their respective employees, directors and representatives) against any and all claims, actions, proceedings, suits, liabilities, damages, settlements, penalties, fines, costs or expenses (including, without limitation, reasonable attorneys' fees and other litigation expenses), arising out of or relating to (a) the violation or breach of any term, condition, representation or warranty of this Agreement by Member; (b) Member's use of the REDIR.PHP ; or (c) Member's violation, alleged violation, or misappropriation of any intellectual property right (including, without limitation, trademark, copyright, patent, trade secrets) or nonproprietary right of a third party (including, without limitation, defamation, libel, violation of privacy or publicity). //*************************************** //grab and unencode the querystring //*************************************** //grab the querystring.. $query = $_GET['result']; //decode the querystring.. $this->redir = base64_decode("$query"); //*************************************** //see if we have a paid or unpaid listing //and set our vars to parse between //*************************************** $paid = "overture_uk"; $pos = strpos($this->redir, $paid); if ($pos === false) { $paid = "gsl_paid"; $pos = strpos($this->redir, $paid); } if ($pos === false) { $paid = "espotting_uk"; $pos = strpos($this->redir, $paid); } if ($pos === false) { $paid = "mirago_uk"; $pos = strpos($this->redir, $paid); } if ($pos === false) { $paid = "turbo10_uk"; $pos = strpos($this->redir, $paid); } if ($pos === false) { $paid = "webfinder.uk"; $pos = strpos($this->redir, $paid); } if ($pos === false) { // we have an unpaid listing $sponType = "Unpaid lisiting click, "; $str1 = "&query="; $str2 = "&rawto="; } else { // we have an paid listing $sponType = "Paid listing click, "; $str1 = "&query="; $str2 = "&qq="; } $logOutput = $sponType .$this->remover($this->redir, $str1, $str2) . "," . date("r") ."|"; if (isset($this->infospace_logname)) { //open or create the log file $fp = fopen($this->logname, "a" ); //write to the file fwrite($fp, $logOutput); //close the file pointer fclose($fp); } break; ######################################################################################## case "overture": // handles all overture feeds ######################################################################################## $this->debugclass->debugit("Executing Overture redirect"); break; ######################################################################################## case "generic": // generic redirect ######################################################################################## $this->debugclass->debugit("Executing Generic Redirect"); break; } $this->doTracking(); if (DEBUG !== true) { header("Location: " .$this->redir); } else { $this->debugclass->debugit("Redirect Disabled for Debugging", $this->redir); } } ######################################################################################## function doTracking() { ######################################################################################## $this->tracking = new myTrackingClass(); $this->debugclass->debugit("", "", get_class($this).":doTracking()"); if ($this->blnGoogleTracking === true) { // if we are doing google tracking, read the array to get values, and initialize values $this->debugclass->debugit("dealing with a google tracker"); $this->tracking->clickTrackingType = "google"; $this->tracking->clickTrackingMaxbid = $this->maxbid; $this->tracking->clickTrackingTitle = $this->title; $this->tracking->getGoogleDataFromSession(); } elseif ($this->blnGenericTracking === true) { // we're doing generic tracking, initialize // this doesn't require any session data to be set $this->debugclass->debugit("dealing with a generic tracker"); $this->tracking->clickTrackingType = "generic"; } $this->tracking->redirClickTracking(); } ######################################################################################## function remover($string, $sep1, $sep2) { // grabs the info we required for the INSP logfile ######################################################################################## $this->debugclass->debugit("", "", get_class($this).":remover()"); $string = substr($string, 0, strpos($string,$sep2)); $string = substr(strstr($string, $sep1), 1); return $string; } ######################################################################################## function errorCode($code, $err="", $feed="") { ######################################################################################## switch ($code) { case 0: $this->error = "You need to define a feedtype by setting one of the following to true: $someclass->blnSearch123, $someclass->blnOverture, or $someclass->blnInfospace
"; break; } } } ?>