change of album after adding to favorites change of album after adding to favorites
 

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]

Main Menu

change of album after adding to favorites

Started by Tranz, December 26, 2005, 04:23:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tranz

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?

Walkinman

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

Paver

#2
Here's one way to do it.  In addfav.php, look for this line near the end:
$location = "displayimage.php?pos=" . (- $pic);
and change it to this line:
$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:
$location = ($_SERVER['HTTP_REFERER']) ? basename($_SERVER['HTTP_REFERER']) : "displayimage.php?pos=" . (- $pic);

Also, I'm not sure why these 3 lines are present:
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.

Tranz

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.

Paver

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

Walkinman

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

Paver

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.

Joachim Müller

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.

Walkinman

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

Paver

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.

Nibbler

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


Walkinman

Hey Nibbler,

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

Thank you.

Cheers

Carl

Tranz

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.


Walkinman

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:

<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

Walkinman

Hey Nibbler,

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

Cheers

Carl

Walkinman

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

Walkinman

Hey folks,

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

Cheers

Carl