PDA

View Full Version : Adding prev/next 'arrows' to an excisting script?



MaGiCSuN
October 12th, 2009, 15:06
Hi there !

I'm having some issues. I found this great script for a simple image gallery for Joomla, it's VSig. It works like the client wanted.

However, like most clients, they change minds easily. Now he wants next/prev arrows (i'm sure textlinks we'll do fine aswell!) to scroll through the photo's.

Is there any way to insert that into the code to make it work? Or do I really need a complete other script? Wich means I have to rebuilt 20+ galleries ...

If anyone can help, that would be great.

The script i'm using: http://www.bretteleben.de/lang-en/joomla/very-simple-image-gallery.html

And i'm using it as a plugin within Joomla!

Thanks !

- Mir

themoose
October 14th, 2009, 09:17
Does the URL have a unique id (for each picture) in it? such as pic.php?id=23 or /pictures/23/

MaGiCSuN
October 22nd, 2009, 15:44
One of the urls of a photo is:

http://www.vermeulengroessen.nl/CMS/vermeulen/gerealiseerde-projecten/72?vsig72-0=2

So it doesn't really have id= in it.. but it does have an unique number. number 72 is the number of the gallery or atleast, the page it shows on.

Love,
Mirna

Dynash
October 22nd, 2009, 16:16
Check the Joomla website for some kind of Codex, check their forums too. Perhaps also the designers of the theme you are using too. You see, WordPress for example has functions already created to do this kind of thing. I'm sure Joomla would have with it being a CMS.

http://codex.wordpress.org/Template_tags - Overall tags, but these are the ones I'm talking about.

http://codex.wordpress.org/Template_Tags/next_post_link - next_post_link(); would be all you have to enter in the template files where you want the links for the next post to be.
http://codex.wordpress.org/Template_Tags/previous_post_link - And likewise for the backwards.

Joomla must have something similar.

themoose
October 23rd, 2009, 07:27
I'm not too sure about joomla specifically but if you can put in your own php this should do the job.


<?php

$curr_id = explode("/", $_SERVER['REQUEST_URI']);
$curr_id = explode("?", $curr_id[(count($curr_id)-1)]);

$prev = "<a href=\"".($curr_id[0]-1)."\">Previous</a>";
$next = "<a href=\"".($curr_id[0]+1)."\">Next</a>";

echo $prev; // previous link
echo $next; // next link
?>