1
BelaS
Custom universal code snippet
  • 2004/2/18 12:55

  • BelaS

  • Just popping in

  • Posts: 62

  • Since: 2003/5/26


Hi Xoopsers,

I've been wracking my brain trying to figure out where and how I could create a feature that would allow me to drop a little custom tag into the body of the text of a News or WFSection article. The tag would convert when loaded to display whatever the content of the tag is set as (in this case, javascript for a floating ad banner, but it could be a recurring pullout-headline or something of the kind).

My thinking was that I would define the code to be contained in the tag as a function somewhere, then insert is thusly:

In, for example, an article in News:

Text text text [myTagtext text text


and XOOPS would automagically convert [myTag] into a nifty pullout box or what-have-you.

I imagine this could be defined in the same spot as the [ URL ] and other formatting codes, but I can't find them and am unsure whether it would work in that manner.

Any assistance would be greatly appreciated.

Béla

2
BelaS
Re: Custom universal code snippet
  • 2004/2/18 12:59

  • BelaS

  • Just popping in

  • Posts: 62

  • Since: 2003/5/26


Moments after posting this I had the good fortune to stumble upon the "editorExtension" hack, which looks as though it will do the trick. Has anyone tried this?

3
Chado
Re: Custom universal code snippet
  • 2004/2/18 13:02

  • Chado

  • Not too shy to talk

  • Posts: 113

  • Since: 2003/6/6 7


You would want to use the /class/module.textsanitizer.php file. If you look at the textsanitizer, you will see a function called &xoopsCodeDecode. You could probably put your code there and accomplish what you are talking about. If you are wanting to to do something with javascript, you will want to add your code after the section where XOOPS converts the one word --javascript -- to two words.

Hope that helps,
Chad

Login

Who's Online

136 user(s) are online (91 user(s) are browsing Support Forums)


Members: 0


Guests: 136


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits