(you can wrap it in a DIV and float it to the left, right style anyway you'd like) */ add_action('bb_init', 'bb_signatures_initialize'); add_action('bb_head', 'bb_signatures_add_css'); add_action('extra_profile_info', 'add_signature_to_profile_edit'); add_action('profile_edited', 'update_user_signature'); add_action('bb_update_post', 'bb_signatures_exclude_posts_update'); add_filter('post_text','add_signature_to_post',5); if (defined('BACKPRESS_PATH')) {add_action('bb-post.php', 'bb_signatures_exclude_posts_update');} else {add_action('bb_post.php', 'bb_signatures_exclude_posts_update');} if ((defined('BB_IS_ADMIN') && BB_IS_ADMIN) || !(strpos($_SERVER['REQUEST_URI'],"/bb-admin/")===false)) { // "stub" only load functions if in admin if (isset($_GET['plugin']) && ($_GET['plugin']=="bb_signatures_admin" || strpos($_GET['plugin'],"bb-signatures.php"))) {require_once("bb-signatures-admin.php");} add_action( 'bb_admin_menu_generator', 'bb_signatures_add_admin_page' ); bb_register_activation_hook(str_replace(array(str_replace("/","\\",BB_PLUGIN_DIR),str_replace("/","\\",BB_CORE_PLUGIN_DIR)),array("user#","core#"),__FILE__), 'bb_signatures_install'); function bb_signatures_add_admin_page() {bb_admin_add_submenu(__('Signatures'), 'administrate', 'bb_signatures_admin');} function bb_signatures_install() {global $bb_signatures; bb_signatures_initialize(); bb_update_option('bb_signatures',$bb_signatures);} } function bb_signatures_initialize() { global $bb,$bb_current_user,$bb_signatures,$bb_signatures_type, $bb_signatures_extra; if (!isset($bb_signatures)) {$bb_signatures = bb_get_option('bb_signatures'); if (empty($bb_signatures)) { $bb_signatures['max_length']=300; // sanity $bb_signatures['max_lines']=3; // sanity $bb_signatures['minimum_user_level']="participate"; // participate, moderate, administrate (watchout for typos) $bb_signatures['one_per_user_per_page']=true; // only one signature shown for a user even if they have 2+ posts on a page $bb_signatures['allow_per_post_signature_toggle']=true; // allows user decide which posts should have signatures $bb_signatures['allow_html']=true ; // not implemented yet, obeys post text rules $bb_signatures['allow_smilies']=true ; // not implemented yet, obeys post text rules $bb_signatures['allow_images']=true ; // not implemented yet, obeys post text rules $bb_signatures['signature_question']="Show your signature on this post?"; $bb_signatures['signature_instructions']="You may enter a short signature which will be shown below your posts."; $bb_signatures['style']=".signature {padding:1em; border-top:1px solid #ccc; font-size:0.87em; color:#444;}"; // add clear:both; for very bottom }} // if (BB_IS_ADMIN) { // doesn't exist until 1040 :-( $bb_signatures_type['max_length']="numeric"; // sanity $bb_signatures_type['max_lines']="numeric"; // sanity $bb_signatures_type['minimum_user_level']="participate,moderate,administrate"; // participate, moderate, administrate (watchout for typos) $bb_signatures_type['one_per_user_per_page']="binary"; // only one signature shown for a user even if they have 2+ posts on a page $bb_signatures_type['allow_per_post_signature_toggle']="binary"; // let's user decide which posts should have signatures $bb_signatures_type['allow_html']="binary"; // not implemented yet, obeys post text rules $bb_signatures_type['allow_smilies']="binary"; // not implemented yet, obeys post text rules $bb_signatures_type['allow_images']="binary"; // not implemented yet, obeys post text rules $bb_signatures_type['signature_question']="input"; $bb_signatures_type['signature_instructions']="input"; $bb_signatures_type['style']="textarea"; $bb_signatures_extra['allow_html']="disabled"; // not implemented yet, obeys post text rules $bb_signatures_extra['allow_smilies']="disabled" ; // not implemented yet, obeys post text rules $bb_signatures_extra['allow_images']="disabled" ; // not implemented yet, obeys post text rules // } } function bb_signatures_add_css() { global $bb_signatures; echo ''; } function add_signature_to_post($text) { if (!is_bb_feed()) { global $bb_post,$bb_signatures,$bb_signatures_on_page; // if (bb_current_user_can($bb_signatures['minimum_user_level']) ) : // only enabled for testing on my own rig $user_id=$bb_post->poster_id; if (($bb_signatures['one_per_user_per_page'] && $bb_signatures_on_page[$user_id]) || bb_signatures_exclude_posts_check($bb_post->post_id)) {return $text;} if ($signature=fetch_user_signature($user_id)) : $text.='