Plugin: [REL] Signature
-
Hi,
Heres my first plugin which was pretty much copied from the Avatar plugin, but hey, now I can contribute my 2 cents (Thanks to the guy who made that too)
To install you must open functions.php (in bb-includes, line 1388) and add:
'sig' => array(0, __('Signature'))
to the end (before last closing bracket)
This is the code:
<?php
/*
Plugin Name: Signature
Author: veb
Version: 1.0
*/
function post_sig() { // function to use in page php to get the sig
if ( get_sig( get_post_author_id() ) )
echo get_sig( get_post_author_id() );
}
function get_sig ( $id ) { //function to return sig lfrom database
global $bbdb, $bb_current_user;
$user = bb_get_user( $id );
$profile_info_keys = get_profile_info_keys();
if ( $id && false !== $user )
if ( is_array( $profile_info_keys ) )
foreach ( $profile_info_keys as $key => $label ) {
if ( 'sig' == $key )
return $user->$key;
}
}
?>
Save as bb-signature.php in my-plugins.
Have fun
- You must be logged in to reply to this topic.