Before I go on, THANK YOU for the constant support you've provided thousands throughout the years. A lot of people come on these forums, find their answer, and never give any sort of thanks -- so consider this a GIANT THANKS from everyone that does it!
I'm developing a site (currently located at worldovereasy.com/br3ad) and I'm running into two specific issues:
As you can see at the bottom of the page is the navigation for the site. On the right side of the logo I have 'RANDOM' and 'NEXT.'
When a user clicks 'NEXT,' I want them to be taken directly to the K2 item that is actually previous. So for example, the user clicks NEXT while they're in ID 466 and they will go to 465. Once on 465, they can click it again and it will go to 464...etc.
So essentially the NEXT will be used more of a PREVIOUS.
When users click on 'RANDOM,' they will go to a random K2 page.
My question is, how can I make this happen?
Here's what I've tried:
RANDOM:
- I've tried creating a menu item with K2 categories, then choosing random ordering, then displaying only one article -- then copy/pasting the link to see what wold happen. Essentially nothing happens, I get a blank main content area.
NEXT:
- Since the bottom nav area is actually a custom HTML module, I've I tried the obvious, pasting this in via Sourcer:
The error I'm getting is:
Fatal error: Using $this when not in object context in class.php on line ...
Mainly because you can't use "$this" in a static method.
I've tried to be as creative as possible to get this to work, but I'm running out of options.
Anyone else have an novel ideas? Also, I've searched these forums, the closest thing I can get to a solution is this:
www.gavick.com/forums/132/back-next-buttom-in-k2-item-14739
However it doesn't really provide any help.
Can you guys be heroes and help me out with this one? PLEASE! :D
I'm developing a site (currently located at worldovereasy.com/br3ad) and I'm running into two specific issues:
As you can see at the bottom of the page is the navigation for the site. On the right side of the logo I have 'RANDOM' and 'NEXT.'
When a user clicks 'NEXT,' I want them to be taken directly to the K2 item that is actually previous. So for example, the user clicks NEXT while they're in ID 466 and they will go to 465. Once on 465, they can click it again and it will go to 464...etc.
So essentially the NEXT will be used more of a PREVIOUS.
When users click on 'RANDOM,' they will go to a random K2 page.
My question is, how can I make this happen?
Here's what I've tried:
RANDOM:
- I've tried creating a menu item with K2 categories, then choosing random ordering, then displaying only one article -- then copy/pasting the link to see what wold happen. Essentially nothing happens, I get a blank main content area.
NEXT:
- Since the bottom nav area is actually a custom HTML module, I've I tried the obvious, pasting this in via Sourcer:
<?php if(isset($this->item->previousLink)): ?>
<a class="itemPrevious" href="<?php echo $this->item->previousLink; ?>">
NEXT
</a>
<?php endif; ?>The error I'm getting is:
Fatal error: Using $this when not in object context in class.php on line ...
Mainly because you can't use "$this" in a static method.
I've tried to be as creative as possible to get this to work, but I'm running out of options.
Anyone else have an novel ideas? Also, I've searched these forums, the closest thing I can get to a solution is this:
www.gavick.com/forums/132/back-next-buttom-in-k2-item-14739
However it doesn't really provide any help.
Can you guys be heroes and help me out with this one? PLEASE! :D