Advertisement
designbymerovingi

myCRED: BP Checkin custom hook

Jan 28th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 21.55 KB | None | 0 0
  1. /**
  2.  * Register Hook
  3.  * @since 0.1
  4.  * @version 1.0
  5.  */
  6. add_filter( 'mycred_setup_hooks', 'mycred_hook_bp_checkins' );
  7. function mycred_hook_bp_checkins( $installed ) {
  8.     // If the required plugin is installed
  9.     if ( function_exists( 'bp_checkins_init' ) )
  10.         $installed['bp_checkins'] = array(
  11.             'title'       => __( 'BP Checkins', 'mycred' ),
  12.             'description' => __( 'Awards %_plural% to users who checking to places on your website.', 'mycred' ),
  13.             'callback'    => array( 'myCRED_BP_Checkins' )
  14.         );
  15.  
  16.     return $installed;
  17. }
  18.  
  19. /**
  20.  * BP Checkins
  21.  * @since 0.1
  22.  * @version 1.0
  23.  */
  24. if ( class_exists( 'myCRED_Hook' ) && ! class_exists( 'myCRED_BP_Checkins' ) ) {
  25.     class myCRED_BP_Checkins extends myCRED_Hook {
  26.  
  27.         /**
  28.          * Construct
  29.          */
  30.         function __construct( $hook_prefs ) {
  31.             parent::__construct( array(
  32.                 'id'       => 'bp_checkins',
  33.                 'defaults' => array(
  34.                     'checkin' => array(
  35.                         'creds'     => 0,
  36.                         'log'       => '%plural% for checkin',
  37.                         'limit'     => 0
  38.                     ),
  39.                     'new_place' => array(
  40.                         'creds'     => 0,
  41.                         'log'       => '%plural% for new place',
  42.                         'limit'     => 0
  43.                     ),
  44.                     'place_checkin'   => array(
  45.                         'creds'     => 0,
  46.                         'log'       => '%plural% for checkin at place',
  47.                         'limit'     => 0
  48.                     ),
  49.                     'place_comment' => array(
  50.                         'creds'     => 0,
  51.                         'log'       => '%plural% for place comment',
  52.                         'limit'     => 0
  53.                     ),
  54.                     'place_checkin_comment' => array(
  55.                         'creds'     => 0,
  56.                         'log'       => '%plural% for place checkin comment',
  57.                         'limit'     => 0
  58.                     ),
  59.                     'group_checkin' => array(
  60.                         'creds'     => 0,
  61.                         'log'       => '%plural% for group checkin',
  62.                         'limit'     => 0
  63.                     ),
  64.                     'group_new_place' => array(
  65.                         'creds'     => 0,
  66.                         'log'       => '%plural% for new group place',
  67.                         'limit'     => 0
  68.                     ),
  69.                     'group_place_checkin'   => array(
  70.                         'creds'     => 0,
  71.                         'log'       => '%plural% for checkin at group place',
  72.                         'limit'     => 0
  73.                     ),
  74.                     'group_place_comment' => array(
  75.                         'creds'     => 0,
  76.                         'log'       => '%plural% for group place comment',
  77.                         'limit'     => 0
  78.                     ),
  79.                     'group_place_checkin_comment' => array(
  80.                         'creds'     => 0,
  81.                         'log'       => '%plural% for group place checkin comment',
  82.                         'limit'     => 0
  83.                     )
  84.                 )
  85.             ), $hook_prefs );
  86.         }
  87.  
  88.         /**
  89.          * Run
  90.          * @since 0.1
  91.          * @version 1.0
  92.          */
  93.         public function run() {
  94.             add_action( 'bp_activity_posted_checkin', array( $this, 'activity_checkin' ), 10, 3 );
  95.             add_action( 'bp_groups_posted_checkin',   array( $this, 'group_checkin' ), 10, 4 );
  96.         }
  97.  
  98.         /**
  99.          * Profile Checkin
  100.          * @since 1.0
  101.          * @version 1.0
  102.          */
  103.         public function activity_checkin( $content, $user_id, $activity_id ) {
  104.             // Check if user is excluded
  105.             if ( $this->core->exclude_user( $user_id ) ) return;
  106.  
  107.             // Get Activity
  108.             $activity = bp_activity_get_specific( array( '' => $activity_id ) );
  109.  
  110.             if ( isset( $this->prefs[ $activity->type ]['creds'] ) && $this->prefs[ $activity->type ]['creds'] != 0 ) {
  111.  
  112.                 $ref_id = $activity_id;
  113.                 if ( $activity->item_id !== false )
  114.                     $ref_id = $activity->item_id;
  115.  
  116.                 // Make sure this is unique event
  117.                 if ( $this->core->has_entry( $activity->type, $user_id, $ref_id ) ) return;
  118.  
  119.                 // Check if we are over the daily limit
  120.                 if ( $this->prefs[ $activity->type ]['limit'] > 0 ) {
  121.                     $earned = mycred_get_total_by_time( 'today', 'now', $activity->type, $user_id );
  122.                     $max = $this->core->number( $this->prefs[ $activity->type ]['limit'] * $this->prefs[ $activity->type ]['creds'] );
  123.                     if ( $earned <= $max ) return;
  124.                 }
  125.  
  126.                 // Execute
  127.                 $this->core->add_creds(
  128.                     $activity->type,
  129.                     $user_id,
  130.                     $this->prefs[ $activity->type ]['creds'],
  131.                     $this->prefs[ $activity->type ]['log'],
  132.                     $ref_id
  133.                 );
  134.  
  135.             }
  136.         }
  137.  
  138.         /**
  139.          * Group Checkin
  140.          * @since 1.0
  141.          * @version 1.0
  142.          */
  143.         public function group_checkin( $content, $user_id, $group_id, $activity_id ) {
  144.             // Check if user is excluded
  145.             if ( $this->core->exclude_user( $user_id ) ) return;
  146.  
  147.             // Get Activity
  148.             $activity = bp_activity_get_specific( array( '' => $activity_id ) );
  149.  
  150.             if ( isset( $this->prefs[ 'group_' . $activity->type ]['creds'] ) && $this->prefs[ 'group_' . $activity->type ]['creds'] != 0 ) {
  151.  
  152.                 $ref_id = $activity_id;
  153.                 if ( $activity->item_id !== false )
  154.                     $ref_id = $activity->item_id;
  155.  
  156.                 // Make sure this is unique event
  157.                 if ( $this->core->has_entry( 'group_' . $activity->type, $user_id, $ref_id ) ) return;
  158.  
  159.                 // Check if we are over the daily limit
  160.                 if ( $this->prefs[ 'group_' . $activity->type ]['limit'] > 0 ) {
  161.                     $earned = mycred_get_total_by_time( 'today', 'now', 'group_' . $activity->type, $user_id );
  162.                     $max = $this->core->number( $this->prefs[ 'group_' . $activity->type ]['limit'] * $this->prefs[ 'group_' . $activity->type ]['creds'] );
  163.                     if ( $earned <= $max ) return;
  164.                 }
  165.  
  166.                 // Execute
  167.                 $this->core->add_creds(
  168.                     $activity->component,
  169.                     $user_id,
  170.                     $this->prefs[ 'group_' . $activity->type ]['creds'],
  171.                     $this->prefs[ 'group_' . $activity->type ]['log'],
  172.                     $ref_id
  173.                 );
  174.  
  175.             }
  176.         }
  177.  
  178.         /**
  179.          * Preferences for Hook
  180.          * @since 1.0
  181.          * @version 1.0
  182.          */
  183.         public function preferences() {
  184.             $prefs = $this->prefs;
  185.             $creds_label = $this->core->plural();
  186.             $log_label = __( 'Log template', 'mycred' );
  187.             $limit_label = __( 'Daily Limit', 'mycred' );
  188.             $limit_description = __( 'Optional daily limit to enforce. Use zero for unlimited.', 'mycred' );
  189.             $available_tags = __( 'Available template tags: General.', 'mycred' );
  190.             $available_tags_post = __( 'Available template tags: General and Post related (places).', 'mycred' ); ?>
  191.  
  192. <label for="<?php echo $this->field_id( array( 'checkin', 'creds' ) ); ?>" class="subheader"><?php _e( 'Profile Checkin', 'mycred' ); ?></label>
  193. <ol>
  194.     <li>
  195.         <label for="<?php echo $this->field_id( array( 'checkin', 'creds' ) ); ?>"><?php echo $creds_label; ?></label>
  196.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'checkin', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'checkin', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['checkin']['creds'] ); ?>" size="8" /></div>
  197.     </li>
  198.     <li>
  199.         <label for="<?php echo $this->field_id( array( 'checkin', 'log' ) ); ?>"><?php echo $log_label; ?></label>
  200.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'checkin', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'checkin', 'log' ) ); ?>" value="<?php echo esc_attr( $prefs['checkin']['log'] ); ?>" class="long" /></div>
  201.         <span class="description"><?php echo $available_tags; ?></span>
  202.     </li>
  203.     <li>
  204.         <label for="<?php echo $this->field_id( array( 'checkin', 'limit' ) ); ?>"><?php echo $limit_label; ?></label>
  205.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'checkin', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'checkin', 'limit' ) ); ?>" value="<?php echo $this->core->number( $prefs['checkin']['limit'] ); ?>" size="8" /> <?php _e( '/ day', 'mycred' ); ?></div>
  206.         <span class="description"><?php echo $limit_description; ?></span>
  207.     </li>
  208. </ol>
  209. <label for="<?php echo $this->field_id( array( 'new_place', 'creds' ) ); ?>" class="subheader"><?php _e( 'New Place', 'mycred' ); ?></label>
  210. <ol>
  211.     <li>
  212.         <label for="<?php echo $this->field_id( array( 'new_place', 'creds' ) ); ?>"><?php echo $creds_label; ?></label>
  213.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'new_place', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'new_place', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['new_place']['creds'] ); ?>" size="8" /></div>
  214.     </li>
  215.     <li>
  216.         <label for="<?php echo $this->field_id( array( 'new_place', 'log' ) ); ?>"><?php echo $log_label; ?></label>
  217.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'new_place', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'new_place', 'log' ) ); ?>" value="<?php echo esc_attr( $prefs['new_place']['log'] ); ?>" class="long" /></div>
  218.         <span class="description"><?php echo $available_tags_post; ?></span>
  219.     </li>
  220.     <li>
  221.         <label for="<?php echo $this->field_id( array( 'new_place', 'limit' ) ); ?>"><?php echo $limit_label; ?></label>
  222.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'new_place', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'new_place', 'limit' ) ); ?>" value="<?php echo $this->core->number( $prefs['new_place']['limit'] ); ?>" size="8" /> <?php _e( '/ day', 'mycred' ); ?></div>
  223.         <span class="description"><?php echo $limit_description; ?></span>
  224.     </li>
  225. </ol>
  226. <label for="<?php echo $this->field_id( array( 'place_checkin', 'creds' ) ); ?>" class="subheader"><?php _e( 'Place Checkin', 'mycred' ); ?></label>
  227. <ol>
  228.     <li>
  229.         <label for="<?php echo $this->field_id( array( 'place_checkin', 'creds' ) ); ?>"><?php echo $creds_label; ?></label>
  230.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'place_checkin', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'place_checkin', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['place_checkin']['creds'] ); ?>" size="8" /></div>
  231.     </li>
  232.     <li>
  233.         <label for="<?php echo $this->field_id( array( 'place_checkin', 'log' ) ); ?>"><?php echo $log_label; ?></label>
  234.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'place_checkin', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'place_checkin', 'log' ) ); ?>" value="<?php echo esc_attr( $prefs['place_checkin']['log'] ); ?>" class="long" /></div>
  235.         <span class="description"><?php echo $available_tags_post; ?></span>
  236.     </li>
  237.     <li>
  238.         <label for="<?php echo $this->field_id( array( 'place_checkin', 'limit' ) ); ?>"><?php echo $limit_label; ?></label>
  239.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'place_checkin', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'place_checkin', 'limit' ) ); ?>" value="<?php echo $this->core->number( $prefs['place_checkin']['limit'] ); ?>" size="8" /> <?php _e( '/ day', 'mycred' ); ?></div>
  240.         <span class="description"><?php echo $limit_description; ?></span>
  241.     </li>
  242. </ol>
  243. <label for="<?php echo $this->field_id( array( 'place_comment', 'creds' ) ); ?>" class="subheader"><?php _e( 'Place Comment', 'mycred' ); ?></label>
  244. <ol>
  245.     <li>
  246.         <label for="<?php echo $this->field_id( array( 'place_comment', 'creds' ) ); ?>"><?php echo $creds_label; ?></label>
  247.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'place_comment', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'place_comment', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['place_comment']['creds'] ); ?>" size="8" /></div>
  248.     </li>
  249.     <li>
  250.         <label for="<?php echo $this->field_id( array( 'place_comment', 'log' ) ); ?>"><?php echo $log_label; ?></label>
  251.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'place_comment', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'place_comment', 'log' ) ); ?>" value="<?php echo esc_attr( $prefs['place_comment']['log'] ); ?>" class="long" /></div>
  252.         <span class="description"><?php echo $available_tags_post; ?></span>
  253.     </li>
  254.     <li>
  255.         <label for="<?php echo $this->field_id( array( 'place_comment', 'limit' ) ); ?>"><?php echo $limit_label; ?></label>
  256.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'place_comment', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'place_comment', 'limit' ) ); ?>" value="<?php echo $this->core->number( $prefs['place_comment']['limit'] ); ?>" size="8" /> <?php _e( '/ day', 'mycred' ); ?></div>
  257.         <span class="description"><?php $limit_description; ?></span>
  258.     </li>
  259. </ol>
  260. <label for="<?php echo $this->field_id( array( 'place_checkin_comment', 'creds' ) ); ?>" class="subheader"><?php _e( 'Place Checkin Comment', 'mycred' ); ?></label>
  261. <ol>
  262.     <li>
  263.         <label for="<?php echo $this->field_id( array( 'place_checkin_comment', 'creds' ) ); ?>"><?php echo $creds_label; ?></label>
  264.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'place_checkin_comment', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'place_checkin_comment', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['place_checkin_comment']['creds'] ); ?>" size="8" /></div>
  265.     </li>
  266.     <li>
  267.         <label for="<?php echo $this->field_id( array( 'place_checkin_comment', 'log' ) ); ?>"><?php echo $log_label; ?></label>
  268.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'place_checkin_comment', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'place_checkin_comment', 'log' ) ); ?>" value="<?php echo esc_attr( $prefs['place_checkin_comment']['log'] ); ?>" class="long" /></div>
  269.         <span class="description"><?php echo $available_tags_post; ?></span>
  270.     </li>
  271.     <li>
  272.         <label for="<?php echo $this->field_id( array( 'place_checkin_comment', 'limit' ) ); ?>"><?php echo $limit_label; ?></label>
  273.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'place_checkin_comment', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'place_checkin_comment', 'limit' ) ); ?>" value="<?php echo $this->core->number( $prefs['place_checkin_comment']['limit'] ); ?>" size="8" /> <?php _e( '/ day', 'mycred' ); ?></div>
  274.         <span class="description"><?php echo $limit_description; ?></span>
  275.     </li>
  276. </ol>
  277.  
  278. <label for="<?php echo $this->field_id( array( 'group_checkin', 'creds' ) ); ?>" class="subheader"><?php _e( 'Group Profile Checkin', 'mycred' ); ?></label>
  279. <ol>
  280.     <li>
  281.         <label for="<?php echo $this->field_id( array( 'group_checkin', 'creds' ) ); ?>"><?php echo $creds_label; ?></label>
  282.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_checkin', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'group_checkin', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['group_checkin']['creds'] ); ?>" size="8" /></div>
  283.     </li>
  284.     <li>
  285.         <label for="<?php echo $this->field_id( array( 'group_checkin', 'log' ) ); ?>"><?php echo $log_label; ?></label>
  286.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_checkin', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'group_checkin', 'log' ) ); ?>" value="<?php echo esc_attr( $prefs['group_checkin']['log'] ); ?>" class="long" /></div>
  287.         <span class="description"><?php echo $available_tags; ?></span>
  288.     </li>
  289.     <li>
  290.         <label for="<?php echo $this->field_id( array( 'group_checkin', 'limit' ) ); ?>"><?php echo $limit_label; ?></label>
  291.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_checkin', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'group_checkin', 'limit' ) ); ?>" value="<?php echo $this->core->number( $prefs['group_checkin']['limit'] ); ?>" size="8" /> <?php _e( '/ day', 'mycred' ); ?></div>
  292.         <span class="description"><?php echo $limit_description; ?></span>
  293.     </li>
  294. </ol>
  295. <label for="<?php echo $this->field_id( array( 'group_new_place', 'creds' ) ); ?>" class="subheader"><?php _e( 'Group New Place', 'mycred' ); ?></label>
  296. <ol>
  297.     <li>
  298.         <label for="<?php echo $this->field_id( array( 'group_new_place', 'creds' ) ); ?>"><?php echo $creds_label; ?></label>
  299.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_new_place', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'group_new_place', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['group_new_place']['creds'] ); ?>" size="8" /></div>
  300.     </li>
  301.     <li>
  302.         <label for="<?php echo $this->field_id( array( 'group_new_place', 'log' ) ); ?>"><?php echo $log_label; ?></label>
  303.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_new_place', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'group_new_place', 'log' ) ); ?>" value="<?php echo esc_attr( $prefs['group_new_place']['log'] ); ?>" class="long" /></div>
  304.         <span class="description"><?php echo $available_tags_post; ?></span>
  305.     </li>
  306.     <li>
  307.         <label for="<?php echo $this->field_id( array( 'group_new_place', 'limit' ) ); ?>"><?php echo $limit_label; ?></label>
  308.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_new_place', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'group_new_place', 'limit' ) ); ?>" value="<?php echo $this->core->number( $prefs['group_new_place']['limit'] ); ?>" size="8" /> <?php _e( '/ day', 'mycred' ); ?></div>
  309.         <span class="description"><?php echo $limit_description; ?></span>
  310.     </li>
  311. </ol>
  312. <label for="<?php echo $this->field_id( array( 'group_place_checkin', 'creds' ) ); ?>" class="subheader"><?php _e( 'Group Place Checkin', 'mycred' ); ?></label>
  313. <ol>
  314.     <li>
  315.         <label for="<?php echo $this->field_id( array( 'group_place_checkin', 'creds' ) ); ?>"><?php echo $creds_label; ?></label>
  316.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_place_checkin', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'group_place_checkin', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['group_place_checkin']['creds'] ); ?>" size="8" /></div>
  317.     </li>
  318.     <li>
  319.         <label for="<?php echo $this->field_id( array( 'group_place_checkin', 'log' ) ); ?>"><?php echo $log_label; ?></label>
  320.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_place_checkin', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'group_place_checkin', 'log' ) ); ?>" value="<?php echo esc_attr( $prefs['group_place_checkin']['log'] ); ?>" class="long" /></div>
  321.         <span class="description"><?php echo $available_tags_post; ?></span>
  322.     </li>
  323.     <li>
  324.         <label for="<?php echo $this->field_id( array( 'group_place_checkin', 'limit' ) ); ?>"><?php echo $limit_label; ?></label>
  325.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_place_checkin', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'group_place_checkin', 'limit' ) ); ?>" value="<?php echo $this->core->number( $prefs['group_place_checkin']['limit'] ); ?>" size="8" /> <?php _e( '/ day', 'mycred' ); ?></div>
  326.         <span class="description"><?php echo $limit_description; ?></span>
  327.     </li>
  328. </ol>
  329. <label for="<?php echo $this->field_id( array( 'group_place_comment', 'creds' ) ); ?>" class="subheader"><?php _e( 'Group Place Comment', 'mycred' ); ?></label>
  330. <ol>
  331.     <li>
  332.         <label for="<?php echo $this->field_id( array( 'group_place_comment', 'creds' ) ); ?>"><?php echo $creds_label; ?></label>
  333.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_place_comment', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'group_place_comment', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['group_place_comment']['creds'] ); ?>" size="8" /></div>
  334.     </li>
  335.     <li>
  336.         <label for="<?php echo $this->field_id( array( 'group_place_comment', 'log' ) ); ?>"><?php echo $log_label; ?></label>
  337.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_place_comment', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'group_place_comment', 'log' ) ); ?>" value="<?php echo esc_attr( $prefs['group_place_comment']['log'] ); ?>" class="long" /></div>
  338.         <span class="description"><?php echo $available_tags_post; ?></span>
  339.     </li>
  340.     <li>
  341.         <label for="<?php echo $this->field_id( array( 'group_place_comment', 'limit' ) ); ?>"><?php echo $limit_label; ?></label>
  342.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_place_comment', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'group_place_comment', 'limit' ) ); ?>" value="<?php echo $this->core->number( $prefs['group_place_comment']['limit'] ); ?>" size="8" /> <?php _e( '/ day', 'mycred' ); ?></div>
  343.         <span class="description"><?php echo $limit_description; ?></span>
  344.     </li>
  345. </ol>
  346. <label for="<?php echo $this->field_id( array( 'group_place_checkin_comment', 'creds' ) ); ?>" class="subheader"><?php _e( 'Group Place Checkin Comment', 'mycred' ); ?></label>
  347. <ol>
  348.     <li>
  349.         <label for="<?php echo $this->field_id( array( 'group_place_checkin_comment', 'creds' ) ); ?>"><?php echo $creds_label; ?></label>
  350.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_place_checkin_comment', 'creds' ) ); ?>" id="<?php echo $this->field_id( array( 'group_place_checkin_comment', 'creds' ) ); ?>" value="<?php echo $this->core->number( $prefs['group_place_checkin_comment']['creds'] ); ?>" size="8" /></div>
  351.     </li>
  352.     <li>
  353.         <label for="<?php echo $this->field_id( array( 'group_place_checkin_comment', 'log' ) ); ?>"><?php echo $log_label; ?></label>
  354.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_place_checkin_comment', 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'group_place_checkin_comment', 'log' ) ); ?>" value="<?php echo esc_attr( $prefs['group_place_checkin_comment']['log'] ); ?>" class="long" /></div>
  355.         <span class="description"><?php echo $available_tags_post; ?></span>
  356.     </li>
  357.     <li>
  358.         <label for="<?php echo $this->field_id( array( 'group_place_checkin_comment', 'limit' ) ); ?>"><?php echo $limit_label; ?></label>
  359.         <div class="h2"><input type="text" name="<?php echo $this->field_name( array( 'group_place_checkin_comment', 'limit' ) ); ?>" id="<?php echo $this->field_id( array( 'group_place_checkin_comment', 'limit' ) ); ?>" value="<?php echo $this->core->number( $prefs['group_place_checkin_comment']['limit'] ); ?>" size="8" /> <?php _e( '/ day', 'mycred' ); ?></div>
  360.         <span class="description"><?php echo $limit_description; ?></span>
  361.     </li>
  362. </ol>
  363.  
  364. <?php
  365.         }
  366.     }
  367. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement