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

 
Eka_Mei

Joined: 2006-01-03
Posts: 132
Posted: Thu, 2006-04-20 22:47

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.

 
j0yst1ck

Joined: 2006-04-20
Posts: 6
Posted: Fri, 2006-04-21 11:27

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

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2006-04-30 10:24

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.

 
youpi

Joined: 2005-06-17
Posts: 35
Posted: Wed, 2006-05-03 09:28

hi, i update the module for the blackjack release 2.1

Now the plugin function, if there are a problem, contact me :

 
j0yst1ck

Joined: 2006-04-20
Posts: 6
Posted: Wed, 2006-05-03 21:20

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

 
youpi

Joined: 2005-06-17
Posts: 35
Posted: Thu, 2006-05-04 14:37

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

 
nickypoo

Joined: 2006-06-16
Posts: 7
Posted: Fri, 2006-06-16 10:57

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

 
majorxp

Joined: 2006-05-08
Posts: 20
Posted: Tue, 2006-06-27 20:25

Anyone working on or supporting this mod?

 
voodooetc

Joined: 2006-07-02
Posts: 2
Posted: Sun, 2006-07-02 20:45

mmm this mod is just what im searching

let get test it

 
photopix

Joined: 2006-04-28
Posts: 11
Posted: Sun, 2006-07-02 21:47
Quote:
mmm this mod is just what im searching

let get test it

Please give your feedback if your done testing, like to know it. Thanks in advance.

 
Hythshade

Joined: 2006-05-31
Posts: 7
Posted: Fri, 2006-07-07 05:29

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?

 
Hythshade

Joined: 2006-05-31
Posts: 7
Posted: Fri, 2006-07-07 05:32

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.

 
stodd

Joined: 2006-07-14
Posts: 2
Posted: Sat, 2006-07-15 18:35

That looks like the exact same code...

did you leave the "true" at the end of that line?

 
KiNgFrUiT

Joined: 2006-07-16
Posts: 3
Posted: Mon, 2006-07-17 17:44

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

 
KiNgFrUiT

Joined: 2006-07-16
Posts: 3
Posted: Thu, 2006-07-20 16:37

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.

 
KiNgFrUiT

Joined: 2006-07-16
Posts: 3
Posted: Thu, 2006-07-20 16:38

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}

 
tdukart

Joined: 2006-08-10
Posts: 5
Posted: Thu, 2006-08-10 22:34

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!

 
tdukart

Joined: 2006-08-10
Posts: 5
Posted: Fri, 2006-08-11 00:36

Hmm... now I'm having a bit of trouble. Whenever a user submits a photo, they get this error:

Quote:
Warning: Cannot modify header information - headers already sent by (output started at /<path-to-gallery>/modules/moderate/ModerateOption.inc:118) in /<path-to-gallery>/modules/core/classes/GalleryPhpVm.class on line 124

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.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-08-17 06:09

attachment above is fixed.

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Sun, 2006-08-20 09:18

I've just added a Rewrite rule to module.inc to make it simple to reach the moderation page

    
    /**
     * @see GalleryModule::getRewriteRules
     */
    function getRewriteRules() {
		return array(
		array('comment' => $this->translate('Moderate'),
		      'match' => array('view' => 'moderate.AdminModeration'),
		      'pattern' => 'moderate',
		      'help' => $this->translate('Open Moderation Page to approve or reject new Items uploaded to the Gallery'),
		    ));
    }

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

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Thu, 2006-08-31 06:31

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

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-08-31 21:29

should it be 'view' => 'core.SiteAdmin', 'subView' => 'moderate.AdminModeration' ?
(just a guess, i haven't used this module)

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Fri, 2006-09-01 05:51

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

 
chacness

Joined: 2005-11-19
Posts: 5
Posted: Thu, 2006-09-21 18:33

Nice

 
juliusbarra

Joined: 2006-10-07
Posts: 2
Posted: Tue, 2006-10-24 09:58

Thanks for the module.
It would be useful if the user could view and even edit his own uploaded images still unmoderated.

 
recentcoin

Joined: 2006-11-07
Posts: 1
Posted: Tue, 2006-11-07 18:45

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 ;)

 
TransportImages
TransportImages's picture

Joined: 2005-08-28
Posts: 9
Posted: Sun, 2006-11-26 21:08

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

 
tink0509

Joined: 2006-12-18
Posts: 33
Posted: Tue, 2006-12-19 17:19

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 :)

 
tink0509

Joined: 2006-12-18
Posts: 33
Posted: Thu, 2006-12-21 14:11
tink0509 wrote:
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 :)

Anyone care to help me out with this one?

 
tink0509

Joined: 2006-12-18
Posts: 33
Posted: Tue, 2007-01-09 13:25
tink0509 wrote:
tink0509 wrote:
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 :)

Anyone care to help me out with this one?

Anyone? :(

 
dachilla

Joined: 2007-01-16
Posts: 2
Posted: Tue, 2007-01-16 21:56

YOOOOUUU.... YOOOOUUUUU...

YOU Guys are the Masters of my Desaster. Thank you for this GREAT Application...

D.C.

 
musicalone

Joined: 2005-09-08
Posts: 5
Posted: Wed, 2007-01-24 10:48

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

 
blastedbill

Joined: 2007-01-29
Posts: 4
Posted: Thu, 2007-02-01 17:07

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!

 
meisay

Joined: 2007-01-02
Posts: 12
Posted: Tue, 2007-02-06 09:16

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?

 
nikola99
nikola99's picture

Joined: 2007-02-09
Posts: 1
Posted: Fri, 2007-02-09 19:32

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

$i = 0;
while ($t1row= mysql_fetch_array($t1result))
{
	$images[$i]["id"] = $t1row[0]; //this has been changed so now each "image" contains an array of 2 elements id and description
	
	/*Load Entity (photo) */
	list ($ret, $item) = GalleryCoreApi::loadEntitiesById($t1row[0]);
	if ($ret) {
		return array($ret->wrap(__FILE__, __LINE__), null);
	}
	$images[$i]["description"] = $item->getDescription();
	
	$dirtyWords = array("badWord1", "badWord2");
	$dirtyCount = count($dirtyWords);
	
	/*Highlight bad words*/
	for($j=0; $j < $dirtyCount; $j++)
	{
		preg_match ("/([[:alpha:]]*)($dirtyWords[$j])([[:alpha:]]*)/i", $images[$i]["description"], $matches);
		
		if($matches[0] != "")
		$images[$i]["description"] = eregi_replace("([[:alpha:]]*)($dirtyWords[$j])(.*)", "\\1<span style='background-color: yellow; color:red; font-weight: bold;'>\\2</span>\\3", $images[$i]["description"]);
	}
	
	$i++;
}

AdminModeration.tpl ~line 11

<div class="gbBlock">	
	{if (count($images) > 0)}
	<p class="giDescription" style="font-size:small">
		{g->text text="Below you have items not yet approved. Pick Approve or Delete for each one and then click Commit Actions."}
	</p>
<table width="99%" align="center" cellspacing="6">
		{assign var="imagesCont" value=1}
		{assign var="indexCount" value=1}
		{foreach from=$images item=timg}

			{assign var="imageId" value=$timg.id}
			{assign var="imageDescription" value=$timg.description}
			
			{if $imagesCont == 1}
				<tr>
			{/if}

			<td width="25%" align="center" style="border: 1px solid #dedede">
				<p>Item Id: {$imageId}</p>
				<p class="giDescription">
					Description: {$imageDescription}
                </p>
				{g->block type="imageblock.ImageBlock" blocks="specificItem" showDate=1 showOwner=1 showViews=0 showTitle=1 showHeading=1 useDefaults=0 itemId=$imageId linkTarget="_blank"} 
				<p style="text-align: left; margin: auto; width: 65px">
					<input type="checkbox" name="{g->formVar var="form[approved][]}" value="{$imageId}">Approve<br />
					<input type="checkbox" name="{g->formVar var="form[deleted][]}" value="{$imageId}">Delete
				</p>
				
			</td>
			
			{assign var="imagesCont" value="`$imagesCont+1`"}
			{assign var="indexCount" value="`$indexCount+1`"}
			{if $imagesCont == 5}
				{assign var="imagesCont" value=1}
				</tr>
			{/if}
			
		{/foreach}
		{if $imagesCont <> 5}
			{assign var="imagesCont" value=1}
			</tr>
		{/if}
	<tr>
		<td colspan="3" align="center">
			<p><br>
			<input type="submit" name="{g->formVar var="form[action][commit]"}" class="inputTypeSubmit" value="Commit Actions">
		</td>
	</tr>
</table>
	{else}
	<p class="giDescription" style="font-size:small">
		{g->text text="There are no images that need moderation."}
	</p>
	{/if}

</div>
 
dopesauce
dopesauce's picture

Joined: 2007-01-29
Posts: 51
Posted: Fri, 2007-02-16 04:10

This all great stuff...

Can anyone hack this to do the same trick with comments? Please?

 
dopesauce
dopesauce's picture

Joined: 2007-01-29
Posts: 51
Posted: Mon, 2007-02-19 04:25

Can anyone think of a way to email the user when their photo is approved?

 
blastedbill

Joined: 2007-01-29
Posts: 4
Posted: Sun, 2007-02-25 14:28

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.

 
dopesauce
dopesauce's picture

Joined: 2007-01-29
Posts: 51
Posted: Tue, 2007-02-27 03:45

Email when submitted is easy, look in the forums, but email when approved is what I need!

 
blastedbill

Joined: 2007-01-29
Posts: 4
Posted: Wed, 2007-02-28 04:41

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?

 
dopesauce
dopesauce's picture

Joined: 2007-01-29
Posts: 51
Posted: Tue, 2007-03-06 01:13

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!!!!!

 
norsejeff

Joined: 2007-03-06
Posts: 14
Posted: Sat, 2007-03-10 06:57

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.

 
blastedbill

Joined: 2007-01-29
Posts: 4
Posted: Sun, 2007-03-11 05:48

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.

 
norsejeff

Joined: 2007-03-06
Posts: 14
Posted: Thu, 2007-03-15 18:36

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?

 
poil11

Joined: 2005-10-24
Posts: 5
Posted: Sun, 2007-03-25 19:06

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!

 
flongpre

Joined: 2007-03-28
Posts: 1
Posted: Wed, 2007-03-28 18:00

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.

 
SoftDux
SoftDux's picture

Joined: 2007-03-27
Posts: 56
Posted: Sat, 2007-04-07 21:09
flongpre wrote:
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.

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

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2007-04-07 22:39

Attached is an updated but untested new version of moderate module.

  • I did some cleanup and fixed a few errors.
  • The original code required you to create your own database table and worked only with mysql. Now it uses the G2 database API so the table is created for you and works with all our supported databases.
  • The admin view still references imageblock module, so thumbnails only appear in that view if imageblock is active.

Hope this helps..

 
chaosdax

Joined: 2005-12-27
Posts: 37
Posted: Mon, 2007-04-09 00:40

Receiving following, please help:

Quote:
Error Detail -
Error (ERROR_STORAGE_FAILURE) : Error trying to run query: CREATE TABLE g2_ModerateMap( g_itemId int(11) NOT NULL, g_ownerId int(11) NOT NULL, PRIMARY KEY(g_itemId) ) MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */
in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1528 (gallerycoreapi::error)
in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1280 (gallerystorageextras::_executesql)
in modules/core/classes/GalleryStorage.class at line 625 (gallerystorageextras::configurestore)
in modules/core/classes/GalleryModule.class at line 144 (mysqlstorage::configurestore)
in modules/core/AdminModules.inc at line 64 (moderatemodule::installorupgrade)
in main.php at line 199 (adminmodulescontroller::handlerequest)
in main.php at line 87
in main.php at line 80
in /usr/www/virtual/doghouse/www.aubrey-addams.com/members/galleries/main.php at line 3
System Information
Gallery version 2.1.1
PHP version 4.4.0 apache
Webserver Apache/1.3.33 (Unix) PHP/4.4.0 mod_ssl/2.8.22 OpenSSL/0.9.7e
Database mysql 4.0.27-standard
Toolkits Gd
Operating system FreeBSD toybox.webair.com 5.4-RELEASE-p1 FreeBSD 5.4-RELEASE-p1 #0: Fri Jun 3 18:25:46 UTC 2005

:/usr/src/sys/i386/compile/WEBAIR i386
Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322)

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2007-04-09 03:49

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.