1){ define('SITE_TITLE', $agent_info['header']); } else define('SITE_TITLE', AGENT_NAME); //print_r($agent_info); if($agent_info['show_cell'] == 1 && strlen($agent_info['tel_2']) > 2){ define('AGENT_CELL', $agent_info['tel_2']); } else define('AGENT_CELL', NULL); $pages = $agent_info['pages']; //multiple agents? if (ereg("[0-9]+", $agent_info['multi_agent'])){ define('MULTI_AGENT', 1); $agents_multi = array_filter(explode('#', $agent_info['multi_agent'])); } //styles define("NAV_STYLE", strlen($agent_info['styles']['nav']) > 2 ? $agent_info['styles']['nav'] : 'nav_white'); define("SIDEBAR_ALIGN", $agent_info['styles']['sidebar_align']); define("HP_LISTINGS", $agent_info['styles']['homepage']['listings']); define("HP_LISTINGS_CONDITIONAL", $agent_info['styles']['homepage']['listings_conditional']); define("HP_NEIGHBORHOODS", $agent_info['styles']['homepage']['neighborhoods']); //routing vars define ("SITE_SCRIPT_NAME", '../agent.php/'); define ("SITE_SCRIPT_PATH", 'agentsites_logic/'); define ("SITE_ASSETS_WEB_ROOT", '../agentsites/'); define ("SITE_ASSETS_WEB_PATH", SITE_ASSETS_WEB_ROOT.AGENT_USERNAME.'/'); define ("SITE_ASSETS_SERVER_ROOT", 'agentsites/'); define ("SITE_ASSETS_SERVER_PATH", SITE_ASSETS_SERVER_ROOT.AGENT_USERNAME.'/'); define ("PAST_LISTING_PICS_PATH", SITE_ASSETS_WEB_PATH.'property_pics/'); define ("CUR_LISTING_PICS_PATH", 'http://agent.hill-co.com/property_pics/'); //IMAGE OPTIONS //banner if (is_file(SITE_ASSETS_SERVER_PATH.'/images/banner.jpg')){ define ('HEADER_IMG', SITE_ASSETS_WEB_PATH.'/images/banner.jpg'); } else if (is_file(SITE_ASSETS_SERVER_PATH.'/images/banner.gif')){ define ('HEADER_IMG', SITE_ASSETS_WEB_PATH.'/images/banner.gif'); } else define ('HEADER_IMG', SITE_ASSETS_WEB_ROOT.'common/images/banner_default.jpg'); //subhead define ('USE_SUBHEADER', $agent_info['subheader']['show']); define ('SUBHEADER_ALIGN', $agent_info['subheader']['align']); if (is_file(SITE_ASSETS_SERVER_PATH.'/images/sub_header.jpg')){ define ('SUBHEADER_IMG', SITE_ASSETS_WEB_PATH.'images/sub_header.jpg'); } else define ('SUBHEADER_IMG', NULL); if (strlen($agent_info['subheader']['html']) > 1){ define ('SUBHEADER_TEXT', '
'.$agent_info['subheader']['html'].'
'); } else define ('SUBHEADER_TEXT', NULL); if (SUBHEADER_IMG){ define ('SUBHEADER', ''); } else define ('SUBHEADER', SUBHEADER_TEXT); //agent image if (is_file(SITE_ASSETS_SERVER_PATH.'/images/agent_img.jpg')){ define ('AGENT_IMG', SITE_ASSETS_WEB_PATH.'/images/agent_img.jpg'); } else define ('AGENT_IMG', 'http://agent.hill-co.com/agent_pics/pic_'.AGENT_ID.'.jpg'); //allowable sections $possible_sections = array('home', 'about', 'testimonials', 'listings', 'mls', 'past', 'resources', 'guide', 'cleanoffer', 'newsletter'); if($section){ define('SECTION', $section); } else{ while ($ps = each($possible_sections)){ if ($pages[$ps[1]]['on'] == 1){ $page_str = 'agentsites/'.$ps[1].'/'; define ('SECTION', $ps[1]); } } } if ($agent_info['website_phone']) define('AGENT_PHONE', $agent_info['website_phone']); else if ($agent_info['ext']) define('AGENT_PHONE', '415-321-'. $agent_info['ext']); else if ($agent_info['tel']) define('AGENT_PHONE', $agent_info['tel']); else if ($agent_info['tel2']) define('AGENT_PHONE', $agent_info['tel2']); define('FAX', $agent_info['fax']); define('RESOURCES', $agent_info['resources']); define('TEXT_MESSAGE', $agent_info['text_message']); define('CELL_NUMBER', $agent_info['cell_number']); define('CELL_CARRIER', $agent_info['cell_carrier']); if (MULTI_AGENT == 1){ $list_stmt = "SELECT PID FROM listings"; $list_stmt .= " WHERE (0 "; while ($a = each($agents_multi)){ $list_stmt .= " OR agent LIKE '%#".$a[1]."#%'"; } $list_stmt .= ")"; $list_stmt .= " AND (status = 'show' OR status = 'soon')"; reset($agents_multi); //echo $list_stmt; //exit; } else{ $list_stmt = "SELECT PID FROM listings WHERE agent LIKE '%#".AGENT_ID."#%' AND (status = 'show' OR status = 'soon');"; } $list_result = mysql_query($list_stmt, $db); if (mysql_num_rows($list_result) > 0 ){ define('HAS_ACTIVE_LISTING', 1); //echo 'listing'; } else{ define('HAS_ACTIVE_LISTING', 0); define('NO_LISTINGS', $agent_info['no_listings']);//what to do if no listings define('NO_LISTINGS_MSG', $agent_info['no_listings_msg']); } //then take the rest of the query string and use it for variables if ($pagevars){ $vars_array = array_chunk($pagevars, 2); while ($ac = each($vars_array)){ if (strlen($ac[1][0]) > 0){ eval("\$".$ac[1][0]." = '".$ac[1][1]."';"); } } } if (SECTION){ $page_str = SITE_SCRIPT_PATH.SECTION.'/'; if (SECTION == 'mls') $content_style = 'content_full'; else $content_style = 'content'; } if ($pg){ if (FALSE !== strpos($pg, '?')){ define('PAGE', substr($pg, 0, strpos($pg, '?'))); } else define('PAGE', $pg); } else define('PAGE', 'index.php'); include SITE_SCRIPT_PATH.'/include/startpage.php'; include $page_str.PAGE; include SITE_SCRIPT_PATH.'/include/endpage.php'; ?>