diff --git a/includes/hostname.conf b/includes/hostname.conf index 78882cc7d228e44b2c677dbcc21aef9a68672303..affdbd4c8afcc585f7636232a137737db2c39c85 100644 --- a/includes/hostname.conf +++ b/includes/hostname.conf @@ -35,7 +35,7 @@ $comment_votes = array("none" => "none", # # Allowed HTML tags: # -$allowed_html = "<A><B><BLOCKQUOTE><BR><DD><DL><DT><EM><HR><I><LI><SMALL><OL><U><UL>"; +$allowed_html = "<A><B><BLOCKQUOTE><DD><DL><DT><EM><HR><I><LI><SMALL><OL><U><UL>"; # # Name for anonymous users: diff --git a/modules/backend.class b/modules/backend.class index 2028c5d876aefed95647f2856d925176ff9bc863..7cdaa328b2f9ac84189b61026b068fc326cff70b 100644 --- a/modules/backend.class +++ b/modules/backend.class @@ -1,5 +1,4 @@ <? - class backend { // Channel properties: @@ -46,7 +45,7 @@ class backend { } } - function rdf2sql($timout = 10) { + function url2sql($timout = 10) { global $site_name; if ($this->file) { @@ -62,12 +61,10 @@ class backend { $fp = fsockopen($host, $port, &$errno, &$errstr, $timout); if ($fp) { - // Get data from URL: - fputs($fp, "GET $path HTTP/1.0\n"); - fputs($fp, "User-Agent: $site_name\n"); - fputs($fp, "Host: ". $host ."\n"); - fputs($fp, "Accept: */*\n\n"); + // Request data via URL: + fputs($fp, "GET $path HTTP/1.0\nUser-Agent: $site_name\nHost: $host\nAccept: */*\n\n"); + // Read data from socket: while(!feof($fp)) $data .= fgets($fp, 128); // print "<PRE>$data</PRE><HR>"; @@ -93,7 +90,7 @@ class backend { $title = ereg_replace(".*<title>", "", $item); $title = ereg_replace("</title>.*", "", $title); - // Count the number of stories: + // Increase the number of headlines: $number += 1; // Insert item in database: @@ -104,25 +101,13 @@ class backend { $result = db_query("UPDATE channel SET timestamp = '". time() ."' WHERE id = $this->id"); $this->timestamp = time(); } - else print "<HR>RDF parser: 404 error?<BR><BR><PRE>$data</PRE><HR>"; + else { + watchdog("error", "failed to retrieve headline data from $host: <PRE>$data</PRE>"); + } } } } - function rss2sql($timout = 10) { - print "backend->rss2sql : TODO<BR>"; - } - - function xml2sql($timout = 10) { - print "backend->xml2sql : TODO<BR>"; - } - - function url2sql($timout = 10) { - if (strstr($this->file, ".rdf")) $this->rdf2sql($timout); - if (strstr($this->file, ".rss")) $this->rss2sql($timout); - if (strstr($this->file, ".xml")) $this->xml2sql($timout); - } - function displayHeadlines($timout = 1800) { global $theme;