Commit de5b9a16 authored by Kjartan's avatar Kjartan

- bug fixes:

    * fixed mails not being parsed properly.
    * tracker now shows user name when you view your own recent
      comments.
    * link to submission queue now points to the right place.
    * fixed jabber module.
    * theme is now activated when changed.
- applied Gerhards coding style patch.
parent 5b555167
...@@ -117,7 +117,8 @@ function t($string, $args = 0) { ...@@ -117,7 +117,8 @@ function t($string, $args = 0) {
global $languages; global $languages;
if (!$args) { if (!$args) {
return $string; return $string;
} else { }
else {
return strtr($string, $args); return strtr($string, $args);
} }
} }
...@@ -582,7 +583,7 @@ function form_select($title, $name, $value, $options, $description = 0, $extra = ...@@ -582,7 +583,7 @@ function form_select($title, $name, $value, $options, $description = 0, $extra =
foreach ($options as $key=>$choice) { 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>"; $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) { ...@@ -607,10 +608,10 @@ function form_submit($value) {
*/ */
function drupal_url($args = array(), $script = "node") { function drupal_url($args = array(), $script = "node") {
$t = array(); $t = array();
foreach($args as $k => $v) { foreach ($args as $k => $v) {
$t[] = "$k=$v"; $t[] = "$k=$v";
} }
return "$script.php?".implode("&amp;", $t); return "$script.php?". implode("&amp;", $t);
} }
/** /**
...@@ -623,17 +624,17 @@ function drupal_url($args = array(), $script = "node") { ...@@ -623,17 +624,17 @@ function drupal_url($args = array(), $script = "node") {
* @param $script script to be invoked; optional, defaults to node * @param $script script to be invoked; optional, defaults to node
*/ */
function l($linktext, $args = array(), $title = "", $script = "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 = "") { function la($linktext, $args = array(), $title = "") {
// we don't call l() to avoid another duplication of the array // 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 = "") { function lm($linktext, $args = array(), $title = "") {
// we don't call l() to avoid another duplication of the array // 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) { function field_get($string, $name) {
......
<?php <?php
// $Id$
function db_connect($url) { function db_connect($url) {
$url = parse_url($url); $url = parse_url($url);
mysql_pconnect($url["host"], $url["user"], $url["pass"]) or die(mysql_error()); 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! // NOTE: we are using a persistent connection!
} }
...@@ -15,7 +16,8 @@ function db_query($query) { ...@@ -15,7 +16,8 @@ function db_query($query) {
$args = array_map("check_query", $args); $args = array_map("check_query", $args);
$args[0] = $query; $args[0] = $query;
return _db_query(call_user_func_array("sprintf", $args)); return _db_query(call_user_func_array("sprintf", $args));
} else { }
else {
return _db_query($query); return _db_query($query);
} }
} }
...@@ -27,7 +29,8 @@ function db_queryd($query) { ...@@ -27,7 +29,8 @@ function db_queryd($query) {
$args = array_map("check_query", $args); $args = array_map("check_query", $args);
$args[0] = $query; $args[0] = $query;
return _db_query(call_user_func_array("sprintf", $args), 1); return _db_query(call_user_func_array("sprintf", $args), 1);
} else { }
else {
return _db_query($query, 1); return _db_query($query, 1);
} }
} }
...@@ -48,7 +51,8 @@ function _db_query($query, $debug = 0) { ...@@ -48,7 +51,8 @@ function _db_query($query, $debug = 0) {
if (!mysql_errno()) { if (!mysql_errno()) {
return $result; return $result;
} else { }
else {
trigger_error(mysql_error() ."\nquery: ". htmlspecialchars($query), E_USER_ERROR); trigger_error(mysql_error() ."\nquery: ". htmlspecialchars($query), E_USER_ERROR);
} }
} }
......
...@@ -9,7 +9,7 @@ function db_connect($url) { ...@@ -9,7 +9,7 @@ function db_connect($url) {
$db_handle = DB::connect($url); $db_handle = DB::connect($url);
if (DB::isError($db_handle)) { if (DB::isError($db_handle)) {
die ("Database problem: ". $db_handle->getMessage()); die("Database problem: ". $db_handle->getMessage());
} }
$db_handle->setFetchMode(DB_FETCHMODE_ASSOC); $db_handle->setFetchMode(DB_FETCHMODE_ASSOC);
......
...@@ -98,7 +98,7 @@ function import_get_bundles($attributes = 0) { ...@@ -98,7 +98,7 @@ function import_get_bundles($attributes = 0) {
$i = 0; $i = 0;
while ($bundle = db_fetch_object($result)) { while ($bundle = db_fetch_object($result)) {
$block[$i]["subject"] = $bundle->title; $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"; $block[$i]["info"] = "$bundle->title bundle";
$i++; $i++;
...@@ -113,7 +113,7 @@ function import_get_feeds($attributes = 0) { ...@@ -113,7 +113,7 @@ function import_get_feeds($attributes = 0) {
$i = 0; $i = 0;
while ($feed = db_fetch_object($result)) { while ($feed = db_fetch_object($result)) {
$block[$i]["subject"] = $feed->title; $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"; $block[$i]["info"] = "$feed->title feed";
$i++; $i++;
...@@ -176,7 +176,7 @@ function import_refresh($feed) { ...@@ -176,7 +176,7 @@ function import_refresh($feed) {
$link = strip_tags($link[1]); $link = strip_tags($link[1]);
$description = filter(strtr($description[1], $tt)); $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: ** Extract and process individual items:
...@@ -349,7 +349,7 @@ function import_view() { ...@@ -349,7 +349,7 @@ function import_view() {
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $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"; $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)) { 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"; $output .= "</table>\n";
...@@ -359,7 +359,7 @@ function import_view() { ...@@ -359,7 +359,7 @@ function import_view() {
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><th>title</th><th>attributes</th><th>operations</th></tr>\n"; $output .= " <tr><th>title</th><th>attributes</th><th>operations</th></tr>\n";
while ($bundle = db_fetch_object($result)) { 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"; $output .= "</table>\n";
...@@ -432,7 +432,7 @@ function import_tag() { ...@@ -432,7 +432,7 @@ function import_tag() {
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><th>time</th><th>feed</th><th>item</th></tr>\n"; $output .= " <tr><th>time</th><th>feed</th><th>item</th></tr>\n";
while ($item = db_fetch_object($result)) { 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 .= "</table>\n";
$output .= "<input type=\"submit\" name=\"op\" value=\"Save attributes\" />\n"; $output .= "<input type=\"submit\" name=\"op\" value=\"Save attributes\" />\n";
...@@ -452,7 +452,7 @@ function import_admin() { ...@@ -452,7 +452,7 @@ function import_admin() {
$links[] = la(t("overview"), array("mod" => "import", "op" => "view")); $links[] = la(t("overview"), array("mod" => "import", "op" => "view"));
$links[] = la(t("help"), array("mod" => "import", "op" => "help")); $links[] = la(t("help"), array("mod" => "import", "op" => "help"));
print "<small>".implode(" | ", $links)."</small><hr />"; print "<small>". implode(" | ", $links) ."</small><hr />";
switch ($op) { switch ($op) {
case "help": case "help":
...@@ -541,7 +541,7 @@ function import_page_last() { ...@@ -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.")); $links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), t("Read more syndicated news from this feed."));
if ($item->link) { if ($item->link) {
$output .= "<tr><td>". format_url($item->link, $item->title) ." &middot; ".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) ." &middot; ". 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) { if ($item->description) {
...@@ -610,7 +610,7 @@ function import_page_bundle($bid) { ...@@ -610,7 +610,7 @@ function import_page_bundle($bid) {
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>"; $links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
if ($item->link) { if ($item->link) {
$output .= "<tr><td>". format_url($item->link, $item->title) ." &middot; ".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) ." &middot; ". 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) { if ($item->description) {
...@@ -638,7 +638,7 @@ function import_page_sources() { ...@@ -638,7 +638,7 @@ function import_page_sources() {
$output .= "<div style=\"margin-left: 20px;\">". check_output($feed->description, 1) ."</div><br />"; $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->header();
$theme->box(t("News feeds"), import_page_info()); $theme->box(t("News feeds"), import_page_info());
......
...@@ -98,7 +98,7 @@ function import_get_bundles($attributes = 0) { ...@@ -98,7 +98,7 @@ function import_get_bundles($attributes = 0) {
$i = 0; $i = 0;
while ($bundle = db_fetch_object($result)) { while ($bundle = db_fetch_object($result)) {
$block[$i]["subject"] = $bundle->title; $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"; $block[$i]["info"] = "$bundle->title bundle";
$i++; $i++;
...@@ -113,7 +113,7 @@ function import_get_feeds($attributes = 0) { ...@@ -113,7 +113,7 @@ function import_get_feeds($attributes = 0) {
$i = 0; $i = 0;
while ($feed = db_fetch_object($result)) { while ($feed = db_fetch_object($result)) {
$block[$i]["subject"] = $feed->title; $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"; $block[$i]["info"] = "$feed->title feed";
$i++; $i++;
...@@ -176,7 +176,7 @@ function import_refresh($feed) { ...@@ -176,7 +176,7 @@ function import_refresh($feed) {
$link = strip_tags($link[1]); $link = strip_tags($link[1]);
$description = filter(strtr($description[1], $tt)); $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: ** Extract and process individual items:
...@@ -349,7 +349,7 @@ function import_view() { ...@@ -349,7 +349,7 @@ function import_view() {
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $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"; $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)) { 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"; $output .= "</table>\n";
...@@ -359,7 +359,7 @@ function import_view() { ...@@ -359,7 +359,7 @@ function import_view() {
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><th>title</th><th>attributes</th><th>operations</th></tr>\n"; $output .= " <tr><th>title</th><th>attributes</th><th>operations</th></tr>\n";
while ($bundle = db_fetch_object($result)) { 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"; $output .= "</table>\n";
...@@ -432,7 +432,7 @@ function import_tag() { ...@@ -432,7 +432,7 @@ function import_tag() {
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><th>time</th><th>feed</th><th>item</th></tr>\n"; $output .= " <tr><th>time</th><th>feed</th><th>item</th></tr>\n";
while ($item = db_fetch_object($result)) { 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 .= "</table>\n";
$output .= "<input type=\"submit\" name=\"op\" value=\"Save attributes\" />\n"; $output .= "<input type=\"submit\" name=\"op\" value=\"Save attributes\" />\n";
...@@ -452,7 +452,7 @@ function import_admin() { ...@@ -452,7 +452,7 @@ function import_admin() {
$links[] = la(t("overview"), array("mod" => "import", "op" => "view")); $links[] = la(t("overview"), array("mod" => "import", "op" => "view"));
$links[] = la(t("help"), array("mod" => "import", "op" => "help")); $links[] = la(t("help"), array("mod" => "import", "op" => "help"));
print "<small>".implode(" | ", $links)."</small><hr />"; print "<small>". implode(" | ", $links) ."</small><hr />";
switch ($op) { switch ($op) {
case "help": case "help":
...@@ -541,7 +541,7 @@ function import_page_last() { ...@@ -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.")); $links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), t("Read more syndicated news from this feed."));
if ($item->link) { if ($item->link) {
$output .= "<tr><td>". format_url($item->link, $item->title) ." &middot; ".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) ." &middot; ". 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) { if ($item->description) {
...@@ -610,7 +610,7 @@ function import_page_bundle($bid) { ...@@ -610,7 +610,7 @@ function import_page_bundle($bid) {
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>"; $links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
if ($item->link) { if ($item->link) {
$output .= "<tr><td>". format_url($item->link, $item->title) ." &middot; ".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) ." &middot; ". 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) { if ($item->description) {
...@@ -638,7 +638,7 @@ function import_page_sources() { ...@@ -638,7 +638,7 @@ function import_page_sources() {
$output .= "<div style=\"margin-left: 20px;\">". check_output($feed->description, 1) ."</div><br />"; $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->header();
$theme->box(t("News feeds"), import_page_info()); $theme->box(t("News feeds"), import_page_info());
......
...@@ -33,14 +33,14 @@ function archive_display($original = 0) { ...@@ -33,14 +33,14 @@ function archive_display($original = 0) {
// Generate calendar header: // Generate calendar header:
$output .= "\n<!-- calendar -->\n"; $output .= "\n<!-- calendar -->\n";
$output .= "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"1\">\n"; $output .= "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"1\">\n";
$output .= " <tr><td align=\"center\" colspan=\"7\"><small>".lm("&lt;", array("mod" => "archive", "date" => $prev))." &nbsp; ". date("F Y", $original) ." &nbsp; " . ($next <= $thislast ? lm("&gt;", array("mod" => "archive", "date" => $next)) : "&gt;") . "</small></td></tr>\n"; $output .= " <tr><td align=\"center\" colspan=\"7\"><small>". lm("&lt;", array("mod" => "archive", "date" => $prev)) ."&nbsp;". date("F Y", $original) ."&nbsp;". ($next <= $thislast ? lm("&gt;", array("mod" => "archive", "date" => $next)) : "&gt;") ."</small></td></tr>\n";
// Generate the days of the week: // Generate the days of the week:
$somesunday = mktime(0, 0, 0, 3, 20, 1994); $somesunday = mktime(0, 0, 0, 3, 20, 1994);
$output .= " <tr>"; $output .= " <tr>";
for ($i = 0; $i < 7; $i++) { 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"; $output .= "</tr>\n";
...@@ -72,7 +72,7 @@ function archive_display($original = 0) { ...@@ -72,7 +72,7 @@ function archive_display($original = 0) {
} }
else { else {
// due to text-decoration we use drupal_url() instead of lm() // 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: // Start every week on a new line:
......
...@@ -33,14 +33,14 @@ function archive_display($original = 0) { ...@@ -33,14 +33,14 @@ function archive_display($original = 0) {
// Generate calendar header: // Generate calendar header:
$output .= "\n<!-- calendar -->\n"; $output .= "\n<!-- calendar -->\n";
$output .= "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"1\">\n"; $output .= "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"1\">\n";
$output .= " <tr><td align=\"center\" colspan=\"7\"><small>".lm("&lt;", array("mod" => "archive", "date" => $prev))." &nbsp; ". date("F Y", $original) ." &nbsp; " . ($next <= $thislast ? lm("&gt;", array("mod" => "archive", "date" => $next)) : "&gt;") . "</small></td></tr>\n"; $output .= " <tr><td align=\"center\" colspan=\"7\"><small>". lm("&lt;", array("mod" => "archive", "date" => $prev)) ."&nbsp;". date("F Y", $original) ."&nbsp;". ($next <= $thislast ? lm("&gt;", array("mod" => "archive", "date" => $next)) : "&gt;") ."</small></td></tr>\n";
// Generate the days of the week: // Generate the days of the week:
$somesunday = mktime(0, 0, 0, 3, 20, 1994); $somesunday = mktime(0, 0, 0, 3, 20, 1994);
$output .= " <tr>"; $output .= " <tr>";
for ($i = 0; $i < 7; $i++) { 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"; $output .= "</tr>\n";
...@@ -72,7 +72,7 @@ function archive_display($original = 0) { ...@@ -72,7 +72,7 @@ function archive_display($original = 0) {
} }
else { else {
// due to text-decoration we use drupal_url() instead of lm() // 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: // Start every week on a new line:
......
...@@ -34,7 +34,7 @@ function block_admin_display() { ...@@ -34,7 +34,7 @@ function block_admin_display() {
$result = db_query("SELECT * FROM blocks ORDER BY module"); $result = db_query("SELECT * FROM blocks ORDER BY module");
// Generate output: // 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 .= "<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"; $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() { ...@@ -128,7 +128,7 @@ function block_admin() {
if (user_access("administer blocks")) { 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(); block_init();
......
...@@ -34,7 +34,7 @@ function block_admin_display() { ...@@ -34,7 +34,7 @@ function block_admin_display() {
$result = db_query("SELECT * FROM blocks ORDER BY module"); $result = db_query("SELECT * FROM blocks ORDER BY module");
// Generate output: // 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 .= "<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"; $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() { ...@@ -128,7 +128,7 @@ function block_admin() {
if (user_access("administer blocks")) { 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();