summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-08-03 18:39:17 +0000
committerDries Buytaert <dries@buytaert.net>2001-08-03 18:39:17 +0000
commitcd48b94ad9ee078cf38fb7d58c1f4500dd5ccb7e (patch)
tree38c844b9102b5c60e70e6c4974435784d2882122 /modules
parent2e8763bac0208a85e7d0f93ff4561684b1813b3c (diff)
downloadbrdo-cd48b94ad9ee078cf38fb7d58c1f4500dd5ccb7e.tar.gz
brdo-cd48b94ad9ee078cf38fb7d58c1f4500dd5ccb7e.tar.bz2
- import.module:
+ applied Julian's fputs() patch + fixed typo - cloud.module: + applied Julian's fputs() patch - comment.module: + applied Julian's "delete" patch
Diffstat (limited to 'modules')
-rw-r--r--modules/aggregator.module8
-rw-r--r--modules/aggregator/aggregator.module8
-rw-r--r--modules/cloud.module3
-rw-r--r--modules/comment.module9
-rw-r--r--modules/comment/comment.module9
-rw-r--r--modules/import.module8
6 files changed, 32 insertions, 13 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module
index e77a4aef9..807ed9098 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -144,7 +144,7 @@ function import_refresh($feed) {
if ($fp) {
// fetch data:
- fputs($fp, "GET $url[path]?$url[query] HTTP/1.0\nUser-Agent: ". variable_get("site_name", "drupal") ."\nHost: $url[host]\nAccept: */*\n\n");
+ fputs($fp, "GET $url[path]?$url[query] HTTP/1.0\r\nUser-Agent: ". variable_get("site_name", "drupal") ."\r\nHost: $url[host]\r\nAccept: */*\r\n\r\n");
while (!feof($fp)) $data .= fgets($fp, 128);
@@ -202,12 +202,12 @@ function import_refresh($feed) {
** Strip invalid tags and provide default values (if required):
*/
- $title = strip_tags(strtr($title[1] ? $title[1] : $feed[title], $tt));$title = strip_tags(strtr($title[1] ? $title[1] : substr(strip_tags(strtr($description[1], $tt)), 0, 30), $tt));
+ $title = strip_tags(strtr($title[1] ? $title[1] : substr(strip_tags(strtr($description[1], $tt)), 0, 30), $tt));
$link = $link[1] ? $link[1] : $feed[link];
$description = strtr($description[1], $tt);
- // print "<pre>title = ". htmlentities($title) ."\n\ndescription = ". htmlentities($description) ."\n\nlink = ". htmlentities($link) ."</pre><hr />";
-
+ print "<pre>title = ". htmlentities($title) ."\n\ndescription = ". htmlentities($description) ."\n\nlink = ". htmlentities($link) ."</pre><hr />";
+
/*
** Save this item:
*/
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index e77a4aef9..807ed9098 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -144,7 +144,7 @@ function import_refresh($feed) {
if ($fp) {
// fetch data:
- fputs($fp, "GET $url[path]?$url[query] HTTP/1.0\nUser-Agent: ". variable_get("site_name", "drupal") ."\nHost: $url[host]\nAccept: */*\n\n");
+ fputs($fp, "GET $url[path]?$url[query] HTTP/1.0\r\nUser-Agent: ". variable_get("site_name", "drupal") ."\r\nHost: $url[host]\r\nAccept: */*\r\n\r\n");
while (!feof($fp)) $data .= fgets($fp, 128);
@@ -202,12 +202,12 @@ function import_refresh($feed) {
** Strip invalid tags and provide default values (if required):
*/
- $title = strip_tags(strtr($title[1] ? $title[1] : $feed[title], $tt));$title = strip_tags(strtr($title[1] ? $title[1] : substr(strip_tags(strtr($description[1], $tt)), 0, 30), $tt));
+ $title = strip_tags(strtr($title[1] ? $title[1] : substr(strip_tags(strtr($description[1], $tt)), 0, 30), $tt));
$link = $link[1] ? $link[1] : $feed[link];
$description = strtr($description[1], $tt);
- // print "<pre>title = ". htmlentities($title) ."\n\ndescription = ". htmlentities($description) ."\n\nlink = ". htmlentities($link) ."</pre><hr />";
-
+ print "<pre>title = ". htmlentities($title) ."\n\ndescription = ". htmlentities($description) ."\n\nlink = ". htmlentities($link) ."</pre><hr />";
+
/*
** Save this item:
*/
diff --git a/modules/cloud.module b/modules/cloud.module
index d429ce637..e66a4806f 100644
--- a/modules/cloud.module
+++ b/modules/cloud.module
@@ -55,7 +55,8 @@ function cloud_update($site) {
if ($fp) {
// fetch data:
- fputs($fp, "GET $link[path]?$link[query] HTTP/1.0\nUser-Agent: ". variable_get(site_name, "drupal") ."\nHost: $link[host]\nAccept: */*\n\n");
+ fputs($fp, "GET $link[path]?$link[query] HTTP/1.0\r\nUser-Agent: ". variable_get(site_name, "drupal") ."\r\nHost: $link[host]\r\nAccept: */*\r\n\r\n");
+
while(!feof($fp)) $data .= fgets($fp, 128);
if (strstr($data, "200 OK")) {
diff --git a/modules/comment.module b/modules/comment.module
index 0a8150799..873af4326 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -53,6 +53,11 @@ function comment_overview() {
return $output;
}
+function comment_delete($id) {
+ db_query("DELETE FROM comments WHERE cid = '$id'");
+ watchdog("special", "comment: deleted '$id'");
+}
+
function comment_admin() {
global $op, $id, $edit, $mod, $keys, $order;
@@ -68,6 +73,10 @@ function comment_admin() {
print search_form($keys);
print search_data($keys, $mod);
break;
+ case "delete":
+ print comment_delete(check_input($id));
+ print comment_overview();
+ break;
case t("Submit"):
print status(comment_save(check_input($id), $edit));
print comment_overview();
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 0a8150799..873af4326 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -53,6 +53,11 @@ function comment_overview() {
return $output;
}
+function comment_delete($id) {
+ db_query("DELETE FROM comments WHERE cid = '$id'");
+ watchdog("special", "comment: deleted '$id'");
+}
+
function comment_admin() {
global $op, $id, $edit, $mod, $keys, $order;
@@ -68,6 +73,10 @@ function comment_admin() {
print search_form($keys);
print search_data($keys, $mod);
break;
+ case "delete":
+ print comment_delete(check_input($id));
+ print comment_overview();
+ break;
case t("Submit"):
print status(comment_save(check_input($id), $edit));
print comment_overview();
diff --git a/modules/import.module b/modules/import.module
index e77a4aef9..807ed9098 100644
--- a/modules/import.module
+++ b/modules/import.module
@@ -144,7 +144,7 @@ function import_refresh($feed) {
if ($fp) {
// fetch data:
- fputs($fp, "GET $url[path]?$url[query] HTTP/1.0\nUser-Agent: ". variable_get("site_name", "drupal") ."\nHost: $url[host]\nAccept: */*\n\n");
+ fputs($fp, "GET $url[path]?$url[query] HTTP/1.0\r\nUser-Agent: ". variable_get("site_name", "drupal") ."\r\nHost: $url[host]\r\nAccept: */*\r\n\r\n");
while (!feof($fp)) $data .= fgets($fp, 128);
@@ -202,12 +202,12 @@ function import_refresh($feed) {
** Strip invalid tags and provide default values (if required):
*/
- $title = strip_tags(strtr($title[1] ? $title[1] : $feed[title], $tt));$title = strip_tags(strtr($title[1] ? $title[1] : substr(strip_tags(strtr($description[1], $tt)), 0, 30), $tt));
+ $title = strip_tags(strtr($title[1] ? $title[1] : substr(strip_tags(strtr($description[1], $tt)), 0, 30), $tt));
$link = $link[1] ? $link[1] : $feed[link];
$description = strtr($description[1], $tt);
- // print "<pre>title = ". htmlentities($title) ."\n\ndescription = ". htmlentities($description) ."\n\nlink = ". htmlentities($link) ."</pre><hr />";
-
+ print "<pre>title = ". htmlentities($title) ."\n\ndescription = ". htmlentities($description) ."\n\nlink = ". htmlentities($link) ."</pre><hr />";
+
/*
** Save this item:
*/