branded = true; $styleOverride->branded = true; } define("serverRoot", "http://" . $_SERVER["SERVER_NAME"]); /** * Check to see if the page is to be embedded. */ $isEmbedded = false; if (isset($_GET['embed']) && $_GET['embed'] == 1) $isEmbedded = true; //Delete Favorites if (isset($_GET["deleteFavorites"])) { $favorites = $_SESSION["favorites"]; foreach ($favorites as $listingid) unset($favorites[$listingid]); $_SESSION["favorites"] = $favorites; } //Set Favorites $favorites = array(); if (isset($_SESSION["favorites"]) && ($_SESSION["favorites"])) foreach ($_SESSION["favorites"] as $listingid) $favorites[] = new Listing($listingid); //init variable we'll need $htmlOut = new HTMLOutput(); $displayListings2 = new DisplayListings(); $agent = new Agent($_GET["AgentID"], $createNew = false); if ($agent->getField(agentTableCoAgentID)) header("Location: ?AgentID=" . $agent->getField(agentTableCoAgentID) . (isset($_GET["branded"]) ? "&branded=1" : "")); $agent->setBranded($_GET); if (!$agent->exists()) die("Invalid AgentID!"); $company = new Company($agent->getField(agentTableCompanyID), $createNew=false); $stats = new AWStats(); $miscQuery = new MiscQuery(); // Get Custom Title and Meta Data - if no data in these fields, we use the default data $agenttitletagdata = $agent->getField(TitleTag); $agentmetadescription = $agent->getField(MetaDescription); $agentmetakeywords = $agent->getField(MetaKeywords); $pickListings = $_GET["pickListings"]; if (!$pickListings) $pickListings = 0; //save selected featured listings if (isset($_POST["showStripped1"]) || isset($_POST["showStripped2"])) { if (isset($_POST["showStripped1"])) $agent->saveFeaturedListings(false, explode(",",$_COOKIE["listings"]), $_POST["order"], $_POST[agentTableNormalFeaturedListingsOptions]); else $agent->saveFeaturedListings(true, explode(",",$_COOKIE["listings"]), $_POST["order"], $_POST[agentTableStrippedFeaturedListingsOptions]); header("Location: AgentInfo.php?AgentID=" . $agent->getAgentID() . "&branded=1"); } //save featured, but with search criteria if (isset($_POST["saveSearch1"]) || isset($_POST["saveSearch2"])) { if (isset($_POST["saveSearch1"])) $agent->saveFeaturedSearch(false, $_POST["searchCriteria"], $_POST["order"], $_POST[agentTableNormalFeaturedListingsOptions]); else $agent->saveFeaturedSearch(true, $_POST["searchCriteria"], $_POST["order"], $_POST[agentTableStrippedFeaturedListingsOptions]); } if ( ($PTID = $agent->getField(agentTablePTID)) == 0) $PTID = 1939; //load featured listings /*if (isset($_GET["stripped"]) || $_GET["pickListings"] == 3) if (strlen($agent->getField(agentTableFeaturedSearch2)) > 2) $featuredListings = searchResults(array_combine(searchCriteriaKeys(),explode(",",$agent->getField(agentTableFeaturedSearch2)) ), $agent->getField(agentTableFeaturedOrder2), $agent); else $featuredListings = $agent->listings(featuredListings2); else */ if (strlen($agent->getField(agentTableFeaturedSearch1)) > 2) $featuredListings = searchResults(array_combine(searchCriteriaKeys(),$agent->getSavedSearchCriteria() ), $agent->getField(agentTableFeaturedOrder1), $agent); else $featuredListings = $agent->listings(featuredListings1); function removeOrder($string) { if (strpos($string, "Order") !== 0) return false; $index = strpos($string, ","); return substr($string, $index+1); } function printButton($id, $src, $array, $url, $height=106, $button) { $src = $src . '?treeColor=' . $array[0] . '&towerColor=' . $array[1] . '&borderColor=' . $array[2] . '&bgoutColor=' . $array[3] . '&bginColor=' . $array[4] . '&boxColor=' . $array[5] . '&textColor2=' . $array[6] . '&textColor1=' . $array[7] . '&action=' . $url; switch($button) { case agentinfo: $return = '
'; break; case sbliving: $return = ''; break; case sbinfo: $return = ''; break; case renewsandinfo: $return = ''; break; case searchmls: $return = ''; break; case spt: $return = ''; break; case iframe-sbliving: $return = ''; break; } $return .= ""; return $return; } function openWindow($type,$url, $name, $width="''", $height="''",$other="'toolbar=yes,scrollbars=yes,sizable=yes'") { if ($type == 0) //normal link return $url; else return "javascript:openWindow('" . $url ."','" . $name . "'," . $width . "," . $height . "," . $other . ")"; } //load saved featured listings to pick from if (isset($_GET["updateFeatured"])) { if ($_GET["updateFeatured"] == 1) $listingsString = removeOrder($agent->getField(agentTableNormalFeaturedListings)); else $listingsString = removeOrder($agent->getField(agentTableStrippedFeaturedListings)); header("Location: /preview/AgentInfo.php?AgentID=" . $agent->getAgentID() . "&selectAll=1&branded=1&listings=1&pickListings=" . $pickListings . "&displayListings=" . $listingsString); } //$profile = new AgentProfile($agent->getAgentID()); //$profile = strlen($agent->getField(agentTableColorSettings)); //temporary if (isset($_GET["search"])) $searchListings = searchResults($_POST, 1,$agent); $activeListings = $agent->listings(activeListings); $soldListings = $agent->listings(soldListings); $activeAndSoldListings = $agent->listings(activeAndSoldListings); /* load special listings - special listings were initially created for agents that are using our IDX for active listings but also want to show listings that are not in the MLS e.g., pocket listings, preMLS marketing of listings, etc. */ $specialListings = $agent->listings(specialListings); $specialListingsTitle = $agent->getField(agentTableSpecialListingsTitle); //var_dump($specialListings); $numListings = 0; if (isset($_GET["displayListings"]) && !isset($_GET["search"])) { $order = 0; if (isset($_GET["pickListings"]) && $_GET["pickListings"] == 2) $order = $agent->getField(agentTableFeaturedOrder1); if (isset($_GET["pickListings"]) && $_GET["pickListings"] == 3) $order = $agent->getField(agentTableFeaturedOrder2); $displayListings = $agent->listings(customListings,$order,$_GET["displayListings"]); } else if (isset($_GET["pickListings"])) { if (isset($_GET["search"])) $displayListings = $searchListings; else $displayListings = $featuredListings; } //this is instead of the old printurl function $queryString = ""; if ($agent->branded()) $queryString .= "branded=1&"; $queryString .= "AgentID=" . $agent->getAgentID(); if (isset($_GET["pickListings"])) $queryString .= "&pickListings=" . $_GET["pickListings"]; if (isset($_GET["displayListings"])) $queryString .= "&displayListings=" . $_GET["displayListings"]; if (isset($_GET["stripped"])) $queryString .= "&stripped=" . $_GET["stripped"]; // Set Flash Agent Buttons to use styleID colors if (isset($_GET['styleID']) && $styleOverride->exists()) $buttonSettings = $styleOverride->getButtonColors(); else $buttonSettings = $agent->getButtonColors(); $cssAgent = new Agent($agent->cssAgentID()); if (!$cssAgent->unbrandedColors()) $cssAgent->setBranded($_GET); // Set Flash Properties For Sale/Rental Properties to use styleID colors if ($agent->branded() && $agent->enhanced() && !isset($_GET['styleID'])) { $colorSetting = $agent->getProfileColors(); } elseif (isset($_GET['styleID']) && $styleOverride->exists()) { $colorSetting = $styleOverride->getProfileColors(); } else { $colorSetting = $cssAgent->getProfileColors(); } $tabFontColor = $colorSetting[4]; $tabBGColor = $colorSetting[3]; $rentaltabcolor = $colorSetting[15]; if ($agent->getField(agentTableArea) == "SYV") $mls = "Santa Ynez"; ?>| branded(), $_GET["stripped"]); } else { // put in banner of style agent echo printBanner($styleOverride, $agent->branded(), $_GET["stripped"]); }?> |
|
|||||||||||||||||||||||||||||||||||||||||
| branded()); ?> | |||||||||||||||||||||||||||||||||||||||||