1
Derya
bug in xoopscodes.php
  • 2003/10/5 12:06

  • Derya

  • Module Developer

  • Posts: 40

  • Since: 2003/5/12


Hi,

If you insert bb-code and smilies on some textareas (Download submitting e.g.) they aren't inserted at the current cursorpostion.
This is a bug in include/xoopscodes.php on line 72 (missing some js calls).
Replace:
echo "<img src='".XOOPS_URL."/images/bold.gif' alt='bold' onmouseover='style.cursor="hand"' onclick='setVisible("".$hiddentext."");makeBold("".$hiddentext."");' />&nbsp;<img src='".XOOPS_URL."/images/italic.gif' alt='italic' onmouseover='style.cursor="hand"' onclick='setVisible("".$hiddentext."");makeItalic("".$hiddentext."");' />&nbsp;<img src='".XOOPS_URL."/images/underline.gif' alt='underline' onmouseover='style.cursor="hand"' onclick='setVisible("".$hiddentext."");makeUnderline("".$hiddentext."");'/>&nbsp;<img src='".XOOPS_URL."/images/linethrough.gif' alt='linethrough' onmouseover='style.cursor="hand"' onclick='setVisible("".$hiddentext."");makeLineThrough("".$hiddentext."");' /></a>&nbsp;<input type='text' id='".$textarea_id."Addtext' size='20' />&nbsp;<input type='button' onclick='xoopsCodeText("$textarea_id", "".$hiddentext."")' value='"._ADD."' /><br /><br /><textarea id='".$textarea_id."'  name='".$textarea_id."' cols='$cols' rows='$rows'>".$GLOBALS[$textarea_id]."</textarea><br />n";

(all in one line)

with:
echo "<img src='".XOOPS_URL."/images/bold.gif' alt='bold' onmouseover='style.cursor="hand"' onclick='setVisible("".$hiddentext."");makeBold("".$hiddentext."");' />&nbsp;<img src='".XOOPS_URL."/images/italic.gif' alt='italic' onmouseover='style.cursor="hand"' onclick='setVisible("".$hiddentext."");makeItalic("".$hiddentext."");' />&nbsp;<img src='".XOOPS_URL."/images/underline.gif' alt='underline' onmouseover='style.cursor="hand"' onclick='setVisible("".$hiddentext."");makeUnderline("".$hiddentext."");'/>&nbsp;<img src='".XOOPS_URL."/images/linethrough.gif' alt='linethrough' onmouseover='style.cursor="hand"' onclick='setVisible("".$hiddentext."");makeLineThrough("".$hiddentext."");' /></a>&nbsp;<input type='text' id='".$textarea_id."Addtext' size='20' />&nbsp;<input type='button' onclick='xoopsCodeText("$textarea_id", "".$hiddentext."")' value='"._ADD."' /><br /><br /><textarea id='".$textarea_id."' onselect="xoopsSavePosition('{$textarea_id}');" onclick="xoopsSavePosition('{$textarea_id}');" onkeyup="xoopsSavePosition('{$textarea_id}');" name='".$textarea_id."' cols='$cols' rows='$rows'>".$GLOBALS[$textarea_id]."</textarea><br />n";

(all in one line)

greetz
derya

2
Herko
Re: bug in xoopscodes.php
  • 2003/10/5 13:14

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Thanks, we'll add this to the list for review for the next version

Herko

3
Panzer
Re: bug in xoopscodes.php
  • 2003/10/6 11:10

  • Panzer

  • Just popping in

  • Posts: 6

  • Since: 2003/9/18


The code you posted didn't work for me in the forum !

It's posted right, but didn't work with XOOPS 2.04 ! The Smileys aren't posted in the selected textarea !

4
Derya
Re: bug in xoopscodes.php
  • 2003/10/6 11:38

  • Derya

  • Module Developer

  • Posts: 40

  • Since: 2003/5/12


I have tested this with XOOPS 2.0.3 and 2.0.4 and it works. Are you sure that you have placed it right(all in one line)?
The changed parts are the js-calls in the textarea.
onselect="xoopsSavePosition('{$textarea_id}');" onclick="xoopsSavePosition('{$textarea_id}');" onkeyup="xoopsSavePosition('{$textarea_id}');"

Don't forget spaces between " and onclick/onkeyup.

greetz
derya

5
techgnome
Re: bug in xoopscodes.php
  • 2003/10/6 13:57

  • techgnome

  • Module Developer

  • Posts: 51

  • Since: 2002/8/9 5


Has any of this been checked for cross browser capabilities? Will this work in IE, AND Mozilla, AND NS?
What has it been tried on?

6
Derya
Re: bug in xoopscodes.php
  • 2003/10/6 14:18

  • Derya

  • Module Developer

  • Posts: 40

  • Since: 2003/5/12


I have test it only with IE, but it should work with other browsers, too. Because these aren't changes in bb-code, only call of the missing js. For example, if inserting bb-code at the right cusor position works well on news-submitting with other browsers, then this changes will work with these browsers,too. The news-submitting and comments aren't effected by this changes, because they work with the xoopsform class and they have these calls. They're only missing in xoopscodes.php.

greetz
derya

7
Panzer
Re: bug in xoopscodes.php
  • 2003/10/7 6:33

  • Panzer

  • Just popping in

  • Posts: 6

  • Since: 2003/9/18


Found my problem ! Don't had the rights to save a file change !

Now it's working fine ! Thx !

Login

Who's Online

255 user(s) are online (151 user(s) are browsing Support Forums)


Members: 0


Guests: 255


more...

Donat-O-Meter

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

Latest GitHub Commits