Skip to content

Commit

Permalink
Merge pull request #9 from GeoDirectory/master
Browse files Browse the repository at this point in the history
Merge Geodirectory master
  • Loading branch information
viruthagiri committed Mar 10, 2016
2 parents a9cf8ac + 6c24e66 commit 66d1a0a
Show file tree
Hide file tree
Showing 12 changed files with 157 additions and 71 deletions.
20 changes: 11 additions & 9 deletions bp-compliments.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Plugin Name: BuddyPress Compliments
Plugin URI: http://wpgeodirectory.com/
Description: Compliments module for BuddyPress.
Version: 1.0.1
Version: 1.0.4
Author: GeoDirectory
Author URI: http://wpgeodirectory.com
*/
Expand All @@ -19,7 +19,7 @@
if ( !defined( 'ABSPATH' ) ) exit;

// Define the plugin version.
define( 'BP_COMPLIMENTS_VER', '1.0.1' );
define( 'BP_COMPLIMENTS_VER', '1.0.4' );

/**
* BuddyPress compliments text domain.
Expand Down Expand Up @@ -68,12 +68,8 @@ function bp_compliments_init() {

// show admin notice for users on BP 1.2.x
} else {
$older_version_notice = __( "Hey! BP Compliments requires BuddyPress 1.5 or higher.", 'bp-compliments' );

add_action( 'admin_notices', create_function( '', "
echo '<div class=\"error\"><p>' . $older_version_notice . '</p></div>';
" ) );

add_action( 'admin_notices', 'bp_compliments_older_version_notice' );

return;
}
}
Expand Down Expand Up @@ -105,7 +101,7 @@ function bp_compliments_activate() {
*/
$table_prefix = apply_filters( 'bp_core_get_table_prefix', $wpdb->base_prefix );

$sql[] = "CREATE TABLE IF NOT EXISTS {$table_prefix}bp_compliments (
$sql = "CREATE TABLE {$table_prefix}bp_compliments (
id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
term_id int(10) NOT NULL,
post_id int(10) NULL DEFAULT NULL,
Expand Down Expand Up @@ -154,3 +150,9 @@ function bp_compliments_required_plugins_nag() {
echo"<div class=\"$class\"> <p>$message</p></div>";
}
}

function bp_compliments_older_version_notice() {
$older_version_notice = __( "Hey! BP Compliments requires BuddyPress 1.5 or higher.", 'bp-compliments' );

echo '<div class="error"><p>' . $older_version_notice . '</p></div>';
}
2 changes: 1 addition & 1 deletion change_log.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
v1.0.2
v1.0.4
Compliment user settings page - ADDED
Linebreaks are removed on compliment messages - FIXED
Compliments message links are clickable - ADDED
Expand Down
2 changes: 2 additions & 0 deletions css/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
# Silence is golden.
2 changes: 2 additions & 0 deletions images/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
# Silence is golden.
11 changes: 11 additions & 0 deletions includes/bp-compliments-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@ function bp_compliments_remove_data( $user_id ) {
*/
do_action( 'bp_compliments_after_remove_data', $user_id );
}

/**
* Inject buddypress compliments content into BP.
*
* @since 0.0.1
* @package BuddyPress_Compliments
*/
function bp_compliments_single_compliments_content() {
bp_get_template_part( 'members/single/compliments' ); // note the new template name for our template part.
}

add_action( 'wpmu_delete_user', 'bp_compliments_remove_data' );
add_action( 'delete_user', 'bp_compliments_remove_data' );
add_action( 'make_spam_user', 'bp_compliments_remove_data' );
5 changes: 1 addition & 4 deletions includes/bp-compliments-screens.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ function bp_compliments_load_template_filter( $found_template, $templates ) {
$found_template = locate_template( 'members/single/plugins.php', false, false );

// add our hook to inject content into BP
// note the new template name for our template part
add_action( 'bp_template_content', create_function( '', "
bp_get_template_part( 'members/single/compliments' );
" ) );
add_action( 'bp_template_content', 'bp_compliments_single_compliments_content' );
}

/**
Expand Down
2 changes: 2 additions & 0 deletions includes/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
# Silence is golden.
2 changes: 2 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
# Silence is golden.
2 changes: 2 additions & 0 deletions js/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
# Silence is golden.
Binary file modified languages/bp-compliments-en_US.mo
Binary file not shown.
Loading

0 comments on commit 66d1a0a

Please sign in to comment.