mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
Sort out image paths (may need a tweak if different icon provided)
This commit is contained in:
@@ -11,19 +11,25 @@ if ((e_PAGE == 'page.php') || (array_key_exists('forum_attach', $pref) && $pref[
|
||||
}
|
||||
}
|
||||
|
||||
$ext = substr($fname, strrpos($fname, ".")+1);
|
||||
$ext = substr($fname, strrpos($fname, '.')+1);
|
||||
|
||||
if(is_readable(THEME."images/".$ext.".png")){
|
||||
$image = THEME."images/".$ext.".png";
|
||||
if(is_readable(THEME.'images/'.$ext.'.png'))
|
||||
{
|
||||
$image = THEME.'images/'.$ext.'.png';
|
||||
}
|
||||
elseif(is_readable(e_IMAGE.'/generic/'.$ext.'.png'))
|
||||
{
|
||||
$image = e_IMAGE.'generic/'.$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';
|
||||
|
||||
}elseif(is_readable(THEME."images/file.png")){
|
||||
$image = THEME."images/file.png";
|
||||
|
||||
}else{
|
||||
$image = e_IMAGES."packs/".IMODE."/generic/file.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
$image = e_IMAGE.'generic/lite/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