public static function getListingInfoBySID($listing_sid) { $listing_info = SJB_ListingDBManager::getListingInfoBySID($listing_sid); if (empty($listing_info)) { return null; } $listing_info['id'] = $listing_info['sid']; return $listing_info; }
private function redirectToListingByKeywords() { $arrayKeywords = SJB_Request::getVar('keywords'); if (empty($arrayKeywords)) { return; } $keywords = array_pop($arrayKeywords); if (empty($keywords)) { return; } $id_listing = intval($keywords); if ($id_listing == 0) { return; } $listing_info = SJB_ListingDBManager::getListingInfoBySID($id_listing); if (empty($listing_info)) { return; } $type = SJB_ListingTypeDBManager::getListingTypeInfoBySID($listing_info['listing_type_sid']); $listing_type = $type['id']; $arrayType = SJB_Request::getVar('listing_type'); if (empty($arrayType)) { return; } $expected_type = array_pop($arrayType); if ($expected_type != $listing_type) { return; } $id = $listing_info['sid']; $name_listing = SJB_HelperFunctions::slugify($listing_info['Title']); $type = strtolower($listing_type); SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . "/display-{$type}/{$id}/{$name_listing}.html"); }