Ok, so this is a little more complicated than first thought.
I have got it working the way that I want now, and am posting this in case anyone else wants to do the same as me in future.
To enable users to upload to a public album this check also has to be commented out:
xp_publish.php (line 729)
if (!USER_IS_ADMIN) {
$result = cpg_db_query("SELECT category FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='$album' and category = '" . (USER_ID + FIRST_USER_CAT) . "'");
if (mysql_num_rows($result) == 0) simple_die(ERROR, $lang_db_input_php['unknown_album'], __FILE__, __LINE__);
$row = mysql_fetch_array($result);
mysql_free_result($result);
$category = $row['category'];
} else {
comment out the lines as shown
if (!USER_IS_ADMIN) {
// $result = cpg_db_query("SELECT category FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='$album' and category = '" . (USER_ID + FIRST_USER_CAT) . "'");
// if (mysql_num_rows($result) == 0) simple_die(ERROR, $lang_db_input_php['unknown_album'], __FILE__, __LINE__);
// $row = mysql_fetch_array($result);
// mysql_free_result($result);
// $category = $row['category'];
// } else {
Otherwise it goes through the publish wizard but doesnt actually add the photos.
If you have turned off public albums and want to get rid of the form that allows them to create a new album you also need to change these lines:
xp_publish.php (line 641)
} else {
template_extract_block($template_select_album, 'no_album');
if (!USER_IS_ADMIN) template_extract_block($template_select_album, 'select_category');
$params = array('{WELCOME}' => sprintf($lang_xp_publish_php['welcome'], USER_NAME),
'{UPLOAD}' => $lang_xp_publish_php['upload'],
'{ALBUM}' => $lang_xp_publish_php['album'],
'{SELECT_ALBUM}' => $html_album_list,
'{CATEGORY}' => $lang_xp_publish_php['category'],
'{SELECT_CATEGORY}' => $html_cat_list,
'{CREATE_NEW}' => $lang_xp_publish_php['create_new'],
'{POST_ACTION}' => trim($CONFIG['site_url'], '/') . '/' . $_SERVER['PHP_SELF'] . '?cmd=create_album',
);
echo template_eval($template_select_album, $params);
$ONNEXT_SCRIPT = 'create_alb_or_use_existing();';
$ONBACK_SCRIPT = 'window.external.FinalBack();';
$WIZARD_BUTTONS = 'true,true,false';
}
change to:
} else {
template_extract_block($template_select_album, 'no_album');
template_extract_block($template_select_album, 'create_album');
// if (!USER_IS_ADMIN) template_extract_block($template_select_album, 'select_category');
$params = array('{WELCOME}' => sprintf($lang_xp_publish_php['welcome'], USER_NAME),
'{UPLOAD}' => $lang_xp_publish_php['upload'],
'{ALBUM}' => $lang_xp_publish_php['album'],
'{SELECT_ALBUM}' => $html_album_list,
// '{CATEGORY}' => $lang_xp_publish_php['category'],
// '{SELECT_CATEGORY}' => $html_cat_list,
// '{CREATE_NEW}' => $lang_xp_publish_php['create_new'],
'{POST_ACTION}' => trim($CONFIG['site_url'], '/') . '/' . $_SERVER['PHP_SELF'] . '?cmd=create_album',
);
echo template_eval($template_select_album, $params);
$ONNEXT_SCRIPT = 'startUpload();';
$ONBACK_SCRIPT = 'window.external.FinalBack();';
$WIZARD_BUTTONS = 'true,true,false';
}
This disables the display of the form, and makes the next button go straight to upload without trying to create a new album.
This is a very rough and ready fix. Other things probably need to be done to make it behave properly in all cases.
Eris