Revision [18941]

This is an old revision of KickTheDonkey made by EdLucas on 2008-01-28 00:13:24.

 

Homepage: http://ktd.sytes.net
Email: kickthedonkey@gmail.com

Tricks I've learned

Here are some nifty hacks I've done to Wikka:



Find this line in /libs/Wakka.class.php (around line 660):
    $external_link_tail = $this->GetConfigValue("external_link_tail");
    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;
    }


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
There are 2 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki