forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: benjamin916 on April 20, 2007, 03:34:46 pm

Title: putting together URL from database - here´s the pos= value?
Post by: benjamin916 on April 20, 2007, 03:34:46 pm
Dear forum users,

I am running cpg1.49. I am trying to put together an image feed to an external website, which is working so far.

I am using the data stored in the cpg mysql database in order to build the image path.

Now I would like to make the image clickable.

Therefore I´d like to know, where coppermine stores the URL value &pos=xxx (taken from the URL: http://www.powerwheelie.de/fotogalerie/displayimage.php?album=16&pos=1498)

Am I able to find this value in the database as well?

I tried searching the whole forum for a while, but couldn´t find a proper answer.
Thank you for your time.
Title: Re: putting together URL from database - here´s the pos= value?
Post by: Hein Traag on April 20, 2007, 03:42:36 pm
Quote
I am running cpg1.49
It's mandatory to upgrade to 1.4.10

Do that first.
Title: Re: putting together URL from database - here´s the pos= value?
Post by: Nibbler on April 20, 2007, 03:48:13 pm
Use pos=-pid
Title: Re: putting together URL from database - here´s the pos= value?
Post by: benjamin916 on April 21, 2007, 09:46:15 am
Use pos=-pid

Doesn´t work mate :(

Look here, on the right hand side, there´s a random gallery image.
http://www.powerwheelie.de/

If you click on it, the link guides you to another image.

Code: [Select]
<?
$query ="SELECT
*
FROM
cpg149_pictures
ORDER BY
RAND()
LIMIT 1
";
$result = mysql_query($query) or die(mysql_error());
$getEntry = mysql_fetch_assoc($result);

global $galeriebild;
$galeriebild = $getEntry['filepath'] . $getEntry['filename'];

global $gal_album;
$gal_album = $getEntry['aid'];

global $gal_picid;
$gal_picid = $getEntry['pid'];
?>

<a href="/fotogalerie/displayimage.php?album=<?= $gal_album; ?>&pos=<?= $gal_picid; ?>" target="_blank"><img class="galeriebild" src="/fotogalerie/albums/<?= $galeriebild; ?>" width="150" alt="Galeriebild" style="border: 1px solid #000000;"></a>
Title: Re: putting together URL from database - here´s the pos= value?
Post by: Nibbler on April 21, 2007, 12:10:13 pm
Use pos=-pid as suggested...

Code: [Select]
<a href="/fotogalerie/displayimage.php?pos=-<?= $gal_picid; ?>" target="_blank">
Title: Re: putting together URL from database - here´s the pos= value?
Post by: benjamin916 on April 22, 2007, 08:33:45 pm
Superb,

thanks a lot mate. That does work.

Just a final question. How come I can´t manage to use CPG´s original url structure as displayed above, including album=xxx&pos=xxx .

Just wondering?
Title: Re: putting together URL from database - here´s the pos= value?
Post by: Nibbler on April 22, 2007, 09:01:24 pm
pos is the position of the file in the album based on the current sorting method. You can't get that reliably from outside Coppermine.