public function event($sub = null) { $cookies = PageTool::getCookies(PageTool::getPage(), CShell::pages()); //Is this a loadtest? $loadtest = !empty($_GET[self::LOADTEST]) && $_GET[self::LOADTEST] == self::LOADTEST; //Is this a preview? $preview = !empty($_GET[self::PREVIEW]) && $_GET[self::PREVIEW] == self::PREVIEW; //Are we testing tracking? Remember to register first. $tracking = !empty($_GET[self::TRACKING]) && $_GET[self::TRACKING] == self::TRACKING; /* Look for incoming 'eid' in URL - 'eid' is user's encrypted email address appended to the /event link. This will allow us to "auto-login" a user who has previously registered if they click the link we send them in the reminder email on the day of the event. */ $e = PageTool::checkEID(); //Get the event position $ep = EventTool::getTimePos(time(), -4); //If before the event OR Not EID, not registered and not a loadtest. if (!$loadtest && ($ep == EventTool::BEFORE && !$tracking || empty($e) && !$cookies[SystemTool::getCookieName()]->set)) { $this->setCache(false); header("Location: " . PageTool::getSiteRoot()); exit; } //They are registered and this is not a loadtest if (!$loadtest) { if (!empty($e)) { $email = $e; } else { $email = base64_decode(SystemTool::sanitize($_COOKIE[SystemTool::getCookieName()], 1)); } } //Track visit if ($loadtest) { $ep = 'test'; $email = '*****@*****.**'; $this->setCache(false); } //Regardless of early entry what is the original time position? $op = EventTool::getTimePos(time()); try { $VTM = new View_trackModel(); $VTM->addRecord(CShell::track_id(), $email, $op); } catch (Exception $e) { } //Check the cache and server and exit if available. if (!$preview && APCTool::checkCache()) { $this->_return = self::CACHE; exit; } //If it's a preview clear the cache. if ($preview) { APCTool::clearCache(); } //If the page is not event/cr if (SystemTool::sanitize($sub) != self::CR) { if ($ep == EventTool::BEFORE) { $url = 'http://www.thestreetbiggold.com/go/bxhvF/TST'; $thumb = 'http://d15s74raupkmp7.cloudfront.net/sites/thestreet-biggold/images/charter-ofthumb2.png'; $copy = '<strong>And for just $75 for a one-year membership</strong> – 50% discount – you literally make up the cost and are in the black on your very first gold purchase.'; } else { $url = 'http://www.thestreetbiggold.com/go/bxg91/TST'; $thumb = 'http://d15s74raupkmp7.cloudfront.net/sites/thestreet-biggold/images/charter-ofthumb1.png'; $copy = '<strong>And for just $79 for a one-year membership</strong> – a savings of $70 off the normal price – you literally make up the cost and are in the black on your very first gold purchase.'; } } else { $this->set('cr', true); if ($ep == EventTool::BEFORE) { $url = 'http://www.caseyresearch.com/go/bxg4T/CSR'; $thumb = 'http://d15s74raupkmp7.cloudfront.net/sites/streetgold-event/images/webinar-crofthumb75.png'; $copy = '<strong>And for just $75 for a one-year membership</strong> – 41% discount – you literally make up the cost and are in the black on your very first gold purchase.'; } else { $url = $url = 'http://www.caseyresearch.com/go/bxg71/CSR'; $thumb = 'http://d15s74raupkmp7.cloudfront.net/sites/streetgold-event/images/webinar-crofthumb79.png'; $copy = '<strong>And for just $79 for a one-year membership</strong> – a savings of $50 off the normal price – you literally make up the cost and are in the black on your very first gold purchase.'; } } //Retrieve the remaining seconds before the event starts. $targetDate = $preview ? 0 : EventTool::getTargetDate(); $this->set('targetDate', $targetDate); $this->set('jwplayerkey', CShell::jwplayerkey()); $this->set('url', $url); $this->set('thumb', $thumb); $this->set('copy', $copy); }