'. print_r($final_config, true) .''); if(!$final_config){ print_r($_SERVER['SERVER_NAME']); die(); } if (isset($final_config['EasyPostAPIKey'])) { $_SESSION['EasyPostAPIKey'] = $final_config['EasyPostAPIKey']; } $site_content = array(); //- This variable is THE shit $host = str_replace('http://', '', SITE_URL); $host = str_replace('www.', '', $host); //------------------------------------------------------- //-- EntityID //------------------------------------------------------- if(isset($_GET['EntityID'])) { $entity_id = sanitizeText($_GET['EntityID']); } else { $entity_id=0; } //------------------------------------------------------- // -- PowerTrainV2 or Not //------------------------------------------------------- $powertrain_v2_enabled = false; if (isset($final_config['PowerTrainV2Enabled']) && 'Y' == $final_config['PowerTrainV2Enabled']) { $powertrain_v2_enabled = true; define('POWERTRAIN_V2', 'Y'); $_SESSION['PowerTrainV2Enabled'] = 'Y'; //echo '



PowerTrainV2Enabled!

'; require_once $_SERVER['DOCUMENT_ROOT'] . '/core/init/dc_autoload.php'; } else { define('POWERTRAIN_V2', 'N'); $_SESSION['PowerTrainV2Enabled'] = 'N'; } if (isset($final_config['DisplayGoogleEcommerceTrackingCode']) && 'Y' == $final_config['DisplayGoogleEcommerceTrackingCode']) { define('DISPLAY_GOOGLE_ECOMMERCE_TRACKING_CODE', 'Y'); $_SESSION['DisplayGoogleEcommerceTrackingCode'] = 'Y'; } else { define('DISPLAY_GOOGLE_ECOMMERCE_TRACKING_CODE', 'N'); $_SESSION['DisplayGoogleEcommerceTrackingCode'] = 'N'; } //------------------------------------------------------- // -- Darwin or Not //------------------------------------------------------- $darwin_enabled = false; if (isset($final_config['DarwinEnabled']) && 'Y' == $final_config['DarwinEnabled']) { $darwin_enabled = true; define('DARWIN_ENABLED', 'Y'); $_SESSION['DarwinEnabled'] = 'Y'; } else { define('DARWIN_ENABLED', 'N'); $_SESSION['DarwinEnabled'] = 'N'; } //------------------------------------------------------- //-- Preview Html //------------------------------------------------------- $preview_html='N'; if (isset($_GET['preview'])) { $preview_html = sanitizeText($_GET['preview']); } $uri_parts = explode('?', filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH)); foreach ($uri_parts as $url_data) { if ($url_data=='preview=Y') { $preview_html='Y'; break; } } //- Convert query string to array. Is this used anywhere downstream? if(isset($uri_parts[1])) { $query_string = $uri_parts[1]; $query_string_parts = explode('&', $query_string); foreach($query_string_parts as $query_string_part) { $query_value_array = explode('=', $query_string_part); if(isset($query_value_array[1])){ $_GET[$query_value_array[0]] = $query_value_array[1]; } } } $is_nextopia_url = 'N'; if (isset($final_config['NextopiaURLKeyword'])) { $nextopia_url_key = $final_config['NextopiaURLKeyword']; $pos = strpos($uri_parts[0], $nextopia_url_key); if ($pos !== false) { $is_nextopia_url = 'Y'; } } if(isset($_SESSION['NextopiaDefaultRecommendationCode'])) { unset($_SESSION['NextopiaDefaultRecommendationCode']); } if (isset($final_config['NextopiaDefaultRecommendationCode'])) { if($final_config['NextopiaDefaultRecommendationCode']!=='' && $final_config['NextopiaDefaultRecommendationCode']!=='0') { $_SESSION['NextopiaDefaultRecommendationCode'] = $final_config['NextopiaDefaultRecommendationCode']; } } //------------------------------------------------------- //-- db_search //------------------------------------------------------- if(!isset($db_search)) { require_once(SITE_ROOT.'/includes/dbconnect.class.php'); $db_search= new db_search(); } //-- Setting Variables For Site $client_id = $final_config['SystemClientID']; $website_id = $final_config['WebsiteID']; $website_domain = $final_config['WebsiteDomainName']; $website_type_id = $final_config['WebsiteTypeID']; $left_plugins_exist='N'; $right_plugins_exist='N'; define('CLIENT_ID', $client_id); $_SESSION['SystemClientID']= $client_id; define('WEBSITE_ID', $website_id); $_SESSION['WebsiteID']= $website_id; //---------------------------------------------------------- //- Redirect by country code //---------------------------------------------------------- $redirect_by_countrycode = isset( $final_config['RedirectBasedOnCountryCode'] ) ? $final_config['RedirectBasedOnCountryCode'] : array(); if ( $redirect_by_countrycode && !isset($_SESSION['IPCountryCode']) ) { globalclient_inc_redirect_by_country_code($redirect_by_countrycode); } //---------------------------------------------------------- //- Block access by IP address //---------------------------------------------------------- $block_access_based_on_ip = isset( $final_config['BlockAccessByIPList'] ) ? $final_config['BlockAccessByIPList'] : ''; $block_access_based_on_ip_array = explode(',',str_replace(' ','',$block_access_based_on_ip)); if ( $block_access_based_on_ip_array ) { if(in_array(USER_IP_ADDRESS,$block_access_based_on_ip_array)){ echo('This website not accessible.'); die(); } } if( isset( $_GET['refcode'] ) ){ $_SESSION['RefCode'] = $_GET['refcode']; } if(isset($_GET['GiftCertCode'])) { $_SESSION['GiftCertCode']= $_GET['GiftCertCode']; } if(isset($_SESSION['WebsiteDomain'])) { define('WEBSITE_DOMAIN', $_SESSION['WebsiteDomain']); }else { define('WEBSITE_DOMAIN', $website_domain); $_SESSION['WebsiteDomain']= $website_domain; } if(isset($_SESSION['WebsiteTypeID'])) { define('WEBSITE_TYPE_ID', $_SESSION['WebsiteTypeID']); }else { define('WEBSITE_TYPE_ID', $website_type_id); $_SESSION['WebsiteTypeID']= $website_type_id; } //---------------------------------------------------------- //- Shopping Cart //---------------------------------------------------------- if (isset($_GET['revive'])) { globalclient_inc_revive_shoppingcart(); } globalclient_inc_shoppingcart_session(); //---------------------------------------------------------- //- My Account Register //---------------------------------------------------------- if(isset($_SESSION['LoginRegisterURL'])) { define('LOGIN_REGISTER_URL', $_SESSION['LoginRegisterURL']); }else { define('LOGIN_REGISTER_URL', $final_config['DefaultLoginRegistrationSiteNavigationURL']); $_SESSION['LoginRegisterURL']= $final_config['DefaultLoginRegistrationSiteNavigationURL']; } if(isset($_SESSION['MyAccountURL'])) { define('MY_ACCOUNT_URL', $_SESSION['MyAccountURL']); }else { define('MY_ACCOUNT_URL', $final_config['DefaultMyAccountSiteNavigationURL']); $_SESSION['MyAccountURL']= $final_config['DefaultMyAccountSiteNavigationURL']; } //---------------------------------------------------------- //- FinalConfig Defines //---------------------------------------------------------- define('CLIENT_INDUSTRY', $final_config['SystemClientIndustryID']); define('COMPANY_NAME', $final_config['CompanyName']); define('HOME_NAV_ID', $final_config['DefaultHomeSiteNavigationID']); define('THANK_YOU_ID', $final_config['DefaultThankSiteNavigationID']); define('THANKYOU_URL', $final_config['DefaultThankSiteNavigationURL']); define('NEWS_URL', $final_config['DefaultNewsSiteNavigationURL']); define('FAQ_URL', $final_config['DefaultFAQSiteNavigationURL']); define('CASESTUDY_URL', $final_config['DefaultCaseStudySiteNavigationURL']); define('TESTIMONIAL_URL', $final_config['DefaultTestimonialSiteNavigationURL']); define('LINK_URL', $final_config['DefaultLinkSiteNavigationURL']); define('SERVICE_URL', $final_config['DefaultServiceSiteNavigationURL']); define('KB_URL', $final_config['DefaultKBSiteNavigationURL']); define('TEAM_URL', $final_config['DefaultTeamSiteNavigationURL']); define('EVENT_URL', $final_config['DefaultEventSiteNavigationURL']); define('IMAGEGALLERY_URL', $final_config['DefaultImageGallerySiteNavigationURL']); if(isset($final_config['DefaultResponsiveImageGallerySiteNavigationID'])) { define('NEWIMAGEGALLERY_URL', $final_config['DefaultResponsiveImageGallerySiteNavigationID']); } else { define('NEWIMAGEGALLERY_URL', 'new-image-gallery/'); } define('BLOG_URL', $final_config['DefaultBlogSiteNavigationURL']); if(isset($final_config['DefaultDynamicProductSiteNavigationID'])) { define('DYNAMIC_PRODUCT_PAGE_ID', $final_config['DefaultDynamicProductSiteNavigationID']); } else { define('DYNAMIC_PRODUCT_PAGE_ID', 0); } define('WORDPRESS_RSS_FEED_URL', $final_config['BlogURLAddress']); define('WORDPRESS_RSS_FEED_DISPLAY', $final_config['BlogDisplayEntries']); define('BG_COLOR_HEX', $final_config['BackgroundColor']); define('LINK_COLOR_HEX', $final_config['LinkColor']); define('BG_IMAGE_URL', $final_config['BackgroundImageURL']); define('BG_INNERIMAGE_URL', $final_config['BackgroundInnerImageURL']); define('BORDER_COLOR_HEX', $final_config['BorderColor']); define('SITEBORDER_ID', $final_config['SiteBorderTypeID']); define('HEADERLAYOUT_ID', $final_config['HeaderLayoutID']); define('CURVYCORNERS_ON', $final_config['CurvyCornersOn']); define('FOOTER_JUSTIFY', $final_config['FooterJustification']); define('CSS_OVERRIDE', $final_config['CSSOverrideCode']); define('JS_OVERRIDE', $final_config['CustomJavascriptCode']); define('MENU_COLOR_HEX', $final_config['MenuColor']); define('MENU_COLOR_ON_HEX', $final_config['MenuColorOn']); define('MENUTXT_COLOR_HEX', $final_config['MenuTextColor']); define('MENUTXT_ON_COLOR_HEX', $final_config['MenuTextColorOn']); define('MENUSUB_COLOR_HEX', $final_config['MenuSubColor']); define('MENUSUB_ON_COLOR_HEX', $final_config['MenuSubColorOn']); define('MENUSUBTXT_COLOR_HEX', $final_config['MenuSubTextColor']); define('MENUSUBTXT_ON_COLOR_HEX', $final_config['MenuSubTextColorOn']); define('MENU_IMAGE_URL', $final_config['MenuImageURL']); define('MAIN_NAV_CSS_URL', $final_config['CSSIncludeURL']); //Make Relative Before Going Live with Premium define('MAIN_NAV_NAME', $final_config['MainNavigationTypeName']); $favicon_url = str_replace("http://", "https://s3.amazonaws.com/", $final_config['FaviconURL']); define('FAVICON_URL', $favicon_url); define('STOPWORDS', 'about,after,all,also,an,and,another,any,are,as,at,be,because,been,before,being,between,both,but,by,came,can,come,could,did,do,each,for,from,get,got,has,had,he,have,her,here,him,himself,his,how,if,in,into,is,it,like,make,many,me,might,more,most,much,must,my,never,now,of,on,only,or,other,our,out,over,said,same,see,should,since,some,still,such,take,than,that,the,their,them,then,there,these,they,this,those,through,to,too,under,up,very,was,way,we,well,were,what,where,which,while,who,with,would,you,your,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$,1,2,3,4,5,6,7,8,9,0,_'); $header_img = '0'; //- This should be coming from PREMProducts plugin/config define('ECOMM_PROCESSING_URL', 'https://www.secure-premiumcommerce.com'); //- This constant will define the site as being responsive design capable or not. //- Value = 16 - Premium Designs (Legacy Design Template) //- Value = 17 - Flexible (Responsive Design Template) define('WEBSITE_TEMPLATE_CATEGORY_ID', $final_config['WebsiteTemplateCategoryID']); if(isset($_SESSION['CDN-URL'])) { define('CDN_URL', $_SESSION['CDN-URL']); }else { define('CDN_URL', $final_config['ContentDeliveryDomainName']); $_SESSION['CDN-URL']= $final_config['ContentDeliveryDomainName']; } if(isset($_SESSION['SECURE-CDN-URL'])) { define('SECURE_CDN_URL', $_SESSION['SECURE-CDN-URL']); }else { if(isset($final_config['SecureContentDeliveryURL'])){ define('SECURE_CDN_URL', $final_config['SecureContentDeliveryURL']); $_SESSION['SECURE-CDN-URL']= $final_config['SecureContentDeliveryURL']; }else { define('SECURE_CDN_URL', '0'); $_SESSION['SECURE-CDN-URL']= '0'; } } //---------------------------------------------------------- //- Site Navigation //---------------------------------------------------------- $my_xml_parser = new xml_parser(SITE_ROOT.'xml/'.$website_id.'/site_navigation.xml',0,1,'tag','Y'); $site_nav_info = $my_xml_parser->xml_output['SiteNavigation']['SiteNavigationDetail']; if (isset($_GET['RewritePath'])) { if (is_string($_GET['RewritePath'])) { foreach($site_nav_info as $nav_entry) { if (preg_replace("/[^a-zA-Z0-9s]/", "", $nav_entry['URLAddress'])==preg_replace("/[^a-zA-Z0-9s]/", "", $_GET['RewritePath'])) { $entity_id=$nav_entry['SiteNavigationID']; if(isset($nav_entry['MasterSiteNavigationID'])){ $master_entity_id=$nav_entry['MasterSiteNavigationID']; }else { $master_entity_id=''; } if($nav_entry['ImagePath']!=='0'){ @$header_img=$nav_entry['ImagePath']; if(!defined('HEADER_IMAGE')){ define('HEADER_IMAGE', $header_img); } }else { if(!defined('HEADER_IMAGE')){ define('HEADER_IMAGE', '0'); } } if ('Y' == POWERTRAIN_V2) { $plugin_config_obj = new DC_PluginConfig(CLIENT_ID, WEBSITE_ID, 'PREMRegisterAccount'); $redirect_plugin_config = $plugin_config_obj->getPluginConfigAsArray(); } else { $redirect_plugin_config_xml_parser = new xml_parser(SITE_ROOT.'xml/'.WEBSITE_ID.'/plugin_config.xml',0,1,'tag','Y'); $redirect_plugin_config=$redirect_plugin_config_xml_parser->xml_output['GenericPluginConfig']['PREMRegisterAccount']; } //echo '
COOKIE:
'. print_r($_COOKIE, true) .'
'; //if(isset($_COOKIE['Client_SimpleCRMContactID']) && $_COOKIE['Client_SimpleCRMContactID']!=='0'){ if (!empty($_COOKIE['Client_SimpleCRMContactID'])) { if(isset($query_string)){ $current_url_no_querystring = str_replace('?'.$query_string,'',sanitizeText($_SERVER['REQUEST_URI'])); }else { $current_url_no_querystring = sanitizeText($_SERVER['REQUEST_URI']); } if($current_url_no_querystring == '/'.$redirect_plugin_config['RegistrationMyAccountLoginRequiredBounceToURL']){ header('Location: /'.MY_ACCOUNT_URL); } } if(isset($nav_entry['ProtectedByLogin'])) { $protectedby_login=$nav_entry['ProtectedByLogin']; list($current_url_no_querystring) = explode('?', sanitizeText($_SERVER['REQUEST_URI'])); //-- Make an exception for 'become-a-member' under MyAccount. It should not bounce to login page. if (strpos($current_url_no_querystring, 'become-a-member/') !== false) { $protectedby_login = 'N'; } if ($protectedby_login=='Y') { $logout_url_id = '0'; if (isset($redirect_plugin_config['RegistrationMyAccountLoginRequiredBounceTo'])) { $logout_url_id = $redirect_plugin_config['RegistrationMyAccountLoginRequiredBounceTo']; } if($logout_url_id=='0'){ //$logout_url = '/'.$_SESSION['LoginRegisterURL']; $logout_url = '/login-register/'; }else { $logout_url = '/'.$redirect_plugin_config['RegistrationMyAccountLoginRequiredBounceToURL']; } //print_r($redirect_plugin_config); if (!isset($_COOKIE['Client_SimpleCRMContactID']) || $_COOKIE['Client_SimpleCRMContactID']=='0') { if (isset($_GET['back-to'])) { header('Location: '.$logout_url.'?ref='.$nav_entry['URLAddress'].'&back-to='.$_GET['back-to']); //echo('Location: '.$logout_url.'?ref='.$nav_entry['URLAddress'].'&back-to='.$_GET['back-to']); die(); } else { header('Location: '.$logout_url.'?ref='.$nav_entry['URLAddress'].'&back-to='.trim(sanitizeText($_SERVER['REQUEST_URI']),'/')); //echo('Location: '.$logout_url.'?ref='.$nav_entry['URLAddress'].'&back-to='.trim(sanitizeText($_SERVER['REQUEST_URI']),'/')); die(); } } else { $allow_group_access = 'Y'; if (isset($nav_entry['SimpleCRMContactGroupIDs'])) { $allow_group_access = 'N'; $customer_group_protected_page_array = explode(',',$nav_entry['SimpleCRMContactGroupIDs']); $customer_group_array = explode(',',$_COOKIE['Client_SimpleCRMContactGroupIDs']); foreach($customer_group_protected_page_array as $customer_group_id){ if (in_array($customer_group_id,$customer_group_array)) { $allow_group_access = 'Y'; } } if ($allow_group_access=='N') { $persist_cookie_for_seconds = 10000; setcookie('Client_SimpleCRMContactID', 0, time()-$persist_cookie_for_seconds, '/'); setcookie('Client_FirstName', '', time()-$persist_cookie_for_seconds, '/'); setcookie('Client_LastName', '', time()-$persist_cookie_for_seconds, '/'); setcookie('Client_CompanyName', '', time()-$persist_cookie_for_seconds, '/'); setcookie('Client_EmailAddress', '', time()-$persist_cookie_for_seconds, '/'); setcookie('Client_SimpleCRMContactGroupIDs', '', time()-$persist_cookie_for_seconds, '/'); setcookie('Client_CategoryID', 0, time()-$persist_cookie_for_seconds, '/'); if (isset($_GET['back-to'])) { header('Location: '.$logout_url.'?ref='.$nav_entry['URLAddress'].'&back-to='.$_GET['back-to']); } else { header('Location: '.$logout_url.'?ref='.$nav_entry['URLAddress'].'&back-to='.trim(sanitizeText($_SERVER['REQUEST_URI']),'/')); } } } } } } } } } } else { foreach($site_nav_info as $nav_entry) { if($nav_entry['SiteNavigationID']==$final_config['DefaultHomeSiteNavigationID']) { if($nav_entry['ImagePath']!=='0'){ define('HEADER_IMAGE', $nav_entry['ImagePath']); }else { define('HEADER_IMAGE', '0'); } } } } //------------------------------------------------------------- //- Template Data Set (move this down, closer to where it's used?) //------------------------------------------------------------- $xml_path = SITE_ROOT.'xml/'.$website_id.'/'; $client_menu = new client_menu($xml_path, SITE_URL, $website_id); $template_xml_parser = new xml_parser(SITE_ROOT.'xml/'.$website_id.'/websitetemplatehomepage.xml',0,1,'tag','Y'); $template_data = $template_xml_parser->xml_output['WebsiteHomePageTemplate']['WebsiteSectionDetail']; $pretty_template_data=array(); if(!is_array($template_data)) { $template_data=array(); } foreach($template_data as $template_key => $template_value) { $single_config_values = array('WebsiteTemplateHomePageID', 'SystemClientID', 'WebsiteID', 'WebsiteTemplateID', 'TemplateFolderPath', '/wald/'); if(!in_array($template_key, $single_config_values)) { $section_letter=substr($template_key, 0, 1); if(!isset($pretty_template_data[$section_letter])) { $pretty_template_data[$section_letter]=array(); } $pretty_template_data[$section_letter][substr($template_key, 1)]=$template_value; } else { $pretty_template_data[$template_key]=$template_value; } } //if(isset($_GET['demo'])){ // $final_config_template_folder = $_GET['demo']; //}else { $final_config_template_folder = $final_config['TemplateFolderPath']; //} $content = ''; $url_based_custom_html = ''; $url_based_custom_image = ''; $url_based_custom_h1 = ''; $url_based_custom_refinements_code = ''; $meta_data_value_array = array(); //---------------------------------------------------------- //-- Home Page //---------------------------------------------------------- if ($entity_id==0 && !isset($_GET['RewritePath']) ) { $content = file_get_contents(SITE_ROOT.'templates'.$final_config_template_folder.'index.php'); $content_xml_parser = new xml_parser($xml_path.'sitenavigationpagecontent-'.$website_id.'_'.HOME_NAV_ID.'.xml',0,1,'tag','Y'); $content_xml = $content_xml_parser->xml_output['SiteNavigationPageContent']['SiteNavigationPageContentDetail']; $meta_data=''; if($preview_html=='N'){ $meta_data.=''.$content_xml['MetaTitle'].''; }else { $meta_data.='PREVIEW: '.$content_xml['MetaTitle'].''; } //$meta_data.=''; $meta_data.=''; //$meta_data.=''; //- Sets the Open Graph Meta $meta_data.=''; $meta_data.=''; $meta_data.=''; $meta_data.=''; if(isset($content_xml['OpenGraphImagePath'])){ if($content_xml['OpenGraphImagePath'] !== 0){ $meta_data.=''; } } if(isset($_GET['show-cart']) || isset($_GET['back-to'])) { $meta_data .= ''; } $seo_text=$content_xml['SEOTopLineText']; $gc=1; $ga=1; $site_content['homepage_content']=''; if($final_config['ShowH1PageNameHeaders']=='Y'){ $site_content['homepage_content']='

'.$content_xml['GenericPageName'].'

'; } $site_content['homepage_content']=$content_xml['GenericPageHTMLContent']; if($preview_html == 'Y'){ $preview_page_data = db_search::sp_execute('dbo.DCExp_System_GenericPageVersion_Profile_Preview', "@SystemClientID||@WebsiteID||@GenericPageID", CLIENT_ID.'||'.WEBSITE_ID.'||'.$content_xml['GenericPageID'],'SQLINT4||SQLINT4||SQLINT4'); $site_content['homepage_content']= $preview_page_data[0]['GenericPageHTMLContent']; } if(isset($site_content['homepage_content'])) { $home_content_xml=$site_content['homepage_content']; preg_match_all('/HTMLWidget:(.+?):HTMLWidget/', $home_content_xml, $out); if(isset($out[1])) { foreach($out[1] as $function_data) { $function_data_array = explode("/", $function_data, 4); $function_name = 'HTMLWidget'; if(isset($function_data_array[0])) { $function_param_id = $function_data_array[0]; $function_param_style = $function_data_array[1]; $function_param_height = $function_data_array[2]; $function_param_width = $function_data_array[3]; if(function_exists($function_name)) { $home_content_xml=str_replace('HTMLWidget:'.$function_data.':HTMLWidget', call_user_func('HTMLWidget', $function_param_id, $function_param_style, $function_param_height, $function_param_width, $client_id), $home_content_xml); } } } } $site_content['homepage_content'] = $home_content_xml; // this is where the sub for plugin code would get translated weeee } if(isset($site_content['homepage_content'])) { $home_content_xml=$site_content['homepage_content']; preg_match_all('/Plugin:(.+?):Plugin/', $home_content_xml, $out); if(isset($out[1])) { foreach($out[1] as $function_data) { // test $home_plugin = false; if (strpos($function_data, 'home') !== false) { $home_plugin = true; } // test $function_data_array = explode("/", $function_data, 2); if(isset($function_data_array[0])) { // if (strpos($function_data_array[1],'/nocache') !== false) { // $home_content_xml=str_replace('Plugin:'.$function_data.':Plugin', '
'.$function_data.'
', $home_content_xml); // } else { $function_name = 'inline_plugin_'.$function_data_array[0]; $function_style = $function_data_array[1]; if ('N' == POWERTRAIN_V2 || $home_plugin !== false) { $plugin_path = 'plugins/content-inline/plugins.php'; } else { $plugin_path = 'client/inline_controller.php'; } if(file_exists($plugin_path)) { $plugin_content=require_once($plugin_path); if($function_name!=='' && function_exists($function_name)) { $home_content_xml=str_replace('Plugin:'.$function_data.':Plugin', call_user_func($function_name, $function_style), $home_content_xml); //$home_content_xml=str_replace('Plugin:'.$function_data.':Plugin', '
'.$function_data.'
', $home_content_xml); } } //} } } } $site_content['homepage_content'] = $home_content_xml; // this is where the sub for plugin code would get translated weeee } //--Allows for Blog to be Home Page--// if($content_xml['ManagedBySystemModuleID']==182) { $plugin_path = 'plugins/content-inline/plugins.php'; $module_function = 'blog'; if(file_exists($plugin_path)) { $plugin_content=require_once($plugin_path); if($module_function!=='') { $site_content['homepage_content'].=call_user_func('module_'.$module_function, ''); }else { $site_content['homepage_content'].=$content_xml['GenericPageHTMLContent']; if($preview_html == 'Y'){ $preview_page_data = db_search::sp_execute('dbo.DCExp_System_GenericPageVersion_Profile_Preview', "@SystemClientID||@WebsiteID||@GenericPageID", CLIENT_ID.'||'.WEBSITE_ID.'||'.$content_xml['GenericPageID'],'SQLINT4||SQLINT4||SQLINT4'); $site_content['homepage_content']= $preview_page_data[0]['GenericPageHTMLContent']; } } } } } else { //---------------------------------------------------------- //-- Other Pages (RewritePath set by htaccess) //---------------------------------------------------------- //- Build Custom Header HTML / META Tags Based on URL for Product Categories or Brands $content = file_get_contents(SITE_ROOT.'/templates'.$final_config_template_folder.'content.php'); if($entity_id=='0' ){ if($is_nextopia_url == 'Y'){ $entity_id = DYNAMIC_PRODUCT_PAGE_ID; $url_based_custom_data = db_search::sp_execute( 'dbo.DCEcomm_System_ProductCategory_Profile_ByURL', '@SystemClientID||@CustomURL', CLIENT_ID .'||'. $uri_parts[0], 'SQLINT4||SQLINT4' ); //- No Categories Match URL, Try Brands if(!$url_based_custom_data){ $url_based_custom_data = db_search::sp_execute( 'dbo.DCEcomm_System_Brand_Profile_ByURL', '@SystemClientID||@CustomURL', CLIENT_ID .'||'. $uri_parts[0], 'SQLINT4||SQLINT4' ); } //- No Brands Match URL, Use URL Parts Dynamically if(!$url_based_custom_data){ $raw_url_array = explode('/',$uri_parts[0]); if($raw_url_array){ $url_based_custom_data = array(); $header_name_value = str_replace('-', ' ', $raw_url_array[1]); $url_based_custom_data[0]['CustomHTMLHeader'] = ''; $url_based_custom_data[0]['CustomH1Text'] = ucwords($header_name_value); $url_based_custom_data[0]['CustomMetaTitle'] = 'Shop for '.ucwords($header_name_value); $url_based_custom_data[0]['CustomMetaDescription'] = 'Shop for '.ucwords($header_name_value); $url_based_custom_data[0]['CustomHeaderImagePath'] = ''; $url_based_custom_data[0]['CustomRefinementsCode'] = ''; } } if($url_based_custom_data){ $url_based_custom_html = $url_based_custom_data[0]['CustomHTMLHeader']; $url_based_custom_h1 = $url_based_custom_data[0]['CustomH1Text']; $url_based_custom_refinements_code = $url_based_custom_data[0]['CustomRefinementsCode']; if(!$url_based_custom_h1){ $url_based_custom_h1 = $url_based_custom_data[0]['NameValue']; } $url_based_custom_meta_title = $url_based_custom_data[0]['CustomMetaTitle']; if(!$url_based_custom_meta_title){ $url_based_custom_meta_title = 'Shop for '.$url_based_custom_data[0]['NameValue']; } $url_based_custom_meta_desc = $url_based_custom_data[0]['CustomMetaDescription']; if(!$url_based_custom_meta_desc){ $url_based_custom_meta_desc = 'Shop for '.$url_based_custom_data[0]['NameValue']; } $url_based_custom_image = $url_based_custom_data[0]['CustomHeaderImagePath']; $meta_data_value_array['MetaTitle'] = $url_based_custom_meta_title; $meta_data_value_array['MetaDescription'] = $url_based_custom_meta_desc; } } else { header('Location: '.str_replace('http://', 'https://', SITE_URL).'/404/'); } } $content_xml_parser = new xml_parser($xml_path.'sitenavigationpagecontent-'.$website_id.'_'.$entity_id.'.xml',0,1,'tag','Y'); if(isset($content_xml_parser->xml_output['SiteNavigationPageContent']['SiteNavigationPageContentDetail'])){ $content_xml = $content_xml_parser->xml_output['SiteNavigationPageContent']['SiteNavigationPageContentDetail']; }else { $content_xml = false; //$headers = 'MIME-Version: 1.0' . "\r\n"; //$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; //$headers .= 'From: toffling@dreamingcode.com'. "\r\n"; //$headers .="\r\n\r\n"; //mail('toffling@dreamingcode.com', 'XML File Access Failed', 'For Page:'. sanitizeText($_SERVER['REQUEST_URI']) .' - For XML:'.$xml_path.'sitenavigationpagecontent-'.$website_id.'_'.$entity_id.'.xml', $headers, '-finfo@commerce.dreamingcode.com'); } if(!$content_xml || $entity_id=='0' ){ header('Location: '.str_replace('http://', 'https://', SITE_URL).'/404/'); } // echo '
';
		// print_r($content_xml);
		// echo '
'; //---------------------------------------------------------- //- Breadcrumb Functionality for Content Inner Pages //---------------------------------------------------------- $bread_crumb_content_page_value = ''; if(isset($final_config['ContentPageBreadcrumbsOn'])){ if($final_config['ContentPageBreadcrumbsOn']=='Y' && $content_xml['ManagedBySystemModuleID']!=110){ $content_page_data = db_search::sp_execute("dbo.DCExp_Client_SiteNavigation_Profile",'@SystemClientID||@SiteNavigationID',CLIENT_ID.'||'.$content_xml['SiteNavigationID'],'SQLINT4||SQLINT4'); if($content_page_data){ $master_sitenav_id = $content_page_data[0]['MasterSiteNavigationID']; if($master_sitenav_id){ $content_page_data = db_search::sp_execute("dbo.DCExp_Client_SiteNavigation_Profile",'@SystemClientID||@SiteNavigationID',CLIENT_ID.'||'.$master_sitenav_id,'SQLINT4||SQLINT4'); if($content_page_data[0]['ExternalSiteDirectURL']){ $bread_crumb_content_page_value = 'Home > '.$content_page_data[0]['SiteNavigationName'].' > '.$content_xml['GenericPageName']; }else { $bread_crumb_content_page_value = 'Home > '.$content_page_data[0]['SiteNavigationName'].' > '.$content_xml['GenericPageName']; } }else { $bread_crumb_content_page_value = 'Home > '.$content_xml['GenericPageName']; } } } } //---------------------------------------------------------- //- Meta Tag Generation //---------------------------------------------------------- $meta_data = globalclient_inc_dynamic_metadata($content_xml, $preview_html, $meta_data_value_array); $seo_text=$content_xml['SEOTopLineText']; if($content_xml['IncludeGoogleConversionCode']=='Y') { $gc=1; } else { $gc=0; } //---------------------------------------------------------- //- Start Inner Page Content //---------------------------------------------------------- $site_content['innerpage_content']=''; $name_header_content = ''; if(!isset($_GET['DetailID'])){ if($final_config['ShowH1PageNameHeaders']=='Y'){ $name_header_content = '

'.$content_xml['GenericPageName'].'

'; $site_content['innerpage_content']=$name_header_content; } } //---------------------------------------------------------- //-- Add Module Output //---------------------------------------------------------- $plugin_call_data = globalclient_inc_get_module_functions($content_xml['ManagedBySystemModuleID'], $powertrain_v2_enabled); $plugin_path = $plugin_call_data['plugin_path']; $module_path = $plugin_call_data['module_path']; $module_function = $plugin_call_data['module_function']; if ($plugin_path && file_exists($plugin_path)) { $plugin_content=require_once($plugin_path); if ($module_function!=='') { $site_content['innerpage_content'].=call_user_func('module_'.$module_function, $content_xml['GenericPageHTMLContent']); // echo '
';
				// print_r('module_'.$module_function.' | '.$content_xml['GenericPageHTMLContent']);
				// echo '
'; } else { $generic_page_html = $content_xml['GenericPageHTMLContent']; if($is_nextopia_url == 'Y'){ $generic_page_html=str_replace('|DYNAMIC-HEADER-IMAGE|', $url_based_custom_image, $generic_page_html); $generic_page_html=str_replace('|DYNAMIC-H1|', $url_based_custom_h1, $generic_page_html); $generic_page_html=str_replace('|DYNAMIC-HEADER-CONTENT|', $url_based_custom_html, $generic_page_html); } $site_content['innerpage_content'].=$generic_page_html; if ($preview_html == 'Y') { $preview_page_data = db_search::sp_execute('dbo.DCExp_System_GenericPageVersion_Profile_Preview', "@SystemClientID||@WebsiteID||@GenericPageID", CLIENT_ID.'||'.WEBSITE_ID.'||'.$content_xml['GenericPageID'],'SQLINT4||SQLINT4||SQLINT4'); $site_content['innerpage_content']= $preview_page_data[0]['GenericPageHTMLContent']; //echo('

INNER-PREVIEW-1'); } } } } //---------------------------------------------------------- //- Add HTMLWidget Output //---------------------------------------------------------- if (isset($site_content['innerpage_content'])) { $innerpage_content_xml = globalclient_inc_inner_page_widgets($client_id, $site_content['innerpage_content']); $site_content['innerpage_content'] = $innerpage_content_xml; // this is where the sub for plugin code would get translated weeee } //---------------------------------------------------------- //-- Add Inline Plugin Output //---------------------------------------------------------- $managed_by_module_id = $content_xml['ManagedBySystemModuleID']; $search_base_category_id_for_plugin = ''; if (isset($site_content['innerpage_content'])) { $innerpage_content_xml = globalclient_inc_inner_page_plugins($client_id, $site_content['innerpage_content'], $managed_by_module_id); $site_content['innerpage_content'] = $innerpage_content_xml; } if (isset($_SESSION['GlobalIncProductSearchCategoryID'])) { $search_base_category_id_for_plugin = $_SESSION['GlobalIncProductSearchCategoryID']; $_SESSION['GlobalIncProductSearchCategoryID'] = NULL; } //---------------------------------------------------------- //-Start Sidebar Plugin Content Build //---------------------------------------------------------- $site_content['sidebar_content']=''; $site_content['main_plugin_content_left']=''; $site_content['main_plugin_content_right']=''; if(isset($master_entity_id)){ if($master_entity_id=='0'){ define('MAIN_PAGE_ID', $entity_id); }else { define('MAIN_PAGE_ID', $master_entity_id); } } if (isset($content_xml)) { for($plugin_count=1;$plugin_count<=10;$plugin_count++) { $plugin_functionname = $content_xml['SideBarPluginPath'.$plugin_count]; $plugin_position = $content_xml['SideBarPlugin'.$plugin_count.'Position']; $plugin_type_id = $content_xml['SideBarPlugin'.$plugin_count.'Type']; $plugin_path = 'plugins/content-inline/plugins.php'; if(file_exists($plugin_path)) { $plugin_content=require_once($plugin_path); if($plugin_functionname!=='0') { if($plugin_position=='L'){//-Position on the Left Sidebar $left_plugins_exist='Y'; //echo('
$left_plugins_exist='.$left_plugins_exist); if($plugin_type_id=='H'){//-HTML Widget $site_content['main_plugin_content_left'].=$plugin_functionname; }else {//-Normal Plugin if(is_callable ('plugin_'.$plugin_functionname)){ $site_content['main_plugin_content_left'].=call_user_func('plugin_'.$plugin_functionname); } } }else {//-Position on the Right Sidebar $right_plugins_exist='Y'; //echo('
$right_plugins_exist='.$right_plugins_exist); if($plugin_type_id=='H'){//-HTML Widget $site_content['main_plugin_content_right'].=$plugin_functionname; }else {//-Normal Plugin if(is_callable ('plugin_'.$plugin_functionname)){ $site_content['main_plugin_content_right'].=call_user_func('plugin_'.$plugin_functionname); } } } } } } } //---------------------------------------------------------- //- Possible Deprecate Left and Right Plugins //---------------------------------------------------------- if (isset($site_content['main_plugin_content_left'])) { $main_plugin_content_left_content_xml=$site_content['main_plugin_content_left']; preg_match_all('/Plugin:(.+?):Plugin/', $main_plugin_content_left_content_xml, $out); if(isset($out[1])) { foreach($out[1] as $function_data) { $function_data_array = explode("/", $function_data, 2); if(isset($function_data_array[0])) { $function_name = 'inline_plugin_'.$function_data_array[0]; $function_style = $function_data_array[1]; $plugin_path = 'plugins/content-inline/plugins.php'; if(file_exists($plugin_path)) { $plugin_content=require_once($plugin_path); if($function_name!=='') { $main_plugin_content_left_content_xml=str_replace('Plugin:'.$function_data.':Plugin', call_user_func($function_name, $function_style), $main_plugin_content_left_content_xml); } } } } } $site_content['main_plugin_content_left'] = $main_plugin_content_left_content_xml; // this is where the sub for plugin code would get translated weeee } if(isset($site_content['main_plugin_content_right'])) { $main_plugin_content_right_content_xml=$site_content['main_plugin_content_right']; preg_match_all('/Plugin:(.+?):Plugin/', $main_plugin_content_right_content_xml, $out); if(isset($out[1])) { foreach($out[1] as $function_data) { $function_data_array = explode("/", $function_data, 2); if(isset($function_data_array[0])) { $function_name = 'inline_plugin_'.$function_data_array[0]; $function_style = $function_data_array[1]; $plugin_path = 'plugins/content-inline/plugins.php'; if(file_exists($plugin_path)) { $plugin_content=require_once($plugin_path); if($function_name!=='') { $main_plugin_content_right_content_xml=str_replace('Plugin:'.$function_data.':Plugin', call_user_func($function_name, $function_style), $main_plugin_content_right_content_xml); } } } } } $site_content['main_plugin_content_right'] = $main_plugin_content_right_content_xml; // this is where the sub for plugin code would get translated weeee } //-- End Possible Deprecate //--------------------------------------------------------- //- Template Data Used //--------------------------------------------------------- foreach ($pretty_template_data as $sub_key => $sub_value) { $content_key='content_section_'.strtolower($sub_key); if(is_array($sub_value) && $sub_value['SectionTypeCode']==1) { $xtra=''; $http_pos = strrpos($sub_value['ContentSectionValue'], "http://"); if ($http_pos === false) { // note: three equal signs // not found... } if(isset($sub_value['ContentAltText'])){ $content_alt_text = $sub_value['ContentAltText']; }else { $content_alt_text = ''; } $site_content[$content_key] = ''.$content_alt_text.''; } else { if (is_array($sub_value) && $sub_value['SectionManagedByModuleID']==1) { if (is_array($sub_value) && $sub_value['SectionTypeCode']==5) { if (false !== ($raw_nav = file_get_contents(SITE_ROOT.'xml/'.$website_id.'/main_nav-'.$website_id.'.php'))) { $raw_nav = file_get_contents(SITE_ROOT.'xml/'.$website_id.'/main_nav-'.$website_id.'.php'); } else { $raw_nav = ''; } //- Set main nav class depending on device $is_mobile = detect_mobile(); $raw_nav = str_replace('id="nav"','id="nav" class="dropdown nav navbar-nav"',$raw_nav); if($is_mobile === true) { $raw_nav = str_replace('id="nav"','id="nav_mobile"',$raw_nav); } //- Persist Main Navigation OnState Functionality if(isset($final_config['PersistMainNavigationOnState'])){ if($final_config['PersistMainNavigationOnState']=='Y'){ $request_url_array = explode('?',sanitizeText($_SERVER['REQUEST_URI'])); if($request_url_array){ $clean_page_url = substr($request_url_array[0],1); $main_nav_sequence_data = db_search::sp_execute("dbo.DCExp_Client_SiteNavigation_MasterNavSequence_ByURLAddress",'@SystemClientID||@WebsiteID||@URLAddress',CLIENT_ID.'||'.WEBSITE_ID.'||'.$clean_page_url,'SQLINT4||SQLINT4||SQLVARCHAR'); if($main_nav_sequence_data){ $main_nav_sequence_value = $main_nav_sequence_data[0]['MainNavigationSequence']; $raw_nav = str_replace('class="dir'.$main_nav_sequence_value.'"','class="dir'.$main_nav_sequence_value.'-onstate"',$raw_nav); } } } } $site_content[$content_key]=$raw_nav; } elseif(is_array($sub_value) && $sub_value['SectionTypeCode']==7) { $raw_nav = file_get_contents(SITE_ROOT.'/templates'.$final_config_template_folder.'footer_nav.php'); $nav_data=explode('||',$raw_nav); $site_content[$content_key]=$client_menu->other_navigation_html('Footer', $nav_data); } elseif(is_array($sub_value) && $sub_value['SectionTypeCode']==4) { $raw_nav = file_get_contents(SITE_ROOT.'/templates'.$final_config_template_folder.'top_nav.php'); $nav_data=explode('||',$raw_nav); $site_content[$content_key]=$client_menu->other_navigation_html('Top', $nav_data); } elseif(is_array($sub_value) && $sub_value['SectionTypeCode']==6) { $raw_nav = file_get_contents(SITE_ROOT.'/templates'.$final_config_template_folder.'left_nav.php'); $nav_data=explode('||',$raw_nav); $site_content[$content_key]=$client_menu->other_navigation_html('Left', $nav_data); } } else { if(is_array($sub_value) && $sub_value['ContentSectionValue']!=='0'){ $content_section_html = $sub_value['ContentSectionValue']; }else { $content_section_html = ''; } preg_match_all('/HTMLWidget:(.+?):HTMLWidget/', $content_section_html, $out); if(isset($out[1])) { foreach($out[1] as $function_data) { $function_data_array = explode("/", $function_data, 4); $function_name = 'HTMLWidget'; if(isset($function_data_array[0])) { $function_param_id = @$function_data_array[0]; $function_param_style = @$function_data_array[1]; $function_param_height = @$function_data_array[2]; $function_param_width = @$function_data_array[3]; if(function_exists($function_name)) { $content_section_html=str_replace('HTMLWidget:'.$function_data.':HTMLWidget', call_user_func('HTMLWidget', $function_param_id, $function_param_style, $function_param_height, $function_param_width, $client_id), $content_section_html); } } } } // $innerpage_content_xml=$site_content['innerpage_content']; preg_match_all('/Plugin:(.+?):Plugin/', $content_section_html, $out); if(isset($out[1])) { foreach($out[1] as $function_data) { $function_data_array = explode("/", $function_data, 2); if(isset($function_data_array[0])) { if (strpos($function_data_array[1],'/nocache') !== false) { $content_section_html=str_replace('Plugin:'.$function_data.':Plugin', '
'.$function_data.'
', $content_section_html); } else { $function_name = 'inline_plugin_'.$function_data_array[0]; $function_style = $function_data_array[1]; if ('N' == POWERTRAIN_V2) { $plugin_path = 'plugins/content-inline/plugins.php'; } else { $plugin_path = 'client/inline_controller.php'; } if(file_exists($plugin_path)) { $plugin_content=require_once($plugin_path); if($function_name!=='') { $content_section_html=str_replace('Plugin:'.$function_data.':Plugin', call_user_func($function_name, $function_style), $content_section_html); //$content_section_html=str_replace('Plugin:'.$function_data.':Plugin', '
'.$function_data.'
', $content_section_html); } } } } } } // $site_content['innerpage_content'] = $innerpage_content_xml; // this is where the sub for plugin code would get translated weeee $function_data = get_string_between($content_section_html, ''); $function_name = ''; $function_data_array = explode("/", $function_data, 2); $function_name = $function_data_array[0]; if(isset($function_data_array[1])) { $function_param_value = $function_data_array[1]; if(function_exists($function_name)) { $content_section_html.=call_user_func($function_name, $function_param_value); $some_key=$content_key; } $site_content[$content_key] = $content_section_html; // this is where the sub for plugin code would get translated weeee if($content_section_html=='3') { $site_content[$content_key]=''; } } else { if(function_exists($function_name)) { $content_section_html.=call_user_func($function_name); $some_key=$content_key; } $site_content[$content_key] = $content_section_html; // this is where the sub for plugin code would get translated weeee if($content_section_html=='3') { $site_content[$content_key]=''; } } } } } //---------------------------------------------------------- //- Possible Deprecate //---------------------------------------------------------- if(isset($site_content['innerpage_content'])) { $innerpage_content_xml=$site_content['innerpage_content']; preg_match_all('//', $innerpage_content_xml, $out); if(isset($out[1])) { foreach($out[1] as $function_data) { $function_data_array = explode("/", $function_data, 2); $function_name = $function_data_array[0]; if(isset($function_data_array[1])) { $function_param_value = $function_data_array[1]; if(!is_numeric($function_param_value)){ $function_param_value = $_GET[$function_param_value]; } if(function_exists($function_name)) { $innerpage_content_xml=str_replace('', call_user_func($function_name, $function_param_value, $client_id), $innerpage_content_xml); } } else { if(function_exists($function_name)) { $innerpage_content_xml=str_replace('', call_user_func($function_name), $innerpage_content_xml); } } } } $site_content['innerpage_content'] = $innerpage_content_xml; // this is where the sub for plugin code would get translated weeee } //- End Possible Deprecate //---------------------------------------------------------- //-- Build the Sandwich //---------------------------------------------------------- $header = file_get_contents(SITE_ROOT.'/templates'.$final_config_template_folder.'header.php'); $footer = file_get_contents(SITE_ROOT.'/templates'.$final_config_template_folder.'footer.php'); $code = $header.$content.$footer; //----------------- Start Include Google / ClickTale / VoiceStar Code into Template --------------------// $google_analytics_code = $final_config['GoogleAnalyticsCode']; $google_conversion_code= $final_config['GoogleConversionCode']; if($gc==1 && $google_conversion_code!='0') { $code = str_replace('', $google_conversion_code.='', $code); } $code = str_replace('', ''.$meta_data, $code); if($seo_text!='0'){ $code = str_replace('
', '
'.$seo_text, $code); } $show_google_ecomm_track = preg_match( '/\/ecomm-order-thankyou\//', sanitizeText($_SERVER['REQUEST_URI']) ) ? 1 : 0; if(isset($final_config['DynamicHeadTagContent']) && $final_config['DynamicHeadTagContent']!=='0'){ $dynamic_headtag_content = $final_config['DynamicHeadTagContent']; $dynamic_headtag_content = str_replace('', $url_based_custom_refinements_code, $dynamic_headtag_content); $code = str_replace('', $dynamic_headtag_content, $code); } if(isset($final_config['GoogleTagManagerCode']) && $final_config['GoogleTagManagerCode']!=='0') { $google_tagmanager_code = str_replace("\|\|","||",$final_config['GoogleTagManagerCode']); $code = str_replace('', $google_tagmanager_code, $code); } if(isset($final_config['GoogleTagBody']) && $final_config['GoogleTagBody']!=='0') { $google_tagmanager_code_body = str_replace("\|\|","||",$final_config['GoogleTagBody']); $code = str_replace('', $google_tagmanager_code_body, $code); } if($final_config['GoogleAnalyticsCode']!=='0') { $google_analytics_code = str_replace("\|\|","||",$final_config['GoogleAnalyticsCode']); $code = str_replace('', $google_analytics_code, $code); } if($final_config['GoogleWebmasterToolsCode']!=='0') { $google_webmaster_code = str_replace("\|\|","||",$final_config['GoogleWebmasterToolsCode']); $code = str_replace('', $google_webmaster_code, $code); } if(isset($final_config['GoogleMarketingCode'])){ if($final_config['GoogleMarketingCode']!=='0') { $google_marketing_code = str_replace("\|\|","||",$final_config['GoogleMarketingCode']); $code = str_replace('', $google_marketing_code, $code); } } //---------------------------------------------------------- //-- Google Adwords Conversion Code //---------------------------------------------------------- if (isset($final_config['GoogleAdwordsConversionCode']) && $show_google_ecomm_track==1) { $google_adwords_conversion_code = globalclient_inc_google_adwords_conversion_code($final_config['GoogleAdwordsConversionCode']); if ($google_adwords_conversion_code) { $code = str_replace('', $google_adwords_conversion_code, $code); } } //---------------------------------------------------------- //-- Google Trusted Stores Code //---------------------------------------------------------- $show_google_ecomm_track = preg_match( '/\/ecomm-order-thankyou\//', sanitizeText($_SERVER['REQUEST_URI']) ) ? 1 : 0; if($show_google_ecomm_track==1) { $google_trusted_stores_code = globalclient_inc_google_trusted_stores(); if ($google_trusted_stores_code) { $code = str_replace('', $google_trusted_stores_code, $code); } } if($final_config['ClickTaleTopCode']!=='0') { $clicktale_top_code = str_replace("\|\|","||",$final_config['ClickTaleTopCode']); $code = str_replace('', $clicktale_top_code, $code); } if($final_config['ClickTaleBottomCode']!=='0') { $clicktale_bottom_code = str_replace("\|\|","||",$final_config['ClickTaleBottomCode']); $code = str_replace('', $clicktale_bottom_code, $code); } //---------------------------------------------------------- //-- SearchSpring //---------------------------------------------------------- if (isset($final_config['EnableSearchSpringIntelliSuggestTracking']) && $final_config['EnableSearchSpringIntelliSuggestTracking']=='Y') { $searchspring_id = $final_config['SearchSpringID']; $searchspring_productdetail_track_code = globalclient_inc_searchspring_productdetail_track_code($searchspring_id); if ($searchspring_productdetail_track_code) { $code = str_replace('', $searchspring_productdetail_track_code, $code); } $searchspring_shoppingcart_track_code = globalclient_inc_searchspring_shoppingcart_track_code($searchspring_id); if ($searchspring_shoppingcart_track_code) { $code = str_replace('', $searchspring_shoppingcart_track_code, $code); } $searchspring_checkout_track_code = globalclient_inc_searchspring_checkout_track_code($searchspring_id); if ($searchspring_checkout_track_code) { $code = str_replace('', $searchspring_checkout_track_code, $code); } } //----------------- End Include Google / ClickTale / VoiceStar Code into Template --------------------// /*------------------------------+ | GLOBAL INC FUNCTIONS | +------------------------------*/ function globalclient_inc_redirect_by_country_code($redirect_by_countrycode) { if (!$redirect_by_countrycode) { return; } $the_ip = get_client_ip(); $country = get_country( $the_ip ); if ( $country ) { $_SESSION['IPCountryCode'] = $country; $iso_code = $country['iso_code']; $redirect_data = explode( ',', $redirect_by_countrycode ); foreach ( $redirect_data as $redirect ) { $countrycode_and_url = array_map( 'trim', explode( '|', $redirect ) ); if ( $iso_code == $countrycode_and_url[0] ) { header( 'Location: ' . $countrycode_and_url[1] ) ; } } } } function globalclient_inc_inner_page_widgets($client_id, $innerpage_content_xml) { $out = array(); preg_match_all('/HTMLWidget:(.+?):HTMLWidget/', $innerpage_content_xml, $out); if(isset($out[1])) { foreach($out[1] as $function_data) { $function_data_array = explode("/", $function_data, 4); $function_name = 'HTMLWidget'; if(isset($function_data_array[0])) { $function_param_id = $function_data_array[0]; $function_param_style = $function_data_array[1]; $function_param_height = $function_data_array[2]; $function_param_width = $function_data_array[3]; if(function_exists($function_name)) { $innerpage_content_xml=str_replace('HTMLWidget:'.$function_data.':HTMLWidget', call_user_func('HTMLWidget', $function_param_id, $function_param_style, $function_param_height, $function_param_width, $client_id), $innerpage_content_xml); } } } } return $innerpage_content_xml; } function globalclient_inc_inner_page_plugins($client_id, $innerpage_content_xml, $managed_by_module_id='') { $out = array(); preg_match_all('/Plugin:(.+?):Plugin/', $innerpage_content_xml, $out); if(isset($out[1])) { foreach($out[1] as $function_data) { $function_data_array = explode("/", $function_data, 2); if(isset($function_data_array[0])) { $function_name = 'inline_plugin_'.$function_data_array[0]; $function_style = $function_data_array[1]; //-- Product Plugin if($function_name=='inline_plugin_product_results'){ $innerpage_content_xml = globalclient_inc_products_plugin($client_id, $innerpage_content_xml, $function_style, $function_data); } else { //-- Other Plugins if (strpos($function_data_array[1],'/nocache') !== false) { $innerpage_content_xml=str_replace('Plugin:'.$function_data.':Plugin', '
'.$function_data.'
', $innerpage_content_xml); } else { if ('N' == POWERTRAIN_V2) { $plugin_path = 'plugins/content-inline/plugins.php'; } else { $plugin_path = 'client/inline_controller.php'; } if(file_exists($plugin_path)) { $plugin_content=require_once($plugin_path); if($function_name!=='') { $innerpage_content_xml=str_replace('Plugin:'.$function_data.':Plugin', call_user_func($function_name, $function_style), $innerpage_content_xml); //$innerpage_content_xml=str_replace('Plugin:'.$function_data.':Plugin', '
'.$function_data.'
', $innerpage_content_xml); } } } } } } } return $innerpage_content_xml; } function globalclient_inc_products_plugin($client_id, $innerpage_content_xml, $function_style, $function_data) { global $results_breadcrumb_div; //-- XML Plugin Config Call if ('Y' == POWERTRAIN_V2) { $plugin_config_obj = new DC_PluginConfig(CLIENT_ID, WEBSITE_ID, 'PREMProducts'); $plugin_config = $plugin_config_obj->getPluginConfigAsArray(); } else { $plugin_config_xml_parser = new xml_parser(SITE_ROOT.'xml/'.WEBSITE_ID.'/plugin_config.xml',0,1,'tag','Y'); $plugin_config=$plugin_config_xml_parser->xml_output['GenericPluginConfig']['PREMProducts']; } //-- ****** Results Page ****** $_SESSION['GlobalIncProductSearchCategoryID'] = $search_base_category_id_for_plugin = $function_style; $product_list = ''; // will be set below by plugins/e-commerce/results-page-main-query.php //get page if(isset($_POST['PageID'])) { $results_page=$_POST['PageID']; } else if(isset($_GET['PageID'])) { $results_page=$_GET['PageID']; } else { $results_page=1; } require_once('plugins/e-commerce/results-page-main-query.php'); // gets value for $product_list includes 'plugins/e-commerce/results-page.class.php'; uses $search_base_category_id_for_plugin. $results_fields_to_display = $plugin_config['ProductsResultsFieldsToDisplay']; $results_output = $results_breadcrumb_div; $results_output .= '
'; if(isset($plugin_config['ProductsResultsPageAllowPaginationAboveProducts'])) { $display_pagination_above_products = $plugin_config['ProductsResultsPageAllowPaginationAboveProducts']; } else { $display_pagination_above_products = ''; } if(isset($plugin_config['ProductsResultsPageAllowPagination'])) { $display_pagination = $plugin_config['ProductsResultsPageAllowPagination']; } else { $display_pagination = ''; } if(isset($plugin_config['ProductsResultsEnableScrollLoadPagination'])) { $ajax_load_products = $plugin_config['ProductsResultsEnableScrollLoadPagination']; } else { $ajax_load_products = ''; } if($ajax_load_products == 'Y') { $display_pagination_above_products = 'N'; $display_pagination = 'N'; } // do top pagination if( $product_list && isset($plugin_config['ProductsResultsPageAllowPaginationAboveProducts'])){ if($display_pagination_above_products=='Y'){ //get recs per page $products_landing_recsperpage = $plugin_config['ProductsResultsPageRecsPerPage']; if ( !$products_landing_recsperpage ) { $products_landing_recsperpage = 1000; } $default_url_arr = explode('/', sanitizeText($_SERVER['REQUEST_URI'])); $default_url = '/'.$default_url_arr[1].'/'; //print_r($default_url_arr); $results_page_pagination = ecomm_generate_paged_navigation($products_landing_recsperpage, $results_page, $product_list, $pages_per_set = 5, $default_url); if($results_page_pagination){ $results_output .= '
'.$results_page_pagination .'
'; } } } $results_output .= build_results_output( $plugin_config, $product_list, $results_fields_to_display, /*$image_size_override=*/'', /*$results_output_type=*/'', $product_filter_list ); $results_output .= '
'; // do pagination if( $product_list && isset($plugin_config['ProductsResultsPageAllowPagination'])){ if($display_pagination=='Y'){ //get recs per page $products_landing_recsperpage = $plugin_config['ProductsResultsPageRecsPerPage']; if ( !$products_landing_recsperpage ) { $products_landing_recsperpage = 1000; } $default_url_arr = explode('/', sanitizeText($_SERVER['REQUEST_URI'])); $default_url = '/'.$default_url_arr[1].'/'; //print_r($default_url_arr); $results_page_pagination = ecomm_generate_paged_navigation($products_landing_recsperpage, $results_page, $product_list, $pages_per_set = 5, $default_url); if($results_page_pagination){ $results_output .= '
'.$results_page_pagination .'
'; } } } if($ajax_load_products == 'Y') { $results_page_pagination = ecomm_generate_scroll_load_navigation('/plugins/content-inline/plugin_products_ajax.class.php', 'results', '#product_container', $results_page); if($results_page_pagination){ $results_output .= $results_page_pagination; } } $innerpage_content_xml=str_replace('Plugin:'.$function_data.':Plugin', $results_output, $innerpage_content_xml); return $innerpage_content_xml; } function globalclient_inc_dynamic_metadata($content_xml, $preview_html='N', $meta_data_value_array=array()) { $meta_data = ''; $meta_title_tag = ''; $meta_keyword_tag = ''; $meta_description_tag = ''; $meta_product_detail_path = ''; $conical_url_code = ''; if($meta_data_value_array){ $meta_title_tag = $meta_data_value_array['MetaTitle']; $meta_description_tag = $meta_data_value_array['MetaDescription']; } else { //--Overrides the Team Detail Title Meta Tag to Display the Individuals Name--// $team_string = $_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"]; $team_find = '/team-detail/'; if(strpos($team_string, $team_find)){ $person_url_raw=str_replace('/team-detail/','',$_SERVER["REQUEST_URI"]); $person_url_part = str_replace('%20', ' ',$person_url_raw); $person_url_final = explode( "/", $person_url_part ); $person_url = $person_url_final[0]; $name_for_query=explode('-',$person_url); $team_fname=$name_for_query[0]; $team_lname=$name_for_query[1]; $meta_title_tag = ucwords($team_fname).' '.ucwords($team_lname).' - '.COMPANY_NAME; }else { $meta_title_tag = $content_xml['MetaTitle']; } $meta_keyword_tag = $content_xml['MetaKeywords']; $meta_description_tag = $content_xml['MetaDescription']; //-- If Products Module, handle page title and keywords if($content_xml['ManagedBySystemModuleID']==110){ $prod_url_str = urldecode( trim( $_SERVER["REQUEST_URI"], '/' ) ); $prod_url_parts = explode( "/", $prod_url_str ); $prod_id = ''; $prod_name = ''; $prod_meta_info = ''; //--Custom Product Meta Info if ('Y' == POWERTRAIN_V2) { $plugin_config_obj = new DC_PluginConfig(CLIENT_ID, WEBSITE_ID, 'PREMProducts'); $plugin_config = $plugin_config_obj->getPluginConfigAsArray(); } else { $plugin_config_xml_parser = new xml_parser(SITE_ROOT.'xml/'.WEBSITE_ID.'/plugin_config.xml',0,1,'tag','Y'); $plugin_config=$plugin_config_xml_parser->xml_output['GenericPluginConfig']['PREMProducts']; } if(isset($plugin_config['ProductsDetailsUniqueURLPrefix'])){ $meta_unique_url_prefix = $plugin_config['ProductsDetailsUniqueURLPrefix']; }else { $meta_unique_url_prefix = '/ecomm-product-detail/'; } $pos = strpos( $_SERVER["REQUEST_URI"], $meta_unique_url_prefix ); $pos_shoppingcart = strpos( $_SERVER["REQUEST_URI"], '/ecomm-shopping-cart/' ); /* if ( $pos_shoppingcart !== false ) { echo '



FILE ' . __FILE__ . ', LINE ' . __LINE__ . '

'; print_r( $_SESSION ); } */ if( $pos !== false ){ //$prod_id = end( $prod_url_parts ); if(isset($_GET['PID'])){ $prod_id = $_GET['PID']; }else { $meta_current_page_url = rtrim(sanitizeText($_SERVER['REQUEST_URI']), '/'); $meta_current_page_url_array = explode( '/', urldecode( $meta_current_page_url ) ); $meta_current_page_url_array_count = (count($meta_current_page_url_array))-(1); if(is_numeric($meta_current_page_url_array[$meta_current_page_url_array_count])){ $prod_id = $meta_current_page_url_array[$meta_current_page_url_array_count]; }else { $prod_id = 0; } } reset( $prod_url_parts ); if( $prod_id ){ $prod_meta_info = db_search::sp_execute("DCEcomm_Client_ProductMetaInfo", '@ProductID||@SystemClientID', $prod_id.'||'.$_SESSION['SystemClientID'], 'SQLINT4||SQLINT4'); if( $prod_meta_info ){ $prod_name = $prod_meta_info[0]['ProductName']; if( 'N' == $prod_meta_info[0]['GenerateMetaDynamically'] ){ $meta_title_tag = isset( $prod_meta_info[0]['CustomMetaTitle'] ) ? $prod_meta_info[0]['CustomMetaTitle'] : $prod_name; $meta_keyword_tag = isset( $prod_meta_info[0]['CustomMetaKeywords'] ) ? $prod_meta_info[0]['CustomMetaKeywords'] : strtolower( $prod_name ); $meta_description_tag = isset( $prod_meta_info[0]['CustomMetaDescription'] ) ? $prod_meta_info[0]['CustomMetaDescription'] : strtolower( $prod_name ); if( $prod_meta_info[0]['ProductPermaLink']=='' ){ $meta_product_detail_path = ''; $meta_product_detail_path_raw = str_replace( ' ', '-', ( strtolower( $prod_meta_info[0]['ProductName'] ) ) ) ; $meta_product_detail_path_raw = str_replace( '/', '-', ( $meta_product_detail_path_raw ) ) ; $meta_product_detail_path_raw = str_replace( '%', '-percent-', ( $meta_product_detail_path_raw ) ) ; $meta_product_detail_path_raw = str_replace( '&', '-and-', ( $meta_product_detail_path_raw ) ) ; $meta_product_detail_path_raw = str_replace( '"', '', ( $meta_product_detail_path_raw ) ) ; $meta_product_detail_path_raw = str_replace( "'", '', ( $meta_product_detail_path_raw ) ) ; $meta_product_detail_path_raw = str_replace( '(', '', ( $meta_product_detail_path_raw ) ) ; $meta_product_detail_path_raw = str_replace( ')', '', ( $meta_product_detail_path_raw ) ) ; $meta_product_detail_path_raw = str_replace( '----', '-', ( $meta_product_detail_path_raw ) ) ; $meta_product_detail_path_raw = str_replace( '---', '-', ( $meta_product_detail_path_raw ) ) ; $product_detail_path = str_replace( '--', '-', ( $meta_product_detail_path_raw ) ) ; }else { $meta_product_detail_path = $prod_meta_info[0]['ProductPermaLink']; } //$conical_url_code = ''; }else{ $meta_title_tag = $meta_keyword_tag = $meta_description_tag = $prod_name; } } } }elseif( $pos_shoppingcart !== false ){ //-- XML Plugin Config Call if ('Y' == POWERTRAIN_V2) { $plugin_config_obj = new DC_PluginConfig(CLIENT_ID, WEBSITE_ID, 'PREMProducts'); $product_plugin_config = $plugin_config_obj->getPluginConfigAsArray(); } else { $plugin_config_xml_parser = new xml_parser(SITE_ROOT.'xml/'.WEBSITE_ID.'/plugin_config.xml',0,1,'tag','Y'); $product_plugin_config=$plugin_config_xml_parser->xml_output['GenericPluginConfig']['PREMProducts']; } $meta_title_tag = !empty($product_plugin_config['ProductsShoppingCartPageTitle']) ? $product_plugin_config['ProductsShoppingCartPageTitle'] : ''; } else { //--Standard Meta Info $prod_title_str = ''; $prod_keyword_str = ''; foreach( $prod_url_parts as $upart ){ if( 'e' == $upart ){ break; } if( $prod_title_str ){ $prod_title_str .= ' - '; } $prod_title_str .= ucwords( $upart ); $prod_keyword_str .= $upart . ','; } //trim( $prod_keyword_str, ',' ); $meta_title_tag = $prod_title_str; $meta_title_tag = str_replace('Ecomm-', '', $meta_title_tag); $meta_title_tag = ucwords($meta_title_tag); $meta_keyword_tag = $prod_keyword_str . $content_xml['MetaKeywords']; // collections cutoms title and meta description if(strpos(sanitizeText($_SERVER['REQUEST_URI']), 'collections')) { //echo '1'; $collectionID = null; //$collectionID = (int) preg_replace('/[^0-9]/', '', sanitizeText($_SERVER['REQUEST_URI'])); if(empty($collectionID)) { // should have permalink //echo '2'; $urlArr = explode('/', sanitizeText($_SERVER['REQUEST_URI'])); $permalink = $urlArr[2]; $spcall = new DC_StoredProcedureCall('DCEComm_Merchandisingv2_Collections_SearchForMeta'); $spcall->addParam( '@Page', 1, 'SQLINT4' ); $spcall->addParam( '@RecsPerPage', 20, 'SQLINT4' ); $spcall->addParam('@WhereClause', 'Permalink = \''.$permalink.' \' AND SystemClientID = '.CLIENT_ID.'', 'SQLVARCHAR'); $collection_result = $spcall->doExecute(); if(!is_null($collection_result)) { //echo '3 | '.$collection_result[0]['CollectionID']; $collectionID = $collection_result[0]['CollectionID']; } } if(!empty($collectionID)) { //echo ' | 4'; $collection_profile = db_search::sp_execute( 'dbo.DCEComm_Merchandisingv2_Collection_Profile', '@SystemClientID||@CollectionID', CLIENT_ID .'||'. $collectionID, 'SQLINT4||SQLINT4' ); // echo '
';
							// print_r($collection_profile );
							//echo '
'; if(!is_null($collection_profile) && !empty($collection_profile[0]['PageTitle'])) { $meta_title_tag = $collection_profile[0]['PageTitle']; } if(!empty($collection_profile[0]['MetaDescription'])) { $meta_description_tag = $collection_profile[0]['MetaDescription']; } } } } } //-- If Rental Listings Module, handle page title and keywords if($content_xml['ManagedBySystemModuleID']==288){ $matches = array(); preg_match( '/\/rental-listing-detail\/[0-9]+\/(.+)\/$/', sanitizeText($_SERVER['REQUEST_URI']), $matches ); if ( isset( $matches[1] ) ) { $url_str = $matches[1]; $meta_title_tag = str_replace( '-', ' ', $url_str ); } $kwds = preg_replace("/[^a-zA-Z ]+/", " ", trim( $meta_title_tag) ); $meta_keyword_tag = preg_replace('/ +/', ',', strtolower( $kwds ) ); //$meta_title_tag = $content_xml['MetaTitle']; //$meta_keyword_tag = $content_xml['MetaKeywords']; //$meta_description_tag = $content_xml['MetaDescription']; } //-- If Sales Listings Module, handle page title and keywords if($content_xml['ManagedBySystemModuleID']==275){ $matches = array(); preg_match( '/\/sales-listing-detail\/[0-9]+\/(.+)\/$/', sanitizeText($_SERVER['REQUEST_URI']), $matches ); if ( isset( $matches[1] ) ) { $url_str = $matches[1]; $meta_title_tag = str_replace( '-', ' ', $url_str ); } $kwds = preg_replace("/[^a-zA-Z ]+/", " ", trim( $meta_title_tag) ); $meta_keyword_tag = preg_replace('/ +/', ',', strtolower( $kwds ) ); //$meta_title_tag = $content_xml['MetaTitle']; //$meta_keyword_tag = $content_xml['MetaKeywords']; //$meta_description_tag = $content_xml['MetaDescription']; } //-- If News Module, handle page title and keywords if($content_xml['ManagedBySystemModuleID']==35){ $news_item_url=$_SERVER["REQUEST_URI"]; $news_item_detail_url=strpos($news_item_url,'/newsdetail/'); //--Custom News Meta Info if($news_item_detail_url!==false) { if(isset($_GET['DetailID'])){ $newsarticle_id=$_GET['DetailID']; $news_item_detail = db_search::sp_execute('dbo.DCExp_Client_NewsArticles_Detail', '@SystemClientID||@WebsiteID||@NewsArticleID', CLIENT_ID.'||'.WEBSITE_ID.'||'.$newsarticle_id, 'SQLINT4||SQLINT4||SQLINT4'); }else { $permalink_default_folder=str_replace('/newsdetail','',$_SERVER["REQUEST_URI"]); $newsarticle_permalink= $permalink_default_folder; $news_item_detail = db_search::sp_execute('dbo.DCExp_Client_NewsArticles_Detail_ByPermaLink', '@SystemClientID||@WebsiteID||@NewsPermaLink', CLIENT_ID.'||'.WEBSITE_ID.'||'.$newsarticle_permalink, 'SQLINT4||SQLINT4||SQLVARCHAR'); } $meta_title_tag = $news_item_detail[0]['NewsArticleTitle']; $meta_description_tag = isset( $news_item_detail[0]['NewsArticleSummary'] ) ? $news_item_detail[0]['NewsArticleSummary'] : strtolower( $meta_title_tag ); //-- Build keywords from description (article summary ) $keyword_array = explode( ' ', $meta_description_tag ); $keyword_array_nonoise = array(); if( $keyword_array ){ $keyword_array_nonoise = array_diff( $keyword_array, explode( ',', STOPWORDS ) ); } $meta_keyword_tag = $keyword_array_nonoise ? implode( ', ', $keyword_array_nonoise ) : str_replace( ' ', ', ', $meta_title_tag ); $meta_keyword_tag = str_replace( ',, ', ',', $meta_keyword_tag ); $punct1 = array( '.', '!', '?', '"', '<', '>', '(', ')', '[', ']' ); $punct2 = array( '/', '=' ); $meta_keyword_tag = str_replace( $punct1, '', $meta_keyword_tag ); $meta_keyword_tag = str_replace( $punct2, ' ', $meta_keyword_tag ); }else { //--Standard Meta Info $news_article_url_str = urldecode( trim( $news_item_url, '/' ) ); $news_article_url_parts = explode( "/", $news_article_url_str ); $news_article_keyword_str = isset( $news_article_url_parts[1] ) ? str_replace(' ', ', ', $news_article_url_parts[1]) : ''; //$meta_title_tag = isset( $news_article_keyword_str ) ? ucwords( $news_article_keyword_str ) : ''; $meta_title_tag = $content_xml['MetaTitle']; $meta_keyword_tag = $news_article_keyword_str . $content_xml['MetaKeywords']; } } //-- If Blog Module, handle page title and keywords if($content_xml['ManagedBySystemModuleID']==182){ //--Custom Blog Meta Info $blogpost_url=$_SERVER["REQUEST_URI"]; $blogpost_detail_url=strpos($blogpost_url,'/blogpost/'); if($blogpost_detail_url!==false) { $blogpost_url_array = explode( '/', urldecode( $blogpost_url ) ); $blogpost_url_array_count = (count($blogpost_url_array))-(2); $blogpost_permalink= str_replace('/','',$blogpost_url_array[$blogpost_url_array_count]); $blogpost_permalink= str_replace('?CommentPosted=Y','',$blogpost_permalink); $blogpost_detail = db_search::sp_execute('dbo.DCExp_Client_BlogPost_Detail', '@SystemClientID||@WebsiteID||@BlogPostPermaLink', CLIENT_ID.'||'.WEBSITE_ID.'||'.$blogpost_permalink, 'SQLINT4||SQLINT4||SQLVARCHAR'); $blogpost_id = $blogpost_detail[0]['BlogPostID']; $blogpost_thmb_id = $blogpost_detail[0]['BlogPostThumbnailID']; if( $blogpost_thmb_id ){ $pic_info = db_search::sp_execute( 'dbo.DCExp_Client_Image_Profile','@SystemClientID||@ImageID',$_SESSION['SystemClientID'] .'||'. $blogpost_thmb_id,'SQLINT4||SQLINT4'); if( $pic_info ){ $og_thmb_path = $pic_info[0]['ImagePath']; } } if(empty($blogpost_detail[0]['BlogPostMetaTitle'])) { $meta_title_tag = $blogpost_detail[0]['PostTitle']; } else { $meta_title_tag = $blogpost_detail[0]['BlogPostMetaTitle']; } $meta_keyword_tag = isset( $blogpost_detail[0]['PostTagValues'] ) ? $blogpost_detail[0]['PostTagValues'] : strtolower( $meta_title_tag ); if(empty($blogpost_detail[0]['BlogPostMetaDescription'])) { $meta_description_tag = strtolower( $meta_title_tag ); } else { $meta_description_tag = $blogpost_detail[0]['BlogPostMetaDescription']; } }else { //--Standard Meta Info $meta_title_tag = $content_xml['MetaTitle']; $meta_keyword_tag = $content_xml['MetaKeywords']; $meta_description_tag = $content_xml['MetaDescription']; } } //-- If Locator Module, handle page title and keywords $locator_detail_url=strpos( $_SERVER["REQUEST_URI"],'ContactID='); if($content_xml['ManagedBySystemModuleID']==227 && $locator_detail_url!==false){ $meta_keyword_tag = ''; $meta_title_tag = ''; $meta_description_tag = ''; //--Custom Locator Meta Info $contact_id = ''; if($locator_detail_url!==false) { $matches = array(); preg_match( '/[0-9]+$/', $_SERVER["REQUEST_URI"], $matches ); if( $matches ){ $contact_id = $matches[0]; } //die("ContactID: $contact_id"); if( $contact_id ){ $locator_detail_info = db_search::sp_execute('dbo.DCExp_Client_SimpleCRMContact_Profile', '@SystemClientID||@SimpleCRMContactID', CLIENT_ID.'||'. $contact_id, 'SQLINT4||SQLINT4' ); if( $locator_detail_info ){ $og_thmb_path = $locator_detail_info[0]['ProfileImagePath']; if ('Y' == POWERTRAIN_V2) { $plugin_config_obj = new DC_PluginConfig(CLIENT_ID, WEBSITE_ID, 'PREMContactLocator'); $plugin_config = $plugin_config_obj->getPluginConfigAsArray(); } else { $plugin_config_xml_parser = new xml_parser('/xml/'.$_SESSION['WebsiteID'].'/plugin_config.xml'); $plugin_config=$plugin_config_xml_parser->xml_output['GenericPluginConfig']['PREMContactLocator']; } $details_fields = $plugin_config['ContactLocatorDetailsFieldsToDisplay']; $details_fields_array = explode(',', $details_fields ); $to_meta = array( 'FirstName', 'LastName', //'CompanyName', //'OfficeLocationName', 'SimpleCRMSpecialtyID', //'AssociatedWith', 'MailingCity' ); foreach( $to_meta as $field ){ if( in_array( $field, $details_fields_array ) ){ if( 'SimpleCRMSpecialtyID' == $field ){ $specialty_map = array(); $specialty_list = db_search::sp_execute("dbo.DCExp_Client_SimpleCRMSpecialty_List",'@SystemClientID',$_SESSION['SystemClientID'],'SQLINT4'); if( $specialty_list ){ foreach( $specialty_list as $specialty_row ){ $specialty_map[$specialty_row['SimpleCRMSpecialtyID']] = trim( $specialty_row['SimpleCRMSpecialtyName'] ); } } $specialty_str = $locator_detail_info[0]['SimpleCRMSpecialtyID']; $pattern = array( '(', ')' ); $id_array = explode( ',', str_replace( $pattern, '', $specialty_str ) ); if( $id_array ){ foreach( $id_array as $spec_id ){ if ( isset( $specialty_map[$spec_id] ) ) { $spec_name = $specialty_map[$spec_id]; $meta_keyword_tag .= $meta_keyword_tag ? ', ' . strtolower( $specialty_map[$spec_id] ) : strtolower( $specialty_map[$spec_id] ); $meta_title_tag .= $meta_title_tag ? ' - ' . $specialty_map[$spec_id] : $specialty_map[$spec_id]; } } } }elseif( 'LastName' == $field ){ $meta_keyword_tag .= $meta_keyword_tag ? ', ' . strtolower( $locator_detail_info[0][$field] ) : strtolower( $locator_detail_info[0][$field] ); $meta_title_tag .= $meta_title_tag ? ' ' . $locator_detail_info[0][$field] : $locator_detail_info[0][$field]; }elseif( $meta_keyword_tag ){ $meta_keyword_tag .= ', ' . trim( strtolower( $locator_detail_info[0][$field] ) ); $meta_title_tag .= ' - ' . trim( $locator_detail_info[0][$field] ); }else{ $meta_keyword_tag .= trim( strtolower( $locator_detail_info[0][$field] ) ); $meta_title_tag .= trim( $locator_detail_info[0][$field] ); } } } // Cannot use ShortBio. Markup (e.g. links) can break the metatags. //if( 'Y' == $plugin_config['ContactLocatorDetailsShowShortBio'] ){ // $meta_description_tag = $locator_detail_info[0]['ShortBio'] ? $locator_detail_info[0]['ShortBio'] : strtolower( $meta_title_tag ); //}else{ $meta_description_tag = strtolower( $meta_title_tag ); //} } }else{ //--Standard Meta Info $contact_url_str = urldecode( trim( $_SERVER["REQUEST_URI"], '/' ) ); $contact_url_parts = explode( "/", $contact_url_str ); $contact_keyword_str = isset( $contact_url_parts[1] ) ? $contact_url_parts[1] : ''; $meta_title_tag = isset( $contact_keyword_str ) ? ucwords( $contact_keyword_str ) : ''; $meta_keyword_tag = $contact_keyword_str . $content_xml['MetaKeywords']; } } } //-- If Listing Module, handle page title and keywords if($content_xml['ManagedBySystemModuleID']==203){ $listing_url_str = urldecode( trim( $_SERVER["REQUEST_URI"], '/' ) ); $listing_url_parts = explode( "_", $listing_url_str ); $listing_id = ''; $listing_name = ''; $listing_meta_info = ''; $listing_url_pos =false; //--Custom Listing Meta Info $restaurants_detail = preg_match( '/\/restaurants-detail\//', sanitizeText($_SERVER['REQUEST_URI']) ) ? 1 : 0; if($restaurants_detail==1){ $listing_url_pos = strpos( $_SERVER["REQUEST_URI"], '/restaurants-detail/' ); } $bars_detail = preg_match( '/\/bars-detail\//', sanitizeText($_SERVER['REQUEST_URI']) ) ? 1 : 0; if($bars_detail==1){ $listing_url_pos = strpos( $_SERVER["REQUEST_URI"], '/bars-detail/' ); } $clubs_detail = preg_match( '/\/clubs-detail\//', sanitizeText($_SERVER['REQUEST_URI']) ) ? 1 : 0; if($clubs_detail==1){ $listing_url_pos = strpos( $_SERVER["REQUEST_URI"], '/clubs-detail/' ); } $comedys_detail = preg_match( '/\/comedys-detail\//', sanitizeText($_SERVER['REQUEST_URI']) ) ? 1 : 0; if($comedys_detail==1){ $listing_url_pos = strpos( $_SERVER["REQUEST_URI"], '/comedys-detail/' ); } $theaters_detail = preg_match( '/\/theaters-detail\//', sanitizeText($_SERVER['REQUEST_URI']) ) ? 1 : 0; if($theaters_detail==1){ $listing_url_pos = strpos( $_SERVER["REQUEST_URI"], '/theaters-detail/' ); } $limo_services_detail = preg_match( '/\/limo-services-detail\//', sanitizeText($_SERVER['REQUEST_URI']) ) ? 1 : 0; if($limo_services_detail==1){ $listing_url_pos = strpos( $_SERVER["REQUEST_URI"], '/limo-services-detail/' ); } if( $listing_url_pos !== false ){ $listing_id = intval(end( $listing_url_parts )); reset( $listing_url_parts ); if(is_int($listing_id)){ $listing_meta_info = db_search::sp_execute("DCEcomm_Client_ListingMetaInfo", '@ListingID||@SystemClientID', $listing_id.'||'.$_SESSION['SystemClientID'], 'SQLINT4||SQLINT4'); if( $listing_meta_info ){ $listing_name = $listing_meta_info[0]['ListingName']; if( 'N' == $listing_meta_info[0]['GenerateMetaDynamically'] ){ $meta_title_tag = isset( $listing_meta_info[0]['CustomMetaTitle'] ) ? $listing_meta_info[0]['CustomMetaTitle'] : $listing_name; $meta_keyword_tag = isset( $listing_meta_info[0]['CustomMetaKeywords'] ) ? $listing_meta_info[0]['CustomMetaKeywords'] : strtolower( $listing_name ); $meta_description_tag = isset( $listing_meta_info[0]['CustomMetaDescription'] ) ? $listing_meta_info[0]['CustomMetaDescription'] : strtolower( $listing_name ); }else{ $meta_title_tag = $meta_keyword_tag = $meta_description_tag = $listing_name; } } } }else { //--Standard Meta Info $listing_title_str = ''; $listing_keyword_str = ''; foreach( $listing_url_parts as $upart ){ if( 'e' == $upart ){ break; } if( $listing_title_str ){ $listing_title_str .= ' - '; } $listing_title_str .= ucwords( $upart ); $listing_keyword_str .= $upart . ','; } //trim( $listing_keyword_str, ',' ); $meta_title_tag = $content_xml['MetaTitle']; $meta_keyword_tag = $content_xml['MetaKeywords']; $meta_description_tag = $content_xml['MetaDescription']; } } $pos = strpos( $_SERVER["REQUEST_URI"], '/ecomm-checkout/' ); if( $pos !== false ){ $meta_title_tag = $content_xml['MetaTitle']; $meta_keyword_tag = $content_xml['MetaKeywords']; $meta_description_tag = $content_xml['MetaDescription']; } $pos = strpos( $_SERVER["REQUEST_URI"], '/ecomm-order-thankyou/' ); if( $pos !== false ){ $meta_title_tag = $content_xml['MetaTitle']; $meta_keyword_tag = $content_xml['MetaKeywords']; $meta_description_tag = $content_xml['MetaDescription']; } $pos = strpos( $_SERVER["REQUEST_URI"], '/blogpost/' ); if( $pos !== false ){ $blogpost_url=$_SERVER["REQUEST_URI"]; $blogpost_permalink= str_replace('/blogpost/','',$blogpost_url); $blogpost_permalink= str_replace('/','',$blogpost_permalink); $blogpost_permalink= str_replace('?CommentPosted=Y','',$blogpost_permalink); $blogpost_permalink = substr($blogpost_permalink,8); $blogpost_detail = db_search::sp_execute('dbo.DCExp_Client_BlogPost_Detail', '@SystemClientID||@WebsiteID||@BlogPostPermaLink', CLIENT_ID.'||'.WEBSITE_ID.'||'.$blogpost_permalink, 'SQLINT4||SQLINT4||SQLVARCHAR'); $blogpost_id = $blogpost_detail[0]['BlogPostID']; $meta_title_tag = $blogpost_detail[0]['PostTitle']; $meta_keyword_tag = $blogpost_detail[0]['PostTitle']; $meta_description_tag = $blogpost_detail[0]['PostExcerpt']; } } //------------------------------------------------ //-- Final Metadata Output //------------------------------------------------ if($preview_html=='N'){ $meta_data.=''.$meta_title_tag.''; }else { $meta_data.='PREVIEW: '.$meta_title_tag.''; } //$meta_data.=''; $meta_data.=''; $meta_data.=''; //- Sets the Open Graph Meta $meta_data.=''; $meta_data.=''; $meta_data.=''; $meta_data.=''; $meta_data.= ''; if(isset($_GET['show-cart']) || isset($_GET['back-to'])) { $meta_data .= ''; } if( isset( $og_thmb_path ) ){ $meta_data.=''; }else{ if(isset($content_xml['OpenGraphImagePath']) && $content_xml['OpenGraphImagePath'] !== 0){ $meta_data.=''; } } //$meta_data.=$conical_url_code; if(strpos( $_SERVER["REQUEST_URI"], '/ecomm-collections/' )!==false) { $meta_data .= ''; } return $meta_data; } function globalclient_inc_revive_shoppingcart() { $_SESSION['ShoppingCartID'] = tdes_dec($_GET['revive']); $shoppingcart_profile = db_search::sp_execute("dbo.DCEcomm_Client_Order_Profile","@OrderID||@SystemClientID",$_SESSION['ShoppingCartID'].'||'.CLIENT_ID,'SQLINT4||SQLINT4'); if($shoppingcart_profile){ $_SESSION['ShoppingCartItemCount'] = $shoppingcart_profile[0]['NumberOfItemsOnOrder']; $_SESSION['ShoppingCartItemTotal'] = $shoppingcart_profile[0]['SubTotalCostOfItemsOnly']; } if ('Y' == POWERTRAIN_V2) { header('Location: /?show-cart=Y'); } else { header('Location: /ecomm-shopping-cart/'); } die(); } function globalclient_inc_shoppingcart_session() { if (isset($_SESSION['ShoppingCartID'])) { if($_SESSION['ShoppingCartID']!=0){ $shoppingcart_status = db_search::sp_execute("dbo.DCEcomm_Client_ShoppingCart_Status","@OrderID||@SystemClientID",$_SESSION['ShoppingCartID'].'||'.CLIENT_ID,'SQLINT4||SQLINT4'); //echo('

$shoppingcart_status[0][OrderStatusID]='.$shoppingcart_status[0]['OrderStatusID']); if($shoppingcart_status){ if($shoppingcart_status[0]['OrderStatusID']==5 || $shoppingcart_status[0]['OrderStatusID']==38){ define('SHOPPINGCART_ID', $_SESSION['ShoppingCartID']); $set_cart_item_count_to_zero = 'N'; $set_cart_total_to_zero = 'N'; }else { if(sanitizeText($_SERVER['REQUEST_URI'])=='/ecomm-order-thankyou/'){ define('SHOPPINGCART_ID', $_SESSION['ShoppingCartID']); $set_cart_item_count_to_zero = 'N'; $set_cart_total_to_zero = 'N'; }else { define('SHOPPINGCART_ID', 0); $_SESSION['ShoppingCartID']= 0; $set_cart_item_count_to_zero = 'Y'; $set_cart_total_to_zero = 'Y'; } } }else { define('SHOPPINGCART_ID', $_SESSION['ShoppingCartID']); $set_cart_item_count_to_zero = 'N'; $set_cart_total_to_zero = 'N'; } } else { define('SHOPPINGCART_ID', $_SESSION['ShoppingCartID']); $set_cart_item_count_to_zero = 'N'; $set_cart_total_to_zero = 'N'; } } else { $set_cart_item_count_to_zero = 'Y'; $set_cart_total_to_zero = 'Y'; define('SHOPPINGCART_ID', 0); $_SESSION['ShoppingCartID']= 0; $_SESSION['ShoppingCartShippingTypeID'] = 0; } if(isset($_SESSION['ShoppingCartShippingTypeID']) && $set_cart_item_count_to_zero=='Y') { $_SESSION['ShoppingCartShippingTypeID']= 0; } if(isset($_SESSION['ShoppingCartItemCount']) && $set_cart_item_count_to_zero=='N') { define('SHOPPINGCART_ITEM_COUNT', $_SESSION['ShoppingCartItemCount']); }else { define('SHOPPINGCART_ITEM_COUNT', 0); $_SESSION['ShoppingCartItemCount']= 0; } if(isset($_SESSION['ShoppingCartItemTotal']) && $set_cart_total_to_zero=='N') { define('SHOPPINGCART_ITEM_TOTAL', $_SESSION['ShoppingCartItemTotal']); // Total before tax & shipping }else { define('SHOPPINGCART_ITEM_TOTAL', 0); $_SESSION['ShoppingCartItemTotal']= 0; } if(isset($_SESSION['ShoppingCartLastProductIDAdded'])) { define('SHOPPINGCART_LAST_ID_ADDED', $_SESSION['ShoppingCartLastProductIDAdded']); }else { define('SHOPPINGCART_LAST_ID_ADDED', 0); $_SESSION['ShoppingCartLastProductIDAdded']= 0; } if(isset($_SESSION['ShoppingCartLastOrderDetailIDAdded'])) { define('SHOPPINGCART_LAST_ORDER_DETAIL_ID_ADDED', $_SESSION['ShoppingCartLastOrderDetailIDAdded']); }else { define('SHOPPINGCART_LAST_ORDER_DETAIL_ID_ADDED', 0); $_SESSION['ShoppingCartLastOrderDetailIDAdded']= 0; } } function globalclient_inc_get_module_functions($managed_by_system_module_id, $powertrain_v2_enabled=false) { //echo '

Line ' . __LINE__; //echo "
managed_by_system_module_id=$managed_by_system_module_id
"; /*if ($powertrain_v2_enabled && 110==$managed_by_system_module_id) { $results = array( 'module_path' => '', 'module_function' => 'products', 'plugin_path' => SITE_ROOT . 'client/e-commerce/main.php', ); return $results; }*/ if ($powertrain_v2_enabled) { $products_plugin_path = 'client/e-commerce/main.php'; $my_account_plugin_path = 'client/my-account/main.php'; } else { $products_plugin_path = 'plugins/e-commerce/plugin_main.php'; $my_account_plugin_path = 'plugins/my-account/plugin_main.php'; } $plugin_router = array( //------------------------------------------ //-- Inline Plugins //------------------------------------------ 60 => array( 'module_path' => 'modules/services.php', 'module_function' => '', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 35 => array( 'module_path' => '', 'module_function' => 'newsarticles', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 52 => array( 'module_path' => '', 'module_function' => 'contactus', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 163 => array( 'module_path' => '', 'module_function' => 'testimonials', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 11 => array( 'module_path' => '', 'module_function' => 'documents', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 13 => array( 'module_path' => '', 'module_function' => 'imagegallery', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 323 => array( 'module_path' => '', 'module_function' => 'newimagegallery', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 39 => array( 'module_path' => '', 'module_function' => 'faq', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 106 => array( 'module_path' => '', 'module_function' => 'team', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 182 => array( 'module_path' => '', 'module_function' => 'blog', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 139 => array( 'module_path' => '', 'module_function' => 'events', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 156 => array( 'module_path' => '', 'module_function' => 'sitesearch', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 147 => array( 'module_path' => 'portfolio', 'module_function' => '', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 187 => array( 'module_path' => '', 'module_function' => 'sitemap', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 203 => array( 'module_path' => '', 'module_function' => 'listings', 'plugin_path' => 'plugins/content-inline/plugin_listings.php', ), 227 => array( 'module_path' => '', 'module_function' => 'contactlocator', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 275 => array( 'module_path' => '', 'module_function' => 'saleslistings', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 288 => array( 'module_path' => '', 'module_function' => 'rentallistings', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 299 => array( 'module_path' => '', 'module_function' => 'joblistings', 'plugin_path' => 'plugins/content-inline/plugins.php', ), 267 => array( 'module_path' => '', 'module_function' => 'productsearch', 'plugin_path' => 'plugins/content-inline/plugins.php', ), //------------------------------------------ //-- My-Account Plugin/Modules //------------------------------------------ 151 => array( 'module_path' => '', 'module_function' => 'registeraccount', 'plugin_path' => $my_account_plugin_path, ), //------------------------------------------ //-- E-Commerce Plugins/Modules //------------------------------------------ 110 => array( 'module_path' => '', 'module_function' => 'products', 'plugin_path' => $products_plugin_path, ), 339 => array( 'module_path' => '', 'module_function' => 'giftregistry', 'plugin_path' => 'plugins/content-inline/plugins.php', ), ); //------------------------------------------ //-- Default values if no match //------------------------------------------ $defaults = array( 'module_path' => '', 'module_function' => '', 'plugin_path' => 'plugins/content-inline/plugins.php' ); $results = isset($plugin_router[$managed_by_system_module_id]) ? $plugin_router[$managed_by_system_module_id] : $defaults; //echo '

Line ' . __LINE__; //echo "
results=" . print_r($results,true); return $results; } function globalclient_inc_google_adwords_conversion_code($code_from_config) { $google_adwords_conversion_code = str_replace("\|\|","||",$code_from_config); $google_order_info = db_search::sp_execute('dbo.DCEcomm_Client_Order_Profile_ForGoogleEcommTracking','@OrderID||@SystemClientID',SHOPPINGCART_ID .'||'. CLIENT_ID,'SQLINT4||SQLINT4'); if($google_order_info){ $google_adwords_conversion_code = str_replace("|TRANSACTION-VALUE|",$google_order_info[0]['OrderGrandTotal'],$google_adwords_conversion_code); $google_adwords_conversion_code = str_replace("|TAX-VALUE|",$google_order_info[0]['TaxCost'],$google_adwords_conversion_code); $google_adwords_conversion_code = str_replace("|SHIPPING-VALUE|",$google_order_info[0]['ShippingCost'],$google_adwords_conversion_code); }else { $google_adwords_conversion_code = str_replace("|TRANSACTION-VALUE|",0,$google_adwords_conversion_code); $google_adwords_conversion_code = str_replace("|TAX-VALUE|",0,$google_adwords_conversion_code); $google_adwords_conversion_code = str_replace("|SHIPPING-VALUE|",0,$google_adwords_conversion_code); } return $google_adwords_conversion_code; } function globalclient_inc_google_trusted_stores() { $google_tag_manager_data_layer = ''; $google_trusted_stores_code = ''; $google_order_info = db_search::sp_execute('dbo.DCEcomm_Client_Order_Profile_ForGoogleEcommTracking','@OrderID||@SystemClientID',SHOPPINGCART_ID .'||'. CLIENT_ID,'SQLINT4||SQLINT4'); if ($google_order_info) { $order_total_conversion_value = $google_order_info[0]['OrderGrandTotal']; $ga_ecomm_track_code = globalclient_inc_generate_google_ecomm_track_code( SHOPPINGCART_ID, CLIENT_ID, WEBSITE_DOMAIN); $google_tag_manager_data_layer .= ''; $google_trusted_stores_code = globalclient_inc_generate_google_trusted_stores_code( SHOPPINGCART_ID, CLIENT_ID, WEBSITE_DOMAIN); return $google_tag_manager_data_layer . $google_trusted_stores_code; } } function globalclient_inc_searchspring_productdetail_track_code($searchspring_id) { if ('Y' == POWERTRAIN_V2) { $plugin_config_obj = new DC_PluginConfig(CLIENT_ID, WEBSITE_ID, 'PREMProducts'); $product_plugin_config = $plugin_config_obj->getPluginConfigAsArray(); } else { $plugin_config_xml_parser = new xml_parser(SITE_ROOT.'xml/'.WEBSITE_ID.'/plugin_config.xml',0,1,'tag','Y'); $product_plugin_config=$plugin_config_xml_parser->xml_output['GenericPluginConfig']['PREMProducts']; } if (isset($product_plugin_config['ProductsDetailsUniqueURLPrefix'])) { $product_detail_url_prefix = $product_plugin_config['ProductsDetailsUniqueURLPrefix']; } else { $product_detail_url_prefix = 'ecomm-product-detail'; } $searchspring_productdetail_track_code = ''; $show_searchspring_productdetail_track = preg_match( '/\/'.str_replace('/','',$product_detail_url_prefix).'\//', sanitizeText($_SERVER['REQUEST_URI']) ) ? 1 : 0; if ($show_searchspring_productdetail_track==0) { return ''; } $current_page_url = sanitizeText($_SERVER['REQUEST_URI']); $current_page_url_has_qstring = strpos($current_page_url,'/?'); if ($current_page_url_has_qstring === false) { $current_page_url = sanitizeText($_SERVER['REQUEST_URI']); } else { $current_page_url_with_qstring_array = explode( '?', $current_page_url ); $current_page_url = $current_page_url_with_qstring_array[0]; } $current_page_url = rtrim($current_page_url, '/'); $current_page_url_array = explode( '/', urldecode( $current_page_url ) ); $current_page_url_array_count = (count($current_page_url_array))-(1); if(is_numeric($current_page_url_array[$current_page_url_array_count])){ $searchspring_product_id = $current_page_url_array[$current_page_url_array_count]; } else { $searchspring_product_id = 0; } $searchspring_productdetail_track_code .= ' '; return $searchspring_productdetail_track_code; } function globalclient_inc_generate_searchspring_ecomm_track_code($order_id,$systemclient_id, $website_domainname){ //$google_ecomm_track_code = ' '; return $searchspring_shoppingcart_track_code; } function globalclient_inc_searchspring_checkout_track_code($searchspring_id) { $searchspring_checkout_track_code = ''; $show_searchspring_checkout_track = preg_match( '/\/ecomm-order-thankyou\//', sanitizeText($_SERVER['REQUEST_URI']) ) ? 1 : 0; if($show_searchspring_checkout_track==0) { return ''; } //require_once $_SERVER['DOCUMENT_ROOT'] . '/plugins/e-commerce/functions-common.php'; $searchspring_checkout_data_array = globalclient_inc_generate_searchspring_ecomm_track_code( SHOPPINGCART_ID, CLIENT_ID, WEBSITE_DOMAIN); $searchspring_checkout_track_code .= ' '; return $searchspring_checkout_track_code; } function globalclient_inc_generate_google_ecomm_track_code($order_id,$systemclient_id, $website_domainname){ //$google_ecomm_track_code = '