+++ /dev/null
-<?php
-/************************************************************************
- * MXChange v0.2.1 Start: 10/19/2003 *
- * ================ Last change: 10/19/2003 *
- * *
- * -------------------------------------------------------------------- *
- * File : what- *
- * -------------------------------------------------------------------- *
- * Short description : *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung : *
- * -------------------------------------------------------------------- *
- * *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
- * *
- * 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 *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
- * MA 02110-1301 USA *
- ************************************************************************/
-
-// Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
-}
-
-// Special file
-require_once (PATH."inc/rdf.class.php");
-
-// Add description as navigation point
-ADD_DESCR("guest", basename(__FILE__));
-
-OUTPUT_HTML("<DIV style=\"padding-left: 10px; padding-right: 10px\">");
-$rdf = new fase4_rdf;
-$rdf->use_dynamic_display(false);
-$rdf->set_CacheDir(PATH."cache/");
-$rdf->set_salt(SITE_KEY);
-$rdf->set_Options(
- array(
- "textinput" => "hidden",
- "sitelink" => "http://blog.mxchange.org"
- )
-);
-$rdf->set_max_item(10);
-$rdf->parse_RDF("http://blog.mxchange.org/feed/");
-$rdf->finish();
-$rdf->clear_cache();
-OUTPUT_HTML("</DIV>");
-
-//
-?>
* This Method avtually parses the XML data.
*
* @access private
- * @author Stefan Saasen <s@fase4.com>
+ * @author Stefan Saasen <s@fase4.com>
* @param string $data RDF File XML Data
- * @see _clear_Items()
+ * @see _clear_Items()
*/
function _parse_xRDF( $data )
{
$this->_clear_Items();
$xml_parser = xml_parser_create();
xml_set_object($xml_parser,$this);
- xml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,0);
+ xml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,0);
xml_set_element_handler($xml_parser, "_startElement", "_endElement");
xml_set_character_data_handler($xml_parser, "_parseData");
if (!xml_parse($xml_parser, trim($data))) {
$this->_parse_mode = "all";
}
- if( !isset( $this->_depth[$parser] ) ) {
- $this->_depth[$parser] = 0;
+ if( !isset( $this->_depth[$this->get_parser_id($parser)] ) ) {
+ $this->_depth[$this->get_parser_id($parser)] = 0;
}
- $this->_depth[$parser]++;
+ $this->_depth[$this->get_parser_id($parser)]++;
array_push($this->_tags, $name);
- if( !isset( $this->_cdepth[$parser] ) ) {
- $this->_cdepth[$parser] = 0;
+ if( !isset( $this->_cdepth[$this->get_parser_id($parser)] ) ) {
+ $this->_cdepth[$this->get_parser_id($parser)] = 0;
}
- $this->_cdepth[$parser]++;
+ $this->_cdepth[$this->get_parser_id($parser)]++;
array_push($this->_ctags, $name);
} // END _startElement()
*/
function _endElement($parser, $name) {
array_pop($this->_tags);
- $this->_depth[$parser]--;
+ $this->_depth[$this->get_parser_id($parser)]--;
array_pop($this->_ctags);
- $this->_cdepth[$parser]--;
+ $this->_cdepth[$this->get_parser_id($parser)]--;
$this->_item["link"] = trim($this->_item["link"]);
if ((!empty($this->_display_opt["refid"])) && (!empty($this->_item["link"])))
{
return $this->_array_textinput;
}
+ /**
+ * Getter for parser id from resource
+ *
+ * @access private
+ * @author Roland Haeder <webmaster@mxchange.org>
+ * @return int
+ */
+ function get_parser_id ($parser) {
+ // Default is zero
+ $id = 0;
+
+ // Is it a resource?
+ if (is_resource($parser)) {
+ // Cast the resource into id
+ $id = (int) $parser;
+ } // END - if
+
+ // Return the id
+ return $id;
+ }
+
/**
* This Method returns the data from <image />.
*
if ($clean) {
$text = preg_replace("/^\s+/", "", $text)."\n";
if($this->_parse_mode == "all") {
- if ( isset($this->_item[$this->_tags[$this->_depth[$parser]]]) &&
- $this->_item[$this->_tags[$this->_depth[$parser]]] ) {
- $this->_item[$this->_tags[$this->_depth[$parser]]] .= $text;
+ if ( isset($this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]]) &&
+ $this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]] ) {
+ $this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]] .= $text;
} else {
- $this->_item[$this->_tags[$this->_depth[$parser]]] = $text;
+ $this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]] = $text;
}
} elseif (isset($this->_parse_mode) && $this->_parse_mode == "channel") {
- if ( isset($this->_citem[$this->_ctags[$this->_cdepth[$parser]]]) ) {
- $this->_citem[$this->_ctags[$this->_cdepth[$parser]]] .= $text;
+ if ( isset($this->_citem[$this->_ctags[$this->_cdepth[$this->get_parser_id($parser)]]]) ) {
+ $this->_citem[$this->_ctags[$this->_cdepth[$this->get_parser_id($parser)]]] .= $text;
} else {
- $this->_citem[$this->_ctags[$this->_cdepth[$parser]]] = $text;
+ $this->_citem[$this->_ctags[$this->_cdepth[$this->get_parser_id($parser)]]] = $text;
}
}
}
{
$dir = dir($this->_cache_dir);
while($file=$dir->read()) {
- if($file!="." && $file!="..") {
+ // Exclude directories
+ if (is_file($dir->path.$file) && substr($file, -6, 6) != ".cache") {
if(!@unlink($dir->path.$file)) {
$this->_throw_exception(
"Unable to unlink ".$dir->path.$file