XOOPS Codes are designed as simple but secure HTML replacements that many modules can and still use. Today's content management systems tend to use WYSIWYG editors, but not all modules do (unless you hack their code). This is somewhat legacy XOOPS because I (and most others) recommend using WYSIWYG wherever possible.
Because of the limitations of this display/input interface, I can't be as clear in this message as I can on my personal website, so you may want to read
my article on XOOPS Codes. I hope this helps.
XOOPS CODES
===========
XOOPS Codes are processed in the MYTS (My Text Sanitizer) class which is XOOPS_ROOT/class/module.textsanitizer.php and you'll find this functionality in the function xoopsCodeDecode. It's a mess of regex pattern replacement information so be prepared to know your regex if you take a look at it.
XOOPS CODES TRANSLATIONS
=======================
To use a XOOPScode, embed it like this:
[xoopscode]
text[/xoopscode] and/or
[xoopscode=
value]
text[/xoopscode]
Format:
xoopscode=value => replacement [notes]-----------------------------------
siteurl=
value =>
text [expects URL relative to site root, no starting slash]
url=
value =>
text [
value can start with http, https, ftp or domain relative]
color=
value =>
text [don't add the #]
size=
value =>
textfont=
value =>
text<email =>
text [
text can start http, https, ftp or relative]
b =>
texti =>
textu =>
textd =>
textquote =>
img => [4 usages, see next section]
Images
-------
Images depends upon whether or not images are allowed or not. There are four variations of each. [Note:
alvalue only allows left, right, or center;
idvalue only allows number]:
Images Allowed:
img =>
img align=
alvalue =>
img id=
idvalue =>
img align=
alvalue id=
idvalue =>
[Note: exactly this order -- id before align will not work;]
Images Not Allowed:
img =>
textimg align=
alvalue =>
textimg id=
idvalue =>
textimg align=
alvalue id=
idvalue =>
idvalue [Note: exactly this order -- id before align will not work;]
[Note:
value can be enclosed in single or double quotes. This same function removes javascripts and about:'s.]
FINAL NOTES
==========
I'll note that based on the image codes that most people probably don't use these XOOPS codes because the image translations aren't always necessarily congruent to what I would expect usage should be especially when both id and align are used, but that's a topic for another discussion.
My recommendation is to use WYSIWYG editors (my personal favorite is
FCKeditor) and not the standard DHTML text area editor making XOOPS codes moot. I hope that's the overall forward direction as I don't think users should need to learn XOOPS, BB or Wiki codes (kind of like learning DOS). But I did on one site, and the users needed to know the codes, thus this page. I think philosophically, the DHTML editor ought to have a helper pop-up window link to give you a look into those codes.
If you have more questions, e-mail
me and I'll respond.