Changeset 714405
- Timestamp:
- 05/17/2013 02:24:08 PM (13 years ago)
- Location:
- bp-group-dice/trunk
- Files:
-
- 1 deleted
- 5 edited
-
history.txt (modified) (1 diff)
-
includes/bp-group-dice-core.php (modified) (1 diff)
-
includes/bp-group-dice-functions.php (modified) (4 diffs)
-
loader.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
theme (deleted)
Legend:
- Unmodified
- Added
- Removed
-
bp-group-dice/trunk/history.txt
r401623 r714405 1 Version 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 1 6 Version 1.1 ( June 27th 2011 ) 2 7 -------------------------------------------------------------- 3 4 8 - Included theme files I forgot to add to initial release. 5 9 6 10 Version 1.0 ( June 14th 2011 ) 7 11 -------------------------------------------------------------- 8 9 12 - Initial Release. 10 -
bp-group-dice/trunk/includes/bp-group-dice-core.php
r396892 r714405 1 1 <?php 2 3 2 define ( 'BP_GROUP_DICE_IS_INSTALLED', 1 ); 4 define ( 'BP_GROUP_DICE_VERSION', '1. 0' );3 define ( 'BP_GROUP_DICE_VERSION', '1.2' ); 5 4 6 5 require( dirname( __FILE__ ) . '/bp-group-dice-functions.php' ); 7 6 8 if ( file_exists( dirname( __FILE__ ) . '/lang/' . get_locale() . '.mo' ) ) 9 load_textdomain( 'bp-group-dice', dirname( __FILE__ ) . '/lang/' . get_locale() . '.mo' ); 7 if ( file_exists( dirname( __FILE__ ) . '/lang/' . get_locale() . '.mo' ) ) load_textdomain( 'bp-group-dice', dirname( __FILE__ ) . '/lang/' . get_locale() . '.mo' ); 10 8 11 9 function bp_group_dice_setup_globals() { 12 10 global $bp, $wpdb; 13 14 11 $bp->dice->id = 'dice'; 15 12 -
bp-group-dice/trunk/includes/bp-group-dice-functions.php
r396892 r714405 38 38 return $post_id; 39 39 } 40 add_action( 'b p_forums_new_post', 'bp_group_dice_catch_forum_post' );40 add_action( 'bbp_new_reply_post_extras', 'bp_group_dice_catch_forum_post' ); 41 41 42 42 43 43 function bp_group_dice_display_roll_results() { 44 44 global $bp; 45 46 $dice_rolled = groups_get_groupmeta( $bp->groups->current_group->id, 'dice_rolled_for_post_' . b p_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() ); 47 47 48 48 if ( !$dice_rolled ) return false; … … 51 51 $dice_type = $dice_details[0]; 52 52 $dice_amount = $dice_details[1]; 53 $dice_results = maybe_unserialize( groups_get_groupmeta( $bp->groups->current_group->id, 'dice_results_for_post_' . b p_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() ) ); 54 54 if ( $dice_results ) { 55 55 $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; 58 61 } 59 62 } … … 62 65 Results: ' . $dice_results_formatted . ' 63 66 '; 64 65 67 return true; 66 68 } 67 add_action( 'b p_dice_group_forum_post_content', 'bp_group_dice_display_roll_results' );69 add_action( 'bbp_theme_after_reply_content', 'bp_group_dice_display_roll_results' ); 68 70 69 71 function bp_group_dice_add_rolling_form() { … … 80 82 jQuery('h4:contains("<?php _e( 'Add a reply:', 'buddypress' ) ?>")').remove(); 81 83 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> 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> 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"/>'); 83 88 } 84 89 </script> 85 90 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> WARNING: </strong>This will delete any text in the post below! 87 92 <?php 88 93 } 89 add_action( ' groups_forum_new_reply_before', 'bp_group_dice_add_rolling_form' );94 add_action( 'bbp_theme_before_reply_form_content', 'bp_group_dice_add_rolling_form' ); 90 95 91 96 function is_valid_dice_type( $dice_type ) { -
bp-group-dice/trunk/loader.php
r401623 r714405 2 2 /* 3 3 Plugin Name: BuddyPress Group Dice 4 Plugin URI: http:// namoo.co.uk4 Plugin URI: http://linktart.co.uk 5 5 Description: Dice rolling in forums for RP/etc groups 6 Version: 1. 17 Revision Date: June 27, 20118 Requires at least: WordPress 3. 1.0, BuddyPress 1.2.89 Tested up to: WordPress 3. 1.3, BuddyPress 1.2.86 Version: 1.2 7 Revision Date: May 17, 2013 8 Requires at least: WordPress 3.5.1, BuddyPress 1.7.2 9 Tested up to: WordPress 3.5.1, BuddyPress 1.7.2 10 10 License: AGPL 11 11 Author: David Cartwright -
bp-group-dice/trunk/readme.txt
r401623 r714405 1 1 === Plugin Name === 2 2 Contributors: aekeron 3 Tags: buddypress, ajax, chat, groups4 Requires at least: WordPress 3. 1.0, BuddyPress 1.2.85 Tested up to: WordPress 3. 1.3, BuddyPress 1.2.86 Stable tag: 1. 13 Tags: buddypress, groups, dice, games, game, gaming, roleplay 4 Requires at least: WordPress 3.5.1, BuddyPress 1.7.2 5 Tested up to: WordPress 3.5.1, BuddyPress 1.7.2 6 Stable tag: 1.2 7 7 8 8 BuddyPress Group Dice. … … 15 15 16 16 * 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.php18 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.24 17 25 18 == Notes ==
Note: See TracChangeset
for help on using the changeset viewer.