Changeset 1833370
- Timestamp:
- 03/05/2018 02:27:54 AM (8 years ago)
- Location:
- social-articles/trunk
- Files:
-
- 7 edited
-
includes/admin/assets/css/sa-admin-settings.css (modified) (1 diff)
-
includes/admin/social-articles-options.php (modified) (1 diff)
-
includes/admin/tabs/social-articles-general-settings.php (modified) (2 diffs)
-
includes/social-articles-functions.php (modified) (1 diff)
-
includes/social-articles-load.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
social-articles.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
social-articles/trunk/includes/admin/assets/css/sa-admin-settings.css
r1821721 r1833370 627 627 opacity: .6; 628 628 } 629 630 631 #addons-tab{ 632 float:right; 633 } -
social-articles/trunk/includes/admin/social-articles-options.php
r1821721 r1833370 21 21 $options['allow_author_adition'] = isset($_POST['allow_author_adition']) ? $_POST['allow_author_adition'] : ''; 22 22 $options['allow_author_deletion'] = isset($_POST['allow_author_deletion']) ? $_POST['allow_author_deletion'] : ''; 23 $options['show_to_logged_out_users'] = isset($_POST['show_to_logged_out_users']) ? $_POST['show_to_logged_out_users'] : ''; 23 24 24 25 $options = apply_filters('saf_save_extra_settings',$options); //followers 25 26 $options = apply_filters('sa_save_extra_settings',$options); //toolbox 26 27 27 28 update_option('social_articles_options', $options); 28 29 -
social-articles/trunk/includes/admin/tabs/social-articles-general-settings.php
r1821721 r1833370 15 15 $status = ""; 16 16 $msg = ""; 17 if(!function_exists("friends_get_friend_user_ids") ){17 if(!function_exists("friends_get_friend_user_ids") || !function_exists('bp_notifications_add_notification')){ 18 18 $status="disabled"; 19 $msg=__("To use this feature, you need to activate bb Friend Connections module.", "social-articles");19 $msg=__("To use this feature, you need to activate BP Friend Connections module and Notifications module.", "social-articles"); 20 20 } 21 21 … … 54 54 ); 55 55 56 $rows[] = array( 57 'id' => 'show_to_logged_out_users', 58 'label' => __('Show articles in logged out users profile','social-articles'), 59 'content' => $socialArticles->select( 'show_to_logged_out_users', array( 60 'false' => __('False', 'social-articles'), 61 'true' => __('True', 'social-articles'), 62 ), false 63 ), 64 ); 65 56 66 $rows = apply_filters('sa_add_extra_settings',$rows,$socialArticles); 57 67 -
social-articles/trunk/includes/social-articles-functions.php
r1821721 r1833370 64 64 global $bp, $socialArticles; 65 65 66 $savedPost = get_post($id); 67 $notification_already_sent = get_post_meta($id, 'notification_already_sent', true); 68 if(empty($notification_already_sent) && 69 $savedPost->post_status == "publish" && 70 $savedPost->post_type=="post" && 71 !wp_is_post_revision($id)): 72 73 $friends = array(); 74 if (function_exists("friends_get_friend_user_ids") && 75 $socialArticles->options['bp_notifications'] == "true"){ 76 $friends = friends_get_friend_user_ids($savedPost->post_author); 77 } 78 79 $friends = apply_filters('saf_add_extra_friends', $friends, $savedPost->post_author, $socialArticles); 80 81 foreach($friends as $friend): 82 bp_notifications_add_notification(array( 83 'user_id' => $friend, 84 'item_id' => $savedPost->ID, 85 'secondary_item_id' => $savedPost->post_author, 86 'component_name' => $bp->social_articles->id, 87 'component_action' => 'new_article'.$savedPost->ID, 88 'date_notified' => bp_core_current_time(), 89 'is_new' => 1, 90 'allow_duplicate' => false, 91 )); 92 endforeach; 93 94 if(!isDirectWorkflow()) { 95 bp_notifications_add_notification(array( 96 'user_id' => $savedPost->post_author, 97 'item_id' => $savedPost->ID, 98 'secondary_item_id' => -1, 99 'component_name' => $bp->social_articles->id, 100 'component_action' => 'new_article' . $savedPost->ID, 101 'date_notified' => bp_core_current_time(), 102 'is_new' => 1, 103 'allow_duplicate' => false, 104 )); 105 } 106 update_post_meta($id, 'notification_already_sent', true); 107 108 endif; 66 if(function_exists('bp_notifications_add_notification')) { 67 $savedPost = get_post($id); 68 $notification_already_sent = get_post_meta($id, 'notification_already_sent', true); 69 if (empty($notification_already_sent) && 70 $savedPost->post_status == "publish" && 71 $savedPost->post_type == "post" && 72 !wp_is_post_revision($id) 73 ): 74 75 $friends = array(); 76 if (function_exists("friends_get_friend_user_ids") && 77 $socialArticles->options['bp_notifications'] == "true" 78 ) { 79 $friends = friends_get_friend_user_ids($savedPost->post_author); 80 } 81 82 $friends = apply_filters('saf_add_extra_friends', $friends, $savedPost->post_author, $socialArticles); 83 84 foreach ($friends as $friend): 85 bp_notifications_add_notification(array( 86 'user_id' => $friend, 87 'item_id' => $savedPost->ID, 88 'secondary_item_id' => $savedPost->post_author, 89 'component_name' => $bp->social_articles->id, 90 'component_action' => 'new_article' . $savedPost->ID, 91 'date_notified' => bp_core_current_time(), 92 'is_new' => 1, 93 'allow_duplicate' => false, 94 )); 95 endforeach; 96 97 if (!isDirectWorkflow()) { 98 bp_notifications_add_notification(array( 99 'user_id' => $savedPost->post_author, 100 'item_id' => $savedPost->ID, 101 'secondary_item_id' => -1, 102 'component_name' => $bp->social_articles->id, 103 'component_action' => 'new_article' . $savedPost->ID, 104 'date_notified' => bp_core_current_time(), 105 'is_new' => 1, 106 'allow_duplicate' => false, 107 )); 108 } 109 update_post_meta($id, 'notification_already_sent', true); 110 111 endif; 112 } 109 113 } 110 114 -
social-articles/trunk/includes/social-articles-load.php
r1821721 r1833370 70 70 71 71 $user_id = bp_is_user() ? bp_displayed_user_id() : bp_loggedin_user_id(); 72 $publishCount = ''; 73 $pendingCount = ''; 74 $draftCount = ''; 72 75 73 76 if(bp_displayed_user_id()==bp_loggedin_user_id()){ 74 75 $publishCount = '';76 $pendingCount = '';77 $draftCount = '';78 79 77 $sub_nav[] = array( 80 78 'name' => sprintf( __("Published", "social-articles").'<span>%s</span>', $publishCount), … … 113 111 'position' => 40 114 112 ); 113 }else { 114 if ($options['show_to_logged_out_users'] == 'true'){ 115 $sub_nav[] = array( 116 'name' => '', 117 'slug' => 'articles', 118 'parent_url' => $social_articles_link, 119 'parent_slug' => SA_SLUG, 120 'screen_function' => 'my_articles_screen', 121 'position' => 10 122 ); 123 } 115 124 } 116 125 if($this->check_visibility()){ 117 126 parent::setup_nav( $main_nav, $sub_nav ); 127 }else{ 128 if ($options['show_to_logged_out_users'] == 'true') { 129 parent::setup_nav($main_nav, $sub_nav); 130 } 118 131 } 119 132 } … … 150 163 $wp_admin_nav[] = array( 151 164 'parent' => 'my-account-social-articles', 165 'id'=>'article-new-item', 152 166 'title' => sprintf( __( 'New Article', 'social-articles' )), 153 167 'href' => trailingslashit( $user_domain.'articles/new' ) -
social-articles/trunk/readme.txt
r1821759 r1833370 6 6 Tested up to: 4.9.4 7 7 Requires PHP: 5.6 8 Stable tag: 2. 68 Stable tag: 2.7 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 75 75 76 76 == Changelog == 77 78 = 2.7 = 79 * New option to show articles in not logged in users profile 80 * Bug Fixing: Check that notification module is active 81 * Bug Fixing: Clean some debug errors 77 82 78 83 = 2.6 = -
social-articles/trunk/social-articles.php
r1821721 r1833370 3 3 Plugin Name: Social Articles 4 4 Description: This is the first BuddyPress plugin that let you to create and manage posts from your profile. It supports all buddypres themes, so you don't need to be an expert to use it! 5 Version: 2. 65 Version: 2.7 6 6 Author: Broobe 7 7 Author URI: http://www.broobe.com … … 78 78 spl_autoload_register('sa_fields_autoload'); 79 79 80 define('SA_PLUGIN_VERSION', '2. 5');80 define('SA_PLUGIN_VERSION', '2.7'); 81 81 define('SA_PLUGIN_DIR', dirname(__FILE__)); 82 82 define('SA_SLUG', 'articles'); … … 135 135 $options['published_post_counter'] = 'true'; 136 136 137 if (!isset($options['show_to_logged_out_users'])) 138 $options['show_to_logged_out_users'] = 'true'; 139 140 137 141 update_option('social_articles_options', $options); 138 142 }
Note: See TracChangeset
for help on using the changeset viewer.