function replace(&$template) { // Function modified in v2.1.0 to use content template without specific module. // If we do not use a content template, extract the content from buffer if ($this->content_template_file == '') { $template['content'] = sts_strip_content_tags($template['content'], 'Default Content'); return; } // Otherwise continue and use the content template to build the content global $template_content; // Read content template file $template_html = sts_read_template_file($this->content_template_file); foreach ($template_content as $key => $value) { $template_html = str_replace('{$' . $key . '}', $value, $template_html); } $template['content'] = $template_html; }
function replace(&$template) { // If we do not use a content template, extract the content from buffer if ($this->content_template_file == '') { $template['content'] = sts_strip_content_tags($template['content'], 'Product Info Content'); return; } // Otherwise continue and use the content template to build the content global $template_pinfo; // Read content template file $template_html = sts_read_template_file($this->content_template_file); if (!defined('STS_CONTENT_END_CHAR')) { // If no end char defined for the placeholders, have to sort the placeholders. uksort($template_pinfo, "sortbykeylength"); // Sort array by string length, so that longer strings are replaced first define('STS_CONTENT_END_CHAR', ''); // An end char must be defined, even if empty. } foreach ($template_pinfo as $key => $value) { $template_html = str_replace('$' . $key . STS_CONTENT_END_CHAR, $value, $template_html); } $template['content'] = $template_html; }
function replace(&$template) { $template['content'] = sts_strip_content_tags($template['content'], 'Index content'); }