Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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

Sponsored Links
Entire Thread
Subject Posted By Posted
Image Gallery v 1.0 Aglavalin 08/12/2002 4:15 AM
Re: Image Gallery v 1.0 AllenAyres 08/12/2002 6:12 AM
Re: Image Gallery v 1.0 Aglavalin 08/12/2002 6:57 AM
Re: Image Gallery v 1.0 Chimera23 08/12/2002 9:13 PM
Re: Image Gallery v 1.0 Aglavalin 08/13/2002 3:41 AM
Re: Image Gallery v 1.0 JoshPet 08/13/2002 4:53 AM
Re: Image Gallery v 1.0 Aglavalin 08/13/2002 6:56 AM
Re: Image Gallery v 1.0 Gardener 08/13/2002 3:37 PM
Re: Image Gallery v 1.0 JoshPet 08/13/2002 4:39 PM
Re: Image Gallery v 1.0 Gardener 08/13/2002 5:21 PM
Re: Image Gallery v 1.0 JoshPet 08/13/2002 5:57 PM
Re: Image Gallery v 1.0 Gardener 08/13/2002 6:20 PM
Re: Image Gallery v 1.0 Aglavalin 08/13/2002 9:39 PM
Re: Image Gallery v 1.0 Gardener 08/13/2002 9:42 PM
Re: Image Gallery v 1.0 JoshPet 08/13/2002 10:06 PM
Re: Image Gallery v 1.0 Gardener 08/13/2002 10:25 PM
Re: Image Gallery v 1.0 JoshPet 08/13/2002 11:16 PM
Re: Image Gallery v 1.0 Aglavalin 08/24/2002 1:15 AM
Re: Image Gallery v 1.0 Aglavalin 09/13/2002 12:46 AM
Re: Image Gallery v 1.0 JoshPet 09/13/2002 1:34 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
• Shock Hosting
• Stable Host
• bluehost
• InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,826
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 13812
Topics Created 0
Posts Made 0
Users Online 1
Birthdays 12
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)