Module: Upload Approval Queue
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
ADMIN EDIT: MODULE TEST FOUND HERE If you can develop a module, I'll pay you for it. The catch is that I need it within a month. Reply with you can do it. Thanks, Chris |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
What exactly are you looking for? There is also a forum for requests like these as well - Services |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
I need to make all uploads go into an approval queue before they are visible in the album. I don't mind posting it in the other forum, but do you do module development? Is this something you could do? |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
I think you may be able to accomplish this with a hidden album that has 'add' for everyone, but not 'view' except for admin. Then you could use the 'organize' module to move the approved photos to the appropriate album. I remember seeing a suggestion of something like this before, I'll have to dig around and see if I can find it. |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
I played around with that, but it frustrated a lot of people. Uploads are available to the general public. Maybe I didn't do it "right"? It has to be as simple as clicking "Upload", finding their file, and then clicking "Submit". Once I start asking them to upload to one album but show pictures in another... they will just get frustrated. |
|
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
To get this right a very detailed use story is needed. Dave |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
I thought it was pretty descriptive, but I'll try to be more specific... There may be a better way to do this than what I spec out here. Someone registers on the site. They then upload a photo. Perhaps they can see their photo, perhaps they just get a message saying their photo will be available once it has been approved. Either works fine for what we're doing. In the admin interface, there is a page with all the recent uploads that are awaiting admin approval. Next to each photo is a button/checkbox/whatever to either approve or reject the photo. An admin goes through and determines what gets approved and what gets rejected. Approved photos go into the public album for anyone and everyone to see. Rejected photos can either be deleted or put into a private folder only admins can see. The goal of this is to eliminate pornographic content on what is a family friendly image gallery. The last time I turned the site on, it got a lot of traffic. I can't have pornographic content visible on there. |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Let's start the dialog then: Module thought process: 1) Disable uploads to the public Further notes: 1) 'Add' must -not- be enabled for 'live albums' to the registered users |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
That sounds like the right approach to me. Users MUST register to upload. There should only be one album that users can see, whether they log in or not, and that is the album that contains the approved images. If there needs to be different albums to make the approval process work, that's perfectly fine as long as there is no option for people to click on an album and "get lost". It seems ridiculous, but it has happened. |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Just about done with the framework... The module will provide a sidebar block that will have an 'upload for approval' button that will allow the user to select the photo(s) they want to upload Does this sound about right and makes sense? |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
That sounds great! I'm anxious to see the first beta and give it a test run!! |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
I think I have everything wrapped up for the initial release... All admin/install stuff completed... Testing out final and should release tomorrow. Sample screenshots to follow |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
That's great news! I look forward to testing it out! |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
Epic! That looks great!!! This will be a huge help! |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Give it a shot, remember, this is -initial- (If anyone looks at the code, I hope your eyes bleed! I joke... remember, I'm not a coder!) |
|
punctuation
Joined: 2012-12-11
Posts: 37 |
![]() |
Suggestion to add input fields for title, description, tags before upload. And input field for comment/message to the admin. ____________________________ |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Good suggestions. I'll see what I can do for the next update, once this gets tested a bit and confirmed working well. |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
I got it installed and running. It looks great! The only issue I have is that, as a regular user, I can't seem to get the upload window. As admin, it pops up and everything is fine. Maybe I'm doing something wrong? |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Good catch - fix will be up in a sec, along with some minor changes. Added ability to add description and comment for admin on upload form (tags may come later, but I don't want to redo the form (which I have to) right now until all is tested) |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
I got v2, but still can't get the upload for regular users. I can see the extra fields when I upload as an admin. Those are great!! |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Okay, v2 uploaded give this a shot |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Digitizit wrote:
I got v2, but still can't get the upload for regular users. I can see the extra fields when I upload as an admin. Those are great!! I jumped the gun - look up and get the v2 there... |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
The link to upload has not completely disappeared for regular users. Admin can still see it and it still seems to work. |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Hmmm, hold one... Think I may have missed something |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
Right. As an admin, I see it all. If I open a different browser and log in as a normal user, I don't see the upload link. I did see it with v1, but when I clicked it, it never gave me the upload window. |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Allrighty, let's give this a try: |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
That worked! I can now see it as a regular user and the link opens the upload dialog. The upload worked, but the dialog box did not close. That's not the biggest deal, but I think it will confuse people. |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
Also, I just noticed, when I approve the photo, the dialog box that comes up is blank. I assume I can just move the photo from that album into the main, which isn't a problem. |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
Ah, okay... I see what has happened on the upload. It actually wants to download the .json file that says "success" after it successfully uploads. Also, the admin approval appears to be working now. I must have had something stuck in cache. |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Hmmm, shouldn't be blank, and no, don't just move it... it will confuse the database later On both dialogs it's not returning to the album? And on the approval dialog, it's blank? What browser are you using? I can't reproduce this. |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
Sorry, I posted that before really trying everything on my side. I got the approval working. It does everything it should. It's great!!! That worked beautifully. The only issue I can't get around yet is Chrome (and IE) prompting to save the .json file that is the success message. |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Hmmm, I can't reproduce that in IE or Chrome. Once uploaded, it refreshes back to the album with a success message up top saying "Added One photo for approval." I've tested in Safari, Firefox, IE and Chrome. (The success json is just like all other dialogs, so I'm not sure why that's happening to you) If you're familiar with the database, try emptying the 'caches' table... Also, have you turned on error_reporting? If you don't know the answer, don't worry about it. |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
Perfect! That did the trick! This is REALLY going to help out. Amazing work! |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Good to hear! Please keep me posted on it's use and effectiveness... I sort of rushed out some things in this, and it's ugly, ugly code... I'll spend more time refining it once I know it's working well. Thanks!
|
|
punctuation
Joined: 2012-12-11
Posts: 37 |
![]() |
I tested the module today. It' not working for me. Have same problems as Digitizit mentioned: Do we need to specify Album where will approved photos go? While it was still working, when I go to Approval-queue album and click on a photo, title and description doesn't show up. Same for comment for admin. ____________________________ |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Make sure you grabbed the latest version a few posts up (v3) I'm not able to reproduce any of the issues you've mentioned. If you're logged in as admin, and there is an issue with any of the settings, it will automatically take you to the admin page to have them fixed for you. If you're using v3, try emptying the cache table in the database. For some reason it seems if you had an older version installed, it cached those pages and doesn't pull the new ones. |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
One thing I had to do, and it could just have been me, was toggle the permissions off and on again. I did that first thing, and everything after that was good. |
|
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
jnash wrote:
http://codex.galleryproject.org/Gallery3:Modules:approval_queue Dave _____________________________________________ |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
floridave wrote:
Thank you kind sir! |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
v4 uploaded - only to fix an initial install bug fix. No need to upgrade if you have it installed already... |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Found an issue with permissions settings on some installs - reworking and will send up new version soon. |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
okay, v5 - initial release If you've installed this previously, you should upgrade for sure to this version... |
|
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
Finally got round to looking at this. When I tried to activate the module (5) for the first time I got a error and the checkbox on the modules page would not stick. $db = Database::instance(); $table = "appqs"; $query = "SHOW TABLES LIKE 'appqs'"; $result = $db->query($query)->count(); if(empty($result)) { message::error("ERR [approvalqueue]: APPQ database does not exist!"); if(identity::active_user()->admin){ url::redirect("admin/approvalqueue"); } else { return "ERROR"; } } is the culprit as I removed it and the module activated properly. The table was already created so I don't know why this bit of code did not see the table that was created. Anyway I have no time to test further at this time. Dave |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
I see the same issue. I didn't remove any code, though. I'll await further investigation. Nash, did you get my PM? |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
I think I might know why this is... Do you guys have table prefixes on in Gallery? if so, I can add the table prefix code in to the query... (I keep forgetting about the table prefixes) |
|
Digitizit
Joined: 2013-07-05
Posts: 29 |
![]() |
I do. |
|
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
Quote:
Do you guys have table prefixes on in Gallery? Yes. Dave_____________________________________________ |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Okay, working it. Trying to figure out what boo boo I made on the upload right now... New version coming soon. |
|
jnash
![]()
Joined: 2004-08-02
Posts: 814 |
![]() |
Okay, v6 now up. Think I have those two pesky bugs worked out... 1) I fixed the appq db search to account for table prefixes |
|
punctuation
Joined: 2012-12-11
Posts: 37 |
![]() |
Module is working great. "For speed, code complexity, upgrade-ability and other considerations, we went with a per album permissions approach and not a per item. Dave" "If you want/need to keep that same structure, you'll need to stick with G2 for now. Keep an eye on G3, the permissions system is in for big changes for 3.1 ____________________________ |
|