xoops forums

Peekay

XOOPS is my life!
Posted on: 2010/8/2 22:50
Peekay
Peekay (Show more)
XOOPS is my life!
Posts: 2335
Since: 2004/11/20
#1

Problem with Xoops CODE tag

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.

madDan

Not too shy to talk
Posted on: 2010/8/3 9:18
madDan
madDan (Show more)
Not too shy to talk
Posts: 105
Since: 2010/1/6 1
#2

Re: Problem with Xoops CODE tag

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.

Peekay

XOOPS is my life!
Posted on: 2010/8/3 12:14
Peekay
Peekay (Show more)
XOOPS is my life!
Posts: 2335
Since: 2004/11/20
#3

Re: Problem with Xoops CODE tag

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.

ghia

Community Support Member
Posted on: 2010/8/4 1:15
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#4

Re: Problem with Xoops CODE tag

Which module ?

Catzwolf

Home away from home
Posted on: 2010/8/4 2:18
Catzwolf
Catzwolf (Show more)
Home away from home
Posts: 1392
Since: 2007/9/30
#5

Re: Problem with Xoops CODE tag

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.

ghia

Community Support Member
Posted on: 2010/8/4 4:27
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#6

Re: Problem with Xoops CODE tag

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.

Peekay

XOOPS is my life!
Posted on: 2010/8/4 9:31
Peekay
Peekay (Show more)
XOOPS is my life!
Posts: 2335
Since: 2004/11/20
#7

Re: Problem with Xoops CODE tag

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.

Peekay

XOOPS is my life!
Posted on: 2010/8/4 12:32
Peekay
Peekay (Show more)
XOOPS is my life!
Posts: 2335
Since: 2004/11/20
#8

Re: Problem with Xoops CODE tag

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.

ghia

Community Support Member
Posted on: 2010/8/4 12:52
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#9

Re: Problem with Xoops CODE tag

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

Peekay

XOOPS is my life!
Posted on: 2010/8/4 15:39
Peekay
Peekay (Show more)
XOOPS is my life!
Posts: 2335
Since: 2004/11/20
#10

Re: Problem with Xoops CODE tag

@ 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.