if (array_is_valid($foundCategoryRow)) { foreach (["state_title" => "title", "state_meta" => "meta", "x_h1_state" => "x_h1_state", "x_article_state" => "x_article_state"] as $k12 => $v12) { if (!empty(trim($foundCategoryRow[$k12]))) { ${"" . $v12} = $foundCategoryRow[$k12]; } } if (\App\Support\ConfigRuntime::isCategoryPhoneEnabled()) { if (!empty($foundCategoryRow['dn_api_phone'])) { C_Domain_Instance::setKey("dn_api_phone", $foundCategoryRow['dn_api_phone']); } if (!empty($foundCategoryRow['dn_api_phone_pool'])) { C_Domain_Instance::setKey("dn_api_phone_pool", $foundCategoryRow['dn_api_phone_pool']); } } if (!empty($__matchedApiId = \App\Helpers\AppHelper::getApiIdFromPool([$foundCategoryRow['surl_a_api_id_default'], $foundCategoryRow['surl_a_api_id_phone']]))) { $__tvar['surl_a_api_id'] = $__matchedApiId; $__tvar['surl_a_api_id_content'] = \App\Support\LeadContent::contentApiId_encrypt($__tvar['surl_a_api_id']); } $source_local_token = \App\SourceLocal\SourceLocalHelper::generateTokenString(["type" => \App\SourceLocal\SourceLocalEnum::TYPE_CATEGORY, "related_id" => $foundCategoryRow['id'], "related_uuid" => "", "related_subtype" => GeneralEnum::PAGE_TYPE_S, "related_data" => ["x_table" => $x_table]]); $__tvar['sltkn'] = $source_local_token; } } if ($category_arr[0] == url_mapping_get(GeneralEnum::URL_MAPPING_TYPE_L)) { $page_type = GeneralEnum::PAGE_TYPE_LINK_POOL; \App\LinkPool\LinkPool::setDomain($domain); $page_data = []; $page_data['link_pool'] = \App\LinkPool\LinkPool::get_listing(); $title = set_value_of_multi_for_empty([$page_data['link_pool']['title']], "Recent Posts | $domain_keyword"); $meta = "New from $domain_keyword. Updated often."; } if ($category_arr[0] == url_mapping_get(GeneralEnum::URL_MAPPING_TYPE_C)) { $content_groups_detail = \App\ContentGroups\ContentGroups::getForDetailPage(trim($category_arr[1])); $__content_groups_type = $custom_page_detail['type']; if (!empty($__content_groups_type)) { $__content_groups_type_data = $content_groups_detail['type_data_array']; } if (array_is_valid($content_groups_detail)) { $keyword_verb = set_value_of_extended($content_groups_detail['aa_library_id'], $keyword_verb); $cat_name = ucwords($keyword_verb); $content_groups_detail = \App\Support\StringRenderer::render($content_groups_detail, ["default" => ["cat_name" => $cat_name]]); if (array_is_valid($content_groups_detail['content_variables'])) { \App\Support\ContentVariables::applyToGlobal($content_groups_detail['content_variables']); } $page_type = GeneralEnum::PAGE_TYPE_CONTENT_GROUPS; $meta = $content_groups_detail['meta_description']; $title = $content_groups_detail['meta_title']; if (!empty($content_groups_detail['image_src'])) { $image_src = $content_groups_detail['image_src']; } if (!empty($content_groups_detail['image_alt'])) { $image_alt = $content_groups_detail['image_alt']; } $h1_tag = $content_groups_detail['title']; $tagline = $content_groups_detail['tagline']; $text = $content_groups_detail['content']; if (!empty($content_groups_detail['subtitle'])) { $__extend_view_custom_data['section']['h1_subtitle'] = $content_groups_detail['subtitle']; } if (!empty($content_groups_detail['breadcrumb_data'])) { $__extend_view_custom_data['section']['breadcrumb_data'] = $content_groups_detail['breadcrumb_data']; } if (array_is_valid($content_groups_detail['pagination_data'])) { $__extend_view_custom_data['section']['pagination_data'] = $content_groups_detail['pagination_data']; } if (isShowcaseEnabled("content_groups", ["build_type" => $domain_arr['build_type']])) { $showcase = \App\Support\Showcase::make($content_groups_detail); $section_showcase_data = \App\Support\Showcase::getDataRender(); } if (isReviewsEnabled("content_groups")) { $reviews = \App\Support\Reviews::make($content_groups_detail); $section_reviews_data = \App\Support\Reviews::getDataRender(); } if (isFaqEnabled("content_groups")) { $faq = \App\Support\Faq::make($content_groups_detail); $section_faq_data = \App\Support\Faq::getDataRender(); } if (isProductsEnabled("content_groups")) { $products = \App\Support\Products::make($content_groups_detail); $section_products_data = \App\Support\Products::getDataRender(); } $__skip_section = array_merge_certainly($__skip_section, array("locationfinder", "states", "cities", "counties", "locationother", "locationseodata", "categories", "custompages")); if (!empty($content_groups_detail['_page_type_include_file'])) { $page_type_include_file = "content-group-type/" . $content_groups_detail['_page_type_include_file']; } $__extend_view_custom_data['section']['content_groups_type_data'] = $__content_groups_type_data; $__tvar['current_content_group_title'] = $content_groups_detail['title']; $__tvar['current_content_group_slug'] = $content_groups_detail['_slug_plain']; $__tvar['current_content_group_rowid'] = $content_groups_detail['id']; if (!empty($__matchedApiId = \App\Helpers\AppHelper::getApiIdFromPool([$content_groups_detail['surl_a_api_id_default'], $content_groups_detail['surl_a_api_id_phone']]))) { $__tvar['surl_a_api_id'] = $__matchedApiId; $__tvar['surl_a_api_id_content'] = \App\Support\LeadContent::contentApiId_encrypt($__tvar['surl_a_api_id']); } $source_local_token = \App\SourceLocal\SourceLocalHelper::generateTokenString(["type" => \App\SourceLocal\SourceLocalEnum::TYPE_CONTENT_GROUP, "related_id" => $content_groups_detail['id'], "related_uuid" => "", "related_subtype" => $content_groups_detail['type']]); $__tvar['sltkn'] = $source_local_token; $__tvar['page_slug'] = $content_groups_detail['slug']; $precheckOtherPageType = TRUE; } } // Type g // Geo Page with City and State // Check xtable Slug Exists if (empty($page_type)) { $__data_xtable_slug_exists = querytorowarray("select * from `$x_table` where slug = '" . Security::sanitizeSqlInput(link_decode($category_arr[0])) . "'"); } if (array_is_valid($__data_xtable_slug_exists)) { $title = $geo_title; $meta = $geo_meta; // Check Url Exists In Data $ycat_slug = link_decode($category_arr[3]); $city = link_decode($category_arr[2]); $city_id = $city; $country = country_settings_property("country_id"); $otherlocation = $city; $otherlocation_id = strtolower($otherlocation); if (country_settings_property("state") === TRUE) { //Check State Exists $__data_state_exists = dataprovider_state_list_row(array("state" => link_decode($category_arr[1]), "geo" => link_decode($category_arr[2]))); if (!array_is_valid($__data_state_exists)) { $err = 1; } else { $state_full = ucwords($__data_state_exists['statefullname']); $state = strtoupper($__data_state_exists['state']); $state_abr = $state; $__tvar['current_state'] = (!empty($state)) ? $state : ""; $__tvar['current_state_id'] = (!empty($state)) ? $state : ""; $__tvar['replace_combined'] = (!empty($__data_state_exists['combined'])) ? $__data_state_exists['combined'] : ""; } //Check City Exists //$__data_check_city_exists = querytorowarray("select * from `$geo_database` where state='" . link_decode($state) . "' and geo='" . link_decode($city) . "'"); $__data_check_city_exists = \App\Support\Geo::getRowFromGeoDatabase(["type" => "state_city", "geo_database" => $geo_database, "state" => link_decode($state), "city" => link_decode($city)]); $last_name = $__data_check_city_exists['last_name']; if (!array_is_valid($__data_check_city_exists)) { $err = 1; } else { $__tvar['current_city'] = (!empty($city_id)) ? $city_id : ""; $__tvar['current_city_id'] = (!empty($city_id)) ? $city_id : ""; $__tvar['current_geo'] = (!empty($__data_check_city_exists['geo'])) ? $__data_check_city_exists['geo'] : ""; $__tvar['current_geo_rowid'] = (!empty($__data_check_city_exists['id'])) ? $__data_check_city_exists['id'] : ""; $__tvar['current_geo_type'] = (!empty($__data_check_city_exists['geo_type'])) ? $__data_check_city_exists['geo_type'] : ""; $__viewCustomerData = []; foreach (["geo_title", "geo_meta", "x_article", "x_h1_city", "x_h2", "x_h2_article", "x_h2_img_src", "bubble4_link" => "city_image"] as $k3 => $v3) { if (!empty($__data_check_city_exists[$v3])) { $__viewCustomerDataKey = (is_numeric($k3)) ? $v3 : $k3; $__viewCustomerData[$__viewCustomerDataKey] = $__data_check_city_exists[$v3]; } } App\ViewCustomizer\CDomain::runAsRuntimeVariables($__viewCustomerData, ["mapping_other" => ["title" => "geo_title", "meta" => "geo_meta", "image_src" => "bubble4_link"]]); } //Get Lat/Long $latitude = $__data_xtable_slug_exists['latitude']; $longitude = $__data_xtable_slug_exists['longitude']; //Check Category Exists $__data_check_category_exists = querynumrows("select * from `$x_table` where subcat_slug='" . Security::sanitizeSqlInput(link_decode($category_arr[3])) . "'"); if ($__data_check_category_exists == 0) { $err = 1; } //Set geo_nice (discontinued) $geo_nice = link_decode($city) . ", " . link_decode($state_full); } else { //Check Location Exists $__data_check_location_exists = querytorowarray("select * from zip_world where country = '" . country_settings_property("country_id") . "' and geo = '" . Security::sanitizeSqlInput($otherlocation) . "'"); if (!array_is_valid($__data_check_location_exists)) { $err = 1; } else { $__tvar['current_other_location'] = (!empty($otherlocation)) ? $otherlocation : ""; $__tvar['current_other_location_id'] = (!empty($otherlocation_id)) ? $otherlocation_id : ""; } //Check Category Exists $__data_check_category_exists = querynumrows("select * from `$x_table` where subcat_slug='" . Security::sanitizeSqlInput(link_decode($category_arr[3])) . "'"); if ($__data_check_category_exists == 0) { $err = 1; } //Get Lat/Long $latitude = $__data_check_location_exists['latitude']; $longitude = $__data_check_location_exists['longitude']; $percent = ""; $alias = ""; $zipcodes = ""; $geo_nice = link_decode($otherlocation); $state_full = country_settings_property("country_name"); } $page_type = GeneralEnum::PAGE_TYPE_G; $page_type_id = GeneralEnum::PAGE_ID_TYPE_G; // Get Category array # for $our_array as $t $b = 0; $found = 0; $foundCategoryRow = FALSE; if (array_is_valid($our_array)) { foreach ($our_array as $icat) { if (strtolower($our_array[$b]['subcat_slug']) == strtolower($ycat_slug)) { $found = 1; $t = $b; $foundCategoryRow = $icat; } $b++; } } if ($page_type == GeneralEnum::PAGE_TYPE_G && $found == "0") { $err = 1; $page_type = GeneralEnum::PAGE_TYPE_404; } else if (isset($category_arr['4']) && !empty($category_arr['4'])) { /** * /vinyl-flooring/ak/anchorage/fixvinyl-floor-scratches/aaa is not allowed */ $err = 1; $page_type = GeneralEnum::PAGE_TYPE_404; } $cat_name = ucwords($our_array[$t]['subcat_name']); $keyword_verb = set_value_of_extended($our_array[$t]['keyword_verb'], $keyword_verb); if (array_is_valid($foundCategoryRow)) { foreach (["city_title" => "title", "city_meta" => "meta", "x_h1_city" => "x_h1_city", "x_article_city" => "x_article", "x_h2" => "x_h2", "x_h2_article" => "x_h2_article"] as $k12 => $v12) { if (!empty(trim($foundCategoryRow[$k12]))) { ${"" . $v12} = $foundCategoryRow[$k12]; } } if (\App\Support\ConfigRuntime::isCategoryPhoneEnabled()) { if (!empty($foundCategoryRow['dn_api_phone'])) { C_Domain_Instance::setKey("dn_api_phone", $foundCategoryRow['dn_api_phone']); } if (!empty($foundCategoryRow['dn_api_phone_pool'])) { C_Domain_Instance::setKey("dn_api_phone_pool", $foundCategoryRow['dn_api_phone_pool']); } } if (!empty($__matchedApiId = \App\Helpers\AppHelper::getApiIdFromPool([$foundCategoryRow['surl_a_api_id_default'], $foundCategoryRow['surl_a_api_id_phone']]))) { $__tvar['surl_a_api_id'] = $__matchedApiId; $__tvar['surl_a_api_id_content'] = \App\Support\LeadContent::contentApiId_encrypt($__tvar['surl_a_api_id']); } $source_local_token = \App\SourceLocal\SourceLocalHelper::generateTokenString(["type" => \App\SourceLocal\SourceLocalEnum::TYPE_CATEGORY, "related_id" => $foundCategoryRow['id'], "related_uuid" => "", "related_subtype" => GeneralEnum::PAGE_TYPE_G, "related_data" => ["x_table" => $x_table]]); $__tvar['sltkn'] = $source_local_token; } // Set Session Variables for tricky location selection skipping. $_SESSION["city"] = $city; $_SESSION["state"] = $state; $_SESSION["cat"] = $our_array[$t]['subcat_slug']; $_SESSION["last_slug"] = $our_array[$t]['slug']; // Canonical Link $header_canonical = "" . "\n"; // End page_type g } // Handle Non Index pages plus 404 errors if (is_no_index(["category_arr" => $category_arr])) { $page_type = url_mapping_get_page_type($category_arr[0]); $head_addon .= "" . "\n"; } if ($domain_arr['custom_page_home_enabled'] == "1" && is_numeric($domain_arr['custom_page_home_id']) && empty($custom_page_slug)) { $__forceCustomPageID = $domain_arr['custom_page_home_id']; if ($domain_arr['custom_page_home_id'] == "0") { $custom_page_slug = $__forceCustomPageID = "index"; } } if ($__isViewCustomized) { $__forceCustomPageID = \App\ViewCustomizer\CustomPage::get(); //dump($__forceCustomPageID); } $__skipCustomPage = FALSE; if ($category_arr[0] == url_mapping_get(GeneralEnum::URL_MAPPING_TYPE_LEAD_FORM_ONLY)) { $page_type = GeneralEnum::PAGE_TYPE_LEAD_FORM_ONLY; $__skipCustomPage = TRUE; } if ($category_arr[0] == url_mapping_get(GeneralEnum::URL_MAPPING_TYPE_PIX2QUOTE)) { $template_file_override = "template.blank.php"; \App\Support\Pix2Quote_Instance::makeByCurrentRequest(); $page_type = GeneralEnum::PAGE_TYPE_PIX2QUOTE; $__skipCustomPage = TRUE; } if ($category_arr[0] == "opt" || $page_type == GeneralEnum::PAGE_TYPE_ADDITIONAL) { $__skipCustomPage = TRUE; } if (isPQProCompanyShowcaseEnabled(["page_type" => $page_type])) { $optionsActionCompanyShowcase = []; if (!empty($state_abr)) { $optionsActionCompanyShowcase['state_abr'] = $state_abr; } if (!empty($city)) { $optionsActionCompanyShowcase['city'] = $city; } //dump($optionsActionCompanyShowcase); $section_pqpro_company_showcase_data = \App\Other\PQPROCompany::cached_getDataForCompanyShowcase($optionsActionCompanyShowcase); } if (\App\Other\CentralLinkPool::isEnabled()) { $section_central_link_pool_data = \App\Other\CentralLinkPool::cached_getDataForRender(); } if ((($err == "1" || $page_type == "") || !empty($__forceCustomPageID)) && $__skipCustomPage !== TRUE) { $precheckOtherPageType = FALSE; $custom_page_detail = CustomPages::get_detail($custom_page_slug); // We're overriding with $__forceCustomPageID when we are sure url requested is not custom page if (!array_is_valid($custom_page_detail)) { $custom_page_detail = CustomPages::get_detail_by_id($__forceCustomPageID); } if ($custom_page_detail) { if (!empty($category_arr[0])) { if ($domain_arr['custom_page_home_enabled'] == "1") { if (($domain_arr['custom_page_home_id'] == "0" && $custom_page_slug == "index") || ($domain_arr['custom_page_home_id'] == $custom_page_detail['id'])) { redirect("/"); } } } $keyword_verb = set_value_of_extended($custom_page_detail['aa_library_id'], $keyword_verb); $cat_name = ucwords($keyword_verb); $custom_page_detail = CustomPages::__format_detail_for_page($custom_page_detail); if (array_is_valid($custom_page_detail['content_variables'])) { \App\Support\ContentVariables::applyToGlobal($custom_page_detail['content_variables']); } $page_type = GeneralEnum::PAGE_TYPE_CUSTOM_PAGE; $meta = $custom_page_detail['meta_description']; $title = $custom_page_detail['meta_title']; if (!empty($custom_page_detail['image_src'])) { $image_src = $custom_page_detail['image_src']; } if (!empty($custom_page_detail['image_alt'])) { $image_alt = $custom_page_detail['image_alt']; } $h1_tag = $custom_page_detail['title']; $tagline = $custom_page_detail['title_tagline']; $text = $custom_page_detail['content']; if (!empty($custom_page_detail['title_sub'])) { $__extend_view_custom_data['section']['h1_subtitle'] = $custom_page_detail['title_sub']; } if (!empty($custom_page_detail['breadcrumb_data'])) { $__extend_view_custom_data['section']['breadcrumb_data'] = $custom_page_detail['breadcrumb_data']; } if (!empty($custom_page_detail['dn_api_phone'])) { C_Domain_Instance::setKey("dn_api_phone", $custom_page_detail['dn_api_phone']); } if (!empty($custom_page_detail['dn_api_phone_pool'])) { C_Domain_Instance::setKey("dn_api_phone_pool", $custom_page_detail['dn_api_phone_pool']); } $__skip_section = array_merge_certainly($__skip_section, array("locationfinder", "states", "cities", "counties", "locationother", "locationseodata", "categories")); $__tvar['current_page_title'] = $custom_page_detail['title']; $__tvar['current_page_slug'] = $custom_page_detail['_slug_plain']; $__tvar['current_page_rowid'] = $custom_page_detail['id']; if (!empty($__matchedApiId = \App\Helpers\AppHelper::getApiIdFromPool([$custom_page_detail['surl_a_api_id_default'], $custom_page_detail['surl_a_api_id_phone']]))) { $__tvar['surl_a_api_id'] = $__matchedApiId; $__tvar['surl_a_api_id_content'] = \App\Support\LeadContent::contentApiId_encrypt($__tvar['surl_a_api_id']); } $source_local_token = \App\SourceLocal\SourceLocalHelper::generateTokenString(["type" => \App\SourceLocal\SourceLocalEnum::TYPE_CUSTOM_PAGE, "related_id" => $custom_page_detail['id'], "related_uuid" => "", "related_subtype" => $custom_page_detail['type']]); $__tvar['sltkn'] = $source_local_token; $optionsActionCustomPages = ["exclude_id" => $custom_page_detail['id'], "list_homepage_type" => "other_pages"]; $section_custompages_links = CustomPages::get_list_on_homepage($optionsActionCustomPages); $precheckOtherPageType = TRUE; $__custom_page_type = $custom_page_detail['type']; if (!empty($__custom_page_type)) { $__custom_page_type_data = json_decode($custom_page_detail['type_data'], TRUE); } switch ($__custom_page_type) { case CustomPages::CUSTOM_PAGE_TYPE_AMAZON_PRODUCT_LISTING: $page_type = GeneralEnum::PAGE_TYPE_CUSTOM_PAGE_TYPE; $page_type_include_file = "custom-page-type/amazon_product_listing.php"; $amazon_product_listing_data = \App\Other\SAmazon::getListingDetail($__custom_page_type_data['s_amazon_id']); $__extend_view_custom_data['section']['amazon_product_listing_data'] = $amazon_product_listing_data; break; case CustomPages::CUSTOM_PAGE_TYPE_TEST_01: $page_type = GeneralEnum::PAGE_TYPE_CUSTOM_PAGE; $page_type_include_file = "custom-page-type/test_01.php"; break; case CustomPages::CUSTOM_PAGE_TYPE_EXTRA: /* switch ($__custom_page_type_data['rid']) { } */ break; case CustomPages::CUSTOM_PAGE_TYPE_SERVICES: $page_type = GeneralEnum::PAGE_TYPE_CUSTOM_PAGE_TYPE; $page_type_include_file = "custom-page-type/services.php"; $section_custompages_links = CustomPages::get_list_on_services(); break; case CustomPages::CUSTOM_PAGE_TYPE_LOCATION: $page_type = GeneralEnum::PAGE_TYPE_CUSTOM_PAGE_TYPE; $page_type_include_file = "custom-page-type/location.php"; $page_data = []; $page_data['location_map_url'] = \App\Other\PhotoDataLibrary::generateRenderUrl(["type" => \App\Other\PhotoDataLibrary::TYPE_LOCATION_MAP_LOCATION]); break; case CustomPages::CUSTOM_PAGE_TYPE_AREYOUCONTRACTOR: $page_type = GeneralEnum::PAGE_TYPE_CUSTOM_PAGE_TYPE; $page_type_include_file = "custom-page-type/areyoucontractor.php"; $section_custompages_links = CustomPages::get_list_on_services(); break; case CustomPages::CUSTOM_PAGE_TYPE_CONTENT_01: case CustomPages::CUSTOM_PAGE_TYPE_CONTENT_02: case CustomPages::CUSTOM_PAGE_TYPE_CONTENT_03: case CustomPages::CUSTOM_PAGE_TYPE_BLOG_POST: $mappingViewFile = [ CustomPages::CUSTOM_PAGE_TYPE_CONTENT_01 => "content_01.php", CustomPages::CUSTOM_PAGE_TYPE_CONTENT_02 => "content_02.php", CustomPages::CUSTOM_PAGE_TYPE_CONTENT_03 => "content_03.php", CustomPages::CUSTOM_PAGE_TYPE_BLOG_POST => "blog_post.php", ]; $mappingViewFileSelected = $mappingViewFile[$__custom_page_type]; $page_type = GeneralEnum::PAGE_TYPE_CUSTOM_PAGE_TYPE; if (!empty($mappingViewFileSelected)) { $page_type_include_file = "custom-page-type/" . $mappingViewFileSelected; $__extend_view_custom_data['section']['custom_page_type_data'] = $__custom_page_type_data; } break; } //$page_type_include_file = "custom-page-type/" . "blog_post.php"; //$page_type = GeneralEnum::PAGE_TYPE_CUSTOM_PAGE_TYPE; //$page_type_include_file = "custom-page-type/" . "content_03.php"; //dump($__custom_page_type); //exit(); if (!empty($category_arr[0])) { // We are only allowing noindex for non-homepage custom-pages if ($custom_page_detail['noindex'] === "1") { $head_addon .= "" . "\n"; } } $optionsActionData = [ 'id' => $custom_page_detail['id'], 'content_group_id' => $custom_page_detail['content_group_id'], 'surl_a_api_id_default' => $custom_page_detail['surl_a_api_id_default'], 'surl_a_api_id_phone' => $custom_page_detail['surl_a_api_id_phone'], 'limit' => 9, // Optional limit "type" => $custom_page_detail['type'], "_other" => [ "title" => $custom_page_detail['title'], "slug" => $custom_page_detail['slug'], "href_title" => $custom_page_detail['href_title'], ], ]; $section_custompages_other_links = \App\CustomPages\CustomPagesLinkTree::getRenderDataSimple($optionsActionData); $__tvar['page_slug'] = $custom_page_detail['slug']; /** * Check canonical domain */ // Removed on 2025-02-20 /* switch (current_domain_url()) { case \App\Support\DomainEnum::DOMAIN_HENSLEYBROTHERS_COM: // We are only enabling for old records. if ($custom_page_detail['id'] <= 169586) { $__canonical_url = "https://" . "hensleypro.com" . "/" . $custom_page_detail['slug']; $header_canonical = "" . "\n"; } break; } */ } if (!$precheckOtherPageType) { if ($indexNowApiKey = isIndexNowEnabled()) { if ($real_slug == $indexNowApiKey . ".txt") { $page_type = GeneralEnum::PAGE_TYPE_INDEXNOWVERIFICATIONFILE; header('Content-type: plain/text'); echo $indexNowApiKey; exit(); } } } } if ($err == "1" || $page_type == "") { // 404 header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found"); $page_type = GeneralEnum::PAGE_TYPE_404; } $__site_phone = site_phone_get(); $__site_phone_link = format_phone_to_link($__site_phone); \App\PhoneTracker\PhoneTracker::setData(["phone" => $__site_phone, "url" => current_url_extended(), "domain" => $domain]); $__variableSelected = []; $__variableSelected['cat_name'] = set_value_of_multi([$cat_name, $our_array[$t]['subcat_name']], ""); $__variableSelected['cat_name_lower'] = strtolower($__variableSelected['cat_name']); $__variableSelected['cat_title'] = set_value_of_multi([$cat_title, $our_array[$t]['subcat_title']], ""); $__variableSelected['keyword_verb'] = set_value_of_multi([$our_array[$t]['keyword_verb'], $keyword_verb], ""); $__variableSelected['geo'] = set_value_of_multi([$geo, $city], "your area"); $__variableSelected['city'] = set_value_of_multi([$city], "your area"); $__variableSelected['city_uc'] = set_value_of_multi([$city], "Your Area"); //dump($__variableSelected, $cat_name, $keyword_verb); // String Replacements // Get all the columns and make variables for them $x_h1_index = str_replace("{{main_keyword}}", ucwords($x_main_keyword), $x_h1_index); $x_h1_index = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $x_h1_index); $x_h1_index = str_replace("{{domain_keyword}}", $domain_keyword, $x_h1_index); $x_h1_index = str_replace("{{domain_nice}}", $domain_nice, $x_h1_index); $x_h1_index = str_replace("{{city}}", $__variableSelected['city_uc'], $x_h1_index); $x_h1_index = str_replace("{{city_only}}", ucwords($city_only), $x_h1_index); $x_h1_index = str_replace("{{state}}", $state_full, $x_h1_index); $x_h1_index = str_replace("{{a_pro}}", ucwords($x_pro), $x_h1_index); $x_h1_index = str_replace("{{pro_singular}}", ucwords($x_pro_singular), $x_h1_index); $x_h1_index = str_replace("{{pro_plural}}", ucwords($x_pro_plural), $x_h1_index); $x_h1_index = str_replace("{{cat_title}}", ucwords($__variableSelected['cat_title']), $x_h1_index); $x_h1_index = str_replace("{{cat_name}}", ucwords($__variableSelected['cat_name']), $x_h1_index); $x_h1_index = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name_lower'], $x_h1_index); $x_h1_index = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $x_h1_index); $x_h1_index = str_replace("{{state_full}}", ucwords($state_full), $x_h1_index); $x_h1_index = str_replace("{{combined}}", $__tvar['replace_combined'], $x_h1_index); $x_h1_index = str_replace("{{phone}}", $__site_phone, $x_h1_index); $x_h1_index = str_replace("{{phone_link}}", $__site_phone_link, $x_h1_index); $h1_tag = str_replace("{{domain_keyword}}", $domain_keyword, $h1_tag); $h1_tag = str_replace("{{domain_nice}}", $domain_nice, $h1_tag); $h1_tag = str_replace("{{city}}", $__variableSelected['city_uc'], $h1_tag); $h1_tag = str_replace("{{city_only}}", ucwords($city_only), $h1_tag); $h1_tag = str_replace("{{state}}", $state_full, $h1_tag); $h1_tag = str_replace("{{cat_title}}", ucwords($__variableSelected['cat_title']), $h1_tag); $h1_tag = str_replace("{{cat_name}}", ucwords($__variableSelected['cat_name']), $h1_tag); $h1_tag = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name_lower'], $h1_tag); $h1_tag = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $h1_tag); $h1_tag = str_replace("{{state_full}}", ucwords($state_full), $h1_tag); $h1_tag = str_replace("{{combined}}", $__tvar['replace_combined'], $h1_tag); $h1_tag = str_replace("{{phone}}", $__site_phone, $h1_tag); $h1_tag = str_replace("{{phone_link}}", $__site_phone_link, $h1_tag); $title = str_replace("{{main_keyword}}", ucwords($x_main_keyword), $title); $title = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $title); $title = str_replace("{{domain_keyword}}", ucwords($domain_keyword), $title); $title = str_replace("{{domain_nice}}", $domain_nice, $title); $title = str_replace("{{city}}", $__variableSelected['city_uc'], $title); $title = str_replace("{{city_only}}", ucwords($city_only), $title); $title = str_replace("{{state}}", ucwords($state_full), $title); $title = str_replace("{{a_pro}}", ucwords($x_pro), $title); $title = str_replace("{{pro_singular}}", ucwords($x_pro_singular), $title); $title = str_replace("{{pro_plural}}", ucwords($x_pro_plural), $title); $title = str_replace("{{cat_title}}", ucwords($__variableSelected['cat_title']), $title); $title = str_replace("{{cat_name}}", ucwords($__variableSelected['cat_name']), $title); $title = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name'], $title); $title = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $title); $title = str_replace("{{geo_nice}}", $geo_nice, $title); $title = str_replace("{{combined}}", $__tvar['replace_combined'], $title); $title = str_replace("{{phone}}", $__site_phone, $title); $title = str_replace("{{phone_link}}", $__site_phone_link, $title); //dump($title, $t); $meta = str_replace("{{main_keyword}}", $x_main_keyword, $meta); $meta = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $meta); $meta = str_replace("{{domain_keyword}}", ucwords($domain_keyword), $meta); $meta = str_replace("{{domain_nice}}", $domain_nice, $meta); $meta = str_replace("{{city}}", $__variableSelected['city_uc'], $meta); $meta = str_replace("{{city_only}}", ucwords($city_only), $meta); $meta = str_replace("{{state}}", ucwords($state_full), $meta); $meta = str_replace("{{a_pro}}", $x_pro, $meta); $meta = str_replace("{{pro_singular}}", $x_pro_singular, $meta); $meta = str_replace("{{pro_plural}}", $x_pro_plural, $meta); $meta = str_replace("{{cat_title}}", $__variableSelected['cat_title'], $meta); $meta = str_replace("{{cat_name}}", $__variableSelected['cat_name'], $meta); $meta = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name_lower'], $meta); $meta = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $meta); $meta = str_replace("{{geo_nice}}", $geo_nice, $meta); $meta = str_replace("{{combined}}", $__tvar['replace_combined'], $meta); $meta = str_replace("{{phone}}", $__site_phone, $meta); $meta = str_replace("{{phone_link}}", $__site_phone_link, $meta); $meta = ucfirst($meta); $article_heading = str_replace("{{main_keyword}}", $x_main_keyword, $article_heading); $article_heading = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $article_heading); $article_heading = str_replace("{{domain_keyword}}", $domain_keyword, $article_heading); $article_heading = str_replace("{{domain_nice}}", $domain_nice, $article_heading); $article_heading = str_replace("{{city}}", $__variableSelected['city_uc'], $article_heading); $article_heading = str_replace("{{city_only}}", ucwords($city_only), $article_heading); $article_heading = str_replace("{{state}}", $state_full, $article_heading); $article_heading = str_replace("{{a_pro}}", $x_pro, $article_heading); $article_heading = str_replace("{{pro_singular}}", $x_pro_singular, $article_heading); $article_heading = str_replace("{{pro_plural}}", $x_pro_plural, $article_heading); $article_heading = str_replace("{{cat_title}}", $__variableSelected['cat_title'], $article_heading); $article_heading = str_replace("{{cat_name}}", $__variableSelected['cat_name'], $article_heading); $article_heading = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name_lower'], $article_heading); $article_heading = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $article_heading); $article_heading = str_replace("{{state_full}}", ucwords($state_full), $article_heading); $article_heading = str_replace("{{geo_nice}}", $geo_nice, $article_heading); $article_heading = str_replace("{{combined}}", $__tvar['replace_combined'], $article_heading); $article_heading = str_replace("{{{phone}}}", $__site_phone, $article_heading); $article_heading = str_replace("{{phone_link}}", $__site_phone_link, $article_heading); $x_index_title = str_replace("{{main_keyword}}", ucwords($x_main_keyword), $x_index_title); $x_index_title = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $x_index_title); $x_index_title = str_replace("{{domain_keyword}}", $domain_keyword, $x_index_title); $x_index_title = str_replace("{{domain_nice}}", $domain_nice, $x_index_title); $x_index_title = str_replace("{{city}}", $__variableSelected['city_uc'], $x_index_title); $x_index_title = str_replace("{{city_only}}", ucwords($city_only), $x_index_title); $x_index_title = str_replace("{{state}}", $state_full, $x_index_title); $x_index_title = str_replace("{{a_pro}}", $x_pro, $x_index_title); $x_index_title = str_replace("{{pro_singular}}", $x_pro_singular, $x_index_title); $x_index_title = str_replace("{{pro_plural}}", $x_pro_plural, $x_index_title); $x_index_title = str_replace("{{cat_title}}", ucwords($__variableSelected['cat_title']), $x_index_title); $x_index_title = str_replace("{{cat_name}}", ucwords($__variableSelected['cat_name']), $x_index_title); $x_index_title = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name_lower'], $x_index_title); $x_index_title = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $x_index_title); $x_index_title = str_replace("{{state_full}}", ucwords($state_full), $x_index_title); $x_index_title = str_replace("{{geo_nice}}", $geo_nice, $x_index_title); $x_index_title = str_replace("{{combined}}", $__tvar['replace_combined'], $x_index_title); $x_index_title = str_replace("{{phone}}", $__site_phone, $x_index_title); $x_index_title = str_replace("{{phone_link}}", $__site_phone_link, $x_index_title); $x_index_meta = str_replace("{{main_keyword}}", $x_main_keyword, $x_index_meta); $x_index_meta = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $x_index_meta); $x_index_meta = str_replace("{{domain_keyword}}", $domain_keyword, $x_index_meta); $x_index_meta = str_replace("{{domain_nice}}", $domain_nice, $x_index_meta); $x_index_meta = str_replace("{{city}}", $__variableSelected['city_uc'], $x_index_meta); $x_index_meta = str_replace("{{state}}", $state_full, $x_index_meta); $x_index_meta = str_replace("{{a_pro}}", $x_pro, $x_index_meta); $x_index_meta = str_replace("{{pro_singular}}", $x_pro_singular, $x_index_meta); $x_index_meta = str_replace("{{pro_plural}}", $x_pro_plural, $x_index_meta); $x_index_meta = str_replace("{{cat_title}}", $__variableSelected['cat_title'], $x_index_meta); $x_index_meta = str_replace("{{cat_name}}", $__variableSelected['cat_name'], $x_index_meta); $x_index_meta = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name_lower'], $x_index_meta); $x_index_meta = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $x_index_meta); $x_index_meta = str_replace("{{state_full}}", ucwords($state_full), $x_index_meta); $x_index_meta = str_replace("{{geo_nice}}", $geo_nice, $x_index_meta); $x_index_meta = str_replace("{{combined}}", $__tvar['replace_combined'], $x_index_meta); $x_index_meta = str_replace("{{phone}}", $__site_phone, $x_index_meta); $x_index_meta = str_replace("{{phone_link}}", $__site_phone_link, $x_index_meta); $x_article = str_replace("{{main_keyword}}", $x_main_keyword, $x_article); $x_article = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $x_article); $x_article = str_replace("{{domain_keyword}}", $domain_keyword, $x_article); $x_article = str_replace("{{domain_nice}}", $domain_nice, $x_article); $x_article = str_replace("{{city}}", $__variableSelected['city'], $x_article); $x_article = str_replace("{{city_only}}", $city_only, $x_article); $x_article = str_replace("{{state}}", $state_full, $x_article); $x_article = str_replace("{{a_pro}}", $x_pro, $x_article); $x_article = str_replace("{{pro_singular}}", $x_pro_singular, $x_article); $x_article = str_replace("{{pro_plural}}", $x_pro_plural, $x_article); $x_article = str_replace("{{cat_title}}", $__variableSelected['cat_title'], $x_article); $x_article = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $x_article); $x_article = str_replace("{{state_full}}", ucwords($state_full), $x_article); $x_article = str_replace("{{geo_nice}}", $geo_nice, $x_article); $x_article = str_replace("{{combined}}", $__tvar['replace_combined'], $x_article); $x_article = str_replace("{{phone}}", $__site_phone, $x_article); $x_article = str_replace("{{phone_link}}", $__site_phone_link, $x_article); $x_article_index = str_replace("{{main_keyword}}", $x_main_keyword, $x_article_index); $x_article_index = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $x_article_index); $x_article_index = str_replace("{{domain_keyword}}", $domain_keyword, $x_article_index); $x_article_index = str_replace("{{domain_nice}}", $domain_nice, $x_article_index); $x_article_index = str_replace("{{city}}", $__variableSelected['city'], $x_article_index); $x_article_index = str_replace("{{city_only}}", $city_only, $x_article_index); $x_article_index = str_replace("{{state}}", $state_full, $x_article_index); $x_article_index = str_replace("{{a_pro}}", $x_pro, $x_article_index); $x_article_index = str_replace("{{pro_singular}}", $x_pro_singular, $x_article_index); $x_article_index = str_replace("{{pro_plural}}", $x_pro_plural, $x_article_index); // We are replacing them on page level with some custom logic, this is why they are disabled here. //$x_article_index = str_replace("{{cat_title}}", strtolower($__variableSelected['cat_title']), $x_article_index); //$x_article_index = str_replace("{{cat_name}}", strtolower($__variableSelected['cat_name']), $x_article_index); $x_article_index = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $x_article_index); $x_article_index = str_replace("{{state_full}}", ucwords($state_full), $x_article_index); $x_article_index = str_replace("{{geo_nice}}", $geo_nice, $x_article_index); $x_article_index = str_replace("{{combined}}", $__tvar['replace_combined'], $x_article_index); $x_article_index = str_replace("{{phone}}", $__site_phone, $x_article_index); $x_article_index = str_replace("{{phone_link}}", $__site_phone_link, $x_article_index); $x_article_state = str_replace("{{main_keyword}}", $x_main_keyword, $x_article_state); $x_article_state = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $x_article_state); $x_article_state = str_replace("{{domain_keyword}}", $domain_keyword, $x_article_state); $x_article_state = str_replace("{{domain_nice}}", $domain_nice, $x_article_state); $x_article_state = str_replace("{{city}}", $__variableSelected['city'], $x_article_state); $x_article_state = str_replace("{{city_only}}", $city_only, $x_article_state); $x_article_state = str_replace("{{state}}", $state_full, $x_article_state); $x_article_state = str_replace("{{a_pro}}", $x_pro, $x_article_state); $x_article_state = str_replace("{{pro_singular}}", $x_pro_singular, $x_article_state); $x_article_state = str_replace("{{pro_plural}}", $x_pro_plural, $x_article_state); $x_article_state = str_replace("{{cat_title}}", $__variableSelected['cat_title'], $x_article_state); $x_article_state = str_replace("{{cat_name}}", $__variableSelected['cat_name'], $x_article_state); $x_article_state = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name_lower'], $x_article_state); $x_article_state = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $x_article_state); $x_article_state = str_replace("{{state_full}}", ucwords($state_full), $x_article_state); $x_article_state = str_replace("{{geo_nice}}", $geo_nice, $x_article_state); $x_article_state = str_replace("{{combined}}", $__tvar['replace_combined'], $x_article_state); $x_article_state = str_replace("{{phone}}", $__site_phone, $x_article_state); $x_article_state = str_replace("{{phone_link}}", $__site_phone_link, $x_article_state); $x_h1_index_cat = str_replace("{{main_keyword}}", ucwords($x_main_keyword), $x_h1_index_cat); $x_h1_index_cat = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $x_h1_index_cat); $x_h1_index_cat = str_replace("{{domain_keyword}}", $domain_keyword, $x_h1_index_cat); $x_h1_index_cat = str_replace("{{domain_nice}}", $domain_nice, $x_h1_index_cat); $x_h1_index_cat = str_replace("{{city}}", $__variableSelected['city_uc'], $x_h1_index_cat); $x_h1_index_cat = str_replace("{{city_only}}", $city_only, $x_h1_index_cat); $x_h1_index_cat = str_replace("{{state}}", $state_full, $x_h1_index_cat); $x_h1_index_cat = str_replace("{{a_pro}}", ucwords($x_pro), $x_h1_index_cat); $x_h1_index_cat = str_replace("{{pro_singular}}", ucwords($x_pro_singular), $x_h1_index_cat); $x_h1_index_cat = str_replace("{{pro_plural}}", ucwords($x_pro_plural), $x_h1_index_cat); $x_h1_index_cat = str_replace("{{cat_title}}", ucwords($__variableSelected['cat_title']), $x_h1_index_cat); $x_h1_index_cat = str_replace("{{cat_name}}", ucwords($__variableSelected['cat_name']), $x_h1_index_cat); $x_h1_index_cat = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name_lower'], $x_h1_index_cat); $x_h1_index_cat = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $x_h1_index_cat); $x_h1_index_cat = str_replace("{{state_full}}", ucwords($state_full), $x_h1_index_cat); $x_h1_index_cat = str_replace("{{geo_nice}}", $geo_nice, $x_h1_index_cat); $x_h1_index_cat = str_replace("{{combined}}", $__tvar['replace_combined'], $x_h1_index_cat); $x_h1_index_cat = str_replace("{{phone}}", $__site_phone, $x_h1_index_cat); $x_h1_index_cat = str_replace("{{phone_link}}", $__site_phone_link, $x_h1_index_cat); $x_h1_state = str_replace("{{main_keyword}}", ucwords($x_main_keyword), $x_h1_state); $x_h1_state = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $x_h1_state); $x_h1_state = str_replace("{{domain_keyword}}", $domain_keyword, $x_h1_state); $x_h1_state = str_replace("{{domain_nice}}", $domain_nice, $x_h1_state); $x_h1_state = str_replace("{{city}}", $__variableSelected['city_uc'], $x_h1_state); $x_h1_state = str_replace("{{city_only}}", $city_only, $x_h1_state); $x_h1_state = str_replace("{{state}}", $state_full, $x_h1_state); $x_h1_state = str_replace("{{a_pro}}", ucwords($x_pro), $x_h1_state); $x_h1_state = str_replace("{{pro_singular}}", ucwords($x_pro_singular), $x_h1_state); $x_h1_state = str_replace("{{pro_plural}}", ucwords($x_pro_plural), $x_h1_state); $x_h1_state = str_replace("{{cat_title}}", ucwords($__variableSelected['cat_title']), $x_h1_state); $x_h1_state = str_replace("{{cat_name}}", ucwords($__variableSelected['cat_name']), $x_h1_state); $x_h1_state = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name_lower'], $x_h1_state); $x_h1_state = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $x_h1_state); $x_h1_state = str_replace("{{state_full}}", ucwords($state_full), $x_h1_state); $x_h1_state = str_replace("{{geo_nice}}", $geo_nice, $x_h1_state); $x_h1_state = str_replace("{{combined}}", $__tvar['replace_combined'], $x_h1_state); $x_h1_state = str_replace("{{phone}}", $__site_phone, $x_h1_state); $x_h1_state = str_replace("{{phone_link}}", $__site_phone_link, $x_h1_state); $x_h1_city = str_replace("{{main_keyword}}", ucwords($x_main_keyword), $x_h1_city); $x_h1_city = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $x_h1_city); $x_h1_city = str_replace("{{domain_keyword}}", $domain_keyword, $x_h1_city); $x_h1_city = str_replace("{{domain_nice}}", $domain_nice, $x_h1_city); $x_h1_city = str_replace("{{city}}", "" . $__variableSelected['city'] . "", $x_h1_city); $x_h1_city = str_replace("{{state}}", "" . ucwords($state_full) . "", $x_h1_city); $x_h1_city = str_replace("{{a_pro}}", ucwords($x_pro), $x_h1_city); $x_h1_city = str_replace("{{pro_singular}}", ucwords($x_pro_singular), $x_h1_city); $x_h1_city = str_replace("{{pro_plural}}", ucwords($x_pro_plural), $x_h1_city); $x_h1_city = str_replace("{{cat_title}}", ucwords($__variableSelected['cat_title']), $x_h1_city); $x_h1_city = str_replace("{{cat_name}}", ucwords($__variableSelected['cat_name']), $x_h1_city); $x_h1_city = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name'], $x_h1_city); $x_h1_city = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $x_h1_city); $x_h1_city = str_replace("{{state_full}}", ucwords($state_full), $x_h1_city); $x_h1_city = str_replace("{{geo_nice}}", $geo_nice, $x_h1_city); $x_h1_city = str_replace("{{combined}}", $__tvar['replace_combined'], $x_h1_city); $x_h1_city = str_replace("{{phone}}", $__site_phone, $x_h1_city); $x_h1_city = str_replace("{{phone_link}}", $__site_phone_link, $x_h1_city); $x_h2 = str_replace("{{main_keyword}}", ucwords($x_main_keyword), $x_h2); $x_h2 = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $x_h2); $x_h2 = str_replace("{{domain_keyword}}", $domain_keyword, $x_h2); $x_h2 = str_replace("{{domain_nice}}", $domain_nice, $x_h2); $x_h2 = str_replace("{{city}}", $__variableSelected['city'], $x_h2); $x_h2 = str_replace("{{city_only}}", $city_only, $x_h2); $x_h2 = str_replace("{{state}}", $state_full, $x_h2); $x_h2 = str_replace("{{a_pro}}", ucwords($x_pro), $x_h2); $x_h2 = str_replace("{{pro_singular}}", ucwords($x_pro_singular), $x_h2); $x_h2 = str_replace("{{pro_plural}}", ucwords($x_pro_plural), $x_h2); $x_h2 = str_replace("{{cat_title}}", ucwords($__variableSelected['cat_title']), $x_h2); $x_h2 = str_replace("{{cat_name}}", ucwords($__variableSelected['cat_name']), $x_h2); $x_h2 = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name_lower'], $x_h2); $x_h2 = str_replace("{{keyword_verb}", set_value_of_extended($our_array[$t]['keyword_verb'], $keyword_verb), $x_h2); $x_h2 = str_replace("{{state_full}}", ucwords($state_full), $x_h2); $x_h2 = str_replace("{{geo_nice}}", $geo_nice, $x_h2); $x_h2 = str_replace("{{combined}}", $__tvar['replace_combined'], $x_h2); $x_h2 = str_replace("{{phone}}", $__site_phone, $x_h2); $x_h2 = str_replace("{{phone_link}}", $__site_phone_link, $x_h2); $x_h2_article = str_replace("{{main_keyword}}", $x_main_keyword, $x_h2_article); $x_h2_article = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $x_h2_article); $x_h2_article = str_replace("{{domain_keyword}}", $domain_keyword, $x_h2_article); $x_h2_article = str_replace("{{domain_nice}}", $domain_nice, $x_h2_article); $x_h2_article = str_replace("{{city}}", $__variableSelected['city_uc'], $x_h2_article); $x_h2_article = str_replace("{{city_only}}", $city_only, $x_h2_article); $x_h2_article = str_replace("{{state}}", $state_full, $x_h2_article); $x_h2_article = str_replace("{{a_pro}}", $x_pro, $x_h2_article); $x_h2_article = str_replace("{{pro_singular}}", $x_pro_singular, $x_h2_article); $x_h2_article = str_replace("{{pro_plural}}", $x_pro_plural, $x_h2_article); $x_h2_article = str_replace("{{cat_title}}", $__variableSelected['cat_title'], $x_h2_article); $x_h2_article = str_replace("{{cat_name}}", $__variableSelected['cat_name'], $x_h2_article); $x_h2_article = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name_lower'], $x_h2_article); $x_h2_article = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $x_h2_article); $x_h2_article = str_replace("{{state_full}}", ucwords($state_full), $x_h2_article); $x_h2_article = str_replace("{{geo_nice}}", $geo_nice, $x_h2_article); $x_h2_article = str_replace("{{combined}}", $__tvar['replace_combined'], $x_h2_article); $x_h2_article = str_replace("{{phone}}", $__site_phone, $x_h2_article); $x_h2_article = str_replace("{{phone_link}}", $__site_phone_link, $x_h2_article); $h2 = str_replace("{{main_keyword}}", ucwords($x_main_keyword), $h2); $h2 = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $h2); $h2 = str_replace("{{domain_keyword}}", $domain_keyword, $h2); $h2 = str_replace("{{domain_nice}}", $domain_nice, $h2); $h2 = str_replace("{{city}}", $__variableSelected['city_uc'], $h2); $h2 = str_replace("{{city_only}}", $city_only, $h2); $h2 = str_replace("{{state}}", $state_full, $h2); $h2 = str_replace("{{a_pro}}", ucwords($x_pro), $h2); $h2 = str_replace("{{pro_singular}}", ucwords($x_pro_singular), $h2); $h2 = str_replace("{{pro_plural}}", ucwords($x_pro_plural), $h2); $h2 = str_replace("{{cat_title}}", ucwords($__variableSelected['cat_title']), $h2); $h2 = str_replace("{{cat_name}}", ucwords($__variableSelected['cat_name']), $h2); $h2 = str_replace("{{cat_name_lower}}", $__variableSelected['cat_name_lower'], $h2); $h2 = str_replace("{{keyword_verb}}", $__variableSelected['keyword_verb'], $h2); $h2 = str_replace("{{state_full}}", ucwords($state_full), $h2); $h2 = str_replace("{{geo_nice}}", $geo_nice, $h2); $h2 = str_replace("{{combined}}", $__tvar['replace_combined'], $h2); $h2 = str_replace("{{phone}}", $__site_phone, $h2); $h2 = str_replace("{{phone_link}}", $__site_phone_link, $h2); // custom replacements $meta = str_replace("{{last_name}}", ucwords($last_name), $meta); $title = str_replace("{{last_name}}", ucwords($last_name), $title); $x_index_title = str_replace("{{last_name}}", ucwords($last_name), $x_index_title); $x_index_meta = str_replace("{{last_name}}", ucwords($last_name), $x_index_meta); $x_h1_index = str_replace("{{last_name}}", ucwords($last_name), $x_h1_index); $article_heading = str_replace("{{last_name}}", ucwords($last_name), $article_heading); $x_index_title = str_replace("{{last_name}}", ucwords($last_name), $x_index_title); $x_index_meta = str_replace("{{last_name}}", ucwords($last_name), $x_index_meta); $x_article = str_replace("{{last_name}}", ucwords($last_name), $x_article); $x_article_index = str_replace("{{last_name}}", ucwords($last_name), $x_article_index); $x_b_article_state = str_replace("{{last_name}}", ucwords($last_name), $x_b_article_state); $x_b_article = str_replace("{{last_name}}", ucwords($last_name), $x_b_article); $x_article_state = str_replace("{{last_name}}", ucwords($last_name), $x_article_state); $x_h1_index_cat = str_replace("{{last_name}}", ucwords($last_name), $x_h1_index_cat); $x_h1_state = str_replace("{{last_name}}", ucwords($last_name), $x_h1_state); $x_h1_city = str_replace("{{last_name}}", ucwords($last_name), $x_h1_city); $x_h2 = str_replace("{{last_name}}", ucwords($last_name), $x_h2); $x_h2_article = str_replace("{{last_name}}", ucwords($last_name), $x_h2_article); $h2 = str_replace("{{last_name}}", ucwords($last_name), $h2); // Custom replacements {{state_abr}} $meta = str_replace("{{state_abr}}", strtoupper($state_abr), $meta); $title = str_replace("{{state_abr}}", strtoupper($state_abr), $title); $x_index_title = str_replace("{{state_abr}}", strtoupper($state_abr), $x_index_title); $x_index_meta = str_replace("{{state_abr}}", strtoupper($state_abr), $x_index_meta); $x_h1_index = str_replace("{{state_abr}}", strtoupper($state_abr), $x_h1_index); $article_heading = str_replace("{{state_abr}}", strtoupper($state_abr), $article_heading); $x_index_title = str_replace("{{state_abr}}", strtoupper($state_abr), $x_index_title); $x_index_meta = str_replace("{{state_abr}}", strtoupper($state_abr), $x_index_meta); $x_article = str_replace("{{state_abr}}", strtoupper($state_abr), $x_article); $x_article_index = str_replace("{{state_abr}}", strtoupper($state_abr), $x_article_index); $x_b_article_state = str_replace("{{state_abr}}", strtoupper($state_abr), $x_b_article_state); $x_b_article = str_replace("{{state_abr}}", strtoupper($state_abr), $x_b_article); $x_article_state = str_replace("{{state_abr}}", strtoupper($state_abr), $x_article_state); $x_h1_index_cat = str_replace("{{state_abr}}", strtoupper($state_abr), $x_h1_index_cat); $x_h1_state = str_replace("{{state_abr}}", strtoupper($state_abr), $x_h1_state); $x_h1_city = str_replace("{{state_abr}}", strtoupper($state_abr), $x_h1_city); $x_h2 = str_replace("{{state_abr}}", strtoupper($state_abr), $x_h2); $x_h2_article = str_replace("{{state_abr}}", strtoupper($state_abr), $x_h2_article); $h2 = str_replace("{{state_abr}}", strtoupper($state_abr), $h2); $our_array[$t]['subcat_list_name'] = str_replace("{{main_keyword}}", ucwords($x_main_keyword), $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{domain_keyword}}", $domain_keyword, $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{domain_nice}}", $domain_nice, $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{city}}", $__variableSelected['city'], $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{city_only}}", $city_only, $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{state}}", $state_full, $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{a_pro}}", ucwords($x_pro), $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{pro_singular}}", ucwords($x_pro_singular), $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{pro_plural}}", ucwords($x_pro_plural), $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{cat_title}}", ucwords($our_array[$t]['subcat_title']), $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{cat_name}}", ucwords($our_array[$t]['subcat_name']), $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{cat_name_lower}}", strtolower($our_array[$t]['subcat_name']), $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{keyword_verb}}", set_value_of_extended($our_array[$t]['keyword_verb'], $keyword_verb), $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{state_full}}", ucwords($state_full), $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{geo_nice}}", $geo_nice, $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{combined}}", $__tvar['replace_combined'], $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{phone}}", $__site_phone, $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{phone_link}}", $__site_phone_link, $our_array[$t]['subcat_list_name']); //dump($__variableSelected, $cat_name); // Other Variable Replacements $h2 = str_replace("{{cat_name}}", $cat_name, $h2); $h2 = str_replace("{{cat_name_lower}}", strtolower($cat_name), $h2); $h2 = str_replace("{{keyword_verb}}", $keyword_verb, $h2); $_replace_var_geo = ""; switch ($page_type) { case "index": default: $_replace_var_geo = $_replace_var_geo_uc = trim($__variableSelected['geo']); if (empty($_replace_var_geo)) { $_replace_var_geo = "your area"; $_replace_var_geo_uc = "Your Area"; } break; case "s": if (!empty($state_full)) { $_replace_var_geo = $_replace_var_geo_uc = $state_full; } break; case "g": if (!empty($state_full) && !empty($city)) { $_replace_var_geo = $_replace_var_geo_uc = $city . ", " . $state_full; } break; } //dump($_replace_var_geo,$page_type); if (!empty($_replace_var_geo)) { $meta = str_replace("{{geo}}", $_replace_var_geo_uc, $meta); $title = str_replace("{{geo}}", $_replace_var_geo_uc, $title); $x_index_title = str_replace("{{geo}}", $_replace_var_geo_uc, $x_index_title); $x_index_meta = str_replace("{{geo}}", $_replace_var_geo_uc, $x_index_meta); $x_h1_index = str_replace("{{geo}}", $_replace_var_geo_uc, $x_h1_index); $h1_tag = str_replace("{{geo}}", $_replace_var_geo_uc, $h1_tag); $article_heading = str_replace("{{geo}}", $_replace_var_geo_uc, $article_heading); $x_article = str_replace("{{geo}}", $_replace_var_geo, $x_article); $x_article_index = str_replace("{{geo}}", $_replace_var_geo, $x_article_index); $x_article_state = str_replace("{{geo}}", $_replace_var_geo, $x_article_state); $x_h1_index_cat = str_replace("{{geo}}", $_replace_var_geo_uc, $x_h1_index_cat); $x_h1_state = str_replace("{{geo}}", $_replace_var_geo_uc, $x_h1_state); $x_h1_city = str_replace("{{geo}}", $_replace_var_geo_uc, $x_h1_city); $x_h2 = str_replace("{{geo}}", $_replace_var_geo_uc, $x_h2); $x_h2_article = str_replace("{{geo}}", $_replace_var_geo_uc, $x_h2_article); $h2 = str_replace("{{geo}}", $_replace_var_geo_uc, $h2); $our_array[$t]['subcat_list_name'] = str_replace("{{geo}}", $_replace_var_geo, $our_array[$t]['subcat_list_name']); } $x_article = \App\Support\StringRenderer::render($x_article); $x_article_index = \App\Support\StringRenderer::render($x_article_index); $x_article_state = \App\Support\StringRenderer::render($x_article_state); // Lets get content based on page types. if ($page_type == GeneralEnum::PAGE_TYPE_GALLERY || $page_type == GeneralEnum::PAGE_TYPE_SERVICE) { $image_src = $bubble4_link; //$h1_tag = $x_h1_index; } // Page type index if ($page_type == GeneralEnum::PAGE_TYPE_INDEX) { //i or no category if ($article_heading == "") { $section_categories_header = "Our Services"; } else { $section_categories_header = $article_heading; } if ($__single_category_mode === TRUE) { $__skip_section[] = "categories"; } foreach ($our_array as $iour) { if ($iour['subcat_name'] != "Other") { /* if(empty($iour['subcat_name'])){ continue; } */ if (!$__categoryonly_mode) { $options_url_category = array("text" => link_decode($iour['subcat_name']), "subcat_slug" => $iour['subcat_slug']); $section_categories_links[] = url_category_generate($options_url_category); } else { $options_url_category = array("type" => "categoryonly", "text" => link_decode($iour['subcat_name']), "subcat_slug" => $iour['subcat_slug']); $section_categories_links[] = url_category_generate($options_url_category); } //$section_categories_links[] = "" . link_decode($iour['subcat_name']) . ""; } } // Page type index without category if ($category_arr[0] == "") { $__tvar['current_category_id'] = ""; $__tvar['current_category_rowid'] = ""; $__tvar['current_category_slug'] = ""; $__tvar['current_category_slug_for_form_type_mapping'] = $__tvar['current_category_slug']; $__tvar['retargeting_content_id'] = ""; $image_alt = trim($image_alt); if (empty($image_alt)) { $image_alt = ucwords($our_array[$t]['subcat_name']); } $image_src = $bubble4_link; $h1_tag = $x_h1_index; $text = "$x_article_index"; if ($text == "") { $text = $x_article; } $text = str_replace("{{custom_sentence}}", "", $text); $text = str_replace("{{in_location}}", "", $text); $text = str_replace("{{cat_name}}", set_value_of_multi([$x_cat_name, $x_main_keyword], "services"), $text); $text = str_replace("{{cat_name_lower}}", strtolower(set_value_of_multi([$x_cat_name, $x_main_keyword], "services")), $text); $text = str_replace("{{keyword_verb}}", set_value_of($keyword_verb, $x_main_keyword), $text); $text = str_replace(" , ", ", ", $text); if (!empty($x_h2_custom)) { $section_h2_header = $x_h2_custom; } if (!empty($x_h2_article_custom)) { $section_h2_article = $x_h2_article_custom; } if (!empty($x_h2_img_src_custom)) { $section_h2_img_src = $x_h2_img_src_custom; } $__custompages_list_options = \App\ViewCustomizer\CustomPagesListOptions::get(); $optionsActionCustomPages = []; if (array_is_valid($__custompages_list_options)) { if (!empty($__custompages_list_options['list_homepage_type'])) { $optionsActionCustomPages['list_homepage_type'] = $__custompages_list_options['list_homepage_type']; } } $section_custompages_links = CustomPages::get_list_on_homepage($optionsActionCustomPages); $optionsActionContentGroups = []; $section_contentgroups_links = \App\ContentGroups\ContentGroups::getForHomepage($optionsActionContentGroups); $section_contentgroups_links = \App\Support\StringRenderer::render($section_contentgroups_links); /** * Quick fix for removing empty category. Enabled Fix Ref 20240409-1 and remove this. */ if (array_is_valid($section_contentgroups_links)) { if (trim($section_categories_links[0]) == "") { unset($section_categories_links[0]); } } if (isShowcaseEnabled("home", ["build_type" => $domain_arr['build_type']])) { $showcase = \App\Support\Showcase::make($domain_arr); $section_showcase_data = \App\Support\Showcase::getDataRender(); } if (isReviewsEnabled("home")) { $reviews = \App\Support\Reviews::make($domain_arr); $section_reviews_data = \App\Support\Reviews::getDataRender(); } if (isFaqEnabled("home")) { $faq = \App\Support\Faq::make($domain_arr); $section_faq_data = \App\Support\Faq::getDataRender(); } if (isProductsEnabled("home")) { $products = \App\Support\Products::make($domain_arr); $section_products_data = \App\Support\Products::getDataRender(); } \App\Support\OtherViewData::make($domain_arr); } //dump($category_arr[0], $__single_category_mode, $isAdwordsLandedURL, $__isHomeViewCustomized); // Page type index with category (i) // Page type index with category (p) if (($category_arr[0] != "" || $__single_category_mode) && !$isAdwordsLandedURL) { /** * If site is on "single category mode" and i page is requested since this will be duplicated content we are 301'in the page to the root */ if ($category_arr[0] != "" && $__single_category_mode) { redirect_301("http://" . $domain); } $__tvar['current_category_id'] = (!empty($our_array[$t]['subcat_name'])) ? link_encode($our_array[$t]['subcat_name']) : ""; $__tvar['current_category_rowid'] = (!empty($our_array[$t]['id'])) ? $our_array[$t]['id'] : ""; $__tvar['current_category_slug'] = (!empty($our_array[$t]['subcat_slug'])) ? link_encode($our_array[$t]['subcat_slug']) : ""; $__tvar['current_category_slug_for_form_type_mapping'] = $__tvar['current_category_slug']; $__tvar['current_category'] = (!empty($our_array[$t]['subcat_name'])) ? $our_array[$t]['subcat_name'] : ""; $__tvar['retargeting_content_id'] = (!empty($our_array[$t]['subcat_name'])) ? strtolower(trim($our_array[$t]['subcat_name'])) : ""; $image_alt = ucwords($our_array[$t]['subcat_name']); // Override if category image is not empty. If empty use the domain's image_src if (!empty($our_array[$t]['image_url'])) { $image_src = $our_array[$t]['image_url']; } $h1_tag = $x_h1_index_cat; $text = $x_article_index; if ($text == "") { $text = $x_article; } $text = str_replace("{{custom_sentence}}", "", $text); $text = str_replace("{{in_location}}", "", $text); $text = str_replace("{{cat_name}}", set_value_of(strtolower($cat_name), "our services"), $text); $text = str_replace("{{cat_name_lower}}", strtolower(set_value_of(strtolower($cat_name), "our services")), $text); $text = str_replace("{{keyword_verb}}", set_value_of(strtolower($keyword_verb), $x_main_keyword), $text); $text = str_replace(" , ", ", ", $text); if ($h2 == "") { $h2 = ucwords($our_array[$t]['subcat_name']); } if (isGeoContentDisabled() !== TRUE) { if (country_settings_property("state") === TRUE) { if (!$__geotarget_mode) { if (!$__categoryonly_mode) { //$section_state_header = $h2 . " - Select your State."; $section_state_header = $cDomainInstance::getSectionStateHeader(["h2" => $h2]); $state_arr = dataprovider_state_list(); foreach ($state_arr as $istate) { $section_state_links[] = url_state_generate(array("text" => $istate['statefullname'], "state" => $istate['state'], "subcat_slug" => $our_array[$t]['subcat_slug'])); } } } else { if (!$__categoryonly_mode) { $__data_slug = querytorowarray("select slug from `$x_table` where subcat_name = '" . Security::sanitizeSqlInput($cat_name) . "'"); $slug = $__data_slug['slug']; //$section_cities_header = $h2 . " - Select City."; $section_cities_header = $cDomainInstance::getSectionCitiesHeader(["h2" => $h2]); $__temp['lat'] = $domain_arr['geotarget_latitude']; $__temp['lon'] = $domain_arr['geotarget_longitude']; $__temp['radius'] = $domain_arr['geotarget_radius']; $options_url_city_other = []; if (config_site_get("", "geotable_simulated_content")) { $city_arr = dataprovider_state_list(["geo_type" => "1", "list_city" => TRUE]); $options_url_city_other['text_format'] = "none"; } else { //$city_arr = querytoarray("select geo,state,(((acos(sin(({$__temp['lat']}*pi()/180)) * sin((latitude * pi()/180))+cos(({$__temp['lat']}*pi()/180)) * cos(( latitude * pi()/180)) * cos((({$__temp['lon']} - longitude)*pi()/180))))*180/pi())*60*1.1515*1.609344) as distance from `$geo_database` where ( 3959 * acos( cos( radians({$__temp['lat']}) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians({$__temp['lon']}) ) + sin( radians({$__temp['lat']}) ) * sin( radians( latitude ) ) ) ) < " . $__temp['radius'] . " and geo_type='1' and active='1'"); $city_arr = \App\Support\Geo::getDataFromGeoDatabase(["type" => "geotarget_city", "geo_database" => $geo_database, "lat" => $__temp['lat'], "lon" => $__temp['lon'], "radius" => $__temp['radius']]); } foreach ($city_arr as $icity) { $options_url_city = array("text" => $icity['geo'], "slug" => $slug, "state" => $icity['state'], "geo" => $icity['geo'], "subcat_slug" => $our_array[$t]['subcat_slug']); $options_url_city['type'] = (!empty($__url_options['city']['type'])) ? $__url_options['city']['type'] : $options_url_city['type']; $options_url_city = array_merge_certainly($options_url_city, $options_url_city_other); $section_cities_links[] = url_city_generate($options_url_city); //$section_cities_links[] = "" . ucwords(strtolower($icity['geo'])) . ""; } //$section_counties_header = $h2 . " - Select County."; $section_counties_header = $cDomainInstance::getSectionCountyHeader(["h2" => $h2]); if (config_site_get("", "geotable_simulated_content")) { } else { //$county_arr = querytoarray("select geo,state,(((acos(sin(({$__temp['lat']}*pi()/180)) * sin((latitude * pi()/180))+cos(({$__temp['lat']}*pi()/180)) * cos(( latitude * pi()/180)) * cos((({$__temp['lon']} - longitude)*pi()/180))))*180/pi())*60*1.1515*1.609344) as distance from `$geo_database` where ( 3959 * acos( cos( radians({$__temp['lat']}) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians({$__temp['lon']}) ) + sin( radians({$__temp['lat']}) ) * sin( radians( latitude ) ) ) ) < " . $__temp['radius'] . " and geo_type='3' and active='1'"); $county_arr = \App\Support\Geo::getDataFromGeoDatabase(["type" => "geotarget_county", "geo_database" => $geo_database, "lat" => $__temp['lat'], "lon" => $__temp['lon'], "radius" => $__temp['radius']]); } foreach ($county_arr as $icounty) { $options_url_county = array("text" => $icounty['geo'], "slug" => $slug, "state" => $icounty['state'], "geo" => $icounty['geo'], "subcat_slug" => $our_array[$t]['subcat_slug']); $options_url_county['type'] = (!empty($__url_options['county']['type'])) ? $__url_options['county']['type'] : $options_url_county['type']; $section_counties_links[] = url_county_generate($options_url_county); //$section_counties_links[] = "" . ucwords(strtolower($icounty['geo'])) . ""; } } } } else { $__data_slug = querytorowarray("select slug from `$x_table` where subcat_name = '" . Security::sanitizeSqlInput($cat_name) . "'"); $slug = $__data_slug['slug']; if (!$__geotarget_mode) { $location_other_arr = querytoarray("select * from zip_world where country = '" . country_settings_property("country_id") . "' and `population` >300"); } else { $__temp['lat'] = $domain_arr['geotarget_latitude']; $__temp['lon'] = $domain_arr['geotarget_longitude']; $__temp['country'] = country_settings_property("country_id"); $__temp['radius'] = $domain_arr['geotarget_radius']; $location_other_arr = querytoarray("select *, (((acos(sin(({$__temp['lat']}*pi()/180)) * sin((latitude * pi()/180))+cos(({$__temp['lat']}*pi()/180)) * cos(( latitude * pi()/180)) * cos((({$__temp['lon']} - longitude)*pi()/180))))*180/pi())*60*1.1515*1.609344) as distance from zip_world where ( 3959 * acos( cos( radians({$__temp['lat']}) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians({$__temp['lon']}) ) + sin( radians({$__temp['lat']}) ) * sin( radians( latitude ) ) ) ) < " . $__temp['radius'] . " and country='{$__temp['country']}' and `population` >300"); } if (!$__categoryonly_mode) { $section_locationother_header = $h2 . " - Select Location"; if (array_is_valid($location_other_arr)) { foreach ($location_other_arr as $k => $v) { $section_locationother_links[] = url_location_generate(array("text" => $v['geo_accent'], "slug" => $slug, "geo" => $v['geo'], "subcat_slug" => $our_array[$t]['subcat_slug'])); //$__link_href = "/" . link_encode($slug) . "/location/" . link_encode($v['geo']) . "/" . link_encode($our_array[$t]['subcat_slug']); //$__link_text = ucwords(strtolower($v['geo_accent'])); //$section_locationother_links[] = "" . $__link_text . ""; } } } } } $__showcaseReviewsSwitch = "category"; if ($__single_category_mode && empty($category[0])) { $__showcaseReviewsSwitch = "category_domain"; } switch ($__showcaseReviewsSwitch) { default: case "category": if (isShowcaseEnabled("i")) { $showcase = \App\Support\Showcase::make($our_array[$t]); $section_showcase_data = \App\Support\Showcase::getDataRender(); } if (isReviewsEnabled("i")) { $reviews = \App\Support\Reviews::make($our_array[$t]); $section_reviews_data = \App\Support\Reviews::getDataRender(); } if (isFaqEnabled("i")) { $faq = \App\Support\Faq::make($our_array[$t]); $section_faq_data = \App\Support\Faq::getDataRender(); } if (isProductsEnabled("i")) { $products = \App\Support\Products::make($our_array[$t]); $section_products_data = \App\Support\Products::getDataRender(); } \App\Support\OtherViewData::make($our_array[$t]); break; case "domain": if (isShowcaseEnabled("home", ["build_type" => $domain_arr['build_type']])) { $showcase = \App\Support\Showcase::make($domain_arr); $section_showcase_data = \App\Support\Showcase::getDataRender(); } if (isReviewsEnabled("home")) { $reviews = \App\Support\Reviews::make($domain_arr); $section_reviews_data = \App\Support\Reviews::getDataRender(); } if (isFaqEnabled("home")) { $faq = \App\Support\Faq::make($domain_arr); $section_faq_data = \App\Support\Faq::getDataRender(); } if (isProductsEnabled("home")) { $products = \App\Support\Products::make($domain_arr); $section_products_data = \App\Support\Products::getDataRender(); } \App\Support\OtherViewData::make($domain_arr); break; case "category_domain": if (isShowcaseEnabled("home", ["build_type" => $domain_arr['build_type']])) { $showcase = \App\Support\Showcase::make($our_array[$t]); $section_showcase_data = \App\Support\Showcase::getDataRender(); if (!array_is_valid($section_showcase_data)) { $showcase = \App\Support\Showcase::make($domain_arr); $section_showcase_data = \App\Support\Showcase::getDataRender(); } } if (isReviewsEnabled("home")) { $reviews = \App\Support\Reviews::make($our_array[$t]); $section_reviews_data = \App\Support\Reviews::getDataRender(); if (!array_is_valid($section_reviews_data)) { $reviews = \App\Support\Reviews::make($domain_arr); $section_reviews_data = \App\Support\Reviews::getDataRender(); } } if (isFaqEnabled("home")) { $faq = \App\Support\Faq::make($our_array[$t]); $section_faq_data = \App\Support\Faq::getDataRender(); if (!array_is_valid($section_faq_data)) { $faq = \App\Support\Faq::make($domain_arr); $section_faq_data = \App\Support\Faq::getDataRender(); } } if (isProductsEnabled("home")) { $products = \App\Support\Products::make($our_array[$t]); $section_products_data = \App\Support\Products::getDataRender(); if (!array_is_valid($section_products_data)) { $products = \App\Support\Products::make($domain_arr); $section_products_data = \App\Support\Products::getDataRender(); } } \App\Support\OtherViewData::make($our_array[$t]); \App\Support\OtherViewData::extendData($domain_arr); break; } } // End with category (i) }// End page type index // Page type State if ($page_type == GeneralEnum::PAGE_TYPE_S) { $__tvar['current_category_id'] = (!empty($our_array[$t]['subcat_name'])) ? link_encode($our_array[$t]['subcat_name']) : ""; $__tvar['current_category_rowid'] = (!empty($our_array[$t]['id'])) ? $our_array[$t]['id'] : ""; $__tvar['current_category_slug'] = (!empty($our_array[$t]['subcat_slug'])) ? link_encode($our_array[$t]['subcat_slug']) : ""; $__tvar['current_category_slug_for_form_type_mapping'] = $__tvar['current_category_slug']; $__tvar['current_category'] = (!empty($our_array[$t]['subcat_name'])) ? $our_array[$t]['subcat_name'] : ""; $__tvar['retargeting_content_id'] = (!empty($our_array[$t]['subcat_name'])) ? strtolower(trim($our_array[$t]['subcat_name'])) : ""; //Image $image_alt = ucwords($our_array[$t]['subcat_name']) . ", " . ucwords($our_array[$t]['slug']) . ", " . $state_full; if (empty($image_src)) { $image_src = $bubble4_link; // Override if category image is not empty. If empty use the domain's image_src if (!empty($our_array[$t]['image_url'])) { $image_src = $our_array[$t]['image_url']; } } //H1 section $h1_tag = $x_h1_state; // Article section for state $text = $x_article_state; if ($text == "") { $text = $x_article; } if ($our_array[$t]['subcat_sentence'] != "") { $text = str_replace("{{custom_sentence}}", $our_array[$t]['subcat_sentence'] . " ", $text); } else { $text = str_replace("{{custom_sentence}}", $our_array[$t]['subcat_sentence'], $text); } $text = str_replace("{{domain_keyword}}", "$domain_keyword", $text); $text = str_replace("{{in_location}}", "in $state_full ", $text); $text = str_replace("{{cat_name}}", $our_array[$t]['subcat_name'], $text); $text = str_replace("{{cat_name_lower}}", strtolower($our_array[$t]['subcat_name']), $text); $text = str_replace("{{keyword_verb}}", set_value_of_extended($our_array[$t]['keyword_verb'], $keyword_verb), $text); $text = str_replace("{{main_keyword}}", "$x_main_keyword", $text); $text = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $text); $text = str_replace(" , ", ", ", $text); //State H2 tag if ($h2 == "") { $h2 = ucwords($our_array[$t]['subcat_name']); } // Section 1 for state Cities //$section_cities_header = $h2 . " - Select City."; $section_cities_header = $cDomainInstance::getSectionCitiesHeader(["h2" => $h2]); //$state_arr = querytoarray("select * from `$geo_database` where state='" . link_decode($category_arr[1]) . "' and geo_type='1' and active='1'"); $state_arr = \App\Support\Geo::getDataFromGeoDatabase(["type" => "state_city", "geo_database" => $geo_database, "state" => link_decode($category_arr[1])]); $__data_slug = querytorowarray("select slug from `$x_table` where subcat_name='" . Security::sanitizeSqlInput($cat_name) . "'"); //dump($cat_name,$__data_slug,$our_array[$t]['subcat_slug'],$our_array[$t]); $slug = $__data_slug['slug']; if (country_settings_property("state") !== TRUE) { $url = url_category_generate(array("type" => "301", "return_type" => "href", "subcat_slug" => $our_array[$t]['subcat_slug'])); //$url = "/i/" . link_encode($our_array[$t]['subcat_slug']) . "/"; redirect_301($url); exit(); } if (isGeoContentDisabled()) { $url = url_category_generate(array("type" => "301", "return_type" => "href", "subcat_slug" => link_encode($our_array[$t]['subcat_slug']))); redirect_301($url); exit(); } $options_url_city_other = []; if (config_site_get("", "geotable_simulated_content")) { $options_url_city_other['text_format'] = "none"; } foreach ($state_arr as $istate) { //$section_cities_links[] = "" . ucwords(strtolower($istate['geo'])) . ""; $options_url_city = array("text" => $istate['geo'], "slug" => $slug, "state" => $istate['state'], "geo" => $istate['geo'], "subcat_slug" => $our_array[$t]['subcat_slug']); $options_url_city = array_merge_certainly($options_url_city, $options_url_city_other); $section_cities_links[] = url_city_generate($options_url_city); } // Section 1 for state Counties //$section_counties_header = $h2 . " - Select County."; $section_counties_header = $cDomainInstance::getSectionCountyHeader(["h2" => $h2]); //$state_arr = querytoarray("select * from `$geo_database` where state='" . link_decode($category_arr[1]) . "' and geo_type='3' and active='1'"); $state_arr = \App\Support\Geo::getDataFromGeoDatabase(["type" => "state_county", "geo_database" => $geo_database, "state" => link_decode($category_arr[1])]); $__data_slug = querytorowarray("select slug from `$x_table` where subcat_name = '" . Security::sanitizeSqlInput($cat_name) . "'"); $slug = $__data_slug['slug']; foreach ($state_arr as $istate) { $section_counties_links[] = url_county_generate(array("text" => $istate['geo'], "slug" => $slug, "state" => $istate['state'], "geo" => $istate['geo'], "subcat_slug" => $our_array[$t]['subcat_slug'])); //$section_counties_links[] = "" . ucwords(strtolower($istate['geo'])) . ""; } if (isShowcaseEnabled("s")) { $showcase = \App\Support\Showcase::make($our_array[$t]); $section_showcase_data = \App\Support\Showcase::getDataRender(); } if (isReviewsEnabled("s")) { $reviews = \App\Support\Reviews::make($our_array[$t]); $section_reviews_data = \App\Support\Reviews::getDataRender(); } if (isFaqEnabled("s")) { $faq = \App\Support\Faq::make($our_array[$t]); $section_faq_data = \App\Support\Faq::getDataRender(); } if (isProductsEnabled("s")) { $products = \App\Support\Products::make($our_array[$t]); $section_products_data = \App\Support\Products::getDataRender(); } \App\Support\OtherViewData::make($our_array[$t]); } // Page type g if ($page_type == GeneralEnum::PAGE_TYPE_G) { if ($__single_category_geotarget_links === TRUE) { single_category_geotarget_link_redirect_301(["single_category_mode" => $__single_category_mode]); } if (isGeoContentDisabled()) { $url = url_category_generate(array("type" => "301", "return_type" => "href", "subcat_slug" => link_encode($our_array[$t]['subcat_slug']))); redirect_301($url); } //dump($country); $__tvar['current_category_id'] = (!empty($our_array[$t]['subcat_name'])) ? link_encode($our_array[$t]['subcat_name']) : ""; $__tvar['current_category_rowid'] = (!empty($our_array[$t]['id'])) ? $our_array[$t]['id'] : ""; $__tvar['current_category_slug'] = (!empty($our_array[$t]['subcat_slug'])) ? link_encode($our_array[$t]['subcat_slug']) : ""; $__tvar['current_category_slug_for_form_type_mapping'] = $__tvar['current_category_slug']; $__tvar['current_category'] = (!empty($our_array[$t]['subcat_name'])) ? $our_array[$t]['subcat_name'] : ""; $__tvar['retargeting_content_id'] = (!empty($our_array[$t]['subcat_name'])) ? strtolower(trim($our_array[$t]['subcat_name'])) : ""; //Image $image_alt = ucwords($our_array[$t]['subcat_name']) . " - " . ucwords($our_array[$t]['slug']) . " " . $city . ", " . $state_full; if (empty($image_src)) { $image_src = $bubble4_link; // Override if category image is not empty. If empty use the domain's image_src if (!empty($our_array[$t]['image_url'])) { $image_src = $our_array[$t]['image_url']; } } //H1 section $h1_tag = $x_h1_city; // Article section for state $text = $x_article; if ($text == "") { $text = $x_article; } if ($our_array[$t]['subcat_sentence'] != "") { $text = str_replace("{{custom_sentence}}", $our_array[$t]['subcat_sentence'] . " ", $text); } else { $text = str_replace("{{custom_sentence}}", $our_array[$t]['subcat_sentence'], $text); } $text = str_replace("{{domain_keyword}}", "$domain_keyword", $text); $text = str_replace("{{in_location}}", "in $city, $state_full ", $text); $text = str_replace("{{cat_name}}", $our_array[$t]['subcat_name'], $text); $text = str_replace("{{cat_name_lower}}", strtolower($our_array[$t]['subcat_name']), $text); $text = str_replace("{{keyword_verb}}", set_value_of_extended($our_array[$t]['keyword_verb'], $keyword_verb), $text); $text = str_replace("{{main_keyword}}", "$x_main_keyword", $text); $text = str_replace("{{main_keyword_lower}}", strtolower($x_main_keyword), $text); $text = str_replace(" , ", ", ", $text); // Section 3 $section_h2_header = $x_h2; $section_h2_article = $x_h2_article; $section_h2_img_src = $x_h2_img_src; // Section 2 $section_categories_header = $article_heading; if ($__single_category_mode === TRUE) { $__skip_section[] = "categories"; } if (config_site_get("", "locations_other_geopage")) { $locations_seo = locations_seo_get(array("state" => $state, "geo" => $city)); if (array_is_valid($locations_seo)) { $section_locations_seo_header = "Locations"; $section_locations_seo_data = $locations_seo; } } foreach ($our_array as $iour) { if ($iour['subcat_name'] != "Other") { /* if (country_settings_property("state") === TRUE) { $section_categories_links[] = url_categories_generate(array("text" => link_decode($iour['subcat_name']), "text_format" => "none", "slug" => $iour['slug'], "state" => $state, "geo" => $city, "subcat_slug" => $iour['subcat_slug'])); //$section_categories_links[] = "" . link_decode($iour['subcat_name']) . ""; } else { $section_categories_links[] = url_location_generate(array("text" => link_decode($iour['subcat_name']), "slug" => $iour['slug'], "geo" => $city, "subcat_slug" => $iour['subcat_slug'])); } */ //GPTODO[BEUN] 9.04.2024 16:31 - Fix Ref 20240409-1 /* if(empty($iour['subcat_name'])){ continue; } */ $options_url_category = array("text" => link_decode($iour['subcat_name']), "text_format" => "none", "slug" => $iour['slug'], "state" => $state, "geo" => $city, "subcat_slug" => $iour['subcat_slug']); $options_url_category['type'] = (!empty($__url_options['category']['type'])) ? $__url_options['category']['type'] : $options_url_category['type']; $section_categories_links[] = url_categories_generate($options_url_category); //$section_categories_links[] = "" . link_decode($iour['subcat_name']) . ""; } } // Start Section 4 if ($our_array[$t]['subcat_list_name'] != "" && $our_array[$t]['subcat_list'] != "") { $our_array[$t]['subcat_list_name'] = str_replace("{{cat_name}}", $cat_name, $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{cat_name_lower}}", strtolower($cat_name), $our_array[$t]['subcat_list_name']); $our_array[$t]['subcat_list_name'] = str_replace("{{keyword_verb}}", $keyword_verb, $our_array[$t]['subcat_list_name']); $list_arr = explode("*", $our_array[$t]['subcat_list']); foreach ($list_arr as $ilist) { $section_types_links[] = ucwords($ilist); } $section_types_header = ucwords($our_array[$t]['subcat_list_name']); } $__country_id = country_settings_property("country_id"); if ($__country_id != "us") { $__current_page_location_other = strtolower(link_decode($category_arr[2])); } if (isShowcaseEnabled("g")) { $showcase = \App\Support\Showcase::make($our_array[$t]); $section_showcase_data = \App\Support\Showcase::getDataRender(); } if (isReviewsEnabled("g")) { $reviews = \App\Support\Reviews::make($our_array[$t]); $section_reviews_data = \App\Support\Reviews::getDataRender(); } if (isFaqEnabled("g")) { $faq = \App\Support\Faq::make($our_array[$t]); $section_faq_data = \App\Support\Faq::getDataRender(); } if (isProductsEnabled("g")) { $products = \App\Support\Products::make($our_array[$t]); $section_products_data = \App\Support\Products::getDataRender(); } \App\Support\OtherViewData::make($our_array[$t]); //End List Section } if ($page_type == GeneralEnum::PAGE_TYPE_CUSTOM_PAGE || $page_type == GeneralEnum::PAGE_TYPE_CUSTOM_PAGE_TYPE) { if (isShowcaseEnabled("custom_page")) { $showcase = \App\Support\Showcase::make($custom_page_detail); $section_showcase_data = \App\Support\Showcase::getDataRender(); } if (isReviewsEnabled("custom_page")) { $reviews = \App\Support\Reviews::make($custom_page_detail); $section_reviews_data = \App\Support\Reviews::getDataRender(); } if (isFaqEnabled("custom_page")) { $faq = \App\Support\Faq::make($custom_page_detail); $section_faq_data = \App\Support\Faq::getDataRender(); } if (isProductsEnabled("custom_page")) { $products = \App\Support\Products::make($custom_page_detail); $section_products_data = \App\Support\Products::getDataRender(); } \App\Support\OtherViewData::make($custom_page_detail); } if ($page_type == GeneralEnum::PAGE_TYPE_CONTENT_GROUPS) { \App\Support\OtherViewData::ma