<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.3.2 //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002-2004 Gregory DEMAR //
// http://www.chezgreg.net/coppermine/ //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team //
// (http://coppermine.sf.net/team/) //
// see /docs/credits.html for details //
// ------------------------------------------------------------------------- //
// 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. //
// ------------------------------------------------------------------------- //
/*
$Id: modifyalb.php,v 1.4 2004/11/23 03:07:57 joe Exp $
*/
define('IN_COPPERMINE', true);
define('MODIFYALB_PHP', true);
include("include/init.inc.php");
if (!(GALLERY_ADMIN_MODE || USER_ADMIN_MODE)) {
cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}
// Type 0 => input
// 1 => yes/no
// 2 => Category
// 3 => Textarea
// 4 => Album thumbnail
// 5 => Album visibility
// add footnote
$notice1 = ' *';
$captionLabel = $lang_modifyalb_php['alb_desc'];
if ($CONFIG['show_bbcode_help']) {$captionLabel .= '<hr />'.$lang_bbcode_help;}
$data = array($lang_modifyalb_php['general_settings'],
array($lang_modifyalb_php['alb_title'], 'title', 0),
array($lang_modifyalb_php['alb_cat'], 'category', 2),
array($captionLabel, 'description', 3),
array($lang_modifyalb_php['alb_thumb'], 'thumb', 4),
);
if (!ereg('Globat', $CONFIG['display_theme'])) {
array_push($data, $lang_modifyalb_php['alb_perm']);
array_push($data, array($lang_modifyalb_php['can_view']), 'visibility', 5);
array_push($data, array($lang_modifyalb_php['can_upload'].$notice1), 'uploads', 1);
array_push($data, array($lang_modifyalb_php['can_post_comments'].$notice1), 'comments', 1);
array_push($data, array($lang_modifyalb_php['can_rate'].$notice1), 'votes', 1);
} else {
array_push($data, "
<br><table border=0 cellpadding=0 cellspacing=0 width='100%'>
<tr><td><img src='images/icon_protectphoto.gif'></td><td width='100%' class='status'>
To edit your photo permissions, please use the
<a href='http://login.globat.com/cp2/gallery_users.php'>GlobatGallery
User Permissions Editor</a> in the
<a href='http://login.globat.com/cp2/gallery_users.php'>Globat Command Console.</a>
<br><br></td></tr></table><br>
");
}
if (!isset($HTTP_GET_VARS['album'])) {
if (GALLERY_ADMIN_MODE) {
$results = mysql_query("SELECT * FROM {$CONFIG['TABLE_ALBUMS']} WHERE 1 LIMIT 1");
} else {
$results = mysql_query("SELECT * FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = " . (FIRST_USER_CAT + USER_ID) . " LIMIT 1");
}
if (mysql_num_rows($results) == 0) cpg_die(ERROR, $lang_modifyalb_php['err_no_alb_to_modify'], __FILE__, __LINE__);
$ALBUM_DATA = mysql_fetch_array($results);
$album = $ALBUM_DATA['aid'];
} else {
$album = (int)$HTTP_GET_VARS['album'];
$results = mysql_query("SELECT * FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='$album'");
if (!mysql_num_rows($results)) cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
$ALBUM_DATA = mysql_fetch_array($results);
}
$cat = $ALBUM_DATA['category'];
$actual_cat = $cat;
if (!GALLERY_ADMIN_MODE && $ALBUM_DATA['category'] != FIRST_USER_CAT + USER_ID) {
cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
}
pageheader(sprintf($lang_modifyalb_php['upd_alb_n'], $ALBUM_DATA['title']));
starttable("100%");
echo <<<EOT
<tr>
<td colspan="2" align="left">
<br><table border=0 cellpadding=0 cellspacing=0 width='100%'>
<tr><td><img src='images/icon_protectphoto.gif'></td><td width='100%' class='status'>
To edit your photo permissions, please use the
<a href='http://login.globat.com/cp2/gallery_users.php'>GlobatGallery
User Permissions Editor</a> in the
<a href='http://login.globat.com/cp2/gallery_users.php'>Globat Command Console.</a>
<br><br></td></tr></table><br>
</td>
</tr>
<tr>
<form action="http://login.globat.com/cp2/gallery_users.php">
<td colspan="2" align="center" class="tablef">
<input type="submit" class="button" value="GlobatGallery User Permissions Editor">
</td>
</form>
</tr>
EOT;
endtable();
pagefooter();
ob_end_flush();
?>