diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-04-20 11:52:50 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-04-20 11:52:50 +0000 |
commit | 8043cb998f3325731bfab8d82251fa49639aec1d (patch) | |
tree | 3774b206865eb631134c447aa36e90af762b8c5b /modules/cloud.module | |
parent | 0a966e1ed42d1b7d0827b0318bcefb7101ac56df (diff) | |
download | brdo-8043cb998f3325731bfab8d82251fa49639aec1d.tar.gz brdo-8043cb998f3325731bfab8d82251fa49639aec1d.tar.bz2 |
- 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.
+ ...
Diffstat (limited to 'modules/cloud.module')
-rw-r--r-- | modules/cloud.module | 24 |
1 files changed, 12 insertions, 12 deletions
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[] = "<a href=\"module.php?mod=cloud\" title=\"". t("Monitor other sites in the cloud.") ."\">". t("site cloud") ."</a>"; + $links[] = lm(t("site cloud"), array("mod" => "cloud"), t("Monitor other sites in the cloud."));; } if ($type == "admin" && user_access("administer site cloud")) { - $links[] = "<a href=\"admin.php?mod=cloud\">". t("site cloud") ."</a>"; + $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 .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>site</th><th>last update</th><th colspan=\"2\">operations</th></tr>\n"; while ($site = db_fetch_object($result)) { - $output .= " <tr><td><a href=\"". check_output($site->link) ."\">". check_output($site->name) ."</a></td><td>". ($site->timestamp ? format_interval(time() - $site->timestamp) ." ago" : "never") ."</td><td><a href=\"admin.php?mod=cloud&op=edit&id=$site->sid\">edit site</a></td><td><a href=\"admin.php?mod=cloud&op=update&id=$site->sid\">update site</a></td></tr>\n"; + $output .= " <tr><td><a href=\"". check_output($site->link) ."\">". check_output($site->name) ."</a></td><td>". ($site->timestamp ? format_interval(time() - $site->timestamp) ." ago" : "never") ."</td><td>".la(t("edit site"), array("mod" => "cloud", "op" => "edit", "id" => $site->sid))."</td><td>".la(t("update site"), array("mod" => "cloud", "op" => "update", "id" => $site->sid))."</td></tr>\n"; } $output .= "</table>\n"; @@ -138,11 +138,11 @@ function cloud_list($limit = 10) { if ($hour == 0) { $output .= "<br />". t("Updated < 1 hours ago:"); } else { - $output .= "<br />". strtr(t("Updated %a ago:"), array("%a" => format_plural($hour, "hour", "hours"))); + $output .= "<br />". t("Updated %a ago:", array("%a" => format_plural($hour, "hour", "hours"))); } } else if ($list) { - $output .= "<br />". strtr(t("Updated more than %a ago:"), array("%a" => format_plural($hour, "hour", "hours"))); + $output .= "<br />". 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) . "<br /><div align=\"right\"><a href=\"module.php?mod=cloud\" title=\"". t("Monitor other sites in the cloud.") ."\">". t("more") ."</a></div>"; + $block[0]["content"] = cloud_list(20) . "<br /><div align=\"right\">".lm(t("more"), array("mod" => "cloud"), t("Monitor other sites in the cloud."))."</div>"; $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 "<small><a href=\"admin.php?mod=cloud&op=add\">add new site</a> | <a href=\"admin.php?mod=cloud\">overview</a> | <a href=\"admin.php?mod=cloud&op=help\">help</a></small><hr />\n"; + print "<small>".la(t("add new site"), array("mod" => "cloud", "op" => "add"))." | ".la(t("overview"), array("mod" => "cloud"))." | ".la(t("help"), array("mod" => "cloud", "op" => "help"))."</small><hr />\n"; switch ($op) { case "add": |