1
intel352
X_SITEURL and Auto Format bug (blocks admin)
  • 2004/12/6 19:22

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


when creating a custom block, if you set the type to autoformat, but use a bbcode url like so:

[url={X_SITEURL}modules/AMS/submit.php]Submit News Articles Tutorials[/url]


then XOOPS will apparently parse the bbcode first, places http:// in front of {X_SITEURL}, and when the site url is placed into the url, it's a broken url due to the extra http://


fyi.

2
irmtfan
Re: X_SITEURL and Auto Format bug (blocks admin)
  • 2004/12/9 11:50

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


any answer or solution for this?
this is hard work to use html format always
many thanks

3
ackbarr
Re: X_SITEURL and Auto Format bug (blocks admin)

you've pinpointed the exact cause of the problem. The fix is relatively simple:

in /class/xoopsblock.php, function getContent() ~line 150 find:
} elseif ( $c_type == 'S' ) {
                
$myts =& MyTextSanitizer::getInstance();
                return 
str_replace('{X_SITEURL}'XOOPS_URL.'/'$myts->displayTarea($this->getVar('content''N'), 11));
            } else {
                
$myts =& MyTextSanitizer::getInstance();
                return 
str_replace('{X_SITEURL}'XOOPS_URL.'/'$myts->displayTarea($this->getVar('content''N'), 10));
            }

and replace with:
} elseif ( $c_type == 'S' ) {
                
$myts =& MyTextSanitizer::getInstance();
                return 
$myts->displayTarea(str_replace('{X_SITEURL}'XOOPS_URL.'/'$this->getVar('content''N')), 11);
            } else {
                
$myts =& MyTextSanitizer::getInstance();
                return 
$myts->displayTarea(str_replace('{X_SITEURL}'XOOPS_URL.'/'$this->getVar('content''N')), 10);
                
            }

All that does is apply X_SITEURL first, before processing any BBCode

4
irmtfan
Re: X_SITEURL and Auto Format bug (blocks admin)
  • 2004/12/9 13:16

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


a nice reply from you. it solve problem. thanks a lot

5
intel352
Re: X_SITEURL and Auto Format bug (blocks admin)
  • 2004/12/9 15:18

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


nice fix ackbarr

6
bikeman
Re: X_SITEURL and Auto Format bug (blocks admin)
  • 2005/5/26 13:06

  • bikeman

  • Just popping in

  • Posts: 30

  • Since: 2005/5/24


What should I use to make this change? If I use notepad I lose the doc formatting the XOOPS stops working.

7
Shine
Re: X_SITEURL and Auto Format bug (blocks admin)
  • 2005/5/26 13:20

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Just upload the file and rename on your server blabla.txt into blabla.php
Update your system (xoops/admin/modules-> system
and your done.

There are dozens of great freeware editors around which can handle php.
NoteTab, Editplus

Grtz., Shine

Login

Who's Online

281 user(s) are online (146 user(s) are browsing Support Forums)


Members: 0


Guests: 281


more...

Donat-O-Meter

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

Latest GitHub Commits