Ignore:
Timestamp:
Sep 6, 2009, 10:26:32 AM (15 years ago)
Author:
vdigital
Message:

Partial thumbnail navigation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/akBookStyle/trunk/include/akContent.class.php

    r3813 r3829  
    3535
    3636  public function loc_begin_index_thumbnails($images) {
    37     global $template;
     37    global $template, $page;
    3838
    3939    $this->category_url = make_index_url(array('section' => 'category',
    40                                                'category' => $GLOBALS['page']['category'],
    41                                                'start' => $GLOBALS['page']['start']
    42                                                )
    43                                         );
     40                 'category' => $GLOBALS['page']['category'],
     41                 'start' => $GLOBALS['page']['start']
     42                 )
     43          );
    4444    $this->current_picture = $this->getPictureId($images);
    4545
     
    5858    $template->assign('AK_HORIZONTAL_TPL', AK_PLUGIN_TEMPLATE. '/ak_horizontal.tpl');
    5959    $template->assign('AK_THUMBNAILS_LOC', $this->plugin_config->ak_thumbnails_loc);
    60   }
    61 
     60                /* Thumbnail Nav */
     61                if (isset($page['navigation_bar'])) {
     62                        $nav = explode(' | ', $page['navigation_bar']);
     63                        if (substr($nav[1],0,2)=='<a') {
     64                                $this->navbar['URL_PREV'] = substr($nav[1],9,stripos($nav[1],'" rel="'));
     65                        }
     66                        if (substr($nav[3],0,2)=='<a') {
     67                                $this->navbar['URL_NEXT'] = substr($nav[3],9,stripos($nav[3],'" rel="'));
     68                        }
     69                        $template->assign('navbar', $this->navbar);
     70                }
     71}
    6272
    6373  public function loc_end_index_thumbnails($tpl_vars, $images) {
     
    8595  private function getPictureId($images) {
    8696    if ($GLOBALS['conf']['question_mark_in_urls']==false and
    87         isset($_SERVER["PATH_INFO"]) and !empty($_SERVER["PATH_INFO"]) ) {
     97      isset($_SERVER["PATH_INFO"]) and !empty($_SERVER["PATH_INFO"]) ) {
    8898      $rewritten = $_SERVER["PATH_INFO"];
    8999      $rewritten = str_replace('//', '/', $rewritten);
     
    91101      $rewritten = '';
    92102      foreach (array_keys($_GET) as $keynum => $key) {
    93         $rewritten = $key;
    94         break;
     103        $rewritten = $key;
     104        break;
    95105      }
    96106    }
    97107    $rewritten = make_index_url().$rewritten;
    98108    $pattern = sprintf('`^%s/(?:start\-\d+/)?picture/(\d+)$`',
    99                        str_replace('?', '\?', $this->category_url)
    100                        );
     109           str_replace('?', '\?', $this->category_url)
     110           );
    101111
    102112    if (preg_match($pattern, $rewritten, $matches)) {
    103113      foreach ($images as $index => $image) {
    104         if ($image['id']==$matches[1]) {
    105           return $index;
    106         }
     114        if ($image['id']==$matches[1]) {
     115          return $index;
     116        }
    107117      }
    108118      return false;
Note: See TracChangeset for help on using the changeset viewer.