diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-03-28 01:26:37 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-03-28 01:26:37 +0000 |
commit | 7690f9bb8bfe33b6d0e85c6473f8d39a4fddf0df (patch) | |
tree | 80fc0ff864a27cbf3597a0dfbb094fc744cf039d /admin/site_reader_remote.php | |
parent | 51a4de797c76dbda26741acacbda76013caa5f64 (diff) |
fix: php 5 errors and warnings
improve: put back update remote site from local listing.xml functionality
(allow_url_fopen is false on several ISPs)
git-svn-id: http://piwigo.org/svn/trunk@1107 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/site_reader_remote.php')
-rw-r--r-- | admin/site_reader_remote.php | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/admin/site_reader_remote.php b/admin/site_reader_remote.php index 1810b955b..03ad7d45a 100644 --- a/admin/site_reader_remote.php +++ b/admin/site_reader_remote.php @@ -6,9 +6,9 @@ // +-----------------------------------------------------------------------+ // | branch : BSF (Best So Far) // | file : $RCSfile$ -// | last update : $Date: 2005-12-03 17:03:58 -0500 (Sat, 03 Dec 2005) $ -// | last modifier : $Author: plg $ -// | revision : $Revision: 967 $ +// | last update : $Date$ +// | last modifier : $Author$ +// | revision : $Revision$ // +-----------------------------------------------------------------------+ // | This program is free software; you can redistribute it and/or modify | // | it under the terms of the GNU General Public License as published by | @@ -31,12 +31,13 @@ class RemoteSiteReader { var $site_url; +var $listing_url; var $site_dirs; var $site_files; var $insert_attributes; var $update_attributes; -function RemoteSiteReader($url) +function RemoteSiteReader($url, $listing_url) { $this->site_url = $url; $this->insert_attributes = array( @@ -45,6 +46,15 @@ function RemoteSiteReader($url) $this->update_attributes = array( 'representative_ext', 'has_high', 'filesize', 'width', 'height' ); + + if (!isset($listing_url)) + { + $this->listing_url = $this->site_url.'/listing.xml'; + } + else + { + $this->listing_url = $listing_url; + } } /** @@ -55,24 +65,23 @@ function RemoteSiteReader($url) function open() { global $errors; - - $listing_file = $this->site_url.'/listing.xml'; - if (@fopen($listing_file, 'r')) + + if (@fopen($this->listing_url, 'r')) { $this->site_dirs = array(); $this->site_files = array(); - $xml_content = getXmlCode($listing_file); + $xml_content = getXmlCode($this->listing_url); $info_xml_element = getChild($xml_content, 'informations'); if (getAttribute($info_xml_element , 'phpwg_version') != PHPWG_VERSION) { array_push( $errors, array( - 'path' => $listing_file, + 'path' => $this->listing_url, 'type' => 'PWG-ERROR-VERSION' ) ); - + return false; } @@ -80,9 +89,9 @@ function open() $this->update_attributes, explode(',', getAttribute($info_xml_element, 'metadata')) ); - + $this->build_structure($xml_content, '', 0); - + return true; } else @@ -90,7 +99,7 @@ function open() array_push( $errors, array( - 'path' => $listing_file, + 'path' => $this->listing_url, 'type' => 'PWG-ERROR-NOLISTING' ) ); |