Moderators for Album pictures - Page 9 Moderators for Album pictures - Page 9
 

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]

Main Menu

Moderators for Album pictures

Started by Abbas Ali, January 09, 2006, 09:01:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nibbler

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.

radmofo

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']}&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;
Please give me some negative Karma. :)

DarkReflections

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?

Abbas Ali

@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.
Chief Geek at Ranium Systems

Nibbler

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.

Abbas Ali

Chief Geek at Ranium Systems

Nibbler


radmofo

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";
        }

Please give me some negative Karma. :)

fangweile

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
QuoteYou 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.
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희

Gephri

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

brenakie

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

Nibbler

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";
        ################################

Abbas Ali

Chief Geek at Ranium Systems

stardust

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

Nibbler

Should work on any version of 1.4

stardust

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?

fangweile

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

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

Joachim Müller

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

stardust

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}">&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?

fangweile

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
[My Coppermine Galleries]
All Koreans, Lim Eun-kyeong's IFC
Saranghae 김태희