<?php class NP_HtmlSpecialChars extends NucleusPlugin { function getName() { return 'NP_HtmlSpecialChars'; } function getAuthor() { return 'Katsumi'; } function getURL() { return 'http://hp.vector.co.jp/authors/VA016157/'; } function getVersion() { return '0.1'; } function getDescription() { return 'Template var:<br /> <%HtmlSpecialChars(category)%><br /> <%HtmlSpecialChars(author)%><br /> <%HtmlSpecialChars(title)%><br /> <%HtmlSpecialChars(body)%><br /> <%HtmlSpecialChars(more)%><br /> ';} function doSkinVar($skinType,$param1='',$param2=''){ } function doTemplateCommentsVar(&$item, &$comment, $param1='', $param2=''){ return $this->doTemplateVar(&$item,$param1,$param2); } function doTemplateVar(&$item,$param1='',$param2=''){ switch(strtolower($param1)){ case 'category': echo $this->hsc($item->category); break; case 'author': echo $this->hsc($item->author); break; case 'title': echo $this->hsc($item->title); break; case 'body': echo $this->hsc($item->body); break; case 'more': echo $this->hsc($item->more); break; default: } } function hsc(&$text){ return preg_replace('!<br />([\r\n])!',"<br />\$1",htmlspecialchars($text,ENT_QUOTES)); } } ?>