2 year(s) ago
Hi lomp, plugins may need to be adapted to the new version, they might not work as they were written for the previous version.
This may or may not be working - we'll work on this later (unless somebody fixes them up for us). For previous and next links:
And, I think Visual Index has some built-in pagination code too - you might look at that too.
Thanks aleman and vaska for your answers. I tried the plugin code, but it didn't work. So I just wait until someone writes a new one.
I'd really like to implement the pagination plugin. I've been looking over plugin.pagination.php and can't unpick why it's not working at the moment.
lomp, I wondered if you had pursued this any further?
Also, I'm using indexpand -- not sure whether the subsection class could be further complicating things? If it's just going through page ID in ascending order I'd guess not...
Just in case it's helpful for anyone, I revisited the plugin.pagination.php file and have got things running on my site.
The below code features a couple of edits, so it manually takes effect on a single section (id 4) which is organised chronologically, so it orders by year, then by object order.
<?php if defined'SITE' exit'No direct script access allowed'
$OBJ =& get_instance();
if ($OBJ->vars->exhibit['section_top'] == 1) return;
if ($OBJ->vars->exhibit['section_id'] == 1) return;
// get all entries
$entries = $OBJ->db->fetchArray("SELECT title, url, id FROM ".PX."objects
WHERE object = '" . $OBJ->vars->exhibit['object'] . "'
AND section_top != '1'
AND status = '1'
AND section_id = '4'
ORDER BY year DESC, ord ASC");
// loop through the array to find current and set the others
foreach ($entries as $key => $entry)
if ($entry['id'] == $OBJ->vars->exhibit['id'])
$previous = (isset($entries[$key - 1])) ? $entries[$key - 1] : '';
$next = (isset($entries[$key + 1])) ? $entries[$key + 1] : '';
$s = "<div id='prev_new_entries'>";
if (!empty($next)) $s .= "<span id='newer' style=''><a href='" . BASEURL . "$next[url]' title='Older Exhibition'>←</a></span>";
if (!empty($next) && !empty($previous)) $s .= " ";
if (!empty($previous)) $s .= "<span id='older' style=''><a href='" . BASEURL . "$previous[url]' title='Newer Exhibition'>→</a></span>";
$s .= "</div>";
There might be some excess in there (e.g. line 10, section id 1 return), but this was just a quick edit to suit my needs.
I also added in line 37 to only show a gap (or a bar, or slash or whatever) between next / prev links when BOTH next and prev are not empty.
As Vaska says, you can call the plugin with:
(*forum note* the post 'Preview' button isn't working, so excuse any weird formatting)
Where to I place the code to call the code to call the pagination plugin?
Either in the text area of your exhibits or the post/pre nav area text boxes.
Are you sure this works. it doesn't seem to work on my web.
Can you show me an example?
Thank you very much
It was a problem with the clean url's.