Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

Author Topic: Moderators for Upload Approval (1.4.x)  (Read 41003 times)

0 Members and 1 Guest are viewing this topic.

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Moderators for Upload Approval (1.4.x)
« on: December 01, 2005, 11:23:37 am »

Here is the moderators for upload approval mod for cpg 1.4.x. Admin can assign moderator group for each album to approve the uploads of that album from album properties page.

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 place
modifyalb.php, db_input.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.

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.

The newly added lines are marked with
######### Added ##########
some code
#########################

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

This will make it easy for you too see the diff and modify your scripts.

For those who are using themes other then classic, they will have to modify their respective theme file. In the pack the modifications are for classic theme.

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


Abbas.


Note: Please download moderator1.1.zip
« Last Edit: December 09, 2005, 01:32:15 pm by Abbas Ali »
Logged
Chief Geek at Ranium Systems

rootyb

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Moderators for Upload Approval (1.4.x)
« Reply #1 on: December 08, 2005, 07:23:32 pm »

Hiya,
 
I tried installing this mod, and I'm fairly certain I followed all of your directions. Once I got it installed, I tried to set a mod group for one of my albums. I selected the group and hit "Update album", and it took me to a screen that said "no upate needed". Above that was a block that said "You are running Coppermine 1.5.0 (alpha) which is only meant for very experienced users - this version comes without support nor any warranties. Use it at your own risk or downgrade to the latest stable version if you need support!"

Thing is, I'm running 1.4.2.

Also, I'm using SMF Bridging. Could that be causing this problem?

Thanks!


/edit: Okay, got rid of the "You are running Coppermine 1.5.0..." message. Went in and manually added the changes to my init.inc.php file. I'll try manually adding all of the changes instead of uploading, and post back my results.


/edit2: Alright, manually edited the files, but when I choose a moderating group and hit "update album", it still says "no update needed", and doesn't save the setting.
« Last Edit: December 08, 2005, 10:16:04 pm by rootyb »
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Moderators for Upload Approval (1.4.x)
« Reply #2 on: December 09, 2005, 06:33:25 am »

I think you missed db_input.php modifications. Please make sure that you have modified/replaced db_input.php file.

Also from where did you downloaded cpg? cpg1.5.0 is the devel version and you must have got it from cvs. I recommend you use the stable 1.4.2 version.
Logged
Chief Geek at Ranium Systems

rootyb

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Moderators for Upload Approval (1.4.x)
« Reply #3 on: December 09, 2005, 12:29:44 pm »

Nope, didn't miss DB_Input. I've tried it several times, now.

Also, I'm not using 1.5.0. I'm on 1.4.2. All of the files you uploaded are marked 1.5.0, though. Maybe that's my issue?

Also, I'm not using the classic theme. Using caliSkinV6. I missed that part of the directions, and didn't mod my theme file directly. Not sure what file(s) to edit in my theme folder, though.



From (for example) the header of the db_input file in your zip:

Quote
  ********************************************
  Coppermine version: 1.5.0
  $Source: /cvsroot/coppermine/devel/db_input.php,v $
  $Revision: 1.53 $
  $Author: gaugau $
  $Date: 2005/11/28 07:24:06 $
**********************************************/
« Last Edit: December 09, 2005, 12:45:35 pm by rootyb »
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Moderators for Upload Approval (1.4.x)
« Reply #4 on: December 09, 2005, 01:25:56 pm »

Actually i picked the files from devel branch, hence my mistake. Anyways it shouldn't afftect the working of mod. But for safety i have uploaded moderator1.1.zip in my first post. Please see if this works.
Logged
Chief Geek at Ranium Systems

rootyb

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Moderators for Upload Approval (1.4.x)
« Reply #5 on: December 09, 2005, 05:01:21 pm »

Got the new version downloaded and installed. Didn't change anything. Switched back to the default theme. That let me save the settings. Switched back to my theme. Looks like it saved the setting.

For future reference, what would someone need to edit in their theme files to make this work?


/edit: Nevermind. Looks like the setting wasn't saved.
« Last Edit: December 09, 2005, 05:42:15 pm by rootyb »
Logged

amirw2k

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 37
Re: Moderators for Upload Approval (1.4.x)
« Reply #6 on: December 10, 2005, 04:24:00 am »

This is great, thanks for the upgrade !

I've got a small problem. I'm using a bridged version so a user can be a memeber of many usergroups. This causes a problem because I'm not sure how the following line is validated:

File: init.inc.php
Code: [Select]
$result = cpg_db_query("SELECT DISTINCT(aid) FROM {$CONFIG['TABLE_ALBUMS']} WHERE moderator_group='{$USER_DATA['group_id']}'");
Looks like it checks only one usergroup, and it's probably the first usergroup found. What if the user is a member of two usergroups or more? Is there any fix for this?

EDIT: To solve this problem, I replaced the above line with the following:
Code: [Select]
$result = cpg_db_query("SELECT DISTINCT(aid) FROM {$CONFIG['TABLE_ALBUMS']} WHERE moderator_group IN ".USER_GROUP_SET);
I still have some permission issues, and I'm checking the code.
« Last Edit: December 10, 2005, 04:58:22 am by amirw2k »
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Moderators for Upload Approval (1.4.x)
« Reply #7 on: December 10, 2005, 06:02:10 am »

@amirw2k: I made the mod considering standalone version. Never intended to make it for bridged installations. If you succeed in porting the mod for bridged installation then pls put up the files here so that others are benifitted.

@rootyb: Please attach the files you are using (those 6 files). Also if you can PM me your admin un/pass then i will take a look.
« Last Edit: December 10, 2005, 06:14:01 am by Abbas Ali »
Logged
Chief Geek at Ranium Systems

rootyb

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Moderators for Upload Approval (1.4.x)
« Reply #8 on: December 10, 2005, 07:34:36 pm »

Alright, here's my modded files, compressed with the directory structure in which I upload them.


Like I said, though, I'm using the SMF bridge, and the group I'm trying to setup for upload approvals is one of my SMF groups. I didn't realize that this wasn't intended for bridged situations. When I disable the bridge, it works as intended.


Sooo, I'm looking forward to seeing Amirw2k's modified files. :)
Logged

Nibbler

  • Guest
Re: Moderators for Upload Approval (1.4.x)
« Reply #9 on: December 10, 2005, 07:49:56 pm »

Code: [Select]
$moderator_group = $HTTP_POST_VARS['moderator_group'];

That should be $_POST now since this is 1.4 code.

Once you fix the multiple usergroups issue as suggested by amirw2k you'll be fine. Coppermine by default supports multiple group membership, so it's not a bridge related issue atall.
Logged

rootyb

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Moderators for Upload Approval (1.4.x)
« Reply #10 on: December 10, 2005, 10:24:22 pm »

Awesome. I only needed to change that in db_input.php, right?

That, along with amirw2k's fix (partial though it may be) looks like it's working for what I need.

I've zipped up the files and attached 'em, if anyone wants to use them. It's working with my SMF bridge, and I haven't noticed any problems yet. If any come up, I'll come say so (don't count on me being able to fix it, though. I'm fairly worthless when it comes to code, but I'm learning as I have to fix stuff here and there.)

No guarantees as to its usefulness, but it's working for me. :)



/edit: Oh, also, I'll probably hit up one of my codemonkies for this, but how hard would it be to change the drop-down box to checkboxes, so you can have more than one group moderating upload approval? :)

Not at all necessary, since you can always add a new group just for approving pictures, and assign it to people that need to be in it, but being able to allow a couple of groups would be nice for bridged situations.
« Last Edit: December 10, 2005, 10:33:47 pm by rootyb »
Logged

dazzler

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 12
    • Minidirectory
Re: Moderators for Upload Approval (1.4.x)
« Reply #11 on: February 12, 2006, 07:47:11 pm »

Guys i am really new to this i am stuck at the making of the moderators group..... i have got the files inplace ready to use...

will i have any probs as my user database is combined with SMF?
Logged
Find your local miniclub at the  *Link Removed*

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Moderators for Upload Approval (1.4.x)
« Reply #12 on: February 13, 2006, 06:18:47 am »

It shouldn't be a problem. But please make backups before proceeding.
Logged
Chief Geek at Ranium Systems

dazzler

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 12
    • Minidirectory
Re: Moderators for Upload Approval (1.4.x)
« Reply #13 on: February 13, 2006, 04:06:06 pm »

Hello Abbas Ali, thank you for your response..

I went in to my My phpmyadmin... some where i ahve never had to go.. i found the dates base... i am just not sure how to Create the modorators group or what settings to use as this didnt look very simple when i had a play...

Good job i backed everything up as i have already had to restore my coppermine already thorugh playing and learning.

I am a fast learner and a few monements on your time with this would be greatfully recieved.

A quick "How to" with the creation part would see my instalation finshed.

Thanking you in advance

Daz

Oh a link to my site where i have it is www.minidirectory.co.uk/forum under the gallery tab
Logged
Find your local miniclub at the  *Link Removed*

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Moderators for Upload Approval (1.4.x)
« Reply #14 on: February 14, 2006, 06:31:57 am »

The HOW TO is given in my very first post. In database you just need to run one query given in my first post. Read my first post carefully and follow the instructions given there.
Logged
Chief Geek at Ranium Systems

Glenn

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Moderators for Upload Approval (1.4.x)
« Reply #15 on: February 26, 2006, 08:54:07 am »

Hello,

I applied your patch and get the following error.

Code: [Select]
Parse error: parse error, unexpected ')' in /home/httpd/vhosts/domainremoved.com.au/subdomains/playerpix/httpdocs/include/init.inc.php on line 403
Please advise.

Thanks

Glenn

EDIT: For some reason some of the files did not FTP to the site - I copied them up again and things look better...
« Last Edit: February 26, 2006, 09:15:03 am by Glenn »
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Moderators for Upload Approval (1.4.x)
« Reply #16 on: February 27, 2006, 06:05:57 am »

It means that it is working now?
Logged
Chief Geek at Ranium Systems

andreas_

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Moderators for Upload Approval (1.4.x)
« Reply #17 on: October 29, 2006, 10:18:31 pm »

I've followed the above instructions of the first post, hopefully I did everything right.

In Album properties a new tag "Album can be moderated by" appeared, I switched it to group 'Manager'.
Unforunatelly logging on as a member of that group there's no special feature added to upload pictures or change them.
What did I wrong? For testing I changed to english language und Classic Theme.

Logged

andreas_

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Moderators for Upload Approval (1.4.x)
« Reply #18 on: October 29, 2006, 10:42:53 pm »

Sorry, my fault.. everything is working fine now.

Thanks for the mod!
Logged

Bazzah

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Moderators for Upload Approval (1.4.x)
« Reply #19 on: October 30, 2006, 02:15:03 pm »

I have been trying to get this mod to run all day, but as soon as I upload init.inc.php, all member groups other than administrators receive 'fatal error' message, and can not access the gallery. I am using a bridge between IPB and CPG 1.4.10, but I can not see how this would interfere. I have only installed a few mods, so I am pretty clueless, so any help would be greatly appreciated.
Logged
Pages: [1] 2   Go Up
 

Page created in 0.055 seconds with 19 queries.