summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-10-03 20:57:01 +0000
committerDries Buytaert <dries@buytaert.net>2001-10-03 20:57:01 +0000
commit7a9bc86bd2f0ba3ba343e014a2e4c7f99d7f0946 (patch)
treebe6bef3f6ad0aba1cb9e942f85eaa325e97d7c1a /modules
parentf7e9bab197205e6fa0d2e220902f5eb6573ac1cb (diff)
downloadbrdo-7a9bc86bd2f0ba3ba343e014a2e4c7f99d7f0946.tar.gz
brdo-7a9bc86bd2f0ba3ba343e014a2e4c7f99d7f0946.tar.bz2
- Improved search architecture derived from Axel's new search patches.
(There is room for improvement so let's go from these ... and build on them.) - Removed some $status's by calls to node_status().
Diffstat (limited to 'modules')
-rw-r--r--modules/comment.module3
-rw-r--r--modules/comment/comment.module3
-rw-r--r--modules/node.module18
-rw-r--r--modules/node/node.module18
-rw-r--r--modules/search.module9
-rw-r--r--modules/search/search.module9
-rw-r--r--modules/user.module6
-rw-r--r--modules/user/user.module6
-rw-r--r--modules/weblogs.module4
9 files changed, 16 insertions, 60 deletions
diff --git a/modules/comment.module b/modules/comment.module
index d436009ae..35d7c1ccd 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -70,8 +70,7 @@ function comment_admin() {
print comment_edit($id);
break;
case "search":
- print search_form($keys);
- print search_data($keys, $mod);
+ print search_type("comment", "admin.php?mod=comment&op=search");
break;
case "delete":
print comment_delete(check_input($id));
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index d436009ae..35d7c1ccd 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -70,8 +70,7 @@ function comment_admin() {
print comment_edit($id);
break;
case "search":
- print search_form($keys);
- print search_data($keys, $mod);
+ print search_type("comment", "admin.php?mod=comment&op=search");
break;
case "delete":
print comment_delete(check_input($id));
diff --git a/modules/node.module b/modules/node.module
index da96c53d7..0b7923165 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -274,21 +274,6 @@ function node_admin_save($edit) {
}
}
-function node_module_find() {
-
- foreach (module_list() as $name) {
- if (module_hook($name, "user")) {
- $options .= "<OPTION VALUE=\"$name\">$name</OPTION>\n";
- }
- }
-
- $output .= " <input size=\"50\" value=\"". check_form($keys) ."\" name=\"keys\" type=\"text\">\n";
- $output .= " <select name=\"type\">$options</select>\n";
- $output .= " <input type=\"submit\" value=\"Search\">\n";
-
- return form($output);
-}
-
function node_edit($node) {
$output .= form_item("Title", $node->title);
$output .= form_item("Operations", implode("<br />", node_links($node->nid, $node->type)));
@@ -318,8 +303,7 @@ function node_admin() {
print node_help();
break;
case "search":
- print node_module_find($id);
- print search_data($keys, $type);
+ print search_type($type, "admin.php?mod=node&op=search", $keys, 1);
break;
case "status":
print node_edit_status($id);
diff --git a/modules/node/node.module b/modules/node/node.module
index da96c53d7..0b7923165 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -274,21 +274,6 @@ function node_admin_save($edit) {
}
}
-function node_module_find() {
-
- foreach (module_list() as $name) {
- if (module_hook($name, "user")) {
- $options .= "<OPTION VALUE=\"$name\">$name</OPTION>\n";
- }
- }
-
- $output .= " <input size=\"50\" value=\"". check_form($keys) ."\" name=\"keys\" type=\"text\">\n";
- $output .= " <select name=\"type\">$options</select>\n";
- $output .= " <input type=\"submit\" value=\"Search\">\n";
-
- return form($output);
-}
-
function node_edit($node) {
$output .= form_item("Title", $node->title);
$output .= form_item("Operations", implode("<br />", node_links($node->nid, $node->type)));
@@ -318,8 +303,7 @@ function node_admin() {
print node_help();
break;
case "search":
- print node_module_find($id);
- print search_data($keys, $type);
+ print search_type($type, "admin.php?mod=node&op=search", $keys, 1);
break;
case "status":
print node_edit_status($id);
diff --git a/modules/search.module b/modules/search.module
index 559c4bf51..e047f6ca9 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -12,6 +12,7 @@ function search_link($type) {
return $links ? $links : array();
}
+/*
function search_item($item, $type) {
$output .= "<p>";
$output .= " <b><u><a href=\"". $item["link"] ."\">". $item["title"] ."</a></u></b><br />";
@@ -20,6 +21,7 @@ function search_item($item, $type) {
return $output;
}
+*/
function search_page() {
global $theme, $edit, $type, $keys;
@@ -27,13 +29,6 @@ function search_page() {
if (user_access("search content")) {
/*
- ** Verify the user input:
- */
-
- $type = check_input($type);
- $keys = check_input($keys);
-
- /*
** Construct the search form:
*/
diff --git a/modules/search/search.module b/modules/search/search.module
index 559c4bf51..e047f6ca9 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -12,6 +12,7 @@ function search_link($type) {
return $links ? $links : array();
}
+/*
function search_item($item, $type) {
$output .= "<p>";
$output .= " <b><u><a href=\"". $item["link"] ."\">". $item["title"] ."</a></u></b><br />";
@@ -20,6 +21,7 @@ function search_item($item, $type) {
return $output;
}
+*/
function search_page() {
global $theme, $edit, $type, $keys;
@@ -27,13 +29,6 @@ function search_page() {
if (user_access("search content")) {
/*
- ** Verify the user input:
- */
-
- $type = check_input($type);
- $keys = check_input($keys);
-
- /*
** Construct the search form:
*/
diff --git a/modules/user.module b/modules/user.module
index 73d66d5f5..d20abe685 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -109,6 +109,7 @@ function user_validate_name($name) {
if (eregi(" ", $name)) return t("The name can not contain multiple spaces in a row.");
if (eregi("[^a-zA-Z0-9 ]", $name)) return t("The name contains an illegal character.");
if (strlen($name) > 32) return t("The name '$name' is too long: it must be less than 32 characters.");
+
}
function user_validate_mail($mail) {
@@ -1136,7 +1137,7 @@ function admin_access_init() {
function user_admin() {
- global $edit, $id, $keys, $op, $user;
+ global $edit, $id, $op, $user;
if (user_access("administer users")) {
@@ -1166,8 +1167,7 @@ function user_admin() {
print user_help();
break;
case "search":
- print search_form($keys);
- print search_data($keys, "user");
+ print search_type("user", "admin.php?mod=user&op=search");
break;
case "Save configuration":
case "Reset to defaults":
diff --git a/modules/user/user.module b/modules/user/user.module
index 73d66d5f5..d20abe685 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -109,6 +109,7 @@ function user_validate_name($name) {
if (eregi(" ", $name)) return t("The name can not contain multiple spaces in a row.");
if (eregi("[^a-zA-Z0-9 ]", $name)) return t("The name contains an illegal character.");
if (strlen($name) > 32) return t("The name '$name' is too long: it must be less than 32 characters.");
+
}
function user_validate_mail($mail) {
@@ -1136,7 +1137,7 @@ function admin_access_init() {
function user_admin() {
- global $edit, $id, $keys, $op, $user;
+ global $edit, $id, $op, $user;
if (user_access("administer users")) {
@@ -1166,8 +1167,7 @@ function user_admin() {
print user_help();
break;
case "search":
- print search_form($keys);
- print search_data($keys, "user");
+ print search_type("user", "admin.php?mod=user&op=search");
break;
case "Save configuration":
case "Reset to defaults":
diff --git a/modules/weblogs.module b/modules/weblogs.module
index 5490572cf..50660cffa 100644
--- a/modules/weblogs.module
+++ b/modules/weblogs.module
@@ -3,7 +3,7 @@
function weblogs_cron() {
if (db_num_rows(db_query("SELECT nid FROM node WHERE status = '". node_status("posted") ."' AND timestamp > '". variable_get("weblogs_cron_last", time()) ."'", 1))) {
- weblogs_notify(variable_get("site_name", "drupal") , path_uri());
+ weblogs_notify(variable_get("site_name", "drupal") , path_uri());
}
variable_set("weblogs_cron_last", time());
}
@@ -13,7 +13,7 @@ function weblogs_notify($name, $url) {
$client = new xmlrpc_client("/RPC2", "rpc.weblogs.com", 80);
$message = new xmlrpcmsg("weblogUpdates.ping", array(new xmlrpcval($name), new xmlrpcval($url)));
-
+
$result = $client->send($message);
if (!$result || $result->faultCode()) {