Changeset 7385
- Timestamp:
- Oct 25, 2010, 10:31:09 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/photoWidget/include/photoWidgetContent.class.php
r7315 r7385 22 22 class photoWidgetContent 23 23 { 24 private $ query_string = null, $applicable = false;24 private $show_xml_list = false, $applicable = false; 25 25 26 26 public function __construct($config) { 27 27 $this->plugin_config = $config; 28 29 $this->fmt_xml = make_index_url() . '/category/%s/pw.xml';30 $xml_pattern = '`category/([^/]*)/pw\.xml$`';31 32 if (preg_match($xml_pattern, $_SERVER['QUERY_STRING'], $matches)) {33 $this->query_string = $matches[1];34 }35 28 } 36 29 … … 48 41 } 49 42 } 43 44 $match_content = $_SERVER['QUERY_STRING']; 45 if (PHPWG_ROOT_PATH != $page['root_path']) { 46 $match_content = $_SERVER['PATH_INFO']; 47 } 48 49 $xml_pattern = '#/pw\.xml$#'; 50 if (preg_match($xml_pattern, $match_content)) { 51 $this->show_xml_list = true; 52 } 50 53 } 51 54 … … 57 60 } 58 61 59 if ($this-> query_string!=null)62 if ($this->show_xml_list) 60 63 { 61 64 foreach ($images as &$image) { … … 85 88 } 86 89 87 if ($this-> query_string!=null)90 if ($this->show_xml_list) 88 91 { 89 92 $image_ids = array(); … … 119 122 120 123 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 } 124 global $page; 125 126 return sprintf( 127 '%s/pw.xml', 128 make_index_url( 129 array( 130 'section' => 'categories', 131 'category' => $page['category'] 132 ) 133 ) 134 ); 129 135 } 130 136
Note: See TracChangeset
for help on using the changeset viewer.