myCRED - Version 1.1

Version Description

  • Added new Email Notices Add-on.
  • Added new Ranks Add-on.

  • Added support for WP-Polls plugin.

  • Added support for WP Favorite Posts.

  • Added support for Events Manager plugin.

  • Added support for MarketPress (Gateway Add-on).

  • Added Zombaio as Payment Gateway for the buyCRED Add-on.

  • Added filter mycred_label to allow white-labeling of myCRED.

  • Added new template tags to: General and User related.

  • Added new shortcode [mycred_link] to award points for users clicking on web links.

  • Added new shortcode [mycred_give] to award x number of points to the current user.

  • Added new shortcode [mycred_send] to send a given user x number of points if the current user can afford it.

  • Added new shortcode [mycred_render_my_rank] to show either a given users rank or the current users rank. Requires Ranks Add-on.

  • Added new shortcode [mycred_users_of_rank] to show all users of a given rank. Requires Ranks Add-on.

  • Added new shortcode [mycred_users_of_all_ranks] to show all users of every published rank in order. Requires Ranks Add-on.

  • Added the option to let purchases made with the Sell Content add-on to expire after an x number of hours.

  • Added new shortcode [mycred_sell_this_ajax] to allow sale of content using AJAX. Note this shortcode can only be used once per content.

  • Adjusted the myCRED List Widget to offer the same features as the [mycred_leaderboard] shortcode, adding the option to offset or change order of list.

  • Adjusted the buyCRED Forms submit button location. (Suggested by dambacher)

  • Adjusted the Transfer form with new CSS styling.

  • Adjusted add_points() method to allow admins to change users points balances without making a log entry.

  • Renamed the default %rank% template tag to %ranking% to give space for the Ranks Add-on.

  • Fixed Bug #27 - Premium Content Author can not see their own content without paying.

  • Fixed Bug #28 - make_purchase() method referencing arguments that does not exist (renamed).

  • Fixed Bug #29 - ABSPATH issue with WP Stage plugin. (Fixed by clariner)

  • Fixed Bug #30 - WooCommerce division by zero error. (Thanks hamzahali)

Download this release

Release Info

Developer designbymerovingi
Plugin Icon 128x128 myCRED
Version 1.1
Comparing to
See all releases

Code changes from version 1.0.9.3 to 1.1

Files changed (47) hide show
  1. abstracts/mycred-abstract-hook.php +6 -3
  2. addons/buddypress/myCRED-addon-buddypress.php +11 -2
  3. addons/buy-creds/abstracts/mycred-abstract-payment-gateway.php +16 -6
  4. addons/buy-creds/gateways/netbilling.php +2 -3
  5. addons/buy-creds/gateways/paypal-standard.php +1 -2
  6. addons/buy-creds/gateways/skrill.php +1 -2
  7. addons/buy-creds/gateways/zombaio.php +392 -0
  8. addons/buy-creds/images/zombaio.jpg +0 -0
  9. addons/buy-creds/myCRED-addon-buy-creds.php +20 -10
  10. addons/email-notices/css/edit-email-notice.css +11 -0
  11. addons/email-notices/css/email-notice.css +2 -0
  12. addons/email-notices/myCRED-addon-email-notices.php +946 -0
  13. addons/gateway/carts/mycred-marketpress.php +416 -0
  14. addons/gateway/carts/mycred-woocommerce.php +9 -1
  15. addons/gateway/myCRED-addon-gateway.php +4 -3
  16. addons/import/myCRED-addon-import.php +1 -1
  17. addons/ranks/includes/index.php +3 -0
  18. addons/ranks/includes/mycred-rank-functions.php +311 -0
  19. addons/ranks/includes/mycred-rank-shortcodes.php +169 -0
  20. addons/ranks/index.php +3 -0
  21. addons/ranks/myCRED-addon-ranks.php +598 -0
  22. addons/sell-content/js/buy-content.js +46 -0
  23. addons/sell-content/js/index.php +3 -0
  24. addons/sell-content/myCRED-addon-sell-content.php +324 -44
  25. addons/transfer/css/transfer.css +6 -8
  26. addons/transfer/js/transfer.js +17 -4
  27. addons/transfer/myCRED-addon-transfer.php +42 -15
  28. assets/css/admin.css +1 -1
  29. assets/js/links.js +45 -0
  30. assets/js/send.js +67 -0
  31. includes/mycred-admin.php +7 -2
  32. includes/mycred-functions.php +71 -48
  33. includes/mycred-install.php +30 -1
  34. includes/mycred-network.php +6 -5
  35. includes/mycred-rankings.php +2 -23
  36. includes/mycred-shortcodes.php +287 -0
  37. includes/mycred-widgets.php +63 -22
  38. lang/mycred-en_US.mo +0 -0
  39. lang/mycred-en_US.po +1734 -543
  40. modules/mycred-module-addons.php +17 -8
  41. modules/mycred-module-general.php +1 -1
  42. modules/mycred-module-help.php +2 -2
  43. modules/mycred-module-hooks.php +184 -471
  44. modules/mycred-module-log.php +2 -2
  45. modules/mycred-module-plugins.php +974 -0
  46. mycred.php +123 -15
  47. readme.txt +46 -6
abstracts/mycred-abstract-hook.php CHANGED
@@ -118,9 +118,9 @@ if ( !class_exists( 'myCRED_Hook' ) ) {
118
  /**
119
  * Impose Limits Dropdown
120
  * @since 0.1
121
- * @version 1.0
122
  */
123
- function impose_limits_dropdown( $pref_id = '' ) {
124
  $limits = array(
125
  '' => __( 'No limit', 'mycred' ),
126
  'twentyfour' => __( 'Once every 24 hours', 'mycred' ),
@@ -131,7 +131,10 @@ if ( !class_exists( 'myCRED_Hook' ) ) {
131
  $limits = apply_filters( 'mycred_hook_impose_limits', $limits );
132
 
133
  echo '<select name="' . $this->field_name( $pref_id ) . '" id="' . $this->field_id( $pref_id ) . '">';
134
- echo '<option value="">' . __( 'Select', 'mycred' ) . '</option>';
 
 
 
135
  foreach ( $limits as $value => $description ) {
136
  echo '<option value="' . $value . '"';
137
  if ( $this->prefs[$pref_id] == $value ) echo ' selected="selected"';
118
  /**
119
  * Impose Limits Dropdown
120
  * @since 0.1
121
+ * @version 1.1
122
  */
123
+ function impose_limits_dropdown( $pref_id = '', $use_select = true ) {
124
  $limits = array(
125
  '' => __( 'No limit', 'mycred' ),
126
  'twentyfour' => __( 'Once every 24 hours', 'mycred' ),
131
  $limits = apply_filters( 'mycred_hook_impose_limits', $limits );
132
 
133
  echo '<select name="' . $this->field_name( $pref_id ) . '" id="' . $this->field_id( $pref_id ) . '">';
134
+
135
+ if ( $use_select )
136
+ echo '<option value="">' . __( 'Select', 'mycred' ) . '</option>';
137
+
138
  foreach ( $limits as $value => $description ) {
139
  echo '<option value="' . $value . '"';
140
  if ( $this->prefs[$pref_id] == $value ) echo ' selected="selected"';
addons/buddypress/myCRED-addon-buddypress.php CHANGED
@@ -126,7 +126,7 @@ if ( !class_exists( 'myCRED_BuddyPress' ) ) {
126
 
127
  $balance = $this->core->get_users_cred( $user_id ); ?>
128
 
129
- <tr id="wp_displayname">
130
  <td class="label"><?php
131
 
132
  // Balance label
@@ -158,7 +158,14 @@ if ( !class_exists( 'myCRED_BuddyPress' ) ) {
158
  $template = $this->buddypress['balance_template'];
159
  $template = str_replace( '%number%', $balance, $template );
160
  $template = str_replace( '%creds%', $this->core->format_creds( $balance ), $template );
161
- $template = str_replace( '%rank%', mycred_rankings_position( $user_id ), $template );
 
 
 
 
 
 
 
162
 
163
  echo '<div id="mycred-my-balance">' . $this->core->template_tags_general( $template ) . '</div>';
164
  }
@@ -392,6 +399,8 @@ if ( !class_exists( 'myCRED_BuddyPress' ) ) {
392
  <label for="<?php echo $this->field_id( 'balance_template' ); ?>"><?php _e( 'Template', 'mycred' ); ?></label>
393
  <div class="h2"><input type="text" name="<?php echo $this->field_name( 'balance_template' ); ?>" id="<?php echo $this->field_id( 'balance_template' ); ?>" value="<?php echo $settings['balance_template']; ?>" class="long" /></div>
394
  <span class="description"><?php _e( 'Available template tags are: %creds%, %number%, %rank%', 'mycred' ); ?></span>
 
 
395
  </li>
396
  </ol>
397
  <label class="subheader" for="<?php echo $this->field_id( 'history_location' ); ?>"><?php echo $this->core->template_tags_general( __( '%plural% History', 'mycred' ) ); ?></label>
126
 
127
  $balance = $this->core->get_users_cred( $user_id ); ?>
128
 
129
+ <tr id="mycred-users-balance">
130
  <td class="label"><?php
131
 
132
  // Balance label
158
  $template = $this->buddypress['balance_template'];
159
  $template = str_replace( '%number%', $balance, $template );
160
  $template = str_replace( '%creds%', $this->core->format_creds( $balance ), $template );
161
+ if ( function_exists( 'mycred_get_users_rank' ) ) {
162
+ $rank_name = mycred_get_users_rank( $user_id );
163
+ $template = str_replace( '%rank%', $rank_name, $template );
164
+ $template = str_replace( '%rank_logo%', mycred_get_rank_logo( $rank_name ), $template );
165
+ }
166
+ else {
167
+ $template = str_replace( '%rank%', mycred_rankings_position( $user_id ), $template );
168
+ }
169
 
170
  echo '<div id="mycred-my-balance">' . $this->core->template_tags_general( $template ) . '</div>';
171
  }
399
  <label for="<?php echo $this->field_id( 'balance_template' ); ?>"><?php _e( 'Template', 'mycred' ); ?></label>
400
  <div class="h2"><input type="text" name="<?php echo $this->field_name( 'balance_template' ); ?>" id="<?php echo $this->field_id( 'balance_template' ); ?>" value="<?php echo $settings['balance_template']; ?>" class="long" /></div>
401
  <span class="description"><?php _e( 'Available template tags are: %creds%, %number%, %rank%', 'mycred' ); ?></span>
402
+ <?php if ( function_exists( 'mycred_get_users_rank' ) ) echo '<br /><span class="description">' . __( 'Note that you can also use %rank_logo% to show the feature image of the rank.', 'mycred' ) . '</span>'; ?>
403
+
404
  </li>
405
  </ol>
406
  <label class="subheader" for="<?php echo $this->field_id( 'history_location' ); ?>"><?php echo $this->core->template_tags_general( __( '%plural% History', 'mycred' ) ); ?></label>
addons/buy-creds/abstracts/mycred-abstract-payment-gateway.php CHANGED
@@ -273,9 +273,11 @@ if ( !class_exists( 'myCRED_Payment_Gateway' ) ) {
273
  if ( $this->prefs['sandbox'] ) {
274
  echo '<pre>request: ' . print_r( $hidden_fields, true ) . '</pre>';
275
 
276
- echo '<pre>sales_data: ' . print_r( $this->decode_sales_data( $hidden_fields[$sales_data] ), true ) . '</pre>';
 
277
 
278
- echo '<pre>length: ' . print_r( strlen( $hidden_fields[$sales_data] ), true ) . '</pre>';
 
279
  }
280
  ?>
281
 
@@ -334,8 +336,12 @@ if ( !class_exists( 'myCRED_Payment_Gateway' ) ) {
334
  * @version 1.0
335
  */
336
  public function get_thankyou() {
337
- if ( $this->core->buy_creds['thankyou']['use'] == 'page' )
338
- return get_permalink( $this->core->buy_creds['thankyou']['page'] );
 
 
 
 
339
  else
340
  return get_bloginfo( 'url' ) . '/' . $this->core->buy_creds['thankyou']['custom'];
341
  }
@@ -346,8 +352,12 @@ if ( !class_exists( 'myCRED_Payment_Gateway' ) ) {
346
  * @version 1.1
347
  */
348
  public function get_cancelled() {
349
- if ( $this->core->buy_creds['cancelled']['use'] == 'page' )
350
- return get_permalink( $this->core->buy_creds['cancelled']['page'] );
 
 
 
 
351
  else
352
  return get_bloginfo( 'url' ) . '/' . $this->core->buy_creds['cancelled']['custom'];
353
  }
273
  if ( $this->prefs['sandbox'] ) {
274
  echo '<pre>request: ' . print_r( $hidden_fields, true ) . '</pre>';
275
 
276
+ if ( !empty( $sales_data ) && isset( $hidden_fields[$sales_data] ) )
277
+ echo '<pre>sales_data: ' . print_r( $this->decode_sales_data( $hidden_fields[$sales_data] ), true ) . '</pre>';
278
 
279
+ if ( isset( $hidden_fields[$sales_data] ) )
280
+ echo '<pre>length: ' . print_r( strlen( $hidden_fields[$sales_data] ), true ) . '</pre>';
281
  }
282
  ?>
283
 
336
  * @version 1.0
337
  */
338
  public function get_thankyou() {
339
+ if ( $this->core->buy_creds['thankyou']['use'] == 'page' ) {
340
+ if ( empty( $this->core->buy_creds['thankyou']['page'] ) )
341
+ return get_bloginfo( 'url' );
342
+ else
343
+ return get_permalink( $this->core->buy_creds['thankyou']['page'] );
344
+ }
345
  else
346
  return get_bloginfo( 'url' ) . '/' . $this->core->buy_creds['thankyou']['custom'];
347
  }
352
  * @version 1.1
353
  */
354
  public function get_cancelled() {
355
+ if ( $this->core->buy_creds['cancelled']['use'] == 'page' ) {
356
+ if ( empty( $this->core->buy_creds['cancelled']['page'] ) )
357
+ return get_bloginfo( 'url' );
358
+ else
359
+ return get_permalink( $this->core->buy_creds['cancelled']['page'] );
360
+ }
361
  else
362
  return get_bloginfo( 'url' ) . '/' . $this->core->buy_creds['cancelled']['custom'];
363
  }
addons/buy-creds/gateways/netbilling.php CHANGED
@@ -353,7 +353,7 @@ if ( !class_exists( 'myCRED_NETbilling' ) ) {
353
  // Transaction Approved, add creds
354
  if ( $this->status == 'approved' ) {
355
  // Make sure this transaction is unique
356
- if ( $this->transaction_id_is_unique( $trans_id ) ) {
357
  $this->status = 'fail';
358
  $this->response = __( 'Duplicate transaction. Please contact support', 'mycred' );
359
  return;
@@ -604,7 +604,6 @@ if ( !class_exists( 'myCRED_NETbilling' ) ) {
604
  public function preferences( $buy_creds ) {
605
  $prefs = $this->prefs; ?>
606
 
607
- <!--<pre><?php print_r( $this ); ?></pre>-->
608
  <label class="subheader" for="<?php echo $this->field_id( 'sandbox' ); ?>"><?php _e( 'Sandbox Mode', 'mycred' ); ?></label>
609
  <ol>
610
  <li>
@@ -694,7 +693,7 @@ if ( !class_exists( 'myCRED_NETbilling' ) ) {
694
  if ( $data['exchange'] != 1 && substr( $data['exchange'], 0, 1 ) != '0' ) {
695
  $data['exchange'] = (float) '0' . $data['exchange'];
696
  }
697
- // Make sure decimals are marked by a dot and not a comma
698
  $data['exchange'] = str_replace( ',', '.', $data['exchange'] );
699
 
700
  $data['disable_avs'] = ( isset( $data['disable_avs'] ) ) ? 1 : 0;
353
  // Transaction Approved, add creds
354
  if ( $this->status == 'approved' ) {
355
  // Make sure this transaction is unique
356
+ if ( !$this->transaction_id_is_unique( $trans_id ) ) {
357
  $this->status = 'fail';
358
  $this->response = __( 'Duplicate transaction. Please contact support', 'mycred' );
359
  return;
604
  public function preferences( $buy_creds ) {
605
  $prefs = $this->prefs; ?>
606
 
 
607
  <label class="subheader" for="<?php echo $this->field_id( 'sandbox' ); ?>"><?php _e( 'Sandbox Mode', 'mycred' ); ?></label>
608
  <ol>
609
  <li>
693
  if ( $data['exchange'] != 1 && substr( $data['exchange'], 0, 1 ) != '0' ) {
694
  $data['exchange'] = (float) '0' . $data['exchange'];
695
  }
696
+ // Decimal seperator must be punctuation and not comma
697
  $data['exchange'] = str_replace( ',', '.', $data['exchange'] );
698
 
699
  $data['disable_avs'] = ( isset( $data['disable_avs'] ) ) ? 1 : 0;
addons/buy-creds/gateways/paypal-standard.php CHANGED
@@ -43,7 +43,6 @@ if ( !class_exists( 'myCRED_PayPal_Standard' ) ) {
43
  else
44
  $host = 'www.paypal.com';
45
 
46
- // Filter allowed POST keys
47
  $data = $this->POST_to_data();
48
 
49
  // Prep Respons
@@ -378,7 +377,7 @@ if ( !class_exists( 'myCRED_PayPal_Standard' ) ) {
378
  if ( $data['exchange'] != 1 && substr( $data['exchange'], 0, 1 ) != '0' ) {
379
  $data['exchange'] = (float) '0' . $data['exchange'];
380
  }
381
- // Make sure decimals are marked by a dot and not a comma
382
  $data['exchange'] = str_replace( ',', '.', $data['exchange'] );
383
 
384
  return $data;
43
  else
44
  $host = 'www.paypal.com';
45
 
 
46
  $data = $this->POST_to_data();
47
 
48
  // Prep Respons
377
  if ( $data['exchange'] != 1 && substr( $data['exchange'], 0, 1 ) != '0' ) {
378
  $data['exchange'] = (float) '0' . $data['exchange'];
379
  }
380
+ // Decimal seperator must be punctuation and not comma
381
  $data['exchange'] = str_replace( ',', '.', $data['exchange'] );
382
 
383
  return $data;
addons/buy-creds/gateways/skrill.php CHANGED
@@ -79,7 +79,6 @@ if ( !class_exists( 'myCRED_Skrill' ) ) {
79
  $error = false;
80
  $log_entry = array();
81
 
82
- // Filter allowed POST keys
83
  $data = $this->POST_to_data();
84
  if ( $this->prefs['sandbox'] ) {
85
  $log_entry[] = 'Incoming Test IPN Call at ' . date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) );
@@ -424,7 +423,7 @@ if ( !class_exists( 'myCRED_Skrill' ) ) {
424
  if ( $data['exchange'] != 1 && substr( $data['exchange'], 0, 1 ) != '0' ) {
425
  $data['exchange'] = (float) '0' . $data['exchange'];
426
  }
427
- // Make sure decimals are marked by a dot and not a comma
428
  $data['exchange'] = str_replace( ',', '.', $data['exchange'] );
429
 
430
  $data['account_title'] = substr( $data['account_title'], 0, 30 );
79
  $error = false;
80
  $log_entry = array();
81
 
 
82
  $data = $this->POST_to_data();
83
  if ( $this->prefs['sandbox'] ) {
84
  $log_entry[] = 'Incoming Test IPN Call at ' . date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) );
423
  if ( $data['exchange'] != 1 && substr( $data['exchange'], 0, 1 ) != '0' ) {
424
  $data['exchange'] = (float) '0' . $data['exchange'];
425
  }
426
+ // Decimal seperator must be punctuation and not comma
427
  $data['exchange'] = str_replace( ',', '.', $data['exchange'] );
428
 
429
  $data['account_title'] = substr( $data['account_title'], 0, 30 );
addons/buy-creds/gateways/zombaio.php ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'myCRED_VERSION' ) ) exit;
3
+ /**
4
+ * myCRED_Zombaio class
5
+ * Zombaio Payment Gateway
6
+ *
7
+ * @since 1.1
8
+ * @version 1.0
9
+ */
10
+ if ( !class_exists( 'myCRED_Zombaio' ) ) {
11
+ class myCRED_Zombaio extends myCRED_Payment_Gateway {
12
+
13
+ /**
14
+ * Construct
15
+ */
16
+ function __construct( $gateway_prefs ) {
17
+ $name = apply_filters( 'mycred_label', myCRED_NAME );
18
+ parent::__construct( array(
19
+ 'id' => 'zombaio',
20
+ 'defaults' => array(
21
+ 'sandbox' => 0,
22
+ 'site_id' => '',
23
+ 'pricing_id' => '',
24
+ 'gwpass' => '',
25
+ 'logo_url' => '',
26
+ 'lang' => 'ZOM',
27
+ 'bypass_ipn' => 0
28
+ )
29
+ ), $gateway_prefs );
30
+ }
31
+
32
+ /**
33
+ * Process
34
+ * @since 1.1
35
+ * @version 1.0
36
+ */
37
+ public function process() {
38
+ if ( isset( $_GET['wp_zombaio_ips'] ) && $_GET['wp_zombaio_ips'] == 1 ) {
39
+ $ips = $this->load_ipn_ips();
40
+ if ( isset( $_GET['csv'] ) && $_GET['csv'] == 1 ) {
41
+ echo '<textarea style="width: 270px;" rows="10" readonly="readonly">' . implode( ',', $ips ) . '</textarea>';
42
+ exit;
43
+ }
44
+ echo '<ul>';
45
+ foreach ( $ips as $ip ) {
46
+ echo '<li><input type="text" readonly="readonly" value="' . $ip . '" size="15" /></li>';
47
+ }
48
+ echo '</ul>';
49
+ exit;
50
+ }
51
+ $this->handle_call();
52
+ }
53
+
54
+ public function verify_ipn_ip() {
55
+ if ( $this->prefs['bypass_ipn'] ) return true;
56
+
57
+ $ips = $this->load_ipn_ips();
58
+ if ( $ips ) {
59
+ if ( in_array( $_SERVER['REMOTE_ADDR'], $ips ) ) return true;
60
+ }
61
+ return false;
62
+ }
63
+
64
+ public function load_ipn_ips() {
65
+ $request = new WP_Http();
66
+ $data = $request->request( 'http://www.zombaio.com/ip_list.txt' );
67
+ $data = explode( '|', $data['body'] );
68
+ return $data;
69
+ }
70
+
71
+ public function handle_call() {
72
+ // Prep
73
+ $id = $this->id;
74
+ $error = false;
75
+ $log_entry = array();
76
+
77
+ // Password check
78
+ $gw_pass = isset( $_GET['ZombaioGWPass'] ) ? $_GET['ZombaioGWPass'] : false;
79
+ if ( !$gw_pass ) return;
80
+
81
+ // Password missmatch
82
+ if ( $gw_pass != $this->prefs['gwpass'] ) {
83
+ $log_entry[] = 'GWPassword mismatch: [' . $gw_pass . ']';
84
+ $error = 1;
85
+ }
86
+
87
+ // Can not verify IPN IP
88
+ if ( !$this->verify_ipn_ip() ) {
89
+ $log_entry[] = 'IP Verification failed: [' . $_SERVER['REMOTE_ADDR'] . ']';
90
+ $error = 2;
91
+ }
92
+
93
+ // Verify Site ID
94
+ $site_id = isset( $_GET['SITE_ID'] ) ? $_GET['SITE_ID'] : ( isset($_GET['SiteID'] ) ? $_GET['SiteID'] : false );
95
+ if ( !$site_id ) {
96
+ if ( isset( $_GET['username'] ) && substr( $_GET['username'], 0, 4 ) == 'Test' ) {
97
+ header('HTTP/1.1 200 OK');
98
+ echo 'OK';
99
+ exit;
100
+ }
101
+ $log_entry[] = 'Site ID missing';
102
+ $error = true;
103
+ }
104
+ if ( $site_id != $this->prefs['site_id'] ) {
105
+ $log_entry[] = 'Site ID mismatch: [' . $site_id . ']';
106
+ $error = true;
107
+ }
108
+
109
+ // Get Action
110
+ $action = isset( $_GET['Action'] ) ? $_GET['Action'] : false;
111
+ if ( !$action ) {
112
+ $log_entry[] = 'Missing Action';
113
+ $error = true;
114
+ }
115
+
116
+ // Action handler
117
+ if ( $error === false ) {
118
+ $action = strtolower( $action );
119
+ switch ( $action ) {
120
+ case 'user.addcredits':
121
+ // Identifier $_to|$_from
122
+ $identifier = isset( $_GET['Identifier'] ) ? $_GET['Identifier'] : false;
123
+ // Missing
124
+ if ( !$identifier ) {
125
+ $log_entry[] = 'Missing Identifier';
126
+ $error = true;
127
+ }
128
+ else {
129
+ $_identifier = explode( '|', $identifier );
130
+ // Incorrect format
131
+ if ( !$_identifier ) {
132
+ $log_entry[] = 'Incorrect Identifier format: [' . $identifier . ']';
133
+ $error = true;
134
+ }
135
+ // All good
136
+ else {
137
+ $_to = abs( $_identifier[0] );
138
+ $_from = abs( $_identifier[1] );
139
+ }
140
+ }
141
+
142
+ // Amount
143
+ $amount = isset( $_GET['Credits'] ) ? abs( $_GET['Credits'] ) : false;
144
+ if ( !$amount ) {
145
+ $log_entry[] = 'Missing Credit Amount';
146
+ $error = true;
147
+ }
148
+ if ( !is_numeric( $amount ) ) {
149
+ $log_entry[] = 'Incorrect Amount format: [' . $amount . ']';
150
+ $error = true;
151
+ }
152
+
153
+ // Make sure this is a unique purchase
154
+ $transaction_id = ( isset( $_GET['TransactionID'] ) ) ? $_GET['TransactionID'] : 'Zombaio|' . $_to . '|' . $_from . '|' . time();
155
+ if ( $transaction_id !== '0000' ) {
156
+ if ( !$this->transaction_id_is_unique( $transaction_id ) ) {
157
+ $log_entry[] = 'Transaction ID previously used: [' . $transaction_id . ']';
158
+ $error = true;
159
+ }
160
+ }
161
+ else {
162
+ $this->prefs['sandbox'] = true;
163
+ }
164
+
165
+ // No errors
166
+ if ( $error === false ) {
167
+ // Log Entry
168
+ $entry = $this->get_entry( $_to, $_from );
169
+ $entry = str_replace( '%gateway%', 'Zombaio', $entry );
170
+ if ( $this->prefs['sandbox'] ) $entry = 'TEST ' . $entry;
171
+
172
+ // Data
173
+
174
+ $visitor_ip = ( isset( $_GET['VISITOR_IP'] ) ) ? $_GET['VISITOR_IP'] : 'missing';
175
+ $data = array(
176
+ 'transaction_id' => $transaction_id,
177
+ 'sales_data' => $identifier,
178
+ 'site_id' => $site_id,
179
+ 'visitor_ip' => $visitor_ip
180
+ );
181
+
182
+ // Execute
183
+ $this->core->add_creds(
184
+ 'buy_creds_with_zombaio',
185
+ $_to,
186
+ $amount,
187
+ $entry,
188
+ $_from,
189
+ $data
190
+ );
191
+
192
+ $log_entry[] = 'CREDs Added';
193
+ do_action( "mycred_buy_cred_{$id}_approved", $this->prefs );
194
+ }
195
+
196
+ break;
197
+ }
198
+ }
199
+
200
+ do_action( "mycred_buy_cred_{$id}_end", $log_entry, $this->prefs );
201
+
202
+ // No errors = success
203
+ if ( $error === false ) {
204
+ echo 'OK';
205
+ }
206
+ // GW Pass issue
207
+ elseif ( $error === 1 ) {
208
+ header( 'HTTP/1.0 401 Unauthorized' );
209
+ echo 'myCRED ERROR 100';
210
+ }
211
+ // IP Verification issue
212
+ elseif ( $error === 2 ) {
213
+ header( 'HTTP/1.0 403 Forbidden' );
214
+ echo 'myCRED ERROR 200';
215
+ }
216
+ // All other issues
217
+ else {
218
+ header( 'HTTP/1.0 401 Unauthorized' );
219
+ echo 'myCRED ERROR 300';
220
+ }
221
+
222
+ exit;
223
+ }
224
+
225
+ /**
226
+ * Buy Handler
227
+ * @since 1.1
228
+ * @version 1.0
229
+ */
230
+ public function buy() {
231
+ if ( !isset( $this->prefs['site_id'] ) || empty( $this->prefs['site_id'] ) )
232
+ wp_die( __( 'Please setup this gateway before attempting to make a purchase!', 'mycred' ) );
233
+
234
+ $home = get_bloginfo( 'url' );
235
+ $token = $this->create_token();
236
+
237
+ // Construct location
238
+ $location = 'https://secure.zombaio.com/?' . $this->prefs['site_id'] . '.' . $this->prefs['pricing_id'] . '.' . $this->prefs['lang'];
239
+
240
+ // Finance
241
+ $amount = $this->core->number( $_REQUEST['amount'] );
242
+ // Enforce minimum
243
+ if ( $amount < $this->core->buy_creds['minimum'] )
244
+ $amount = $this->core->buy_creds['minimum'];
245
+ // No negative amounts please
246
+ $amount = abs( $amount );
247
+
248
+ // Thank you page
249
+ $thankyou_url = $this->get_thankyou();
250
+
251
+ // Cancel page
252
+ $cancel_url = $this->get_cancelled();
253
+
254
+ // Return to a url
255
+ if ( isset( $_REQUEST['return_to'] ) ) {
256
+ $thankyou_url = $_REQUEST['return_to'];
257
+ $cancel_url = $_REQUEST['return_to'];
258
+ }
259
+
260
+ $to = $this->get_to();
261
+ $from = $this->current_user_id;
262
+ unset( $_REQUEST );
263
+
264
+ $hidden_fields = array(
265
+ 'identifier' => $to . '|' . $from,
266
+ 'approve_url' => $thankyou_url,
267
+ 'decline_url' => $cancel_url
268
+ );
269
+
270
+ // Generate processing page
271
+ $this->purchase_header( __( 'Processing payment &hellip;', 'mycred' ) );
272
+ $this->form_with_redirect( $hidden_fields, $location, $this->prefs['logo_url'] );
273
+ $this->purchase_footer();
274
+
275
+ // Exit
276
+ unset( $this );
277
+ exit();
278
+ }
279
+
280
+ /**
281
+ * Preferences
282
+ * @since 1.1
283
+ * @version 1.0
284
+ */
285
+ public function preferences( $buy_creds ) {
286
+ $prefs = $this->prefs;
287
+ if ( empty( $prefs['logo_url'] ) )
288
+ $prefs['logo_url'] = plugins_url( 'images/zombaio.png', myCRED_PURCHASE ); ?>
289
+
290
+ <label class="subheader" for="<?php echo $this->field_id( 'sandbox' ); ?>"><?php _e( 'Sandbox Mode', 'mycred' ); ?></label>
291
+ <ol>
292
+ <li>
293
+ <input type="checkbox" name="<?php echo $this->field_name( 'sandbox' ); ?>" id="<?php echo $this->field_id( 'sandbox' ); ?>" value="1"<?php checked( $prefs['sandbox'], 1 ); ?> />
294
+ </li>
295
+ </ol>
296
+ <label class="subheader" for="<?php echo $this->field_id( 'site_id' ); ?>"><?php _e( 'Site ID', 'mycred' ); ?></label>
297
+ <ol>
298
+ <li>
299
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( 'site_id' ); ?>" id="<?php echo $this->field_id( 'site_id' ); ?>" value="<?php echo $prefs['site_id']; ?>" class="long" /></div>
300
+ </li>
301
+ </ol>
302
+ <label class="subheader" for="<?php echo $this->field_id( 'gwpass' ); ?>"><?php _e( 'GW Password', 'mycred' ); ?></label>
303
+ <ol>
304
+ <li>
305
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( 'gwpass' ); ?>" id="<?php echo $this->field_id( 'gwpass' ); ?>" value="<?php echo $prefs['gwpass']; ?>" class="long" /></div>
306
+ </li>
307
+ </ol>
308
+ <label class="subheader" for="<?php echo $this->field_id( 'site_id' ); ?>"><?php _e( 'Pricing ID', 'mycred' ); ?></label>
309
+ <ol>
310
+ <li>
311
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( 'pricing_id' ); ?>" id="<?php echo $this->field_id( 'pricing_id' ); ?>" value="<?php echo $prefs['pricing_id']; ?>" class="long" /></div>
312
+ </li>
313
+ </ol>
314
+ <label class="subheader" for="<?php echo $this->field_id( 'logo_url' ); ?>"><?php _e( 'Logo URL', 'mycred' ); ?></label>
315
+ <ol>
316
+ <li>
317
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( 'logo_url' ); ?>" id="<?php echo $this->field_id( 'logo_url' ); ?>" value="<?php echo $prefs['logo_url']; ?>" class="long" /></div>
318
+ </li>
319
+ </ol>
320
+ <label class="subheader" for="<?php echo $this->field_id( 'bypass_ipn' ); ?>"><?php _e( 'IP Verification', 'mycred' ); ?></label>
321
+ <ol>
322
+ <li>
323
+ <input type="checkbox" name="<?php echo $this->field_name( 'bypass_ipn' ); ?>" id="<?php echo $this->field_id( 'bypass_ipn' ); ?>" value="1"<?php checked( $prefs['bypass_ipn'], 1 ); ?> /> <?php _e( 'Do not verify that callbacks are coming from Zombaio.', 'mycred' ); ?>
324
+ </li>
325
+ </ol>
326
+ <label class="subheader" for="<?php echo $this->field_id( 'lang' ); ?>"><?php _e( 'Language', 'mycred' ); ?></label>
327
+ <ol>
328
+ <li>
329
+ <?php $this->lang_dropdown( 'lang' ); ?>
330
+
331
+ </li>
332
+ </ol>
333
+ <label class="subheader"><?php _e( 'Postback URL (ZScript)', 'mycred' ); ?></label>
334
+ <ol>
335
+ <li>
336
+ <code style="padding: 12px;display:block;"><?php echo get_bloginfo( 'url' ); ?></code>
337
+ <p><?php _e( 'For this gateway to work, login to ZOA and set the Postback URL to the above address and click validate.', 'mycred' ); ?></p>
338
+ </li>
339
+ </ol>
340
+ <?php
341
+ }
342
+
343
+ /**
344
+ * Sanatize Prefs
345
+ * @since 1.1
346
+ * @version 1.0
347
+ */
348
+ public function sanitise_preferences( $data ) {
349
+ $data['sandbox'] = ( !isset( $data['sandbox'] ) ) ? 0 : 1;
350
+
351
+ $data['site_id'] = sanitize_text_field( $data['site_id'] );
352
+ $data['gwpass'] = sanitize_text_field( $data['gwpass'] );
353
+ $data['pricing_id'] = sanitize_text_field( $data['pricing_id'] );
354
+ $data['logo_url'] = sanitize_text_field( $data['logo_url'] );
355
+ $data['bypass_ipn'] = ( isset( $data['bypass_ipn'] ) ) ? 1 : 0;
356
+ $data['lang'] = sanitize_text_field( $data['lang'] );
357
+
358
+ return $data;
359
+ }
360
+
361
+ /**
362
+ * Language Dropdown
363
+ * @since 1.1
364
+ * @version 1.0
365
+ */
366
+ public function lang_dropdown( $name ) {
367
+ $languages = array(
368
+ 'ZOM' => 'Let Zombaio Detect Language',
369
+ 'US' => 'English',
370
+ 'FR' => 'French',
371
+ 'DE' => 'German',
372
+ 'IT' => 'Italian',
373
+ 'JP' => 'Japanese',
374
+ 'ES' => 'Spanish',
375
+ 'SE' => 'Swedish',
376
+ 'KR' => 'Korean',
377
+ 'CH' => 'Traditional Chinese',
378
+ 'HK' => 'Simplified Chinese'
379
+ );
380
+
381
+ echo '<select name="' . $this->field_name( $name ) . '" id="' . $this->field_id( $name ) . '">';
382
+ echo '<option value="">' . __( 'Select', 'mycred' ) . '</option>';
383
+ foreach ( $languages as $code => $cname ) {
384
+ echo '<option value="' . $code . '"';
385
+ if ( $this->prefs[$name] == $code ) echo ' selected="selected"';
386
+ echo '>' . $cname . '</option>';
387
+ }
388
+ echo '</select>';
389
+ }
390
+ }
391
+ }
392
+ ?>
addons/buy-creds/images/zombaio.jpg ADDED
Binary file
addons/buy-creds/myCRED-addon-buy-creds.php CHANGED
@@ -21,6 +21,7 @@ require_once( myCRED_PURCHASE_DIR . 'abstracts/mycred-abstract-payment-gateway.p
21
  require_once( myCRED_PURCHASE_DIR . 'gateways/paypal-standard.php' );
22
  require_once( myCRED_PURCHASE_DIR . 'gateways/netbilling.php' );
23
  require_once( myCRED_PURCHASE_DIR . 'gateways/skrill.php' );
 
24
  /**
25
  * myCRED_Buy_CREDs class
26
  *
@@ -82,11 +83,16 @@ if ( !class_exists( 'myCRED_Buy_CREDs' ) ) {
82
  /**
83
  * Init Gateway
84
  */
85
- if ( isset( $_REQUEST['mycred_call'] ) || ( isset( $_REQUEST['mycred_buy'] ) && is_user_logged_in() ) ) {
86
- $gateway_id = ( isset( $_REQUEST['mycred_call'] ) ) ? $_REQUEST['mycred_call'] : $_REQUEST['mycred_buy'];
87
- if ( array_key_exists( $gateway_id, $installed ) && $this->is_active( $gateway_id ) ) {
88
- $class = $installed[$gateway_id]['callback'][0];
89
- $gateway = new $class( $this->gateway_prefs );
 
 
 
 
 
90
  }
91
  }
92
 
@@ -95,7 +101,7 @@ if ( !class_exists( 'myCRED_Buy_CREDs' ) ) {
95
  * Next we check to see if there is a purchase request, either made locally though
96
  * a form submission or by gateways calling remotly (see PayPal).
97
  */
98
- if ( isset( $_REQUEST['mycred_call'] ) ) {
99
  $gateway->process();
100
  }
101
 
@@ -136,6 +142,10 @@ if ( !class_exists( 'myCRED_Buy_CREDs' ) ) {
136
  'title' => __( 'Skrill (Moneybookers)' ),
137
  'callback' => array( 'myCRED_Skrill' )
138
  );
 
 
 
 
139
  $installed = apply_filters( 'mycred_setup_gateways', $installed );
140
 
141
  $this->installed = $installed;
@@ -302,7 +312,7 @@ if ( !class_exists( 'myCRED_Buy_CREDs' ) ) {
302
 
303
  <div class="wrap list" id="myCRED-wrap">
304
  <div id="icon-myCRED" class="icon32"><br /></div>
305
- <h2><?php echo '<strong>my</strong>CRED ' . __( 'Payment Gateways', 'mycred' ); ?></h2>
306
  <p><?php echo $this->core->template_tags_general( __( 'Select the payment gateways you want to offer your users to buy %plural%.', 'mycred' ) ); ?></p>
307
  <form method="post" action="options.php">
308
  <?php settings_fields( 'myCRED-gateways' ); ?>
@@ -495,7 +505,7 @@ if ( !class_exists( 'myCRED_Buy_CREDs' ) ) {
495
  * Render Shortcode Form
496
  * Returns an advanced version allowing for further customizations.
497
  * @since 0.1
498
- * @version 1.1
499
  */
500
  public function render_shortcode_form( $atts, $content = '' ) {
501
  // Make sure the add-on has been setup
@@ -570,8 +580,7 @@ if ( !class_exists( 'myCRED_Buy_CREDs' ) ) {
570
 
571
  // Start constructing form with title and submit button
572
  $form = '
573
- <form method="post" action="" class="' . implode( ' ', $classes ) . '">
574
- <input type="submit" name="submit" value="' . $button . '" class="mycred-buy button large" />';
575
 
576
  // Gifting a specific user or post author
577
  if ( $buy_author ) {
@@ -678,6 +687,7 @@ if ( !class_exists( 'myCRED_Buy_CREDs' ) ) {
678
 
679
  $form .= '
680
  <input type="hidden" name="token" value="' . wp_create_nonce( 'mycred-buy-creds' ) . '" />
 
681
  </form>';
682
 
683
  return $form;
21
  require_once( myCRED_PURCHASE_DIR . 'gateways/paypal-standard.php' );
22
  require_once( myCRED_PURCHASE_DIR . 'gateways/netbilling.php' );
23
  require_once( myCRED_PURCHASE_DIR . 'gateways/skrill.php' );
24
+ require_once( myCRED_PURCHASE_DIR . 'gateways/zombaio.php' );
25
  /**
26
  * myCRED_Buy_CREDs class
27
  *
83
  /**
84
  * Init Gateway
85
  */
86
+ if ( isset( $_REQUEST['mycred_call'] ) || ( isset( $_REQUEST['mycred_buy'] ) && is_user_logged_in() ) || ( isset( $_GET['wp_zombaio_ips'] ) || isset( $_GET['ZombaioGWPass'] ) ) ) {
87
+ if ( isset( $_GET['wp_zombaio_ips'] ) || isset( $_GET['ZombaioGWPass'] ) ) {
88
+ $gateway = new myCRED_Zombaio( $this->gateway_prefs );
89
+ }
90
+ else {
91
+ $gateway_id = ( isset( $_REQUEST['mycred_call'] ) ) ? $_REQUEST['mycred_call'] : $_REQUEST['mycred_buy'];
92
+ if ( array_key_exists( $gateway_id, $installed ) && $this->is_active( $gateway_id ) ) {
93
+ $class = $installed[$gateway_id]['callback'][0];
94
+ $gateway = new $class( $this->gateway_prefs );
95
+ }
96
  }
97
  }
98
 
101
  * Next we check to see if there is a purchase request, either made locally though
102
  * a form submission or by gateways calling remotly (see PayPal).
103
  */
104
+ if ( isset( $_REQUEST['mycred_call'] ) || ( isset( $_GET['wp_zombaio_ips'] ) || isset( $_GET['ZombaioGWPass'] ) ) ) {
105
  $gateway->process();
106
  }
107
 
142
  'title' => __( 'Skrill (Moneybookers)' ),
143
  'callback' => array( 'myCRED_Skrill' )
144
  );
145
+ $installed['zombaio'] = array(
146
+ 'title' => __( 'Zombaio' ),
147
+ 'callback' => array( 'myCRED_Zombaio' )
148
+ );
149
  $installed = apply_filters( 'mycred_setup_gateways', $installed );
150
 
151
  $this->installed = $installed;
312
 
313
  <div class="wrap list" id="myCRED-wrap">
314
  <div id="icon-myCRED" class="icon32"><br /></div>
315
+ <h2><?php echo apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . __( 'Payment Gateways', 'mycred' ); ?></h2>
316
  <p><?php echo $this->core->template_tags_general( __( 'Select the payment gateways you want to offer your users to buy %plural%.', 'mycred' ) ); ?></p>
317
  <form method="post" action="options.php">
318
  <?php settings_fields( 'myCRED-gateways' ); ?>
505
  * Render Shortcode Form
506
  * Returns an advanced version allowing for further customizations.
507
  * @since 0.1
508
+ * @version 1.2
509
  */
510
  public function render_shortcode_form( $atts, $content = '' ) {
511
  // Make sure the add-on has been setup
580
 
581
  // Start constructing form with title and submit button
582
  $form = '
583
+ <form method="post" action="" class="' . implode( ' ', $classes ) . '">';
 
584
 
585
  // Gifting a specific user or post author
586
  if ( $buy_author ) {
687
 
688
  $form .= '
689
  <input type="hidden" name="token" value="' . wp_create_nonce( 'mycred-buy-creds' ) . '" />
690
+ <input type="submit" name="submit" value="' . $button . '" class="mycred-buy button large" />
691
  </form>';
692
 
693
  return $form;
addons/email-notices/css/edit-email-notice.css ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ #poststuff #mycred_email_settings .inside { margin: 0; padding: 0; }
2
+ #poststuff .inside .mycred-save { text-align: right; padding: 10px 10px 8px; border-top: 1px solid #f5f5f5; clear: both; margin-top: -2px; }
3
+ .mycred-inline label { padding: 0 6px; }
4
+ #mycred_email_settings select { margin-bottom: 6px; }
5
+ #mycred_email_settings input[type="text"] { margin-bottom: 6px; width: 80%; }
6
+ #mycred-test { line-height: 25px; vertical-align: middle; text-align: left; float: left; }
7
+ #mycred-text .spinner { float: left; }
8
+ #mycred-email-styling { width: 95%; max-width: 98%; min-width: 95%; min-height: 100px; height: 100px; max-height: 200px; }
9
+
10
+ #mycred_email_template_tags ul { display: block; width: 50%; height: auto; float: left; }
11
+ #mycred_email_template_tags ul .title { font-size: large; }
addons/email-notices/css/email-notice.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ th#title { width: 30%; }
2
+ th#mycred-email-status { width: 20%; }
addons/email-notices/myCRED-addon-email-notices.php ADDED
@@ -0,0 +1,946 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Addon: Email Notices
4
+ * Addon URI: http://mycred.me/add-ons/email-notices/
5
+ * Version: 1.0
6
+ * Description: Create email notices for any type of myCRED instance.
7
+ * Author: Gabriel S Merovingi
8
+ * Author URI: http://www.merovingi.com
9
+ */
10
+ if ( !defined( 'myCRED_VERSION' ) ) exit;
11
+ define( 'myCRED_EMAIL', __FILE__ );
12
+ define( 'myCRED_EMAIL_VERSION', myCRED_VERSION . '.1' );
13
+ /**
14
+ * myCRED_Email_Notices class
15
+ *
16
+ *
17
+ * @since 1.1
18
+ * @version 1.0
19
+ */
20
+ if ( !class_exists( 'myCRED_Email_Notices' ) ) {
21
+ class myCRED_Email_Notices extends myCRED_Module {
22
+
23
+ public $instances = array();
24
+
25
+ /**
26
+ * Construct
27
+ */
28
+ function __construct() {
29
+ parent::__construct( 'myCRED_Email_Notices', array(
30
+ 'module_name' => 'emailnotices',
31
+ 'defaults' => array(
32
+ 'from' => array(
33
+ 'name' => get_bloginfo( 'name' ),
34
+ 'email' => get_bloginfo( 'admin_email' ),
35
+ 'reply_to' => get_bloginfo( 'admin_email' )
36
+ ),
37
+ 'filter' => array(
38
+ 'subject' => 0,
39
+ 'content' => 0
40
+ ),
41
+ 'use_html' => true,
42
+ 'content' => '',
43
+ 'styling' => ''
44
+ ),
45
+ 'register' => false,
46
+ 'add_to_core' => true
47
+ ) );
48
+
49
+ //add_action( 'mycred_help', array( $this, 'help' ), 10, 2 );
50
+ }
51
+
52
+ /**
53
+ * Hook into Init
54
+ * @since 1.1
55
+ * @version 1.0
56
+ */
57
+ public function module_init() {
58
+ $this->register_post_type();
59
+ $this->setup_instances();
60
+ add_action( 'mycred_admin_enqueue', array( $this, 'enqueue_scripts' ) );
61
+ add_filter( 'mycred_add', array( $this, 'email_check' ), 10, 3 );
62
+ }
63
+
64
+ /**
65
+ * Hook into Admin Init
66
+ * @since 1.1
67
+ * @version 1.0
68
+ */
69
+ public function module_admin_init() {
70
+ add_action( 'admin_head', array( $this, 'admin_header' ) );
71
+ add_filter( 'post_row_actions', array( $this, 'adjust_row_actions' ), 10, 2 );
72
+
73
+ add_filter( 'manage_mycred_email_notice_posts_columns', array( $this, 'adjust_column_headers' ) );
74
+ add_action( 'manage_mycred_email_notice_posts_custom_column', array( $this, 'adjust_column_content' ), 10, 2 );
75
+
76
+ add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
77
+ add_filter( 'enter_title_here', array( $this, 'enter_title_here' ) );
78
+ add_filter( 'default_content', array( $this, 'default_content' ) );
79
+
80
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
81
+ add_action( 'post_submitbox_start', array( $this, 'publish_warning' ) );
82
+ add_action( 'save_post', array( $this, 'save_email_notice' ) );
83
+
84
+ if ( $this->emailnotices['use_html'] === false )
85
+ add_filter( 'user_can_richedit', array( $this, 'disable_richedit' ) );
86
+ }
87
+
88
+ /**
89
+ * Admin Header
90
+ * @since 1.1
91
+ * @version 1.0
92
+ */
93
+ public function admin_header() {
94
+ $screen = get_current_screen();
95
+ if ( $screen->id == 'mycred_email_notice' && $this->emailnotices['use_html'] === false ) {
96
+ remove_action( 'media_buttons', 'media_buttons' );
97
+ echo '
98
+ <style type="text/css">
99
+ #ed_toolbar { display: none !important; }
100
+ </style>';
101
+ }
102
+ }
103
+
104
+ /**
105
+ * Enqueue Scripts & Styles
106
+ * @since 1.1
107
+ * @version 1.0
108
+ */
109
+ public function enqueue_scripts() {
110
+ // Register Email List Styling
111
+ wp_register_style(
112
+ 'mycred-email-notices',
113
+ plugins_url( 'css/email-notice.css', myCRED_EMAIL ),
114
+ false,
115
+ myCRED_EMAIL_VERSION . '.1',
116
+ 'all'
117
+ );
118
+ // Register Edit Email Notice Styling
119
+ wp_register_style(
120
+ 'mycred-email-edit-notice',
121
+ plugins_url( 'css/edit-email-notice.css', myCRED_EMAIL ),
122
+ false,
123
+ myCRED_EMAIL_VERSION . '.1',
124
+ 'all'
125
+ );
126
+
127
+ $screen = get_current_screen();
128
+ // Commonly used
129
+ if ( $screen->id == 'edit-mycred_email_notice' || $screen->id == 'mycred_email_notice' ) {
130
+ wp_enqueue_style( 'mycred-admin' );
131
+ }
132
+
133
+ // Edit Email Notice Styling
134
+ if ( $screen->id == 'mycred_email_notice' )
135
+ wp_enqueue_style( 'mycred-email-edit-notice' );
136
+ // Email Notice List Styling
137
+ elseif ( $screen->id == 'edit-mycred_email_notice' )
138
+ wp_enqueue_style( 'mycred-email-notices' );
139
+ }
140
+
141
+ /**
142
+ * Register Email Notice Post Type
143
+ * @since 1.1
144
+ * @version 1.0
145
+ */
146
+ protected function register_post_type() {
147
+ $labels = array(
148
+ 'name' => __( 'Email Notices', 'mycred' ),
149
+ 'singular_name' => __( 'Email Notice', 'mycred' ),
150
+ 'add_new' => __( 'Add New', 'mycred' ),
151
+ 'add_new_item' => __( 'Add New Notice', 'mycred' ),
152
+ 'edit_item' => __( 'Edit Notice', 'mycred' ),
153
+ 'new_item' => __( 'New Notice', 'mycred' ),
154
+ 'all_items' => __( 'Email Notices', 'mycred' ),
155
+ 'view_item' => __( 'View Notice', 'mycred' ),
156
+ 'search_items' => __( 'Search Email Notices', 'mycred' ),
157
+ 'not_found' => __( 'No email notices found', 'mycred' ),
158
+ 'not_found_in_trash' => __( 'No email notices found in Trash', 'mycred' ),
159
+ 'parent_item_colon' => '',
160
+ 'menu_name' => __( 'Email Notices', 'mycred' )
161
+ );
162
+ $args = array(
163
+ 'labels' => $labels,
164
+ 'publicly_queryable' => false,
165
+ 'show_ui' => true,
166
+ 'show_in_menu' => 'myCRED',
167
+ 'capability_type' => 'page',
168
+ 'supports' => array( 'title', 'editor' )
169
+ );
170
+ register_post_type( 'mycred_email_notice', $args );
171
+ }
172
+
173
+ /**
174
+ * Setup Instances
175
+ * @since 1.1
176
+ * @version 1.0
177
+ */
178
+ protected function setup_instances() {
179
+ $instances[''] = __( 'Select', 'mycred' );
180
+ $instances['general'] = array(
181
+ 'label' => __( 'General', 'mycred' ),
182
+ 'all' => __( 'users balance changes', 'mycred' ),
183
+ 'positive' => __( 'user gains %_plural%', 'mycred' ),
184
+ 'negative' => __( 'user lose %_plural%', 'mycred' ),
185
+ 'zero' => __( 'users balance reaches zero', 'mycred' ),
186
+ 'minus' => __( 'users balance goes minus', 'mycred' ),
187
+ 'end' => ''
188
+ );
189
+
190
+ if ( class_exists( 'myCRED_Sell_Content' ) ) {
191
+ $instances['buy_content'] = array(
192
+ 'label' => __( 'Sell Content Add-on', 'mycred' ),
193
+ 'negative' => __( 'user buys content', 'mycred' ),
194
+ 'positive' => __( 'authors content gets sold', 'mycred' ),
195
+ 'end' => ''
196
+ );
197
+ }
198
+
199
+ if ( class_exists( 'myCRED_Buy_CREDs' ) ) {
200
+ $instances['buy_creds'] = array(
201
+ 'label' => __( 'buyCREDs Add-on', 'mycred' ),
202
+ 'positive' => __( 'user buys %_plural%', 'mycred' ),
203
+ 'end' => ''
204
+ );
205
+ }
206
+
207
+ if ( class_exists( 'myCRED_Transfer_Creds' ) ) {
208
+ $instances['transfer'] = array(
209
+ 'label' => __( 'Transfer Add-on', 'mycred' ),
210
+ 'negative' => __( 'user sends %_plural%', 'mycred' ),
211
+ 'positive' => __( 'user receives %_plural%', 'mycred' ),
212
+ 'end' => ''
213
+ );
214
+ }
215
+
216
+ $this->instances = apply_filters( 'mycred_email_instances', $instances );
217
+ }
218
+
219
+ /**
220
+ * Get Instance
221
+ * @since 1.1
222
+ * @version 1.0
223
+ */
224
+ protected function get_instance( $key = '', $detail = NULL ) {
225
+ $instance_keys = explode( '|', $key );
226
+ if ( $instance_keys === false || empty( $instance_keys ) || count( $instance_keys ) != 2 ) return NULL;
227
+
228
+ // By default we return the entire array for the given key
229
+ if ( $detail === NULL && array_key_exists( $instance_keys[0], $this->instances ) )
230
+ return $this->core->template_tags_general( $this->instances[$instance_keys[0]][$instance_keys[1]] );
231
+
232
+ if ( $detail !== NULL && array_key_exists( $detail, $this->instances[$instance_keys[0]] ) )
233
+ return $this->core->template_tags_general( $this->instances[$instance_keys[0]][$detail] );
234
+
235
+ return NULL;
236
+ }
237
+
238
+ /**
239
+ * Add to General Settings
240
+ * @since 1.1
241
+ * @version 1.0
242
+ */
243
+ public function after_general_settings() {
244
+ if ( $this->emailnotices['use_html'] === true )
245
+ $use_html = 1;
246
+ else
247
+ $use_html = 0; ?>
248
+
249
+ <h4 style="color:#BBD865;"><?php _e( 'Email Notices', 'mycred' ); ?></h4>
250
+ <div class="body" style="display:none;">
251
+ <p><?php _e( 'Settings that apply to all email notices and can not be overridden for individual emails.', 'mycred' ); ?></p>
252
+ <label class="subheader" for="<?php echo $this->field_id( array( 'use_html' => 'no' ) ); ?>"><?php _e( 'Email Format', 'mycred' ); ?></label>
253
+ <ol id="myCRED-email-notice-use-html">
254
+ <li>
255
+ <input type="radio" name="<?php echo $this->field_name( 'use_html' ); ?>" id="<?php echo $this->field_id( array( 'use_html' => 'no' ) ); ?>" <?php checked( $use_html, 0 ); ?> value="0" />
256
+ <label for="<?php echo $this->field_id( array( 'use_html' => 'no' ) ); ?>"><?php _e( 'Plain text emails only.', 'mycred' ); ?></label>
257
+ </li>
258
+ <li>
259
+ <input type="radio" name="<?php echo $this->field_name( 'use_html' ); ?>" id="<?php echo $this->field_id( array( 'use_html' => 'yes' ) ); ?>" <?php checked( $use_html, 1 ); ?> value="1" />
260
+ <label for="<?php echo $this->field_id( array( 'use_html' => 'yes' ) ); ?>"><?php _e( 'HTML or Plain text emails.', 'mycred' ); ?></label>
261
+ </li>
262
+ </ol>
263
+ <label class="subheader" for="<?php echo $this->field_id( array( 'filter' => 'subject' ) ); ?>"><?php _e( 'Filters', 'mycred' ); ?></label>
264
+ <ol id="myCRED-email-notice-allow-filters">
265
+ <li>
266
+ <input type="checkbox" name="<?php echo $this->field_name( array( 'filter' => 'subject' ) ); ?>" id="<?php echo $this->field_id( array( 'filter' => 'subject' ) ); ?>" <?php checked( $this->emailnotices['filter']['subject'], 1 ); ?> value="1" />
267
+ <label for="<?php echo $this->field_id( array( 'filter' => 'subject' ) ); ?>"><?php _e( 'Allow WordPress and Third Party Plugins to filter the email subject before an email is sent.', 'mycred' ); ?></label>
268
+ </li>
269
+ <li>
270
+ <input type="checkbox" name="<?php echo $this->field_name( array( 'filter' => 'content' ) ); ?>" id="<?php echo $this->field_id( array( 'filter' => 'content' ) ); ?>" <?php checked( $this->emailnotices['filter']['content'], 1 ); ?> value="1" />
271
+ <label for="<?php echo $this->field_id( array( 'filter' => 'content' ) ); ?>"><?php _e( 'Allow WordPress and Third Party Plugins to filter the email content before an email is sent.', 'mycred' ); ?></label>
272
+ </li>
273
+ </ol>
274
+ <p><?php _e( 'Default email settings. These settings can be individually overridden when editing emails.', 'mycred' ); ?></p>
275
+ <label class="subheader"><?php _e( 'Email Settings', 'mycred' ); ?></label>
276
+ <ol id="myCRED-email-default-sender">
277
+ <li>
278
+ <label for="<?php echo $this->field_id( array( 'from' => 'name' ) ); ?>"><?php _e( 'Senders Name:', 'mycred' ); ?></label>
279
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'from' => 'name' ) ); ?>" id="<?php echo $this->field_id( array( 'from' => 'name' ) ); ?>" value="<?php echo $this->emailnotices['from']['name']; ?>" class="long" /></div>
280
+ </li>
281
+ <li>
282
+ <label for="<?php echo $this->field_id( array( 'from' => 'email' ) ); ?>"><?php _e( 'Senders Email:', 'mycred' ); ?></label>
283
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'from' => 'email' ) ); ?>" id="<?php echo $this->field_id( array( 'from' => 'email' ) ); ?>" value="<?php echo $this->emailnotices['from']['email']; ?>" class="long" /></div>
284
+ </li>
285
+ <li>
286
+ <label for="<?php echo $this->field_id( array( 'from' => 'reply_to' ) ); ?>"><?php _e( 'Reply-To:', 'mycred' ); ?></label>
287
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'from' => 'reply_to' ) ); ?>" id="<?php echo $this->field_id( array( 'from' => 'reply_to' ) ); ?>" value="<?php echo $this->emailnotices['from']['reply_to']; ?>" class="long" /></div>
288
+ </li>
289
+ </ol>
290
+ <label class="subheader" for="<?php echo $this->field_id( 'content' ); ?>"><?php _e( 'Default Email Content', 'mycred' ); ?></label>
291
+ <ol id="myCRED-email-notice-defaults">
292
+ <li>
293
+ <textarea rows="10" cols="50" name="<?php echo $this->field_name( 'content' ); ?>" id="<?php echo $this->field_id( 'content' ); ?>" class="large-text code"><?php echo $this->emailnotices['content']; ?></textarea>
294
+ <span class="description"><?php _e( 'Default email content.', 'mycred' ); ?></span>
295
+ </li>
296
+ </ol>
297
+ <label class="subheader" for="<?php echo $this->field_id( 'styling' ); ?>"><?php _e( 'Default Email Styling', 'mycred' ); ?></label>
298
+ <ol>
299
+ <li>
300
+ <textarea rows="10" cols="50" name="<?php echo $this->field_name( 'styling' ); ?>" id="<?php echo $this->field_id( 'styling' ); ?>" class="large-text code"><?php echo $this->emailnotices['styling']; ?></textarea>
301
+ <span class="description"><?php _e( 'Ignored if HTML is not allowed in emails.', 'mycred' ); ?></span>
302
+ </li>
303
+ </ol>
304
+ </div>
305
+ <?php
306
+ }
307
+
308
+ /**
309
+ * Save Settings
310
+ * @since 1.1
311
+ * @version 1.0
312
+ */
313
+ public function sanitize_extra_settings( $new_data, $data, $core ) {
314
+ $new_data['emailnotices']['use_html'] = ( $data['emailnotices']['use_html'] == 1 ) ? true : false;
315
+
316
+ $new_data['emailnotices']['filter']['subject'] = ( isset( $data['emailnotices']['filter']['subject'] ) ) ? true : false;
317
+ $new_data['emailnotices']['filter']['content'] = ( isset( $data['emailnotices']['filter']['content'] ) ) ? true : false;
318
+
319
+ $new_data['emailnotices']['from']['name'] = sanitize_text_field( $data['emailnotices']['from']['name'] );
320
+ $new_data['emailnotices']['from']['email'] = sanitize_text_field( $data['emailnotices']['from']['email'] );
321
+ $new_data['emailnotices']['from']['reply_to'] = sanitize_text_field( $data['emailnotices']['from']['reply_to'] );
322
+
323
+ $new_data['emailnotices']['content'] = sanitize_text_field( $data['emailnotices']['content'] );
324
+ $new_data['emailnotices']['styling'] = sanitize_text_field( $data['emailnotices']['styling'] );
325
+
326
+ return $new_data;
327
+ }
328
+
329
+ /**
330
+ * Email Notice Check
331
+ * @since 1.1
332
+ * @version 1.0
333
+ */
334
+ public function email_check( $reply, $request, $mycred ) {
335
+ // Construct events
336
+ $event = array( 'all' );
337
+ $amount = $request['amount'];
338
+
339
+ // Event: Account gains or loses amount
340
+ if ( $amount < 0 )
341
+ $event[] = 'negative';
342
+ else
343
+ $event[] = 'positive';
344
+
345
+ // Event: Account reaches zero or goes minus
346
+ $balance = $mycred->get_users_cred( $request['user_id'] );
347
+ if ( $amount < 0 && $balance-$amount < 0 )
348
+ $event[] = 'minus';
349
+ elseif ( $balance-$amount == 0 )
350
+ $event[] = 'zero';
351
+
352
+ // Before we send a notice, lets execute the request
353
+ // so that emails show the correct details
354
+ $mycred->update_users_balance( $request['user_id'], $request['amount'] );
355
+ $mycred->add_to_log( $request['ref'], $request['user_id'], $request['amount'], $request['entry'], $request['ref_id'], $request['data'], $request['type'] );
356
+
357
+ // Start with general events
358
+ $this->do_email_notices( 'general', $event, $request );
359
+
360
+ // At this stage, remove 'all'
361
+ unset( $event[0] );
362
+
363
+ // Add-on specific events
364
+ $this->do_email_notices( $request['ref'], $event, $request );
365
+
366
+ // Return the reply that we have already done this
367
+ return 'done';
368
+ }
369
+
370
+ /**
371
+ * Do Email Notices
372
+ * @since 1.1
373
+ * @version 1.0
374
+ */
375
+ protected function do_email_notices( $reference = NULL, $events = array(), $request = array() ) {
376
+ if ( $reference === NULL || ( !is_array( $events ) || empty( $events ) ) || ( !is_array( $request ) || empty( $request ) ) ) return;
377
+
378
+ $args = array(
379
+ 'post_type' => 'mycred_email_notice',
380
+ 'posts_per_page' => 1,
381
+ 'post_status' => 'publish'
382
+ );
383
+
384
+ foreach ( $events as $event ) {
385
+ // Add meta query to main args
386
+ $args['meta_query'] = array(
387
+ array(
388
+ 'key' => 'mycred_email_instance',
389
+ 'value' => $reference . '|' . $event,
390
+ 'compare' => '='
391
+ )
392
+ );
393
+
394
+ $test[] = $args;
395
+ $query = new WP_Query( $args );
396
+ if ( $query->have_posts() ) {
397
+ while ( $query->have_posts() ) {
398
+ $query->the_post();
399
+ $settings = $this->get_email_settings( $query->post->ID );
400
+
401
+ // Send to user
402
+ if ( $settings['recipient'] == 'user' || $settings['recipient'] == 'both' ) {
403
+ $user = get_user_by( 'id', $request['user_id'] );
404
+ $to = $user->user_email;
405
+ unset( $user );
406
+ }
407
+ // Send to admin
408
+ elseif ( $settings['recipient'] == 'admin' ) {
409
+ $to = get_option( 'admin_email' );
410
+ }
411
+
412
+ // Filtered Subject
413
+ if ( $this->emailnotices['filter']['subject'] === true ) {
414
+ $subject = get_the_title();
415
+ }
416
+ // Unfiltered Subject
417
+ else {
418
+ $subject = $query->post->post_title;
419
+ }
420
+
421
+ // Filtered Content
422
+ if ( $this->emailnotices['filter']['content'] === true ) {
423
+ $message = get_the_content();
424
+ }
425
+ // Unfiltered Content
426
+ else {
427
+ $message = $query->post->post_content;
428
+ }
429
+
430
+ $headers = array();
431
+ $attachments = '';
432
+
433
+ // Construct headers
434
+ if ( $this->emailnotices['use_html'] === true ) {
435
+ $headers[] = 'MIME-Version: 1.0';
436
+ $headers[] = 'Content-Type: text/HTML; charset="' . get_option( 'blog_charset' ) . '"';
437
+ }
438
+ $headers[] = 'From: ' . $settings['senders_name'] . ' <' . $settings['senders_email'] . '>';
439
+
440
+ // Reply-To
441
+ if ( !empty( $settings['reply_to'] ) )
442
+ $headers[] = 'Reply-To: ' . $settings['reply_to'];
443
+
444
+ // Both means we blank carbon copy the admin so the user does not see email
445
+ if ( $settings['recipient'] == 'both' )
446
+ $headers[] = 'Bcc: ' . get_option( 'admin_email' );
447
+
448
+ // If email was successfully sent we update 'last_run'
449
+ if ( $this->wp_mail( $to, $subject, $message, $headers, $attachments, $request, $query->post->ID ) === true )
450
+ update_post_meta( $query->post->ID, 'mycred_email_last_run', date_i18n( 'U' ) );
451
+ }
452
+ }
453
+ wp_reset_postdata();
454
+ }
455
+ }
456
+
457
+ /**
458
+ * WP Mail
459
+ * @since 1.1
460
+ * @version 1.0
461
+ */
462
+ public function wp_mail( $to, $subject, $message, $headers, $attachments, $request, $email_id ) {
463
+ // Let others play before we do our thing
464
+ $filtered = apply_filters( 'mycred_email_before_send', compact( 'to', 'subject', 'message', 'headers', 'attachments', 'request', 'email_id' ) );
465
+
466
+ // Unset everything so only filtered remains
467
+ unset( $to );
468
+ unset( $subject );
469
+ unset( $message );
470
+ unset( $headers );
471
+ unset( $attachments );
472
+ unset( $request );
473
+
474
+ // Parse Subject Template Tags
475
+ $subject = $this->core->template_tags_general( $filtered['subject'] );
476
+ $subject = $this->core->template_tags_amount( $subject, $filtered['request']['amount'] );
477
+ $subject = $this->core->template_tags_user( $subject, $filtered['request']['user_id'] );
478
+
479
+ // Parse Message Template Tags
480
+ $message = $this->core->template_tags_general( $filtered['message'] );
481
+ $message = $this->core->template_tags_amount( $message, $filtered['request']['amount'] );
482
+ $message = $this->core->template_tags_user( $message, $filtered['request']['user_id'] );
483
+ $message = $this->template_tags_request( $message, $filtered['request'] );
484
+
485
+ // Construct HTML Content
486
+ if ( $this->emailnotices['use_html'] === true ) {
487
+ $styling = $this->get_email_styling( $email_id );
488
+ $message = '<html><head><title>' . $subject . '</title><style type="text/css" media="all"> ' . trim( $styling ) . '</style></head><body>' . nl2br( $message ) . '</body></html>';
489
+ }
490
+
491
+ // Send Email
492
+ add_filter( 'wp_mail_content_type', array( $this, 'get_email_format' ) );
493
+ $result = wp_mail( $filtered['to'], $subject, $message, $filtered['headers'], $filtered['attachments'] );
494
+ remove_filter( 'wp_mail_content_type', array( $this, 'get_email_format' ) );
495
+
496
+ // Let others play
497
+ do_action( 'mycred_email_sent', $filtered );
498
+
499
+ return $result;
500
+ }
501
+
502
+ /**
503
+ * Get Email Format
504
+ * @since 1.1
505
+ * @version 1.0
506
+ */
507
+ public function get_email_format() {
508
+ if ( $this->emailnotices['use_html'] === false )
509
+ return 'text/plain';
510
+ else
511
+ return 'text/html';
512
+ }
513
+
514
+ /**
515
+ * Request Related Template Tags
516
+ * @since 1.1
517
+ * @version 1.0
518
+ */
519
+ public function template_tags_request( $content, $request ) {
520
+ $content = $this->core->template_tags_amount( $content, $request['amount'] );
521
+
522
+ $content = str_replace( '%amount%', $request['amount'], $content );
523
+ $content = str_replace( '%entry%', $request['entry'], $content );
524
+ $content = str_replace( '%data%', print_r( $request['data'], true ), $content );
525
+
526
+ return $content;
527
+ }
528
+
529
+ /**
530
+ * Get Email Settings
531
+ * @since 1.1
532
+ * @version 1.0
533
+ */
534
+ protected function get_email_settings( $post_id ) {
535
+ $settings = get_post_meta( $post_id, 'mycred_email_settings', true );
536
+ // Defaults
537
+ if ( empty( $settings ) )
538
+ return array(
539
+ 'recipient' => 'user',
540
+ 'senders_name' => $this->emailnotices['from']['name'],
541
+ 'senders_email' => $this->emailnotices['from']['email'],
542
+ 'reply_to' => $this->emailnotices['from']['reply_to']
543
+ );
544
+
545
+ return $settings;
546
+ }
547
+
548
+ /**
549
+ * Get Email Styling
550
+ * @since 1.1
551
+ * @version 1.0
552
+ */
553
+ protected function get_email_styling( $post_id ) {
554
+ if ( $this->emailnotices['use_html'] === false ) return '';
555
+ $style = get_post_meta( $post_id, 'mycred_email_styling', true );
556
+ // Defaults
557
+ if ( empty( $style ) )
558
+ return $this->emailnotices['styling'];
559
+
560
+ return $style;
561
+ }
562
+
563
+ /**
564
+ * Adjust Row Actions
565
+ * @since 1.1
566
+ * @version 1.0
567
+ */
568
+ public function adjust_row_actions( $actions, $post ) {
569
+ if ( $post->post_type == 'mycred_email_notice' ) {
570
+ unset( $actions['inline hide-if-no-js'] );
571
+ unset( $actions['view'] );
572
+ }
573
+
574
+ return $actions;
575
+ }
576
+
577
+ /**
578
+ * Adjust Column Header
579
+ * @since 1.1
580
+ * @version 1.0
581
+ */
582
+ public function adjust_column_headers( $defaults ) {
583
+ // Remove
584
+ unset( $defaults['date'] );
585
+
586
+ // Add / Adjust
587
+ $defaults['title'] = __( 'Email Subject', 'mycred' );
588
+ $defaults['mycred-email-status'] = __( 'Status', 'mycred' );
589
+ $defaults['mycred-email-reference'] = __( 'Setup', 'mycred' );
590
+
591
+ // Return
592
+ return $defaults;
593
+ }
594
+
595
+ /**
596
+ * Adjust Column Content
597
+ * @since 1.1
598
+ * @version 1.0
599
+ */
600
+ public function adjust_column_content( $column_name, $post_id ) {
601
+ // Get the post
602
+ if ( $column_name == 'mycred-email-status' || $column_name == 'mycred-email-reference' )
603
+ $post = get_post( $post_id );
604
+
605
+ // Email Status Column
606
+ if ( $column_name == 'mycred-email-status' ) {
607
+ if ( $post->post_status != 'publish' && $post->post_status != 'future' )
608
+ echo '<p>' . __( 'Not Active', 'mycred' ) . '</p>';
609
+ elseif ( $post->post_status == 'future' )
610
+ echo '<p>' . sprintf( __( 'Scheduled:<br /><strong>%1$s</strong>', 'mycred' ), date_i18n( get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' ), strtotime( $post->post_date ) ) ) . '</p>';
611
+ else {
612
+ $date = get_post_meta( $post_id, 'mycred_email_last_run', true );
613
+ if ( empty( $date ) )
614
+ echo '<p>' . __( 'Active', 'mycred' ) . '</p>';
615
+ else
616
+ echo '<p>' . sprintf( __( 'Active - Last run:<br /><strong>%1$s</strong>', 'mycred' ), date_i18n( get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' ), $date ) ) . '</p>';
617
+ }
618
+ }
619
+ // Email Setup Column
620
+ elseif ( $column_name == 'mycred-email-reference' ) {
621
+ echo '<p>';
622
+ $instance_key = get_post_meta( $post->ID, 'mycred_email_instance', true );
623
+ $label = $this->get_instance( $instance_key );
624
+ if ( !empty( $instance_key ) && !empty( $label ) )
625
+ echo '<em>' . __( 'Email is sent when', 'mycred' ) .' ' . $label . '.</em></br />';
626
+ else
627
+ echo '<em>' . __( 'Missing instance for this notice!', 'mycred' ) . '</em><br />';
628
+
629
+ $settings = get_post_meta( $post->ID, 'mycred_email_settings', true );
630
+ if ( !empty( $settings ) && isset( $settings['recipient'] ) )
631
+ $recipient = $settings['recipient'];
632
+ else
633
+ $recipient = 'user';
634
+
635
+ if ( $recipient == 'user' )
636
+ echo '<strong>' . __( 'Sent To', 'mycred' ) . '</strong>: ' . __( 'User', 'mycred' ) . '</p>';
637
+ elseif ( $recipient == 'admin' )
638
+ echo '<strong>' . __( 'Sent To', 'mycred' ) . '</strong>: ' . __( 'Administrator', 'mycred' ) . '</p>';
639
+ else
640
+ echo '<strong>' . __( 'Sent To', 'mycred' ) . '</strong>: ' . __( 'Both Administrator and User', 'mycred' ) . '</p>';
641
+ }
642
+ }
643
+
644
+ /**
645
+ * Add Meta Boxes
646
+ * @since 1.1
647
+ * @version 1.0
648
+ */
649
+ public function add_meta_boxes() {
650
+ add_meta_box(
651
+ 'mycred_email_settings',
652
+ __( 'Email Settings', 'mycred' ),
653
+ array( $this, 'email_settings' ),
654
+ 'mycred_email_notice',
655
+ 'side',
656
+ 'high'
657
+ );
658
+
659
+ add_meta_box(
660
+ 'mycred_email_template_tags',
661
+ __( 'Available Template Tags', 'mycred' ),
662
+ array( $this, 'template_tags' ),
663
+ 'mycred_email_notice',
664
+ 'normal',
665
+ 'core'
666
+ );
667
+
668
+ if ( $this->emailnotices['use_html'] === false ) return;
669
+
670
+ add_meta_box(
671
+ 'mycred_email_header',
672
+ __( 'Email Header', 'mycred' ),
673
+ array( $this, 'email_header' ),
674
+ 'mycred_email_notice',
675
+ 'normal',
676
+ 'high'
677
+ );
678
+ }
679
+
680
+ /**
681
+ * Disable WYSIWYG Editor
682
+ * @since 1.1
683
+ * @version 1.0
684
+ */
685
+ public function disable_richedit( $default ) {
686
+ global $post;
687
+ if ( $post->post_type == 'mycred_email_notice' )
688
+ return false;
689
+
690
+ return $default;
691
+ }
692
+
693
+ /**
694
+ * Adjust Enter Title Here
695
+ * @since 1.1
696
+ * @version 1.0
697
+ */
698
+ public function enter_title_here( $title ) {
699
+ global $post_type;
700
+ if ( $post_type == 'mycred_email_notice' )
701
+ return __( 'Email Subject', 'mycred' );
702
+
703
+ return $title;
704
+ }
705
+
706
+ /**
707
+ * Apply Default Content
708
+ * @since 1.1
709
+ * @version 1.0
710
+ */
711
+ public function default_content( $content ) {
712
+ global $post_type;
713
+ if ( $post_type == 'mycred_email_notice' && !empty( $this->emailnotices['content'] ) )
714
+ $content = $this->emailnotices['content'];
715
+
716
+ return $content;
717
+ }
718
+
719
+ /**
720
+ * Email Settings Metabox
721
+ * @since 1.1
722
+ * @version 1.0
723
+ */
724
+ public function email_settings( $post ) {
725
+ // Get instance
726
+ $instance = get_post_meta( $post->ID, 'mycred_email_instance', true );
727
+ // Get settings
728
+ $settings = $this->get_email_settings( $post->ID ); ?>
729
+
730
+ <div class="misc-pub-section">
731
+ <input type="hidden" name="mycred_email[token]" value="<?php echo wp_create_nonce( 'mycred-edit-email' ); ?>" />
732
+ <label for="mycred-email-instance"<?php if ( $post->post_status == 'publish' && empty( $instance ) ) echo ' style="color:red;font-weight:bold;"'; ?>><?php _e( 'Send this email notice when...', 'mycred' ); ?></label><br />
733
+ <select name="mycred_email[instance]" id="mycred-email-instance">
734
+ <?php
735
+ // Default
736
+ echo '<option value=""';
737
+ if ( empty( $instance ) ) echo ' selected="selected"';
738
+ echo '>' . __( 'Select', 'mycred' ) . '</option>';
739
+
740
+ // Loop though instances
741
+ foreach ( $this->instances as $hook_ref => $values ) {
742
+ foreach ( $values as $key => $value ) {
743
+ // Make sure that the submitted value is unique
744
+ $key_value = $hook_ref . '|' . $key;
745
+ // Option group starts with 'label'
746
+ if ( $key == 'label' )
747
+ echo '<optgroup label="' . $value . '">';
748
+ // Option group ends with 'end'
749
+ elseif ( $key == 'end' )
750
+ echo '</optgroup>';
751
+ // The selectable options
752
+ else {
753
+ echo '<option value="' . $key_value . '"';
754
+ if ( $instance == $key_value ) echo ' selected="selected"';
755
+ echo '>... ' . $this->core->template_tags_general( $value ) . '</option>';
756
+ }
757
+ }
758
+ } ?>
759
+
760
+ </select><br />
761
+ <label for="mycred-email-recipient-user"><?php _e( 'Recipient:', 'mycred' ); ?></label><br />
762
+ <div class="mycred-inline">
763
+ <input type="radio" name="mycred_email[recipient]" id="mycred-email-recipient-user" value="user" <?php checked( $settings['recipient'], 'user' ); ?> /> <label for="mycred-email-recipient-user"><?php _e( 'User', 'mycred' ); ?></label>
764
+ <input type="radio" name="mycred_email[recipient]" id="mycred-email-recipient-admin" value="admin" <?php checked( $settings['recipient'], 'admin' ); ?> /> <label for="mycred-email-recipient-admin"><?php _e( 'Administrator', 'mycred' ); ?></label>
765
+ <input type="radio" name="mycred_email[recipient]" id="mycred-email-recipient-both" value="both" <?php checked( $settings['recipient'], 'both' ); ?> /> <label for="mycred-email-recipient-both"><?php _e( 'Both', 'mycred' ); ?></label>
766
+ </div>
767
+ </div>
768
+ <div class="misc-pub-section">
769
+ <label for="mycred-email-senders-name"><?php _e( 'Senders Name:', 'mycred' ); ?></label><br />
770
+ <input type="text" name="mycred_email[senders_name]" id="mycred-email-senders-name" value="<?php echo $settings['senders_name']; ?>" /><br />
771
+ <label for="mycred-email-senders-email"><?php _e( 'Senders Email:', 'mycred' ); ?></label><br />
772
+ <input type="text" name="mycred_email[senders_email]" id="mycred-email-senders-email" value="<?php echo $settings['senders_email']; ?>" /><br />
773
+ <label for="mycred-email-reply-to"><?php _e( 'Reply-To Email:', 'mycred' ); ?></label><br />
774
+ <input type="text" name="mycred_email[reply_to]" id="mycred-email-reply-to" value="<?php echo $settings['reply_to']; ?>" />
775
+ </div>
776
+ <?php do_action( 'mycred_email_settings_box', $this ); ?>
777
+
778
+ <div class="mycred-save">
779
+ <?php submit_button( __( 'Save', 'mycred' ), 'secondary', 'mycred-save-email', '' ); ?>
780
+ </div>
781
+ <?php
782
+ }
783
+
784
+ /**
785
+ * Email Header Metabox
786
+ * @since 1.1
787
+ * @version 1.0
788
+ */
789
+ public function email_header( $post ) { ?>
790
+
791
+ <p><label for="mycred-email-styling"><?php _e( 'CSS Styling', 'mycred' ); ?></label></p>
792
+ <textarea name="mycred_email[styling]" id="mycred-email-styling"><?php echo $this->get_email_styling( $post->ID ); ?></textarea>
793
+ <?php do_action( 'mycred_email_header_box', $this ); ?>
794
+
795
+ <?php
796
+ }
797
+
798
+ /**
799
+ * Template Tags Metabox
800
+ * @since 1.1
801
+ * @version 1.0
802
+ */
803
+ public function template_tags( $post ) {
804
+ echo '
805
+ <ul>
806
+ <li class="title">' . __( 'Site Related', 'mycred' ) . '</li>
807
+ <li><strong>%blog_name%</strong> ' . __( 'Your websites title', 'mycred' ) . '.</li>
808
+ <li><strong>%blog_url%</strong> ' . __( 'Your websites address', 'mycred' ) . '.</li>
809
+ <li><strong>%blog_info%</strong> ' . __( 'Your websites tagline (description)', 'mycred' ) . '.</li>
810
+ <li><strong>%admin_email%</strong> ' . __( 'Your websites admin email', 'mycred' ) . '.</li>
811
+ <li><strong>%num_members%</strong> ' . __( 'Total number of blog members', 'mycred' ) . '.</li>
812
+ <li class="empty">&nbsp;</li>
813
+ <li class="title">' . __( 'General', 'mycred' ) . '</li>
814
+ <li><strong>%singular%</strong> ' . __( 'Points name in singular format', 'mycred' ) . '.</li>
815
+ <li><strong>%plural%</strong> ' . __( 'Points name in plural', 'mycred' ) . '.</li>
816
+ <li><strong>%login_url%</strong> ' . __( 'Login URL', 'mycred' ) . '.</li>
817
+ </ul>
818
+ <ul>
819
+ <li class="title">' . __( 'User Related', 'mycred' ) . '</li>
820
+ <li><strong>%user_id%</strong> ' . __( 'The users ID', 'mycred' ) . '.</li>
821
+ <li><strong>%user_name%</strong> ' . __( 'The users login name (username)', 'mycred' ) . '.</li>
822
+ <li><strong>%display_name%</strong> ' . __( 'The users display name', 'mycred' ) . '.</li>
823
+ <li><strong>%user_profile_url%</strong> ' . __( 'The users profile address', 'mycred' ) . '.</li>
824
+ <li><strong>%user_profile_link%</strong> ' . __( 'Link to the users profile address with their display name as title', 'mycred' ) . '.</li>
825
+ <li><strong>%balance%</strong> ' . __( 'The users current balance unformated', 'mycred' ) . '.</li>
826
+ <li><strong>%balance_f%</strong> ' . __( 'The users current balance formated', 'mycred' ) . '.</li>
827
+ <li class="empty">&nbsp;</li>
828
+ <li class="title">' . __( 'Post Related', 'mycred' ) . '</li>
829
+ <li><strong>%post_title%</strong> ' . __( 'Post Title', 'mycred' ) . '.</li>
830
+ <li><strong>%post_url%</strong> ' . __( 'Post URL address', 'mycred' ) . '.</li>
831
+ <li><strong>%link_with_title%</strong> ' . __( 'Link to post Post title', 'mycred' ) . '.</li>
832
+ <li><strong>%post_type%</strong> ' . __( 'The post type', 'mycred' ) . '.</li>
833
+ </ul>
834
+ <div class="clear"></div>';
835
+ }
836
+
837
+ /**
838
+ * Save Email Notice Details
839
+ * @since 1.1
840
+ * @version 1.0
841
+ */
842
+ public function save_email_notice( $post_id ) {
843
+ // Make sure this is the correct post type
844
+ if ( get_post_type( $post_id ) != 'mycred_email_notice' ) return;
845
+ // Make sure we can edit
846
+ elseif ( !mycred_is_admin( get_current_user_id() ) ) return;
847
+ // Make sure fields exists
848
+ elseif ( !isset( $_POST['mycred_email'] ) || !is_array( $_POST['mycred_email'] ) ) return;
849
+ // Finally check token
850
+ elseif ( !wp_verify_nonce( $_POST['mycred_email']['token'], 'mycred-edit-email' ) ) return;
851
+
852
+ // Update Instance
853
+ if ( !empty( $_POST['mycred_email']['instance'] ) ) {
854
+ // Lets make sure the value is properly formatted otherwise things could go uggly later
855
+ $instance_key = trim( $_POST['mycred_email']['instance'] );
856
+ $keys = explode( '|', $instance_key );
857
+ if ( $keys !== false && !empty( $keys ) );
858
+ update_post_meta( $post_id, 'mycred_email_instance', $instance_key );
859
+ }
860
+
861
+ // Construct new settings
862
+ $settings = array();
863
+ // If recipient is set but differs from the default, use the posted one else use default
864
+ if ( !empty( $_POST['mycred_email']['recipient'] ) )
865
+ $settings['recipient'] = $_POST['mycred_email']['recipient'];
866
+ else
867
+ $settings['recipient'] = 'user';
868
+
869
+ // If senders name is set but differs from the default, use the posted one else use default
870
+ if ( !empty( $_POST['mycred_email']['senders_name'] ) )
871
+ $settings['senders_name'] = $_POST['mycred_email']['senders_name'];
872
+ else
873
+ $settings['senders_name'] = $this->emailnotices['from']['name'];
874
+
875
+ // If senders email is set but differs from the default, use the posted one else use default
876
+ if ( !empty( $_POST['mycred_email']['senders_email'] ) )
877
+ $settings['senders_email'] = $_POST['mycred_email']['senders_email'];
878
+ else
879
+ $settings['senders_email'] = $this->emailnotices['from']['email'];
880
+
881
+ // If senders email is set but differs from the default, use the posted one else use default
882
+ if ( !empty( $_POST['mycred_email']['reply_to'] ) )
883
+ $settings['reply_to'] = $_POST['mycred_email']['reply_to'];
884
+ else
885
+ $settings['reply_to'] = $this->emailnotices['from']['reply_to'];
886
+
887
+ // Save settings
888
+ update_post_meta( $post_id, 'mycred_email_settings', $settings );
889
+
890
+ // If rich editing is disabled bail now
891
+ if ( $this->emailnotices['use_html'] === false ) return;
892
+
893
+ // Save styling
894
+ if ( !empty( $_POST['mycred_email']['styling'] ) )
895
+ update_post_meta( $post_id, 'mycred_email_styling', trim( $_POST['mycred_email']['styling'] ) );
896
+ }
897
+
898
+ /**
899
+ * Adjust Post Updated Messages
900
+ * @since 1.1
901
+ * @version 1.0
902
+ */
903
+ public function post_updated_messages( $messages ) {
904
+ global $post;
905
+
906
+ $messages['mycred_email_notice'] = array(
907
+ 0 => '',
908
+ 1 => sprintf( __( 'Email Notice Updated. View <a href="%1$s">All Notices</a>.', 'mycred' ), admin_url( 'edit.php?post_type=mycred_email_notice' ) ),
909
+ 2 => __( 'Custom field updated', 'mycred' ),
910
+ 3 => __( 'Custom filed updated', 'mycred' ),
911
+ 4 => sprintf( __( 'Email Notice Updated. View <a href="%1$s">All Notices</a>.', 'mycred' ), admin_url( 'edit.php?post_type=mycred_email_notice' ) ),
912
+ 5 => false,
913
+ 6 => __( 'Email Notice Activated', 'mycred' ),
914
+ 7 => __( 'Email Notice Saved', 'mycred' ),
915
+ 8 => sprintf( __( 'Email Notice Submitted for approval. View <a href="%1$s">All Notices</a>.', 'mycred' ), admin_url( 'edit.php?post_type=mycred_email_notice' ) ),
916
+ 9 => sprintf(
917
+ __( 'Email Notice scheduled for: <strong>%1$s</strong>.', 'mycred' ),
918
+ date_i18n( get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' ), strtotime( $post->post_date ) )
919
+ ),
920
+ 10 => __( '', 'mycred' )
921
+ );
922
+
923
+ return $messages;
924
+ }
925
+
926
+ /**
927
+ * Add Publish Notice
928
+ * @since 1.1
929
+ * @version 1.0
930
+ */
931
+ public function publish_warning() {
932
+ global $post;
933
+ if ( $post->post_type != 'mycred_email_notice' ) return;
934
+
935
+ if ( $post->post_status != 'publish' && $post->post_status != 'future' )
936
+ echo '<p>' . __( 'Once a notice is "published" it becomes active! Select "Save Draft" if you are not yet ready to use this email notice!', 'mycred' ) . '</p>';
937
+ elseif ( $post->post_status == 'future' )
938
+ echo '<p>' . sprintf( __( 'This notice will become active on:<br /><strong>%1$s</strong>', 'mycred' ), date_i18n( get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' ), strtotime( $post->post_date ) ) ) . '</p>';
939
+ else
940
+ echo '<p>' . __( 'This email notice is active.', 'mycred' ) . '</p>';
941
+ }
942
+ }
943
+ $email_notice = new myCRED_Email_Notices();
944
+ $email_notice->load();
945
+ }
946
+ ?>
addons/gateway/carts/mycred-marketpress.php ADDED
@@ -0,0 +1,416 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'WP_PLUGIN_DIR' ) ) exit;
3
+ /**
4
+ * MarketPress Payment Gateway
5
+ * @since 1.1
6
+ * @version 1.0
7
+ */
8
+ if ( !class_exists( 'MP_Gateway_myCRED' ) && function_exists( 'mp_register_gateway_plugin' ) ) {
9
+ /**
10
+ * Locate the MarketPress base gateway file
11
+ * @from MarketPress::init_vars()
12
+ */
13
+ $file = '/marketpress-includes/marketpress-gateways.php';
14
+ if ( file_exists( WP_PLUGIN_DIR . '/wordpress-ecommerce' . $file ) )
15
+ include_once( WP_PLUGIN_DIR . '/wordpress-ecommerce' . $file );
16
+ elseif ( file_exists( WP_PLUGIN_DIR . $file ) )
17
+ include_once( WP_PLUGIN_DIR . $file );
18
+ elseif ( is_multisite() && file_exists( WPMU_PLUGIN_DIR . $file ) )
19
+ include_once( WPMU_PLUGIN_DIR . $file );
20
+
21
+ /**
22
+ * myCRED Custom Gateway
23
+ */
24
+ class MP_Gateway_myCRED extends MP_Gateway_API {
25
+
26
+ var $plugin_name = 'mycred';
27
+ var $admin_name = 'myCRED';
28
+ var $public_name = 'myCRED';
29
+ var $method_img_url = '';
30
+ var $method_button_img_url = '';
31
+ var $force_ssl = false;
32
+ var $ipn_url;
33
+ var $skip_form = false;
34
+
35
+ /**
36
+ * Runs when your class is instantiated. Use to setup your plugin instead of __construct()
37
+ */
38
+ function on_creation() {
39
+ global $mp;
40
+ $settings = get_option( 'mp_settings' );
41
+
42
+ //set names here to be able to translate
43
+ $this->admin_name = 'myCRED';
44
+ $this->public_name = ( !empty( $settings['gateways']['mycred']['name'] ) ) ? $settings['gateways']['mycred']['name'] : apply_filters( 'mycred_label', myCRED_NAME );
45
+ $this->method_img_url = plugins_url( 'assets/images/cred-icon32.png', myCRED_THIS );
46
+ $this->method_button_img_url = $settings['gateways']['mycred']['name'];
47
+ }
48
+
49
+ /**
50
+ * Use Exchange
51
+ * Checks to see if exchange is needed.
52
+ * @since 1.1
53
+ * @version 1.0
54
+ */
55
+ function use_exchange() {
56
+ global $mp;
57
+
58
+ $settings = get_option( 'mp_settings' );
59
+ if ( $settings['currency'] == 'POINTS' ) return false;
60
+ return true;
61
+ }
62
+
63
+ /**
64
+ * Return fields you need to add to the payment screen, like your credit card info fields
65
+ *
66
+ * @param array $cart. Contains the cart contents for the current blog, global cart if $mp->global_cart is true
67
+ * @param array $shipping_info. Contains shipping info and email in case you need it
68
+ * @since 1.1
69
+ * @version 1.0
70
+ */
71
+ function payment_form( $cart, $shipping_info ) {
72
+ global $mp;
73
+
74
+ $settings = get_option( 'mp_settings' );
75
+ $mycred = mycred_get_settings();
76
+ return '<div id="mp-mycred-balance">' . $mycred->template_tags_general( $settings['gateways']['mycred']['name'] ) . '</div>';
77
+ }
78
+
79
+ /**
80
+ * Return the chosen payment details here for final confirmation. You probably don't need
81
+ * to post anything in the form as it should be in your $_SESSION var already.
82
+ *
83
+ * @param array $cart. Contains the cart contents for the current blog, global cart if $mp->global_cart is true
84
+ * @param array $shipping_info. Contains shipping info and email in case you need it
85
+ * @since 1.1
86
+ * @version 1.0
87
+ */
88
+ function confirm_payment_form( $cart, $shipping_info ) {
89
+ global $mp;
90
+
91
+ $settings = get_option( 'mp_settings' );
92
+ $mycred = mycred_get_settings();
93
+ $user_id = get_current_user_id();
94
+ return '<div id="mp-mycred-balance">' . $mycred->template_tags_user( $settings['gateways']['mycred']['instructions'], $user_id ) . '</div>';
95
+ }
96
+
97
+ function process_payment_form( $cart, $shipping_info ) { }
98
+
99
+ /**
100
+ * Use this to do the final payment. Create the order then process the payment. If
101
+ * you know the payment is successful right away go ahead and change the order status
102
+ * as well.
103
+ * Call $mp->cart_checkout_error($msg, $context); to handle errors. If no errors
104
+ * it will redirect to the next step.
105
+ *
106
+ * @param array $cart. Contains the cart contents for the current blog, global cart if $mp->global_cart is true
107
+ * @param array $shipping_info. Contains shipping info and email in case you need it
108
+ * @since 1.1
109
+ * @version 1.0
110
+ */
111
+ function process_payment( $cart, $shipping_info ) {
112
+ global $mp;
113
+
114
+ $settings = get_option('mp_settings');
115
+ $timestamp = time();
116
+
117
+ // This gateway requires buyer to be logged in
118
+ if ( !is_user_logged_in() )
119
+ $mp->cart_checkout_error(
120
+ sprintf(
121
+ __( 'Sorry, but you must be logged in to use this gateway. Please <a href="%s">Login</a> or <a href="%s">select a different payment method</a>.', 'mycred' ),
122
+ wp_login_url( mp_checkout_step_url( 'checkout' ) ),
123
+ mp_checkout_step_url( 'checkout' )
124
+ )
125
+ );
126
+
127
+ $mycred = mycred_get_settings();
128
+ $user_id = get_current_user_id();
129
+
130
+ // Make sure current user is not excluded from using myCRED
131
+ if ( $mycred->exclude_user( $user_id ) )
132
+ $mp->cart_checkout_error(
133
+ sprintf( __( 'Sorry, but you can not use this gateway as your account is excluded. Please <a href="%s">select a different payment method</a>.', 'mycred' ), mp_checkout_step_url( 'checkout' ) )
134
+ );
135
+
136
+ // Get total
137
+ $totals = array();
138
+ foreach ( $cart as $product_id => $variations ) {
139
+ foreach ( $variations as $data ) {
140
+ $totals[] = $mp->before_tax_price( $data['price'], $product_id ) * $data['quantity'];
141
+ }
142
+ }
143
+ $total = array_sum( $totals );
144
+
145
+ // Apply Coupons
146
+ if ( $coupon = $mp->coupon_value( $mp->get_coupon_code(), $total ) ) {
147
+ $total = $coupon['new_total'];
148
+ }
149
+
150
+ // Shipping Cost
151
+ if ( ( $shipping_price = $mp->shipping_price() ) !== false ) {
152
+ $total = $total + $shipping_price;
153
+ }
154
+
155
+ // Tax
156
+ if ( ( $tax_price = $mp->tax_price() ) !== false ) {
157
+ $total = $total + $tax_price;
158
+ }
159
+
160
+ $balance = $mycred->get_users_cred( $user_id );
161
+ if ( $this->use_exchange() )
162
+ $balance = $mycred->apply_exchange_rate( $mycred->number( $total ), $settings['gateways']['mycred']['exchange'] );
163
+
164
+ // Check if there is enough to fund this
165
+ if ( $balance >= $total ) {
166
+ // Create MarketPress order
167
+ $order_id = $mp->generate_order_id();
168
+ $payment_info['gateway_public_name'] = $this->public_name;
169
+ $payment_info['gateway_private_name'] = $this->admin_name;
170
+ $payment_info['status'][$timestamp] = __( 'Paid', 'mycred' );
171
+ $payment_info['total'] = $total;
172
+ $payment_info['currency'] = $settings['currency'];
173
+ $payment_info['method'] = __( 'myCRED', 'mycred' );
174
+ $payment_info['transaction_id'] = $order_id;
175
+ $paid = true;
176
+ $result = $mp->create_order( $order_id, $cart, $shipping_info, $payment_info, $paid );
177
+
178
+ $order = get_page_by_title( $result, 'OBJECT', 'mp_order' );
179
+ // Deduct cost
180
+ $mycred->add_creds(
181
+ 'marketpress_payment',
182
+ $user_id,
183
+ 0-$total,
184
+ $settings['gateways']['mycred']['log_template'],
185
+ $order->ID,
186
+ array( 'ref_type' => 'post' )
187
+ );
188
+
189
+
190
+
191
+ }
192
+ // Insuffient Funds
193
+ else {
194
+ $mp->cart_checkout_error(
195
+ sprintf( __( 'Insufficient Funds Please select a different payment method. <a href="%s">Go Back</a>', 'mycred' ), mp_checkout_step_url( 'checkout' ) )
196
+ );
197
+ }
198
+ }
199
+
200
+ function order_confirmation( $order ) { }
201
+
202
+ /**
203
+ * Filters the order confirmation email message body. You may want to append something to
204
+ * the message. Optional
205
+ * @since 1.1
206
+ * @version 1.0
207
+ */
208
+ function order_confirmation_email( $msg, $order ) {
209
+ global $mp;
210
+ $settings = get_option('mp_settings');
211
+
212
+ if ( isset( $settings['gateways']['mycred']['email'] ) )
213
+ $msg = $mp->filter_email( $order, $settings['gateways']['mycred']['email'] );
214
+ else
215
+ $msg = $settings['email']['new_order_txt'];
216
+
217
+ return $msg;
218
+ }
219
+
220
+ /**
221
+ * Return any html you want to show on the confirmation screen after checkout. This
222
+ * should be a payment details box and message.
223
+ * @since 1.1
224
+ * @version 1.0
225
+ */
226
+ function order_confirmation_msg( $content, $order ) {
227
+ global $mp;
228
+ $settings = get_option('mp_settings');
229
+
230
+ $mycred = mycred_get_settings();
231
+ $user_id = get_current_user_id();
232
+
233
+ return $content . str_replace(
234
+ 'TOTAL',
235
+ $mp->format_currency( $order->mp_payment_info['currency'], $order->mp_payment_info['total'] ),
236
+ $mycred->template_tags_user( $settings['gateways']['mycred']['confirmation'], $user_id )
237
+ );
238
+ }
239
+
240
+ /**
241
+ * myCRED Gateway Settings
242
+ * @since 1.1
243
+ * @version 1.0
244
+ */
245
+ function gateway_settings_box( $settings ) {
246
+ global $mp;
247
+ $settings = get_option( 'mp_settings' );
248
+ $mycred = mycred_get_settings();
249
+
250
+ $name = apply_filters( 'mycred_label', myCRED_NAME );
251
+
252
+ if ( empty( $settings['gateways']['mycred']['name'] ) )
253
+ $settings['gateways']['mycred']['name'] = strip_tags( $name ) . ' ' . $mycred->template_tags_general( __( '%_singular% Balance', 'mycred' ) );
254
+
255
+ if ( !isset( $settings['gateways']['mycred']['logo'] ) )
256
+ $settings['gateways']['mycred']['logo'] = $this->method_button_img_url;
257
+
258
+ if ( !isset( $settings['gateways']['mycred']['log_template'] ) )
259
+ $settings['gateways']['mycred']['log_template'] = 'Payment for Order: #%order_id%';
260
+
261
+ if ( !isset( $settings['gateways']['mycred']['exchange'] ) )
262
+ $settings['gateways']['mycred']['exchange'] = 1;
263
+
264
+ if ( !isset( $settings['gateways']['mycred']['instructions'] ) )
265
+ $settings['gateways']['mycred']['instructions'] = 'Pay using your account balance.';
266
+
267
+ if ( !isset( $settings['gateways']['mycred']['confirmation'] ) )
268
+ $settings['gateways']['mycred']['confirmation'] = 'TOTAL amount has been deducted from your account. Your current balance is: %balance_f%';
269
+
270
+ if ( !isset( $settings['gateways']['mycred']['email'] ) )
271
+ $settings['gateways']['mycred']['email'] = $settings['email']['new_order_txt']; ?>
272
+
273
+ <div id="mp_cubepoints_payments" class="postbox mp-pages-msgs">
274
+ <h3 class="handle"><span><?php echo $name . ' ' . __( 'Settings', 'mycred' ); ?></span></h3>
275
+ <div class="inside">
276
+ <span class="description"><?php echo sprintf( __( 'Let your users pay for items in their shopping cart using their %s Account. Note! This gateway requires your users to be logged in when making a purchase!', 'mycred' ), $name ); ?></span>
277
+ <table class="form-table">
278
+ <tr>
279
+ <th scope="row"><label for="mycred-method-name"><?php _e( 'Method Name', 'mycred' ); ?></label></th>
280
+ <td>
281
+ <span class="description"><?php _e( 'Enter a public name for this payment method that is displayed to users - No HTML', 'mycred' ); ?></span>
282
+ <p><input value="<?php echo esc_attr( $settings['gateways']['mycred']['name'] ); ?>" style="width: 100%;" name="mp[gateways][mycred][name]" id="mycred-method-name" type="text" /></p>
283
+ </td>
284
+ </tr>
285
+ <tr>
286
+ <th scope="row"><label for="mycred-method-logo"><?php _e( 'Gateway Logo URL', 'mycred' ); ?></label></th>
287
+ <td>
288
+ <p><input value="<?php echo esc_attr( $settings['gateways']['mycred']['logo'] ); ?>" style="width: 100%;" name="mp[gateways][mycred][logo]" id="mycred-method-logo" type="text" /></p>
289
+ </td>
290
+ </tr>
291
+ <tr>
292
+ <th scope="row"><label for="mycred-log-template"><?php _e( 'Log Template', 'mycred' ); ?></label></th>
293
+ <td>
294
+ <span class="description"><?php _e( 'Log entry template for successful payments. Available template tags: %order_id%, %order_link%', 'mycred' ); ?></span>
295
+ <p><input value="<?php echo esc_attr( $settings['gateways']['mycred']['log_template'] ); ?>" style="width: 100%;" name="mp[gateways][mycred][log_template]" id="mycred-log-template" type="text" /></p>
296
+ </td>
297
+ </tr>
298
+ <?php
299
+ // Exchange rate
300
+ if ( $this->use_exchange() ) :
301
+ $exchange_desc = __( 'How much is 1 %_singular% worth in %currency%?', 'mycred' );
302
+ $exchange_desc = $mycred->template_tags_general( $exchange_desc );
303
+ $exchange_desc = str_replace( '%currency%', $settings['currency'], $exchange_desc ); ?>
304
+
305
+ <tr>
306
+ <th scope="row"><label for="mycred-exchange-rate"><?php _e( 'Exchange Rate', 'mycred' ); ?></label></th>
307
+ <td>
308
+ <span class="description"><?php echo $exchange_desc; ?></span>
309
+ <p><input value="<?php echo esc_attr( $settings['gateways']['mycred']['exchange'] ); ?>" size="8" name="mp[gateways][mycred][exchange]" id="mycred-exchange-rate" type="text" /></p>
310
+ </td>
311
+ </tr>
312
+ <?php endif; ?>
313
+
314
+ <tr>
315
+ <th scope="row"><label for="mycred-instructions"><?php _e( 'User Instructions', 'mycred' ); ?></label></th>
316
+ <td>
317
+ <span class="description"><?php _e( 'Information to show users before payment.', 'mycred' ); ?></span>
318
+ <p><?php wp_editor( $settings['gateways']['mycred']['instructions'] , 'mycred-instructions', array( 'textarea_name' => 'mp[gateways][mycred][instructions]' ) ); ?><br />
319
+ <span class="description"><?php _e( 'Available template tags are: %balance% and %balance_f% for users current balance.', 'mycred' ); ?></span></p>
320
+ </td>
321
+ </tr>
322
+ <tr>
323
+ <th scope="row"><label for="mycred-confirmation"><?php _e( 'Confirmation Information', 'mycred' ); ?></label></th>
324
+ <td>
325
+ <span class="description"><?php _e( 'Information to display on the order confirmation page. - HTML allowed', 'mycred' ); ?></span>
326
+ <p><?php wp_editor( $settings['gateways']['mycred']['confirmation'], 'mycred-confirmation', array( 'textarea_name' => 'mp[gateways][mycred][confirmation]' ) ); ?><br />
327
+ <span class="description"><?php _e( 'Available template tags: TOTAL - total cart cost, %balance% and %balance_f% - users current balance.', 'mycred' ); ?></span></p>
328
+ </td>
329
+ </tr>
330
+ <tr>
331
+ <th scope="row"><label for="mycred-email"><?php _e( 'Order Confirmation Email', 'mycred' ); ?></label></th>
332
+ <td>
333
+ <span class="description"><?php echo sprintf( __( 'This is the email text to send to those who have made %s checkouts. It overrides the default order checkout email. These codes will be replaced with order details: CUSTOMERNAME, ORDERID, ORDERINFO, SHIPPINGINFO, PAYMENTINFO, TOTAL, TRACKINGURL. No HTML allowed.', 'mycred' ), $name ); ?></span>
334
+ <p><textarea id="mycred-email" name="mp[gateways][mycred][email]" class="mp_emails_txt"><?php echo esc_textarea( $settings['gateways']['mycred']['email'] ); ?></textarea></p>
335
+ <span class="description"><?php _e( 'Available template tags: %balance% or %balance_f% for users balance.', 'mycred' ); ?></span>
336
+ </td>
337
+ </tr>
338
+ </table>
339
+ </div>
340
+ </div>
341
+ <?php
342
+ }
343
+
344
+ /**
345
+ * Filter Gateway Settings
346
+ * @since 1.1
347
+ * @version 1.0
348
+ */
349
+ function process_gateway_settings( $settings ) {
350
+ // Name (no html)
351
+ $settings['gateways']['mycred']['name'] = stripslashes( wp_filter_nohtml_kses( $settings['gateways']['mycred']['name'] ) );
352
+
353
+ // Log Template (no html)
354
+ $settings['gateways']['mycred']['log_template'] = stripslashes( wp_filter_nohtml_kses( $settings['gateways']['mycred']['log_template'] ) );
355
+ $settings['gateways']['mycred']['logo'] = stripslashes( wp_filter_nohtml_kses( $settings['gateways']['mycred']['logo'] ) );
356
+
357
+ // Exchange rate (if used)
358
+ if ( $this->use_exchange() ) {
359
+ // Decimals must start with a zero
360
+ if ( $settings['gateways']['mycred']['exchange'] != 1 && substr( $settings['gateways']['mycred']['exchange'], 0, 1 ) != '0' ) {
361
+ $settings['gateways']['mycred']['exchange'] = (float) '0' . $settings['gateways']['mycred']['exchange'];
362
+ }
363
+ // Decimal seperator must be punctuation and not comma
364
+ $settings['gateways']['mycred']['exchange'] = str_replace( ',', '.', $settings['gateways']['mycred']['exchange'] );
365
+ }
366
+ else
367
+ $settings['gateways']['mycred']['exchange'] = 1;
368
+
369
+ // Filter Instruction & Confirmation (if needed)
370
+ if ( !current_user_can( 'unfiltered_html' ) ) {
371
+ $settings['gateways']['mycred']['instructions'] = wp_filter_post_kses( $settings['gateways']['mycred']['instructions'] );
372
+ $settings['gateways']['mycred']['confirmation'] = wp_filter_post_kses( $settings['gateways']['mycred']['confirmation'] );
373
+ }
374
+
375
+ // Email (no html)
376
+ $settings['gateways']['mycred']['email'] = stripslashes( wp_filter_nohtml_kses( $settings['gateways']['mycred']['email'] ) );
377
+
378
+ return $settings;
379
+ }
380
+ }
381
+ // Register Gateway
382
+ mp_register_gateway_plugin( 'MP_Gateway_myCRED', 'mycred', 'myCRED' );
383
+ }
384
+ /**
385
+ * Filter the myCRED Log
386
+ * Parses the %order_id% and %order_link% template tags.
387
+ * @since 1.1
388
+ * @version 1.0
389
+ */
390
+ if ( !function_exists( 'mycred_marketpress_parse_log' ) ) {
391
+ add_filter( 'mycred_parse_log_entry_marketpress_payment', 'mycred_marketpress_parse_log', 90, 2 );
392
+ function mycred_marketpress_parse_log( $content, $log_entry )
393
+ {
394
+ // Prep
395
+ global $mp;
396
+ $mycred = mycred_get_settings();
397
+ $order = get_post( $log_entry->ref_id );
398
+ $order_id = $order->post_title;
399
+ $user_id = get_current_user_id();
400
+
401
+ // Order ID
402
+ $content = str_replace( '%order_id%', $order->post_title, $content );
403
+
404
+ // Link to order if we can edit plugin or are the user who made the order
405
+ if ( $user_id == $log_entry->user_id || $mycred->can_edit_plugin( $user_id ) ) {
406
+ $track_link = '<a href="' . mp_orderstatus_link( false, true ) . $order_id . '/' . '">#' . $order->post_title . '/' . '</a>';
407
+ $content = str_replace( '%order_link%', $track_link, $content );
408
+ }
409
+ else {
410
+ $content = str_replace( '%order_link%', '#' . $order_id, $content );
411
+ }
412
+
413
+ return $content;
414
+ }
415
+ }
416
+ ?>
addons/gateway/carts/mycred-woocommerce.php CHANGED
@@ -41,7 +41,15 @@ if ( !function_exists( 'mycred_init_woo_gateway' ) ) {
41
  // Define user set variables
42
  $this->title = $this->get_option( 'title' );
43
  $this->description = $this->get_option( 'description' );
44
- $this->exchange_rate = ( $this->use_exchange() ) ? (float) $this->get_option( 'exchange_rate' ) : 1;
 
 
 
 
 
 
 
 
45
  $this->log_template = $this->get_option( 'log_template' );
46
 
47
  // Actions
41
  // Define user set variables
42
  $this->title = $this->get_option( 'title' );
43
  $this->description = $this->get_option( 'description' );
44
+ if ( $this->use_exchange() )
45
+ $exchange_rate = (float) $this->get_option( 'exchange_rate' );
46
+ else
47
+ $exchange_rate = 1;
48
+
49
+ if ( !is_numeric( $exchange_rate ) )
50
+ $exchange_rate = 1;
51
+
52
+ $this->exchange_rate = $exchange_rate;
53
  $this->log_template = $this->get_option( 'log_template' );
54
 
55
  // Actions
addons/gateway/myCRED-addon-gateway.php CHANGED
@@ -2,8 +2,8 @@
2
  /**
3
  * Addon: Gateway
4
  * Addon URI: http://mycred.me/add-ons/gateway/
5
- * Version: 1.0
6
- * Description: Let your users pay using their <strong>my</strong>CRED points balance. Supported Carts: WooCommerce.
7
  * Author: Gabriel S Merovingi
8
  * Author URI: http://www.merovingi.com
9
  */
@@ -13,7 +13,8 @@ define( 'myCRED_GATE_DIR', myCRED_ADDONS_DIR . 'gateway/' );
13
  define( 'myCRED_GATE_ASSETS_DIR', myCRED_GATE_DIR . 'assets/' );
14
  define( 'myCRED_GATE_CART_DIR', myCRED_GATE_DIR . 'carts/' );
15
  /**
16
- * WooCommerce
17
  */
18
  require_once( myCRED_GATE_CART_DIR . 'mycred-woocommerce.php' );
 
19
  ?>
2
  /**
3
  * Addon: Gateway
4
  * Addon URI: http://mycred.me/add-ons/gateway/
5
+ * Version: 1.1
6
+ * Description: Let your users pay using their <strong>my</strong>CRED points balance. Supported Carts: WooCommerce, MarketPress.
7
  * Author: Gabriel S Merovingi
8
  * Author URI: http://www.merovingi.com
9
  */
13
  define( 'myCRED_GATE_ASSETS_DIR', myCRED_GATE_DIR . 'assets/' );
14
  define( 'myCRED_GATE_CART_DIR', myCRED_GATE_DIR . 'carts/' );
15
  /**
16
+ * Supported Carts
17
  */
18
  require_once( myCRED_GATE_CART_DIR . 'mycred-woocommerce.php' );
19
+ require_once( myCRED_GATE_CART_DIR . 'mycred-marketpress.php' );
20
  ?>
addons/import/myCRED-addon-import.php CHANGED
@@ -456,7 +456,7 @@ if ( !class_exists( 'myCRED_Import' ) ) {
456
 
457
  <div class="wrap list" id="myCRED-wrap">
458
  <div id="icon-myCRED" class="icon32"><br /></div>
459
- <h2><?php echo '<strong>my</strong>CRED ' . __( 'Import', 'mycred' ); ?></h2>
460
  <?php
461
  // Errors
462
  if ( !empty( $this->errors ) ) {
456
 
457
  <div class="wrap list" id="myCRED-wrap">
458
  <div id="icon-myCRED" class="icon32"><br /></div>
459
+ <h2><?php echo apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . __( 'Import', 'mycred' ); ?></h2>
460
  <?php
461
  // Errors
462
  if ( !empty( $this->errors ) ) {
addons/ranks/includes/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ ?>
addons/ranks/includes/mycred-rank-functions.php ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'myCRED_VERSION' ) ) exit;
3
+ /**
4
+ * Have Ranks
5
+ * Checks if there are any registered rank.
6
+ * @returns (bool) true or false
7
+ * @since 1.1
8
+ * @version 1.0
9
+ */
10
+ if ( !function_exists( 'have_ranks' ) ) {
11
+ function mycred_have_ranks() {
12
+ global $wpdb;
13
+
14
+ $sql = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = %s";
15
+ $search = $wpdb->get_var( $wpdb->prepare( $sql, 'mycred_rank' ) );
16
+ if ( $search > 0 ) return true;
17
+ return false;
18
+ }
19
+ }
20
+ /**
21
+ * Get Ranks
22
+ * Retreaves a given rank.
23
+ * @param $rank_title (string) the rank title (case sensitive)
24
+ * @param $format (string) optional output type: OBJECT, ARRAY_N or ARRAY_A
25
+ * @uses get_page_by_title()
26
+ * @returns empty string if title is missing, NULL if rank is not found else the output type
27
+ * @since 1.1
28
+ * @version 1.0
29
+ */
30
+ if ( !function_exists( 'mycred_get_rank' ) ) {
31
+ function mycred_get_rank( $rank_title = '', $format = 'OBJECT' ) {
32
+ if ( empty( $rank_title ) ) return $rank_title;
33
+ return get_page_by_title( $rank_title, $format, 'mycred_rank' );
34
+ }
35
+ }
36
+ /**
37
+ * Get Users Rank
38
+ * Retreaves the users current saved rank or if rank is missing
39
+ * finds the appropriate rank and saves it.
40
+ * @param $user_id (int) required user id to check
41
+ * @uses mycred_find_users_rank()
42
+ * @uses get_the_title()
43
+ * @returns rank (string) or empty string on fail
44
+ * @since 1.1
45
+ * @version 1.0
46
+ */
47
+ if ( !function_exists( 'mycred_get_users_rank' ) ) {
48
+ function mycred_get_users_rank( $user_id = NULL ) {
49
+ $rank_id = get_user_meta( $user_id, 'mycred_rank', true );
50
+ if ( empty( $rank ) )
51
+ return mycred_find_users_rank( $user_id, true );
52
+ else
53
+ return get_the_title( $rank_id );
54
+ }
55
+ }
56
+ /**
57
+ * Find Users Rank
58
+ * Compares the given users points balance with existing ranks to determain
59
+ * where the user fits in.
60
+ * @param $user_id (int) required user id
61
+ * @param $save (bool) option to save the rank to the given users meta data
62
+ * @uses WP_Query()
63
+ * @uses mycred_have_ranks()
64
+ * @uses update_user_meta()
65
+ * @returns empty (string) on failure or the users rank
66
+ * @since 1.1
67
+ * @version 1.0
68
+ */
69
+ if ( !function_exists( 'mycred_find_users_rank' ) ) {
70
+ function mycred_find_users_rank( $user_id = NULL, $save = false ) {
71
+ $mycred = mycred_get_settings();
72
+
73
+ // Check for exclusion
74
+ if ( $mycred->exclude_user( $user_id ) ) return '';
75
+
76
+ // Get users balance
77
+ if ( $user_id === NULL )
78
+ $balance = $mycred->get_users_cred( get_current_user_id() );
79
+ else
80
+ $balance = $mycred->get_users_cred( $user_id );
81
+
82
+ // Rank query arguments
83
+ $args = array(
84
+ 'post_type' => 'mycred_rank', // rank type
85
+ 'post_status' => 'publish', // in case we have some draft ranks
86
+ 'posts_per_page' => 1, // we should recieve just one match but just in case
87
+ 'meta_query' => array(
88
+ array(
89
+ 'key' => 'mycred_rank_min',
90
+ 'value' => $balance,
91
+ 'compare' => '<=',
92
+ 'type' => 'NUMERIC'
93
+ ),
94
+ array(
95
+ 'key' => 'mycred_rank_max',
96
+ 'value' => $balance,
97
+ 'compare' => '>=',
98
+ 'type' => 'NUMERIC'
99
+ )
100
+ )
101
+ );
102
+ $rank = new WP_Query( $args );
103
+
104
+ // Found a matching rank
105
+ if ( $rank->have_posts() ) {
106
+ $rank_title = $rank->post->post_title;
107
+ $rank_id = $rank->post->ID;
108
+ }
109
+ // No matching rank found
110
+ else {
111
+ // Reset
112
+ wp_reset_postdata();
113
+ // Check if there is any ranks (should be one)
114
+ if ( mycred_have_ranks() ) {
115
+ // Get this rank
116
+ $new_args = array(
117
+ 'post_type' => 'mycred_rank', // rank type
118
+ 'post_status' => 'publish'
119
+ );
120
+ $default = new WP_Query( $new_args );
121
+ if ( $default->have_posts() ) {
122
+ $rank_title = $default->post->post_title;
123
+ $rank_id = $default->post->ID;
124
+ }
125
+ else {
126
+ $rank_title = __( 'No Rank', 'mycred' );
127
+ $rank_id = '';
128
+ }
129
+ }
130
+ // No ranks at all
131
+ else {
132
+ $rank_title = __( 'No Rank', 'mycred' );
133
+ $rank_id = '';
134
+ }
135
+ }
136
+
137
+ // Save if requested
138
+ if ( $save )
139
+ update_user_meta( $user_id, 'mycred_rank', $rank_id );
140
+
141
+ // Reset & Return
142
+ wp_reset_postdata();
143
+ return $rank_title;
144
+ }
145
+ }
146
+ /**
147
+ * Get Rank ID from Title
148
+ * Used to get the rank object based on the ranks title.
149
+ * @param $title (string) required rank title
150
+ * @uses mycred_get_rank()
151
+ * @returns empty (string) if title is missing, NULL if rank is not found else (string) the rank.
152
+ * @since 1.1
153
+ * @version 1.0
154
+ */
155
+ if ( !function_exists( 'mycred_get_rank_id_from_title' ) ) {
156
+ function mycred_get_rank_id_from_title( $title ) {
157
+ $rank = mycred_get_rank( $title );
158
+ return $rank->ID;
159
+ }
160
+ }
161
+
162
+ /**
163
+ * Get My Rank
164
+ * Returns the current users rank
165
+ * @since 1.1
166
+ * @version 1.0
167
+ */
168
+ if ( !function_exists( 'mycred_get_my_rank' ) ) {
169
+ function mycred_get_my_rank() {
170
+ return mycred_get_users_rank( get_current_user_id() );
171
+ }
172
+ }
173
+ /**
174
+ * Get Ranks
175
+ * Returns an associative array of ranks with the given status.
176
+ * @param $status (string) post status, defaults to 'publish'
177
+ * @param $number (int|string) number of ranks to return, defaults to all
178
+ * @param $order (string) option to return ranks ordered Ascending or Descending
179
+ * @uses WP_Query()
180
+ * @returns (array) empty if no ranks are found or associative array with post ID as key and title as value
181
+ * @since 1.1
182
+ * @version 1.0
183
+ */
184
+ if ( !function_exists( 'mycred_get_ranks' ) ) {
185
+ function mycred_get_ranks( $status = 'publish', $number = '-1', $order = 'DESC' ) {
186
+ $args = array(
187
+ 'post_type' => 'mycred_rank',
188
+ 'post_status' => $status,
189
+ 'posts_per_page' => $number,
190
+ 'orderby' => 'meta_value_num',
191
+ 'meta_key' => 'mycred_rank_min',
192
+ 'order' => $order
193
+ );
194
+ $ranks = new WP_Query( $args );
195
+ $all_ranks = array();
196
+ if ( $ranks->have_posts() ) {
197
+ while ( $ranks->have_posts() ) {
198
+ $ranks->the_post();
199
+ $all_ranks[get_the_ID()] = array(
200
+ 'title' => get_the_title(),
201
+ 'slug' => isset( $ranks->post->post_name ) ? $ranks->post->post_name : ''
202
+ );
203
+ }
204
+ }
205
+
206
+ wp_reset_postdata();
207
+ return $all_ranks;
208
+ }
209
+ }
210
+ /**
211
+ * Get Users of Rank
212
+ * Returns an associative array of user IDs and display names of users for a given
213
+ * rank.
214
+ * @param $rank (int|string) either a rank id or rank name
215
+ * @param $number (int) number of users to return
216
+ * @uses mycred_get_rank_id_from_title()
217
+ * @uses get_users()
218
+ * @returns (array) empty if no users were found or associative array with user ID as key and display name as value
219
+ * @since 1.1
220
+ * @version 1.0
221
+ */
222
+ if ( !function_exists( 'mycred_get_users_of_rank' ) ) {
223
+ function mycred_get_users_of_rank( $rank, $number = NULL ) {
224
+ if ( !is_numeric( $rank ) )
225
+ $rank = mycred_get_rank_id_from_title( $rank );
226
+
227
+ if ( $rank === NULL ) return '';
228
+
229
+ $mycred = mycred_get_settings();
230
+ $args = array(
231
+ 'meta_key' => 'mycred_rank',
232
+ 'meta_value' => $rank,
233
+ 'order' => 'DESC',
234
+ 'number' => $number,
235
+ 'type' => 'mycred_default'
236
+ );
237
+
238
+ global $wpdb;
239
+ $sql = "SELECT u.ID FROM $wpdb->users u INNER JOIN $wpdb->usermeta m ON (u.ID = m.user_id) INNER JOIN $wpdb->usermeta c ON (u.ID = c.user_id) WHERE 1=1 AND ( m.meta_key = %s AND m.meta_value = %d AND c.meta_key = %s ) ORDER BY c.meta_value+0";
240
+
241
+ // Order
242
+ if ( $args['order'] == 'ASC' || $args['order'] == 'DESC' )
243
+ $sql .= ' ' . trim( $args['order'] );
244
+ else
245
+ $sql .= ' DESC';
246
+
247
+ // Limit
248
+ if ( $args['number'] !== NULL )
249
+ $sql .= ' LIMIT 0,' . abs( $args['number'] );
250
+
251
+ // Run query
252
+ $users = $wpdb->get_results( $wpdb->prepare( $sql, $args['meta_key'], $args['meta_value'], $args['type'] ) );
253
+
254
+ $rank_users = array();
255
+ if ( $users ) {
256
+ foreach ( $users as $user ) {
257
+ // make sure user is not excluded
258
+ if ( $mycred->exclude_user( $user->ID ) ) continue;
259
+ $rank_users[] = $user->ID;
260
+ }
261
+ }
262
+
263
+ return $rank_users;
264
+ }
265
+ }
266
+ /**
267
+ * Rank Has Logo
268
+ * Checks if a given rank has a logo.
269
+ * @param $rank_id (int|string) either the rank id or the rank title
270
+ * @uses mycred_get_rank_id_from_title()
271
+ * @uses has_post_thumbnail()
272
+ * @returns (bool) true or false
273
+ * @since 1.1
274
+ * @version 1.0
275
+ */
276
+ if ( !function_exists( 'mycred_rank_has_logo' ) ) {
277
+ function mycred_rank_has_logo( $rank_id ) {
278
+ if ( !is_numeric( $rank_id ) )
279
+ $rank_id = mycred_get_rank_id_from_title( $rank_id );
280
+
281
+ if ( has_post_thumbnail( $rank_id ) ) return true;
282
+ return false;
283
+ }
284
+ }
285
+ /**
286
+ * Get Rank Logo
287
+ * Returns the given ranks logo.
288
+ * @param $rank_id (int|string) either the rank id or the rank title
289
+ * @param $size (string|array) see http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail
290
+ * @param $attr (string|array) see http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail
291
+ * @uses mycred_get_rank_id_from_title()
292
+ * @uses mycred_rank_has_logo()
293
+ * @uses get_the_post_thumbnail()
294
+ * @returns empty string if rank does not that logo or the HTML IMG element with given size and attribute
295
+ * @since 1.1
296
+ * @version 1.0
297
+ */
298
+ if ( !function_exists( 'mycred_get_rank_logo' ) ) {
299
+ function mycred_get_rank_logo( $rank_id, $size = 'post-thumbnail', $attr = NULL ) {
300
+ if ( !is_numeric( $rank_id ) )
301
+ $rank_id = mycred_get_rank_id_from_title( $rank_id );
302
+
303
+ if ( !mycred_rank_has_logo( $rank_id ) ) return '';
304
+
305
+ if ( is_numeric( $size ) )
306
+ $size = array( $size, $size );
307
+
308
+ return get_the_post_thumbnail( $rank_id, $size, $attr );
309
+ }
310
+ }
311
+ ?>
addons/ranks/includes/mycred-rank-shortcodes.php ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'myCRED_VERSION' ) ) exit;
3
+ /**
4
+ * myCRED Shortcode: mycred_my_rank
5
+ * Returns the current users balance.
6
+ * @see http://mycred.me/shortcodes/mycred_my_rank/
7
+ * @since 1.1
8
+ * @version 1.0
9
+ */
10
+ if ( !function_exists( 'mycred_render_my_rank' ) ) {
11
+ function mycred_render_my_rank( $atts, $content = NULL )
12
+ {
13
+ extract( shortcode_atts( array(
14
+ 'user_id' => NULL,
15
+ 'show_title' => 1,
16
+ 'show_logo' => 0,
17
+ 'first' => 'logo'
18
+ ), $atts ) );
19
+
20
+ if ( $user_id === NULL && !is_user_logged_in() ) return;
21
+ if ( $user_id === NULL )
22
+ $user_id = get_current_user_id();
23
+
24
+ $rank_name = mycred_get_users_rank( $user_id );
25
+ $show = array();
26
+
27
+ if ( $show_logo )
28
+ $show[] = mycred_get_rank_logo( $rank_name );
29
+
30
+ if ( $show_title )
31
+ $show[] = $rank_name;
32
+
33
+ if ( $first != 'logo' )
34
+ $show = array_reverse( $show );
35
+
36
+ if ( empty( $show ) ) return;
37
+ return '<div class="mycred-my-rank">' . implode( ' ', $show ) . '</div>';
38
+ }
39
+ }
40
+
41
+ /**
42
+ * myCRED Shortcode: mycred_users_of_rank
43
+ * Returns all users who have the given rank with the option to show the rank logo and optional content.
44
+ * @see http://mycred.me/shortcodes/mycred_users_of_rank/
45
+ * @since 1.1
46
+ * @version 1.0
47
+ */
48
+ if ( !function_exists( 'mycred_render_users_of_rank' ) ) {
49
+ function mycred_render_users_of_rank( $atts, $row_template = NULL )
50
+ {
51
+ extract( shortcode_atts( array(
52
+ 'rank_id' => NULL,
53
+ 'login' => '',
54
+ 'number' => NULL,
55
+ 'wrap' => 'div',
56
+ 'nothing' => __( 'No users found with this rank', 'mycred' )
57
+ ), $atts ) );
58
+
59
+ // Rank ID required
60
+ if ( $rank_id === NULL )
61
+ return '<strong>' . apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . __( 'error', 'mycred' ) . '</strong> ' . __( 'Rank ID is required!', 'mycred' );
62
+
63
+ $mycred = mycred_get_settings();
64
+ // User is not logged in
65
+ if ( !empty( $login ) && !is_user_logged_in() ) return $mycred->template_tags_general( $login );
66
+
67
+ // ID is not a post id but a rank title
68
+ if ( !is_numeric( $rank_id ) )
69
+ $rank_id = mycred_get_rank_id_from_title( $rank_id );
70
+
71
+ $output = '';
72
+ $rank = get_post( $rank_id );
73
+ // Make sure rank exist
74
+ if ( $rank !== NULL ) {
75
+ if ( $row_template === NULL )
76
+ $row_template = '<p class="user-row">%user_profile_link% with %balance% %_plural%</p>';
77
+
78
+ // Let others play
79
+ $row_template = apply_filters( 'mycred_users_of_rank', $row_template, $atts, $mycred );
80
+ // Get users of this rank if there are any
81
+ $users = mycred_get_users_of_rank( $rank_id, $number );
82
+ if ( !empty( $users ) ) {
83
+ $output .= '<' . $wrap . ' class="mycred-users-of-rank-wrapper">';
84
+ foreach ( $users as $user_id ) {
85
+ $output .= $mycred->template_tags_user( $row_template, $user_id );
86
+ }
87
+ $output .= '</' . $wrap . '>' . "\n";
88
+ }
89
+ // No users found
90
+ else {
91
+ $output .= '<p>' . $nothing . '</p>' . "\n";
92
+ }
93
+ }
94
+
95
+ return do_shortcode( $output );
96
+ }
97
+ }
98
+
99
+ /**
100
+ * myCRED Shortcode: mycred_users_of_all_ranks
101
+ * Returns all users fore every registered rank in order.
102
+ * @see http://mycred.me/shortcodes/mycred_users_of_all_ranks/
103
+ * @since 1.1
104
+ * @version 1.0
105
+ */
106
+ if ( !function_exists( 'mycred_render_users_of_all_ranks' ) ) {
107
+ function mycred_render_users_of_all_ranks( $atts, $row_template = NULL )
108
+ {
109
+ extract( shortcode_atts( array(
110
+ 'login' => '',
111
+ 'number' => NULL,
112
+ 'show_logo' => 1,
113
+ 'logo_size' => 'post-thumbnail',
114
+ 'wrap' => 'div',
115
+ 'nothing' => __( 'No users found with this rank', 'mycred' )
116
+ ), $atts ) );
117
+
118
+ // Prep
119
+ $mycred = mycred_get_settings();
120
+
121
+ // User is not logged in
122
+ if ( !empty( $login ) && !is_user_logged_in() ) return $mycred->template_tags_general( $login );
123
+
124
+ // Default template
125
+ if ( $row_template === NULL )
126
+ $row_template = '<p class="mycred-rank-user-row">%user_profile_link% with %balance% %_plural%</p>';
127
+
128
+ // Let others play
129
+ $row_template = apply_filters( 'mycred_users_of_all_ranks', $row_template, $atts, $mycred );
130
+
131
+ $output = '';
132
+ $all_ranks = mycred_get_ranks();
133
+ // If we have ranks
134
+ if ( !empty( $all_ranks ) ) {
135
+ $output .= '<div class="mycred-all-ranks-wrapper">' . "\n";
136
+ // Loop though all ranks
137
+ foreach ( $all_ranks as $rank_id => $rank ) {
138
+ // Prep Slug
139
+ $slug = $rank['slug'];
140
+ if ( empty( $slug ) )
141
+ $slug = str_replace( ' ', '-', strtolower( $rank['title'] ) );
142
+
143
+ // Rank wrapper
144
+ $output .= '<div class="mycred-rank rank-' . $slug . ' rank-' . $rank_id . '"><h2>';
145
+
146
+ // Insert Logo
147
+ if ( $show_logo )
148
+ $output .= mycred_get_rank_logo( $rank_id, $logo_size );
149
+
150
+ // Rank title
151
+ $output .= $rank['title'] . '</h2>' . "\n";
152
+
153
+ $attr = array(
154
+ 'rank_id' => $rank_id,
155
+ 'number' => $number,
156
+ 'nothing' => $nothing,
157
+ 'wrap' => $wrap
158
+ );
159
+ $output .= mycred_render_users_of_rank( $attr, $row_template );
160
+
161
+ $output .= '</div>' . "\n";
162
+ }
163
+ $output .= '</div>';
164
+ }
165
+
166
+ return $output;
167
+ }
168
+ }
169
+ ?>
addons/ranks/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ ?>
addons/ranks/myCRED-addon-ranks.php ADDED
@@ -0,0 +1,598 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Addon: Ranks
4
+ * Addon URI: http://mycred.me/add-ons/email-notices/
5
+ * Version: 1.0
6
+ * Description: Create ranks for users reaching a certain number of %_plural% with the option to add logos for each rank.
7
+ * Author: Gabriel S Merovingi
8
+ * Author URI: http://www.merovingi.com
9
+ */
10
+ if ( !defined( 'myCRED_VERSION' ) ) exit;
11
+ define( 'myCRED_RANKS', __FILE__ );
12
+ define( 'myCRED_RANKS_DIR', myCRED_ADDONS_DIR . 'ranks/' );
13
+ define( 'myCRED_RANKS_VERSION', myCRED_VERSION . '.1' );
14
+ include_once( myCRED_RANKS_DIR . 'includes/mycred-rank-functions.php' );
15
+ include_once( myCRED_RANKS_DIR . 'includes/mycred-rank-shortcodes.php' );
16
+ /**
17
+ * myCRED_Ranks class
18
+ * While myCRED rankings just ranks users according to users total amount of
19
+ * points, ranks are titles that can be given to users when their reach a certain
20
+ * amount.
21
+ * @since 1.1
22
+ * @version 1.0
23
+ */
24
+ if ( !class_exists( 'myCRED_Ranks' ) ) {
25
+ class myCRED_Ranks extends myCRED_Module {
26
+
27
+ /**
28
+ * Construct
29
+ */
30
+ function __construct() {
31
+ parent::__construct( 'myCRED_Ranks', array(
32
+ 'module_name' => 'rank',
33
+ 'defaults' => array(
34
+ 'public' => 0,
35
+ 'slug' => 'mycred_rank',
36
+ 'bb_location' => 'top'
37
+ ),
38
+ 'register' => false,
39
+ 'add_to_core' => true
40
+ ) );
41
+
42
+ add_action( 'mycred_help', array( $this, 'help' ), 10, 2 );
43
+ add_action( 'mycred_parse_tags_user', array( $this, 'parse_rank' ), 10, 3 );
44
+ }
45
+
46
+ /**
47
+ * Hook into Init
48
+ * @since 1.1
49
+ * @version 1.0
50
+ */
51
+ public function module_init() {
52
+ $this->register_post_type();
53
+ if ( !mycred_have_ranks() )
54
+ $this->add_default_rank();
55
+
56
+ add_action( 'mycred_admin_enqueue', array( $this, 'enqueue_scripts' ) );
57
+ add_action( 'transition_post_status', array( $this, 'publishing_content' ), 10, 3 );
58
+ add_filter( 'mycred_add', array( $this, 'check_for_rank' ), 10, 3 );
59
+
60
+ // BuddyPress
61
+ if ( function_exists( 'bp_displayed_user_id' ) && isset( $this->rank['bb_location'] ) && !empty( $this->rank['bb_location'] ) ) {
62
+ if ( $this->rank['bb_location'] == 'top' || $this->rank['bb_location'] == 'both' )
63
+ add_action( 'bp_before_member_header_meta', array( $this, 'insert_rank_header' ) );
64
+
65
+ if ( $this->rank['bb_location'] == 'profile_tab' || $this->rank['bb_location'] == 'both' )
66
+ add_action( 'bp_profile_field_item', array( $this, 'insert_rank_profile' ) );
67
+ }
68
+
69
+ // Shortcodes
70
+ add_shortcode( 'mycred_my_rank', 'mycred_render_my_rank' );
71
+ add_shortcode( 'mycred_users_of_rank', 'mycred_render_users_of_rank' );
72
+ add_shortcode( 'mycred_users_of_all_ranks', 'mycred_render_users_of_all_ranks' );
73
+ }
74
+
75
+ /**
76
+ * Hook into Admin Init
77
+ * @since 1.1
78
+ * @version 1.0
79
+ */
80
+ public function module_admin_init() {
81
+ add_filter( 'manage_mycred_rank_posts_columns', array( $this, 'adjust_column_headers' ) );
82
+ add_action( 'manage_mycred_rank_posts_custom_column', array( $this, 'adjust_column_content' ), 10, 2 );
83
+
84
+ add_filter( 'post_row_actions', array( $this, 'adjust_row_actions' ), 10, 2 );
85
+
86
+ add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
87
+ add_filter( 'enter_title_here', array( $this, 'enter_title_here' ) );
88
+
89
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
90
+ add_action( 'save_post', array( $this, 'save_rank_settings' ) );
91
+ }
92
+
93
+ /**
94
+ * Enqueue Scripts & Styles
95
+ * @since 1.1
96
+ * @version 1.0
97
+ */
98
+ public function enqueue_scripts() {
99
+ $screen = get_current_screen();
100
+ // Commonly used
101
+ if ( $screen->id == 'edit-mycred_rank' ) {
102
+ wp_enqueue_style( 'mycred-admin' );
103
+ }
104
+ elseif ( $screen->id == 'mycred_rank' ) {
105
+ wp_enqueue_style( 'mycred-admin' );
106
+ wp_dequeue_script( 'autosave' );
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Register Rank Post Type
112
+ * @since 1.1
113
+ * @version 1.0
114
+ */
115
+ public function register_post_type() {
116
+ $labels = array(
117
+ 'name' => __( 'Ranks', 'mycred' ),
118
+ 'singular_name' => __( 'Rank', 'mycred' ),
119
+ 'add_new' => __( 'Add New', 'mycred' ),
120
+ 'add_new_item' => __( 'Add New Rank', 'mycred' ),
121
+ 'edit_item' => __( 'Edit Rank', 'mycred' ),
122
+ 'new_item' => __( 'New Rank', 'mycred' ),
123
+ 'all_items' => __( 'Ranks', 'mycred' ),
124
+ 'view_item' => __( 'View Rank', 'mycred' ),
125
+ 'search_items' => __( 'Search Ranks', 'mycred' ),
126
+ 'not_found' => __( 'No ranks found', 'mycred' ),
127
+ 'not_found_in_trash' => __( 'No ranks found in Trash', 'mycred' ),
128
+ 'parent_item_colon' => '',
129
+ 'menu_name' => __( 'Ranks', 'mycred' )
130
+ );
131
+ $args = array(
132
+ 'labels' => $labels,
133
+ 'public' => (bool) $this->rank['public'],
134
+ 'publicly_queryable' => (bool) $this->rank['public'],
135
+ 'show_ui' => true,
136
+ 'show_in_menu' => 'myCRED',
137
+ 'capability_type' => 'page',
138
+ 'supports' => array( 'title', 'thumbnail' )
139
+ );
140
+
141
+ if ( $this->rank['public'] ) {
142
+ $args['rewrite'] = array( 'slug' => $this->rank['slug'] );
143
+ }
144
+ register_post_type( 'mycred_rank', $args );
145
+ }
146
+
147
+ /**
148
+ * Find Users Ranks
149
+ * When a rank is published we run though all users to allowcate them to
150
+ * the appropriate rank.
151
+ * @since 1.1
152
+ * @version 1.0
153
+ */
154
+ public function publishing_content( $new_status, $old_status, $post ) {
155
+ // Only ranks please
156
+ if ( $post->post_type != 'mycred_rank' ) return;
157
+
158
+ // Check for ranks that are getting published
159
+ $status = apply_filters( 'mycred_publish_hook_old', array( 'new', 'auto-draft', 'draft', 'private', 'pending', 'scheduled' ) );
160
+ if ( in_array( $old_status, $status ) && $new_status == 'publish' ) {
161
+ // Run though all users and find their rank
162
+ $mycred = mycred_get_settings();
163
+ $args = array();
164
+
165
+ // In case we have an exclude list
166
+ if ( isset( $mycred->exclude['list'] ) && !empty( $mycred->exclude['list'] ) )
167
+ $args['exclude'] = explode( ',', $mycred->exclude['list'] );
168
+
169
+ $users = get_users( $args );
170
+ $rank_users = array();
171
+ if ( $users ) {
172
+ foreach ( $users as $user ) {
173
+ // The above exclude list will not take into account
174
+ // if admins are excluded. For this reason we need to run
175
+ // this check again to avoid including them in this list.
176
+ if ( $mycred->exclude_user( $user->ID ) ) continue;
177
+ // Find users rank
178
+ mycred_find_users_rank( $user->ID, true );
179
+ }
180
+ }
181
+ }
182
+ }
183
+
184
+ /**
185
+ * Check For Rank
186
+ * Each time a users balance changes we check if this effects their ranking.
187
+ * @since 1.1
188
+ * @version 1.0
189
+ */
190
+ public function check_for_rank( $reply, $request, $mycred ) {
191
+ mycred_find_users_rank( $request['user_id'], true );
192
+ return $reply;
193
+ }
194
+
195
+ /**
196
+ * Parse Rank
197
+ * Parses the %rank% and %rank_logo% template tags.
198
+ * @since 1.1
199
+ * @version 1.0
200
+ */
201
+ public function parse_rank( $content, $user = '', $data = '' ) {
202
+ if ( !isset( $user->ID ) ) {
203
+ if ( is_array( $data ) && isset( $data['ID'] ) )
204
+ $user_id = $data['ID'];
205
+ else
206
+ $user_id = get_current_user_id();
207
+ }
208
+ else {
209
+ $user_id = $user->ID;
210
+ }
211
+
212
+ $rank_name = mycred_get_users_rank( $user_id );
213
+ $content = str_replace( '%rank%', $rank_name, $content );
214
+ $content = str_replace( '%rank_logo%', mycred_get_rank_logo( $rank_name ), $content );
215
+
216
+ return $content;
217
+ }
218
+
219
+ /**
220
+ * Insert Rank In Profile Header
221
+ * @since 1.1
222
+ * @version 1.0
223
+ */
224
+ public function insert_rank_header() {
225
+ if ( bp_is_my_profile() || mycred_is_admin() ) {
226
+ $user_id = bp_displayed_user_id();
227
+ if ( $this->core->exclude_user( $user_id ) ) return;
228
+
229
+ $rank_name = mycred_get_users_rank( $user_id );
230
+ echo '<div id="mycred-my-rank">' . __( 'Rank', 'mycred' ) . ': ' . $rank_name . ' ' . mycred_get_rank_logo( $rank_name ) . '</div>';
231
+ }
232
+ }
233
+
234
+ /**
235
+ * Insert Rank In Profile Details
236
+ * @since 1.1
237
+ * @version 1.0
238
+ */
239
+ public function insert_rank_profile() {
240
+ $user_id = bp_displayed_user_id();
241
+ if ( $this->core->exclude_user( $user_id ) ) return;
242
+ $rank_name = mycred_get_users_rank( $user_id ); ?>
243
+
244
+ <tr id="mycred-users-rank">
245
+ <td class="label"><?php _e( 'Rank', 'mycred' ); ?></td>
246
+ <td class="data">
247
+ <?php echo $rank_name . ' ' . mycred_get_rank_logo( $rank_name ); ?>
248
+
249
+ </td>
250
+ </tr>
251
+ <?php
252
+ }
253
+
254
+ /**
255
+ * Add Default Rank
256
+ * Adds the default "Newbie" rank and adds all non-exluded user to this rank.
257
+ * Note! This method is only called when there are zero ranks as this will create the new default rank.
258
+ * @uses wp_insert_port()
259
+ * @uses update_post_meta()
260
+ * @uses get_users()
261
+ * @uses update_user_meta()
262
+ * @since 1.1
263
+ * @version 1.0
264
+ */
265
+ public function add_default_rank() {
266
+ $rank = array();
267
+ $rank['post_title'] = __( 'Newbie', 'mycred' );
268
+ $rank['post_type'] = 'mycred_rank';
269
+ $rank['post_status'] = 'publish';
270
+
271
+ $rank_id = wp_insert_post( $rank );
272
+
273
+ update_post_meta( $rank_id, 'mycred_rank_min', 0 );
274
+ update_post_meta( $rank_id, 'mycred_rank_max', 9999999 );
275
+
276
+ $args = array();
277
+ if ( isset( $this->core->exclude['list'] ) && !empty( $this->core->exclude['list'] ) )
278
+ $args['exclude'] = explode( ',', $this->core->exclude['list'] );
279
+
280
+ $users = get_users( $args );
281
+ if ( $users ) {
282
+ foreach ( $users as $user ) {
283
+ update_user_meta( $user->ID, 'mycred_rank', $rank_id );
284
+ }
285
+ }
286
+ }
287
+
288
+ /**
289
+ * Adjust Post Updated Messages
290
+ * @since 1.1
291
+ * @version 1.0
292
+ */
293
+ public function post_updated_messages( $messages ) {
294
+ global $post;
295
+
296
+ $messages['mycred_rank'] = array(
297
+ 0 => '',
298
+ 1 => sprintf( __( 'Rank Updated. View <a href="%1$s">All Ranks</a>.', 'mycred' ), admin_url( 'edit.php?post_type=mycred_rank' ) ),
299
+ 2 => __( 'Custom field updated', 'mycred' ),
300
+ 3 => __( 'Custom filed updated', 'mycred' ),
301
+ 4 => sprintf( __( 'Rank Updated. View <a href="%1$s">All Ranks</a>.', 'mycred' ), admin_url( 'edit.php?post_type=mycred_rank' ) ),
302
+ 5 => false,
303
+ 6 => __( 'Rank Activated', 'mycred' ),
304
+ 7 => __( 'Rank Saved', 'mycred' ),
305
+ 8 => sprintf( __( 'Rank Submitted for approval. View <a href="%1$s">All Ranks</a>.', 'mycred' ), admin_url( 'edit.php?post_type=mycred_rank' ) ),
306
+ 9 => sprintf(
307
+ __( 'Rank scheduled for: <strong>%1$s</strong>.', 'mycred' ),
308
+ date_i18n( get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' ), strtotime( $post->post_date ) )
309
+ ),
310
+ 10 => __( '', 'mycred' )
311
+ );
312
+
313
+ return $messages;
314
+ }
315
+
316
+ /**
317
+ * Adjust Row Actions
318
+ * @since 1.1
319
+ * @version 1.0
320
+ */
321
+ public function adjust_row_actions( $actions, $post ) {
322
+ if ( $post->post_type == 'mycred_rank' ) {
323
+ unset( $actions['inline hide-if-no-js'] );
324
+
325
+ if ( !$this->rank['public'] )
326
+ unset( $actions['view'] );
327
+ }
328
+
329
+ return $actions;
330
+ }
331
+
332
+ /**
333
+ * Adjust Column Header
334
+ * @since 1.1
335
+ * @version 1.0
336
+ */
337
+ public function adjust_column_headers( $defaults ) {
338
+ // Remove
339
+ unset( $defaults['date'] );
340
+
341
+ // Add / Adjust
342
+ $defaults['title'] = __( 'Rank Title', 'mycred' );
343
+ $defaults['mycred-rank-logo'] = __( 'Logo', 'mycred' );
344
+ $defaults['mycred-rank-req'] = __( 'Requirement', 'mycred' );
345
+ $defaults['mycred-rank-users'] = __( 'Users', 'mycred' );
346
+
347
+ // Return
348
+ return $defaults;
349
+ }
350
+
351
+ /**
352
+ * Adjust Column Content
353
+ * @since 1.1
354
+ * @version 1.0
355
+ */
356
+ public function adjust_column_content( $column_name, $post_id ) {
357
+ // Rank Logo (thumbnail)
358
+ if ( $column_name == 'mycred-rank-logo' ) {
359
+ $logo = mycred_get_rank_logo( $post_id, 'thumbnail' );
360
+ if ( empty( $logo ) )
361
+ echo '<p>' . __( 'No Logo Set', 'mycred' );
362
+ else
363
+ echo '<p>' . $logo . '</p>';
364
+ }
365
+ // Rank Requirement (custom metabox)
366
+ elseif ( $column_name == 'mycred-rank-req' ) {
367
+ $mycred = mycred_get_settings();
368
+ $min = get_post_meta( $post_id, 'mycred_rank_min', true );
369
+ if ( empty( $min ) && (int) $min !== 0 )
370
+ $min = __( 'Any Value', 'mycred' );
371
+
372
+ $min = $mycred->template_tags_general( __( 'Minimum %plural%', 'mycred' ) ) . ': ' . $min;
373
+ $max = get_post_meta( $post_id, 'mycred_rank_max', true );
374
+ if ( empty( $max ) )
375
+ $max = __( 'Any Value', 'mycred' );
376
+
377
+ $max = $mycred->template_tags_general( __( 'Maximum %plural%', 'mycred' ) ) . ': ' . $max;
378
+ echo '<p>' . $min . '<br />' . $max . '</p>';
379
+ }
380
+ // Rank Users (user list)
381
+ elseif ( $column_name == 'mycred-rank-users' ) {
382
+ $users = count( mycred_get_users_of_rank( $post_id ) );
383
+ //if ( $users > 0 )
384
+ // $users = '<a href="' . admin_url( 'users.php?rank=' . $post_id ) . '">' . $users . '</a>';
385
+ echo '<p>' . $users . '</p>';
386
+ }
387
+ }
388
+
389
+ /**
390
+ * Adjust Enter Title Here
391
+ * @since 1.1
392
+ * @version 1.0
393
+ */
394
+ public function enter_title_here( $title ) {
395
+ global $post_type;
396
+ if ( $post_type == 'mycred_rank' )
397
+ return __( 'Rank Title', 'mycred' );
398
+
399
+ return $title;
400
+ }
401
+
402
+ /**
403
+ * Add Meta Boxes
404
+ * @since 1.1
405
+ * @version 1.0
406
+ */
407
+ public function add_meta_boxes() {
408
+ add_meta_box(
409
+ 'mycred_rank_settings',
410
+ __( 'Rank Settings', 'mycred' ),
411
+ array( $this, 'rank_settings' ),
412
+ 'mycred_rank',
413
+ 'normal',
414
+ 'high'
415
+ );
416
+ }
417
+
418
+ /**
419
+ * Rank Settings Metabox
420
+ * @since 1.1
421
+ * @version 1.0
422
+ */
423
+ public function rank_settings( $post ) {
424
+ $mycred = mycred_get_settings();
425
+ $min = get_post_meta( $post->ID, 'mycred_rank_min', true );
426
+ $max = get_post_meta( $post->ID, 'mycred_rank_max', true ); ?>
427
+
428
+ <input type="hidden" name="mycred_rank[token]" value="<?php echo wp_create_nonce( 'mycred-edit-rank' ); ?>" />
429
+ <div style="display:block;float:none;clear:both;">
430
+ <div style="display:block;width:50%;margin:0;padding:0;float:left;">
431
+ <p>
432
+ <?php echo $mycred->template_tags_general( __( 'Minimum %plural% to reach this rank', 'mycred' ) ); ?>:<br />
433
+ <input type="text" name="mycred_rank[min]" id="mycred-rank-min" value="<?php echo $min; ?>" />
434
+ </p>
435
+ <p>
436
+ <?php echo $mycred->template_tags_general( __( 'Maximum %plural% to be included in this rank', 'mycred' ) ); ?>:<br />
437
+ <input type="text" name="mycred_rank[max]" id="mycred-rank-max" value="<?php echo $max; ?>" />
438
+ </p>
439
+ </div>
440
+ <div style="display:block;width:50%;margin:0;padding:0;float:left;">
441
+ <p><?php _e( 'All Published Ranks', 'mycred' ); ?>:</p>
442
+ <?php
443
+
444
+ $all = mycred_get_ranks();
445
+ if ( !empty( $all ) ) {
446
+ foreach ( $all as $rank_id => $rank_title ) {
447
+ $_min = get_post_meta( $rank_id, 'mycred_rank_min', true );
448
+ if ( empty( $_min ) && (int) $_min !== 0 ) $_min = __( 'Not Set', 'mycred' );
449
+ $_max = get_post_meta( $rank_id, 'mycred_rank_max', true );
450
+ if ( empty( $_max ) ) $_max = __( 'Not Set', 'mycred' );
451
+ echo '<p><strong style="display:inline-block;width:20%;">' . $rank_title . '</strong> ' . $_min . ' - ' . $_max . '</p>';
452
+ }
453
+ }
454
+ else {
455
+ echo '<p>' . __( 'No Ranks found', 'mycred' ) . '.</p>';
456
+ }
457
+ ?>
458
+
459
+ </div>
460
+ <div class="clear">&nbsp;</div>
461
+ </div>
462
+ <?php
463
+ }
464
+
465
+ /**
466
+ * Save Email Notice Details
467
+ * @since 1.1
468
+ * @version 1.0
469
+ */
470
+ public function save_rank_settings( $post_id ) {
471
+ // Make sure this is the correct post type
472
+ if ( get_post_type( $post_id ) != 'mycred_rank' ) return;
473
+ // Make sure we can edit
474
+ elseif ( !mycred_is_admin( get_current_user_id() ) ) return;
475
+ // Make sure fields exists
476
+ elseif ( !isset( $_POST['mycred_rank'] ) || !is_array( $_POST['mycred_rank'] ) ) return;
477
+ // Finally check token
478
+ elseif ( !wp_verify_nonce( $_POST['mycred_rank']['token'], 'mycred-edit-rank' ) ) return;
479
+
480
+ // Minimum can not be empty
481
+ if ( empty( $_POST['mycred_rank']['min'] ) )
482
+ $min = 0;
483
+ else
484
+ $min = trim( $_POST['mycred_rank']['min'] );
485
+
486
+ // Maximum can not be empty
487
+ if ( empty( $_POST['mycred_rank']['max'] ) )
488
+ $max = 9999999;
489
+ else
490
+ $max = trim( $_POST['mycred_rank']['max'] );
491
+
492
+ update_post_meta( $post_id, 'mycred_rank_min', $min );
493
+ update_post_meta( $post_id, 'mycred_rank_max', $max );
494
+ }
495
+
496
+ /**
497
+ * Add to General Settings
498
+ * @since 1.1
499
+ * @version 1.0
500
+ */
501
+ public function after_general_settings() { ?>
502
+
503
+ <h4 style="color:#BBD865;"><?php _e( 'Ranks', 'mycred' ); ?></h4>
504
+ <div class="body" style="display:none;">
505
+ <label class="subheader" for="<?php echo $this->field_id( 'public' ); ?>"><?php _e( 'Public', 'mycred' ); ?></label>
506
+ <ol id="myCRED-email-notice-allow-filters">
507
+ <li>
508
+ <input type="checkbox" name="<?php echo $this->field_name( 'public' ); ?>" id="<?php echo $this->field_id( 'public' ); ?>" <?php checked( $this->rank['public'], 1 ); ?> value="1" />
509
+ <label for="<?php echo $this->field_id( 'public' ); ?>"><?php _e( 'If you want to create a template archive for each rank, you must select to have ranks public. Defaults to disabled.', 'mycred' ); ?></label>
510
+ </li>
511
+ <li class="empty">&nbsp;</li>
512
+ <li>
513
+ <label for="<?php echo $this->field_id( 'slug' ); ?>"><?php _e( 'Rank Post Type URL Slug', 'mycred' ); ?></label>
514
+ <div class="h2"><?php bloginfo( 'url' ); ?>/ <input type="text" name="<?php echo $this->field_name( 'slug' ); ?>" id="<?php echo $this->field_id( 'slug' ); ?>" value="<?php echo $this->rank['slug']; ?>" size="20" />/</div>
515
+ <span class="description"><?php _e( 'If you are using a custom permalink structure and you make ranks public or change the slug, you will need to visit your permalink settings page and click "Save Changes" to flush your re-write rules! Otherwise you will get a 404 error message when trying to view a rank archive page.', 'mycred' ); ?></span>
516
+ </li>
517
+ <li class="empty">&nbsp;</li>
518
+ <li>
519
+ <p><?php echo sprintf( __( 'For more information on Templates for Custom Post Types visit the <a href="%s">WordPress Codex</a>.', 'mycred' ), 'http://codex.wordpress.org/Post_Types#Custom_Post_Types' ); ?></p>
520
+ </li>
521
+ </ol>
522
+ <?php
523
+ // If BuddyPress is installed
524
+ if ( function_exists( 'bp_displayed_user_id' ) ) {
525
+ if ( !isset( $this->rank['bb_location'] ) )
526
+ $this->rank['bb_location'] = '';
527
+
528
+ $rank_locations = array(
529
+ '' => __( 'Do not show.', 'mycred' ),
530
+ 'top' => __( 'Include in Profile Header.', 'mycred' ),
531
+ 'profile_tab' => __( 'Include under the "Profile" tab', 'mycred' ),
532
+ 'both' => __( 'Include under the "Profile" tab and Profile Header.', 'mycred' )
533
+ ); ?>
534
+
535
+ <label class="subheader" for="<?php echo $this->field_id( 'bb_location' ); ?>"><?php _e( 'Rank in BuddyPress', 'mycred' ); ?></label>
536
+ <ol id="myCRED-email-notice-buddypress-location">
537
+ <li>
538
+ <select name="<?php echo $this->field_name( 'bb_location' ); ?>" id="<?php echo $this->field_id( 'bb_location' ); ?>">
539
+ <?php
540
+ // Loop though locations
541
+ foreach ( $rank_locations as $value => $label ) {
542
+ echo '<option value="' . $value . '"';
543
+ if ( $this->rank['bb_location'] == $value ) echo ' selected="selected"';
544
+ echo '>' . $label . '</option>';
545
+
546
+ } ?>
547
+
548
+ </select>
549
+ </li>
550
+ </ol>
551
+ <?php }
552
+ else {
553
+ echo '<input type="hidden" name="' . $this->field_name( 'bb_location' ) . '" value="" />';
554
+ } ?>
555
+
556
+ </div>
557
+ <?php
558
+ }
559
+
560
+ /**
561
+ * Save Settings
562
+ * @since 1.1
563
+ * @version 1.0
564
+ */
565
+ public function sanitize_extra_settings( $new_data, $data, $core ) {
566
+ $new_data['rank']['public'] = ( isset( $data['rank']['public'] ) ) ? true : false;
567
+ $new_data['rank']['slug'] = sanitize_text_field( $data['rank']['slug'] );
568
+ $new_data['rank']['bb_location'] = sanitize_text_field( $data['rank']['bb_location'] );
569
+ return $new_data;
570
+ }
571
+
572
+ /**
573
+ * Help
574
+ * @since 1.1
575
+ * @version 1.0
576
+ */
577
+ public function help( $screen_id, $screen ) {
578
+ if ( $screen_id == 'mycred_page_myCRED_page_settings' ) {
579
+ $screen->add_help_tab( array(
580
+ 'id' => 'mycred-rank',
581
+ 'title' => __( 'Ranks', 'mycred' ),
582
+ 'content' => '
583
+ <p>' . __( 'You can create ranks according to the amount of points a user has. By default, ranks are only visible in widgets and shortcodes however it is possible for you to also create archive pages in your theme for all ranks or specific ones.', 'mycred' ) . '</p>
584
+ <p><strong>' . __( 'Templates', 'mycred' ) . '</strong></p>
585
+ <p>' . __( 'Ranks are just another custom post type which means that you can, if you select to make Ranks Public, create custom template files for ranks in your theme folder.', 'mycred' ) . '</p>
586
+ <p>' . sprintf( __( 'For more information on Templates for Custom Post Types visit the <a href="%s">WordPress Codex</a>.', 'mycred' ), 'http://codex.wordpress.org/Post_Types#Custom_Post_Types' ) . '</p>
587
+ <p><strong>' . __( 'Changing URL Slug', 'mycred' ) . '</strong></p>
588
+ <p>' . __( 'You can change the URL slug used for ranks to any URL friendly value.', 'mycred' ) . '</p>
589
+ <p>' . __( 'If you are using a custom permalink structure and you make ranks public or change the slug, you will need to visit your permalink settings page and click "Save Changes" to flush your re-write rules! Otherwise you will get a 404 error message when trying to view a rank archive page.', 'mycred' ) . '</span></p>'
590
+ ) );
591
+ }
592
+
593
+ }
594
+ }
595
+ $rank = new myCRED_Ranks();
596
+ $rank->load();
597
+ }
598
+ ?>
addons/sell-content/js/buy-content.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * myCRED Sell Content
3
+ * @since 1.1
4
+ * @version 1.0
5
+ */
6
+ jQuery(function($) {
7
+ var mycred_buy_content = function( button, label ) {
8
+ wrapper = button.parents( 'div.mycred-content-forsale' );
9
+ $.ajax({
10
+ type : "POST",
11
+ data : {
12
+ action : 'mycred-buy-content',
13
+ postid : button.attr( 'data-id' ),
14
+ token : myCREDsell.token
15
+ },
16
+ dataType : "HTML",
17
+ url : myCREDsell.ajaxurl,
18
+ // Before we start
19
+ beforeSend : function() {
20
+ button.attr( 'value', myCREDsell.working );
21
+ button.attr( 'disabled', 'disabled' );
22
+ wrapper.slideUp();
23
+ },
24
+ // On Successful Communication
25
+ success : function( data ) {
26
+ wrapper.empty();
27
+ wrapper.append( data );
28
+ wrapper.slideDown();
29
+ },
30
+ // Error (sent to console)
31
+ error : function( jqXHR, textStatus, errorThrown ) {
32
+ button.attr( 'value', 'Upps!' );
33
+ button.removeAttr( 'disabled' );
34
+ wrapper.slideDown();
35
+ // Debug - uncomment to use
36
+ console.log( jqXHR );
37
+ console.log( textStatus );
38
+ console.log( errorThrown );
39
+ }
40
+ });
41
+ };
42
+
43
+ $('.mycred-sell-this-button').click(function(){
44
+ mycred_buy_content( $(this), $(this).attr( 'value' ) );
45
+ });
46
+ });
addons/sell-content/js/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ ?>
addons/sell-content/myCRED-addon-sell-content.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Addon: Sell Content
4
  * Addon URI: http://mycred.me/add-ons/sell-content/
5
- * Version: 1.0
6
  * Description: This add-on allows you to sell posts, pages or any public post types on your website. You can either sell the entire content or using our shortcode, sell parts of your content allowing you to offer "teasers".
7
  * Author: Gabriel S Merovingi
8
  * Author URI: http://www.merovingi.com
@@ -28,21 +28,22 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
28
  'module_name' => 'sell_content',
29
  'register' => false,
30
  'defaults' => array(
31
- 'post_types' => 'post,page',
32
- 'pay' => 'none',
33
  'pay_percent' => 100,
34
- 'templates' => array(
35
- 'members' => __( '<p>Buy this %post_type% for only %price% %buy_button%</p>', 'mycred' ),
36
- 'visitors' => __( '<p><a href="%login_url_here%">Login</a> to buy access to this %post_type%.</p>', 'mycred' ),
37
- 'cantafford' => __( "<p>You do not have enough %plural% to buy access to this %post_type%.</p>\n<p><strong>Price</strong>: %price%</p>", 'mycred' )
38
  ),
39
- 'defaults' => array(
40
  'price' => 10,
41
  'overwrite_price' => 0,
42
  'button_label' => __( 'Buy Now', 'mycred' ),
43
- 'overwrite_buttonlabel' => 0
 
44
  ),
45
- 'logs' => array(
46
  'buy' => __( 'Purchase of %link_with_title%', 'mycred' ),
47
  'sell' => __( 'Sale of %link_with_title%', 'mycred' )
48
  )
@@ -50,7 +51,8 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
50
  'add_to_core' => true
51
  ) );
52
 
53
- add_action( 'mycred_help', array( $this, 'help' ), 10, 2 );
 
54
  }
55
 
56
  /**
@@ -60,16 +62,21 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
60
  */
61
  public function module_init() {
62
  $this->make_purchase();
 
63
 
64
- add_filter( 'the_content', array( $this, 'the_content' ), 30 );
65
 
66
- add_shortcode( 'mycred_sell_this', array( $this, 'render_shortcode' ) );
67
- add_shortcode( 'mycred_sales_history', array( $this, 'render_sales_history' ) );
 
68
 
69
- add_action( 'add_meta_boxes', array( $this, 'add_metabox' ) );
70
- add_action( 'save_post', array( $this, 'save_metabox' ) );
71
 
72
- add_action( 'mycred_admin_enqueue', array( $this, 'admin_enqueue' ) );
 
 
 
73
  }
74
 
75
  /**
@@ -94,7 +101,7 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
94
  $sell_content = $this->sell_content;
95
  $prefs = $this->get_sale_prefs( $post_id );
96
 
97
- $request = compact( 'action', 'post_id', 'user_id', 'author', 'post_type', 'settings', 'sales_preference' );
98
  do_action( 'mycred_sell_content_purchase_request', $request );
99
 
100
  if ( is_user_logged_in() && !$this->user_paid( $user_id, $post_id ) && $this->user_can_buy( $user_id, $prefs['price'] ) ) {
@@ -116,7 +123,7 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
116
  if ( (int) $sell_content['pay_percent'] != 100 ) {
117
  $percent = (int) $sell_content['pay_percent']/100;
118
  $price = $percent*$content_price;
119
- $content_price = number_format( $price, $this->core->format['decimals'] );
120
  }
121
  $log = $sell_content['logs']['sell'];
122
  $data = array(
@@ -132,6 +139,77 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
132
  }
133
  }
134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  /**
136
  * Enqueue Admin
137
  * @since 0.1
@@ -157,6 +235,46 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
157
  }
158
  }
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  /**
161
  * Settings Page
162
  * @since 0.1
@@ -164,6 +282,8 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
164
  */
165
  public function after_general_settings( $all ) {
166
  $sell_content = $this->sell_content;
 
 
167
 
168
  $before = $this->core->before;
169
  $after = $this->core->after;
@@ -226,6 +346,12 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
226
  <input type="checkbox" name="<?php echo $this->field_name( array( 'defaults' => 'overwrite_buttonlabel' ) ); ?>" id="<?php echo $this->field_id( array( 'defaults' => 'overwrite_buttonlabel' ) ); ?>" <?php checked( $sell_content['defaults']['overwrite_buttonlabel'], 1 ); ?> value="1" />
227
  <label for="<?php echo $this->field_id( array( 'defaults' => 'overwrite_buttonlabel' ) ); ?>"><?php _e( 'Allow authors to change button label.', 'mycred' ); ?></label>
228
  </li>
 
 
 
 
 
 
229
  </ol>
230
  <label class="subheader" for="<?php echo $this->field_id( array( 'templates' => 'visitors' ) ); ?>"><?php _e( 'Sale Template for non members', 'mycred' ); ?></label>
231
  <ol id="myCRED-buy-template-visitors">
@@ -288,6 +414,7 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
288
  $new_data['sell_content']['defaults']['overwrite_price'] = ( isset( $settings['defaults']['overwrite_price'] ) ) ? 1 : 0;
289
  $new_data['sell_content']['defaults']['button_label'] = sanitize_text_field( $settings['defaults']['button_label'] );
290
  $new_data['sell_content']['defaults']['overwrite_buttonlabel'] = ( isset( $settings['defaults']['overwrite_buttonlabel'] ) ) ? 1 : 0;
 
291
 
292
  $new_data['sell_content']['templates']['members'] = trim( $settings['templates']['members'] );
293
  $new_data['sell_content']['templates']['visitors'] = trim( $settings['templates']['visitors'] );
@@ -308,11 +435,12 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
308
  public function add_metabox() {
309
  $sell_content = $this->sell_content;
310
  $post_types = explode( ',', $sell_content['post_types'] );
 
311
  foreach ( (array) $post_types as $post_type ) {
312
  $post_type = trim( $post_type );
313
  add_meta_box(
314
  'mycred_sell_content',
315
- __( 'myCRED Sell', 'mycred' ),
316
  array( $this, 'metabox' ),
317
  $post_type,
318
  'side',
@@ -331,15 +459,22 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
331
  */
332
  public function get_sale_prefs( $post_id ) {
333
  $sell_content = $this->sell_content;
 
 
 
334
  $prefs = get_post_meta( $post_id, 'myCRED_sell_content', true );
335
  if ( empty( $prefs ) ) {
336
  $sales_data = array(
337
  'status' => 'disabled',
338
  'price' => $sell_content['defaults']['price'],
339
- 'button_label' => $sell_content['defaults']['button_label']
 
340
  );
341
  }
342
  else {
 
 
 
343
  $sales_data = $prefs;
344
  }
345
 
@@ -354,7 +489,7 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
354
  public function metabox( $post ) {
355
  // Make sure add-on has been setup
356
  if ( !$this->is_installed() ) {
357
- echo __( '<strong>my</strong>CRED Sell Content needs to be setup before you can use this feature.', 'mycred' );
358
  // Settings Link
359
  if ( $this->core->can_edit_plugin( get_current_user_id() ) )
360
  echo ' <a href="' . admin_url( 'admin.php?page=myCRED_page_settings' ) . '" title="' . __( 'Setup add-on', 'mycred' ) . '">' . __( 'Lets do it', 'mycred' ) . '</a>';
@@ -399,6 +534,10 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
399
  <label for="mycred-buy-prefs-"><?php _e( 'Button Label', 'mycred' ); ?></label>
400
  <input type="text" name="myCRED_sell_content[button_label]" id="mycred-buy-prefs-" value="<?php echo $sales_data['button_label']; ?>" <?php if ( $ob === false && !$admin ) echo 'disabled="disabled" class="disabled"'; ?> />
401
  </li>
 
 
 
 
402
  </ul>
403
  </div>
404
  <script type="text/javascript">//<![CDATA[
@@ -446,6 +585,9 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
446
  $ob = (bool) $sell_content['defaults']['overwrite_buttonlabel'];
447
  $prefs['button_label'] = ( $ob === true || $is_admin === true ) ? $_POST['myCRED_sell_content']['button_label'] : $sell_content['defaults']['button_label'];
448
 
 
 
 
449
  update_post_meta( $post_id, 'myCRED_sell_content', $prefs );
450
  }
451
 
@@ -474,20 +616,63 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
474
  * @param $post_id (int) required post id
475
  * @returns (bool) true or false
476
  * @since 0.1
477
- * @version 1.0
478
  */
479
  public function user_paid( $user_id, $post_id ) {
 
480
  if ( $this->core->can_edit_plugin( $user_id ) || $this->core->can_edit_creds( $user_id ) ) return true;
 
 
481
 
482
  global $wpdb;
 
 
 
 
 
 
 
 
 
 
 
 
 
483
 
484
- $sql = "SELECT ID FROM " . $wpdb->prefix . 'myCRED_log' . " WHERE user_id = %d AND ref = %s AND ref_id = %d ";
485
- $results = $wpdb->get_results( $wpdb->prepare( $sql, $user_id, 'buy_content', $post_id ) );
486
- if ( $wpdb->num_rows == 1 ) return true;
487
 
 
 
 
 
 
488
  return false;
489
  }
490
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
  /**
492
  * User Can Buy
493
  * Checks if a given user can afford the given price.
@@ -526,7 +711,7 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
526
  $button_text = $sell_content['defaults']['button_label'];
527
 
528
  // Button element
529
- $button = '<input type="submit" name="mycred-buy-button" id="mycred-buy-button" value="' . $this->core->template_tags_post( $button_text, $post ) . '" class="button large" />';
530
 
531
  // Make sure there is a button
532
  if ( !preg_match( '/%buy_button%/', $text ) )
@@ -575,12 +760,12 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
575
  $template = $this->get_button( $template, $GLOBALS['post'] );
576
  return '
577
  <form action="" method="post">
578
- <input type="hidden" name="mycred_purchase[post_id]" id="" value="' . $post_id . '" />
579
- <input type="hidden" name="mycred_purchase[post_type]" id="" value="' . $GLOBALS['post']->post_type . '" />
580
- <input type="hidden" name="mycred_purchase[user_id]" id="" value="' . get_current_user_id() . '" />
581
- <input type="hidden" name="mycred_purchase[author]" id="" value="' . $GLOBALS['post']->post_author . '" />
582
- <input type="hidden" name="mycred_purchase_token" id="" value="' . wp_create_nonce( 'buy-content' ) . '" />
583
- <input type="hidden" name="mycred_purchase[action]" id="" value="buy" />
584
  <div class="mycred-content-forsale">' . $template . '</div>
585
  </form>';
586
  }
@@ -606,12 +791,12 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
606
 
607
  /**
608
  * Render Shortcode
609
- * Just as protecting the entire content, the sell_this_myCRED shortcode protects
610
  * parts of the content.
611
  *
612
  * @returns (string) content
613
  * @since 0.1
614
- * @version 1.1
615
  */
616
  public function render_shortcode( $atts, $content ) {
617
  $post_id = $GLOBALS['post']->ID;
@@ -620,16 +805,18 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
620
 
621
  $prefs = shortcode_atts( array(
622
  'price' => $sell_content['defaults']['price'],
623
- 'button_label' => $sell_content['defaults']['button_label']
 
624
  ), $atts );
625
  $sales_prefs = $this->get_sale_prefs( $post_id );
626
 
627
  // If we are not using defaults save these settings.
628
- if ( $sales_prefs['price'] != $prefs['price'] || $sales_prefs['button_label'] != $prefs['button_label'] ) {
629
  update_post_meta( $post_id, 'myCRED_sell_content', array(
630
  'price' => $prefs['price'],
631
  'status' => $sales_prefs['status'],
632
- 'button_label' => $prefs['button_label']
 
633
  ) );
634
  }
635
 
@@ -653,11 +840,11 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
653
  unset( $content );
654
  return '
655
  <form action="" method="post">
656
- <input type="hidden" name="mycred_purchase[post_id]" value="' . $post_id . '" />
657
  <input type="hidden" name="mycred_purchase[post_type]" value="' . $GLOBALS['post']->post_type . '" />
658
- <input type="hidden" name="mycred_purchase[user_id]" value="' . get_current_user_id() . '" />
659
- <input type="hidden" name="mycred_purchase[author]" value="' . $GLOBALS['post']->post_author . '" />
660
- <input type="hidden" name="mycred_purchase_token" value="' . wp_create_nonce( 'buy-content' ) . '" />
661
  <input type="hidden" name="mycred_purchase[action]" value="buy" />
662
  <div class="mycred-content-forsale">' . $template . '</div>
663
  </form>';
@@ -673,8 +860,88 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
673
  return '<div class="mycred-content-forsale">' . $template . '</div>';
674
  }
675
 
676
- // Admin Wrapper for highlight of content set for sale
677
- if ( mycred_is_admin() )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
678
  $content = '<div class="mycred-mark-title">' . __( 'The following content is set for sale:', 'mycred' ) . '</div><div class="mycred-mark-content">' . $content . '</div>';
679
 
680
  return do_shortcode( $content );
@@ -751,6 +1018,19 @@ if ( !class_exists( 'myCRED_Sell_Content' ) ) {
751
 
752
  return $output;
753
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
754
 
755
  /**
756
  * Contextual Help
2
  /**
3
  * Addon: Sell Content
4
  * Addon URI: http://mycred.me/add-ons/sell-content/
5
+ * Version: 1.1
6
  * Description: This add-on allows you to sell posts, pages or any public post types on your website. You can either sell the entire content or using our shortcode, sell parts of your content allowing you to offer "teasers".
7
  * Author: Gabriel S Merovingi
8
  * Author URI: http://www.merovingi.com
28
  'module_name' => 'sell_content',
29
  'register' => false,
30
  'defaults' => array(
31
+ 'post_types' => 'post,page',
32
+ 'pay' => 'none',
33
  'pay_percent' => 100,
34
+ 'templates' => array(
35
+ 'members' => __( '<p>Buy this %post_type% for only %price% %buy_button%</p>', 'mycred' ),
36
+ 'visitors' => __( '<p><a href="%login_url_here%">Login</a> to buy access to this %post_type%.</p>', 'mycred' ),
37
+ 'cantafford' => __( "<p>You do not have enough %plural% to buy access to this %post_type%.</p>\n<p><strong>Price</strong>: %price%</p>", 'mycred' )
38
  ),
39
+ 'defaults' => array(
40
  'price' => 10,
41
  'overwrite_price' => 0,
42
  'button_label' => __( 'Buy Now', 'mycred' ),
43
+ 'overwrite_buttonlabel' => 0,
44
+ 'expire' => 0
45
  ),
46
+ 'logs' => array(
47
  'buy' => __( 'Purchase of %link_with_title%', 'mycred' ),
48
  'sell' => __( 'Sale of %link_with_title%', 'mycred' )
49
  )
51
  'add_to_core' => true
52
  ) );
53
 
54
+ add_action( 'mycred_help', array( $this, 'help' ), 10, 2 );
55
+ add_filter( 'mycred_email_before_send', array( $this, 'email_notices' ), 10, 2 );
56
  }
57
 
58
  /**
62
  */
63
  public function module_init() {
64
  $this->make_purchase();
65
+ $this->exp_title = apply_filters( 'mycred_sell_exp_title', __( 'Hours', 'mycred' ) );
66
 
67
+ add_filter( 'the_content', array( $this, 'the_content' ), 30 );
68
 
69
+ add_shortcode( 'mycred_sell_this', array( $this, 'render_shortcode' ) );
70
+ add_shortcode( 'mycred_sell_this_ajax', array( $this, 'render_ajax_shortcode' ) );
71
+ add_shortcode( 'mycred_sales_history', array( $this, 'render_sales_history' ) );
72
 
73
+ add_action( 'add_meta_boxes', array( $this, 'add_metabox' ) );
74
+ add_action( 'save_post', array( $this, 'save_metabox' ) );
75
 
76
+ add_action( 'mycred_admin_enqueue', array( $this, 'admin_enqueue' ) );
77
+ add_action( 'mycred_front_enqueue', array( $this, 'front_enqueue' ) );
78
+ add_action( 'wp_footer', array( $this, 'footer' ) );
79
+ add_action( 'wp_ajax_mycred-buy-content', array( $this, 'make_purchase_ajax' ) );
80
  }
81
 
82
  /**
101
  $sell_content = $this->sell_content;
102
  $prefs = $this->get_sale_prefs( $post_id );
103
 
104
+ $request = compact( 'action', 'post_id', 'user_id', 'author', 'post_type', 'sell_content', 'prefs' );
105
  do_action( 'mycred_sell_content_purchase_request', $request );
106
 
107
  if ( is_user_logged_in() && !$this->user_paid( $user_id, $post_id ) && $this->user_can_buy( $user_id, $prefs['price'] ) ) {
123
  if ( (int) $sell_content['pay_percent'] != 100 ) {
124
  $percent = (int) $sell_content['pay_percent']/100;
125
  $price = $percent*$content_price;
126
+ $content_price = number_format( $price, $this->core->format['decimals'], '.', '' );
127
  }
128
  $log = $sell_content['logs']['sell'];
129
  $data = array(
139
  }
140
  }
141
 
142
+ /**
143
+ * Make Purchase AJAX
144
+ * @since 1.1
145
+ * @version 1.0
146
+ */
147
+ public function make_purchase_ajax() {
148
+ // We must be logged in
149
+ if ( !is_user_logged_in() ) die();
150
+
151
+ // Security
152
+ check_ajax_referer( 'mycred-buy-content-ajax', 'token' );
153
+
154
+ // Prep
155
+ $post_id = $_POST['postid'];
156
+ $user_id = get_current_user_id();
157
+ $action = 'buy-content-ajax';
158
+
159
+ $sell_content = $this->sell_content;
160
+ $prefs = $this->get_sale_prefs( $post_id );
161
+
162
+ if ( !$this->user_paid( $user_id, $post_id ) && $this->user_can_buy( $user_id, $prefs['price'] ) ) {
163
+ $post = get_post( $post_id );
164
+ $author = $post->post_author;
165
+ $post_type = $post->post_type;
166
+
167
+ // Charge
168
+ $log = $sell_content['logs']['buy'];
169
+ $data = array(
170
+ 'ref_type' => 'post',
171
+ 'purchase_id' => 'TXID' . date_i18n( 'U' ),
172
+ 'seller' => $author
173
+ );
174
+ $this->core->add_creds( 'buy_content', $user_id, 0-$prefs['price'], $log, $post_id, $data );
175
+
176
+ $request = compact( 'action', 'post_id', 'user_id', 'author', 'post_type', 'sell_content', 'prefs' );
177
+ do_action( 'mycred_sell_content_purchase_ready', $request );
178
+
179
+ // Pay
180
+ if ( $sell_content['pay'] == 'author' ) {
181
+ $content_price = $prefs['price'];
182
+ // If we are paying the author less then 100%
183
+ if ( (int) $sell_content['pay_percent'] != 100 ) {
184
+ $percent = (int) $sell_content['pay_percent']/100;
185
+ $price = $percent*$content_price;
186
+ $content_price = number_format( $price, $this->core->format['decimals'], '.', '' );
187
+ }
188
+ $log = $sell_content['logs']['sell'];
189
+ $data = array(
190
+ 'ref_type' => 'post',
191
+ 'purchase_id' => 'TXID' . date_i18n( 'U' ),
192
+ 'buyer' => $user_id
193
+ );
194
+ $this->core->add_creds( 'buy_content', $author, $content_price, $log, $post_id, $data );
195
+ }
196
+
197
+ // $match[1] = start tag, $match[2] = settings, $match[3] = content, $match[4] = end tag
198
+ preg_match( "'(\[mycred_sell_this_ajax(.{1,})\])(.*?)(\[\/mycred_sell_this_ajax\])'si", $post->post_content, $match );
199
+
200
+ // Filter content before returning
201
+ $content = apply_filters( 'the_content', $match[3] );
202
+ $content = str_replace( ']]>', ']]&gt;', $content );
203
+ $content = do_shortcode( $content );
204
+ }
205
+ // Someone is trying to make a purchase but not allowed
206
+ else {
207
+ $content = '<p>' . __( 'You can not buy this content.', 'mycred' ) . '</p>';
208
+ }
209
+
210
+ die( $content );
211
+ }
212
+
213
  /**
214
  * Enqueue Admin
215
  * @since 0.1
235
  }
236
  }
237
 
238
+ /**
239
+ * Enqueue Front
240
+ * @since 1.1
241
+ * @version 1.0
242
+ */
243
+ public function front_enqueue() {
244
+ global $mycred_buy_content;
245
+
246
+ wp_register_script(
247
+ 'mycred-buy-content',
248
+ plugins_url( 'js/buy-content.js', myCRED_SELL ),
249
+ array( 'jquery' ),
250
+ myCRED_SELL_VERSION . '.1',
251
+ true
252
+ );
253
+ }
254
+
255
+ /**
256
+ * Footer
257
+ * @since 1.1
258
+ * @version 1.0
259
+ */
260
+ public function footer() {
261
+ global $mycred_buy_content;
262
+
263
+ if ( $mycred_buy_content === true ) {
264
+ wp_localize_script(
265
+ 'mycred-buy-content',
266
+ 'myCREDsell',
267
+ array(
268
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
269
+ 'working' => __( 'Processing...', 'mycred' ),
270
+ 'error' => __( 'Error. Try Again', 'mycred' ),
271
+ 'token' => wp_create_nonce( 'mycred-buy-content-ajax' )
272
+ )
273
+ );
274
+ wp_enqueue_script( 'mycred-buy-content' );
275
+ }
276
+ }
277
+
278
  /**
279
  * Settings Page
280
  * @since 0.1
282
  */
283
  public function after_general_settings( $all ) {
284
  $sell_content = $this->sell_content;
285
+ if ( !isset( $sell_content['defaults']['expire'] ) )
286
+ $sell_content['defaults']['expire'] = 0;
287
 
288
  $before = $this->core->before;
289
  $after = $this->core->after;
346
  <input type="checkbox" name="<?php echo $this->field_name( array( 'defaults' => 'overwrite_buttonlabel' ) ); ?>" id="<?php echo $this->field_id( array( 'defaults' => 'overwrite_buttonlabel' ) ); ?>" <?php checked( $sell_content['defaults']['overwrite_buttonlabel'], 1 ); ?> value="1" />
347
  <label for="<?php echo $this->field_id( array( 'defaults' => 'overwrite_buttonlabel' ) ); ?>"><?php _e( 'Allow authors to change button label.', 'mycred' ); ?></label>
348
  </li>
349
+ <li class="empty">&nbsp;</li>
350
+ <li>
351
+ <label for="<?php echo $this->field_id( array( 'defaults' => 'expire' ) ); ?>"><?php _e( 'Purchases expire after', 'mycred' ); ?></label>
352
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'defaults' => 'expire' ) ); ?>" id="<?php echo $this->field_id( array( 'defaults' => 'expire' ) ); ?>" value="<?php echo $sell_content['defaults']['expire']; ?>" size="6" /> <?php echo $this->exp_title; ?></div>
353
+ <span class="description"><?php _e( 'Use zero for permanent sales.', 'mycred' ); ?></span>
354
+ </li>
355
  </ol>
356
  <label class="subheader" for="<?php echo $this->field_id( array( 'templates' => 'visitors' ) ); ?>"><?php _e( 'Sale Template for non members', 'mycred' ); ?></label>
357
  <ol id="myCRED-buy-template-visitors">
414
  $new_data['sell_content']['defaults']['overwrite_price'] = ( isset( $settings['defaults']['overwrite_price'] ) ) ? 1 : 0;
415
  $new_data['sell_content']['defaults']['button_label'] = sanitize_text_field( $settings['defaults']['button_label'] );
416
  $new_data['sell_content']['defaults']['overwrite_buttonlabel'] = ( isset( $settings['defaults']['overwrite_buttonlabel'] ) ) ? 1 : 0;
417
+ $new_data['sell_content']['defaults']['expire'] = abs( $settings['defaults']['expire'] );
418
 
419
  $new_data['sell_content']['templates']['members'] = trim( $settings['templates']['members'] );
420
  $new_data['sell_content']['templates']['visitors'] = trim( $settings['templates']['visitors'] );
435
  public function add_metabox() {
436
  $sell_content = $this->sell_content;
437
  $post_types = explode( ',', $sell_content['post_types'] );
438
+ $name = apply_filters( 'mycred_label', myCRED_NAME );
439
  foreach ( (array) $post_types as $post_type ) {
440
  $post_type = trim( $post_type );
441
  add_meta_box(
442
  'mycred_sell_content',
443
+ $name . ' ' . __( 'Sell This', 'mycred' ),
444
  array( $this, 'metabox' ),
445
  $post_type,
446
  'side',
459
  */
460
  public function get_sale_prefs( $post_id ) {
461
  $sell_content = $this->sell_content;
462
+ if ( !isset( $sell_content['defaults']['expire'] ) )
463
+ $sell_content['defaults']['expire'] = 0;
464
+
465
  $prefs = get_post_meta( $post_id, 'myCRED_sell_content', true );
466
  if ( empty( $prefs ) ) {
467
  $sales_data = array(
468
  'status' => 'disabled',
469
  'price' => $sell_content['defaults']['price'],
470
+ 'button_label' => $sell_content['defaults']['button_label'],
471
+ 'expire' => $sell_content['defaults']['expire']
472
  );
473
  }
474
  else {
475
+ if ( !isset( $prefs['expire'] ) )
476
+ $prefs['expire'] = $sell_content['defaults']['expire'];
477
+
478
  $sales_data = $prefs;
479
  }
480
 
489
  public function metabox( $post ) {
490
  // Make sure add-on has been setup
491
  if ( !$this->is_installed() ) {
492
+ echo apply_filters( 'mycred_label', myCRED_NAME ) . __( ' Sell Content needs to be setup before you can use this feature.', 'mycred' );
493
  // Settings Link
494
  if ( $this->core->can_edit_plugin( get_current_user_id() ) )
495
  echo ' <a href="' . admin_url( 'admin.php?page=myCRED_page_settings' ) . '" title="' . __( 'Setup add-on', 'mycred' ) . '">' . __( 'Lets do it', 'mycred' ) . '</a>';
534
  <label for="mycred-buy-prefs-"><?php _e( 'Button Label', 'mycred' ); ?></label>
535
  <input type="text" name="myCRED_sell_content[button_label]" id="mycred-buy-prefs-" value="<?php echo $sales_data['button_label']; ?>" <?php if ( $ob === false && !$admin ) echo 'disabled="disabled" class="disabled"'; ?> />
536
  </li>
537
+ <li>
538
+ <label for="mycred-buy-prefs-"><?php _e( 'Purchase expires after', 'mycred' ); ?></label>
539
+ <div class="formated"><input type="text" name="myCRED_sell_content[expire]" id="mycred-buy-prefs-expire" value="<?php echo $sales_data['expire']; ?>" <?php if ( $op === false && !$admin ) echo 'disabled="disabled" class="disabled"'; ?> size="5" /> <?php echo $this->exp_title; ?></div>
540
+ </li>
541
  </ul>
542
  </div>
543
  <script type="text/javascript">//<![CDATA[
585
  $ob = (bool) $sell_content['defaults']['overwrite_buttonlabel'];
586
  $prefs['button_label'] = ( $ob === true || $is_admin === true ) ? $_POST['myCRED_sell_content']['button_label'] : $sell_content['defaults']['button_label'];
587
 
588
+ // Expiration
589
+ $prefs['expire'] = ( $is_admin === true ) ? abs( $_POST['myCRED_sell_content']['expire'] ) : $sell_content['defaults']['expire'];
590
+
591
  update_post_meta( $post_id, 'myCRED_sell_content', $prefs );
592
  }
593
 
616
  * @param $post_id (int) required post id
617
  * @returns (bool) true or false
618
  * @since 0.1
619
+ * @version 1.2
620
  */
621
  public function user_paid( $user_id, $post_id ) {
622
+ // Admins can view
623
  if ( $this->core->can_edit_plugin( $user_id ) || $this->core->can_edit_creds( $user_id ) ) return true;
624
+ // Authors can view
625
+ if ( isset( $GLOBALS['post'] ) && $GLOBALS['post']->post_author == $user_id ) return true;
626
 
627
  global $wpdb;
628
+
629
+ $sell_content = $this->sell_content;
630
+
631
+ // Search for the latest purchase of this item.
632
+ $sql = "SELECT * FROM " . $wpdb->prefix . $this->core->db_name . " WHERE user_id = %d AND ref = %s AND ref_id = %d ORDER BY time DESC LIMIT 0,1";
633
+ $purchases = $wpdb->get_results( $wpdb->prepare( $sql, $user_id, 'buy_content', $post_id ) );
634
+ update_option( 'mycred_purchase_check', $purchases );
635
+ // We have found purchase records
636
+ if ( !empty( $purchases ) ) {
637
+ // Since individual posts can override the default settings we need to check sales prefs
638
+ $prefs = $this->get_sale_prefs( $post_id );
639
+ if ( !isset( $prefs['expire'] ) )
640
+ $prefs['expire'] = ( isset( $sell_content['defaults']['expire'] ) ) ? $sell_content['defaults']['expire'] : 0;
641
 
642
+ // If purchases never expire just return true here and now
643
+ if ( $prefs['expire'] == 0 ) return true;
 
644
 
645
+ // Check if purchase has expired
646
+ if ( !$this->purchase_has_expired( $purchases[0]->time, $prefs['expire'], $user_id, $post_id ) ) return true;
647
+ }
648
+
649
+ // All else there are no purchases
650
  return false;
651
  }
652
 
653
+ /**
654
+ * Purchase Has Expired
655
+ * Makes a time comparison to check if a given timestamp is in the future (not expired) or
656
+ * in the past (expired).
657
+ *
658
+ * @param $timestamp (int) The UNIX timestamp to wich we apply the expiration check
659
+ * @param $length (int) Length of expiration time to check by default this is the number of hours.
660
+ * @filter 'mycred_sell_expire_calc'
661
+ * @returns (bool) true or false
662
+ * @since 1.1
663
+ * @version 1.0
664
+ */
665
+ public function purchase_has_expired( $timestamp, $length = 0, $user_id, $post_id ) {
666
+ if ( $length == 0 ) return false;
667
+
668
+ $expiration = apply_filters( 'mycred_sell_expire_calc', abs( $length*3600 ), $length, $user_id, $post_id );
669
+ $expiration = $expiration+$timestamp;
670
+
671
+ if ( $expiration > date_i18n( 'U' ) ) return false;
672
+
673
+ return true;
674
+ }
675
+
676
  /**
677
  * User Can Buy
678
  * Checks if a given user can afford the given price.
711
  $button_text = $sell_content['defaults']['button_label'];
712
 
713
  // Button element
714
+ $button = '<input type="submit" name="mycred-buy-button" value="' . $this->core->template_tags_post( $button_text, $post ) . '" class="button large" />';
715
 
716
  // Make sure there is a button
717
  if ( !preg_match( '/%buy_button%/', $text ) )
760
  $template = $this->get_button( $template, $GLOBALS['post'] );
761
  return '
762
  <form action="" method="post">
763
+ <input type="hidden" name="mycred_purchase[post_id]" value="' . $post_id . '" />
764
+ <input type="hidden" name="mycred_purchase[post_type]" value="' . $GLOBALS['post']->post_type . '" />
765
+ <input type="hidden" name="mycred_purchase[user_id]" value="' . get_current_user_id() . '" />
766
+ <input type="hidden" name="mycred_purchase[author]" value="' . $GLOBALS['post']->post_author . '" />
767
+ <input type="hidden" name="mycred_purchase_token" value="' . wp_create_nonce( 'buy-content' ) . '" />
768
+ <input type="hidden" name="mycred_purchase[action]" value="buy" />
769
  <div class="mycred-content-forsale">' . $template . '</div>
770
  </form>';
771
  }
791
 
792
  /**
793
  * Render Shortcode
794
+ * Just as protecting the entire content, the mycred_sell_this shortcode protects
795
  * parts of the content.
796
  *
797
  * @returns (string) content
798
  * @since 0.1
799
+ * @version 1.2
800
  */
801
  public function render_shortcode( $atts, $content ) {
802
  $post_id = $GLOBALS['post']->ID;
805
 
806
  $prefs = shortcode_atts( array(
807
  'price' => $sell_content['defaults']['price'],
808
+ 'button_label' => $sell_content['defaults']['button_label'],
809
+ 'expire' => $sell_content['defaults']['expire']
810
  ), $atts );
811
  $sales_prefs = $this->get_sale_prefs( $post_id );
812
 
813
  // If we are not using defaults save these settings.
814
+ if ( ( $sales_prefs['price'] != $prefs['price'] ) || ( $sales_prefs['button_label'] != $prefs['button_label'] ) || ( $sales_prefs['expire'] != $prefs['expire'] ) ) {
815
  update_post_meta( $post_id, 'myCRED_sell_content', array(
816
  'price' => $prefs['price'],
817
  'status' => $sales_prefs['status'],
818
+ 'button_label' => $prefs['button_label'],
819
+ 'expire' => $prefs['expire']
820
  ) );
821
  }
822
 
840
  unset( $content );
841
  return '
842
  <form action="" method="post">
843
+ <input type="hidden" name="mycred_purchase[post_id]" value="' . $post_id . '" />
844
  <input type="hidden" name="mycred_purchase[post_type]" value="' . $GLOBALS['post']->post_type . '" />
845
+ <input type="hidden" name="mycred_purchase[user_id]" value="' . get_current_user_id() . '" />
846
+ <input type="hidden" name="mycred_purchase[author]" value="' . $GLOBALS['post']->post_author . '" />
847
+ <input type="hidden" name="mycred_purchase_token" value="' . wp_create_nonce( 'buy-content' ) . '" />
848
  <input type="hidden" name="mycred_purchase[action]" value="buy" />
849
  <div class="mycred-content-forsale">' . $template . '</div>
850
  </form>';
860
  return '<div class="mycred-content-forsale">' . $template . '</div>';
861
  }
862
 
863
+ // Admin and Author Wrapper for highlight of content set for sale
864
+ if ( mycred_is_admin() || $GLOBALS['post']->post_author == $user_id )
865
+ $content = '<div class="mycred-mark-title">' . __( 'The following content is set for sale:', 'mycred' ) . '</div><div class="mycred-mark-content">' . $content . '</div>';
866
+
867
+ return do_shortcode( $content );
868
+ }
869
+
870
+ /**
871
+ * Render Shortcode AJAX
872
+ * Just as protecting the entire content, the mycred_sell_this_ajax shortcode protects
873
+ * parts of the content and uses AJAX to make the purchase
874
+ *
875
+ * @returns (string) content
876
+ * @since 0.1
877
+ * @version 1.0
878
+ */
879
+ public function render_ajax_shortcode( $atts, $content ) {
880
+ global $mycred_buy_content;
881
+
882
+ $post_id = $GLOBALS['post']->ID;
883
+ $user_id = get_current_user_id();
884
+ $sell_content = $this->sell_content;
885
+
886
+ $prefs = shortcode_atts( array(
887
+ 'price' => $sell_content['defaults']['price'],
888
+ 'button_label' => $sell_content['defaults']['button_label'],
889
+ 'expire' => $sell_content['defaults']['expire']
890
+ ), $atts );
891
+ $sales_prefs = $this->get_sale_prefs( $post_id );
892
+
893
+ // If we are not using defaults save these settings.
894
+ if ( ( $sales_prefs['price'] != $prefs['price'] ) || ( $sales_prefs['button_label'] != $prefs['button_label'] ) || ( $sales_prefs['expire'] != $prefs['expire'] ) ) {
895
+ update_post_meta( $post_id, 'myCRED_sell_content', array(
896
+ 'price' => $prefs['price'],
897
+ 'status' => $sales_prefs['status'],
898
+ 'button_label' => $prefs['button_label'],
899
+ 'expire' => $prefs['expire']
900
+ ) );
901
+ }
902
+
903
+ // Not logged in
904
+ if ( !is_user_logged_in() ) {
905
+ $template = $sell_content['templates']['visitors'];
906
+
907
+ $template = str_replace( '%price%', $this->core->format_creds( $prefs['price'] ), $template );
908
+ $template = $this->core->template_tags_post( $template, $GLOBALS['post'] );
909
+ unset( $content );
910
+ return '<div class="mycred-content-forsale">' . $template . '</div>';
911
+ }
912
+
913
+ // Can buy
914
+ elseif ( is_user_logged_in() && !$this->user_paid( $user_id, $post_id ) && $this->user_can_buy( $user_id, $prefs['price'] ) ) {
915
+ $template = $sell_content['templates']['members'];
916
+
917
+ $template = str_replace( '%price%', $this->core->format_creds( $prefs['price'] ), $template );
918
+ $template = $this->core->template_tags_post( $template, $GLOBALS['post'] );
919
+
920
+ if ( isset( $prefs['button_label'] ) )
921
+ $button_text = $prefs['button_label'];
922
+ else
923
+ $button_text = $sell_content['defaults']['button_label'];
924
+
925
+ $button = '<input type="button" data-id="' . $GLOBALS['post']->ID . '" name="mycred-buy-button" value="' . $this->core->template_tags_post( $button_text, $GLOBALS['post'] ) . '" class="mycred-sell-this-button button large" />';
926
+ $template = str_replace( '%buy_button%', $button, $template );
927
+ unset( $content );
928
+
929
+ $mycred_buy_content = true;
930
+ return '<div class="mycred-content-forsale">' . $template . '</div>';
931
+ }
932
+
933
+ // We are logged in, have not purchased this item and can not afford to buy this
934
+ elseif ( is_user_logged_in() && !$this->user_paid( $user_id, $post_id ) && !$this->user_can_buy( $user_id, $prefs['price'] ) ) {
935
+ $template = $sell_content['templates']['cantafford'];
936
+
937
+ $template = str_replace( '%price%', $this->core->format_creds( $prefs['price'] ), $template );
938
+ $template = $this->core->template_tags_post( $template, $GLOBALS['post'] );
939
+ unset( $content );
940
+ return '<div class="mycred-content-forsale">' . $template . '</div>';
941
+ }
942
+
943
+ // Admin and Author Wrapper for highlight of content set for sale
944
+ if ( mycred_is_admin() || $GLOBALS['post']->post_author == $user_id )
945
  $content = '<div class="mycred-mark-title">' . __( 'The following content is set for sale:', 'mycred' ) . '</div><div class="mycred-mark-content">' . $content . '</div>';
946
 
947
  return do_shortcode( $content );
1018
 
1019
  return $output;
1020
  }
1021
+
1022
+ /**
1023
+ * Support for Email Notices
1024
+ * @since 1.1
1025
+ * @version 1.0
1026
+ */
1027
+ public function email_notices( $data ) {
1028
+ if ( $data['request']['ref'] == 'buy_content' ) {
1029
+ $message = $data['message'];
1030
+ $data['message'] = $this->core->template_tags_post( $message, $data['request']['ref_id'] );
1031
+ }
1032
+ return $data;
1033
+ }
1034
 
1035
  /**
1036
  * Contextual Help
addons/transfer/css/transfer.css CHANGED
@@ -1,28 +1,26 @@
1
  /**
2
  * Transfer Styling
3
  * @since 0.1
4
- * @version 1.0
5
  */
6
  .mycred-transfer-cred-wrapper { display: block; float: none; clear: both; margin: 0; padding: 0; }
7
- .mycred-transfer-cred-wrapper>p { margin-bottom: 12px; }
8
  .mycred-transfer-cred-wrapper ol { margin: 0; padding: 0; float: none; clear: both; }
9
- .mycred-transfer-cred-wrapper ol li { list-style-type: none; float: left; margin: 0; }
10
  .widget .mycred-transfer-cred-wrapper ol li { float: none; }
11
 
12
  .mycred-transfer-cred-wrapper ol li.mycred-send-to { width: 40%; }
13
  .mycred-transfer-cred-wrapper ol li.mycred-send-to div.transfer-to { height: 100px; }
14
  .widget .mycred-transfer-cred-wrapper ol li.mycred-send-to { width: 100%; }
15
- .mycred-transfer-cred-wrapper ol li.mycred-send-to span.ui-helper-hidden-accessible { display: none !important; }
16
 
17
- .mycred-transfer-cred-wrapper ol li.mycred-send-details { width: 58%; }
18
- .mycred-transfer-cred-wrapper ol li.mycred-send-details input[type="button"] { margin-top: 0; }
19
- .widget .mycred-transfer-cred-wrapper ol li.mycred-send-details { width: 100%; }
20
  .mycred-transfer-cred-wrapper ol li.mycred-send-details span:empty { display: none; }
21
 
22
  .mycred-transfer-cred-wrapper ol li label { display: block; }
23
  .mycred-transfer-cred-wrapper ol li input[type="text"] { width: 90%; }
24
  .mycred-transfer-cred-wrapper ol li input[type="text"].short { width: 40%; }
25
- .mycred-transfer-cred-wrapper ol li input[type="button"] { margin-left: 12px; float: right; }
26
 
27
  .mycred-transfer-info { margin: 0; padding: 6px 0; display: block; clear: both; float: none; }
28
  .mycred-transfer-info p { font-size: smaller; line-height: 16px; margin: 0; padding: 0; }
1
  /**
2
  * Transfer Styling
3
  * @since 0.1
4
+ * @version 1.1
5
  */
6
  .mycred-transfer-cred-wrapper { display: block; float: none; clear: both; margin: 0; padding: 0; }
7
+ .mycred-transfer-cred-wrapper>p { margin-bottom: 6px; }
8
  .mycred-transfer-cred-wrapper ol { margin: 0; padding: 0; float: none; clear: both; }
9
+ .mycred-transfer-cred-wrapper ol li { list-style-type: none; float: left; margin: 0; padding: 0; }
10
  .widget .mycred-transfer-cred-wrapper ol li { float: none; }
11
 
12
  .mycred-transfer-cred-wrapper ol li.mycred-send-to { width: 40%; }
13
  .mycred-transfer-cred-wrapper ol li.mycred-send-to div.transfer-to { height: 100px; }
14
  .widget .mycred-transfer-cred-wrapper ol li.mycred-send-to { width: 100%; }
 
15
 
16
+ .mycred-transfer-cred-wrapper ol li.mycred-send-amount { width: 60%; }
17
+ .widget .mycred-transfer-cred-wrapper ol li.mycred-send-amount { width: 100%; }
 
18
  .mycred-transfer-cred-wrapper ol li.mycred-send-details span:empty { display: none; }
19
 
20
  .mycred-transfer-cred-wrapper ol li label { display: block; }
21
  .mycred-transfer-cred-wrapper ol li input[type="text"] { width: 90%; }
22
  .mycred-transfer-cred-wrapper ol li input[type="text"].short { width: 40%; }
23
+ .mycred-transfer-cred-wrapper ol li input[type="button"] { float: right; }
24
 
25
  .mycred-transfer-info { margin: 0; padding: 6px 0; display: block; clear: both; float: none; }
26
  .mycred-transfer-info p { font-size: smaller; line-height: 16px; margin: 0; padding: 0; }
addons/transfer/js/transfer.js CHANGED
@@ -10,7 +10,7 @@
10
  */
11
  jQuery(function($){
12
  // Transfer function
13
- var transfer_creds = function( to, creds ) {
14
  $.ajax({
15
  type : "POST",
16
  data : {
@@ -23,9 +23,18 @@ jQuery(function($){
23
  dataType : "JSON",
24
  url : myCRED.ajaxurl,
25
  // Before we start
26
- beforeSend : function() {},
 
 
 
 
27
  // On Successful Communication
28
  success : function( data ) {
 
 
 
 
 
29
  // Security token could not be verified.
30
  if ( data == 'error_1' ) {
31
  alert( myCRED.error_1 );
@@ -104,6 +113,10 @@ jQuery(function($){
104
  response( data );
105
  });
106
  },
 
 
 
 
107
  appendTo : 'div.transfer-to'
108
  });
109
 
@@ -116,14 +129,14 @@ jQuery(function($){
116
  //console.log( to );
117
 
118
  // Amount:
119
- var amount = $(this).prev().prev();
120
  var creds = $(amount).val();
121
  // Debug - uncomment to use
122
  //console.log( creds );
123
 
124
  // If elements are not emepty attempt transfer
125
  if ( to != '' && creds != '' ) {
126
- transfer_creds( to, creds );
127
  }
128
  });
129
  });
10
  */
11
  jQuery(function($){
12
  // Transfer function
13
+ var transfer_creds = function( to, creds, label ) {
14
  $.ajax({
15
  type : "POST",
16
  data : {
23
  dataType : "JSON",
24
  url : myCRED.ajaxurl,
25
  // Before we start
26
+ beforeSend : function() {
27
+ // Prevent users from clicking multiple times
28
+ $('.mycred-click').attr( 'value', myCRED.working );
29
+ $('.mycred-click').attr( 'disabled', 'disabled' );
30
+ },
31
  // On Successful Communication
32
  success : function( data ) {
33
+ // Debug - uncomment to use
34
+ //console.log( data );
35
+ // Remove disable
36
+ $('.mycred-click').attr( 'value', label );
37
+ $('.mycred-click').removeAttr( 'disabled' );
38
  // Security token could not be verified.
39
  if ( data == 'error_1' ) {
40
  alert( myCRED.error_1 );
113
  response( data );
114
  });
115
  },
116
+ messages: {
117
+ noResults: '',
118
+ results: function() {}
119
+ },
120
  appendTo : 'div.transfer-to'
121
  });
122
 
129
  //console.log( to );
130
 
131
  // Amount:
132
+ var amount = $(this).prev().children( 'input' );
133
  var creds = $(amount).val();
134
  // Debug - uncomment to use
135
  //console.log( creds );
136
 
137
  // If elements are not emepty attempt transfer
138
  if ( to != '' && creds != '' ) {
139
+ transfer_creds( to, creds, $(this).attr( 'value' ) );
140
  }
141
  });
142
  });
addons/transfer/myCRED-addon-transfer.php CHANGED
@@ -51,7 +51,8 @@ if ( !class_exists( 'myCRED_Transfer_Creds' ) ) {
51
  'add_to_core' => true
52
  ) );
53
 
54
- add_action( 'mycred_help', array( $this, 'help' ), 10, 2 );
 
55
  }
56
 
57
  /**
@@ -125,6 +126,7 @@ if ( !class_exists( 'myCRED_Transfer_Creds' ) ) {
125
  $base = array(
126
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
127
  'user_id' => get_current_user_id(),
 
128
  'token' => wp_create_nonce( 'mycred-transfer-creds' ),
129
  'atoken' => wp_create_nonce( 'mycred-autocomplete' )
130
  );
@@ -319,7 +321,7 @@ if ( !class_exists( 'myCRED_Transfer_Creds' ) ) {
319
  if ( $amount == $this->core->number( 0 ) ) die( json_encode( 'error_5' ) );
320
 
321
  // Check funds
322
- if ( mycred_user_can_transfer( $from, $amount ) == 'low' ) die( json_encode( 'error_7' ) );
323
 
324
  $today = date_i18n( 'd' );
325
  $this_week = date_i18n( 'W' );
@@ -380,7 +382,7 @@ if ( !class_exists( 'myCRED_Transfer_Creds' ) ) {
380
  }
381
 
382
  // Let others play before we execute the transfer
383
- do_action( 'mycred_transfer_ready', $this->core, $ruser );
384
 
385
  // Generate Transaction ID for our records
386
  $transaction_id = 'TXID' . date_i18n( 'U' );
@@ -412,7 +414,7 @@ if ( !class_exists( 'myCRED_Transfer_Creds' ) ) {
412
  );
413
 
414
  // Let others play once transaction is completed
415
- do_action( 'mycred_transfer_completed', $this->core );
416
 
417
  // Clean up and die
418
  unset( $this );
@@ -450,6 +452,19 @@ if ( !class_exists( 'myCRED_Transfer_Creds' ) ) {
450
  die( json_encode( $results ) );
451
  }
452
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  /**
454
  * Contextual Help
455
  * @since 0.1
@@ -491,7 +506,7 @@ if ( !class_exists( 'myCRED_Widget_Transfer' ) ) {
491
  'classname' => 'widget-my-cred-transfer',
492
  'description' => __( 'Allow transfers between users.', 'mycred' )
493
  );
494
- $this->WP_Widget( 'mycred_widget_transfer', __( 'myCRED Transfer', 'mycred' ), $widget_ops );
495
  $this->alt_option_name = 'mycred_widget_transfer';
496
  }
497
 
@@ -679,7 +694,17 @@ if ( !function_exists( 'mycred_transfer_render' ) ) {
679
 
680
  // If content is passed on.
681
  if ( $content !== NULL && !empty( $content ) )
682
- $output .= '<p>' . nl2br( $content ) . '</p>';
 
 
 
 
 
 
 
 
 
 
683
 
684
  // Main output
685
  $output .= '
@@ -688,12 +713,12 @@ if ( !function_exists( 'mycred_transfer_render' ) ) {
688
  <label>' . __( 'To:', 'mycred' ) . '</label>
689
  <div class="transfer-to">' . $to_input . '</div>
690
  </li>
691
- <li class="mycred-send-details">
692
  <label>' . __( 'Amount:', 'mycred' ) . '</label>
693
- <span class="mycred-before">' . $mycred->before . '</span>
694
- <input type="text" class="short" name="mycred-transfer-amount" value="' . $mycred->format_number( 0 ) . '" size="8" />
695
- <span class="mycred-after">' . $mycred->after . '</span>
696
- <input type="button" class="button large button-large mycred-click" value="' . $pref['templates']['button'] . '" />';
697
 
698
  $extras = array();
699
 
@@ -713,11 +738,10 @@ if ( !function_exists( 'mycred_transfer_render' ) ) {
713
 
714
  // No need to include this if extras is empty
715
  if ( !empty( $extras ) ) {
716
- $output .= '<br /><div class="mycred-transfer-info"><p>' . implode( '</p><p>', $extras ) . '</p></div>';
717
  }
718
 
719
  $output .= '
720
- </li>
721
  </ol>' . "\n";
722
 
723
  // Return result
@@ -726,7 +750,7 @@ if ( !function_exists( 'mycred_transfer_render' ) ) {
726
 
727
  unset( $mycred );
728
  unset( $output );
729
- return $result;
730
  }
731
  }
732
 
@@ -742,7 +766,7 @@ if ( !function_exists( 'mycred_transfer_render' ) ) {
742
  * @version 1.1
743
  */
744
  if ( !function_exists( 'mycred_user_can_transfer' ) ) {
745
- function mycred_user_can_transfer( $user_id, $amount = NULL )
746
  {
747
  if ( $user_id === NULL ) $user_id = get_current_user_id();
748
 
@@ -754,6 +778,9 @@ if ( !function_exists( 'mycred_user_can_transfer' ) ) {
754
 
755
  // To low balance
756
  $account_limit = (int) apply_filters( 'mycred_transfer_acc_limit', 0 );
 
 
 
757
  if ( $amount !== NULL ) {
758
  if ( $balance-$amount < $account_limit ) return 'low';
759
  } else {
51
  'add_to_core' => true
52
  ) );
53
 
54
+ add_action( 'mycred_help', array( $this, 'help' ), 10, 2 );
55
+ add_filter( 'mycred_email_before_send', array( $this, 'email_notices' ), 10, 2 );
56
  }
57
 
58
  /**
126
  $base = array(
127
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
128
  'user_id' => get_current_user_id(),
129
+ 'working' => __( 'Processing...', 'mycred' ),
130
  'token' => wp_create_nonce( 'mycred-transfer-creds' ),
131
  'atoken' => wp_create_nonce( 'mycred-autocomplete' )
132
  );
321
  if ( $amount == $this->core->number( 0 ) ) die( json_encode( 'error_5' ) );
322
 
323
  // Check funds
324
+ if ( mycred_user_can_transfer( $from, $amount ) === 'low' ) die( json_encode( 'error_7' ) );
325
 
326
  $today = date_i18n( 'd' );
327
  $this_week = date_i18n( 'W' );
382
  }
383
 
384
  // Let others play before we execute the transfer
385
+ do_action( 'mycred_transfer_ready', $prefs, $this->core );
386
 
387
  // Generate Transaction ID for our records
388
  $transaction_id = 'TXID' . date_i18n( 'U' );
414
  );
415
 
416
  // Let others play once transaction is completed
417
+ do_action( 'mycred_transfer_completed', $prefs, $this->core );
418
 
419
  // Clean up and die
420
  unset( $this );
452
  die( json_encode( $results ) );
453
  }
454
 
455
+ /**
456
+ * Support for Email Notices
457
+ * @since 1.1
458
+ * @version 1.0
459
+ */
460
+ public function email_notices( $data ) {
461
+ if ( $data['request']['ref'] == 'transfer' ) {
462
+ $message = $data['message'];
463
+ $data['message'] = $this->core->template_tags_user( $message, $data['request']['ref_id'] );
464
+ }
465
+ return $data;
466
+ }
467
+
468
  /**
469
  * Contextual Help
470
  * @since 0.1
506
  'classname' => 'widget-my-cred-transfer',
507
  'description' => __( 'Allow transfers between users.', 'mycred' )
508
  );
509
+ $this->WP_Widget( 'mycred_widget_transfer', sprintf( __( '%s Transfer', 'mycred' ), apply_filters( 'mycred_label', myCRED_NAME ) ), $widget_ops );
510
  $this->alt_option_name = 'mycred_widget_transfer';
511
  }
512
 
694
 
695
  // If content is passed on.
696
  if ( $content !== NULL && !empty( $content ) )
697
+ $output .= $content;
698
+
699
+ if ( !empty( $mycred->before ) )
700
+ $before = $mycred->before . ' ';
701
+ else
702
+ $before = '';
703
+
704
+ if ( !empty( $mycred->after ) )
705
+ $after = ' ' . $mycred->after;
706
+ else
707
+ $after = '';
708
 
709
  // Main output
710
  $output .= '
713
  <label>' . __( 'To:', 'mycred' ) . '</label>
714
  <div class="transfer-to">' . $to_input . '</div>
715
  </li>
716
+ <li class="mycred-send-amount">
717
  <label>' . __( 'Amount:', 'mycred' ) . '</label>
718
+ <div>' . $before . '<input type="text" class="short" name="mycred-transfer-amount" value="' . $mycred->format_number( 0 ) . '" size="8" />' . $after . '</div>
719
+ <input type="button" class="button large button-large mycred-click" value="' . $pref['templates']['button'] . '" />
720
+ </li>
721
+ ';
722
 
723
  $extras = array();
724
 
738
 
739
  // No need to include this if extras is empty
740
  if ( !empty( $extras ) ) {
741
+ $output .= '<li class="mycred-transfer-info"><p>' . implode( '</p><p>', $extras ) . '</p></li>';
742
  }
743
 
744
  $output .= '
 
745
  </ol>' . "\n";
746
 
747
  // Return result
750
 
751
  unset( $mycred );
752
  unset( $output );
753
+ return do_shortcode( $result );
754
  }
755
  }
756
 
766
  * @version 1.1
767
  */
768
  if ( !function_exists( 'mycred_user_can_transfer' ) ) {
769
+ function mycred_user_can_transfer( $user_id = NULL, $amount = NULL )
770
  {
771
  if ( $user_id === NULL ) $user_id = get_current_user_id();
772
 
778
 
779
  // To low balance
780
  $account_limit = (int) apply_filters( 'mycred_transfer_acc_limit', 0 );
781
+ if ( !is_numeric( $account_limit ) )
782
+ $account_limit = 0;
783
+
784
  if ( $amount !== NULL ) {
785
  if ( $balance-$amount < $account_limit ) return 'low';
786
  } else {
assets/css/admin.css CHANGED
@@ -18,7 +18,7 @@
18
  .tj { text-align: justify; }
19
 
20
  /* Specifics */
21
- #icon-myCRED { background-image: url(../images/cred-icon32.png); background-repeat: no-repeat; background-position: 0 0; }
22
  #myCRED-wrap p.submit { margin-top: 0; padding-top: 0; }
23
  #mycred-social { text-align: right; }
24
 
18
  .tj { text-align: justify; }
19
 
20
  /* Specifics */
21
+ #icon-myCRED, .icon32-posts-mycred_email_notice, .icon32-posts-mycred_rank { background-image: url(../images/cred-icon32.png); background-repeat: no-repeat; background-position: 0 0; }
22
  #myCRED-wrap p.submit { margin-top: 0; padding-top: 0; }
23
  #mycred-social { text-align: right; }
24
 
assets/js/links.js ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * myCRED Points for Link Clicks jQuery Scripts
3
+ * @since 0.1
4
+ * @version 1.0
5
+ */
6
+ jQuery(function($) {
7
+ var mycred_click = function( points, href, id ) {
8
+ //alert( 'You gained '+points+' for clicking on this link. Reference: '+href );
9
+ $.ajax({
10
+ type : "POST",
11
+ data : {
12
+ action : 'mycred-click-points',
13
+ amount : points,
14
+ url : href,
15
+ eid : id,
16
+ token : myCREDgive.token
17
+ },
18
+ dataType : "JSON",
19
+ url : myCREDgive.ajaxurl,
20
+ // Before we start
21
+ beforeSend : function() {},
22
+ // On Successful Communication
23
+ success : function( data ) {
24
+ // Security token could not be verified.
25
+ if ( data == 'alert' ) {
26
+ alert( 'You gained '+points+' points for clicking on this link.' );
27
+ }
28
+ },
29
+ // Error (sent to console)
30
+ error : function( jqXHR, textStatus, errorThrown ) {
31
+ // Debug - uncomment to use
32
+ //console.log( jqXHR );
33
+ }
34
+ });
35
+ };
36
+
37
+ $('.mycred-points-link').click(function(){
38
+ if ( $(this).attr( 'id' ) && $(this).attr( 'id' ) != '' ) {
39
+ mycred_click( $(this).attr( 'data-amount' ), $(this).attr( 'href' ), $(this).attr( 'id' ) );
40
+ }
41
+ else {
42
+ mycred_click( $(this).attr( 'data-amount' ), $(this).attr( 'href' ), '' );
43
+ }
44
+ });
45
+ });
assets/js/send.js ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * myCRED Points for Link Clicks jQuery Scripts
3
+ * @since 0.1
4
+ * @version 1.0
5
+ */
6
+ jQuery(function($) {
7
+ var mycred_send = function( button, label ) {
8
+ $.ajax({
9
+ type : "POST",
10
+ data : {
11
+ action : 'mycred-send-points',
12
+ amount : button.attr( 'data-amount' ),
13
+ recipient : button.attr( 'data-to' ),
14
+ log : button.attr( 'data-log' ),
15
+ reference : button.attr( 'data-ref' ),
16
+ token : myCREDsend.token
17
+ },
18
+ dataType : "JSON",
19
+ url : myCREDsend.ajaxurl,
20
+ // Before we start
21
+ beforeSend : function() {
22
+ button.attr( 'value', myCREDsend.working );
23
+ button.attr( 'disabled', 'disabled' );
24
+ },
25
+ // On Successful Communication
26
+ success : function( data ) {
27
+ // Transfer complete
28
+ if ( data == 'done' ) {
29
+ button.attr( 'value', myCREDsend.done );
30
+ setTimeout( function(){
31
+ button.attr( 'value', label );
32
+ button.removeAttr( 'disabled' ); }, 2000 );
33
+ }
34
+ // Transfer complete but now account has reached zero
35
+ else if ( data == 'zero' ) {
36
+ // Loop though each button disable and hide
37
+ $('.mycred-send-points-button').each(function(){
38
+ $(this).attr( 'disabled', 'disabled' );
39
+ $(this).hide();
40
+ });
41
+ }
42
+ // Transfer complete but this amount can not be sent again
43
+ else if ( data == 'minus' ) {
44
+ // Loop though each button
45
+ $('.mycred-send-points-button').each(function(){
46
+ // If amount is larger or equal to this buttons amount disable and hide
47
+ if ( $(this).attr( 'data-amount' ) && $(this).attr( 'data-amount' ) >= button.attr( 'data-amount' ) ) {
48
+ $(this).attr( 'disabled', 'disabled' );
49
+ $(this).hide();
50
+ }
51
+ });
52
+ }
53
+ },
54
+ // Error (sent to console)
55
+ error : function( jqXHR, textStatus, errorThrown ) {
56
+ button.attr( 'value', myCREDsend.error );
57
+ button.removeAttr( 'disabled' );
58
+ // Debug - uncomment to use
59
+ //console.log( jqXHR );
60
+ }
61
+ });
62
+ };
63
+
64
+ $('.mycred-send-points-button').click(function(){
65
+ mycred_send( $(this), $(this).attr( 'value' ) );
66
+ });
67
+ });
includes/mycred-admin.php CHANGED
@@ -162,13 +162,18 @@ if ( !class_exists( 'myCRED_Admin' ) ) {
162
 
163
  // Balance
164
  $balance = $this->core->get_users_cred( $user->ID );
165
- $balance = $this->core->format_creds( $balance ); ?>
 
 
 
 
 
166
 
167
  <tr>
168
  <th scope="row"><label for="myCRED-manual-add-points"><?php echo $label; ?></label></th>
169
  <td id="myCRED-adjust-users-points">
170
  <?php echo $this->core->plural(); ?>: <input type="text" name="myCRED-manual-add-points" id="myCRED-manual-add-points" value="<?php echo $this->core->number( 0 ); ?>" size="4" /><br /><br />
171
- <label for="myCRED-manual-add-description"><?php _e( 'Log description for adjustment', 'mycred' ); ?> (<strong><?php _e( 'required', 'mycred' ); ?></strong>)</label><br />
172
  <input type="text" name="myCRED-manual-add-description" id="myCRED-manual-add-description" value="" class="regular-text" /> <?php submit_button( __( 'Update', 'mycred' ), 'primary medium', 'myCRED_update', '' ); ?>
173
  </td>
174
  </tr>
162
 
163
  // Balance
164
  $balance = $this->core->get_users_cred( $user->ID );
165
+ $balance = $this->core->format_creds( $balance );
166
+
167
+ if ( $this->core->can_edit_creds() && !$this->core->can_edit_plugin() )
168
+ $req = '(<strong>' . __( 'required', 'mycred' ) . '</strong>)';
169
+ else
170
+ $req = '(optional)'; ?>
171
 
172
  <tr>
173
  <th scope="row"><label for="myCRED-manual-add-points"><?php echo $label; ?></label></th>
174
  <td id="myCRED-adjust-users-points">
175
  <?php echo $this->core->plural(); ?>: <input type="text" name="myCRED-manual-add-points" id="myCRED-manual-add-points" value="<?php echo $this->core->number( 0 ); ?>" size="4" /><br /><br />
176
+ <label for="myCRED-manual-add-description"><?php _e( 'Log description for adjustment', 'mycred' ); ?> <?php echo $req; ?></label><br />
177
  <input type="text" name="myCRED-manual-add-description" id="myCRED-manual-add-description" value="" class="regular-text" /> <?php submit_button( __( 'Update', 'mycred' ), 'primary medium', 'myCRED_update', '' ); ?>
178
  </td>
179
  </tr>
includes/mycred-functions.php CHANGED
@@ -25,6 +25,8 @@ if ( !class_exists( 'myCRED_Settings' ) ) {
25
  $this->$key = $value;
26
  }
27
  }
 
 
28
  }
29
 
30
  /**
@@ -177,11 +179,11 @@ if ( !class_exists( 'myCRED_Settings' ) ) {
177
  * @param $rate (int|float) the exchange rate to devide by
178
  * @param $round (bool) option to round values, defaults to yes.
179
  * @since 0.1
180
- * @version 1.1
181
  */
182
  public function apply_exchange_rate( $amount, $rate = 1, $round = true ) {
183
  $amount = $this->number( $amount );
184
- if ( $rate == 1 ) return $amount;
185
 
186
  $exchange = $amount/(float) $rate;
187
  if ( $round ) $exchange = round( $exchange );
@@ -243,13 +245,11 @@ if ( !class_exists( 'myCRED_Settings' ) ) {
243
  $content = apply_filters( 'mycred_parse_tags_general', $content );
244
 
245
  // Singular
246
- $content = str_replace( '%singular%', $this->singular(), $content );
247
- $content = str_replace( '%Singular%', $this->singular(), $content );
248
  $content = str_replace( '%_singular%', strtolower( $this->singular() ), $content );
249
 
250
  // Plural
251
- $content = str_replace( '%plural%', $this->plural(), $content );
252
- $content = str_replace( '%Plural%', $this->plural(), $content );
253
  $content = str_replace( '%_plural%', strtolower( $this->plural() ), $content );
254
 
255
  // Login URL
@@ -262,6 +262,10 @@ if ( !class_exists( 'myCRED_Settings' ) ) {
262
 
263
  // Blog Related
264
  $content = str_replace( '%num_members%', $this->count_members(), $content );
 
 
 
 
265
 
266
  //$content = str_replace( '', , $content );
267
  return $content;
@@ -314,7 +318,7 @@ if ( !class_exists( 'myCRED_Settings' ) ) {
314
  }
315
 
316
  // Let others play first
317
- $content = apply_filters( 'mycred_parse_tags_post', $content, $data, $post );
318
  $content = $this->template_tags_general( $content );
319
 
320
  // Replace template tags
@@ -343,7 +347,7 @@ if ( !class_exists( 'myCRED_Settings' ) ) {
343
  * @param $data (object) Log entry data object
344
  * @return (string) parsed string
345
  * @since 0.1
346
- * @version 1.0.2
347
  */
348
  public function template_tags_user( $content, $ref_id = NULL, $data = '' ) {
349
  if ( $ref_id === NULL ) return $content;
@@ -356,12 +360,15 @@ if ( !class_exists( 'myCRED_Settings' ) ) {
356
  if ( !is_array( $data ) || !array_key_exists( 'ID', $data ) ) return $content;
357
  $user = new StdClass();
358
  foreach ( $data as $key => $value ) {
359
- $user->$key = $value;
 
 
 
360
  }
361
  }
362
 
363
  // Let others play first
364
- $content = apply_filters( 'mycred_parse_tags_user', $content, $data, $user );
365
  $content = $this->template_tags_general( $content );
366
 
367
  // Replace template tags
@@ -381,6 +388,22 @@ if ( !class_exists( 'myCRED_Settings' ) ) {
381
  $content = str_replace( '%user_profile_url%', $url, $content );
382
  $content = str_replace( '%user_profile_link%', '<a href="' . $url . '">' . $user->display_name . '</a>', $content );
383
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  //$content = str_replace( '', $user->, $content );
385
  unset( $user );
386
 
@@ -423,7 +446,7 @@ if ( !class_exists( 'myCRED_Settings' ) ) {
423
  }
424
 
425
  // Let others play first
426
- $content = apply_filters( 'mycred_parse_tags_comment', $content, $data, $comment );
427
  $content = $this->template_tags_general( $content );
428
 
429
  $content = str_replace( '%comment_id%', $comment->comment_ID, $content );
@@ -618,7 +641,7 @@ if ( !class_exists( 'myCRED_Settings' ) ) {
618
  * @version 1.0
619
  */
620
  public function get_cred_id() {
621
- if ( !isset( $this->cred_id ) )
622
  $this->cred_id = 'mycred_default';
623
 
624
  return $this->cred_id;
@@ -681,7 +704,7 @@ if ( !class_exists( 'myCRED_Settings' ) ) {
681
  * @param $ref (string), required reference id
682
  * @param $user_id (int), required id of the user who will get these points
683
  * @param $cred (int|float), required number of creds to give or deduct from the given user.
684
- * @param $ref_id (array), optional array of reference IDs allowing the use of content specific keywords in the log entry
685
  * @param $data (object|array|string|int), optional extra data to save in the log. Note that arrays gets serialized!
686
  * @param $type (string), optional point name, defaults to 'mycred_default'
687
  * @returns boolean true on success or false on fail
@@ -706,7 +729,10 @@ if ( !class_exists( 'myCRED_Settings' ) ) {
706
  // true (boolean) - "Yes" let myCRED add points and log the event
707
  if ( $execute === true ) {
708
  $this->update_users_balance( $user_id, $amount );
709
- $this->add_to_log( $ref, $user_id, $amount, $entry, $ref_id, $data, $type );
 
 
 
710
  return true;
711
  }
712
  // done (string) - "Already done"
@@ -961,6 +987,19 @@ if ( !function_exists( 'mycred_get_users_fcred' ) ) {
961
  }
962
  }
963
 
 
 
 
 
 
 
 
 
 
 
 
 
 
964
  /**
965
  * Add Creds
966
  * Adds creds to a given user. A refernece ID, user id and amount must be given.
@@ -1009,47 +1048,31 @@ if ( !function_exists( 'mycred_subtract' ) ) {
1009
  }
1010
 
1011
  /**
1012
- * My Balance Shortcode
1013
- * Returns the current users balance.
1014
- * @see http://mycred.me/shortcodes/mycred_my_balance/
1015
- * @since 1.0.9
 
 
 
1016
  * @version 1.0
1017
  */
1018
- if ( !function_exists( 'mycred_render_my_balance' ) ) {
1019
- function mycred_render_my_balance( $atts )
1020
  {
1021
- extract( shortcode_atts( array(
1022
- 'login' => NULL,
1023
- 'title' => '',
1024
- 'title_el' => 'h1',
1025
- 'balance_el' => 'div'
1026
- ), $atts ) );
1027
-
1028
- // Not logged in
1029
- if ( !is_user_logged_in() ) {
1030
- if ( $login != NULL )
1031
- return '<div class="mycred-not-logged-in">' . $login . '</div>';
1032
-
1033
- return;
1034
- }
1035
 
1036
- $user_id = get_current_user_id();
1037
- $mycred = mycred_get_settings();
1038
- if ( $mycred->exclude_user( $user_id ) ) return;
1039
 
1040
- $output = '<div class="mycred-my-balance-wrapper">';
1041
-
1042
- // Title
1043
- if ( !empty( $title ) ) {
1044
- $output .= '<' . $title_el . '>' . $title . '</' . $title_el . '>';
 
1045
  }
1046
 
1047
- // Balance
1048
- $balance = $mycred->get_users_cred( $user_id );
1049
- $output .= '<' . $balance_el . '>' . $mycred->format_creds( $balance ) . '</' . $balance_el . '>';
1050
- $output .= '</div>';
1051
-
1052
- return $output;
1053
  }
1054
  }
1055
  ?>
25
  $this->$key = $value;
26
  }
27
  }
28
+
29
+ $this->db_name = 'myCRED_log';
30
  }
31
 
32
  /**
179
  * @param $rate (int|float) the exchange rate to devide by
180
  * @param $round (bool) option to round values, defaults to yes.
181
  * @since 0.1
182
+ * @version 1.2
183
  */
184
  public function apply_exchange_rate( $amount, $rate = 1, $round = true ) {
185
  $amount = $this->number( $amount );
186
+ if ( !is_numeric( $rate ) || $rate == 1 ) return $amount;
187
 
188
  $exchange = $amount/(float) $rate;
189
  if ( $round ) $exchange = round( $exchange );
245
  $content = apply_filters( 'mycred_parse_tags_general', $content );
246
 
247
  // Singular
248
+ $content = str_replace( array( '%singular%', '%Singular%' ), $this->singular(), $content );
 
249
  $content = str_replace( '%_singular%', strtolower( $this->singular() ), $content );
250
 
251
  // Plural
252
+ $content = str_replace( array( '%plural%', '%Plural%' ), $this->plural(), $content );
 
253
  $content = str_replace( '%_plural%', strtolower( $this->plural() ), $content );
254
 
255
  // Login URL
262
 
263
  // Blog Related
264
  $content = str_replace( '%num_members%', $this->count_members(), $content );
265
+ $content = str_replace( '%blog_name%', get_bloginfo( 'name' ), $content );
266
+ $content = str_replace( '%blog_url%', get_bloginfo( 'url' ), $content );
267
+ $content = str_replace( '%blog_info%', get_bloginfo( 'description' ), $content );
268
+ $content = str_replace( '%admin_email%', get_bloginfo( 'admin_email' ), $content );
269
 
270
  //$content = str_replace( '', , $content );
271
  return $content;
318
  }
319
 
320
  // Let others play first
321
+ $content = apply_filters( 'mycred_parse_tags_post', $content, $post, $data );
322
  $content = $this->template_tags_general( $content );
323
 
324
  // Replace template tags
347
  * @param $data (object) Log entry data object
348
  * @return (string) parsed string
349
  * @since 0.1
350
+ * @version 1.0.3
351
  */
352
  public function template_tags_user( $content, $ref_id = NULL, $data = '' ) {
353
  if ( $ref_id === NULL ) return $content;
360
  if ( !is_array( $data ) || !array_key_exists( 'ID', $data ) ) return $content;
361
  $user = new StdClass();
362
  foreach ( $data as $key => $value ) {
363
+ if ( $key == 'login' )
364
+ $user->user_login = $value;
365
+ else
366
+ $user->$key = $value;
367
  }
368
  }
369
 
370
  // Let others play first
371
+ $content = apply_filters( 'mycred_parse_tags_user', $content, $user, $data );
372
  $content = $this->template_tags_general( $content );
373
 
374
  // Replace template tags
388
  $content = str_replace( '%user_profile_url%', $url, $content );
389
  $content = str_replace( '%user_profile_link%', '<a href="' . $url . '">' . $user->display_name . '</a>', $content );
390
 
391
+ $content = str_replace( '%user_nicename%', ( isset( $user->user_nicename ) ) ? $user->user_nicename : '', $content );
392
+ $content = str_replace( '%nickname%', ( isset( $user->nickname ) ) ? $user->nickname : '', $content );
393
+ $content = str_replace( '%user_email%', ( isset( $user->user_email ) ) ? $user->user_email : '', $content );
394
+ $content = str_replace( '%user_url%', ( isset( $user->user_url ) ) ? $user->user_url : '', $content );
395
+
396
+ // Account Related
397
+ $balance = $this->get_users_cred( $user->ID );
398
+ $content = str_replace( '%balance%', $balance, $content );
399
+ $content = str_replace( '%balance_f%', $this->format_creds( $balance ), $content );
400
+
401
+ // Ranking
402
+ if ( !function_exists( 'mycred_get_users_rank' ) )
403
+ $content = str_replace( array( '%rank%', '%ranking%' ), mycred_rankings_position( $user->ID ), $content );
404
+ else
405
+ $content = str_replace( '%ranking%', mycred_rankings_position( $user->ID ), $content );
406
+
407
  //$content = str_replace( '', $user->, $content );
408
  unset( $user );
409
 
446
  }
447
 
448
  // Let others play first
449
+ $content = apply_filters( 'mycred_parse_tags_comment', $content, $comment, $data );
450
  $content = $this->template_tags_general( $content );
451
 
452
  $content = str_replace( '%comment_id%', $comment->comment_ID, $content );
641
  * @version 1.0
642
  */
643
  public function get_cred_id() {
644
+ if ( !isset( $this->cred_id ) || empty( $this->cred_id ) )
645
  $this->cred_id = 'mycred_default';
646
 
647
  return $this->cred_id;
704
  * @param $ref (string), required reference id
705
  * @param $user_id (int), required id of the user who will get these points
706
  * @param $cred (int|float), required number of creds to give or deduct from the given user.
707
+ * @param $ref_id (int), optional array of reference IDs allowing the use of content specific keywords in the log entry
708
  * @param $data (object|array|string|int), optional extra data to save in the log. Note that arrays gets serialized!
709
  * @param $type (string), optional point name, defaults to 'mycred_default'
710
  * @returns boolean true on success or false on fail
729
  // true (boolean) - "Yes" let myCRED add points and log the event
730
  if ( $execute === true ) {
731
  $this->update_users_balance( $user_id, $amount );
732
+ // Only admins can have empty log entries which do not add a log entry
733
+ if ( ( $this->can_edit_plugin() && empty( $entry ) ) === false )
734
+ $this->add_to_log( $ref, $user_id, $amount, $entry, $ref_id, $data, $type );
735
+
736
  return true;
737
  }
738
  // done (string) - "Already done"
987
  }
988
  }
989
 
990
+ /**
991
+ * Flush Widget Cache
992
+ * @since 0.1
993
+ * @version 1.0
994
+ */
995
+ if ( !function_exists( 'mycred_flush_widget_cache' ) ) {
996
+ function mycred_flush_widget_cache( $id = NULL )
997
+ {
998
+ if ( $id === NULL ) return;
999
+ wp_cache_delete( $id, 'widget' );
1000
+ }
1001
+ }
1002
+
1003
  /**
1004
  * Add Creds
1005
  * Adds creds to a given user. A refernece ID, user id and amount must be given.
1048
  }
1049
 
1050
  /**
1051
+ * Count Reference Instances
1052
+ * Counts the total number of occurrences of a specific reference for a user.
1053
+ * @see http://mycred.me/functions/mycred_count_ref_instances/
1054
+ * @param $reference (string) required reference to check
1055
+ * @param $user_id (int) option to check references for a specific user
1056
+ * @uses get_var()
1057
+ * @since 1.1
1058
  * @version 1.0
1059
  */
1060
+ if ( !function_exists( 'mycred_count_ref_instances' ) ) {
1061
+ function mycred_count_ref_instances( $reference = '', $user_id = NULL )
1062
  {
1063
+ if ( empty( $reference ) ) return 999999999;
 
 
 
 
 
 
 
 
 
 
 
 
 
1064
 
1065
+ global $wpdb;
 
 
1066
 
1067
+ if ( $user_id !== NULL ) {
1068
+ return $wpdb->get_var( $wpdb->prepare(
1069
+ "SELECT COUNT(*) FROM " . $wpdb->prefix . 'myCRED_log' . " WHERE ref = %s AND user_id = %d",
1070
+ $reference,
1071
+ $user_id
1072
+ ) );
1073
  }
1074
 
1075
+ return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM " . $wpdb->prefix . 'myCRED_log' . " WHERE ref = %s", $reference ) );
 
 
 
 
 
1076
  }
1077
  }
1078
  ?>
includes/mycred-install.php CHANGED
@@ -160,8 +160,37 @@ if ( !class_exists( 'myCRED_Install' ) ) {
160
  if ( is_multisite() ) {
161
  delete_site_option( 'mycred_network' );
162
  }
 
 
 
163
  // Good bye.
164
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  }
166
  }
167
  /**
@@ -366,7 +395,7 @@ if ( !class_exists( 'myCRED_Setup' ) ) {
366
  <div id="icon-myCRED" class="icon32"><br /></div>
367
  <h2><?php
368
 
369
- echo '<strong>my</strong>CRED ' . __( 'Setup', 'mycred' );
370
  if ( $this->step !== false )
371
  echo ' <span>' . __( 'Step', 'mycred' ) . ' ' . $this->step . ' / 3'; ?></span></h2>
372
  <?php // Get View
160
  if ( is_multisite() ) {
161
  delete_site_option( 'mycred_network' );
162
  }
163
+
164
+ // Delete custom post types
165
+ $this->delete_post_types();
166
  // Good bye.
167
  }
168
+
169
+ /**
170
+ * Delete Custom Post Types
171
+ * Removed custom post types created by myCRED.
172
+ * @since 1.1
173
+ * @version 1.0
174
+ */
175
+ public function delete_post_types() {
176
+ $post_types = apply_filters( 'mycred_custom_post_types', array( 'mycred_rank', 'mycred_email_notice' ) );
177
+ if ( !is_array( $post_types ) ) return;
178
+
179
+ foreach ( $post_types as $post_type ) {
180
+ $args = array(
181
+ 'post_type' => $post_type,
182
+ 'posts_per_page' => '-1',
183
+ 'post_status' => 'any',
184
+ 'fields' => 'ids'
185
+ );
186
+ $query = new WP_Query( $args );
187
+ if ( $query->have_posts() ) {
188
+ foreach ( $query->posts as $post_id ) {
189
+ wp_delete_post( $post_id, true );
190
+ }
191
+ }
192
+ }
193
+ }
194
  }
195
  }
196
  /**
395
  <div id="icon-myCRED" class="icon32"><br /></div>
396
  <h2><?php
397
 
398
+ echo '<strong>my</strong>CRED' . ' ' . __( 'Setup', 'mycred' );
399
  if ( $this->step !== false )
400
  echo ' <span>' . __( 'Step', 'mycred' ) . ' ' . $this->step . ' / 3'; ?></span></h2>
401
  <?php // Get View
includes/mycred-network.php CHANGED
@@ -120,18 +120,19 @@ if ( !class_exists( 'myCRED_Network' ) ) {
120
  'master' => 0,
121
  'block' => ''
122
  );
123
- $prefs = get_site_option( 'mycred_network', $defaults, false ); ?>
 
124
 
125
  <div class="wrap" id="myCRED-wrap">
126
  <div id="icon-myCRED" class="icon32"><br /></div>
127
- <h2><strong>my</strong>CRED <?php _e( 'Network', 'mycred' ); ?></h2>
128
  <?php
129
 
130
  // Settings Updated
131
  if ( isset( $mycred_network['update'] ) )
132
  echo '<div class="updated"><p>' . __( 'Network Settings Updated', 'mycred' ) . '</p></div>'; ?>
133
 
134
- <p><?php _e( 'Configure network settings for <strong>my</strong>CRED.', 'mycred' ); ?></p>
135
  <form method="post" action="" class="">
136
  <input type="hidden" name="mycred-token" value="<?php echo wp_create_nonce( 'mycred' ); ?>" />
137
  <div class="list-items expandable-li" id="accordion">
@@ -148,14 +149,14 @@ if ( !class_exists( 'myCRED_Network' ) ) {
148
  <label for="myCRED-network-"><?php _e( 'No', 'mycred' ); ?></label>
149
  </li>
150
  <li>
151
- <p class="description"><?php _e( 'If enabled, your main site\'s <strong>my</strong>CRED setup will be used for all other sites.', 'mycred' ); ?></p>
152
  </li>
153
  </ol>
154
  <label class="subheader"><?php _e( 'Site Block', 'mycred' ); ?></label>
155
  <ol id="myCRED-network-">
156
  <li>
157
  <div class="h2"><input type="text" name="mycred_network[block]" id="myCRED-network-block" value="<?php echo $prefs['block']; ?>" class="long" /></div>
158
- <span class="description"><?php _e( 'Comma separated list of blog ids where <strong>my</strong>CRED is to be disabled.', 'mycred' ); ?></span>
159
  </li>
160
  </ol>
161
  <?php do_action( 'mycred_network_prefs', $this ); ?>
120
  'master' => 0,
121
  'block' => ''
122
  );
123
+ $prefs = get_site_option( 'mycred_network', $defaults, false );
124
+ $name = apply_filters( 'mycred_label', myCRED_NAME ); ?>
125
 
126
  <div class="wrap" id="myCRED-wrap">
127
  <div id="icon-myCRED" class="icon32"><br /></div>
128
+ <h2> <?php echo $name . ' ' . __( 'Network', 'mycred' ); ?></h2>
129
  <?php
130
 
131
  // Settings Updated
132
  if ( isset( $mycred_network['update'] ) )
133
  echo '<div class="updated"><p>' . __( 'Network Settings Updated', 'mycred' ) . '</p></div>'; ?>
134
 
135
+ <p><?php echo sprintf( __( 'Configure network settings for %s.', 'mycred' ), $name ); ?></p>
136
  <form method="post" action="" class="">
137
  <input type="hidden" name="mycred-token" value="<?php echo wp_create_nonce( 'mycred' ); ?>" />
138
  <div class="list-items expandable-li" id="accordion">
149
  <label for="myCRED-network-"><?php _e( 'No', 'mycred' ); ?></label>
150
  </li>
151
  <li>
152
+ <p class="description"><?php echo sprintf( __( 'If enabled, your main site\'s %s setup will be used for all other sites.', 'mycred' ), $name ); ?></p>
153
  </li>
154
  </ol>
155
  <label class="subheader"><?php _e( 'Site Block', 'mycred' ); ?></label>
156
  <ol id="myCRED-network-">
157
  <li>
158
  <div class="h2"><input type="text" name="mycred_network[block]" id="myCRED-network-block" value="<?php echo $prefs['block']; ?>" class="long" /></div>
159
+ <span class="description"><?php echo sprintf( __( 'Comma separated list of blog ids where %s is to be disabled.', 'mycred' ), $name ); ?></span>
160
  </li>
161
  </ol>
162
  <?php do_action( 'mycred_network_prefs', $this ); ?>
includes/mycred-rankings.php CHANGED
@@ -30,7 +30,7 @@ if ( !class_exists( 'myCRED_Rankings' ) ) {
30
  'order' => 'DESC',
31
  'allowed_tags' => '',
32
  'meta_key' => $mycred->get_cred_id(),
33
- 'template' => '#%rank% %user_profile_link% %cred_f%'
34
  ) );
35
  $this->frequency = 12 * HOUR_IN_SECONDS;
36
 
@@ -179,7 +179,7 @@ if ( !class_exists( 'myCRED_Rankings' ) ) {
179
  */
180
  public function get_display() {
181
  // Default template
182
- if ( empty( $this->args['template'] ) ) $this->args['template'] = '#%rank% %user_profile_link% %cred_f%';
183
 
184
  // Organized list
185
  $output = '<ol class="myCRED-leaderboard">';
@@ -201,7 +201,6 @@ if ( !class_exists( 'myCRED_Rankings' ) ) {
201
  // Template Tags
202
  $layout = str_replace( '%rank%', $position+1, $this->args['template'] );
203
 
204
- $layout = $this->core->template_tags_general( $layout );
205
  $layout = $this->core->template_tags_amount( $layout, $row['creds'] );
206
  $layout = $this->core->template_tags_user( $layout, $row['user_id'], $row );
207
 
@@ -264,26 +263,6 @@ if ( !function_exists( 'mycred_rankings_position' ) ) {
264
  }
265
  }
266
 
267
- /**
268
- * Render Leaderboard Shortcode
269
- * @since 0.1
270
- * @version 1.0
271
- */
272
- if ( !function_exists( 'mycred_render_leaderboard' ) ) {
273
- function mycred_render_leaderboard( $attr, $content ) {
274
- if ( !isset( $attr['template'] ) ) $attr['template'] = $content;
275
- $rankings = mycred_rankings( $attr );
276
-
277
- // Have results
278
- if ( $rankings->have_results() )
279
- return $rankings->get_display();
280
-
281
- // No result template is set
282
- if ( isset( $attr['no-results'] ) && !empty( $attr['no-results'] ) )
283
- return $rankings->core->template_tags_general( $attr['no-results'] );
284
- }
285
- }
286
-
287
  /**
288
  * Force Leaderboard Update
289
  * @since 1.0.9.1
30
  'order' => 'DESC',
31
  'allowed_tags' => '',
32
  'meta_key' => $mycred->get_cred_id(),
33
+ 'template' => '#%ranking% %user_profile_link% %cred_f%'
34
  ) );
35
  $this->frequency = 12 * HOUR_IN_SECONDS;
36
 
179
  */
180
  public function get_display() {
181
  // Default template
182
+ if ( empty( $this->args['template'] ) ) $this->args['template'] = '#%ranking% %user_profile_link% %cred_f%';
183
 
184
  // Organized list
185
  $output = '<ol class="myCRED-leaderboard">';
201
  // Template Tags
202
  $layout = str_replace( '%rank%', $position+1, $this->args['template'] );
203
 
 
204
  $layout = $this->core->template_tags_amount( $layout, $row['creds'] );
205
  $layout = $this->core->template_tags_user( $layout, $row['user_id'], $row );
206
 
263
  }
264
  }
265
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  /**
267
  * Force Leaderboard Update
268
  * @since 1.0.9.1
includes/mycred-shortcodes.php ADDED
@@ -0,0 +1,287 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'myCRED_VERSION' ) ) exit;
3
+ /**
4
+ * myCRED Shortcode: my_balance
5
+ * Returns the current users balance.
6
+ * @see http://mycred.me/shortcodes/mycred_my_balance/
7
+ * @since 1.0.9
8
+ * @version 1.0
9
+ */
10
+ if ( !function_exists( 'mycred_render_shortcode_my_balance' ) ) {
11
+ function mycred_render_shortcode_my_balance( $atts, $content = NULL )
12
+ {
13
+ extract( shortcode_atts( array(
14
+ 'login' => NULL,
15
+ 'title' => '',
16
+ 'title_el' => 'h1',
17
+ 'balance_el' => 'div',
18
+ 'type' => ''
19
+ ), $atts ) );
20
+
21
+ // Not logged in
22
+ if ( !is_user_logged_in() ) {
23
+ if ( $login != NULL )
24
+ return '<div class="mycred-not-logged-in">' . $login . '</div>';
25
+
26
+ return;
27
+ }
28
+
29
+ $user_id = get_current_user_id();
30
+ $mycred = mycred_get_settings();
31
+ if ( $mycred->exclude_user( $user_id ) ) return;
32
+
33
+ if ( !empty( $type ) )
34
+ $mycred->cred_id = $type;
35
+
36
+ $output = '<div class="mycred-my-balance-wrapper">';
37
+
38
+ // Title
39
+ if ( !empty( $title ) ) {
40
+ $output .= '<' . $title_el . '>' . $title . '</' . $title_el . '>';
41
+ }
42
+
43
+ // Balance
44
+ $balance = $mycred->get_users_cred( $user_id );
45
+ $output .= '<' . $balance_el . '>' . $mycred->format_creds( $balance ) . '</' . $balance_el . '>';
46
+ $output .= '</div>';
47
+
48
+ return $output;
49
+ }
50
+ }
51
+
52
+ /**
53
+ * myCRED Shortcode: mycred_leaderboard
54
+ * @since 0.1
55
+ * @version 1.0
56
+ */
57
+ if ( !function_exists( 'mycred_render_leaderboard' ) ) {
58
+ function mycred_render_leaderboard( $atts, $content = NULL )
59
+ {
60
+ $attr = shortcode_atts( array(
61
+ 'number' => '-1',
62
+ 'offset' => 0,
63
+ 'order' => 'DESC',
64
+ 'template' => '',
65
+ 'type' => '',
66
+ 'nothing' => __( 'Leaderboard is empty.', 'mycred' )
67
+ ), $atts );
68
+
69
+ // Template can also be passed though the content
70
+ if ( empty( $attr['template'] ) && $content !== NULL )
71
+ $attr['template'] = do_shortcode( $content );
72
+
73
+ // Points type
74
+ if ( !empty( $attr['type'] ) ) {
75
+ $attr['meta_key'] = $attr['type'];
76
+ unset( $attr['type'] );
77
+ }
78
+
79
+ $rankings = mycred_rankings( $attr );
80
+
81
+ // Have results
82
+ if ( $rankings->have_results() )
83
+ return $rankings->get_display();
84
+
85
+ // No result template is set
86
+ if ( !empty( $attr['nothing'] ) )
87
+ return '<p class="mycred-leaderboard-none">' . $attr['nothing'] . '</p>';
88
+ }
89
+ }
90
+
91
+ /**
92
+ * myCRED Shortcode: mycred_my_ranking
93
+ * @since 0.1
94
+ * @version 1.1
95
+ */
96
+ if ( !function_exists( 'mycred_render_my_ranking' ) ) {
97
+ function mycred_render_my_ranking( $atts, $content )
98
+ {
99
+ extract( shortcode_atts( array(
100
+ 'user_id' => NULL
101
+ ), $atts ) );
102
+
103
+ // If no id is given
104
+ if ( $user_id === NULL ) {
105
+ // Current user must be logged in for this shortcode to work
106
+ if ( !is_user_logged_in() ) return;
107
+ // Get current user id
108
+ $user_id = get_current_user_id();
109
+ }
110
+
111
+ return mycred_rankings_position( $user_id );
112
+ }
113
+ }
114
+
115
+ /**
116
+ * myCRED Shortcode: mycred_give
117
+ * This shortcode allows you to award or deduct points from the current user
118
+ * when this shortcode is executed. You can insert this in page/post content
119
+ * or in a template file. Note that users are awarded/deducted points each time
120
+ * this shortcode exectutes!
121
+ * @see
122
+ * @since 1.1
123
+ * @version 1.0
124
+ */
125
+ if ( !function_exists( 'mycred_render_shortcode_give' ) ) {
126
+ function mycred_render_shortcode_give( $atts, $content )
127
+ {
128
+ if ( !is_user_logged_in() ) return;
129
+
130
+ extract( shortcode_atts( array(
131
+ 'amount' => NULL,
132
+ 'log' => '',
133
+ 'ref' => 'gift',
134
+ 'limit' => 0,
135
+ 'type' => 'mycred_default'
136
+ ), $atts ) );
137
+
138
+ if ( $amount === NULL )
139
+ return '<strong>' . apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . __( 'error', 'mycred' ) . '</strong> ' . __( 'Amount missing!', 'mycred' );
140
+
141
+ if ( empty( $log ) )
142
+ return '<strong>' . apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . __( 'error', 'mycred' ) . '</strong> ' . __( 'Log Template Missing!', 'mycred' );
143
+
144
+ $mycred = mycred_get_settings();
145
+ $user_id = get_current_user_id();
146
+
147
+ // Check for exclusion
148
+ if ( $mycred->exclude_user( $user_id ) ) return;
149
+
150
+ // Limit
151
+ $limit = abs( $limit );
152
+ if ( $limit != 0 && mycred_count_ref_instances( $ref, $user_id ) >= $limit ) return;
153
+
154
+ $amount = $mycred->number( $amount );
155
+ $mycred->add_creds(
156
+ $reference,
157
+ $user_id,
158
+ $amount,
159
+ $log,
160
+ '',
161
+ '',
162
+ $type
163
+ );
164
+ }
165
+ }
166
+
167
+ /**
168
+ * myCRED Shortcode: mycred_link
169
+ * This shortcode allows you to award or deduct points from the current user
170
+ * when their click on a link. The shortcode will generate an anchor element
171
+ * and call the mycred-click-link jQuery script which will award the points.
172
+ *
173
+ * Note! Only HTML5 anchor attributes are supported and this shortcode is only
174
+ * available if the hook is enabled!
175
+ *
176
+ * @see http://mycred.me/shortcodes/mycred_link/
177
+ * @since 1.1
178
+ * @version 1.0
179
+ */
180
+ if ( !function_exists( 'mycred_render_shortcode_link' ) ) {
181
+ function mycred_render_shortcode_link( $atts, $content )
182
+ {
183
+ global $mycred_link_points;
184
+
185
+ $atts = shortcode_atts( array(
186
+ 'id' => '',
187
+ 'rel' => '',
188
+ 'class' => '',
189
+ 'href' => '',
190
+ 'title' => '',
191
+ 'target' => '',
192
+ 'style' => '',
193
+ 'amount' => 0,
194
+ 'hreflang' => '', // for advanced users
195
+ 'media' => '', // for advanced users
196
+ 'type' => '' // for advanced users
197
+ ), $atts );
198
+
199
+ // HREF is required
200
+ if ( empty( $atts['href'] ) )
201
+ return '<strong>' . apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . __( 'error', 'mycred' ) . '</strong> ' . __( 'Anchor missing URL!', 'mycred' );
202
+
203
+ // All links must contain the 'mycred-points-link' class
204
+ if ( empty( $atts['class'] ) )
205
+ $atts['class'] = 'mycred-points-link';
206
+ else
207
+ $atts['class'] = 'mycred-points-link ' . $atts['class'];
208
+
209
+ // Construct anchor attributes
210
+ $attr = array();
211
+ foreach ( $atts as $attribute => $value ) {
212
+ if ( !empty( $value ) && $attribute != 'amount' ) {
213
+ $attr[] = $attribute . '="' . $value . '"';
214
+ }
215
+ }
216
+ // Add amount
217
+ $attr[] = 'data-amount="' . $atts['amount'] . '"';
218
+
219
+ // Make sure jQuery script is called
220
+ $mycred_link_points = true;
221
+
222
+ // Return result
223
+ return '<a ' . implode( ' ', $attr ) . '>' . $content . '</a>';
224
+ }
225
+ }
226
+
227
+ /**
228
+ * myCRED Shortcode: mycred_send
229
+ * This shortcode allows the current user to send a pre-set amount of points
230
+ * to a pre-set user. A simpler version of the mycred_transfer shortcode.
231
+ * @see
232
+ * @since 1.1
233
+ * @version 1.0
234
+ */
235
+ if ( !function_exists( 'mycred_render_shortcode_send' ) ) {
236
+ function mycred_render_shortcode_send( $atts, $content )
237
+ {
238
+ if ( !is_user_logged_in() ) return;
239
+
240
+ extract( shortcode_atts( array(
241
+ 'amount' => NULL,
242
+ 'to' => NULL,
243
+ 'log' => '',
244
+ 'ref' => 'gift',
245
+ 'type' => 'mycred_default'
246
+ ), $atts ) );
247
+
248
+ // Amount is required
249
+ if ( $amount === NULL )
250
+ return '<strong>' . apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . __( 'error', 'mycred' ) . '</strong> ' . __( 'Amount missing!', 'mycred' );
251
+
252
+ // Recipient is required
253
+ if ( empty( $to ) )
254
+ return '<strong>' . apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . __( 'error', 'mycred' ) . '</strong> ' . __( 'User ID missing for recipient.', 'mycred' );
255
+
256
+ // Log template is required
257
+ if ( empty( $log ) )
258
+ return '<strong>' . apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . __( 'error', 'mycred' ) . '</strong> ' . __( 'Log Template Missing!', 'mycred' );
259
+
260
+ if ( $to == 'author' ) {
261
+ // You can not use this outside the loop
262
+ if ( !is_single() ) return;
263
+ $to = $GLOBALS['post']->post_author;
264
+ }
265
+
266
+ global $mycred_sending_points;
267
+
268
+ $mycred = mycred_get_settings();
269
+ $user_id = get_current_user_id();
270
+
271
+ // Make sure current user or recipient is not excluded!
272
+ if ( $mycred->exclude_user( $to ) || $mycred->exclude_user( $user_id ) ) return;
273
+
274
+ $account_limit = (int) apply_filters( 'mycred_transfer_acc_limit', 0 );
275
+ $balance = $mycred->get_users_cred( $user_id );
276
+ $amount = $mycred->number( $amount );
277
+
278
+ // Insufficient Funds
279
+ if ( $balance-$amount < $account_limit ) return;
280
+
281
+ // We are ready!
282
+ $mycred_sending_points = true;
283
+
284
+ return '<input type="button" class="mycred-send-points-button" data-to="' . $to . '" data-ref="' . $ref . '" data-log="' . $log . '" data-amount="' . $amount . '" data-type="' . $type . '" value="' . $mycred->template_tags_general( $content ) . '" />';
285
+ }
286
+ }
287
+ ?>
includes/mycred-widgets.php CHANGED
@@ -12,12 +12,13 @@ if ( !class_exists( 'myCRED_Widget_Balance' ) ) {
12
  * Construct
13
  */
14
  function myCRED_Widget_Balance() {
 
15
  // Basic details about our widget
16
  $widget_ops = array(
17
  'classname' => 'widget-my-cred',
18
- 'description' => __( 'Show the current users myCRED balance', 'mycred' )
19
  );
20
- $this->WP_Widget( 'mycred_widget_balance', __( 'myCRED Balance', 'mycred' ), $widget_ops );
21
  $this->alt_option_name = 'mycred_widget_balance';
22
  }
23
 
@@ -58,7 +59,15 @@ if ( !class_exists( 'myCRED_Widget_Balance' ) ) {
58
 
59
  // Include Ranking
60
  if ( $instance['show_rank'] ) {
61
- $ranking = str_replace( '%rank%', mycred_rankings_position( $user_id ), $instance['rank_format'] );
 
 
 
 
 
 
 
 
62
  $ranking = '<div class="myCRED-rank">' . $ranking . '</div>';
63
  $layout .= $ranking;
64
  }
@@ -152,7 +161,7 @@ if ( !class_exists( 'myCRED_Widget_Balance' ) ) {
152
  $history_length = isset( $instance['number'] ) ? abs( $instance['number'] ) : 5;
153
 
154
  $show_rank = isset( $instance['show_rank'] ) ? $instance['show_rank'] : 0;
155
- $rank_format = isset( $instance['rank_format'] ) ? $instance['rank_format'] : '#%rank%';
156
  $show_visitors = isset( $instance['show_visitors'] ) ? $instance['show_visitors'] : 0;
157
  $message = isset( $instance['message'] ) ? esc_attr( $instance['message'] ) : __( '<a href="%login_url_here%">Login</a> to view your balance.', 'mycred' );
158
 
@@ -187,9 +196,9 @@ if ( !class_exists( 'myCRED_Widget_Balance' ) ) {
187
  <input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'show_rank' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'show_rank' ) ); ?>" value="1"<?php checked( $show_rank, true ); ?> class="checkbox" />
188
  <label for="<?php echo esc_attr( $this->get_field_id( 'show_rank' ) ); ?>"><?php _e( 'Include users ranking', 'mycred' ); ?></label><br />
189
  <span class="mycred-hidden<?php echo $rank_format_class; ?>">
190
- <label for="<?php echo esc_attr( $this->get_field_id( 'rank_format' ) ); ?>"><?php _e( 'Rank format', 'mycred' ); ?>:</label>
191
  <input id="<?php echo esc_attr( $this->get_field_id( 'rank_format' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'rank_format' ) ); ?>" type="text" value="<?php echo $rank_format; ?>" class="widefat" /><br />
192
- <small><?php _e( 'This will be appended after their balance. See the help tab for available template tags.', 'mycred' ); ?></small>
193
  </span>
194
  </p>
195
  <!-- History -->
@@ -247,7 +256,8 @@ if ( !class_exists( 'myCRED_Widget_Balance' ) ) {
247
  $instance['cred_format'] = trim( $new_instance['cred_format'] );
248
 
249
  $instance['show_rank'] = (bool) $new_instance['show_rank'];
250
- $instance['rank_format'] = trim( $new_instance['rank_format'] );
 
251
 
252
  $instance['show_history'] = (bool) $new_instance['show_history'];
253
  $instance['history_title'] = trim( $new_instance['history_title'] );
@@ -275,12 +285,13 @@ if ( !class_exists( 'myCRED_Widget_List' ) ) {
275
  * Construct
276
  */
277
  function myCRED_Widget_List() {
 
278
  // Basic details about our widget
279
  $widget_ops = array(
280
  'classname' => 'widget-mycred-list',
281
- 'description' => __( 'Show a list of users sorted by their myCRED balance', 'mycred' )
282
  );
283
- $this->WP_Widget( 'mycred_widget_list', __( 'myCRED List', 'mycred' ), $widget_ops );
284
  $this->alt_option_name = 'mycred_widget_list';
285
  }
286
 
@@ -295,7 +306,18 @@ if ( !class_exists( 'myCRED_Widget_List' ) ) {
295
  if ( !$instance['show_visitors'] && !is_user_logged_in() ) return;
296
 
297
  // Get Rankings
298
- $rankings = mycred_rankings( array( 'number' => $instance['number'], 'template' => $instance['text'] ) );
 
 
 
 
 
 
 
 
 
 
 
299
  if ( $rankings->have_results() ) {
300
  // Settings
301
  $mycred = mycred_get_settings();
@@ -326,7 +348,9 @@ if ( !class_exists( 'myCRED_Widget_List' ) ) {
326
  $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : __( 'Leaderboard', 'mycred' );
327
  $number = isset( $instance['number'] ) ? abs( $instance['number'] ) : 5;
328
  $show_visitors = isset( $instance['show_visitors'] ) ? 1 : 0;
329
- $text = isset( $instance['text'] ) ? esc_attr( $instance['text'] ) : '#%rank% %user_profile_link% %cred_f%'; ?>
 
 
330
 
331
  <p class="myCRED-widget-field">
332
  <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'mycred' ); ?>:</label>
@@ -345,6 +369,28 @@ if ( !class_exists( 'myCRED_Widget_List' ) ) {
345
  <textarea class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'text' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'text' ) ); ?>" rows="3"><?php echo esc_attr( $text ); ?></textarea>
346
  <small><?php _e( 'See the help tab for available template tags.', 'mycred' ); ?></small>
347
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
  <?php
349
  }
350
 
@@ -356,21 +402,16 @@ if ( !class_exists( 'myCRED_Widget_List' ) ) {
356
  $instance['number'] = (int) $new_instance['number'];
357
  $instance['title'] = trim( $new_instance['title'] );
358
  $instance['show_visitors'] = $new_instance['show_visitors'];
359
- $instance['text'] = $new_instance['text'];
 
 
 
 
 
360
 
361
  mycred_flush_widget_cache( 'mycred_widget_list' );
362
  return $instance;
363
  }
364
  }
365
  }
366
- /**
367
- * Flush Widget Cache
368
- * @since 0.1
369
- * @version 1.0
370
- */
371
- function mycred_flush_widget_cache( $id = NULL )
372
- {
373
- if ( $id === NULL ) return;
374
- wp_cache_delete( $id, 'widget' );
375
- }
376
  ?>
12
  * Construct
13
  */
14
  function myCRED_Widget_Balance() {
15
+ $name = apply_filters( 'mycred_label', myCRED_NAME );
16
  // Basic details about our widget
17
  $widget_ops = array(
18
  'classname' => 'widget-my-cred',
19
+ 'description' => sprintf( __( 'Show the current users %s balance', 'mycred' ), strip_tags( $name ) )
20
  );
21
+ $this->WP_Widget( 'mycred_widget_balance', sprintf( __( '%s Balance', 'mycred' ), $name ), $widget_ops );
22
  $this->alt_option_name = 'mycred_widget_balance';
23
  }
24
 
59
 
60
  // Include Ranking
61
  if ( $instance['show_rank'] ) {
62
+ if ( function_exists( 'mycred_get_users_rank' ) ) {
63
+ $rank_name = mycred_get_users_rank( $user_id );
64
+ $ranking = str_replace( '%rank%', $rank_name, $instance['rank_format'] );
65
+ $ranking = str_replace( '%rank_logo%', mycred_get_rank_logo( $rank_name ), $ranking );
66
+ $ranking = str_replace( '%ranking%', mycred_rankings_position( $user_id ), $ranking );
67
+ }
68
+ else {
69
+ $ranking = str_replace( array( '%rank%', '%ranking%' ), mycred_rankings_position( $user_id ), $instance['rank_format'] );
70
+ }
71
  $ranking = '<div class="myCRED-rank">' . $ranking . '</div>';
72
  $layout .= $ranking;
73
  }
161
  $history_length = isset( $instance['number'] ) ? abs( $instance['number'] ) : 5;
162
 
163
  $show_rank = isset( $instance['show_rank'] ) ? $instance['show_rank'] : 0;
164
+ $rank_format = isset( $instance['rank_format'] ) ? $instance['rank_format'] : '#%ranking%';
165
  $show_visitors = isset( $instance['show_visitors'] ) ? $instance['show_visitors'] : 0;
166
  $message = isset( $instance['message'] ) ? esc_attr( $instance['message'] ) : __( '<a href="%login_url_here%">Login</a> to view your balance.', 'mycred' );
167
 
196
  <input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'show_rank' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'show_rank' ) ); ?>" value="1"<?php checked( $show_rank, true ); ?> class="checkbox" />
197
  <label for="<?php echo esc_attr( $this->get_field_id( 'show_rank' ) ); ?>"><?php _e( 'Include users ranking', 'mycred' ); ?></label><br />
198
  <span class="mycred-hidden<?php echo $rank_format_class; ?>">
199
+ <label for="<?php echo esc_attr( $this->get_field_id( 'rank_format' ) ); ?>"><?php _e( 'Format', 'mycred' ); ?>:</label>
200
  <input id="<?php echo esc_attr( $this->get_field_id( 'rank_format' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'rank_format' ) ); ?>" type="text" value="<?php echo $rank_format; ?>" class="widefat" /><br />
201
+ <small><?php _e( 'This will be appended after the balance. See the help tab for available template tags.', 'mycred' ); ?></small>
202
  </span>
203
  </p>
204
  <!-- History -->
256
  $instance['cred_format'] = trim( $new_instance['cred_format'] );
257
 
258
  $instance['show_rank'] = (bool) $new_instance['show_rank'];
259
+ $rank_format = trim( $new_instance['rank_format'] );
260
+ $instance['rank_format'] = str_replace( '%rank%', '%ranking%', $rank_format );
261
 
262
  $instance['show_history'] = (bool) $new_instance['show_history'];
263
  $instance['history_title'] = trim( $new_instance['history_title'] );
285
  * Construct
286
  */
287
  function myCRED_Widget_List() {
288
+ $name = apply_filters( 'mycred_label', myCRED_NAME );
289
  // Basic details about our widget
290
  $widget_ops = array(
291
  'classname' => 'widget-mycred-list',
292
+ 'description' => sprintf( __( 'Show a list of users sorted by their %s balance', 'mycred' ), strip_tags( $name ) )
293
  );
294
+ $this->WP_Widget( 'mycred_widget_list', sprintf( __( '%s List', 'mycred' ), $name ), $widget_ops );
295
  $this->alt_option_name = 'mycred_widget_list';
296
  }
297
 
306
  if ( !$instance['show_visitors'] && !is_user_logged_in() ) return;
307
 
308
  // Get Rankings
309
+ $args = array(
310
+ 'number' => $instance['number'],
311
+ 'template' => $instance['text']
312
+ );
313
+
314
+ if ( isset( $instance['order'] ) )
315
+ $args['order'] = $instance['order'];
316
+
317
+ if ( isset( $instance['offset'] ) )
318
+ $args['offset'] = $instance['offset'];
319
+
320
+ $rankings = mycred_rankings( $args );
321
  if ( $rankings->have_results() ) {
322
  // Settings
323
  $mycred = mycred_get_settings();
348
  $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : __( 'Leaderboard', 'mycred' );
349
  $number = isset( $instance['number'] ) ? abs( $instance['number'] ) : 5;
350
  $show_visitors = isset( $instance['show_visitors'] ) ? 1 : 0;
351
+ $text = isset( $instance['text'] ) ? esc_attr( $instance['text'] ) : '#%ranking% %user_profile_link% %cred_f%';
352
+ $offset = isset( $instance['offset'] ) ? esc_attr( $instance['offset'] ) : 0;
353
+ $order = isset( $instance['order'] ) ? esc_attr( $instance['order'] ) : 'DESC'; ?>
354
 
355
  <p class="myCRED-widget-field">
356
  <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'mycred' ); ?>:</label>
369
  <textarea class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'text' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'text' ) ); ?>" rows="3"><?php echo esc_attr( $text ); ?></textarea>
370
  <small><?php _e( 'See the help tab for available template tags.', 'mycred' ); ?></small>
371
  </p>
372
+ <p class="myCRED-widget-field">
373
+ <label for="<?php echo esc_attr( $this->get_field_id( 'offset' ) ); ?>"><?php _e( 'Offset', 'mycred' ); ?>:</label>
374
+ <input id="<?php echo esc_attr( $this->get_field_id( 'offset' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'offset' ) ); ?>" type="text" value="<?php echo $offset; ?>" size="3" class="align-right" /><br />
375
+ <small><?php _e( 'Optional offset of order. Use zero to return the first in the list.', 'mycred' ); ?></small>
376
+ </p>
377
+ <p class="myCRED-widget-field">
378
+ <label for="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>"><?php _e( 'Order', 'mycred' ); ?>:</label>
379
+ <select name="<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>">
380
+ <?php
381
+ $options = array(
382
+ 'ASC' => __( 'Ascending', 'mycred' ),
383
+ 'DESC' => __( 'Descending', 'mycred' )
384
+ );
385
+ foreach ( $options as $value => $label ) {
386
+ echo '<option value="' . $value . '"';
387
+ if ( $order == $value ) echo ' selected="selected"';
388
+ echo '>' . $label . '</option>';
389
+ }
390
+ ?>
391
+
392
+ </select>
393
+ </p>
394
  <?php
395
  }
396
 
402
  $instance['number'] = (int) $new_instance['number'];
403
  $instance['title'] = trim( $new_instance['title'] );
404
  $instance['show_visitors'] = $new_instance['show_visitors'];
405
+
406
+ $rank_format = trim( $new_instance['text'] );
407
+ $instance['text'] = str_replace( '%rank%', '%ranking%', $rank_format );
408
+
409
+ $instance['offset'] = $new_instance['offset'];
410
+ $instance['order'] = $new_instance['order'];
411
 
412
  mycred_flush_widget_cache( 'mycred_widget_list' );
413
  return $instance;
414
  }
415
  }
416
  }
 
 
 
 
 
 
 
 
 
 
417
  ?>
lang/mycred-en_US.mo CHANGED
Binary file
lang/mycred-en_US.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: myCRED v1.0.7\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2013-05-13 00:35:57+0000\n"
7
  "Last-Translator: unimatrix0 <gabriel.s@merovingi.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -51,16 +51,17 @@ msgstr ""
51
  #: addons/buddypress/hooks/bp-profile.php:387
52
  #: addons/buddypress/hooks/bp-profile.php:400
53
  #: addons/buddypress/hooks/bp-profile.php:413
54
- #: modules/mycred-module-hooks.php:289
55
- #: modules/mycred-module-hooks.php:533
56
- #: modules/mycred-module-hooks.php:546
57
- #: modules/mycred-module-hooks.php:581
58
- #: modules/mycred-module-hooks.php:803
59
- #: modules/mycred-module-hooks.php:815
60
- #: modules/mycred-module-hooks.php:827
61
- #: modules/mycred-module-hooks.php:962
62
- #: modules/mycred-module-hooks.php:983
63
- #: modules/mycred-module-hooks.php:1117
 
64
  #: modules/mycred-module-subscriptions.php:486
65
  #: modules/mycred-module-subscriptions.php:499
66
  #@ mycred
@@ -222,8 +223,8 @@ msgid "%plural% for Sending Gift"
222
  msgstr ""
223
 
224
  #: addons/buddypress/myCRED-addon-buddypress.php:50
225
- #: modules/mycred-module-log.php:60
226
- #: modules/mycred-module-log.php:419
227
  #@ mycred
228
  msgid "My History"
229
  msgstr ""
@@ -234,179 +235,183 @@ msgstr ""
234
  msgid "%s's History"
235
  msgstr ""
236
 
237
- #: addons/buddypress/myCRED-addon-buddypress.php:371
238
  #, php-format
239
  #@ mycred
240
  msgid "%singular% Balance"
241
  msgstr ""
242
 
243
- #: addons/buddypress/myCRED-addon-buddypress.php:201
244
- #: modules/mycred-module-log.php:202
245
  #@ mycred
246
  msgid "All"
247
  msgstr ""
248
 
249
- #: addons/buddypress/myCRED-addon-buddypress.php:202
250
- #: modules/mycred-module-log.php:203
251
  #@ mycred
252
  msgid "Today"
253
  msgstr ""
254
 
255
- #: addons/buddypress/myCRED-addon-buddypress.php:203
256
- #: modules/mycred-module-log.php:204
257
  #@ mycred
258
  msgid "Yesterday"
259
  msgstr ""
260
 
261
- #: addons/buddypress/myCRED-addon-buddypress.php:204
262
- #: modules/mycred-module-log.php:205
263
  #@ mycred
264
  msgid "This Week"
265
  msgstr ""
266
 
267
- #: addons/buddypress/myCRED-addon-buddypress.php:205
268
- #: modules/mycred-module-log.php:206
269
  #@ mycred
270
  msgid "This Month"
271
  msgstr ""
272
 
273
- #: addons/buddypress/myCRED-addon-buddypress.php:329
274
  #@ default
275
  msgid "bbPress 2.0"
276
  msgstr ""
277
 
278
- #: addons/buddypress/myCRED-addon-buddypress.php:330
279
  #@ mycred
280
  msgid "Awards %_plural% for bbPress actions."
281
  msgstr ""
282
 
283
- #: addons/buddypress/myCRED-addon-buddypress.php:301
284
  #@ default
285
  msgid "BuddyPress: Groups"
286
  msgstr ""
287
 
288
- #: addons/buddypress/myCRED-addon-buddypress.php:302
289
  #@ mycred
290
  msgid "Awards %_plural% for group related actions. Use minus to deduct %_plural% or zero to disable a specific hook."
291
  msgstr ""
292
 
293
- #: addons/buddypress/myCRED-addon-buddypress.php:306
294
  #@ default
295
  msgid "BuddyPress: Members"
296
  msgstr ""
297
 
298
- #: addons/buddypress/myCRED-addon-buddypress.php:307
299
  #@ mycred
300
  msgid "Awards %_plural% for profile related actions."
301
  msgstr ""
302
 
303
- #: addons/buddypress/myCRED-addon-buddypress.php:313
304
  #@ default
305
  msgid "BuddyPress: Links"
306
  msgstr ""
307
 
308
- #: addons/buddypress/myCRED-addon-buddypress.php:314
309
  #@ mycred
310
  msgid "Awards %_plural% for link related actions."
311
  msgstr ""
312
 
313
- #: addons/buddypress/myCRED-addon-buddypress.php:321
314
  #@ default
315
  msgid "BuddyPress: Gallery Actions"
316
  msgstr ""
317
 
318
- #: addons/buddypress/myCRED-addon-buddypress.php:322
319
  #@ mycred
320
  msgid "Awards %_plural% for creating a new gallery either using BP Album+ or BP Gallery."
321
  msgstr ""
322
 
323
- #: addons/buddypress/myCRED-addon-buddypress.php:350
324
  #: addons/buddypress/myCRED-addon-buddypress.php:357
 
 
325
  #@ mycred
326
  msgid "Do not show."
327
  msgstr ""
328
 
329
- #: addons/buddypress/myCRED-addon-buddypress.php:351
 
330
  #@ mycred
331
  msgid "Include in Profile Header."
332
  msgstr ""
333
 
334
- #: addons/buddypress/myCRED-addon-buddypress.php:352
 
335
  #@ mycred
336
  msgid "Include under the \"Profile\" tab"
337
  msgstr ""
338
 
339
- #: addons/buddypress/myCRED-addon-buddypress.php:353
 
340
  #@ mycred
341
  msgid "Include under the \"Profile\" tab and Profile Header."
342
  msgstr ""
343
 
344
- #: addons/buddypress/myCRED-addon-buddypress.php:358
345
  #@ mycred
346
  msgid "Show in Profile"
347
  msgstr ""
348
 
349
- #: addons/buddypress/myCRED-addon-buddypress.php:369
350
  #@ mycred
351
  msgid "BuddyPress"
352
  msgstr ""
353
 
354
- #: addons/buddypress/myCRED-addon-buddypress.php:387
355
  #@ mycred
356
  msgid "Members can view each others %_singular% balance."
357
  msgstr ""
358
 
359
- #: addons/buddypress/myCRED-addon-buddypress.php:392
360
  #@ mycred
361
  msgid "Template"
362
  msgstr ""
363
 
364
- #: addons/buddypress/myCRED-addon-buddypress.php:397
365
- #: includes/mycred-widgets.php:149
366
- #: modules/mycred-module-log.php:61
367
  #, php-format
368
  #@ mycred
369
  msgid "%plural% History"
370
  msgstr ""
371
 
372
- #: addons/buddypress/myCRED-addon-buddypress.php:413
373
  #@ mycred
374
  msgid "Members can view each others %_plural% history."
375
  msgstr ""
376
 
377
- #: addons/buddypress/myCRED-addon-buddypress.php:418
378
  #@ mycred
379
  msgid "Menu Title"
380
  msgstr ""
381
 
382
- #: addons/buddypress/myCRED-addon-buddypress.php:420
383
  #@ mycred
384
  msgid "Title shown to me"
385
  msgstr ""
386
 
387
- #: addons/buddypress/myCRED-addon-buddypress.php:425
388
  #, php-format
389
  #@ mycred
390
  msgid "Title shown to others. Use %s to show the first name."
391
  msgstr ""
392
 
393
- #: addons/buddypress/myCRED-addon-buddypress.php:430
394
  #@ mycred
395
  msgid "Menu Position"
396
  msgstr ""
397
 
398
- #: addons/buddypress/myCRED-addon-buddypress.php:432
399
  #@ mycred
400
  msgid "Current menu positions:"
401
  msgstr ""
402
 
403
  #: addons/import/myCRED-addon-import.php:451
404
  #: includes/mycred-network.php:115
405
- #: modules/mycred-module-addons.php:237
406
  #: modules/mycred-module-general.php:35
407
- #: modules/mycred-module-hooks.php:154
408
- #: modules/mycred-module-log.php:321
409
- #: modules/mycred-module-log.php:397
410
  #@ mycred
411
  #@ default
412
  msgid "Access Denied"
@@ -575,7 +580,7 @@ msgid " error: "
575
  msgstr ""
576
 
577
  #: addons/buy-creds/gateways/netbilling.php:423
578
- #: addons/buy-creds/myCRED-addon-buy-creds.php:132
579
  #@ mycred
580
  #@ default
581
  msgid "NETbilling"
@@ -662,12 +667,15 @@ msgstr ""
662
  msgid "Billing Details"
663
  msgstr ""
664
 
665
- #: abstracts/mycred-abstract-hook.php:134
666
- #: addons/buy-creds/abstracts/mycred-abstract-payment-gateway.php:506
667
- #: addons/buy-creds/abstracts/mycred-abstract-payment-gateway.php:529
668
  #: addons/buy-creds/gateways/netbilling.php:514
669
- #: addons/buy-creds/myCRED-addon-buy-creds.php:220
670
- #: addons/buy-creds/myCRED-addon-buy-creds.php:241
 
 
 
671
  #@ mycred
672
  msgid "Select"
673
  msgstr ""
@@ -682,406 +690,409 @@ msgstr ""
682
  msgid "Year"
683
  msgstr ""
684
 
685
- #: addons/buy-creds/gateways/netbilling.php:608
686
- #: addons/buy-creds/gateways/paypal-standard.php:327
687
- #: addons/buy-creds/gateways/skrill.php:332
688
- #: addons/buy-creds/myCRED-addon-buy-creds.php:750
 
689
  #@ mycred
690
  msgid "Sandbox Mode"
691
  msgstr ""
692
 
693
- #: addons/buy-creds/gateways/netbilling.php:614
694
  #@ mycred
695
  msgid "Account ID"
696
  msgstr ""
697
 
698
- #: addons/buy-creds/gateways/netbilling.php:620
699
  #@ mycred
700
  msgid "Site Tag"
701
  msgstr ""
702
 
703
- #: addons/buy-creds/gateways/netbilling.php:626
704
  #@ mycred
705
  msgid "Dynamic IP Security Code"
706
  msgstr ""
707
 
708
- #: addons/buy-creds/gateways/netbilling.php:632
709
- #: addons/buy-creds/gateways/paypal-standard.php:347
710
- #: addons/buy-creds/gateways/skrill.php:358
711
  #@ mycred
712
  msgid "Item Name"
713
  msgstr ""
714
 
715
- #: addons/buy-creds/gateways/netbilling.php:638
716
- #: addons/buy-creds/gateways/paypal-standard.php:354
717
- #: addons/buy-creds/gateways/skrill.php:365
718
  #, php-format
719
  #@ mycred
720
  msgid "%plural% Exchange Rate"
721
  msgstr ""
722
 
723
- #: addons/buy-creds/gateways/netbilling.php:644
724
  #@ mycred
725
  msgid "Allowed Attempts"
726
  msgstr ""
727
 
728
- #: addons/buy-creds/gateways/netbilling.php:648
729
  #@ mycred
730
  msgid "Maximum number of attempts allowed for purchases."
731
  msgstr ""
732
 
733
- #: addons/buy-creds/gateways/netbilling.php:651
734
  #@ mycred
735
  msgid "Advanced"
736
  msgstr ""
737
 
738
- #: addons/buy-creds/gateways/paypal-standard.php:231
739
- #: addons/buy-creds/gateways/skrill.php:205
740
  #@ mycred
741
  msgid "Success"
742
  msgstr ""
743
 
744
- #: addons/buy-creds/gateways/paypal-standard.php:232
745
- #: addons/buy-creds/gateways/skrill.php:206
746
  #@ mycred
747
  msgid "Thank you for your purchase"
748
  msgstr ""
749
 
750
- #: addons/buy-creds/gateways/paypal-standard.php:245
751
- #: addons/buy-creds/gateways/skrill.php:219
752
- #@ mycred
753
- msgid "Please setup this gateway before attempting to make a purchaase!"
754
- msgstr ""
755
-
756
- #: addons/buy-creds/gateways/paypal-standard.php:305
757
- #: addons/buy-creds/gateways/skrill.php:260
758
  #@ mycred
759
  msgid "Return to "
760
  msgstr ""
761
 
762
- #: addons/buy-creds/gateways/paypal-standard.php:310
763
- #: addons/buy-creds/gateways/skrill.php:314
 
764
  #@ mycred
765
  msgid "Processing payment &hellip;"
766
  msgstr ""
767
 
768
- #: addons/buy-creds/gateways/paypal-standard.php:333
769
- #: addons/buy-creds/gateways/skrill.php:338
770
- #: addons/buy-creds/myCRED-addon-buy-creds.php:741
771
  #@ mycred
772
  msgid "Currency"
773
  msgstr ""
774
 
775
- #: addons/buy-creds/gateways/paypal-standard.php:338
776
- #: addons/buy-creds/gateways/skrill.php:395
777
  #@ mycred
778
  msgid "Important!"
779
  msgstr ""
780
 
781
- #: addons/buy-creds/gateways/paypal-standard.php:338
782
  #@ mycred
783
  msgid "Make sure you select a currency that your PayPal account supports. Otherwise transactions will not be approved until you login to your PayPal account and Accept each transaction!"
784
  msgstr ""
785
 
786
- #: addons/buy-creds/gateways/paypal-standard.php:341
787
  #@ mycred
788
  msgid "Account Email"
789
  msgstr ""
790
 
791
- #: addons/buy-creds/gateways/paypal-standard.php:351
792
- #: addons/buy-creds/gateways/skrill.php:362
793
  #@ mycred
794
  msgid "Description of the item being purchased by the user."
795
  msgstr ""
796
 
797
- #: addons/buy-creds/gateways/paypal-standard.php:357
798
- #: addons/buy-creds/gateways/skrill.php:368
799
  #@ mycred
800
  msgid "Your selected currency"
801
  msgstr ""
802
 
803
- #: addons/buy-creds/gateways/paypal-standard.php:360
804
  #@ mycred
805
  msgid "IPN Address"
806
  msgstr ""
807
 
808
- #: addons/buy-creds/gateways/skrill.php:297
809
  #@ mycred
810
  msgid "Product:"
811
  msgstr ""
812
 
813
- #: addons/buy-creds/gateways/skrill.php:306
814
  #@ mycred
815
  msgid "Gift to:"
816
  msgstr ""
817
 
818
- #: addons/buy-creds/gateways/skrill.php:307
819
  #@ mycred
820
  msgid "(author)"
821
  msgstr ""
822
 
823
- #: addons/buy-creds/gateways/skrill.php:335
824
  #@ mycred
825
  msgid "Remember to use your Test Merchant Account when Sandbox mode is active!"
826
  msgstr ""
827
 
828
- #: addons/buy-creds/gateways/skrill.php:345
829
  #@ mycred
830
  msgid "Merchant Account Email"
831
  msgstr ""
832
 
833
- #: addons/buy-creds/gateways/skrill.php:351
834
  #@ mycred
835
  msgid "Secret Word"
836
  msgstr ""
837
 
838
- #: addons/buy-creds/gateways/skrill.php:355
839
  #@ mycred
840
  msgid "You can set your secret word under \"Merchant Tools\" in your Skrill Account."
841
  msgstr ""
842
 
843
- #: addons/buy-creds/gateways/skrill.php:371
844
  #@ mycred
845
  msgid "Confirmation Email"
846
  msgstr ""
847
 
848
- #: addons/buy-creds/gateways/skrill.php:374
849
  #@ mycred
850
  msgid "Ask Skrill to send me a confirmation email for each successful purchase."
851
  msgstr ""
852
 
853
- #: addons/buy-creds/gateways/skrill.php:377
854
- #: addons/buy-creds/myCRED-addon-buy-creds.php:752
855
  #@ mycred
856
  msgid "Checkout Page"
857
  msgstr ""
858
 
859
- #: addons/buy-creds/gateways/skrill.php:380
860
- #: addons/gateway/carts/mycred-woocommerce.php:67
861
- #: addons/transfer/myCRED-addon-transfer.php:566
862
- #: includes/mycred-widgets.php:175
863
- #: includes/mycred-widgets.php:331
864
  #@ mycred
865
  msgid "Title"
866
  msgstr ""
867
 
868
- #: addons/buy-creds/gateways/skrill.php:382
869
  #@ mycred
870
  msgid "If left empty, your account email is used as title on the Skill Payment Page."
871
  msgstr ""
872
 
873
- #: addons/buy-creds/gateways/skrill.php:385
 
874
  #@ mycred
875
  msgid "Logo URL"
876
  msgstr ""
877
 
878
- #: addons/buy-creds/gateways/skrill.php:387
879
  #@ mycred
880
  msgid "The URL to the image you want to use on the top of the gateway. For best integration results we recommend you use logos with dimensions up to 200px in width and 50px in height."
881
  msgstr ""
882
 
883
- #: addons/buy-creds/gateways/skrill.php:390
884
  #@ mycred
885
  msgid "Confirmation Note"
886
  msgstr ""
887
 
888
- #: addons/buy-creds/gateways/skrill.php:392
889
  #@ mycred
890
  msgid "Optional text to show user once a transaction has been successfully completed. This text is shown by Skrill."
891
  msgstr ""
892
 
893
- #: addons/buy-creds/gateways/skrill.php:396
894
  #@ mycred
895
  msgid "By default all Skrill Merchant account accept payments via Bank Transfers. When a user selects this option, no %_plural% are awarded! You will need to manually award these once the bank transfer is completed."
896
  msgstr ""
897
 
898
- #: addons/buy-creds/gateways/skrill.php:397
899
- #@ mycred
900
- msgid "By default purchases made using Skrill will result in users having to signup for a Skrill account (if they do not have one already). You can contact <a href=\"mailto:\">Skrill Merchant Services</a> and request to disable this feature."
901
- msgstr ""
902
-
903
- #: addons/buy-creds/myCRED-addon-buy-creds.php:47
904
  #: addons/buy-creds/myCRED-addon-buy-creds.php:48
905
  #: addons/buy-creds/myCRED-addon-buy-creds.php:49
906
- #: addons/buy-creds/myCRED-addon-buy-creds.php:304
 
907
  #@ mycred
908
  msgid "Payment Gateways"
909
  msgstr ""
910
 
911
- #: addons/buy-creds/myCRED-addon-buy-creds.php:128
912
- #: addons/buy-creds/myCRED-addon-buy-creds.php:739
913
  #@ default
914
  #@ mycred
915
  msgid "PayPal Payments Standard"
916
  msgstr ""
917
 
918
- #: addons/buy-creds/myCRED-addon-buy-creds.php:136
919
  #@ default
920
  msgid "Skrill (Moneybookers)"
921
  msgstr ""
922
 
923
- #: addons/buy-creds/myCRED-addon-buy-creds.php:158
924
  #@ mycred
925
  msgid "Please login to purchase %_plural%"
926
  msgstr ""
927
 
928
- #: addons/buy-creds/myCRED-addon-buy-creds.php:172
929
  #, php-format
930
  #@ mycred
931
  msgid "Gift purchase from %display_name%."
932
  msgstr ""
933
 
934
- #: addons/buy-creds/myCRED-addon-buy-creds.php:185
 
935
  #, php-format
936
  #@ mycred
937
  msgid "Minimum %plural%"
938
  msgstr ""
939
 
940
- #: addons/buy-creds/myCRED-addon-buy-creds.php:189
941
  #, php-format
942
  #@ mycred
943
  msgid "Minimum amount of %plural% a user must purchase. Will default to 1."
944
  msgstr ""
945
 
946
- #: addons/buy-creds/myCRED-addon-buy-creds.php:205
947
  #@ mycred
948
  msgid "Thank You Page"
949
  msgstr ""
950
 
951
- #: addons/buy-creds/myCRED-addon-buy-creds.php:208
952
- #: addons/buy-creds/myCRED-addon-buy-creds.php:229
953
  #@ mycred
954
  msgid "Custom URL"
955
  msgstr ""
956
 
957
- #: addons/buy-creds/myCRED-addon-buy-creds.php:213
958
- #: addons/buy-creds/myCRED-addon-buy-creds.php:234
959
  #@ mycred
960
  msgid "Page"
961
  msgstr ""
962
 
963
- #: addons/buy-creds/myCRED-addon-buy-creds.php:226
964
  #@ mycred
965
  msgid "Cancellation Page"
966
  msgstr ""
967
 
968
- #: addons/buy-creds/myCRED-addon-buy-creds.php:247
969
  #@ mycred
970
  msgid "Gifting"
971
  msgstr ""
972
 
973
- #: addons/buy-creds/myCRED-addon-buy-creds.php:249
974
  #@ mycred
975
  msgid "Allow users to buy %_plural% for other users."
976
  msgstr ""
977
 
978
- #: addons/buy-creds/myCRED-addon-buy-creds.php:250
979
  #@ mycred
980
  msgid "Allow users to buy %_plural% for content authors."
981
  msgstr ""
982
 
983
- #: addons/buy-creds/myCRED-addon-buy-creds.php:199
984
- #: addons/buy-creds/myCRED-addon-buy-creds.php:253
985
- #: addons/gateway/carts/mycred-woocommerce.php:79
986
- #: modules/mycred-module-hooks.php:423
 
 
 
 
 
 
 
 
 
 
987
  #@ mycred
988
  msgid "Log Template"
989
  msgstr ""
990
 
991
- #: addons/buy-creds/myCRED-addon-buy-creds.php:255
992
  #, php-format
993
  #@ default
994
  msgid "Available template tags: %singular%, %plural% and %display_name%"
995
  msgstr ""
996
 
997
- #: addons/buy-creds/myCRED-addon-buy-creds.php:299
998
  #: modules/mycred-module-general.php:42
999
- #: modules/mycred-module-hooks.php:161
1000
  #@ mycred
1001
  msgid "Settings Updated"
1002
  msgstr ""
1003
 
1004
- #: addons/buy-creds/myCRED-addon-buy-creds.php:305
1005
  #, php-format
1006
  #@ mycred
1007
  msgid "Select the payment gateways you want to offer your users to buy %plural%."
1008
  msgstr ""
1009
 
1010
- #: addons/buy-creds/myCRED-addon-buy-creds.php:328
1011
- #: modules/mycred-module-hooks.php:179
1012
  #@ mycred
1013
  msgid "Enable"
1014
  msgstr ""
1015
 
1016
- #: addons/buy-creds/myCRED-addon-buy-creds.php:346
1017
  #@ mycred
1018
  msgid "Update Gateway Settings"
1019
  msgstr ""
1020
 
1021
- #: addons/buy-creds/myCRED-addon-buy-creds.php:402
1022
- #: addons/buy-creds/myCRED-addon-buy-creds.php:504
1023
  #@ mycred
1024
  msgid "No gateways installed."
1025
  msgstr ""
1026
 
1027
- #: addons/buy-creds/myCRED-addon-buy-creds.php:403
1028
- #: addons/buy-creds/myCRED-addon-buy-creds.php:505
1029
  #@ mycred
1030
  msgid "Gateway does not exist."
1031
  msgstr ""
1032
 
1033
- #: addons/buy-creds/myCRED-addon-buy-creds.php:439
1034
  #@ mycred
1035
  msgid "Yourself"
1036
  msgstr ""
1037
 
1038
- #: addons/buy-creds/myCRED-addon-buy-creds.php:506
1039
  #@ mycred
1040
  msgid "No active gateways found."
1041
  msgstr ""
1042
 
1043
- #: addons/buy-creds/myCRED-addon-buy-creds.php:507
1044
  #@ mycred
1045
  msgid "The selected gateway is not active."
1046
  msgstr ""
1047
 
1048
- #: addons/buy-creds/myCRED-addon-buy-creds.php:547
1049
  #@ mycred
1050
  msgid "Buy with"
1051
  msgstr ""
1052
 
1053
- #: addons/buy-creds/myCRED-addon-buy-creds.php:551
1054
  #: addons/sell-content/myCRED-addon-sell-content.php:42
1055
  #@ mycred
1056
  msgid "Buy Now"
1057
  msgstr ""
1058
 
1059
- #: addons/buy-creds/myCRED-addon-buy-creds.php:585
1060
  #@ mycred
1061
  msgid "No users found"
1062
  msgstr ""
1063
 
1064
- #: addons/buy-creds/myCRED-addon-buy-creds.php:595
1065
  #@ mycred
1066
  msgid "To"
1067
  msgstr ""
1068
 
1069
- #: addons/buy-creds/myCRED-addon-buy-creds.php:612
1070
  #@ mycred
1071
  msgid "Select Amount"
1072
  msgstr ""
1073
 
1074
- #: addons/buy-creds/myCRED-addon-buy-creds.php:634
1075
  #@ mycred
1076
  msgid "Amount"
1077
  msgstr ""
1078
 
1079
- #: addons/buy-creds/myCRED-addon-buy-creds.php:636
1080
  #@ mycred
1081
  msgid "min."
1082
  msgstr ""
1083
 
1084
- #: addons/buy-creds/myCRED-addon-buy-creds.php:644
1085
  #@ mycred
1086
  msgid "Select Gateway"
1087
  msgstr ""
@@ -1106,7 +1117,7 @@ msgstr ""
1106
  msgid "Click here if you are not automatically redirected"
1107
  msgstr ""
1108
 
1109
- #: addons/buy-creds/abstracts/mycred-abstract-payment-gateway.php:857
1110
  #@ mycred
1111
  msgid "Outside US"
1112
  msgstr ""
@@ -1257,7 +1268,8 @@ msgstr ""
1257
  msgid "Email"
1258
  msgstr ""
1259
 
1260
- #: addons/gateway/carts/mycred-woocommerce.php:92
 
1261
  #: addons/import/myCRED-addon-import.php:518
1262
  #: addons/import/myCRED-addon-import.php:587
1263
  #: addons/import/myCRED-addon-import.php:651
@@ -1378,171 +1390,161 @@ msgid ""
1378
  "<p><strong>Price</strong>: %price%</p>"
1379
  msgstr ""
1380
 
1381
- #: addons/sell-content/myCRED-addon-sell-content.php:46
1382
  #, php-format
1383
  #@ mycred
1384
  msgid "Purchase of %link_with_title%"
1385
  msgstr ""
1386
 
1387
- #: addons/sell-content/myCRED-addon-sell-content.php:47
1388
  #, php-format
1389
  #@ mycred
1390
  msgid "Sale of %link_with_title%"
1391
  msgstr ""
1392
 
1393
- #: addons/sell-content/myCRED-addon-sell-content.php:170
1394
  #@ default
1395
  msgid "No Payout. Just charge."
1396
  msgstr ""
1397
 
1398
- #: addons/sell-content/myCRED-addon-sell-content.php:171
1399
  #@ default
1400
  msgid "Pay Content Author."
1401
  msgstr ""
1402
 
1403
- #: addons/sell-content/myCRED-addon-sell-content.php:175
1404
- #: addons/sell-content/myCRED-addon-sell-content.php:687
1405
  #@ mycred
1406
  msgid "Sell Content"
1407
  msgstr ""
1408
 
1409
- #: addons/sell-content/myCRED-addon-sell-content.php:177
1410
  #@ mycred
1411
  msgid "Post Types"
1412
  msgstr ""
1413
 
1414
- #: addons/sell-content/myCRED-addon-sell-content.php:181
1415
  #@ mycred
1416
  msgid "Comma separated list of post types that can be sold."
1417
  msgstr ""
1418
 
1419
- #: addons/sell-content/myCRED-addon-sell-content.php:184
1420
  #@ mycred
1421
  msgid "Payments"
1422
  msgstr ""
1423
 
1424
- #: addons/sell-content/myCRED-addon-sell-content.php:198
1425
  #@ mycred
1426
  msgid "Percentage to pay Author"
1427
  msgstr ""
1428
 
1429
- #: addons/sell-content/myCRED-addon-sell-content.php:200
1430
  #@ mycred
1431
  msgid "Percentage of the price to pay the author. Can not be zero and is ignored if authors are not paid."
1432
  msgstr ""
1433
 
1434
- #: addons/sell-content/myCRED-addon-sell-content.php:208
1435
- #: addons/sell-content/myCRED-addon-sell-content.php:690
1436
  #@ mycred
1437
  msgid "Defaults"
1438
  msgstr ""
1439
 
1440
- #: addons/sell-content/myCRED-addon-sell-content.php:211
1441
- #: addons/sell-content/myCRED-addon-sell-content.php:393
1442
  #@ mycred
1443
  msgid "Price"
1444
  msgstr ""
1445
 
1446
- #: addons/sell-content/myCRED-addon-sell-content.php:216
1447
  #@ mycred
1448
  msgid "Allow authors to change price."
1449
  msgstr ""
1450
 
1451
- #: addons/sell-content/myCRED-addon-sell-content.php:220
1452
- #: addons/sell-content/myCRED-addon-sell-content.php:397
1453
  #@ mycred
1454
  msgid "Button Label"
1455
  msgstr ""
1456
 
1457
- #: addons/sell-content/myCRED-addon-sell-content.php:225
1458
  #@ mycred
1459
  msgid "Allow authors to change button label."
1460
  msgstr ""
1461
 
1462
- #: addons/sell-content/myCRED-addon-sell-content.php:228
1463
  #@ mycred
1464
  msgid "Sale Template for non members"
1465
  msgstr ""
1466
 
1467
- #: addons/sell-content/myCRED-addon-sell-content.php:232
1468
  #, php-format
1469
  #@ mycred
1470
  msgid "Do <strong>not</strong> use the %buy_button% in this template as a user must be logged in to buy content!"
1471
  msgstr ""
1472
 
1473
- #: addons/sell-content/myCRED-addon-sell-content.php:233
1474
  #, php-format
1475
  #@ mycred
1476
  msgid "Available template tags are: %singular%, %plural%, %post_title%, %post_url%, %link_with_title%, %price%"
1477
  msgstr ""
1478
 
1479
- #: addons/sell-content/myCRED-addon-sell-content.php:236
1480
  #@ mycred
1481
  msgid "Sale Template for members"
1482
  msgstr ""
1483
 
1484
- #: addons/sell-content/myCRED-addon-sell-content.php:240
1485
- #: addons/sell-content/myCRED-addon-sell-content.php:248
1486
  #, php-format
1487
  #@ mycred
1488
  msgid "Your template must contain the %buy_button% tag for purchases to work!"
1489
  msgstr ""
1490
 
1491
- #: addons/sell-content/myCRED-addon-sell-content.php:241
1492
- #: addons/sell-content/myCRED-addon-sell-content.php:249
1493
  #, php-format
1494
  #@ mycred
1495
  msgid "Available template tags are: %singular%, %plural%, %post_title%, %post_url%, %link_with_title%, %buy_button%, %price%"
1496
  msgstr ""
1497
 
1498
- #: addons/sell-content/myCRED-addon-sell-content.php:244
1499
  #@ mycred
1500
  msgid "Insufficient funds template"
1501
  msgstr ""
1502
 
1503
- #: addons/sell-content/myCRED-addon-sell-content.php:252
1504
  #@ mycred
1505
  msgid "Log template for Purchases"
1506
  msgstr ""
1507
 
1508
- #: addons/sell-content/myCRED-addon-sell-content.php:256
1509
- #: addons/sell-content/myCRED-addon-sell-content.php:263
1510
  #, php-format
1511
  #@ mycred
1512
  msgid "Available template tags are: %singular%, %plural%, %post_title%, %post_url% or %link_with_title%"
1513
  msgstr ""
1514
 
1515
- #: addons/sell-content/myCRED-addon-sell-content.php:259
1516
  #@ mycred
1517
  msgid "Log template for Sales"
1518
  msgstr ""
1519
 
1520
- #: addons/sell-content/myCRED-addon-sell-content.php:313
1521
- #@ mycred
1522
- msgid "myCRED Sell"
1523
- msgstr ""
1524
-
1525
- #: addons/sell-content/myCRED-addon-sell-content.php:355
1526
- #@ mycred
1527
- msgid "<strong>my</strong>CRED Sell Content needs to be setup before you can use this feature."
1528
- msgstr ""
1529
-
1530
- #: addons/sell-content/myCRED-addon-sell-content.php:358
1531
  #@ mycred
1532
  msgid "Setup add-on"
1533
  msgstr ""
1534
 
1535
- #: addons/sell-content/myCRED-addon-sell-content.php:358
1536
  #@ mycred
1537
  msgid "Lets do it"
1538
  msgstr ""
1539
 
1540
- #: addons/sell-content/myCRED-addon-sell-content.php:387
1541
  #@ mycred
1542
  msgid "Enable sale of this "
1543
  msgstr ""
1544
 
1545
- #: addons/sell-content/myCRED-addon-sell-content.php:597
1546
  #@ mycred
1547
  msgid "Thank you for your purchase!"
1548
  msgstr ""
@@ -1560,178 +1562,169 @@ msgid "You have exceeded your %limit% transfer limit."
1560
  msgstr ""
1561
 
1562
  #: addons/transfer/myCRED-addon-transfer.php:43
1563
- #: addons/transfer/myCRED-addon-transfer.php:463
1564
  #@ mycred
1565
  msgid "Transfer"
1566
  msgstr ""
1567
 
1568
- #: addons/transfer/myCRED-addon-transfer.php:134
1569
  #@ mycred
1570
  msgid "Transaction completed."
1571
  msgstr ""
1572
 
1573
- #: addons/transfer/myCRED-addon-transfer.php:135
1574
  #@ mycred
1575
  msgid "Security token could not be verified. Please contact your site administrator!"
1576
  msgstr ""
1577
 
1578
- #: addons/transfer/myCRED-addon-transfer.php:136
1579
  #@ mycred
1580
  msgid "Communications error. Please try again later."
1581
  msgstr ""
1582
 
1583
- #: addons/transfer/myCRED-addon-transfer.php:137
1584
  #@ mycred
1585
  msgid "Recipient not found. Please try again."
1586
  msgstr ""
1587
 
1588
- #: addons/transfer/myCRED-addon-transfer.php:138
1589
  #@ mycred
1590
  msgid "Transaction declined by recipient."
1591
  msgstr ""
1592
 
1593
- #: addons/transfer/myCRED-addon-transfer.php:139
1594
  #@ mycred
1595
  msgid "Incorrect amount. Please try again."
1596
  msgstr ""
1597
 
1598
- #: addons/transfer/myCRED-addon-transfer.php:140
1599
  #@ mycred
1600
  msgid "This myCRED Add-on has not yet been setup! No transfers are allowed until this has been done!"
1601
  msgstr ""
1602
 
1603
- #: addons/transfer/myCRED-addon-transfer.php:141
1604
  #@ mycred
1605
  msgid "Insufficient funds. Please enter a lower amount."
1606
  msgstr ""
1607
 
1608
- #: addons/transfer/myCRED-addon-transfer.php:142
1609
  #@ mycred
1610
  msgid "Transfer Limit exceeded."
1611
  msgstr ""
1612
 
1613
- #: addons/transfer/myCRED-addon-transfer.php:143
1614
  #@ mycred
1615
  msgid "The request amount will exceed your transfer limit. Please try again with a lower amount!"
1616
  msgstr ""
1617
 
1618
- #: addons/transfer/myCRED-addon-transfer.php:168
1619
  #@ mycred
1620
  msgid "No limits."
1621
  msgstr ""
1622
 
1623
- #: addons/transfer/myCRED-addon-transfer.php:169
1624
  #@ mycred
1625
  msgid "Impose daily limit."
1626
  msgstr ""
1627
 
1628
- #: addons/transfer/myCRED-addon-transfer.php:170
1629
  #@ mycred
1630
  msgid "Impose weekly limit."
1631
  msgstr ""
1632
 
1633
- #: addons/transfer/myCRED-addon-transfer.php:174
1634
  #@ mycred
1635
  msgid "Transfer CREDs"
1636
  msgstr ""
1637
 
1638
- #: addons/transfer/myCRED-addon-transfer.php:176
1639
  #@ mycred
1640
  msgid "Log template for sending"
1641
  msgstr ""
1642
 
1643
- #: addons/transfer/myCRED-addon-transfer.php:183
1644
  #@ mycred
1645
  msgid "Log template for receiving"
1646
  msgstr ""
1647
 
1648
- #: addons/transfer/myCRED-addon-transfer.php:190
 
1649
  #@ mycred
1650
  msgid "Limits"
1651
  msgstr ""
1652
 
1653
- #: addons/transfer/myCRED-addon-transfer.php:207
1654
  #@ mycred
1655
  msgid "Maximum Amount"
1656
  msgstr ""
1657
 
1658
- #: addons/transfer/myCRED-addon-transfer.php:209
1659
  #@ mycred
1660
  msgid "This amount is ignored if no limits are imposed."
1661
  msgstr ""
1662
 
1663
- #: addons/transfer/myCRED-addon-transfer.php:212
1664
  #@ mycred
1665
  msgid "Form Templates"
1666
  msgstr ""
1667
 
1668
- #: addons/transfer/myCRED-addon-transfer.php:215
1669
  #@ mycred
1670
  msgid "Not logged in Template"
1671
  msgstr ""
1672
 
1673
- #: addons/transfer/myCRED-addon-transfer.php:221
1674
  #@ mycred
1675
  msgid "Balance Template"
1676
  msgstr ""
1677
 
1678
- #: addons/transfer/myCRED-addon-transfer.php:227
1679
  #@ mycred
1680
  msgid "Limit Template"
1681
  msgstr ""
1682
 
1683
- #: addons/transfer/myCRED-addon-transfer.php:233
1684
  #@ mycred
1685
  msgid "Button Template"
1686
  msgstr ""
1687
 
1688
- #: addons/transfer/myCRED-addon-transfer.php:238
1689
  #@ mycred
1690
  msgid "Error Messages"
1691
  msgstr ""
1692
 
1693
- #: addons/transfer/myCRED-addon-transfer.php:241
1694
  #@ mycred
1695
  msgid "Balance to low to send."
1696
  msgstr ""
1697
 
1698
- #: addons/transfer/myCRED-addon-transfer.php:247
1699
  #@ mycred
1700
  msgid "Transfer Limit Reached."
1701
  msgstr ""
1702
 
1703
- #: addons/transfer/myCRED-addon-transfer.php:492
1704
- #@ mycred
1705
- msgid "Allow cred transfers between users."
1706
- msgstr ""
1707
-
1708
- #: addons/transfer/myCRED-addon-transfer.php:494
1709
- #@ mycred
1710
- msgid "myCRED Transfer"
1711
- msgstr ""
1712
-
1713
- #: addons/transfer/myCRED-addon-transfer.php:560
1714
  #, php-format
1715
  #@ mycred
1716
  msgid "Transfer %plural%"
1717
  msgstr ""
1718
 
1719
- #: addons/transfer/myCRED-addon-transfer.php:571
1720
  #@ mycred
1721
  msgid "Show users balance"
1722
  msgstr ""
1723
 
1724
- #: addons/transfer/myCRED-addon-transfer.php:575
1725
  #@ mycred
1726
  msgid "Show users limit"
1727
  msgstr ""
1728
 
1729
- #: addons/transfer/myCRED-addon-transfer.php:688
1730
  #@ mycred
1731
  msgid "To:"
1732
  msgstr ""
1733
 
1734
- #: addons/transfer/myCRED-addon-transfer.php:692
1735
  #@ mycred
1736
  msgid "Amount:"
1737
  msgstr ""
@@ -1762,22 +1755,22 @@ msgstr ""
1762
  msgid "Adjust Users Balance"
1763
  msgstr ""
1764
 
1765
- #: includes/mycred-admin.php:171
1766
  #@ mycred
1767
  msgid "Log description for adjustment"
1768
  msgstr ""
1769
 
1770
- #: includes/mycred-admin.php:171
1771
  #@ mycred
1772
  msgid "required"
1773
  msgstr ""
1774
 
1775
- #: includes/mycred-admin.php:172
1776
  #@ mycred
1777
  msgid "Update"
1778
  msgstr ""
1779
 
1780
- #: includes/mycred-admin.php:177
1781
  #@ mycred
1782
  msgid "Users Current Balance"
1783
  msgstr ""
@@ -1787,262 +1780,239 @@ msgstr ""
1787
  msgid "Sorry but your WordPress installation does not reach the minimum requirements for running myCRED. The following errors were given:\n"
1788
  msgstr ""
1789
 
1790
- #: includes/mycred-install.php:219
1791
  #@ mycred
1792
  msgid "CRED needs your attention."
1793
  msgstr ""
1794
 
1795
- #: includes/mycred-install.php:219
1796
  #@ mycred
1797
  msgid "Run Setup"
1798
  msgstr ""
1799
 
1800
- #: includes/mycred-install.php:231
1801
- #: includes/mycred-install.php:232
1802
  #@ mycred
1803
  msgid "myCRED Setup"
1804
  msgstr ""
1805
 
1806
- #: includes/mycred-install.php:369
1807
- #: mycred.php:96
 
1808
  #@ mycred
1809
  msgid "Setup"
1810
  msgstr ""
1811
 
1812
- #: includes/mycred-install.php:395
1813
  #@ mycred
1814
  msgid "Begin Setup"
1815
  msgstr ""
1816
 
1817
- #: includes/mycred-install.php:453
 
1818
  #@ mycred
1819
  msgid "Format"
1820
  msgstr ""
1821
 
1822
- #: includes/mycred-install.php:456
1823
  #@ mycred
1824
  msgid "Separators"
1825
  msgstr ""
1826
 
1827
- #: includes/mycred-install.php:466
1828
  #@ mycred
1829
  msgid "Decimals"
1830
  msgstr ""
1831
 
1832
- #: includes/mycred-install.php:468
1833
  #@ mycred
1834
  msgid "Use zero for no decimals."
1835
  msgstr ""
1836
 
1837
- #: includes/mycred-install.php:497
1838
  #@ default
1839
  msgid "Cancel Setup"
1840
  msgstr ""
1841
 
1842
- #: includes/mycred-install.php:497
1843
  #@ default
1844
  msgid "Cancel"
1845
  msgstr ""
1846
 
1847
- #: includes/mycred-install.php:497
1848
- #: includes/mycred-install.php:577
1849
  #@ mycred
1850
  msgid "Next"
1851
  msgstr ""
1852
 
1853
- #: includes/mycred-install.php:474
1854
  #: modules/mycred-module-general.php:61
1855
  #@ mycred
1856
  msgid "Name (Singular)"
1857
  msgstr ""
1858
 
1859
- #: includes/mycred-install.php:478
1860
  #: modules/mycred-module-general.php:66
1861
  #@ mycred
1862
  msgid "Name (Plural)"
1863
  msgstr ""
1864
 
1865
- #: includes/mycred-install.php:484
1866
  #: modules/mycred-module-general.php:77
1867
  #@ mycred
1868
  msgid "Prefix"
1869
  msgstr ""
1870
 
1871
- #: includes/mycred-install.php:492
1872
  #: modules/mycred-module-general.php:85
1873
  #@ mycred
1874
  msgid "Suffix"
1875
  msgstr ""
1876
 
1877
- #: includes/mycred-install.php:526
1878
  #: modules/mycred-module-general.php:93
1879
  #@ mycred
1880
  msgid "Security"
1881
  msgstr ""
1882
 
1883
- #: includes/mycred-install.php:529
1884
  #@ mycred
1885
  msgid "Edit Settings Capability"
1886
  msgstr ""
1887
 
1888
- #: includes/mycred-install.php:537
1889
  #: modules/mycred-module-general.php:106
1890
  #@ mycred
1891
  msgid "Excludes"
1892
  msgstr ""
1893
 
1894
- #: includes/mycred-install.php:541
1895
  #: modules/mycred-module-general.php:110
1896
  #@ mycred
1897
  msgid "Exclude those who can \"Edit Settings\"."
1898
  msgstr ""
1899
 
1900
- #: includes/mycred-install.php:548
1901
  #: modules/mycred-module-general.php:118
1902
  #@ mycred
1903
  msgid "Exclude the following user IDs:"
1904
  msgstr ""
1905
 
1906
- #: includes/mycred-install.php:552
1907
  #: modules/mycred-module-general.php:123
1908
  #@ mycred
1909
  msgid "Rankings"
1910
  msgstr ""
1911
 
1912
- #: includes/mycred-install.php:556
1913
  #: modules/mycred-module-general.php:127
1914
  #@ mycred
1915
  msgid "Update rankings each time a users balance changes."
1916
  msgstr ""
1917
 
1918
- #: includes/mycred-install.php:560
1919
  #: modules/mycred-module-general.php:131
1920
  #@ mycred
1921
  msgid "Update rankings once a day."
1922
  msgstr ""
1923
 
1924
- #: includes/mycred-install.php:564
1925
  #: modules/mycred-module-general.php:135
1926
  #@ mycred
1927
  msgid "Update rankings once a week."
1928
  msgstr ""
1929
 
1930
- #: includes/mycred-install.php:568
1931
  #: modules/mycred-module-general.php:139
1932
  #@ mycred
1933
  msgid "Update rankings on a specific date."
1934
  msgstr ""
1935
 
1936
- #: includes/mycred-install.php:572
1937
  #: modules/mycred-module-general.php:143
1938
- #: modules/mycred-module-log.php:701
1939
  #@ mycred
1940
  msgid "Date"
1941
  msgstr ""
1942
 
1943
- #: includes/mycred-network.php:148
1944
  #@ mycred
1945
  msgid "No"
1946
  msgstr ""
1947
 
1948
- #: includes/mycred-network.php:144
1949
  #@ mycred
1950
  msgid "Yes"
1951
  msgstr ""
1952
 
1953
- #: includes/mycred-install.php:596
1954
  #@ mycred
1955
  msgid "Ready"
1956
  msgstr ""
1957
 
1958
- #: includes/mycred-install.php:598
1959
  #@ mycred
1960
  msgid "Install & Run"
1961
  msgstr ""
1962
 
1963
- #: includes/mycred-widgets.php:18
1964
- #@ mycred
1965
- msgid "Show the current users myCRED balance"
1966
- msgstr ""
1967
-
1968
- #: includes/mycred-widgets.php:20
1969
- #@ mycred
1970
- msgid "myCRED Balance"
1971
- msgstr ""
1972
-
1973
- #: includes/mycred-widgets.php:145
1974
  #@ mycred
1975
  msgid "My Balance"
1976
  msgstr ""
1977
 
1978
- #: includes/mycred-widgets.php:156
1979
  #, php-format
1980
  #@ mycred
1981
  msgid "<a href=\"%login_url_here%\">Login</a> to view your balance."
1982
  msgstr ""
1983
 
1984
- #: includes/mycred-widgets.php:180
1985
  #@ mycred
1986
  msgid "Layout"
1987
  msgstr ""
1988
 
1989
- #: includes/mycred-widgets.php:187
1990
  #@ mycred
1991
  msgid "Include users ranking"
1992
  msgstr ""
1993
 
1994
- #: includes/mycred-widgets.php:189
1995
- #@ mycred
1996
- msgid "Rank format"
1997
- msgstr ""
1998
-
1999
- #: includes/mycred-widgets.php:197
2000
  #@ mycred
2001
  msgid "Include history"
2002
  msgstr ""
2003
 
2004
- #: includes/mycred-widgets.php:201
2005
  #@ mycred
2006
  msgid "Number of entires"
2007
  msgstr ""
2008
 
2009
- #: includes/mycred-widgets.php:203
2010
- #: includes/mycred-widgets.php:343
2011
  #@ mycred
2012
  msgid "Row layout"
2013
  msgstr ""
2014
 
2015
- #: includes/mycred-widgets.php:211
2016
  #@ mycred
2017
  msgid "Show message when not logged in"
2018
  msgstr ""
2019
 
2020
- #: includes/mycred-widgets.php:213
2021
  #@ mycred
2022
  msgid "Message"
2023
  msgstr ""
2024
 
2025
- #: includes/mycred-widgets.php:280
2026
- #@ mycred
2027
- msgid "Show a list of users sorted by their myCRED balance"
2028
- msgstr ""
2029
-
2030
- #: includes/mycred-widgets.php:282
2031
- #@ mycred
2032
- msgid "myCRED List"
2033
- msgstr ""
2034
-
2035
- #: includes/mycred-widgets.php:325
2036
  #@ mycred
2037
  msgid "Leaderboard"
2038
  msgstr ""
2039
 
2040
- #: includes/mycred-widgets.php:336
2041
  #@ mycred
2042
  msgid "Visible to non-members"
2043
  msgstr ""
2044
 
2045
- #: includes/mycred-widgets.php:339
2046
  #@ mycred
2047
  msgid "Number of users"
2048
  msgstr ""
@@ -2063,6 +2033,7 @@ msgid "This Hook does no settings"
2063
  msgstr ""
2064
 
2065
  #: abstracts/mycred-abstract-hook.php:125
 
2066
  #@ mycred
2067
  msgid "No limit"
2068
  msgstr ""
@@ -2090,78 +2061,79 @@ msgstr ""
2090
  #: modules/mycred-module-addons.php:23
2091
  #: modules/mycred-module-addons.php:24
2092
  #: modules/mycred-module-addons.php:25
2093
- #: modules/mycred-module-addons.php:252
2094
  #@ mycred
2095
  msgid "Add-ons"
2096
  msgstr ""
2097
 
2098
- #: modules/mycred-module-addons.php:245
2099
  #@ mycred
2100
  msgid "Add-on Activated"
2101
  msgstr ""
2102
 
2103
- #: modules/mycred-module-addons.php:247
2104
  #@ mycred
2105
  msgid "Add-on Deactivated"
2106
  msgstr ""
2107
 
2108
- #: modules/mycred-module-addons.php:253
2109
  #@ mycred
2110
  msgid "Add-ons can expand your current installation with further features."
2111
  msgstr ""
2112
 
2113
- #: modules/mycred-module-addons.php:291
2114
  #@ mycred
2115
  msgid "Deactivate Add-on"
2116
  msgstr ""
2117
 
2118
- #: modules/mycred-module-addons.php:292
2119
  #@ mycred
2120
  msgid "Deactivate"
2121
  msgstr ""
2122
 
2123
- #: modules/mycred-module-addons.php:297
2124
  #@ mycred
2125
  msgid "Activate Add-on"
2126
  msgstr ""
2127
 
2128
- #: modules/mycred-module-addons.php:298
2129
  #@ mycred
2130
  msgid "Activate"
2131
  msgstr ""
2132
 
2133
- #: modules/mycred-module-addons.php:315
2134
  #@ mycred
2135
  msgid "Version"
2136
  msgstr ""
2137
 
2138
- #: modules/mycred-module-addons.php:318
2139
  #@ mycred
2140
  msgid "By"
2141
  msgstr ""
2142
 
2143
- #: modules/mycred-module-addons.php:318
2144
  #@ mycred
2145
  msgid "View Authors Website"
2146
  msgstr ""
2147
 
2148
- #: modules/mycred-module-addons.php:321
2149
  #@ mycred
2150
  msgid "View Add-ons Website"
2151
  msgstr ""
2152
 
2153
- #: modules/mycred-module-addons.php:321
2154
  #@ mycred
2155
  msgid "Visit Website"
2156
  msgstr ""
2157
 
2158
- #: includes/mycred-network.php:138
 
2159
  #: modules/mycred-module-general.php:19
2160
  #: modules/mycred-module-general.php:20
2161
  #: modules/mycred-module-general.php:21
2162
  #: modules/mycred-module-general.php:47
2163
- #: modules/mycred-module-log.php:301
2164
- #: mycred.php:103
2165
  #@ mycred
2166
  msgid "Settings"
2167
  msgstr ""
@@ -2199,7 +2171,7 @@ msgstr ""
2199
  msgid "Adding an underscore at the beginning of template tag for names will return them in lowercase. i.e. %_singular%"
2200
  msgstr ""
2201
 
2202
- #: includes/mycred-install.php:471
2203
  #: modules/mycred-module-general.php:74
2204
  #@ mycred
2205
  msgid "Presentation"
@@ -2234,142 +2206,142 @@ msgid "Update Settings"
2234
  msgstr ""
2235
 
2236
  #: modules/mycred-module-help.php:88
2237
- #: modules/mycred-module-hooks.php:25
2238
- #: modules/mycred-module-hooks.php:26
2239
- #: modules/mycred-module-hooks.php:27
2240
- #: modules/mycred-module-hooks.php:166
2241
  #@ mycred
2242
  msgid "Hooks"
2243
  msgstr ""
2244
 
2245
- #: modules/mycred-module-hooks.php:85
2246
  #, php-format
2247
  #@ mycred
2248
  msgid "%plural% for registrations"
2249
  msgstr ""
2250
 
2251
- #: modules/mycred-module-hooks.php:86
2252
  #@ mycred
2253
  msgid "Award %_plural% for users joining your website."
2254
  msgstr ""
2255
 
2256
- #: modules/mycred-module-hooks.php:90
2257
  #, php-format
2258
  #@ mycred
2259
  msgid "%plural% for logins"
2260
  msgstr ""
2261
 
2262
- #: modules/mycred-module-hooks.php:91
2263
  #@ mycred
2264
  msgid "Award %_plural% for logging in to your website. You can also set an optional limit."
2265
  msgstr ""
2266
 
2267
- #: modules/mycred-module-hooks.php:95
2268
  #, php-format
2269
  #@ mycred
2270
  msgid "%plural% for publishing content"
2271
  msgstr ""
2272
 
2273
- #: modules/mycred-module-hooks.php:96
2274
  #@ mycred
2275
  msgid "Award %_plural% for publishing content on your website. If your custom post type is not shown bellow, make sure it is set to \"Public\"."
2276
  msgstr ""
2277
 
2278
- #: modules/mycred-module-hooks.php:100
2279
  #, php-format
2280
  #@ mycred
2281
  msgid "%plural% for comments"
2282
  msgstr ""
2283
 
2284
- #: modules/mycred-module-hooks.php:101
2285
  #@ mycred
2286
  msgid "Award %_plural% for making comments."
2287
  msgstr ""
2288
 
2289
- #: modules/mycred-module-hooks.php:108
2290
  #@ mycred
2291
  msgid "Invite Anyone Plugin"
2292
  msgstr ""
2293
 
2294
- #: modules/mycred-module-hooks.php:109
2295
  #@ mycred
2296
  msgid "Awards %_plural% for sending invitations and/or %_plural% if the invite is accepted."
2297
  msgstr ""
2298
 
2299
- #: modules/mycred-module-hooks.php:117
2300
  #@ mycred
2301
  msgid "Contact Form 7 Form Submissions"
2302
  msgstr ""
2303
 
2304
- #: modules/mycred-module-hooks.php:118
2305
  #@ mycred
2306
  msgid "Awards %_plural% for successful form submissions (by logged in users)."
2307
  msgstr ""
2308
 
2309
- #: modules/mycred-module-hooks.php:167
2310
  #@ mycred
2311
  msgid "Hooks are instances where %_plural% are awarded or deducted from a user, depending on their actions around your website."
2312
  msgstr ""
2313
 
2314
- #: modules/mycred-module-hooks.php:192
2315
  #@ mycred
2316
  msgid "Update Changes"
2317
  msgstr ""
2318
 
2319
- #: modules/mycred-module-hooks.php:430
2320
- #: modules/mycred-module-hooks.php:967
2321
- #: modules/mycred-module-hooks.php:988
2322
  #@ mycred
2323
  msgid "Limit"
2324
  msgstr ""
2325
 
2326
- #: modules/mycred-module-hooks.php:527
2327
  #, php-format
2328
  #@ mycred
2329
  msgid "%plural% for Posts"
2330
  msgstr ""
2331
 
2332
- #: modules/mycred-module-hooks.php:540
2333
  #, php-format
2334
  #@ mycred
2335
  msgid "%plural% for Pages"
2336
  msgstr ""
2337
 
2338
- #: modules/mycred-module-hooks.php:575
2339
  #, php-format
2340
  #@ mycred
2341
  msgid "%plural% for %s"
2342
  msgstr ""
2343
 
2344
- #: modules/mycred-module-hooks.php:955
2345
  #, php-format
2346
  #@ mycred
2347
  msgid "%plural% for Sending An Invite"
2348
  msgstr ""
2349
 
2350
- #: modules/mycred-module-hooks.php:971
2351
  #@ mycred
2352
  msgid "Maximum number of invites that grants %_plural%. User zero for unlimited."
2353
  msgstr ""
2354
 
2355
- #: modules/mycred-module-hooks.php:975
2356
  #, php-format
2357
  #@ mycred
2358
  msgid "%plural% for Accepting An Invite"
2359
  msgstr ""
2360
 
2361
- #: modules/mycred-module-hooks.php:979
2362
  #, php-format
2363
  #@ mycred
2364
  msgid "%plural% for each invited user that accepts an invitation."
2365
  msgstr ""
2366
 
2367
- #: modules/mycred-module-hooks.php:992
2368
  #@ mycred
2369
  msgid "Maximum number of accepted invitations that grants %_plural%. User zero for unlimited."
2370
  msgstr ""
2371
 
2372
- #: modules/mycred-module-hooks.php:1089
2373
  #@ mycred
2374
  msgid "No forms found."
2375
  msgstr ""
@@ -2385,60 +2357,57 @@ msgstr ""
2385
  msgid "Activity Log"
2386
  msgstr ""
2387
 
2388
- #: modules/mycred-module-log.php:83
2389
  #@ mycred
2390
  msgid "Entries"
2391
  msgstr ""
2392
 
2393
- #: modules/mycred-module-log.php:165
2394
  #@ mycred
2395
  msgid "Show all references"
2396
  msgstr ""
2397
 
2398
- #: modules/mycred-module-log.php:179
2399
  #@ mycred
2400
  msgid "Show all users"
2401
  msgstr ""
2402
 
2403
- #: modules/mycred-module-log.php:190
2404
  #@ mycred
2405
  msgid "Filter"
2406
  msgstr ""
2407
 
2408
- #: modules/mycred-module-log.php:259
2409
- #: modules/mycred-module-log.php:261
2410
  #@ mycred
2411
  msgid "Search Log"
2412
  msgstr ""
2413
 
2414
- #: modules/mycred-module-log.php:288
2415
  #@ mycred
2416
  msgid "entry"
2417
  msgid_plural "entries"
2418
  msgstr[0] ""
2419
  msgstr[1] ""
2420
 
2421
- #: modules/mycred-module-log.php:307
2422
  #@ mycred
2423
  msgid "Search results for"
2424
  msgstr ""
2425
 
2426
- #: modules/mycred-module-log.php:311
2427
- #@ mycred
2428
- msgid "<strong>my</strong>CRED "
2429
- msgstr ""
2430
-
2431
- #: modules/mycred-module-log.php:700
2432
  #@ mycred
2433
  msgid "User"
2434
  msgstr ""
2435
 
2436
- #: modules/mycred-module-log.php:703
2437
  #@ mycred
2438
  msgid "Entry"
2439
  msgstr ""
2440
 
2441
- #: modules/mycred-module-log.php:837
2442
  #@ mycred
2443
  msgid "No log entries found"
2444
  msgstr ""
@@ -2464,16 +2433,16 @@ msgstr ""
2464
  msgid "click to close"
2465
  msgstr ""
2466
 
2467
- #: mycred.php:356
2468
  #@ mycred
2469
  msgid "My Balance: "
2470
  msgstr ""
2471
 
 
2472
  #: addons/gateway/carts/mycred-woocommerce.php:34
2473
  #: includes/mycred-network.php:53
2474
  #: includes/mycred-network.php:54
2475
- #: mycred.php:373
2476
- #: mycred.php:374
2477
  #@ mycred
2478
  msgid "myCRED"
2479
  msgstr ""
@@ -2488,98 +2457,98 @@ msgstr ""
2488
  msgid "If you use a negative value and the user does not have enough %_plural% the \"Join Group\" button will be disabled."
2489
  msgstr ""
2490
 
2491
- #: addons/buy-creds/gateways/netbilling.php:655
2492
  #@ mycred
2493
  msgid "Disable AVS (Address Verification System) for credit card transactions."
2494
  msgstr ""
2495
 
2496
- #: addons/buy-creds/gateways/netbilling.php:659
2497
  #@ mycred
2498
  msgid "Disable CVV2 (Card Verification Value 2) for credit card transactions."
2499
  msgstr ""
2500
 
2501
- #: addons/buy-creds/gateways/netbilling.php:663
2502
  #@ mycred
2503
  msgid "Disable all fraud protection other than AVS/CVV2. (This implies disable_negative_db)"
2504
  msgstr ""
2505
 
2506
- #: addons/buy-creds/gateways/netbilling.php:667
2507
  #@ mycred
2508
  msgid "Disable only the negative database component of the fraud protection system."
2509
  msgstr ""
2510
 
2511
- #: addons/buy-creds/gateways/netbilling.php:671
2512
  #@ mycred
2513
  msgid "Disable automatic sending of both merchant and customer email receipts."
2514
  msgstr ""
2515
 
2516
- #: addons/buy-creds/gateways/netbilling.php:675
2517
  #@ mycred
2518
  msgid "Disable immediate rejection of expired cards."
2519
  msgstr ""
2520
 
2521
- #: addons/buy-creds/gateways/paypal-standard.php:364
2522
- #: addons/buy-creds/myCRED-addon-buy-creds.php:744
2523
  #@ mycred
2524
  msgid "For this gateway to work, you must login to your PayPal account and under \"Profile\" > \"Selling Tools\" enable \"Instant Payment Notifications\". Make sure the \"Notification URL\" is set to the above address and that you have selected \"Receive IPN messages (Enabled)\"."
2525
  msgstr ""
2526
 
2527
- #: addons/buy-creds/myCRED-addon-buy-creds.php:183
2528
  #@ mycred
2529
  msgid "buyCRED"
2530
  msgstr ""
2531
 
2532
- #: addons/buy-creds/myCRED-addon-buy-creds.php:192
2533
  #@ mycred
2534
  msgid "Login Template"
2535
  msgstr ""
2536
 
2537
- #: addons/buy-creds/myCRED-addon-buy-creds.php:196
2538
  #@ mycred
2539
  msgid "Content to show when a user is not logged in."
2540
  msgstr ""
2541
 
2542
- #: addons/transfer/myCRED-addon-transfer.php:217
2543
  #@ mycred
2544
  msgid "Text to show when users are not logged in. Leave empty to hide. No HTML elements allowed!"
2545
  msgstr ""
2546
 
2547
- #: addons/transfer/myCRED-addon-transfer.php:223
2548
  #@ mycred
2549
  msgid "Template to use when displaying the users balance (if included). No HTML elements allowed!"
2550
  msgstr ""
2551
 
2552
- #: addons/transfer/myCRED-addon-transfer.php:229
2553
  #@ mycred
2554
  msgid "Template to use when displaying limits (if used). No HTML elements allowed!"
2555
  msgstr ""
2556
 
2557
- #: addons/transfer/myCRED-addon-transfer.php:235
2558
  #@ mycred
2559
  msgid "Send Transfer button template. No HTML elements allowed!"
2560
  msgstr ""
2561
 
2562
- #: addons/transfer/myCRED-addon-transfer.php:243
2563
  #@ mycred
2564
  msgid "Text to show when a users balance is to low for transfers. Leave empty to hide. No HTML elements allowed!"
2565
  msgstr ""
2566
 
2567
- #: addons/transfer/myCRED-addon-transfer.php:249
2568
  #@ mycred
2569
  msgid "Text to show when a user has reached their transfer limit (if used). Leave empty to hide. No HTML elements allowed!"
2570
  msgstr ""
2571
 
2572
- #: includes/mycred-install.php:371
2573
  #@ mycred
2574
  msgid "Step"
2575
  msgstr ""
2576
 
2577
- #: includes/mycred-install.php:394
2578
  #@ mycred
2579
  msgid "Click \"Begin Setup\" to install myCRED. You will be able to select your points format, layout and security settings."
2580
  msgstr ""
2581
 
2582
- #: includes/mycred-install.php:452
2583
  #@ mycred
2584
  msgid "Select the format you want to use for your points."
2585
  msgstr ""
@@ -2590,42 +2559,27 @@ msgstr ""
2590
  msgid "Network Settings"
2591
  msgstr ""
2592
 
2593
- #: includes/mycred-network.php:127
2594
  #@ mycred
2595
  msgid "Network"
2596
  msgstr ""
2597
 
2598
- #: includes/mycred-network.php:132
2599
  #@ mycred
2600
  msgid "Network Settings Updated"
2601
  msgstr ""
2602
 
2603
- #: includes/mycred-network.php:134
2604
- #@ mycred
2605
- msgid "Configure network settings for <strong>my</strong>CRED."
2606
- msgstr ""
2607
-
2608
- #: includes/mycred-network.php:140
2609
  #@ mycred
2610
  msgid "Master Template"
2611
  msgstr ""
2612
 
2613
- #: includes/mycred-network.php:151
2614
- #@ mycred
2615
- msgid "If enabled, your main site's <strong>my</strong>CRED setup will be used for all other sites."
2616
- msgstr ""
2617
-
2618
- #: includes/mycred-network.php:154
2619
  #@ mycred
2620
  msgid "Site Block"
2621
  msgstr ""
2622
 
2623
- #: includes/mycred-network.php:158
2624
- #@ mycred
2625
- msgid "Comma separated list of blog ids where <strong>my</strong>CRED is to be disabled."
2626
- msgstr ""
2627
-
2628
- #: includes/mycred-network.php:167
2629
  #@ mycred
2630
  msgid "Save Network Settings"
2631
  msgstr ""
@@ -2635,7 +2589,7 @@ msgstr ""
2635
  msgid "Template Tags"
2636
  msgstr ""
2637
 
2638
- #: mycred.php:116
2639
  #@ mycred
2640
  msgid "myCRED is blocked for this site. Please contact your network administrator for further details."
2641
  msgstr ""
@@ -2661,9 +2615,9 @@ msgstr ""
2661
  #: addons/buddypress/hooks/bp-profile.php:389
2662
  #: addons/buddypress/hooks/bp-profile.php:402
2663
  #: addons/buddypress/hooks/bp-profile.php:415
2664
- #: modules/mycred-module-hooks.php:427
2665
- #: modules/mycred-module-hooks.php:964
2666
- #: modules/mycred-module-hooks.php:985
2667
  #: modules/mycred-module-subscriptions.php:488
2668
  #: modules/mycred-module-subscriptions.php:501
2669
  #@ mycred
@@ -2672,24 +2626,26 @@ msgstr ""
2672
 
2673
  #: addons/buddypress/hooks/bp-press.php:115
2674
  #: addons/buddypress/hooks/bp-press.php:128
2675
- #: modules/mycred-module-hooks.php:537
2676
- #: modules/mycred-module-hooks.php:550
2677
- #: modules/mycred-module-hooks.php:585
2678
- #: modules/mycred-module-hooks.php:1119
 
 
2679
  #@ mycred
2680
  msgid "Available template tags: General, Post"
2681
  msgstr ""
2682
 
2683
  #: addons/buddypress/hooks/bp-profile.php:350
2684
  #: addons/buddypress/hooks/bp-profile.php:363
2685
- #: addons/transfer/myCRED-addon-transfer.php:180
2686
- #: addons/transfer/myCRED-addon-transfer.php:187
2687
- #: modules/mycred-module-hooks.php:293
2688
  #@ mycred
2689
  msgid "Available template tags: General, User"
2690
  msgstr ""
2691
 
2692
- #: addons/buddypress/myCRED-addon-buddypress.php:394
2693
  #, php-format
2694
  #@ mycred
2695
  msgid "Available template tags are: %creds%, %number%, %rank%"
@@ -2700,224 +2656,217 @@ msgstr ""
2700
  msgid "Let users pay using their myCRED balance."
2701
  msgstr ""
2702
 
2703
- #: addons/gateway/carts/mycred-woocommerce.php:60
2704
  #@ mycred
2705
  msgid "Enable/Disable"
2706
  msgstr ""
2707
 
2708
- #: addons/gateway/carts/mycred-woocommerce.php:62
2709
  #@ mycred
2710
  msgid "Enable myCRED Payment"
2711
  msgstr ""
2712
 
2713
- #: addons/gateway/carts/mycred-woocommerce.php:64
2714
  #@ mycred
2715
  msgid "Users who are not logged in or excluded from using myCRED will not have access to this gateway!"
2716
  msgstr ""
2717
 
2718
- #: addons/gateway/carts/mycred-woocommerce.php:69
2719
  #@ mycred
2720
  msgid "Title to show for this payment option."
2721
  msgstr ""
2722
 
2723
- #: addons/gateway/carts/mycred-woocommerce.php:70
2724
  #@ mycred
2725
  msgid "Pay with myCRED"
2726
  msgstr ""
2727
 
2728
- #: addons/gateway/carts/mycred-woocommerce.php:74
2729
  #@ mycred
2730
  msgid "Customer Message"
2731
  msgstr ""
2732
 
2733
- #: addons/gateway/carts/mycred-woocommerce.php:76
2734
  #@ mycred
2735
  msgid "Deduct the amount from your %_plural% balance."
2736
  msgstr ""
2737
 
2738
- #: addons/gateway/carts/mycred-woocommerce.php:81
 
2739
  #, php-format
2740
  #@ mycred
2741
  msgid "Log entry template for successful payments. Available template tags: %order_id%, %order_link%"
2742
  msgstr ""
2743
 
2744
- #: addons/gateway/carts/mycred-woocommerce.php:82
2745
  #, php-format
2746
  #@ mycred
2747
  msgid "Payment for Order: #%order_id%"
2748
  msgstr ""
2749
 
2750
- #: addons/gateway/carts/mycred-woocommerce.php:87
 
2751
  #, php-format
2752
  #@ mycred
2753
  msgid "How much is 1 %_singular% worth in %currency%?"
2754
  msgstr ""
2755
 
2756
- #: addons/gateway/carts/mycred-woocommerce.php:99
2757
  #@ mycred
2758
  msgid "Show Total"
2759
  msgstr ""
2760
 
2761
- #: addons/gateway/carts/mycred-woocommerce.php:101
2762
  #@ mycred
2763
  msgid "Show the final price in %_plural% ."
2764
  msgstr ""
2765
 
2766
- #: addons/gateway/carts/mycred-woocommerce.php:103
2767
  #@ mycred
2768
  msgid "Do not show"
2769
  msgstr ""
2770
 
2771
- #: addons/gateway/carts/mycred-woocommerce.php:104
2772
  #@ mycred
2773
  msgid "Show in Cart"
2774
  msgstr ""
2775
 
2776
- #: addons/gateway/carts/mycred-woocommerce.php:105
2777
  #@ mycred
2778
  msgid "Show on Checkout Page"
2779
  msgstr ""
2780
 
2781
- #: addons/gateway/carts/mycred-woocommerce.php:106
2782
  #@ mycred
2783
  msgid "Show in Cart and on Checkout Page"
2784
  msgstr ""
2785
 
2786
- #: addons/gateway/carts/mycred-woocommerce.php:111
2787
  #@ mycred
2788
  msgid "Label"
2789
  msgstr ""
2790
 
2791
- #: addons/gateway/carts/mycred-woocommerce.php:113
2792
  #@ mycred
2793
  msgid "Order Total in %_plural%"
2794
  msgstr ""
2795
 
2796
- #: addons/gateway/carts/mycred-woocommerce.php:140
2797
  #@ mycred
2798
  msgid "myCRED Payment"
2799
  msgstr ""
2800
 
2801
- #: addons/gateway/carts/mycred-woocommerce.php:141
2802
  #@ mycred
2803
  msgid "Allows users to pay using their myCRED %_singular% balance. Please note that users with insufficient funds and users who are not logged in will not see this payment gateway on the checkout page."
2804
  msgstr ""
2805
 
2806
- #: addons/gateway/carts/mycred-woocommerce.php:162
2807
  #@ mycred
2808
  msgid "You must be logged in to pay with %_plural%"
2809
  msgstr ""
2810
 
2811
- #: addons/gateway/carts/mycred-woocommerce.php:168
2812
  #@ mycred
2813
  msgid "You can not use this gateway. Please try a different payment option."
2814
  msgstr ""
2815
 
2816
- #: addons/gateway/carts/mycred-woocommerce.php:180
2817
  #@ mycred
2818
  msgid "Insufficient funds. Please try a different payment option."
2819
  msgstr ""
2820
 
2821
- #: addons/gateway/carts/mycred-woocommerce.php:201
2822
  #@ mycred
2823
  msgid "Your account has successfully been charged."
2824
  msgstr ""
2825
 
2826
- #: addons/gateway/carts/mycred-woocommerce.php:391
2827
  #@ mycred
2828
  msgid "Your current balance"
2829
  msgstr ""
2830
 
2831
- #: modules/mycred-module-hooks.php:805
2832
- #: modules/mycred-module-hooks.php:817
2833
- #: modules/mycred-module-hooks.php:829
2834
  #@ mycred
2835
  msgid "Available template tags: General, Comment"
2836
  msgstr ""
2837
 
2838
- #: modules/mycred-module-hooks.php:796
2839
  #@ mycred
2840
  msgid "Approved Comment"
2841
  msgstr ""
2842
 
2843
- #: modules/mycred-module-hooks.php:808
2844
  #@ mycred
2845
  msgid "Comment Marked SPAM"
2846
  msgstr ""
2847
 
2848
- #: modules/mycred-module-hooks.php:820
2849
  #@ mycred
2850
  msgid "Trashed / Unapproved Comments"
2851
  msgstr ""
2852
 
2853
- #: addons/buy-creds/myCRED-addon-buy-creds.php:723
2854
- #@ mycred
2855
- msgid "Buy Creds"
2856
- msgstr ""
2857
-
2858
- #: addons/buy-creds/myCRED-addon-buy-creds.php:725
2859
  #@ mycred
2860
  msgid "This add-on lets your users buy %_plural% using a payment gateway."
2861
  msgstr ""
2862
 
2863
- #: addons/buy-creds/myCRED-addon-buy-creds.php:726
2864
  #@ mycred
2865
  msgid "Supported Gateways"
2866
  msgstr ""
2867
 
2868
- #: addons/buy-creds/myCRED-addon-buy-creds.php:727
2869
- #@ mycred
2870
- msgid "myCRED supports purchases though: PayPal Payments Standard, Skrill (Moneybookers) and NETbilling. Let us know if you want to add other payment gateways."
2871
- msgstr ""
2872
-
2873
- #: addons/buy-creds/myCRED-addon-buy-creds.php:728
2874
- #: addons/sell-content/myCRED-addon-sell-content.php:692
2875
- #: addons/transfer/myCRED-addon-transfer.php:468
2876
  #@ mycred
2877
  msgid "Usage"
2878
  msgstr ""
2879
 
2880
- #: addons/buy-creds/myCRED-addon-buy-creds.php:729
2881
  #@ mycred
2882
  msgid "Purchases can be made using one of the following shortcodes:"
2883
  msgstr ""
2884
 
2885
- #: addons/buy-creds/myCRED-addon-buy-creds.php:731
2886
  #@ mycred
2887
  msgid "When you want to sell a pre-set amount, sell to a specific user or use a specific gateway.<br />For more information on how to use the shortcode, please visit the"
2888
  msgstr ""
2889
 
2890
- #: addons/buy-creds/myCRED-addon-buy-creds.php:732
2891
  #@ mycred
2892
  msgid "When you want to give your users the option to select an amount, gateway or recipient.<br />For more information on how to use the shortcode, please visit the"
2893
  msgstr ""
2894
 
2895
- #: addons/buy-creds/myCRED-addon-buy-creds.php:742
2896
  #@ mycred
2897
  msgid "Make sure you select a currency that your PayPal account supports. Otherwise transactions will not be approved until you login to your PayPal account and Accept each transaction! Purchases made in a currency that is not supported will not be applied to the buyer until you have resolved the issue."
2898
  msgstr ""
2899
 
2900
- #: addons/buy-creds/myCRED-addon-buy-creds.php:743
2901
  #@ mycred
2902
  msgid "Instant Payment Notifications"
2903
  msgstr ""
2904
 
2905
- #: addons/buy-creds/myCRED-addon-buy-creds.php:748
2906
  #@ mycred
2907
  msgid "Skrill"
2908
  msgstr ""
2909
 
2910
- #: addons/buy-creds/myCRED-addon-buy-creds.php:751
2911
  #@ mycred
2912
  msgid "Transactions made while Sandbox mode is active are real transactions! Remember to use your \"Test Merchant Account\" when Sandbox mode is active!"
2913
  msgstr ""
2914
 
2915
- #: addons/buy-creds/myCRED-addon-buy-creds.php:753
2916
  #@ mycred
2917
  msgid "By default all Skrill Merchant account accept payments via Bank Transfers. When a user selects this option, no points are awarded! You will need to manually award these once the bank transfer is completed."
2918
  msgstr ""
2919
 
2920
- #: addons/buy-creds/myCRED-addon-buy-creds.php:754
 
2921
  #@ mycred
2922
  msgid "By default purchases made using Skrill will result in users having to signup for a Skrill account (if they do not have one already). You can contact Skrill Merchant Services and request to disable this feature."
2923
  msgstr ""
@@ -3006,37 +2955,37 @@ msgstr ""
3006
  msgid "Please note that the meta key is case sensitive and can not contain whitespaces!"
3007
  msgstr ""
3008
 
3009
- #: addons/sell-content/myCRED-addon-sell-content.php:689
3010
  #@ mycred
3011
  msgid "This add-on lets you sell either entire contents or parts of it. You can select if you want to just charge users or share a percentage of the sale with the post author."
3012
  msgstr ""
3013
 
3014
- #: addons/sell-content/myCRED-addon-sell-content.php:691
3015
  #@ mycred
3016
  msgid "The default price and button label is applied to all content that is set for sale. You can select if you want to enforce these settings or let the content authors set their own."
3017
  msgstr ""
3018
 
3019
- #: addons/sell-content/myCRED-addon-sell-content.php:693
3020
  #@ mycred
3021
  msgid "You can either sell entire posts via the Sell Content Meta Box or by using the <code>mycred_sell_this</code> shortcode.<br />For more information on how to use the shortcode, please visit the"
3022
  msgstr ""
3023
 
3024
- #: addons/transfer/myCRED-addon-transfer.php:465
3025
  #@ mycred
3026
  msgid "This add-on lets your users transfer %_plural% to each other. Members who are set to be excluded can neither send or receive %_plural%."
3027
  msgstr ""
3028
 
3029
- #: addons/transfer/myCRED-addon-transfer.php:466
3030
  #@ mycred
3031
  msgid "Transfer Limit"
3032
  msgstr ""
3033
 
3034
- #: addons/transfer/myCRED-addon-transfer.php:467
3035
  #@ mycred
3036
  msgid "You can impose a daily-, weekly- or monthly transfer limit for each user. Note, that this transfer limit is imposed on everyone who are not excluded from using myCRED."
3037
  msgstr ""
3038
 
3039
- #: addons/transfer/myCRED-addon-transfer.php:469
3040
  #@ mycred
3041
  msgid "Transfers can be made by either using the <code>mycred_transfer</code> shortcode or via the myCRED Transfer Widget.<br />For more information on how to use the shortcode, please visit the"
3042
  msgstr ""
@@ -3046,38 +2995,33 @@ msgstr ""
3046
  msgid "Adjust Your Balance"
3047
  msgstr ""
3048
 
3049
- #: includes/mycred-install.php:533
3050
  #, php-format
3051
  #@ mycred
3052
  msgid "Edit Users %plural% Capability"
3053
  msgstr ""
3054
 
3055
- #: includes/mycred-install.php:545
3056
  #: modules/mycred-module-general.php:114
3057
  #, php-format
3058
  #@ mycred
3059
  msgid "Exclude those who can \"Edit Users %plural%\"."
3060
  msgstr ""
3061
 
3062
- #: includes/mycred-install.php:597
3063
  #@ mycred
3064
  msgid "Almost done! Click the button below to finish this setup."
3065
  msgstr ""
3066
 
3067
- #: includes/mycred-widgets.php:182
3068
- #: includes/mycred-widgets.php:205
3069
  #: includes/mycred-widgets.php:215
3070
- #: includes/mycred-widgets.php:345
 
3071
  #@ mycred
3072
  msgid "See the help tab for available template tags."
3073
  msgstr ""
3074
 
3075
- #: includes/mycred-widgets.php:191
3076
- #@ mycred
3077
- msgid "This will be appended after their balance. See the help tab for available template tags."
3078
- msgstr ""
3079
-
3080
- #: includes/mycred-widgets.php:199
3081
  #@ mycred
3082
  msgid "History Title"
3083
  msgstr ""
@@ -3300,6 +3244,7 @@ msgstr ""
3300
  msgid "myCRED Balance Template Tags"
3301
  msgstr ""
3302
 
 
3303
  #: modules/mycred-module-help.php:146
3304
  #: modules/mycred-module-help.php:170
3305
  #@ mycred
@@ -3330,12 +3275,6 @@ msgstr ""
3330
  msgid "Rank Format:"
3331
  msgstr ""
3332
 
3333
- #: modules/mycred-module-help.php:151
3334
- #: modules/mycred-module-help.php:172
3335
- #@ mycred
3336
- msgid "The users ranking."
3337
- msgstr ""
3338
-
3339
  #: modules/mycred-module-help.php:152
3340
  #@ mycred
3341
  msgid "History Title:"
@@ -3425,12 +3364,12 @@ msgstr ""
3425
  msgid "Here you can name your installation along with setting your layout and format. You can use any name as long as you set both the singular and plural format and you can change the name at any time."
3426
  msgstr ""
3427
 
3428
- #: modules/mycred-module-hooks.php:126
3429
  #@ mycred
3430
  msgid "Jetpack Subscriptions"
3431
  msgstr ""
3432
 
3433
- #: modules/mycred-module-hooks.php:127
3434
  #@ mycred
3435
  msgid "Awards %_plural% for users signing up for site or comment updates using Jetpack."
3436
  msgstr ""
@@ -3445,3 +3384,1255 @@ msgstr ""
3445
  msgid "Comment Subscriptions"
3446
  msgstr ""
3447
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: myCRED v1.1beta8\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2013-06-17 12:28:36+0000\n"
7
  "Last-Translator: unimatrix0 <gabriel.s@merovingi.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
51
  #: addons/buddypress/hooks/bp-profile.php:387
52
  #: addons/buddypress/hooks/bp-profile.php:400
53
  #: addons/buddypress/hooks/bp-profile.php:413
54
+ #: modules/mycred-module-hooks.php:340
55
+ #: modules/mycred-module-hooks.php:582
56
+ #: modules/mycred-module-hooks.php:595
57
+ #: modules/mycred-module-hooks.php:630
58
+ #: modules/mycred-module-hooks.php:851
59
+ #: modules/mycred-module-hooks.php:863
60
+ #: modules/mycred-module-hooks.php:875
61
+ #: modules/mycred-module-plugins.php:136
62
+ #: modules/mycred-module-plugins.php:157
63
+ #: modules/mycred-module-plugins.php:292
64
+ #: modules/mycred-module-plugins.php:546
65
  #: modules/mycred-module-subscriptions.php:486
66
  #: modules/mycred-module-subscriptions.php:499
67
  #@ mycred
223
  msgstr ""
224
 
225
  #: addons/buddypress/myCRED-addon-buddypress.php:50
226
+ #: modules/mycred-module-log.php:65
227
+ #: modules/mycred-module-log.php:424
228
  #@ mycred
229
  msgid "My History"
230
  msgstr ""
235
  msgid "%s's History"
236
  msgstr ""
237
 
238
+ #: addons/buddypress/myCRED-addon-buddypress.php:378
239
  #, php-format
240
  #@ mycred
241
  msgid "%singular% Balance"
242
  msgstr ""
243
 
244
+ #: addons/buddypress/myCRED-addon-buddypress.php:208
245
+ #: modules/mycred-module-log.php:207
246
  #@ mycred
247
  msgid "All"
248
  msgstr ""
249
 
250
+ #: addons/buddypress/myCRED-addon-buddypress.php:209
251
+ #: modules/mycred-module-log.php:208
252
  #@ mycred
253
  msgid "Today"
254
  msgstr ""
255
 
256
+ #: addons/buddypress/myCRED-addon-buddypress.php:210
257
+ #: modules/mycred-module-log.php:209
258
  #@ mycred
259
  msgid "Yesterday"
260
  msgstr ""
261
 
262
+ #: addons/buddypress/myCRED-addon-buddypress.php:211
263
+ #: modules/mycred-module-log.php:210
264
  #@ mycred
265
  msgid "This Week"
266
  msgstr ""
267
 
268
+ #: addons/buddypress/myCRED-addon-buddypress.php:212
269
+ #: modules/mycred-module-log.php:211
270
  #@ mycred
271
  msgid "This Month"
272
  msgstr ""
273
 
274
+ #: addons/buddypress/myCRED-addon-buddypress.php:336
275
  #@ default
276
  msgid "bbPress 2.0"
277
  msgstr ""
278
 
279
+ #: addons/buddypress/myCRED-addon-buddypress.php:337
280
  #@ mycred
281
  msgid "Awards %_plural% for bbPress actions."
282
  msgstr ""
283
 
284
+ #: addons/buddypress/myCRED-addon-buddypress.php:308
285
  #@ default
286
  msgid "BuddyPress: Groups"
287
  msgstr ""
288
 
289
+ #: addons/buddypress/myCRED-addon-buddypress.php:309
290
  #@ mycred
291
  msgid "Awards %_plural% for group related actions. Use minus to deduct %_plural% or zero to disable a specific hook."
292
  msgstr ""
293
 
294
+ #: addons/buddypress/myCRED-addon-buddypress.php:313
295
  #@ default
296
  msgid "BuddyPress: Members"
297
  msgstr ""
298
 
299
+ #: addons/buddypress/myCRED-addon-buddypress.php:314
300
  #@ mycred
301
  msgid "Awards %_plural% for profile related actions."
302
  msgstr ""
303
 
304
+ #: addons/buddypress/myCRED-addon-buddypress.php:320
305
  #@ default
306
  msgid "BuddyPress: Links"
307
  msgstr ""
308
 
309
+ #: addons/buddypress/myCRED-addon-buddypress.php:321
310
  #@ mycred
311
  msgid "Awards %_plural% for link related actions."
312
  msgstr ""
313
 
314
+ #: addons/buddypress/myCRED-addon-buddypress.php:328
315
  #@ default
316
  msgid "BuddyPress: Gallery Actions"
317
  msgstr ""
318
 
319
+ #: addons/buddypress/myCRED-addon-buddypress.php:329
320
  #@ mycred
321
  msgid "Awards %_plural% for creating a new gallery either using BP Album+ or BP Gallery."
322
  msgstr ""
323
 
 
324
  #: addons/buddypress/myCRED-addon-buddypress.php:357
325
+ #: addons/buddypress/myCRED-addon-buddypress.php:364
326
+ #: addons/ranks/myCRED-addon-ranks.php:529
327
  #@ mycred
328
  msgid "Do not show."
329
  msgstr ""
330
 
331
+ #: addons/buddypress/myCRED-addon-buddypress.php:358
332
+ #: addons/ranks/myCRED-addon-ranks.php:530
333
  #@ mycred
334
  msgid "Include in Profile Header."
335
  msgstr ""
336
 
337
+ #: addons/buddypress/myCRED-addon-buddypress.php:359
338
+ #: addons/ranks/myCRED-addon-ranks.php:531
339
  #@ mycred
340
  msgid "Include under the \"Profile\" tab"
341
  msgstr ""
342
 
343
+ #: addons/buddypress/myCRED-addon-buddypress.php:360
344
+ #: addons/ranks/myCRED-addon-ranks.php:532
345
  #@ mycred
346
  msgid "Include under the \"Profile\" tab and Profile Header."
347
  msgstr ""
348
 
349
+ #: addons/buddypress/myCRED-addon-buddypress.php:365
350
  #@ mycred
351
  msgid "Show in Profile"
352
  msgstr ""
353
 
354
+ #: addons/buddypress/myCRED-addon-buddypress.php:376
355
  #@ mycred
356
  msgid "BuddyPress"
357
  msgstr ""
358
 
359
+ #: addons/buddypress/myCRED-addon-buddypress.php:394
360
  #@ mycred
361
  msgid "Members can view each others %_singular% balance."
362
  msgstr ""
363
 
364
+ #: addons/buddypress/myCRED-addon-buddypress.php:399
365
  #@ mycred
366
  msgid "Template"
367
  msgstr ""
368
 
369
+ #: addons/buddypress/myCRED-addon-buddypress.php:406
370
+ #: includes/mycred-widgets.php:159
371
+ #: modules/mycred-module-log.php:66
372
  #, php-format
373
  #@ mycred
374
  msgid "%plural% History"
375
  msgstr ""
376
 
377
+ #: addons/buddypress/myCRED-addon-buddypress.php:422
378
  #@ mycred
379
  msgid "Members can view each others %_plural% history."
380
  msgstr ""
381
 
382
+ #: addons/buddypress/myCRED-addon-buddypress.php:427
383
  #@ mycred
384
  msgid "Menu Title"
385
  msgstr ""
386
 
387
+ #: addons/buddypress/myCRED-addon-buddypress.php:429
388
  #@ mycred
389
  msgid "Title shown to me"
390
  msgstr ""
391
 
392
+ #: addons/buddypress/myCRED-addon-buddypress.php:434
393
  #, php-format
394
  #@ mycred
395
  msgid "Title shown to others. Use %s to show the first name."
396
  msgstr ""
397
 
398
+ #: addons/buddypress/myCRED-addon-buddypress.php:439
399
  #@ mycred
400
  msgid "Menu Position"
401
  msgstr ""
402
 
403
+ #: addons/buddypress/myCRED-addon-buddypress.php:441
404
  #@ mycred
405
  msgid "Current menu positions:"
406
  msgstr ""
407
 
408
  #: addons/import/myCRED-addon-import.php:451
409
  #: includes/mycred-network.php:115
410
+ #: modules/mycred-module-addons.php:249
411
  #: modules/mycred-module-general.php:35
412
+ #: modules/mycred-module-hooks.php:206
413
+ #: modules/mycred-module-log.php:326
414
+ #: modules/mycred-module-log.php:402
415
  #@ mycred
416
  #@ default
417
  msgid "Access Denied"
580
  msgstr ""
581
 
582
  #: addons/buy-creds/gateways/netbilling.php:423
583
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:138
584
  #@ mycred
585
  #@ default
586
  msgid "NETbilling"
667
  msgid "Billing Details"
668
  msgstr ""
669
 
670
+ #: abstracts/mycred-abstract-hook.php:136
671
+ #: addons/buy-creds/abstracts/mycred-abstract-payment-gateway.php:512
672
+ #: addons/buy-creds/abstracts/mycred-abstract-payment-gateway.php:535
673
  #: addons/buy-creds/gateways/netbilling.php:514
674
+ #: addons/buy-creds/gateways/zombaio.php:382
675
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:231
676
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:252
677
+ #: addons/email-notices/myCRED-addon-email-notices.php:179
678
+ #: addons/email-notices/myCRED-addon-email-notices.php:738
679
  #@ mycred
680
  msgid "Select"
681
  msgstr ""
690
  msgid "Year"
691
  msgstr ""
692
 
693
+ #: addons/buy-creds/gateways/netbilling.php:607
694
+ #: addons/buy-creds/gateways/paypal-standard.php:321
695
+ #: addons/buy-creds/gateways/skrill.php:338
696
+ #: addons/buy-creds/gateways/zombaio.php:290
697
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:777
698
  #@ mycred
699
  msgid "Sandbox Mode"
700
  msgstr ""
701
 
702
+ #: addons/buy-creds/gateways/netbilling.php:613
703
  #@ mycred
704
  msgid "Account ID"
705
  msgstr ""
706
 
707
+ #: addons/buy-creds/gateways/netbilling.php:619
708
  #@ mycred
709
  msgid "Site Tag"
710
  msgstr ""
711
 
712
+ #: addons/buy-creds/gateways/netbilling.php:625
713
  #@ mycred
714
  msgid "Dynamic IP Security Code"
715
  msgstr ""
716
 
717
+ #: addons/buy-creds/gateways/netbilling.php:631
718
+ #: addons/buy-creds/gateways/paypal-standard.php:341
719
+ #: addons/buy-creds/gateways/skrill.php:364
720
  #@ mycred
721
  msgid "Item Name"
722
  msgstr ""
723
 
724
+ #: addons/buy-creds/gateways/netbilling.php:637
725
+ #: addons/buy-creds/gateways/paypal-standard.php:348
726
+ #: addons/buy-creds/gateways/skrill.php:371
727
  #, php-format
728
  #@ mycred
729
  msgid "%plural% Exchange Rate"
730
  msgstr ""
731
 
732
+ #: addons/buy-creds/gateways/netbilling.php:643
733
  #@ mycred
734
  msgid "Allowed Attempts"
735
  msgstr ""
736
 
737
+ #: addons/buy-creds/gateways/netbilling.php:647
738
  #@ mycred
739
  msgid "Maximum number of attempts allowed for purchases."
740
  msgstr ""
741
 
742
+ #: addons/buy-creds/gateways/netbilling.php:650
743
  #@ mycred
744
  msgid "Advanced"
745
  msgstr ""
746
 
747
+ #: addons/buy-creds/gateways/paypal-standard.php:225
748
+ #: addons/buy-creds/gateways/skrill.php:211
749
  #@ mycred
750
  msgid "Success"
751
  msgstr ""
752
 
753
+ #: addons/buy-creds/gateways/paypal-standard.php:226
754
+ #: addons/buy-creds/gateways/skrill.php:212
755
  #@ mycred
756
  msgid "Thank you for your purchase"
757
  msgstr ""
758
 
759
+ #: addons/buy-creds/gateways/paypal-standard.php:299
760
+ #: addons/buy-creds/gateways/skrill.php:266
 
 
 
 
 
 
761
  #@ mycred
762
  msgid "Return to "
763
  msgstr ""
764
 
765
+ #: addons/buy-creds/gateways/paypal-standard.php:304
766
+ #: addons/buy-creds/gateways/skrill.php:320
767
+ #: addons/buy-creds/gateways/zombaio.php:271
768
  #@ mycred
769
  msgid "Processing payment &hellip;"
770
  msgstr ""
771
 
772
+ #: addons/buy-creds/gateways/paypal-standard.php:327
773
+ #: addons/buy-creds/gateways/skrill.php:344
774
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:768
775
  #@ mycred
776
  msgid "Currency"
777
  msgstr ""
778
 
779
+ #: addons/buy-creds/gateways/paypal-standard.php:332
780
+ #: addons/buy-creds/gateways/skrill.php:401
781
  #@ mycred
782
  msgid "Important!"
783
  msgstr ""
784
 
785
+ #: addons/buy-creds/gateways/paypal-standard.php:332
786
  #@ mycred
787
  msgid "Make sure you select a currency that your PayPal account supports. Otherwise transactions will not be approved until you login to your PayPal account and Accept each transaction!"
788
  msgstr ""
789
 
790
+ #: addons/buy-creds/gateways/paypal-standard.php:335
791
  #@ mycred
792
  msgid "Account Email"
793
  msgstr ""
794
 
795
+ #: addons/buy-creds/gateways/paypal-standard.php:345
796
+ #: addons/buy-creds/gateways/skrill.php:368
797
  #@ mycred
798
  msgid "Description of the item being purchased by the user."
799
  msgstr ""
800
 
801
+ #: addons/buy-creds/gateways/paypal-standard.php:351
802
+ #: addons/buy-creds/gateways/skrill.php:374
803
  #@ mycred
804
  msgid "Your selected currency"
805
  msgstr ""
806
 
807
+ #: addons/buy-creds/gateways/paypal-standard.php:354
808
  #@ mycred
809
  msgid "IPN Address"
810
  msgstr ""
811
 
812
+ #: addons/buy-creds/gateways/skrill.php:303
813
  #@ mycred
814
  msgid "Product:"
815
  msgstr ""
816
 
817
+ #: addons/buy-creds/gateways/skrill.php:312
818
  #@ mycred
819
  msgid "Gift to:"
820
  msgstr ""
821
 
822
+ #: addons/buy-creds/gateways/skrill.php:313
823
  #@ mycred
824
  msgid "(author)"
825
  msgstr ""
826
 
827
+ #: addons/buy-creds/gateways/skrill.php:341
828
  #@ mycred
829
  msgid "Remember to use your Test Merchant Account when Sandbox mode is active!"
830
  msgstr ""
831
 
832
+ #: addons/buy-creds/gateways/skrill.php:351
833
  #@ mycred
834
  msgid "Merchant Account Email"
835
  msgstr ""
836
 
837
+ #: addons/buy-creds/gateways/skrill.php:357
838
  #@ mycred
839
  msgid "Secret Word"
840
  msgstr ""
841
 
842
+ #: addons/buy-creds/gateways/skrill.php:361
843
  #@ mycred
844
  msgid "You can set your secret word under \"Merchant Tools\" in your Skrill Account."
845
  msgstr ""
846
 
847
+ #: addons/buy-creds/gateways/skrill.php:377
848
  #@ mycred
849
  msgid "Confirmation Email"
850
  msgstr ""
851
 
852
+ #: addons/buy-creds/gateways/skrill.php:380
853
  #@ mycred
854
  msgid "Ask Skrill to send me a confirmation email for each successful purchase."
855
  msgstr ""
856
 
857
+ #: addons/buy-creds/gateways/skrill.php:383
858
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:779
859
  #@ mycred
860
  msgid "Checkout Page"
861
  msgstr ""
862
 
863
+ #: addons/buy-creds/gateways/skrill.php:386
864
+ #: addons/gateway/carts/mycred-woocommerce.php:75
865
+ #: addons/transfer/myCRED-addon-transfer.php:581
866
+ #: includes/mycred-widgets.php:185
867
+ #: includes/mycred-widgets.php:356
868
  #@ mycred
869
  msgid "Title"
870
  msgstr ""
871
 
872
+ #: addons/buy-creds/gateways/skrill.php:388
873
  #@ mycred
874
  msgid "If left empty, your account email is used as title on the Skill Payment Page."
875
  msgstr ""
876
 
877
+ #: addons/buy-creds/gateways/skrill.php:391
878
+ #: addons/buy-creds/gateways/zombaio.php:314
879
  #@ mycred
880
  msgid "Logo URL"
881
  msgstr ""
882
 
883
+ #: addons/buy-creds/gateways/skrill.php:393
884
  #@ mycred
885
  msgid "The URL to the image you want to use on the top of the gateway. For best integration results we recommend you use logos with dimensions up to 200px in width and 50px in height."
886
  msgstr ""
887
 
888
+ #: addons/buy-creds/gateways/skrill.php:396
889
  #@ mycred
890
  msgid "Confirmation Note"
891
  msgstr ""
892
 
893
+ #: addons/buy-creds/gateways/skrill.php:398
894
  #@ mycred
895
  msgid "Optional text to show user once a transaction has been successfully completed. This text is shown by Skrill."
896
  msgstr ""
897
 
898
+ #: addons/buy-creds/gateways/skrill.php:402
899
  #@ mycred
900
  msgid "By default all Skrill Merchant account accept payments via Bank Transfers. When a user selects this option, no %_plural% are awarded! You will need to manually award these once the bank transfer is completed."
901
  msgstr ""
902
 
 
 
 
 
 
 
903
  #: addons/buy-creds/myCRED-addon-buy-creds.php:48
904
  #: addons/buy-creds/myCRED-addon-buy-creds.php:49
905
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:50
906
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:315
907
  #@ mycred
908
  msgid "Payment Gateways"
909
  msgstr ""
910
 
911
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:134
912
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:766
913
  #@ default
914
  #@ mycred
915
  msgid "PayPal Payments Standard"
916
  msgstr ""
917
 
918
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:142
919
  #@ default
920
  msgid "Skrill (Moneybookers)"
921
  msgstr ""
922
 
923
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:168
924
  #@ mycred
925
  msgid "Please login to purchase %_plural%"
926
  msgstr ""
927
 
928
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:182
929
  #, php-format
930
  #@ mycred
931
  msgid "Gift purchase from %display_name%."
932
  msgstr ""
933
 
934
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:195
935
+ #: addons/ranks/myCRED-addon-ranks.php:372
936
  #, php-format
937
  #@ mycred
938
  msgid "Minimum %plural%"
939
  msgstr ""
940
 
941
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:199
942
  #, php-format
943
  #@ mycred
944
  msgid "Minimum amount of %plural% a user must purchase. Will default to 1."
945
  msgstr ""
946
 
947
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:216
948
  #@ mycred
949
  msgid "Thank You Page"
950
  msgstr ""
951
 
952
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:219
953
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:240
954
  #@ mycred
955
  msgid "Custom URL"
956
  msgstr ""
957
 
958
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:224
959
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:245
960
  #@ mycred
961
  msgid "Page"
962
  msgstr ""
963
 
964
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:237
965
  #@ mycred
966
  msgid "Cancellation Page"
967
  msgstr ""
968
 
969
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:258
970
  #@ mycred
971
  msgid "Gifting"
972
  msgstr ""
973
 
974
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:260
975
  #@ mycred
976
  msgid "Allow users to buy %_plural% for other users."
977
  msgstr ""
978
 
979
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:261
980
  #@ mycred
981
  msgid "Allow users to buy %_plural% for content authors."
982
  msgstr ""
983
 
984
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:209
985
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:264
986
+ #: addons/gateway/carts/mycred-marketpress.php:292
987
+ #: addons/gateway/carts/mycred-woocommerce.php:87
988
+ #: modules/mycred-module-hooks.php:475
989
+ #: modules/mycred-module-hooks.php:1079
990
+ #: modules/mycred-module-plugins.php:380
991
+ #: modules/mycred-module-plugins.php:382
992
+ #: modules/mycred-module-plugins.php:391
993
+ #: modules/mycred-module-plugins.php:670
994
+ #: modules/mycred-module-plugins.php:790
995
+ #: modules/mycred-module-plugins.php:803
996
+ #: modules/mycred-module-plugins.php:950
997
+ #: modules/mycred-module-plugins.php:963
998
  #@ mycred
999
  msgid "Log Template"
1000
  msgstr ""
1001
 
1002
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:266
1003
  #, php-format
1004
  #@ default
1005
  msgid "Available template tags: %singular%, %plural% and %display_name%"
1006
  msgstr ""
1007
 
1008
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:310
1009
  #: modules/mycred-module-general.php:42
1010
+ #: modules/mycred-module-hooks.php:213
1011
  #@ mycred
1012
  msgid "Settings Updated"
1013
  msgstr ""
1014
 
1015
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:316
1016
  #, php-format
1017
  #@ mycred
1018
  msgid "Select the payment gateways you want to offer your users to buy %plural%."
1019
  msgstr ""
1020
 
1021
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:339
1022
+ #: modules/mycred-module-hooks.php:231
1023
  #@ mycred
1024
  msgid "Enable"
1025
  msgstr ""
1026
 
1027
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:357
1028
  #@ mycred
1029
  msgid "Update Gateway Settings"
1030
  msgstr ""
1031
 
1032
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:421
1033
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:531
1034
  #@ mycred
1035
  msgid "No gateways installed."
1036
  msgstr ""
1037
 
1038
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:422
1039
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:532
1040
  #@ mycred
1041
  msgid "Gateway does not exist."
1042
  msgstr ""
1043
 
1044
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:458
1045
  #@ mycred
1046
  msgid "Yourself"
1047
  msgstr ""
1048
 
1049
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:533
1050
  #@ mycred
1051
  msgid "No active gateways found."
1052
  msgstr ""
1053
 
1054
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:534
1055
  #@ mycred
1056
  msgid "The selected gateway is not active."
1057
  msgstr ""
1058
 
1059
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:574
1060
  #@ mycred
1061
  msgid "Buy with"
1062
  msgstr ""
1063
 
1064
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:578
1065
  #: addons/sell-content/myCRED-addon-sell-content.php:42
1066
  #@ mycred
1067
  msgid "Buy Now"
1068
  msgstr ""
1069
 
1070
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:611
1071
  #@ mycred
1072
  msgid "No users found"
1073
  msgstr ""
1074
 
1075
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:621
1076
  #@ mycred
1077
  msgid "To"
1078
  msgstr ""
1079
 
1080
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:638
1081
  #@ mycred
1082
  msgid "Select Amount"
1083
  msgstr ""
1084
 
1085
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:660
1086
  #@ mycred
1087
  msgid "Amount"
1088
  msgstr ""
1089
 
1090
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:662
1091
  #@ mycred
1092
  msgid "min."
1093
  msgstr ""
1094
 
1095
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:670
1096
  #@ mycred
1097
  msgid "Select Gateway"
1098
  msgstr ""
1117
  msgid "Click here if you are not automatically redirected"
1118
  msgstr ""
1119
 
1120
+ #: addons/buy-creds/abstracts/mycred-abstract-payment-gateway.php:863
1121
  #@ mycred
1122
  msgid "Outside US"
1123
  msgstr ""
1268
  msgid "Email"
1269
  msgstr ""
1270
 
1271
+ #: addons/gateway/carts/mycred-marketpress.php:306
1272
+ #: addons/gateway/carts/mycred-woocommerce.php:100
1273
  #: addons/import/myCRED-addon-import.php:518
1274
  #: addons/import/myCRED-addon-import.php:587
1275
  #: addons/import/myCRED-addon-import.php:651
1390
  "<p><strong>Price</strong>: %price%</p>"
1391
  msgstr ""
1392
 
1393
+ #: addons/sell-content/myCRED-addon-sell-content.php:47
1394
  #, php-format
1395
  #@ mycred
1396
  msgid "Purchase of %link_with_title%"
1397
  msgstr ""
1398
 
1399
+ #: addons/sell-content/myCRED-addon-sell-content.php:48
1400
  #, php-format
1401
  #@ mycred
1402
  msgid "Sale of %link_with_title%"
1403
  msgstr ""
1404
 
1405
+ #: addons/sell-content/myCRED-addon-sell-content.php:292
1406
  #@ default
1407
  msgid "No Payout. Just charge."
1408
  msgstr ""
1409
 
1410
+ #: addons/sell-content/myCRED-addon-sell-content.php:293
1411
  #@ default
1412
  msgid "Pay Content Author."
1413
  msgstr ""
1414
 
1415
+ #: addons/sell-content/myCRED-addon-sell-content.php:297
1416
+ #: addons/sell-content/myCRED-addon-sell-content.php:1045
1417
  #@ mycred
1418
  msgid "Sell Content"
1419
  msgstr ""
1420
 
1421
+ #: addons/sell-content/myCRED-addon-sell-content.php:299
1422
  #@ mycred
1423
  msgid "Post Types"
1424
  msgstr ""
1425
 
1426
+ #: addons/sell-content/myCRED-addon-sell-content.php:303
1427
  #@ mycred
1428
  msgid "Comma separated list of post types that can be sold."
1429
  msgstr ""
1430
 
1431
+ #: addons/sell-content/myCRED-addon-sell-content.php:306
1432
  #@ mycred
1433
  msgid "Payments"
1434
  msgstr ""
1435
 
1436
+ #: addons/sell-content/myCRED-addon-sell-content.php:320
1437
  #@ mycred
1438
  msgid "Percentage to pay Author"
1439
  msgstr ""
1440
 
1441
+ #: addons/sell-content/myCRED-addon-sell-content.php:322
1442
  #@ mycred
1443
  msgid "Percentage of the price to pay the author. Can not be zero and is ignored if authors are not paid."
1444
  msgstr ""
1445
 
1446
+ #: addons/sell-content/myCRED-addon-sell-content.php:330
1447
+ #: addons/sell-content/myCRED-addon-sell-content.php:1048
1448
  #@ mycred
1449
  msgid "Defaults"
1450
  msgstr ""
1451
 
1452
+ #: addons/sell-content/myCRED-addon-sell-content.php:333
1453
+ #: addons/sell-content/myCRED-addon-sell-content.php:530
1454
  #@ mycred
1455
  msgid "Price"
1456
  msgstr ""
1457
 
1458
+ #: addons/sell-content/myCRED-addon-sell-content.php:338
1459
  #@ mycred
1460
  msgid "Allow authors to change price."
1461
  msgstr ""
1462
 
1463
+ #: addons/sell-content/myCRED-addon-sell-content.php:342
1464
+ #: addons/sell-content/myCRED-addon-sell-content.php:534
1465
  #@ mycred
1466
  msgid "Button Label"
1467
  msgstr ""
1468
 
1469
+ #: addons/sell-content/myCRED-addon-sell-content.php:347
1470
  #@ mycred
1471
  msgid "Allow authors to change button label."
1472
  msgstr ""
1473
 
1474
+ #: addons/sell-content/myCRED-addon-sell-content.php:356
1475
  #@ mycred
1476
  msgid "Sale Template for non members"
1477
  msgstr ""
1478
 
1479
+ #: addons/sell-content/myCRED-addon-sell-content.php:360
1480
  #, php-format
1481
  #@ mycred
1482
  msgid "Do <strong>not</strong> use the %buy_button% in this template as a user must be logged in to buy content!"
1483
  msgstr ""
1484
 
1485
+ #: addons/sell-content/myCRED-addon-sell-content.php:361
1486
  #, php-format
1487
  #@ mycred
1488
  msgid "Available template tags are: %singular%, %plural%, %post_title%, %post_url%, %link_with_title%, %price%"
1489
  msgstr ""
1490
 
1491
+ #: addons/sell-content/myCRED-addon-sell-content.php:364
1492
  #@ mycred
1493
  msgid "Sale Template for members"
1494
  msgstr ""
1495
 
1496
+ #: addons/sell-content/myCRED-addon-sell-content.php:368
1497
+ #: addons/sell-content/myCRED-addon-sell-content.php:376
1498
  #, php-format
1499
  #@ mycred
1500
  msgid "Your template must contain the %buy_button% tag for purchases to work!"
1501
  msgstr ""
1502
 
1503
+ #: addons/sell-content/myCRED-addon-sell-content.php:369
1504
+ #: addons/sell-content/myCRED-addon-sell-content.php:377
1505
  #, php-format
1506
  #@ mycred
1507
  msgid "Available template tags are: %singular%, %plural%, %post_title%, %post_url%, %link_with_title%, %buy_button%, %price%"
1508
  msgstr ""
1509
 
1510
+ #: addons/sell-content/myCRED-addon-sell-content.php:372
1511
  #@ mycred
1512
  msgid "Insufficient funds template"
1513
  msgstr ""
1514
 
1515
+ #: addons/sell-content/myCRED-addon-sell-content.php:380
1516
  #@ mycred
1517
  msgid "Log template for Purchases"
1518
  msgstr ""
1519
 
1520
+ #: addons/sell-content/myCRED-addon-sell-content.php:384
1521
+ #: addons/sell-content/myCRED-addon-sell-content.php:391
1522
  #, php-format
1523
  #@ mycred
1524
  msgid "Available template tags are: %singular%, %plural%, %post_title%, %post_url% or %link_with_title%"
1525
  msgstr ""
1526
 
1527
+ #: addons/sell-content/myCRED-addon-sell-content.php:387
1528
  #@ mycred
1529
  msgid "Log template for Sales"
1530
  msgstr ""
1531
 
1532
+ #: addons/sell-content/myCRED-addon-sell-content.php:495
 
 
 
 
 
 
 
 
 
 
1533
  #@ mycred
1534
  msgid "Setup add-on"
1535
  msgstr ""
1536
 
1537
+ #: addons/sell-content/myCRED-addon-sell-content.php:495
1538
  #@ mycred
1539
  msgid "Lets do it"
1540
  msgstr ""
1541
 
1542
+ #: addons/sell-content/myCRED-addon-sell-content.php:524
1543
  #@ mycred
1544
  msgid "Enable sale of this "
1545
  msgstr ""
1546
 
1547
+ #: addons/sell-content/myCRED-addon-sell-content.php:784
1548
  #@ mycred
1549
  msgid "Thank you for your purchase!"
1550
  msgstr ""
1562
  msgstr ""
1563
 
1564
  #: addons/transfer/myCRED-addon-transfer.php:43
1565
+ #: addons/transfer/myCRED-addon-transfer.php:478
1566
  #@ mycred
1567
  msgid "Transfer"
1568
  msgstr ""
1569
 
1570
+ #: addons/transfer/myCRED-addon-transfer.php:136
1571
  #@ mycred
1572
  msgid "Transaction completed."
1573
  msgstr ""
1574
 
1575
+ #: addons/transfer/myCRED-addon-transfer.php:137
1576
  #@ mycred
1577
  msgid "Security token could not be verified. Please contact your site administrator!"
1578
  msgstr ""
1579
 
1580
+ #: addons/transfer/myCRED-addon-transfer.php:138
1581
  #@ mycred
1582
  msgid "Communications error. Please try again later."
1583
  msgstr ""
1584
 
1585
+ #: addons/transfer/myCRED-addon-transfer.php:139
1586
  #@ mycred
1587
  msgid "Recipient not found. Please try again."
1588
  msgstr ""
1589
 
1590
+ #: addons/transfer/myCRED-addon-transfer.php:140
1591
  #@ mycred
1592
  msgid "Transaction declined by recipient."
1593
  msgstr ""
1594
 
1595
+ #: addons/transfer/myCRED-addon-transfer.php:141
1596
  #@ mycred
1597
  msgid "Incorrect amount. Please try again."
1598
  msgstr ""
1599
 
1600
+ #: addons/transfer/myCRED-addon-transfer.php:142
1601
  #@ mycred
1602
  msgid "This myCRED Add-on has not yet been setup! No transfers are allowed until this has been done!"
1603
  msgstr ""
1604
 
1605
+ #: addons/transfer/myCRED-addon-transfer.php:143
1606
  #@ mycred
1607
  msgid "Insufficient funds. Please enter a lower amount."
1608
  msgstr ""
1609
 
1610
+ #: addons/transfer/myCRED-addon-transfer.php:144
1611
  #@ mycred
1612
  msgid "Transfer Limit exceeded."
1613
  msgstr ""
1614
 
1615
+ #: addons/transfer/myCRED-addon-transfer.php:145
1616
  #@ mycred
1617
  msgid "The request amount will exceed your transfer limit. Please try again with a lower amount!"
1618
  msgstr ""
1619
 
1620
+ #: addons/transfer/myCRED-addon-transfer.php:170
1621
  #@ mycred
1622
  msgid "No limits."
1623
  msgstr ""
1624
 
1625
+ #: addons/transfer/myCRED-addon-transfer.php:171
1626
  #@ mycred
1627
  msgid "Impose daily limit."
1628
  msgstr ""
1629
 
1630
+ #: addons/transfer/myCRED-addon-transfer.php:172
1631
  #@ mycred
1632
  msgid "Impose weekly limit."
1633
  msgstr ""
1634
 
1635
+ #: addons/transfer/myCRED-addon-transfer.php:176
1636
  #@ mycred
1637
  msgid "Transfer CREDs"
1638
  msgstr ""
1639
 
1640
+ #: addons/transfer/myCRED-addon-transfer.php:178
1641
  #@ mycred
1642
  msgid "Log template for sending"
1643
  msgstr ""
1644
 
1645
+ #: addons/transfer/myCRED-addon-transfer.php:185
1646
  #@ mycred
1647
  msgid "Log template for receiving"
1648
  msgstr ""
1649
 
1650
+ #: addons/transfer/myCRED-addon-transfer.php:192
1651
+ #: modules/mycred-module-hooks.php:1086
1652
  #@ mycred
1653
  msgid "Limits"
1654
  msgstr ""
1655
 
1656
+ #: addons/transfer/myCRED-addon-transfer.php:209
1657
  #@ mycred
1658
  msgid "Maximum Amount"
1659
  msgstr ""
1660
 
1661
+ #: addons/transfer/myCRED-addon-transfer.php:211
1662
  #@ mycred
1663
  msgid "This amount is ignored if no limits are imposed."
1664
  msgstr ""
1665
 
1666
+ #: addons/transfer/myCRED-addon-transfer.php:214
1667
  #@ mycred
1668
  msgid "Form Templates"
1669
  msgstr ""
1670
 
1671
+ #: addons/transfer/myCRED-addon-transfer.php:217
1672
  #@ mycred
1673
  msgid "Not logged in Template"
1674
  msgstr ""
1675
 
1676
+ #: addons/transfer/myCRED-addon-transfer.php:223
1677
  #@ mycred
1678
  msgid "Balance Template"
1679
  msgstr ""
1680
 
1681
+ #: addons/transfer/myCRED-addon-transfer.php:229
1682
  #@ mycred
1683
  msgid "Limit Template"
1684
  msgstr ""
1685
 
1686
+ #: addons/transfer/myCRED-addon-transfer.php:235
1687
  #@ mycred
1688
  msgid "Button Template"
1689
  msgstr ""
1690
 
1691
+ #: addons/transfer/myCRED-addon-transfer.php:240
1692
  #@ mycred
1693
  msgid "Error Messages"
1694
  msgstr ""
1695
 
1696
+ #: addons/transfer/myCRED-addon-transfer.php:243
1697
  #@ mycred
1698
  msgid "Balance to low to send."
1699
  msgstr ""
1700
 
1701
+ #: addons/transfer/myCRED-addon-transfer.php:249
1702
  #@ mycred
1703
  msgid "Transfer Limit Reached."
1704
  msgstr ""
1705
 
1706
+ #: addons/transfer/myCRED-addon-transfer.php:575
 
 
 
 
 
 
 
 
 
 
1707
  #, php-format
1708
  #@ mycred
1709
  msgid "Transfer %plural%"
1710
  msgstr ""
1711
 
1712
+ #: addons/transfer/myCRED-addon-transfer.php:586
1713
  #@ mycred
1714
  msgid "Show users balance"
1715
  msgstr ""
1716
 
1717
+ #: addons/transfer/myCRED-addon-transfer.php:590
1718
  #@ mycred
1719
  msgid "Show users limit"
1720
  msgstr ""
1721
 
1722
+ #: addons/transfer/myCRED-addon-transfer.php:713
1723
  #@ mycred
1724
  msgid "To:"
1725
  msgstr ""
1726
 
1727
+ #: addons/transfer/myCRED-addon-transfer.php:717
1728
  #@ mycred
1729
  msgid "Amount:"
1730
  msgstr ""
1755
  msgid "Adjust Users Balance"
1756
  msgstr ""
1757
 
1758
+ #: includes/mycred-admin.php:176
1759
  #@ mycred
1760
  msgid "Log description for adjustment"
1761
  msgstr ""
1762
 
1763
+ #: includes/mycred-admin.php:168
1764
  #@ mycred
1765
  msgid "required"
1766
  msgstr ""
1767
 
1768
+ #: includes/mycred-admin.php:177
1769
  #@ mycred
1770
  msgid "Update"
1771
  msgstr ""
1772
 
1773
+ #: includes/mycred-admin.php:182
1774
  #@ mycred
1775
  msgid "Users Current Balance"
1776
  msgstr ""
1780
  msgid "Sorry but your WordPress installation does not reach the minimum requirements for running myCRED. The following errors were given:\n"
1781
  msgstr ""
1782
 
1783
+ #: includes/mycred-install.php:248
1784
  #@ mycred
1785
  msgid "CRED needs your attention."
1786
  msgstr ""
1787
 
1788
+ #: includes/mycred-install.php:248
1789
  #@ mycred
1790
  msgid "Run Setup"
1791
  msgstr ""
1792
 
1793
+ #: includes/mycred-install.php:260
1794
+ #: includes/mycred-install.php:261
1795
  #@ mycred
1796
  msgid "myCRED Setup"
1797
  msgstr ""
1798
 
1799
+ #: addons/email-notices/myCRED-addon-email-notices.php:589
1800
+ #: includes/mycred-install.php:398
1801
+ #: mycred.php:98
1802
  #@ mycred
1803
  msgid "Setup"
1804
  msgstr ""
1805
 
1806
+ #: includes/mycred-install.php:424
1807
  #@ mycred
1808
  msgid "Begin Setup"
1809
  msgstr ""
1810
 
1811
+ #: includes/mycred-install.php:482
1812
+ #: includes/mycred-widgets.php:199
1813
  #@ mycred
1814
  msgid "Format"
1815
  msgstr ""
1816
 
1817
+ #: includes/mycred-install.php:485
1818
  #@ mycred
1819
  msgid "Separators"
1820
  msgstr ""
1821
 
1822
+ #: includes/mycred-install.php:495
1823
  #@ mycred
1824
  msgid "Decimals"
1825
  msgstr ""
1826
 
1827
+ #: includes/mycred-install.php:497
1828
  #@ mycred
1829
  msgid "Use zero for no decimals."
1830
  msgstr ""
1831
 
1832
+ #: includes/mycred-install.php:526
1833
  #@ default
1834
  msgid "Cancel Setup"
1835
  msgstr ""
1836
 
1837
+ #: includes/mycred-install.php:526
1838
  #@ default
1839
  msgid "Cancel"
1840
  msgstr ""
1841
 
1842
+ #: includes/mycred-install.php:526
1843
+ #: includes/mycred-install.php:606
1844
  #@ mycred
1845
  msgid "Next"
1846
  msgstr ""
1847
 
1848
+ #: includes/mycred-install.php:503
1849
  #: modules/mycred-module-general.php:61
1850
  #@ mycred
1851
  msgid "Name (Singular)"
1852
  msgstr ""
1853
 
1854
+ #: includes/mycred-install.php:507
1855
  #: modules/mycred-module-general.php:66
1856
  #@ mycred
1857
  msgid "Name (Plural)"
1858
  msgstr ""
1859
 
1860
+ #: includes/mycred-install.php:513
1861
  #: modules/mycred-module-general.php:77
1862
  #@ mycred
1863
  msgid "Prefix"
1864
  msgstr ""
1865
 
1866
+ #: includes/mycred-install.php:521
1867
  #: modules/mycred-module-general.php:85
1868
  #@ mycred
1869
  msgid "Suffix"
1870
  msgstr ""
1871
 
1872
+ #: includes/mycred-install.php:555
1873
  #: modules/mycred-module-general.php:93
1874
  #@ mycred
1875
  msgid "Security"
1876
  msgstr ""
1877
 
1878
+ #: includes/mycred-install.php:558
1879
  #@ mycred
1880
  msgid "Edit Settings Capability"
1881
  msgstr ""
1882
 
1883
+ #: includes/mycred-install.php:566
1884
  #: modules/mycred-module-general.php:106
1885
  #@ mycred
1886
  msgid "Excludes"
1887
  msgstr ""
1888
 
1889
+ #: includes/mycred-install.php:570
1890
  #: modules/mycred-module-general.php:110
1891
  #@ mycred
1892
  msgid "Exclude those who can \"Edit Settings\"."
1893
  msgstr ""
1894
 
1895
+ #: includes/mycred-install.php:577
1896
  #: modules/mycred-module-general.php:118
1897
  #@ mycred
1898
  msgid "Exclude the following user IDs:"
1899
  msgstr ""
1900
 
1901
+ #: includes/mycred-install.php:581
1902
  #: modules/mycred-module-general.php:123
1903
  #@ mycred
1904
  msgid "Rankings"
1905
  msgstr ""
1906
 
1907
+ #: includes/mycred-install.php:585
1908
  #: modules/mycred-module-general.php:127
1909
  #@ mycred
1910
  msgid "Update rankings each time a users balance changes."
1911
  msgstr ""
1912
 
1913
+ #: includes/mycred-install.php:589
1914
  #: modules/mycred-module-general.php:131
1915
  #@ mycred
1916
  msgid "Update rankings once a day."
1917
  msgstr ""
1918
 
1919
+ #: includes/mycred-install.php:593
1920
  #: modules/mycred-module-general.php:135
1921
  #@ mycred
1922
  msgid "Update rankings once a week."
1923
  msgstr ""
1924
 
1925
+ #: includes/mycred-install.php:597
1926
  #: modules/mycred-module-general.php:139
1927
  #@ mycred
1928
  msgid "Update rankings on a specific date."
1929
  msgstr ""
1930
 
1931
+ #: includes/mycred-install.php:601
1932
  #: modules/mycred-module-general.php:143
1933
+ #: modules/mycred-module-log.php:828
1934
  #@ mycred
1935
  msgid "Date"
1936
  msgstr ""
1937
 
1938
+ #: includes/mycred-network.php:149
1939
  #@ mycred
1940
  msgid "No"
1941
  msgstr ""
1942
 
1943
+ #: includes/mycred-network.php:145
1944
  #@ mycred
1945
  msgid "Yes"
1946
  msgstr ""
1947
 
1948
+ #: includes/mycred-install.php:625
1949
  #@ mycred
1950
  msgid "Ready"
1951
  msgstr ""
1952
 
1953
+ #: includes/mycred-install.php:627
1954
  #@ mycred
1955
  msgid "Install & Run"
1956
  msgstr ""
1957
 
1958
+ #: includes/mycred-widgets.php:155
 
 
 
 
 
 
 
 
 
 
1959
  #@ mycred
1960
  msgid "My Balance"
1961
  msgstr ""
1962
 
1963
+ #: includes/mycred-widgets.php:166
1964
  #, php-format
1965
  #@ mycred
1966
  msgid "<a href=\"%login_url_here%\">Login</a> to view your balance."
1967
  msgstr ""
1968
 
1969
+ #: includes/mycred-widgets.php:190
1970
  #@ mycred
1971
  msgid "Layout"
1972
  msgstr ""
1973
 
1974
+ #: includes/mycred-widgets.php:197
1975
  #@ mycred
1976
  msgid "Include users ranking"
1977
  msgstr ""
1978
 
1979
+ #: includes/mycred-widgets.php:207
 
 
 
 
 
1980
  #@ mycred
1981
  msgid "Include history"
1982
  msgstr ""
1983
 
1984
+ #: includes/mycred-widgets.php:211
1985
  #@ mycred
1986
  msgid "Number of entires"
1987
  msgstr ""
1988
 
1989
+ #: includes/mycred-widgets.php:213
1990
+ #: includes/mycred-widgets.php:368
1991
  #@ mycred
1992
  msgid "Row layout"
1993
  msgstr ""
1994
 
1995
+ #: includes/mycred-widgets.php:221
1996
  #@ mycred
1997
  msgid "Show message when not logged in"
1998
  msgstr ""
1999
 
2000
+ #: includes/mycred-widgets.php:223
2001
  #@ mycred
2002
  msgid "Message"
2003
  msgstr ""
2004
 
2005
+ #: includes/mycred-widgets.php:348
 
 
 
 
 
 
 
 
 
 
2006
  #@ mycred
2007
  msgid "Leaderboard"
2008
  msgstr ""
2009
 
2010
+ #: includes/mycred-widgets.php:361
2011
  #@ mycred
2012
  msgid "Visible to non-members"
2013
  msgstr ""
2014
 
2015
+ #: includes/mycred-widgets.php:364
2016
  #@ mycred
2017
  msgid "Number of users"
2018
  msgstr ""
2033
  msgstr ""
2034
 
2035
  #: abstracts/mycred-abstract-hook.php:125
2036
+ #: modules/mycred-module-hooks.php:928
2037
  #@ mycred
2038
  msgid "No limit"
2039
  msgstr ""
2061
  #: modules/mycred-module-addons.php:23
2062
  #: modules/mycred-module-addons.php:24
2063
  #: modules/mycred-module-addons.php:25
2064
+ #: modules/mycred-module-addons.php:264
2065
  #@ mycred
2066
  msgid "Add-ons"
2067
  msgstr ""
2068
 
2069
+ #: modules/mycred-module-addons.php:257
2070
  #@ mycred
2071
  msgid "Add-on Activated"
2072
  msgstr ""
2073
 
2074
+ #: modules/mycred-module-addons.php:259
2075
  #@ mycred
2076
  msgid "Add-on Deactivated"
2077
  msgstr ""
2078
 
2079
+ #: modules/mycred-module-addons.php:265
2080
  #@ mycred
2081
  msgid "Add-ons can expand your current installation with further features."
2082
  msgstr ""
2083
 
2084
+ #: modules/mycred-module-addons.php:303
2085
  #@ mycred
2086
  msgid "Deactivate Add-on"
2087
  msgstr ""
2088
 
2089
+ #: modules/mycred-module-addons.php:304
2090
  #@ mycred
2091
  msgid "Deactivate"
2092
  msgstr ""
2093
 
2094
+ #: modules/mycred-module-addons.php:309
2095
  #@ mycred
2096
  msgid "Activate Add-on"
2097
  msgstr ""
2098
 
2099
+ #: modules/mycred-module-addons.php:310
2100
  #@ mycred
2101
  msgid "Activate"
2102
  msgstr ""
2103
 
2104
+ #: modules/mycred-module-addons.php:327
2105
  #@ mycred
2106
  msgid "Version"
2107
  msgstr ""
2108
 
2109
+ #: modules/mycred-module-addons.php:330
2110
  #@ mycred
2111
  msgid "By"
2112
  msgstr ""
2113
 
2114
+ #: modules/mycred-module-addons.php:330
2115
  #@ mycred
2116
  msgid "View Authors Website"
2117
  msgstr ""
2118
 
2119
+ #: modules/mycred-module-addons.php:333
2120
  #@ mycred
2121
  msgid "View Add-ons Website"
2122
  msgstr ""
2123
 
2124
+ #: modules/mycred-module-addons.php:333
2125
  #@ mycred
2126
  msgid "Visit Website"
2127
  msgstr ""
2128
 
2129
+ #: addons/gateway/carts/mycred-marketpress.php:274
2130
+ #: includes/mycred-network.php:139
2131
  #: modules/mycred-module-general.php:19
2132
  #: modules/mycred-module-general.php:20
2133
  #: modules/mycred-module-general.php:21
2134
  #: modules/mycred-module-general.php:47
2135
+ #: modules/mycred-module-log.php:306
2136
+ #: mycred.php:105
2137
  #@ mycred
2138
  msgid "Settings"
2139
  msgstr ""
2171
  msgid "Adding an underscore at the beginning of template tag for names will return them in lowercase. i.e. %_singular%"
2172
  msgstr ""
2173
 
2174
+ #: includes/mycred-install.php:500
2175
  #: modules/mycred-module-general.php:74
2176
  #@ mycred
2177
  msgid "Presentation"
2206
  msgstr ""
2207
 
2208
  #: modules/mycred-module-help.php:88
2209
+ #: modules/mycred-module-hooks.php:28
2210
+ #: modules/mycred-module-hooks.php:29
2211
+ #: modules/mycred-module-hooks.php:30
2212
+ #: modules/mycred-module-hooks.php:218
2213
  #@ mycred
2214
  msgid "Hooks"
2215
  msgstr ""
2216
 
2217
+ #: modules/mycred-module-hooks.php:88
2218
  #, php-format
2219
  #@ mycred
2220
  msgid "%plural% for registrations"
2221
  msgstr ""
2222
 
2223
+ #: modules/mycred-module-hooks.php:89
2224
  #@ mycred
2225
  msgid "Award %_plural% for users joining your website."
2226
  msgstr ""
2227
 
2228
+ #: modules/mycred-module-hooks.php:95
2229
  #, php-format
2230
  #@ mycred
2231
  msgid "%plural% for logins"
2232
  msgstr ""
2233
 
2234
+ #: modules/mycred-module-hooks.php:96
2235
  #@ mycred
2236
  msgid "Award %_plural% for logging in to your website. You can also set an optional limit."
2237
  msgstr ""
2238
 
2239
+ #: modules/mycred-module-hooks.php:102
2240
  #, php-format
2241
  #@ mycred
2242
  msgid "%plural% for publishing content"
2243
  msgstr ""
2244
 
2245
+ #: modules/mycred-module-hooks.php:103
2246
  #@ mycred
2247
  msgid "Award %_plural% for publishing content on your website. If your custom post type is not shown bellow, make sure it is set to \"Public\"."
2248
  msgstr ""
2249
 
2250
+ #: modules/mycred-module-hooks.php:109
2251
  #, php-format
2252
  #@ mycred
2253
  msgid "%plural% for comments"
2254
  msgstr ""
2255
 
2256
+ #: modules/mycred-module-hooks.php:110
2257
  #@ mycred
2258
  msgid "Award %_plural% for making comments."
2259
  msgstr ""
2260
 
2261
+ #: modules/mycred-module-hooks.php:124
2262
  #@ mycred
2263
  msgid "Invite Anyone Plugin"
2264
  msgstr ""
2265
 
2266
+ #: modules/mycred-module-hooks.php:125
2267
  #@ mycred
2268
  msgid "Awards %_plural% for sending invitations and/or %_plural% if the invite is accepted."
2269
  msgstr ""
2270
 
2271
+ #: modules/mycred-module-hooks.php:133
2272
  #@ mycred
2273
  msgid "Contact Form 7 Form Submissions"
2274
  msgstr ""
2275
 
2276
+ #: modules/mycred-module-hooks.php:134
2277
  #@ mycred
2278
  msgid "Awards %_plural% for successful form submissions (by logged in users)."
2279
  msgstr ""
2280
 
2281
+ #: modules/mycred-module-hooks.php:219
2282
  #@ mycred
2283
  msgid "Hooks are instances where %_plural% are awarded or deducted from a user, depending on their actions around your website."
2284
  msgstr ""
2285
 
2286
+ #: modules/mycred-module-hooks.php:244
2287
  #@ mycred
2288
  msgid "Update Changes"
2289
  msgstr ""
2290
 
2291
+ #: modules/mycred-module-hooks.php:482
2292
+ #: modules/mycred-module-plugins.php:141
2293
+ #: modules/mycred-module-plugins.php:162
2294
  #@ mycred
2295
  msgid "Limit"
2296
  msgstr ""
2297
 
2298
+ #: modules/mycred-module-hooks.php:576
2299
  #, php-format
2300
  #@ mycred
2301
  msgid "%plural% for Posts"
2302
  msgstr ""
2303
 
2304
+ #: modules/mycred-module-hooks.php:589
2305
  #, php-format
2306
  #@ mycred
2307
  msgid "%plural% for Pages"
2308
  msgstr ""
2309
 
2310
+ #: modules/mycred-module-hooks.php:624
2311
  #, php-format
2312
  #@ mycred
2313
  msgid "%plural% for %s"
2314
  msgstr ""
2315
 
2316
+ #: modules/mycred-module-plugins.php:129
2317
  #, php-format
2318
  #@ mycred
2319
  msgid "%plural% for Sending An Invite"
2320
  msgstr ""
2321
 
2322
+ #: modules/mycred-module-plugins.php:145
2323
  #@ mycred
2324
  msgid "Maximum number of invites that grants %_plural%. User zero for unlimited."
2325
  msgstr ""
2326
 
2327
+ #: modules/mycred-module-plugins.php:149
2328
  #, php-format
2329
  #@ mycred
2330
  msgid "%plural% for Accepting An Invite"
2331
  msgstr ""
2332
 
2333
+ #: modules/mycred-module-plugins.php:153
2334
  #, php-format
2335
  #@ mycred
2336
  msgid "%plural% for each invited user that accepts an invitation."
2337
  msgstr ""
2338
 
2339
+ #: modules/mycred-module-plugins.php:166
2340
  #@ mycred
2341
  msgid "Maximum number of accepted invitations that grants %_plural%. User zero for unlimited."
2342
  msgstr ""
2343
 
2344
+ #: modules/mycred-module-plugins.php:264
2345
  #@ mycred
2346
  msgid "No forms found."
2347
  msgstr ""
2357
  msgid "Activity Log"
2358
  msgstr ""
2359
 
2360
+ #: modules/mycred-module-log.php:88
2361
  #@ mycred
2362
  msgid "Entries"
2363
  msgstr ""
2364
 
2365
+ #: modules/mycred-module-log.php:170
2366
  #@ mycred
2367
  msgid "Show all references"
2368
  msgstr ""
2369
 
2370
+ #: modules/mycred-module-log.php:184
2371
  #@ mycred
2372
  msgid "Show all users"
2373
  msgstr ""
2374
 
2375
+ #: modules/mycred-module-log.php:195
2376
  #@ mycred
2377
  msgid "Filter"
2378
  msgstr ""
2379
 
2380
+ #: modules/mycred-module-log.php:264
2381
+ #: modules/mycred-module-log.php:266
2382
  #@ mycred
2383
  msgid "Search Log"
2384
  msgstr ""
2385
 
2386
+ #: modules/mycred-module-log.php:293
2387
  #@ mycred
2388
  msgid "entry"
2389
  msgid_plural "entries"
2390
  msgstr[0] ""
2391
  msgstr[1] ""
2392
 
2393
+ #: modules/mycred-module-log.php:312
2394
  #@ mycred
2395
  msgid "Search results for"
2396
  msgstr ""
2397
 
2398
+ #: addons/email-notices/myCRED-addon-email-notices.php:636
2399
+ #: addons/email-notices/myCRED-addon-email-notices.php:763
2400
+ #: modules/mycred-module-log.php:827
 
 
 
2401
  #@ mycred
2402
  msgid "User"
2403
  msgstr ""
2404
 
2405
+ #: modules/mycred-module-log.php:830
2406
  #@ mycred
2407
  msgid "Entry"
2408
  msgstr ""
2409
 
2410
+ #: modules/mycred-module-log.php:969
2411
  #@ mycred
2412
  msgid "No log entries found"
2413
  msgstr ""
2433
  msgid "click to close"
2434
  msgstr ""
2435
 
2436
+ #: mycred.php:365
2437
  #@ mycred
2438
  msgid "My Balance: "
2439
  msgstr ""
2440
 
2441
+ #: addons/gateway/carts/mycred-marketpress.php:173
2442
  #: addons/gateway/carts/mycred-woocommerce.php:34
2443
  #: includes/mycred-network.php:53
2444
  #: includes/mycred-network.php:54
2445
+ #: modules/mycred-module-plugins.php:346
 
2446
  #@ mycred
2447
  msgid "myCRED"
2448
  msgstr ""
2457
  msgid "If you use a negative value and the user does not have enough %_plural% the \"Join Group\" button will be disabled."
2458
  msgstr ""
2459
 
2460
+ #: addons/buy-creds/gateways/netbilling.php:654
2461
  #@ mycred
2462
  msgid "Disable AVS (Address Verification System) for credit card transactions."
2463
  msgstr ""
2464
 
2465
+ #: addons/buy-creds/gateways/netbilling.php:658
2466
  #@ mycred
2467
  msgid "Disable CVV2 (Card Verification Value 2) for credit card transactions."
2468
  msgstr ""
2469
 
2470
+ #: addons/buy-creds/gateways/netbilling.php:662
2471
  #@ mycred
2472
  msgid "Disable all fraud protection other than AVS/CVV2. (This implies disable_negative_db)"
2473
  msgstr ""
2474
 
2475
+ #: addons/buy-creds/gateways/netbilling.php:666
2476
  #@ mycred
2477
  msgid "Disable only the negative database component of the fraud protection system."
2478
  msgstr ""
2479
 
2480
+ #: addons/buy-creds/gateways/netbilling.php:670
2481
  #@ mycred
2482
  msgid "Disable automatic sending of both merchant and customer email receipts."
2483
  msgstr ""
2484
 
2485
+ #: addons/buy-creds/gateways/netbilling.php:674
2486
  #@ mycred
2487
  msgid "Disable immediate rejection of expired cards."
2488
  msgstr ""
2489
 
2490
+ #: addons/buy-creds/gateways/paypal-standard.php:358
2491
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:771
2492
  #@ mycred
2493
  msgid "For this gateway to work, you must login to your PayPal account and under \"Profile\" > \"Selling Tools\" enable \"Instant Payment Notifications\". Make sure the \"Notification URL\" is set to the above address and that you have selected \"Receive IPN messages (Enabled)\"."
2494
  msgstr ""
2495
 
2496
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:193
2497
  #@ mycred
2498
  msgid "buyCRED"
2499
  msgstr ""
2500
 
2501
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:202
2502
  #@ mycred
2503
  msgid "Login Template"
2504
  msgstr ""
2505
 
2506
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:206
2507
  #@ mycred
2508
  msgid "Content to show when a user is not logged in."
2509
  msgstr ""
2510
 
2511
+ #: addons/transfer/myCRED-addon-transfer.php:219
2512
  #@ mycred
2513
  msgid "Text to show when users are not logged in. Leave empty to hide. No HTML elements allowed!"
2514
  msgstr ""
2515
 
2516
+ #: addons/transfer/myCRED-addon-transfer.php:225
2517
  #@ mycred
2518
  msgid "Template to use when displaying the users balance (if included). No HTML elements allowed!"
2519
  msgstr ""
2520
 
2521
+ #: addons/transfer/myCRED-addon-transfer.php:231
2522
  #@ mycred
2523
  msgid "Template to use when displaying limits (if used). No HTML elements allowed!"
2524
  msgstr ""
2525
 
2526
+ #: addons/transfer/myCRED-addon-transfer.php:237
2527
  #@ mycred
2528
  msgid "Send Transfer button template. No HTML elements allowed!"
2529
  msgstr ""
2530
 
2531
+ #: addons/transfer/myCRED-addon-transfer.php:245
2532
  #@ mycred
2533
  msgid "Text to show when a users balance is to low for transfers. Leave empty to hide. No HTML elements allowed!"
2534
  msgstr ""
2535
 
2536
+ #: addons/transfer/myCRED-addon-transfer.php:251
2537
  #@ mycred
2538
  msgid "Text to show when a user has reached their transfer limit (if used). Leave empty to hide. No HTML elements allowed!"
2539
  msgstr ""
2540
 
2541
+ #: includes/mycred-install.php:400
2542
  #@ mycred
2543
  msgid "Step"
2544
  msgstr ""
2545
 
2546
+ #: includes/mycred-install.php:423
2547
  #@ mycred
2548
  msgid "Click \"Begin Setup\" to install myCRED. You will be able to select your points format, layout and security settings."
2549
  msgstr ""
2550
 
2551
+ #: includes/mycred-install.php:481
2552
  #@ mycred
2553
  msgid "Select the format you want to use for your points."
2554
  msgstr ""
2559
  msgid "Network Settings"
2560
  msgstr ""
2561
 
2562
+ #: includes/mycred-network.php:128
2563
  #@ mycred
2564
  msgid "Network"
2565
  msgstr ""
2566
 
2567
+ #: includes/mycred-network.php:133
2568
  #@ mycred
2569
  msgid "Network Settings Updated"
2570
  msgstr ""
2571
 
2572
+ #: includes/mycred-network.php:141
 
 
 
 
 
2573
  #@ mycred
2574
  msgid "Master Template"
2575
  msgstr ""
2576
 
2577
+ #: includes/mycred-network.php:155
 
 
 
 
 
2578
  #@ mycred
2579
  msgid "Site Block"
2580
  msgstr ""
2581
 
2582
+ #: includes/mycred-network.php:168
 
 
 
 
 
2583
  #@ mycred
2584
  msgid "Save Network Settings"
2585
  msgstr ""
2589
  msgid "Template Tags"
2590
  msgstr ""
2591
 
2592
+ #: mycred.php:118
2593
  #@ mycred
2594
  msgid "myCRED is blocked for this site. Please contact your network administrator for further details."
2595
  msgstr ""
2615
  #: addons/buddypress/hooks/bp-profile.php:389
2616
  #: addons/buddypress/hooks/bp-profile.php:402
2617
  #: addons/buddypress/hooks/bp-profile.php:415
2618
+ #: modules/mycred-module-hooks.php:479
2619
+ #: modules/mycred-module-plugins.php:138
2620
+ #: modules/mycred-module-plugins.php:159
2621
  #: modules/mycred-module-subscriptions.php:488
2622
  #: modules/mycred-module-subscriptions.php:501
2623
  #@ mycred
2626
 
2627
  #: addons/buddypress/hooks/bp-press.php:115
2628
  #: addons/buddypress/hooks/bp-press.php:128
2629
+ #: modules/mycred-module-hooks.php:586
2630
+ #: modules/mycred-module-hooks.php:599
2631
+ #: modules/mycred-module-hooks.php:634
2632
+ #: modules/mycred-module-plugins.php:294
2633
+ #: modules/mycred-module-plugins.php:538
2634
+ #: modules/mycred-module-plugins.php:548
2635
  #@ mycred
2636
  msgid "Available template tags: General, Post"
2637
  msgstr ""
2638
 
2639
  #: addons/buddypress/hooks/bp-profile.php:350
2640
  #: addons/buddypress/hooks/bp-profile.php:363
2641
+ #: addons/transfer/myCRED-addon-transfer.php:182
2642
+ #: addons/transfer/myCRED-addon-transfer.php:189
2643
+ #: modules/mycred-module-hooks.php:344
2644
  #@ mycred
2645
  msgid "Available template tags: General, User"
2646
  msgstr ""
2647
 
2648
+ #: addons/buddypress/myCRED-addon-buddypress.php:401
2649
  #, php-format
2650
  #@ mycred
2651
  msgid "Available template tags are: %creds%, %number%, %rank%"
2656
  msgid "Let users pay using their myCRED balance."
2657
  msgstr ""
2658
 
2659
+ #: addons/gateway/carts/mycred-woocommerce.php:68
2660
  #@ mycred
2661
  msgid "Enable/Disable"
2662
  msgstr ""
2663
 
2664
+ #: addons/gateway/carts/mycred-woocommerce.php:70
2665
  #@ mycred
2666
  msgid "Enable myCRED Payment"
2667
  msgstr ""
2668
 
2669
+ #: addons/gateway/carts/mycred-woocommerce.php:72
2670
  #@ mycred
2671
  msgid "Users who are not logged in or excluded from using myCRED will not have access to this gateway!"
2672
  msgstr ""
2673
 
2674
+ #: addons/gateway/carts/mycred-woocommerce.php:77
2675
  #@ mycred
2676
  msgid "Title to show for this payment option."
2677
  msgstr ""
2678
 
2679
+ #: addons/gateway/carts/mycred-woocommerce.php:78
2680
  #@ mycred
2681
  msgid "Pay with myCRED"
2682
  msgstr ""
2683
 
2684
+ #: addons/gateway/carts/mycred-woocommerce.php:82
2685
  #@ mycred
2686
  msgid "Customer Message"
2687
  msgstr ""
2688
 
2689
+ #: addons/gateway/carts/mycred-woocommerce.php:84
2690
  #@ mycred
2691
  msgid "Deduct the amount from your %_plural% balance."
2692
  msgstr ""
2693
 
2694
+ #: addons/gateway/carts/mycred-marketpress.php:294
2695
+ #: addons/gateway/carts/mycred-woocommerce.php:89
2696
  #, php-format
2697
  #@ mycred
2698
  msgid "Log entry template for successful payments. Available template tags: %order_id%, %order_link%"
2699
  msgstr ""
2700
 
2701
+ #: addons/gateway/carts/mycred-woocommerce.php:90
2702
  #, php-format
2703
  #@ mycred
2704
  msgid "Payment for Order: #%order_id%"
2705
  msgstr ""
2706
 
2707
+ #: addons/gateway/carts/mycred-marketpress.php:301
2708
+ #: addons/gateway/carts/mycred-woocommerce.php:95
2709
  #, php-format
2710
  #@ mycred
2711
  msgid "How much is 1 %_singular% worth in %currency%?"
2712
  msgstr ""
2713
 
2714
+ #: addons/gateway/carts/mycred-woocommerce.php:107
2715
  #@ mycred
2716
  msgid "Show Total"
2717
  msgstr ""
2718
 
2719
+ #: addons/gateway/carts/mycred-woocommerce.php:109
2720
  #@ mycred
2721
  msgid "Show the final price in %_plural% ."
2722
  msgstr ""
2723
 
2724
+ #: addons/gateway/carts/mycred-woocommerce.php:111
2725
  #@ mycred
2726
  msgid "Do not show"
2727
  msgstr ""
2728
 
2729
+ #: addons/gateway/carts/mycred-woocommerce.php:112
2730
  #@ mycred
2731
  msgid "Show in Cart"
2732
  msgstr ""
2733
 
2734
+ #: addons/gateway/carts/mycred-woocommerce.php:113
2735
  #@ mycred
2736
  msgid "Show on Checkout Page"
2737
  msgstr ""
2738
 
2739
+ #: addons/gateway/carts/mycred-woocommerce.php:114
2740
  #@ mycred
2741
  msgid "Show in Cart and on Checkout Page"
2742
  msgstr ""
2743
 
2744
+ #: addons/gateway/carts/mycred-woocommerce.php:119
2745
  #@ mycred
2746
  msgid "Label"
2747
  msgstr ""
2748
 
2749
+ #: addons/gateway/carts/mycred-woocommerce.php:121
2750
  #@ mycred
2751
  msgid "Order Total in %_plural%"
2752
  msgstr ""
2753
 
2754
+ #: addons/gateway/carts/mycred-woocommerce.php:148
2755
  #@ mycred
2756
  msgid "myCRED Payment"
2757
  msgstr ""
2758
 
2759
+ #: addons/gateway/carts/mycred-woocommerce.php:149
2760
  #@ mycred
2761
  msgid "Allows users to pay using their myCRED %_singular% balance. Please note that users with insufficient funds and users who are not logged in will not see this payment gateway on the checkout page."
2762
  msgstr ""
2763
 
2764
+ #: addons/gateway/carts/mycred-woocommerce.php:170
2765
  #@ mycred
2766
  msgid "You must be logged in to pay with %_plural%"
2767
  msgstr ""
2768
 
2769
+ #: addons/gateway/carts/mycred-woocommerce.php:176
2770
  #@ mycred
2771
  msgid "You can not use this gateway. Please try a different payment option."
2772
  msgstr ""
2773
 
2774
+ #: addons/gateway/carts/mycred-woocommerce.php:188
2775
  #@ mycred
2776
  msgid "Insufficient funds. Please try a different payment option."
2777
  msgstr ""
2778
 
2779
+ #: addons/gateway/carts/mycred-woocommerce.php:209
2780
  #@ mycred
2781
  msgid "Your account has successfully been charged."
2782
  msgstr ""
2783
 
2784
+ #: addons/gateway/carts/mycred-woocommerce.php:399
2785
  #@ mycred
2786
  msgid "Your current balance"
2787
  msgstr ""
2788
 
2789
+ #: modules/mycred-module-hooks.php:853
2790
+ #: modules/mycred-module-hooks.php:865
2791
+ #: modules/mycred-module-hooks.php:877
2792
  #@ mycred
2793
  msgid "Available template tags: General, Comment"
2794
  msgstr ""
2795
 
2796
+ #: modules/mycred-module-hooks.php:844
2797
  #@ mycred
2798
  msgid "Approved Comment"
2799
  msgstr ""
2800
 
2801
+ #: modules/mycred-module-hooks.php:856
2802
  #@ mycred
2803
  msgid "Comment Marked SPAM"
2804
  msgstr ""
2805
 
2806
+ #: modules/mycred-module-hooks.php:868
2807
  #@ mycred
2808
  msgid "Trashed / Unapproved Comments"
2809
  msgstr ""
2810
 
2811
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:752
 
 
 
 
 
2812
  #@ mycred
2813
  msgid "This add-on lets your users buy %_plural% using a payment gateway."
2814
  msgstr ""
2815
 
2816
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:753
2817
  #@ mycred
2818
  msgid "Supported Gateways"
2819
  msgstr ""
2820
 
2821
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:755
2822
+ #: addons/sell-content/myCRED-addon-sell-content.php:1050
2823
+ #: addons/transfer/myCRED-addon-transfer.php:483
 
 
 
 
 
2824
  #@ mycred
2825
  msgid "Usage"
2826
  msgstr ""
2827
 
2828
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:756
2829
  #@ mycred
2830
  msgid "Purchases can be made using one of the following shortcodes:"
2831
  msgstr ""
2832
 
2833
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:758
2834
  #@ mycred
2835
  msgid "When you want to sell a pre-set amount, sell to a specific user or use a specific gateway.<br />For more information on how to use the shortcode, please visit the"
2836
  msgstr ""
2837
 
2838
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:759
2839
  #@ mycred
2840
  msgid "When you want to give your users the option to select an amount, gateway or recipient.<br />For more information on how to use the shortcode, please visit the"
2841
  msgstr ""
2842
 
2843
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:769
2844
  #@ mycred
2845
  msgid "Make sure you select a currency that your PayPal account supports. Otherwise transactions will not be approved until you login to your PayPal account and Accept each transaction! Purchases made in a currency that is not supported will not be applied to the buyer until you have resolved the issue."
2846
  msgstr ""
2847
 
2848
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:770
2849
  #@ mycred
2850
  msgid "Instant Payment Notifications"
2851
  msgstr ""
2852
 
2853
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:775
2854
  #@ mycred
2855
  msgid "Skrill"
2856
  msgstr ""
2857
 
2858
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:778
2859
  #@ mycred
2860
  msgid "Transactions made while Sandbox mode is active are real transactions! Remember to use your \"Test Merchant Account\" when Sandbox mode is active!"
2861
  msgstr ""
2862
 
2863
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:780
2864
  #@ mycred
2865
  msgid "By default all Skrill Merchant account accept payments via Bank Transfers. When a user selects this option, no points are awarded! You will need to manually award these once the bank transfer is completed."
2866
  msgstr ""
2867
 
2868
+ #: addons/buy-creds/gateways/skrill.php:403
2869
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:781
2870
  #@ mycred
2871
  msgid "By default purchases made using Skrill will result in users having to signup for a Skrill account (if they do not have one already). You can contact Skrill Merchant Services and request to disable this feature."
2872
  msgstr ""
2955
  msgid "Please note that the meta key is case sensitive and can not contain whitespaces!"
2956
  msgstr ""
2957
 
2958
+ #: addons/sell-content/myCRED-addon-sell-content.php:1047
2959
  #@ mycred
2960
  msgid "This add-on lets you sell either entire contents or parts of it. You can select if you want to just charge users or share a percentage of the sale with the post author."
2961
  msgstr ""
2962
 
2963
+ #: addons/sell-content/myCRED-addon-sell-content.php:1049
2964
  #@ mycred
2965
  msgid "The default price and button label is applied to all content that is set for sale. You can select if you want to enforce these settings or let the content authors set their own."
2966
  msgstr ""
2967
 
2968
+ #: addons/sell-content/myCRED-addon-sell-content.php:1051
2969
  #@ mycred
2970
  msgid "You can either sell entire posts via the Sell Content Meta Box or by using the <code>mycred_sell_this</code> shortcode.<br />For more information on how to use the shortcode, please visit the"
2971
  msgstr ""
2972
 
2973
+ #: addons/transfer/myCRED-addon-transfer.php:480
2974
  #@ mycred
2975
  msgid "This add-on lets your users transfer %_plural% to each other. Members who are set to be excluded can neither send or receive %_plural%."
2976
  msgstr ""
2977
 
2978
+ #: addons/transfer/myCRED-addon-transfer.php:481
2979
  #@ mycred
2980
  msgid "Transfer Limit"
2981
  msgstr ""
2982
 
2983
+ #: addons/transfer/myCRED-addon-transfer.php:482
2984
  #@ mycred
2985
  msgid "You can impose a daily-, weekly- or monthly transfer limit for each user. Note, that this transfer limit is imposed on everyone who are not excluded from using myCRED."
2986
  msgstr ""
2987
 
2988
+ #: addons/transfer/myCRED-addon-transfer.php:484
2989
  #@ mycred
2990
  msgid "Transfers can be made by either using the <code>mycred_transfer</code> shortcode or via the myCRED Transfer Widget.<br />For more information on how to use the shortcode, please visit the"
2991
  msgstr ""
2995
  msgid "Adjust Your Balance"
2996
  msgstr ""
2997
 
2998
+ #: includes/mycred-install.php:562
2999
  #, php-format
3000
  #@ mycred
3001
  msgid "Edit Users %plural% Capability"
3002
  msgstr ""
3003
 
3004
+ #: includes/mycred-install.php:574
3005
  #: modules/mycred-module-general.php:114
3006
  #, php-format
3007
  #@ mycred
3008
  msgid "Exclude those who can \"Edit Users %plural%\"."
3009
  msgstr ""
3010
 
3011
+ #: includes/mycred-install.php:626
3012
  #@ mycred
3013
  msgid "Almost done! Click the button below to finish this setup."
3014
  msgstr ""
3015
 
3016
+ #: includes/mycred-widgets.php:192
 
3017
  #: includes/mycred-widgets.php:215
3018
+ #: includes/mycred-widgets.php:225
3019
+ #: includes/mycred-widgets.php:370
3020
  #@ mycred
3021
  msgid "See the help tab for available template tags."
3022
  msgstr ""
3023
 
3024
+ #: includes/mycred-widgets.php:209
 
 
 
 
 
3025
  #@ mycred
3026
  msgid "History Title"
3027
  msgstr ""
3244
  msgid "myCRED Balance Template Tags"
3245
  msgstr ""
3246
 
3247
+ #: addons/email-notices/myCRED-addon-email-notices.php:661
3248
  #: modules/mycred-module-help.php:146
3249
  #: modules/mycred-module-help.php:170
3250
  #@ mycred
3275
  msgid "Rank Format:"
3276
  msgstr ""
3277
 
 
 
 
 
 
 
3278
  #: modules/mycred-module-help.php:152
3279
  #@ mycred
3280
  msgid "History Title:"
3364
  msgid "Here you can name your installation along with setting your layout and format. You can use any name as long as you set both the singular and plural format and you can change the name at any time."
3365
  msgstr ""
3366
 
3367
+ #: modules/mycred-module-hooks.php:142
3368
  #@ mycred
3369
  msgid "Jetpack Subscriptions"
3370
  msgstr ""
3371
 
3372
+ #: modules/mycred-module-hooks.php:143
3373
  #@ mycred
3374
  msgid "Awards %_plural% for users signing up for site or comment updates using Jetpack."
3375
  msgstr ""
3384
  msgid "Comment Subscriptions"
3385
  msgstr ""
3386
 
3387
+ #: addons/buddypress/myCRED-addon-buddypress.php:402
3388
+ #, php-format
3389
+ #@ mycred
3390
+ msgid "Note that you can also use %rank_logo% to show the feature image of the rank."
3391
+ msgstr ""
3392
+
3393
+ #: addons/buy-creds/gateways/paypal-standard.php:239
3394
+ #: addons/buy-creds/gateways/skrill.php:225
3395
+ #: addons/buy-creds/gateways/zombaio.php:232
3396
+ #@ mycred
3397
+ msgid "Please setup this gateway before attempting to make a purchase!"
3398
+ msgstr ""
3399
+
3400
+ #: addons/buy-creds/gateways/zombaio.php:296
3401
+ #@ mycred
3402
+ msgid "Site ID"
3403
+ msgstr ""
3404
+
3405
+ #: addons/buy-creds/gateways/zombaio.php:302
3406
+ #@ mycred
3407
+ msgid "GW Password"
3408
+ msgstr ""
3409
+
3410
+ #: addons/buy-creds/gateways/zombaio.php:308
3411
+ #@ mycred
3412
+ msgid "Pricing ID"
3413
+ msgstr ""
3414
+
3415
+ #: addons/buy-creds/gateways/zombaio.php:320
3416
+ #@ mycred
3417
+ msgid "IP Verification"
3418
+ msgstr ""
3419
+
3420
+ #: addons/buy-creds/gateways/zombaio.php:323
3421
+ #@ mycred
3422
+ msgid "Do not verify that callbacks are coming from Zombaio."
3423
+ msgstr ""
3424
+
3425
+ #: addons/buy-creds/gateways/zombaio.php:326
3426
+ #@ mycred
3427
+ msgid "Language"
3428
+ msgstr ""
3429
+
3430
+ #: addons/buy-creds/gateways/zombaio.php:333
3431
+ #@ mycred
3432
+ msgid "Postback URL (ZScript)"
3433
+ msgstr ""
3434
+
3435
+ #: addons/buy-creds/gateways/zombaio.php:337
3436
+ #@ mycred
3437
+ msgid "For this gateway to work, login to ZOA and set the Postback URL to the above address and click validate."
3438
+ msgstr ""
3439
+
3440
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:146
3441
+ #@ default
3442
+ msgid "Zombaio"
3443
+ msgstr ""
3444
+
3445
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:213
3446
+ #, php-format
3447
+ #@ mycred
3448
+ msgid "Available template tags: General and %gateway% for the payment gateway used."
3449
+ msgstr ""
3450
+
3451
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:404
3452
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:514
3453
+ #@ mycred
3454
+ msgid "This Add-on needs to setup before you can use this shortcode."
3455
+ msgstr ""
3456
+
3457
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:750
3458
+ #, php-format
3459
+ #@ mycred
3460
+ msgid "Buy %plural%"
3461
+ msgstr ""
3462
+
3463
+ #: addons/buy-creds/myCRED-addon-buy-creds.php:754
3464
+ #@ mycred
3465
+ msgid "myCRED supports purchases through: PayPal Payments Standard, Skrill (Moneybookers) and NETbilling. Let us know if you want to add other payment gateways."
3466
+ msgstr ""
3467
+
3468
+ #: addons/email-notices/myCRED-addon-email-notices.php:148
3469
+ #: addons/email-notices/myCRED-addon-email-notices.php:154
3470
+ #: addons/email-notices/myCRED-addon-email-notices.php:160
3471
+ #: addons/email-notices/myCRED-addon-email-notices.php:249
3472
+ #@ mycred
3473
+ msgid "Email Notices"
3474
+ msgstr ""
3475
+
3476
+ #: addons/email-notices/myCRED-addon-email-notices.php:149
3477
+ #@ mycred
3478
+ msgid "Email Notice"
3479
+ msgstr ""
3480
+
3481
+ #: addons/email-notices/myCRED-addon-email-notices.php:150
3482
+ #: addons/ranks/myCRED-addon-ranks.php:119
3483
+ #@ mycred
3484
+ msgid "Add New"
3485
+ msgstr ""
3486
+
3487
+ #: addons/email-notices/myCRED-addon-email-notices.php:151
3488
+ #@ mycred
3489
+ msgid "Add New Notice"
3490
+ msgstr ""
3491
+
3492
+ #: addons/email-notices/myCRED-addon-email-notices.php:152
3493
+ #@ mycred
3494
+ msgid "Edit Notice"
3495
+ msgstr ""
3496
+
3497
+ #: addons/email-notices/myCRED-addon-email-notices.php:153
3498
+ #@ mycred
3499
+ msgid "New Notice"
3500
+ msgstr ""
3501
+
3502
+ #: addons/email-notices/myCRED-addon-email-notices.php:155
3503
+ #@ mycred
3504
+ msgid "View Notice"
3505
+ msgstr ""
3506
+
3507
+ #: addons/email-notices/myCRED-addon-email-notices.php:156
3508
+ #@ mycred
3509
+ msgid "Search Email Notices"
3510
+ msgstr ""
3511
+
3512
+ #: addons/email-notices/myCRED-addon-email-notices.php:157
3513
+ #@ mycred
3514
+ msgid "No email notices found"
3515
+ msgstr ""
3516
+
3517
+ #: addons/email-notices/myCRED-addon-email-notices.php:158
3518
+ #@ mycred
3519
+ msgid "No email notices found in Trash"
3520
+ msgstr ""
3521
+
3522
+ #: addons/email-notices/myCRED-addon-email-notices.php:181
3523
+ #: addons/email-notices/myCRED-addon-email-notices.php:813
3524
+ #@ mycred
3525
+ msgid "General"
3526
+ msgstr ""
3527
+
3528
+ #: addons/email-notices/myCRED-addon-email-notices.php:182
3529
+ #@ mycred
3530
+ msgid "users balance changes"
3531
+ msgstr ""
3532
+
3533
+ #: addons/email-notices/myCRED-addon-email-notices.php:183
3534
+ #@ mycred
3535
+ msgid "user gains %_plural%"
3536
+ msgstr ""
3537
+
3538
+ #: addons/email-notices/myCRED-addon-email-notices.php:184
3539
+ #@ mycred
3540
+ msgid "user lose %_plural%"
3541
+ msgstr ""
3542
+
3543
+ #: addons/email-notices/myCRED-addon-email-notices.php:185
3544
+ #@ mycred
3545
+ msgid "users balance reaches zero"
3546
+ msgstr ""
3547
+
3548
+ #: addons/email-notices/myCRED-addon-email-notices.php:186
3549
+ #@ mycred
3550
+ msgid "users balance goes minus"
3551
+ msgstr ""
3552
+
3553
+ #: addons/email-notices/myCRED-addon-email-notices.php:192
3554
+ #@ mycred
3555
+ msgid "Sell Content Add-on"
3556
+ msgstr ""
3557
+
3558
+ #: addons/email-notices/myCRED-addon-email-notices.php:193
3559
+ #@ mycred
3560
+ msgid "user buys content"
3561
+ msgstr ""
3562
+
3563
+ #: addons/email-notices/myCRED-addon-email-notices.php:194
3564
+ #@ mycred
3565
+ msgid "authors content gets sold"
3566
+ msgstr ""
3567
+
3568
+ #: addons/email-notices/myCRED-addon-email-notices.php:201
3569
+ #@ mycred
3570
+ msgid "buyCREDs Add-on"
3571
+ msgstr ""
3572
+
3573
+ #: addons/email-notices/myCRED-addon-email-notices.php:202
3574
+ #@ mycred
3575
+ msgid "user buys %_plural%"
3576
+ msgstr ""
3577
+
3578
+ #: addons/email-notices/myCRED-addon-email-notices.php:209
3579
+ #@ mycred
3580
+ msgid "Transfer Add-on"
3581
+ msgstr ""
3582
+
3583
+ #: addons/email-notices/myCRED-addon-email-notices.php:210
3584
+ #@ mycred
3585
+ msgid "user sends %_plural%"
3586
+ msgstr ""
3587
+
3588
+ #: addons/email-notices/myCRED-addon-email-notices.php:211
3589
+ #@ mycred
3590
+ msgid "user receives %_plural%"
3591
+ msgstr ""
3592
+
3593
+ #: addons/email-notices/myCRED-addon-email-notices.php:251
3594
+ #@ mycred
3595
+ msgid "Settings that apply to all email notices and can not be overridden for individual emails."
3596
+ msgstr ""
3597
+
3598
+ #: addons/email-notices/myCRED-addon-email-notices.php:252
3599
+ #@ mycred
3600
+ msgid "Email Format"
3601
+ msgstr ""
3602
+
3603
+ #: addons/email-notices/myCRED-addon-email-notices.php:256
3604
+ #@ mycred
3605
+ msgid "Plain text emails only."
3606
+ msgstr ""
3607
+
3608
+ #: addons/email-notices/myCRED-addon-email-notices.php:260
3609
+ #@ mycred
3610
+ msgid "HTML or Plain text emails."
3611
+ msgstr ""
3612
+
3613
+ #: addons/email-notices/myCRED-addon-email-notices.php:263
3614
+ #@ mycred
3615
+ msgid "Filters"
3616
+ msgstr ""
3617
+
3618
+ #: addons/email-notices/myCRED-addon-email-notices.php:267
3619
+ #@ mycred
3620
+ msgid "Allow WordPress and Third Party Plugins to filter the email subject before an email is sent."
3621
+ msgstr ""
3622
+
3623
+ #: addons/email-notices/myCRED-addon-email-notices.php:271
3624
+ #@ mycred
3625
+ msgid "Allow WordPress and Third Party Plugins to filter the email content before an email is sent."
3626
+ msgstr ""
3627
+
3628
+ #: addons/email-notices/myCRED-addon-email-notices.php:274
3629
+ #@ mycred
3630
+ msgid "Default email settings. These settings can be individually overridden when editing emails."
3631
+ msgstr ""
3632
+
3633
+ #: addons/email-notices/myCRED-addon-email-notices.php:275
3634
+ #: addons/email-notices/myCRED-addon-email-notices.php:652
3635
+ #@ mycred
3636
+ msgid "Email Settings"
3637
+ msgstr ""
3638
+
3639
+ #: addons/email-notices/myCRED-addon-email-notices.php:278
3640
+ #: addons/email-notices/myCRED-addon-email-notices.php:769
3641
+ #@ mycred
3642
+ msgid "Senders Name:"
3643
+ msgstr ""
3644
+
3645
+ #: addons/email-notices/myCRED-addon-email-notices.php:282
3646
+ #: addons/email-notices/myCRED-addon-email-notices.php:771
3647
+ #@ mycred
3648
+ msgid "Senders Email:"
3649
+ msgstr ""
3650
+
3651
+ #: addons/email-notices/myCRED-addon-email-notices.php:286
3652
+ #@ mycred
3653
+ msgid "Reply-To:"
3654
+ msgstr ""
3655
+
3656
+ #: addons/email-notices/myCRED-addon-email-notices.php:290
3657
+ #@ mycred
3658
+ msgid "Default Email Content"
3659
+ msgstr ""
3660
+
3661
+ #: addons/email-notices/myCRED-addon-email-notices.php:294
3662
+ #@ mycred
3663
+ msgid "Default email content."
3664
+ msgstr ""
3665
+
3666
+ #: addons/email-notices/myCRED-addon-email-notices.php:297
3667
+ #@ mycred
3668
+ msgid "Default Email Styling"
3669
+ msgstr ""
3670
+
3671
+ #: addons/email-notices/myCRED-addon-email-notices.php:301
3672
+ #@ mycred
3673
+ msgid "Ignored if HTML is not allowed in emails."
3674
+ msgstr ""
3675
+
3676
+ #: addons/email-notices/myCRED-addon-email-notices.php:587
3677
+ #: addons/email-notices/myCRED-addon-email-notices.php:701
3678
+ #@ mycred
3679
+ msgid "Email Subject"
3680
+ msgstr ""
3681
+
3682
+ #: addons/email-notices/myCRED-addon-email-notices.php:588
3683
+ #@ mycred
3684
+ msgid "Status"
3685
+ msgstr ""
3686
+
3687
+ #: addons/email-notices/myCRED-addon-email-notices.php:608
3688
+ #@ mycred
3689
+ msgid "Not Active"
3690
+ msgstr ""
3691
+
3692
+ #: addons/email-notices/myCRED-addon-email-notices.php:610
3693
+ #, php-format
3694
+ #@ mycred
3695
+ msgid "Scheduled:<br /><strong>%1$s</strong>"
3696
+ msgstr ""
3697
+
3698
+ #: addons/email-notices/myCRED-addon-email-notices.php:614
3699
+ #@ mycred
3700
+ msgid "Active"
3701
+ msgstr ""
3702
+
3703
+ #: addons/email-notices/myCRED-addon-email-notices.php:616
3704
+ #, php-format
3705
+ #@ mycred
3706
+ msgid "Active - Last run:<br /><strong>%1$s</strong>"
3707
+ msgstr ""
3708
+
3709
+ #: addons/email-notices/myCRED-addon-email-notices.php:625
3710
+ #@ mycred
3711
+ msgid "Email is sent when"
3712
+ msgstr ""
3713
+
3714
+ #: addons/email-notices/myCRED-addon-email-notices.php:627
3715
+ #@ mycred
3716
+ msgid "Missing instance for this notice!"
3717
+ msgstr ""
3718
+
3719
+ #: addons/email-notices/myCRED-addon-email-notices.php:636
3720
+ #: addons/email-notices/myCRED-addon-email-notices.php:638
3721
+ #: addons/email-notices/myCRED-addon-email-notices.php:640
3722
+ #@ mycred
3723
+ msgid "Sent To"
3724
+ msgstr ""
3725
+
3726
+ #: addons/email-notices/myCRED-addon-email-notices.php:638
3727
+ #: addons/email-notices/myCRED-addon-email-notices.php:764
3728
+ #@ mycred
3729
+ msgid "Administrator"
3730
+ msgstr ""
3731
+
3732
+ #: addons/email-notices/myCRED-addon-email-notices.php:640
3733
+ #@ mycred
3734
+ msgid "Both Administrator and User"
3735
+ msgstr ""
3736
+
3737
+ #: addons/email-notices/myCRED-addon-email-notices.php:672
3738
+ #@ mycred
3739
+ msgid "Email Header"
3740
+ msgstr ""
3741
+
3742
+ #: addons/email-notices/myCRED-addon-email-notices.php:732
3743
+ #@ mycred
3744
+ msgid "Send this email notice when..."
3745
+ msgstr ""
3746
+
3747
+ #: addons/email-notices/myCRED-addon-email-notices.php:761
3748
+ #@ mycred
3749
+ msgid "Recipient:"
3750
+ msgstr ""
3751
+
3752
+ #: addons/email-notices/myCRED-addon-email-notices.php:765
3753
+ #@ mycred
3754
+ msgid "Both"
3755
+ msgstr ""
3756
+
3757
+ #: addons/email-notices/myCRED-addon-email-notices.php:773
3758
+ #@ mycred
3759
+ msgid "Reply-To Email:"
3760
+ msgstr ""
3761
+
3762
+ #: addons/email-notices/myCRED-addon-email-notices.php:779
3763
+ #@ mycred
3764
+ msgid "Save"
3765
+ msgstr ""
3766
+
3767
+ #: addons/email-notices/myCRED-addon-email-notices.php:791
3768
+ #@ mycred
3769
+ msgid "CSS Styling"
3770
+ msgstr ""
3771
+
3772
+ #: addons/email-notices/myCRED-addon-email-notices.php:806
3773
+ #@ mycred
3774
+ msgid "Site Related"
3775
+ msgstr ""
3776
+
3777
+ #: addons/email-notices/myCRED-addon-email-notices.php:807
3778
+ #@ mycred
3779
+ msgid "Your websites title"
3780
+ msgstr ""
3781
+
3782
+ #: addons/email-notices/myCRED-addon-email-notices.php:808
3783
+ #@ mycred
3784
+ msgid "Your websites address"
3785
+ msgstr ""
3786
+
3787
+ #: addons/email-notices/myCRED-addon-email-notices.php:809
3788
+ #@ mycred
3789
+ msgid "Your websites tagline (description)"
3790
+ msgstr ""
3791
+
3792
+ #: addons/email-notices/myCRED-addon-email-notices.php:810
3793
+ #@ mycred
3794
+ msgid "Your websites admin email"
3795
+ msgstr ""
3796
+
3797
+ #: addons/email-notices/myCRED-addon-email-notices.php:811
3798
+ #@ mycred
3799
+ msgid "Total number of blog members"
3800
+ msgstr ""
3801
+
3802
+ #: addons/email-notices/myCRED-addon-email-notices.php:814
3803
+ #@ mycred
3804
+ msgid "Points name in singular format"
3805
+ msgstr ""
3806
+
3807
+ #: addons/email-notices/myCRED-addon-email-notices.php:815
3808
+ #@ mycred
3809
+ msgid "Points name in plural"
3810
+ msgstr ""
3811
+
3812
+ #: addons/email-notices/myCRED-addon-email-notices.php:816
3813
+ #@ mycred
3814
+ msgid "Login URL"
3815
+ msgstr ""
3816
+
3817
+ #: addons/email-notices/myCRED-addon-email-notices.php:819
3818
+ #@ mycred
3819
+ msgid "User Related"
3820
+ msgstr ""
3821
+
3822
+ #: addons/email-notices/myCRED-addon-email-notices.php:820
3823
+ #@ mycred
3824
+ msgid "The users ID"
3825
+ msgstr ""
3826
+
3827
+ #: addons/email-notices/myCRED-addon-email-notices.php:821
3828
+ #@ mycred
3829
+ msgid "The users login name (username)"
3830
+ msgstr ""
3831
+
3832
+ #: addons/email-notices/myCRED-addon-email-notices.php:822
3833
+ #@ mycred
3834
+ msgid "The users display name"
3835
+ msgstr ""
3836
+
3837
+ #: addons/email-notices/myCRED-addon-email-notices.php:823
3838
+ #@ mycred
3839
+ msgid "The users profile address"
3840
+ msgstr ""
3841
+
3842
+ #: addons/email-notices/myCRED-addon-email-notices.php:824
3843
+ #@ mycred
3844
+ msgid "Link to the users profile address with their display name as title"
3845
+ msgstr ""
3846
+
3847
+ #: addons/email-notices/myCRED-addon-email-notices.php:825
3848
+ #@ mycred
3849
+ msgid "The users current balance unformated"
3850
+ msgstr ""
3851
+
3852
+ #: addons/email-notices/myCRED-addon-email-notices.php:826
3853
+ #@ mycred
3854
+ msgid "The users current balance formated"
3855
+ msgstr ""
3856
+
3857
+ #: addons/email-notices/myCRED-addon-email-notices.php:828
3858
+ #@ mycred
3859
+ msgid "Post Related"
3860
+ msgstr ""
3861
+
3862
+ #: addons/email-notices/myCRED-addon-email-notices.php:829
3863
+ #@ mycred
3864
+ msgid "Post Title"
3865
+ msgstr ""
3866
+
3867
+ #: addons/email-notices/myCRED-addon-email-notices.php:830
3868
+ #@ mycred
3869
+ msgid "Post URL address"
3870
+ msgstr ""
3871
+
3872
+ #: addons/email-notices/myCRED-addon-email-notices.php:831
3873
+ #@ mycred
3874
+ msgid "Link to post Post title"
3875
+ msgstr ""
3876
+
3877
+ #: addons/email-notices/myCRED-addon-email-notices.php:832
3878
+ #@ mycred
3879
+ msgid "The post type"
3880
+ msgstr ""
3881
+
3882
+ #: addons/email-notices/myCRED-addon-email-notices.php:908
3883
+ #: addons/email-notices/myCRED-addon-email-notices.php:911
3884
+ #, php-format
3885
+ #@ mycred
3886
+ msgid "Email Notice Updated. View <a href=\"%1$s\">All Notices</a>."
3887
+ msgstr ""
3888
+
3889
+ #: addons/email-notices/myCRED-addon-email-notices.php:909
3890
+ #: addons/ranks/myCRED-addon-ranks.php:299
3891
+ #@ mycred
3892
+ msgid "Custom field updated"
3893
+ msgstr ""
3894
+
3895
+ #: addons/email-notices/myCRED-addon-email-notices.php:910
3896
+ #: addons/ranks/myCRED-addon-ranks.php:300
3897
+ #@ mycred
3898
+ msgid "Custom filed updated"
3899
+ msgstr ""
3900
+
3901
+ #: addons/email-notices/myCRED-addon-email-notices.php:913
3902
+ #@ mycred
3903
+ msgid "Email Notice Activated"
3904
+ msgstr ""
3905
+
3906
+ #: addons/email-notices/myCRED-addon-email-notices.php:914
3907
+ #@ mycred
3908
+ msgid "Email Notice Saved"
3909
+ msgstr ""
3910
+
3911
+ #: addons/email-notices/myCRED-addon-email-notices.php:915
3912
+ #, php-format
3913
+ #@ mycred
3914
+ msgid "Email Notice Submitted for approval. View <a href=\"%1$s\">All Notices</a>."
3915
+ msgstr ""
3916
+
3917
+ #: addons/email-notices/myCRED-addon-email-notices.php:917
3918
+ #, php-format
3919
+ #@ mycred
3920
+ msgid "Email Notice scheduled for: <strong>%1$s</strong>."
3921
+ msgstr ""
3922
+
3923
+ #: addons/email-notices/myCRED-addon-email-notices.php:936
3924
+ #@ mycred
3925
+ msgid "Once a notice is \"published\" it becomes active! Select \"Save Draft\" if you are not yet ready to use this email notice!"
3926
+ msgstr ""
3927
+
3928
+ #: addons/email-notices/myCRED-addon-email-notices.php:938
3929
+ #, php-format
3930
+ #@ mycred
3931
+ msgid "This notice will become active on:<br /><strong>%1$s</strong>"
3932
+ msgstr ""
3933
+
3934
+ #: addons/email-notices/myCRED-addon-email-notices.php:940
3935
+ #@ mycred
3936
+ msgid "This email notice is active."
3937
+ msgstr ""
3938
+
3939
+ #: addons/gateway/carts/mycred-marketpress.php:121
3940
+ #, php-format
3941
+ #@ mycred
3942
+ msgid "Sorry, but you must be logged in to use this gateway. Please <a href=\"%s\">Login</a> or <a href=\"%s\">select a different payment method</a>."
3943
+ msgstr ""
3944
+
3945
+ #: addons/gateway/carts/mycred-marketpress.php:133
3946
+ #, php-format
3947
+ #@ mycred
3948
+ msgid "Sorry, but you can not use this gateway as your account is excluded. Please <a href=\"%s\">select a different payment method</a>."
3949
+ msgstr ""
3950
+
3951
+ #: addons/gateway/carts/mycred-marketpress.php:170
3952
+ #@ mycred
3953
+ msgid "Paid"
3954
+ msgstr ""
3955
+
3956
+ #: addons/gateway/carts/mycred-marketpress.php:195
3957
+ #, php-format
3958
+ #@ mycred
3959
+ msgid "Insufficient Funds Please select a different payment method. <a href=\"%s\">Go Back</a>"
3960
+ msgstr ""
3961
+
3962
+ #: addons/gateway/carts/mycred-marketpress.php:253
3963
+ #@ mycred
3964
+ msgid "%_singular% Balance"
3965
+ msgstr ""
3966
+
3967
+ #: addons/gateway/carts/mycred-marketpress.php:276
3968
+ #, php-format
3969
+ #@ mycred
3970
+ msgid "Let your users pay for items in their shopping cart using their %s Account. Note! This gateway requires your users to be logged in when making a purchase!"
3971
+ msgstr ""
3972
+
3973
+ #: addons/gateway/carts/mycred-marketpress.php:279
3974
+ #@ mycred
3975
+ msgid "Method Name"
3976
+ msgstr ""
3977
+
3978
+ #: addons/gateway/carts/mycred-marketpress.php:281
3979
+ #@ mycred
3980
+ msgid "Enter a public name for this payment method that is displayed to users - No HTML"
3981
+ msgstr ""
3982
+
3983
+ #: addons/gateway/carts/mycred-marketpress.php:286
3984
+ #@ mycred
3985
+ msgid "Gateway Logo URL"
3986
+ msgstr ""
3987
+
3988
+ #: addons/gateway/carts/mycred-marketpress.php:315
3989
+ #@ mycred
3990
+ msgid "User Instructions"
3991
+ msgstr ""
3992
+
3993
+ #: addons/gateway/carts/mycred-marketpress.php:317
3994
+ #@ mycred
3995
+ msgid "Information to show users before payment."
3996
+ msgstr ""
3997
+
3998
+ #: addons/gateway/carts/mycred-marketpress.php:319
3999
+ #, php-format
4000
+ #@ mycred
4001
+ msgid "Available template tags are: %balance% and %balance_f% for users current balance."
4002
+ msgstr ""
4003
+
4004
+ #: addons/gateway/carts/mycred-marketpress.php:323
4005
+ #@ mycred
4006
+ msgid "Confirmation Information"
4007
+ msgstr ""
4008
+
4009
+ #: addons/gateway/carts/mycred-marketpress.php:325
4010
+ #@ mycred
4011
+ msgid "Information to display on the order confirmation page. - HTML allowed"
4012
+ msgstr ""
4013
+
4014
+ #: addons/gateway/carts/mycred-marketpress.php:327
4015
+ #, php-format
4016
+ #@ mycred
4017
+ msgid "Available template tags: TOTAL - total cart cost, %balance% and %balance_f% - users current balance."
4018
+ msgstr ""
4019
+
4020
+ #: addons/gateway/carts/mycred-marketpress.php:331
4021
+ #@ mycred
4022
+ msgid "Order Confirmation Email"
4023
+ msgstr ""
4024
+
4025
+ #: addons/gateway/carts/mycred-marketpress.php:333
4026
+ #, php-format
4027
+ #@ mycred
4028
+ msgid "This is the email text to send to those who have made %s checkouts. It overrides the default order checkout email. These codes will be replaced with order details: CUSTOMERNAME, ORDERID, ORDERINFO, SHIPPINGINFO, PAYMENTINFO, TOTAL, TRACKINGURL. No HTML allowed."
4029
+ msgstr ""
4030
+
4031
+ #: addons/gateway/carts/mycred-marketpress.php:335
4032
+ #, php-format
4033
+ #@ mycred
4034
+ msgid "Available template tags: %balance% or %balance_f% for users balance."
4035
+ msgstr ""
4036
+
4037
+ #: addons/ranks/includes/mycred-rank-functions.php:126
4038
+ #: addons/ranks/includes/mycred-rank-functions.php:132
4039
+ #@ mycred
4040
+ msgid "No Rank"
4041
+ msgstr ""
4042
+
4043
+ #: addons/ranks/includes/mycred-rank-shortcodes.php:56
4044
+ #: addons/ranks/includes/mycred-rank-shortcodes.php:115
4045
+ #@ mycred
4046
+ msgid "No users found with this rank"
4047
+ msgstr ""
4048
+
4049
+ #: addons/ranks/includes/mycred-rank-shortcodes.php:61
4050
+ #: includes/mycred-shortcodes.php:139
4051
+ #: includes/mycred-shortcodes.php:142
4052
+ #: includes/mycred-shortcodes.php:201
4053
+ #: includes/mycred-shortcodes.php:250
4054
+ #: includes/mycred-shortcodes.php:254
4055
+ #: includes/mycred-shortcodes.php:258
4056
+ #@ mycred
4057
+ msgid "error"
4058
+ msgstr ""
4059
+
4060
+ #: addons/ranks/includes/mycred-rank-shortcodes.php:61
4061
+ #@ mycred
4062
+ msgid "Rank ID is required!"
4063
+ msgstr ""
4064
+
4065
+ #: addons/ranks/myCRED-addon-ranks.php:117
4066
+ #: addons/ranks/myCRED-addon-ranks.php:123
4067
+ #: addons/ranks/myCRED-addon-ranks.php:129
4068
+ #: addons/ranks/myCRED-addon-ranks.php:503
4069
+ #: addons/ranks/myCRED-addon-ranks.php:581
4070
+ #@ mycred
4071
+ msgid "Ranks"
4072
+ msgstr ""
4073
+
4074
+ #: addons/ranks/myCRED-addon-ranks.php:118
4075
+ #: addons/ranks/myCRED-addon-ranks.php:230
4076
+ #: addons/ranks/myCRED-addon-ranks.php:245
4077
+ #@ mycred
4078
+ msgid "Rank"
4079
+ msgstr ""
4080
+
4081
+ #: addons/ranks/myCRED-addon-ranks.php:120
4082
+ #@ mycred
4083
+ msgid "Add New Rank"
4084
+ msgstr ""
4085
+
4086
+ #: addons/ranks/myCRED-addon-ranks.php:121
4087
+ #@ mycred
4088
+ msgid "Edit Rank"
4089
+ msgstr ""
4090
+
4091
+ #: addons/ranks/myCRED-addon-ranks.php:122
4092
+ #@ mycred
4093
+ msgid "New Rank"
4094
+ msgstr ""
4095
+
4096
+ #: addons/ranks/myCRED-addon-ranks.php:124
4097
+ #@ mycred
4098
+ msgid "View Rank"
4099
+ msgstr ""
4100
+
4101
+ #: addons/ranks/myCRED-addon-ranks.php:125
4102
+ #@ mycred
4103
+ msgid "Search Ranks"
4104
+ msgstr ""
4105
+
4106
+ #: addons/ranks/myCRED-addon-ranks.php:126
4107
+ #@ mycred
4108
+ msgid "No ranks found"
4109
+ msgstr ""
4110
+
4111
+ #: addons/ranks/myCRED-addon-ranks.php:127
4112
+ #@ mycred
4113
+ msgid "No ranks found in Trash"
4114
+ msgstr ""
4115
+
4116
+ #: addons/ranks/myCRED-addon-ranks.php:267
4117
+ #@ mycred
4118
+ msgid "Newbie"
4119
+ msgstr ""
4120
+
4121
+ #: addons/ranks/myCRED-addon-ranks.php:298
4122
+ #: addons/ranks/myCRED-addon-ranks.php:301
4123
+ #, php-format
4124
+ #@ mycred
4125
+ msgid "Rank Updated. View <a href=\"%1$s\">All Ranks</a>."
4126
+ msgstr ""
4127
+
4128
+ #: addons/ranks/myCRED-addon-ranks.php:303
4129
+ #@ mycred
4130
+ msgid "Rank Activated"
4131
+ msgstr ""
4132
+
4133
+ #: addons/ranks/myCRED-addon-ranks.php:304
4134
+ #@ mycred
4135
+ msgid "Rank Saved"
4136
+ msgstr ""
4137
+
4138
+ #: addons/ranks/myCRED-addon-ranks.php:305
4139
+ #, php-format
4140
+ #@ mycred
4141
+ msgid "Rank Submitted for approval. View <a href=\"%1$s\">All Ranks</a>."
4142
+ msgstr ""
4143
+
4144
+ #: addons/ranks/myCRED-addon-ranks.php:307
4145
+ #, php-format
4146
+ #@ mycred
4147
+ msgid "Rank scheduled for: <strong>%1$s</strong>."
4148
+ msgstr ""
4149
+
4150
+ #: addons/ranks/myCRED-addon-ranks.php:342
4151
+ #: addons/ranks/myCRED-addon-ranks.php:397
4152
+ #@ mycred
4153
+ msgid "Rank Title"
4154
+ msgstr ""
4155
+
4156
+ #: addons/ranks/myCRED-addon-ranks.php:343
4157
+ #@ mycred
4158
+ msgid "Logo"
4159
+ msgstr ""
4160
+
4161
+ #: addons/ranks/myCRED-addon-ranks.php:344
4162
+ #@ mycred
4163
+ msgid "Requirement"
4164
+ msgstr ""
4165
+
4166
+ #: addons/ranks/myCRED-addon-ranks.php:345
4167
+ #@ mycred
4168
+ msgid "Users"
4169
+ msgstr ""
4170
+
4171
+ #: addons/ranks/myCRED-addon-ranks.php:361
4172
+ #@ mycred
4173
+ msgid "No Logo Set"
4174
+ msgstr ""
4175
+
4176
+ #: addons/ranks/myCRED-addon-ranks.php:370
4177
+ #: addons/ranks/myCRED-addon-ranks.php:375
4178
+ #@ mycred
4179
+ msgid "Any Value"
4180
+ msgstr ""
4181
+
4182
+ #: addons/ranks/myCRED-addon-ranks.php:377
4183
+ #, php-format
4184
+ #@ mycred
4185
+ msgid "Maximum %plural%"
4186
+ msgstr ""
4187
+
4188
+ #: addons/ranks/myCRED-addon-ranks.php:410
4189
+ #@ mycred
4190
+ msgid "Rank Settings"
4191
+ msgstr ""
4192
+
4193
+ #: addons/ranks/myCRED-addon-ranks.php:432
4194
+ #, php-format
4195
+ #@ mycred
4196
+ msgid "Minimum %plural% to reach this rank"
4197
+ msgstr ""
4198
+
4199
+ #: addons/ranks/myCRED-addon-ranks.php:436
4200
+ #, php-format
4201
+ #@ mycred
4202
+ msgid "Maximum %plural% to be included in this rank"
4203
+ msgstr ""
4204
+
4205
+ #: addons/ranks/myCRED-addon-ranks.php:441
4206
+ #@ mycred
4207
+ msgid "All Published Ranks"
4208
+ msgstr ""
4209
+
4210
+ #: addons/ranks/myCRED-addon-ranks.php:448
4211
+ #: addons/ranks/myCRED-addon-ranks.php:450
4212
+ #@ mycred
4213
+ msgid "Not Set"
4214
+ msgstr ""
4215
+
4216
+ #: addons/ranks/myCRED-addon-ranks.php:455
4217
+ #@ mycred
4218
+ msgid "No Ranks found"
4219
+ msgstr ""
4220
+
4221
+ #: addons/ranks/myCRED-addon-ranks.php:505
4222
+ #@ mycred
4223
+ msgid "Public"
4224
+ msgstr ""
4225
+
4226
+ #: addons/ranks/myCRED-addon-ranks.php:509
4227
+ #@ mycred
4228
+ msgid "If you want to create a template archive for each rank, you must select to have ranks public. Defaults to disabled."
4229
+ msgstr ""
4230
+
4231
+ #: addons/ranks/myCRED-addon-ranks.php:513
4232
+ #@ mycred
4233
+ msgid "Rank Post Type URL Slug"
4234
+ msgstr ""
4235
+
4236
+ #: addons/ranks/myCRED-addon-ranks.php:515
4237
+ #: addons/ranks/myCRED-addon-ranks.php:589
4238
+ #@ mycred
4239
+ msgid "If you are using a custom permalink structure and you make ranks public or change the slug, you will need to visit your permalink settings page and click \"Save Changes\" to flush your re-write rules! Otherwise you will get a 404 error message when trying to view a rank archive page."
4240
+ msgstr ""
4241
+
4242
+ #: addons/ranks/myCRED-addon-ranks.php:519
4243
+ #: addons/ranks/myCRED-addon-ranks.php:586
4244
+ #, php-format
4245
+ #@ mycred
4246
+ msgid "For more information on Templates for Custom Post Types visit the <a href=\"%s\">WordPress Codex</a>."
4247
+ msgstr ""
4248
+
4249
+ #: addons/ranks/myCRED-addon-ranks.php:535
4250
+ #@ mycred
4251
+ msgid "Rank in BuddyPress"
4252
+ msgstr ""
4253
+
4254
+ #: addons/ranks/myCRED-addon-ranks.php:583
4255
+ #@ mycred
4256
+ msgid "You can create ranks according to the amount of points a user has. By default, ranks are only visible in widgets and shortcodes however it is possible for you to also create archive pages in your theme for all ranks or specific ones."
4257
+ msgstr ""
4258
+
4259
+ #: addons/ranks/myCRED-addon-ranks.php:584
4260
+ #@ mycred
4261
+ msgid "Templates"
4262
+ msgstr ""
4263
+
4264
+ #: addons/ranks/myCRED-addon-ranks.php:585
4265
+ #@ mycred
4266
+ msgid "Ranks are just another custom post type which means that you can, if you select to make Ranks Public, create custom template files for ranks in your theme folder."
4267
+ msgstr ""
4268
+
4269
+ #: addons/ranks/myCRED-addon-ranks.php:587
4270
+ #@ mycred
4271
+ msgid "Changing URL Slug"
4272
+ msgstr ""
4273
+
4274
+ #: addons/ranks/myCRED-addon-ranks.php:588
4275
+ #@ mycred
4276
+ msgid "You can change the URL slug used for ranks to any URL friendly value."
4277
+ msgstr ""
4278
+
4279
+ #: addons/sell-content/myCRED-addon-sell-content.php:65
4280
+ #@ mycred
4281
+ msgid "Hours"
4282
+ msgstr ""
4283
+
4284
+ #: addons/sell-content/myCRED-addon-sell-content.php:207
4285
+ #@ mycred
4286
+ msgid "You can not buy this content."
4287
+ msgstr ""
4288
+
4289
+ #: addons/sell-content/myCRED-addon-sell-content.php:269
4290
+ #: addons/transfer/myCRED-addon-transfer.php:129
4291
+ #: mycred.php:493
4292
+ #@ mycred
4293
+ msgid "Processing..."
4294
+ msgstr ""
4295
+
4296
+ #: addons/sell-content/myCRED-addon-sell-content.php:270
4297
+ #@ mycred
4298
+ msgid "Error. Try Again"
4299
+ msgstr ""
4300
+
4301
+ #: addons/sell-content/myCRED-addon-sell-content.php:351
4302
+ #@ mycred
4303
+ msgid "Purchases expire after"
4304
+ msgstr ""
4305
+
4306
+ #: addons/sell-content/myCRED-addon-sell-content.php:353
4307
+ #@ mycred
4308
+ msgid "Use zero for permanent sales."
4309
+ msgstr ""
4310
+
4311
+ #: addons/sell-content/myCRED-addon-sell-content.php:443
4312
+ #@ mycred
4313
+ msgid "Sell This"
4314
+ msgstr ""
4315
+
4316
+ #: addons/sell-content/myCRED-addon-sell-content.php:492
4317
+ #@ mycred
4318
+ msgid " Sell Content needs to be setup before you can use this feature."
4319
+ msgstr ""
4320
+
4321
+ #: addons/sell-content/myCRED-addon-sell-content.php:538
4322
+ #@ mycred
4323
+ msgid "Purchase expires after"
4324
+ msgstr ""
4325
+
4326
+ #: addons/sell-content/myCRED-addon-sell-content.php:865
4327
+ #: addons/sell-content/myCRED-addon-sell-content.php:945
4328
+ #@ mycred
4329
+ msgid "The following content is set for sale:"
4330
+ msgstr ""
4331
+
4332
+ #: addons/sell-content/myCRED-addon-sell-content.php:963
4333
+ #@ mycred
4334
+ msgid "No purchases found"
4335
+ msgstr ""
4336
+
4337
+ #: addons/sell-content/myCRED-addon-sell-content.php:1000
4338
+ #@ mycred
4339
+ msgid "Purchased"
4340
+ msgstr ""
4341
+
4342
+ #: addons/transfer/myCRED-addon-transfer.php:507
4343
+ #@ mycred
4344
+ msgid "Allow transfers between users."
4345
+ msgstr ""
4346
+
4347
+ #: addons/transfer/myCRED-addon-transfer.php:509
4348
+ #, php-format
4349
+ #@ mycred
4350
+ msgid "%s Transfer"
4351
+ msgstr ""
4352
+
4353
+ #: includes/mycred-functions.php:310
4354
+ #@ mycred
4355
+ msgid "Deleted"
4356
+ msgstr ""
4357
+
4358
+ #: includes/mycred-functions.php:441
4359
+ #@ mycred
4360
+ msgid "Deleted Item"
4361
+ msgstr ""
4362
+
4363
+ #: includes/mycred-network.php:135
4364
+ #, php-format
4365
+ #@ mycred
4366
+ msgid "Configure network settings for %s."
4367
+ msgstr ""
4368
+
4369
+ #: includes/mycred-network.php:152
4370
+ #, php-format
4371
+ #@ mycred
4372
+ msgid "If enabled, your main site's %s setup will be used for all other sites."
4373
+ msgstr ""
4374
+
4375
+ #: includes/mycred-network.php:159
4376
+ #, php-format
4377
+ #@ mycred
4378
+ msgid "Comma separated list of blog ids where %s is to be disabled."
4379
+ msgstr ""
4380
+
4381
+ #: includes/mycred-shortcodes.php:139
4382
+ #: includes/mycred-shortcodes.php:250
4383
+ #@ mycred
4384
+ msgid "Amount missing!"
4385
+ msgstr ""
4386
+
4387
+ #: includes/mycred-shortcodes.php:142
4388
+ #: includes/mycred-shortcodes.php:258
4389
+ #@ mycred
4390
+ msgid "Log Template Missing!"
4391
+ msgstr ""
4392
+
4393
+ #: includes/mycred-shortcodes.php:201
4394
+ #@ mycred
4395
+ msgid "Anchor missing URL!"
4396
+ msgstr ""
4397
+
4398
+ #: includes/mycred-shortcodes.php:254
4399
+ #@ mycred
4400
+ msgid "User ID missing for recipient."
4401
+ msgstr ""
4402
+
4403
+ #: includes/mycred-widgets.php:19
4404
+ #, php-format
4405
+ #@ mycred
4406
+ msgid "Show the current users %s balance"
4407
+ msgstr ""
4408
+
4409
+ #: includes/mycred-widgets.php:21
4410
+ #, php-format
4411
+ #@ mycred
4412
+ msgid "%s Balance"
4413
+ msgstr ""
4414
+
4415
+ #: includes/mycred-widgets.php:201
4416
+ #@ mycred
4417
+ msgid "This will be appended after the balance. See the help tab for available template tags."
4418
+ msgstr ""
4419
+
4420
+ #: includes/mycred-widgets.php:292
4421
+ #, php-format
4422
+ #@ mycred
4423
+ msgid "Show a list of users sorted by their %s balance"
4424
+ msgstr ""
4425
+
4426
+ #: includes/mycred-widgets.php:294
4427
+ #, php-format
4428
+ #@ mycred
4429
+ msgid "%s List"
4430
+ msgstr ""
4431
+
4432
+ #: includes/mycred-widgets.php:373
4433
+ #@ mycred
4434
+ msgid "Offset"
4435
+ msgstr ""
4436
+
4437
+ #: includes/mycred-widgets.php:375
4438
+ #@ mycred
4439
+ msgid "Optional offset of order. Use zero to return the first in the list."
4440
+ msgstr ""
4441
+
4442
+ #: includes/mycred-widgets.php:378
4443
+ #@ mycred
4444
+ msgid "Order"
4445
+ msgstr ""
4446
+
4447
+ #: includes/mycred-widgets.php:382
4448
+ #@ mycred
4449
+ msgid "Ascending"
4450
+ msgstr ""
4451
+
4452
+ #: includes/mycred-widgets.php:383
4453
+ #@ mycred
4454
+ msgid "Descending"
4455
+ msgstr ""
4456
+
4457
+ #: modules/mycred-module-hooks.php:116
4458
+ #, php-format
4459
+ #@ mycred
4460
+ msgid "%plural% for clicking on links"
4461
+ msgstr ""
4462
+
4463
+ #: modules/mycred-module-hooks.php:117
4464
+ #@ mycred
4465
+ msgid "Award %_plural% to users who clicks on links generated by the [mycred_link] shortcode."
4466
+ msgstr ""
4467
+
4468
+ #: modules/mycred-module-hooks.php:151
4469
+ #@ mycred
4470
+ msgid "BadgeOS"
4471
+ msgstr ""
4472
+
4473
+ #: modules/mycred-module-hooks.php:152
4474
+ #@ mycred
4475
+ msgid "Default settings for each BadgeOS Achievement type. These settings may be overridden for individual achievement type."
4476
+ msgstr ""
4477
+
4478
+ #: modules/mycred-module-hooks.php:160
4479
+ #@ mycred
4480
+ msgid "WP-Polls"
4481
+ msgstr ""
4482
+
4483
+ #: modules/mycred-module-hooks.php:161
4484
+ #@ mycred
4485
+ msgid "Awards %_plural% for users voting in polls."
4486
+ msgstr ""
4487
+
4488
+ #: modules/mycred-module-hooks.php:169
4489
+ #@ mycred
4490
+ msgid "WP Favorite Posts"
4491
+ msgstr ""
4492
+
4493
+ #: modules/mycred-module-hooks.php:170
4494
+ #@ mycred
4495
+ msgid "Awards %_plural% for users adding posts to their favorites."
4496
+ msgstr ""
4497
+
4498
+ #: modules/mycred-module-hooks.php:178
4499
+ #@ mycred
4500
+ msgid "Events Manager"
4501
+ msgstr ""
4502
+
4503
+ #: modules/mycred-module-hooks.php:179
4504
+ #@ mycred
4505
+ msgid "Awards %_plural% for users attending events."
4506
+ msgstr ""
4507
+
4508
+ #: modules/mycred-module-hooks.php:929
4509
+ #@ mycred
4510
+ msgid "Once for each unique URL"
4511
+ msgstr ""
4512
+
4513
+ #: modules/mycred-module-hooks.php:930
4514
+ #@ mycred
4515
+ msgid "Once for each unique link id"
4516
+ msgstr ""
4517
+
4518
+ #: modules/mycred-module-hooks.php:1076
4519
+ #@ mycred
4520
+ msgid "The default amount to award for clicking on links. You can override this in the shortcode."
4521
+ msgstr ""
4522
+
4523
+ #: modules/mycred-module-hooks.php:1083
4524
+ #, php-format
4525
+ #@ mycred
4526
+ msgid "Available template tags: General and custom tags: %url% or %id%."
4527
+ msgstr ""
4528
+
4529
+ #: modules/mycred-module-hooks.php:1094
4530
+ #@ mycred
4531
+ msgid "Remember!"
4532
+ msgstr ""
4533
+
4534
+ #: modules/mycred-module-hooks.php:1094
4535
+ #@ mycred
4536
+ msgid "If you select to limit by id and you do not include the id attribute in the shortcode, no %_plural% will be awarded!"
4537
+ msgstr ""
4538
+
4539
+ #: modules/mycred-module-log.php:930
4540
+ #@ mycred
4541
+ msgid "User Missing"
4542
+ msgstr ""
4543
+
4544
+ #: modules/mycred-module-plugins.php:363
4545
+ #, php-format
4546
+ #@ mycred
4547
+ msgid "Please setup your <a href=\"%s\">default settings</a> before using this feature."
4548
+ msgstr ""
4549
+
4550
+ #: modules/mycred-module-plugins.php:374
4551
+ #: modules/mycred-module-plugins.php:376
4552
+ #, php-format
4553
+ #@ mycred
4554
+ msgid "%plural% to Award"
4555
+ msgstr ""
4556
+
4557
+ #: modules/mycred-module-plugins.php:378
4558
+ #@ mycred
4559
+ msgid "Use zero to disable"
4560
+ msgstr ""
4561
+
4562
+ #: modules/mycred-module-plugins.php:389
4563
+ #@ mycred
4564
+ msgid "Deduction Log Template"
4565
+ msgstr ""
4566
+
4567
+ #: modules/mycred-module-plugins.php:525
4568
+ #, php-format
4569
+ #@ mycred
4570
+ msgid "Default %s for %s"
4571
+ msgstr ""
4572
+
4573
+ #: modules/mycred-module-plugins.php:532
4574
+ #@ mycred
4575
+ msgid "User zero to disable users gaining %_plural%"
4576
+ msgstr ""
4577
+
4578
+ #: modules/mycred-module-plugins.php:536
4579
+ #@ mycred
4580
+ msgid "Default Log template"
4581
+ msgstr ""
4582
+
4583
+ #: modules/mycred-module-plugins.php:674
4584
+ #, php-format
4585
+ #@ mycred
4586
+ msgid "Available template tags: General. You can also use %poll_id% and %poll_question%."
4587
+ msgstr ""
4588
+
4589
+ #: modules/mycred-module-plugins.php:784
4590
+ #@ mycred
4591
+ msgid "Adding Content to Favorites"
4592
+ msgstr ""
4593
+
4594
+ #: modules/mycred-module-plugins.php:794
4595
+ #: modules/mycred-module-plugins.php:807
4596
+ #: modules/mycred-module-plugins.php:954
4597
+ #: modules/mycred-module-plugins.php:967
4598
+ #@ mycred
4599
+ msgid "Available template tags: General and Post Related"
4600
+ msgstr ""
4601
+
4602
+ #: modules/mycred-module-plugins.php:797
4603
+ #@ mycred
4604
+ msgid "Removing Content from Favorites"
4605
+ msgstr ""
4606
+
4607
+ #: modules/mycred-module-plugins.php:944
4608
+ #@ mycred
4609
+ msgid "Attending Event"
4610
+ msgstr ""
4611
+
4612
+ #: modules/mycred-module-plugins.php:957
4613
+ #@ mycred
4614
+ msgid "Cancelling Attendance"
4615
+ msgstr ""
4616
+
4617
+ #: mycred.php:494
4618
+ #@ mycred
4619
+ msgid "Sent"
4620
+ msgstr ""
4621
+
4622
+ #: mycred.php:495
4623
+ #@ mycred
4624
+ msgid "Error - Try Again"
4625
+ msgstr ""
4626
+
4627
+ #: includes/mycred-shortcodes.php:66
4628
+ #@ mycred
4629
+ msgid "Leaderboard is empty."
4630
+ msgstr ""
4631
+
4632
+ #: modules/mycred-module-help.php:151
4633
+ #: modules/mycred-module-help.php:172
4634
+ #, php-format
4635
+ #@ mycred
4636
+ msgid "The users ranking. Was \"%rank%\" before version 1.1"
4637
+ msgstr ""
4638
+
modules/mycred-module-addons.php CHANGED
@@ -131,7 +131,7 @@ if ( !class_exists( 'myCRED_Addons' ) ) {
131
  /**
132
  * Get Addons
133
  * @since 0.1
134
- * @version 1.1
135
  */
136
  public function get( $save = false ) {
137
  $prefix = 'myCRED-addon-';
@@ -142,10 +142,15 @@ if ( !class_exists( 'myCRED_Addons' ) ) {
142
  $addon_search = glob( $addon_location . "*/$prefix*.php" );
143
  if ( !empty( $addon_search ) && $addon_search !== false ) {
144
  foreach ( $addon_search as $filename ) {
145
- // Handle windows
146
- $abspath = str_replace( '/', '', ABSPATH );
147
- // Remove ABSPATH to prevent long string addresses. Everything starts with wp-content
148
- $sub_file = str_replace( array( $abspath, ABSPATH ), '', $filename );
 
 
 
 
 
149
  // Get File Name
150
  preg_match( '/(.{1,})\/(.{1,})/', $sub_file, $matches );
151
  $sub_file_name = $matches[2];
@@ -219,13 +224,17 @@ if ( !class_exists( 'myCRED_Addons' ) ) {
219
  /**
220
  * Get Path of Addon
221
  * @since 0.1
222
- * @version 1.1
223
  */
224
  public function get_path( $key ) {
225
  $installed = $this->installed;
226
  if ( array_key_exists( $key, $installed ) ) {
227
  $file = $installed[$key]['file'];
228
- return ABSPATH . $installed[$key]['folder'] . $file;
 
 
 
 
229
  }
230
  return '';
231
  }
@@ -252,7 +261,7 @@ if ( !class_exists( 'myCRED_Addons' ) ) {
252
 
253
  <div class="wrap" id="myCRED-wrap">
254
  <div id="icon-myCRED" class="icon32"><br /></div>
255
- <h2><?php echo '<strong>my</strong>CRED ' . __( 'Add-ons', 'mycred' ); ?></h2>
256
  <p><?php _e( 'Add-ons can expand your current installation with further features.', 'mycred' ); ?></p>
257
  <div class="list-items expandable-li" id="accordion">
258
  <?php
131
  /**
132
  * Get Addons
133
  * @since 0.1
134
+ * @version 1.2
135
  */
136
  public function get( $save = false ) {
137
  $prefix = 'myCRED-addon-';
142
  $addon_search = glob( $addon_location . "*/$prefix*.php" );
143
  if ( !empty( $addon_search ) && $addon_search !== false ) {
144
  foreach ( $addon_search as $filename ) {
145
+ // Handle windows and WP Stage support by clariner
146
+ if ( !defined( 'WP_STAGE' ) ) {
147
+ $abspath = str_replace( '/', '', ABSPATH );
148
+ // Remove ABSPATH to prevent long string addresses. Everything starts with wp-content
149
+ $sub_file = str_replace( array( $abspath, ABSPATH ), '', $filename );
150
+ }
151
+ else {
152
+ $sub_file = $filename;
153
+ }
154
  // Get File Name
155
  preg_match( '/(.{1,})\/(.{1,})/', $sub_file, $matches );
156
  $sub_file_name = $matches[2];
224
  /**
225
  * Get Path of Addon
226
  * @since 0.1
227
+ * @version 1.2
228
  */
229
  public function get_path( $key ) {
230
  $installed = $this->installed;
231
  if ( array_key_exists( $key, $installed ) ) {
232
  $file = $installed[$key]['file'];
233
+ // WP Stage Support by clariner
234
+ if ( !defined( 'WP_STAGE' ) )
235
+ return ABSPATH . $installed[$key]['folder'] . $file;
236
+ else
237
+ return $installed[$key]['folder'] . $file;
238
  }
239
  return '';
240
  }
261
 
262
  <div class="wrap" id="myCRED-wrap">
263
  <div id="icon-myCRED" class="icon32"><br /></div>
264
+ <h2><?php echo apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . __( 'Add-ons', 'mycred' ); ?></h2>
265
  <p><?php _e( 'Add-ons can expand your current installation with further features.', 'mycred' ); ?></p>
266
  <div class="list-items expandable-li" id="accordion">
267
  <?php
modules/mycred-module-general.php CHANGED
@@ -44,7 +44,7 @@ if ( !class_exists( 'myCRED_General' ) ) {
44
 
45
  <div class="wrap list" id="myCRED-wrap">
46
  <div id="icon-myCRED" class="icon32"><br /></div>
47
- <h2><?php echo '<strong>my</strong>CRED ' . __( 'Settings', 'mycred' ); ?> <?php echo myCRED_VERSION; ?></h2>
48
  <div id="mycred-social">
49
  <a href="https://www.facebook.com/myCRED" class="zocial facebook" target="_blank">Facebook</a>
50
  <a href="https://plus.google.com/b/102981932999764129220/102981932999764129220/posts" class="zocial googleplus" target="_blank">Google Plus</a>
44
 
45
  <div class="wrap list" id="myCRED-wrap">
46
  <div id="icon-myCRED" class="icon32"><br /></div>
47
+ <h2><?php echo apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . __( 'Settings', 'mycred' ); ?> <?php echo myCRED_VERSION; ?></h2>
48
  <div id="mycred-social">
49
  <a href="https://www.facebook.com/myCRED" class="zocial facebook" target="_blank">Facebook</a>
50
  <a href="https://plus.google.com/b/102981932999764129220/102981932999764129220/posts" class="zocial googleplus" target="_blank">Google Plus</a>
modules/mycred-module-help.php CHANGED
@@ -148,7 +148,7 @@ if ( !class_exists( 'myCRED_Help' ) ) {
148
  <p><code>%cred%</code> ' . __( 'Balance amount in plain format.', 'mycred' ) . '<br />
149
  <code>%cred_f%</code> ' . __( 'Balance amount formatted with prefix and/or suffix.', 'mycred' ) . '</p>
150
  <p><strong>' . __( 'Rank Format:', 'mycred' ) . '</strong></p>
151
- <p><code>%rank%</code> ' . __( 'The users ranking.', 'mycred' ) . '</p>
152
  <p><strong>' . __( 'History Title:', 'mycred' ) . '</strong></p>
153
  <p><code>%singular%</code> ' . __( 'or', 'mycred' ) . ' <code>%_singular%</code> ' . $this->core->template_tags_general( __( 'Singular %plural% Name.', 'mycred' ) ) . '<br />
154
  <code>%plural%</code> ' . __( 'or', 'mycred' ) . ' <code>%_plural%</code> ' . $this->core->template_tags_general( __( 'Plural %plural% Name.', 'mycred' ) ) . '</p>
@@ -169,7 +169,7 @@ if ( !class_exists( 'myCRED_Help' ) ) {
169
  'content' => '
170
  <h3>' . __( 'Available Template Tags', 'mycred' ) . '</h3>
171
  <p><strong>' . __( 'Row Layout:', 'mycred' ) . '</strong></p>
172
- <p><code>%rank%</code> ' . __( 'The users ranking.', 'mycred' ) . '<br />
173
  <code>%cred%</code> ' . __( 'Balance amount in plain format.', 'mycred' ) . '<br />
174
  <code>%cred_f%</code> ' . __( 'Balance amount formatted with prefix and/or suffix.', 'mycred' ) . '<br />
175
  <code>%singular%</code> ' . __( 'or', 'mycred' ) . ' <code>%_singular%</code> ' . $this->core->template_tags_general( __( 'Singular %plural% Name.', 'mycred' ) ) . '<br />
148
  <p><code>%cred%</code> ' . __( 'Balance amount in plain format.', 'mycred' ) . '<br />
149
  <code>%cred_f%</code> ' . __( 'Balance amount formatted with prefix and/or suffix.', 'mycred' ) . '</p>
150
  <p><strong>' . __( 'Rank Format:', 'mycred' ) . '</strong></p>
151
+ <p><code>%ranking%</code> ' . __( 'The users ranking. Was "%rank%" before version 1.1', 'mycred' ) . '</p>
152
  <p><strong>' . __( 'History Title:', 'mycred' ) . '</strong></p>
153
  <p><code>%singular%</code> ' . __( 'or', 'mycred' ) . ' <code>%_singular%</code> ' . $this->core->template_tags_general( __( 'Singular %plural% Name.', 'mycred' ) ) . '<br />
154
  <code>%plural%</code> ' . __( 'or', 'mycred' ) . ' <code>%_plural%</code> ' . $this->core->template_tags_general( __( 'Plural %plural% Name.', 'mycred' ) ) . '</p>
169
  'content' => '
170
  <h3>' . __( 'Available Template Tags', 'mycred' ) . '</h3>
171
  <p><strong>' . __( 'Row Layout:', 'mycred' ) . '</strong></p>
172
+ <p><code>%ranking%</code> ' . __( 'The users ranking. Was "%rank%" before version 1.1', 'mycred' ) . '<br />
173
  <code>%cred%</code> ' . __( 'Balance amount in plain format.', 'mycred' ) . '<br />
174
  <code>%cred_f%</code> ' . __( 'Balance amount formatted with prefix and/or suffix.', 'mycred' ) . '<br />
175
  <code>%singular%</code> ' . __( 'or', 'mycred' ) . ' <code>%_singular%</code> ' . $this->core->template_tags_general( __( 'Singular %plural% Name.', 'mycred' ) ) . '<br />
modules/mycred-module-hooks.php CHANGED
@@ -1,6 +1,9 @@
1
  <?php
2
  if ( !defined( 'myCRED_VERSION' ) ) exit;
 
3
  include_once( myCRED_MODULES_DIR . 'mycred-module-subscriptions.php' );
 
 
4
  /**
5
  * myCRED_Hooks class
6
  * @since 0.1
@@ -77,31 +80,44 @@ if ( !class_exists( 'myCRED_Hooks' ) ) {
77
  /**
78
  * Get Hooks
79
  * @since 0.1
80
- * @version 1.0.5
81
  */
82
  public function get( $save = false ) {
83
- // Defaults
84
  $installed['registration'] = array(
85
  'title' => __( '%plural% for registrations', 'mycred' ),
86
  'description' => __( 'Award %_plural% for users joining your website.', 'mycred' ),
87
  'callback' => array( 'myCRED_Hook_Registration' )
88
  );
 
 
89
  $installed['logging_in'] = array(
90
  'title' => __( '%plural% for logins', 'mycred' ),
91
  'description' => __( 'Award %_plural% for logging in to your website. You can also set an optional limit.', 'mycred' ),
92
  'callback' => array( 'myCRED_Hook_Logging_In' )
93
  );
 
 
94
  $installed['publishing_content'] = array(
95
  'title' => __( '%plural% for publishing content', 'mycred' ),
96
  'description' => __( 'Award %_plural% for publishing content on your website. If your custom post type is not shown bellow, make sure it is set to "Public".', 'mycred' ),
97
  'callback' => array( 'myCRED_Hook_Publishing_Content' )
98
  );
 
 
99
  $installed['comments'] = array(
100
  'title' => __( '%plural% for comments', 'mycred' ),
101
  'description' => __( 'Award %_plural% for making comments.', 'mycred' ),
102
  'callback' => array( 'myCRED_Hook_Comments' )
103
  );
104
 
 
 
 
 
 
 
 
105
  // Prep for Invite Anyone Plugin
106
  if ( function_exists( 'invite_anyone_init' ) ) {
107
  $installed['invite_anyone'] = array(
@@ -128,7 +144,7 @@ if ( !class_exists( 'myCRED_Hooks' ) ) {
128
  'callback' => array( 'myCRED_Hook_Jetpack' )
129
  );
130
  }
131
-
132
  // Prep for BadgeOS
133
  if ( class_exists( 'BadgeOS' ) ) {
134
  $installed['badgeos'] = array(
@@ -138,6 +154,33 @@ if ( !class_exists( 'myCRED_Hooks' ) ) {
138
  );
139
  }
140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  $installed = apply_filters( 'mycred_setup_hooks', $installed );
142
 
143
  if ( $save === true && $this->core->can_edit_plugin() ) {
@@ -172,7 +215,7 @@ if ( !class_exists( 'myCRED_Hooks' ) ) {
172
 
173
  <div class="wrap" id="myCRED-wrap">
174
  <div id="icon-myCRED" class="icon32"><br /></div>
175
- <h2><?php echo '<strong>my</strong>CRED ' . __( 'Hooks', 'mycred' ); ?></h2>
176
  <p><?php echo $this->core->template_tags_general( __( 'Hooks are instances where %_plural% are awarded or deducted from a user, depending on their actions around your website.', 'mycred' ) ); ?></p>
177
  <form method="post" action="options.php">
178
  <?php settings_fields( 'myCRED-hooks' ); ?>
@@ -202,8 +245,7 @@ if ( !class_exists( 'myCRED_Hooks' ) ) {
202
 
203
  </form>
204
  </div>
205
- <?php
206
- unset( $installed );
207
  unset( $this );
208
  }
209
 
@@ -302,8 +344,7 @@ if ( !class_exists( 'myCRED_Hook_Registration' ) ) {
302
  <span class="description"><?php _e( 'Available template tags: General, User', 'mycred' ); ?></span>
303
  </li>
304
  </ol>
305
- <?php
306
- unset( $this );
307
  }
308
  }
309
  }
@@ -346,8 +387,10 @@ if ( !class_exists( 'myCRED_Hook_Logging_In' ) ) {
346
  * @version 1.1
347
  */
348
  public function logging_in( $user_login, $user ) {
 
349
  if ( $this->core->exclude_user( $user->ID ) === true ) return;
350
 
 
351
  if ( !$this->reward_login( $user->ID ) ) return;
352
 
353
  // Execute
@@ -405,7 +448,7 @@ if ( !class_exists( 'myCRED_Hook_Logging_In' ) ) {
405
  }
406
  }
407
  }
408
-
409
  // Update new login time
410
  if ( $this->prefs['limit'] == 'daily' )
411
  update_user_meta( $user_id, 'mycred_last_login', $today );
@@ -443,8 +486,7 @@ if ( !class_exists( 'myCRED_Hook_Logging_In' ) ) {
443
 
444
  </li>
445
  </ol>
446
- <?php
447
- unset( $this );
448
  }
449
  }
450
  }
@@ -566,7 +608,7 @@ if ( !class_exists( 'myCRED_Hook_Publishing_Content' ) ) {
566
  foreach ( $post_types as $post_type ) {
567
  // Start by checking if this post type should be excluded
568
  if ( !$this->include_post_type( $post_type->name ) ) continue;
569
-
570
  // Points to award/deduct
571
  if ( isset( $prefs[$post_type->name]['creds'] ) )
572
  $_creds = $prefs[$post_type->name]['creds'];
@@ -604,7 +646,6 @@ if ( !class_exists( 'myCRED_Hook_Publishing_Content' ) ) {
604
  */
605
  protected function include_post_type( $post_type ) {
606
  if ( in_array( $post_type, apply_filters( 'mycred_post_type_excludes', array( 'post', 'page' ) ) ) ) return false;
607
-
608
  return true;
609
  }
610
  }
@@ -659,7 +700,7 @@ if ( !class_exists( 'myCRED_Hook_Comments' ) ) {
659
  add_action( 'comment_approved_to_spam', array( $this, 'spam_comments' ) );
660
  add_action( 'comment_unapproved_to_spam', array( $this, 'spam_comments' ) );
661
  }
662
-
663
  if ( $this->prefs['trash'] != 0 ) {
664
  add_action( 'comment_approved_to_unapproved', array( $this, 'trash_comments' ) );
665
  add_action( 'comment_approved_to_trash', array( $this, 'trash_comments' ) );
@@ -841,546 +882,218 @@ if ( !class_exists( 'myCRED_Hook_Comments' ) ) {
841
  }
842
  }
843
  /**
844
- * Hooks for Invite Anyone Plugin
845
- * @since 0.1
846
  * @version 1.0
847
  */
848
- if ( !class_exists( 'myCRED_Invite_Anyone' ) && function_exists( 'invite_anyone_init' ) ) {
849
- class myCRED_Invite_Anyone extends myCRED_Hook {
850
 
851
  /**
852
  * Construct
853
  */
854
  function __construct( $hook_prefs ) {
855
  parent::__construct( array(
856
- 'id' => 'invite_anyone',
857
  'defaults' => array(
858
- 'send_invite' => array(
859
- 'creds' => 1,
860
- 'log' => '%plural% for sending an invitation',
861
- 'limit' => 0
862
- ),
863
- 'accept_invite' => array(
864
- 'creds' => 1,
865
- 'log' => '%plural% for accepted invitation',
866
- 'limit' => 0
867
- )
868
  )
869
  ), $hook_prefs );
870
  }
871
 
872
  /**
873
  * Run
874
- * @since 0.1
875
  * @version 1.0
876
  */
877
  public function run() {
878
- if ( $this->prefs['send_invite']['creds'] != 0 ) {
879
- add_action( 'sent_email_invite', array( $this, 'send_invite' ), 10, 3 );
880
- }
881
- if ( $this->prefs['accept_invite']['creds'] != 0 ) {
882
- add_action( 'accepted_email_invite', array( $this, 'accept_invite' ), 10, 2 );
883
- }
884
- }
885
-
886
- /**
887
- * Sending Invites
888
- * @since 0.1
889
- * @version 1.0
890
- */
891
- public function send_invite( $user_id, $email, $group ) {
892
- // Limit Check
893
- if ( $this->prefs['send_invite']['limit'] != 0 ) {
894
- $user_log = get_user_meta( $user_id, 'mycred_invite_anyone', true );
895
- if ( empty( $user_log['sent'] ) ) $user_log['sent'] = 0;
896
- // Return if limit is reached
897
- if ( $user_log['sent'] >= $this->prefs['send_invite']['limit'] ) return;
898
- }
899
 
900
- // Award Points
901
- $this->core->add_creds(
902
- 'sending_an_invite',
903
- $user_id,
904
- $this->prefs['send_invite']['creds'],
905
- $this->prefs['send_invite']['log']
906
- );
907
 
908
- // Update limit
909
- if ( $this->prefs['send_invite']['limit'] != 0 ) {
910
- $user_log['sent'] = $user_log['sent']+1;
911
- update_user_meta( $user_id, 'mycred_invite_anyone', $user_log );
912
- }
913
-
914
- // Clean up
915
- unset( $this );
916
  }
917
 
918
  /**
919
- * Accepting Invites
920
- * @since 0.1
921
  * @version 1.0
922
  */
923
- public function accept_invite( $invited_user_id, $inviters ) {
924
- // Invite Anyone will pass on an array of user IDs of those who have invited this user which we need to loop though
925
- foreach ( $inviters as $inviter_id ) {
926
- // Limit Check
927
- if ( $this->prefs['accept_invite']['limit'] != 0 ) {
928
- $user_log = get_user_meta( $inviter_id, 'mycred_invite_anyone', true );
929
- if ( empty( $user_log['accepted'] ) ) $user_log['accepted'] = 0;
930
- // Continue to next inviter if limit is reached
931
- if ( $user_log['accepted'] >= $this->prefs['accept_invite']['limit'] ) continue;
932
- }
933
-
934
- // Award Points
935
- $this->core->add_creds(
936
- 'accepting_an_invite',
937
- $inviter_id,
938
- $this->prefs['accept_invite']['creds'],
939
- $this->prefs['accept_invite']['log']
940
- );
941
-
942
- // Update Limit
943
- if ( $this->prefs['accept_invite']['limit'] != 0 ) {
944
- $user_log['accepted'] = $user_log['accepted']+1;
945
- update_user_meta( $inviter_id, 'mycred_invite_anyone', $user_log );
946
- }
947
- }
948
-
949
- // Clean up
950
- unset( $this );
951
  }
952
 
953
  /**
954
- * Preferences
955
- * @since 0.1
956
  * @version 1.0
957
  */
958
- public function preferences() {
959
- $prefs = $this->prefs; ?>
 
 
960
 
961
- <!-- Creds for Sending Invites -->
962
- <label for="<?php echo $this->field_id( array( 'send_invite', 'creds' ) ); ?>" class="subheader"><?php echo $this->core->template_tags_general( __( '%plural% for Sending An Invite', 'mycred' ) ); ?></label>
963
- <ol>
964
- <li>
965
- <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'send_invite', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'send_invite', 'creds' ) ); ?>" value="<?php echo $this->core->format_number( $prefs['send_invite']['creds'] ); ?>" size="8" /></div>
966
- </li>
967
- <li class="empty">&nbsp;</li>
968
- <li>
969
- <label for="<?php echo $this->field_id( array( 'send_invite', 'log' ) ); ?>"><?php _e( 'Log template', 'mycred' ); ?></label>
970
- <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'send_invite', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'send_invite', 'log' ) ); ?>" value="<?php echo $prefs['send_invite']['log']; ?>" class="long" /></div>
971
- <span class="description"><?php _e( 'Available template tags: General', 'mycred' ); ?></span>
972
- </li>
973
- </ol>
974
- <label for="<?php echo $this->field_id( array( 'send_invite', 'limit' ) ); ?>" class="subheader"><?php _e( 'Limit', 'mycred' ); ?></label>
975
- <ol>
976
- <li>
977
- <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'send_invite', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'send_invite', 'limit' ) ); ?>" value="<?php echo $prefs['send_invite']['limit']; ?>" size="8" /></div>
978
- <span class="description"><?php echo $this->core->template_tags_general( __( 'Maximum number of invites that grants %_plural%. User zero for unlimited.', 'mycred' ) ); ?></span>
979
- </li>
980
- </ol>
981
- <!-- Creds for Accepting Invites -->
982
- <label for="<?php echo $this->field_id( array( 'accept_invite', 'creds' ) ); ?>" class="subheader"><?php echo $this->core->template_tags_general( __( '%plural% for Accepting An Invite', 'mycred' ) ); ?></label>
983
- <ol>
984
- <li>
985
- <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'accept_invite', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'accept_invite', 'creds' ) ); ?>" value="<?php echo $this->core->format_number( $prefs['accept_invite']['creds'] ); ?>" size="8" /></div>
986
- <span class="description"><?php echo $this->core->template_tags_general( __( '%plural% for each invited user that accepts an invitation.', 'mycred' ) ); ?></span>
987
- </li>
988
- <li class="empty">&nbsp;</li>
989
- <li>
990
- <label for="<?php echo $this->field_id( array( 'accept_invite', 'log' ) ); ?>"><?php _e( 'Log template', 'mycred' ); ?></label>
991
- <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'accept_invite', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'accept_invite', 'log' ) ); ?>" value="<?php echo $prefs['accept_invite']['log']; ?>" class="long" /></div>
992
- <span class="description"><?php _e( 'Available template tags: General', 'mycred' ); ?></span>
993
- </li>
994
- </ol>
995
- <label for="<?php echo $this->field_id( array( 'accept_invite', 'limit' ) ); ?>" class="subheader"><?php _e( 'Limit', 'mycred' ); ?></label>
996
- <ol>
997
- <li>
998
- <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'accept_invite', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'accept_invite', 'limit' ) ); ?>" value="<?php echo $prefs['accept_invite']['limit']; ?>" size="8" /></div>
999
- <span class="description"><?php echo $this->core->template_tags_general( __( 'Maximum number of accepted invitations that grants %_plural%. User zero for unlimited.', 'mycred' ) ); ?></span>
1000
- </li>
1001
- </ol>
1002
- <?php unset( $this );
1003
- }
1004
- }
1005
- }
1006
- /**
1007
- * Hook for Contact Form 7 Plugin
1008
- * @since 0.1
1009
- * @version 1.0
1010
- */
1011
- if ( !class_exists( 'myCRED_Contact_Form7' ) && function_exists( 'wpcf7' ) ) {
1012
- class myCRED_Contact_Form7 extends myCRED_Hook {
1013
-
1014
- /**
1015
- * Construct
1016
- */
1017
- function __construct( $hook_prefs ) {
1018
- parent::__construct( array(
1019
- 'id' => 'contact_form7',
1020
- 'defaults' => ''
1021
- ), $hook_prefs );
1022
- }
1023
-
1024
- /**
1025
- * Run
1026
- * @since 0.1
1027
- * @version 1.0
1028
- */
1029
- public function run() {
1030
- add_action( 'wpcf7_mail_sent', array( $this, 'form_submission' ) );
1031
  }
1032
 
1033
  /**
1034
- * Get Forms
1035
- * Queries all Contact Form 7 forms.
1036
- * @uses WP_Query()
1037
- * @since 0.1
1038
  * @version 1.0
1039
  */
1040
- public function get_forms() {
1041
- $forms = new WP_Query( array(
1042
- 'post_type' => 'wpcf7_contact_form',
1043
- 'post_status' => 'any',
1044
- 'posts_per_page' => '-1',
1045
- 'orderby' => 'ID',
1046
- 'order' => 'ASC'
1047
- ) );
1048
 
1049
- $result = array();
1050
- if ( $forms->have_posts() ) {
1051
- while ( $forms->have_posts() ) : $forms->the_post();
1052
- $result[get_the_ID()] = get_the_title();
1053
- endwhile;
1054
  }
1055
- wp_reset_postdata();
1056
-
1057
- return $result;
1058
  }
1059
-
1060
  /**
1061
- * Successful Form Submission
1062
- * @since 0.1
1063
  * @version 1.0
1064
  */
1065
- public function form_submission( $cf7_form ) {
1066
- // Login is required
1067
- if ( !is_user_logged_in() ) return;
1068
-
1069
- $form_id = $cf7_form->id;
1070
- if ( isset( $this->prefs[$form_id] ) && $this->prefs[$form_id]['creds'] != 0 ) {
1071
- $this->core->add_creds(
1072
- 'contact_form_submission',
1073
- get_current_user_id(),
1074
- $this->prefs[$form_id]['creds'],
1075
- $this->prefs[$form_id]['log'],
1076
- $form_id,
1077
- array( 'ref_type' => 'post' )
1078
  );
 
1079
  }
1080
-
1081
- // Clean up
1082
- unset( $this );
1083
  }
1084
 
1085
  /**
1086
- * Preferences for Commenting Hook
1087
- * @since 0.1
1088
  * @version 1.0
1089
  */
1090
- public function preferences() {
1091
- $prefs = $this->prefs;
1092
- $forms = $this->get_forms();
1093
 
1094
- // No forms found
1095
- if ( empty( $forms ) ) {
1096
- echo '<p>' . __( 'No forms found.', 'mycred' ) . '</p>';
1097
- return;
1098
  }
1099
-
1100
- // Loop though prefs to make sure we always have a default settings (happens when a new form has been created)
1101
- foreach ( $forms as $form_id => $form_title ) {
1102
- if ( !isset( $prefs[$form_id] ) ) {
1103
- $prefs[$form_id] = array(
1104
- 'creds' => 1,
1105
- 'log' => ''
1106
- );
1107
- }
1108
  }
 
1109
 
1110
- // Set pref if empty
1111
- if ( empty( $prefs ) ) $this->prefs = $prefs;
1112
-
1113
- // Loop for settings
1114
- foreach ( $forms as $form_id => $form_title ) { ?>
1115
 
1116
- <!-- Creds for -->
1117
- <label for="<?php echo $this->field_id( array( $form_id, 'creds' ) ); ?>" class="subheader"><?php echo $form_title; ?></label>
1118
- <ol>
1119
- <li>
1120
- <div class="h2"><input type="text" name="<?php echo $this->field_name( array( $form_id, 'creds' ) ); ?>" id="<?php echo $this->field_id( array( $form_id, 'creds' ) ); ?>" value="<?php echo $this->core->format_number( $prefs[$form_id]['creds'] ); ?>" size="8" /></div>
1121
- </li>
1122
- <li class="empty">&nbsp;</li>
1123
- <li>
1124
- <label for="<?php echo $this->field_id( array( $form_id, 'log' ) ); ?>"><?php _e( 'Log template', 'mycred' ); ?></label>
1125
- <div class="h2"><input type="text" name="<?php echo $this->field_name( array( $form_id, 'log' ) ); ?>" id="<?php echo $this->field_id( array( $form_id, 'log' ) ); ?>" value="<?php echo $prefs[$form_id]['log']; ?>" class="long" /></div>
1126
- <span class="description"><?php _e( 'Available template tags: General, Post', 'mycred' ); ?></span>
1127
- </li>
1128
- </ol>
1129
- <?php }
1130
- unset( $this );
1131
  }
1132
- }
1133
- }
1134
- /**
1135
- * Hook for BadgeOS Plugin
1136
- * @since 1.0.8
1137
- * @version 1.0
1138
- */
1139
- if ( !class_exists( 'myCRED_Hook_BadgeOS' ) && class_exists( 'BadgeOS' ) ) {
1140
- class myCRED_Hook_BadgeOS extends myCRED_Hook {
1141
 
1142
  /**
1143
- * Construct
1144
- */
1145
- function __construct( $hook_prefs ) {
1146
- parent::__construct( array(
1147
- 'id' => 'badgeos',
1148
- 'defaults' => ''
1149
- ), $hook_prefs );
1150
- }
1151
-
1152
- /**
1153
- * Run
1154
- * @since 1.0.8
1155
- * @version 1.0
1156
- */
1157
- public function run() {
1158
- add_action( 'add_meta_boxes', array( $this, 'add_metaboxes' ) );
1159
- add_action( 'save_post', array( $this, 'save_achivement_data' ) );
1160
-
1161
- add_action( 'badgeos_award_achievement', array( $this, 'award_achievent' ), 10, 2 );
1162
- add_action( 'badgeos_revoke_achievement', array( $this, 'revoke_achievement' ), 10, 2 );
1163
- }
1164
-
1165
- /**
1166
- * Add Metaboxes
1167
- * @since 1.0.8
1168
- * @version 1.0
1169
- */
1170
- public function add_metaboxes() {
1171
- // Get all Achievement Types
1172
- $badge_post_types = badgeos_get_achievement_types_slugs();
1173
- foreach ( $badge_post_types as $post_type ) {
1174
- // Add Meta Box
1175
- add_meta_box(
1176
- 'mycred_badgeos_' . $post_type,
1177
- __( 'myCRED', 'mycred' ),
1178
- array( $this, 'render_meta_box' ),
1179
- $post_type,
1180
- 'side',
1181
- 'core'
1182
- );
1183
- }
1184
- }
1185
-
1186
- /**
1187
- * Render Meta Box
1188
- * @since 1.0.8
1189
  * @version 1.0
1190
  */
1191
- public function render_meta_box( $post ) {
1192
- // Setup is needed
1193
- if ( !isset( $this->prefs[$post->post_type] ) ) {
1194
- $message = sprintf( __( 'Please setup your <a href="%s">default settings</a> before using this feature.', 'mycred' ), admin_url( 'admin.php?page=myCRED_page_hooks' ) );
1195
- echo '<p>' . $message . '</p>';
1196
- }
1197
-
1198
- // Prep Achievement Data
1199
- $prefs = $this->prefs;
1200
- $mycred = mycred_get_settings();
1201
- $achievement_data = get_post_meta( $post->ID, '_mycred_values', true );
1202
- if ( empty( $achievement_data ) )
1203
- $achievement_data = $prefs[$post->post_type]; ?>
1204
-
1205
- <p><strong><?php echo $mycred->template_tags_general( __( '%plural% to Award', 'mycred' ) ); ?></strong></p>
1206
- <p>
1207
- <label class="screen-reader-text" for="mycred-values-creds"><?php echo $mycred->template_tags_general( __( '%plural% to Award', 'mycred' ) ); ?></label>
1208
- <input type="text" name="mycred_values[creds]" id="mycred-values-creds" value="<?php echo $achievement_data['creds']; ?>" size="8" />
1209
- <span class="description"><?php _e( 'Use zero to disable', 'mycred' ); ?></span>
1210
- </p>
1211
- <p><strong><?php _e( 'Log Template', 'mycred' ); ?></strong></p>
1212
- <p>
1213
- <label class="screen-reader-text" for="mycred-values-log"><?php _e( 'Log Template', 'mycred' ); ?></label>
1214
- <input type="text" name="mycred_values[log]" id="mycred-values-log" value="<?php echo $achievement_data['log']; ?>" style="width:99%;" />
1215
- </p>
1216
- <?php
1217
- // If deduction is enabled
1218
- if ( $this->prefs[$post->post_type]['deduct'] == 1 ) { ?>
1219
-
1220
- <p><strong><?php _e( 'Deduction Log Template', 'mycred' ); ?></strong></p>
1221
- <p>
1222
- <label class="screen-reader-text" for="mycred-values-log"><?php _e( 'Log Template', 'mycred' ); ?></label>
1223
- <input type="text" name="mycred_values[deduct_log]" id="mycred-values-deduct-log" value="<?php echo $achievement_data['deduct_log']; ?>" style="width:99%;" />
1224
- </p>
1225
- <?php
1226
- }
1227
- }
1228
-
1229
- /**
1230
- * Save Achievement Data
1231
- * @since 1.0.8
1232
- * @version 1.1
1233
- */
1234
- public function save_achivement_data( $post_id ) {
1235
- // Post Type
1236
- $post_type = get_post_type( $post_id );
1237
 
1238
- // Make sure this is a BadgeOS Object
1239
- if ( !in_array( $post_type, badgeos_get_achievement_types_slugs() ) ) return;
1240
-
1241
- // Make sure preference is set
1242
- if ( !isset( $this->prefs[$post_type] ) || !isset( $_POST['mycred_values']['creds'] ) || !isset( $_POST['mycred_values']['log'] ) ) return;
1243
-
1244
- // Only save if the settings differ, otherwise we default
1245
- if ( $_POST['mycred_values']['creds'] == $this->prefs[$post_type]['creds'] &&
1246
- $_POST['mycred_values']['log'] == $this->prefs[$post_type]['log'] ) return;
1247
-
1248
- $data = array();
1249
 
1250
- // Creds
1251
- if ( !empty( $_POST['mycred_values']['creds'] ) && $_POST['mycred_values']['creds'] != $this->prefs[$post_type]['creds'] )
1252
- $data['creds'] = $this->core->format_number( $_POST['mycred_values']['creds'] );
1253
- else
1254
- $data['creds'] = $this->core->format_number( $this->prefs[$post_type]['creds'] );
1255
 
1256
- // Log template
1257
- if ( !empty( $_POST['mycred_values']['log'] ) && $_POST['mycred_values']['log'] != $this->prefs[$post_type]['log'] )
1258
- $data['log'] = strip_tags( $_POST['mycred_values']['log'] );
1259
  else
1260
- $data['log'] = strip_tags( $this->prefs[$post_type]['log'] );
1261
 
1262
- // If deduction is enabled save log template
1263
- if ( $this->prefs[$post_type]['deduct'] == 1 ) {
1264
- if ( !empty( $_POST['mycred_values']['deduct_log'] ) && $_POST['mycred_values']['deduct_log'] != $this->prefs[$post_type]['deduct_log'] )
1265
- $data['deduct_log'] = strip_tags( $_POST['mycred_values']['deduct_log'] );
1266
- else
1267
- $data['deduct_log'] = strip_tags( $this->prefs[$post_type]['deduct_log'] );
 
 
 
 
 
 
 
1268
  }
1269
-
1270
- // Update sales values
1271
- update_post_meta( $post_id, '_mycred_values', $data );
1272
- }
1273
-
1274
- /**
1275
- * Award Achievement
1276
- * Run by BadgeOS when ever needed, we make sure settings are not zero otherwise
1277
- * award points whenever this hook fires.
1278
- * @since 1.0.8
1279
- * @version 1.0
1280
- */
1281
- public function award_achievent( $user_id, $achievement_id ) {
1282
- $post_type = get_post_type( $achievement_id );
1283
- // Settings are not set
1284
- if ( !isset( $this->prefs[$post_type]['creds'] ) ) return;
1285
-
1286
- // Get achievemen data
1287
- $achievement_data = get_post_meta( $achievement_id, '_mycred_values', true );
1288
- if ( empty( $achievement_data ) )
1289
- $achievement_data = $this->prefs[$post_type];
1290
-
1291
- // Make sure its not disabled
1292
- if ( $achievement_data['creds'] == 0 ) return;
1293
 
1294
  // Execute
1295
- $post_type_object = get_post_type_object( $post_type );
1296
  $this->core->add_creds(
1297
- $post_type_object->labels->name,
1298
- $user_id,
1299
- $achievement_data['creds'],
1300
- $achievement_data['log'],
1301
- $achievement_id,
1302
- array( 'ref_type' => 'post' )
 
 
 
 
1303
  );
1304
- }
1305
-
1306
- /**
1307
- * Revoke Achievement
1308
- * Run by BadgeOS when a users achievement is revoed.
1309
- * @since 1.0.8
1310
- * @version 1.1
1311
- */
1312
- public function revoke_achievement( $user_id, $achievement_id ) {
1313
- $post_type = get_post_type( $achievement_id );
1314
- // Settings are not set
1315
- if ( !isset( $this->prefs[$post_type]['creds'] ) ) return;
1316
 
1317
- // Get achievemen data
1318
- $achievement_data = get_post_meta( $achievement_id, '_mycred_values', true );
1319
- if ( empty( $achievement_data ) )
1320
- $achievement_data = $this->prefs[$post_type];
1321
-
1322
- // Make sure its not disabled
1323
- if ( $achievement_data['creds'] == 0 ) return;
1324
-
1325
- // Execute
1326
- $post_type_object = get_post_type_object( $post_type );
1327
- $this->core->add_creds(
1328
- $post_type_object->labels->name,
1329
- $user_id,
1330
- 0-$achievement_data['creds'],
1331
- $achievement_data['deduct_log'],
1332
- $achievement_id,
1333
- array( 'ref_type' => 'post' )
1334
- );
1335
  }
1336
-
1337
  /**
1338
- * Preferences for Commenting Hook
1339
- * @since 1.0.8
1340
  * @version 1.0
1341
  */
1342
  public function preferences() {
1343
- $prefs = $this->prefs;
1344
- $badge_post_types = badgeos_get_achievement_types_slugs();
1345
- foreach ( $badge_post_types as $post_type ) {
1346
- if ( in_array( $post_type, apply_filters( 'mycred_badgeos_excludes', array( 'step' ) ) ) ) continue;
1347
- if ( !isset( $prefs[$post_type] ) )
1348
- $prefs[$post_type] = array(
1349
- 'creds' => 10,
1350
- 'log' => '',
1351
- 'deduct' => 1,
1352
- 'deduct_log' => '%plural% deduction'
1353
- );
1354
-
1355
- $post_type_object = get_post_type_object( $post_type );
1356
- $title = sprintf( __( 'Default %s for %s', 'mycred' ), $this->core->plural(), $post_type_object->labels->singular_name ); ?>
1357
-
1358
- <!-- Creds for -->
1359
- <label for="<?php echo $this->field_id( array( $post_type, 'creds' ) ); ?>" class="subheader"><?php echo $title; ?></label>
1360
  <ol>
1361
  <li>
1362
- <div class="h2"><input type="text" name="<?php echo $this->field_name( array( $post_type, 'creds' ) ); ?>" id="<?php echo $this->field_id( array( $post_type, 'creds' ) ); ?>" value="<?php echo $this->core->format_number( $prefs[$post_type]['creds'] ); ?>" size="8" /></div>
1363
- <span class="description"><?php echo $this->core->template_tags_general( __( 'User zero to disable users gaining %_plural%', 'mycred' ) ); ?></span>
1364
- </li>
1365
- <li class="empty">&nbsp;</li>
1366
- <li>
1367
- <label for="<?php echo $this->field_id( array( $post_type, 'log' ) ); ?>"><?php _e( 'Default Log template', 'mycred' ); ?></label>
1368
- <div class="h2"><input type="text" name="<?php echo $this->field_name( array( $post_type, 'log' ) ); ?>" id="<?php echo $this->field_id( array( $form_id, 'log' ) ); ?>" value="<?php echo $prefs[$post_type]['log']; ?>" class="long" /></div>
1369
- <span class="description"><?php _e( 'Available template tags: General, Post', 'mycred' ); ?></span>
1370
  </li>
 
 
 
1371
  <li>
1372
- <input type="checkbox" name="<?php echo $this->field_name( array( $post_type, 'deduct' ) ); ?>" id="<?php echo $this->field_id( array( $post_type, 'deduct' ) ); ?>" <?php checked( $prefs[$post_type]['deduct'], 1 ); ?> value="1" />
1373
- <label for="<?php echo $this->field_id( array( $post_type, 'deduct' ) ); ?>"><?php echo $this->core->template_tags_general( __( 'Deduct %_plural% if user looses ' . $post_type_object->labels->singular_name, 'mycred' ) ); ?></label>
1374
  </li>
1375
- <li class="empty">&nbsp;</li>
 
 
1376
  <li>
1377
- <label for="<?php echo $this->field_id( array( $post_type, 'deduct_log' ) ); ?>"><?php _e( 'Log template', 'mycred' ); ?></label>
1378
- <div class="h2"><input type="text" name="<?php echo $this->field_name( array( $post_type, 'deduct_log' ) ); ?>" id="<?php echo $this->field_id( array( $form_id, 'deduct_log' ) ); ?>" value="<?php echo $prefs[$post_type]['deduct_log']; ?>" class="long" /></div>
1379
- <span class="description"><?php _e( 'Available template tags: General, Post', 'mycred' ); ?></span>
 
1380
  </li>
 
1381
  </ol>
1382
- <?php
1383
- }
1384
  }
1385
  }
1386
  }
1
  <?php
2
  if ( !defined( 'myCRED_VERSION' ) ) exit;
3
+ // Subscription Related Hooks
4
  include_once( myCRED_MODULES_DIR . 'mycred-module-subscriptions.php' );
5
+ // Third-Party Plugin Hooks
6
+ include_once( myCRED_MODULES_DIR . 'mycred-module-plugins.php' );
7
  /**
8
  * myCRED_Hooks class
9
  * @since 0.1
80
  /**
81
  * Get Hooks
82
  * @since 0.1
83
+ * @version 1.1
84
  */
85
  public function get( $save = false ) {
86
+ // Registrations
87
  $installed['registration'] = array(
88
  'title' => __( '%plural% for registrations', 'mycred' ),
89
  'description' => __( 'Award %_plural% for users joining your website.', 'mycred' ),
90
  'callback' => array( 'myCRED_Hook_Registration' )
91
  );
92
+
93
+ // Logins
94
  $installed['logging_in'] = array(
95
  'title' => __( '%plural% for logins', 'mycred' ),
96
  'description' => __( 'Award %_plural% for logging in to your website. You can also set an optional limit.', 'mycred' ),
97
  'callback' => array( 'myCRED_Hook_Logging_In' )
98
  );
99
+
100
+ // Content Publishing
101
  $installed['publishing_content'] = array(
102
  'title' => __( '%plural% for publishing content', 'mycred' ),
103
  'description' => __( 'Award %_plural% for publishing content on your website. If your custom post type is not shown bellow, make sure it is set to "Public".', 'mycred' ),
104
  'callback' => array( 'myCRED_Hook_Publishing_Content' )
105
  );
106
+
107
+ // Commenting
108
  $installed['comments'] = array(
109
  'title' => __( '%plural% for comments', 'mycred' ),
110
  'description' => __( 'Award %_plural% for making comments.', 'mycred' ),
111
  'callback' => array( 'myCRED_Hook_Comments' )
112
  );
113
 
114
+ // Link Clicks
115
+ $installed['link_click'] = array(
116
+ 'title' => __( '%plural% for clicking on links', 'mycred' ),
117
+ 'description' => __( 'Award %_plural% to users who clicks on links generated by the [mycred_link] shortcode.', 'mycred' ),
118
+ 'callback' => array( 'myCRED_Hook_Click_Links' )
119
+ );
120
+
121
  // Prep for Invite Anyone Plugin
122
  if ( function_exists( 'invite_anyone_init' ) ) {
123
  $installed['invite_anyone'] = array(
144
  'callback' => array( 'myCRED_Hook_Jetpack' )
145
  );
146
  }
147
+
148
  // Prep for BadgeOS
149
  if ( class_exists( 'BadgeOS' ) ) {
150
  $installed['badgeos'] = array(
154
  );
155
  }
156
 
157
+ // Prep for WP-Polls
158
+ if ( function_exists( 'vote_poll' ) ) {
159
+ $installed['wppolls'] = array(
160
+ 'title' => __( 'WP-Polls', 'mycred' ),
161
+ 'description' => __( 'Awards %_plural% for users voting in polls.', 'mycred' ),
162
+ 'callback' => array( 'myCRED_Hook_WPPolls' )
163
+ );
164
+ }
165
+
166
+ // WP Favorite Posts
167
+ if ( function_exists( 'wp_favorite_posts' ) ) {
168
+ $installed['wpfavorite'] = array(
169
+ 'title' => __( 'WP Favorite Posts', 'mycred' ),
170
+ 'description' => __( 'Awards %_plural% for users adding posts to their favorites.', 'mycred' ),
171
+ 'callback' => array( 'myCRED_Hook_WPFavorite' )
172
+ );
173
+ }
174
+
175
+ // Events Manager
176
+ if ( function_exists( 'bp_em_init' ) ) {
177
+ $installed['eventsmanager'] = array(
178
+ 'title' => __( 'Events Manager', 'mycred' ),
179
+ 'description' => __( 'Awards %_plural% for users attending events.', 'mycred' ),
180
+ 'callback' => array( 'myCRED_Hook_Events_Manager' )
181
+ );
182
+ }
183
+
184
  $installed = apply_filters( 'mycred_setup_hooks', $installed );
185
 
186
  if ( $save === true && $this->core->can_edit_plugin() ) {
215
 
216
  <div class="wrap" id="myCRED-wrap">
217
  <div id="icon-myCRED" class="icon32"><br /></div>
218
+ <h2><?php echo apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . __( 'Hooks', 'mycred' ); ?></h2>
219
  <p><?php echo $this->core->template_tags_general( __( 'Hooks are instances where %_plural% are awarded or deducted from a user, depending on their actions around your website.', 'mycred' ) ); ?></p>
220
  <form method="post" action="options.php">
221
  <?php settings_fields( 'myCRED-hooks' ); ?>
245
 
246
  </form>
247
  </div>
248
+ <?php unset( $installed );
 
249
  unset( $this );
250
  }
251
 
344
  <span class="description"><?php _e( 'Available template tags: General, User', 'mycred' ); ?></span>
345
  </li>
346
  </ol>
347
+ <?php unset( $this );
 
348
  }
349
  }
350
  }
387
  * @version 1.1
388
  */
389
  public function logging_in( $user_login, $user ) {
390
+ // Check for exclusion
391
  if ( $this->core->exclude_user( $user->ID ) === true ) return;
392
 
393
+ // Check if we should reward
394
  if ( !$this->reward_login( $user->ID ) ) return;
395
 
396
  // Execute
448
  }
449
  }
450
  }
451
+
452
  // Update new login time
453
  if ( $this->prefs['limit'] == 'daily' )
454
  update_user_meta( $user_id, 'mycred_last_login', $today );
486
 
487
  </li>
488
  </ol>
489
+ <?php unset( $this );
 
490
  }
491
  }
492
  }
608
  foreach ( $post_types as $post_type ) {
609
  // Start by checking if this post type should be excluded
610
  if ( !$this->include_post_type( $post_type->name ) ) continue;
611
+
612
  // Points to award/deduct
613
  if ( isset( $prefs[$post_type->name]['creds'] ) )
614
  $_creds = $prefs[$post_type->name]['creds'];
646
  */
647
  protected function include_post_type( $post_type ) {
648
  if ( in_array( $post_type, apply_filters( 'mycred_post_type_excludes', array( 'post', 'page' ) ) ) ) return false;
 
649
  return true;
650
  }
651
  }
700
  add_action( 'comment_approved_to_spam', array( $this, 'spam_comments' ) );
701
  add_action( 'comment_unapproved_to_spam', array( $this, 'spam_comments' ) );
702
  }
703
+
704
  if ( $this->prefs['trash'] != 0 ) {
705
  add_action( 'comment_approved_to_unapproved', array( $this, 'trash_comments' ) );
706
  add_action( 'comment_approved_to_trash', array( $this, 'trash_comments' ) );
882
  }
883
  }
884
  /**
885
+ * Hooks for Clicking on Links
886
+ * @since 1.1
887
  * @version 1.0
888
  */
889
+ if ( !class_exists( 'myCRED_Hook_Click_Links' ) ) {
890
+ class myCRED_Hook_Click_Links extends myCRED_Hook {
891
 
892
  /**
893
  * Construct
894
  */
895
  function __construct( $hook_prefs ) {
896
  parent::__construct( array(
897
+ 'id' => 'link_click',
898
  'defaults' => array(
899
+ 'limit_by' => 'none',
900
+ 'creds' => 1,
901
+ 'log' => '%plural% for clicking on link to: %url%'
 
 
 
 
 
 
 
902
  )
903
  ), $hook_prefs );
904
  }
905
 
906
  /**
907
  * Run
908
+ * @since 1.1
909
  * @version 1.0
910
  */
911
  public function run() {
912
+ add_action( 'mycred_front_enqueue', array( $this, 'register_script' ) );
913
+ add_action( 'wp_footer', array( $this, 'footer' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
914
 
915
+ add_shortcode( 'mycred_link', 'mycred_render_shortcode_link' );
916
+ add_action( 'wp_ajax_mycred-click-points', array( $this, 'ajax_call_link_points' ) );
 
 
 
 
 
917
 
918
+ add_filter( 'mycred_parse_tags_link', array( $this, 'parse_custom_tags' ), 10, 2 );
 
 
 
 
 
 
 
919
  }
920
 
921
  /**
922
+ * Customize Limit Options
923
+ * @since 1.1
924
  * @version 1.0
925
  */
926
+ public function custom_limit() {
927
+ return array(
928
+ 'none' => __( 'No limit', 'mycred' ),
929
+ 'url' => __( 'Once for each unique URL', 'mycred' ),
930
+ 'id' => __( 'Once for each unique link id', 'mycred' )
931
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
932
  }
933
 
934
  /**
935
+ * Parse Custom Tags in Log
936
+ * @since 1.1
937
  * @version 1.0
938
  */
939
+ public function parse_custom_tags( $content, $log_entry ) {
940
+ $data = unserialize( $log_entry->data );
941
+ $content = str_replace( '%url%', $data['link_url'], $content );
942
+ $content = str_replace( '%id%', $data['link_id'], $content );
943
 
944
+ return $content;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
945
  }
946
 
947
  /**
948
+ * Register Script
949
+ * @since 1.1
 
 
950
  * @version 1.0
951
  */
952
+ public function register_script() {
953
+ wp_register_script(
954
+ 'mycred-link-points',
955
+ plugins_url( 'assets/js/links.js', myCRED_THIS ),
956
+ array( 'jquery' ),
957
+ myCRED_VERSION . '.1',
958
+ true
959
+ );
960
 
961
+ global $mycred_link_points;
962
+ if ( $mycred_link_points === true ) {
963
+ wp_enqueue_script( 'mycred-link-points' );
 
 
964
  }
 
 
 
965
  }
966
+
967
  /**
968
+ * WP Fotter
969
+ * @since 1.1
970
  * @version 1.0
971
  */
972
+ public function footer() {
973
+ global $mycred_link_points;
974
+ if ( $mycred_link_points === true ) {
975
+ wp_localize_script(
976
+ 'mycred-link-points',
977
+ 'myCREDgive',
978
+ array(
979
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
980
+ 'token' => wp_create_nonce( 'mycred-link-points' )
981
+ )
 
 
 
982
  );
983
+ wp_enqueue_script( 'mycred-link-points' );
984
  }
 
 
 
985
  }
986
 
987
  /**
988
+ * Custom Has Entry Check
989
+ * @since 1.1
990
  * @version 1.0
991
  */
992
+ public function has_entry( $action = '', $reference = '' ) {
993
+ global $wpdb;
 
994
 
995
+ if ( $this->prefs['limit_by'] == 'url' ) {
996
+ $string = '%s:8:"link_url";s:' . strlen( $reference ) . ':"' . $reference . '";%';
 
 
997
  }
998
+ elseif ( $this->prefs['limit_by'] == 'id' ) {
999
+ $string = '%s:7:"link_id";s:' . strlen( $reference ) . ':"' . $reference . '";%';
 
 
 
 
 
 
 
1000
  }
1001
+ else return false;
1002
 
1003
+ $sql = "SELECT id FROM " . $wpdb->prefix . 'myCRED_log' . " WHERE ref = %s AND data LIKE %s";
1004
+ $wpdb->get_results( $wpdb->prepare( $sql, $action, $string ) );
1005
+ if ( $wpdb->num_rows > 0 ) return true;
 
 
1006
 
1007
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1008
  }
 
 
 
 
 
 
 
 
 
1009
 
1010
  /**
1011
+ * AJAX Call Handler
1012
+ * @since 1.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1013
  * @version 1.0
1014
  */
1015
+ public function ajax_call_link_points() {
1016
+ // We must be logged in
1017
+ if ( !is_user_logged_in() ) die();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1018
 
1019
+ // Security
1020
+ check_ajax_referer( 'mycred-link-points', 'token' );
 
 
 
 
 
 
 
 
 
1021
 
1022
+ // Check if user should be excluded
1023
+ if ( $this->core->exclude_user( get_current_user_id() ) === true ) return;
 
 
 
1024
 
1025
+ // If amount is not set we default
1026
+ if ( $_POST['amount'] == 0 )
1027
+ $amount = $this->prefs['creds'];
1028
  else
1029
+ $amount = $this->core->format_number( $_POST['amount'] );
1030
 
1031
+ // Limits
1032
+ if ( $this->prefs['limit_by'] == 'url' ) {
1033
+ if ( !isset( $_POST['url'] ) || empty( $_POST['url'] ) ) die();
1034
+ if ( $this->has_entry( 'link_click', $_POST['url'] ) ) die();
1035
+ $ref = $_POST['url'];
1036
+ }
1037
+ elseif ( $this->prefs['limit_by'] == 'id' ) {
1038
+ if ( !isset( $_POST['eid'] ) || empty( $_POST['eid'] ) ) die();
1039
+ if ( $this->has_entry( 'link_click', $_POST['eid'] ) ) die();
1040
+ $ref = $_POST['eid'];
1041
+ }
1042
+ else {
1043
+ $ref = '';
1044
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1045
 
1046
  // Execute
 
1047
  $this->core->add_creds(
1048
+ 'link_click',
1049
+ get_current_user_id(),
1050
+ $amount,
1051
+ $this->prefs['log'],
1052
+ $ref,
1053
+ array(
1054
+ 'ref_type' => 'link',
1055
+ 'link_url' => ( isset( $_POST['url'] ) ) ? $_POST['url'] : '',
1056
+ 'link_id' => ( isset( $_POST['eid'] ) ) ? $_POST['eid'] : ''
1057
+ )
1058
  );
 
 
 
 
 
 
 
 
 
 
 
 
1059
 
1060
+ // Report the good news
1061
+ die( json_encode( 'done' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1062
  }
1063
+
1064
  /**
1065
+ * Preference for Link Click Hook
1066
+ * @since 1.1
1067
  * @version 1.0
1068
  */
1069
  public function preferences() {
1070
+ $prefs = $this->prefs; ?>
1071
+
1072
+ <label class="subheader"><?php echo $this->core->plural(); ?></label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1073
  <ol>
1074
  <li>
1075
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( 'creds' ); ?>" id="<?php echo $this->field_id( 'creds' ); ?>" value="<?php echo $this->core->format_number( $prefs['creds'] ); ?>" size="8" /></div>
1076
+ <span class="description"><?php _e( 'The default amount to award for clicking on links. You can override this in the shortcode.', 'mycred' ); ?></span>
 
 
 
 
 
 
1077
  </li>
1078
+ </ol>
1079
+ <label class="subheader"><?php _e( 'Log Template', 'mycred' ); ?></label>
1080
+ <ol>
1081
  <li>
1082
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( 'log' ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" value="<?php echo $prefs['log']; ?>" class="long" /></div>
1083
+ <span class="description"><?php _e( 'Available template tags: General and custom tags: %url% or %id%.', 'mycred' ); ?></span>
1084
  </li>
1085
+ </ol>
1086
+ <label class="subheader"><?php _e( 'Limits', 'mycred' ); ?></label>
1087
+ <ol>
1088
  <li>
1089
+ <?php
1090
+ add_filter( 'mycred_hook_impose_limits', array( $this, 'custom_limit' ) );
1091
+ $this->impose_limits_dropdown( 'limit_by', false ); ?>
1092
+
1093
  </li>
1094
+ <li><strong><?php _e( 'Remember!', 'mycred' ); ?></strong> <?php echo $this->core->template_tags_general( __( 'If you select to limit by id and you do not include the id attribute in the shortcode, no %_plural% will be awarded!', 'mycred' ) ); ?></li>
1095
  </ol>
1096
+ <?php unset( $this );
 
1097
  }
1098
  }
1099
  }
modules/mycred-module-log.php CHANGED
@@ -313,7 +313,7 @@ if ( !class_exists( 'myCRED_Log' ) ) {
313
  else
314
  $search_for = '';
315
 
316
- echo __( '<strong>my</strong>CRED ', 'mycred' ) . $title . ' ' . $link . $search_for;
317
  }
318
 
319
  /**
@@ -560,7 +560,7 @@ if ( !class_exists( 'myCRED_Log' ) ) {
560
  // Add details that will no longer be available
561
  $user = get_userdata( $user_id );
562
  $new_data['ID'] = $user->ID;
563
- $new_data['login'] = $user->user_login;
564
  $new_data['display_name'] = $user->display_name;
565
  // Save
566
  $wpdb->update(
313
  else
314
  $search_for = '';
315
 
316
+ echo apply_filters( 'mycred_label', myCRED_NAME ) . ' ' . $title . ' ' . $link . $search_for;
317
  }
318
 
319
  /**
560
  // Add details that will no longer be available
561
  $user = get_userdata( $user_id );
562
  $new_data['ID'] = $user->ID;
563
+ $new_data['user_login'] = $user->user_login;
564
  $new_data['display_name'] = $user->display_name;
565
  // Save
566
  $wpdb->update(
modules/mycred-module-plugins.php ADDED
@@ -0,0 +1,974 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Third-Party Plugin Hooks
4
+ *
5
+ * @since 1.1
6
+ * @version 1.0
7
+ */
8
+ if ( !defined( 'myCRED_VERSION' ) ) exit;
9
+
10
+ /**
11
+ * Hooks for Invite Anyone Plugin
12
+ * @since 0.1
13
+ * @version 1.0
14
+ */
15
+ if ( !class_exists( 'myCRED_Invite_Anyone' ) && function_exists( 'invite_anyone_init' ) ) {
16
+ class myCRED_Invite_Anyone extends myCRED_Hook {
17
+
18
+ /**
19
+ * Construct
20
+ */
21
+ function __construct( $hook_prefs ) {
22
+ parent::__construct( array(
23
+ 'id' => 'invite_anyone',
24
+ 'defaults' => array(
25
+ 'send_invite' => array(
26
+ 'creds' => 1,
27
+ 'log' => '%plural% for sending an invitation',
28
+ 'limit' => 0
29
+ ),
30
+ 'accept_invite' => array(
31
+ 'creds' => 1,
32
+ 'log' => '%plural% for accepted invitation',
33
+ 'limit' => 0
34
+ )
35
+ )
36
+ ), $hook_prefs );
37
+ }
38
+
39
+ /**
40
+ * Run
41
+ * @since 0.1
42
+ * @version 1.0
43
+ */
44
+ public function run() {
45
+ if ( $this->prefs['send_invite']['creds'] != 0 ) {
46
+ add_action( 'sent_email_invite', array( $this, 'send_invite' ), 10, 3 );
47
+ }
48
+ if ( $this->prefs['accept_invite']['creds'] != 0 ) {
49
+ add_action( 'accepted_email_invite', array( $this, 'accept_invite' ), 10, 2 );
50
+ }
51
+ }
52
+
53
+ /**
54
+ * Sending Invites
55
+ * @since 0.1
56
+ * @version 1.0
57
+ */
58
+ public function send_invite( $user_id, $email, $group ) {
59
+ // Limit Check
60
+ if ( $this->prefs['send_invite']['limit'] != 0 ) {
61
+ $user_log = get_user_meta( $user_id, 'mycred_invite_anyone', true );
62
+ if ( empty( $user_log['sent'] ) ) $user_log['sent'] = 0;
63
+ // Return if limit is reached
64
+ if ( $user_log['sent'] >= $this->prefs['send_invite']['limit'] ) return;
65
+ }
66
+
67
+ // Award Points
68
+ $this->core->add_creds(
69
+ 'sending_an_invite',
70
+ $user_id,
71
+ $this->prefs['send_invite']['creds'],
72
+ $this->prefs['send_invite']['log']
73
+ );
74
+
75
+ // Update limit
76
+ if ( $this->prefs['send_invite']['limit'] != 0 ) {
77
+ $user_log['sent'] = $user_log['sent']+1;
78
+ update_user_meta( $user_id, 'mycred_invite_anyone', $user_log );
79
+ }
80
+
81
+ // Clean up
82
+ unset( $this );
83
+ }
84
+
85
+ /**
86
+ * Accepting Invites
87
+ * @since 0.1
88
+ * @version 1.0
89
+ */
90
+ public function accept_invite( $invited_user_id, $inviters ) {
91
+ // Invite Anyone will pass on an array of user IDs of those who have invited this user which we need to loop though
92
+ foreach ( $inviters as $inviter_id ) {
93
+ // Limit Check
94
+ if ( $this->prefs['accept_invite']['limit'] != 0 ) {
95
+ $user_log = get_user_meta( $inviter_id, 'mycred_invite_anyone', true );
96
+ if ( empty( $user_log['accepted'] ) ) $user_log['accepted'] = 0;
97
+ // Continue to next inviter if limit is reached
98
+ if ( $user_log['accepted'] >= $this->prefs['accept_invite']['limit'] ) continue;
99
+ }
100
+
101
+ // Award Points
102
+ $this->core->add_creds(
103
+ 'accepting_an_invite',
104
+ $inviter_id,
105
+ $this->prefs['accept_invite']['creds'],
106
+ $this->prefs['accept_invite']['log']
107
+ );
108
+
109
+ // Update Limit
110
+ if ( $this->prefs['accept_invite']['limit'] != 0 ) {
111
+ $user_log['accepted'] = $user_log['accepted']+1;
112
+ update_user_meta( $inviter_id, 'mycred_invite_anyone', $user_log );
113
+ }
114
+ }
115
+
116
+ // Clean up
117
+ unset( $this );
118
+ }
119
+
120
+ /**
121
+ * Preferences
122
+ * @since 0.1
123
+ * @version 1.0
124
+ */
125
+ public function preferences() {
126
+ $prefs = $this->prefs; ?>
127
+
128
+ <!-- Creds for Sending Invites -->
129
+ <label for="<?php echo $this->field_id( array( 'send_invite', 'creds' ) ); ?>" class="subheader"><?php echo $this->core->template_tags_general( __( '%plural% for Sending An Invite', 'mycred' ) ); ?></label>
130
+ <ol>
131
+ <li>
132
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'send_invite', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'send_invite', 'creds' ) ); ?>" value="<?php echo $this->core->format_number( $prefs['send_invite']['creds'] ); ?>" size="8" /></div>
133
+ </li>
134
+ <li class="empty">&nbsp;</li>
135
+ <li>
136
+ <label for="<?php echo $this->field_id( array( 'send_invite', 'log' ) ); ?>"><?php _e( 'Log template', 'mycred' ); ?></label>
137
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'send_invite', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'send_invite', 'log' ) ); ?>" value="<?php echo $prefs['send_invite']['log']; ?>" class="long" /></div>
138
+ <span class="description"><?php _e( 'Available template tags: General', 'mycred' ); ?></span>
139
+ </li>
140
+ </ol>
141
+ <label for="<?php echo $this->field_id( array( 'send_invite', 'limit' ) ); ?>" class="subheader"><?php _e( 'Limit', 'mycred' ); ?></label>
142
+ <ol>
143
+ <li>
144
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'send_invite', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'send_invite', 'limit' ) ); ?>" value="<?php echo $prefs['send_invite']['limit']; ?>" size="8" /></div>
145
+ <span class="description"><?php echo $this->core->template_tags_general( __( 'Maximum number of invites that grants %_plural%. User zero for unlimited.', 'mycred' ) ); ?></span>
146
+ </li>
147
+ </ol>
148
+ <!-- Creds for Accepting Invites -->
149
+ <label for="<?php echo $this->field_id( array( 'accept_invite', 'creds' ) ); ?>" class="subheader"><?php echo $this->core->template_tags_general( __( '%plural% for Accepting An Invite', 'mycred' ) ); ?></label>
150
+ <ol>
151
+ <li>
152
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'accept_invite', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'accept_invite', 'creds' ) ); ?>" value="<?php echo $this->core->format_number( $prefs['accept_invite']['creds'] ); ?>" size="8" /></div>
153
+ <span class="description"><?php echo $this->core->template_tags_general( __( '%plural% for each invited user that accepts an invitation.', 'mycred' ) ); ?></span>
154
+ </li>
155
+ <li class="empty">&nbsp;</li>
156
+ <li>
157
+ <label for="<?php echo $this->field_id( array( 'accept_invite', 'log' ) ); ?>"><?php _e( 'Log template', 'mycred' ); ?></label>
158
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'accept_invite', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'accept_invite', 'log' ) ); ?>" value="<?php echo $prefs['accept_invite']['log']; ?>" class="long" /></div>
159
+ <span class="description"><?php _e( 'Available template tags: General', 'mycred' ); ?></span>
160
+ </li>
161
+ </ol>
162
+ <label for="<?php echo $this->field_id( array( 'accept_invite', 'limit' ) ); ?>" class="subheader"><?php _e( 'Limit', 'mycred' ); ?></label>
163
+ <ol>
164
+ <li>
165
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'accept_invite', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'accept_invite', 'limit' ) ); ?>" value="<?php echo $prefs['accept_invite']['limit']; ?>" size="8" /></div>
166
+ <span class="description"><?php echo $this->core->template_tags_general( __( 'Maximum number of accepted invitations that grants %_plural%. User zero for unlimited.', 'mycred' ) ); ?></span>
167
+ </li>
168
+ </ol>
169
+ <?php unset( $this );
170
+ }
171
+ }
172
+ }
173
+
174
+ /**
175
+ * Hook for Contact Form 7 Plugin
176
+ * @since 0.1
177
+ * @version 1.0
178
+ */
179
+ if ( !class_exists( 'myCRED_Contact_Form7' ) && function_exists( 'wpcf7' ) ) {
180
+ class myCRED_Contact_Form7 extends myCRED_Hook {
181
+
182
+ /**
183
+ * Construct
184
+ */
185
+ function __construct( $hook_prefs ) {
186
+ parent::__construct( array(
187
+ 'id' => 'contact_form7',
188
+ 'defaults' => ''
189
+ ), $hook_prefs );
190
+ }
191
+
192
+ /**
193
+ * Run
194
+ * @since 0.1
195
+ * @version 1.0
196
+ */
197
+ public function run() {
198
+ add_action( 'wpcf7_mail_sent', array( $this, 'form_submission' ) );
199
+ }
200
+
201
+ /**
202
+ * Get Forms
203
+ * Queries all Contact Form 7 forms.
204
+ * @uses WP_Query()
205
+ * @since 0.1
206
+ * @version 1.0
207
+ */
208
+ public function get_forms() {
209
+ $forms = new WP_Query( array(
210
+ 'post_type' => 'wpcf7_contact_form',
211
+ 'post_status' => 'any',
212
+ 'posts_per_page' => '-1',
213
+ 'orderby' => 'ID',
214
+ 'order' => 'ASC'
215
+ ) );
216
+
217
+ $result = array();
218
+ if ( $forms->have_posts() ) {
219
+ while ( $forms->have_posts() ) : $forms->the_post();
220
+ $result[get_the_ID()] = get_the_title();
221
+ endwhile;
222
+ }
223
+ wp_reset_postdata();
224
+
225
+ return $result;
226
+ }
227
+
228
+ /**
229
+ * Successful Form Submission
230
+ * @since 0.1
231
+ * @version 1.0
232
+ */
233
+ public function form_submission( $cf7_form ) {
234
+ // Login is required
235
+ if ( !is_user_logged_in() ) return;
236
+
237
+ $form_id = $cf7_form->id;
238
+ if ( isset( $this->prefs[$form_id] ) && $this->prefs[$form_id]['creds'] != 0 ) {
239
+ $this->core->add_creds(
240
+ 'contact_form_submission',
241
+ get_current_user_id(),
242
+ $this->prefs[$form_id]['creds'],
243
+ $this->prefs[$form_id]['log'],
244
+ $form_id,
245
+ array( 'ref_type' => 'post' )
246
+ );
247
+ }
248
+
249
+ // Clean up
250
+ unset( $this );
251
+ }
252
+
253
+ /**
254
+ * Preferences for Commenting Hook
255
+ * @since 0.1
256
+ * @version 1.0
257
+ */
258
+ public function preferences() {
259
+ $prefs = $this->prefs;
260
+ $forms = $this->get_forms();
261
+
262
+ // No forms found
263
+ if ( empty( $forms ) ) {
264
+ echo '<p>' . __( 'No forms found.', 'mycred' ) . '</p>';
265
+ return;
266
+ }
267
+
268
+ // Loop though prefs to make sure we always have a default settings (happens when a new form has been created)
269
+ foreach ( $forms as $form_id => $form_title ) {
270
+ if ( !isset( $prefs[$form_id] ) ) {
271
+ $prefs[$form_id] = array(
272
+ 'creds' => 1,
273
+ 'log' => ''
274
+ );
275
+ }
276
+ }
277
+
278
+ // Set pref if empty
279
+ if ( empty( $prefs ) ) $this->prefs = $prefs;
280
+
281
+ // Loop for settings
282
+ foreach ( $forms as $form_id => $form_title ) { ?>
283
+
284
+ <!-- Creds for -->
285
+ <label for="<?php echo $this->field_id( array( $form_id, 'creds' ) ); ?>" class="subheader"><?php echo $form_title; ?></label>
286
+ <ol>
287
+ <li>
288
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( $form_id, 'creds' ) ); ?>" id="<?php echo $this->field_id( array( $form_id, 'creds' ) ); ?>" value="<?php echo $this->core->format_number( $prefs[$form_id]['creds'] ); ?>" size="8" /></div>
289
+ </li>
290
+ <li class="empty">&nbsp;</li>
291
+ <li>
292
+ <label for="<?php echo $this->field_id( array( $form_id, 'log' ) ); ?>"><?php _e( 'Log template', 'mycred' ); ?></label>
293
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( $form_id, 'log' ) ); ?>" id="<?php echo $this->field_id( array( $form_id, 'log' ) ); ?>" value="<?php echo $prefs[$form_id]['log']; ?>" class="long" /></div>
294
+ <span class="description"><?php _e( 'Available template tags: General, Post', 'mycred' ); ?></span>
295
+ </li>
296
+ </ol>
297
+ <?php }
298
+ unset( $this );
299
+ }
300
+ }
301
+ }
302
+
303
+ /**
304
+ * Hook for BadgeOS Plugin
305
+ * @since 1.0.8
306
+ * @version 1.0
307
+ */
308
+ if ( !class_exists( 'myCRED_Hook_BadgeOS' ) && class_exists( 'BadgeOS' ) ) {
309
+ class myCRED_Hook_BadgeOS extends myCRED_Hook {
310
+
311
+ /**
312
+ * Construct
313
+ */
314
+ function __construct( $hook_prefs ) {
315
+ parent::__construct( array(
316
+ 'id' => 'badgeos',
317
+ 'defaults' => ''
318
+ ), $hook_prefs );
319
+ }
320
+
321
+ /**
322
+ * Run
323
+ * @since 1.0.8
324
+ * @version 1.0
325
+ */
326
+ public function run() {
327
+ add_action( 'add_meta_boxes', array( $this, 'add_metaboxes' ) );
328
+ add_action( 'save_post', array( $this, 'save_achivement_data' ) );
329
+
330
+ add_action( 'badgeos_award_achievement', array( $this, 'award_achievent' ), 10, 2 );
331
+ add_action( 'badgeos_revoke_achievement', array( $this, 'revoke_achievement' ), 10, 2 );
332
+ }
333
+
334
+ /**
335
+ * Add Metaboxes
336
+ * @since 1.0.8
337
+ * @version 1.0
338
+ */
339
+ public function add_metaboxes() {
340
+ // Get all Achievement Types
341
+ $badge_post_types = badgeos_get_achievement_types_slugs();
342
+ foreach ( $badge_post_types as $post_type ) {
343
+ // Add Meta Box
344
+ add_meta_box(
345
+ 'mycred_badgeos_' . $post_type,
346
+ __( 'myCRED', 'mycred' ),
347
+ array( $this, 'render_meta_box' ),
348
+ $post_type,
349
+ 'side',
350
+ 'core'
351
+ );
352
+ }
353
+ }
354
+
355
+ /**
356
+ * Render Meta Box
357
+ * @since 1.0.8
358
+ * @version 1.0
359
+ */
360
+ public function render_meta_box( $post ) {
361
+ // Setup is needed
362
+ if ( !isset( $this->prefs[$post->post_type] ) ) {
363
+ $message = sprintf( __( 'Please setup your <a href="%s">default settings</a> before using this feature.', 'mycred' ), admin_url( 'admin.php?page=myCRED_page_hooks' ) );
364
+ echo '<p>' . $message . '</p>';
365
+ }
366
+
367
+ // Prep Achievement Data
368
+ $prefs = $this->prefs;
369
+ $mycred = mycred_get_settings();
370
+ $achievement_data = get_post_meta( $post->ID, '_mycred_values', true );
371
+ if ( empty( $achievement_data ) )
372
+ $achievement_data = $prefs[$post->post_type]; ?>
373
+
374
+ <p><strong><?php echo $mycred->template_tags_general( __( '%plural% to Award', 'mycred' ) ); ?></strong></p>
375
+ <p>
376
+ <label class="screen-reader-text" for="mycred-values-creds"><?php echo $mycred->template_tags_general( __( '%plural% to Award', 'mycred' ) ); ?></label>
377
+ <input type="text" name="mycred_values[creds]" id="mycred-values-creds" value="<?php echo $achievement_data['creds']; ?>" size="8" />
378
+ <span class="description"><?php _e( 'Use zero to disable', 'mycred' ); ?></span>
379
+ </p>
380
+ <p><strong><?php _e( 'Log Template', 'mycred' ); ?></strong></p>
381
+ <p>
382
+ <label class="screen-reader-text" for="mycred-values-log"><?php _e( 'Log Template', 'mycred' ); ?></label>
383
+ <input type="text" name="mycred_values[log]" id="mycred-values-log" value="<?php echo $achievement_data['log']; ?>" style="width:99%;" />
384
+ </p>
385
+ <?php
386
+ // If deduction is enabled
387
+ if ( $this->prefs[$post->post_type]['deduct'] == 1 ) { ?>
388
+
389
+ <p><strong><?php _e( 'Deduction Log Template', 'mycred' ); ?></strong></p>
390
+ <p>
391
+ <label class="screen-reader-text" for="mycred-values-log"><?php _e( 'Log Template', 'mycred' ); ?></label>
392
+ <input type="text" name="mycred_values[deduct_log]" id="mycred-values-deduct-log" value="<?php echo $achievement_data['deduct_log']; ?>" style="width:99%;" />
393
+ </p>
394
+ <?php
395
+ }
396
+ }
397
+
398
+ /**
399
+ * Save Achievement Data
400
+ * @since 1.0.8
401
+ * @version 1.1
402
+ */
403
+ public function save_achivement_data( $post_id ) {
404
+ // Post Type
405
+ $post_type = get_post_type( $post_id );
406
+
407
+ // Make sure this is a BadgeOS Object
408
+ if ( !in_array( $post_type, badgeos_get_achievement_types_slugs() ) ) return;
409
+
410
+ // Make sure preference is set
411
+ if ( !isset( $this->prefs[$post_type] ) || !isset( $_POST['mycred_values']['creds'] ) || !isset( $_POST['mycred_values']['log'] ) ) return;
412
+
413
+ // Only save if the settings differ, otherwise we default
414
+ if ( $_POST['mycred_values']['creds'] == $this->prefs[$post_type]['creds'] &&
415
+ $_POST['mycred_values']['log'] == $this->prefs[$post_type]['log'] ) return;
416
+
417
+ $data = array();
418
+
419
+ // Creds
420
+ if ( !empty( $_POST['mycred_values']['creds'] ) && $_POST['mycred_values']['creds'] != $this->prefs[$post_type]['creds'] )
421
+ $data['creds'] = $this->core->format_number( $_POST['mycred_values']['creds'] );
422
+ else
423
+ $data['creds'] = $this->core->format_number( $this->prefs[$post_type]['creds'] );
424
+
425
+ // Log template
426
+ if ( !empty( $_POST['mycred_values']['log'] ) && $_POST['mycred_values']['log'] != $this->prefs[$post_type]['log'] )
427
+ $data['log'] = strip_tags( $_POST['mycred_values']['log'] );
428
+ else
429
+ $data['log'] = strip_tags( $this->prefs[$post_type]['log'] );
430
+
431
+ // If deduction is enabled save log template
432
+ if ( $this->prefs[$post_type]['deduct'] == 1 ) {
433
+ if ( !empty( $_POST['mycred_values']['deduct_log'] ) && $_POST['mycred_values']['deduct_log'] != $this->prefs[$post_type]['deduct_log'] )
434
+ $data['deduct_log'] = strip_tags( $_POST['mycred_values']['deduct_log'] );
435
+ else
436
+ $data['deduct_log'] = strip_tags( $this->prefs[$post_type]['deduct_log'] );
437
+ }
438
+
439
+ // Update sales values
440
+ update_post_meta( $post_id, '_mycred_values', $data );
441
+ }
442
+
443
+ /**
444
+ * Award Achievement
445
+ * Run by BadgeOS when ever needed, we make sure settings are not zero otherwise
446
+ * award points whenever this hook fires.
447
+ * @since 1.0.8
448
+ * @version 1.0
449
+ */
450
+ public function award_achievent( $user_id, $achievement_id ) {
451
+ $post_type = get_post_type( $achievement_id );
452
+ // Settings are not set
453
+ if ( !isset( $this->prefs[$post_type]['creds'] ) ) return;
454
+
455
+ // Get achievemen data
456
+ $achievement_data = get_post_meta( $achievement_id, '_mycred_values', true );
457
+ if ( empty( $achievement_data ) )
458
+ $achievement_data = $this->prefs[$post_type];
459
+
460
+ // Make sure its not disabled
461
+ if ( $achievement_data['creds'] == 0 ) return;
462
+
463
+ // Execute
464
+ $post_type_object = get_post_type_object( $post_type );
465
+ $this->core->add_creds(
466
+ $post_type_object->labels->name,
467
+ $user_id,
468
+ $achievement_data['creds'],
469
+ $achievement_data['log'],
470
+ $achievement_id,
471
+ array( 'ref_type' => 'post' )
472
+ );
473
+ }
474
+
475
+ /**
476
+ * Revoke Achievement
477
+ * Run by BadgeOS when a users achievement is revoed.
478
+ * @since 1.0.8
479
+ * @version 1.1
480
+ */
481
+ public function revoke_achievement( $user_id, $achievement_id ) {
482
+ $post_type = get_post_type( $achievement_id );
483
+ // Settings are not set
484
+ if ( !isset( $this->prefs[$post_type]['creds'] ) ) return;
485
+
486
+ // Get achievemen data
487
+ $achievement_data = get_post_meta( $achievement_id, '_mycred_values', true );
488
+ if ( empty( $achievement_data ) )
489
+ $achievement_data = $this->prefs[$post_type];
490
+
491
+ // Make sure its not disabled
492
+ if ( $achievement_data['creds'] == 0 ) return;
493
+
494
+ // Execute
495
+ $post_type_object = get_post_type_object( $post_type );
496
+ $this->core->add_creds(
497
+ $post_type_object->labels->name,
498
+ $user_id,
499
+ 0-$achievement_data['creds'],
500
+ $achievement_data['deduct_log'],
501
+ $achievement_id,
502
+ array( 'ref_type' => 'post' )
503
+ );
504
+ }
505
+
506
+ /**
507
+ * Preferences for BadgeOS
508
+ * @since 1.0.8
509
+ * @version 1.0
510
+ */
511
+ public function preferences() {
512
+ $prefs = $this->prefs;
513
+ $badge_post_types = badgeos_get_achievement_types_slugs();
514
+ foreach ( $badge_post_types as $post_type ) {
515
+ if ( in_array( $post_type, apply_filters( 'mycred_badgeos_excludes', array( 'step' ) ) ) ) continue;
516
+ if ( !isset( $prefs[$post_type] ) )
517
+ $prefs[$post_type] = array(
518
+ 'creds' => 10,
519
+ 'log' => '',
520
+ 'deduct' => 1,
521
+ 'deduct_log' => '%plural% deduction'
522
+ );
523
+
524
+ $post_type_object = get_post_type_object( $post_type );
525
+ $title = sprintf( __( 'Default %s for %s', 'mycred' ), $this->core->plural(), $post_type_object->labels->singular_name ); ?>
526
+
527
+ <!-- Creds for -->
528
+ <label for="<?php echo $this->field_id( array( $post_type, 'creds' ) ); ?>" class="subheader"><?php echo $title; ?></label>
529
+ <ol>
530
+ <li>
531
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( $post_type, 'creds' ) ); ?>" id="<?php echo $this->field_id( array( $post_type, 'creds' ) ); ?>" value="<?php echo $this->core->format_number( $prefs[$post_type]['creds'] ); ?>" size="8" /></div>
532
+ <span class="description"><?php echo $this->core->template_tags_general( __( 'User zero to disable users gaining %_plural%', 'mycred' ) ); ?></span>
533
+ </li>
534
+ <li class="empty">&nbsp;</li>
535
+ <li>
536
+ <label for="<?php echo $this->field_id( array( $post_type, 'log' ) ); ?>"><?php _e( 'Default Log template', 'mycred' ); ?></label>
537
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( $post_type, 'log' ) ); ?>" id="<?php echo $this->field_id( array( $form_id, 'log' ) ); ?>" value="<?php echo $prefs[$post_type]['log']; ?>" class="long" /></div>
538
+ <span class="description"><?php _e( 'Available template tags: General, Post', 'mycred' ); ?></span>
539
+ </li>
540
+ <li>
541
+ <input type="checkbox" name="<?php echo $this->field_name( array( $post_type, 'deduct' ) ); ?>" id="<?php echo $this->field_id( array( $post_type, 'deduct' ) ); ?>" <?php checked( $prefs[$post_type]['deduct'], 1 ); ?> value="1" />
542
+ <label for="<?php echo $this->field_id( array( $post_type, 'deduct' ) ); ?>"><?php echo $this->core->template_tags_general( __( 'Deduct %_plural% if user looses ' . $post_type_object->labels->singular_name, 'mycred' ) ); ?></label>
543
+ </li>
544
+ <li class="empty">&nbsp;</li>
545
+ <li>
546
+ <label for="<?php echo $this->field_id( array( $post_type, 'deduct_log' ) ); ?>"><?php _e( 'Log template', 'mycred' ); ?></label>
547
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( $post_type, 'deduct_log' ) ); ?>" id="<?php echo $this->field_id( array( $form_id, 'deduct_log' ) ); ?>" value="<?php echo $prefs[$post_type]['deduct_log']; ?>" class="long" /></div>
548
+ <span class="description"><?php _e( 'Available template tags: General, Post', 'mycred' ); ?></span>
549
+ </li>
550
+ </ol>
551
+ <?php
552
+ }
553
+ }
554
+ }
555
+ }
556
+
557
+ /**
558
+ * Hook for WP-Polls Plugin
559
+ * @since 1.1
560
+ * @version 1.0
561
+ */
562
+ if ( !class_exists( 'myCRED_Hook_WPPolls' ) && function_exists( 'vote_poll' ) ) {
563
+ class myCRED_Hook_WPPolls extends myCRED_Hook {
564
+
565
+ /**
566
+ * Construct
567
+ */
568
+ function __construct( $hook_prefs ) {
569
+ parent::__construct( array(
570
+ 'id' => 'wppolls',
571
+ 'defaults' => array(
572
+ 'creds' => 1,
573
+ 'log' => '%plural% for voting'
574
+ )
575
+ ), $hook_prefs );
576
+ }
577
+
578
+ /**
579
+ * Run
580
+ * @since 1.1
581
+ * @version 1.0
582
+ */
583
+ public function run() {
584
+ add_action( 'wp_ajax_polls', array( $this, 'vote_poll' ), 1 );
585
+ add_filter( 'mycred_parse_tags_poll', array( $this, 'parse_custom_tags' ), 10, 2 );
586
+ }
587
+
588
+ /**
589
+ * Poll Voting
590
+ * @since 1.1
591
+ * @version 1.0
592
+ */
593
+ public function vote_poll() {
594
+ if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'polls' && is_user_logged_in() ) {
595
+ // Get Poll ID
596
+ $poll_id = ( isset( $_REQUEST['poll_id'] ) ? intval( $_REQUEST['poll_id'] ) : 0 );
597
+
598
+ // Ensure Poll ID Is Valid
599
+ if ( $poll_id != 0 ) {
600
+ // Verify Referer
601
+ if ( check_ajax_referer( 'poll_' . $poll_id . '-nonce', 'poll_' . $poll_id . '_nonce', false ) ) {
602
+ // Which View
603
+ switch ( $_REQUEST['view'] ) {
604
+ case 'process':
605
+ $poll_aid = $_POST["poll_$poll_id"];
606
+ $poll_aid_array = array_unique( array_map( 'intval', explode( ',', $poll_aid ) ) );
607
+ if ( $poll_id > 0 && !empty( $poll_aid_array ) && check_allowtovote() ) {
608
+ $check_voted = check_voted( $poll_id );
609
+ if ( $check_voted == 0 ) {
610
+ $user_id = get_current_user_id();
611
+ // Make sure we are not excluded
612
+ if ( !$this->core->exclude_user( $user_id ) ) {
613
+ $this->core->add_creds(
614
+ 'poll_voting',
615
+ $user_id,
616
+ $this->prefs['creds'],
617
+ $this->prefs['log'],
618
+ $poll_id,
619
+ array( 'ref_type' => 'poll' )
620
+ );
621
+ }
622
+ }
623
+ }
624
+ break;
625
+ }
626
+ }
627
+ }
628
+ }
629
+ }
630
+
631
+ /**
632
+ * Parse Custom Tags in Log
633
+ * @since 1.1
634
+ * @version 1.0
635
+ */
636
+ public function parse_custom_tags( $content, $log_entry ) {
637
+ $poll_id = $log_entry->ref_id;
638
+ $content = str_replace( '%poll_id%', $poll_id, $content );
639
+ $content = str_replace( '%poll_question%', $this->get_poll_name( $poll_id ), $content );
640
+
641
+ return $content;
642
+ }
643
+
644
+ /**
645
+ * Get Poll Name (Question)
646
+ * @since 1.1
647
+ * @version 1.0
648
+ */
649
+ protected function get_poll_name( $poll_id ) {
650
+ global $wpdb;
651
+
652
+ $sql = "SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = %d ";
653
+ return $wpdb->get_var( $wpdb->prepare( $sql, $poll_id ) );
654
+ }
655
+
656
+ /**
657
+ * Preferences for WP-Polls
658
+ * @since 1.1
659
+ * @version 1.0
660
+ */
661
+ public function preferences() {
662
+ $prefs = $this->prefs; ?>
663
+
664
+ <label class="subheader"><?php echo $this->core->plural(); ?></label>
665
+ <ol>
666
+ <li>
667
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( 'creds' ); ?>" id="<?php echo $this->field_id( 'creds' ); ?>" value="<?php echo $this->core->format_number( $prefs['creds'] ); ?>" size="8" /></div>
668
+ </li>
669
+ </ol>
670
+ <label class="subheader"><?php _e( 'Log Template', 'mycred' ); ?></label>
671
+ <ol>
672
+ <li>
673
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( 'log' ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" value="<?php echo $prefs['log']; ?>" class="long" /></div>
674
+ <span class="description"><?php _e( 'Available template tags: General. You can also use %poll_id% and %poll_question%.', 'mycred' ); ?></span>
675
+ </li>
676
+ </ol>
677
+ <?php unset( $this );
678
+ }
679
+ }
680
+ }
681
+
682
+ /**
683
+ * Hook for WP Favorite Posts
684
+ * @since 1.1
685
+ * @version 1.0
686
+ */
687
+ if ( !class_exists( 'myCRED_Hook_WPFavorite' ) && function_exists( 'wp_favorite_posts' ) ) {
688
+ class myCRED_Hook_WPFavorite extends myCRED_Hook {
689
+
690
+ /**
691
+ * Construct
692
+ */
693
+ function __construct( $hook_prefs ) {
694
+ parent::__construct( array(
695
+ 'id' => 'wpfavorite',
696
+ 'defaults' => array(
697
+ 'add' => array(
698
+ 'creds' => 1,
699
+ 'log' => '%plural% for adding a post as favorite'
700
+ ),
701
+ 'remove' => array(
702
+ 'creds' => 1,
703
+ 'log' => '%plural% deduction for removing a post from favorites'
704
+ )
705
+ )
706
+ ), $hook_prefs );
707
+ }
708
+
709
+ /**
710
+ * Run
711
+ * @since 1.1
712
+ * @version 1.0
713
+ */
714
+ public function run() {
715
+ if ( $this->prefs['add']['creds'] != 0 )
716
+ add_action( 'wpfp_after_add', array( $this, 'add_favorite' ) );
717
+
718
+ if ( $this->prefs['remove']['creds'] != 0 )
719
+ add_action( 'wpfp_after_remove', array( $this, 'remove_favorite' ) );
720
+ }
721
+
722
+ /**
723
+ * Add Favorite
724
+ * @since 1.1
725
+ * @version 1.0
726
+ */
727
+ public function add_favorite( $post_id ) {
728
+ // Must be logged in
729
+ if ( !is_user_logged_in() ) return;
730
+
731
+ $user_id = get_current_user_id();
732
+ // Check for exclusion
733
+ if ( $this->core->exclude_user( $user_id ) ) return;
734
+
735
+ // Make sure this is unique event
736
+ if ( $this->has_entry( 'add_favorite_post', $post_id, $user_id ) ) return;
737
+
738
+ // Execute
739
+ $this->core->add_creds(
740
+ 'add_favorite_post',
741
+ $user_id,
742
+ $this->prefs['add']['creds'],
743
+ $this->prefs['add']['log'],
744
+ $post_id,
745
+ array( 'ref_type' => 'post' )
746
+ );
747
+ }
748
+
749
+ /**
750
+ * Remove Favorite
751
+ * @since 1.1
752
+ * @version 1.0
753
+ */
754
+ public function remove_favorite( $post_id ) {
755
+ // Must be logged in
756
+ if ( !is_user_logged_in() ) return;
757
+
758
+ $user_id = get_current_user_id();
759
+ // Check for exclusion
760
+ if ( $this->core->exclude_user( $user_id ) ) return;
761
+
762
+ // Make sure this is unique event
763
+ if ( $this->has_entry( 'favorite_post_removed', $post_id, $user_id ) ) return;
764
+
765
+ // Execute
766
+ $this->core->add_creds(
767
+ 'favorite_post_removed',
768
+ $user_id,
769
+ $this->prefs['remove']['creds'],
770
+ $this->prefs['remove']['log'],
771
+ $post_id,
772
+ array( 'ref_type' => 'post' )
773
+ );
774
+ }
775
+
776
+ /**
777
+ * Preferences for WP-Polls
778
+ * @since 1.1
779
+ * @version 1.0
780
+ */
781
+ public function preferences() {
782
+ $prefs = $this->prefs; ?>
783
+
784
+ <label class="subheader" for="<?php echo $this->field_id( array( 'add' => 'creds' ) ); ?>"><?php _e( 'Adding Content to Favorites', 'mycred' ); ?></label>
785
+ <ol>
786
+ <li>
787
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'add' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'add' => 'creds' ) ); ?>" value="<?php echo $this->core->format_number( $prefs['add']['creds'] ); ?>" size="8" /></div>
788
+ </li>
789
+ </ol>
790
+ <label class="subheader" for="<?php echo $this->field_id( array( 'add' => 'log' ) ); ?>"><?php _e( 'Log Template', 'mycred' ); ?></label>
791
+ <ol>
792
+ <li>
793
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'add' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'add' => 'log' ) ); ?>" value="<?php echo $prefs['add']['log']; ?>" class="long" /></div>
794
+ <span class="description"><?php _e( 'Available template tags: General and Post Related', 'mycred' ); ?></span>
795
+ </li>
796
+ </ol>
797
+ <label class="subheader" for="<?php echo $this->field_id( array( 'remove' => 'creds' ) ); ?>"><?php _e( 'Removing Content from Favorites', 'mycred' ); ?></label>
798
+ <ol>
799
+ <li>
800
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'remove' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'remove' => 'creds' ) ); ?>" value="<?php echo $this->core->format_number( $prefs['remove']['creds'] ); ?>" size="8" /></div>
801
+ </li>
802
+ </ol>
803
+ <label class="subheader" for="<?php echo $this->field_id( array( 'remove' => 'log' ) ); ?>"><?php _e( 'Log Template', 'mycred' ); ?></label>
804
+ <ol>
805
+ <li>
806
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'remove' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'remove' => 'log' ) ); ?>" value="<?php echo $prefs['remove']['log']; ?>" class="long" /></div>
807
+ <span class="description"><?php _e( 'Available template tags: General and Post Related', 'mycred' ); ?></span>
808
+ </li>
809
+ </ol>
810
+ <?php unset( $this );
811
+ }
812
+ }
813
+ }
814
+
815
+ /**
816
+ * Hook for Events Manager
817
+ * @since 1.1
818
+ * @version 1.0
819
+ */
820
+ if ( !class_exists( 'myCRED_Hook_Events_Manager' ) && function_exists( 'bp_em_init' ) ) {
821
+ class myCRED_Hook_Events_Manager extends myCRED_Hook {
822
+
823
+ /**
824
+ * Construct
825
+ */
826
+ function __construct( $hook_prefs ) {
827
+ parent::__construct( array(
828
+ 'id' => 'eventsmanager',
829
+ 'defaults' => array(
830
+ 'attend' => array(
831
+ 'creds' => 1,
832
+ 'log' => '%plural% for attending an %link_with_title%'
833
+ ),
834
+ 'cancel' => array(
835
+ 'creds' => 1,
836
+ 'log' => '%plural% for cancelled attendance at %link_with_title%'
837
+ )
838
+ )
839
+ ), $hook_prefs );
840
+ }
841
+
842
+ /**
843
+ * Run
844
+ * @since 1.1
845
+ * @version 1.0
846
+ */
847
+ public function run() {
848
+ if ( $this->prefs['attend']['creds'] != 0 && get_option( 'dbem_bookings_approval' ) != 0 )
849
+ add_filter( 'em_bookings_add', array( $this, 'new_booking' ), 10, 2 );
850
+
851
+ add_filter( 'em_booking_set_status', array( $this, 'adjust_booking' ), 10, 2 );
852
+ }
853
+
854
+ /**
855
+ * New Booking
856
+ * When users can make their own bookings.
857
+ * @since 1.1
858
+ * @version 1.0
859
+ */
860
+ public function new_booking( $result, $booking ) {
861
+ $user_id = $booking->person_id;
862
+ // Check for exclusion
863
+ if ( $this->core->exclude_user( $user_id ) ) return $result;
864
+
865
+ // Successfull Booking
866
+ if ( $result === true ) {
867
+ // Make sure this is unique event
868
+ if ( $this->has_entry( 'event_booking', $booking->event->post_id, $user_id ) ) return $result;
869
+
870
+ // Execute
871
+ $this->core->add_creds(
872
+ 'event_booking',
873
+ $user_id,
874
+ $this->prefs['attend']['creds'],
875
+ $this->prefs['attend']['log'],
876
+ $booking->event->post_id,
877
+ array( 'ref_type' => 'post' )
878
+ );
879
+ }
880
+
881
+ return $result;
882
+ }
883
+
884
+ /**
885
+ * Adjust Booking
886
+ * Incase an administrator needs to approve bookings first or if booking gets
887
+ * cancelled.
888
+ * @since 1.1
889
+ * @version 1.0
890
+ */
891
+ public function adjust_booking( $result, $booking ) {
892
+ $user_id = $booking->person_id;
893
+ // Check for exclusion
894
+ if ( $this->core->exclude_user( $user_id ) ) return $result;
895
+
896
+ // If the new status is 'approved', add points
897
+ if ( $booking->booking_status == 1 && $booking->previous_status != 1 ) {
898
+ // If we do not award points for attending an event bail now
899
+ if ( $this->prefs['attend']['creds'] == 0 ) return $result;
900
+
901
+ // Make sure this is unique event
902
+ if ( $this->has_entry( 'event_attendance', $booking->event->post_id, $user_id ) ) return $result;
903
+
904
+ // Execute
905
+ $this->core->add_creds(
906
+ 'event_attendance',
907
+ $user_id,
908
+ $this->prefs['attend']['creds'],
909
+ $this->prefs['attend']['log'],
910
+ $booking->event->post_id,
911
+ array( 'ref_type' => 'post' )
912
+ );
913
+ }
914
+ // Else if status got changed from previously 'approved', remove points given
915
+ elseif ( $booking->booking_status != 1 && $booking->previous_status == 1 ) {
916
+ // If we do not deduct points for cancellation bail now
917
+ if ( $this->prefs['cancel']['creds'] == 0 ) return $result;
918
+
919
+ // Make sure this is unique event
920
+ if ( $this->has_entry( 'cancelled_event_attendance', $booking->event->post_id, $user_id ) ) return $result;
921
+
922
+ // Execute
923
+ $this->core->add_creds(
924
+ 'cancelled_event_attendance',
925
+ $user_id,
926
+ $this->prefs['cancel']['creds'],
927
+ $this->prefs['cancel']['log'],
928
+ $booking->event->post_id,
929
+ array( 'ref_type' => 'post' )
930
+ );
931
+ }
932
+
933
+ return $result;
934
+ }
935
+
936
+ /**
937
+ * Preferences for Events Manager
938
+ * @since 1.1
939
+ * @version 1.0
940
+ */
941
+ public function preferences() {
942
+ $prefs = $this->prefs; ?>
943
+
944
+ <label class="subheader" for="<?php echo $this->field_id( array( 'attend' => 'creds' ) ); ?>"><?php _e( 'Attending Event', 'mycred' ); ?></label>
945
+ <ol>
946
+ <li>
947
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'attend' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'attend' => 'creds' ) ); ?>" value="<?php echo $this->core->format_number( $prefs['attend']['creds'] ); ?>" size="8" /></div>
948
+ </li>
949
+ </ol>
950
+ <label class="subheader" for="<?php echo $this->field_id( array( 'attend' => 'log' ) ); ?>"><?php _e( 'Log Template', 'mycred' ); ?></label>
951
+ <ol>
952
+ <li>
953
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'attend' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'attend' => 'log' ) ); ?>" value="<?php echo $prefs['attend']['log']; ?>" class="long" /></div>
954
+ <span class="description"><?php _e( 'Available template tags: General and Post Related', 'mycred' ); ?></span>
955
+ </li>
956
+ </ol>
957
+ <label class="subheader" for="<?php echo $this->field_id( array( 'cancel' => 'creds' ) ); ?>"><?php _e( 'Cancelling Attendance', 'mycred' ); ?></label>
958
+ <ol>
959
+ <li>
960
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'cancel' => 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'cancel' => 'creds' ) ); ?>" value="<?php echo $this->core->format_number( $prefs['cancel']['creds'] ); ?>" size="8" /></div>
961
+ </li>
962
+ </ol>
963
+ <label class="subheader" for="<?php echo $this->field_id( array( 'cancel' => 'log' ) ); ?>"><?php _e( 'Log Template', 'mycred' ); ?></label>
964
+ <ol>
965
+ <li>
966
+ <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'cancel' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'cancel' => 'log' ) ); ?>" value="<?php echo $prefs['cancel']['log']; ?>" class="long" /></div>
967
+ <span class="description"><?php _e( 'Available template tags: General and Post Related', 'mycred' ); ?></span>
968
+ </li>
969
+ </ol>
970
+ <?php unset( $this );
971
+ }
972
+ }
973
+ }
974
+ ?>
mycred.php CHANGED
@@ -3,18 +3,19 @@
3
  Plugin Name: myCRED
4
  Plugin URI: http://mycred.me
5
  Description: <strong>my</strong>CRED is an adaptive points management system for WordPress powered websites, giving you full control on how points are gained, used, traded, managed, logged or presented.
6
- Version: 1.0.9.3
7
- Tags: points, tokens, credit, management, reward, charge
8
  Author: Gabriel S Merovingi
9
  Author URI: http://www.merovingi.com
10
- Author Email: mycred@merovingi.com
11
  Requires at least: WP 3.1
12
  Tested up to: WP 3.5.1
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
  */
16
- define( 'myCRED_VERSION', '1.0.9.3' );
17
  define( 'myCRED_SLUG', 'mycred' );
 
18
 
19
  define( 'myCRED_THIS', __FILE__ );
20
  define( 'myCRED_ROOT_DIR', plugin_dir_path( myCRED_THIS ) );
@@ -62,12 +63,13 @@ if ( !class_exists( 'myCRED_Core' ) ) {
62
 
63
  // Load these only when ready
64
  require_once( myCRED_INCLUDES_DIR . 'mycred-rankings.php' );
 
65
 
66
  // Load
67
  $this->load();
68
 
69
  // Localization
70
- add_action( 'plugins_loaded', array( $this, 'language' ) );
71
 
72
  // Inits
73
  add_action( 'init', array( $this, 'init_mycred' ) );
@@ -257,13 +259,14 @@ if ( !class_exists( 'myCRED_Core' ) ) {
257
  }
258
 
259
  /**
260
- * Load Textdomain
261
  * @since 0.1
262
- * @version 2.0
263
  */
264
- function language() {
265
  load_plugin_textdomain( 'mycred', false, myCRED_LANG_DIR );
266
- do_action( 'mycred_plugin_loaded' );
 
267
  }
268
 
269
  /**
@@ -277,15 +280,20 @@ if ( !class_exists( 'myCRED_Core' ) ) {
277
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue' ) );
278
 
279
  // Admin Menu
280
- add_action( 'admin_menu', array( $this, 'add_menu' ) );
281
 
282
  // Admin Bar / Tool Bar
283
  add_action( 'admin_bar_menu', array( $this, 'tool_bar' ) );
284
 
285
- // Ranking shortcode
286
- add_shortcode( 'mycred_leaderboard', 'mycred_render_leaderboard' );
287
- add_shortcode( 'mycred_my_balance', 'mycred_render_my_balance' );
 
 
 
288
 
 
 
289
  // Let others play
290
  do_action( 'mycred_init' );
291
  }
@@ -370,9 +378,10 @@ if ( !class_exists( 'myCRED_Core' ) ) {
370
  */
371
  function add_menu() {
372
  $mycred = mycred_get_settings();
 
373
  $page = add_menu_page(
374
- __( 'myCRED', 'mycred' ),
375
- __( 'myCRED', 'mycred' ),
376
  $mycred->edit_creds_cap(),
377
  'myCRED',
378
  '',
@@ -391,6 +400,8 @@ if ( !class_exists( 'myCRED_Core' ) ) {
391
  * @version 1.0
392
  */
393
  function front_enqueue() {
 
 
394
  // Widget Scripts
395
  wp_register_script(
396
  'mycred-widget',
@@ -398,6 +409,17 @@ if ( !class_exists( 'myCRED_Core' ) ) {
398
  array( 'jquery' ),
399
  myCRED_VERSION . '.1'
400
  );
 
 
 
 
 
 
 
 
 
 
 
401
  wp_enqueue_script( 'mycred-widget' );
402
 
403
  // Widget Style (can be disabled)
@@ -452,6 +474,34 @@ if ( !class_exists( 'myCRED_Core' ) ) {
452
  function admin_print_styles() {
453
  wp_enqueue_style( 'mycred-admin' );
454
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
 
456
  /**
457
  * Clear up
@@ -530,6 +580,64 @@ if ( !class_exists( 'myCRED_Core' ) ) {
530
  add_blog_option( 'mycred_version_db', '1.0', '', 'no' );
531
  return true;
532
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
533
  }
534
  new myCRED_Core();
535
  }
3
  Plugin Name: myCRED
4
  Plugin URI: http://mycred.me
5
  Description: <strong>my</strong>CRED is an adaptive points management system for WordPress powered websites, giving you full control on how points are gained, used, traded, managed, logged or presented.
6
+ Version: 1.1
7
+ Tags: points, tokens, credit, management, reward, charge, buddypress, jetpack, ranks, email notice, buy, sell
8
  Author: Gabriel S Merovingi
9
  Author URI: http://www.merovingi.com
10
+ Author Email: support@mycred.me
11
  Requires at least: WP 3.1
12
  Tested up to: WP 3.5.1
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
  */
16
+ define( 'myCRED_VERSION', '1.1' );
17
  define( 'myCRED_SLUG', 'mycred' );
18
+ define( 'myCRED_NAME', '<strong>my</strong>CRED' );
19
 
20
  define( 'myCRED_THIS', __FILE__ );
21
  define( 'myCRED_ROOT_DIR', plugin_dir_path( myCRED_THIS ) );
63
 
64
  // Load these only when ready
65
  require_once( myCRED_INCLUDES_DIR . 'mycred-rankings.php' );
66
+ require_once( myCRED_INCLUDES_DIR . 'mycred-shortcodes.php' );
67
 
68
  // Load
69
  $this->load();
70
 
71
  // Localization
72
+ add_action( 'plugins_loaded', array( $this, 'pre_init' ) );
73
 
74
  // Inits
75
  add_action( 'init', array( $this, 'init_mycred' ) );
259
  }
260
 
261
  /**
262
+ * Pre Init (Plugins Loaded)
263
  * @since 0.1
264
+ * @version 3.0
265
  */
266
+ function pre_init() {
267
  load_plugin_textdomain( 'mycred', false, myCRED_LANG_DIR );
268
+
269
+ do_action( 'mycred_plugins_loaded' );
270
  }
271
 
272
  /**
280
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue' ) );
281
 
282
  // Admin Menu
283
+ add_action( 'admin_menu', array( $this, 'add_menu' ), 9 );
284
 
285
  // Admin Bar / Tool Bar
286
  add_action( 'admin_bar_menu', array( $this, 'tool_bar' ) );
287
 
288
+ // Shortcodes
289
+ add_shortcode( 'mycred_leaderboard', 'mycred_render_leaderboard' );
290
+ add_shortcode( 'mycred_my_ranking', 'mycred_render_my_ranking' );
291
+ add_shortcode( 'mycred_my_balance', 'mycred_render_shortcode_my_balance' );
292
+ add_shortcode( 'mycred_give', 'mycred_render_shortcode_give' );
293
+ add_shortcode( 'mycred_send', 'mycred_render_shortcode_send' );
294
 
295
+ add_action( 'wp_footer', array( $this, 'footer' ) );
296
+ add_action( 'wp_ajax_mycred-send-points', array( $this, 'send_points' ) );
297
  // Let others play
298
  do_action( 'mycred_init' );
299
  }
378
  */
379
  function add_menu() {
380
  $mycred = mycred_get_settings();
381
+ $name = apply_filters( 'mycred_label', myCRED_NAME );
382
  $page = add_menu_page(
383
+ $name,
384
+ $name,
385
  $mycred->edit_creds_cap(),
386
  'myCRED',
387
  '',
400
  * @version 1.0
401
  */
402
  function front_enqueue() {
403
+ global $mycred_sending_points;
404
+
405
  // Widget Scripts
406
  wp_register_script(
407
  'mycred-widget',
409
  array( 'jquery' ),
410
  myCRED_VERSION . '.1'
411
  );
412
+
413
+ // Send Points Shortcode
414
+ wp_register_script(
415
+ 'mycred-send-points',
416
+ plugins_url( 'assets/js/send.js', myCRED_THIS ),
417
+ array( 'jquery' ),
418
+ myCRED_VERSION . '.1',
419
+ true
420
+ );
421
+
422
+ // Enqueue
423
  wp_enqueue_script( 'mycred-widget' );
424
 
425
  // Widget Style (can be disabled)
474
  function admin_print_styles() {
475
  wp_enqueue_style( 'mycred-admin' );
476
  }
477
+
478
+ /**
479
+ * WP Footer
480
+ * @since 1.1
481
+ * @version 1.0
482
+ */
483
+ public function footer() {
484
+ global $mycred_sending_points;
485
+ if ( $mycred_sending_points === true ) {
486
+ $mycred = mycred_get_settings();
487
+ $base = array(
488
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
489
+ 'token' => wp_create_nonce( 'mycred-send-points' )
490
+ );
491
+
492
+ $language = apply_filters( 'mycred_send_language', array(
493
+ 'working' => __( 'Processing...', 'mycred' ),
494
+ 'done' => __( 'Sent', 'mycred' ),
495
+ 'error' => __( 'Error - Try Again', 'mycred' )
496
+ ) );
497
+ wp_localize_script(
498
+ 'mycred-send-points',
499
+ 'myCREDsend',
500
+ array_merge_recursive( $base, $language )
501
+ );
502
+ wp_enqueue_script( 'mycred-send-points' );
503
+ }
504
+ }
505
 
506
  /**
507
  * Clear up
580
  add_blog_option( 'mycred_version_db', '1.0', '', 'no' );
581
  return true;
582
  }
583
+
584
+ /**
585
+ * Send Points Ajax Call Handler
586
+ *
587
+ * @since 1.1
588
+ * @version 1.1
589
+ */
590
+ public function send_points() {
591
+ // We must be logged in
592
+ if ( !is_user_logged_in() ) die();
593
+
594
+ // Security
595
+ check_ajax_referer( 'mycred-send-points', 'token' );
596
+
597
+ $mycred = mycred_get_settings();
598
+ $user_id = get_current_user_id();
599
+
600
+ $account_limit = (int) apply_filters( 'mycred_transfer_acc_limit', 0 );
601
+ $balance = $mycred->get_users_cred( $user_id );
602
+ $amount = $mycred->number( $_POST['amount'] );
603
+ $new_balance = $balance-$amount;
604
+
605
+ // Insufficient Funds
606
+ if ( $new_balance < $account_limit )
607
+ die();
608
+ // After this transfer our account will reach zero
609
+ elseif ( $new_balance == $account_limit )
610
+ $reply = 'zero';
611
+ // Check if this is the last time we can do these kinds of amounts
612
+ elseif ( $new_balance-$amount < $account_limit )
613
+ $reply = 'minus';
614
+ // Else everything is fine
615
+ else
616
+ $reply = 'done';
617
+
618
+ // First deduct points
619
+ $mycred->add_creds(
620
+ trim( $_POST['reference'] ),
621
+ $user_id,
622
+ 0-$amount,
623
+ trim( $_POST['log'] ),
624
+ $_POST['recipient'],
625
+ array( 'ref_type' => 'user' )
626
+ );
627
+
628
+ // Then add to recipient
629
+ $mycred->add_creds(
630
+ trim( $_POST['reference'] ),
631
+ $_POST['recipient'],
632
+ $amount,
633
+ trim( $_POST['log'] ),
634
+ $user_id,
635
+ array( 'ref_type' => 'user' )
636
+ );
637
+
638
+ // Share the good news
639
+ die( json_encode( $reply ) );
640
+ }
641
  }
642
  new myCRED_Core();
643
  }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === myCRED ===
2
  Contributors: designbymerovingi
3
  Donate Link: http://mycred.me/donate/
4
- Tags:points, tokens, credit, management, reward, charge, community, BuddyPress, Jetpack
5
  Requires at least: 3.1
6
  Tested up to: 3.5.1
7
- Stable tag: 1.0.9.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -33,13 +33,15 @@ So we built an adaptive plugin which gives it’s users full control on how poin
33
 
34
  **Add-ons:**
35
 
36
- Add-ons are custom features that can be enabled individually.
37
 
 
38
  * *Transfer* - Allows your users to send points to other members with an option to impose a daily-, weekly- or monthly transfer limit.
39
  * *Import* - Import points from a CSV-file, Cubepoints or points stored under any custom user meta key.
40
  * *Sell Content* - Sell access to entire contents or parts of it with the option to share a percentage of the sale with the content author.
41
- * *Buy Creds* - Let your users buy points via PayPal, Skrill or NETbilling.
42
- * *Gateway* - Allow your users to pay for items in their WooCommerce shopping cart using their point balance.
 
43
  * *BuddyPress* - Extend **my**CRED to support [BuddyPress](http://wordpress.org/extend/plugins/buddypress/), [bbPress](http://wordpress.org/extend/plugins/bbpress/), [BuddyPress Gifts](http://wordpress.org/extend/plugins/buddypress-gifts/), [BuddyPress Links](http://wordpress.org/extend/plugins/buddypress-links/), [BP Album+](http://wordpress.org/extend/plugins/bp-gallery/) and [BP Gallery](http://buddydev.com/plugins/bp-gallery/).
44
 
45
 
@@ -59,7 +61,9 @@ The following third party plugins are supported by default:
59
  * [Invite Anyone Plugin](http://wordpress.org/extend/plugins/invite-anyone/) - Award users for sending invitations and for each time an invited user accepts and signs up.
60
  * [Jetpack](http://wordpress.org/extend/plugins/jetpack/) - Award users for subscribing to comments or your site. Requires users to be logged in or subscribe using the email saved in their profile.
61
  * [BadgeOS](http://wordpress.org/extend/plugins/badgeos/) - Award points for any BadgeOS achievement type.
62
-
 
 
63
 
64
  **Further Details**
65
 
@@ -80,6 +84,8 @@ The following third party plugins are supported by default:
80
 
81
  == Installation ==
82
 
 
 
83
  1. Upload `mycred` to the `/wp-content/plugins/` directory
84
  2. Activate the plugin through the 'Plugins' menu in WordPress
85
  3. Run the myCRED Setup which will allow you to configure your **my**CRED installation
@@ -122,6 +128,40 @@ Yes but if one of them is bought, all is shown. The mycred_sell_this shortcode w
122
 
123
  == Changelog ==
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  = 1.0.9.3 =
126
  * Added new template tag %num_members% to show the total number of members on blog.
127
  * Added support for user related template tags for myCRED Balance widget.
1
  === myCRED ===
2
  Contributors: designbymerovingi
3
  Donate Link: http://mycred.me/donate/
4
+ Tags:points, tokens, credit, management, reward, charge, community, contest, BuddyPress, Jetpack, ranks, email notice
5
  Requires at least: 3.1
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
33
 
34
  **Add-ons:**
35
 
36
+ Your myCRED installation comes packed with optional add-ons, adding further features and third-party plugin support.
37
 
38
+ * *Email Notices* - Setup email notices for your users and/or admins when a users points balance changes or on specific events, for example when they purchase content set for sale.
39
  * *Transfer* - Allows your users to send points to other members with an option to impose a daily-, weekly- or monthly transfer limit.
40
  * *Import* - Import points from a CSV-file, Cubepoints or points stored under any custom user meta key.
41
  * *Sell Content* - Sell access to entire contents or parts of it with the option to share a percentage of the sale with the content author.
42
+ * *Buy Creds* - Let your users buy points via PayPal, Skrill, Zombaio or NETbilling.
43
+ * *Ranks* - Allows you to setup ranks based on your users points balance.
44
+ * *Gateway* - Allow your users to pay for items in their WooCommerce or MarketPress shopping cart using their point balance.
45
  * *BuddyPress* - Extend **my**CRED to support [BuddyPress](http://wordpress.org/extend/plugins/buddypress/), [bbPress](http://wordpress.org/extend/plugins/bbpress/), [BuddyPress Gifts](http://wordpress.org/extend/plugins/buddypress-gifts/), [BuddyPress Links](http://wordpress.org/extend/plugins/buddypress-links/), [BP Album+](http://wordpress.org/extend/plugins/bp-gallery/) and [BP Gallery](http://buddydev.com/plugins/bp-gallery/).
46
 
47
 
61
  * [Invite Anyone Plugin](http://wordpress.org/extend/plugins/invite-anyone/) - Award users for sending invitations and for each time an invited user accepts and signs up.
62
  * [Jetpack](http://wordpress.org/extend/plugins/jetpack/) - Award users for subscribing to comments or your site. Requires users to be logged in or subscribe using the email saved in their profile.
63
  * [BadgeOS](http://wordpress.org/extend/plugins/badgeos/) - Award points for any BadgeOS achievement type.
64
+ * [WP-Polls](http://wordpress.org/plugins/wp-polls/) - Award points for users voting in polls.
65
+ * [WP Favorite Posts](http://wordpress.org/plugins/wp-favorite-posts/) - Award points for users adding posts to their favorites or deduct points if they remove posts.
66
+ * [Events Manager](http://wordpress.org/plugins/events-manager/) - Award points for users attending events with the option to deduct points if attendance is cancelled.
67
 
68
  **Further Details**
69
 
84
 
85
  == Installation ==
86
 
87
+ For a comprehensive guide on how to install myCRED or how this plugin works, consider visiting our [Online Tutorial](http://mycred.me/support/tutorials/how-to-install-and-setup-mycred/).
88
+
89
  1. Upload `mycred` to the `/wp-content/plugins/` directory
90
  2. Activate the plugin through the 'Plugins' menu in WordPress
91
  3. Run the myCRED Setup which will allow you to configure your **my**CRED installation
128
 
129
  == Changelog ==
130
 
131
+ = 1.1 =
132
+ * Added new Email Notices Add-on.
133
+ * Added new Ranks Add-on.
134
+
135
+ * Added support for WP-Polls plugin.
136
+ * Added support for WP Favorite Posts.
137
+ * Added support for Events Manager plugin.
138
+
139
+ * Added support for MarketPress (Gateway Add-on).
140
+ * Added Zombaio as Payment Gateway for the buyCRED Add-on.
141
+ * Added filter mycred_label to allow white-labeling of myCRED.
142
+
143
+ * Added new template tags to: General and User related.
144
+ * Added new shortcode [mycred_link] to award points for users clicking on web links.
145
+ * Added new shortcode [mycred_give] to award x number of points to the current user.
146
+ * Added new shortcode [mycred_send] to send a given user x number of points if the current user can afford it.
147
+ * Added new shortcode [mycred_render_my_rank] to show either a given users rank or the current users rank. Requires Ranks Add-on.
148
+ * Added new shortcode [mycred_users_of_rank] to show all users of a given rank. Requires Ranks Add-on.
149
+ * Added new shortcode [mycred_users_of_all_ranks] to show all users of every published rank in order. Requires Ranks Add-on.
150
+
151
+ * Added the option to let purchases made with the Sell Content add-on to expire after an x number of hours.
152
+ * Added new shortcode [mycred_sell_this_ajax] to allow sale of content using AJAX. Note this shortcode can only be used once per content.
153
+ * Adjusted the myCRED List Widget to offer the same features as the [mycred_leaderboard] shortcode, adding the option to offset or change order of list.
154
+ * Adjusted the buyCRED Forms submit button location. (Suggested by dambacher)
155
+ * Adjusted the Transfer form with new CSS styling.
156
+ * Adjusted add_points() method to allow admins to change users points balances without making a log entry.
157
+
158
+ * Renamed the default %rank% template tag to %ranking% to give space for the Ranks Add-on.
159
+
160
+ * Fixed Bug #27 - Premium Content Author can not see their own content without paying.
161
+ * Fixed Bug #28 - make_purchase() method referencing arguments that does not exist (renamed).
162
+ * Fixed Bug #29 - ABSPATH issue with WP Stage plugin. (Fixed by clariner)
163
+ * Fixed Bug #30 - WooCommerce division by zero error. (Thanks hamzahali)
164
+
165
  = 1.0.9.3 =
166
  * Added new template tag %num_members% to show the total number of members on blog.
167
  * Added support for user related template tags for myCRED Balance widget.