Webaddress field open in new window

16 years 7 months ago #44264 by Bartcelona
Webaddress field open in new window was created by Bartcelona
Does anybody know how I can make the Webaddress field open in the same window?

Currently I use this to link inside my site and therefor opening in a new window is not the right behavior.

(I have thought of a work arround and create a "creative tab" that has the links but I do not like this solution much as I wish to have the link on the profile tab and not a new ("creative") tab)

any help greatly appreciated

Please Log in to join the conversation.

16 years 6 months ago #44481 by ysva
Replied by ysva on topic Re:Webaddress field open in new window
administrator/components/com_comprofiler/comprofiler.class.php
On line: 1482

You can find this:
[code:1]$oReturn="<a href=\"http://".htmlspecialchars($oReturn[0])."\" target=\"_blank\">".htmlspecialchars($oReturn[1])."</a>";
[/code:1]

change it to this:
[code:1]$oReturn="<a href=\"http://".htmlspecialchars($oReturn[0])."\" target=\"_self\">".htmlspecialchars($oReturn[1])."</a>";
[/code:1]

Please Log in to join the conversation.

16 years 6 months ago #44556 by Bartcelona
Replied by Bartcelona on topic Re:Webaddress field open in new window
Excellent, that did it!

Thanks for the help

Please Log in to join the conversation.

16 years 6 months ago #44562 by ysva
Replied by ysva on topic Re:Webaddress field open in new window
np ^^
I'm one of the few people that answer the small but hard to find questions, quite a shame actually:(

Please Log in to join the conversation.

16 years 6 months ago #44563 by Bartcelona
Replied by Bartcelona on topic Re:Webaddress field open in new window
ysva wrote:

np ^^
I'm one of the few people that answer the small but hard to find questions, quite a shame actually:(


You are a great example of what these forums should be like. I will try to do the same when I believe I can help somebody ;-)

Please Log in to join the conversation.

15 years 2 months ago #86227 by wrongjon
Replied by wrongjon on topic Re:Webaddress field open in new window
Guys
Im also trying to do this... I want webaddress fields to open in new window so located the code in comprofiler.class.php and changed as below

[code:1]CASE 'webaddress':
IF($oValue==null) $oReturn="";
ELSEIF($ueConfig==1) {
$oReturn=array();
$oReturn = explode("|*|",$oValue);
if (count($oReturn) < 2) $oReturn[1]=$oReturn[0];
//$oReturn="<a href=\"http://".htmlspecialchars($oReturn[0])."\" target=\"_blank\">".htmlspecialchars($oReturn[1])."</a>"; JJA_MOD new version below

$oReturn="<a href=\"http://".htmlspecialchars($oReturn[0])."\" title=\"hello\" target=\"_self\">".htmlspecialchars($oReturn[1])."</a>";

} ELSE {
$oReturn=$oValue;
}
break;[/code:1]

as you can see ive changed _blank to _self and even added a title="hello"

But none of these changes are affecting my site when I look at results in userlist the links dont have a title and dont open in same window.

Either im going crazy or my site isnt using this new version... Ive deleted the file off the remote ftp and site stops so its defo looking at this file.

Anyone think of why its not affecting the links?

thanks in advance
jonathan

************
SOLED
************

Doh I was editing code that was only there for backwards compatibility in comprofiler.class.php

Found new code in cb.core.php line 1925

//return '<a href="http://' . htmlspecialchars( $oReturn[0] ) . '" target="_blank">' . htmlspecialchars( $oReturn[1] ) . '</a>';
return '<a href="http://' . htmlspecialchars( $oReturn[0] ) . '" target="_self">' . htmlspecialchars( $oReturn[1] ) . '</a>';

Only took me a whole day to work it out :(

Post edited by: wrongjon, at: 2009/01/22 19:08

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.207 seconds

Facebook Twitter LinkedIn