forum.coppermine-gallery.net
Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: Casper on December 21, 2003, 01:38:32 pm
-
My registered users cannot upload to the public, admin owned albums from xp_publish. As admin, all albums are shown to me when testing xp_publish (I use ftp to upload), but users are only shown albums they have created in the private members category.
I want them to be able to use xp_publish to upload to all albums they have permissions for, and can using the normal upload feature.
Is this possible.
-
are you sure?
Make sure they have upload rights.
-
Yes, I'm sure.
hers is a screenshot of a registered user, upoading via the normal upload facility;
(http://www.langportrd.f2s.com/images/upload.jpg)
as you can see, he has several albums to choose from.(note, the private album hadn't been created at this point)
Now the same user trying to use xp_publish;
(http://www.langportrd.f2s.com/images/upload2.jpg)
now he can only upload to his own album, or create a new one.
-
hmm... I was 60% sure (OK 59.9%) that this wasn't the case in 1.1..
but anyway, try this:
in xp_publish.php change
if (USER_IS_ADMIN) {
$public_albums = mysql_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 = db_fetch_rowset($public_albums);
} else {
$public_albums_list = array();
}
} else {
$public_albums_list = array();
}
to
if (USER_IS_ADMIN) {
$public_albums = mysql_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " ORDER BY title");
} else {
$public_albums = mysql_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 = db_fetch_rowset($public_albums);
} else {
$public_albums_list = array();
}
Please report if it works
-
ok, the user now sees all albums.
But I am unable to upload at all using xp publish now. It tells me I have been successful, but when I return to the gallery, it's not there. :?
Could this be a registry problem on my pc, as I have been using it for both admin and user uploads.
-
did you check whether they are awaiting approval?
-
OK,
the first problem is fixed, but I have found the sencond problem seems to be with new registered users, trying to upload to thier own albums.
I tried to upload as a registered user, to that users private gallery, and got this warning
Impossible to move shanks.jpg to albums/userpics/10044/ !
Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 10295 is not allowed to access /home/httpd/vhosts/hsocuk.com/httpdocs/galleries/albums/userpics/10044 owned by uid 48 in /home/httpd/vhosts/hsocuk.com/httpdocs/galleries/db_input.php on line 258
It seems the user has been allocated a different user id ( 48 ) to the corresponding album (10044), even though this album was set up by that user.
Is this because I had deleted a few users. If so, this could be a bug.
edit; just realised I amended db_input.php 2 days ago. maybe I caused this myself, will go and check.
-
this second problem you are talking about... is it related to the xp_publish problem or is it a totally different topic?
-
Hi Oasis,
it seems not to be related to the xp publish problem, which you kindly sorted for me.
However, that was how I found it, and I thought it was related, which is why it was posted on the same thread.
When I find the cause, and if I need more help, I will find a relevent thread, or post a new one.
Sorry for any confusion caused, but you're not as confused as me. :?
-
hmm... I was 60% sure (OK 59.9%) that this wasn't the case in 1.1..
but anyway, try this:
in xp_publish.php change
if (USER_IS_ADMIN) {
$public_albums = mysql_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 = db_fetch_rowset($public_albums);
} else {
$public_albums_list = array();
}
} else {
$public_albums_list = array();
}
to
if (USER_IS_ADMIN) {
$public_albums = mysql_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " ORDER BY title");
} else {
$public_albums = mysql_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 = db_fetch_rowset($public_albums);
} else {
$public_albums_list = array();
}
I had the same problem.... I tried this to solve it... and indeed it works for me now....
but when a registred user wants to upload to a public album i don't get the pictures there... when he uploads to his private album there's no problem....
could anyone help with this?