Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Photo Gallery w/User Upload Using Multi File Upload

edited February 2008 in Vanilla 1.0 Help
Ok I'm very new to PHP so I usually just paste my various extensions together to get what I want so here's my almost coding free idea for a photo gallery.
Features:
Displays a gallery of images on each users account page
Users can upload to a personal directory to change the images on their account page
Obviously other users need see the images in the gallery of the account they are currently viewing not their own images
When a thumbnail is clicked it gets repositioned in the center display area and increased in size

My approach so far:
I have a nice bit of code which does the resizing and displays the images nicely. I can share a link to the code if anyone cares, but it's just basic stuff to display a certain set of named images from a directory.
I also have Multi File Upload set so that all user files uploaded go into directories using their UserID so they could post their images in a discussion and the display extension could simply read them from the UserID directory.

That little bit of coding that seems to be getting in my way:
I don't know how to make the display extension read the UserID of the account page being viewed so that it displays the gallery for that person.
I think I might need a modified version of Multi File Upload so that it only displays on the User Wall (is that possible? Is it a discussion too?) and it only allows certain file names to be given to the uploaded files. i.e. A drop down selection for Picture1 through Picture36, for each attachment. Of course if you updated your pictures while on somebody else's account page since Attachments takes your UserID it would still end up in your directory and not theirs so it should keep people from changing gallery images that aren't their own. Perhaps easier might be to make the User Wall comment posting box have a fixed number of attachment boxes displayed with fixed names for each one and a line of text saying "place images in order from position 1 through x", etc.

It feels close to working but I lack any experience referencing UserID's, and what not. Any thoughts? Oh and as I said I'm new to PHP (I have other programming experience though) so I pretty much lack an understanding of the language and operators so I'll need pretty concrete examples of what to insert. i.e. I'm not going to know what to do if you say something like "overload the UserID".

Comments

  • ..or if it is gonna be in a gallery, the user can create an album in the gallery and the user can set weather or not other users can see his or her pictures... ----------------------- i really like ur idea
  • This is the number one extension/application I'd like to see for Vanilla. I'd like to test it on one of my boards, and maybe someone more familiar with php could lend a helping hand towards us helping ourselves and the community. I'm starting to make the jump from standard html to MySql, PHP and being more creative with CSS. That's why I'm here. email me at dave@thedesignstudent.com if you'd like to get together, because I'd like to try your extension and learn more about creating my own in the process. Piecing together code is where it all starts. Say hi, and stay in touch!
  • There shouldn't be an option to upload/edit pictures in the gallery on someone else's account page, only your own. Keep the current code you have though, just remove the panel item if $AccountUserID != $Context -> Session -> UserID. That way, if someone tries to be sneaky and access the upload/edit section with someone else's UserID, they'll only see their gallery. Getting the display extension to read the UserID of whoever's pictures it needs to display should be fairly straight-forward. If it's displaying on the account page then you can use the $AccountUserID variable which gets set on that page. If it's not on the account page then you need to provide the page with the UserID. Usually that's done by linking to the page with ?u=UserID appended but you can post the data to the page too. Once you've got that setup all you need to do is grab it with ForceIncomingInt('u', $Context -> Session -> UserID) (that last parameter ensures the value defaults to the logged in user if no UserID is passed to the script). Something similar to this is planned as part of my super-secret project but it involves screenshots mainly.
  • Any chance this will be put together for Vanilla2?
  • MikhaelMikhael New
    edited August 2010
    I spent quite some time creating a Facebook-like theme in another system, and would like to go some of the way toward that kind of idea with Vanilla 2, but without having to spend too much time coding and theming. I like Vanilla's default theme anyway, so am thinking more 'wall' style as the front page, ie., Profile, with other tabs/pages for images, etc.

    One thing which needs thinking about is server storage if your site gets busy, or a few members become overly enthusiastic about uploading. It occurs to me that Google, Flickr, etc., probably have easy ways to integrate a user's images into your own site, so the storage issue is resolved if users upload to one of those sites and you integrate the services into yours.

    There are threads here about creating a plugin to allow image/video embedding, and if that works then users can embed in posts without storage issues. Or weeks of coding on your part, come to that.
Sign In or Register to comment.