Changeset 1064 for trunk/admin/site_reader_remote.php
- Timestamp:
- Mar 5, 2006, 12:31:46 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/site_reader_remote.php
r1058 r1064 40 40 { 41 41 $this->site_url = $url; 42 $this->insert_attributes = array('tn_ext', 'representative_ext', 'has_high'); 43 $this->update_attributes = array( 'representative_ext', 'has_high', 'filesize', 'width', 'height' ); 42 $this->insert_attributes = array( 43 'tn_ext', 'representative_ext', 'has_high' 44 ); 45 $this->update_attributes = array( 46 'representative_ext', 'has_high', 'filesize', 'width', 'height' 47 ); 44 48 } 45 49 … … 52 56 { 53 57 global $errors; 58 54 59 $listing_file = $this->site_url.'/listing.xml'; 55 60 if (@fopen($listing_file, 'r')) … … 59 64 $xml_content = getXmlCode($listing_file); 60 65 $info_xml_element = getChild($xml_content, 'informations'); 61 if ( getAttribute($info_xml_element , 'phpwg_version') != PHPWG_VERSION ) 62 { 63 array_push($errors, array('path' => $listing_file, 'type' => 'PWG-ERROR-VERSION')); 66 if (getAttribute($info_xml_element , 'phpwg_version') != PHPWG_VERSION) 67 { 68 array_push( 69 $errors, 70 array( 71 'path' => $listing_file, 72 'type' => 'PWG-ERROR-VERSION' 73 ) 74 ); 75 64 76 return false; 65 77 } 66 $meta_attributes = explode ( ',', 67 getAttribute($info_xml_element , 'metadata') ); 68 $this->update_attributes = array_merge( $this->update_attributes, $meta_attributes ); 78 79 $this->update_attributes = array_merge( 80 $this->update_attributes, 81 explode(',', getAttribute($info_xml_element, 'metadata')) 82 ); 83 69 84 $this->build_structure($xml_content, '', 0); 85 70 86 return true; 71 87 } 72 88 else 73 89 { 74 array_push($errors, array('path' => $listing_file, 'type' => 'PWG-ERROR-NOLISTING')); 90 array_push( 91 $errors, 92 array( 93 'path' => $listing_file, 94 'type' => 'PWG-ERROR-NOLISTING' 95 ) 96 ); 97 75 98 return false; 76 99 } … … 84 107 { 85 108 $full_dir = $this->site_url . $dir; 86 if ( $full_dir!=$basedir87 and strpos($full_dir, $basedir)===0109 if ($full_dir != $basedir 110 and strpos($full_dir, $basedir) === 0 88 111 ) 89 112 { … … 106 129 { 107 130 $full_dir = $this->site_url . $dir; 108 if ( strpos($full_dir, $path)===0)109 { 110 foreach ( 131 if (strpos($full_dir, $path) === 0) 132 { 133 foreach ($files as $file) 111 134 { 112 $data = $this->get_element_attributes($file, 113 $this->insert_attributes); 135 $data = $this->get_element_attributes( 136 $file, 137 $this->insert_attributes 138 ); 114 139 $elements[$file] = $data; 115 140 } … … 130 155 function get_element_update_attributes($file) 131 156 { 132 return $this->get_element_attributes($file, 133 $this->update_attributes); 157 return $this->get_element_attributes( 158 $file, 159 $this->update_attributes 160 ); 134 161 } 135 162 … … 144 171 { 145 172 $xml_element = $this->site_files[$file]; 146 if ( ! isset($xml_element))173 if (!isset($xml_element)) 147 174 { 148 175 return null; … … 178 205 if ($basedir != '') 179 206 { 180 $xml_elements = getChildren( getChild($xml_content, 'root'), 'element' ); 207 $xml_elements = getChildren( 208 getChild($xml_content, 'root'), 209 'element' 210 ); 181 211 foreach ($xml_elements as $xml_element) 182 212 { 183 213 $path = getAttribute($xml_element, 'path'); 184 214 $this->site_files[$path] = $xml_element; 185 array_push( 215 array_push($this->site_dirs[$basedir], $path); 186 216 } 187 217 }
Note: See TracChangeset
for help on using the changeset viewer.