',4);
// added to remove image links by default
if($item['isimg']){
// remove link from images
ptln('
'.
utf8_decodeFN($item['file']).
'',6);
} else {
ptln('
'.
utf8_decodeFN($item['file']).
'',6);
}
(...)
//edited to remove image links by default
print '
';
--[[ian@subcultured.org|ian]]
===== Method 2 =====
If you already have an established site and wish to turn off image linking by default, make the following change:\\
Open **inc/parser/handler.php** and change the block at line 686 to look like
//get linking command
if(preg_match('/nolink/i',$param)){
$linking = 'nolink';
}else if(preg_match('/direct/i',$param)){
$linking = 'direct';
}else if(preg_match('/details/i',$param)){
$linking = 'details';
}else{
$linking = 'nolink';
}
This would make a good option to add into the core.\\
--- //[[mezell1@ece.utk.edu|Matt Ezell]] 2007-02-11 21:56//
>IIRC, this will actually make **all** inserted media default to nolink, which may not be desirable (think PDF links, for example) --[[ian@subcultured.org|ian]]
>>It is possible to make the code above work for //images only// by using on extra ''preg_match''. Again, substitute starting at line 686 (check the comment line below to find the correct spot)\\
//get linking command
if(preg_match('/nolink/i',$param)){
$linking = 'nolink';
}else if(preg_match('/direct/i',$param)){
$linking = 'direct';
}else if(preg_match('/linkonly/i',$param)){
$linking = 'linkonly';
}else{
$imageformats='/\.(gif|jpg|jpeg|png)/i';
if (preg_match($imageformats,$src) )
$linking = 'nolink';
else
$linking = 'details';
}
\\ This will allow for the handler to apply nolinking only to known image formats (you can, of course, change the expression in the ''$imageformats'' variable, I have used a very simple one). --- //[[luis.machuca@gulix.cl|Luis Machuca Bezzaza]] 2009/09/21 03:19//