diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-07-30 21:27:34 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-07-30 21:27:34 +0000 |
commit | d746d35a8fbb0b78802b6948363b2c5ac3db7aa4 (patch) | |
tree | 9406325825df3394961548af12269f574789c468 /modules | |
parent | 8dfc0e5ad70eeaaf2f501d59c50251c9bf09d463 (diff) | |
download | brdo-d746d35a8fbb0b78802b6948363b2c5ac3db7aa4.tar.gz brdo-d746d35a8fbb0b78802b6948363b2c5ac3db7aa4.tar.bz2 |
- Patch #163073 by Robert Douglas: removing dead code.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/comment/comment.install | 6 | ||||
-rw-r--r-- | modules/comment/comment.module | 14 | ||||
-rw-r--r-- | modules/comment/comment.schema | 3 |
3 files changed, 9 insertions, 14 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 819b46547..4c30b6c60 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -24,3 +24,9 @@ function comment_update_1() { } return array(); } + +function comment_update_6001() { + $ret[] = update_sql("ALTER TABLE {comments} DROP score"); + $ret[] = update_sql("ALTER TABLE {comments} DROP users"); + return $ret; +} diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 53b28e012..3f23fdd78 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -744,14 +744,6 @@ function comment_save($edit) { else { // Add the comment to database. $status = user_access('post comments without approval') ? COMMENT_PUBLISHED : COMMENT_NOT_PUBLISHED; - $roles = variable_get('comment_roles', array()); - $score = 0; - - foreach (array_intersect(array_keys($roles), array_keys($user->roles)) as $rid) { - $score = max($roles[$rid], $score); - } - - $users = serialize(array(0 => $score)); // Here we are building the thread field. See the documentation for // comment_render(). @@ -804,7 +796,7 @@ function comment_save($edit) { } $edit += array('mail' => '', 'homepage' => ''); - db_query("INSERT INTO {comments} (nid, pid, uid, subject, comment, format, hostname, timestamp, status, score, users, thread, name, mail, homepage) VALUES (%d, %d, %d, '%s', '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s')", $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], ip_address(), $edit['timestamp'], $status, $score, $users, $thread, $edit['name'], $edit['mail'], $edit['homepage']); + db_query("INSERT INTO {comments} (nid, pid, uid, subject, comment, format, hostname, timestamp, status, thread, name, mail, homepage) VALUES (%d, %d, %d, '%s', '%s', %d, '%s', %d, %d, '%s', '%s', '%s', '%s')", $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], ip_address(), $edit['timestamp'], $status, $thread, $edit['name'], $edit['mail'], $edit['homepage']); $edit['cid'] = db_last_insert_id('comments', 'cid'); _comment_update_node_statistics($edit['nid']); @@ -966,7 +958,7 @@ function comment_render($node, $cid = 0) { if ($cid && is_numeric($cid)) { // Single comment view. - $query = 'SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.score, c.users, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d'; + $query = 'SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d'; $query_args = array($cid); if (!user_access('administer comments')) { $query .= ' AND c.status = %d'; @@ -987,7 +979,7 @@ function comment_render($node, $cid = 0) { else { // Multiple comment view $query_count = 'SELECT COUNT(*) FROM {comments} WHERE nid = %d'; - $query = 'SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.score, c.users, c.thread, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d'; + $query = 'SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.thread, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d'; $query_args = array($nid); if (!user_access('administer comments')) { diff --git a/modules/comment/comment.schema b/modules/comment/comment.schema index 5620aa1e7..acbbbfd6d 100644 --- a/modules/comment/comment.schema +++ b/modules/comment/comment.schema @@ -12,11 +12,9 @@ function comment_schema() { 'comment' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'score' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'medium'), 'status' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), 'format' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0), 'thread' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE), - 'users' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big'), 'name' => array('type' => 'varchar', 'length' => 60, 'not null' => FALSE), 'mail' => array('type' => 'varchar', 'length' => 64, 'not null' => FALSE), 'homepage' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE) @@ -42,4 +40,3 @@ function comment_schema() { return $schema; } - |