Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: change of album after adding to favorites  (Read 10379 times)

0 Members and 1 Guest are viewing this topic.

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
change of album after adding to favorites
« on: December 26, 2005, 04:23:14 pm »

When I added a file to Favorites, I had expected to remain in the album that I had used to access the file, and not to go into the album where the file actually exists. For example, my favorite files also are the most viewed ones, as the public seemed to agree from the views. I wanted to download some of those files into favorites to consolidate them in one folder. Or even going through my portfolio album which is a keyword album.

Does it make sense to anyone else to return to the album used to access the file? If so, is this possible to implement with little trouble?
« Last Edit: February 20, 2006, 04:04:15 am by Nibbler »
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: change of album after adding to favorites
« Reply #1 on: January 23, 2006, 07:39:21 am »

Hey TranzNDance,

I was just search for someinformation on this topc too.

It seems now when I do a search by keyword, I can browse a -pseudo-gallery' of just those images taht came up with that keyword. However, when I add one to 'favorites' (or Lightbox, on my site)I'm no longer returned to the keyword search, but the gallery from which that image came.

Is this fixable? I'd really like to have viewers be able to browse by keywords, add an image or moer to favorites, and continue on browsing those images that came up under their search terms.

Thank you.

Cheers

Carl
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: change of album after adding to favorites
« Reply #2 on: January 23, 2006, 09:02:39 am »

Here's one way to do it.  In addfav.php, look for this line near the end:
Code: [Select]
$location = "displayimage.php?pos=" . (- $pic);and change it to this line:
Code: [Select]
$location = basename($_SERVER['HTTP_REFERER']);
I wonder if there are times when or places where HTTP_REFERER is not populated?  If that is possible, it would be better to use this replacement instead:
Code: [Select]
$location = ($_SERVER['HTTP_REFERER']) ? basename($_SERVER['HTTP_REFERER']) : "displayimage.php?pos=" . (- $pic);
Also, I'm not sure why these 3 lines are present:
Code: [Select]
pageheader($lang_info, "<meta http-equiv=\"refresh\" content=\"1;url=$location\">");
msg_box($lang_info, $lang_rate_pic_php['rate_ok'], $lang_continue, $location);
pagefooter();
They are never used by the client browser since the line before sends the header with URL/Location.  Or is this a compatibility thing for certain cases to make sure something is displayed?  In that case, the message box is rather weird for the "Add to Favorites" link since it says "your vote was accepted".

edit: I agree that returning to the previous album is a logical thing to do.   If HTTP_REFERER is not trustworthy, then it will be necessary to add GET variables to the addfav link.  Since such a messy-looking URL should never show up in the address bar (unless there's a header issue as mentioned above), it seems like this would be a reasonable & transparent thing to do.  We can discuss this if necessary.
« Last Edit: January 23, 2006, 09:13:25 am by Paver »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: change of album after adding to favorites
« Reply #3 on: January 23, 2006, 09:18:02 am »

It is possible for referer info not to be populated. If you have web developer toolbar for firefox, you can disable referer sending to test the code. :)

And there are people who use security software that disables it, too. It's trickier with those folks since they're not even aware of the empty/altered referers that the software sends.
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: change of album after adding to favorites
« Reply #4 on: January 23, 2006, 03:12:35 pm »

Roger that.  I'll look into the second option then. 
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: change of album after adding to favorites
« Reply #5 on: February 03, 2006, 10:06:39 pm »

Hey Folks,

I thought I'd bring this up again - it's kind of a big deal to me, having users be able to search and not have to search again if they add an image to their lightbox. I realise, of course, that my ignorance in all things internet related is my own problem  ;) but does the solution Paver suggested work, or bear any further problems? Can someone explain, in lay-terms, what the 3 posts above me mean, in a practical sense?

Thank you.

Cheers

Carl
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: change of album after adding to favorites
« Reply #6 on: February 03, 2006, 10:10:09 pm »

Go ahead and make the modifications I suggested.  At worst, if the user's browser does not return the referer field, my modifications will default to what it currently does and you are no better off, but no worse off.  For most people who use "regular" browsers, I think this will work.

I'm sure one of the devs will take this up sometime; TranzNDance put it on our list of things to do by adding it here.

The HTTP_REFERER field tells the web server who referred you to the web page you are currently requesting.  It's a way to see for example if a search engine referred you to this page.  But it's up to the web browser to populate this field, so it can be "turned off" at the browser.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: change of album after adding to favorites
« Reply #7 on: February 04, 2006, 12:55:38 pm »

most of the times, the referer is switched of by pseudo-security software like "Norton Internet security" or similar crap. However, as this discussion on the bugs board deals with the flaw and not with actual support, please be patient and wait for a fix.
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: change of album after adding to favorites
« Reply #8 on: February 04, 2006, 10:15:31 pm »

Hey Paver,

OK, thanks. I appreciate you explaining to me what all that means. Thank you.

Hey GauGau,

OK, thanks, I'll wait for a fix. I just wasn't sure if what Paver suggested would fix the problem or not.

Cheers

Carl
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: change of album after adding to favorites
« Reply #9 on: February 04, 2006, 10:40:07 pm »

Walkinman: My intent was to propose a solution for the "bug".  If you are asking for support that is related to the bug, please start another thread on the support board that references this thread.  Bug threads are intended for users to report bugs and for devs (and anyone else) to propose solutions.  Since you weren't adding any new information to the bug report, that's why GauGau informed you that you were asking for support.

I guess I was in essence asking for "support" for a bug fix I proposed, but really I was asking "will this work in all cases?".   The answer is either yes or no.  If yes, the fix is applied.  If no, we need to find another fix.
Logged

Nibbler

  • Guest
Re: change of album after adding to favorites
« Reply #10 on: February 04, 2006, 11:28:56 pm »

I would suggest sending the referer in the url in the same way as with the login/logout links.
Logged

Nibbler

  • Guest
Re: change of album after adding to favorites
« Reply #11 on: February 20, 2006, 04:04:02 am »

Done.
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: change of album after adding to favorites
« Reply #12 on: February 20, 2006, 05:23:20 pm »

Hey Nibbler,

Thanks for your work on this. How do I implement and what are the changes required?

Thank you.

Cheers

Carl
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: change of album after adding to favorites
« Reply #13 on: February 20, 2006, 05:27:26 pm »

You can either wait for 1.4.4 to be released, or learn about using CVS: http://sourceforge.net/cvs/?group_id=89658. Or maybe someone will post the code.
Logged

Nibbler

  • Guest
Re: change of album after adding to favorites
« Reply #14 on: February 20, 2006, 05:30:11 pm »

Check the diffs in cvs.

displayimage.php
addfav.php
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: change of album after adding to favorites
« Reply #15 on: February 20, 2006, 05:56:02 pm »

Hey Nibbler,

Thank you. I added the changes - but I've got the "Add to Lightbox" feature as a button in the Image Navigation Bar. The code is simply:

Code: [Select]
<td align="center" valign="middle" class="navmenu" width="125">
                        {FAVORITE}
                </td>

How can I modify that so that it works in line with your modification?

Thank you.

Cheers

Carl
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: change of album after adding to favorites
« Reply #16 on: February 20, 2006, 07:12:58 pm »

Hey Nibbler,

I got it fixed, thanks. THis modification really helps. Thank you.

Cheers

Carl
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: change of album after adding to favorites
« Reply #17 on: February 21, 2006, 04:52:02 am »

Hey Nibbler,

I'm not sure where to put this post, but as this is the trhead that has the change included, I thought I'd put it there - if you need to move it, feel free.

I tried the change out more thouroughly, and it's not working. I have both the "Add to Lightbox" text in the info pallete, and also the "Add to Lightbox" button in the navigation bar .. neither of them work correctly. I'll do a search, and click a thumbnail, and when I add it to a lightbox, another image from an entirely different gallery comes up, that had nothing to do with the search, nor the home gallery of the image I had selected. I don't know whether i't something I did incorrectly, or a bug in the program.

Thank you.

Cheers

Carl
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: change of album after adding to favorites
« Reply #18 on: February 21, 2006, 04:59:29 am »

Hey folks,

Well, it seems to be very sporadic - sometimes it works and sometimes it doesn't.

Cheers

Carl
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.