forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: stan85in on November 29, 2010, 03:50:07 am

Title: How can i add a "edit my pictures" button for the users to edit only their files
Post by: stan85in on November 29, 2010, 03:50:07 am
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?
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: Αndré on November 29, 2010, 01:55:51 pm
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.
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: stan85in on November 29, 2010, 07:38:58 pm
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.
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: Αndré on November 29, 2010, 08:19:07 pm
What exactly doesn't work? Afaik the cat parameter is ignored for that meta album.
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: stan85in on November 29, 2010, 11:51:28 pm
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.
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: stan85in on November 30, 2010, 01:14:34 am
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.
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: Αndré on November 30, 2010, 11:17:43 am
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.
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: stan85in on November 30, 2010, 02:06:30 pm
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?
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: Αndré on November 30, 2010, 05:04:06 pm
Please attach your theme folder as zip file (which resides in 'themes/') and not the file include/themes.inc.php.
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: stan85in on December 01, 2010, 01:05:31 am
I have attached theme.zip
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: Αndré on December 01, 2010, 09:14:32 am
I cannot find your button in that file.
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: stan85in on December 02, 2010, 03:18:04 pm
Thank a lot Andre, for your hints and clues. I finally found out where i was going wrong. Much Appreciated.
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: Αndré on December 02, 2010, 03:24:22 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.
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: stan85in on December 04, 2010, 12:39:22 am
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.
Title: Re: How can i add a "edit my pictures" button for the users to edit only their files
Post by: Αndré on December 04, 2010, 10:01:14 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.