Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Plugin: [REL] Signature


wittmania
Member

@wittmania

OK, to answer the “where do I put the code question (0.8.1)…

In functions.php, find the get_profile_info_keys() function, which should be on or around line 1761. In the line that starts with array('user_email'..., add the following code before the last “)” in the line. Note the comma.

, 'sig' => array(0, __('Signature'))

This will add the signature field to the profile edit page, enabling users to input their own signatures.

Next, we need to add the code to display the signatures in their posts. In post.php, find this line (for me it was line 17):

<div class="post"><?php post_text(); ?></div>

BEFORE the closing div tag, add the following:

<?php /*Is the signature field blank?*/
if (get_sig( get_post_author_id() ) != "") { ?>
<div class="signature"><?php post_sig(); ?></div>
<?php } ?>

(NOTE: Make sure the existing closing div tag still follows the code above.)

This checks to see if a signature exists, and if it does it adds a nested div with the signature class stylization applied to it, and the content of the signature field is placed inside this div.

Finally, add the following to your style sheet:

.signature {
border-top: 1px dotted #ccc;
margin: 5px 0 0;
padding: 5px 0 0;
}

If you are using the default theme, this will style the signature div exactly like the poststuff div that follows it.

Please note that (at this time) signatures are text-only. You may want to let your users know by adding a note in the functions.php array declaration. Something like 'Signature (text only)' would do the trick.

I don’t know if it’s possible, but it would be nice if this plugin would be modified so that it can display images, links, and so on in the signature. Does anyone know how to do that?

Thanks!

Skip to toolbar