diff --git a/includes/common.inc b/includes/common.inc index 594140a54271e0015558dc97ffa1c1c9a2732e79..644e453c7750ac8c05b7b79757da87166abeb2d3 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -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) { diff --git a/includes/theme.inc b/includes/theme.inc index 5a01e0a915e5384fa9968683b70d9daba2945fe5..ac6b5cf86da3c705bc747a9a40b55f504f248037 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -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"); diff --git a/modules/locale.module b/modules/locale.module index abfea68d47cfdecaf95ed08fce99d2f643e7d4ed..c363e64a725a9ff5000f7090109d5a0a3ac581fa 100644 --- a/modules/locale.module +++ b/modules/locale.module @@ -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; } -?> \ No newline at end of file +?> diff --git a/modules/locale/locale.module b/modules/locale/locale.module index abfea68d47cfdecaf95ed08fce99d2f643e7d4ed..c363e64a725a9ff5000f7090109d5a0a3ac581fa 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -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; } -?> \ No newline at end of file +?> diff --git a/modules/rating.module b/modules/rating.module index 062f89f5b03dc42840ed7b52f42c27ee077922f7..dd00aafb90d075bc16aa7439086e34721ce262b6 100644 --- a/modules/rating.module +++ b/modules/rating.module @@ -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)) { diff --git a/modules/watchdog.module b/modules/watchdog.module index a98ebb550663c0bb1f9fb4fc17e7d43917d7ecc1..ad7724030bfad5b6e774d4bfa249ed1ff6dc991e 100644 --- a/modules/watchdog.module +++ b/modules/watchdog.module @@ -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"; diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module index a98ebb550663c0bb1f9fb4fc17e7d43917d7ecc1..ad7724030bfad5b6e774d4bfa249ed1ff6dc991e 100644 --- a/modules/watchdog/watchdog.module +++ b/modules/watchdog/watchdog.module @@ -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"; diff --git a/updates/3.00-to-x.xx.sql b/updates/3.00-to-x.xx.sql index a905bf27d1a82e54044ea22c785b4730b3fb3be9..9d29dfb03c0dbb3bb9a3eb8f5562c244d5b3003a 100644 --- a/updates/3.00-to-x.xx.sql +++ b/updates/3.00-to-x.xx.sql @@ -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;