Nxt_Gate Posted April 1, 2003 Share Posted April 1, 2003 Im new using the Smarty's Php Template, so im looking for new plugins and found some in the smartys web page.. but what i dont know is how to implement them.. for example i downlaoded this one function smarty_modifier_highlight_quoted($text, $escape = true, $indenter = '|>',$colors = false) { if(!is_array($colors)) { $colors = array(); $colors[] = "#000000"; $colors[] = "#0000BB"; $colors[] = "#681E80"; $colors[] = "#0070FF"; $colors[] = "#C67900"; $colors[] = "#008800"; $colors[] = "#FF3333"; } $matches = array(); preg_match_all( '/^([ '.preg_quote($indenter).']*)(.*)/m', $text, $matches, PREG_SET_ORDER); $ret = ""; foreach($matches AS $match) { if ($escape) { $match[2] = htmlspecialchars($match[2]); } if(trim($match[2]) != "") { $indent = strlen(preg_replace('/[\s]*/','',$match[1])); $color = $indent % count($colors); $ret .= '<font color="'.$colors[$color].'">'; $ret .= htmlspecialchars($match[1])." "; $ret .= $match[2]; $ret .= "</font>"; } else { $ret .= $match[2]; } } return $ret; } ?> But i dont know how to make it work! Can any of you help me please??? Link to comment Share on other sites More sharing options...
0 ORPHlC Posted April 1, 2003 Share Posted April 1, 2003 (edited) Where is this Smarty's template site at? Edit: yep, it is... Edited April 1, 2003 by timdorr Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted April 1, 2003 Veteran Share Posted April 1, 2003 should be http://smarty.php.net Link to comment Share on other sites More sharing options...
0 Nxt_Gate Posted April 1, 2003 Author Share Posted April 1, 2003 No one can help me please??!!... :( Link to comment Share on other sites More sharing options...
Question
Nxt_Gate
Im new using the Smarty's Php Template, so im looking for new plugins and found some in the smartys web page.. but what i dont know is how to implement them.. for example i downlaoded this one
function smarty_modifier_highlight_quoted($text, $escape = true, $indenter = '|>',$colors = false) { if(!is_array($colors)) { $colors = array(); $colors[] = "#000000"; $colors[] = "#0000BB"; $colors[] = "#681E80"; $colors[] = "#0070FF"; $colors[] = "#C67900"; $colors[] = "#008800"; $colors[] = "#FF3333"; } $matches = array(); preg_match_all( '/^([ '.preg_quote($indenter).']*)(.*)/m', $text, $matches, PREG_SET_ORDER); $ret = ""; foreach($matches AS $match) { if ($escape) { $match[2] = htmlspecialchars($match[2]); } if(trim($match[2]) != "") { $indent = strlen(preg_replace('/[\s]*/','',$match[1])); $color = $indent % count($colors); $ret .= '<font color="'.$colors[$color].'">'; $ret .= htmlspecialchars($match[1])." "; $ret .= $match[2]; $ret .= "</font>"; } else { $ret .= $match[2]; } } return $ret; } ?>But i dont know how to make it work!
Can any of you help me please???
Link to comment
Share on other sites
3 answers to this question
Recommended Posts