As per only trying to insert it if the file is an image. There was an old hack like this one... I'm using it on my board... except that I've got it set to all boards.
I haven't tested this.... but here's the code that checks if it's a .jpg or .gif ....
So maybe you need something like this:
code:
if ($File) {
$File = rawurlencode($File);
$postrow[$i]['filelink'] = "<a href="{$config['fileurl']}/$File">{$ubbt_lang['FILE_ATTACH']}</a>";
//---------------------------
//image gallery addon
if ($Board == "FORUM_NAME" and (eregi("\.GIF|\.JPG|\.PNG", $File))) {
$postrow[$i]['showfile'] = "<center><img src="{$config['fileurl']}/$File"></center><br><br>";
}
}
Again.... haven't tested this... I'm not a PHP expert and don't know if I've got the syntex of an if statement with an "AND" correct or now.... but the old hack that JustDave wrote for 5.5 used "if (eregi("\.GIF|\.JPG|\.PNG", $File))" to check if it was a GIF, JPG or PNG file.
Hope that helps!
Josh