1
Peekay
Problem with Xoops CODE tag
  • 2010/8/2 22:50

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I am trying to get an old module up to speed for Xoops 2.4.5 and I have a problem with the 'code' tag in the DHTML editor.

I should get

function writeName(){
echo 
"John Smith" ;
}


but I am getting:

lor="#000000"> <?php function writeName(){
echo 
"John Smith" ;
}


Any ideas what is going wrong here and what I should be looking for?

The 'quote' tag works fine and both work in Xoops 2.3 and earlier.
A thread is for life. Not just for Christmas.

2
madDan
Re: Problem with Xoops CODE tag
  • 2010/8/3 9:18

  • madDan

  • Not too shy to talk

  • Posts: 105

  • Since: 2010/1/6 1


function writeName(){
echo 
"John Smith" ;
}


it works on here, I assume this site uses 2.4.5?

If so maybe it is caused by the theme you are using?

probably talking gibberish but just thinking out loud.

3
Peekay
Re: Problem with Xoops CODE tag
  • 2010/8/3 12:14

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Yes, If I send a PM with the 'code' tag in 2.4.5 it's fine, so there's a new method somewhere that the older module isn't compatible with.

I'll dig deeper.

Thx
A thread is for life. Not just for Christmas.

4
ghia
Re: Problem with Xoops CODE tag
  • 2010/8/4 1:15

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Which module ?

5
Catzwolf
Re: Problem with Xoops CODE tag
  • 2010/8/4 2:18

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Peekay,

There are a few places where different code is being used to more or less do the same thing here.

If I understand you right, you need to look in Xoops Forms and formdhtmltextarea.php, there and also in the 'includes' folder you should find xoopscodes.php which more or less has the same code.

You also might want to look in the
class/module.textsanitizer.php and all the plug-in for that. Plus, the module that you are using could possibly have the same code that is used by all the examples I have given you.

But from what I can see, it looks like that $myts is finding something in the input that it doesn't know how to handle correctly. Maybe an unclosed tag or misplaced quote or something.

I have a funny feeling that
lor="#000000"


Could in fact be
color="#000000"
or
backgroundcolor="#000000"


So I would look for that in your code somewhere.

6
ghia
Re: Problem with Xoops CODE tag
  • 2010/8/4 4:27

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


If you upgraded XOOPS, do also the file check, to see that all files of the latest version are present. Mixing files from different versions can also produce unexpected results.

7
Peekay
Re: Problem with Xoops CODE tag
  • 2010/8/4 9:31

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Many thanks for the pointers. Much appreciated.

I can see the method in 'module.textsanitizer' for 'code' is different than 2.0.18 so I swapped them and it works, but that is obviously not a solution.

I'll do some more work on it today and check the things you suggest.

Thx again for the help.
A thread is for life. Not just for Christmas.

8
Peekay
Re: Problem with Xoops CODE tag
  • 2010/8/4 12:32

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


OK. problem solved!

The developer had added the DHTML editor elements to the submit form directly, rather than adding the editor as a Xoops Form Object. It calls methods like:

onclick='xoopsCodeEmail("$textarea_id");


These were once contained in 'include/xoops.js' which is loaded by default, but they have now been moved to 'include/formdhtmltextarea.js'.

I suppose I should re-write the form, but in the meantime I have loaded the JS by adding this line at the bottom of the form script:

$filename XOOPS_ROOT_PATH."/include/formdhtmltextarea.js" ;
if (
file_exists($filename)) {
$xoopsTpl->assign("xoops_module_header",'<script src="'.XOOPS_URL.'/include/formdhtmltextarea.js" type="text/javascript"></script>') ;
}


This now makes the DHTML editor work AND the 'code' tag works properly too.

It's my (lazy) Blue Move tip of the day
A thread is for life. Not just for Christmas.

9
ghia
Re: Problem with Xoops CODE tag
  • 2010/8/4 12:52

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Nice tip, but we still don't know for which module!

10
Peekay
Re: Problem with Xoops CODE tag
  • 2010/8/4 15:39

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


@ Ghia

Sorry, I am updating arMS. It's a module that allows multiple authors to collaborate in the creation of technical documents.

It's very good, but very old.
A thread is for life. Not just for Christmas.

Login

Who's Online

247 user(s) are online (125 user(s) are browsing Support Forums)


Members: 0


Guests: 247


more...

Donat-O-Meter

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

Latest GitHub Commits