/**
 * bp_like_post_to_stream()
 * 
 * Posts to stream, depending on settings
 * 
 * TODO, Should we be posted that people like comments to the feed? This can get messy..
 * Also no point having 20 posts saying people liked the same status..
 * 
 */
function bp_like_post_to_stream($item_id, $user_id)
{
    if (bp_like_get_settings('post_to_activity_stream') == 1) {
        $activity = bp_activity_get_specific(array('activity_ids' => $item_id, 'component' => 'buddypress-like'));
        $author_id = $activity['activities'][0]->user_id;
        if ($user_id == $author_id) {
            $action = bp_like_get_text('record_activity_likes_own');
        } elseif ($user_id == 0) {
            $action = bp_like_get_text('record_activity_likes_an');
        } else {
            $action = bp_like_get_text('record_activity_likes_users');
        }
        $liker = bp_core_get_userlink($user_id);
        $author = bp_core_get_userlink($author_id);
        $activity_url = bp_activity_get_permalink($item_id);
        $content = '';
        //content must be defined...
        /* Grab the content and make it into an excerpt of 140 chars if we're allowed */
        if (bp_like_get_settings('show_excerpt') == 1) {
            $content = $activity['activities'][0]->content;
            if (strlen($content) > bp_like_get_settings('excerpt_length')) {
                $content = substr($content, 0, bp_like_get_settings('excerpt_length'));
                $content = strip_tags($content);
                $content = $content . '...';
            }
        }
        /* Filter out the placeholders */
        $action = str_replace('%user%', $liker, $action);
        $action = str_replace('%permalink%', $activity_url, $action);
        $action = str_replace('%author%', $author, $action);
        bp_activity_add(array('action' => $action, 'content' => $content, 'primary_link' => $activity_url, 'component' => 'bp-like', 'type' => 'activity_liked', 'user_id' => $user_id, 'item_id' => $item_id));
    }
}
Esempio n. 2
0
/**
 * bp_like_insert_head()
 *
 * Includes JavaScript variables needed in the <head>.
 *
 */
function bp_like_insert_head()
{
    // Only load if the user is logged in and if they aren't in the dashboard
    if (!is_user_logged_in() && !is_admin()) {
        return;
    }
    ?>
	
    <script type="text/javascript">
        /* <![CDATA[ */
        var bp_like_terms_like = '<?php 
    echo bp_like_get_text('like');
    ?>
';
        var bp_like_terms_like_message = '<?php 
    echo bp_like_get_text('like_this_item');
    ?>
';
        var bp_like_terms_unlike_message = '<?php 
    echo bp_like_get_text('unlike_this_item');
    ?>
';
        var bp_like_terms_view_likes = '<?php 
    echo bp_like_get_text('view_likes');
    ?>
';
        var bp_like_terms_hide_likes = '<?php 
    echo bp_like_get_text('hide_likes');
    ?>
';
        var bp_like_terms_unlike_1 = '<?php 
    echo bp_like_get_text('unlike');
    ?>
 (1)';
        /* ]]> */


    <?php 
    if (bp_like_get_settings('remove_fav_button') == 1) {
        ?>
            jQuery(document).ready(function($) {

                jQuery(".fav").remove();
                jQuery(".unfav").remove();
            });
    <?php 
    }
    ?>
    </script>
    <?php 
}
Esempio n. 3
0
/**
 * bp_like_insert_head()
 *
 * Includes JavaScript variables needed in the <head>.
 *
 */
function bp_like_insert_head()
{
    ?>
	
    <script type="text/javascript">
        /* <![CDATA[ */
        var bp_like_terms_like = '<?php 
    echo bp_like_get_text('like');
    ?>
';
        var bp_like_terms_like_message = '<?php 
    echo bp_like_get_text('like_this_item');
    ?>
';
        var bp_like_terms_unlike_message = '<?php 
    echo bp_like_get_text('unlike_this_item');
    ?>
';
        var bp_like_terms_view_likes = '<?php 
    echo bp_like_get_text('view_likes');
    ?>
';
        var bp_like_terms_hide_likes = '<?php 
    echo bp_like_get_text('hide_likes');
    ?>
';
        var bp_like_terms_unlike_1 = '<?php 
    echo bp_like_get_text('unlike');
    ?>
 (1)';
        /* ]]> */


    <?php 
    if (bp_like_get_settings('remove_fav_button') == 1) {
        ?>
            jQuery(document).ready(function($) {

                jQuery(".fav").remove();
                jQuery(".unfav").remove();
            });
    <?php 
    }
    ?>
    </script>
    <?php 
}
/**
 * bp_like_get_likes()
 *
 * Outputs a list of users who have liked a given item.
 *
 */
function bp_like_get_likes($item_id = '', $type = '', $user_id = '')
{
    global $bp;
    if (!$type || !$item_id) {
        return false;
    }
    if (!$user_id) {
        $user_id = $bp->loggedin_user->id;
    }
    if ($type == 'activity') {
        /* Grab some core data we will need later on, specific to activities */
        $users_who_like = array_keys(bp_activity_get_meta($item_id, 'liked_count'));
        $liked_count = count(bp_activity_get_meta($item_id, 'liked_count'));
        $output = '';
        /* Intercept any messages if nobody likes it, just incase the button was clicked when it shouldn't be */
        if ($liked_count == 0) {
            $output .= bp_like_get_text('get_likes_no_likes');
        } elseif (bp_like_get_settings('likers_visibility') == 'show_all') {
            /* Settings say we should show their name. */
            if (bp_like_get_settings('name_or_avatar') == 'name') {
                /* Current user likes it too, remove them from the liked count and output appropriate message */
                if (bp_like_is_liked($item_id, 'activity', $user_id)) {
                    // remove current user from liked count.
                    $liked_count = $liked_count - 1;
                    if ($liked_count == 1) {
                        //only current user and 1 other person likes this.
                        $output .= bp_like_get_text('get_likes_you_and_singular');
                        $other = $users_who_like[count($users_who_like)];
                        $output .= 'You and ' . bp_core_get_userlink($other) . ' liked this.';
                    } elseif ($liked_count == 0) {
                        //current user is the only person to like this.
                        $output .= bp_like_get_text('get_likes_only_liker');
                    } else {
                        $output .= bp_like_get_text('get_likes_you_and_plural');
                    }
                } else {
                    if ($liked_count == 1) {
                        $output .= bp_like_get_text('get_likes_count_people_singular');
                    } else {
                        $output .= bp_like_get_text('get_likes_count_people_plural');
                    }
                }
                /* Now output the name of each person who has liked it (except the current user obviously) */
                foreach ($users_who_like as $id) {
                    if ($id != $user_id) {
                        $output .= ' &middot <a href="' . bp_core_get_user_domain($id) . '" title="' . bp_core_get_user_displayname($id) . '">' . bp_core_get_user_displayname($id) . '</a>';
                    }
                }
            } elseif (bp_like_get_settings('name_or_avatar') == 'avatar') {
                /* Output the avatar of each person who has liked it. */
                foreach ($users_who_like as $id) {
                    $output .= '<a href="' . bp_core_get_user_domain($id) . '" title="' . bp_core_get_user_displayname($id) . '">' . bp_core_fetch_avatar(array('item_id' => $id, 'object' => 'user', 'type' => 'thumb', 'width' => 30, 'height' => 30)) . '</a> ';
                }
            }
        } elseif (bp_like_get_settings('likers_visibility') == 'friends_names_others_numbers' && bp_is_active('friends')) {
            /* Grab some information about their friends. */
            $users_friends = friends_get_friend_user_ids($user_id);
            if (!empty($users_friends)) {
                $friends_who_like = array_intersect($users_who_like, $users_friends);
            }
            /* Current user likes it, so reduce the liked count by 1, to get the number of other people who like it. */
            if (bp_like_is_liked($item_id, 'activity', $user_id)) {
                $liked_count = $liked_count - 1;
            }
            /* Settings say we should show their names. */
            if (bp_like_get_settings('name_or_avatar') == 'name') {
                /* Current user likes it too, tell them. */
                if (bp_like_is_liked($item_id, 'activity', $user_id)) {
                    $output .= 'You ';
                }
                /* Output the name of each friend who has liked it. */
                foreach ($users_who_like as $id) {
                    if (in_array($id, $friends_who_like)) {
                        //$output .= ' &middot <a href="' . bp_core_get_user_domain( $id ) . '" title="' . bp_core_get_user_displayname( $id ) . '">' . bp_core_get_user_displayname( $id ) . '</a> ';
                        $output .= bp_core_get_userlink($id);
                        $liked_count = $liked_count - 1;
                    }
                }
                /* If non-friends like it, say so. */
                if ($liked_count == 1) {
                    $output .= bp_like_get_text('get_likes_and_people_singular');
                } elseif ($liked_count > 1) {
                    $output .= bp_like_get_text('get_likes_and_people_plural');
                } else {
                    $output .= bp_like_get_text('get_likes_like_this');
                }
            } elseif (bp_like_get_settings('name_or_avatar') == 'avatar') {
                /* Output the avatar of each friend who has liked it, as well as the current users' if they have. */
                if (!empty($friends_who_like)) {
                    foreach ($users_who_like as $id) {
                        if ($id == $user_id || in_array($id, $friends_who_like)) {
                            $user_info = get_userdata($id);
                            $output .= '<a href="' . bp_core_get_user_domain($id) . '" title="' . bp_core_get_user_displayname($id) . '">' . get_avatar($user_info->user_email, 30) . '</a> ';
                        }
                    }
                }
            } elseif (bp_like_get_settings('likers_visibility') == 'friends_names_others_numbers' && !bp_is_active('friends') || bp_like_get_settings('likers_visibility') == 'just_numbers') {
                /* Current user likes it too, remove them from the liked count and output appropriate message */
                if (bp_like_is_liked($item_id, 'activity', $user_id)) {
                    $liked_count = $liked_count - 1;
                    if ($liked_count == 1) {
                        $output .= bp_like_get_text('get_likes_you_and_singular');
                    } elseif ($liked_count == 0) {
                        $output .= bp_like_get_text('get_likes_only_liker');
                    } else {
                        $output .= bp_like_get_text('get_likes_you_and_plural');
                    }
                } else {
                    if ($liked_count == 1) {
                        $output .= bp_like_get_text('get_likes_count_people_singular');
                    } else {
                        $output .= bp_like_get_text('get_likes_count_people_plural');
                    }
                }
            }
        }
    }
    /* Filter out the placeholder. */
    $output = str_replace('%count%', $liked_count, $output);
    echo $output;
}
Esempio n. 5
0
/**
 * bp_like_admin_page()
 *
 * Outputs the admin settings page.
 *
 */
function bp_like_admin_page()
{
    global $current_user;
    wp_get_current_user();
    /* Update our options if the form has been submitted */
    if (isset($_POST['_wpnonce']) && isset($_POST['bp_like_updated'])) {
        /* Add each text string to the $strings_to_save array */
        foreach ($_POST as $key => $value) {
            if (preg_match("/text_string_/i", $key)) {
                $default = bp_like_get_text(str_replace('bp_like_admin_text_string_', '', $key), 'default');
                $strings_to_save[str_replace('bp_like_admin_text_string_', '', $key)] = array('default' => $default, 'custom' => stripslashes($value));
            }
        }
        /* Now actually save the data to the options table */
        update_site_option('bp_like_settings', array('likers_visibility' => $_POST['bp_like_admin_likers_visibility'], 'post_to_activity_stream' => $_POST['bp_like_admin_post_to_activity_stream'], 'show_excerpt' => $_POST['bp_like_admin_show_excerpt'], 'excerpt_length' => $_POST['bp_like_admin_excerpt_length'], 'text_strings' => $strings_to_save, 'translate_nag' => bp_like_get_settings('translate_nag'), 'name_or_avatar' => $_POST['name_or_avatar'], 'remove_fav_button' => $_POST['bp_like_remove_fav_button']));
        /* Let the user know everything's cool */
        echo '<div class="updated"><p><strong>';
        _e('Settings saved.', 'wordpress');
        echo '</strong></p></div>';
    }
    $text_strings = bp_like_get_settings('text_strings');
    $title = __('BuddyPress Like');
    ?>
    <style type="text/css">
        table input { width: 100%; }
        table label { display: block; }
    </style>
    <script type="text/javascript">
        jQuery(document).ready(function() {
            jQuery('select.name-or-avatar').change(function() {
                var value = jQuery(this).val();
                jQuery('select.name-or-avatar').val(value);
            });
        });
    </script>

    <div class="wrap">
        <h1><?php 
    echo esc_html($title);
    ?>
</h1>
        <form action="" method="post">
            <input type="hidden" name="bp_like_updated" value="updated">

            <table class="form-table" id="bp-like-admin" style="max-width:650px;float:left;">
                <tr valign="top">
                    <th scope="row"><?php 
    _e('Posting Settings', 'buddypress-like');
    ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text">
                                <span><?php 
    _e('Posting Settings', 'buddypress-like');
    ?>
</span>
                            </legend>
                            <input type="checkbox" id="bp_like_admin_post_to_activity_stream" name="bp_like_admin_post_to_activity_stream" value="1"<?php 
    if (bp_like_get_settings('post_to_activity_stream') == 1) {
        echo ' checked="checked"';
    }
    ?>
>
                            <label for="bp_like_admin_post_activity_updates">
                                <?php 
    _e("Post an activity update when something is liked", 'buddypress-like');
    ?>
                            </label>
                            <p class="description"><?php 
    echo __('e.g. ') . $current_user->display_name . __(" liked Darren's activity. ");
    ?>
</p>
                            <br />

                            <input type="checkbox" id="bp_like_admin_show_excerpt" name="bp_like_admin_show_excerpt" value="1"<?php 
    if (bp_like_get_settings('show_excerpt') == 1) {
        echo ' checked="checked"';
    }
    ?>
>
                            <label for="bp_like_admin_show_excerpt"><?php 
    _e("Show a short excerpt of the activity that has been liked.", 'buddypress-like');
    ?>
</label>
                            <p>Limit to <input type="text" maxlength="3" style="width: 40px" value="<?php 
    echo bp_like_get_settings('excerpt_length');
    ?>
" name="bp_like_admin_excerpt_length" /> characters.</p>

                        </fieldset>
                    </td>
                </tr>


                <tr valign="top">
                    <th scope="row"><?php 
    _e('Remove Favorite Button', 'buddypress-like');
    ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text">
                                <span><?php 
    _e('Remove Favorite Button', 'buddypress-like');
    ?>
</span>
                            </legend>
                            <input type="checkbox" id="bp_like_remove_fav_button" name="bp_like_remove_fav_button" value="1" <?php 
    if (bp_like_get_settings('remove_fav_button') == 1) {
        echo ' checked="checked" ';
    }
    ?>
>
                            <label for="bp_like_remove_fav_button">
                                <?php 
    _e("Remove the BuddyPress favorite button from activity.", 'buddypress-like');
    ?>
                            </label>
                            <p class="description"><?php 
    echo __(" Currently only uses jQuery to remove the buttons.", "buddypress-like");
    ?>
</p>
                            <br />
                        </fieldset>
                    </td>
                </tr>
            </table>

            <div id="bplike-about" style="float:right; background:#fff;max-width:300px;padding:20px;margin-bottom:30px;">
                <h3>About</h3>
                <p><strong>Version: <?php 
    echo BP_LIKE_VERSION;
    ?>
</strong></p>
                <div class="inside">

                    <p>Gives users the ability to 'like' content across your BuddyPress enabled site.</p>

                    <p>Available for free on <a href="http://wordpress.org/plugins/buddypress-like/">WordPress.org</a>.</p>

                    <h4>Want to help?</h4>
                    <ul>
                        <li><a href="https://wordpress.org/support/view/plugin-reviews/buddypress-like?filter=5">Give 5 stars on WordPress.org</a></li>
                        <li>Development takes place publicly on <a href="https://github.com/Darrenmeehan/BuddyPress-Like">Github</a>. Is there any issues or bugs you have?</li>
                        <li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZAJLLEJDBHAWL"><strong>Donate</strong></a></li>
                    </ul>

                    <h4>Need help?</h4>
                    <ul><li>Ask on the <a href="http://wordpress.org/support/plugin/buddypress-like">WordPress.org forum</a></li></ul>

                </div>
            </div>


            <table class="form-table">
                <tr valign="top">
                    <th scope="row"><?php 
    _e('Custom Messages', 'buddypress-like');
    ?>
</th>
                    <td>
                        <fieldset>
                            <legend class="screen-reader-text">
                                <span><?php 
    _e('Custom Messages', 'buddypress-like');
    ?>
</span>
                            </legend>
                            <label for="bp_like_admin_post_activity_updates">
    <?php 
    _e("Change what messages are shown to users. For example, they can 'love' or 'dig' items instead of liking them.", "buddypress-like");
    ?>
                            </label>
                        </fieldset>
                    </td>
                </tr>
            </table>
            <table class="widefat fixed" cellspacing="0">
                <thead>
                    <tr>
                        <th scope="col" id="default" class="column-name" style="width: 43%;"><?php 
    _e('Default', 'buddypress-like');
    ?>
</th>
                        <th scope="col" id="custom" class="column-name" style=""><?php 
    _e('Custom', 'buddypress-like');
    ?>
</th>
                    </tr>
                </thead>
                <tfoot>
                    <tr>
                        <th colspan="2" id="default" class="column-name"></th>
                    </tr>
                </tfoot>

    <?php 
    foreach ($text_strings as $key => $string) {
        ?>
                    <tr valign="top">
                        <th scope="row" style="width:400px;"><label for="bp_like_admin_text_string_<?php 
        echo $key;
        ?>
"><?php 
        echo htmlspecialchars($string['default']);
        ?>
</label></th>
                        <td><input name="bp_like_admin_text_string_<?php 
        echo $key;
        ?>
" id="bp_like_admin_text_string_<?php 
        echo $key;
        ?>
" value="<?php 
        echo htmlspecialchars($string['custom']);
        ?>
" class="regular-text" type="text"></td>
                    </tr>
    <?php 
    }
    ?>
                </tbody>
            </table>

            <p class="submit">
                <input class="button-primary" type="submit" name="bp-like-admin-submit" id="bp-like-admin-submit" value="<?php 
    _e('Save Changes', 'wordpress');
    ?>
"/>
            </p>
    <?php 
    wp_nonce_field('bp-like-admin');
    ?>
        </form>
    </div>
    <?php 
}
Esempio n. 6
0
/**
 * bp_like_admin_page()
 *
 * Outputs the admin settings page.
 *
 */
function bp_like_admin_page()
{
    global $current_user;
    wp_get_current_user();
    /* Update our options if the form has been submitted */
    if (isset($_POST['_wpnonce']) && isset($_POST['bp_like_updated'])) {
        /* Add each text string to the $strings_to_save array */
        foreach ($_POST as $key => $value) {
            if (preg_match("/text_string_/i", $key)) {
                $default = bp_like_get_text(str_replace('bp_like_admin_text_string_', '', $key), 'default');
                $strings_to_save[str_replace('bp_like_admin_text_string_', '', $key)] = array('default' => $default, 'custom' => stripslashes($value));
            }
        }
        /* Now actually save the data to the options table */
        update_site_option('bp_like_settings', array('likers_visibility' => $_POST['bp_like_admin_likers_visibility'], 'post_to_activity_stream' => $_POST['bp_like_admin_post_to_activity_stream'], 'show_excerpt' => $_POST['bp_like_admin_show_excerpt'], 'excerpt_length' => $_POST['bp_like_admin_excerpt_length'], 'text_strings' => $strings_to_save, 'translate_nag' => bp_like_get_settings('translate_nag'), 'name_or_avatar' => $_POST['name_or_avatar']));
        /* Let the user know everything's cool */
        echo '<div class="updated"><p><strong>';
        _e('Settings saved.', 'wordpress');
        echo '</strong></p></div>';
    }
    $text_strings = bp_like_get_settings('text_strings');
    ?>
<style type="text/css">
#icon-bp-like-settings { background: url('<?php 
    echo plugins_url('/_inc/img/bp-like-icon32.png', __FILE__);
    ?>
') no-repeat top left; }
table input { width: 100%; }
table label { display: block; }
</style>
<script type="text/javascript">
jQuery(document).ready( function() {
	jQuery('select.name-or-avatar').change(function(){
		var value = jQuery(this).val();
		jQuery('select.name-or-avatar').val(value);
	});
});
</script>

<div class="wrap">
  <div id="icon-bp-like-settings" class="icon32"><br /></div>
  <h2><?php 
    _e('BuddyPress Like Settings', 'buddypress-like');
    ?>
</h2>
  <form action="" method="post" id="bp-like-admin-form">
    <input type="hidden" name="bp_like_updated" value="updated">
    
    <h3><?php 
    _e('General Settings', 'buddypress-like');
    ?>
</h3>
    <p><input type="checkbox" id="bp_like_admin_post_to_activity_stream" name="bp_like_admin_post_to_activity_stream" value="1"<?php 
    if (bp_like_get_settings('post_to_activity_stream') == 1) {
        echo ' checked="checked"';
    }
    ?>
> <label for="bp_like_admin_post_activity_updates"><?php 
    _e("Post an activity update when something is liked", 'buddypress-like');
    ?>
, (e.g. "<?php 
    echo $current_user->display_name;
    ?>
 likes Bob's activity")</label></p>
    <p><input type="checkbox" id="bp_like_admin_show_excerpt" name="bp_like_admin_show_excerpt" value="1"<?php 
    if (bp_like_get_settings('show_excerpt') == 1) {
        echo ' checked="checked"';
    }
    ?>
> <label for="bp_like_admin_show_excerpt"><?php 
    _e("Show a short excerpt of the activity that has been liked", 'buddypress-like');
    ?>
</label>; limit to <input type="text" maxlength="3" style="width: 40px" value="<?php 
    echo bp_like_get_settings('excerpt_length');
    ?>
" name="bp_like_admin_excerpt_length" /> characters.</p>
    
    <h3><?php 
    _e("'View Likes' Visibility", "buddypress-like");
    ?>
</h3>
    <p><?php 
    _e("Choose how much information about the 'likers' of a particular item is shown;", "buddypress-like");
    ?>
</p>
    <p style="line-height: 200%;">
      <input type="radio" name="bp_like_admin_likers_visibility" value="show_all"<?php 
    if (bp_like_get_settings('likers_visibility') == 'show_all') {
        echo ' checked="checked""';
    }
    ?>
 /> Show <select name="name_or_avatar" class="name-or-avatar"><option value="name"<?php 
    if (bp_like_get_settings('name_or_avatar') == 'name') {
        echo ' selected="selected""';
    }
    ?>
>names</option><option value="avatar"<?php 
    if (bp_like_get_settings('name_or_avatar') == 'avatar') {
        echo ' selected="selected""';
    }
    ?>
>avatars</option></select> of all likers<br />
      <?php 
    if (bp_is_active('friends')) {
        ?>
      <input type="radio" name="bp_like_admin_likers_visibility" value="friends_names_others_numbers"<?php 
        if (bp_like_get_settings('likers_visibility') == 'friends_names_others_numbers') {
            echo ' checked="checked""';
        }
        ?>
 /> Show <select name="name_or_avatar" class="name-or-avatar"><option value="name"<?php 
        if (bp_like_get_settings('name_or_avatar') == 'name') {
            echo ' selected="selected""';
        }
        ?>
>names</option><option value="avatar"<?php 
        if (bp_like_get_settings('name_or_avatar') == 'avatar') {
            echo ' selected="selected""';
        }
        ?>
>avatars</option></select> of friends, and the number of non-friends<br />
      <?php 
    }
    ?>
      <input type="radio" name="bp_like_admin_likers_visibility" value="just_numbers"<?php 
    if (bp_like_get_settings('likers_visibility') == 'just_numbers') {
        echo ' checked="checked""';
    }
    ?>
 /> <?php 
    _e('Show only the number of likers', 'buddypress-like');
    ?>
    </p>
    <h3><?php 
    _e('Custom Messages', 'buddypress-like');
    ?>
</h3>
    <p><?php 
    _e("Change what messages are shown to users. For example, they can 'love' or 'dig' items instead of liking them.", "buddypress-like");
    ?>
<br /><br /></p>
    
    <table class="widefat fixed" cellspacing="0">
	  <thead>
	    <tr>
	      <th scope="col" id="default" class="column-name" style="width: 43%;"><?php 
    _e('Default', 'buddypress-like');
    ?>
</th>
	      <th scope="col" id="custom" class="column-name" style=""><?php 
    _e('Custom', 'buddypress-like');
    ?>
</th>
	    </tr>
	  </thead>
	  <tfoot>
	    <tr>
	      <th colspan="2" id="default" class="column-name"></th>
	    </tr>
	  </tfoot>

      <?php 
    foreach ($text_strings as $key => $string) {
        ?>
      <tr valign="top">
          <th scope="row" style="width:400px;"><label for="bp_like_admin_text_string_<?php 
        echo $key;
        ?>
"><?php 
        echo htmlspecialchars($string['default']);
        ?>
</label></th>
          <td><input name="bp_like_admin_text_string_<?php 
        echo $key;
        ?>
" id="bp_like_admin_text_string_<?php 
        echo $key;
        ?>
" value="<?php 
        echo htmlspecialchars($string['custom']);
        ?>
" class="regular-text" type="text"></td>
        </tr>
      <?php 
    }
    ?>
      </tbody>
    </table>
	
    <p class="submit">
      <input class="button-primary" type="submit" name="bp-like-admin-submit" id="bp-like-admin-submit" value="<?php 
    _e('Save Changes', 'wordpress');
    ?>
"/>
    </p>
    <?php 
    wp_nonce_field('bp-like-admin');
    ?>
  </form>
</div>
<?php 
}