Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
3 + 5 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
   

Re:Setting the target for links in some blocks
by Anonymous on 2007/6/14 19:37:32

Quote:
When I use bb code to make the link XOOPS automatically inserts target="_blank" into the link which causes the link to open a new window.


Rather than use the [url].....[/url] bb code, I've found that "siteurl" works in some cases, i.e.:

[ siteurl=yourlink ]LinkText[ /siteurl ]

Remove the spaces after [ and before ]

When this works it has the effect of opening the link in the same window. It works in some modules (e.g. Forums (obviously!) & ExtCal) but I'm not sure about about blocks (might have to play about with the settings/format).

HTH
Re:Setting the target for links in some blocks
by optikool on 2007/6/14 19:25:23

This would be a great option if it was only limited to my site. I'm making a module that other users can use, but I don't want to tell them to modify core XOOPS just to get my module to work. Is there a way to format my code so that I can format it myself? Here is the code I have...

if ($movies !== "") {
if ($movies_target == "No") {
$moviesURL = "<a href='$movies'>"._XD_MOVIES."</a>"; $xoopsTpl->assign('movies',$moviesURL);
} else {
$moviesURL = "<a href='$movies' target='_blank'>"._XD_MOVIES."</a>";
$xoopsTpl->assign('movies',$moviesURL);
}
} else {
$xoopsTpl->assign('movies',"");
}

In this code I'm giving the user the option to set the _blank target if they wish, else keep it on the same page. Is there something I can do to tell XOOPS not to format what I created? Thanks for your help.
Re:Setting the target for links in some blocks
by chipthamac on 2005/2/15 19:29:21

Quote:

balancedi wrote:
To Guido:
When XOOPS interpets bb code links it adds target="_blank". So it reads:

[URL=yourlink]LinkText[/URL]

and changes it to:

<a href="yourlink" target="_blank">LinkText</a>

This forces a new window to open. If it simply left off the target="_blank" then the link would open in the current window. I'm not exactly sure why XOOPS does this. Maybe its some standard method of interpeting bb code.

At any rate, to make this easier for my users that aren't HTML savvy I edited the XOOPS core. For me this didn't seem to have any detrimental side effects on the rest of XOOPS. I edited the file /html/class/module.textsanitizer.php. There is a small function in there called &xoopsCodeDecode that handles this. I just removed everything that said target="blank". (Note: always make a backup before editing code.)


To Anyone:
Is there a way for me to recommend this little change to the XOOPS developers?


Solo71:
Thanks for the tip about Edito and multiMenu. They won't help me with this specific problem but they really look like very handly modules.


This worked great for me as well. I made of custom block where I post the urls of new media that I post. I didn't want it to open up in a new window, because that's just bad form. :p
I didn't know the file that I needed to edit and actually found this post. awesome. I opened the file in wordpad, did a find - replace on the edit menu and plugged in target="_blank" into the find slot and left the replace slot blank. Then I clicked replace, opened up my ftp program, renamed the /html/class/module.textsanitizer.php to /html/class/module.textsanitizer.bak, then uploaded the edited file.
Worked like a charm with no errors thus far.
Thanks guys.
Re:Setting the target for links in some blocks
by balancedi on 2004/10/24 4:47:11

To Guido:
When XOOPS interpets bb code links it adds target="_blank". So it reads:

[URL=yourlink]LinkText[/URL]

and changes it to:

<a href="yourlink" target="_blank">LinkText</a>

This forces a new window to open. If it simply left off the target="_blank" then the link would open in the current window. I'm not exactly sure why XOOPS does this. Maybe its some standard method of interpeting bb code.

At any rate, to make this easier for my users that aren't HTML savvy I edited the XOOPS core. For me this didn't seem to have any detrimental side effects on the rest of XOOPS. I edited the file /html/class/module.textsanitizer.php. There is a small function in there called &xoopsCodeDecode that handles this. I just removed everything that said target="blank". (Note: always make a backup before editing code.)


To Anyone:
Is there a way for me to recommend this little change to the XOOPS developers?


Solo71:
Thanks for the tip about Edito and multiMenu. They won't help me with this specific problem but they really look like very handly modules.
Re:Setting the target for links in some blocks
by tripmon on 2004/10/21 21:25:17

Guido

as opposed to using bb code, which is hard coded to open a new window:
[URL=yourlink]LinkText[/URL]

use HTML to launch a link in the same window.
<a href="yourlink">LinkText</a>

you will need to use HTML formatting in the drop down box below the text area.

As far as changing the bb code function, it would cascade to additional areas where [URL] is used and may present problems. You could change the bbcode call and add a variable, but it's not worth the trouble in my opinion.

Who's Online

498 user(s) are online (172 user(s) are browsing Support Forums)


Members: 0


Guests: 498


more...

Donat-O-Meter

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

Latest GitHub Commits