2 of 2
2
Insert URL not Link into Custom-Field
Posted: 11 June 2008 09:22 AM   [ Ignore ]   [ # 16 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3350
Joined  2006-10-18

Stefan,

Sorry for being late on this one…
Found it… not sure why I never caught this before, but the code actually does reside in the File Upload module code smile

In mod.file_upload.php (in modules/file_upload folder), around line 387:

Change:

if ($data['is_image'== 1)
  
{
   $imgsrc 
"<img src=\"{filedir_".$data['id']."}".$data['file_name']."\"".$properties;
   
   
$wh '';
   
   if (
function_exists('getimagesize')) 
   
{
    $imgdim 
= @getimagesize($query->row['server_path'].$data['file_name']);
    
    if (
is_array($imgdim)) 
    
{
     $imgsrc 
.= " width=\"".$imgdim['0']."\" height=\"".$imgdim['1']."\"";
     
     
$wh "width=".($imgdim['0']+15).",height=".($imgdim['1']+15).",";
    
}
   }
   
   $imgsrc 
.= " />";

To:

if ($data['is_image'== 2)
  
{
   $imgsrc 
"{filedir_".$data['id']."}".$data['file_name']."".$properties;
   
   
$wh '';
   
   if (
function_exists('getimagesize')) 
   
{
    $imgdim 
= @getimagesize($query->row['server_path'].$data['file_name']);
    
    if (
is_array($imgdim)) 
    
{
     $imgsrc 
.= "";
     
     
$wh "width=".($imgdim['0']+15).",height=".($imgdim['1']+15).",";
    
}
   }
   
   $imgsrc 
.= "";

And around line 413:

Change:

else
  
{
   $props 
.= "<a href=\"{filedir_".$data['id']."}".$data['file_name']."\">".$data['file_name']."</a>";
  
}

To:

else
  
{
   $props 
.= "{filedir_".$data['id']."}".$data['file_name']."";
  
}

 Signature 
Profile
 
 
Posted: 11 June 2008 09:30 AM   [ Ignore ]   [ # 17 ]
Jr. Member
RankRank
Total Posts:  33
Joined  2007-09-04

Pie Man for President - Pie Man for President!!!

Tank you very much! it works «just like magic» (as steve jobs would say) *g*

Profile
 
 
Posted: 11 June 2008 09:38 AM   [ Ignore ]   [ # 18 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3350
Joined  2006-10-18

Haha LOL

Well, it’s sort of a sloppy hack… I’m sure there’s a much cleaner method rasberry

 Signature 
Profile
 
 
Posted: 12 June 2008 08:28 AM   [ Ignore ]   [ # 19 ]
Jr. Member
RankRank
Total Posts:  33
Joined  2007-09-04

hey Pie Man

thx again for your help … i’ve just launched my new classifields site where i use this «Hack»: http://expressionengine.com/forums/viewthread/82156/

Profile
 
 
Posted: 12 June 2008 08:51 AM   [ Ignore ]   [ # 20 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3350
Joined  2006-10-18

Awesome! LOL

You’re probably not too worried about IE7 users, but the title gets margined out about 2 third’s the way up wink

You don’t even want to know what IE6 looks like, hahaha LOL

Image Attachments
macprime_ie7.jpg
 Signature 
Profile
 
 
Posted: 12 June 2008 08:55 AM   [ Ignore ]   [ # 21 ]
Jr. Member
RankRank
Total Posts:  33
Joined  2007-09-04

hehe, i know, i know (also about IE 6 (and 5.5)) but we have only about 5% IE-Users … but it’s on my todo-list ... but with very low priority! wink

Profile
 
 
   
2 of 2
2