function replace_meta_template_tags() { global $config, $lang; if (isset($_GET['listingID']) && $_GET['action'] != 'searchresults') { $listing_keywords = $this->replace_listing_field_tags($_GET['listingID'], $config['seo_listing_keywords']); $listing_keywords = strip_tags(str_replace(array("\r\n", "\r", "\n", '||'), array('', '', '', ','), $listing_keywords)); $this->page = str_replace('{load_meta_keywords}', '<meta name="keywords" content="' . $listing_keywords . '" />', $this->page); $this->page = str_replace('{load_meta_keywords_raw}', $listing_keywords, $this->page); $listing_description = $this->replace_listing_field_tags($_GET['listingID'], $config['seo_listing_description']); $listing_description = strip_tags(str_replace(array("\r\n", "\r", "\n", '||'), array('', '', '', ','), $listing_description)); $this->page = str_replace('{load_meta_description}', '<meta name="description" content="' . $listing_description . '" />', $this->page); $this->page = str_replace('{load_meta_description_raw}', $listing_description, $this->page); // Handle Site Title $listing_title = $this->replace_listing_field_tags($_GET['listingID'], $config['seo_listing_title']); $listing_title = strip_tags(str_replace(array("\r\n", "\r", "\n", '||'), array('', '', '', ','), $listing_title)); $this->page = str_replace('{site_title}', $listing_title, $this->page); } else { if ($_GET['action'] == 'view_users') { $this->page = str_replace('{load_meta_keywords}', '<meta name="keywords" content="' . $config['seo_default_keywords'] . '" />', $this->page); $this->page = str_replace('{load_meta_description}', '<meta name="description" content="' . $config['seo_default_description'] . '" />', $this->page); $this->page = str_replace('{load_meta_keywords_raw}', $config['seo_default_keywords'], $this->page); $this->page = str_replace('{load_meta_description_raw}', $config['seo_default_description'], $this->page); $this->page = str_replace('{site_title}', $config['seo_default_title'] . ' - ' . $lang['menu_view_agents'], $this->page); } else { if ($_GET['action'] == 'view_listing_image') { if (isset($_GET['image_id'])) { require_once $config['basepath'] . '/include/images.inc.php'; $title = image_handler::get_image_caption(); $this->page = str_replace('{load_meta_keywords}', '<meta name="keywords" content="' . $config['seo_default_keywords'] . '" />', $this->page); $this->page = str_replace('{load_meta_description}', '<meta name="description" content="' . $config['seo_default_description'] . '" />', $this->page); $this->page = str_replace('{load_meta_keywords_raw}', $config['seo_default_keywords'], $this->page); $this->page = str_replace('{load_meta_description_raw}', $config['seo_default_description'], $this->page); $this->page = str_replace('{site_title}', $config['seo_default_title'] . ' - ' . $title, $this->page); } else { $this->page = str_replace('{load_meta_keywords}', '<meta name="keywords" content="' . $config['seo_default_keywords'] . '" />', $this->page); $this->page = str_replace('{load_meta_description}', '<meta name="description" content="' . $config['seo_default_description'] . '" />', $this->page); $this->page = str_replace('{load_meta_keywords_raw}', $config['seo_default_keywords'], $this->page); $this->page = str_replace('{load_meta_description_raw}', $config['seo_default_description'], $this->page); $this->page = str_replace('{site_title}', $config['seo_default_title'], $this->page); } } else { if (isset($_GET['PageID'])) { require_once $config['basepath'] . '/include/page_display.inc.php'; $title = page_display::get_page_title($_GET['PageID']); $description = page_display::get_page_description($_GET['PageID']); $keywords = page_display::get_page_keywords($_GET['PageID']); if ($title == '') { $title = $config['seo_default_title']; } if ($description == '') { $description = $config['seo_default_description']; } if ($keywords == '') { $keywords = $config['seo_default_keywords']; } $this->page = str_replace('{load_meta_keywords}', '<meta name="keywords" content="' . $keywords . '" />', $this->page); $this->page = str_replace('{load_meta_description}', '<meta name="description" content="' . $description . '" />', $this->page); $this->page = str_replace('{load_meta_keywords_raw}', $keywords, $this->page); $this->page = str_replace('{load_meta_description_raw}', $description, $this->page); $this->page = str_replace('{site_title}', $title, $this->page); } else { $this->page = str_replace('{load_meta_keywords}', '<meta name="keywords" content="' . $config['seo_default_keywords'] . '" />', $this->page); $this->page = str_replace('{load_meta_description}', '<meta name="description" content="' . $config['seo_default_description'] . '" />', $this->page); $this->page = str_replace('{load_meta_keywords_raw}', $config['seo_default_keywords'], $this->page); $this->page = str_replace('{load_meta_description_raw}', $config['seo_default_description'], $this->page); $this->page = str_replace('{site_title}', $config['seo_default_title'], $this->page); } } } } }