Plugin Directory

Changeset 714405


Ignore:
Timestamp:
05/17/2013 02:24:08 PM (13 years ago)
Author:
Aekeron
Message:

1.2 release - support for WP 3.5.1 and BP 1.7.2.

Location:
bp-group-dice/trunk
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • bp-group-dice/trunk/history.txt

    r401623 r714405  
     1Version 1.2 ( May 17th 2013 )
     2---------------------------------------------------------------
     3- Updated to work with bbpress group forums at vulneratum's request.
     4- Slight changes to formatting and warning added about removing reply textbox.
     5
    16Version 1.1 ( June 27th 2011 )
    27--------------------------------------------------------------
    3 
    48- Included theme files I forgot to add to initial release.
    59
    610Version 1.0 ( June 14th 2011 )
    711--------------------------------------------------------------
    8 
    912- Initial Release.
    10 
  • bp-group-dice/trunk/includes/bp-group-dice-core.php

    r396892 r714405  
    11<?php
    2 
    32define ( 'BP_GROUP_DICE_IS_INSTALLED', 1 );
    4 define ( 'BP_GROUP_DICE_VERSION', '1.0' );
     3define ( 'BP_GROUP_DICE_VERSION', '1.2' );
    54
    65require( dirname( __FILE__ ) . '/bp-group-dice-functions.php' );
    76
    8 if ( file_exists( dirname( __FILE__ ) . '/lang/' . get_locale() . '.mo' ) )
    9     load_textdomain( 'bp-group-dice', dirname( __FILE__ ) . '/lang/' . get_locale() . '.mo' );
     7if ( file_exists( dirname( __FILE__ ) . '/lang/' . get_locale() . '.mo' ) ) load_textdomain( 'bp-group-dice', dirname( __FILE__ ) . '/lang/' . get_locale() . '.mo' );
    108
    119function bp_group_dice_setup_globals() {
    1210    global $bp, $wpdb;
    13 
    1411    $bp->dice->id = 'dice';
    1512
  • bp-group-dice/trunk/includes/bp-group-dice-functions.php

    r396892 r714405  
    3838    return $post_id;
    3939}
    40 add_action( 'bp_forums_new_post', 'bp_group_dice_catch_forum_post' );
     40add_action( 'bbp_new_reply_post_extras', 'bp_group_dice_catch_forum_post' );
    4141
    4242
    4343function bp_group_dice_display_roll_results() {
    4444    global $bp;
    45        
    46     $dice_rolled = groups_get_groupmeta( $bp->groups->current_group->id, 'dice_rolled_for_post_' . bp_get_the_topic_post_id() );
     45   
     46    $dice_rolled = groups_get_groupmeta( $bp->groups->current_group->id, 'dice_rolled_for_post_' . bbp_get_reply_id() );
    4747   
    4848    if ( !$dice_rolled ) return false;
     
    5151    $dice_type = $dice_details[0];
    5252    $dice_amount = $dice_details[1];
    53     $dice_results = maybe_unserialize( groups_get_groupmeta( $bp->groups->current_group->id, 'dice_results_for_post_' . bp_get_the_topic_post_id() ) );
     53    $dice_results = maybe_unserialize( groups_get_groupmeta( $bp->groups->current_group->id, 'dice_results_for_post_' . bbp_get_reply_id() ) );
    5454    if ( $dice_results ) {
    5555        $dice_results_formatted = '';
    56         foreach ( $dice_results as $dice_result ) {
    57             $dice_results_formatted .= $dice_result . ' ';
     56        foreach ( $dice_results as $key => $dice_result ) {
     57            if ( $key && ( $key < ( count( $dice_results ) ) ) ) {
     58                $dice_results_formatted .= ', ';
     59            }
     60            $dice_results_formatted .= $dice_result;
    5861        }
    5962    }
     
    6265            Results: ' . $dice_results_formatted . '
    6366         ';
    64    
    6567    return true;
    6668}
    67 add_action( 'bp_dice_group_forum_post_content', 'bp_group_dice_display_roll_results' );
     69add_action( 'bbp_theme_after_reply_content', 'bp_group_dice_display_roll_results' );
    6870
    6971function bp_group_dice_add_rolling_form() {
     
    8082        jQuery('h4:contains("<?php _e( 'Add a reply:', 'buddypress' ) ?>")').remove();
    8183        jQuery('.submit').children('#submit').remove();
    82         jQuery('#post-reply').html('<input type="hidden" id="reply_text" name="reply_text" value="<?php _e( 'Dice Roll', 'bp_group_dice' ) ?>"/>Dice type: <select name="dice_type" id="dice_type"><option value="3">D3</option><option value="4">D4</option><option value="6">D6</option><option value="8">D8</option><option value="10">D10</option><option value="12">D12</option><option value="20">D20</option><option value="100">D100</option></select>&nbsp;&nbsp;Amount: <select name="dice_number" id="dice_number"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select><div class="submit"><input id="submit" type="submit" value="Roll the dice!" name="submit_reply"></div><input type="hidden" name="bp_dice_roll" id="bp_dice_roll" value="1"/>');
     84        jQuery('.bbp-template-notice').next().remove();
     85        jQuery('.bbp-template-notice').remove();
     86        jQuery('#new-post').children().children().first().prepend().html('Dice Roller');
     87        jQuery('#new-post').children().children().first().after('<input type="hidden" id="bbp_reply_content" name="bbp_reply_content" value="<?php _e( 'Dice Roll', 'bp_group_dice' ) ?>"/>Dice type: <select name="dice_type" id="dice_type"><option value="3">D3</option><option value="4">D4</option><option value="6">D6</option><option value="8">D8</option><option value="10">D10</option><option value="12">D12</option><option value="20">D20</option><option value="100">D100</option></select>&nbsp;&nbsp;Amount: <select name="dice_number" id="dice_number"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select><div class="submit"><input id="submit" type="submit" value="Roll the dice!" name="submit_reply"></div><input type="hidden" name="bp_dice_roll" id="bp_dice_roll" value="1"/>');
    8388    }
    8489    </script>
    8590   
    86     <input id="show-roller-button" type="button" onclick="loadDiceRoller();return false;" value="Click to Initiate Dice Roll"/>
     91    <input id="show-roller-button" type="button" onclick="loadDiceRoller();return false;" value="Click to Initiate Dice Roll"/> <strong>&nbsp;WARNING: </strong>This will delete any text in the post below!
    8792    <?php
    8893}
    89 add_action( 'groups_forum_new_reply_before', 'bp_group_dice_add_rolling_form' );
     94add_action( 'bbp_theme_before_reply_form_content', 'bp_group_dice_add_rolling_form' );
    9095
    9196function is_valid_dice_type( $dice_type ) {
  • bp-group-dice/trunk/loader.php

    r401623 r714405  
    22/*
    33Plugin Name: BuddyPress Group Dice
    4 Plugin URI: http://namoo.co.uk
     4Plugin URI: http://linktart.co.uk
    55Description: Dice rolling in forums for RP/etc groups
    6 Version: 1.1
    7 Revision Date: June 27, 2011
    8 Requires at least: WordPress 3.1.0, BuddyPress 1.2.8
    9 Tested up to: WordPress 3.1.3, BuddyPress 1.2.8
     6Version: 1.2
     7Revision Date: May 17, 2013
     8Requires at least: WordPress 3.5.1, BuddyPress 1.7.2
     9Tested up to: WordPress 3.5.1, BuddyPress 1.7.2
    1010License: AGPL
    1111Author: David Cartwright
  • bp-group-dice/trunk/readme.txt

    r401623 r714405  
    11=== Plugin Name ===
    22Contributors: aekeron
    3 Tags: buddypress, ajax, chat, groups
    4 Requires at least: WordPress 3.1.0, BuddyPress 1.2.8
    5 Tested up to: WordPress 3.1.3, BuddyPress 1.2.8
    6 Stable tag: 1.1
     3Tags: buddypress, groups, dice, games, game, gaming, roleplay
     4Requires at least: WordPress 3.5.1, BuddyPress 1.7.2
     5Tested up to: WordPress 3.5.1, BuddyPress 1.7.2
     6Stable tag: 1.2
    77
    88BuddyPress Group Dice.
     
    1515
    1616* Download and upload the plugin to your plugins folder. Activate.
    17 * Copy topic.php to your theme folder.  Path should be: active theme directory/groups/single/forum/topic.php
    18 
    19 If you are using a custom theme you can instead insert:
    20 `<?php do_action( 'bp_dice_group_forum_post_content' ); ?>`
    21 immediately after:
    22 `<?php bp_the_topic_post_content() ?>`
    23 in your active theme directory/groups/single/forum/topic.php file.
    2417                   
    2518== Notes ==
Note: See TracChangeset for help on using the changeset viewer.