angelali Posted May 16, 2012 Share Posted May 16, 2012 Hello, my friends and I are planning to make a photo gallery, where people can upload their images and everyone can view them. These images will be saved in database. The problem is, we have to moderate these images when uploaded, to prevent adult content or copyrighted images from being displayed. We were thinking to make people send us these images by email, I mean through an email attachment, then we will review them, and if these images are OK, we will insert them manually into the database. We want as far as possible to not consume unnecessary spaces in the database, else the hosting will cancel our account even it offers unlimited space and bandwidth. We could make these images store in a folder, but the persons will have to give their names, that's why we think it would be better to make them fill some fields, attach the image and send us by email. 1/ Do you think this method is good? If you have another method, please give me... 2/ And also how do you insert images manually to database? I'm using PHPMyAdmin. I mean, to upload an image which is on my computer itself. I know there are some MySQL IDEs which do this, but do not know on PHPMyAdmin Thank you Quote Link to comment https://forums.phpfreaks.com/topic/262617-image-upload-system-moderation-method/ Share on other sites More sharing options...
litebearer Posted May 16, 2012 Share Posted May 16, 2012 Perhaps let the "REGISTERED" users upload the pics via form. db table id, image_name, user_id, approved. set approved to 0 for NOT approved yet. When user uploads pic, move to folder, add to db, send email to Admin that image has been uploaded. THEN when Admin reviews the unapproved images she/he can either delete the image or change approved to 1. When displaying the pics, set filter to only show pics where approved = 1. Quote Link to comment https://forums.phpfreaks.com/topic/262617-image-upload-system-moderation-method/#findComment-1345958 Share on other sites More sharing options...
Jessica Posted May 16, 2012 Share Posted May 16, 2012 You should save images in the file system, and only save the file name and location in the database. You could also allow them to upload the image, and have a web interface for your admins to approve/reject. Rejected ones get deleted from filesystem and DB. Approved ones get a flag to be shown on the site. Quote Link to comment https://forums.phpfreaks.com/topic/262617-image-upload-system-moderation-method/#findComment-1345960 Share on other sites More sharing options...
angelali Posted May 16, 2012 Author Share Posted May 16, 2012 Move the images to a folder, but, if an image has the same name, how will I know? as if i store the images in folder, only the image will be stored... And secondly, how to add images manually in database if you know please...on PHPMyAdmin.. thank Quote Link to comment https://forums.phpfreaks.com/topic/262617-image-upload-system-moderation-method/#findComment-1345961 Share on other sites More sharing options...
Jessica Posted May 16, 2012 Share Posted May 16, 2012 Typically you would append something to the name to make it unique, such as the time(). AFAIK you cannot put images into a database using phpMyAdmin, which is a good thing. Images should not be stored in a DB. Quote Link to comment https://forums.phpfreaks.com/topic/262617-image-upload-system-moderation-method/#findComment-1345964 Share on other sites More sharing options...
angelali Posted May 16, 2012 Author Share Posted May 16, 2012 Well, well, well, I have to choose a real solution, me too I didnt want to store database in DB....but I think I have to, as people can search these images, there will be also categories of images like Technology, Abstract etc... Quote Link to comment https://forums.phpfreaks.com/topic/262617-image-upload-system-moderation-method/#findComment-1345966 Share on other sites More sharing options...
mrMarcus Posted May 16, 2012 Share Posted May 16, 2012 Do as what has been said. My only input is to acknowledge the possibility of copyrighted images, and not only adult material. Being a "host" of any material can be a risky business. Quote Link to comment https://forums.phpfreaks.com/topic/262617-image-upload-system-moderation-method/#findComment-1345967 Share on other sites More sharing options...
angelali Posted May 16, 2012 Author Share Posted May 16, 2012 In fact myself I would not be able to determine if an image is copyrighted or not, so my conditions will be clear on the site, I am not responsible if the person has uploaded a copyrighted image...but for adult content, I should moderate... Quote Link to comment https://forums.phpfreaks.com/topic/262617-image-upload-system-moderation-method/#findComment-1345968 Share on other sites More sharing options...
mrMarcus Posted May 16, 2012 Share Posted May 16, 2012 In fact myself I would not be able to determine if an image is copyrighted or not, so my conditions will be clear on the site, I am not responsible if the person has uploaded a copyrighted image...but for adult content, I should moderate... Wonder how Kim Dotcom would respond to that? I'm sure you'll be enough under the radar that it won't matter. But ya, scratch the idea of receiving images via email and having to insert manually and do as was suggested with a backend control panel where images can be moderated more efficiently. As for filenames, I generally hash the filename with time(): $filename = md5($_POST['image'] . time()); So as to avoid improper filenames (unwanted wording, spaces in filename, etc). Then just store that in a table. Also, you can, but is not entirely necessary (all depending on expected growth of site and knowledge of file/directory handling), create folders for each user and store their images in there (assuming a user must be registered to upload an image). But hashing will suffice, I'm sure. Never store the path of the file in the table. Simply the filename, as directories/folders can be changed over time, and you don't want to have to update every file in the table. Quote Link to comment https://forums.phpfreaks.com/topic/262617-image-upload-system-moderation-method/#findComment-1345971 Share on other sites More sharing options...
angelali Posted May 16, 2012 Author Share Posted May 16, 2012 Oh no, now you are making me afraid when you mentioned Megaupload's owner.. :'( Well, if like this, we will decide if we are going to cancel the project of image hosting and gallery...or simply, we can make a simple website where user will just upload an image, store it in the folder like a boss and give the user his links, embed codes etc... But wait, what to create in the place of the image website if it is going to cancel? Ok, we will think of a website directory... Quote Link to comment https://forums.phpfreaks.com/topic/262617-image-upload-system-moderation-method/#findComment-1345974 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.