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 ... 5 6 7 8 [9] 10 11   Go Down

Author Topic: Moderators for Album pictures  (Read 153502 times)

0 Members and 1 Guest are viewing this topic.

Nibbler

  • Guest
Re: Moderators for Album pictures
« Reply #160 on: February 21, 2008, 02:48:10 pm »

You are entering it into the wrong place I think. You need to use the tab 'SQL' and just paste it into the large text box.
Logged

radmofo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 31
Re: Moderators for Album pictures
« Reply #161 on: March 20, 2008, 04:24:33 pm »

Lovely mod! I can't thank you enough. I have one request- How do I add the "Crop Rotate" and "edit Picture information" under the intermediate image of displayimage.php if the user has the moderator permissions to manage the particular album the image is in?

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

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



Code: [Select]
if ((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) {
    $picmenu .= <<<EOT
     <a href="javascript:;" onclick="return MM_openBrWindow('picEditor.php?id={$CURRENT_PIC_DATA['pid']}','Crop_Picture','scrollbars=yes,toolbar=no,status=yes,resizable=yes')" class="admin_menu" >{$lang_display_image_php['crop_pic']}</a> <a href="editOnePic.php?id={$CURRENT_PIC_DATA['pid']}&amp;what=picture"  class="admin_menu">{$lang_display_image_php['edit_pic']}</a> <a href="delete.php?id={$CURRENT_PIC_DATA['pid']}&amp;what=picture"  class="admin_menu" onclick="return confirm('{$lang_display_image_php['confirm_del']}'); return false; ">{$lang_display_image_php['del_pic']}</a>
EOT;
Logged
Please give me some negative Karma. :)

DarkReflections

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Moderators for Album pictures
« Reply #162 on: March 27, 2008, 12:12:49 am »

I'm just about to upload and set up a new gallery. I'm using the new 1.4.16 files. If I do a standard replace with the files from this mod, will that mess it up?
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Moderators for Album pictures
« Reply #163 on: March 27, 2008, 11:47:31 am »

@radmofo: There is a global array $USER_DATA['allowed_albums'] which contains all albums to which the current users has access as moderators. So you will need to check whether the user has access to album which the current picture belongs and then show those buttons. You will also need add the same check in the file where the actual rotation takes place.

@DarkReflections: Do not replace file. Instead apply the mod manually.
Logged
Chief Geek at Ranium Systems

Nibbler

  • Guest
Re: Moderators for Album pictures
« Reply #164 on: March 29, 2008, 01:30:51 am »

You've removed a whole load of sql here:

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

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

Album passwords/hints and keywords can't be updated as admin.
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Moderators for Album pictures
« Reply #165 on: March 29, 2008, 06:05:20 am »

@Nibbler: you mean in my mod?
Logged
Chief Geek at Ranium Systems

Nibbler

  • Guest
Re: Moderators for Album pictures
« Reply #166 on: March 29, 2008, 02:38:47 pm »

Yeah. db_input.php
Logged

radmofo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 31
Re: Moderators for Album pictures
« Reply #167 on: April 18, 2008, 04:48:55 am »

Hmmm.. I'm using this code, not sure what to change. It looks as if admin wot be able to  update password, hint and keywords. Not sure yet though.

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



Original code

Code: [Select]
if (GALLERY_ADMIN_MODE) {
            $query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title='$title', description='$description', category='$category', thumb='$thumb', uploads='$uploads', comments='$comments', votes='$votes', visibility='$visibility', alb_password='$password', alb_password_hint='$password_hint', keyword='$keyword' WHERE aid='$aid' LIMIT 1";
        }
       
        else {
            $category = FIRST_USER_CAT + USER_ID;
            $query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title='$title', description='$description', thumb='$thumb',  comments='$comments', votes='$votes', visibility='$visibility', alb_password='$password', alb_password_hint='$password_hint',keyword='$keyword' WHERE aid='$aid' AND category='$category' LIMIT 1";
        }
Logged
Please give me some negative Karma. :)

fangweile

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 103
  • Saranghaeyo ^_^
    • All Koreans - Home of Korean Actors and Actresses
Re: Moderators for Album pictures
« Reply #168 on: May 30, 2008, 07:38:38 am »

Hello there,

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

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

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

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

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

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

Hope someone could help, thanks in advance.
Logged
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: Moderators for Album pictures
« Reply #169 on: June 26, 2008, 11:26:39 am »

Whenever anyone tries to submit a comment they are given the 'empty_name_or_com' error message from db_input.php.

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

thanks
Logged

brenakie

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 31
Re: Moderators for Album pictures
« Reply #170 on: July 02, 2008, 05:45:14 pm »

Thanks for the mod, quick install and works great!!!
Logged

Nibbler

  • Guest
Re: Moderators for Album pictures
« Reply #171 on: July 24, 2008, 12:34:35 pm »

Fix for album keyword issue should be:

find

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

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

Change to

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

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

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Moderators for Album pictures
« Reply #172 on: July 25, 2008, 08:43:07 am »

Thanks Nibbler.
Logged
Chief Geek at Ranium Systems

stardust

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
Re: Moderators for Album pictures
« Reply #173 on: August 02, 2008, 05:36:30 am »

Thread is marked as being for cpg1.4.x, which means "any version from cpg1.4.0 to cpg1.4.10". So yes, it should work. Why don't you try and give us feedback if you succeeded?

Has anyone successfully used this in 1.4.18? I really want to use this mod but I have cpg1.4.18
Logged

Nibbler

  • Guest
Re: Moderators for Album pictures
« Reply #174 on: August 02, 2008, 02:08:29 pm »

Should work on any version of 1.4
Logged

stardust

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
Re: Moderators for Album pictures
« Reply #175 on: August 03, 2008, 12:28:20 am »

I got "Fatal Error" when trying to manually add it.

I run 1.4.18 with Stramm's modpack. I think my problem is editting my theme.php (I made a custom theme) because it doesn't have everything in themes.inc.php. Can someone help me edit themes.php with this mod?
Logged

fangweile

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 103
  • Saranghaeyo ^_^
    • All Koreans - Home of Korean Actors and Actresses
Re: Moderators for Album pictures
« Reply #176 on: August 03, 2008, 02:52:48 am »

I also having problem installing the mod when I upgrade to cpg 1.4.18.

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

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

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

Logged
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Moderators for Album pictures
« Reply #177 on: August 03, 2008, 12:23:19 pm »

Don't use the files attached to this thread, but apply the changes manually.
Logged

stardust

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
Re: Moderators for Album pictures
« Reply #178 on: August 04, 2008, 08:18:53 am »

This is my theme.php (custom).
Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

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

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

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


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

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

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

EOT;

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

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

?>

It doesn't have everything that themes.inc.php has so I'm not sure how to manually edit with additions & modifications for that file. Can someone post my themes.php modified by this mod's theme.inc.php please?
Logged

fangweile

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 103
  • Saranghaeyo ^_^
    • All Koreans - Home of Korean Actors and Actresses
Re: Moderators for Album pictures
« Reply #179 on: August 04, 2008, 11:56:10 am »

you have to go to your gallery include folder

yourgalleryroot/include/themes.inc.php

and add and modify the required files.

you don't have to edit your theme.php
Logged
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희
Pages: 1 ... 5 6 7 8 [9] 10 11   Go Up
 

Page created in 0.033 seconds with 21 queries.