Briggsy:
If you still need the pdf, and doc and whatever you want, a friend of mine fixed it rather quickly.
Find:
$sites = explode('||', $Xterlink_sites);
foreach ($sites as $key=>$value) {
$sites[$key]= explode('->', $value);
}
And add this after it:
$custom = explode('||', $Xterlink_custom);
foreach ($custom as $key=>$value) {
$custom[$key]= explode('->', $value);
}
And also find:
for($n=0;$n<count($links[2]);$n++){
$linkprotocol = strtolower(substr($links[2][$n],0,5));
And replace with:
for($n=0;$n<count($links[2]);$n++){
$fileextension = strtolower(substr($links[2][$n],(strrpos($links[2][$n], ".")+1),strlen($links[2][$n])));
if (count($ext)>0){
foreach($ext as $customExt){
if($fileextension==$customExt[0]){
$o = str_replace($links[1][$n],$links[1][$n].' class="'.$customExt[1].'"',$o);
$links[1][$n]=$links[1][$n].' class='.$customExt[1];
continue(2);
}
}
}
$linkprotocol = strtolower(substr($links[2][$n],0,5));
Update the parameters with:
&Xterlink_sites=<strong>Sites</strong>;string;www.modxcms.com->modxcmscomclass||modxhost->modxhostclass||modxcms.fr->modxcmsfrclass ;&Xterlink_genericclass=<strong>Generic external links css class</strong>;string;external &Xterlink_internalclass=<strong>Internal links css class</strong>;string;internal
&Xterlink_httpsclass=<strong>HTTPS css class</strong>;string;httpsXternal &Xterlink_ftpclass=<strong>FTP css class</strong>;string;ftpXternal &Xterlink_custom=<strong>Custom protocol</strong>;string;javas->javascriptClass &Xterlink_ext=<strong>File extentsion</strong>;string;pdf->pdfclass||doc->docclass||html->htmlclass;
Now you’re done and you can add whatever filetype you want.
I use it in conjunktion with
http://www.psyked.co.uk/css/automatic-link-icons-v20.htm so I can style the links with my css, and add jQuery to open the pdfclass, or whateverclass in a new window.
_blank isn’t valid anylonger, though it works just fine.
Greets go out to my friend bac0n who fixed this little script for me.
Cheers