UserDefinedTag issue

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
dest

UserDefinedTag issue

Post by dest »

So, I set up a user defined tag for code display (so it doesn't parse it, and to look nicer when displaying).

I defined the tag as "code", and typed in the following (the c parameter would be the code I want displayed):

Code: Select all

if($params['c']!='')
{
 echo "<div style='margin-left:10%;font-size:smaller'><b>Code:</b>
 <div style='background-color:#eeeeee;border:1px solid black;'>";
 $code=$params['c'];
 $code=str_replace("<","&#60",$code);
 $code=str_replace(">","&#62",$code);
 $code=str_replace("{","&#123",$code);
 $code=str_replace("}","&#125",$code);
 echo $code;
 echo "</div></div>"
}
I then went to test this, and found out that it didn't work, because the editor had converted the html character codes back to the characters.  The str_replace()s now did nothing. 

I decided to try fixing this problem by going to phpmyadmin, finding where this was stored, and putting in the correct code.  Now, calling the {code} tag causes a tag-not-found error:
Fatal error: Smarty error: [in preview:cmspreviewmGQLao line 740]: syntax error: unrecognized tag 'code' (Smarty_Compiler.class.php, line 580) in /home/www/dev/cms/lib/smarty/Smarty.class.php on line 1095
Basic info:
-CMS Made Simple 0.13
-PHP 4.4.0
-Apache 1.3.33
-mySQL 4.0.24

I would appreciate any help. 
Last edited by dest on Fri Jun 23, 2006 11:33 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: UserDefinedTag issue

Post by calguy1000 »

1) turn wysiwyg off
2) copy the code you just pasted
3) delete any tag called code that shows up in the tag list
4) create a new tag called code, and click  "paste"
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
dest

Re: UserDefinedTag issue

Post by dest »

WYSIWYG was already off. 

I've found the problem, though.  If you have bad code, when it redisplays with the error, it changes character codes to display the character.  I must have not noticed that when I did that last time.  ::)

Thanks, though.
Locked

Return to “CMSMS Core”