How can i add a "edit my pictures" button for the users to edit only their files How can i add a "edit my pictures" button for the users to edit only their files
 

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 i add a "edit my pictures" button for the users to edit only their files

Started by stan85in, November 29, 2010, 03:50:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stan85in

I need to add a sub_menu button which will allow each registered users to "edit/display all their own pictures" they have uploaded themselves into the public albums, without displaying the pictures uploaded by other users? Assuming that the registered users only uploads their pictures into the public albums created by the administrator, and the users should be able to view/edit their uploaded pictures just by clicking on the newly added sub-menu button. Currently coppermine doesn't have this feature yet. Is there a way to do that?

Αndré

You can use the 'lastupby' meta album to display all pictures uploaded by a particular user. So you could create your menu item and link to that meta album imo.

stan85in

I tried to use 'lastupby' by creating a sub menu button and then pointing the link to http:/mysite.com/thumbnails.php?album=lastupby&uid=1&cat=-5 so that when a user is logged on, he can click this sub menu button to view all pictures uploaded by him, in all of the albums he choosed but unfortunately it didn't work. Any suggestion to modify the link? Thanks.

Αndré

What exactly doesn't work? Afaik the cat parameter is ignored for that meta album.

stan85in

Do you mind giving me an example of how i can use 'lastupby' meta album to display all pictures uploaded by a particular user. how i do link to that meta album imo. (what is imo) Thanks Again.

stan85in

I used the link as pointing to http:/mysite.com/thumbnails.php?album=lastupby&uid=2 which seemed to work fine for User ID=2 only, but i need to make it this way that only the user logged in at the time will see his uploads. This "uid=2" points to user with ID=2, but if user with ID=3 or ID=4 uses the same link i created for the Sub Menu Button, they will be directed to the pictures uploaded by User ID=2. I would like the User ID=3 or ID=4 to access their own last uploads, just by clicking on the Sub Menu Button link. Thanks.

Αndré

You need to create a placeholder and replace it with the link (including the correct user id, which is stored in the constant USER_ID) if the user is logged in. Attach your complete theme to your next reply if cannot figure it out yourself.

stan85in

I have attached my theme.txt file for your review since the attachment does not allow upload of .php file. I will need help with this feature. Do i need to provide link to my website?

Αndré

Please attach your theme folder as zip file (which resides in 'themes/') and not the file include/themes.inc.php.


Αndré


stan85in

Thank a lot Andre, for your hints and clues. I finally found out where i was going wrong. Much Appreciated.

Αndré

Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
Don't just post "I have found the answer", but tell others what you actually did to solve your issues. Posting a link to the page where you found the answer might help. Describing what you did might help as well.

stan85in

I Created a Sub Menu Button called "My Pictures" by editing my theme/theme.php file and then i pointed the Sub Menu button link to http:/mysite.com/thumbnails.php?album=lastupby&uid=2. So that when a user uploaded several files, the users can click on the sub menu button "My Pictures" anytime while browsing and can view all the uploads they have ever created. Check it out here at: www.ifoundasale.com     Register a username first, upload any pictures, enter details and then try it to see if it works. It worked for me, so i hope it works for others too.

Αndré

Quote from: stan85in on December 04, 2010, 12:39:22 AM
i pointed the Sub Menu button link to http:/mysite.com/thumbnails.php?album=lastupby&uid=2
I doubt that this solution will work for different users. You have to create a token like thumbnails.php?album=lastupby&uid={USER_ID} and replace that token later with the appropriate USER_ID.