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.
Do make
backups before applying this mod.
Step 1Modify the database table cpgPrefix_albums by running following query (Use phpMyadmin or other application)
Replace Prefix with your prefix for database tables.
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.zipStep 2Download 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.zipP.S: Thanks to Nibbler and amirw2k for fixing bugs in previous version.
Abbas.
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
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.
Very-very good mod!
request: edit comment for moderator?
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
Quote from: andrewshu329 on January 15, 2006, 10:34:35 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?
SQL-query for default `moderator_group`= groupID (Use phpMyadmin or other application).
___________________
I am sorry for my bad english. I do not know it.
Quote from: andrewshu329 on January 15, 2006, 10:34:35 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.
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.
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
$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
$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
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.
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.
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 :(
Hmmm.... Will do it whenver i get some free time. Can't promise anything ;)
Great :)
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?
Quote from: gabbadude on March 12, 2006, 02:40:31 PM
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
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.
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)?
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.
Make sure that you have the following code in your init.inc.php file
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'];
}
}
}
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)
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
print_r($USER_DATA['allowed_albums']);
just after
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
added the snippet, where should i see the output ? dont see anything
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.
www.grafflix.org/flix/index.php
Really dont see anything.
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).
I have readded the mod. Didnt do any good though.
Gave you a pm with some login stuff.
Tnx
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....
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.
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
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....
Ok thanks alot, meanwhile ill try to come up with another solution.
Hi Abbas,
GauGau kindly directed me to the original thread on Moderator and then this. From your orignal post, you stated:
Quote from: 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
- 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:
Quote from: n3n on April 14, 2006, 11:55:07 AM...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
@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
Quote from: Abbas Ali on April 21, 2006, 05:44:47 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
what's different between moderator1.1 with moderator 1.0 ?
No new features..just some bug fixes. You should use version 1.1
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.
What error message does it gives? Or what exactly happens? Please give more details.
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. :)
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!
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
if ($cat != FIRST_USER_CAT + USER_ID && !GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
with
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
Thanks! Now it seems to work....thanks a lot!
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
This is mod , it means you need to apply it manually.
zip files are attache to first (initial) post
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
It's under ToDo List for feature version (1.5)
Would it be possible to add a link to edit that specific image, next to the link "delete".
Just like an admin.
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!
change the part that say prefix to be whatever your coppermine is
mine was cpg143_albums
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).
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)
Quote from: jans on October 21, 2006, 11:45:48 PM
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.
Will this mod work with the latest version?
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?
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
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.
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)
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.
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.
In delete.php (somewhere around line 290)
Replace
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos) VALUES ('$category', '" . addslashes($op['album_nm']) . "', 'NO', '{$op['album_sort']}')";
with
$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.
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.
Disregard that last post I figured it out. friggin beautiful man :)
Thanks for the help the autoassign is working perfectly.
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.
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.
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.
Still havn't figured out what the problem is moderators are still group_id 2 "Registered"
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.
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?
@Daft: Don't know what to tell you :(.
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.
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 queryALTER TABLE `cpgPrefix_albums` DROP `moderator_group`
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.
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]
Replace cpgPrefix_ in the sql query with the prefix you are using. Ex cpg1410_.
:-\ i should know better to post before i had a cup of coffee
Sorry Abbas
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 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
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.
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 ;)
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...
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 ;)
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)
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
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.
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 ;)
Is it possible to allow moderators move pictures from album to another in same category?
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.
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
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.
@Hein: You forgot to give your gallery URL.
@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.
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
Quote from: 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
if ($cat != FIRST_USER_CAT + USER_ID && !GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
with
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
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 define('SILLY_SAFE_MODE', 1);
in config.inc.php right after <?php
Regards,
Hein
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 ? )
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
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.
Ok Abbas. Thanks for the answer. If you say it's complex to code i believe it :)
Thanks again for a great mod
Hein
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,
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?
Make sure that you edited themes.inc.php properly. Attach your themes.inc.php here.
Here is the themes.inc.php from my gallery.
Thank you for looking at this...your help is much appreciated.
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.
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.
@dr9a8c: I didn't received any PM from you as yet.
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! ;)
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???
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.
this may be obvious but I'd like to confirm that moderator1.1 is not meant to work with bridged CPG + phpBB's - right?
Should work fine.
@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.
@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.
By PM
Quote from: dr9a8c on March 10, 2007, 04:29:52 AM
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
if (!is_array($USER_DATA['allowed_albums']) || !count($USER_DATA['allowed_albums'])) {
template_extract_block($template_sys_menu, 'upload_approval');
}
just after
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.
global $AUTHORIZED, $CONFIG, $album, $actual_cat, $cat, $REFERER, $USER_DATA;
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.
You probably didn't modified your theme.php correctly which shows the upload approval button.
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?
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.
Sorry
URL
http://forum.coppermine-gallery.net/index.php?action=dlattach;topic=26218.0;attach=3384
No problem with downloading here.
I get version 1.0 file fine - 1.1 gets that error.
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.
Thanks worked great :D
MP
I integrate moderator1.1 (manual after stramm modpack), but no works ???
No errors & not work...
Quote from: lamehh on April 24, 2007, 12:41:29 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.
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
Check that you edited correct theme file.
Quote from: Abbas Ali on April 25, 2007, 09:22:16 AM
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 :(
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.
Quote from: GauGau on April 25, 2007, 06:51: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?
uff, so anybody help me? where is error and how fix?
when moderator login not have button for approving pictures...
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?
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?
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.
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
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.
Or do you can help me to make that?
It is very important for me so I hope you help me please :)
Would look into this if i get time. Will require quite a bit of time and programming.
Thx :) that would be very great.
:) :) :) :)
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
the fault is in the functions.inc file if i upload that one i get the error
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?
You should apply the changes marked in the files provided to your own files instead of using the provided files as they are.
man still doenst seem to work properly i dont get it
Quote from: kadafu on August 22, 2007, 08:27:40 PM
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".
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. ^_^
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
Quote from: herbuel on November 18, 2007, 03:05:52 PM
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...?
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.
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
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:
// 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 -
You probably didn't added other code in modifyalb.php. Make sure that you have modified the file as per instructions.
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:
********************************************
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
There are 3 changes in modifyalb.php and not 2. So you are obviously missing the below mentioned change
case 7:
form_password_hint($element[0],$element[1]);
break;
########## Added ##########
case 8 :
form_moderator($element[0], $element[1]);
break;
##########################
"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!
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.
^ 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]
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)
I looked to replace the prefix, but I dont seem to have any...Here is my table...
Your prefix is cpg_
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!!!!
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.
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.
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']}&what=picture" class="admin_menu">{$lang_display_image_php['edit_pic']}</a> <a href="delete.php?id={$CURRENT_PIC_DATA['pid']}&what=picture" class="admin_menu" onclick="return confirm('{$lang_display_image_php['confirm_del']}'); return false; ">{$lang_display_image_php['del_pic']}</a>
EOT;
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?
@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.
You've removed a whole load of sql here:
########### 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.
@Nibbler: you mean in my mod?
Yeah. db_input.php
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
########### 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
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";
}
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 isQuoteYou 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.
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
Thanks for the mod, quick install and works great!!!
Fix for album keyword issue should be:
find
########### 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
########### 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";
################################
Thanks Nibbler.
Quote from: 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?
Has anyone successfully used this in 1.4.18? I really want to use this mod but I have cpg1.4.18
Should work on any version of 1.4
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?
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 ???
Don't use the files attached to this thread, but apply the changes manually.
This is my theme.php (custom).
<?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}"> + </a></span></td>
<td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&page={PAGE}&sort=nd" title="{SORT_ND}"> - </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?
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
Don't modify themes.inc.php. Copy only what you need to change from the sample theme and then modify what you copied.
@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.
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?
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.
Forgot to do that again, haha ;D Thank you so much for everything! Everything is now working perfectly fine!
@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 ???
fangweile yes my moderators can edit files. If you applied the mod manually, make sure you did this:
Quote from: 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
if ($cat != FIRST_USER_CAT + USER_ID && !GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
with
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
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. ^_^
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.
Upgrade first.
Didn't even see the new version even though I checked today. Well ... I'll have a look, thanks.
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
// 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.
The if statement should be
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.
The theme's theme.inc.php is almost empty.
If I put that if statement in there it doesn't work because of <<<EOT.
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.
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.
@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.
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
Quote from: savdre on December 14, 2008, 09:14:59 PM
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.
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?
Quote from: 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?
Edit manually.
Thanks Abbas, I have one more question:
Quote from: 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...
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 :-\
^ 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)
Quote from: stardust on January 22, 2009, 04:38:32 PM
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.
well i went ahead & just replaced that attachment and it seems to be working fine with cpg1.4.19
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 :)
This mod should work for all versions of cpg1.4.x - at least that's what it was designed for. From the initial posting:
Quote from: Abbas Ali on January 09, 2006, 09:01:58 AM
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.
@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
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.
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
$visibility = !empty($password) ? FIRST_USER_CAT + USER_ID : $visibility;
add
$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
This plugin works for CPG 1.5 too?
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.
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.
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.