how can users use xp_publish to upload to public albums? how can users use xp_publish to upload to public albums?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

how can users use xp_publish to upload to public albums?

Started by Casper, December 21, 2003, 01:38:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Casper

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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Oasis

Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

Casper

Yes, I'm sure.

hers is a screenshot of a registered user, upoading via the normal upload facility;
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.langportrd.f2s.com%2Fimages%2Fupload.jpg&hash=b259eec4cf8d66735f2835fef2969c9d3f8450ff)

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;
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.langportrd.f2s.com%2Fimages%2Fupload2.jpg&hash=25d54cea78efc071f5c092085af8243107edfc98)

now he can only upload to his own album, or create a new one.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Oasis

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
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

Casper

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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Oasis

Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

Casper

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
QuoteImpossible 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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Oasis

this second problem you are talking about... is it related to the xp_publish problem or is it a totally different topic?
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

Casper

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.  :?
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

gijs_schouten

Quote from: Oasis on December 21, 2003, 07:36:28 PM
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?