Extension ext-network does now show if a network requires the webmaster to send a...
[mailer.git] / inc / classes / rdf.class.php
index 7ab88f773e80ae0858c33106e54439313899b38f..78c7e95fbbd267e132e9a4d5745f6161b6b44615 100644 (file)
@@ -53,7 +53,7 @@ class fase4_rdf {
         * @access private
         * @var    integer
         */
-       var $_word_wrap = 0;
+       var $_word_wrap = '0';
 
        /**
         * Wether to recode \n -> <br /> or not in description
@@ -68,11 +68,12 @@ class fase4_rdf {
         *
         * "htmlentities" - Use the function htmlentities()
         * "utf8_decode"  - Use the function ut8_decode() when you have UTF8 encoded text
+        * <empty>        - Use non of both
         *
         * @access private
         * @var    string
         */
-       var $_decoding_mode = 'utf8_decode';
+       var $_decoding_mode = '';
 
        /**
         * If $_link_target is set a target='xxx' attribute in each <a /> and <form accept-charset="utf-8" /> html tag will be added
@@ -246,7 +247,7 @@ class fase4_rdf {
         * @access private
         * @var    int
         */
-       var $_item_count = 0;
+       var $_item_count = '0';
 
        /**
         * No of max <item>s
@@ -399,7 +400,7 @@ class fase4_rdf {
                $this->out .= $this->cache();
                $this->out .= "</table>";
                $this->_output = '';
-               $this->_item_count = 0;
+               $this->_item_count = '0';
                return true;
        }
 
@@ -412,14 +413,14 @@ class fase4_rdf {
         * @return    string Displays RDF Content ( using _display() )
         * @see          _remote_file, cache()
         */
-       function finish($return = false)
-       {
+       function finish($return = false) {
+               $this->out = str_replace('$', '&#36;', $this->out);
+
                if (!$return) {
                        echo $this->out;
                } else {
                        return $this->out;
                }
-               flush();
                $this->_garbage_collection();
        }
 
@@ -438,8 +439,7 @@ class fase4_rdf {
         * @return    string Displays RDF Content ( using _display() )
         * @see          _remote_file, cache()
         */
-       function use_dynamic_display( $bool )
-       {
+       function use_dynamic_display( $bool ) {
                $this->_use_dynamic_display = $bool;
                return true;
        }
@@ -452,8 +452,7 @@ class fase4_rdf {
         * @param     string $data    RDF File XML Data
         * @see       _clear_Items()
         */
-       function _parse_xRDF( $data )
-       {
+       function _parse_xRDF( $data ) {
                $this->_clear_Items();
                $xml_parser = xml_parser_create();
                xml_set_object($xml_parser,$this);
@@ -464,7 +463,7 @@ class fase4_rdf {
                        $this->_throw_exception(sprintf("XML error: %s at line %d",
                        xml_error_string(xml_get_error_code($xml_parser)),
                        xml_get_current_line_number($xml_parser)).'<br /><br />Exception in function parse_RDF().');
-               }
+               } // END - if
                xml_parser_free($xml_parser);
        }
 
@@ -475,17 +474,15 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @param     int $seconds time files will be cached (in seconds).
-        * @return       boolean
-        * @see          _refresh
+        * @return    boolean
+        * @see       _refresh
         */
-       function set_refresh( $seconds )
-       {
+       function set_refresh( $seconds ) {
                $this->_refresh = (time() - $seconds);
                return true;
        }
 
-       function set_salt( $saltPara )
-       {
+       function set_salt( $saltPara ) {
                $this->salt = $saltPara;
                return true;
        }
@@ -621,13 +618,13 @@ class fase4_rdf {
                }
 
                if( !isset( $this->_depth[$this->get_parser_id($parser)] ) ) {
-                       $this->_depth[$this->get_parser_id($parser)] = 0;
+                       $this->_depth[$this->get_parser_id($parser)] = '0';
                }
                $this->_depth[$this->get_parser_id($parser)]++;
                array_push($this->_tags, $name);
 
                if( !isset( $this->_cdepth[$this->get_parser_id($parser)] ) ) {
-                       $this->_cdepth[$this->get_parser_id($parser)] = 0;
+                       $this->_cdepth[$this->get_parser_id($parser)] = '0';
                }
                $this->_cdepth[$this->get_parser_id($parser)]++;
                array_push($this->_ctags, $name);
@@ -665,7 +662,7 @@ class fase4_rdf {
                        }
                        $this->_output .= "<a href=\"".$this->_citem['link']."\" ";
                        if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
-                       $this->_output .= ">".$this->_cut_string($this->_citem['link'])."</a>";
+                       $this->_output .= ">".$this->_cut_string($this->_citem['link']) . '</a>';
                        $this->_output .= "</td></tr>\n";
                        $this->_output .= "<tr><td><hr noshade width=\"100%\" size=\"1\"></td></tr>\n";
                        $this->_output .= "</table></td></tr>";
@@ -694,7 +691,7 @@ class fase4_rdf {
                $this->_item['link'] = trim($this->_item['link']);
                if ((!empty($this->_display_opt['refid'])) && (!empty($this->_item['link'])))
                {
-                       if (!ereg('refid=', $this->_item['link'])) $this->_item['link'] .= '?refid=' . $this->_display_opt['refid'];
+                       if (!isInString('refid=', $this->_item['link'])) $this->_item['link'] .= '?refid=' . $this->_display_opt['refid'];
                }
                switch ($name) {
                        case 'item':
@@ -710,9 +707,9 @@ class fase4_rdf {
                                                        // First remove all \n
                                                        $this->_item['description'] = str_replace('\n', ' ', $this->_item['description']);
                                                        // Wrap with <br />\n
-                                                       $this->_item['description'] = wordwrap($this->_item['description'], $this->_word_wrap, "*<br>\n");
+                                                       $this->_item['description'] = wordwrap($this->_item['description'], $this->_word_wrap, "*<br />\n");
                                                }
-                                               elseif (($this->_word_wrap == 0) && (!$this->_use_nl2br))
+                                               elseif (($this->_word_wrap == '0') && (!$this->_use_nl2br))
                                                {
                                                        // Strip tags out instead when word-wrap is disabled
                                                        $this->_item['description'] = strip_tags($this->_item['description'], '<a>, <img>');
@@ -802,11 +799,11 @@ class fase4_rdf {
                        case 'textinput':
                                if(isset($this->_display_opt['textinput']) && ($this->_display_opt['textinput'] != 'hidden') && $this->_item['name'] && $this->_item['link']) {
                                        $this->_output .= "<tr><td class=\"fase4_rdf\">\n";
-                                       $this->_output .= "<form accept-charset=\"utf-8\" action=\"".$this->_item['link']."\" ";
+                                       $this->_output .= "<form accept-charset=\"UTF-8\" action=\"".$this->_item['link']."\" ";
                                        if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
                                        $this->_output .= "method=\"get\">\n";
                                        $this->_output .= "<div class=\"fase4_rdf_title\">".$this->_item['title']."</div>";
-                                       $this->_output .= strip_tags($this->_item['description'], '<a>, <img>')."<br><br>\n";
+                                       $this->_output .= strip_tags($this->_item['description'], '<a>, <img>')."<br /><br />\n";
                                        $this->_output .= "<input class=\"fase4_rdf_input\" type=\"text\" name=\"".$this->_item['name']."\">&nbsp;\n";
                                        $this->_output .= "<input class=\"fase4_rdf_input\" type=\"submit\" value=\"go\">";
                                        $this->_output .= "</form>\n";
@@ -845,7 +842,7 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @return    array
-        * @see          _array_item
+        * @see       _array_item
         */
        function get_array_item( )
        {
@@ -858,7 +855,7 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @return    array
-        * @see          _array_textinput
+        * @see       _array_textinput
         */
        function get_array_textinput( )
        {
@@ -868,13 +865,13 @@ class fase4_rdf {
        /**
         * Getter for parser id from resource
         *
-        * @access private
-        * @author      Roland Haeder <webmaster@mxchange.org>
-        * @return      int
+        * @access   private
+        * @author   Roland Haeder <webmaster@mxchange.org>
+        * @return   int
         */
        function get_parser_id ($parser) {
                // Default is zero
-               $id = 0;
+               $id = '0';
 
                // Is it a resource?
                if (is_resource($parser)) {
@@ -892,7 +889,7 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @return    array
-        * @see          _array_image
+        * @see       _array_image
         */
        function get_array_image( )
        {
@@ -1031,7 +1028,7 @@ class fase4_rdf {
                        // get_cache_update_time()
                        clearstatcache();
                        if($this->_use_dynamic_display == true) {
-                               $_rdf = @implode(' ', $this->_rdf_data()); // -> proxy
+                               $_rdf = implode(' ', $this->_rdf_data()); // -> proxy
                                if(!$_rdf) {
                                        $this->_throw_exception( $this->_remote_file.' is not available' );
                                }
@@ -1039,7 +1036,7 @@ class fase4_rdf {
                                $this->_update_cache( $_rdf );
                                $data = $this->_output;
                        } else {
-                               $_rdf = @implode(' ', $this->_rdf_data()); // -> proxy
+                               $_rdf = implode(' ', $this->_rdf_data()); // -> proxy
                                if(!$_rdf) {
                                        $this->_throw_exception( $this->_remote_file.' is not available' );
                                }
@@ -1054,7 +1051,7 @@ class fase4_rdf {
                                $this->_parse_xRDF( implode(' ', file($_cache_f)) );
                                $data = $this->_output;
                        } else {
-                               $data = @implode(' ', file($_cache_f));
+                               $data = implode(' ', file($_cache_f));
                        }
                }
                return trim($data);
@@ -1078,8 +1075,7 @@ class fase4_rdf {
                        if($arr[0]=='') {
                                $path = '/';
                        }
-                       for($i = 0;$i<$c;$i++)
-                       {
+                       for($i = '0';$i<$c;$i++) {
                                if($arr[$i]!='') {
                                        $path .= $arr[$i].'/';
                                        if(!@is_dir($path)) {
@@ -1297,7 +1293,7 @@ class fase4_rdf {
                        }
 
 
-                       for ( $i = 0; !feof ($fp) ; $i++)
+                       for ( $i = '0'; !feof ($fp) ; $i++)
                        {
                                $usable_data[$i] = "";
                                $usable_data[$i] = fgets($fp,4096);