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: Question about Position  (Read 3641 times)

0 Members and 1 Guest are viewing this topic.

extremest

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Question about Position
« 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.
Logged

copperminepro

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
Re: Question about Position
« Reply #1 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?
Logged

extremest

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Question about Position
« Reply #2 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.
Logged

copperminepro

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
Re: Question about Position
« Reply #3 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  :-\
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Question about Position
« Reply #4 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.
Logged

copperminepro

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
Re: Question about Position
« Reply #5 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Question about Position
« Reply #6 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?
Logged

copperminepro

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
Re: Question about Position
« Reply #7 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.
« Last Edit: February 27, 2008, 01:27:55 pm by copperminepro »
Logged

extremest

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Question about Position
« Reply #8 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Question about Position
« Reply #9 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.
Logged

Nibbler

  • Guest
Re: Question about Position
« Reply #10 on: February 28, 2008, 12:16:28 pm »

The search details are stored in a cookie.
Logged

extremest

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Question about Position
« Reply #11 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 20 queries.