php forum
php mysql forum
php mysql smarty
 
Topic Options
#222303 - 08/11/02 09:15 PM Image Gallery v 1.0
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
Mod Name / Version - Image Gallery v1.0 <br />Description - Turns a selected forum into a picture gallery allowing permitted groups to post and comment on uploaded images. Uses existing attachment features and file size limits. <br />Example - <br />http://www.newoutriders.org/ubbtest/postlist.php?Cat=&Board=gallery <br />Pre-requisites - none <br />Author - Aglavalin, aka Steve Stout <br />Files Altered - showflat.php, showflat.tmpl, showthreaded.php, showthreaded.tmpl <br />Database Altered - no <br />New Files - none <br />Note: Use group permissions on forum(s) to determine who can post. <br />Any other info - this is a simple hack <br /> <br /> <br />Here is my first real hack. It turns a forum into a basic image gallery which could be pulled into an IIP page very easily. It allows users to comment on the images as well. This took me a few days to figure out, and it seems to be working fine. The only thing I could not figure out was how to check if the attachment was an image before displaying it. Perhaps someone could clue me in on how to do this?


Attachments
53952-ImageGallery_v1.0.txt (15 downloads)


Top
#222304 - 08/11/02 11:12 PM Re: Image Gallery v 1.0 [Re: neuron]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25452
Loc: Texas
interesting, has great possibilities <img src="/forum/images/icons/smile.gif" alt="" /> I am getting a parse error on your example forum. Please post when it's up, I'd like to check it out <img src="/forum/images/icons/smile.gif" alt="" />
_________________________
- Allen wavey
- What Drives You?

Top
#222305 - 08/11/02 11:57 PM Re: Image Gallery v 1.0 [Re: SurfMinister]
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
Hmm, not sure what I did there, but it's fixed now, lol

Top
#222306 - 08/12/02 02:13 PM Re: Image Gallery v 1.0 [Re: neuron]
Chimera23 Offline
Newbie

Registered: 08/08/02
Posts: 17
Very nice, and simple mod. Good work.

Top
#222307 - 08/12/02 08:41 PM Re: Image Gallery v 1.0 [Re: leo]
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
I just added instructions to upgrade the newspal.php file in IIP 4.3 to display the images from the image gallery, such as use on a homepage or whatnot.<br /><br /><br />Optional code to make images show up in the newspal.php file with IIP 4.3<br /><br />Open newspal.php and find:<br /><br /> if ($palFile) {<br /> $epalFile = rawurlencode($palFile);<br /> $attachment = "<BR>{$ubbt_lang['FILE_ATTACH']} <a href=\"{$config['fileurl']}/$epalFile\">$palFile</a>";<br /> }<br /> else {<br /> $attachment = "";<br /> }<br /><br /><br />and REPLACE it with:<br /><br /> if ($palFile) {<br /> $epalFile = rawurlencode($palFile);<br /> $attachment = "<BR>{$ubbt_lang['FILE_ATTACH']} <a href=\"{$config['fileurl']}/$epalFile\">$palFile</a>";<br /> }<br /> if ($postdisplay[$i] == "FORUM_NAME") {<br /> $attachment = "<center><img src=\"{$config['fileurl']}/$epalFile\"></center><br><br>";<br /> }<br /> else {<br /> $attachment = "";<br /> }<br /><br /><br />Edit FORUM_NAME to match the forum name you will use as your image gallery forum.<br /><br /><br />You can view this addon in action at http://www.newoutriders.org/index.php


Attachments
54024-ImageGallery_v1.1.txt (10 downloads)


Top
#222308 - 08/12/02 09:53 PM Re: Image Gallery v 1.0 [Re: neuron]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
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.<br /><br />I haven't tested this.... but here's the code that checks if it's a .jpg or .gif ....<br /><br />So maybe you need something like this: <br /><br /><pre><font class="small">code:</font><hr><br /><br /> if ($File) {<br /> $File = rawurlencode($File);<br /> $postrow[$i]['filelink'] = "<a href=\"{$config['fileurl']}/$File\">{$ubbt_lang['FILE_ATTACH']}</a>";<br /><br />//---------------------------<br />//image gallery addon<br /> if ($Board == "FORUM_NAME" and (eregi("\.GIF|\.JPG|\.PNG", $File))) {<br /> $postrow[$i]['showfile'] = "<center><img src=\"{$config['fileurl']}/$File\"></center><br><br>";<br /> }<br /> }<br /></pre><hr><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.<br /><br />Hope that helps!<br />Josh<br />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#222309 - 08/12/02 11:56 PM Re: Image Gallery v 1.0 [Re: Daine]
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
Yep, that works <img src="/forum/images/icons/smile.gif" alt="" /> I've updated the directions to include this on the changes to showflat.php, showthreaded.php and newspal.php .<br /><br />Thanks for the help, I think this hack is working as I intended now <img src="/forum/images/icons/smile.gif" alt="" /><br /><br />Attached is the latest and I hope finished version.


Attachments
54034-ImageGallery_v1.2.txt (16 downloads)


Top
#222310 - 08/13/02 08:37 AM Re: Image Gallery v 1.0 [Re: neuron]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
Just a small thought, you could modify the code that inserts the disk image on the postlist to show an image that indicates the posts includes an image instead?
_________________________
/Gardener | Complete list of my mods

Top
#222311 - 08/13/02 09:39 AM Re: Image Gallery v 1.0 [Re: c0bra]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#222312 - 08/13/02 10:21 AM Re: Image Gallery v 1.0 [Re: Daine]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
From what I could see on his board that hack was already installed. But what I meant was to extend that hack to show an icon describing an image (like a canvas, a palette or something) instead of the diskette icon when applicable.<br /><br />The reason I thought of this was that he had two test threads, one with an included image and one with a text file attached. From the postlist, both showed a diskette icon, which made it seem like both had an image inside it. That is, since that particular forum should be an image gallery. Of course, if only posts with images are posted in the forum it won't really matter, the disk would mean that the post has an image in it. But still, something showing an image would be better IMHO.
_________________________
/Gardener | Complete list of my mods

Top
#222313 - 08/13/02 10:57 AM Re: Image Gallery v 1.0 [Re: c0bra]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Something like this. (attached) <br /> <br />[]http://www.threadsdev.com/threads/php/uploads/54056-camera.gif[/]


Attachments
54056-camera.gif (8 downloads)



Edited by JoshPet (08/13/02 10:58 AM)
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#222314 - 08/13/02 11:20 AM Re: Image Gallery v 1.0 [Re: Daine]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
Yup, that's what I mean.
_________________________
/Gardener | Complete list of my mods

Top
#222315 - 08/13/02 02:39 PM Re: Image Gallery v 1.0 [Re: c0bra]
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
Yeah I had a post with a text file for testing purposes. This seperate image for a graphic attachment seems like it should be added onto the attachment image hack to me. Maybe I'll add this to my board, gotta think about it first <img src="/forum/images/icons/smile.gif" alt="" />

Top
#222316 - 08/13/02 02:42 PM Re: Image Gallery v 1.0 [Re: neuron]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
Yes, I guess that would be the best place to put it. Maybe it could be expanded to recognize archives, text files etc, and show different pictures depending on what it is.
_________________________
/Gardener | Complete list of my mods

Top
#222317 - 08/13/02 03:06 PM Re: Image Gallery v 1.0 [Re: c0bra]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
I was just thinking about doing a revision to the attachment image hack to make a distinction for .zip files, graphics, .txt and my board posts alot of video clips..... it would be cool with a logo to indicate video files. <img src="/forum/images/icons/smile.gif" alt="" /><br /><br />I'll get to work. <img src="/forum/images/icons/wink.gif" alt="" /><br /><br />I wonder how all this will work with 6.1 since there is that download script? I wonder if that will get in the way of this type of stuff?
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#222318 - 08/13/02 03:25 PM Re: Image Gallery v 1.0 [Re: Daine]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
The filename of the file should still be in the database, so it's just a matter of reading that. I don't think there will be any problems, you will probably need to change the code a bit though.
_________________________
/Gardener | Complete list of my mods

Top
#222319 - 08/13/02 04:16 PM Re: Image Gallery v 1.0 [Re: c0bra]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Great.... as long as the filename is in the database it should be no problem.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#222320 - 08/23/02 06:15 PM Re: Image Gallery v 1.0 [Re: Daine]
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
Has anyone had any issues using this hack? It seems pretty stable to me and I'll move it to finished status if no problems are reported. I'm planning on updating it if needed for the 6.1 version after I install a copy.

Top
#222321 - 09/12/02 05:46 PM Re: Image Gallery v 1.0 [Re: neuron]
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
This hack is being moved to finished mods forum. It also has been updated for 6.1

Top
#222322 - 09/12/02 06:34 PM Re: Image Gallery v 1.0 [Re: neuron]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Finished Mod can be found here.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top


Who's Online
0 registered (), 18 Guests and 10 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Wisdom needed
by Gizmo
Yesterday at 10:54 AM
How to hide sub forums from summary page
by blaaskaak
12/03/08 09:54 AM
Spell Check [beta]
by Bill B
12/01/08 09:16 PM
PhotoPost BB Code Popup
by AllenAyres
12/01/08 09:41 AM
Problems reading a lot of old posts here
by AllenAyres
12/01/08 09:35 AM
Forum 'Trader Ratings'.
by AllenAyres
12/01/08 09:33 AM
Customization needed
by Gizmo
11/12/08 12:28 PM
New Mods
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Spell Check [beta]
by
10/17/06 09:24 PM
Newest Members
Truth, David DelMonte, nick1, Begbie, cenk
13364 Registered Users
Top Posters
AllenAyres 25452
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks