Moderation Module
j0yst1ck
Joined: 2006-04-20
Posts: 6 |
Posted: Thu, 2006-04-20 22:17 |
Hi all, I have a gallery where users can register, create an album and upload images. I looked for a module that would permit me to preview items before they appeared on the page (for every user), but I found nothing. I wrote one myself for Gallery 2 (well, very simple I think... I've not completely figured out Gallery 2 coding structure, I used another one as a start) and I would like to share it with the community, but I don't know how... Could you give me some hint? Sorry if I posted to the wrong Forum, or if the module was alredy developed and I didn't find it, but I'm quite new to Gallery... Bye ------------------------------------------- My Gallery : www.facceitaliane.it |
|
Posts: 132
Sound like a great addon. I would love to have something like that and possibly improve upon it. IE: Optionally preview depends on which album they upload it to. Etc.
Can you post a zip file of the code you modified? I'm not sure how the official way is to submit module, but I think all you need is to post it here and let us try it out for a start.
Posts: 6
Ok, thank you for your answer.
I attached a small .tar.gz file to this post, it contains the whole subdir of the module: just place it in your modules/ directory and use "install -> activate" from Administration Page.
It's based upon Quotas Module, so you'll easily find some references (as well as some original comments... sorry).
I don't know how Gallery Database/Structure works, so if someone could please help... ;)
By now to use you need to manually create a table in your gallery2 database; table structure follows:
CREATE TABLE `ToApprove` (
`g_id` varchar(11) NOT NULL default '',
`ownerid` varchar(11) NOT NULL default '',
PRIMARY KEY (`g_id`)
) TYPE=MyISAM;
HOW THE MODULE WORKS:
It's quite simple: when a user uploads a file, the module removes any permission to view it. Only the admin has this ability. The admin page shows elements in "ToApprove" table and you have to take an action: if approved, permission are restored; otherwise the item is deleted. In either case the element is removed from "ToApprove" table.
Also, if a user removes the last item in his root album, the module hides the album itself (well, I think it... never tested quite well... ;) ).
And what if you want a newly registered user not to show his empty root album (if it has been just created, it would be obviously empty)? My solution was to modify UserAlbumHelper.class in modules/useralbum/ but I'm not sure it was a good solution... Just if you're interested, I removed the ability for the user to edit item permssions and commented out "$viewPermissions..." section to hide the item from public view.
Moderation Module will restore public view permissions on first album's item approve.
The module lacks configuration (e.g.: admin should be able to define his own permissions... etc...)...
Just try it if you are interested and feel free to improve it!
Bye
------------------------------------------
My Gallery : www.facceitaliane.it
Posts: 32509
very nice
how do you differentiate items with no public permissions from "pending items"?
i mean, if you remove all permissions, it's just an item without permissions. but you can't really tell if it's a pending item that needs approval or if the item is actually just non-public / for the admin only.
Posts: 35
hi, i update the module for the blackjack release 2.1
Now the plugin function, if there are a problem, contact me :
Posts: 6
Hi, nice to see that someone is interested in this module ;)
valiant, I use a table stored into database that records items as soon as they are uploaded. Then they will show up in admin page and you can approve/decline each one of them. Your action will modify permissions for the item and will remove it from "ToApprove" table in database.
If you are not satisfied with my answer, feel free to ask ;)
Also many thanks to youpi for his update.
Bye
---------------------------------------------------------------
My Gallery : www.facceitaliane.it
Posts: 35
yes it's marvelous plugin, i will be happy when someone help me to update the module tagg
In the next release it would be great if we can :
- display the name of album where upload picture
- create a template after upload to indicate for user that their picture is pending and after validate by the admin
- get a confirmation by mail when the picture has been validating
Posts: 7
Hi,
I tried to use moderate Mod and I get
Fatal error: Undefined class name 'gallerystatus' in /home/b2l1850/public_html/gallery/modules/moderate/module.inc on line 67
and line 67 is :
return array(GalleryStatus::success(), true);
Please What am I doing worng??
Peace And LOVE
Posts: 20
Anyone working on or supporting this mod?
Posts: 2
mmm this mod is just what im searching
let get test it
Posts: 11
Please give your feedback if your done testing, like to know it. Thanks in advance.
Posts: 7
Recieve same error as above.
Fatal error: Undefined class name 'gallerystatus' in ...gallery2/modules/moderate/module.inc on line 67
This is the line it's referring to.
return array(GalleryStatus::success(), true);
Does anyone know a fix?
Posts: 7
I was able to getthis fixed. I replaced this code return array(GalleryStatus::success(), with this
return array(GalleryStatus::success(), I'm not sure of the difference, but I copied this snippet from the dev tutorial. and it worked... maybe just a coincidence.
Posts: 2
That looks like the exact same code...
did you leave the "true" at the end of that line?
Posts: 3
I fixed this by replacing the offending code with
return array(null, true);
Then after creating the needed table using the sql given earlier in this thread everything was working great.
Have have noticed a bug which needs fixing though.
When I post a picture using the admin account it appears in the album immediately which is correct.
However it is also appearing on the moderate list in the admin pannel, even though it is already showing in the gallery.
I think all admin posts should be displayed without any moderation.
--
To allow you to view my comments and ideas in perspective you should know that my gallery has:
No registered users
I add all pictures using the admin account
Guests can only post to an album called public
Once a guest has added a pic they cannot do anything else to it, ie delete
I am testing this mod on my local machine so these changes will not show on my website (for a while)
http://www.kraftwrk.com/gallery2
Posts: 3
I have now fixed the issue with where the admins postings needed moderating.
Add the following code to ModerateOption.inc at line 58 (or download the attached file)
/**
* @if the current user is admin do not start the moderation process, just return so the pic
* @is added to the gallery immediately
*/
list ($ret, $isAdmin) = GalleryCoreApi::isUserInSiteAdminGroup();
if ($isAdmin) {
return array(null, $errors, $warnings);
}
After testing how ever I have found a problem with the permissions assigned to the images after being accepted by the moderator. (This does however is not due to my new code.)
My album allows guests (anyone) to post pictures, hence the need to moderating, but only the admin should be able to perform other actions such as delete. Pictures that have been added using the moderate module allow guests to perform any action on any other moderated guest added picture, which is not good.
Any ideas? I will start investigating this myself as well though.
Posts: 3
So that users are aware of their posts not showing until they have been approved I have added the following to
modules\core\templates\ItemAddConfirmation.tpl at line 15, so the original message plus my extra text is displayed.
{if $user.isAdmin == false}
<br />
{g->text one="Your image will need to be approved before it will be publically displayed, this should take around 24 hours."
many="Your images will need to be approved before they will be publically displayed, this should take around 24 hours."
count=$ItemAddConfirmation.count arg1=$ItemAddConfirmation.count}
{/if}
Posts: 5
Thank you so much. This is precisely what I need for a weather photo gallery I'm building for the TV station where I work.
For some reason, I'm getting a 403 "Forbidden" error on KiNgFrUiT's file attachment (ItemAddConfirmation.tpl). If a moderator or webmaster sees this, could you fix it? Thanks!
Posts: 5
Hmm... now I'm having a bit of trouble. Whenever a user submits a photo, they get this error:
I'm running Gallery 2.1.1 and youpi's version of this for Gallery 2.1.
Line 124 of GalleryPhpVm.class is: return header($string, $replace);
ModerateOption.inc is 117 lines long (no kidding), so I have no idea what the 118 means. I'm pretty new at PHP, so any help would be greatly appreciated.
Posts: 8601
attachment above is fixed.
Posts: 1023
I've just added a Rewrite rule to module.inc to make it simple to reach the moderation page
but something doesn't work, the commit button is not functional... only if I go to the admin pages directly... where s' my error?
See you!
Lutz
Gallery version = 2.2-svn core 1.1.15
PHP version = 5.1.4 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.4 mod_ssl/2.2.2 OpenSSL/0.9.8b
Database = mysql 5.0.22-log,
Theme=PGtheme,
Gallery-URL=http://lf-photodesign.de
Posts: 1023
any idea?
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.4 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.4 mod_ssl/2.2.2 OpenSSL/0.9.8b
Database = mysql 5.0.22-log,
Theme=PGtheme,
Gallery-URL=http://lf-photodesign.de
Posts: 8601
should it be 'view' => 'core.SiteAdmin', 'subView' => 'moderate.AdminModeration' ?
(just a guess, i haven't used this module)
Posts: 1023
oops - that seems to make sense... I completly missed the sub_view-thing, Many Thanks !
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.4 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.4 mod_ssl/2.2.2 OpenSSL/0.9.8b
Database = mysql 5.0.22-log,
Theme=PGtheme,
Gallery-URL=http://lf-photodesign.de
Posts: 5
Nice
Posts: 2
Thanks for the module.
It would be useful if the user could view and even edit his own uploaded images still unmoderated.
Posts: 1
I thought for the sake of simplicity I'd make most of the changes here and upload the bundle for those aren't comfortable editing things themselves. The only change I haven't made to this bundle was the re-write rule and that's because I'm familiar enough with where things go to do it. I've also not added anything to execute the SQL script needed to generate the table. With all the GUI managers for MySQL around, it shouldn't be that hard to do.
DISCLAIMER: I wrote none of this. I take no credit and no responsibility for any of it ;)
Posts: 9
Great module.
I've just implemented recentcoin bundled version and it is working without problems.
Although anyone using the bundle still needs to follow KiNgFrUiT advice and edit the ItemAddConfirmation.tpl file.
I do have a question. When a user uploads a file the photo is owned by the user, but the user in question has no permissions to see and edit the photo before acceptance by admin. This is a problem as I want users to be able to edit the custom fields at time of upload. Is there anyway the module can be modified to give the user "all access user permissions" to their image on upload.
Thanks
Posts: 33
Is there a way that I can have:
When approving the images; I want to show the original uploader instead of Admin/founder (me) being the owner?
Also, when approving, is there a way I can select which album I want it to go in instead of approving then moving the image?
Thanks for the help, I'm falling in loave with this
Posts: 33
Anyone care to help me out with this one?
Posts: 33
Anyone?
Posts: 2
YOOOOUUU.... YOOOOUUUUU...
YOU Guys are the Masters of my Desaster. Thank you for this GREAT Application...
D.C.
Posts: 5
Would be useful to be able to have an email sent to the administrator when there are new images to moderate.
Any idea how this could be implemented?
Thanks
Posts: 4
hey all,
i have been looking for a script like gallery for about a year now. i can finally make the webpage i've been wanting to make but didn't know how. it's nearly perfect to what i want and looks very easy to add features i do want. i was VERY happy to come across this module. moderation of images is something i realy wanted. i installed recentcoin's package of the mod with kingfuits ItemAddConfirmation.tpl. the install went well and had no errors. but when i tried to find the toapprove page it took a bit of looking to find it. i'm still getting use to the interface. not realy how i would have designed it, but as i'm very lazy, i would never finish it if i even started such a script. so for future users of this mod, the toapprove is in...
site admin > gallery > moderate
seems simple unless your looking for something called "toapprove". so it works well as is, but i would like one feature added. I want other moderators be able to approve images for the albums i've assigned them. i plan on haveing well over 50 albums with many many many subalbums. i don't want to approve EVERY image. but i also don't want to share full admin ability just to have assigned owners for albums be able to apporve images that were submited to their album. some trusted users will of course be giving full access to albums, but i want a way to have any one submit, but have a way of filtering content.
also, i would also like the email ablity. email the administrator and the album owner would be good.
any help with either of these would be great. thanks!
Posts: 12
I'm hoping to make the permissions for approved images the same as the default settings for the album they are uploaded to. Or just pre-define permissions:
- "Everyone" can view all sizes, view comments, view ratings,
- "Registered Users" can view all, add comments and add ratings.
- "Owner" has no specific permissions.
- "Admins" have all access.
Can anyone help with how to hack the module to make these permissions possible?
Posts: 1
Thanks for this module.
I have changed it so the item description(caption) is displayed as well on the moderation page, and bad words are highlighted to facilitate easier moderation. All you need to do is to add the bad words.
Here are the changes:
AdminModeration.inc ~line 249
AdminModeration.tpl ~line 11
Posts: 51
This all great stuff...
Can anyone hack this to do the same trick with comments? Please?
Posts: 51
Can anyone think of a way to email the user when their photo is approved?
Posts: 4
Yes, email when a photo is submited is needed!!
also, i did not relize this at 1st, but this moderates EVERY BOBY! any one know how to mod the script so that users with permissions to an album can upload with out moderation?
also still looking for a way other users can be added as moderators with out being added as site admins.
thanks.
Posts: 51
Email when submitted is easy, look in the forums, but email when approved is what I need!
Posts: 4
i'm not very comfortable yet editing this script my self. did you already mod it to email the admins when there needs an approval? if so can you reupload that version here?
Posts: 51
Can someone point out where in the code the approval of the images takes place so I can inject a little email on approval function? This module is pretty sparse on the comments and I'd like to extend it to email the users when their item is approved.
It's some where in AdminModeration...but WHERE!!!!!
Posts: 14
Was there ever a fix for this
Fatal error: Undefined class name 'gallerystatus' in /mnt/Target01/328594/www.vgrealms.com/web/content/modules/gallery2/modules/moderate/module.inc on line 67
?
Also, is it supposed to show the thumbnail in the Moderate admin section, or just the Pid? All I see is the Pid and the approve and delete check boxes. The module works, but it just seems pointless if you can't see the picture.
Posts: 4
when any of my users try to upload to a location they are not allowed to or a photo that has an issue, it just shows as a pid. i have to delete it and have the upload properly. when the files are uploaded right, it works great. just need a few more features added to it.
Posts: 14
I just had to move my whole website to a different server. So I reinstalled gallery to a new DB and went for the Full version this time since it already has things like moderate installed for me. Anyway, now when I try to delete just 1 photo, I get this error
Fatal error: Call to a member function on a non-object in /home/******/public_html/modules/mGallery2/gallery2/modules/moderate/module.inc on line 144
but if I delete 2 or more, it works fine. I've tried to reupload the whole moderate module but nothing is working. I've also tried to reup my old version of moderate from my old website and it still does this. Any suggestions?
Posts: 5
Does this module work with the latest version of gallery? I am really looking to use this module but it doesn't seem to work at all for me.
-----------------------------------
Never mind it works great! I was still logged in as admin when i tried adding a picture. I Will post a picture of the final product when i am done!
Posts: 1
Hi! I am new to Gallery and to this forum. I did try to install the Moderate module on my Gallery 2.2 web site (by uploading the moderate folder in my modules folder, permissions are 755 everywhere) and while i see the module in the list, clicking "install" does nothing. Do I have to make something else to make it work (changing the database...)? Thank you for your help. I am very impress by the power of Gallery and its modules, I really need this module to be able to use Gallery for a new project.
Posts: 56
I don't think this module works in the latest version, which is sad, cause I'd also like to use it
--
South African Webhosting & Domain Registrations
Website: http://www.SoftDux.com
Forum: http://Forum.SoftDux.com
Posts: 8601
Attached is an updated but untested new version of moderate module.
Hope this helps..
Posts: 37
Receiving following, please help:
Posts: 8601
sorry, I used the new format for schema.tpl that doesn't work with gallery 2.1.x. download the attachment above again, I think I have it using the old style now, so it should work for G2.1.x and 2.2.x.