Menu

#53 better rendering [ code ][ /code ]

XOOPS_2.2
closed
nobody
5
2012-09-25
2004-08-24
D.J.
No

in class/module.textsanitizer.php, use:

function codeConv($text, $xcode = 1, $image

= 1){
if($xcode != 0){
$patterns = "/[code](.*)
[\/code]/esU";
if ($image != 0) {
// image allowed
$replacements
= "'

'.MyTextSanitizer::codeSanitizer
('$1').'
'"; // hack for [code] rendering by
 -- 
phppp
//$text =& $this-

xoopsCodeDecode($text);
} else {
// image not
allowed
$replacements
= "'

'.MyTextSanitizer::codeSanitizer
('$1', 0).'
'"; // hack for [code] rendering by
 -- phppp
//$text =& $this-
xoopsCodeDecode($text, 0);
}
$text = preg_replace
($patterns, $replacements, $text);
}
return $text;
}

then add following to xoops.css or
themes/yourtheme/style.css, styleNN.css, styleMAC.css


pre.xoopscode {
background: #fffff8;
border: 1px solid #6C87B0;
color: #385a72;
width: 500px;
height: 200px;
margin: 1em;
overflow: auto;
padding: 3px 6px 6px 6px;
}

Discussion

  • nick89

    nick89 - 2004-10-01

    Logged In: YES
    user_id=1131183

    yes this is much like the latest vbulletin style and it
    works very well.

     
  • Jan Pedersen

    Jan Pedersen - 2005-06-25

    Logged In: YES
    user_id=841117

    Can you explain to me what this does that isn't done by
    adding the CSS style to div.xoopsCode {} in the theme's CSS?

    I mean, what's the difference between putting the class on
    the

     tag as opposed to the 
    tag?

     

Log in to post a comment.