Revision history for OpenExternalInNewWindow


Revision [20572]

Last edited on 2009-04-24 10:23:08 by ErikAnderson
Additions:
%%(php) $external_link_new_window = $this->GetConfigValue("external_link_new_window");
if ($external_link_new_window = "0") {
$result = '<a class="'.$class.'" href="'.$url.'">'.$text.'</a>';
} else {
$result = '<a class="'.$class.'" href="'.$url.'" target=\"_new\">'.$text.'</a>';
}%%
Deletions:
**Replace** it with... (rest of instructions to follow shortly -EA)


Revision [20571]

Edited on 2009-04-24 09:45:39 by ErikAnderson [Instructions for Wikka Version 1.1.6.6 (more to come)]
Additions:
====Step 1 for Wikka version =1.1.6.6====
%%(php) $result = '<a class="'.$class.'" href="'.$url.'">'.$text.'</a>';%%
In Wikka version 1.1.6.6, you can find the code in ##libs/Wakka.class.php## at line 1050.
**Replace** it with... (rest of instructions to follow shortly -EA)
====Step 1 for Wikka versions <1.1.6.6====
====Step 2====


Revision [19473]

Edited on 2008-01-28 00:16:35 by JasonHuebel [Modified links pointing to docs server]

No Differences

Revision [17927]

Edited on 2008-01-24 21:47:54 by JasonHuebel [Modified links pointing to docs server]
Additions:
**TODO:**
~- Need to add info on modifying ##actions/rss.php##, which should always be considered external


Revision [17923]

Edited on 2008-01-24 20:49:43 by JasonHuebel [added note about requiring XHTML Transitional]
Additions:
**Note:** This modification also requires XHTML Transitional. XHTML Strict is not supported, since the target attribute is not allowed. If you don't understand this and/or haven't modified the DOCTYPE in ##actions/header.php##, then you don't need to worry about this.


Revision [17904]

Edited on 2008-01-15 01:09:37 by JasonHuebel [modified to include instructions for Wikka versions 1.1.6.2 or greater]
Additions:
Locate this line in the source:
In Wikka versions <1.1.6.2, you can find the code in ##wikka.php##, somewhere around line 662.
In Wikka versions >=1.1.6.2, you can find the code in ##libs/Wakka.class.php##, somewhere around line 882.
**Replace** it with this:
%%(php)'external_link_new_window' => '1'%%
##'0'## (zero) turns off opening external links in a new window. Any non-zero value turns on opening external links in a new window.
Deletions:
Locate this line in ##wikka.php##, somewhere around line 662:
and **replace** it with this:
%%(php)"external_link_new_window" => "1"%%
##"0"## (zero) turns off opening external links in a new window. Any non-zero value turns on opening external links in a new window.


Revision [14478]

Edited on 2006-06-05 16:08:11 by JasonHuebel [added config file option for opening an external link in a new window]
Additions:
and **replace** it with this:
%%(php) $external_link_new_window = $this->GetConfigValue("external_link_new_window");
if ($external_link_new_window = "0") {
return $url ? "<a class=\"ext\" href=\"$url\">$text</a>$external_link_tail" : $text;
} else {
return $url ? "<a class=\"ext\" href=\"$url\" target=\"_new\">$text</a>$external_link_tail" : $text;
}%%
Then add the following element to the ##wikka.config.php## wakkaConfig array:
%%(php)"external_link_new_window" => "1"%%
##"0"## (zero) turns off opening external links in a new window. Any non-zero value turns on opening external links in a new window.
Deletions:
and change it to this:
%%(php) return $url ? "<a class=\"ext\" href=\"$url\" target=\"_new\">$text</a>$external_link_tail" : $text;%%


Revision [12269]

Edited on 2005-12-14 19:17:57 by JasonHuebel [removed comment, clarified the purpose of the modification]
Additions:
This simple code modification will open //all// external links in a new window or tab, depending on your browser's configuration. This modification is useful to prevent users from navigating away from the wiki when they click an external link. External links are defined as any link that leaves the Wiki (even if they are on the same server).
Deletions:
This simple code modification will open external links in a new window. External links are defined as any link that leaves the Wiki (even if they are on the same server).
~& Another alternative is to use this directly within the wikka page you are working on
~& %%(htmlstrict) <A href="http://google.com" TARGET="_blank">Google</A> %%
~& It will show up a normal link "" <A href="http://google.com" TARGET="blank">Google</A> ""
~& In this case the **TARGET="_blank"** bit is what does the trick.
~& Assuming this is what you were originally after, it has the advantage of no code changes. NickDamoulakis


Revision [11911]

Edited on 2005-11-19 12:13:36 by NickDamoulakis [removed comment, clarified the purpose of the modification]
Additions:
~& Another alternative is to use this directly within the wikka page you are working on
~& %%(htmlstrict) <A href="http://google.com" TARGET="_blank">Google</A> %%
~& It will show up a normal link "" <A href="http://google.com" TARGET="blank">Google</A> ""
~& In this case the **TARGET="_blank"** bit is what does the trick.
~& Assuming this is what you were originally after, it has the advantage of no code changes. NickDamoulakis


Revision [10701]

Edited on 2005-08-15 17:28:51 by JasonHuebel [added category]
Additions:
----
CategoryUserContributions


Revision [10699]

Edited on 2005-08-15 17:27:08 by JasonHuebel [typo]
Additions:
Locate this line in ##wikka.php##, somewhere around line 662:
Deletions:
Locate this line in ##wikka.php##, somwhere around line 662:


Revision [10698]

The oldest known version of this page was created on 2005-08-15 17:26:45 by JasonHuebel [typo]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki