forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: extremest on February 27, 2008, 07:21:49 am

Title: Question about Position
Post by: extremest on February 27, 2008, 07:21:49 am
I have noticed that when you click on an image to view the intermediate image it passes the album number or search and cat and the position number.  Is that the position of the image in the result set then.  Trying to figure out how displayimage.php knows what the original query was to recreate it.  I don't understand how to get then next image or the previous image without looping through the whole thing.  Can someone please clarify the position variable.
Title: Re: Question about Position
Post by: copperminepro on February 27, 2008, 07:31:43 am
The position stuff is horrible, I'm working on making an admin configurable option for enabling permalinks to images throughout the site right now.

The way intermediate pages know which picture is next is pretty simple... Just find (!function_exists('theme_html_img_nav_menu')) in themes.inc.php

Displayimage doesn't really know what the original "query" was (on my gallery or the demo)... For example, on my gallery if I were to search for "lol" and than hit the next/previous button, it would take me to +1 or -1 the original picture id in that album.. So if I landed on the image with a position of 10, the next image would be 11 or 9 respectively..

Maybe I'm miss understanding.. What exactly are you trying to accomplish?
Title: Re: Question about Position
Post by: extremest on February 27, 2008, 07:50:01 am
I can understand the pid if browsing an album just don't understand if using search feature.  It could be across multiple albums and pid is then irrelevant from the search.
Title: Re: Question about Position
Post by: copperminepro on February 27, 2008, 08:10:27 am
The position is always irrelevant and useless as it's going to change

You can try doing this:
http://forum.coppermine-gallery.net/index.php/topic,49953.0.html

This will replace position's with pid's so you will always get the permanent link

Sorry if I'm still not understanding  :-\
Title: Re: Question about Position
Post by: Joachim Müller on February 27, 2008, 08:29:34 am
The position stuff is horrible, I'm working on making an admin configurable option for enabling permalinks to images throughout the site right now.
This will change entirely in cpg1.5.x. The dev team is aware of the relative position being bad in terms of search engine friendliness and other issues, that's why cpg1.5.x will use reference to pid instead of pos. This being said I recommend not to look into the code for cpg1.4.x any longer, but look at cpg1.5.x and start your improvements from there.
Title: Re: Question about Position
Post by: copperminepro on February 27, 2008, 08:54:41 am
This will change entirely in cpg1.5.x. The dev team is aware of the relative position being bad in terms of search engine friendliness and other issues, that's why cpg1.5.x will use reference to pid instead of pos. This being said I recommend not to look into the code for cpg1.4.x any longer, but look at cpg1.5.x and start your improvements from there.

That's what I was referring to  ;)

On my 1.5 sandbox the URL's are still pid so I started messing around and looking through the code and working on a way to integrate that with an admin configurable option or with support for the old url's
Title: Re: Question about Position
Post by: Joachim Müller on February 27, 2008, 10:36:06 am
pid = absolute URL = good
pos = relative URL = bad

Why do you want to re-enable the old, bad way?
Title: Re: Question about Position
Post by: copperminepro on February 27, 2008, 12:58:19 pm
Alright now I really feel like an idiot.

The structure looked the exact same when I compared my themes.inc.php with the new version so for some reason I assumed 1.5 still used pos :-( and I meant to type pos above :-)

There are still multiple urls for files though. I know this is needed for the next/previous and filmstrip, but it just seems that there might be a better way.
Title: Re: Question about Position
Post by: extremest on February 27, 2008, 01:31:48 pm
what I mean is this.  Ok if someone is viewing an album I can understand how you can use the pid to get the next one in the album and so on.  My question is if they did a search how do you know the next or previous pid if you don't know the search string.  It has to be passed on also doesn't it.
Title: Re: Question about Position
Post by: Joachim Müller on February 28, 2008, 08:29:27 am
@extremest: sorry for hijacking your thread to talk about future versions. In cpg1.4.x, you have to live with relative addressing. Relief will come with cpg1.5.x, which has not been released yet.
Title: Re: Question about Position
Post by: Nibbler on February 28, 2008, 12:16:28 pm
The search details are stored in a cookie.
Title: Re: Question about Position
Post by: extremest on February 28, 2008, 02:00:54 pm
Thank you nibbler for that.  I was pretty sure that was how it was done.  So if someone has cookies off it won't work.  That is all I needed to know. thanks.