From 8043cb998f3325731bfab8d82251fa49639aec1d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 20 Apr 2002 11:52:50 +0000 Subject: - Applied Marco's big patch, including contributions from Moshe: + Changed the db_query() API. + Wrapped all links in l(), lm(), la(), ..., drupal_url() functions. + XHTML-ified some HTML. + Wrapped a lot of text in the administrative pages in a t() function. + Replaced all $REQUEST_URI/$PATH_INFOs by request_uri(). + Small bugfixes (eg. bug in book_export_html() and clean-ups (eg. RSS code). + Fixed some bugs in the taxonomy module (eg. tree making bug), added new functionality (eg. new APIs for use by other modules), included Moshe's taxonomy extensions, and some documentation udpates. + ... --- modules/cloud.module | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'modules/cloud.module') diff --git a/modules/cloud.module b/modules/cloud.module index 5390b44fb..bc434faf8 100644 --- a/modules/cloud.module +++ b/modules/cloud.module @@ -31,11 +31,11 @@ function cloud_perm() { function cloud_link($type) { if ($type == "page" && user_access("access site cloud")) { - $links[] = "". t("site cloud") .""; + $links[] = lm(t("site cloud"), array("mod" => "cloud"), t("Monitor other sites in the cloud."));; } if ($type == "admin" && user_access("administer site cloud")) { - $links[] = "". t("site cloud") .""; + $links[] = la(t("site cloud"), array("mod" => "cloud")); } return $links ? $links : array(); @@ -65,7 +65,7 @@ function cloud_update($site) { } if (abs($site["size"] - strlen($data)) > $site["threshold"]) { - db_query("UPDATE site SET size = '". strlen($data) ."', timestamp = '". time() ."' WHERE link = '". check_input($site["link"]) ."'"); + db_query("UPDATE site SET size = '". strlen($data) ."', timestamp = '". time() ."' WHERE link = '%s'", $site["link"]); } fclose($fp); @@ -97,18 +97,18 @@ function cloud_form($edit = array()) { } function cloud_get_site($sid) { - return db_fetch_array(db_query("SELECT * FROM site WHERE sid = '". check_input($sid) ."'")); + return db_fetch_array(db_query("SELECT * FROM site WHERE sid = '%s'", $sid)); } function cloud_save($edit) { if ($edit["sid"] && $edit["name"]) { - db_query("UPDATE site SET name = '". check_input($edit["name"]) ."', link = '". check_input($edit["link"]) ."', feed = '". check_input($edit["feed"]) ."', refresh = '". check_input($edit["refresh"]) ."', threshold = '". check_input($edit["threshold"]) ."' WHERE sid = '". check_input($edit["sid"]) ."'"); + db_query("UPDATE site SET name = '%s', link = '%s', feed = '%s', refresh = '%s', threshold = '%s' WHERE sid = '%s'", $edit["name"], $edit["link"], $edit["feed"], $edit["refresh"], $edit["threshold"], $edit["sid"]); } else if ($edit["sid"]) { - db_query("DELETE FROM site WHERE sid = '". check_input($edit["sid"]) ."'"); + db_query("DELETE FROM site WHERE sid = '%s'", $edit["sid"]); } else { - db_query("INSERT INTO site (name, link, feed, refresh, threshold) VALUES ('". check_input($edit["name"]) ."', '". check_input($edit["link"]) ."', '". check_input($edit["feed"]) ."', '". check_input($edit["refresh"]) ."', '". check_input($edit["threshold"]) ."')"); + db_query("INSERT INTO site (name, link, feed, refresh, threshold) VALUES ('%s', '%s', '%s', '%s', '%s')", $edit["name"], $edit["link"], $edit["feed"], $edit["refresh"], $edit["threshold"]); } } @@ -118,7 +118,7 @@ function cloud_display() { $output .= "\n"; $output .= " \n"; while ($site = db_fetch_object($result)) { - $output .= " \n"; + $output .= " \n"; } $output .= "
sitelast updateoperations
link) ."\">". check_output($site->name) ."". ($site->timestamp ? format_interval(time() - $site->timestamp) ." ago" : "never") ."sid\">edit sitesid\">update site
link) ."\">". check_output($site->name) ."". ($site->timestamp ? format_interval(time() - $site->timestamp) ." ago" : "never") ."".la(t("edit site"), array("mod" => "cloud", "op" => "edit", "id" => $site->sid))."".la(t("update site"), array("mod" => "cloud", "op" => "update", "id" => $site->sid))."
\n"; @@ -138,11 +138,11 @@ function cloud_list($limit = 10) { if ($hour == 0) { $output .= "
". t("Updated < 1 hours ago:"); } else { - $output .= "
". strtr(t("Updated %a ago:"), array("%a" => format_plural($hour, "hour", "hours"))); + $output .= "
". t("Updated %a ago:", array("%a" => format_plural($hour, "hour", "hours"))); } } else if ($list) { - $output .= "
". strtr(t("Updated more than %a ago:"), array("%a" => format_plural($hour, "hour", "hours"))); + $output .= "
". t("Updated more than %a ago:", array("%a" => format_plural($hour, "hour", "hours"))); $list = 0; } } @@ -163,7 +163,7 @@ function cloud_page() { function cloud_block() { $block[0]["subject"] = t("Site cloud"); - $block[0]["content"] = cloud_list(20) . "
". t("more") ."
"; + $block[0]["content"] = cloud_list(20) . "
".lm(t("more"), array("mod" => "cloud"), t("Monitor other sites in the cloud."))."
"; $block[0]["info"] = t("Site cloud"); return $block; } @@ -172,7 +172,7 @@ function cloud_admin() { global $op, $id, $edit; if (user_access("administer site cloud")) { - print "add new site | overview | help
\n"; + print "".la(t("add new site"), array("mod" => "cloud", "op" => "add"))." | ".la(t("overview"), array("mod" => "cloud"))." | ".la(t("help"), array("mod" => "cloud", "op" => "help"))."
\n"; switch ($op) { case "add": -- cgit v1.2.3