- I tidied up most SQL tables to be more consistent with the rest of the
tables: I changed all "id"s to "xid"s where "x" is the first letter of the table name. I also renamed all remaining "userid"s to "uid"s as I mentioned I would do. Take a look at ./drupal/updates/3.00-to-x.xx.sql for the MySQL updates.4.0.x
parent
27c4514719
commit
625455b53b
|
@ -34,7 +34,7 @@ function error_handler($errno, $message, $filename, $line, $variables) {
|
|||
|
||||
function watchdog($type, $message) {
|
||||
global $user;
|
||||
db_query("INSERT INTO watchdog (userid, type, message, location, hostname, timestamp) VALUES ('$user->uid', '". check_input($type) ."', '". check_input($message) ."', '". check_input(getenv("REQUEST_URI")) ."', '". check_input(getenv("REMOTE_ADDR")) ."', '". time() ."')");
|
||||
db_query("INSERT INTO watchdog (uid, type, message, location, hostname, timestamp) VALUES ('$user->uid', '". check_input($type) ."', '". check_input($message) ."', '". check_input(getenv("REQUEST_URI")) ."', '". check_input(getenv("REMOTE_ADDR")) ."', '". time() ."')");
|
||||
}
|
||||
|
||||
function throttle($type, $rate) {
|
||||
|
|
|
@ -99,7 +99,7 @@ function theme_blocks($region, &$theme) {
|
|||
break;
|
||||
case "/index.php":
|
||||
|
||||
if ($user->uid) $result = db_query("SELECT * FROM blocks b LEFT JOIN layout l ON b.name = l.block WHERE (b.status = 2 OR (b.status = 1 AND l.userid = '$user->uid'))". (($region == "left" OR $region == "right") ? ($region == "left" ? " AND b.region = 0" : " AND b.region = 1") : "") ." ORDER BY weight");
|
||||
if ($user->uid) $result = db_query("SELECT * FROM blocks b LEFT JOIN layout l ON b.name = l.block WHERE (b.status = 2 OR (b.status = 1 AND l.uid = '$user->uid'))". (($region == "left" OR $region == "right") ? ($region == "left" ? " AND b.region = 0" : " AND b.region = 1") : "") ." ORDER BY weight");
|
||||
else $result = db_query("SELECT * FROM blocks WHERE status = 2". (($region == "left" OR $region == "right") ? ($region == "left" ? " AND region = 0" : " AND region = 1") : "") ." ORDER BY weight");
|
||||
while ($result && ($block = db_fetch_object($result))) {
|
||||
$blocks = module_invoke($block->module, "block");
|
||||
|
|
|
@ -50,23 +50,22 @@ function locale_conf_options() {
|
|||
return form_select("Locale support", "locale", variable_get("locale", 0), array("Disabled", "Enabled"), "Disable locale support if your site does not require translation or internationalization support.");
|
||||
}
|
||||
|
||||
function locale_delete($id) {
|
||||
db_query("DELETE FROM locales WHERE id = '$id'");
|
||||
function locale_delete($lid) {
|
||||
db_query("DELETE FROM locales WHERE lid = '$lid'");
|
||||
}
|
||||
|
||||
function locale_save($id, $edit) {
|
||||
function locale_save($lid, $edit) {
|
||||
foreach ($edit as $key=>$value) {
|
||||
db_query("UPDATE locales SET $key = '". check_input($value) ."' WHERE id = '$id'");
|
||||
db_query("UPDATE locales SET $key = '". check_input($value) ."' WHERE lid = '$lid'");
|
||||
}
|
||||
}
|
||||
|
||||
function locale_edit($id) {
|
||||
function locale_edit($lid) {
|
||||
global $languages;
|
||||
$result = db_query("SELECT * FROM locales WHERE id = '$id'");
|
||||
$result = db_query("SELECT * FROM locales WHERE lid = '$lid'");
|
||||
if ($translation = db_fetch_object($result)) {
|
||||
$form .= form_item(t("Original text"), "<PRE>". wordwrap(check_output($translation->string)) ."</PRE>");
|
||||
foreach ($languages as $code=>$language) $form .= (strlen($translation->string) > 30) ? form_textarea($language, $code, $translation->$code, 50, 10) : form_textfield($language, $code, $translation->$code, 50, 128);
|
||||
$form .= form_hidden("id", $id);
|
||||
$form .= form_submit("Save translations");
|
||||
|
||||
return form($form);
|
||||
|
@ -104,7 +103,7 @@ function locale_overview() {
|
|||
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
|
||||
$output .= " <TR><TH>string</TH><TH>languages</TH><TH COLSPAN=\"2\">operations</TH></TR>\n";
|
||||
while ($locale = db_fetch_object($result)) {
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>". check_output($locale->location) ."</I></SMALL></TD><TD ALIGN=\"center\">". check_output(locale_languages($locale)) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->id\">edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->id\">delete locale</A></TD></TR>";
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>". check_output($locale->location) ."</I></SMALL></TD><TD ALIGN=\"center\">". check_output(locale_languages($locale)) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->lid\">edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->lid\">delete locale</A></TD></TR>";
|
||||
}
|
||||
$output .= "</TABLE>\n";
|
||||
|
||||
|
@ -117,7 +116,7 @@ function locale_translated($language) {
|
|||
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
|
||||
$output .= " <TR><TH>original string</TH><TH>translated string</TH><TH COLSPAN=\"2\">operations</TH></TR>\n";
|
||||
while ($locale = db_fetch_object($result)) {
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."</TD><TD>". check_output($locale->$language) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->id\"> edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->id\">delete locale</A></TD></TR>";
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."</TD><TD>". check_output($locale->$language) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->lid\"> edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->lid\">delete locale</A></TD></TR>";
|
||||
}
|
||||
$output .= "</TABLE>\n";
|
||||
|
||||
|
@ -130,7 +129,7 @@ function locale_untranslated($language) {
|
|||
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
|
||||
$output .= " <TR><TH>string</TH><TH COLSPAN=\"2\">operations</TH></TR>\n";
|
||||
while ($locale = db_fetch_object($result)) {
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>$locale->location</I></SMALL></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->id\"> edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->id\">delete locale</A></TD></TR>";
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>$locale->location</I></SMALL></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->lid\"> edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->lid\">delete locale</A></TD></TR>";
|
||||
}
|
||||
$output .= "</TABLE>\n";
|
||||
|
||||
|
@ -138,9 +137,9 @@ function locale_untranslated($language) {
|
|||
}
|
||||
|
||||
function locale_seek() {
|
||||
global $edit, $languages, $op, $locale_settings;
|
||||
global $id, $edit, $languages, $op, $locale_settings;
|
||||
|
||||
if ($edit[id] && session_is_registered("locale_settings")) {
|
||||
if (session_is_registered("locale_settings")) {
|
||||
$edit = $locale_settings;
|
||||
}
|
||||
|
||||
|
@ -173,7 +172,7 @@ function locale_seek() {
|
|||
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
|
||||
$output .= " <TR><TH>string</TH><TH>languages</TH><TH COLSPAN=\"2\">operations</TH></TR>\n";
|
||||
while ($locale = db_fetch_object($result)) {
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>". check_output($locale->location) ."</I></SMALL></TD><TD ALIGN=\"center\">". check_output(locale_languages($locale)) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->id\">edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->id\">delete locale</A></TD></TR>";
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>". check_output($locale->location) ."</I></SMALL></TD><TD ALIGN=\"center\">". check_output(locale_languages($locale)) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->lid\">edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->lid\">delete locale</A></TD></TR>";
|
||||
}
|
||||
$output .= "</TABLE>\n";
|
||||
}
|
||||
|
@ -232,11 +231,11 @@ function locale_admin() {
|
|||
function locale($string) {
|
||||
global $locale;
|
||||
if (variable_get("locale", 0)) {
|
||||
$result = db_query("SELECT id, $locale FROM locales WHERE STRCMP(string, '". addslashes($string) ."') = 0");
|
||||
$result = db_query("SELECT lid, $locale FROM locales WHERE STRCMP(string, '". addslashes($string) ."') = 0");
|
||||
if ($translation = db_fetch_object($result)) $string = ($translation->$locale) ? check_output($translation->$locale) : $string;
|
||||
else db_query("INSERT INTO locales (string, location) VALUES ('". addslashes($string) ."', '". check_input(getenv("REQUEST_URI")) ."')");
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -50,23 +50,22 @@ function locale_conf_options() {
|
|||
return form_select("Locale support", "locale", variable_get("locale", 0), array("Disabled", "Enabled"), "Disable locale support if your site does not require translation or internationalization support.");
|
||||
}
|
||||
|
||||
function locale_delete($id) {
|
||||
db_query("DELETE FROM locales WHERE id = '$id'");
|
||||
function locale_delete($lid) {
|
||||
db_query("DELETE FROM locales WHERE lid = '$lid'");
|
||||
}
|
||||
|
||||
function locale_save($id, $edit) {
|
||||
function locale_save($lid, $edit) {
|
||||
foreach ($edit as $key=>$value) {
|
||||
db_query("UPDATE locales SET $key = '". check_input($value) ."' WHERE id = '$id'");
|
||||
db_query("UPDATE locales SET $key = '". check_input($value) ."' WHERE lid = '$lid'");
|
||||
}
|
||||
}
|
||||
|
||||
function locale_edit($id) {
|
||||
function locale_edit($lid) {
|
||||
global $languages;
|
||||
$result = db_query("SELECT * FROM locales WHERE id = '$id'");
|
||||
$result = db_query("SELECT * FROM locales WHERE lid = '$lid'");
|
||||
if ($translation = db_fetch_object($result)) {
|
||||
$form .= form_item(t("Original text"), "<PRE>". wordwrap(check_output($translation->string)) ."</PRE>");
|
||||
foreach ($languages as $code=>$language) $form .= (strlen($translation->string) > 30) ? form_textarea($language, $code, $translation->$code, 50, 10) : form_textfield($language, $code, $translation->$code, 50, 128);
|
||||
$form .= form_hidden("id", $id);
|
||||
$form .= form_submit("Save translations");
|
||||
|
||||
return form($form);
|
||||
|
@ -104,7 +103,7 @@ function locale_overview() {
|
|||
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
|
||||
$output .= " <TR><TH>string</TH><TH>languages</TH><TH COLSPAN=\"2\">operations</TH></TR>\n";
|
||||
while ($locale = db_fetch_object($result)) {
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>". check_output($locale->location) ."</I></SMALL></TD><TD ALIGN=\"center\">". check_output(locale_languages($locale)) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->id\">edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->id\">delete locale</A></TD></TR>";
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>". check_output($locale->location) ."</I></SMALL></TD><TD ALIGN=\"center\">". check_output(locale_languages($locale)) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->lid\">edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->lid\">delete locale</A></TD></TR>";
|
||||
}
|
||||
$output .= "</TABLE>\n";
|
||||
|
||||
|
@ -117,7 +116,7 @@ function locale_translated($language) {
|
|||
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
|
||||
$output .= " <TR><TH>original string</TH><TH>translated string</TH><TH COLSPAN=\"2\">operations</TH></TR>\n";
|
||||
while ($locale = db_fetch_object($result)) {
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."</TD><TD>". check_output($locale->$language) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->id\"> edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->id\">delete locale</A></TD></TR>";
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."</TD><TD>". check_output($locale->$language) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->lid\"> edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->lid\">delete locale</A></TD></TR>";
|
||||
}
|
||||
$output .= "</TABLE>\n";
|
||||
|
||||
|
@ -130,7 +129,7 @@ function locale_untranslated($language) {
|
|||
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
|
||||
$output .= " <TR><TH>string</TH><TH COLSPAN=\"2\">operations</TH></TR>\n";
|
||||
while ($locale = db_fetch_object($result)) {
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>$locale->location</I></SMALL></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->id\"> edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->id\">delete locale</A></TD></TR>";
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>$locale->location</I></SMALL></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->lid\"> edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->lid\">delete locale</A></TD></TR>";
|
||||
}
|
||||
$output .= "</TABLE>\n";
|
||||
|
||||
|
@ -138,9 +137,9 @@ function locale_untranslated($language) {
|
|||
}
|
||||
|
||||
function locale_seek() {
|
||||
global $edit, $languages, $op, $locale_settings;
|
||||
global $id, $edit, $languages, $op, $locale_settings;
|
||||
|
||||
if ($edit[id] && session_is_registered("locale_settings")) {
|
||||
if (session_is_registered("locale_settings")) {
|
||||
$edit = $locale_settings;
|
||||
}
|
||||
|
||||
|
@ -173,7 +172,7 @@ function locale_seek() {
|
|||
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
|
||||
$output .= " <TR><TH>string</TH><TH>languages</TH><TH COLSPAN=\"2\">operations</TH></TR>\n";
|
||||
while ($locale = db_fetch_object($result)) {
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>". check_output($locale->location) ."</I></SMALL></TD><TD ALIGN=\"center\">". check_output(locale_languages($locale)) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->id\">edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->id\">delete locale</A></TD></TR>";
|
||||
$output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>". check_output($locale->location) ."</I></SMALL></TD><TD ALIGN=\"center\">". check_output(locale_languages($locale)) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->lid\">edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->lid\">delete locale</A></TD></TR>";
|
||||
}
|
||||
$output .= "</TABLE>\n";
|
||||
}
|
||||
|
@ -232,11 +231,11 @@ function locale_admin() {
|
|||
function locale($string) {
|
||||
global $locale;
|
||||
if (variable_get("locale", 0)) {
|
||||
$result = db_query("SELECT id, $locale FROM locales WHERE STRCMP(string, '". addslashes($string) ."') = 0");
|
||||
$result = db_query("SELECT lid, $locale FROM locales WHERE STRCMP(string, '". addslashes($string) ."') = 0");
|
||||
if ($translation = db_fetch_object($result)) $string = ($translation->$locale) ? check_output($translation->$locale) : $string;
|
||||
else db_query("INSERT INTO locales (string, location) VALUES ('". addslashes($string) ."', '". check_input(getenv("REQUEST_URI")) ."')");
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -39,7 +39,7 @@ function rating_cron() {
|
|||
|
||||
$r2 = db_query("SELECT uid FROM users ORDER BY rating DESC");
|
||||
while ($account = db_fetch_object($r2)) {
|
||||
db_query("INSERT INTO rating (userid, new, old) VALUES ('$account->uid', '". ++$j ."', '". $rating[$account->uid] ."')");
|
||||
db_query("INSERT INTO rating (uid, new, old) VALUES ('$account->uid', '". ++$j ."', '". $rating[$account->uid] ."')");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ function rating_gravity($id) {
|
|||
}
|
||||
|
||||
function rating_list($limit) {
|
||||
$result = db_query("SELECT u.rating, u.name, u.uid, r.* FROM users u LEFT JOIN rating r ON u.uid = r.userid ORDER BY u.rating DESC LIMIT $limit");
|
||||
$result = db_query("SELECT u.rating, u.name, u.uid, r.* FROM users u LEFT JOIN rating r ON u.uid = r.uid ORDER BY u.rating DESC LIMIT $limit");
|
||||
|
||||
$output .= "<TABLE CELLPADDING=\"1\" CELLSPACING=\"1\">\n";
|
||||
while ($account = db_fetch_object($result)) {
|
||||
|
|
|
@ -33,13 +33,13 @@ function watchdog_overview($type) {
|
|||
$color = array(user => "#FFEEAA", message => "#FFFFFF", special => "#A49FFF", warning => "#FFAA22", httpd => "#99DD99", error => "#EE4C4C");
|
||||
$query = array(user => "WHERE type = 'user'", regular => "WHERE type = 'message'", special => "WHERE type = 'special'", warning => "WHERE type = 'warning'", error => "WHERE type = 'error'", httpd => "WHERE type = 'httpd'");
|
||||
|
||||
$result = db_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.userid = u.uid ". ($type ? $query[$type] : "") ." ORDER BY timestamp DESC LIMIT 1000");
|
||||
$result = db_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.uid = u.uid ". ($type ? $query[$type] : "") ." ORDER BY timestamp DESC LIMIT 1000");
|
||||
|
||||
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
|
||||
$output .= " <TR><TH>date</TH><TH>message</TH><TH>user</TH><TH>operations</TH></TR>\n";
|
||||
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\"><A HREF=\"admin.php?mod=watchdog&op=view&id=$watchdog->id\">details</A></TD></TR>\n";
|
||||
$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\"><A HREF=\"admin.php?mod=watchdog&op=view&id=$watchdog->wid\">details</A></TD></TR>\n";
|
||||
}
|
||||
}
|
||||
$output .= "</TABLE>\n";
|
||||
|
@ -48,7 +48,7 @@ function watchdog_overview($type) {
|
|||
}
|
||||
|
||||
function watchdog_view($id) {
|
||||
$result = db_query("SELECT l.*, u.name, u.uid FROM watchdog l LEFT JOIN users u ON l.userid = u.uid WHERE l.id = '$id'");
|
||||
$result = db_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.uid = u.uid WHERE w.wid = '$id'");
|
||||
|
||||
if ($watchdog = db_fetch_object($result)) {
|
||||
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
|
||||
|
|
|
@ -33,13 +33,13 @@ function watchdog_overview($type) {
|
|||
$color = array(user => "#FFEEAA", message => "#FFFFFF", special => "#A49FFF", warning => "#FFAA22", httpd => "#99DD99", error => "#EE4C4C");
|
||||
$query = array(user => "WHERE type = 'user'", regular => "WHERE type = 'message'", special => "WHERE type = 'special'", warning => "WHERE type = 'warning'", error => "WHERE type = 'error'", httpd => "WHERE type = 'httpd'");
|
||||
|
||||
$result = db_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.userid = u.uid ". ($type ? $query[$type] : "") ." ORDER BY timestamp DESC LIMIT 1000");
|
||||
$result = db_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.uid = u.uid ". ($type ? $query[$type] : "") ." ORDER BY timestamp DESC LIMIT 1000");
|
||||
|
||||
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
|
||||
$output .= " <TR><TH>date</TH><TH>message</TH><TH>user</TH><TH>operations</TH></TR>\n";
|
||||
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\"><A HREF=\"admin.php?mod=watchdog&op=view&id=$watchdog->id\">details</A></TD></TR>\n";
|
||||
$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\"><A HREF=\"admin.php?mod=watchdog&op=view&id=$watchdog->wid\">details</A></TD></TR>\n";
|
||||
}
|
||||
}
|
||||
$output .= "</TABLE>\n";
|
||||
|
@ -48,7 +48,7 @@ function watchdog_overview($type) {
|
|||
}
|
||||
|
||||
function watchdog_view($id) {
|
||||
$result = db_query("SELECT l.*, u.name, u.uid FROM watchdog l LEFT JOIN users u ON l.userid = u.uid WHERE l.id = '$id'");
|
||||
$result = db_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.uid = u.uid WHERE w.wid = '$id'");
|
||||
|
||||
if ($watchdog = db_fetch_object($result)) {
|
||||
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
|
||||
|
|
|
@ -55,3 +55,11 @@ ALTER TABLE watchdog CHANGE user userid int(10) DEFAULT '0' NOT NULL;
|
|||
ALTER TABLE rating CHANGE user userid int(10) DEFAULT '0' NOT NULL;
|
||||
ALTER TABLE layout CHANGE user userid int(10) DEFAULT '0' NOT NULL;
|
||||
ALTER TABLE blocks CHANGE offset delta tinyint(2) DEFAULT '0' NOT NULL;
|
||||
|
||||
# 14/10/01
|
||||
|
||||
ALTER TABLE watchdog CHANGE id wid int(5) DEFAULT '0' NOT NULL auto_increment;
|
||||
ALTER TABLE watchdog CHANGE userid uid int(10) DEFAULT '0' NOT NULL;
|
||||
ALTER TABLE layout CHANGE userid uid int(10) DEFAULT '0' NOT NULL;
|
||||
ALTER TABLE rating CHANGE userid uid int(10) DEFAULT '0' NOT NULL;
|
||||
ALTER TABLE locales CHANGE id lid int(10) DEFAULT '0' NOT NULL;
|
||||
|
|
Loading…
Reference in New Issue