Question about Position Question about Position
 

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

Question about Position

Started by extremest, February 27, 2008, 07:21:49 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

extremest

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.

copperminepro

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?

extremest

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.

copperminepro

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  :-\

Joachim Müller

Quote from: 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.
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.

copperminepro

Quote from: Joachim Müller on February 27, 2008, 08:29:34 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

Joachim Müller

pid = absolute URL = good
pos = relative URL = bad

Why do you want to re-enable the old, bad way?

copperminepro

#7
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.

extremest

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.

Joachim Müller

@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.

Nibbler

The search details are stored in a cookie.

extremest

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.