Ignore:
Timestamp:
Sep 13, 2009, 8:00:47 PM (15 years ago)
Author:
vdigital
Message:

Don't forget to adapt category name selection mask (<!--Book--> by default)
'ak_categories' is active. (bug 1160)

File:
1 edited

Legend:

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

    r3842 r3843  
    3434    $this->next_picture = null;
    3535    $this->previous_picture = null;
     36    $this->applicable = false;
    3637  }
    3738
    38   public function user_force() {
    39     $GLOBALS['user']['nb_image_page'] = $this->plugin_config->ak_by_page;
     39  public function page_force() {
     40    global $page;
     41    if ( isset($page['category']) ) {
     42      $cat_filter = $this->plugin_config->ak_categories;
     43      $this->applicable = (stripos($page['category']['name'], $cat_filter) > 0) ? true:false;
     44      if ( $this->applicable ) {
     45        $page['nb_image_page'] = $this->plugin_config->ak_by_page;
     46      }
     47    }
    4048  }
    4149
    4250  public function loc_begin_index_thumbnails($images) {
    4351    global $template;
     52    if ($this->applicable === false) return;
    4453    $this->category_url = make_index_url(array('section' => 'category',
    4554                 'category' => $GLOBALS['page']['category'],
     
    6978
    7079  public function loc_end_index_thumbnails($tpl_vars, $images) {
     80    if ($this->applicable === false) return $tpl_vars;
    7181    foreach ($tpl_vars as &$tpl_var) {
    7282      $tpl_var['AK_URL'] = $this->makeAkUrl($tpl_var);
Note: See TracChangeset for help on using the changeset viewer.