mirror of
https://github.com/e107inc/e107.git
synced 2025-07-30 19:30:25 +02:00
image path corrected + added support for extension-specific-images
This commit is contained in:
@@ -2,7 +2,6 @@ global $pref, $fromadmin;
|
||||
|
||||
if ((e_PAGE == 'page.php') || (array_key_exists('forum_attach', $pref) && $pref['forum_attach'] && FILE_UPLOADS || ADMIN || $fromadmin))
|
||||
{
|
||||
$image = (file_exists(THEME."images/file.png") ? THEME."images/file.png" : e_IMAGE."generic/".IMODE."/file.png");
|
||||
list($fname, $uc) = explode("^", $parm."^");
|
||||
if($uc)
|
||||
{
|
||||
@@ -11,5 +10,21 @@ if ((e_PAGE == 'page.php') || (array_key_exists('forum_attach', $pref) && $pref[
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$ext = substr($fname, strrpos($fname, ".")+1);
|
||||
|
||||
if(is_readable(THEME."images/".$ext.".png")){
|
||||
$image = THEME."images/".$ext.".png";
|
||||
|
||||
}elseif(is_readable(e_IMAGES."packs/".IMODE."/generic/".$ext.".png")){
|
||||
$image = e_IMAGES."packs/".IMODE."/generic/".$ext.".png";
|
||||
|
||||
}elseif(is_readable(THEME."images/file.png")){
|
||||
$image = THEME."images/file.png";
|
||||
|
||||
}else{
|
||||
$image = e_IMAGES."packs/".IMODE."/generic/file.png";
|
||||
}
|
||||
|
||||
return "<a href='".$tp -> toAttribute($fname)."'><img src='".$image."' alt='' style='border:0; vertical-align:middle' /></a> <a href='".$tp -> toAttribute($fname)."'>".$code_text."</a>";
|
||||
}
|
||||
|
Reference in New Issue
Block a user