1
Reintjan
formdhtmltextarea.php and xoopscodes.php
  • 2008/7/11 9:47

  • Reintjan

  • Not too shy to talk

  • Posts: 144

  • Since: 2005/3/17


In XOOPS 2.0.18 xoopscodes.php has code to make it possible for instance to insert website links in a form. This code is in line 36 - 75.

As far as I can see formdhtmltextarea.php has the same code on line 121 - 171

Can anyone please tell me why this code excists 2 times and what the difference between them is?

Thank you!
Be smart, stay smart. Stay one step ahead...

2
Reintjan
Re: formdhtmltextarea.php and xoopscodes.php
  • 2008/7/14 5:37

  • Reintjan

  • Not too shy to talk

  • Posts: 144

  • Since: 2005/3/17


Anyone?
Be smart, stay smart. Stay one step ahead...

3
phppp
Re: formdhtmltextarea.php and xoopscodes.php
  • 2008/7/14 6:12

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


xoopscodes.php is deprecated and not recommended.

4
Reintjan
Re: formdhtmltextarea.php and xoopscodes.php
  • 2008/7/14 7:02

  • Reintjan

  • Not too shy to talk

  • Posts: 144

  • Since: 2005/3/17


Thank you for this answer! So if I understand this correct then xoopscodes.php is not used anymore by xoopscore? Only some modules use this?

Thank you...
Be smart, stay smart. Stay one step ahead...

5
phppp
Re: formdhtmltextarea.php and xoopscodes.php
  • 2008/7/14 7:13

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


Correct.

6
Reintjan
Re: formdhtmltextarea.php and xoopscodes.php
  • 2008/7/14 11:08

  • Reintjan

  • Not too shy to talk

  • Posts: 144

  • Since: 2005/3/17


Can you please add the following code in the next core then?

This will make it possible to use siteurl through the dhtmleditor opening links inside a website on the same page...

in class\xoopsform\formdhtmltextarea.php

insert after line 135:

le="color: #000000"><?php "<img onmouseover='style.cursor="hand"' src='".XOOPS_URL."/images/siteurl.gif' alt='siteurl' onclick='xoopsCodeSiteUrl("".$ele_name."", "".htmlspecialchars(_ENTERURL, ENT_QUOTES)."", "".htmlspecialchars(_ENTERWEBTITLE, ENT_QUOTES)."");' />&nbsp;".


in include\xoops.js

insert after line 246:

le="color: #000000"><?php function xoopsCodeSiteUrl(id, enterUrlPhrase, enterWebsitePhrase){ if (enterUrlPhrase == null) { enterUrlPhrase = "Enter the URL of the link you want to add:"; } var text = prompt(enterUrlPhrase, ""); var domobj = xoopsGetElementById(id); if ( text != null && text != "" ) { if (enterWebsitePhrase == null) { enterWebsitePhrase = "Enter the web site title:"; } var text2 = prompt(enterWebsitePhrase, ""); if ( text2 != null ) { if ( text2 == "" ) { var result = "[siteurl=" + text + "]" + text + "[/siteurl]"; } else { var pos = text2.indexOf(unescape('%00')); if(0 < pos){ text2 = text2.substr(0,pos); } var result = "[siteurl=" + text + "]" + text2 + "[/siteurl]"; } xoopsInsertText(domobj, result); } } domobj.focus(); }


upload Resized Image and Resized Image

to images folder....

Now you can select in dhtm editor how links should be handled...

Editing is done based on XOOPS 2.0.18
Be smart, stay smart. Stay one step ahead...

7
Reintjan
Re: formdhtmltextarea.php and xoopscodes.php
  • 2008/7/14 11:14

  • Reintjan

  • Not too shy to talk

  • Posts: 144

  • Since: 2005/3/17


In my last post I copied some code for xoops.js but it's not displayed correctly. It displays http://www.xoops.org instead of siteurl + text....

Looks like an error in inserting code?????

I will send you the correct files as pm....
Be smart, stay smart. Stay one step ahead...

8
Reintjan
Re: formdhtmltextarea.php and xoopscodes.php
  • 2008/7/14 11:32

  • Reintjan

  • Not too shy to talk

  • Posts: 144

  • Since: 2005/3/17


corrected files can be found here: Click link
Be smart, stay smart. Stay one step ahead...

9
phppp
Re: formdhtmltextarea.php and xoopscodes.php
  • 2008/7/14 13:14

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


Hi Reintjan, thank you for pointing out the siteurl tag.
We will evaluate to see if implement in core or not.