From 2101f6c454d670a93ee445f84bfe839aa21bf049 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 11 Mar 2004 20:33:59 +0000 Subject: - Rewrote the profile module: + Added a 'created' field to the users table and renamed the 'timestamp' fied to 'changed' (cfr. node table). Update.php will try to determine a 'created' timestamp for existing users. + The profile module no longer uses serialized data but has its own set of tables. Known existing profile data is migrated by these new tables. TODO: migrate the birthday field. + The profile fields can be grouped, and within each group, profile fields can be sorted using weights. + The profile pages can be themed. + The profiles can be browsed based on certain properties/settings. + Change the _user hook: (i) 'private_view' and 'public_view' are merged into 'view' as there are no private fields and (ii) 'edit_form' has been renamed to 'edit'. + Avatar handling has been refactored and is now part of the user module. The users table has a dedicted 'picture' field. + Simplified the way themes should use display/visualize pictures or avatars. + Made it possible for administrators to replace or delete avatars. + ... I hope this make for a good base to build on collectively. --- modules/comment/comment.module | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 69fd729fb..a0225e44b 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -138,16 +138,15 @@ function comment_settings() { function comment_user($type, $edit, &$user) { switch ($type) { - case "view_public": - case "view_private": + case "view": if ($user->signature) { return form_item(t("Signature"), check_output($user->signature)); } break; - case "edit_form": + case "edit": // when user tries to edit his own data return array(t('Personal information') => form_textarea(t("Signature"), "signature", $user->signature, 70, 3, t("Your signature will be publicly displayed at the end of your comments.") ."
". filter_tips_short())); - case "edit_validate": + case "edit": // validate user data editing return array("signature" => $edit["signature"]); } @@ -203,7 +202,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 INNER 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.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $pid)); $comment = drupal_unpack($comment); $output .= theme("comment_view", $comment); } @@ -258,7 +257,7 @@ function comment_preview($edit) { $output .= theme("comment_form", $edit, t("Reply")); if ($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 = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.picture, 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 = drupal_unpack($comment); $output .= theme("comment_view", $comment); } @@ -559,7 +558,7 @@ function comment_render($node, $cid = 0) { $output .= "
\n"; $output .= 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 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); + $result = db_query("SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.picture, 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.picture, u.data, c.score, c.users", $cid); if ($comment = db_fetch_object($result)) { $output .= theme("comment_view", $comment, theme('links', module_invoke_all('link', 'comment', $comment, 1))); @@ -576,9 +575,9 @@ 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 INNER 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.picture, 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"; + $query .= " GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.picture, u.data, c.score, c.users, c.thread"; /* ** We want to use the standard pager, but threads would need every -- cgit v1.2.3