Actually it was a different mod that needs cleanup before others try to use it. The Extra Boilerplate code is so small I can just post it here.
/includes/functions/extra_functions/extra_boilerplate_functions.php
PHP Code:
<?php
/**
* @copyright Copyright 2011 Glenn Herbert
* @license http://www.gnu.org/licenses/ GNU Public License V3.0
* /includes/functions/extra_functions/extra_boilerplate_functions.php
* Extra Boilerplate by Glenn Herbert (gjh42) 2011-03-18
* based on swguy's boilerplate file technique - can be used alongside it
*/
function html_include_cb($match) {
$prefix = "HTML_INCLUDE_";
$match_filename = str_replace($prefix, '', $match[0]);
$filename = DIR_WS_LANGUAGES . $_SESSION['language'] .
'/boilerplate/' .
$match_filename . ".html";
$buffer = "";
if (file_exists($filename)) {
$handle = @fopen($filename, "r");
while (!feof($handle)) {
$buffer .= fgets($handle, 4096);
}
fclose($handle);
}
return $buffer;
}
function extra_boilerplate($products_description, $output=true) {//proofing against empty description 20110417
$extra_text = array();
if ($products_description != '') {
$pattern = "/HTML_X_INCLUDE_[a-zA-Z0-9]*/";
preg_match_all($pattern, $products_description, $match);
$match[0] = str_replace('HTML_X_INCLUDE_','HTML_INCLUDE_',$match[0]);
foreach($match[0] as $key => $value){
$bit = str_replace('HTML_INCLUDE_','',$key);
$item[0] = $value;
$extra_text[$bit] = html_include_cb($item);
}
}//echo blank or return empty array if no desc
if ($output) {// output immediately or return array content
echo implode('',$extra_text);
}else{
return $extra_text;
}
}
?>
readme_eb1_0.txt
Code:
* @copyright Copyright 2011 Glenn Herbert
* @license http://www.gnu.org/licenses/ GNU Public License V3.0
* Extra Boilerplate by Glenn Herbert (gjh42) 2011-04-17
* based on swguy's boilerplate file technique.
* can be used in conjunction with the original technique;
* leave the function code out of tpl_product_info_display.php.
Files included:
/includes/functions/extra_functions/extra_boilerplate_functions.php
/includes/languages/english/boilerplate/bp1.html
FTP the /includes/ folder in this package to the root of your store.
The files will automatically be placed in the correct locations.
Add to your custom product info page file, in the location you want the new text:
(/includes/templates/your_template/templates/tpl_product_info_display.php)
<!-- bof html description -->
<?php extra_boilerplate($products_description); ?>
<!-- eof html description -->
Add to the product description (doesn't matter where) in admin:
<!-- HTML_X_INCLUDE_bp1 -->
Replace bp1 with the filename you want to use.
Save your boilerplate file as
/includes/languages/english/boilerplate/bp1.html
You can have as many versions of HTML_X_INCLUDE_whatever as you like
inside the comment tags; they will be output in the order they appear.
================================================================
Advanced usage:
To manipulate the text with PHP, call the function like
$extra_boilerplate = extra_boilerplate($products_description, false);
You can now do what you like with the content of $extra_boilerplate,
which will hold an array with each file's content as the value of its filename as key.
foreach($extra_boilerplate as $key=>$value){//output size chart(s) if any
if(strpos($key,'size_chart') !== false) echo $value;
}
================================================================
You can adjust the function call to refer to $categories_description:
<!-- bof html description -->
<?php extra_boilerplate($categories_description); ?>
<!-- eof html description -->
Bookmarks