Revision history for ArchiveLinkFormattingFix


Revision [19126]

Last edited on 2008-01-28 00:14:03 by JsnX [Modified links pointing to docs server]

No Differences

Revision [16860]

Edited on 2007-05-31 23:26:39 by JsnX [Reverted]
Additions:
if (preg_match("/^([A-Z][a-zA-Z]+):([^\\s\"<>&]+)$/", $tag, $matches))
{
$url = $this->GetInterWikiUrl($matches[1], $matches[2]);
}
else if (preg_match("/^(http|https|ftp):\/\/([^\\s\"<>&]+)$/", $tag))
{
$url = $tag; // this is a vaild external URL
}
else if (preg_match("/^[^\\s\"<>&]+\@[^\\s\"<>&]+$/", $tag))
{
$url = "mailto:".$tag;
}
else if (preg_match("/^([-A-Za-z0-9_]+\\.)+[A-Za-z][-A-Za-z0-9_]+$/", $tag))
{
$url = "http://".$tag;
}
elseif (preg_match("/^[A-Za-z0-9]+$/", $tag))
{
// it's a Wakka link!
if ($_SESSION["linktracking"] && $track) $this->TrackLinkTo($tag);
return ($this->LoadPage($tag) ? "<a href=\"".$this->href($method, $tag)."\">".$text."</a>" : "<span class=\"missingpage\">".$text."</span><a href=\"".$this->href("edit", $tag)."\">?</a>");
}
$tail = "<span class=\"exttail\">∞</span>"; // set this to the empty string if you don't like it
return $url ? "<a class=\"ext\" href=\"$url\">$text</a>$tail" : $text;
}
%%
Change the function **IsWikiName** to
%% function IsWikiName($text) { return preg_match("/^[A-Z][a-z]+[A-Z0-9][A-Za-z0-9]*$/", $text); }
%%
While you're at it, fix the bug with link tracking in headers and footers (these links shouldn't count as back links to a page):
%% function Header() { return $this->Action($this->GetConfigValue("header_action"), 0); }
function Footer() { return $this->Action($this->GetConfigValue("footer_action"), 0); }
%%
==== formatters/wakka.php ====
Make this patch:
%%@@ -57,1 +57,1 @@
- return "<a href=\"$url\">$url</a>".$matches[2];
+ return $wakka->Link($url).$matches[2];
%%
====css/wakka.css====
Add these CSS classes, editing to suit your taste:
%%a.ext {
color: #933;
}
.exttail {
color: #999;
position: relative;
bottom: 0.5ex;
}
%%
Deletions:
if (preg_match("/^([A-Z][a-zA-Z] ):([^\\s\"<>


Revision [16658]

Edited on 2007-05-31 10:30:38 by CjdI1r [Reverted]
Additions:
if (preg_match("/^([A-Z][a-zA-Z] ):([^\\s\"<>
Deletions:
if (preg_match("/^([A-Z][a-zA-Z]+):([^\\s\"<>&]+)$/", $tag, $matches))
{
$url = $this->GetInterWikiUrl($matches[1], $matches[2]);
}
else if (preg_match("/^(http|https|ftp):\/\/([^\\s\"<>&]+)$/", $tag))
{
$url = $tag; // this is a vaild external URL
}
else if (preg_match("/^[^\\s\"<>&]+\@[^\\s\"<>&]+$/", $tag))
{
$url = "mailto:".$tag;
}
else if (preg_match("/^([-A-Za-z0-9_]+\\.)+[A-Za-z][-A-Za-z0-9_]+$/", $tag))
{
$url = "http://".$tag;
}
elseif (preg_match("/^[A-Za-z0-9]+$/", $tag))
{
// it's a Wakka link!
if ($_SESSION["linktracking"] && $track) $this->TrackLinkTo($tag);
return ($this->LoadPage($tag) ? "<a href=\"".$this->href($method, $tag)."\">".$text."</a>" : "<span class=\"missingpage\">".$text."</span><a href=\"".$this->href("edit", $tag)."\">?</a>");
}
$tail = "<span class=\"exttail\">∞</span>"; // set this to the empty string if you don't like it
return $url ? "<a class=\"ext\" href=\"$url\">$text</a>$tail" : $text;
}
%%
Change the function **IsWikiName** to
%% function IsWikiName($text) { return preg_match("/^[A-Z][a-z]+[A-Z0-9][A-Za-z0-9]*$/", $text); }
%%
While you're at it, fix the bug with link tracking in headers and footers (these links shouldn't count as back links to a page):
%% function Header() { return $this->Action($this->GetConfigValue("header_action"), 0); }
function Footer() { return $this->Action($this->GetConfigValue("footer_action"), 0); }
%%
==== formatters/wakka.php ====
Make this patch:
%%@@ -57,1 +57,1 @@
- return "<a href=\"$url\">$url</a>".$matches[2];
+ return $wakka->Link($url).$matches[2];
%%
====css/wakka.css====
Add these CSS classes, editing to suit your taste:
%%a.ext {
color: #933;
}
.exttail {
color: #999;
position: relative;
bottom: 0.5ex;
}
%%


Revision [35]

The oldest known version of this page was created on 2004-03-07 15:08:46 by JsnX [Reverted]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki