Changeset 3829 for extensions/akBookStyle/trunk/include/akContent.class.php
- Timestamp:
- Sep 6, 2009, 10:26:32 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/akBookStyle/trunk/include/akContent.class.php
r3813 r3829 35 35 36 36 public function loc_begin_index_thumbnails($images) { 37 global $template ;37 global $template, $page; 38 38 39 39 $this->category_url = make_index_url(array('section' => 'category', 40 41 42 43 40 'category' => $GLOBALS['page']['category'], 41 'start' => $GLOBALS['page']['start'] 42 ) 43 ); 44 44 $this->current_picture = $this->getPictureId($images); 45 45 … … 58 58 $template->assign('AK_HORIZONTAL_TPL', AK_PLUGIN_TEMPLATE. '/ak_horizontal.tpl'); 59 59 $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 } 62 72 63 73 public function loc_end_index_thumbnails($tpl_vars, $images) { … … 85 95 private function getPictureId($images) { 86 96 if ($GLOBALS['conf']['question_mark_in_urls']==false and 87 97 isset($_SERVER["PATH_INFO"]) and !empty($_SERVER["PATH_INFO"]) ) { 88 98 $rewritten = $_SERVER["PATH_INFO"]; 89 99 $rewritten = str_replace('//', '/', $rewritten); … … 91 101 $rewritten = ''; 92 102 foreach (array_keys($_GET) as $keynum => $key) { 93 94 103 $rewritten = $key; 104 break; 95 105 } 96 106 } 97 107 $rewritten = make_index_url().$rewritten; 98 108 $pattern = sprintf('`^%s/(?:start\-\d+/)?picture/(\d+)$`', 99 100 109 str_replace('?', '\?', $this->category_url) 110 ); 101 111 102 112 if (preg_match($pattern, $rewritten, $matches)) { 103 113 foreach ($images as $index => $image) { 104 105 106 114 if ($image['id']==$matches[1]) { 115 return $index; 116 } 107 117 } 108 118 return false;
Note: See TracChangeset
for help on using the changeset viewer.