Changeset 1090 for trunk/include/functions_html.inc.php
- Timestamp:
- Mar 21, 2006, 2:27:21 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_html.inc.php
r1084 r1090 46 46 return $page['get_icon_cache'][$date]; 47 47 } 48 48 49 49 list($devnull, $year, $month, $day) = $matches; 50 50 $unixtime = mktime( 0, 0, 0, $month, $day, $year ); … … 56 56 return $page['get_icon_cache'][$date]; 57 57 } 58 58 59 59 $diff = time() - $unixtime; 60 60 $day_in_seconds = 24*60*60; … … 84 84 $pages_around = $conf['paginate_pages_around']; 85 85 $start_str = $clean_url ? '/start-' : '&start='; 86 86 87 87 $navbar = ''; 88 88 89 89 // current page detection 90 90 if (!isset($start) … … 94 94 $start = 0; 95 95 } 96 96 97 97 // navigation bar useful only if more than one page to display ! 98 98 if ($nb_element > $nb_element_page) … … 119 119 { 120 120 $previous = $start - $nb_element_page; 121 121 122 122 $navbar.= 123 123 '<a href="' … … 136 136 { 137 137 $navbar.= ' <a href="'.$url.'">1</a>'; 138 138 139 139 if ($cur_page > $pages_around + 2) 140 140 { … … 142 142 } 143 143 } 144 144 145 145 // inspired from punbb source code 146 146 for ($i = $cur_page - $pages_around, $stop = $cur_page + $pages_around + 1; … … 155 155 { 156 156 $temp_start = ($i - 1) * $nb_element_page; 157 157 158 158 $navbar.= 159 159 ' ' … … 177 177 { 178 178 $temp_start = ($maximum - 1) * $nb_element_page; 179 179 180 180 if ($cur_page < ($maximum - $pages_around - 1)) 181 181 { 182 182 $navbar.= ' ...'; 183 183 } 184 184 185 185 $navbar.= ' <a href="'.$url.$start_str.$temp_start.'">'.$maximum.'</a>'; 186 186 } 187 187 188 188 $navbar.= ' | '; 189 189 // link on next page ? … … 192 192 { 193 193 $next = $start + $nb_element_page; 194 194 195 195 $navbar.= 196 196 '<a href="'.$url.$start_str.$next.'" rel="next">' … … 202 202 $navbar.= $lang['next_page']; 203 203 } 204 204 205 205 $navbar.= ' | '; 206 206 // link to last page ? … … 208 208 { 209 209 $temp_start = ($maximum - 1) * $nb_element_page; 210 210 211 211 $navbar.= 212 212 '<a href="'.$url.$start_str.$temp_start.'" rel="last">' … … 258 258 { 259 259 global $conf; 260 260 261 261 $output = ''; 262 262 $is_first = true; … … 324 324 } 325 325 } 326 326 327 327 $output = ''; 328 328 $is_first = true; … … 330 330 { 331 331 $name = $cat_names[$category_id]; 332 332 333 333 if ($is_first) 334 334 { … … 385 385 $page_cat = $page['category']; 386 386 } 387 387 388 388 foreach ($categories as $category) 389 389 { … … 411 411 } 412 412 $menu.= '>'; 413 413 414 414 $url = make_index_url(array('category' => $category['id'])); 415 415 416 416 $menu.= "\n".'<a href="'.$url.'"'; 417 417 if ($page_cat != 0 … … 434 434 435 435 $menu.= str_repeat("\n</li></ul>",($level)); 436 436 437 437 return $menu; 438 438 } … … 454 454 455 455 $content = nl2br($content); 456 456 457 457 // replace _word_ by an underlined word 458 458 $pattern = '/\b_(\S*)_\b/'; 459 459 $replacement = '<span style="text-decoration:underline;">$1</span>'; 460 460 $content = preg_replace($pattern, $replacement, $content); 461 461 462 462 // replace *word* by a bolded word 463 463 $pattern = '/\b\*(\S*)\*\b/'; 464 464 $replacement = '<span style="font-weight:bold;">$1</span>'; 465 465 $content = preg_replace($pattern, $replacement, $content); 466 466 467 467 // replace /word/ by an italic word 468 468 $pattern = "/\/(\S*)\/(\s)/";
Note: See TracChangeset
for help on using the changeset viewer.