Revision [4601]
This is an old revision of KickTheDonkey made by KickTheDonkey on 2005-01-13 18:21:20.
Email: kickthedonkey@gmail.com
Want a gmail invite? I've got'em in spades...
Tricks I've learned
Here are some nifty hacks I've done to Wikka:- Preventing links to the current host as being marked as 'external'. For instance, you've got Wikka installed at http://some.host.com/wikka/ and you link to a file http://some.host.com/files/file.txt. I didn't like the fact that Wikka marked it as 'external'. Yes, its external to Wikka, but not external to the site. So, here's a little hack to make Wikka match my personal preference:
Find this line in wikka.php in the Wikka::Link method (around link 475, I believe):
$external_link_tail = $this->GetConfigValue("external_link_tail");
return $url ? "<a class=\"ext\" href=\"$url\">$text</a>$external_link_tail" : $text;
return $url ? "<a class=\"ext\" href=\"$url\">$text</a>$external_link_tail" : $text;
and replace with:
$url_parts = parse_url($url);
$base_parts = parse_url($this->config['base_url']);
if($url_parts['host'] != $base_parts['host'])
{
$external_link_tail = $this->GetConfigValue("external_link_tail");
return $url ? "<a class=\"ext\" href=\"$url\">$text</a>$external_link_tail" : $text;
}
else
{
return $url ? "<a href=\"$url\">$text</a>" : $text;
}
$base_parts = parse_url($this->config['base_url']);
if($url_parts['host'] != $base_parts['host'])
{
$external_link_tail = $this->GetConfigValue("external_link_tail");
return $url ? "<a class=\"ext\" href=\"$url\">$text</a>$external_link_tail" : $text;
}
else
{
return $url ? "<a href=\"$url\">$text</a>" : $text;
}
Basically, this hack is getting the base host of the url in question, and comparing that against the base host of the Wikka install. If they're different, the link is identified as an external link. Otherwise, its presented as a regular link.
Back to CategoryUsers