<ol id="pagination"> <?php if (count($links)) { if ($vars['offset'] > $boundary + 1) { ?> <li class="first"><?php echo px_create_link('First', $vars['baseurl'] . '&offset=1', null, false, false); ?> </li> <?php } foreach ($links as $id => $offset) { ?> <li><?php echo $offset == $vars['offset'] ? $offset : px_create_link($offset, $vars['baseurl'] . '&offset=' . $offset, null, false, false); ?> </li> <?php } if ($vars['offset'] < $lastpage - $boundary) { ?> <li class="last"><?php echo px_create_link('Last', $vars['baseurl'] . '&offset=' . $lastpage, null, false, false); ?> </li> <?php } } ?> </ol>
/** * Construct a HTML anchor containing an affiliate URL. * * @param string $anchor The anchor text. * @param string $url The affiliate URL. * @param array $params Associative array of query string parameters. * @param string $class Optional class to apply to the a tag. * * @return string A HTML anchor tag. */ function px_affiliate_link_to($anchor, $url, $params = array(), $class = null) { global $px_prefs; $newwindow = $px_prefs['links_new_window'] == 'y'; if ($px_prefs['cloaking'] == 'y') { $params['id'] = px_encode_affiliate_url($url); return px_link_to($anchor, PX_REDIRECTION_PAGE, $params, $class, true, $newwindow); } else { return px_create_link($anchor, htmlentities($url), $class, true, $newwindow); } }