Changeset 901
- Timestamp:
- 02/23/08 17:10:51 (9 months ago)
- Files:
-
- bbpress-signatures/trunk/bb-signatures.php (modified) (6 diffs)
- bbpress-signatures/trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bbpress-signatures/trunk/bb-signatures.php
r806 r901 2 2 /* 3 3 Plugin Name: bbPress signatures 4 Plugin URI: http://bbpress.org/plugins/topic/63 4 5 Description: allows users to add signatures to their forum posts, including an optional per-post toggle 5 Plugin URI: http://bbpress.org/plugins/topic/63 6 Version: 0.16 6 7 Author: _ck_ 7 Author URI: http://CKon.wordpress.com 8 Version: 0.15 9 */ 10 /* 8 Author URI: http://bbshowcase.org 9 11 10 License: CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ 11 12 Donate: http://amazon.com/paypage/P2FBORKDEFQIVM 12 13 13 14 Instructions: install, activate, tinker with settings in admin menu … … 29 30 0.14 : signatures removed from rss feeds 30 31 0.15 : bug fix to maintain setting when posts are saved after edit 31 32 0.16 : minor bug fixes 32 33 */ 33 34 34 35 function bb_signatures_initialize() { 35 global $bb,$bb_current_user,$bb_signatures,$bb_signatures_type ;36 global $bb,$bb_current_user,$bb_signatures,$bb_signatures_type, $bb_signatures_extra; 36 37 if(!isset($bb_signatures)) {$bb_signatures = bb_get_option('bb_signatures'); 37 38 if (!$bb_signatures) { … … 39 40 $bb_signatures['max_lines']=3; // sanity 40 41 $bb_signatures['minimum_user_level']="participate"; // participate, moderate, administrate (watchout for typos) 42 $bb_signatures['one_per_user_per_page']=true; // only one signature shown for a user even if they have 2+ posts on a page 43 $bb_signatures['allow_per_post_signature_toggle']=true; // allows user decide which posts should have signatures 41 44 $bb_signatures['allow_html']=true ; // not implimented yet, obeys post text rules 42 45 $bb_signatures['allow_smilies']=true ; // not implimented yet, obeys post text rules 43 46 $bb_signatures['allow_images']=true ; // not implimented yet, obeys post text rules 44 $bb_signatures['one_per_user_per_page']=true; // only one signature shown for a user even if they have 2+ posts on a page45 $bb_signatures['allow_per_post_signature_toggle']=true; // allows user decide which posts should have signatures46 47 $bb_signatures['signature_question']="Show your signature on this post?"; 47 48 $bb_signatures['signature_instructions']="You may enter a short signature which will be shown below your posts."; 48 49 $bb_signatures['style']=".signature {clear:both;border-top:1px solid #222; font-size:85%; color:#777;padding:1em;}"; 49 } 50 }} 51 // if (BB_IS_ADMIN) { // doesn't exist until 1040 :-( 50 52 $bb_signatures_type['max_length']="numeric"; // sanity 51 53 $bb_signatures_type['max_lines']="numeric"; // sanity 52 54 $bb_signatures_type['minimum_user_level']="participate,moderate,administrate"; // participate, moderate, administrate (watchout for typos) 55 $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 56 $bb_signatures_type['allow_per_post_signature_toggle']="binary"; // let's user decide which posts should have signatures 53 57 $bb_signatures_type['allow_html']="binary"; // not implimented yet, obeys post text rules 54 58 $bb_signatures_type['allow_smilies']="binary"; // not implimented yet, obeys post text rules 55 59 $bb_signatures_type['allow_images']="binary"; // not implimented yet, obeys post text rules 56 $bb_signatures_type['one_per_user_per_page']="binary"; // only one signature shown for a user even if they have 2+ posts on a page57 $bb_signatures_type['allow_per_post_signature_toggle']="binary"; // let's user decide which posts should have signatures58 60 $bb_signatures_type['signature_question']="input"; 59 61 $bb_signatures_type['signature_instructions']="input"; 60 62 $bb_signatures_type['style']="textarea"; 61 } 63 64 $bb_signatures_extra['allow_html']="disabled"; // not implimented yet, obeys post text rules 65 $bb_signatures_extra['allow_smilies']="disabled" ; // not implimented yet, obeys post text rules 66 $bb_signatures_extra['allow_images']="disabled" ; // not implimented yet, obeys post text rules 67 // } 62 68 } 63 69 add_action( 'bb_init', 'bb_signatures_initialize'); 64 add_action( 'init', 'bb_signatures_initialize');65 70 66 71 function bb_signatures_add_css() { global $bb_signatures; echo '<style type="text/css">'.$bb_signatures['style'].'</style>'; … … 186 191 187 192 function bb_signatures_admin_page() { 188 global $bb_signatures,$bb_signatures_type ;193 global $bb_signatures,$bb_signatures_type,$bb_signatures_extra; 189 194 ?> 190 195 <h2>bbPress Signatures</h2> … … 205 210 switch ( $bb_signatures_type[$key]) : 206 211 case 'binary' : 207 ?><input type=radio name="<?php echo $key; ?>" value="1" <?php echo ($bb_signatures[$key]==true ? 'checked="checked"' : '');?> >YES208 <input type=radio name="<?php echo $key; ?>" value="0" <?php echo ($bb_signatures[$key]==false ? 'checked="checked"' : '');?> >NO <?php212 ?><input <?php echo ($test=$bb_signatures_extra[$key]) ? $test : ""; ?> type=radio name="<?php echo $key; ?>" value="1" <?php echo ($bb_signatures[$key]==true ? 'checked="checked"' : '');?> >YES 213 <input <?php echo ($test=$bb_signatures_extra[$key]) ? $test : ""; ?> type=radio name="<?php echo $key; ?>" value="0" <?php echo ($bb_signatures[$key]==false ? 'checked="checked"' : '');?> >NO <?php 209 214 break; 210 215 case 'numeric' : … … 232 237 </tbody> 233 238 </table> 234 <p class="submit"><input type="submit" name="submit" value="S ubmit"></p>239 <p class="submit"><input type="submit" name="submit" value="Save bbPress Signatures Settings"></p> 235 240 236 241 </form> bbpress-signatures/trunk/readme.txt
r807 r901 1 1 === bbPress Signatures === 2 Tags: signature, signatures 3 Contributors: 2 Tags: signature, signatures, _ck_ 3 Contributors: _ck_ 4 4 Requires at least: 0.8.2 5 5 Tested up to: trunk 6 6 Stable tag: trunk 7 Donate link: http://amazon.com/paypage/P2FBORKDEFQIVM 7 8 8 9 == Description == … … 19 20 If you would like the optional toggle on new/edit posts to allow the member to disable signatures on a per-post basis, 20 21 you must edit the edit-form.php & post-form.php templates and place at or near the bottom: 21 <? bb_signatures_checkbox(); ?> 22 `<? bb_signatures_checkbox(); ?>` 22 23 (you can optionally wrap that in a DIV and float it to the left, right style anyway you'd like) 23 24 24 25 == License == 25 26 26 CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/27 * CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ 27 28 28 == Version History==29 == Donate == 29 30 30 Version 0.11 (2007-07-31) 31 * http://amazon.com/paypage/P2FBORKDEFQIVM 32 33 == History == 34 35 = Version 0.11 (2007-07-31) = 31 36 32 37 * first public release 33 38 34 Version 0.15 (2008-01-30) 39 = Version 0.15 (2008-01-30) = 35 40 36 41 * signatures removed from rss feeds
