diff --git a/configuration.php b/configuration.php index 4d7c581..bff5d04 100644 --- a/configuration.php +++ b/configuration.php @@ -18,7 +18,7 @@ class configuration /** * URL of the website */ - var $url = 'http://www.nojhan.net/geekscottes'; + var $url = 'http://localhost/~nojhan/stripit/trunk'; /** * Title of the website diff --git a/rss.php b/rss.php index 50a2ae6..7437443 100644 --- a/rss.php +++ b/rss.php @@ -14,6 +14,12 @@ set_include_path(get_include_path() . PATH_SEPARATOR . getcwd()); require_once 'strip_manager.php'; require_once 'configuration.php'; +// hack for passing objects by values instead of reference under PHP5 (but not PHP4) +// damn clone keyword ! +if (version_compare(phpversion(), '5.0') < 0) { + eval('function clone($object) {return $object;}'); +} + /** * RSS manager */ @@ -47,13 +53,13 @@ class rss_manager $sm->strips_list_get(); - for( $i = 0; $i < $sm->strips_count; $i++ ) { + for( $i = $sm->strips_count-1; $i >= 0; $i-- ) { // reverser order $sm->strip_info_get( $i ); - + // conversion iso8601 -> RFC822 $sm->date = date('r', strtotime($sm->date)); - $this->items_list[] = $sm; + $this->items_list[] = clone($sm); // hack for php4/5 compat } } diff --git a/strip_manager.php b/strip_manager.php index 60ed67b..27b35a2 100644 --- a/strip_manager.php +++ b/strip_manager.php @@ -241,7 +241,6 @@ class strip_manager * @param integer index of the file to parse in the {@link $strips_list} */ function strip_info_get( $element_asked ) { - $this->current_id = $element_asked; $file = $this->strips_list[$element_asked];