я прописывала так:
для административных
if (ereg(".gif$", "$file"))
{
$file2 = $file;
$file2 = str_replace(".gif", "", $file2);
$trfile = trans($file2);
$str = str_replace(":$file2:", "<img src=\"../sm/adm/$file2.gif\" alt=\"\" />", $str);
$str = str_replace(":$trfile:", "<img src=\"../sm/adm/$file2.gif\" alt=\"\" />", $str);
$file2 = $file;
$file2 = str_replace(".gif", "", $file2);
$trfile = trans($file2);
$str = str_replace(".$file2.", "<img src=\"../sm/adm/$file2.gif\" alt=\"\" />", $str);
$str = str_replace(".$trfile.", "<img src=\"../sm/adm/$file2.gif\" alt=\"\" />", $str);
}
для каталога
if (ereg(".gif$", "$k"))
{
$file2 = $k;
$file2 = str_replace(".gif", "", $file2);
$trfile = trans($file2);
$str = str_replace(":$file2:", "<img src=\"../sm/cat/$a[$a1]/$file2.gif\" alt=\"\" />", $str);
$str = str_replace(":$trfile:", "<img src=\"../sm/cat/$a[$a1]/$file2.gif\" alt=\"\" />", $str);
$file2 = $k;
$file2 = str_replace(".gif", "", $file2);
$trfile = trans($file2);
$str = str_replace(".$file2.", "<img src=\"../sm/cat/$a[$a1]/$file2.gif\" alt=\"\" />", $str);
$str = str_replace(".$trfile.", "<img src=\"../sm/cat/$a[$a1]/$file2.gif\" alt=\"\" />", $str);
}