diff options
38 files changed, 376 insertions, 384 deletions
diff --git a/includes/common.inc b/includes/common.inc index 99b4c36bc..881cb06cd 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -117,7 +117,8 @@ function t($string, $args = 0) { global $languages; if (!$args) { return $string; - } else { + } + else { return strtr($string, $args); } } @@ -582,7 +583,7 @@ function form_select($title, $name, $value, $options, $description = 0, $extra = foreach ($options as $key=>$choice) { $select .= "<option value=\"$key\"". (is_array($value) ? (in_array($key, $value) ? " selected=\"selected\"" : "") : ($key == $value ? " selected=\"selected\"" : "")) .">". check_form($choice) ."</option>"; } - return form_item($title, "<select name=\"edit[$name]".($multiple ? "[]" : "")."\"" .($multiple ? " multiple " : "").($extra ? " $extra" : "") .">$select</select>", $description); + return form_item($title, "<select name=\"edit[$name]". ($multiple ? "[]" : "") ."\"". ($multiple ? " multiple " : "") . ($extra ? " $extra" : "") .">$select</select>", $description); } } @@ -607,10 +608,10 @@ function form_submit($value) { */ function drupal_url($args = array(), $script = "node") { $t = array(); - foreach($args as $k => $v) { + foreach ($args as $k => $v) { $t[] = "$k=$v"; } - return "$script.php?".implode("&", $t); + return "$script.php?". implode("&", $t); } /** @@ -623,17 +624,17 @@ function drupal_url($args = array(), $script = "node") { * @param $script script to be invoked; optional, defaults to node */ function l($linktext, $args = array(), $title = "", $script = "node") { - return "<a href=\"".drupal_url($args, $script)."\" title=\"$title\">$linktext</a>"; + return "<a href=\"". drupal_url($args, $script) ."\" title=\"$title\">$linktext</a>"; } function la($linktext, $args = array(), $title = "") { // we don't call l() to avoid another duplication of the array - return "<a href=\"".drupal_url($args, "admin")."\" title=\"$title\">$linktext</a>"; + return "<a href=\"". drupal_url($args, "admin") ."\" title=\"$title\">$linktext</a>"; } function lm($linktext, $args = array(), $title = "") { // we don't call l() to avoid another duplication of the array - return "<a href=\"".drupal_url($args, "module")."\" title=\"$title\">$linktext</a>"; + return "<a href=\"". drupal_url($args, "module") ."\" title=\"$title\">$linktext</a>"; } function field_get($string, $name) { diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc index 42df3fe6b..5417eb305 100644 --- a/includes/database.mysql.inc +++ b/includes/database.mysql.inc @@ -1,10 +1,11 @@ <?php +// $Id$ function db_connect($url) { $url = parse_url($url); mysql_pconnect($url["host"], $url["user"], $url["pass"]) or die(mysql_error()); - mysql_select_db(substr($url["path"], 1)) or die ("unable to select database"); + mysql_select_db(substr($url["path"], 1)) or die("unable to select database"); // NOTE: we are using a persistent connection! } @@ -15,7 +16,8 @@ function db_query($query) { $args = array_map("check_query", $args); $args[0] = $query; return _db_query(call_user_func_array("sprintf", $args)); - } else { + } + else { return _db_query($query); } } @@ -27,7 +29,8 @@ function db_queryd($query) { $args = array_map("check_query", $args); $args[0] = $query; return _db_query(call_user_func_array("sprintf", $args), 1); - } else { + } + else { return _db_query($query, 1); } } @@ -48,7 +51,8 @@ function _db_query($query, $debug = 0) { if (!mysql_errno()) { return $result; - } else { + } + else { trigger_error(mysql_error() ."\nquery: ". htmlspecialchars($query), E_USER_ERROR); } } diff --git a/includes/database.pear.inc b/includes/database.pear.inc index c48ffbb35..2c27d5bb3 100644 --- a/includes/database.pear.inc +++ b/includes/database.pear.inc @@ -9,7 +9,7 @@ function db_connect($url) { $db_handle = DB::connect($url); if (DB::isError($db_handle)) { - die ("Database problem: ". $db_handle->getMessage()); + die("Database problem: ". $db_handle->getMessage()); } $db_handle->setFetchMode(DB_FETCHMODE_ASSOC); diff --git a/modules/aggregator.module b/modules/aggregator.module index d3b79bf7c..c12ee48ed 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -98,7 +98,7 @@ function import_get_bundles($attributes = 0) { $i = 0; while ($bundle = db_fetch_object($result)) { $block[$i]["subject"] = $bundle->title; - $block[$i]["content"] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\">".lm(t("more"), array("mod" => "import", "op" => "bundle", "id" => $bundle->bid), t("View this bundle's recent news."))."</div></p>"; + $block[$i]["content"] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\">". lm(t("more"), array("mod" => "import", "op" => "bundle", "id" => $bundle->bid), t("View this bundle's recent news.")) ."</div></p>"; $block[$i]["info"] = "$bundle->title bundle"; $i++; @@ -113,7 +113,7 @@ function import_get_feeds($attributes = 0) { $i = 0; while ($feed = db_fetch_object($result)) { $block[$i]["subject"] = $feed->title; - $block[$i]["content"] = import_feed_block($feed) ."<p><div align=\"right\">".lm(t("more"), array("mod" => "import", "op" => "feed", "id" => $feed->fid), t("View this feed's recent news."))."</div></p>"; + $block[$i]["content"] = import_feed_block($feed) ."<p><div align=\"right\">". lm(t("more"), array("mod" => "import", "op" => "feed", "id" => $feed->fid), t("View this feed's recent news.")) ."</div></p>"; $block[$i]["info"] = "$feed->title feed"; $i++; @@ -176,7 +176,7 @@ function import_refresh($feed) { $link = strip_tags($link[1]); $description = filter(strtr($description[1], $tt)); - db_query("UPDATE feed SET timestamp = '%s', link = '%s', description = '%s' WHERE fid = '%s'",time(), $link, $description, $feed["fid"]); + db_query("UPDATE feed SET timestamp = '%s', link = '%s', description = '%s' WHERE fid = '%s'", time(), $link, $description, $feed["fid"]); /* ** Extract and process individual items: @@ -349,7 +349,7 @@ function import_view() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>title</th><th>attributes</th><th>items</th><th>last update</th><th>next update</th><th colspan=\"3\">operations</th></tr>\n"; while ($feed = db_fetch_object($result)) { - $output .= " <tr><td>". check_output($feed->title) ."</td><td>". check_output($feed->attributes) ."</td><td>". format_plural($feed->items, "item", "items") ."</td><td>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</td><td>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</td><td>".la(t("edit feed"), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $feed->fid))."</td><td>" .la(t("remove items"), array("mod" => "import", "type" => "feed", "op" => "remove", "id" => $feed->fid)). "</td><td>". la(t("update items"), array("mod" => "import", "type" => "feed", "op" => "update", "id" => $feed->fid)). "</td></tr>\n"; + $output .= " <tr><td>". check_output($feed->title) ."</td><td>". check_output($feed->attributes) ."</td><td>". format_plural($feed->items, "item", "items") ."</td><td>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</td><td>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</td><td>". la(t("edit feed"), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $feed->fid)) ."</td><td>". la(t("remove items"), array("mod" => "import", "type" => "feed", "op" => "remove", "id" => $feed->fid)) ."</td><td>". la(t("update items"), array("mod" => "import", "type" => "feed", "op" => "update", "id" => $feed->fid)) ."</td></tr>\n"; } $output .= "</table>\n"; @@ -359,7 +359,7 @@ function import_view() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>title</th><th>attributes</th><th>operations</th></tr>\n"; while ($bundle = db_fetch_object($result)) { - $output .= " <tr><td>". check_output($bundle->title) ."</td><td>". check_output($bundle->attributes) ."</td><td>".la(t("edit bundle"), array("mod" => "import", "type" => "bundle", "op" => "edit", "id" => $bundle->bid))."</td></tr>\n"; + $output .= " <tr><td>". check_output($bundle->title) ."</td><td>". check_output($bundle->attributes) ."</td><td>". la(t("edit bundle"), array("mod" => "import", "type" => "bundle", "op" => "edit", "id" => $bundle->bid)) ."</td></tr>\n"; } $output .= "</table>\n"; @@ -432,7 +432,7 @@ function import_tag() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>time</th><th>feed</th><th>item</th></tr>\n"; while ($item = db_fetch_object($result)) { - $output .= " <tr><td valign=\"top\" nowrap=\"nowrap\">". format_date($item->timestamp, "custom", "m/d/y") ."<br />". format_date($item->timestamp, "custom", "H:i") ."</td><td align=\"center\" valign=\"top\" nowrap=\"nowrap\">".la(check_output($item->feed), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $item->fid))."</td><td><a href=\"". check_output($item->link) ."\">". check_output($item->title) ."</a>". ($item->description ? "<br /><small><i>". check_output($item->description, 1) ."</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" /></td></tr>\n"; + $output .= " <tr><td valign=\"top\" nowrap=\"nowrap\">". format_date($item->timestamp, "custom", "m/d/y") ."<br />". format_date($item->timestamp, "custom", "H:i") ."</td><td align=\"center\" valign=\"top\" nowrap=\"nowrap\">". la(check_output($item->feed), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $item->fid)) ."</td><td><a href=\"". check_output($item->link) ."\">". check_output($item->title) ."</a>". ($item->description ? "<br /><small><i>". check_output($item->description, 1) ."</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" /></td></tr>\n"; } $output .= "</table>\n"; $output .= "<input type=\"submit\" name=\"op\" value=\"Save attributes\" />\n"; @@ -452,7 +452,7 @@ function import_admin() { $links[] = la(t("overview"), array("mod" => "import", "op" => "view")); $links[] = la(t("help"), array("mod" => "import", "op" => "help")); - print "<small>".implode(" | ", $links)."</small><hr />"; + print "<small>". implode(" | ", $links) ."</small><hr />"; switch ($op) { case "help": @@ -541,7 +541,7 @@ function import_page_last() { $links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), t("Read more syndicated news from this feed.")); if ($item->link) { - $output .= "<tr><td>". format_url($item->link, $item->title) ." · ".lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), t("View more information about this feed."))."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td>". format_url($item->link, $item->title) ." · ". lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), t("View more information about this feed.")) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; } if ($item->description) { @@ -610,7 +610,7 @@ function import_page_bundle($bid) { $links[] = "<a href=\"$item->link\">". t("visit") ."</a>"; if ($item->link) { - $output .= "<tr><td>". format_url($item->link, $item->title) ." · ".lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), t("View more information about this feed."))."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td>". format_url($item->link, $item->title) ." · ". lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), t("View more information about this feed.")) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; } if ($item->description) { @@ -638,7 +638,7 @@ function import_page_sources() { $output .= "<div style=\"margin-left: 20px;\">". check_output($feed->description, 1) ."</div><br />"; } - $output .= lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", array("mod" => "import", "op" => "fd"), t("View the list of syndicated websites in XML format."))."<br />\n"; + $output .= lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", array("mod" => "import", "op" => "fd"), t("View the list of syndicated websites in XML format.")) ."<br />\n"; $theme->header(); $theme->box(t("News feeds"), import_page_info()); diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index d3b79bf7c..c12ee48ed 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -98,7 +98,7 @@ function import_get_bundles($attributes = 0) { $i = 0; while ($bundle = db_fetch_object($result)) { $block[$i]["subject"] = $bundle->title; - $block[$i]["content"] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\">".lm(t("more"), array("mod" => "import", "op" => "bundle", "id" => $bundle->bid), t("View this bundle's recent news."))."</div></p>"; + $block[$i]["content"] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\">". lm(t("more"), array("mod" => "import", "op" => "bundle", "id" => $bundle->bid), t("View this bundle's recent news.")) ."</div></p>"; $block[$i]["info"] = "$bundle->title bundle"; $i++; @@ -113,7 +113,7 @@ function import_get_feeds($attributes = 0) { $i = 0; while ($feed = db_fetch_object($result)) { $block[$i]["subject"] = $feed->title; - $block[$i]["content"] = import_feed_block($feed) ."<p><div align=\"right\">".lm(t("more"), array("mod" => "import", "op" => "feed", "id" => $feed->fid), t("View this feed's recent news."))."</div></p>"; + $block[$i]["content"] = import_feed_block($feed) ."<p><div align=\"right\">". lm(t("more"), array("mod" => "import", "op" => "feed", "id" => $feed->fid), t("View this feed's recent news.")) ."</div></p>"; $block[$i]["info"] = "$feed->title feed"; $i++; @@ -176,7 +176,7 @@ function import_refresh($feed) { $link = strip_tags($link[1]); $description = filter(strtr($description[1], $tt)); - db_query("UPDATE feed SET timestamp = '%s', link = '%s', description = '%s' WHERE fid = '%s'",time(), $link, $description, $feed["fid"]); + db_query("UPDATE feed SET timestamp = '%s', link = '%s', description = '%s' WHERE fid = '%s'", time(), $link, $description, $feed["fid"]); /* ** Extract and process individual items: @@ -349,7 +349,7 @@ function import_view() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>title</th><th>attributes</th><th>items</th><th>last update</th><th>next update</th><th colspan=\"3\">operations</th></tr>\n"; while ($feed = db_fetch_object($result)) { - $output .= " <tr><td>". check_output($feed->title) ."</td><td>". check_output($feed->attributes) ."</td><td>". format_plural($feed->items, "item", "items") ."</td><td>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</td><td>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</td><td>".la(t("edit feed"), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $feed->fid))."</td><td>" .la(t("remove items"), array("mod" => "import", "type" => "feed", "op" => "remove", "id" => $feed->fid)). "</td><td>". la(t("update items"), array("mod" => "import", "type" => "feed", "op" => "update", "id" => $feed->fid)). "</td></tr>\n"; + $output .= " <tr><td>". check_output($feed->title) ."</td><td>". check_output($feed->attributes) ."</td><td>". format_plural($feed->items, "item", "items") ."</td><td>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</td><td>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</td><td>". la(t("edit feed"), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $feed->fid)) ."</td><td>". la(t("remove items"), array("mod" => "import", "type" => "feed", "op" => "remove", "id" => $feed->fid)) ."</td><td>". la(t("update items"), array("mod" => "import", "type" => "feed", "op" => "update", "id" => $feed->fid)) ."</td></tr>\n"; } $output .= "</table>\n"; @@ -359,7 +359,7 @@ function import_view() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>title</th><th>attributes</th><th>operations</th></tr>\n"; while ($bundle = db_fetch_object($result)) { - $output .= " <tr><td>". check_output($bundle->title) ."</td><td>". check_output($bundle->attributes) ."</td><td>".la(t("edit bundle"), array("mod" => "import", "type" => "bundle", "op" => "edit", "id" => $bundle->bid))."</td></tr>\n"; + $output .= " <tr><td>". check_output($bundle->title) ."</td><td>". check_output($bundle->attributes) ."</td><td>". la(t("edit bundle"), array("mod" => "import", "type" => "bundle", "op" => "edit", "id" => $bundle->bid)) ."</td></tr>\n"; } $output .= "</table>\n"; @@ -432,7 +432,7 @@ function import_tag() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>time</th><th>feed</th><th>item</th></tr>\n"; while ($item = db_fetch_object($result)) { - $output .= " <tr><td valign=\"top\" nowrap=\"nowrap\">". format_date($item->timestamp, "custom", "m/d/y") ."<br />". format_date($item->timestamp, "custom", "H:i") ."</td><td align=\"center\" valign=\"top\" nowrap=\"nowrap\">".la(check_output($item->feed), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $item->fid))."</td><td><a href=\"". check_output($item->link) ."\">". check_output($item->title) ."</a>". ($item->description ? "<br /><small><i>". check_output($item->description, 1) ."</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" /></td></tr>\n"; + $output .= " <tr><td valign=\"top\" nowrap=\"nowrap\">". format_date($item->timestamp, "custom", "m/d/y") ."<br />". format_date($item->timestamp, "custom", "H:i") ."</td><td align=\"center\" valign=\"top\" nowrap=\"nowrap\">". la(check_output($item->feed), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $item->fid)) ."</td><td><a href=\"". check_output($item->link) ."\">". check_output($item->title) ."</a>". ($item->description ? "<br /><small><i>". check_output($item->description, 1) ."</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" /></td></tr>\n"; } $output .= "</table>\n"; $output .= "<input type=\"submit\" name=\"op\" value=\"Save attributes\" />\n"; @@ -452,7 +452,7 @@ function import_admin() { $links[] = la(t("overview"), array("mod" => "import", "op" => "view")); $links[] = la(t("help"), array("mod" => "import", "op" => "help")); - print "<small>".implode(" | ", $links)."</small><hr />"; + print "<small>". implode(" | ", $links) ."</small><hr />"; switch ($op) { case "help": @@ -541,7 +541,7 @@ function import_page_last() { $links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), t("Read more syndicated news from this feed.")); if ($item->link) { - $output .= "<tr><td>". format_url($item->link, $item->title) ." · ".lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), t("View more information about this feed."))."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td>". format_url($item->link, $item->title) ." · ". lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), t("View more information about this feed.")) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; } if ($item->description) { @@ -610,7 +610,7 @@ function import_page_bundle($bid) { $links[] = "<a href=\"$item->link\">". t("visit") ."</a>"; if ($item->link) { - $output .= "<tr><td>". format_url($item->link, $item->title) ." · ".lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), t("View more information about this feed."))."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td>". format_url($item->link, $item->title) ." · ". lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), t("View more information about this feed.")) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; } if ($item->description) { @@ -638,7 +638,7 @@ function import_page_sources() { $output .= "<div style=\"margin-left: 20px;\">". check_output($feed->description, 1) ."</div><br />"; } - $output .= lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", array("mod" => "import", "op" => "fd"), t("View the list of syndicated websites in XML format."))."<br />\n"; + $output .= lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", array("mod" => "import", "op" => "fd"), t("View the list of syndicated websites in XML format.")) ."<br />\n"; $theme->header(); $theme->box(t("News feeds"), import_page_info()); diff --git a/modules/archive.module b/modules/archive.module index 7dbe4eda0..1d711a9a8 100644 --- a/modules/archive.module +++ b/modules/archive.module @@ -33,14 +33,14 @@ function archive_display($original = 0) { // Generate calendar header: $output .= "\n<!-- calendar -->\n"; $output .= "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"1\">\n"; - $output .= " <tr><td align=\"center\" colspan=\"7\"><small>".lm("<", array("mod" => "archive", "date" => $prev))." ". date("F Y", $original) ." " . ($next <= $thislast ? lm(">", array("mod" => "archive", "date" => $next)) : ">") . "</small></td></tr>\n"; + $output .= " <tr><td align=\"center\" colspan=\"7\"><small>". lm("<", array("mod" => "archive", "date" => $prev)) ." ". date("F Y", $original) ." ". ($next <= $thislast ? lm(">", array("mod" => "archive", "date" => $next)) : ">") ."</small></td></tr>\n"; // Generate the days of the week: $somesunday = mktime(0, 0, 0, 3, 20, 1994); $output .= " <tr>"; for ($i = 0; $i < 7; $i++) { - $output .= "<td align=\"center\"><small>" . substr(ucfirst(t(date("l", $somesunday + $i * 86400))), 0, 1) . "</small></td>"; + $output .= "<td align=\"center\"><small>". substr(ucfirst(t(date("l", $somesunday + $i * 86400))), 0, 1) ."</small></td>"; } $output .= "</tr>\n"; @@ -72,7 +72,7 @@ function archive_display($original = 0) { } else { // due to text-decoration we use drupal_url() instead of lm() - $output .= " <td align=\"center\"><small><a href=\"".drupal_url(array("mod" => "archive", "date" => $date), "module")." \" style=\"text-decoration: none;\">$nday</a></small></td>\n"; + $output .= " <td align=\"center\"><small><a href=\"". drupal_url(array("mod" => "archive", "date" => $date), "module") ." \" style=\"text-decoration: none;\">$nday</a></small></td>\n"; } // Start every week on a new line: diff --git a/modules/archive/archive.module b/modules/archive/archive.module index 7dbe4eda0..1d711a9a8 100644 --- a/modules/archive/archive.module +++ b/modules/archive/archive.module @@ -33,14 +33,14 @@ function archive_display($original = 0) { // Generate calendar header: $output .= "\n<!-- calendar -->\n"; $output .= "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"1\">\n"; - $output .= " <tr><td align=\"center\" colspan=\"7\"><small>".lm("<", array("mod" => "archive", "date" => $prev))." ". date("F Y", $original) ." " . ($next <= $thislast ? lm(">", array("mod" => "archive", "date" => $next)) : ">") . "</small></td></tr>\n"; + $output .= " <tr><td align=\"center\" colspan=\"7\"><small>". lm("<", array("mod" => "archive", "date" => $prev)) ." ". date("F Y", $original) ." ". ($next <= $thislast ? lm(">", array("mod" => "archive", "date" => $next)) : ">") ."</small></td></tr>\n"; // Generate the days of the week: $somesunday = mktime(0, 0, 0, 3, 20, 1994); $output .= " <tr>"; for ($i = 0; $i < 7; $i++) { - $output .= "<td align=\"center\"><small>" . substr(ucfirst(t(date("l", $somesunday + $i * 86400))), 0, 1) . "</small></td>"; + $output .= "<td align=\"center\"><small>". substr(ucfirst(t(date("l", $somesunday + $i * 86400))), 0, 1) ."</small></td>"; } $output .= "</tr>\n"; @@ -72,7 +72,7 @@ function archive_display($original = 0) { } else { // due to text-decoration we use drupal_url() instead of lm() - $output .= " <td align=\"center\"><small><a href=\"".drupal_url(array("mod" => "archive", "date" => $date), "module")." \" style=\"text-decoration: none;\">$nday</a></small></td>\n"; + $output .= " <td align=\"center\"><small><a href=\"". drupal_url(array("mod" => "archive", "date" => $date), "module") ." \" style=\"text-decoration: none;\">$nday</a></small></td>\n"; } // Start every week on a new line: diff --git a/modules/block.module b/modules/block.module index 6024a347d..3effe0fd5 100644 --- a/modules/block.module +++ b/modules/block.module @@ -34,7 +34,7 @@ function block_admin_display() { $result = db_query("SELECT * FROM blocks ORDER BY module"); // Generate output: - $output .= "<form action=\"".drupal_url(array("mod" => "block"), "admin")." method=\"post\">\n"; + $output .= "<form action=\"". drupal_url(array("mod" => "block"), "admin") ." method=\"post\">\n"; $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>block</th><th>module</th><th>status</th><th>weight</th><th>region</th><th>path</th></tr>\n"; @@ -128,7 +128,7 @@ function block_admin() { if (user_access("administer blocks")) { - print "<small>".la(t("configure"), array("mod" => "block"))." | ".la(t("preview"), array("mod" => "block", "op" => "preview"))." | ".la(t("help"), array("mod" => "block", "op" => "help"))."</small><hr>\n"; + print "<small>". la(t("configure"), array("mod" => "block")) ." | ". la(t("preview"), array("mod" => "block", "op" => "preview")) ." | ". la(t("help"), array("mod" => "block", "op" => "help")) ."</small><hr>\n"; block_init(); diff --git a/modules/block/block.module b/modules/block/block.module index 6024a347d..3effe0fd5 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -34,7 +34,7 @@ function block_admin_display() { $result = db_query("SELECT * FROM blocks ORDER BY module"); // Generate output: - $output .= "<form action=\"".drupal_url(array("mod" => "block"), "admin")." method=\"post\">\n"; + $output .= "<form action=\"". drupal_url(array("mod" => "block"), "admin") ." method=\"post\">\n"; $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>block</th><th>module</th><th>status</th><th>weight</th><th>region</th><th>path</th></tr>\n"; @@ -128,7 +128,7 @@ function block_admin() { if (user_access("administer blocks")) { - print "<small>".la(t("configure"), array("mod" => "block"))." | ".la(t("preview"), array("mod" => "block", "op" => "preview"))." | ".la(t("help"), array("mod" => "block", "op" => "help"))."</small><hr>\n"; + print "<small>". la(t("configure"), array("mod" => "block")) ." | ". la(t("preview"), array("mod" => "block", "op" => "preview")) ." | ". la(t("help"), array("mod" => "block", "op" => "help")) ."</small><hr>\n"; block_init(); diff --git a/modules/book.module b/modules/book.module index 93f23c837..57dff70c3 100644 --- a/modules/book.module +++ b/modules/book.module @@ -384,7 +384,7 @@ function book_view($node, $main = 0) { if ($node->title) { foreach (book_location($node) as $level) { - $location .= "$indent ".l($level->title, array("id" => $level->nid))."<br />"; + $location .= "$indent ". l($level->title, array("id" => $level->nid)) ."<br />"; $indent .= "-"; } @@ -406,7 +406,7 @@ function book_view($node, $main = 0) { } $output .= " <tr><td colspan=\"3\"><hr /></td></tr>"; - $output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? l(t("previous"), array("id" => $prev->nid), t("View the previous page in this book.")) : t("previous")) ."</td><td align=\"center\" width=\"34%\">".lm(t("index"), array("mod" => "book"), t("View this book's table of contents."))."</td><td align=\"right\" width=\"33%\">". ($next ? l(t("next"), array("id" => $next->nid), t("View the next page in this book.")) : t("next")) ."</td></tr>"; + $output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? l(t("previous"), array("id" => $prev->nid), t("View the previous page in this book.")) : t("previous")) ."</td><td align=\"center\" width=\"34%\">". lm(t("index"), array("mod" => "book"), t("View this book's table of contents.")) ."</td><td align=\"right\" width=\"33%\">". ($next ? l(t("next"), array("id" => $next->nid), t("View the next page in this book.")) : t("next")) ."</td></tr>"; $output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? "<small>". check_output($prev->title) ."</small>" : " ") ."</td><td align=\"center\" width=\"34%\">". ($node->parent ? l(t("up"), array("id" => $node->parent), t("View this page's parent section.")) : t("up")) ."</td><td align=\"right\" width=\"33%\">". ($next ? "<small>". check_output($next->title) ."</small>" : " ") ."</td></tr>"; $output .= " <tr><td colspan=\"3\"><hr /></td></tr>"; $output .= " <tr><td colspan=\"3\" align=\"right\"><div style=\"margin: 10 10 10 10;\">". $theme->links(link_node($node, $main)) ."</div></td></tr>"; @@ -462,7 +462,7 @@ function book_tree_recurse($nid, $depth, $children) { if ($depth > 0) { if ($children[$nid]) { foreach ($children[$nid] as $foo => $node) { - $output .= "<li>".l(check_output($node->title), array("id" => $node->nid))."</li>"; + $output .= "<li>". l(check_output($node->title), array("id" => $node->nid)) ."</li>"; if ($tree = book_tree_recurse($node->nid, $depth - 1, $children)) { $output .= "<ul>$tree</ul>"; @@ -508,7 +508,7 @@ function book_render() { if ($node) { // output the content: - $output .= "<dt>".l(check_output($node->title), array("id" => $node->nid))."</dt><dd>". book_body($node) ."<br /><br /></dd>"; + $output .= "<dt>". l(check_output($node->title), array("id" => $node->nid)) ."</dt><dd>". book_body($node) ."<br /><br /></dd>"; } } @@ -608,12 +608,12 @@ function book_admin_view_line($node, $depth = 0) { */ $output .= "<tr>"; - $output .= " <td><div style=\"padding-left: ". (25 * $depth) ."px;\">".l(check_output($node->title), array("id" => $node->nid))."</div></td>"; + $output .= " <td><div style=\"padding-left: ". (25 * $depth) ."px;\">". l(check_output($node->title), array("id" => $node->nid)) ."</div></td>"; $output .= " <td align=\"center\">$revision</td>"; - $output .= " <td>".la(t("edit node"), array("mod" => "node", "op" => "edit", "id" => $node->nid))."</td>"; + $output .= " <td>". la(t("edit node"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td>"; //TODO: get this link to work. Must pass $nid along so it is received by book_node_link() - //$output .= " <td>".la(t("edit book outline"), array("mod" => "book", "nid" => $node->nid, "op" => "Edit+book+outline"))."</td>"; - $output .= " <td>".la(t("delete node"), array("mod" => "node", "op" => "delete", "id" => $node->nid))."</td>"; + //$output .= " <td>". la(t("edit book outline"), array("mod" => "book", "nid" => $node->nid, "op" => "Edit+book+outline")) ."</td>"; + $output .= " <td>". la(t("delete node"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td>"; $output .= "</tr>"; return $output; @@ -660,7 +660,7 @@ function book_admin_orphan() { $output .= " <tr><th>title</th><th colspan=\"2\">operations</th></tr>"; foreach ($pages as $nid => $node) { if ($node->parent && empty($pages[$node->parent])) { - $output .= "<tr><td>".l(check_output($node->title), array("id" => $node->nid))."</td><td>".la(t("edit page"), array("mod" => "node", "op" => "edit", "id" => $node->nid))."</td><td>".la(t("delete page"), array("mod" => "node", "op" => "delete", "id" => $node->nid))."</td>"; + $output .= "<tr><td>". l(check_output($node->title), array("id" => $node->nid)) ."</td><td>". la(t("edit page"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td><td>". la(t("delete page"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td>"; } } $output .= "</table>"; diff --git a/modules/book/book.module b/modules/book/book.module index 93f23c837..57dff70c3 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -384,7 +384,7 @@ function book_view($node, $main = 0) { if ($node->title) { foreach (book_location($node) as $level) { - $location .= "$indent ".l($level->title, array("id" => $level->nid))."<br />"; + $location .= "$indent ". l($level->title, array("id" => $level->nid)) ."<br />"; $indent .= "-"; } @@ -406,7 +406,7 @@ function book_view($node, $main = 0) { } $output .= " <tr><td colspan=\"3\"><hr /></td></tr>"; - $output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? l(t("previous"), array("id" => $prev->nid), t("View the previous page in this book.")) : t("previous")) ."</td><td align=\"center\" width=\"34%\">".lm(t("index"), array("mod" => "book"), t("View this book's table of contents."))."</td><td align=\"right\" width=\"33%\">". ($next ? l(t("next"), array("id" => $next->nid), t("View the next page in this book.")) : t("next")) ."</td></tr>"; + $output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? l(t("previous"), array("id" => $prev->nid), t("View the previous page in this book.")) : t("previous")) ."</td><td align=\"center\" width=\"34%\">". lm(t("index"), array("mod" => "book"), t("View this book's table of contents.")) ."</td><td align=\"right\" width=\"33%\">". ($next ? l(t("next"), array("id" => $next->nid), t("View the next page in this book.")) : t("next")) ."</td></tr>"; $output .= " <tr><td align=\"left\" width=\"33%\">". ($prev ? "<small>". check_output($prev->title) ."</small>" : " ") ."</td><td align=\"center\" width=\"34%\">". ($node->parent ? l(t("up"), array("id" => $node->parent), t("View this page's parent section.")) : t("up")) ."</td><td align=\"right\" width=\"33%\">". ($next ? "<small>". check_output($next->title) ."</small>" : " ") ."</td></tr>"; $output .= " <tr><td colspan=\"3\"><hr /></td></tr>"; $output .= " <tr><td colspan=\"3\" align=\"right\"><div style=\"margin: 10 10 10 10;\">". $theme->links(link_node($node, $main)) ."</div></td></tr>"; @@ -462,7 +462,7 @@ function book_tree_recurse($nid, $depth, $children) { if ($depth > 0) { if ($children[$nid]) { foreach ($children[$nid] as $foo => $node) { - $output .= "<li>".l(check_output($node->title), array("id" => $node->nid))."</li>"; + $output .= "<li>". l(check_output($node->title), array("id" => $node->nid)) ."</li>"; if ($tree = book_tree_recurse($node->nid, $depth - 1, $children)) { $output .= "<ul>$tree</ul>"; @@ -508,7 +508,7 @@ function book_render() { if ($node) { // output the content: - $output .= "<dt>".l(check_output($node->title), array("id" => $node->nid))."</dt><dd>". book_body($node) ."<br /><br /></dd>"; + $output .= "<dt>". l(check_output($node->title), array("id" => $node->nid)) ."</dt><dd>". book_body($node) ."<br /><br /></dd>"; } } @@ -608,12 +608,12 @@ function book_admin_view_line($node, $depth = 0) { */ $output .= "<tr>"; - $output .= " <td><div style=\"padding-left: ". (25 * $depth) ."px;\">".l(check_output($node->title), array("id" => $node->nid))."</div></td>"; + $output .= " <td><div style=\"padding-left: ". (25 * $depth) ."px;\">". l(check_output($node->title), array("id" => $node->nid)) ."</div></td>"; $output .= " <td align=\"center\">$revision</td>"; - $output .= " <td>".la(t("edit node"), array("mod" => "node", "op" => "edit", "id" => $node->nid))."</td>"; + $output .= " <td>". la(t("edit node"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td>"; //TODO: get this link to work. Must pass $nid along so it is received by book_node_link() - //$output .= " <td>".la(t("edit book outline"), array("mod" => "book", "nid" => $node->nid, "op" => "Edit+book+outline"))."</td>"; - $output .= " <td>".la(t("delete node"), array("mod" => "node", "op" => "delete", "id" => $node->nid))."</td>"; + //$output .= " <td>". la(t("edit book outline"), array("mod" => "book", "nid" => $node->nid, "op" => "Edit+book+outline")) ."</td>"; + $output .= " <td>". la(t("delete node"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td>"; $output .= "</tr>"; return $output; @@ -660,7 +660,7 @@ function book_admin_orphan() { $output .= " <tr><th>title</th><th colspan=\"2\">operations</th></tr>"; foreach ($pages as $nid => $node) { if ($node->parent && empty($pages[$node->parent])) { - $output .= "<tr><td>".l(check_output($node->title), array("id" => $node->nid))."</td><td>".la(t("edit page"), array("mod" => "node", "op" => "edit", "id" => $node->nid))."</td><td>".la(t("delete page"), array("mod" => "node", "op" => "delete", "id" => $node->nid))."</td>"; + $output .= "<tr><td>". l(check_output($node->title), array("id" => $node->nid)) ."</td><td>". la(t("edit page"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td><td>". la(t("delete page"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td>"; } } $output .= "</table>"; diff --git a/modules/cloud.module b/modules/cloud.module index bc434faf8..4c4d3ec0d 100644 --- a/modules/cloud.module +++ b/modules/cloud.module @@ -78,7 +78,7 @@ function cloud_update($site) { function cloud_form($edit = array()) { $period = array(900 => format_interval(900), 1800 => format_interval(1800), 3600 => format_interval(3600), 7200 => format_interval(7200), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 64800 => format_interval(64800), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200)); - $threshold = array (0 => "0 bytes", 10 => "10 bytes", 20 => "20 bytes", 40 => "40 bytes", 60 => "60 bytes", 80 => "80 bytes", 160 => "160 bytes", 320 => "320 bytes", 640 => "640 bytes"); + $threshold = array(0 => "0 bytes", 10 => "10 bytes", 20 => "20 bytes", 40 => "40 bytes", 60 => "60 bytes", 80 => "80 bytes", 160 => "160 bytes", 320 => "320 bytes", 640 => "640 bytes"); $form .= form_textfield("Site name", "name", $edit["name"], 50, 128, "The name of the website you want to monitor for updates."); $form .= form_textfield("Site URL", "link", $edit["link"], 50, 255, "The URL of the website you want to monitor for updates."); @@ -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>".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 .= " <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"; @@ -137,7 +137,8 @@ function cloud_list($limit = 10) { if ($hour < 12) { if ($hour == 0) { $output .= "<br />". t("Updated < 1 hours ago:"); - } else { + } + else { $output .= "<br />". t("Updated %a ago:", array("%a" => format_plural($hour, "hour", "hours"))); } } @@ -163,7 +164,7 @@ function cloud_page() { function cloud_block() { $block[0]["subject"] = t("Site cloud"); - $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]["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 +173,7 @@ function cloud_admin() { global $op, $id, $edit; if (user_access("administer site cloud")) { - 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"; + 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": diff --git a/modules/comment.module b/modules/comment.module index 9c7e6b1d3..aa4bcbb3b 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -7,8 +7,8 @@ $GLOBALS["corder"] = array(1 => "Date - newest first", 2 => "Date - oldest first function comment_help() { $output .= "<p>The comment module enables users to submit posts that are directly associated with a piece of content. These associated posts are called <i>comments</i>. Comments may be <i>threaded</i>, which means that Drupal keeps track of multiple subconversations around a piece of content. Threading helps to keep the comment conversation more organized. Users are presented with several ways to view the comment conversation, and if desired, users may easily choose a <i>flat</i> presentation of comments instead of threaded. Further, users may choose to order their comments view by <i>newest first</i> or by <i>oldest first</i>. Finally, users may view a folded list or an expanded list of comments. Folded limits the comment display to <i>subject</i> only. Drupal remembers the comment view preference of each user whenever he changes a view setting.</p>"; $output .= "<p>Since a busy site generates lots of comments, Drupal takes care to present a personalized view of comments for each user. The home page lists displays the number of read and unread comments for a given post for the current user. Also, the tracker module (when installed) displays all recent comments on the site. Finally, comments which the user has not yet read are highlighted with a red star (this graphic may depend on the current theme).</p>"; - $output .= "<p>Comments behave like other user submissions in Drupal. Specifically, ".la("filters", array("mod" => "system", "type" => "filter"))." like smileys and HTML work fine if the administrator has enabled them. Also, throttles are usually enabled to prevent a single user from spamming the web site with too many comments in a short period of time.</p>"; - $output .= "<p>Administrators may control which persons are allowed to submit and administer comments. These controls appear in the ".la("user permissions", array("mod" => "user", "op" => "permission"))." administration page. Additionally, administrators may edit or search through comments on the ".la("comments admininistration page", array("mod" => "comment")).", as well as set the default display view for new users.</p>"; + $output .= "<p>Comments behave like other user submissions in Drupal. Specifically, ". la("filters", array("mod" => "system", "type" => "filter")) ." like smileys and HTML work fine if the administrator has enabled them. Also, throttles are usually enabled to prevent a single user from spamming the web site with too many comments in a short period of time.</p>"; + $output .= "<p>Administrators may control which persons are allowed to submit and administer comments. These controls appear in the ". la("user permissions", array("mod" => "user", "op" => "permission")) ." administration page. Additionally, administrators may edit or search through comments on the ". la("comments admininistration page", array("mod" => "comment")) .", as well as set the default display view for new users.</p>"; return $output; } @@ -161,13 +161,15 @@ function comment_reply($pid, $nid) { if (node_comment_mode($nid) == 1) { $theme->box(t("Reply"), t("This discussion is closed: you can't post new comments.")); - } else if (user_access("post comments", $context)) { + } + else if (user_access("post comments", $context)) { $theme->box(t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid))); } else { $theme->box(t("Reply"), t("You are not authorized to post comments.")); } - } else { + } + else { $theme->box(t("Reply"), t("You are not authorized to view comments.")); } } @@ -201,7 +203,7 @@ function comment_preview($edit) { $theme->box(t("Reply"), comment_form($edit)); if ($edit["pid"]) { - $comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.cid = '%s'", $edit[pid])); + $comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.cid = '%s'", $edit["pid"])); comment_view($comment, t("reply to this comment")); } else { @@ -379,7 +381,7 @@ function comment_links($comment, $return = 1) { $links = array(); if ($return) { - $links[] = l("<span style=\"color: $theme->type;\">". t("return") ."</span>", array("id" => $comment->nid."#".$comment->cid));; + $links[] = l("<span style=\"color: $theme->type;\">". t("return") ."</span>", array("id" => $comment->nid ."#". $comment->cid)); } if (user_access("administer comments")) { @@ -416,7 +418,7 @@ function comment_view($comment, $folded = 0) { $theme->comment($comment, $folded); } else { - print l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid."#".$comment->cid)). " by ". format_name($comment) ."</small><p />"; + print l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid ."#". $comment->cid)) ." by ". format_name($comment) ."</small><p />"; } } @@ -488,7 +490,7 @@ function comment_render($nid, $cid) { } print "<a name=\"comment\"></a>\n"; - print "<form method=\"post\" action=\"".request_uri()."\">\n"; + print "<form method=\"post\" action=\"". request_uri() ."\">\n"; /* ** Render control panel: @@ -509,7 +511,7 @@ function comment_render($nid, $cid) { print " <tr><th>Subject</th><th>Author</th><th>Date</th><th>Score</th></tr>\n"; while ($comment = db_fetch_object($result)) { if (comment_visible($comment, $threshold)) { - print " <tr><td>".l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid."#".$comment->cid))."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>$comment->score</td></tr>\n"; + print " <tr><td>". l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid ."#". $comment->cid)) ."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>$comment->score</td></tr>\n"; } } print "</table>\n"; @@ -576,9 +578,7 @@ function comment_search($keys) { // The select statement may optionally provide "nid", which is a secondary // identifier which is currently used byt the comment module. // - $find = do_search(array("keys" => $keys, - "type" => "comment", - "select" => "select s.lno as lno, c.nid as nid, c.subject as title, c.timestamp as created, u.uid as uid, u.name as name, s.count as count FROM search_index s, comments c LEFT JOIN users u ON c.uid = u.uid WHERE s.lno = c.cid AND s.type = 'comment' AND s.word like '%'")); + $find = do_search(array("keys" => $keys, "type" => "comment", "select" => "select s.lno as lno, c.nid as nid, c.subject as title, c.timestamp as created, u.uid as uid, u.name as name, s.count as count FROM search_index s, comments c LEFT JOIN users u ON c.uid = u.uid WHERE s.lno = c.cid AND s.type = 'comment' AND s.word like '%'")); return $find; } @@ -605,7 +605,7 @@ function comment_link($type, $node = 0, $main = 0) { $all = comment_num_all($node->nid); $new = comment_num_new($node->nid); - $links[] = l(format_plural($all, "comment", "comments") . ($new ? ", $new ". t("new") : ""), array("id" => $node->nid."#comment"), t("View this posting and all of its comments.")); + $links[] = l(format_plural($all, "comment", "comments") . ($new ? ", $new ". t("new") : ""), array("id" => $node->nid ."#comment"), t("View this posting and all of its comments.")); } } else { @@ -616,8 +616,9 @@ function comment_link($type, $node = 0, $main = 0) { if (user_access("post comments")) { if ($node->comment == 2) { - $links[] = lm(t("add new comment"), array("mod" => "comment", "op" => "reply", "id" => $node->nid."#comment"), t("Share your thoughts and opinions related to this posting.")); - } else { + $links[] = lm(t("add new comment"), array("mod" => "comment", "op" => "reply", "id" => $node->nid ."#comment"), t("Share your thoughts and opinions related to this posting.")); + } + else { $links[] = t("This discussion is closed: you can't post new comments."); } } @@ -642,7 +643,7 @@ function comment_node_link($node) { $output .= " <tr><th>title</th><th>author</th><th colspan=\"3\">operations</th></tr>"; while ($comment = db_fetch_object($result)) { - $output .= "<tr><td>".l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid."#".$comment->cid))."</td><td>". format_name($comment) ."</td><td>".l(t("view comment"), array("id" => $node->nid, "cid" => $comment->cid."#".$comment->cid))."</td><td>".la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid))."</td><td>".la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid))."</td></tr>"; + $output .= "<tr><td>". l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid ."#". $comment->cid)) ."</td><td>". format_name($comment) ."</td><td>". l(t("view comment"), array("id" => $node->nid, "cid" => $comment->cid ."#". $comment->cid)) ."</td><td>". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)) ."</td><td>". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) ."</td></tr>"; } $output .= "</table>"; @@ -707,7 +708,7 @@ function comment_admin_overview() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>subject</th><th>author</th><th>date</th><th colspan=\"2\">operations</th></tr>\n"; while ($comment = db_fetch_object($result)) { - $output .= " <tr><td>".l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid, "pid" => $comment->pid."#".$comment->cid))."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>".la(t("edit comment"), array("mod" => comment, "op" => edit, "id" => $comment->cid))."</td><td>".la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid))."</td></tr>\n"; + $output .= " <tr><td>". l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid, "pid" => $comment->pid ."#". $comment->cid)) ."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". la(t("edit comment"), array("mod" => comment, "op" => edit, "id" => $comment->cid)) ."</td><td>". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) ."</td></tr>\n"; } $output .= "</table>\n"; @@ -736,7 +737,7 @@ function comment_admin() { if (user_access("administer comments")) { - print "<small>".la(t("overview"), array("mod" => "comment"))." | ".la(t("search comment"), array("mod" => "comment", "op" => "search"))."</small><hr />\n"; + print "<small>". la(t("overview"), array("mod" => "comment")) ." | ". la(t("search comment"), array("mod" => "comment", "op" => "search")) ."</small><hr />\n"; switch ($op) { case "edit": @@ -778,9 +779,7 @@ function comment_update_index() { // "select"'s value is used to select the node id and text fields from // the table we are indexing. In this case, we also check against the // last run date for the comments update. - return array("last_update" => "comment_cron_last", - "node_type" => "comment", - "select" => "SELECT c.cid as lno, c.subject as text1, c.comment as text2 FROM comments c WHERE timestamp > ". variable_get("comment_cron_last", 1)); + return array("last_update" => "comment_cron_last", "node_type" => "comment", "select" => "SELECT c.cid as lno, c.subject as text1, c.comment as text2 FROM comments c WHERE timestamp > ". variable_get("comment_cron_last", 1)); } ?> diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 9c7e6b1d3..aa4bcbb3b 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -7,8 +7,8 @@ $GLOBALS["corder"] = array(1 => "Date - newest first", 2 => "Date - oldest first function comment_help() { $output .= "<p>The comment module enables users to submit posts that are directly associated with a piece of content. These associated posts are called <i>comments</i>. Comments may be <i>threaded</i>, which means that Drupal keeps track of multiple subconversations around a piece of content. Threading helps to keep the comment conversation more organized. Users are presented with several ways to view the comment conversation, and if desired, users may easily choose a <i>flat</i> presentation of comments instead of threaded. Further, users may choose to order their comments view by <i>newest first</i> or by <i>oldest first</i>. Finally, users may view a folded list or an expanded list of comments. Folded limits the comment display to <i>subject</i> only. Drupal remembers the comment view preference of each user whenever he changes a view setting.</p>"; $output .= "<p>Since a busy site generates lots of comments, Drupal takes care to present a personalized view of comments for each user. The home page lists displays the number of read and unread comments for a given post for the current user. Also, the tracker module (when installed) displays all recent comments on the site. Finally, comments which the user has not yet read are highlighted with a red star (this graphic may depend on the current theme).</p>"; - $output .= "<p>Comments behave like other user submissions in Drupal. Specifically, ".la("filters", array("mod" => "system", "type" => "filter"))." like smileys and HTML work fine if the administrator has enabled them. Also, throttles are usually enabled to prevent a single user from spamming the web site with too many comments in a short period of time.</p>"; - $output .= "<p>Administrators may control which persons are allowed to submit and administer comments. These controls appear in the ".la("user permissions", array("mod" => "user", "op" => "permission"))." administration page. Additionally, administrators may edit or search through comments on the ".la("comments admininistration page", array("mod" => "comment")).", as well as set the default display view for new users.</p>"; + $output .= "<p>Comments behave like other user submissions in Drupal. Specifically, ". la("filters", array("mod" => "system", "type" => "filter")) ." like smileys and HTML work fine if the administrator has enabled them. Also, throttles are usually enabled to prevent a single user from spamming the web site with too many comments in a short period of time.</p>"; + $output .= "<p>Administrators may control which persons are allowed to submit and administer comments. These controls appear in the ". la("user permissions", array("mod" => "user", "op" => "permission")) ." administration page. Additionally, administrators may edit or search through comments on the ". la("comments admininistration page", array("mod" => "comment")) .", as well as set the default display view for new users.</p>"; return $output; } @@ -161,13 +161,15 @@ function comment_reply($pid, $nid) { if (node_comment_mode($nid) == 1) { $theme->box(t("Reply"), t("This discussion is closed: you can't post new comments.")); - } else if (user_access("post comments", $context)) { + } + else if (user_access("post comments", $context)) { $theme->box(t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid))); } else { $theme->box(t("Reply"), t("You are not authorized to post comments.")); } - } else { + } + else { $theme->box(t("Reply"), t("You are not authorized to view comments.")); } } @@ -201,7 +203,7 @@ function comment_preview($edit) { $theme->box(t("Reply"), comment_form($edit)); if ($edit["pid"]) { - $comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.cid = '%s'", $edit[pid])); + $comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.cid = '%s'", $edit["pid"])); comment_view($comment, t("reply to this comment")); } else { @@ -379,7 +381,7 @@ function comment_links($comment, $return = 1) { $links = array(); if ($return) { - $links[] = l("<span style=\"color: $theme->type;\">". t("return") ."</span>", array("id" => $comment->nid."#".$comment->cid));; + $links[] = l("<span style=\"color: $theme->type;\">". t("return") ."</span>", array("id" => $comment->nid ."#". $comment->cid)); } if (user_access("administer comments")) { @@ -416,7 +418,7 @@ function comment_view($comment, $folded = 0) { $theme->comment($comment, $folded); } else { - print l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid."#".$comment->cid)). " by ". format_name($comment) ."</small><p />"; + print l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid ."#". $comment->cid)) ." by ". format_name($comment) ."</small><p />"; } } @@ -488,7 +490,7 @@ function comment_render($nid, $cid) { } print "<a name=\"comment\"></a>\n"; - print "<form method=\"post\" action=\"".request_uri()."\">\n"; + print "<form method=\"post\" action=\"". request_uri() ."\">\n"; /* ** Render control panel: @@ -509,7 +511,7 @@ function comment_render($nid, $cid) { print " <tr><th>Subject</th><th>Author</th><th>Date</th><th>Score</th></tr>\n"; while ($comment = db_fetch_object($result)) { if (comment_visible($comment, $threshold)) { - print " <tr><td>".l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid."#".$comment->cid))."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>$comment->score</td></tr>\n"; + print " <tr><td>". l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid ."#". $comment->cid)) ."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>$comment->score</td></tr>\n"; } } print "</table>\n"; @@ -576,9 +578,7 @@ function comment_search($keys) { // The select statement may optionally provide "nid", which is a secondary // identifier which is currently used byt the comment module. // - $find = do_search(array("keys" => $keys, - "type" => "comment", - "select" => "select s.lno as lno, c.nid as nid, c.subject as title, c.timestamp as created, u.uid as uid, u.name as name, s.count as count FROM search_index s, comments c LEFT JOIN users u ON c.uid = u.uid WHERE s.lno = c.cid AND s.type = 'comment' AND s.word like '%'")); + $find = do_search(array("keys" => $keys, "type" => "comment", "select" => "select s.lno as lno, c.nid as nid, c.subject as title, c.timestamp as created, u.uid as uid, u.name as name, s.count as count FROM search_index s, comments c LEFT JOIN users u ON c.uid = u.uid WHERE s.lno = c.cid AND s.type = 'comment' AND s.word like '%'")); return $find; } @@ -605,7 +605,7 @@ function comment_link($type, $node = 0, $main = 0) { $all = comment_num_all($node->nid); $new = comment_num_new($node->nid); - $links[] = l(format_plural($all, "comment", "comments") . ($new ? ", $new ". t("new") : ""), array("id" => $node->nid."#comment"), t("View this posting and all of its comments.")); + $links[] = l(format_plural($all, "comment", "comments") . ($new ? ", $new ". t("new") : ""), array("id" => $node->nid ."#comment"), t("View this posting and all of its comments.")); } } else { @@ -616,8 +616,9 @@ function comment_link($type, $node = 0, $main = 0) { if (user_access("post comments")) { if ($node->comment == 2) { - $links[] = lm(t("add new comment"), array("mod" => "comment", "op" => "reply", "id" => $node->nid."#comment"), t("Share your thoughts and opinions related to this posting.")); - } else { + $links[] = lm(t("add new comment"), array("mod" => "comment", "op" => "reply", "id" => $node->nid ."#comment"), t("Share your thoughts and opinions related to this posting.")); + } + else { $links[] = t("This discussion is closed: you can't post new comments."); } } @@ -642,7 +643,7 @@ function comment_node_link($node) { $output .= " <tr><th>title</th><th>author</th><th colspan=\"3\">operations</th></tr>"; while ($comment = db_fetch_object($result)) { - $output .= "<tr><td>".l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid."#".$comment->cid))."</td><td>". format_name($comment) ."</td><td>".l(t("view comment"), array("id" => $node->nid, "cid" => $comment->cid."#".$comment->cid))."</td><td>".la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid))."</td><td>".la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid))."</td></tr>"; + $output .= "<tr><td>". l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid ."#". $comment->cid)) ."</td><td>". format_name($comment) ."</td><td>". l(t("view comment"), array("id" => $node->nid, "cid" => $comment->cid ."#". $comment->cid)) ."</td><td>". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)) ."</td><td>". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) ."</td></tr>"; } $output .= "</table>"; @@ -707,7 +708,7 @@ function comment_admin_overview() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>subject</th><th>author</th><th>date</th><th colspan=\"2\">operations</th></tr>\n"; while ($comment = db_fetch_object($result)) { - $output .= " <tr><td>".l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid, "pid" => $comment->pid."#".$comment->cid))."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>".la(t("edit comment"), array("mod" => comment, "op" => edit, "id" => $comment->cid))."</td><td>".la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid))."</td></tr>\n"; + $output .= " <tr><td>". l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid, "pid" => $comment->pid ."#". $comment->cid)) ."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". la(t("edit comment"), array("mod" => comment, "op" => edit, "id" => $comment->cid)) ."</td><td>". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) ."</td></tr>\n"; } $output .= "</table>\n"; @@ -736,7 +737,7 @@ function comment_admin() { if (user_access("administer comments")) { - print "<small>".la(t("overview"), array("mod" => "comment"))." | ".la(t("search comment"), array("mod" => "comment", "op" => "search"))."</small><hr />\n"; + print "<small>". la(t("overview"), array("mod" => "comment")) ." | ". la(t("search comment"), array("mod" => "comment", "op" => "search")) ."</small><hr />\n"; switch ($op) { case "edit": @@ -778,9 +779,7 @@ function comment_update_index() { // "select"'s value is used to select the node id and text fields from // the table we are indexing. In this case, we also check against the // last run date for the comments update. - return array("last_update" => "comment_cron_last", - "node_type" => "comment", - "select" => "SELECT c.cid as lno, c.subject as text1, c.comment as text2 FROM comments c WHERE timestamp > ". variable_get("comment_cron_last", 1)); + return array("last_update" => "comment_cron_last", "node_type" => "comment", "select" => "SELECT c.cid as lno, c.subject as text1, c.comment as text2 FROM comments c WHERE timestamp > ". variable_get("comment_cron_last", 1)); } ?> diff --git a/modules/forum.module b/modules/forum.module index 3c2d5c5c7..64597ab2c 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -47,7 +47,7 @@ function forum_link($type) { function forum_view($node) { global $theme; - $output .= "<p>".lm(t("Forum"), array("mod" => "forum"))." / <b>".l(check_output($node->title), array("id" => $node->nid))."</b>:</p><p>". check_output($node->body) ."</p>"; + $output .= "<p>". lm(t("Forum"), array("mod" => "forum")) ." / <b>". l(check_output($node->title), array("id" => $node->nid)) ."</b>:</p><p>". check_output($node->body) ."</p>"; $output .= "<p>". $theme->links(link_node($node, $main)) ."</p>"; $theme->box(t("Discussion forum"), $output); @@ -81,7 +81,7 @@ function forum_page() { $output .= " <tr><th>". t("Forum") ."</th><th>". t("Comments") ."</th><th>". t("Last comment") ."</th></tr>"; while ($node = db_fetch_object($result)) { $node = node_load(array("nid" => $node->nid)); - $output .= " <tr><td>".l(check_output($node->title), array("id" => $node->nid))."<br /><small>". check_output($node->body, 1) ."</small></td><td align=\"center\">". forum_num_comments($node->nid) ."</td><td align=\"center\">". forum_last_comment($node->nid) ."</td></tr>"; + $output .= " <tr><td>". l(check_output($node->title), array("id" => $node->nid)) ."<br /><small>". check_output($node->body, 1) ."</small></td><td align=\"center\">". forum_num_comments($node->nid) ."</td><td align=\"center\">". forum_last_comment($node->nid) ."</td></tr>"; } $output .= "</table>"; diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 3c2d5c5c7..64597ab2c 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -47,7 +47,7 @@ function forum_link($type) { function forum_view($node) { global $theme; - $output .= "<p>".lm(t("Forum"), array("mod" => "forum"))." / <b>".l(check_output($node->title), array("id" => $node->nid))."</b>:</p><p>". check_output($node->body) ."</p>"; + $output .= "<p>". lm(t("Forum"), array("mod" => "forum")) ." / <b>". l(check_output($node->title), array("id" => $node->nid)) ."</b>:</p><p>". check_output($node->body) ."</p>"; $output .= "<p>". $theme->links(link_node($node, $main)) ."</p>"; $theme->box(t("Discussion forum"), $output); @@ -81,7 +81,7 @@ function forum_page() { $output .= " <tr><th>". t("Forum") ."</th><th>". t("Comments") ."</th><th>". t("Last comment") ."</th></tr>"; while ($node = db_fetch_object($result)) { $node = node_load(array("nid" => $node->nid)); - $output .= " <tr><td>".l(check_output($node->title), array("id" => $node->nid))."<br /><small>". check_output($node->body, 1) ."</small></td><td align=\"center\">". forum_num_comments($node->nid) ."</td><td align=\"center\">". forum_last_comment($node->nid) ."</td></tr>"; + $output .= " <tr><td>". l(check_output($node->title), array("id" => $node->nid)) ."<br /><small>". check_output($node->body, 1) ."</small></td><td align=\"center\">". forum_num_comments($node->nid) ."</td><td align=\"center\">". forum_last_comment($node->nid) ."</td></tr>"; } $output .= "</table>"; diff --git a/modules/import.module b/modules/import.module index d3b79bf7c..c12ee48ed 100644 --- a/modules/import.module +++ b/modules/import.module @@ -98,7 +98,7 @@ function import_get_bundles($attributes = 0) { $i = 0; while ($bundle = db_fetch_object($result)) { $block[$i]["subject"] = $bundle->title; - $block[$i]["content"] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\">".lm(t("more"), array("mod" => "import", "op" => "bundle", "id" => $bundle->bid), t("View this bundle's recent news."))."</div></p>"; + $block[$i]["content"] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\">". lm(t("more"), array("mod" => "import", "op" => "bundle", "id" => $bundle->bid), t("View this bundle's recent news.")) ."</div></p>"; $block[$i]["info"] = "$bundle->title bundle"; $i++; @@ -113,7 +113,7 @@ function import_get_feeds($attributes = 0) { $i = 0; while ($feed = db_fetch_object($result)) { $block[$i]["subject"] = $feed->title; - $block[$i]["content"] = import_feed_block($feed) ."<p><div align=\"right\">".lm(t("more"), array("mod" => "import", "op" => "feed", "id" => $feed->fid), t("View this feed's recent news."))."</div></p>"; + $block[$i]["content"] = import_feed_block($feed) ."<p><div align=\"right\">". lm(t("more"), array("mod" => "import", "op" => "feed", "id" => $feed->fid), t("View this feed's recent news.")) ."</div></p>"; $block[$i]["info"] = "$feed->title feed"; $i++; @@ -176,7 +176,7 @@ function import_refresh($feed) { $link = strip_tags($link[1]); $description = filter(strtr($description[1], $tt)); - db_query("UPDATE feed SET timestamp = '%s', link = '%s', description = '%s' WHERE fid = '%s'",time(), $link, $description, $feed["fid"]); + db_query("UPDATE feed SET timestamp = '%s', link = '%s', description = '%s' WHERE fid = '%s'", time(), $link, $description, $feed["fid"]); /* ** Extract and process individual items: @@ -349,7 +349,7 @@ function import_view() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>title</th><th>attributes</th><th>items</th><th>last update</th><th>next update</th><th colspan=\"3\">operations</th></tr>\n"; while ($feed = db_fetch_object($result)) { - $output .= " <tr><td>". check_output($feed->title) ."</td><td>". check_output($feed->attributes) ."</td><td>". format_plural($feed->items, "item", "items") ."</td><td>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</td><td>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</td><td>".la(t("edit feed"), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $feed->fid))."</td><td>" .la(t("remove items"), array("mod" => "import", "type" => "feed", "op" => "remove", "id" => $feed->fid)). "</td><td>". la(t("update items"), array("mod" => "import", "type" => "feed", "op" => "update", "id" => $feed->fid)). "</td></tr>\n"; + $output .= " <tr><td>". check_output($feed->title) ."</td><td>". check_output($feed->attributes) ."</td><td>". format_plural($feed->items, "item", "items") ."</td><td>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</td><td>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</td><td>". la(t("edit feed"), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $feed->fid)) ."</td><td>". la(t("remove items"), array("mod" => "import", "type" => "feed", "op" => "remove", "id" => $feed->fid)) ."</td><td>". la(t("update items"), array("mod" => "import", "type" => "feed", "op" => "update", "id" => $feed->fid)) ."</td></tr>\n"; } $output .= "</table>\n"; @@ -359,7 +359,7 @@ function import_view() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>title</th><th>attributes</th><th>operations</th></tr>\n"; while ($bundle = db_fetch_object($result)) { - $output .= " <tr><td>". check_output($bundle->title) ."</td><td>". check_output($bundle->attributes) ."</td><td>".la(t("edit bundle"), array("mod" => "import", "type" => "bundle", "op" => "edit", "id" => $bundle->bid))."</td></tr>\n"; + $output .= " <tr><td>". check_output($bundle->title) ."</td><td>". check_output($bundle->attributes) ."</td><td>". la(t("edit bundle"), array("mod" => "import", "type" => "bundle", "op" => "edit", "id" => $bundle->bid)) ."</td></tr>\n"; } $output .= "</table>\n"; @@ -432,7 +432,7 @@ function import_tag() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>time</th><th>feed</th><th>item</th></tr>\n"; while ($item = db_fetch_object($result)) { - $output .= " <tr><td valign=\"top\" nowrap=\"nowrap\">". format_date($item->timestamp, "custom", "m/d/y") ."<br />". format_date($item->timestamp, "custom", "H:i") ."</td><td align=\"center\" valign=\"top\" nowrap=\"nowrap\">".la(check_output($item->feed), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $item->fid))."</td><td><a href=\"". check_output($item->link) ."\">". check_output($item->title) ."</a>". ($item->description ? "<br /><small><i>". check_output($item->description, 1) ."</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" /></td></tr>\n"; + $output .= " <tr><td valign=\"top\" nowrap=\"nowrap\">". format_date($item->timestamp, "custom", "m/d/y") ."<br />". format_date($item->timestamp, "custom", "H:i") ."</td><td align=\"center\" valign=\"top\" nowrap=\"nowrap\">". la(check_output($item->feed), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $item->fid)) ."</td><td><a href=\"". check_output($item->link) ."\">". check_output($item->title) ."</a>". ($item->description ? "<br /><small><i>". check_output($item->description, 1) ."</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" /></td></tr>\n"; } $output .= "</table>\n"; $output .= "<input type=\"submit\" name=\"op\" value=\"Save attributes\" />\n"; @@ -452,7 +452,7 @@ function import_admin() { $links[] = la(t("overview"), array("mod" => "import", "op" => "view")); $links[] = la(t("help"), array("mod" => "import", "op" => "help")); - print "<small>".implode(" | ", $links)."</small><hr />"; + print "<small>". implode(" | ", $links) ."</small><hr />"; switch ($op) { case "help": @@ -541,7 +541,7 @@ function import_page_last() { $links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), t("Read more syndicated news from this feed.")); if ($item->link) { - $output .= "<tr><td>". format_url($item->link, $item->title) ." · ".lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), t("View more information about this feed."))."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td>". format_url($item->link, $item->title) ." · ". lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), t("View more information about this feed.")) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; } if ($item->description) { @@ -610,7 +610,7 @@ function import_page_bundle($bid) { $links[] = "<a href=\"$item->link\">". t("visit") ."</a>"; if ($item->link) { - $output .= "<tr><td>". format_url($item->link, $item->title) ." · ".lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), t("View more information about this feed."))."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; + $output .= "<tr><td>". format_url($item->link, $item->title) ." · ". lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), t("View more information about this feed.")) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n"; } if ($item->description) { @@ -638,7 +638,7 @@ function import_page_sources() { $output .= "<div style=\"margin-left: 20px;\">". check_output($feed->description, 1) ."</div><br />"; } - $output .= lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", array("mod" => "import", "op" => "fd"), t("View the list of syndicated websites in XML format."))."<br />\n"; + $output .= lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", array("mod" => "import", "op" => "fd"), t("View the list of syndicated websites in XML format.")) ."<br />\n"; $theme->header(); $theme->box(t("News feeds"), import_page_info()); diff --git a/modules/jabber.module b/modules/jabber.module index a5d962abf..5af4554d7 100644 --- a/modules/jabber.module +++ b/modules/jabber.module @@ -166,8 +166,8 @@ function jabber_user($type, $edit, $user) { return $output; case "edit_form": $result = user_get_authname($user, $module); - $output .= form_textfield("$name ID", "authname_" . $module, $result, 30, 55, t("You may login to %s using a valid %id.", array("%s" => variable_get("site_name", "this web site"), "%id" => lm($name ID, array("mod" => "user", "op" => "help#".$module))))); - return $output; + $output .= form_textfield("$name ID", "authname_" . $module, $result, 30, 55, t("You may login to %s using a valid %id.", array("%s" => variable_get("site_name", "this web site"), "%id" => lm("$name ID", array("mod" => "user", "op" => "help#".$module))))); + return $output; case "edit_validate": return user_validate_authmap($user, $edit["authname_$module"], $module); } diff --git a/modules/locale.module b/modules/locale.module index 0b79a22f6..9813f1152 100644 --- a/modules/locale.module +++ b/modules/locale.module @@ -95,7 +95,7 @@ function locale_languages($translation) { global $languages; foreach ($languages as $key=>$value) { - $output .= ($translation->$key) ? "<a href=\"#\" title=\"".check_output($translation->$key)."\">$key</a> " : "<strike>$key</strike> "; + $output .= ($translation->$key) ? "<a href=\"#\" title=\"". check_output($translation->$key) ."\">$key</a> " : "<strike>$key</strike> "; } return $output; @@ -106,10 +106,10 @@ function locale_links($translation) { foreach ($languages as $key=>$value) { if ($translation) { - $output .= la(t("translated '$key' strings"), array("mod" => "locale", "op" => "translated", "language" => $key))." | "; + $output .= la(t("translated '$key' strings"), array("mod" => "locale", "op" => "translated", "language" => $key)) ." | "; } else { - $output .= la(t("untranslated '$key' strings"), array("mod" => "locale", "op" => "untranslated", "language" => $key))." | "; + $output .= la(t("untranslated '$key' strings"), array("mod" => "locale", "op" => "untranslated", "language" => $key)) ." | "; } } @@ -156,18 +156,18 @@ function locale_seek() { $string_query[] = "string LIKE '%". check_query($edit["string"]) ."%'"; if ($edit["status"] != 2) { if (strlen($edit["language"]) == 2) { - $string_query[] = check_query($edit["language"]). " LIKE '%". check_query($edit["string"]) ."%'"; + $string_query[] = check_query($edit["language"]) ." LIKE '%". check_query($edit["string"]) ."%'"; } else { foreach ($languages as $key=>$value) { - $string_query[] = check_query($key). " LIKE '%". check_query($edit["string"]) ."%'"; + $string_query[] = check_query($key) ." LIKE '%". check_query($edit["string"]) ."%'"; } } } - $query[] = "(" . implode(" || ", $string_query) . ")"; + $query[] = "(". implode(" || ", $string_query) .")"; } - $result = db_query("SELECT * FROM locales". (count($query) ? " WHERE ". implode(" && ", $query) : ""). " ORDER BY string"); + $result = db_query("SELECT * FROM locales". (count($query) ? " WHERE ". implode(" && ", $query) : "") ." ORDER BY string"); $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>string</th>"; @@ -191,7 +191,7 @@ function locale_seek() { $output .= "<td align=\"center\">". check_output(locale_languages($locale)) ."</td>"; } - $output .= "<td nowrap=\"nowrap\">".la(t("edit locale"), array("mod" => "locale", "op" => "edit", "id" => $locale->lid))."</td><td nowrap=\"nowrap\">".la(t("delete locale"), array("mod" => "locale", "op" => "delete", "id" => $locale->lid))."</td></tr>"; + $output .= "<td nowrap=\"nowrap\">". la(t("edit locale"), array("mod" => "locale", "op" => "edit", "id" => $locale->lid)) ."</td><td nowrap=\"nowrap\">". la(t("delete locale"), array("mod" => "locale", "op" => "delete", "id" => $locale->lid)) ."</td></tr>"; } $output .= "</table>\n"; } @@ -216,7 +216,7 @@ function locale_admin() { print status("locale disabled."); } else if (user_access("administer locales")) { - print "<small>". locale_links(1) . locale_links(0) .la(t("search"), array("mod" => "locale", "op" => "Search"))." | ".la(t("overview"), array("mod" => "locale", "op" => "overview"))." | ".la(t("help"), array("mod" => "locale", "op" => "help"))."</small><hr />\n"; + print "<small>". locale_links(1) . locale_links(0) . la(t("search"), array("mod" => "locale", "op" => "Search")) ." | ". la(t("overview"), array("mod" => "locale", "op" => "overview")) ." | ". la(t("help"), array("mod" => "locale", "op" => "help")) ."</small><hr />\n"; switch ($op) { case "delete": diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 0b79a22f6..9813f1152 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -95,7 +95,7 @@ function locale_languages($translation) { global $languages; foreach ($languages as $key=>$value) { - $output .= ($translation->$key) ? "<a href=\"#\" title=\"".check_output($translation->$key)."\">$key</a> " : "<strike>$key</strike> "; + $output .= ($translation->$key) ? "<a href=\"#\" title=\"". check_output($translation->$key) ."\">$key</a> " : "<strike>$key</strike> "; } return $output; @@ -106,10 +106,10 @@ function locale_links($translation) { foreach ($languages as $key=>$value) { if ($translation) { - $output .= la(t("translated '$key' strings"), array("mod" => "locale", "op" => "translated", "language" => $key))." | "; + $output .= la(t("translated '$key' strings"), array("mod" => "locale", "op" => "translated", "language" => $key)) ." | "; } else { - $output .= la(t("untranslated '$key' strings"), array("mod" => "locale", "op" => "untranslated", "language" => $key))." | "; + $output .= la(t("untranslated '$key' strings"), array("mod" => "locale", "op" => "untranslated", "language" => $key)) ." | "; } } @@ -156,18 +156,18 @@ function locale_seek() { $string_query[] = "string LIKE '%". check_query($edit["string"]) ."%'"; if ($edit["status"] != 2) { if (strlen($edit["language"]) == 2) { - $string_query[] = check_query($edit["language"]). " LIKE '%". check_query($edit["string"]) ."%'"; + $string_query[] = check_query($edit["language"]) ." LIKE '%". check_query($edit["string"]) ."%'"; } else { foreach ($languages as $key=>$value) { - $string_query[] = check_query($key). " LIKE '%". check_query($edit["string"]) ."%'"; + $string_query[] = check_query($key) ." LIKE '%". check_query($edit["string"]) ."%'"; } } } - $query[] = "(" . implode(" || ", $string_query) . ")"; + $query[] = "(". implode(" || ", $string_query) .")"; } - $result = db_query("SELECT * FROM locales". (count($query) ? " WHERE ". implode(" && ", $query) : ""). " ORDER BY string"); + $result = db_query("SELECT * FROM locales". (count($query) ? " WHERE ". implode(" && ", $query) : "") ." ORDER BY string"); $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>string</th>"; @@ -191,7 +191,7 @@ function locale_seek() { $output .= "<td align=\"center\">". check_output(locale_languages($locale)) ."</td>"; } - $output .= "<td nowrap=\"nowrap\">".la(t("edit locale"), array("mod" => "locale", "op" => "edit", "id" => $locale->lid))."</td><td nowrap=\"nowrap\">".la(t("delete locale"), array("mod" => "locale", "op" => "delete", "id" => $locale->lid))."</td></tr>"; + $output .= "<td nowrap=\"nowrap\">". la(t("edit locale"), array("mod" => "locale", "op" => "edit", "id" => $locale->lid)) ."</td><td nowrap=\"nowrap\">". la(t("delete locale"), array("mod" => "locale", "op" => "delete", "id" => $locale->lid)) ."</td></tr>"; } $output .= "</table>\n"; } @@ -216,7 +216,7 @@ function locale_admin() { print status("locale disabled."); } else if (user_access("administer locales")) { - print "<small>". locale_links(1) . locale_links(0) .la(t("search"), array("mod" => "locale", "op" => "Search"))." | ".la(t("overview"), array("mod" => "locale", "op" => "overview"))." | ".la(t("help"), array("mod" => "locale", "op" => "help"))."</small><hr />\n"; + print "<small>". locale_links(1) . locale_links(0) . la(t("search"), array("mod" => "locale", "op" => "Search")) ." | ". la(t("overview"), array("mod" => "locale", "op" => "overview")) ." | ". la(t("help"), array("mod" => "locale", "op" => "help")) ."</small><hr />\n"; switch ($op) { case "delete": diff --git a/modules/node.module b/modules/node.module index 2db4862ce..ffc57efc3 100644 --- a/modules/node.module +++ b/modules/node.module @@ -280,9 +280,7 @@ function node_search($keys) { // The select must always provide the following fields - lno, title, // created, uid, name, count // - $find = do_search(array("keys" => $keys, - "type" => "node", - "select" => "select s.lno as lno, n.title as title, n.created as created, u.uid as uid, u.name as name, s.count as count FROM search_index s, node n LEFT JOIN users u ON n.uid = u.uid WHERE s.lno = n.nid AND s.type = 'node' AND s.word like '%' AND n.status = 1")); + $find = do_search(array("keys" => $keys, "type" => "node", "select" => "select s.lno as lno, n.title as title, n.created as created, u.uid as uid, u.name as name, s.count as count FROM search_index s, node n LEFT JOIN users u ON n.uid = u.uid WHERE s.lno = n.nid AND s.type = 'node' AND s.word like '%' AND n.status = 1")); return $find; } @@ -462,7 +460,7 @@ function node_admin_edit($node) { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">"; $output .= " <tr><th>older revisions</th><th colspan=\"3\">operations</th></tr>"; foreach ($node->revisions as $key => $revision) { - $output .= " <tr><td>". t("revision #%r revised by %u on %d", array("%r" => $key, "%u" => format_name(user_load(array("uid" => $revision["uid"]))), "%d" => format_date($revision["timestamp"], "small"))) . ($revision["history"] ? "<br /><small>". $revision["history"] ."</small>" : "") ."</td><td>".l(t("view revision"), array("id" => $node->nid, "revision" =>$key))."</td><td>".la(t("rollback revision"), array("mod" => "node", "op" => "rollback+revision", "id" => $node->nid, "revision" => $key))."</td><td>". la(t("delete revision"), array("mod" => "node", "op" => "delete+revision", "id" => $node->nid, "revision" => $key))."</td></tr>"; + $output .= " <tr><td>". t("revision #%r revised by %u on %d", array("%r" => $key, "%u" => format_name(user_load(array("uid" => $revision["uid"]))), "%d" => format_date($revision["timestamp"], "small"))) . ($revision["history"] ? "<br /><small>". $revision["history"] ."</small>" : "") ."</td><td>". l(t("view revision"), array("id" => $node->nid, "revision" =>$key)) ."</td><td>". la(t("rollback revision"), array("mod" => "node", "op" => "rollback+revision", "id" => $node->nid, "revision" => $key)) ."</td><td>". la(t("delete revision"), array("mod" => "node", "op" => "delete+revision", "id" => $node->nid, "revision" => $key)) ."</td></tr>"; } $output .= "</table>"; } @@ -495,7 +493,7 @@ function node_admin_nodes() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>title</th><th>type</th><th>author</th><th>status</th><th colspan=\"2\">operations</th></tr>\n"; while ($node = db_fetch_object($result)) { - $output .= "<tr><td>".l(check_output($node->title), array("id" => $node->nid))."</td><td>$node->type</td><td nowrap=\"nowrap\">". format_name($node) ."</td><td>". ($node->status ? t("published") : t("not published")) ."</td><td nowrap=\"nowrap\">".la(t("edit node"), array("mod" => "node", "op" => "edit", "id" => $node->nid))."</td><td nowrap=\"nowrap\">".la(t("delete node"), array("mod" => "node", "op" => "delete", "id" => $node->nid))."</td></tr>"; + $output .= "<tr><td>". l(check_output($node->title), array("id" => $node->nid)) ."</td><td>$node->type</td><td nowrap=\"nowrap\">". format_name($node) ."</td><td>". ($node->status ? t("published") : t("not published")) ."</td><td nowrap=\"nowrap\">". la(t("edit node"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td><td nowrap=\"nowrap\">". la(t("delete node"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td></tr>"; } $output .= "</table>"; @@ -666,7 +664,7 @@ function node_block() { global $theme; $block[0][subject] = t("Syndicate"); - $block[0][content] = "<div align=\"center\">".lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"XML\" />", array("mod" => "node", "op" => "feed"), t("Read the XML version of this page."))."</div>\n"; + $block[0][content] = "<div align=\"center\">". lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"XML\" />", array("mod" => "node", "op" => "feed"), t("Read the XML version of this page.")) ."</div>\n"; $block[0][info] = "Syndicate"; return $block; @@ -902,7 +900,7 @@ function node_add($type) { foreach (module_list() as $name) { if (module_hook($name, "node") && node_access("create", array("type" => $name))) { $output .= "<li>"; - $output .= " ".lm(module_invoke($name, "node", "name"), array("mod" => "node", "op" => "add", "type" => $name), t("Add a new %s.", array("%s" => module_invoke($name, "node", "name")))); + $output .= " ". lm(module_invoke($name, "node", "name"), array("mod" => "node", "op" => "add", "type" => $name), t("Add a new %s.", array("%s" => module_invoke($name, "node", "name")))); $output .= " <div style=\"margin-left: 20px;\">". module_invoke($name, "node", "description") ."</div>"; $output .= "</li>"; } @@ -1213,7 +1211,8 @@ function node_page() { foreach ((explode(",", $or)) as $t) { $terms[] = "'".check_query($t)."'"; } - } else if ($and) { + } + else if ($and) { foreach ((explode(",", $and)) as $t) { $terms[] = "'".check_query($t)."'"; } @@ -1222,10 +1221,12 @@ function node_page() { if ($or) { // this is an OR of terms $result = db_query("SELECT DISTINCT(n.nid), type FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); - } else if ($and) { + } + else if ($and) { // this is an AND $result = db_query("SELECT n.nid, type, count(*) AS c FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' GROUP BY n.nid HAVING c = ".count($terms)." ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); - } else { + } + else { $result = db_query("SELECT nid, type FROM node WHERE ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' ORDER BY static DESC, changed DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); } diff --git a/modules/node/node.module b/modules/node/node.module index 2db4862ce..ffc57efc3 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -280,9 +280,7 @@ function node_search($keys) { // The select must always provide the following fields - lno, title, // created, uid, name, count // - $find = do_search(array("keys" => $keys, - "type" => "node", - "select" => "select s.lno as lno, n.title as title, n.created as created, u.uid as uid, u.name as name, s.count as count FROM search_index s, node n LEFT JOIN users u ON n.uid = u.uid WHERE s.lno = n.nid AND s.type = 'node' AND s.word like '%' AND n.status = 1")); + $find = do_search(array("keys" => $keys, "type" => "node", "select" => "select s.lno as lno, n.title as title, n.created as created, u.uid as uid, u.name as name, s.count as count FROM search_index s, node n LEFT JOIN users u ON n.uid = u.uid WHERE s.lno = n.nid AND s.type = 'node' AND s.word like '%' AND n.status = 1")); return $find; } @@ -462,7 +460,7 @@ function node_admin_edit($node) { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">"; $output .= " <tr><th>older revisions</th><th colspan=\"3\">operations</th></tr>"; foreach ($node->revisions as $key => $revision) { - $output .= " <tr><td>". t("revision #%r revised by %u on %d", array("%r" => $key, "%u" => format_name(user_load(array("uid" => $revision["uid"]))), "%d" => format_date($revision["timestamp"], "small"))) . ($revision["history"] ? "<br /><small>". $revision["history"] ."</small>" : "") ."</td><td>".l(t("view revision"), array("id" => $node->nid, "revision" =>$key))."</td><td>".la(t("rollback revision"), array("mod" => "node", "op" => "rollback+revision", "id" => $node->nid, "revision" => $key))."</td><td>". la(t("delete revision"), array("mod" => "node", "op" => "delete+revision", "id" => $node->nid, "revision" => $key))."</td></tr>"; + $output .= " <tr><td>". t("revision #%r revised by %u on %d", array("%r" => $key, "%u" => format_name(user_load(array("uid" => $revision["uid"]))), "%d" => format_date($revision["timestamp"], "small"))) . ($revision["history"] ? "<br /><small>". $revision["history"] ."</small>" : "") ."</td><td>". l(t("view revision"), array("id" => $node->nid, "revision" =>$key)) ."</td><td>". la(t("rollback revision"), array("mod" => "node", "op" => "rollback+revision", "id" => $node->nid, "revision" => $key)) ."</td><td>". la(t("delete revision"), array("mod" => "node", "op" => "delete+revision", "id" => $node->nid, "revision" => $key)) ."</td></tr>"; } $output .= "</table>"; } @@ -495,7 +493,7 @@ function node_admin_nodes() { $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= " <tr><th>title</th><th>type</th><th>author</th><th>status</th><th colspan=\"2\">operations</th></tr>\n"; while ($node = db_fetch_object($result)) { - $output .= "<tr><td>".l(check_output($node->title), array("id" => $node->nid))."</td><td>$node->type</td><td nowrap=\"nowrap\">". format_name($node) ."</td><td>". ($node->status ? t("published") : t("not published")) ."</td><td nowrap=\"nowrap\">".la(t("edit node"), array("mod" => "node", "op" => "edit", "id" => $node->nid))."</td><td nowrap=\"nowrap\">".la(t("delete node"), array("mod" => "node", "op" => "delete", "id" => $node->nid))."</td></tr>"; + $output .= "<tr><td>". l(check_output($node->title), array("id" => $node->nid)) ."</td><td>$node->type</td><td nowrap=\"nowrap\">". format_name($node) ."</td><td>". ($node->status ? t("published") : t("not published")) ."</td><td nowrap=\"nowrap\">". la(t("edit node"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td><td nowrap=\"nowrap\">". la(t("delete node"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td></tr>"; } $output .= "</table>"; @@ -666,7 +664,7 @@ function node_block() { global $theme; $block[0][subject] = t("Syndicate"); - $block[0][content] = "<div align=\"center\">".lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"XML\" />", array("mod" => "node", "op" => "feed"), t("Read the XML version of this page."))."</div>\n"; + $block[0][content] = "<div align=\"center\">". lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" border=\"0\" alt=\"XML\" />", array("mod" => "node", "op" => "feed"), t("Read the XML version of this page.")) ."</div>\n"; $block[0][info] = "Syndicate"; return $block; @@ -902,7 +900,7 @@ function node_add($type) { foreach (module_list() as $name) { if (module_hook($name, "node") && node_access("create", array("type" => $name))) { $output .= "<li>"; - $output .= " ".lm(module_invoke($name, "node", "name"), array("mod" => "node", "op" => "add", "type" => $name), t("Add a new %s.", array("%s" => module_invoke($name, "node", "name")))); + $output .= " ". lm(module_invoke($name, "node", "name"), array("mod" => "node", "op" => "add", "type" => $name), t("Add a new %s.", array("%s" => module_invoke($name, "node", "name")))); $output .= " <div style=\"margin-left: 20px;\">". module_invoke($name, "node", "description") ."</div>"; $output .= "</li>"; } @@ -1213,7 +1211,8 @@ function node_page() { foreach ((explode(",", $or)) as $t) { $terms[] = "'".check_query($t)."'"; } - } else if ($and) { + } + else if ($and) { foreach ((explode(",", $and)) as $t) { $terms[] = "'".check_query($t)."'"; } @@ -1222,10 +1221,12 @@ function node_page() { if ($or) { // this is an OR of terms $result = db_query("SELECT DISTINCT(n.nid), type FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); - } else if ($and) { + } + else if ($and) { // this is an AND $result = db_query("SELECT n.nid, type, count(*) AS c FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' GROUP BY n.nid HAVING c = ".count($terms)." ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); - } else { + } + else { $result = db_query("SELECT nid, type FROM node WHERE ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' ORDER BY static DESC, changed DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); } diff --git a/modules/page.module b/modules/page.module index 946308063..3b18feed7 100644 --- a/modules/page.module +++ b/modules/page.module @@ -2,7 +2,7 @@ // $Id$ function page_help() { - $output .= "<p>The page module is used to create a <i>site page</i>. Unlike a story, a site page is a persistent web page on your site which usually shortcuts the typical lifecycle of user generated content (i.e. submit -> moderate -> post -> comment). A site page is usually linked from the main navigation bar, using whatever text the author wishes. To create a site page without this navigation link, simply skip the form field which requests link text. Administrators are the exclusive authors of site pages (i.e. requires the <i>adinister nodes</i> in ".la("permission", array("mod" => "user", "op" => "permission")).").</p>"; + $output .= "<p>The page module is used to create a <i>site page</i>. Unlike a story, a site page is a persistent web page on your site which usually shortcuts the typical lifecycle of user generated content (i.e. submit -> moderate -> post -> comment). A site page is usually linked from the main navigation bar, using whatever text the author wishes. To create a site page without this navigation link, simply skip the form field which requests link text. Administrators are the exclusive authors of site pages (i.e. requires the <i>adinister nodes</i> in ". la("permission", array("mod" => "user", "op" => "permission")) .").</p>"; $output .= "<p>Site pages, unlike many other forms of Drupal content, may be made of PHP code in addition to HTML and text. All Drupal objects and functions are available to the Site Page author.</p>"; return $output; } diff --git a/modules/page/page.module b/modules/page/page.module index 946308063..3b18feed7 100644 --- a/modules/page/page.module +++ b/modules/page/page.module @@ -2,7 +2,7 @@ // $Id$ function page_help() { - $output .= "<p>The page module is used to create a <i>site page</i>. Unlike a story, a site page is a persistent web page on your site which usually shortcuts the typical lifecycle of user generated content (i.e. submit -> moderate -> post -> comment). A site page is usually linked from the main navigation bar, using whatever text the author wishes. To create a site page without this navigation link, simply skip the form field which requests link text. Administrators are the exclusive authors of site pages (i.e. requires the <i>adinister nodes</i> in ".la("permission", array("mod" => "user", "op" => "permission")).").</p>"; + $output .= "<p>The page module is used to create a <i>site page</i>. Unlike a story, a site page is a persistent web page on your site which usually shortcuts the typical lifecycle of user generated content (i.e. submit -> moderate -> post -> comment). A site page is usually linked from the main navigation bar, using whatever text the author wishes. To create a site page without this navigation link, simply skip the form field which requests link text. Administrators are the exclusive authors of site pages (i.e. requires the <i>adinister nodes</i> in ". la("permission", array("mod" => "user", "op" => "permission")) .").</p>"; $output .= "<p>Site pages, unlike many other forms of Drupal content, may be made of PHP code in addition to HTML and text. All Drupal objects and functions are available to the Site Page author.</p>"; return $output; } diff --git a/modules/poll.module b/modules/poll.module index d0ab4dbf0..9d9b16f76 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -28,7 +28,7 @@ function poll_block() { function poll_cron() { // Close polls that have exceeded their allowed runtime - $result = db_query("SELECT p.nid FROM poll p LEFT JOIN node n ON p.nid=n.nid WHERE (n.created + p.runtime) < '" . time() . "' AND p.active = '1' AND p.runtime != '0'"); + $result = db_query("SELECT p.nid FROM poll p LEFT JOIN node n ON p.nid=n.nid WHERE (n.created + p.runtime) < '". time() ."' AND p.active = '1' AND p.runtime != '0'"); while ($poll = db_fetch_object($result)) { db_query("UPDATE poll SET active='0' WHERE nid='$poll->nid'"); } @@ -55,12 +55,12 @@ function poll_form(&$node, &$help, &$error) { } if ($node->chvotes[$i] < 0) { - $error["chvotes][$i"] = "<span style=\"color: red;\">" . t("Negative values are not allowed.") . "</span>"; + $error["chvotes][$i"] = "<span style=\"color: red;\">". t("Negative values are not allowed.") ."</span>"; } } if ($actualchoices < 2) { - $error["choice][0"] = "<span style=\"color: red;\">" . t("You must fill in at least two choices.") . "</span>"; + $error["choice][0"] = "<span style=\"color: red;\">". t("You must fill in at least two choices.") ."</span>"; } } else { @@ -71,10 +71,10 @@ function poll_form(&$node, &$help, &$error) { $opts[$c] = $c; } $output .= form_select(t("Number of choices"), "choices", $node->choices, $opts, t("This item only specifies the number of boxes in this form, but it doesn't have to equal the actual amount of options: you can leave the extra boxes empty.")); - $output .= form_submit(t("Preview")) . "<br><br><br>"; + $output .= form_submit(t("Preview")) ."<br /><br /><br />"; for ($a = 0; $a < $node->choices; $a++) { - $output .= form_textfield(t("Choice"). " " . ($a + 1), "choice][$a", $node->choice[$a], 50, 127, $error["choice][$a"]); + $output .= form_textfield(t("Choice") ." ". ($a + 1), "choice][$a", $node->choice[$a], 50, 127, $error["choice][$a"]); if ($admin) { $output .= form_textfield(t("Votes for choice %n", array("%n" => ($a + 1))), "chvotes][$a", $node->chvotes[$a] ? $node->chvotes[$a] : 0, 7, 7, $error["chvotes][$a"]); } @@ -97,8 +97,7 @@ function poll_help() { function poll_insert($node) { if (!user_access("administer nodes")) { // Make sure all votes are 0 initially - for ($i = 0; $i < count($node->chvotes); $i++) - $node->chvotes[$i] = 0; + for ($i = 0; $i < count($node->chvotes); $i++) $node->chvotes[$i] = 0; $node->active = 1; } @@ -192,7 +191,7 @@ function poll_view(&$node, $main = 0, $block = 0) { if (user_access("vote on polls")) { if ($user->uid) { // Pad the UID with underscores to allow a simple strstr() search - $id = "_" . $user->uid . "_"; + $id = "_". $user->uid ."_"; } else { $id = $REMOTE_ADDR; @@ -205,7 +204,7 @@ function poll_view(&$node, $main = 0, $block = 0) { if (($pollid == $pollidcount) && isset($pollvote) && ($allowvotes)) { // The user has submitted a valid vote if (!empty($node->choice[$pollvote])) { - $node->voters = $node->voters ? ($node->voters . " " . $id) : $id; + $node->voters = $node->voters ? ($node->voters ." ". $id) : $id; db_query("UPDATE poll SET voters='$node->voters' WHERE nid='$node->nid'"); db_query("UPDATE poll_choices SET chvotes = chvotes + 1 WHERE nid='$node->nid' AND chorder='$pollvote'"); $allowvotes = false; @@ -215,7 +214,7 @@ function poll_view(&$node, $main = 0, $block = 0) { if ($allowvotes) { // Display the vote form - $url = request_uri() . (strstr(request_uri(), "?") ? "&" : "?") . "pollid=" . $pollidcount; + $url = request_uri() . (strstr(request_uri(), "?") ? "&" : "?") ."pollid=". $pollidcount; $output .= "<form action=\"$url\" method=\"post\">"; $output .= "<table border=\"0\" align=\"center\"><tr><td>"; @@ -225,9 +224,9 @@ function poll_view(&$node, $main = 0, $block = 0) { } } if ($block) { - $output .= "</td></tr><tr><td><div align=\"center\">" . form_submit(t("Vote")) . "</div></td></tr></table>"; + $output .= "</td></tr><tr><td><div align=\"center\">". form_submit(t("Vote")) ."</div></td></tr></table>"; } else { - $output .= "</td><td valign=\"middle\"><div align=\"right\"> " . form_submit(t("Vote")) . "</div></td></tr></table>"; + $output .= "</td><td valign=\"middle\"><div align=\"right\"> ". form_submit(t("Vote")) ."</div></td></tr></table>"; } $output .= "</form>"; } @@ -243,8 +242,8 @@ function poll_view(&$node, $main = 0, $block = 0) { // Define CSS classes for the bars $output .= "<style type=\"text/css\">"; - $output .= "td.pollfg { background-color: " . $theme->foreground . "; font-size: 5pt; }"; - $output .= "td.pollbg { background-color: " . $theme->background . "; font-size: 5pt; }"; + $output .= "td.pollfg { background-color: ". $theme->foreground ."; font-size: 5pt; }"; + $output .= "td.pollbg { background-color: ". $theme->background ."; font-size: 5pt; }"; $output .= "</style>"; foreach ($node->choice as $key => $value) { @@ -252,7 +251,7 @@ function poll_view(&$node, $main = 0, $block = 0) { $width = round($node->chvotes[$key] * 100 / $votesmax); $percentage = round($node->chvotes[$key] * 100 / max($votestotal, 1)); - $output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\"><tr><td>$value</td><td><div align=\"right\"> $percentage%" . (!$block ? " (" . $node->chvotes[$key] . " votes)" : "") . "</div></td></tr></table>"; + $output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\"><tr><td>$value</td><td><div align=\"right\"> $percentage%". (!$block ? " (". $node->chvotes[$key] ." votes)" : "") ."</div></td></tr></table>"; if ($width == 0) { $output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\"><tr><td class=\"pollbg\" width=\"100%\"> </td></tr></table>"; } @@ -260,11 +259,11 @@ function poll_view(&$node, $main = 0, $block = 0) { $output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\"><tr><td class=\"pollfg\" width=\"100%\"> </td></tr></table>"; } else { - $output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\"><tr><td class=\"pollfg\" width=\"" . $width . "%\"> </td><td class=\"pollbg\" width=\"" . (100 - $width) . "%\"> </td></tr></table>"; + $output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\"><tr><td class=\"pollfg\" width=\"". $width ."%\"> </td><td class=\"pollbg\" width=\"". (100 - $width) ."%\"> </td></tr></table>"; } } } - $output .= "<br><div align=\"center\">Total votes: " . $votestotal . "</div>"; + $output .= "<br /><div align=\"center\">Total votes: ". $votestotal ."</div>"; } // Force the output on both the mainpage and elsewhere $node->body = $output; diff --git a/modules/poll/poll.module b/modules/poll/poll.module index d0ab4dbf0..9d9b16f76 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -28,7 +28,7 @@ function poll_block() { function poll_cron() { // Close polls that have exceeded their allowed runtime - $result = db_query("SELECT p.nid FROM poll p LEFT JOIN node n ON p.nid=n.nid WHERE (n.created + p.runtime) < '" . time() . "' AND p.active = '1' AND p.runtime != '0'"); + $result = db_query("SELECT p.nid FROM poll p LEFT JOIN node n ON p.nid=n.nid WHERE (n.created + p.runtime) < '". time() ."' AND p.active = '1' AND p.runtime != '0'"); while ($poll = db_fetch_object($result)) { db_query("UPDATE poll SET active='0' WHERE nid='$poll->nid'"); } @@ -55,12 +55,12 @@ function poll_form(&$node, &$help, &$error) { } if ($node->chvotes[$i] < 0) { - $error["chvotes][$i"] = "<span style=\"color: red;\">" . t("Negative values are not allowed.") . "</span>"; + $error["chvotes][$i"] = "<span style=\"color: red;\">". t("Negative values are not allowed.") ."</span>"; } } if ($actualchoices < 2) { - $error["choice][0"] = "<span style=\"color: red;\">" . t("You must fill in at least two choices.") . "</span>"; + $error["choice][0"] = "<span style=\"color: red;\">". t("You must fill in at least two choices.") ."</span>"; } } else { @@ -71,10 +71,10 @@ function poll_form(&$node, &$help, &$error) { $opts[$c] = $c; } $output .= form_select(t("Number of choices"), "choices", $node->choices, $opts, t("This item only specifies the number of boxes in this form, but it doesn't have to equal the actual amount of options: you can leave the extra boxes empty.")); - $output .= form_submit(t("Preview")) . "<br><br><br>"; + $output .= form_submit(t("Preview")) ."<br /><br /><br />"; for ($a = 0; $a < $node->choices; $a++) { - $output .= form_textfield(t("Choice"). " " . ($a + 1), "choice][$a", $node->choice[$a], 50, 127, $error["choice][$a"]); + $output .= form_textfield(t("Choice") ." ". ($a + 1), "choice][$a", $node->choice[$a], 50, 127, $error["choice][$a"]); if ($admin) { $output .= form_textfield(t("Votes for choice %n", array("%n" => ($a + 1))), "chvotes][$a", $node->chvotes[$a] ? $node->chvotes[$a] : 0, 7, 7, $error["chvotes][$a"]); } @@ -97,8 +97,7 @@ function poll_help() { function poll_insert($node) { if (!user_access("administer nodes")) { // Make sure all votes are 0 initially - for ($i = 0; $i < count($node->chvotes); $i++) - $node->chvotes[$i] = 0; + for ($i = 0; $i < count($node->chvotes); $i++) $node->chvotes[$i] = 0; $node->active = 1; } @@ -192,7 +191,7 @@ function poll_view(&$node, $main = 0, $block = 0) { if (user_access("vote on polls")) { if ($user->uid) { // Pad the UID with underscores to allow a simple strstr() search - $id = "_" . $user->uid . "_"; + $id = "_". $user->uid ."_"; } else { $id = $REMOTE_ADDR; @@ -205,7 +204,7 @@ function poll_view(&$node, $main = 0, $block = 0) { if (($pollid == $pollidcount) && isset($pollvote) && ($allowvotes)) { // The user has submitted a valid vote if (!empty($node->choice[$pollvote])) { - $node->voters = $node->voters ? ($node->voters . " " . $id) : $id; + $node->voters = $node->voters ? ($node->voters ." ". $id) : $id; db_query("UPDATE poll SET voters='$node->voters' WHERE nid='$node->nid'"); db_query("UPDATE poll_choices SET chvotes = chvotes + 1 WHERE nid='$node->nid' AND chorder='$pollvote'"); $allowvotes = false; @@ -215,7 +214,7 @@ function poll_view(&$node, $main = 0, $block = 0) { if ($allowvotes) { // Display the vote form - $url = request_uri() . (strstr(request_uri(), "?") ? "&" : "?") . "pollid=" . $pollidcount; + $url = request_uri() . (strstr(request_uri(), "?") ? "&" : "?") ."pollid=". $pollidcount; $output .= "<form action=\"$url\" method=\"post\">"; $output .= "<table border=\"0\" align=\"center\"><tr><td>"; @@ -225,9 +224,9 @@ function poll_view(&$node, $main = 0, $block = 0) { } } if ($block) { - $output .= "</td></tr><tr><td><div align=\"center\">" . form_submit(t("Vote")) . "</div></td></tr></table>"; + $output .= "</td></tr><tr><td><div align=\"center\">". form_submit(t("Vote")) ."</div></td></tr></table>"; } else { - $output .= "</td><td valign=\"middle\"><div align=\"right\"> " . form_submit(t("Vote")) . "</div></td></tr></table>"; + $output .= "</td><td valign=\"middle\"><div align=\"right\"> ". form_submit(t("Vote")) ."</div></td></tr></table>"; } $output .= "</form>"; } @@ -243,8 +242,8 @@ function poll_view(&$node, $main = 0, $block = 0) { // Define CSS classes for the bars $output .= "<style type=\"text/css\">"; - $output .= "td.pollfg { background-color: " . $theme->foreground . "; font-size: 5pt; }"; - $output .= "td.pollbg { background-color: " . $theme->background . "; font-size: 5pt; }"; + $output .= "td.pollfg { background-color: ". $theme->foreground ."; font-size: 5pt; }"; + $output .= "td.pollbg { background-color: ". $theme->background ."; font-size: 5pt; }"; $output .= "</style>"; foreach ($node->choice as $key => $value) { @@ -252,7 +251,7 @@ function poll_view(&$node, $main = 0, $block = 0) { $width = round($node->chvotes[$key] * 100 / $votesmax); $percentage = round($node->chvotes[$key] * 100 / max($votestotal, 1)); - $output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\"><tr><td>$value</td><td><div align=\"right\"> $percentage%" . (!$block ? " (" . $node->chvotes[$key] . " votes)" : "") . "</div></td></tr></table>"; + $output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\"><tr><td>$value</td><td><div align=\"right\"> $percentage%". (!$block ? " (". $node->chvotes[$key] ." votes)" : "") ."</div></td></tr></table>"; if ($width == 0) { $output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\"><tr><td class=\"pollbg\" width=\"100%\"> </td></tr></table>"; } @@ -260,11 +259,11 @@ function poll_view(&$node, $main = 0, $block = 0) { $output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\"><tr><td class=\"pollfg\" width=\"100%\"> </td></tr></table>"; } else { - $output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\"><tr><td class=\"pollfg\" width=\"" . $width . "%\"> </td><td class=\"pollbg\" width=\"" . (100 - $width) . "%\"> </td></tr></table>"; + $output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"95%\" align=\"center\"><tr><td class=\"pollfg\" width=\"". $width ."%\"> </td><td class=\"pollbg\" width=\"". (100 - $width) ."%\"> </td></tr></table>"; } } } - $output .= "<br><div align=\"center\">Total votes: " . $votestotal . "</div>"; + $output .= "<br /><div align=\"center\">Total votes: ". $votestotal ."</div>"; } // Force the output on both the mainpage and elsewhere $node->body = $output; diff --git a/modules/queue.module b/modules/queue.module index 00de652d3..a37cf49dd 100644 --- a/modules/queue.module +++ b/modules/queue.module @@ -9,8 +9,8 @@ function queue_conf_options() { $output .= form_select(t("Post threshold"), "queue_threshold_post", variable_get("queue_threshold_post", 4), $threshold_post, t("If new submissions are subject to moderation, select a post threshold.")); $output .= form_select(t("Dump threshold"), "queue_threshold_dump", variable_get("queue_threshold_dump", -2), $threshold_dump, t("If new submissions are subject to moderation, select a dump threshold.")); - $output .= form_select(t("Expiration threshold"),"queue_threshold_expire", variable_get("queue_threshold_expire", 8), $threshold_expire, t("If new submissions are subject to moderation, select an expiration threshold.")); - $output .= form_select(t("Show comments"),"queue_show_comments", variable_get("queue_show_comments", 1), array(0 => "Disabled", 1 => "Enabled"), t("If enabled comments will be shown below the moderation form.")); + $output .= form_select(t("Expiration threshold"), "queue_threshold_expire", variable_get("queue_threshold_expire", 8), $threshold_expire, t("If new submissions are subject to moderation, select an expiration threshold.")); + $output .= form_select(t("Show comments"), "queue_show_comments", variable_get("queue_show_comments", 1), array(0 => "Disabled", 1 => "Enabled"), t("If enabled comments will be shown below the moderation form.")); return $output; } @@ -21,7 +21,7 @@ function queue_perm() { function queue_link($type) { if ($type == "menu.view" && user_access("access submission queue")) { - $links[] = la(t("view submissions"), array("mod" => "queue"), t("Moderate the content in the submission queue."))." (<span style=\"color: red;\">". queue_count() ."</span>)"; + $links[] = lm(t("view submissions"), array("mod" => "queue"), t("Moderate the content in the submission queue.")) ." (<span style=\"color: red;\">". queue_count() ."</span>)"; } return $links ? $links : array(); @@ -84,10 +84,10 @@ function queue_overview() { $output .= " <tr><th>". t("Subject") ."</th><th>". t("Author") ."</th><th>". t("Type") ."</th><th>". t("Score") ."</th></tr>"; while ($node = db_fetch_object($result)) { if ($user->uid == $node->uid || field_get($node->users, $user->uid)) { - $output .= " <tr><td>".la(check_output($node->title), array("mod" => "queue", "op" => "view", "id" => $node->nid))."</td><td align=\"center\">". format_name($node) ."</td><td align=\"center\">". module_invoke($node->type, "node", "name") ."</td><td align=\"center\">". queue_score($node->nid) ."</td></tr>"; + $output .= " <tr><td>". la(check_output($node->title), array("mod" => "queue", "op" => "view", "id" => $node->nid)) ."</td><td align=\"center\">". format_name($node) ."</td><td align=\"center\">". module_invoke($node->type, "node", "name") ."</td><td align=\"center\">". queue_score($node->nid) ."</td></tr>"; } else { - $output .= " <tr><td>".lm(check_output($node->title), array("mod" => "queue", "op" => "view", "id" => $node->nid))."</td><td align=\"center\">". format_name($node) ."</td><td align=\"center\">". module_invoke($node->type, "node", "name") ."</td><td align=\"center\">".lm(t("vote"), array("mod" => "queue", "op" => "view", "id" => $node->nid))."</td></tr>"; + $output .= " <tr><td>". lm(check_output($node->title), array("mod" => "queue", "op" => "view", "id" => $node->nid)) ."</td><td align=\"center\">". format_name($node) ."</td><td align=\"center\">". module_invoke($node->type, "node", "name") ."</td><td align=\"center\">". lm(t("vote"), array("mod" => "queue", "op" => "view", "id" => $node->nid)) ."</td></tr>"; } if ($node->teaser) { diff --git a/modules/statistics.module b/modules/statistics.module index 3c7753f22..a0bb70439 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -92,7 +92,7 @@ function statistics_admin() { if (user_access("administer statistics")) { - print "<small>".la(t("internal referrers"), array("mod" => "statistics", "type" => "internal+referrer"))." | ".la(t("external referrers"), array("mod" => "statistics", "type" => "external+referrer"))." | ".la(t("help"), array("mod" => "statistics", "op" => "help"))."</small><hr />\n"; + print "<small>". la(t("internal referrers"), array("mod" => "statistics", "type" => "internal+referrer")) ." | ". la(t("external referrers"), array("mod" => "statistics", "type" => "external+referrer")) ." | ". la(t("help"), array("mod" => "statistics", "op" => "help")) ."</small><hr />\n"; switch ($op) { case "help": diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 3c7753f22..a0bb70439 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -92,7 +92,7 @@ function statistics_admin() { if (user_access("administer statistics")) { - print "<small>".la(t("internal referrers"), array("mod" => "statistics", "type" => "internal+referrer"))." | ".la(t("external referrers"), array("mod" => "statistics", "type" => "external+referrer"))." | ".la(t("help"), array("mod" => "statistics", "op" => "help"))."</small><hr />\n"; + print "<small>". la(t("internal referrers"), array("mod" => "statistics", "type" => "internal+referrer")) ." | ". la(t("external referrers"), array("mod" => "statistics", "type" => "external+referrer")) ." | ". la(t("help"), array("mod" => "statistics", "op" => "help")) ."</small><hr />\n"; switch ($op) { case "help": diff --git a/modules/taxonomy.module b/modules/taxonomy.module index fdac7c715..ad0833203 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -9,24 +9,24 @@ else { if ($or) { foreach ((explode(",", $or)) as $t) { - $terms[] = "'".check_query($t)."'"; + $terms[] = "'". check_query($t) ."'"; } - $result = db_query("SELECT DISTINCT(n.nid), type FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND status = '1' ORDER BY static DESC, created DESC LIMIT 15"); + $result = db_query("SELECT DISTINCT(n.nid), type FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (". implode(",", $terms) .") AND status = '1' ORDER BY static DESC, created DESC LIMIT 15"); $term = taxonomy_get_term($or); } else if ($and) { foreach ((explode(",", $and)) as $t) { - $terms[] = "'".check_query($t)."'"; + $terms[] = "'". check_query($t) ."'"; } - $result = db_query("SELECT n.nid, type, count(*) AS c FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND status = '1' GROUP BY n.nid HAVING c = ".count($terms)." ORDER BY static DESC, created DESC LIMIT 15"); + $result = db_query("SELECT n.nid, type, count(*) AS c FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (". implode(",", $terms) .") AND status = '1' GROUP BY n.nid HAVING c = ". count($terms) ." ORDER BY static DESC, created DESC LIMIT 15"); $term = taxonomy_get_term($and); } else { return node_feed(); } - $channel["title"] = variable_get("site_name", "drupal") . " - " . $term->name; - $channel["link"] = path_uri() . "index.php?or=$or"; + $channel["title"] = variable_get("site_name", "drupal") ." - ". $term->name; + $channel["link"] = path_uri() ."index.php?or=$or"; $channel["description"] = $term->description; node_feed($result, $channel); @@ -56,43 +56,35 @@ } } - $form .= form_textfield("Vocabulary name", "name", $edit[name], 50, 64, "Required. The name for this vocabulary. Example: 'Topic'."); - $form .= form_textarea("Description", "description", $edit[description], 60, 5, "Optional. Description of the vocabulary, can be used by modules."); - $form .= form_select("Types", "types", explode(",", $edit[types]), $nodetypes, "Required. A list of node types you want to associate this vocabulary with.", "", 1); - $form .= form_checkbox("Related terms", "relations", 1, $edit[relations], "Optional. Allows ".la("related terms", array("mod" => "taxonomy", "op" => "help#relatedterms"))." in this vocabulary."); - $form .= form_select("Hierarchy", "hierarchy", $edit[hierarchy], array("Disabled", "Single", "Multiple"), "Optional. Allows ".la("a tree-like hierarchy", array("mod" => "taxonomy", "op" => "help#hierarchy"))." between terms of this vocabulary.", "", 0); - $form .= form_checkbox("Multiple select", "multiple", 1, $edit[multiple], "Optional. Allows nodes to have more than one term in this vocabulary."); - $form .= form_checkbox("Required", "required", 1, $edit[required], "If enabled every node <b>must</b> have at least one term in this vocabulary"); + $form .= form_textfield("Vocabulary name", "name", $edit["name"], 50, 64, "Required. The name for this vocabulary. Example: 'Topic'."); + $form .= form_textarea("Description", "description", $edit["description"], 60, 5, "Optional. Description of the vocabulary, can be used by modules."); + $form .= form_select("Types", "types", explode(",", $edit["types"]), $nodetypes, "Required. A list of node types you want to associate this vocabulary with.", "", 1); + $form .= form_checkbox("Related terms", "relations", 1, $edit["relations"], "Optional. Allows ". la("related terms", array("mod" => "taxonomy", "op" => "help#relatedterms")) ." in this vocabulary."); + $form .= form_select("Hierarchy", "hierarchy", $edit["hierarchy"], array("Disabled", "Single", "Multiple"), "Optional. Allows ". la("a tree-like hierarchy", array("mod" => "taxonomy", "op" => "help#hierarchy")) ." between terms of this vocabulary.", "", 0); + $form .= form_checkbox("Multiple select", "multiple", 1, $edit["multiple"], "Optional. Allows nodes to have more than one term in this vocabulary."); + $form .= form_checkbox("Required", "required", 1, $edit["required"], "If enabled every node <b>must</b> have at least one term in this vocabulary"); $form .= form_textfield("Weight", "weight", $edit["weight"], 3, 3, "Optional. In listings, the heavier vocabularies will sink and the lighter vocabularies will be positioned nearer the top."); $form .= form_submit("Submit"); - if ($edit[vid]) { + if ($edit["vid"]) { $form .= form_submit("Delete"); - $form .= form_hidden("vid", $edit[vid]); + $form .= form_hidden("vid", $edit["vid"]); } return form($form); } function taxonomy_save_vocabulary($edit) { - $data = array( - "name" => $edit["name"], - "types" => implode(",", $edit["types"]), - "description" => $edit["description"], - "multiple" => $edit["multiple"], - "required" => $edit["required"], - "hierarchy" => $edit["hierarchy"], - "relations" => $edit["relations"], - "weight" => $edit["weight"] - ); + $data = array("name" => $edit["name"], "types" => implode(",", $edit["types"]), "description" => $edit["description"], "multiple" => $edit["multiple"], "required" => $edit["required"], "hierarchy" => $edit["hierarchy"], "relations" => $edit["relations"], "weight" => $edit["weight"]); + if ($edit["vid"] && $edit["name"]) { - db_query("UPDATE vocabulary SET "._prepare_update($data)." WHERE vid = '". check_input($edit["vid"])."'"); + db_query("UPDATE vocabulary SET ". _prepare_update($data) ." WHERE vid = '". check_input($edit["vid"]) ."'"); } else if ($edit["vid"]) { taxonomy_del_vocabulary($edit["vid"]); } else { - db_query("INSERT INTO vocabulary "._prepare_insert($data, 1)." VALUES "._prepare_insert($data, 2)); + db_query("INSERT INTO vocabulary ". _prepare_insert($data, 1) ." VALUES ". _prepare_insert($data, 2)); } } @@ -125,13 +117,14 @@ $exclude = array_keys($children); $exclude[] = $edit["tid"]; if ($vocabulary->hierarchy == 1) { - $form .= _taxonomy_term_select("Parent", "parent", $parent, $vocabulary_id, "Required. ".la("Parent term", array("mod" => "taxonomy", "op" => "help#parent")).".", 0, "<root>", $exclude); - } elseif ($vocabulary->hierarchy == 2) { - $form .= _taxonomy_term_select("Parents", "parent", $parent, $vocabulary_id, "Required. ".la("Parent terms", array("mod" => "taxonomy", "op" => "help#parent")).".", 1, "<root>", $exclude); + $form .= _taxonomy_term_select("Parent", "parent", $parent, $vocabulary_id, "Required. ". la("Parent term", array("mod" => "taxonomy", "op" => "help#parent")) .".", 0, "<root>", $exclude); + } + elseif ($vocabulary->hierarchy == 2) { + $form .= _taxonomy_term_select("Parents", "parent", $parent, $vocabulary_id, "Required. ". la("Parent terms", array("mod" => "taxonomy", "op" => "help#parent")) .".", 1, "<root>", $exclude); } } - $form .= form_textarea("Synonyms", "synonyms", implode("\n", taxonomy_get_synonyms($edit["tid"])), 30, 5, "Optional. ".la("Synonyms", array("mod" => "taxonomy", "op" => "help#synonyms"))." of this term, one synonym per line."); + $form .= form_textarea("Synonyms", "synonyms", implode("\n", taxonomy_get_synonyms($edit["tid"])), 30, 5, "Optional. ". la("Synonyms", array("mod" => "taxonomy", "op" => "help#synonyms")) ." of this term, one synonym per line."); $form .= form_textfield("Weight", "weight", $edit["weight"], 3, 3, "Optional. In listings, the heavier terms will sink and the lighter terms will be positioned nearer the top."); $form .= form_hidden("vid", $vocabulary->vid); $form .= form_submit("Submit"); @@ -146,13 +139,9 @@ function taxonomy_save_term($edit) { if ($edit["tid"] && $edit["name"]) { - $data = array( - "name" => $edit["name"], - "description" => $edit["description"], - "weight" => $edit["weight"] - ); + $data = array("name" => $edit["name"], "description" => $edit["description"], "weight" => $edit["weight"]); - db_query("UPDATE term_data SET "._prepare_update($data)." WHERE tid = '%s'", $edit["tid"]); + db_query("UPDATE term_data SET ". _prepare_update($data) ." WHERE tid = '%s'", $edit["tid"]); } else if ($edit["tid"]) { taxonomy_del_term($edit["tid"]); @@ -163,14 +152,8 @@ // first term $edit["tid"] = 1; } - $data = array( - "tid" => $edit["tid"], - "name" => $edit["name"], - "description" => $edit["description"], - "vid" => $edit["vid"], - "weight" => $edit["weight"] - ); - db_query("INSERT INTO term_data "._prepare_insert($data, 1)." VALUES "._prepare_insert($data, 2)); + $data = array("tid" => $edit["tid"], "name" => $edit["name"], "description" => $edit["description"], "vid" => $edit["vid"], "weight" => $edit["weight"]); + db_query("INSERT INTO term_data ". _prepare_insert($data, 1) ." VALUES ". _prepare_insert($data, 2)); } // relations (seem very powerful, but I have to understand it completely) @@ -196,8 +179,9 @@ foreach ($edit["parent"] as $parent) { $sql[] = "('". check_query($edit["tid"]) ."', '". check_query($parent) ."')"; } - db_query("INSERT INTO term_hierarchy (tid, parent) VALUES ".implode(", ", $sql)); - } else { + db_query("INSERT INTO term_hierarchy (tid, parent) VALUES ". implode(", ", $sql)); + } + else { db_query("INSERT INTO term_hierarchy (tid, parent) VALUES ('%s', '%s')", $edit["tid"], $edit["parent"][0]); } @@ -233,14 +217,14 @@ $links[] = la(t("add term"), array("mod" => "taxonomy", "op" => "add", "type" => "leaf", "vocabulary_id" => $vocabulary->vid)); $links[] = la(t("preview form"), array("mod" => "taxonomy", "type" => "vocabulary", "op" => "preview", "id" => $vocabulary->vid)); - $output .= " <tr><td>". check_output($vocabulary->name) ."</td><td>". check_output($vocabulary->types) ."</td><td>".implode(" | ", $links)."</td></tr>\n"; + $output .= " <tr><td>". check_output($vocabulary->name) ."</td><td>". check_output($vocabulary->types) ."</td><td>". implode(" | ", $links) ."</td></tr>\n"; unset($tree); taxonomy_get_tree($vocabulary->vid, $tree); if ($tree) { $output .= "<tr><td colspan=\"3\"><table><tr><td>"; foreach ($tree as $term) { - $output .= "<tr><td>".la(_taxonomy_depth($term->depth).check_output($term->name), array("mod" => "taxonomy", "op" => "edit", "type" => "term", "id" => check_output($term->tid)))."</td></tr>"; + $output .= "<tr><td>". la(_taxonomy_depth($term->depth).check_output($term->name), array("mod" => "taxonomy", "op" => "edit", "type" => "term", "id" => check_output($term->tid))) ."</td></tr>"; } $output .= "</td></tr></table></td></tr>\n"; } @@ -255,14 +239,16 @@ if ($vocabulary->required) { $verb = "must"; $blank = 0; - } else { + } + else { $verb = "can"; $blank = "<none>"; } if ($vocabulary->multiple) { $description = "You $verb choose one or more terms for this node"; $multiple = 1; - } else { + } + else { $description = "You $verb choose one term for this node"; $multiple = 0; } @@ -277,7 +263,8 @@ function taxonomy_get_vocabularies($type = '', $key = "vid") { if ($type) { $result = db_query("SELECT * FROM vocabulary WHERE types LIKE '%%%s%%' ORDER BY weight, name", $type); - } else { + } + else { $result = db_query("SELECT * FROM vocabulary ORDER BY weight, name"); } $vocabularies = array(); @@ -292,10 +279,12 @@ if (!$node->taxonomy) { if ($node->nid) { $terms = array_keys(taxonomy_node_get_terms($node->nid)); - } else { + } + else { $terms = 0; } - } else { + } + else { $terms = $node->taxonomy; } @@ -343,9 +332,9 @@ if ($terms) { foreach ($terms as $t) { - $query[] = "('".check_query($nid)."', '".check_query($t)."')"; + $query[] = "('". check_query($nid) ."', '". check_query($t) ."')"; } - db_query("INSERT INTO term_node (nid, tid) VALUES ".implode(", ", $query)); + db_query("INSERT INTO term_node (nid, tid) VALUES ". implode(", ", $query)); } } @@ -375,7 +364,8 @@ $parents[$parent->$key] = $parent; } return $parents; - } else { + } + else { return array(); } } @@ -384,7 +374,8 @@ function taxonomy_get_children($tid, $vid = 0, $key = "tid") { if ($vid) { $result = db_query("SELECT t.* FROM term_hierarchy h, term_data t WHERE t.vid = '%s' AND h.tid = t.tid AND h.parent = '%s' ORDER BY weight, name", $vid, $tid); - } else { + } + else { $result = db_query("SELECT t.* FROM term_hierarchy h, term_data t WHERE h.tid = t.tid AND parent = '%s' ORDER BY weight", $tid); } $children = array(); @@ -418,7 +409,8 @@ taxonomy_get_tree($vocabulary_id, $tree, $child, $depth, $key); } } - } else { + } + else { return 0; } } @@ -431,7 +423,8 @@ $synonyms[] = $synonym["name"]; } return $synonyms ? $synonyms : array(); - } else { + } + else { return array(); } } @@ -512,12 +505,12 @@ // min 8, possibly options/3 (set max too?) $size = max(8, round(count($options)) / 3); - return form_item($title, "<select name=\"edit[$name][]\"" .($multiple ? " multiple size=\"$size\"" : "").($extra ? " $extra" : "") .">$select</select>", $description); + return form_item($title, "<select name=\"edit[$name][]\"". ($multiple ? " multiple size=\"$size\"" : "") . ($extra ? " $extra" : "") .">$select</select>", $description); } } function _taxonomy_depth($depth, $graphic = '--') { - for ($n=0; $n<$depth; $n++) { + for ($n = 0; $n < $depth; $n++) { $result .= $graphic; } return $result; @@ -534,7 +527,8 @@ function _prepare_insert($data, $stage) { if ($stage == 1) { $result = implode(", ", array_keys($data)); - } else { + } + else { foreach (array_values($data) as $value) { $q[] = "'". check_query($value) ."'"; } @@ -567,7 +561,7 @@ $links[] = la(t("overview"), array("mod" => "taxonomy")); $links[] = la(t("help"), array("mod" => "taxonomy", "op" => "help")); - print "<small>".implode(" | ", $links)."</small><hr>\n"; + print "<small>". implode(" | ", $links) ."</small><hr>\n"; switch ($op) { case "add": @@ -589,7 +583,7 @@ print taxonomy_help(); break; case "Delete": - $edit[name] = 0; + $edit["name"] = 0; // fall through: case "Submit": if ($type == "vocabulary") @@ -620,17 +614,17 @@ types</a> and insight into the development of <i>taxonomy.module</i>, see this <a href="http://www.drupal.org/node.php?id=55">drupal.org discussion</a>.<br /> <h3>An Example Taxonomy - Foods</h3> - <p>Dairy <br> - --Milk <br> - Drink <br> - --Alchohol <br> - --Pop <br> - --Milk<br> - Meat <br> - --Beef <br> - --Chicken <br> - --Lamb <br> - Spices <br> + <p>Dairy <br /> + --Milk <br /> + Drink <br /> + --Alchohol <br /> + --Pop <br /> + --Milk<br /> + Meat <br /> + --Beef <br /> + --Chicken <br /> + --Lamb <br /> + Spices <br /> --Sugar</p> <p><b>Notes</b></p> <ul> diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index fdac7c715..ad0833203 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -9,24 +9,24 @@ else { if ($or) { foreach ((explode(",", $or)) as $t) { - $terms[] = "'".check_query($t)."'"; + $terms[] = "'". check_query($t) ."'"; } - $result = db_query("SELECT DISTINCT(n.nid), type FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND status = '1' ORDER BY static DESC, created DESC LIMIT 15"); + $result = db_query("SELECT DISTINCT(n.nid), type FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (". implode(",", $terms) .") AND status = '1' ORDER BY static DESC, created DESC LIMIT 15"); $term = taxonomy_get_term($or); } else if ($and) { foreach ((explode(",", $and)) as $t) { - $terms[] = "'".check_query($t)."'"; + $terms[] = "'". check_query($t) ."'"; } - $result = db_query("SELECT n.nid, type, count(*) AS c FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND status = '1' GROUP BY n.nid HAVING c = ".count($terms)." ORDER BY static DESC, created DESC LIMIT 15"); + $result = db_query("SELECT n.nid, type, count(*) AS c FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (". implode(",", $terms) .") AND status = '1' GROUP BY n.nid HAVING c = ". count($terms) ." ORDER BY static DESC, created DESC LIMIT 15"); $term = taxonomy_get_term($and); } else { return node_feed(); } - $channel["title"] = variable_get("site_name", "drupal") . " - " . $term->name; - $channel["link"] = path_uri() . "index.php?or=$or"; + $channel["title"] = variable_get("site_name", "drupal") ." - ". $term->name; + $channel["link"] = path_uri() ."index.php?or=$or"; $channel["description"] = $term->description; node_feed($result, $channel); @@ -56,43 +56,35 @@ } } - $form .= form_textfield("Vocabulary name", "name", $edit[name], 50, 64, "Required. The name for this vocabulary. Example: 'Topic'."); - $form .= form_textarea("Description", "description", $edit[description], 60, 5, "Optional. Description of the vocabulary, can be used by modules."); - $form .= form_select("Types", "types", explode(",", $edit[types]), $nodetypes, "Required. A list of node types you want to associate this vocabulary with.", "", 1); - $form .= form_checkbox("Related terms", "relations", 1, $edit[relations], "Optional. Allows ".la("related terms", array("mod" => "taxonomy", "op" => "help#relatedterms"))." in this vocabulary."); - $form .= form_select("Hierarchy", "hierarchy", $edit[hierarchy], array("Disabled", "Single", "Multiple"), "Optional. Allows ".la("a tree-like hierarchy", array("mod" => "taxonomy", "op" => "help#hierarchy"))." between terms of this vocabulary.", "", 0); - $form .= form_checkbox("Multiple select", "multiple", 1, $edit[multiple], "Optional. Allows nodes to have more than one term in this vocabulary."); - $form .= form_checkbox("Required", "required", 1, $edit[required], "If enabled every node <b>must</b> have at least one term in this vocabulary"); + $form .= form_textfield("Vocabulary name", "name", $edit["name"], 50, 64, "Required. The name for this vocabulary. Example: 'Topic'."); + $form .= form_textarea("Description", "description", $edit["description"], 60, 5, "Optional. Description of the vocabulary, can be used by modules."); + $form .= form_select("Types", "types", explode(",", $edit["types"]), $nodetypes, "Required. A list of node types you want to associate this vocabulary with.", "", 1); + $form .= form_checkbox("Related terms", "relations", 1, $edit["relations"], "Optional. Allows ". la("related terms", array("mod" => "taxonomy", "op" => "help#relatedterms")) ." in this vocabulary."); + $form .= form_select("Hierarchy", "hierarchy", $edit["hierarchy"], array("Disabled", "Single", "Multiple"), "Optional. Allows ". la("a tree-like hierarchy", array("mod" => "taxonomy", "op" => "help#hierarchy")) ." between terms of this vocabulary.", "", 0); + $form .= form_checkbox("Multiple select", "multiple", 1, $edit["multiple"], "Optional. Allows nodes to have more than one term in this vocabulary."); + $form .= form_checkbox("Required", "required", 1, $edit["required"], "If enabled every node <b>must</b> have at least one term in this vocabulary"); $form .= form_textfield("Weight", "weight", $edit["weight"], 3, 3, "Optional. In listings, the heavier vocabularies will sink and the lighter vocabularies will be positioned nearer the top."); $form .= form_submit("Submit"); - if ($edit[vid]) { + if ($edit["vid"]) { $form .= form_submit("Delete"); - $form .= form_hidden("vid", $edit[vid]); + $form .= form_hidden("vid", $edit["vid"]); } return form($form); } function taxonomy_save_vocabulary($edit) { - $data = array( - "name" => $edit["name"], - "types" => implode(",", $edit["types"]), - "description" => $edit["description"], - "multiple" => $edit["multiple"], - "required" => $edit["required"], - "hierarchy" => $edit["hierarchy"], - "relations" => $edit["relations"], - "weight" => $edit["weight"] - ); + $data = array("name" => $edit["name"], "types" => implode(",", $edit["types"]), "description" => $edit["description"], "multiple" => $edit["multiple"], "required" => $edit["required"], "hierarchy" => $edit["hierarchy"], "relations" => $edit["relations"], "weight" => $edit["weight"]); + if ($edit["vid"] && $edit["name"]) { - db_query("UPDATE vocabulary SET "._prepare_update($data)." WHERE vid = '". check_input($edit["vid"])."'"); + db_query("UPDATE vocabulary SET ". _prepare_update($data) ." WHERE vid = '". check_input($edit["vid"]) ."'"); } else if ($edit["vid"]) { taxonomy_del_vocabulary($edit["vid"]); } else { - db_query("INSERT INTO vocabulary "._prepare_insert($data, 1)." VALUES "._prepare_insert($data, 2)); + db_query("INSERT INTO vocabulary ". _prepare_insert($data, 1) ." VALUES ". _prepare_insert($data, 2)); } } @@ -125,13 +117,14 @@ $exclude = array_keys($children); $exclude[] = $edit["tid"]; if ($vocabulary->hierarchy == 1) { - $form .= _taxonomy_term_select("Parent", "parent", $parent, $vocabulary_id, "Required. ".la("Parent term", array("mod" => "taxonomy", "op" => "help#parent")).".", 0, "<root>", $exclude); - } elseif ($vocabulary->hierarchy == 2) { - $form .= _taxonomy_term_select("Parents", "parent", $parent, $vocabulary_id, "Required. ".la("Parent terms", array("mod" => "taxonomy", "op" => "help#parent")).".", 1, "<root>", $exclude); + $form .= _taxonomy_term_select("Parent", "parent", $parent, $vocabulary_id, "Required. ". la("Parent term", array("mod" => "taxonomy", "op" => "help#parent")) .".", 0, "<root>", $exclude); + } + elseif ($vocabulary->hierarchy == 2) { + $form .= _taxonomy_term_select("Parents", "parent", $parent, $vocabulary_id, "Required. ". la("Parent terms", array("mod" => "taxonomy", "op" => "help#parent")) .".", 1, "<root>", $exclude); } } - $form .= form_textarea("Synonyms", "synonyms", implode("\n", taxonomy_get_synonyms($edit["tid"])), 30, 5, "Optional. ".la("Synonyms", array("mod" => "taxonomy", "op" => "help#synonyms"))." of this term, one synonym per line."); + $form .= form_textarea("Synonyms", "synonyms", implode("\n", taxonomy_get_synonyms($edit["tid"])), 30, 5, "Optional. ". la("Synonyms", array("mod" => "taxonomy", "op" => "help#synonyms")) ." of this term, one synonym per line."); $form .= form_textfield("Weight", "weight", $edit["weight"], 3, 3, "Optional. In listings, the heavier terms will sink and the lighter terms will be positioned nearer the top."); $form .= form_hidden("vid", $vocabulary->vid); $form .= form_submit("Submit"); @@ -146,13 +139,9 @@ function taxonomy_save_term($edit) { if ($edit["tid"] && $edit["name"]) { - $data = array( - "name" => $edit["name"], - "description" => $edit["description"], - "weight" => $edit["weight"] - ); + $data = array("name" => $edit["name"], "description" => $edit["description"], "weight" => $edit["weight"]); - db_query("UPDATE term_data SET "._prepare_update($data)." WHERE tid = '%s'", $edit["tid"]); + db_query("UPDATE term_data SET ". _prepare_update($data) ." WHERE tid = '%s'", $edit["tid"]); } else if ($edit["tid"]) { taxonomy_del_term($edit["tid"]); @@ -163,14 +152,8 @@ // first term $edit["tid"] = 1; } - $data = array( - "tid" => $edit["tid"], - "name" => $edit["name"], - "description" => $edit["description"], - "vid" => $edit["vid"], - "weight" => $edit["weight"] - ); - db_query("INSERT INTO term_data "._prepare_insert($data, 1)." VALUES "._prepare_insert($data, 2)); + $data = array("tid" => $edit["tid"], "name" => $edit["name"], "description" => $edit["description"], "vid" => $edit["vid"], "weight" => $edit["weight"]); + db_query("INSERT INTO term_data ". _prepare_insert($data, 1) ." VALUES ". _prepare_insert($data, 2)); } // relations (seem very powerful, but I have to understand it completely) @@ -196,8 +179,9 @@ foreach ($edit["parent"] as $parent) { $sql[] = "('". check_query($edit["tid"]) ."', '". check_query($parent) ."')"; } - db_query("INSERT INTO term_hierarchy (tid, parent) VALUES ".implode(", ", $sql)); - } else { + db_query("INSERT INTO term_hierarchy (tid, parent) VALUES ". implode(", ", $sql)); + } + else { db_query("INSERT INTO term_hierarchy (tid, parent) VALUES ('%s', '%s')", $edit["tid"], $edit["parent"][0]); } @@ -233,14 +217,14 @@ $links[] = la(t("add term"), array("mod" => "taxonomy", "op" => "add", "type" => "leaf", "vocabulary_id" => $vocabulary->vid)); $links[] = la(t("preview form"), array("mod" => "taxonomy", "type" => "vocabulary", "op" => "preview", "id" => $vocabulary->vid)); - $output .= " <tr><td>". check_output($vocabulary->name) ."</td><td>". check_output($vocabulary->types) ."</td><td>".implode(" | ", $links)."</td></tr>\n"; + $output .= " <tr><td>". check_output($vocabulary->name) ."</td><td>". check_output($vocabulary->types) ."</td><td>". implode(" | ", $links) ."</td></tr>\n"; unset($tree); taxonomy_get_tree($vocabulary->vid, $tree); if ($tree) { $output .= "<tr><td colspan=\"3\"><table><tr><td>"; foreach ($tree as $term) { - $output .= "<tr><td>".la(_taxonomy_depth($term->depth).check_output($term->name), array("mod" => "taxonomy", "op" => "edit", "type" => "term", "id" => check_output($term->tid)))."</td></tr>"; + $output .= "<tr><td>". la(_taxonomy_depth($term->depth).check_output($term->name), array("mod" => "taxonomy", "op" => "edit", "type" => "term", "id" => check_output($term->tid))) ."</td></tr>"; } $output .= "</td></tr></table></td></tr>\n"; } @@ -255,14 +239,16 @@ if ($vocabulary->required) { $verb = "must"; $blank = 0; - } else { + } + else { $verb = "can"; $blank = "<none>"; } if ($vocabulary->multiple) { $description = "You $verb choose one or more terms for this node"; $multiple = 1; - } else { + } + else { $description = "You $verb choose one term for this node"; $multiple = 0; } @@ -277,7 +263,8 @@ function taxonomy_get_vocabularies($type = '', $key = "vid") { if ($type) { $result = db_query("SELECT * FROM vocabulary WHERE types LIKE '%%%s%%' ORDER BY weight, name", $type); - } else { + } + else { $result = db_query("SELECT * FROM vocabulary ORDER BY weight, name"); } $vocabularies = array(); @@ -292,10 +279,12 @@ if (!$node->taxonomy) { if ($node->nid) { $terms = array_keys(taxonomy_node_get_terms($node->nid)); - } else { + } + else { $terms = 0; } - } else { + } + else { $terms = $node->taxonomy; } @@ -343,9 +332,9 @@ if ($terms) { foreach ($terms as $t) { - $query[] = "('".check_query($nid)."', '".check_query($t)."')"; + $query[] = "('". check_query($nid) ."', '". check_query($t) ."')"; } - db_query("INSERT INTO term_node (nid, tid) VALUES ".implode(", ", $query)); + db_query("INSERT INTO term_node (nid, tid) VALUES ". implode(", ", $query)); } } @@ -375,7 +364,8 @@ $parents[$parent->$key] = $parent; } return $parents; - } else { + } + else { return array(); } } @@ -384,7 +374,8 @@ function taxonomy_get_children($tid, $vid = 0, $key = "tid") { if ($vid) { $result = db_query("SELECT t.* FROM term_hierarchy h, term_data t WHERE t.vid = '%s' AND h.tid = t.tid AND h.parent = '%s' ORDER BY weight, name", $vid, $tid); - } else { + } + else { $result = db_query("SELECT t.* FROM term_hierarchy h, term_data t WHERE h.tid = t.tid AND parent = '%s' ORDER BY weight", $tid); } $children = array(); @@ -418,7 +409,8 @@ taxonomy_get_tree($vocabulary_id, $tree, $child, $depth, $key); } } - } else { + } + else { return 0; } } @@ -431,7 +423,8 @@ $synonyms[] = $synonym["name"]; } return $synonyms ? $synonyms : array(); - } else { + } + else { return array(); } } @@ -512,12 +505,12 @@ // min 8, possibly options/3 (set max too?) $size = max(8, round(count($options)) / 3); - return form_item($title, "<select name=\"edit[$name][]\"" .($multiple ? " multiple size=\"$size\"" : "").($extra ? " $extra" : "") .">$select</select>", $description); + return form_item($title, "<select name=\"edit[$name][]\"". ($multiple ? " multiple size=\"$size\"" : "") . ($extra ? " $extra" : "") .">$select</select>", $description); } } function _taxonomy_depth($depth, $graphic = '--') { - for ($n=0; $n<$depth; $n++) { + for ($n = 0; $n < $depth; $n++) { $result .= $graphic; } return $result; @@ -534,7 +527,8 @@ function _prepare_insert($data, $stage) { if ($stage == 1) { $result = implode(", ", array_keys($data)); - } else { + } + else { foreach (array_values($data) as $value) { $q[] = "'". check_query($value) ."'"; } @@ -567,7 +561,7 @@ $links[] = la(t("overview"), array("mod" => "taxonomy")); $links[] = la(t("help"), array("mod" => "taxonomy", "op" => "help")); - print "<small>".implode(" | ", $links)."</small><hr>\n"; + print "<small>". implode(" | ", $links) ."</small><hr>\n"; switch ($op) { case "add": @@ -589,7 +583,7 @@ print taxonomy_help(); break; case "Delete": - $edit[name] = 0; + $edit["name"] = 0; // fall through: case "Submit": if ($type == "vocabulary") @@ -620,17 +614,17 @@ types</a> and insight into the development of <i>taxonomy.module</i>, see this <a href="http://www.drupal.org/node.php?id=55">drupal.org discussion</a>.<br /> <h3>An Example Taxonomy - Foods</h3> - <p>Dairy <br> - --Milk <br> - Drink <br> - --Alchohol <br> - --Pop <br> - --Milk<br> - Meat <br> - --Beef <br> - --Chicken <br> - --Lamb <br> - Spices <br> + <p>Dairy <br /> + --Milk <br /> + Drink <br /> + --Alchohol <br /> + --Pop <br /> + --Milk<br /> + Meat <br /> + --Beef <br /> + --Chicken <br /> + --Lamb <br /> + Spices <br /> --Sugar</p> <p><b>Notes</b></p> <ul> diff --git a/modules/tracker.module b/modules/tracker.module index 6af261647..2ddc4440c 100644 --- a/modules/tracker.module +++ b/modules/tracker.module @@ -28,18 +28,18 @@ function tracker_comments($id = 0) { } while ($node = db_fetch_object($sresult)) { - $output .= format_plural($node->comments, "comment", "comments") ." ". t("attached to node") ." ".l(check_output($node->title), array("id" => $node->nid)).":\n"; + $output .= format_plural($node->comments, "comment", "comments") ." ". t("attached to node") ." ". l(check_output($node->title), array("id" => $node->nid)) .":\n"; if ($id) { - $cresult = db_query("SELECT * FROM comments WHERE timestamp > $period AND uid = '%s' AND nid = '$node->nid' ORDER BY cid DESC", $id); + $cresult = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.timestamp > $period AND c.uid = '%d' AND c.nid = '%d' ORDER BY cid DESC", $id, $node->nid); } else { - $cresult = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.timestamp > $period AND c.nid = '$node->nid' ORDER BY c.cid DESC"); + $cresult = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.timestamp > $period AND c.nid = '%d' ORDER BY cid DESC", $node->nid); } $output .= "<ul>"; while ($comment = db_fetch_object($cresult)) { - $output .= " <li>".l(check_output($comment->subject), array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid."#".$comment->cid))." by ".lm(check_output($comment->name), array("mod" => "user", "op" => "view", "id" => $comment->uid))." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n"; + $output .= " <li>". l(check_output($comment->subject), array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid ."#". $comment->cid)) ." by ". lm(check_output($comment->name), array("mod" => "user", "op" => "view", "id" => $comment->uid)) ." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n"; } $output .= " </ul>\n"; } diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 6af261647..2ddc4440c 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -28,18 +28,18 @@ function tracker_comments($id = 0) { } while ($node = db_fetch_object($sresult)) { - $output .= format_plural($node->comments, "comment", "comments") ." ". t("attached to node") ." ".l(check_output($node->title), array("id" => $node->nid)).":\n"; + $output .= format_plural($node->comments, "comment", "comments") ." ". t("attached to node") ." ". l(check_output($node->title), array("id" => $node->nid)) .":\n"; if ($id) { - $cresult = db_query("SELECT * FROM comments WHERE timestamp > $period AND uid = '%s' AND nid = '$node->nid' ORDER BY cid DESC", $id); + $cresult = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.timestamp > $period AND c.uid = '%d' AND c.nid = '%d' ORDER BY cid DESC", $id, $node->nid); } else { - $cresult = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.timestamp > $period AND c.nid = '$node->nid' ORDER BY c.cid DESC"); + $cresult = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.timestamp > $period AND c.nid = '%d' ORDER BY cid DESC", $node->nid); } $output .= "<ul>"; while ($comment = db_fetch_object($cresult)) { - $output .= " <li>".l(check_output($comment->subject), array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid."#".$comment->cid))." by ".lm(check_output($comment->name), array("mod" => "user", "op" => "view", "id" => $comment->uid))." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n"; + $output .= " <li>". l(check_output($comment->subject), array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid ."#". $comment->cid)) ." by ". lm(check_output($comment->name), array("mod" => "user", "op" => "view", "id" => $comment->uid)) ." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n"; } $output .= " </ul>\n"; } diff --git a/modules/user.module b/modules/user.module index 1169898c8..2f202c3b8 100644 --- a/modules/user.module +++ b/modules/user.module @@ -459,7 +459,7 @@ function user_block() { // Display account settings: $block[0]["subject"] = $user->name; - $output .= "<div style=\"{ width: 155; }\">\n"; + $output = "<div style=\"{ width: 155; }\">\n"; $links = array_merge(module_invoke_all("link", "menu.create"), array(""), module_invoke_all("link", "menu.view"), array(""), module_invoke_all("link", "menu.settings"), array(""), module_invoke_all("link", "menu.misc")); $output .= @implode("<br />\n", $links); @@ -470,18 +470,17 @@ function user_block() { else { $block[1]["subject"] = t("Log in"); - $output .= "<div align=\"center\">\n"; + $output = "<div align=\"center\">\n"; $output .= "<form action=\"".drupal_url(array("mod" => "user", "op" => "login"), "module")."\" method=\"post\">\n"; $output .= "<b>". t("Username") .":</b><br /><input name=\"edit[name]\" size=\"15\" /><br />\n"; $output .= "<b>". t("Password") .":</b><br /><input name=\"edit[pass]\" size=\"15\" type=\"password\" /><br />\n"; - $output .= "<input name=\"edit[remember_me]\" type=\"checkbox\" />". t("Remember me") ."<br />\n"; + $output .= "<input name=\"edit[remember_me]\" type=\"checkbox\" />". t("Remember me") ."<br />\n"; $output .= "<input type=\"submit\" value=\"". t("Log in") ."\" /><br />\n"; - $output .= "</div>\n"; + $output .= "</form></div>\n"; if (variable_get("account_register", 1)) { $output .= "» ".lm(t("Register"), array("mod" => "user", "op" => "register"), t("Create a new user account."))."\n"; } - $output .= "<br \>» ".lm(t("New password"), array("mod" => "user", "op" => "password"), t("Request new password via e-mail"))."</a><br />"; - $output .= "</form>\n"; + $output .= "<br \>» ".lm(t("New password"), array("mod" => "user", "op" => "password"), t("Request new password via e-mail"))."<br />"; $block[1]["content"] = $output; } @@ -940,7 +939,7 @@ function user_register($edit = array()) { //the first user may login immediately, and receives a customized welcome email. if ($user->uid == 1) { - user_mail($edit["mail"], t("drupal user account details for %s", array("%s" => $edit["name"])), t("%username,\n\nYou may now login to %uri using the following username and password:\n\n username: %username\n password: %password\n\nAfter logging in, you may wish to visit the following pages:\n\nAdministration: %uriadmin.php\nEdit user account: %uri".drupal_url(array("mod" => "user", "op" => "edit"), "module")."\n\n--drupal"), $variables, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + user_mail($edit["mail"], t("drupal user account details for %s", array("%s" => $edit["name"])), strtr(t("%username,\n\nYou may now login to %uri using the following username and password:\n\n username: %username\n password: %password\n\nAfter logging in, you may wish to visit the following pages:\n\nAdministration: %uriadmin.php\nEdit user account: %uri". drupal_url(array("mod" => "user", "op" => "edit"), "module") ."\n\n--drupal"), $variables), "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); // This should not be t()'ed. No point as its only shown once in the sites lifetime, and it would be bad to store the password $output .= "<p>Welcome to Drupal. You are user #1, which gives you full and immediate access. All future registrants will receive their passwords via email, so please configure your email settings using the Administration pages.</p><p> Your password is <b>$pass</b>. You may change your password on the next page.</p><p>Please login below.</p>"; $output .= form_hidden("name", $user->name); @@ -1179,6 +1178,7 @@ function user_page() { case t("Save user information"): case "edit": $output = user_edit($edit); + $theme = theme_init(); $theme->header(); $theme->box(t("User account"), user_menu()); $theme->box(t("Edit user information"), $output); diff --git a/modules/user/user.module b/modules/user/user.module index 1169898c8..2f202c3b8 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -459,7 +459,7 @@ function user_block() { // Display account settings: $block[0]["subject"] = $user->name; - $output .= "<div style=\"{ width: 155; }\">\n"; + $output = "<div style=\"{ width: 155; }\">\n"; $links = array_merge(module_invoke_all("link", "menu.create"), array(""), module_invoke_all("link", "menu.view"), array(""), module_invoke_all("link", "menu.settings"), array(""), module_invoke_all("link", "menu.misc")); $output .= @implode("<br />\n", $links); @@ -470,18 +470,17 @@ function user_block() { else { $block[1]["subject"] = t("Log in"); - $output .= "<div align=\"center\">\n"; + $output = "<div align=\"center\">\n"; $output .= "<form action=\"".drupal_url(array("mod" => "user", "op" => "login"), "module")."\" method=\"post\">\n"; $output .= "<b>". t("Username") .":</b><br /><input name=\"edit[name]\" size=\"15\" /><br />\n"; $output .= "<b>". t("Password") .":</b><br /><input name=\"edit[pass]\" size=\"15\" type=\"password\" /><br />\n"; - $output .= "<input name=\"edit[remember_me]\" type=\"checkbox\" />". t("Remember me") ."<br />\n"; + $output .= "<input name=\"edit[remember_me]\" type=\"checkbox\" />". t("Remember me") ."<br />\n"; $output .= "<input type=\"submit\" value=\"". t("Log in") ."\" /><br />\n"; - $output .= "</div>\n"; + $output .= "</form></div>\n"; if (variable_get("account_register", 1)) { $output .= "» ".lm(t("Register"), array("mod" => "user", "op" => "register"), t("Create a new user account."))."\n"; } - $output .= "<br \>» ".lm(t("New password"), array("mod" => "user", "op" => "password"), t("Request new password via e-mail"))."</a><br />"; - $output .= "</form>\n"; + $output .= "<br \>» ".lm(t("New password"), array("mod" => "user", "op" => "password"), t("Request new password via e-mail"))."<br />"; $block[1]["content"] = $output; } @@ -940,7 +939,7 @@ function user_register($edit = array()) { //the first user may login immediately, and receives a customized welcome email. if ($user->uid == 1) { - user_mail($edit["mail"], t("drupal user account details for %s", array("%s" => $edit["name"])), t("%username,\n\nYou may now login to %uri using the following username and password:\n\n username: %username\n password: %password\n\nAfter logging in, you may wish to visit the following pages:\n\nAdministration: %uriadmin.php\nEdit user account: %uri".drupal_url(array("mod" => "user", "op" => "edit"), "module")."\n\n--drupal"), $variables, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); + user_mail($edit["mail"], t("drupal user account details for %s", array("%s" => $edit["name"])), strtr(t("%username,\n\nYou may now login to %uri using the following username and password:\n\n username: %username\n password: %password\n\nAfter logging in, you may wish to visit the following pages:\n\nAdministration: %uriadmin.php\nEdit user account: %uri". drupal_url(array("mod" => "user", "op" => "edit"), "module") ."\n\n--drupal"), $variables), "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from"); // This should not be t()'ed. No point as its only shown once in the sites lifetime, and it would be bad to store the password $output .= "<p>Welcome to Drupal. You are user #1, which gives you full and immediate access. All future registrants will receive their passwords via email, so please configure your email settings using the Administration pages.</p><p> Your password is <b>$pass</b>. You may change your password on the next page.</p><p>Please login below.</p>"; $output .= form_hidden("name", $user->name); @@ -1179,6 +1178,7 @@ function user_page() { case t("Save user information"): case "edit": $output = user_edit($edit); + $theme = theme_init(); $theme->header(); $theme->box(t("User account"), user_menu()); $theme->box(t("Edit user information"), $output); diff --git a/modules/watchdog.module b/modules/watchdog.module index 4a3a67705..545dd32af 100644 --- a/modules/watchdog.module +++ b/modules/watchdog.module @@ -40,7 +40,7 @@ function watchdog_overview($type) { $output .= " <tr><th>date</th><th>message</th><th>user</th><th>operations</th></tr>"; while ($watchdog = db_fetch_object($result)) { if ($background = $color[$watchdog->type]) { - $output .= " <tr bgcolor=\"$background\"><td>". format_date($watchdog->timestamp, "small") ."</td><td>". substr(check_output($watchdog->message), 0, 64) ."</td><td align=\"center\">". format_name($watchdog) ."</a></td><td align=\"center\">".la(t("details"), array("mod" => "watchdog", "op" => "view", "id" => $watchdog->wid))."</td></tr>"; + $output .= " <tr bgcolor=\"$background\"><td>". format_date($watchdog->timestamp, "small") ."</td><td>". substr(check_output($watchdog->message), 0, 64) ."</td><td align=\"center\">". format_name($watchdog) ."</a></td><td align=\"center\">". la(t("details"), array("mod" => "watchdog", "op" => "view", "id" => $watchdog->wid)) ."</td></tr>"; } } $output .= "</table>"; @@ -79,7 +79,7 @@ function watchdog_admin() { $links[] = la(t("overview"), array("mod" => "watchdog")); $links[] = la(t("help"), array("mod" => "watchdog", "op" => "help")); - print "<small>".implode(" | ", $links)."</small><hr />"; + print "<small>". implode(" | ", $links) ."</small><hr />"; switch ($op) { case "help": diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module index 4a3a67705..545dd32af 100644 --- a/modules/watchdog/watchdog.module +++ b/modules/watchdog/watchdog.module @@ -40,7 +40,7 @@ function watchdog_overview($type) { $output .= " <tr><th>date</th><th>message</th><th>user</th><th>operations</th></tr>"; while ($watchdog = db_fetch_object($result)) { if ($background = $color[$watchdog->type]) { - $output .= " <tr bgcolor=\"$background\"><td>". format_date($watchdog->timestamp, "small") ."</td><td>". substr(check_output($watchdog->message), 0, 64) ."</td><td align=\"center\">". format_name($watchdog) ."</a></td><td align=\"center\">".la(t("details"), array("mod" => "watchdog", "op" => "view", "id" => $watchdog->wid))."</td></tr>"; + $output .= " <tr bgcolor=\"$background\"><td>". format_date($watchdog->timestamp, "small") ."</td><td>". substr(check_output($watchdog->message), 0, 64) ."</td><td align=\"center\">". format_name($watchdog) ."</a></td><td align=\"center\">". la(t("details"), array("mod" => "watchdog", "op" => "view", "id" => $watchdog->wid)) ."</td></tr>"; } } $output .= "</table>"; @@ -79,7 +79,7 @@ function watchdog_admin() { $links[] = la(t("overview"), array("mod" => "watchdog")); $links[] = la(t("help"), array("mod" => "watchdog", "op" => "help")); - print "<small>".implode(" | ", $links)."</small><hr />"; + print "<small>". implode(" | ", $links) ."</small><hr />"; switch ($op) { case "help": @@ -42,7 +42,7 @@ if ($number > 1) { while ($node = db_fetch_object($result)) { if (node_access("view", $node)) { - $output .= "<p><b>".l(check_output($node->title), array("id" => $node->nid))."</b><br /><small>$node->type - ". format_name($node) ." - ". format_date($node->ccreated, "small") ."</small></p>"; + $output .= "<p><b>". l(check_output($node->title), array("id" => $node->nid)) ."</b><br /><small>$node->type - ". format_name($node) ." - ". format_date($node->ccreated, "small") ."</small></p>"; } } @@ -51,7 +51,7 @@ if ($number > 1) { $theme->footer(); } elseif ($number) { - $node = ($title ? node_load(array("title" => $title, "status" => 1)) : node_load(array("nid" => ($edit[id] ? $edit[id] : $id)))); + $node = ($title ? node_load(array("title" => $title, "status" => 1)) : node_load(array("nid" => ($edit["id"] ? $edit["id"] : $id)))); if (node_access("view", $node)) { if (isset($revision)) { |