summaryrefslogtreecommitdiff
path: root/modules/cloud.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/cloud.module')
-rw-r--r--modules/cloud.module24
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":