Hi, I tried to solve this one. Here is my solution. It worked for me.
I have a usergroup called "Uploader", which I wanted to allow to upload files to public albums through XP Publisher.
To get that working for this usergroup, edit xp_publish.php as following:
(If you have another usergroup, change this name in the following code accordingly)
search:
<!-- END existing_albums -->
<!-- BEGIN create_album -->
replace with:
<!-- END existing_albums -->
<!-- BEGIN create_special -->
<form method="post" id="createAlb" action="{POST_ACTION}">
<input type="hidden" id="newAlbName" name="new_alb_name" value="" maxlength="255" />
</form>
<!-- END create_special -->
<!-- BEGIN create_album -->
--------------------------------------------------------------
search:
if (USER_IS_ADMIN) {
$public_albums = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " ORDER BY title");
if (mysql_num_rows($public_albums)) {
$public_albums_list = cpg_db_fetch_rowset($public_albums);
} else {
$public_albums_list = array();
}
} else {
$public_albums_list = array();
}
replace with:
if (USER_IS_ADMIN) {
$public_albums = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " ORDER BY title");
if (mysql_num_rows($public_albums)) {
$public_albums_list = cpg_db_fetch_rowset($public_albums);
} else {
$public_albums_list = array();
}
} elseif (USER_GROUP == 'Uploader') {
$public_albums = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " AND uploads='YES' ORDER BY title");
if (mysql_num_rows($public_albums)) {
$public_albums_list = cpg_db_fetch_rowset($public_albums);
} else {
$public_albums_list = array();
}
} else {
$public_albums_list = array();
}
--------------------------------------------------------------
search:
if (!(USER_CAN_CREATE_ALBUMS || USER_IS_ADMIN)) {
template_extract_block($template_select_album, 'existing_albums');
template_extract_block($template_select_album, 'create_album');
replace with:
if (USER_IS_ADMIN || (USER_GROUP == 'Uploader')) {
$user_is_admin_xp = 1;
}
if (!(USER_CAN_CREATE_ALBUMS || $user_is_admin_xp)) {
template_extract_block($template_select_album, 'existing_albums');
template_extract_block($template_select_album, 'create_album');
template_extract_block($template_select_album, 'create_special');
--------------------------------------------------------------
search:
if (!USER_IS_ADMIN) template_extract_block($template_select_album, 'select_category');
replace with:
if (!$user_is_admin_xp) template_extract_block($template_select_album, 'select_category');
if (USER_GROUP == 'Uploader') template_extract_block($template_select_album, 'create_album');
--------------------------------------------------------------
search (yes, once again):
if (!USER_IS_ADMIN) template_extract_block($template_select_album, 'select_category');
replace with:
if (!$user_is_admin_xp) template_extract_block($template_select_album, 'select_category');
if (USER_GROUP == 'Uploader') template_extract_block($template_select_album, 'create_album');
--------------------------------------------------------------
search:
global $lang_db_input_php, $lang_errors;
@unlink(LOGFILE);
replace with:
global $lang_db_input_php, $lang_errors;
if (USER_IS_ADMIN || (USER_GROUP == 'Uploader')) {
$user_is_admin_xp = 1;
}
@unlink(LOGFILE);
--------------------------------------------------------------
search:
// Check if the album id provided is valid
if (!USER_IS_ADMIN) {
replace with:
// Check if the album id provided is valid
if (!$user_is_admin_xp) {