Changeset 901

Show
Ignore:
Timestamp:
02/23/08 17:10:51 (9 months ago)
Author:
_ck_
Message:

minor bug fixes + BB_IS_ADMIN does not exist before build 1040 :-(

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bbpress-signatures/trunk/bb-signatures.php

    r806 r901  
    22/* 
    33Plugin Name: bbPress signatures 
     4Plugin URI:  http://bbpress.org/plugins/topic/63 
    45Description:  allows users to add signatures to their forum posts, including an optional per-post toggle 
    5 Plugin URI:  http://bbpress.org/plugins/topic/63 
     6Version: 0.16 
    67Author: _ck_ 
    7 Author URI: http://CKon.wordpress.com 
    8 Version: 0.15 
    9 */ 
    10 /* 
     8Author URI: http://bbshowcase.org 
     9 
    1110License: CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ 
     11 
     12Donate: http://amazon.com/paypage/P2FBORKDEFQIVM 
    1213 
    1314Instructions:   install, activate, tinker with settings in admin menu 
     
    29300.14    : signatures removed from rss feeds 
    30310.15    : bug fix to maintain setting when posts are saved after edit  
    31  
     320.16    : minor bug fixes 
    3233*/ 
    3334 
    3435function 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
    3637        if(!isset($bb_signatures)) {$bb_signatures = bb_get_option('bb_signatures'); 
    3738                if (!$bb_signatures) { 
     
    3940                $bb_signatures['max_lines']=3;     // sanity  
    4041                $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 
    4144                $bb_signatures['allow_html']=true ;  // not implimented yet, obeys post text rules 
    4245                $bb_signatures['allow_smilies']=true ;  // not implimented yet, obeys post text rules 
    4346                $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 page 
    45                 $bb_signatures['allow_per_post_signature_toggle']=true;    // allows user decide which posts should have signatures 
    4647                $bb_signatures['signature_question']="Show your signature on this post?"; 
    4748                $bb_signatures['signature_instructions']="You may enter a short signature which will be shown below your posts."; 
    4849                $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 :-( 
    5052                $bb_signatures_type['max_length']="numeric";     // sanity  
    5153                $bb_signatures_type['max_lines']="numeric";     // sanity  
    5254                $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 
    5357                $bb_signatures_type['allow_html']="binary";  // not implimented yet, obeys post text rules 
    5458                $bb_signatures_type['allow_smilies']="binary";  // not implimented yet, obeys post text rules 
    5559                $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 page 
    57                 $bb_signatures_type['allow_per_post_signature_toggle']="binary";    // let's user decide which posts should have signatures 
    5860                $bb_signatures_type['signature_question']="input"; 
    5961                $bb_signatures_type['signature_instructions']="input";           
    6062                $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        // } 
    6268}        
    6369add_action( 'bb_init', 'bb_signatures_initialize'); 
    64 add_action( 'init', 'bb_signatures_initialize'); 
    6570         
    6671function bb_signatures_add_css() { global $bb_signatures;  echo '<style type="text/css">'.$bb_signatures['style'].'</style>';  
     
    186191 
    187192function bb_signatures_admin_page() { 
    188         global $bb_signatures,$bb_signatures_type;             
     193        global $bb_signatures,$bb_signatures_type,$bb_signatures_extra;                
    189194        ?> 
    190195                <h2>bbPress Signatures</h2> 
     
    205210                                                        switch ( $bb_signatures_type[$key]) : 
    206211                                                        case 'binary' : 
    207                                                                 ?><input type=radio name="<?php echo $key;  ?>" value="1" <?php echo ($bb_signatures[$key]==true ? 'checked="checked"' : '');?> >YES 
    208                                                                      <input type=radio name="<?php echo $key;  ?>" value="0" <?php echo ($bb_signatures[$key]==false ? 'checked="checked"' : '');?> >NO <?php 
     212                                                                ?><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 &nbsp; &nbsp; 
     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 
    209214                                                        break; 
    210215                                                        case 'numeric' : 
     
    232237                                </tbody> 
    233238                        </table> 
    234                         <p class="submit"><input type="submit" name="submit" value="Submit"></p> 
     239                        <p class="submit"><input type="submit" name="submit" value="Save bbPress Signatures Settings"></p> 
    235240                 
    236241                </form> 
  • bbpress-signatures/trunk/readme.txt

    r807 r901  
    11=== bbPress Signatures === 
    2 Tags: signature, signatures 
    3 Contributors:  
     2Tags: signature, signatures, _ck_ 
     3Contributors: _ck_ 
    44Requires at least: 0.8.2 
    55Tested up to: trunk 
    66Stable tag: trunk 
     7Donate link: http://amazon.com/paypage/P2FBORKDEFQIVM 
    78 
    89== Description == 
     
    1920If you would like the optional toggle on new/edit posts to allow the member to disable signatures  on a per-post basis,  
    2021you 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(); ?>` 
    2223(you can optionally wrap that in a DIV and float it to the left, right style anyway you'd like) 
    2324 
    2425== License == 
    2526 
    26 CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ 
     27* CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ 
    2728 
    28 == Version History == 
     29== Donate == 
    2930 
    30 Version 0.11 (2007-07-31) 
     31* http://amazon.com/paypage/P2FBORKDEFQIVM 
     32 
     33== History == 
     34 
     35= Version 0.11 (2007-07-31) = 
    3136 
    3237* first public release 
    3338 
    34 Version 0.15 (2008-01-30) 
     39= Version 0.15 (2008-01-30) = 
    3540 
    3641*       signatures removed from rss feeds