Rewrites/fixes for handling config entries in SQLs
[mailer.git] / inc / classes / rdf.class.php
index dc1e85ca4539de1b62d62ab0fb0e8f5d12e5ebd8..9c9a0a2ff0d5ee108ad9784a3158de2ef9999a5d 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
@@ -246,7 +246,7 @@ class fase4_rdf {
         * @access private
         * @var    int
         */
-       var $_item_count = 0;
+       var $_item_count = '0';
 
        /**
         * No of max <item>s
@@ -399,7 +399,7 @@ class fase4_rdf {
                $this->out .= $this->cache();
                $this->out .= "</table>";
                $this->_output = '';
-               $this->_item_count = 0;
+               $this->_item_count = '0';
                return true;
        }
 
@@ -414,12 +414,13 @@ class fase4_rdf {
         */
        function finish($return = false)
        {
+               $this->out = str_replace('$', '&#36;', $this->out);
+
                if (!$return) {
                        echo $this->out;
                } else {
                        return $this->out;
                }
-               flush();
                $this->_garbage_collection();
        }
 
@@ -621,13 +622,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 +666,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 +695,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 +711,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>');
@@ -806,7 +807,7 @@ class fase4_rdf {
                                        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";
@@ -874,7 +875,7 @@ class fase4_rdf {
         */
        function get_parser_id ($parser) {
                // Default is zero
-               $id = 0;
+               $id = '0';
 
                // Is it a resource?
                if (is_resource($parser)) {
@@ -1078,7 +1079,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].'/';
@@ -1297,7 +1298,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);