Machepap,
I wanted to do exactly what you want to do: use a URL to open a gallery at a specific image. And like you, I found the knowledge base here to be somewhat lacking. So I went searching the internet, learned a few things about coding, and came up with a solution. Here's what I did (this is using SimpleViewer 2.0)
I had the simpleviewer embedded into an html file (in my case it was called highlands.html) which I changed using a text editor to highlands.php
Then in the simpleviewer head, which looks like this:
<!-- SIMPLEVIEWER HEAD. Paste this into the head of the HTML page-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.galleryURL = "gallery.xml";
var params = {};
params.bgcolor = "000000";
params.allowfullscreen = true;
params.allowscriptaccess = "always";
swfobject.embedSWF("simpleviewer.swf", "flashContent", "779", "470", "9.0.124", false, flashvars, params);
</script>
I added the following lines of php code into the head:
<?php
//set $id 's value to whatever is contained on the url.
$id = $_GET['id'];
?>
flashvars.firstImageIndex = <?echo("$id")?>;
So now the final simpleviewer head looks like this:
<!-- SIMPLEVIEWER HEAD. Paste this into the head of the HTML page-->
<?php
//set $id 's value to whatever is contained on the url.
$id = $_GET['id'];
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.galleryURL = "gallery.xml";
flashvars.firstImageIndex = <?echo("$id")?>;
var params = {};
params.bgcolor = "000000";
params.allowfullscreen = true;
params.allowscriptaccess = "always";
swfobject.embedSWF("simpleviewer.swf", "flashContent", "779", "470", "9.0.124", false, flashvars, params);
</script>
In other words, I used the php GET command to pull the variable "id" from the URL, then I used the ECHO command to pass this variable to the firstImageIndex. Now, to set the image I want to start at, I simply add "?id=x" to the URL, where x is the index of the image you want to start on. For example:
http://www.joshuacripps.com/galleries/t … s.php?id=0 will start on the first image in the gallery.
http://www.joshuacripps.com/galleries/t … .php?id=10 will start on the 11th image in the gallery.
It ended up being a pretty straightforward solution in the end, once I understood how the code was working. Hope this makes sense and helps you out!
Josh