/** * @static * @param int $listingId * @param string $ipAddress */ public static function setListingLatestViewDateByIp($listingId, $ipAddress) { $listingViewPageID = self::getListingViewPageID($ipAddress, $listingId); $pageId = SJB_System::getUserPageParentURI(SJB_Navigator::getURI()); if ($listingViewPageID) { SJB_DB::query('UPDATE `page_view` SET `date` = NOW() WHERE `id` = ?n', $listingViewPageID); } else { SJB_DB::query('INSERT INTO `page_view` SET `id_pages` = ?s, `param` = ?n, `ip_address` = ?s, `date` = NOW(), `contract_id` = 0', $pageId, $listingId, $ipAddress); } }
/** * Execute request * */ public function execute() { // send headers foreach ($this->headers as $name => $value) { $header = $name . ':' . $value; header($header, true); } if ($this->page_config->PageExists()) { echo SJB_System::getPage($this->page_config); } else { if (SJB_System::doesParentUserPageExist($this->uri)) { $uri = SJB_System::getUserPageParentURI($this->uri); $_REQUEST['passed_parameters_via_uri'] = substr($this->uri, strlen($uri)); } else { // the 404 error case! header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); // no such page in configuration $uri = '/404/'; } $this->page_config = SJB_PageConfig::getPageConfig($uri); echo SJB_System::getPage($this->page_config); } }