Changeset 7315


Ignore:
Timestamp:
10/21/10 10:11:57 (9 years ago)
Author:
nikrou
Message:

Fix issue 1932 : photoWidget is not compatible with id-name category url style

Location:
extensions/photoWidget
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/photoWidget/CHANGELOG

    r7282 r7315  
     1photoWidget 0.2.3 - 2010-10-21 
     2================================ 
     3* Fix issue 1932 : photoWidget is not compatible with id-name category url style 
     4 
    15photoWidget 0.2.2 - 2010-10-19 
    26================================ 
  • extensions/photoWidget/include/photoWidgetContent.class.php

    r6850 r7315  
    7171 
    7272    $template->set_filename('index_thumbnails', PW_TEMPLATE . '/animation.tpl'); 
    73     if (!empty($page['category']['permalink'])) { 
    74       $template->assign('PW_XML', sprintf($this->fmt_xml, $page['category']['permalink'])); 
    75     } else { 
    76       $template->assign('PW_XML', sprintf($this->fmt_xml, $page['category']['id'])); 
    77     } 
     73    $template->assign('PW_XML', $this->getXmlPath($page['category'])); 
    7874    $template->assign('PW_BGCOLOR', $this->plugin_config->pw_bgcolor); 
    7975    $template->assign('PW_WIDTH', $this->plugin_config->pw_width); 
     
    10399;'; 
    104100      $result = pwg_query($query); 
    105       while ($row = pwg_db_fetch_assoc($result)) 
    106       { 
     101      while ($row = pwg_db_fetch_assoc($result)) { 
    107102        $thumbnail_src_of[$row['id']] = get_thumbnail_url($row); 
    108103      } 
     
    116111     
    117112    $template->set_filename('index_category_thumbnails', PW_TEMPLATE . '/animation.tpl'); 
    118     $template->assign('PW_XML', sprintf($this->fmt_xml, $page['category']['id'])); 
     113    $template->assign('PW_XML', $this->getXmlPath($page['category'])); 
    119114    $template->assign('PW_BGCOLOR', $this->plugin_config->pw_bgcolor); 
    120115    $template->assign('PW_WIDTH', $this->plugin_config->pw_width); 
    121116    $template->assign('PW_HEIGHT', $this->plugin_config->pw_height); 
    122117    $template->assign('PW_SWF_ANIMATION', PW_SWF . '/photowidget.swf'); 
     118  } 
     119 
     120  private function getXmlPath($category) { 
     121    if (!empty($category['permalink'])) { 
     122      return sprintf($this->fmt_xml, $category['permalink']); 
     123    } elseif ( $GLOBALS['conf']['category_url_style']=='id-name' ) { 
     124      $id_name = $category['id'] . '-' . str2url($category['name']); 
     125      return sprintf($this->fmt_xml, $id_name); 
     126    } else { 
     127      return sprintf($this->fmt_xml, $category['id']); 
     128    }     
    123129  } 
    124130 
  • extensions/photoWidget/main.inc.php

    r7282 r7315  
    2222/* 
    2323Plugin Name: photoWidget 
    24 Version: 0.2.2 
     24Version: 0.2.3 
    2525Description: add an amazing 3D animation for pictures 
    2626Plugin URI: http://piwigo.org/ext/extension_view.php?eid=370 
Note: See TracChangeset for help on using the changeset viewer.