public function __construct($data)
 {
     # Initialize the Application Class, Establish a Database Connection
     parent::Connect(dbHost, dbUser, dbPass, dbName);
     # Set Local Array with _GET/_POST Data
     $this->localData = $data;
     # Paging Defaults
     $this->rowsPerPage = 15;
     if (!$this->localData["s"]) {
         $this->localData["s"] = 0;
     }
     # Check for Referrer
     if (isset($this->localData["ref_id"])) {
         // user has been referred
         setcookie("referrer", $this->localData["ref_id"], time() + 86400 * 3, "/");
         //
         $requestURI = rtrim(str_replace("ref_id={$this->localData["ref_id"]}", "", $_SERVER["REQUEST_URI"]), "&");
         header("Location: http://" . $_SERVER["SERVER_NAME"] . $requestURI);
     }
     # Check for Affiliate
     if (isset($this->localData["aff_id"])) {
         // affiliate referrer set
         setcookie("affiliate", $this->localData["aff_id"], time() + 86400 * 3, "/");
         //
         $requestURI = rtrim(str_replace("aff_id={$this->localData["aff_id"]}", "", $_SERVER["REQUEST_URI"]), "&");
         header("Location: http://" . $_SERVER["SERVER_NAME"] . $requestURI);
     }
     if (isset($this->localData['form-data'])) {
         # Temporarily Save Form Data into a $_SESSION
         unset($_SESSION['form-data']);
         $_SESSION['form-data'] = array();
         foreach ($this->localData as $sess_name => $sess_val) {
             # Loop Through Each Element
             if (!is_array($sess_val)) {
                 # Not Array
                 $_SESSION['form-data'][$sess_name] = $sess_val;
             } else {
                 # Array
                 foreach ($sess_val as $n => $v) {
                     $_SESSION['form-data'][$sess_name][$n] = $v;
                 }
             }
         }
     }
     if (isset($this->localData['method']) && $this->localData['b'] == 1) {
         // Call a Method
         $this->{$this->localData['method']}();
     }
 }
Exemple #2
0
 public function __construct($data)
 {
     // construct RSS Class
     $this->localData = $data;
     parent::Connect(dbHost, dbUser, dbPass, dbName);
     switch ($this->localData["feed_type"]) {
         case 'by_location':
             parent::SetQuery("SELECT * FROM `table_locations` WHERE location_id='{$this->localData["location_id"]}'");
             $locationData = parent::DoQuery();
             $this->CreateRSS("SELECT * FROM `table_offerlocations`,`table_offers` WHERE \r\n\t\t\t\t`table_offers`.`offer_id`=`table_offerlocations`.`offer_id` AND \r\n\t\t\t\t`table_offerlocations`.`location_id`='{$this->localData["location_id"]}'\r\n\t\t\t\tORDER BY expiration DESC LIMIT 15", 'Find My Monkey, Recent Deals in ' . $locationData[0]["location"], 'http://www.findmymonkey.com/offers?location_id=' . $this->localData["location_id"], 'Get the latest Monkey Deals in ' . $locationData[0]["location"] . '!');
             break;
         case 'most_recent':
             $this->CreateRSS("SELECT * FROM `table_offers` ORDER BY expiration DESC LIMIT 15", 'Find My Monkey, Deals RSS', 'http://www.findmymonkey/offers', 'Get the latest Monkey Deals for Find My Monkey.');
             break;
     }
 }
 public function __construct()
 {
     parent::Connect(dbHost, dbUser, dbPass, dbName);
     $this->localData = array_merge($_GET, $_POST);
 }