Commit 8e657f64 authored by Dries's avatar Dries

- Gerhard's uid 0 patches. These patches bring various performance

  improvements.  Requires a database update.
parent accebe35
......@@ -37,7 +37,7 @@ ErrorDocument 500 /error.php
php_value session.auto_start 0
php_value session.save_handler user
php_value session.cache_limiter none
php_value allow_call_time_pass_reference Off
php_value allow_call_time_pass_reference On
</IfModule>
# Various rewrite rules
......
......@@ -332,7 +332,7 @@ CREATE TABLE [dbo].[term_synonym] (
GO
CREATE TABLE [dbo].[users] (
[uid] [bigint] IDENTITY (1, 1) NOT NULL ,
[uid] [numeric](10, 0) NULL ,
[name] [varchar] (60) NOT NULL ,
[pass] [varchar] (32) NOT NULL ,
[mail] [varchar] (64) NULL ,
......@@ -472,6 +472,8 @@ INSERT INTO system VALUES ('themes/marvin/marvin.theme','marvin','theme','Intern
INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2002-05-15";');
INSERT INTO variable(name,value) VALUES('theme_default','s:6:"marvin";');
INSERT INTO users(uid,name,mail) VALUES(0,'Anonymous','root@localhost');
INSERT INTO blocks(module,delta,status,custom,region,weight,path) VALUES('user', 0, 1, 0, 1, 0, '');
INSERT INTO blocks(module,delta,status,custom,region,weight,path) VALUES('user', 1, 1, 0, 1, 0, '');
......
......@@ -500,7 +500,7 @@ CREATE TABLE term_synonym (
--
CREATE TABLE users (
uid int(10) unsigned NOT NULL auto_increment,
uid int(10) unsigned NOT NULL default '0',
name varchar(60) NOT NULL default '',
pass varchar(32) NOT NULL default '',
mail varchar(64) default '',
......@@ -578,6 +578,7 @@ INSERT INTO system VALUES ('modules/page.module','page','module','',1);
INSERT INTO system VALUES ('modules/story.module','story','module','',1);
INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1);
INSERT INTO system VALUES ('themes/marvin/marvin.theme','marvin','theme','Internet explorer, Netscape, Opera',1);
INSERT INTO users (uid, name, mail) VALUES ('0', 'Anonymous', 'root@localhost');
REPLACE variable SET name='update_start', value='s:10:"2003-04-19;"';
REPLACE variable SET name='theme_default', value='s:6:"marvin";';
......
......@@ -499,7 +499,7 @@ CREATE INDEX term_synonym_name_idx ON term_synonym(name);
--
CREATE TABLE users (
uid SERIAL,
uid integer NOT NULL default '0',
name varchar(60) NOT NULL default '',
pass varchar(32) NOT NULL default '',
mail varchar(64) default '',
......@@ -580,6 +580,7 @@ INSERT INTO system VALUES ('themes/marvin/marvin.theme','marvin','theme','Intern
INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2003-04-19";');
INSERT INTO variable(name,value) VALUES('theme_default','s:6:"marvin";');
INSERT INTO users(uid,name,mail) VALUES(0,'Anonymous','root@localhost');
INSERT INTO blocks(module,delta,status) VALUES('user', '0', '1');
INSERT INTO blocks(module,delta,status) VALUES('user', '1', '1');
......
......@@ -175,7 +175,7 @@ function comment_form($edit) {
function comment_edit($cid) {
global $user;
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status != 2", $cid));
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status != 2", $cid));
if (comment_access("edit", $comment)) {
comment_preview(object2array($comment));
......@@ -192,7 +192,7 @@ function comment_reply($pid, $nid) {
*/
if ($pid) {
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $pid));
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $pid));
comment_view($comment);
}
else if (user_access("access content")) {
......@@ -243,7 +243,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, u.data FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $edit["pid"]));
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $edit["pid"]));
comment_view($comment);
}
else {
......@@ -569,7 +569,7 @@ function comment_render($node, $cid = 0) {
print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
print form_hidden("nid", $nid);
$result = db_query("SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0 GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users", $cid);
$result = db_query("SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0 GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users", $cid);
if ($comment = db_fetch_object($result)) {
comment_view($comment, comment_links($comment));
......@@ -586,7 +586,7 @@ function comment_render($node, $cid = 0) {
** Multiple comments view
*/
$query .= "SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users, c.thread FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.nid = '". check_query($nid) ."' AND c.status = 0";
$query .= "SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users, c.thread FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = '". check_query($nid) ."' AND c.status = 0";
$query .= " GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users, c.thread";
......@@ -884,7 +884,7 @@ function comment_node_link($node) {
** Edit comments:
*/
$result = db_query("SELECT c.cid, c.subject, u.uid, u.name FROM {comments} c LEFT JOIN {users} u ON u.uid = c.uid WHERE nid = %d AND c.status = 0 ORDER BY c.timestamp", $node->nid);
$result = db_query("SELECT c.cid, c.subject, u.uid, u.name FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE nid = %d AND c.status = 0 ORDER BY c.timestamp", $node->nid);
$header = array(t("title"), t("author"), array("data" => t("operations"), "colspan" => 3));
......@@ -904,7 +904,7 @@ function comment_node_link($node) {
function comment_admin_edit($id) {
$result = db_query("SELECT c.*, u.name, u.uid FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status != 2", $id);
$result = db_query("SELECT c.*, u.name, u.uid FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status != 2", $id);
$comment = db_fetch_object($result);
// if a comment is "deleted", it's deleted
......@@ -955,7 +955,7 @@ function comment_admin_overview($status = 0) {
array("data" => t("operations"), "colspan" => 2)
);
$sql = "SELECT c.*, u.name, u.uid FROM {comments} c LEFT JOIN {users} u ON u.uid = c.uid WHERE c.status = ". check_query($status);
$sql = "SELECT c.*, u.name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.status = ". check_query($status);
$sql .= tablesort_sql($header);
$result = pager_query($sql, 50);
......@@ -1539,7 +1539,7 @@ function comment_search($keys) {
** 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 c.status = 0 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 INNER JOIN {users} u ON c.uid = u.uid WHERE s.lno = c.cid AND s.type = 'comment' AND c.status = 0 AND s.word like '%'"));
return $find;
}
......
......@@ -175,7 +175,7 @@ function comment_form($edit) {
function comment_edit($cid) {
global $user;
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status != 2", $cid));
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status != 2", $cid));
if (comment_access("edit", $comment)) {
comment_preview(object2array($comment));
......@@ -192,7 +192,7 @@ function comment_reply($pid, $nid) {
*/
if ($pid) {
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $pid));
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $pid));
comment_view($comment);
}
else if (user_access("access content")) {
......@@ -243,7 +243,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, u.data FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $edit["pid"]));
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $edit["pid"]));
comment_view($comment);
}
else {
......@@ -569,7 +569,7 @@ function comment_render($node, $cid = 0) {
print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
print form_hidden("nid", $nid);
$result = db_query("SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0 GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users", $cid);
$result = db_query("SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0 GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users", $cid);
if ($comment = db_fetch_object($result)) {
comment_view($comment, comment_links($comment));
......@@ -586,7 +586,7 @@ function comment_render($node, $cid = 0) {
** Multiple comments view
*/
$query .= "SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users, c.thread FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.nid = '". check_query($nid) ."' AND c.status = 0";
$query .= "SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users, c.thread FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = '". check_query($nid) ."' AND c.status = 0";
$query .= " GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users, c.thread";
......@@ -884,7 +884,7 @@ function comment_node_link($node) {
** Edit comments:
*/
$result = db_query("SELECT c.cid, c.subject, u.uid, u.name FROM {comments} c LEFT JOIN {users} u ON u.uid = c.uid WHERE nid = %d AND c.status = 0 ORDER BY c.timestamp", $node->nid);
$result = db_query("SELECT c.cid, c.subject, u.uid, u.name FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE nid = %d AND c.status = 0 ORDER BY c.timestamp", $node->nid);
$header = array(t("title"), t("author"), array("data" => t("operations"), "colspan" => 3));
......@@ -904,7 +904,7 @@ function comment_node_link($node) {
function comment_admin_edit($id) {
$result = db_query("SELECT c.*, u.name, u.uid FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status != 2", $id);
$result = db_query("SELECT c.*, u.name, u.uid FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status != 2", $id);
$comment = db_fetch_object($result);
// if a comment is "deleted", it's deleted
......@@ -955,7 +955,7 @@ function comment_admin_overview($status = 0) {
array("data" => t("operations"), "colspan" => 2)
);
$sql = "SELECT c.*, u.name, u.uid FROM {comments} c LEFT JOIN {users} u ON u.uid = c.uid WHERE c.status = ". check_query($status);
$sql = "SELECT c.*, u.name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.status = ". check_query($status);
$sql .= tablesort_sql($header);
$result = pager_query($sql, 50);
......@@ -1539,7 +1539,7 @@ function comment_search($keys) {
** 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 c.status = 0 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 INNER JOIN {users} u ON c.uid = u.uid WHERE s.lno = c.cid AND s.type = 'comment' AND c.status = 0 AND s.word like '%'"));
return $find;
}
......
......@@ -228,7 +228,7 @@ function _forum_last_comment($nid) {
}
function _forum_last_reply($nid) {
$value = db_fetch_object(db_query_range("SELECT c.timestamp, u.name, u.uid FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d AND c.status = 0 ORDER BY c.timestamp DESC", $nid, 0, 1));
$value = db_fetch_object(db_query_range("SELECT c.timestamp, u.name, u.uid FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d AND c.status = 0 ORDER BY c.timestamp DESC", $nid, 0, 1));
return $value;
}
......@@ -312,9 +312,9 @@ function _forum_topics_read($uid) {
}
function _forum_last_post($term) {
$topic = db_fetch_object(db_query_range("SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM {forum} f INNER JOIN {node} n ON n.nid = f.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC", $term, 0, 1));
$topic = db_fetch_object(db_query_range("SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM {forum} f INNER JOIN {node} n ON n.nid = f.nid INNER JOIN {users} u ON n.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC", $term, 0, 1));
$reply = db_fetch_object(db_query_range("SELECT n.nid, c.timestamp, u.name AS name, u.uid AS uid FROM {forum} f INNER JOIN {node} n ON n.nid = f.nid INNER JOIN {comments} c ON n.nid = c.nid LEFT JOIN {users} u ON c.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 AND c.status = 0 ORDER BY c.timestamp DESC", $term, 0, 1));
$reply = db_fetch_object(db_query_range("SELECT n.nid, c.timestamp, u.name AS name, u.uid AS uid FROM {forum} f INNER JOIN {node} n ON n.nid = f.nid INNER JOIN {comments} c ON n.nid = c.nid INNER JOIN {users} u ON c.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 AND c.status = 0 ORDER BY c.timestamp DESC", $term, 0, 1));
$value = ($topic->timestamp > $reply->timestamp) ? $topic : $reply;
......@@ -343,7 +343,7 @@ function forum_get_topics($tid, $sortby, $forum_per_page) {
$voc = taxonomy_get_vocabulary($term->vid);
// show topics with the correct tid, or in the forum but with shadow = 1
$sql = "SELECT n.nid, n.title, u.name AS name, u.uid AS uid, n.created AS timestamp, GREATEST(n.created, MAX(c.timestamp)) AS date_sort, COUNT(c.nid) AS num_comments, n.comment AS comment_mode, f.tid FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid LEFT JOIN {users} u ON n.uid = u.uid LEFT JOIN {comments} c ON n.nid = c.nid INNER JOIN {forum} f ON n.nid = f.nid WHERE n.nid = r.nid AND ((r.tid = '".check_query($tid)."' AND f.shadow = 1) OR f.tid = '".check_query($tid)."') AND n.status = 1 AND n.type = 'forum' GROUP BY n.nid, n.title, u.name, u.uid, n.created, n.comment, f.tid";
$sql = "SELECT n.nid, n.title, u.name AS name, u.uid AS uid, n.created AS timestamp, GREATEST(n.created, MAX(c.timestamp)) AS date_sort, COUNT(c.nid) AS num_comments, n.comment AS comment_mode, f.tid FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid INNER JOIN {users} u ON n.uid = u.uid LEFT JOIN {comments} c ON n.nid = c.nid INNER JOIN {forum} f ON n.nid = f.nid WHERE n.nid = r.nid AND ((r.tid = '".check_query($tid)."' AND f.shadow = 1) OR f.tid = '".check_query($tid)."') AND n.status = 1 AND n.type = 'forum' GROUP BY n.nid, n.title, u.name, u.uid, n.created, n.comment, f.tid";
$sql .= tablesort_sql($forum_topic_list_header);
$sql_count = "SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {forum} f ON n.nid = f.nid INNER JOIN {term_node} r ON n.nid = r.nid WHERE n.nid = r.nid AND ( (r.tid = '".check_query($tid)."' AND f.shadow = 1) OR f.tid = '".check_query($tid)."') AND n.status = 1 AND n.type = 'forum'";
......
......@@ -228,7 +228,7 @@ function _forum_last_comment($nid) {
}
function _forum_last_reply($nid) {
$value = db_fetch_object(db_query_range("SELECT c.timestamp, u.name, u.uid FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d AND c.status = 0 ORDER BY c.timestamp DESC", $nid, 0, 1));
$value = db_fetch_object(db_query_range("SELECT c.timestamp, u.name, u.uid FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d AND c.status = 0 ORDER BY c.timestamp DESC", $nid, 0, 1));
return $value;
}
......@@ -312,9 +312,9 @@ function _forum_topics_read($uid) {
}
function _forum_last_post($term) {
$topic = db_fetch_object(db_query_range("SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM {forum} f INNER JOIN {node} n ON n.nid = f.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC", $term, 0, 1));
$topic = db_fetch_object(db_query_range("SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM {forum} f INNER JOIN {node} n ON n.nid = f.nid INNER JOIN {users} u ON n.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC", $term, 0, 1));
$reply = db_fetch_object(db_query_range("SELECT n.nid, c.timestamp, u.name AS name, u.uid AS uid FROM {forum} f INNER JOIN {node} n ON n.nid = f.nid INNER JOIN {comments} c ON n.nid = c.nid LEFT JOIN {users} u ON c.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 AND c.status = 0 ORDER BY c.timestamp DESC", $term, 0, 1));
$reply = db_fetch_object(db_query_range("SELECT n.nid, c.timestamp, u.name AS name, u.uid AS uid FROM {forum} f INNER JOIN {node} n ON n.nid = f.nid INNER JOIN {comments} c ON n.nid = c.nid INNER JOIN {users} u ON c.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 AND c.status = 0 ORDER BY c.timestamp DESC", $term, 0, 1));
$value = ($topic->timestamp > $reply->timestamp) ? $topic : $reply;
......@@ -343,7 +343,7 @@ function forum_get_topics($tid, $sortby, $forum_per_page) {
$voc = taxonomy_get_vocabulary($term->vid);
// show topics with the correct tid, or in the forum but with shadow = 1
$sql = "SELECT n.nid, n.title, u.name AS name, u.uid AS uid, n.created AS timestamp, GREATEST(n.created, MAX(c.timestamp)) AS date_sort, COUNT(c.nid) AS num_comments, n.comment AS comment_mode, f.tid FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid LEFT JOIN {users} u ON n.uid = u.uid LEFT JOIN {comments} c ON n.nid = c.nid INNER JOIN {forum} f ON n.nid = f.nid WHERE n.nid = r.nid AND ((r.tid = '".check_query($tid)."' AND f.shadow = 1) OR f.tid = '".check_query($tid)."') AND n.status = 1 AND n.type = 'forum' GROUP BY n.nid, n.title, u.name, u.uid, n.created, n.comment, f.tid";
$sql = "SELECT n.nid, n.title, u.name AS name, u.uid AS uid, n.created AS timestamp, GREATEST(n.created, MAX(c.timestamp)) AS date_sort, COUNT(c.nid) AS num_comments, n.comment AS comment_mode, f.tid FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid INNER JOIN {users} u ON n.uid = u.uid LEFT JOIN {comments} c ON n.nid = c.nid INNER JOIN {forum} f ON n.nid = f.nid WHERE n.nid = r.nid AND ((r.tid = '".check_query($tid)."' AND f.shadow = 1) OR f.tid = '".check_query($tid)."') AND n.status = 1 AND n.type = 'forum' GROUP BY n.nid, n.title, u.name, u.uid, n.created, n.comment, f.tid";
$sql .= tablesort_sql($forum_topic_list_header);
$sql_count = "SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {forum} f ON n.nid = f.nid INNER JOIN {term_node} r ON n.nid = r.nid WHERE n.nid = r.nid AND ( (r.tid = '".check_query($tid)."' AND f.shadow = 1) OR f.tid = '".check_query($tid)."') AND n.status = 1 AND n.type = 'forum'";
......
......@@ -263,7 +263,7 @@ function node_load($conditions, $revision = -1) {
** Retrieve the node:
*/
$node = db_fetch_object(db_query("SELECT n.*, u.uid, u.name FROM {node} n LEFT JOIN {users} u ON u.uid = n.uid WHERE ". implode(" AND ", $cond)));
$node = db_fetch_object(db_query("SELECT n.*, u.uid, u.name FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE ". implode(" AND ", $cond)));
/*
** Unserialize the revisions field:
......@@ -493,7 +493,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 INNER 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;
}
......@@ -697,7 +697,7 @@ function node_admin_nodes() {
** Overview table:
*/
$result = pager_query("SELECT n.*, u.name, u.uid FROM {node} n LEFT JOIN {users} u ON n.uid = u.uid ". $filters[$filter][1], 50);
$result = pager_query("SELECT n.*, u.name, u.uid FROM {node} n INNER JOIN {users} u ON n.uid = u.uid ". $filters[$filter][1], 50);
$header = array(NULL, t("title"), t("type"), t("author"), t("status"), array ("data" => t("operations"), "colspan" => 2));
while ($node = db_fetch_object($result)) {
......
......@@ -263,7 +263,7 @@ function node_load($conditions, $revision = -1) {
** Retrieve the node:
*/
$node = db_fetch_object(db_query("SELECT n.*, u.uid, u.name FROM {node} n LEFT JOIN {users} u ON u.uid = n.uid WHERE ". implode(" AND ", $cond)));
$node = db_fetch_object(db_query("SELECT n.*, u.uid, u.name FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE ". implode(" AND ", $cond)));
/*
** Unserialize the revisions field:
......@@ -493,7 +493,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 INNER 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;
}
......@@ -697,7 +697,7 @@ function node_admin_nodes() {
** Overview table:
*/
$result = pager_query("SELECT n.*, u.name, u.uid FROM {node} n LEFT JOIN {users} u ON n.uid = u.uid ". $filters[$filter][1], 50);
$result = pager_query("SELECT n.*, u.name, u.uid FROM {node} n INNER JOIN {users} u ON n.uid = u.uid ". $filters[$filter][1], 50);
$header = array(NULL, t("title"), t("type"), t("author"), t("status"), array ("data" => t("operations"), "colspan" => 2));
while ($node = db_fetch_object($result)) {
......
......@@ -105,7 +105,7 @@ function queue_vote($node, $vote) {
function queue_overview() {
global $user;
$result = db_query("SELECT n.*, u.name, u.uid FROM {node} n LEFT JOIN {users} u ON n.uid = u.uid WHERE n.moderate = 1");
$result = db_query("SELECT n.*, u.name, u.uid FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.moderate = 1");
$output .= "<table border=\"0\" cellspacing=\"4\" cellpadding=\"4\">";
$output .= " <tr><th>". t("Subject") ."</th><th>". t("Author") ."</th><th>". t("Type") ."</th><th>". t("Score") ."</th></tr>";
......
......@@ -728,7 +728,7 @@ function statistics_display_online_block() {
/* Display linked title based on field name */
function statistics_title_list($dbfield, $dbrows) {
/* valid dbfields: totalcount, daycount, timestamp */
return db_query_range("SELECT s.nid, n.title, u.uid, u.name FROM {statistics} s INNER JOIN {node} n ON s.nid = n.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE %s <> '0' AND n.status = 1 ORDER BY %s DESC", "s.". $dbfield, "s.". $dbfield, 0, $dbrows);
return db_query_range("SELECT s.nid, n.title, u.uid, u.name FROM {statistics} s INNER JOIN {node} n ON s.nid = n.nid INNER JOIN {users} u ON n.uid = u.uid WHERE %s <> '0' AND n.status = 1 ORDER BY %s DESC", "s.". $dbfield, "s.". $dbfield, 0, $dbrows);
}
......
......@@ -728,7 +728,7 @@ function statistics_display_online_block() {
/* Display linked title based on field name */
function statistics_title_list($dbfield, $dbrows) {
/* valid dbfields: totalcount, daycount, timestamp */
return db_query_range("SELECT s.nid, n.title, u.uid, u.name FROM {statistics} s INNER JOIN {node} n ON s.nid = n.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE %s <> '0' AND n.status = 1 ORDER BY %s DESC", "s.". $dbfield, "s.". $dbfield, 0, $dbrows);
return db_query_range("SELECT s.nid, n.title, u.uid, u.name FROM {statistics} s INNER JOIN {node} n ON s.nid = n.nid INNER JOIN {users} u ON n.uid = u.uid WHERE %s <> '0' AND n.status = 1 ORDER BY %s DESC", "s.". $dbfield, "s.". $dbfield, 0, $dbrows);
}
......
......@@ -657,11 +657,11 @@ function taxonomy_select_nodes($taxonomy, $pager = 1) {
if ($taxonomy->str_tids) {
if ($taxonomy->operator == "or") {
$sql = "SELECT DISTINCT(n.nid), n.title, n.type, n.created, n.changed, n.uid, n.static, n.created, u.name FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' ORDER BY static DESC, created DESC";
$sql_count = "SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1'";
$sql = "SELECT DISTINCT(n.nid), n.title, n.type, n.created, n.changed, n.uid, n.static, n.created, u.name FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid INNER JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' ORDER BY static DESC, created DESC";
$sql_count = "SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid INNER JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1'";
}
else {
$sql = "SELECT n.nid, n.title, n.type, n.created, n.changed, n.uid, u.name FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' GROUP BY n.nid, n.title, n.type, n.created, n.changed, n.uid, u.name HAVING COUNT(n.nid) = ".count($taxonomy->tids)." ORDER BY static DESC, created DESC";
$sql = "SELECT n.nid, n.title, n.type, n.created, n.changed, n.uid, u.name FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid INNER JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' GROUP BY n.nid, n.title, n.type, n.created, n.changed, n.uid, u.name HAVING COUNT(n.nid) = ".count($taxonomy->tids)." ORDER BY static DESC, created DESC";
// Special trick as we could not find anything better:
$count = db_num_rows(db_query("SELECT n.nid FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' GROUP BY n.nid HAVING COUNT(n.nid) = ". count($taxonomy->tids)));
......
......@@ -657,11 +657,11 @@ function taxonomy_select_nodes($taxonomy, $pager = 1) {
if ($taxonomy->str_tids) {
if ($taxonomy->operator == "or") {
$sql = "SELECT DISTINCT(n.nid), n.title, n.type, n.created, n.changed, n.uid, n.static, n.created, u.name FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' ORDER BY static DESC, created DESC";
$sql_count = "SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1'";
$sql = "SELECT DISTINCT(n.nid), n.title, n.type, n.created, n.changed, n.uid, n.static, n.created, u.name FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid INNER JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' ORDER BY static DESC, created DESC";
$sql_count = "SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid INNER JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1'";
}
else {
$sql = "SELECT n.nid, n.title, n.type, n.created, n.changed, n.uid, u.name FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' GROUP BY n.nid, n.title, n.type, n.created, n.changed, n.uid, u.name HAVING COUNT(n.nid) = ".count($taxonomy->tids)." ORDER BY static DESC, created DESC";
$sql = "SELECT n.nid, n.title, n.type, n.created, n.changed, n.uid, u.name FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid INNER JOIN {users} u ON n.uid = u.uid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' GROUP BY n.nid, n.title, n.type, n.created, n.changed, n.uid, u.name HAVING COUNT(n.nid) = ".count($taxonomy->tids)." ORDER BY static DESC, created DESC";
// Special trick as we could not find anything better:
$count = db_num_rows(db_query("SELECT n.nid FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid WHERE r.tid IN ($taxonomy->str_tids) AND n.status = '1' GROUP BY n.nid HAVING COUNT(n.nid) = ". count($taxonomy->tids)));
......
......@@ -10,11 +10,11 @@ function title_page() {
if (user_access("access content")) {
$title = urldecode(arg(1));
$result = db_query("SELECT n.*, u.name, u.uid FROM {node} n LEFT JOIN {users} u ON n.uid = u.uid WHERE n.title = '%s' AND n.status = 1 ORDER BY n.created DESC", $title);
$result = db_query("SELECT n.*, u.name, u.uid FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.title = '%s' AND n.status = 1 ORDER BY n.created DESC", $title);
if (db_num_rows($result) == 0) {
// No node with exact title found, try substring.
$result = db_query("SELECT n.*, u.name, u.uid FROM {node} n LEFT JOIN {users} u ON n.uid = u.uid WHERE n.title LIKE '%". check_query($title). "%' AND n.status = 1 ORDER BY n.created DESC");
$result = db_query("SELECT n.*, u.name, u.uid FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.title LIKE '%". check_query($title). "%' AND n.status = 1 ORDER BY n.created DESC");
}
if (db_num_rows($result) == 0 && module_exist("search")) {
......
......@@ -35,14 +35,14 @@ function tracker_posts($id = 0) {
);
if ($id) {
$sql = "SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE n.uid = '". check_query($id) ."' AND n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name";
$sql = "SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid INNER JOIN {users} u ON n.uid = u.uid WHERE n.uid = '". check_query($id) ."' AND n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name";
$sql .= tablesort_sql($header);
$sresult = pager_query($sql, 10, 0, "SELECT COUNT(nid) FROM {node} WHERE status = 1 AND uid = '". check_query($id) ."'");
}
else {
$sql = "SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name";
$sql = "SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid INNER JOIN {users} u ON n.uid = u.uid WHERE n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name";
$sql .= tablesort_sql($header);
$sresult = pager_query($sql, 10, 0, "SELECT COUNT(nid) FROM {node} WHERE status = 1");
......@@ -50,10 +50,10 @@ function tracker_posts($id = 0) {
while ($node = db_fetch_object($sresult)) {
if ($id) {
$cresult = db_query("SELECT c.*, u.name FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.uid = %d AND c.nid = %d AND c.status = 0 ORDER BY c.cid DESC", $id, $node->nid);
$cresult = db_query("SELECT c.*, u.name FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.uid = %d AND c.nid = %d AND c.status = 0 ORDER BY c.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.nid = %d AND c.status = 0 ORDER BY c.cid DESC", $node->nid);
$cresult = db_query("SELECT c.*, u.name FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d AND c.status = 0 ORDER BY c.cid DESC", $node->nid);
}
$type = ucfirst(module_invoke($node->type, "node", "name"));
......
......@@ -35,14 +35,14 @@ function tracker_posts($id = 0) {
);
if ($id) {
$sql = "SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE n.uid = '". check_query($id) ."' AND n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name";
$sql = "SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid INNER JOIN {users} u ON n.uid = u.uid WHERE n.uid = '". check_query($id) ."' AND n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name";
$sql .= tablesort_sql($header);
$sresult = pager_query($sql, 10, 0, "SELECT COUNT(nid) FROM {node} WHERE status = 1 AND uid = '". check_query($id) ."'");
}
else {
$sql = "SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name";
$sql = "SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid INNER JOIN {users} u ON n.uid = u.uid WHERE n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name";
$sql .= tablesort_sql($header);
$sresult = pager_query($sql, 10, 0, "SELECT COUNT(nid) FROM {node} WHERE status = 1");
......@@ -50,10 +50,10 @@ function tracker_posts($id = 0) {
while ($node = db_fetch_object($sresult)) {
if ($id) {
$cresult = db_query("SELECT c.*, u.name FROM {comments} c LEFT JOIN {users} u ON c.uid = u.uid WHERE c.uid = %d AND c.nid = %d AND c.status = 0 ORDER BY c.cid DESC", $id, $node->nid);
$cresult = db_query("SELECT c.*, u.name FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.uid = %d AND c.nid = %d AND c.status = 0 ORDER BY c.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.nid = %d AND c.status = 0 ORDER BY c.cid DESC", $node->nid);
$cresult = db_query("SELECT c.*, u.name FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d AND c.status = 0 ORDER BY c.cid DESC", $node->nid);
}
$type = ucfirst(module_invoke($node->type, "node", "name"));
......
......@@ -142,6 +142,7 @@ function user_save($account, $array = array()) {
}
else {
$array["timestamp"] = time();
$array["uid"] = db_next_id("user_uid");
foreach ($array as $key => $value) {
if ($key == "pass") {
......
......@@ -142,6 +142,7 @@ function user_save($account, $array = array()) {
}
else {
$array["timestamp"] = time();
$array["uid"] = db_next_id("user_uid");
foreach ($array as $key => $value) {
if ($key == "pass") {
......
......@@ -77,7 +77,7 @@ function watchdog_overview($type) {
array("data" => t("user"), "field" => "u.name"),
array("data" => t("operations"), "colspan" => "2")
);
$sql = "SELECT w.*, u.name, u.uid FROM {watchdog} w LEFT JOIN {users} u ON w.uid = u.uid ". ($type ? $query[$type] : "");
$sql = "SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid ". ($type ? $query[$type] : "");
$sql .= tablesort_sql($header);
$result = pager_query($sql, 50);
......@@ -105,7 +105,7 @@ function watchdog_overview($type) {
function watchdog_view($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 = %d", $id);
$result = db_query("SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid WHERE w.wid = %d", $id);
if ($watchdog = db_fetch_object($result)) {
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
......
......@@ -77,7 +77,7 @@ function watchdog_overview($type) {
array("data" => t("user"), "field" => "u.name"),
array("data" => t("operations"), "colspan" => "2")
);
$sql = "SELECT w.*, u.name, u.uid FROM {watchdog} w LEFT JOIN {users} u ON w.uid = u.uid ". ($type ? $query[$type] : "");
$sql = "SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid ". ($type ? $query[$type] : "");
$sql .= tablesort_sql($header);
$result = pager_query($sql, 50);
......@@ -105,7 +105,7 @@ function watchdog_overview($type) {
function watchdog_view($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 = %d", $id);
$result = db_query("SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid WHERE w.wid = %d", $id);
if ($watchdog = db_fetch_object($result)) {
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
......
......@@ -43,7 +43,8 @@
"2003-08-05" => "update_59",
"2003-08-15" => "update_60",
"2003-08-20" => "update_61",
"2003-08-27" => "update_62"
"2003-08-27" => "update_62",
"2003-09-09" => "update_63"
);
function update_32() {
......@@ -380,6 +381,13 @@ function _update_next_thread($structure, $parent) {
return $val;
}
function update_63() {
update_sql("ALTER TABLE users CHANGE uid uid int(10) unsigned NOT NULL default '0'");
update_sql("INSERT INTO users (uid, name, mail, timestamp) VALUES ('0', 'Anonymous', 'root@localhost', '". time() ."')");
$users = db_result(db_query("SELECT MAX(uid) FROM users;"));
update_sql("INSERT INTO sequences (name, id) VALUES ('users_uid', '$users')");
}
/*
** System functions
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment