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
-
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.
-
I am running cpg1.49
It's mandatory to upgrade to 1.4.10
Do that first.
-
Use pos=-pid
-
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.
<?
$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>
-
Use pos=-pid as suggested...
<a href="/fotogalerie/displayimage.php?pos=-<?= $gal_picid; ?>" target="_blank">
-
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?
-
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.