? user_signatures_1.patch Index: modules/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment.module,v retrieving revision 1.391 diff -u -r1.391 comment.module --- modules/comment.module 21 Nov 2005 08:32:31 -0000 1.391 +++ modules/comment.module 22 Nov 2005 04:17:43 -0000 @@ -290,21 +290,6 @@ } /** - * Implementation of hook_user(). - * - * Provides signature customization for the user's comments. - */ -function comment_user($type, $edit, &$user, $category = NULL) { - if ($type == 'form' && $category == 'account') { - // when user tries to edit his own data - $form['comment_settings'] = array('#type' => 'fieldset', '#title' => t('Comment settings'), '#collapsible' => TRUE, '#weight' => 4); - $form['comment_settings']['signature'] = array('#type' => 'textarea', '#title' => t('Signature'), '#default_value' => $edit['comment_settings']['signature'], '#description' => ('Your signature will be publicly displayed at the end of your comments.')); - - return $form; - } -} - -/** * Menu callback; presents the comment settings page. */ function comment_configure() { @@ -799,7 +784,7 @@ if ($cid) { // Single comment view. - $result = db_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.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 = %d GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, u.picture, c.homepage, u.uid, u.name, u.picture, u.data, c.score, c.users', $cid, COMMENT_PUBLISHED); + $result = db_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 FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, u.picture, c.homepage, u.uid, u.name, u.picture, u.data, c.score, c.users', $cid, COMMENT_PUBLISHED); if ($comment = db_fetch_object($result)) { $comment->name = $comment->uid ? $comment->registered_name : $comment->name; @@ -809,9 +794,9 @@ else { // Multiple comment view - $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.picture, u.data, c.score, c.users, c.thread FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d AND c.status = %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 FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d AND c.status = %d"; - $query .= ' GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, u.picture, c.homepage, u.uid, u.name, u.picture, u.data, c.score, c.users, c.thread'; + $query .= ' GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, u.picture, c.homepage, u.uid, u.name, u.signature, u.picture, u.data, c.score, c.users, c.thread'; /* ** We want to use the standard pager, but threads would need every @@ -1166,7 +1151,7 @@ $form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => $edit['subject']); } - $form['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE + $form['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => $edit['comment'], '#required' => TRUE ); $form = array_merge($form, filter_form($node->format)); Index: modules/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node.module,v retrieving revision 1.551 diff -u -r1.551 node.module --- modules/node.module 21 Nov 2005 18:10:26 -0000 1.551 +++ modules/node.module 22 Nov 2005 04:17:43 -0000 @@ -361,10 +361,10 @@ // Retrieve the node. if ($revision) { - $node = db_fetch_object(db_query(db_rewrite_sql('SELECT n.nid, r.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.nid = n.nid AND r.vid = %d WHERE '. $cond), $revision)); + $node = db_fetch_object(db_query(db_rewrite_sql('SELECT n.nid, r.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.signature, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.nid = n.nid AND r.vid = %d WHERE '. $cond), $revision)); } else { - $node = db_fetch_object(db_query(db_rewrite_sql('SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.vid = n.vid WHERE '. $cond))); + $node = db_fetch_object(db_query(db_rewrite_sql('SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.signature, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.vid = n.vid WHERE '. $cond))); } if ($node->nid) { Index: modules/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user.module,v retrieving revision 1.533 diff -u -r1.533 user.module --- modules/user.module 21 Nov 2005 18:36:12 -0000 1.533 +++ modules/user.module 22 Nov 2005 04:21:12 -0000 @@ -1155,25 +1155,90 @@ function user_edit_form($uid, $edit) { // Account information: - $form['account'] = array('#type' => 'fieldset', '#title' => t('Account information'), '#weight' => 0); - $form['account']['name'] = array('#type' => 'textfield', '#title' => t('Username'), '#default_value' => $edit['name'], '#maxlength' => 55, '#description' => t('Your full name or your preferred username: only letters, numbers and spaces are allowed.'), '#required' => TRUE); - $form['account']['mail'] = array('#type' => 'textfield', '#title' => t('E-mail address'), '#default_value' => $edit['mail'], '#maxlength' => 55, '#description' => t('Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.'), '#required' => TRUE); - $form['account']['pass'] = array('#type' => 'item', '#title' => t('Password'), '#value' => ' ', '#required' => true); + $form['account'] = array( + '#type' => 'fieldset', + '#title' => t('Account information'), + '#weight' => 0, + ); + $form['account']['name'] = array( + '#type' => 'textfield', + '#title' => t('Username'), + '#default_value' => $edit['name'], + '#maxlength' => 55, + '#description' => t('Your full name or your preferred username: only letters, numbers and spaces are allowed.'), + '#required' => TRUE, + ); + $form['account']['mail'] = array( + '#type' => 'textfield', + '#title' => t('E-mail address'), + '#default_value' => $edit['mail'], + '#maxlength' => 55, + '#description' => t('Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.'), + '#required' => TRUE, + ); + $form['account']['pass'] = array( + '#type' => 'item', + '#title' => t('Password'), + '#value' => ' ', + '#required' => true, + ); if (user_access('administer users')) { - $form['account']['status'] = array('#type' => 'radios', '#title' => t('Status'), '#default_value' => $edit['status'], '#options' => array(t('Blocked'), t('Active'))); + $form['account']['status'] = array( + '#type' => 'radios', + '#title' => t('Status'), + '#default_value' => $edit['status'], + '#options' => array(t('Blocked'), t('Active')), + ); } if (user_access('administer access control')) { - $form['account']['roles'] = array('#type' => 'checkboxes', '#title' => t('Roles'), '#default_value' => array_keys($edit['roles']), '#options' => user_roles(1), '#description' => t('Select at least one role. The user receives the combined permissions of all of the selected roles.'), '#required' => TRUE); - } + $form['account']['roles'] = array( + '#type' => 'checkboxes', + '#title' => t('Roles'), + '#default_value' => array_keys($edit['roles']), + '#options' => user_roles(1), + '#description' => t('Select at least one role. The user receives the combined permissions of all of the selected roles.'), + '#required' => TRUE, + ); + } + + // Signature: + $form['signature'] = array( + '#type' => 'fieldset', + '#title' => t('Signature settings'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + ); + $form['signature']['signature'] = array( + '#type' => 'textarea', + '#title' => t('Signature'), + '#default_value' => $edit['signature'], + '#description' => t('Your signature will be publicly displayed at the end of your posts and comments where the administrator has enabled them.'), + ); // Picture/avatar: if (variable_get('user_pictures', 0)) { - $form['picture'] = array('#type' => 'fieldset', '#title' => t('Picture'), '#weight' => 1); + $form['picture'] = array( + '#type' => 'fieldset', + '#title' => t('Picture'), + '#weight' => 1, + ); if ($edit['picture'] && ($picture = theme('user_picture', array2object($edit)))) { - $form['picture']['current_picture'] = array('#type' => 'markup', '#value' => $picture); - $form['picture']['picture_delete'] = array('#type' => 'checkbox', '#title' => t('Delete picture'), '#description' => t('Check this box to delete your current picture.')); - } - $form['picture']['picture'] = array('#type' => 'file', '#title' => t('Upload picture'), '#size' => 48, '#description' => t('Your virtual face or picture. Maximum dimensions are %dimensions and the maximum size is %size kB.', array('%dimensions' => variable_get('user_picture_dimensions', '85x85'), '%size' => variable_get('user_picture_file_size', '30'))) .' '. variable_get('user_picture_guidelines', '')); + $form['picture']['current_picture'] = array( + '#type' => 'markup', + '#value' => $picture, + ); + $form['picture']['picture_delete'] = array( + '#type' => 'checkbox', + '#title' => t('Delete picture'), + '#description' => t('Check this box to delete your current picture.'), + ); + } + $form['picture']['picture'] = array( + '#type' => 'file', + '#title' => t('Upload picture'), + '#size' => 48, + '#description' => t('Your virtual face or picture. Maximum dimensions are %dimensions and the maximum size is %size kB.', array('%dimensions' => variable_get('user_picture_dimensions', '85x85'), '%size' => variable_get('user_picture_file_size', '30'))) .' '. variable_get('user_picture_guidelines', ''), + ); } return $form; @@ -1752,18 +1817,92 @@ function user_configure() { // User registration settings. - $form['registration'] = array('#type' => 'fieldset', '#title' => t('User registration settings')); - $form['registration']['user_register'] = array('#type' => 'radios', '#title' => t('Public registrations'), '#default_value' => variable_get('user_register', 1), '#options' => array(t('Only site administrators can create new user accounts.'), t('Visitors can create accounts and no administrator approval is required.'), t('Visitors can create accounts but administrator approval is required.'))); - $form['registration']['user_registration_help'] = array('#type' => 'textarea', '#title' => t('User registration guidelines'), '#default_value' => variable_get('user_registration_help', ''), '#description' => t('This text is displayed at the top of the user registration form. It\'s useful for helping or instructing your users.')); + $form['registration'] = array( + '#type' => 'fieldset', + '#title' => t('User registration settings'), + ); + $form['registration']['user_register'] = array( + '#type' => 'radios', + '#title' => t('Public registrations'), + '#default_value' => variable_get('user_register', 1), + '#options' => array(t('Only site administrators can create new user accounts.'), + t('Visitors can create accounts and no administrator approval is required.'), + t('Visitors can create accounts but administrator approval is required.')), + ); + $form['registration']['user_registration_help'] = array( + '#type' => 'textarea', + '#title' => t('User registration guidelines'), + '#default_value' => variable_get('user_registration_help', ''), + '#description' => t('This text is displayed at the top of the user registration form. It\'s useful for helping or instructing your users.'), + ); + + // User signature settings. + $form['signature'] = array( + '#type' => 'fieldset', + '#title' => t('User signature settings'), + ); + $defaults = array_keys(variable_get('signature_node_types', array()), '1'); + $form['signature']['signature_node_types'] = array( + '#type' => 'checkboxes', + '#title' => t('Types'), + '#options' => node_get_types(), + '#default_value' => $defaults, + '#description' => t('Selected content types will display signatures at the bottom of all posts and comments'), + ); + $form['signature']['signature_template'] = array( + '#type' => 'textarea', + '#title' => t('Signature template'), + '#default_value' => variable_get('signature_template', '--
%s
'), + '#description' => t('Use HTML to establish a template for signatures. %s represents the signature text.'), + ); // User e-mail settings. - $form['email'] = array('#type' => 'fieldset', '#title' => t('User email settings')); - $form['email']['user_mail_welcome_subject'] = array('#type' => 'textfield', '#title' => t('Subject of welcome e-mail'), '#default_value' => _user_mail_text('welcome_subject'), '#maxlength' => 180, '#description' => t('Customize the subject of your welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri, %login_url.'); - $form['email']['user_mail_welcome_body'] = array('#type' => 'textarea', '#title' => t('Body of welcome e-mail'), '#default_value' => _user_mail_text('welcome_body'), '#rows' => 15, '#description' => t('Customize the body of the welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri, %login_url.'); - $form['email']['user_mail_approval_subject'] = array('#type' => 'textfield', '#title' => t('Subject of welcome e-mail (awaiting admin approval)'), '#default_value' => _user_mail_text('approval_subject'), '#maxlength' => 180, '#description' => t('Customize the subject of your awaiting approval welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri, %login_url.'); - $form['email']['user_mail_approval_body'] = array('#type' => 'textarea', '#title' => t('Body of welcome e-mail (awaiting admin approval)'), '#default_value' => _user_mail_text('approval_body'), '#rows' => 15, '#description' => t('Customize the body of the awaiting approval welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri, %login_url.'); - $form['email']['user_mail_pass_subject'] = array('#type' => 'textfield', '#title' => t('Subject of password recovery e-mail'), '#default_value' => _user_mail_text('pass_subject'), '#maxlength' => 180, '#description' => t('Customize the Subject of your forgotten password e-mail.') .' '. t('Available variables are:') .' %username, %site, %login_url, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri.'); - $form['email']['user_mail_pass_body'] = array('#type' => 'textarea', '#title' => t('Body of password recovery e-mail'), '#default_value' => _user_mail_text('pass_body'), '#rows' => 15, '#description' => t('Customize the body of the forgotten password e-mail.') .' '. t('Available variables are:') .' %username, %site, %login_url, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.'); + $form['email'] = array( + '#type' => 'fieldset', + '#title' => t('User email settings'), + ); + $form['email']['user_mail_welcome_subject'] = array( + '#type' => 'textfield', + '#title' => t('Subject of welcome e-mail'), + '#default_value' => _user_mail_text('welcome_subject'), + '#maxlength' => 180, + '#description' => t('Customize the subject of your welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri, %login_url.', + ); + $form['email']['user_mail_welcome_body'] = array( + '#type' => 'textarea', + '#title' => t('Body of welcome e-mail'), + '#default_value' => _user_mail_text('welcome_body'), + '#rows' => 15, + '#description' => t('Customize the body of the welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri, %login_url.', + ); + $form['email']['user_mail_approval_subject'] = array( + '#type' => 'textfield', + '#title' => t('Subject of welcome e-mail (awaiting admin approval)'), + '#default_value' => _user_mail_text('approval_subject'), + '#maxlength' => 180, + '#description' => t('Customize the subject of your awaiting approval welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' %username, %site, %password, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri, %login_url.', + ); + $form['email']['user_mail_approval_body'] = array( + '#type' => 'textarea', + '#title' => t('Body of welcome e-mail (awaiting admin approval)'), + '#default_value' => _user_mail_text('approval_body'), + '#rows' => 15, + '#description' => t('Customize the body of the awaiting approval welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' %username, %site, %password, %uri, %uri_brief, %mailto, %login_uri, %edit_uri, %login_url.', + ); + $form['email']['user_mail_pass_subject'] = array( + '#type' => 'textfield', + '#title' => t('Subject of password recovery e-mail'), + '#default_value' => _user_mail_text('pass_subject'), + '#maxlength' => 180, + '#description' => t('Customize the Subject of your forgotten password e-mail.') .' '. t('Available variables are:') .' %username, %site, %login_url, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri.', + ); + $form['email']['user_mail_pass_body'] = array( + '#type' => 'textarea', + '#title' => t('Body of password recovery e-mail'), + '#default_value' => _user_mail_text('pass_body'), + '#rows' => 15, + '#description' => t('Customize the body of the forgotten password e-mail.') .' '. t('Available variables are:') .' %username, %site, %login_url, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.', + ); // If picture support is enabled, check whether the picture directory exists: if (variable_get('user_pictures', 0)) { @@ -1771,13 +1910,54 @@ file_check_directory($picture_path, 1, 'user_picture_path'); } - $form['pictures'] = array('#type' => 'fieldset', '#title' => t('Pictures')); - $form['pictures']['user_pictures'] = array('#type' => 'radios', '#title' => t('Picture support'), '#default_value' => variable_get('user_pictures', 0), '#options' => array(t('Disabled'), t('Enabled')), '#description' => t('Enable picture support.')); - $form['pictures']['user_picture_path'] = array('#type' => 'textfield', '#title' => t('Picture image path'), '#default_value' => variable_get('user_picture_path', 'pictures'), '#size' => 30, '#maxlength' => 255, '#description' => t('Subdirectory in the directory "%dir" where pictures will be stored.', array('%dir' => file_directory_path() .'/'))); - $form['pictures']['user_picture_default'] = array('#type' => 'textfield', '#title' => t('Default picture'), '#default_value' => variable_get('user_picture_default', ''), '#size' => 30, '#maxlength' => 255, '#description' => t('URL of picture to display for users with no custom picture selected. Leave blank for none.')); - $form['pictures']['user_picture_dimensions'] = array('#type' => 'textfield', '#title' => t('Picture maximum dimensions'), '#default_value' => variable_get('user_picture_dimensions', '85x85'), '#size' => 15, '#maxlength' => 10, '#description' => t('Maximum dimensions for pictures.')); - $form['pictures']['user_picture_file_size'] = array('#type' => 'textfield', '#title' => t('Picture maximum file size'), '#default_value' => variable_get('user_picture_file_size', '30'), '#size' => 15, '#maxlength' => 10, '#description' => t('Maximum file size for pictures, in kB.')); - $form['pictures']['user_picture_guidelines'] = array('#type' => 'textarea', '#title' => t('Picture guidelines'), '#default_value' => variable_get('user_picture_guidelines', ''), '#description' => t('This text is displayed at the picture upload form in addition to the default guidelines. It\'s useful for helping or instructing your users.')); + $form['pictures'] = array( + '#type' => 'fieldset', + '#title' => t('Pictures'), + ); + $form['pictures']['user_pictures'] = array( + '#type' => 'radios', + '#title' => t('Picture support'), + '#default_value' => variable_get('user_pictures', 0), + '#options' => array(t('Disabled'), t('Enabled')), + '#description' => t('Enable picture support.'), + ); + $form['pictures']['user_picture_path'] = array( + '#type' => 'textfield', + '#title' => t('Picture image path'), + '#default_value' => variable_get('user_picture_path', 'pictures'), + '#size' => 30, + '#maxlength' => 255, + '#description' => t('Subdirectory in the directory "%dir" where pictures will be stored.', array('%dir' => file_directory_path() .'/')), + ); + $form['pictures']['user_picture_default'] = array( + '#type' => 'textfield', '#title' => t('Default picture'), + '#default_value' => variable_get('user_picture_default', ''), + '#size' => 30, + '#maxlength' => 255, + '#description' => t('URL of picture to display for users with no custom picture selected. Leave blank for none.'), + ); + $form['pictures']['user_picture_dimensions'] = array( + '#type' => 'textfield', + '#title' => t('Picture maximum dimensions'), + '#default_value' => variable_get('user_picture_dimensions', '85x85'), + '#size' => 15, + '#maxlength' => 10, + '#description' => t('Maximum dimensions for pictures.'), + ); + $form['pictures']['user_picture_file_size'] = array( + '#type' => 'textfield', + '#title' => t('Picture maximum file size'), + '#default_value' => variable_get('user_picture_file_size', '30'), + '#size' => 15, + '#maxlength' => 10, + '#description' => t('Maximum file size for pictures, in kB.'), + ); + $form['pictures']['user_picture_guidelines'] = array( + '#type' => 'textarea', + '#title' => t('Picture guidelines'), + '#default_value' => variable_get('user_picture_guidelines', ''), + '#description' => t('This text is displayed at the picture upload form in addition to the default guidelines. It\'s useful for helping or instructing your users.'), + ); return system_settings_form('user_configure_settings', $form); } @@ -1924,4 +2104,52 @@ exit(); } +/** + * Implementation of hook_comment(). + */ +function user_comment($comment, $op) { + if ($op == 'view') { + $node = node_load($comment->nid); + if (user_signature_is_allowed($node->type)) { + $comment->comment .= theme('user_signature', $comment->signature); + } + } + + return $comment; +} + +/** + * Implementation of hook_nodeapi(). + */ +function user_nodeapi(&$node, $op, $arg = 0) { + if (user_signature_is_allowed($node->type)) { + switch ($op) { + case 'view': + $node->body .= theme('user_signature', $node->signature); + break; + } + } +} + +/** + * Determines if signature type is allowed or not. + * + * @param $type + * A node type + * @return boolean + * Returns true if node type is allowed, false if it is not. + */ +function user_signature_is_allowed($type) { + $allowed_types = variable_get('signature_node_types', array()); + return ($allowed_types[$type] == 1); +} +/** + * Format a signature + * + * @return string + * HTML output of signature + */ +function theme_user_signature($signature) { + return sprintf(variable_get('signature_template', '--
%s
'), $signature); +}