forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Permissions => Topic started by: Abbas Ali on January 09, 2006, 09:01:58 am

Title: Moderators for Album pictures
Post by: Abbas Ali on January 09, 2006, 09:01:58 am
Here is the album moderators mod for cpg 1.4.x. Admin can assign moderator group for each album from album properties page.

Moderators can do following things

Moderators cannot edit the album itself i.e. they cannot delete the albums or edit their name/description and such other things.

Do make backups before applying this mod.

Step 1

Modify the database table cpgPrefix_albums by running following query (Use phpMyadmin or other application)
Replace Prefix with your prefix for database tables.

Code: [Select]
ALTER TABLE `cpgPrefix_albums` ADD `moderator_group` INT NOT NULL;


Step 2

Download the zip file and replace
modifyalb.php, db_input.php, index.php and editpics.php in your coppermine root folder.
english.php in lang folder
init.inc.php, functions.inc.php, themes.inc.php in include folder.
theme.php in themes/yourtheme folder (Attached theme file is for classic)

For those who are already using modified cpg or have applied some mods it is recommended to open the respective files and see the diff and then insert the appropriate code to your scripts. To make it easy i have marked all the modification with ######## characters.

Update: Everyone should make the changes manually as the attached files are of 1.4.3 version and if you replace it in the latest version then that might cause issues. If you do the changes manually then mod will work with all cpg1.4.x versions. Attached files are for cpg1.4.19. If you are using any other version then do the changes manually

For those who are using customized theme they will have to modify their respective theme.php instead of themes.inc.php
Also i have modified themes.inc.php for the sake of simplicity. The correct way would be to modify your respective theme file.

Those who are using unmodified version, it is highly recommended to download the files and replace your current files with these.

Latest file : moderator_cpg1419.1.zip


Step 2

Download the zip file and extract it. It contains the file changes.txt which has the instructions to modify the scripts. The zip also contains a theme.php (classic theme). You need to manually edit your theme file and apply the changes as given in attached theme.php. The newly added lines are marked with
######### Added ##########
some code
#########################

The modified lines are marked with
######### Modified #########
some code
#########################

If your theme file does not have that piece of code then you can copy it from themes/sample/theme.php and then make the changes.

Latest File : moderator_cpg14x.zip

P.S: Thanks to Nibbler and amirw2k for fixing bugs in previous version.


Abbas.
Title: Re: Moderators for Album pictures
Post by: andrewshu329 on January 14, 2006, 02:05:11 pm
Thanks alot for this mod Abbas,
I have one question: If I've already implemented your previous mod, Moderators for upload approval for cpg 1.4.x, will this mod work alongside that? Or will i have to undo the modifications to the files before implementing this mod?

Thanks again,
Andrew
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on January 14, 2006, 05:53:27 pm
The files modified for both the mods are same and hence you will have to undo previous mod. If you hadn't any other mod other then my previous mod (upload approval) then it is recommended that you just replace your existing files with this one (do make backups).

Note: This mod also does upload approval.
Title: Re: Moderators for Album pictures
Post by: VVVas on January 14, 2006, 11:37:59 pm
Very-very good mod!

request: edit comment for moderator?
Title: Re: Moderators for Album pictures
Post by: andrewshu329 on January 15, 2006, 10:34:35 am
Hi Abbas,
Once again, thanks for the great mod.
However, there is one minor detail that id like to point out.

As you know, while in admin mode, you can move a user's photo from a public album into his or her private album.
This function is not available to moderators, so an admin must manually set all of the user's albums to "moderated by" "groupname".

Is it possible to make this function available?

Thanks,
Andrew

Title: Re: Moderators for Album pictures
Post by: VVVas on January 15, 2006, 03:31:16 pm
As you know, while in admin mode, you can move a user's photo from a public album into his or her private album.
This function is not available to moderators, so an admin must manually set all of the user's albums to "moderated by" "groupname".

Is it possible to make this function available?
SQL-query for default `moderator_group`= groupID (Use phpMyadmin or other application).

___________________
I am sorry for my bad english. I do not know it.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on January 16, 2006, 06:10:15 am
As you know, while in admin mode, you can move a user's photo from a public album into his or her private album.
This function is not available to moderators, so an admin must manually set all of the user's albums to "moderated by" "groupname".

Is it possible to make this function available?

This is possible. But i deliberately made it like that. Anyways i am going out for a week, will discuss this after i return.
Title: Re: Moderators for Album pictures
Post by: Goosemoose on February 26, 2006, 06:19:56 am
Any update on moving to a users gallery? The sql command would need to be run every time a user created a new album, so it's not exactly usable.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on February 28, 2006, 12:01:46 pm
Yes....now the moderators can move the pictures to their personal galleries. Please download the newly attached moderator1.1.zip in my first post.

If you want to make changes manually then edit editpics.php

Replace

Code: [Select]
$user_albums = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid IN $albStr AND category > '".FIRST_USER_CAT."' ORDER BY title");

with

Code: [Select]
$user_albums = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid IN $albStr AND category > '".FIRST_USER_CAT."' OR category='".(FIRST_USER_CAT + USER_ID)."' ORDER BY title");


Abbas
Title: Re: Moderators for Album pictures
Post by: n3n on March 06, 2006, 11:33:10 pm
Very nice mod, tnx alot.
I do have a question. Where is the link to the image approve list ? And is it possible for
moderators to recieve an email when there are new files that need approval ?

Tnx again for the work.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on March 07, 2006, 06:54:57 am
The link is shown only to moderators. The code has been added to include/themes.inc.php for the same.

Email notifications are possible with some modifications in code.
Title: Re: Moderators for Album pictures
Post by: n3n on March 07, 2006, 07:00:22 am
Ok tnx.

Would you consider implementing the email thing ? Think lots of people would like it, but i don't
have the skills to do it :(
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on March 07, 2006, 07:05:02 am
Hmmm.... Will do it whenver i get some free time. Can't promise anything ;)
Title: Re: Moderators for Album pictures
Post by: n3n on March 07, 2006, 07:29:02 am
Great :)
Title: Re: Moderators for Album pictures
Post by: gabbadude on March 12, 2006, 02:40:31 pm
THis is an EXCELLENT mod Abbas.  Thank you for this.

I'm sorry if I missed the next question on these boards but there is soo mcuh info here that it has taken me ALL day to find this mod.

Is there any way to actually make a user a moderator of a whole CATEGORY?  Exactly with the same features above except he should be able to create albums in that category only aswell as adding to his current "User Category" Albums?

Thanks
Gabbadude!

P.S. Just thought I would let you know that I think I have found a bug(maybe just my ignorance) in the mod.  As it is probably supposed to be like this, the mod only works if the "Public Albums Upload Approval" is set to "Yes" on the group that the user is assigned to. However, this forces the moderators to approve their own uploads to their own moderated albums too.  How do you propose that we get around this?  What am I doing wrong?
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on March 13, 2006, 06:40:23 am
Is there any way to actually make a user a moderator of a whole CATEGORY?  Exactly with the same features above except he should be able to create albums in that category only aswell as adding to his current "User Category" Albums?

I am afraid this is not possible. This feature has been requested many times and we have incorporated it in cpgNG which is in alpha stage as of now. Can't do the same in current stable version.

Quote
P.S. Just thought I would let you know that I think I have found a bug(maybe just my ignorance) in the mod.  As it is probably supposed to be like this, the mod only works if the "Public Albums Upload Approval" is set to "Yes" on the group that the user is assigned to. However, this forces the moderators to approve their own uploads to their own moderated albums too.  How do you propose that we get around this?  What am I doing wrong?

I didn't understand this.... Moderators will approve only when "Public Albums Upload Approval" is set to "Yes"... this should be the behavior, isn't it? If "Public Albums Upload Approval" is set to "no" then there will be no pic to approve.

Yes moderators need to approve their own pics too which they upload to their moderated albums.. This can be avoided by changing some more scripts. But i am reluctant to do so. Since i want to keep the total number of files changed for this mod to as less as possible.

This mod can be improved in many ways but it will require changing a lot of scripts which i suppose is not a good idea.


Abbas
Title: Re: Moderators for Album pictures
Post by: n3n on April 13, 2006, 05:54:27 pm
Hi Abbas,

I applied this mod for the second time now to cpg 1.44 install with other mods.
The thing is that as an admin im able to assign an album to a certain group in the album properties page.
But when i login as a user from that group, i dont see any buttons or options that allow me to edit an image.

What could be the problem ? Ive tried it using multiple themes.
Title: Re: Moderators for Album pictures
Post by: Joachim Müller on April 14, 2006, 09:56:47 am
did you enable Allow users to retain control over their pics in public galleries (http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_user_editpics_public_start)?
Title: Re: Moderators for Album pictures
Post by: n3n on April 14, 2006, 11:55:07 am
Hmm,tnx for the tip GauGau, just tried it, but changed nothing. Also i dont want normal users (not in the moderator group) to be able to delete any
pictures, even if they uploaded them.

Any other things that could cause the problem ?

ps. Im leaving for a few days, so it could be im not gonna reply really soon.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on April 15, 2006, 08:46:51 am
Make sure that you have the following code in your init.inc.php file

Code: [Select]
if (!GALLERY_ADMIN_MODE) {
  $result = cpg_db_query("SELECT DISTINCT(aid) FROM {$CONFIG['TABLE_ALBUMS']} WHERE moderator_group IN ".USER_GROUP_SET);
  if (mysql_num_rows($result)) {
    while ($row = mysql_fetch_array($result)) {
      $USER_DATA['allowed_albums'][] = $row['aid'];
    }
  }
}
Title: Re: Moderators for Album pictures
Post by: n3n on April 17, 2006, 10:45:25 pm
Tnx for the repply again.
Checked my code, and that piece exists in init.inc

Any other suggestions ? It cant be because im also using the mod by stramm ? (the watermark, sharp thumbs, etc)
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on April 18, 2006, 09:26:10 am
I don't know the mod by stramm so can't comment on that one.

We will need to debug the script. In index.php add

Code: [Select]
print_r($USER_DATA['allowed_albums']);

just after

Code: [Select]
global $lang_list_albums, $lang_errors;

Above code will print an array. Report the output here along with the aid of the album to which you have assigned the moderators.

Remove the line added after testing.

Abbas
Title: Re: Moderators for Album pictures
Post by: n3n on April 18, 2006, 02:12:26 pm
added the snippet, where should i see the output ? dont  see anything
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on April 18, 2006, 03:26:24 pm
Open the gallery's index page in browser. You will see the output there. Also post a link to your gallery so that i can see the output.
Title: Re: Moderators for Album pictures
Post by: n3n on April 18, 2006, 06:34:51 pm
www.grafflix.org/flix/index.php

Really dont see anything.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on April 19, 2006, 09:48:50 am
The $USER_DATE['allowed_albums'] array is not getting generated in your script. Can't say why without debugging it. If you are happy to give me your server's ftp info then i will look into it (Just PM me).
Title: Re: Moderators for Album pictures
Post by: n3n on April 19, 2006, 12:56:44 pm
I have readded the mod. Didnt do any good though.
Gave you a pm with some login stuff.

Tnx
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on April 20, 2006, 07:44:31 am
You gallery always shows last added thumbnails. You are not showing the album list. Then how can the buttons be shown? The edit/moderate buttons are only shown beside the album thumbnail. But you are not showing the album list at all....
Title: Re: Moderators for Album pictures
Post by: n3n on April 20, 2006, 11:20:38 am
Oooh no, i thought the button wouold show beneath the intermediate aswell, like with a normal admin account.
Sorry for the inconvenience  :-X

Tnx alot for the trouble.
Title: Re: Moderators for Album pictures
Post by: n3n on April 20, 2006, 11:34:42 am
Also I seem to be getting a permission denied error. Isnt there a way to use this mod without having to use the catlist and alblist, e.g underneath the intermediate image? Really hate the output it gives.

Sorry to take so much of your time, but i really really need this mod
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on April 20, 2006, 12:54:07 pm
Giving link under intermediate pic will require editOnePic.php to be modified so that moderator can edit a single pic. Currently moderator can edit file only from editpics.php  This will require some time. I will do it as i get some free time but don't expect it to be done soon....
Title: Re: Moderators for Album pictures
Post by: n3n on April 20, 2006, 12:59:57 pm
Ok thanks alot, meanwhile ill try to come up with another solution.
Title: Re: Moderators for Album pictures
Post by: cgc0202 on April 21, 2006, 03:23:18 pm
Here is the album moderators mod for cpg 1.4.x. Admin can assign moderator group for each album from album properties page.

Moderators can do following things
  • Approve uploads in that album
  • Edit/Delete pics from that album
  • Reset views counter/comments for that album

Moderators cannot edit the album itself i.e. they cannot delete the albums or edit their name/description and such other things.

Abbas.


I was wondering, is it too late (or at least consider for the further development of this feature) to have the  "approval" and "delete" as two independent potential permissions delegated to a moderator?  And, maybe just like in the  Config panel -- to let the Admin decide to assign one or both permissions to a moderator.  [In fact, at some point as a later development of this feature -- and the other permissions you  indicated -- to have them in a Config table format so that the Admin will have the option to decide what permissions to the delgate to a Moderator.

You stated: "Moderators cannot edit the album itself i.e. they cannot delete the albums or edit their name/description and such other things." But, before this, you stated: "li]Edit/Delete pics from that album[/li][/list]"

If you analyze both statements more carefully -- without any other safeguards in place -- a Mderator can technically delete one file at a time (or just check every file in an album for deletion.  Thus, while (s)hemay not be able to delete the Album itself, a disgruntled Moderator can leave the category members with an empty photo album.[ This observation is based from the CPG1.4.4 that  I am using right now.]

While they did not explain the underlying reason for their preference, I will surmise that the above potenntial scenario or some other undesirable possibilities were the reasons why  n3n stated:

  ...Also i dont want normal users (not in the moderator group) to be able to delete any pictures, even if they uploaded them. ...
  Two other people -- sgt_goomba and kfc -- and if you include me; there are at least four (4) who prefer quite strongly that the "delete" permissions be one function that must be retained by the Admin.

Once deleted it cannot be restored -- unless there is a backup mechanism in place.  A proposition that will yet require another mod.

As a diclosure, three (3) forum participants -- cerberus, DefenceTalk.com and tanfwc --  supported the "edit/delete" permissions for the Moderator, without explaining why they chose that.  I may be incorrect in my deduction but maybe it was because both permissions were lumped as if they were indivisible permissions when you stated:

"li]Edit/Delete pics from that album[/li][/list]"

I wonder if they will join our camp -- to decouple these two powers -- if they realize the potential disaster that can ensue from an abuse of the "delete" power.

I do not know how complicated and how much work it will require to script, but one alternatice possibility is to develop a mechanism for the Moderator to recommend to Admin that certain photos be deleted and the Admin will have the final say. 

The concept  is much like the :approval queue, excep that the reverse, i,e,, "deletion " is the goal of the mechanism to be instituted.  Such a mechanism will be a great help ffrom the Moderator and relieve a lot of the preliminary editorial functions that would have fto be done by the Admin.

There could also be a fail-safe automated mechanism so that the number of already approved photos will not go below a certain minimum threshold. [This could be included in the "Config" also.]

 Moreover, if this option for a Moderator  --to recommend to Admin to delete photos  is adopted-- there must be some defined general guidelines.  [These guidelines will not require any scripting but included in the "Guidelines of the photo gallery website.  Here are some example rules (that I will define in my website): 

(1) Recommend deletions only if the set limit in the number of photos in a category is near the maximum or already exceeded.
(2) Public albums must be managed so  that it must not become a quasi-persomal album. To elaborate using an extreme case: Contributor A has 98 photos and Contributor B has the other two (2) -- in a max of 100 allowed.  Even if the quality of the photos of "B" are not good as that of A, the deletion must come from   A.
(3) In some applications -- like taxonomy of plans, animals, microorganisms -- again using a extreme example, if there are 98 photos of ducks, swans and geese vs 2 pedestrian photos of a mountain lion and a cheetah, the deletion must come from the fowls.
(4) etc.

I have observed situations, in forums for example, when the power of a Moderator has gone to an individual's head, and they abuse the exercise "to delete" postings.  This can create tension that can destroy a "community spirit". Similar scenarios can happen in moderated photo albums.  That can spell doom in sites where contributions pf photos are voluntary rather tha compensated.

In the end, the extreme situation conjured here can usually be avoided, if the Administrator makes prudent judgement in selecting  people  who will serve as Moderators.

Finally, when granting these permissions, we must remember that it is far easier for the Admin to reverse an "approval" action but how can you reverse the finality of a "delete" action -- if the software does not have a fail-safe mechanism in place?


cgc0202


Title: Re: Moderators for Album pictures
Post by: Abbas Ali on April 21, 2006, 05:44:47 pm
@cgc0202: Your suggestion is correct but below are the reasons why i kept it like that.

I wanted to give moderator powers with least possible changes being done in core code. The main intention was that it should be easy to apply for any user. As the number of changes in files increases it becomes difficult for a normal user to apply the mod. Also it becomes difficult for the developer to maintain such a mod. Hence generally all the mod developers want to keep the changes as minimal as possible.

Edit/Delete both were conjoined for admin and both can be done from editpics.php. In editpics.php i just gave the moderator the admin powers. So whatever admin can do on editpics.php, the moderator can do the same. I did so, so that minimal changes are required in editpics.php file.

There are many users who don't know a single line of php or how to follow the guidelines given to apply the mod. They just keep harassing the mod developer with their questions and problems. Most of the times the mod does not work for them. Let me tell you, this is a huge problem for the mod developer since he/she had to support such users. Generally mods are made for persons who know what they are doing and how to do it. This is another reason why we chose to keep the changes require for the mod as minimal as possible.

It is possible to provide "editing" and "deletion" as two separate permissions. I cannot guarantee anything but i will give it a thought and try to come up with the solution. But again as i said earlier it will become a huge mod with changes in lots of places. Lets see when i get time to do this... :)


Abbas
Title: A commendation
Post by: cgc0202 on April 21, 2006, 07:09:15 pm
... It is possible to provide "editing" and "deletion" as two separate permissions. I cannot guarantee anything but i will give it a thought and try to come up with the solution. But again as i said earlier it will become a huge mod with changes in lots of places. Lets see when i get time to do this... :)
Abbas

Thanks very much. 

I understand the complexity involved -- coming from a non-tech perspective.  I have wrecked havoc to some scripts I have tried to change sometimes because there was possibly just a closing tag, or something that I missed.

I found quite a few hidden gems in the program that are not even discussed in the Manual -- like the "install lock" feature for example was quite elegant.  Other softwares that I have used just advised you to remove the install an some other files or categories.

That the members of the whole team are doing it for an open-source software is even more laudable.  We as users of the program cannot thank you enough.  If we cannot return the favor in kind, I wish you all to know that I hope to use the program for what would in turn help perhaps make a difference in the world -- eventually. 

There is no guarantee of course, but just like what you are doing, trying your own good deed -- like a stone thrown in the pond to cast  ripples.

I use the TikiWiki for its "wiki" collaborative feature, and it has a good image gallery with a good overall permissions systems  for the entire system (173 different permissions) -- most sophisticated I have ever seen as I am beginning to understand the ramifications of what it can do.

Nonetheless, I have chosen to look for a separate image gallery system because the integrated image gallery in TikiWiki is not as well developed as the others I have found. I must be honest that when I started looking and comparing, for some reason, I opted for Gallery2 initially rather than Coppermine -- because of certain features it had or the direction they were going.

To cut a long story short, at some point, I decided to do a head-to-head comparison between the two in our Family Album -- as a dry run for what I plan eventually for a well-developed photogallery program.  In a more real setting the Coppermine edged Gallery2 in terms of what it can already deliver rather than just the promise of what can be that attracted me hypothetically to Gallery2. [I knew I needed those features in the long run.]

I decided to look at Coppermine more intensively.  And, based on what the members of our family wanted to do with an entire website -- the multimedia feature of Coppermine was quite popular.  The choice of pre-packaged themes was a hit to them also. 

I investigated the activity in the forums and that is what attracted me the most -- the active development of tangible features rather than just cosmetic dressing.  As a result, perhaps one day, Coppermine will have the features that I wish included, if I try to share my own perspective. 

One of them is towards decentralization of the Administrative duties without compromising the security of the website.  This is very critical in  a collaborative environment --- as discovered by the "wiki" developers.  That was why, in the case of Tikiwiki, they developed the most elaborate permissions system, to address what is now recognized as the inherent flaw in "MediaWiki", the program(?) that runs "Wikipedia".

I hope you will not misconstrued my post as badgering your team, I can see from the forums that there are just so much in your plate right now.

In regard the feature of decoupling the two -- approve and delete -- I have ways of coping with that right now, if as you said, it will take time because of the ramifications it could  trigger.  In fact, while I wish it not to be the case, even if the proposal  (and underlying reasons I outlined) is not adopted, the good points I found in Coppermine right now outweighs such potential lack of the feature.

I support  the use open-source software, not so much because it is free, but more because of the vision and the principles behind.  In a sense, the greatest reward that developers of open source softwares can aspire for is that the public uses what they have worked hard to create.  At present, I decided to cast my vote in using Coppermine.

cgc0202


Title: Re: Moderators for Album pictures
Post by: adnan on May 26, 2006, 09:33:03 am
what's different between moderator1.1 with moderator 1.0 ?
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on May 26, 2006, 09:43:17 am
No new features..just some bug fixes. You should use version 1.1
Title: Re: Moderators for Album pictures
Post by: AnneN on June 14, 2006, 03:01:29 am
I installed the v 1.1 moderator mod onto a working version of 1.4.8 and then found that the Edit One Pic function no longer works. Is there something I need to tweak to make it work with this veriosn please? It worked fine with my earlier version of Coppermine.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on June 14, 2006, 12:32:12 pm
What error message does it gives? Or what exactly happens? Please give more details.
Title: Re: Moderators for Album pictures
Post by: AnneN on July 13, 2006, 02:56:56 am
I deleted the mod so cannot report the error. I've now redone it and all works properly so I guess it was just a glitch. Thanks for the mod, it is just what I need. :)
Title: Re: Moderators for Album pictures
Post by: Mr_Hat on August 28, 2006, 02:42:23 pm
Hi Abbas,

I've installed the mod editing manually all the files 'cause some of that files was modified by other mods...it seems to work but when I log in with the account of a user of the group that I've chosen to be moderator and I click to "Modify File" (I suppose that it's the translation in English of the Italian sentence that I read) the gallery says that I don't have the rights to access to that page...Am I making a mistake of the rights to set to the specified group? I've already enabled "Allow users to retain control over their pics in public galleries"...

ps: Thanks for the mod, it's exactly what I'm searching of....!  :D

Bye!
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on August 29, 2006, 08:04:07 am
I forgot to mark one of the modified lines with ###### and since you applied the mod manually you didn't knew that.

In editpics.php

Replace

Code: [Select]
        if ($cat != FIRST_USER_CAT + USER_ID && !GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);

with

Code: [Select]
        if ($cat != FIRST_USER_CAT + USER_ID && !GALLERY_ADMIN_MODE && !MODERATOR_EDIT_MODE) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);

This should solve your problem.


Abbas
Title: Re: Moderators for Album pictures
Post by: Mr_Hat on August 29, 2006, 08:44:20 pm
Thanks! Now it seems to work....thanks a lot!
Title: Re: Moderators for Album pictures
Post by: zammers on October 12, 2006, 03:51:28 pm
Where do I download the zip file for this MOD?

Also is there an install script which will run the SQL Query? It is easier than trying to figure out the phpmyadmin thing
Title: Re: Moderators for Album pictures
Post by: Sami on October 12, 2006, 04:12:58 pm
This is mod , it means you need to apply it manually.
zip files are attache to first (initial) post
Title: Re: Moderators for Album pictures
Post by: zammers on October 12, 2006, 05:20:05 pm
Thanks - I didn't see the little attachment links at the beginning of the post. I was able to get the mod installed and LOVE IT... I hope this functionality is included in future releases
Title: Re: Moderators for Album pictures
Post by: Sami on October 12, 2006, 05:32:36 pm
It's under ToDo List for feature version (1.5)
Title: Re: Moderators for Album pictures
Post by: Stifler on October 15, 2006, 06:59:11 pm
Would it be possible to add a link to edit that specific image, next to the link "delete".
Just like an admin.
Title: Re: Moderators for Album pictures
Post by: TapeWurm on October 17, 2006, 07:59:29 pm
Hello and thanks for the mod I've been needing forever!
But with the query, it sayd that cpgPrefix_albums doesn't exist. I can't find it anywhere. Coppermine claims I'm running 1.4.x so can you think of anything else that might be going on?
Thanks in advance!
Title: Re: Moderators for Album pictures
Post by: zammers on October 17, 2006, 10:15:10 pm
change the part that say prefix to be whatever your coppermine is

mine was cpg143_albums
Title: Re: Moderators for Album pictures
Post by: jans on October 21, 2006, 11:45:48 pm
Hi,

Is it possible anyhow to allow an album moderator or any other user / group to change file or picture properties?

I'd like to make a batch upload to a public album (mainly because a regular user cannot do a batch upload. :) but I'd like my co-workers to describe the files on my behalf. Currently only the original file owner seems to have permission to define keywords, set-up a titile or description. For obvious reasons, I don't want others to use my own account and password, especially, that I have administrator priviledges. :)

Thank you very much for your help in advance,

Best regards,

(js).
Title: Re: Moderators for Album pictures
Post by: macekztrade on October 30, 2006, 05:43:32 pm
Hi!
I´m offering this mod for version 1.4.10

http://www.divadlo.mezimesti.cz/moderator1.1.zip (http://www.divadlo.mezimesti.cz/moderator1.1.zip)
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on November 02, 2006, 08:03:40 am
Is it possible anyhow to allow an album moderator or any other user / group to change file or picture properties?

This is exactly what the mod does. It allows the moderators to edit the files/pictures of the album to which the moderator is granted the permission.
Title: Re: Moderators for Album pictures
Post by: Stifler on November 05, 2006, 02:41:34 am
Will this mod work with the latest version?
Title: Re: Moderators for Album pictures
Post by: Joachim Müller on November 06, 2006, 07:08:26 am
Thread is marked as being for cpg1.4.x, which means "any version from cpg1.4.0 to cpg1.4.10". So yes, it should work. Why don't you try and give us feedback if you succeeded?
Title: Re: Moderators for Album pictures
Post by: Daft on November 15, 2006, 03:01:25 am
I tried this and while its a great mod it leaves a little to be desired for the purposes I intend to use it for.

What I am trying to do is make moderators for help with approving user uploads once our traffic ramps up I basically want them to be able to do anything i can do as an admin with exception to viewing or changing server information or settings. Not that I dont trust my moderators but as they say *it happens so I'd like to have them not worry about messing things up as well.

in short i want them to be able to approve uploads in all categories (including user albums), Move filesfrom public albums to private and vice versa
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on November 15, 2006, 06:03:50 am
This mod works per album basis. If you want to allow moderators to manage all the categories then you will have to edit each album and assign a moderator group to them. Apart from approving/editing/deleting pics moderators cannot do anything else as far as this mod is concerned.
Title: Re: Moderators for Album pictures
Post by: Daft on November 15, 2006, 07:59:07 am
Ok well like I said it is close. is there a way to make the moderator group automatically gain control over new non-public albums?

I know im a tiny bit off topic but this is the closest thing to a eureka i've found (and i <3 CPG's look)
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on November 15, 2006, 08:13:21 am
Yes this can be done by modifying the query where a new album is created and insert the moderator group id along with album details in database. The script which needs to be modified is delete.php.
Title: Re: Moderators for Album pictures
Post by: Daft on November 15, 2006, 10:43:28 am
hmmm im not quite sure of what I am looking for here i have delete.php open do you know a keyphrase for that section?

Also wondering what the format of my modification would be.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on November 15, 2006, 12:34:49 pm
In delete.php (somewhere around line 290)

Replace

Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos) VALUES ('$category', '" . addslashes($op['album_nm']) . "', 'NO',  '{$op['album_sort']}')";

with

Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, moderator_group) VALUES ('$category', '" . addslashes($op['album_nm']) . "', 'NO',  '{$op['album_sort']}', '2')";

Replace '2' (at the end of the statement with the group id of your moderator group.

This will cause all the new albums, including personal albums, to be assigned to moderator group for moderation.
Title: Re: Moderators for Album pictures
Post by: Daft on November 15, 2006, 08:11:26 pm
Blah! hmmm The only number id that seems to be working is 2 which sets registered users to moderator how do i grab the id of my moderator group? I've been poking around in SQL looking for it.
Title: Re: Moderators for Album pictures
Post by: Daft on November 15, 2006, 08:31:39 pm
Disregard that last post I figured it out. friggin beautiful man :)

Thanks for the help the autoassign is working perfectly.
Title: Re: Moderators for Album pictures
Post by: Daft on November 15, 2006, 11:14:04 pm
I dont know if its my bridge with phpbb (the bridge seems to function exceptionally) but I loaded a test account and placed it in the moderator group the album assigns the proper group so i know that is working but there is no change to the moderators account. Did not receive notification of upload approval in any capacity and had insufficient access to the URL of the approval section from my admin account.

Either I applied something incorrectly (i dont seem to have), Dont know what I am looking for to change, Or am missing the point of the mod.
Title: Re: Moderators for Album pictures
Post by: Daft on November 16, 2006, 02:29:49 am
My apologies for all the posts.

It seems as though the problem is the members of the moderator group are having their group_id overridden by the Registered groups ID in this case 2 as defined by the debug readout.

If you need additional information Id be more than happy to grab it for you.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on November 16, 2006, 11:07:40 am
Very difficult to say anything without actually seeing what is happening. PM me the admin account and a test user account along with a link to your cpg site and i will look into it.
Title: Re: Moderators for Album pictures
Post by: Daft on November 25, 2006, 08:32:56 pm
Still havn't figured out what the problem is moderators are still group_id 2 "Registered"
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on November 27, 2006, 11:14:41 am
I think you didn't modified the editpics.php file properly. The "Edit" link for the album is shown to the moderator but when moderator goes to the edit page, permission denied error is shown. I have created an album "New Folder" in the root category. Login as "test" user and see the "Edit" link is shown besides it but when it is clicked permission denied error is shown.

Re-check your editpics.php and make sure you have done all the mods properly.
Title: Re: Moderators for Album pictures
Post by: Daft on November 28, 2006, 12:51:29 am
Still cant think of anything the moderator group_id is 121 and is set as such in delete.php but my moderators still show up as 2 in debug.

Double checked editpics

is there a specific thing I should be looking for?
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on December 05, 2006, 01:26:41 pm
@Daft: Don't know what to tell you :(.
Title: Re: Moderators for Album pictures
Post by: Daft on December 08, 2006, 07:35:47 am
Hmm.. Can you post some detailed uninstall instructions? I want to try reinstalling from scratch without running the risk of compromising my site. Hopefully it will work the second time around.
Title: Re: Moderators for Album pictures
Post by: Joachim Müller on December 08, 2006, 07:45:03 am
To uninstal, restore your backup (you should make backups before starting to modify files) or get vanilla copies of the modified files by downloading the coppermine package and extracting the files needed.
To undo the adding of the column (step one of the mod), run the query
Code: [Select]
ALTER TABLE `cpgPrefix_albums` DROP `moderator_group`
Title: Re: Moderators for Album pictures
Post by: Daft on December 08, 2006, 07:46:42 am
Thanks Gaugau. Ill let you guys know if I have better luck this time. If I dont I intend to find out why and Ill give a report.
Title: Re: Moderators for Album pictures
Post by: Hein Traag on December 22, 2006, 09:42:19 am
Code: [Select]
Goodmorning!

I began installing this little mod by running the sql query on my DB but got this:
[code]Failed to execute SQL : SQL ALTER TABLE `cpgPrefix_albums` ADD `moderator_group` INT NOT NULL; failed : Table 'fototest.cpgPrefix_albums' doesn't exist
 

I am running 1.4.10 , what am i missing here ?

Hein[/code]
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on December 22, 2006, 10:20:14 am
Replace cpgPrefix_ in the sql query with the prefix you are using. Ex cpg1410_.
Title: Re: Moderators for Album pictures
Post by: Hein Traag on December 22, 2006, 11:00:44 am
 :-\ i should know better to post before i had a cup of coffee

Sorry Abbas
Title: Re: Moderators for Album pictures
Post by: Hein Traag on December 22, 2006, 01:07:53 pm
Back again. Loaded the SQL statement. Added the files and edited dutch.php for the language part.
I created a Editor group to put the people in that i need. When i now go to the properties of a album i do get the option to add a moderated by selection. I select the Editor group and save. I then login as a user which has the rights to upload files and i upload 1 file. When i try to add the file to the album it says it can't and that it did (?).
I log out again and login as a Editor user.. i do get a menu option which links to
Code: [Select]
editpics.php?mode=upload_approval But when i click on that links it says there is nothing to display.
Where am i going wrong ?

Regards,
Hein
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on December 28, 2006, 06:28:39 am
Can't say anything unless i see what's happening. Can you please PM me the admin and one moderator account of your gallery along with its URL.
Title: Re: Moderators for Album pictures
Post by: ARTURLION on December 28, 2006, 11:37:29 pm
I've searched forum for this feature/mod for some time and finally I've found. (Great job, Abbas! ;)

It's quite enigmatic that there's no possibility to give access ONLY to edit descriptions of files w/o any other administrative functions. I've made it very dangerously by giving access to additional account of admin user with full access, INCLUDING EDITING DESCRIPTION OF FILES. But it's not safe for longer way...

Now I see with this mode it's possible BUT...

I've made test of deleting files by my new moderator user and I see... Yes, (s)he can delete files from the accesible/moderable albums (and of course edit descriptions, THX! ;)

I've read this whole topic but I think I've understood it's quite complicated but possible (maybe quite to quickly I've read it? ;P).

Abbas, can You advise me how to disable all DELETING options to moderator and give them ONLY access to edit descriptions of files?

I know it sounds I do not believe in my moderators so far but I don't like to backup whole gallery every time I give access to another person who can delete all files (but not album as one person here pointed ;).
We're talking about public albums, no user albums are available, I don't want to go this way... ;P

Impatiently I'm waiting for solution, thanks in advance ;)
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on December 29, 2006, 12:01:54 pm
I have attached a new editpics.php. Replace your existing one with this and see how it goes. Moderators should be denied with all delete functionalities including comment deletion, resetting views and votes etc...

Title: Re: Moderators for Album pictures
Post by: ARTURLION on December 29, 2006, 07:47:14 pm
I can't find a proper word for what You've done. Incredible! Everything works properly! ;)

BIG, big thanks for it! ;)

Now Coppermine Photo Gallery fits my needs in 100% ;P
(maybe in 99% because I don't like my gallery's skin but this forum is sufficient to find a solution for that problem ;P)

Great thanks again!

I think You should add this feature to moderator v.1.2 mod but I'm suprised no-one ever asked for that function that I did ;)
Title: Re: Moderators for Album pictures
Post by: kxp on January 01, 2007, 10:54:13 pm
i have a problem with people not allowed to log in

I had 2 accounts logged in (one in opera, other in IE) , one of them was admin, other was the test subject user to see how does this mod work. I had both users logged in already before starting to replace the files on my site so i just did those "on the fly". i got my second user to be able to modify things but then at some point i noticed that i wasnt logged in and lost my permissions so i tested a bit and this is what i got

When logging in it says coocies not enabled (2 comps, 3 different browsers, all the same). Tryed getting the old files back and trying them out 1 by 1 so i managed to see that after uploading init.inc.php i couldnt log in anymore. after replacing that file with original i was again able to log in but then moderators permissions weren't effective.

Downloaded version 1.1 from first post and i have the latest 1.4.10 on my server. I don't have the default theme, just downloaded something from this page but i don't think that matters that much. Also, only active plugin that's running is one favourites script which add possibility to add multiple pictures to favourites (bot those are seporate files, they didn't replace anything)
Title: Re: Moderators for Album pictures
Post by: kxp on January 02, 2007, 12:05:11 am
Ok, i have to make 2 posts in a row because somehow moderators have forbidden to edit my own posts or i'm just blind because i only saw quote on my last post....

ok thats that, i got it fixed, just modified my original cpg file instead of overwriting it with your file and it seems to work for now
Title: Re: Moderators for Album pictures
Post by: netone on January 11, 2007, 03:03:08 pm
why Moderator dont have access to modify title and description of files ?  ??? Is there any other hack that can let me do this, i realy need this option as i have some people assigned that will modify names of file & descritopn that i (admin) will upload  there are different person for different albums. How can i do this ? i dont want to assign them Admin access as they have access to specified albums.
Title: Re: Moderators for Album pictures
Post by: ARTURLION on January 11, 2007, 03:39:36 pm
This addon/mod really DOES it what You've described. If You also don't want moderators to have access to delete options in chosen albums, just editing title and description of files/photos, add also editpics.php from the last Abbas Ali's post here (Posted on: December 29, 2006, 12:01:54 PM). Good luck! Don't forget to make backup of Your gallery's script files before adding mod ;)
Title: Re: Moderators for Album pictures
Post by: Jokke_K on January 13, 2007, 06:36:25 pm
Is it possible to allow moderators move pictures from album to another in same category?
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on January 13, 2007, 07:08:29 pm
Moderators can move pictures to any album which they have permission to i.e. if album A is moderated by group A and album B is also moderated by group A then group A user can move pictures from album A to album B.
Title: Re: Moderators for Album pictures
Post by: Hein Traag on January 30, 2007, 02:14:25 pm
Abbas,

i added the Uploader and Editor group again. The uploader group has permission to upload into public albums but they need permission from an admin before posting. Uploaders has a quota of 1024. In a test album i ticked on the option that users can upload files into that album and selected the Editor group as the group which can edit the album.

I then logged in as Loader and uploaded 1 file into that test album. A message came that the file was correctly installed. I then proceeded to the screen where you can select into which album you want to add the uploaded file. I select a album and proceed to accepting that. It then gives a message that the previous loaded file could not be added to the album and underneath that a message saying the process was done ok.

When i then login as a editor and go to Upload approval it says there are no files to be shown.
Where did i go wrong ?

Kind regards,
Hein
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on January 31, 2007, 06:16:19 am
Hein, I was not able to look at your gallery because of lack of time. I will do it shortly. I hope you haven't changed the un/pass you gave me last time.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on January 31, 2007, 07:38:00 am
@Hein: You forgot to give your gallery URL.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on February 01, 2007, 12:55:43 pm
@Hein: I took a look at your gallery and it seems that nothing wrong with Moderator mod. The main issue is that files are not getting uploaded by any user (even admin) to any album. That means file uploading via http method is not working on your site. You will have to first fix that. Refer to File Upload Troubleshooting guide for the same.
Title: Re: Moderators for Album pictures
Post by: Hein Traag on February 01, 2007, 06:18:59 pm
Thanks Abbas. At least now i know i implemented the mod correctly. I'll have a word with my sysadmin to see where the problem originates from.

Again, thanks for taking the time to have a look.

Kind regards,
Hein
Title: Re: Moderators for Album pictures
Post by: Dmitriy Katkov on February 05, 2007, 01:04:20 am
I forgot to mark one of the modified lines with ###### and since you applied the mod manually you didn't knew that.

In editpics.php

Replace

Code: [Select]
        if ($cat != FIRST_USER_CAT + USER_ID && !GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);

with

Code: [Select]
        if ($cat != FIRST_USER_CAT + USER_ID && !GALLERY_ADMIN_MODE && !MODERATOR_EDIT_MODE) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);

This should solve your problem.


Abbas

Many thanks to Abbas for very useful mod.
But, during installation I had the same problems, that n3n and Mr_Hat had. May be it is good idea to inform people right in main post that this mod works if "alblist" is enabled and add these missed ######## in to editpics.php of your .zip file?
Dmitriy
Title: Re: Moderators for Album pictures
Post by: Hein Traag on February 05, 2007, 02:52:05 pm
Abbas

problem solved. Ticket http://forum.coppermine-gallery.net/index.php?topic=40623.0 (http://forum.coppermine-gallery.net/index.php?topic=40623.0) was about the same message of the files not being uploaded.

Turns out the solution is to add
Code: [Select]
define('SILLY_SAFE_MODE', 1); in config.inc.php right after
Code: [Select]
<?php
Regards,
Hein
Title: Re: Moderators for Album pictures
Post by: Hein Traag on February 05, 2007, 09:36:56 pm
Ok, got it to work properly now.

Example. I created two new groups within CPG called Moderator and Upload. I created two new users.
User 1 : name: user1 - primary group : Upload - secondary group : Registered
User 2 : name: user2 - primary group : Moderator - secondary group : Registered

I set the rights of the Registed group so it does not have the rights to upload to a public album. But it does need to get approval from a moderator on uploaded pictures.

I set the rights of the Upload group so it can upload to public album and also requires a moderator for approving the uploaded picture.

I set the rights of the Moderator group so it can not upload to public album and does not need moderator approval on uploaded pictures.

I tested a couple of pictures and when CPG is set like above it does the trick for me.

Thanks Abbas for a great mod  ;D. (any chance of getting this into a plugin ? )
Title: Re: Moderators for Album pictures
Post by: Hein Traag on February 07, 2007, 04:42:11 pm
Abbas,

would it be possible to edit this mod so when you go to editpics.php?mode=upload_approval
you can also select all uploaded pictures at once ? This would speed things up for my moderators. They now have to approve each picture individually.

At my CPG the user with upload rights get 15 upload boxes. This is set to 15 because they can upload a maximum of 15 after each scouting event. Once a user uploads all 15 he/she has to set the album at each picture. Can the mod be edited to give the upload user a list of the pictures that were uploaded and then the choice of setting a album for all the pictures but also the option to set a album per picture (or would that be impossible to code).

Thanks again for your patience and support

Kind regards,
Hein
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on February 08, 2007, 07:47:23 am
When you go to editpics.php?mode=upload_approval it will show only those photos which are pending for approval.

To see all photos of a particular album to edit on editpics.php you can use the "Edit Files" button for that album

But to show all the files uploaded by a single user (in different albums) on editpics.php will be complex to code.
Title: Re: Moderators for Album pictures
Post by: Hein Traag on February 08, 2007, 09:18:30 am
Ok Abbas. Thanks for the answer. If you say it's complex to code i believe it  :)

Thanks again for a great mod

Hein
Title: Re: Moderators for Album pictures
Post by: dr9a8c on February 18, 2007, 10:12:35 pm
Great Mod ;D

I have installed this mod and it does what it should do with the following exception: upload approval is always visible to all users.

I am using a custom theme. This also occurs if I switch to the hardwired theme. If I use the Classic theme everything is fine.

I am guessing that I need to add something else to my theme.php but I'm not sure what. Could you shed some light on this?

Thanks,
Title: Re: Moderators for Album pictures
Post by: dr9a8c on March 01, 2007, 03:28:31 am
I have spent days upon days searching this site for what I am looking for...but I do not see the answer anywhere else.

Attached is my custom theme. As I said before, the only problem that I have is that the upload approval link is always shown. If I remove the section of code which determines the look of the links, it works fine. How can I change the block of text referring to the upload approval to be visible only by a moderator?
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on March 01, 2007, 08:52:51 am
Make sure that you edited themes.inc.php properly. Attach your themes.inc.php here.
Title: Re: Moderators for Album pictures
Post by: dr9a8c on March 01, 2007, 07:07:11 pm
Here is the themes.inc.php from my gallery.

Thank you for looking at this...your help is much appreciated.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on March 02, 2007, 06:55:07 am
The code seems to be fine.

If you are happy to PM me your ftp/gallery details then i will look into this. Please give the link to this topic in the PM.
Title: Re: Moderators for Album pictures
Post by: dr9a8c on March 02, 2007, 04:53:48 pm
I attempted to send the details that you requested.

There was not confirmation that the message was sent and I was unable to preview so I am not sure if the message was actually sent.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on March 03, 2007, 05:50:26 am
@dr9a8c: I didn't received any PM from you as yet.
Title: Re: Moderators for Album pictures
Post by: eXess on March 04, 2007, 03:28:15 pm
Hi, I also think that it'a a great mod. My request is to make this mod to be installed through the Configuration Panel of the gallery. It will be much easier then. If you have some time, think about it. Have a nice Day!  ;)
Title: Re: Moderators for Album pictures
Post by: dr9a8c on March 05, 2007, 03:21:55 am
No matter what I try, I cannot send a message on these forums. After I compose the message and press preview or submit, nothing happens.

Is there another way that I can contact you privately Abbas? Maybe if you private message me first I'll be able to reply???
Title: Re: Moderators for Album pictures
Post by: Joachim Müller on March 06, 2007, 08:20:03 am
Sending PMs works flawlessly, I just double-checked using a non-privileged test user account that has similar permissions to yours. Must be something on your end. Check pseudo-security client apps like "Norton Internet Security" or similar crap that can keep you from submitting forms if set up improperly.
Title: Re: Moderators for Album pictures
Post by: Gephri on March 06, 2007, 08:28:09 pm
this may be obvious but I'd like to confirm that moderator1.1 is not meant to work with bridged CPG + phpBB's - right?
Title: Re: Moderators for Album pictures
Post by: Nibbler on March 06, 2007, 09:01:44 pm
Should work fine.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on March 08, 2007, 09:20:22 am
@dr9a8c: I have added a bit of code in your include/themes.inc.php This was needed since you are using a custom theme and it works quite different from others. Let me know if this solves your problem.

P.S: Actually function theme_main_menu should be defined in your custom theme since we modified that.
Title: Re: Moderators for Album pictures
Post by: dr9a8c on March 08, 2007, 06:17:32 pm
@Abbas

Thanks so much for your help...everything is now working exactly as planned.

P.S. I believe that I have private messaging working from my PC. Thanks for the suggestion on that GauGau.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on March 10, 2007, 09:05:36 am
By PM

In a completely boneheaded move, I have managed to delete the added code in the themes.inc and didn't yet have it pasted into the themes.php.

Could you tell me that line of code again? I know where it goes and that it refers to the template extract for upload_approval.

I promise I will never make code changes on lack of sleep again.


Thanks in advance for your help and patience

In function theme_main_menu add

Code: [Select]
if (!is_array($USER_DATA['allowed_albums']) || !count($USER_DATA['allowed_albums'])) {
template_extract_block($template_sys_menu, 'upload_approval');
}

just after

Code: [Select]
    if (!$CONFIG['display_faq']) {
        template_extract_block($template_sys_menu, 'faq');
    }

also add $USER_DATA in the global variables declaration in the same function

i.e.

Code: [Select]
global $AUTHORIZED, $CONFIG, $album, $actual_cat, $cat, $REFERER, $USER_DATA;
Title: Re: Moderators for Album pictures
Post by: mylogon on March 12, 2007, 10:57:37 am
I am missing something, I have:

Inserted the code in myphp
uploaded and replaced your files
Created a group called Moderated
Created a user in group moderated
Made the public album moderated by members of the moderated group.
 
and then

Logged in as that user
uploaded a picture
inserted into gallery and I see them message waiting for admin approval.
Gone to home.

I cannot see anything other than user galleries with no files.  I see no moderated approval.

I just do not see a moderated approval button - only see it in admin mode.




Title: Re: Moderators for Album pictures
Post by: Abbas Ali on March 14, 2007, 08:14:55 am
You probably didn't modified your theme.php correctly which shows the upload approval button.
Title: Re: Moderators for Album pictures
Post by: mylogon on March 14, 2007, 08:38:44 am
I uploaded your files exactly.  I even tried the default theme.  You have no instructions to modify the theme.php.  What you you modify, as everything is in the themes.inc.php?
Title: Re: Moderators for Album pictures
Post by: mylogon on March 14, 2007, 08:41:56 am
Also, the forum attachments seem to be down again:

Firefox can't find the file at /forum/index.php?action=dlattach;topic=26218.0;attach=3384.

When trying to download the file.

Title: Re: Moderators for Album pictures
Post by: mylogon on March 14, 2007, 08:43:41 am
Sorry

URL

http://forum.coppermine-gallery.net/index.php?action=dlattach;topic=26218.0;attach=3384
Title: Re: Moderators for Album pictures
Post by: Hein Traag on March 14, 2007, 08:47:26 am
No problem with downloading here.
Title: Re: Moderators for Album pictures
Post by: mylogon on March 14, 2007, 08:50:09 am
I get version 1.0 file fine - 1.1 gets that error.
Title: Re: Moderators for Album pictures
Post by: mylogon on March 14, 2007, 09:03:42 am
My themes.php is the default - with no data in it, so it should only read the themes.inc.php, and I see the added section there, it just does not appear when I login as a moderator.  It also does not show as an administrator - but I do not if it should.  The galleries show up in public view, and they should not, as I understand this mod.

I am using the same account for uploading and approving - as you it was stated that even a moderators uploads would have to be approved.

The previous file was placed successfully.

Your file was uploaded successfully.

It will be visible after admin approval.
Title: Re: Moderators for Album pictures
Post by: MPDesignZ on March 31, 2007, 12:13:13 pm
Thanks worked great :D


MP
Title: Re: Moderators for Album pictures
Post by: lamehh on April 24, 2007, 12:41:29 am
I integrate moderator1.1 (manual after stramm modpack), but no works ???
No errors & not work...
Title: Re: Moderators for Album pictures
Post by: Hein Traag on April 24, 2007, 08:14:15 am
I integrate moderator1.1 (manual after stramm modpack), but no works ???
No errors & not work...

If you do not see any visible error messages then activate debug mode and copy/paste that here.
Title: Re: Moderators for Album pictures
Post by: lamehh on April 24, 2007, 03:16:39 pm
Uh, problem maybe is in my theme not have button for Moderators...
I try open my-domain.com/editpics.php?mode=upload_approval and works
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on April 25, 2007, 09:22:16 am
Check that you edited correct theme file.
Title: Re: Moderators for Album pictures
Post by: lamehh on April 25, 2007, 04:11:27 pm
Check that you edited correct theme file.

I attach my theme & themes.inc files.
Please somebody who understand to explain me where is my mistake... and fix me :(
Title: Re: Moderators for Album pictures
Post by: Joachim Müller on April 25, 2007, 06:51:01 pm
The mod doesn't only consist of two files:
Download the zip file and replace
modifyalb.php, db_input.php, index.php and editpics.php in your coppermine root folder.
english.php in lang folder
init.inc.php, functions.inc.php, themes.inc.php in include folder.
Title: Re: Moderators for Album pictures
Post by: lamehh on April 26, 2007, 10:24:01 pm
The mod doesn't only consist of two files:
----------------------------------------
Quote from: Abbas Ali on January 09, 2006, 09:01:58 AM
Download the zip file and replace
modifyalb.php, db_input.php, index.php and editpics.php in your coppermine root folder.
english.php in lang folder
init.inc.php, functions.inc.php, themes.inc.php in include folder.

Ohhh...
I have replaced these files, just my theme not have button for Moderators and I think that this is from these two files... or I lie myself?
Title: Re: Moderators for Album pictures
Post by: lamehh on May 01, 2007, 04:33:18 pm
uff, so anybody help me? where is error and how fix?
when moderator login not have button for approving pictures...
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on May 15, 2007, 09:55:03 am
I am running busy these days and don't get enough time. Is there any other moderator who would like to take on this issue?
Title: Re: Moderators for Album pictures
Post by: just_some_guy on August 11, 2007, 05:26:21 pm
Hello,

Firstly, great mod.

however, i have a problem i am using this mod along with strams mod pack, As you can see by the attached image where the login info and check pms,buddys etc. it just says {LOGIN FORM}, thankfully i backed up all my files, if this problem cannot be fixed do i just overwrite the files with the previous ones?

Thanks,

ps, i didnt edit any of the files should i of?
Title: Re: Moderators for Album pictures
Post by: Joachim Müller on August 12, 2007, 09:46:24 am
In the thread whoops! accidently overwrote some files. (http://forum.coppermine-gallery.net/index.php?topic=46024.0) you said that you're interessted to use the moderator mod any more, so you don't need ananswer to your question here. In the future, resolve your requests for support (one way or the other) >:(! This avoids waste of supporter's time.
Title: Re: Moderators for Album pictures
Post by: Crazymodder on August 20, 2007, 11:21:23 am
Hello this mod works very great.
But I have a question is it possible that moderators can see the 3 buttons at the displayimage.php like an admin?
I mean the 3 buttons under the picture witch displayed to you if you are an admin.
I have tried somethings but then everybody see these buttons user's to but I want only Admins and Moderator can see that buttons.
I hope you can help me I would be very nice
thx
Best Regards
Crazymodder
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on August 20, 2007, 01:49:43 pm
Showing the buttons is not a problem. But making those buttons work will be. It will require some programming in each of the pages where those button points to.
Title: Re: Moderators for Album pictures
Post by: Crazymodder on August 20, 2007, 02:04:50 pm
Or do you can help me to make that?
It is very important for me so I hope you help me please :)
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on August 20, 2007, 02:31:34 pm
Would look into this if i get time. Will require quite a bit of time and programming.
Title: Re: Moderators for Album pictures
Post by: Crazymodder on August 20, 2007, 03:04:02 pm
Thx :) that would be very great.
 :) :) :) :)
Title: Re: Moderators for Album pictures
Post by: kadafu on August 22, 2007, 05:48:30 pm
hmm mod works fine , but it gives me a problem , when i on click show all uploads/comments of this user it says, no images to display.

i removed the mod once and the error was gone, then i reapplyed it and it was back again.

plz help



Title: Re: Moderators for Album pictures
Post by: kadafu on August 22, 2007, 06:22:25 pm
the fault is in the functions.inc file if i upload that one i get the error
Title: Re: Moderators for Album pictures
Post by: kadafu on August 22, 2007, 07:11:23 pm
i did some test runs and it seems to be working fine, what did the modification in functions.inc actaully do? is it harmfull not to use the modded file of this?
Title: Re: Moderators for Album pictures
Post by: Nibbler on August 22, 2007, 07:14:47 pm
You should apply the changes marked in the files provided to your own files instead of using the provided files as they are.
Title: Re: Moderators for Album pictures
Post by: kadafu on August 22, 2007, 08:27:40 pm
man still doenst seem to work properly i dont get it
Title: Re: Moderators for Album pictures
Post by: Joachim Müller on August 23, 2007, 08:13:50 am
man still doenst seem to work properly i dont get it
Not a valid report. If you want help, you have to do more than just post "doesn't work".
Title: Re: Moderators for Album pictures
Post by: fangweile on September 01, 2007, 01:01:43 pm
I installed this mod in my gallery today and glad to say that it is perfectly working. No problem or any errors I encountered. I just follow the instruction given by Abbas. Thanks a lot for this nice modification. It is really great. ^_^
Title: Re: Moderators for Album pictures
Post by: herbuel on November 18, 2007, 03:05:52 pm
Hello,

I installed this module as in the doc, but i really can't find my want about "how to use it". May be my instalation is wrong... I had a look on the topics in this tread, and everyone seams to know how to do.

Could you give me a clue? Thanks a lot. Alain
Title: Re: Moderators for Album pictures
Post by: Gephri on November 30, 2007, 10:37:16 am
I installed this module as in the doc, but i really can't find my want about "how to use it". May be my instalation is wrong... I had a look on the topics in this tread, and everyone seams to know how to do.

Could you give me a clue? Thanks a lot. Alain

dittto - can someone help us start using our install...?
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on December 04, 2007, 06:06:16 am
If the mod is installed properly then you will find a new drop down for assigning moderators on album properties page. Then when the moderator logs in, he can edit/delete the pictures of the albums which can be moderated by him.
Title: Re: Moderators for Album pictures
Post by: Gephri on December 04, 2007, 05:51:22 pm
Hello Abbas,
I try to get to my album properties page by clicking Properties from the following page:
gallery/index.php?cat=...


But when I click on the Properties button it take me to:
/gallery/modifyalb.php?album=...

and I get an error that reads:
"Invalid action for form creation"

Any idea why the problem - which is probably also why I couldn't find the Moderator links
Title: Re: Moderators for Album pictures
Post by: Gephri on December 04, 2007, 11:22:38 pm
Let me simplify my request:
I would really like to use this mod>
But in order to get the /gallery/modifyalb.php?album=... page to load I've had to comment out the following Mod code:

Code: [Select]
// MOD Abbas Moderator Mod 1.1 (start)
if (GALLERY_ADMIN_MODE) {
  $data[] = array($lang_modifyalb_php['can_moderate'], 'moderator_group', 8);
}
// MOD Abbas Moderator Mod 1.1 (end)

When the above code is used it generates a critical error that says:
"Invalid action for form creation"

Any idea how to resolve -
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on December 05, 2007, 05:30:04 am
You probably didn't added other code in modifyalb.php. Make sure that you have modified the file as per instructions.
Title: Re: Moderators for Album pictures
Post by: Gephri on December 05, 2007, 09:06:33 am
Abbas
I've downloaded the latest 1.1 version of this mod from this thread.
The modifyalb.php page shows the following version in at the top:

Code: [Select]
  ********************************************
  Coppermine version: 1.4.3
  $Source: /cvsroot/coppermine/stable/modifyalb.php,v $
  $Revision: 1.11 $
  $Author: gaugau $
  $Date: 2005/11/28 07:42:14 $
**********************************************/

I see two changes for your mod in this file.  I've done them and I get the error I mentioned earlier.

any ideas.

Also - the only change I made to the nstallation of your mod was to  update themes/.../theme.php with the changes called for in themes.inc.php.  But that should not be creating the error - right.

So any other ideas?

Thnks
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on December 05, 2007, 12:27:27 pm
There are 3 changes in modifyalb.php and not 2. So you are obviously missing the below mentioned change

Code: [Select]
                case 7:
                    form_password_hint($element[0],$element[1]);
                    break;
                    ########## Added ##########
                case 8 :
                    form_moderator($element[0], $element[1]);
                    break;
                    ##########################
Title: Re: Moderators for Album pictures
Post by: sec187 on February 19, 2008, 08:54:56 pm
"For those who are using customized theme they will have to modify their respective theme.php instead of themes.inc.php
Also i have modified themes.inc.php for the sake of simplicity. The correct way would be to modify your respective theme file."

What exactly does this mean.  I have used one of the custom themes that was availible and have replaced some of the image files with my own.

How exactly do I modify my respective theme file without screwing everything up.  My gallery is already in use.
I am sort of new to this and want to make sure I know what I am doing before I try it.
Thanks!
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on February 20, 2008, 05:49:35 am
Your theme file will be themes/yourtheme/theme.php. So you need to modify theme.php and not themes.inc.php. If you don't find a section (which needs modification) in theme.php then copy that section from themes/sample/theme.php to your theme.php

I think there is a tutorial on how to modify a theme file. Please search the board.
Title: Re: Moderators for Album pictures
Post by: sec187 on February 20, 2008, 05:48:40 pm
^ thanks I am trying to change my code in step one using phpmyadmin, but I keep getting errors where am I going wrong.  Thanks for your help!

Code:
ALTER TABLE `cpgPrefix_albums` ADD `moderator_group` INT NOT NULL;


[Edit GauGau] Replaced hotlinked image with attachment [/Edit]


Title: Re: Moderators for Album pictures
Post by: Abbas Ali on February 21, 2008, 01:53:30 pm
Replace cpgPrefix_ with the prefix you have used. You can find your prefix by seeing the names of other tables in phpmyadmin.

No PMs please. (sec187 sent a PM to me)
Title: Re: Moderators for Album pictures
Post by: sec187 on February 21, 2008, 02:20:33 pm
I looked to replace the prefix, but I dont seem to have any...Here is my table...

Title: Re: Moderators for Album pictures
Post by: Hein Traag on February 21, 2008, 02:37:02 pm
Your prefix is cpg_
Title: Re: Moderators for Album pictures
Post by: sec187 on February 21, 2008, 02:45:26 pm
I understand that, but from my error message above, what I am supposed to replace or fix?

Sorry, I am new to this, thanks for all your help!!!!
Title: Re: Moderators for Album pictures
Post by: Nibbler on February 21, 2008, 02:48:10 pm
You are entering it into the wrong place I think. You need to use the tab 'SQL' and just paste it into the large text box.
Title: Re: Moderators for Album pictures
Post by: radmofo on March 20, 2008, 04:24:33 pm
Lovely mod! I can't thank you enough. I have one request- How do I add the "Crop Rotate" and "edit Picture information" under the intermediate image of displayimage.php if the user has the moderator permissions to manage the particular album the image is in?

This code is from displayimage.php I think it may be what needs to be edited. I've tried a few combo's but clearly I Don't have the coppermine skill to make it function.

As far as I'm concerned this is the final feature of tis mod that will put it over the top in usefulness!! Love it, Thanks Abbis Ali for your hard work.



Code: [Select]
if ((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) {
    $picmenu .= <<<EOT
     <a href="javascript:;" onclick="return MM_openBrWindow('picEditor.php?id={$CURRENT_PIC_DATA['pid']}','Crop_Picture','scrollbars=yes,toolbar=no,status=yes,resizable=yes')" class="admin_menu" >{$lang_display_image_php['crop_pic']}</a> <a href="editOnePic.php?id={$CURRENT_PIC_DATA['pid']}&amp;what=picture"  class="admin_menu">{$lang_display_image_php['edit_pic']}</a> <a href="delete.php?id={$CURRENT_PIC_DATA['pid']}&amp;what=picture"  class="admin_menu" onclick="return confirm('{$lang_display_image_php['confirm_del']}'); return false; ">{$lang_display_image_php['del_pic']}</a>
EOT;
Title: Re: Moderators for Album pictures
Post by: DarkReflections on March 27, 2008, 12:12:49 am
I'm just about to upload and set up a new gallery. I'm using the new 1.4.16 files. If I do a standard replace with the files from this mod, will that mess it up?
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on March 27, 2008, 11:47:31 am
@radmofo: There is a global array $USER_DATA['allowed_albums'] which contains all albums to which the current users has access as moderators. So you will need to check whether the user has access to album which the current picture belongs and then show those buttons. You will also need add the same check in the file where the actual rotation takes place.

@DarkReflections: Do not replace file. Instead apply the mod manually.
Title: Re: Moderators for Album pictures
Post by: Nibbler on March 29, 2008, 01:30:51 am
You've removed a whole load of sql here:

Code: [Select]
        ########### Modified ###########

        if (GALLERY_ADMIN_MODE) {
            $moderator_group = $_POST['moderator_group'];
            $query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title='$title', description='$description', category='$category', thumb='$thumb', uploads='$uploads', comments='$comments', votes='$votes', visibility='$visibility', moderator_group='$moderator_group' WHERE aid='$aid' LIMIT 1";
        ################################

Album passwords/hints and keywords can't be updated as admin.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on March 29, 2008, 06:05:20 am
@Nibbler: you mean in my mod?
Title: Re: Moderators for Album pictures
Post by: Nibbler on March 29, 2008, 02:38:47 pm
Yeah. db_input.php
Title: Re: Moderators for Album pictures
Post by: radmofo on April 18, 2008, 04:48:55 am
Hmmm.. I'm using this code, not sure what to change. It looks as if admin wot be able to  update password, hint and keywords. Not sure yet though.

Modded code
Code: [Select]
########### Modified ###########
        if (GALLERY_ADMIN_MODE) {
            $moderator_group = $_POST['moderator_group'];
            $query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title='$title', description='$description', category='$category', thumb='$thumb', uploads='$uploads', comments='$comments', votes='$votes', visibility='$visibility', moderator_group='$moderator_group' WHERE aid='$aid' LIMIT 1";
        ################################
        } else {
            $category = FIRST_USER_CAT + USER_ID;
            $query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title='$title', description='$description', thumb='$thumb',  comments='$comments', votes='$votes', visibility='$visibility', alb_password='$password', alb_password_hint='$password_hint',keyword='$keyword' WHERE aid='$aid' AND category='$category' LIMIT 1";
        }



Original code

Code: [Select]
if (GALLERY_ADMIN_MODE) {
            $query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title='$title', description='$description', category='$category', thumb='$thumb', uploads='$uploads', comments='$comments', votes='$votes', visibility='$visibility', alb_password='$password', alb_password_hint='$password_hint', keyword='$keyword' WHERE aid='$aid' LIMIT 1";
        }
       
        else {
            $category = FIRST_USER_CAT + USER_ID;
            $query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title='$title', description='$description', thumb='$thumb',  comments='$comments', votes='$votes', visibility='$visibility', alb_password='$password', alb_password_hint='$password_hint',keyword='$keyword' WHERE aid='$aid' AND category='$category' LIMIT 1";
        }
Title: Re: Moderators for Album pictures
Post by: fangweile on May 30, 2008, 07:38:38 am
Hello there,

I have this mod last time and it is perfectly working.

I just upgraded my coppermine gallery to 1.4.18 and apply this mod again manually.

I follow every instructions given and added and modified the coppermine files.

However, I am having an error when the moderator is trying to edit the files in the album

The error is
Quote
You don't have permission to perform this operation.

I already double check the code and I surely did modified and added the required codes.
I don't know what is seems the problem

Hope someone could help, thanks in advance.
Title: Re: Moderators for Album pictures
Post by: Gephri on June 26, 2008, 11:26:39 am
Whenever anyone tries to submit a comment they are given the 'empty_name_or_com' error message from db_input.php.

I've got Moderators for Album pictures installed and wonder if this could be creating the problem - if so how to fix?

thanks
Title: Re: Moderators for Album pictures
Post by: brenakie on July 02, 2008, 05:45:14 pm
Thanks for the mod, quick install and works great!!!
Title: Re: Moderators for Album pictures
Post by: Nibbler on July 24, 2008, 12:34:35 pm
Fix for album keyword issue should be:

find

Code: [Select]
        ########### Modified ###########

        if (GALLERY_ADMIN_MODE) {
            $moderator_group = $_POST['moderator_group'];
            $query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title='$title', description='$description', category='$category', thumb='$thumb', uploads='$uploads', comments='$comments', votes='$votes', visibility='$visibility', moderator_group='$moderator_group' WHERE aid='$aid' LIMIT 1";
        ################################

Change to

Code: [Select]
        ########### Modified ###########

        if (GALLERY_ADMIN_MODE) {
            $moderator_group = $_POST['moderator_group'];
            $query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title='$title', description='$description', category='$category', thumb='$thumb', uploads='$uploads', comments='$comments', votes='$votes', visibility='$visibility', moderator_group='$moderator_group', alb_password='$password', alb_password_hint='$password_hint', keyword='$keyword' WHERE aid='$aid' LIMIT 1";
        ################################
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on July 25, 2008, 08:43:07 am
Thanks Nibbler.
Title: Re: Moderators for Album pictures
Post by: stardust on August 02, 2008, 05:36:30 am
Thread is marked as being for cpg1.4.x, which means "any version from cpg1.4.0 to cpg1.4.10". So yes, it should work. Why don't you try and give us feedback if you succeeded?

Has anyone successfully used this in 1.4.18? I really want to use this mod but I have cpg1.4.18
Title: Re: Moderators for Album pictures
Post by: Nibbler on August 02, 2008, 02:08:29 pm
Should work on any version of 1.4
Title: Re: Moderators for Album pictures
Post by: stardust on August 03, 2008, 12:28:20 am
I got "Fatal Error" when trying to manually add it.

I run 1.4.18 with Stramm's modpack. I think my problem is editting my theme.php (I made a custom theme) because it doesn't have everything in themes.inc.php. Can someone help me edit themes.php with this mod?
Title: Re: Moderators for Album pictures
Post by: fangweile on August 03, 2008, 02:52:48 am
I also having problem installing the mod when I upgrade to cpg 1.4.18.

I have a fresh copy of all upgraded files and I manually edit the files cause I want to keep the updated cpg files.

HOwever, I am having problem with the modification in editpics.php despite of double checking the codes I added.
Perhaps there is a conflict with modification in updated editpics.php thats why I have this error "You don't have permission to perform this operation. " when logging in as moderator.

I just overwrite the original editpics.php with the same file attached @ 1st post to get it works.
And now my editpics.php is in Coppermine version: 1.4.3  ???

Title: Re: Moderators for Album pictures
Post by: Joachim Müller on August 03, 2008, 12:23:19 pm
Don't use the files attached to this thread, but apply the changes manually.
Title: Re: Moderators for Album pictures
Post by: stardust on August 04, 2008, 08:18:53 am
This is my theme.php (custom).
Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.8
  $Source$
  $Revision: 3116 $
  $Author: gaugau $
  $Date: 2006-06-08 00:11:54 +0200 (Do, 08 Jun 2006) $
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has all CORE items removed                                     //
// ------------------------------------------------------------------------- //

define('THEME_IS_XHTML10_TRANSITIONAL',1);
$template_sub_menu_spacer "::";
// Creates an array of tokens to be used with function assemble_template_buttons
// this function is used in this file it needs to be declared before being called.
function addbutton(&$menu,$href_lnk,$href_title,$href_tgt,$block_id,$spacer) {
  
$menu[]=array($href_lnk,$href_title,$href_tgt,$block_id,$spacer);
}
    
// HTML template for template sub_menu buttons
    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}
    
addbutton($sub_menu_buttons,'{CUSTOM_LNK_LNK}','{CUSTOM_LNK_TITLE}','{CUSTOM_LNK_TGT}','custom_link',$template_sub_menu_spacer);
    
addbutton($sub_menu_buttons,'Credits/Resources','Sources used by iTVXQ','http://www.itvxq.net/credits.php','custom2',$template_sub_menu_spacer);
    
addbutton($sub_menu_buttons,'Download Zipped Images','Download HQ images available in zipped folders','http://www.itvxq.net/download.php','custom2',$template_sub_menu_spacer);
    
addbutton($sub_menu_buttons,'{LASTCOM_LNK}','{LASTCOM_TITLE}','{LASTCOM_TGT}','lastcom',$template_sub_menu_spacer);
    
addbutton($sub_menu_buttons,'{LASTUP_LNK}','{LASTUP_TITLE}','{LASTUP_TGT}','lastup',$template_sub_menu_spacer);
    
addbutton($sub_menu_buttons,'{TOPN_LNK}','{TOPN_TITLE}','{TOPN_TGT}','topn'$template_sub_menu_spacer);
    
addbutton($sub_menu_buttons,'{SEARCH_LNK}','{SEARCH_TITLE}','{SEARCH_TGT}','search','');


// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

        <tr>
                        <td align="center" valign="middle" class="navmenu" width="100">
                        <a href="javascript:;" class="navmenu_pic" onclick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}">INFORMATION</a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="100%">
                        {PIC_POS}
                </td>
<!-- BEGIN report_file_button -->
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{REPORT_TGT}" class="navmenu_pic" title="{REPORT_TITLE}"><img src="{LOCATION}images/report.gif" border="0" align="middle" alt="{REPORT_TITLE}" /></a>
                </td>
<!-- END report_file_button -->
<!-- BEGIN ecard_button -->
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{ECARD_TGT}" class="navmenu_pic" title="{ECARD_TITLE}"><img src="{LOCATION}images/ecard.gif"  border="0" align="middle" alt="{ECARD_TITLE}" /></a>
                </td>
<!-- END ecard_button -->

                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}">PREV</a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}">NEXT</a>
                </td>
        </tr>

EOT;

// HTML template for title row of the thumbnail view (album title + sort options)
$template_thumb_view_title_row = <<<EOT

                        <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td width="100%" class="statlink"><h2>{ALBUM_NAME}</h2></td>
                                <td><img src="images/spacer.gif" width="1" alt="" /></td>
                                <td class="sortorder_cell">
                                        <table cellpadding="0" cellspacing="0">
                                        <tr>
                                                <td class="sortorder_options">{NAME}</td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&page={PAGE}&sort=na" title="{SORT_NA}">&nbsp;+&nbsp;</a></span></td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&page={PAGE}&sort=nd" title="{SORT_ND}">&nbsp;-&nbsp;</a></span></td>
                                        </tr>
                                        </table>
                                </td>
                        </tr>
                        </table>
EOT;

?>

It doesn't have everything that themes.inc.php has so I'm not sure how to manually edit with additions & modifications for that file. Can someone post my themes.php modified by this mod's theme.inc.php please?
Title: Re: Moderators for Album pictures
Post by: fangweile on August 04, 2008, 11:56:10 am
you have to go to your gallery include folder

yourgalleryroot/include/themes.inc.php

and add and modify the required files.

you don't have to edit your theme.php
Title: Re: Moderators for Album pictures
Post by: Nibbler on August 04, 2008, 01:03:03 pm
Don't modify themes.inc.php. Copy only what you need to change from the sample theme and then modify what you copied.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on August 05, 2008, 07:23:19 am
@stardust: Find the attached zip containing the files patched with this mod. Directly replace your existing files with the ones attached in the zip. Do take a backup before doing so.
Title: Re: Moderators for Album pictures
Post by: stardust on August 05, 2008, 07:44:45 am
Thanks for the zip! I tested it and still got Fatal Error. "init.inc.php" is the only file that is giving me the error. I tested the other files a few times & they don't hurt my gallery, but everytime I try to add init.inc.php I get Fatal Error. I'm not sure what the problem is, do you know?
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on August 05, 2008, 07:54:19 am
Did you added the field in the albums table in database? i.e. make sure you ran the query mentioned in the first post of this thread.
Title: Re: Moderators for Album pictures
Post by: stardust on August 05, 2008, 11:26:34 am
Forgot to do that again, haha ;D Thank you so much for everything! Everything is now working perfectly fine!
Title: Re: Moderators for Album pictures
Post by: fangweile on August 05, 2008, 01:36:22 pm
@stardust

Does your moderator now can edit files in your album?

Just curious  cause I still have this error "You don't have permission to perform this operation" when applying the mod in editpics.php cpg1.4.18 version ???
Title: Re: Moderators for Album pictures
Post by: stardust on August 06, 2008, 10:14:05 am
fangweile yes my moderators can edit files. If you applied the mod manually, make sure you did this:

I forgot to mark one of the modified lines with ###### and since you applied the mod manually you didn't knew that.

In editpics.php

Replace

Code: [Select]
        if ($cat != FIRST_USER_CAT + USER_ID && !GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);

with

Code: [Select]
        if ($cat != FIRST_USER_CAT + USER_ID && !GALLERY_ADMIN_MODE && !MODERATOR_EDIT_MODE) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);

This should solve your problem.


Abbas
Title: Re: Moderators for Album pictures
Post by: fangweile on August 07, 2008, 03:39:02 am
OMG, I missed to read that one, It is working fine now. It will saved my time if I read that early on. My bad.

thanks. ^_^
Title: Re: Moderators for Album pictures
Post by: fejker on November 04, 2008, 11:36:37 pm
I'm having partial success with this mod and cpg 1.4.18. I applied the mod manually and moderators can edit pictures that are already in the albums but they cannot approve newly uploaded pics. Seams like the "if statement" for the approve button is missing.

Can somebody please help me with this.
Title: Re: Moderators for Album pictures
Post by: Joachim Müller on November 04, 2008, 11:41:10 pm
Upgrade first.
Title: Re: Moderators for Album pictures
Post by: fejker on November 05, 2008, 12:13:27 am
Didn't even see the new version even though I checked today. Well ... I'll have a look, thanks.
Title: Re: Moderators for Album pictures
Post by: fejker on November 05, 2008, 11:07:04 pm
OK, the mod works now but I have one little problem. I'm not a PHP/coding expert and I changed the way the menu buttons are generated and don't know how to make use of the "if" statement with the new code.

Here's part of the code I added to themes.inc.php
Code: [Select]
// HTML template for template sys_menu buttons
if (!isset($sys_menu_buttons)) { //{THEMES}
  // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}
  $template_sys_menu = <<<EOT
    <span class="topmenu">
    <table border="0" cellpadding="0" cellspacing="6">
    <td class="admin_menu"><a href="{HOME_TGT}" title="{HOME_LNK}">{HOME_LNK}</a></td>
    <td class="admin_menu" id="admin_menu_anim"><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_LNK}</a></td>
  <!-- BEGIN my_gallery -->
    <td class="admin_menu"><a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a></td>
  <!-- END my_gallery -->

How can I insert the "if" statement in here to make the "Approve" button appear only to the moderators and admins. I changed the way buttons are generated only to have them look the same as other buttons. Is there any way to do this?

Thanks in advance.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on November 06, 2008, 08:01:05 am
The if statement should be

Code: [Select]
if (is_array($USER_DATA['allowed_albums']) && count($USER_DATA['allowed_albums'])) {
  // You button code here
}

Don't modify your themes.inc.php directly but rather make the changes in your theme.
Title: Re: Moderators for Album pictures
Post by: fejker on November 06, 2008, 10:06:44 am
The theme's theme.inc.php is almost empty.

If I put that if statement in there it doesn't work because of <<<EOT.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on November 06, 2008, 10:24:32 am
You will have to copy the theme section from themes/sample/theme.php to your theme.php and then modify it as you see fit.
Title: Re: Moderators for Album pictures
Post by: savdre on November 24, 2008, 01:44:37 am
I am so close to getting this to work properly... at least I think. I have read through this whole topic a few times and I am having difficutly getting the ability edit the file/pic as a moderator. I hope I can get some help.

So here is the summary:

1. Made the db change successfully.
2. Updated the files except I had difficulty updating the eyeball theme. I tried copying the entire sections from themes.inc.php file that required add/modifications that did not exist in the eyball theme. When that version is uploaded, the site goes blank if you are a moderator and logged in.

I tried leaving the eyball theme unchanged and update the theme.inc.php file. I can assign moderators to users and albums, and the edit link pops up on albums, but no imgaes are displayed when it is clicked on. if you go into an album and click on a pic, no buttons below the pic for editing.

I did add the unmarked edit to the editpcis file.

Attched is a zip with origingal files (anything with "copy of" is an original) and files with my modifications. The eyeball theme I tried to modifiy is titled "theme no good.php"

The theme.inc.php file has mods to it.

I have cpg 1.4.18. I have modified the layout of the theme to work with my site and also added a file types pluging and modified the site to play flash movies.

I have also created a test account - user: test   pw:test

I do have to admit that I am not a technical coder type... I'm a copy and paste kind of guy. Sorry of the answer is obvious to you guys but not me.


Thanks for the help in advance.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on December 02, 2008, 09:04:53 am
@savdre: I have updated the mod for cpg1419. Look at the first (http://forum.coppermine-gallery.net/index.php/topic,26218.msg120859.html#msg120859) post of this thread and see if this works for you. Also you are using cpg1418 which is outdated, so first upgrade to cpg1419.
Title: Re: Moderators for Album pictures
Post by: savdre on December 14, 2008, 09:14:59 pm
Abbas,

thanks for the response and advice. It took a while but I got the site upgraded to 1.4.19 and redid the moderator mods. It seems to be working right. I am using a customized version of the eyeball theme.

I could not fiugre out what modifications I need to make to these files, so I left them unchange. The eyeball theme.php does not have the same sections in the classic theme.php file you made that have modifications.

I have one other question. Are moderators supposed to see the edit options (crop & rotate, edite file info, delete) when they are on an idividual picture page?

Bet Regards,
Andreas
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on December 15, 2008, 05:54:02 am
I have one other question. Are moderators supposed to see the edit options (crop & rotate, edite file info, delete) when they are on an idividual picture page?

No.
Title: Re: Moderators for Album pictures
Post by: stardust on January 22, 2009, 04:49:08 am
If we have modpack for cpg1.4.19, do we have to edit files manually or can we still just replace the files with your zip?
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on January 22, 2009, 05:22:48 am
If we have modpack for cpg1.4.19, do we have to edit files manually or can we still just replace the files with your zip?

Edit manually.
Title: Re: Moderators for Album pictures
Post by: stardust on January 22, 2009, 04:35:08 pm
Thanks Abbas, I have one more question:

I have attached a new editpics.php. Replace your existing one with this and see how it goes. Moderators should be denied with all delete functionalities including comment deletion, resetting views and votes etc...



Is it okay to still use this attached zip for cpg1.4.19? I don't want mods to be able to delete or reset anything. I'm not sure how to manually add it to the 1.4.19 with a modpack though  :-\
Title: Re: Moderators for Album pictures
Post by: stardust on January 22, 2009, 04:38:32 pm
^ When I say "I'm not sure how to manually add it to the 1.4.19 with a modpack though ", I mean I don't know if I'll be removing anything from the modpack editfiles.php with this attached file when I manually add things from it. Could you make an editfiles.php that doesn't allow mods to delete or reset image settings (compatible with modpack for 1.4.19)
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on January 23, 2009, 05:36:02 am
Could you make an editfiles.php that doesn't allow mods to delete or reset image settings (compatible with modpack for 1.4.19)

Sorry - won't get enough time to do that.
Title: Re: Moderators for Album pictures
Post by: stardust on January 25, 2009, 02:22:16 am
well i went ahead & just replaced that attachment and it seems to be working fine with cpg1.4.19
Title: Re: Moderators for Album pictures
Post by: NenaGb on May 11, 2009, 11:55:11 pm
Hello ok I added this mod but didnt realize my version was 1.4.21 vs. 1.1.19 so my question is, is there an easy fix to get it working right w/out refreshing all the files and manually adding the mod. I of course was excited to see this and sleep deprived and didnt make a back up of my files so I will need to get them from the main cpg files to do so. I just wanted to ask if there was an easier way to fix whatever I goofed.

My error is that I do not see the delete button when logged in as moderator user, but in admin mode i do see that each album has drop down feature to select which group has access to moderate. I have selected manually each album to have moderator access to moderate pics but still when logged in as a moderator user I do not see any feature to allow to edit files.

My gallery is www.CaneCorsoGallery.com

Thank you in advance :)
Title: Re: Moderators for Album pictures
Post by: Joachim Müller on May 12, 2009, 08:09:20 am
This mod should work for all versions of cpg1.4.x - at least that's what it was designed for. From the initial posting:
Attached files are for cpg1.4.19. If you are using any other version then do the changes manually
So that's what you need to do: apply the changes manually.
Running an outdated version of coppermine is not an option - make sure to keep it up to date. Most recent stable release currently (as I'm typing this) is cpg1.4.22. Upgrade to the most recent version, then apply this mod manually.

@Abbas: I'm oppossed to keep outdated files in mod threads. I suggest removing the files and only providing manual mod instructions.
Title: Re: Moderators for Album pictures
Post by: Abbas Ali on May 14, 2009, 05:47:09 am
@Joachim: Thanks for the suggestion.

@All: I have updated my initial post with new instructions. From now onwards it is highly recommended to do the changes manually instead of replacing the files. Please read the Step 2 of my initial (http://forum.coppermine-gallery.net/index.php/topic,26218.msg120859.html#msg120859) post
Title: Re: Moderators for Album pictures
Post by: tcscottc on June 08, 2009, 08:03:38 am
I have followed the instruction from the revised first post (or so I thought) and I see no visual difference to my admin.  Not sure what to do to try and resolve...thanks in advance for any assistance in getting me down the right path.
Title: Re: Moderators for Album pictures
Post by: RickJ on March 06, 2010, 12:45:26 pm
Very useful mod this, I've applied the latest patch instructions to Coppermine 1.4.26 and run into one small bug.

The code changes appear to assume register-globals is on in PHP. If it's off (which is usually the default now), then one more line is required.

In db_input.php, just above the change already made:

after
       
Code: [Select]
$visibility = !empty($password) ? FIRST_USER_CAT + USER_ID : $visibility;
add
       
Code: [Select]
$moderator_group = (int)$_POST['moderator_group'];
Now it works fine. It adds just the extra bit of edit granularity I need.

I've also generated a patch file of the changes (excluding the theme) in case I need to re-apply them - took a long time and made a few typos doing it manually! The file is attached in case it's of use to anyone.

Rick Jones
Title: Re: Moderators for Album pictures
Post by: profili on November 04, 2010, 02:23:04 am
This plugin works for CPG 1.5 too?
Title: Re: Moderators for Album pictures
Post by: Joachim Müller on November 04, 2010, 08:29:25 am
This is not a plugin, but a hack of the core code. It probably doesn't work with cpg1.5.x, but you're not allowed that kind of question on this thread anyway - read up the sticky thread Don't ask for other versions (http://forum.coppermine-gallery.net/index.php/topic,24540.0.html) to find out why. Your question is cluttering this thread. Read up what a plugin is as well in the documentation: http://documentation.coppermine-gallery.net/en/plugins.htm#plugin_definition
cpg1.5.x comes with limited moderator capabilities built into it - read up the features it has got.
Locking.
Title: Re: Moderators for Album pictures
Post by: mr.bena on March 13, 2011, 06:41:41 pm
Hi this is very great feature that I really need. My question is, will the instructions and zip files work the same on cpg 1.5.x? I search like "Moderator for Album Pictures cpg 1.5.x" but I have not seen any result for cpg 1.5.x.
Title: Re: Moderators for Album pictures
Post by: mr.bena on March 13, 2011, 09:03:24 pm
Hi, I am using CPG 1.5.12, could you please tell me how can I appoint moderators in my gallery? I try to add or replace by referencing some of the code you have given in the above zip file, but I experience that in cpg 1.5.12 some of the code are already present and at the same time I could not find some of the code you instruct to replace. I hope there is a way to add moderation feature in cpg 1.5.12, I am really indeed of it!

Thank you in advanced.