RSGallery2 Support Forums
Welcome, Guest. Please login or register.

Login with username, password and session length
  Home    Forum    Help    Search    Login    Register  
*
News : November 21, 2008, 06:23:20 am
+  RSGallery2 Support Forums
|-+  RSgallery2 support forums
| |-+  Display and Templates (Moderators: Jonah, Tomislav Ribicic, Daniel Tulp, Ronald Smit)
| | |-+  Adding prev and next buttons to the template?
Advanced search
  « previous next »
Pages 1
Author
Topic: Adding prev and next buttons to the template?  (Read 2948 times)
« on: August 19, 2008, 10:57:39 am »
Billy Offline
Newbie
*
Posts: 11

View Profile Email

I would like to get rid of the Page Navigation on the bottom of the image using Semantic template, and instead replace it with simple Previous and Next buttons on each side of the displayed image. I cant seem to find the code for the page navigation utility anywhere. I just need to take the code from the Prev and Next buttons and use that, so if anyone can point me in the right direction it would be appreciated.
Logged
 
Reply #1
« on: August 19, 2008, 04:35:21 pm »
john Offline
Dev Team
Sr. Member
*
Posts: 458

View Profile Email

RsGallery2 uses the standard Joomla navigation framework. Modifying it would change all navigation controls on you site.
Maybe you can hide them in RSG2 with the CSS ?

john
Logged
 
Reply #2
« on: August 20, 2008, 11:38:01 pm »
Chef Groovy Offline
Dev Team
Full Member
*
Posts: 110
danshaffer@insightbb.com
View Profile WWW

Yeah it's possible. I did it in version 1.13. Even had the thumbnails of the next and previous pictures show.
Have to change a little in the rsg core to get the id of the next and prev picss to make the

 I bypassed all the joomla pagination stuff, and just wrote my own routines for navigation.

Probably an easier way now in 1.14. Can send over my 1.13 spagetti code if want to sift through it. I plan on doing it at some point. Makes browsing the gallery a lot quicker

Logged

Chef Groovy
RSGallery2: Legacy - Dev
Test Site: dev.fantasyartwork.net
 
Reply #3
« on: August 21, 2008, 08:39:01 am »
Billy Offline
Newbie
*
Posts: 11

View Profile Email

I would definitly appreciate that, thanks! I would hopefully be able to get something working!
Logged
 
Reply #4
« on: August 21, 2008, 08:23:30 pm »
Chef Groovy Offline
Dev Team
Full Member
*
Posts: 110
danshaffer@insightbb.com
View Profile WWW

Here you go. good luck! (you're gonna need it!) 

This is just the template, think most was in there

Only works in v1.13
Logged

Chef Groovy
RSGallery2: Legacy - Dev
Test Site: dev.fantasyartwork.net
 
Reply #5
« on: August 27, 2008, 07:49:30 pm »
Chef Groovy Offline
Dev Team
Full Member
*
Posts: 110
danshaffer@insightbb.com
View Profile WWW

I give up!

Either I'm missing a key concept to the Prev/Next link problem, or there is no "clean" way to do it in 1.14 without hacking the joomla core

Anyone else have any luck?

Logged

Chef Groovy
RSGallery2: Legacy - Dev
Test Site: dev.fantasyartwork.net
 
Reply #6
« on: August 28, 2008, 01:01:02 pm »
Billy Offline
Newbie
*
Posts: 11

View Profile Email

I didnt even get a chance to open the modded template for 0.13 yet, but I apprciate you taking the time to try and find a way to do it on 1.014. I am going to try and take a look now and see what's up with it.

I was even thinking along the lines of hiding the numbers and just using CSS to style things, but the whole pagination thing all uses the same class, so even that would be difficult.
Logged
 
Reply #7
« on: August 28, 2008, 08:33:43 pm »
Chef Groovy Offline
Dev Team
Full Member
*
Posts: 110
danshaffer@insightbb.com
View Profile WWW

Yeah, as far as I can figure is it involves getting the ordering from the config

write sql queries for each scenerio (sort by date decending, name ascending, etc)

Load the query set into an array and find the id the user is currently on

Go one back and one forward and get prev/next id

easy as pie lol


hacky method is to get into the joomla core and comment out the numbers, but then they don't work for anything else
Logged

Chef Groovy
RSGallery2: Legacy - Dev
Test Site: dev.fantasyartwork.net
 
Reply #8
« on: September 14, 2008, 06:44:08 pm »
Chef Groovy Offline
Dev Team
Full Member
*
Posts: 110
danshaffer@insightbb.com
View Profile WWW

In case anyone still cares, here's a non-hacky, semi-clean way to get a Next Image link.  Place the function in your display.class and call it like do others. Can modify it to make a prev image link as well, jsut check if prev is below 0 or not.  See dev site in my sig to see it action.

Code:
// Shows a link to the next image in current directory
function showNextButton() {
global $database;

$gallery = rsgGalleryManager::get();

$galid=$gallery->id;
$ceiling = $gallery->itemCount();

// If the ID is set in rsgInstance, then get the current page from there
if( rsgInstance::getInt( 'id', 0 ) )
{
$curimage = $gallery->indexOfItem();
$nextlink = $curimage+1;
}
else // ID NOT SET, so get it from limitstart in address bar
{
$limitstart = mosGetParam ( $_REQUEST, 'limitstart', 0);
$nextlink = $limitstart+1;
}

// Check if last page. If so, start over at 1
if ($nextlink >= $ceiling)
{
$nextlink = 0;
}

echo '<a href="/index.php?option=com_rsgallery2&page=inline&gid='. $galid . '&limit=1&limitstart=' . $nextlink .'">Next Image</a>';
}

« Last Edit: September 14, 2008, 06:46:07 pm by Chef Groovy » Logged

Chef Groovy
RSGallery2: Legacy - Dev
Test Site: dev.fantasyartwork.net
 
Print  Pages 1
« previous next »
Jump to: