Search Results for 'toolbar'
-
Search Results
-
Hi guys, I created a custom notification that is added when an user receive a like on a custom post type.
All good unitl now, but I noticed that if the post receive 2 likes, from 2 different users, the user receive only the first notification and not the second one.
Any help would be really appreciated.
//Component declaration if(!function_exists('my_custom_register_wiki_notification')) { function my_custom_register_wiki_notification() { // Register component manually into buddypress() singleton buddypress()->my_custom_wiki = new stdClass; // Add notification callback function buddypress()->my_custom_wiki->notification_callback = 'my_custom_wiki_like_format_notifications'; // Now register components into active components array buddypress()->active_components['my_custom_wiki'] = 1; } }; //Notification format declaration if(!function_exists('my_custom_wiki_like_format_notifications')) { function my_custom_wiki_like_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { // New custom notifications if ( 'my_custom_wiki_like' === $action ) { $wiki_post = get_post( $item_id ); $post_title = get_the_title( $item_id ); $custom_title = sprintf( esc_html__( 'Your post "%1$s" received a like', 'my_custom' ), $post_title ); $custom_text = sprintf( esc_html__( 'Your post "%1$s" received a like', 'my_custom' ), $post_title ); $custom_link = get_permalink( $item_id ); // WordPress Toolbar if ( 'string' === $format ) { $return = apply_filters( 'my_custom_wiki_like_format', '<a href="' . esc_url( $custom_link ) . '" title="' . esc_attr( $custom_title ) . '">' . esc_html( $custom_text ) . '</a>', $custom_text, $custom_link ); // Deprecated BuddyBar } else { $return = apply_filters( 'my_custom_wiki_like_format', array( 'text' => $custom_text, 'link' => $custom_link ), $custom_link, (int) $total_items, $custom_text, $custom_title ); } return $return; } return $action; } } //Function that add the notification when like is triggered function my_custom_add_like() { //... //... if(my_custom_is_wiki_like_notification_enabled()) { bp_notifications_add_notification( array( 'user_id' => $post_object->post_author, 'item_id' => $post_id, 'secondary_item_id' => get_current_user_id(), 'component_name' => 'my_custom_wiki', 'component_action' => 'my_custom_wiki_like', 'date_notified' => bp_core_current_time(), 'is_new' => 1, ) ); } }Topic: Getting bp user info
Hi all,
I’m new here. a big hello to the community!!
I’m tring to hacking an external WP plugin in order to works with buddypress.
The Plugin is WP Mobile MenuMy idea is to add some buttons in the header to this plugin, in order to make easy for the user open some useful page, like Activity, Profile an so on.
Actually Is working just fine, with this code:
$current_user = wp_get_current_user(); // Profile $output .= '<div id="toolbar-profile" onclick="location.reload();location.href=\'http://example.org/members/'; $output .= $current_user->user_login; $output .= '\'"></div>';…but…but… if the username contain a dot character, buddypress transform the dot in ‘-‘ so pressing the button above, the user obtain a 404 page… and some users of mine, are using a email address as username.
So I’m trying to modify my code so, but it doesn’t work at all.
global $bp; $userlink = get_bp_loggedinuser_link(); // Profile $output .= '<div id="toolbar-profile" onclick="location.reload();location.href=\'http://example.org/members/'; $output .= $userlink->user_login; $output .= '\'"></div>';Someone know ho to import the bp_loggedinuser_link() variable in a external WP plugin?
(it’s not a 3th part buddypress plugin)regards
MaXTopic: How to move the TOOLBAR?
What are the PHP file templates that have to
edit in moving the toolbar?hi
There was no problem with toolbar and was previously displayed. But it does not show.
I mean, from the toolbar, it is a bar for login and registration.Under certain circumstances, there is an infinite loop inside the
bp_legacy_theme_new_activity_comment()function. Specifically, when all of thesecondary_item_idfields are zero, the$parent_idwill continually be set to zero. An infinite loop ensues and eventually the script will time out. This causes new activity items to not display until the page is refreshed, as mentioned here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/.This error happens when attempting to add a comment to a group post. I believe this is a similar problem as the one expressed here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/
For information:
- WordPress
4.5.3 - BuddyPress
2.6.1.1 - Single site install in web root
- There are indeed other plugins activated on this site. The full list is below. This site is for a client, and I’m unsure of which plugins can be safely deactivated to test.
- We’re using a customized theme, but I have tested with the TwentySixteen theme and found the same results.
- The core BuddyPress files have not been modified to my knowledge.
- The site is hosted on Page.ly, but I can reproduce the problems in a local VVV install
- The live site is http://www.lifeofdad.com/
I believe that this may be a problem inside BuddyPress itself, as the function with the infinite loop is part of BuddyPress. The Javascript that makes the Ajax request is part of the BuddyPress Wall plugin, but from what I can tell the problem is in the aforementioned
bp_legacy_theme_new_activity_comment()function.My specific concern is this loop:
// Load the new activity item into the $activities_template global. bp_has_activities( 'display_comments=stream&hide_spam=false&show_hidden=true&include=' . $comment_id ); // Swap the current comment with the activity item we just loaded. if ( isset( $activities_template->activities[0] ) ) { $activities_template->activity = new stdClass(); $activities_template->activity->id = $activities_template->activities[0]->item_id; $activities_template->activity->current_comment = $activities_template->activities[0]; // Because the whole tree has not been loaded, we manually // determine depth. $depth = 1; $parent_id = (int) $activities_template->activities[0]->secondary_item_id; while ( $parent_id !== (int) $activities_template->activities[0]->item_id ) { $depth++; $p_obj = new BP_Activity_Activity( $parent_id ); $parent_id = (int) $p_obj->secondary_item_id; } $activities_template->activity->current_comment->depth = $depth; }I’ve run XDebug locally to inspect the items in the loop as it is running. If some of the raw variable data is required, I can provide that.
I have tried making some changes to the code in this loop to prevent the infinite loop from occurring. While successful in that endeavor with a few tweaks, the result is that the comment sent back through the Ajax response is the wrong comment, and a page refresh is still needed.
I considered filing a bug in Trac, but I wasn’t certain whether something else could possibly be interfering.
+--------------------------------------+--------+-----------+---------+ | name | status | update | version | +--------------------------------------+--------+-----------+---------+ | akismet | active | none | 3.1.11 | | all-in-one-seo-pack | active | available | 2.3.7 | | appbuddy | active | available | 2.0.7 | | appcamera | active | available | 2.0.0 | | appfbconnect | active | none | 2.3.0 | | apppresser | active | none | 2.5.0 | | apppush | active | available | 2.1.0 | | appshare | active | none | 2.1.0 | | appswiper | active | available | 2.2.1 | | bp-profile-search | active | none | 4.5.2 | | buddypress | active | none | 2.6.1.1 | | buddypress-activity-plus | active | none | 1.6.4 | | bp-moderation | active | none | 0.1.7 | | buddypress-nocaptcha-register-box | active | none | 1.1.3 | | buddypress-toolbar | active | none | 1.6.0 | | buddypress-wall | active | none | 0.9.4 | | buddypress-xprofile-image-field | active | none | 2.0.1 | | category-posts | active | none | 4.6.1 | | contact-form-7 | active | none | 4.4.2 | | contact-form-7-to-database-extension | active | none | 2.10.20 | | cubell-themes-functionality | active | none | 3.1 | | envato-wordpress-toolkit | active | none | 1.7.3 | | hashbuddy | active | none | 1.5.2 | | login-with-ajax | active | none | 3.1.6 | | mailchimp-for-wp | active | none | 3.1.11 | | nav-menu-roles | active | none | 1.8.2 | | nextend-facebook-connect | active | none | 1.5.9 | | buddypress-media | active | none | 4.0.4 | | vine-embed | active | none | 0.2 | | wds-lod-automatic-friends | active | none | 0.1.0 | | wds-lod-base | active | none | 0.1.0 | | wds-lod-bp | active | none | 0.1.0 | | wds-lod-post-types | active | none | 0.1.0 | | wds-lod-widgets | active | none | 0.1.0 | | wordpress-importer | active | none | 0.6.1 | +--------------------------------------+--------+-----------+---------+Hello,
I created a custom form-post.php so I could use wp_editor to customize the tinymce buttons I wanted to show. This is my code for that:
function bpfr_whats_new_tiny_editor() { // building the what's new textarea if ( isset( $_GET['r'] ) ) : $content = esc_textarea( $_GET['r'] ); endif; // adding tinymce tools $editor_id = 'whats-new'; $settings = array('textarea_name' => 'description', 'quicktags' => false, 'editor_class' => 'bp-suggestions', 'media_buttons' => false, 'teeny' => false, 'textarea_rows' => 5, 'tinymce'=> array( 'toolbar1'=> 'bold,italic,underline,strikethrough,forecolor', 'toolbar2' => 'bullist,numlist,link,unlink,undo,redo' )); // get the editor wp_editor( $content, $editor_id, $settings ); } add_action( 'whats_new_textarea', 'bpfr_whats_new_tiny_editor' );<div id="whats-new-textarea"> <?php do_action( 'whats_new_textarea' ); ?> </div>My issue is that when I click in to the textarea (which is of course in an iframe) the “post update” button does not appear as it normally should. Suggestions?
Can I have BuddyPress running at MySite.com but also seamlessly have a blog at podcast.mysite.com where logged in members can comment on podcast posts and see their profile avatar in the main toolbar?
In other words, podcast.mysite.com would recognize a user/member who is logged in at mysite.com.Much appreciated.
Robert
hello
when a member logs in the home icon redirects to the member page. if i enter the url for the home page it redirects to the member page.
Where can i fix it so that it redirects to the home page. i have a link for the members page in the toolbar.
please help….
GatorThere is a feature in WordPress that’s very useful for a blog owner who administers his/her own blog, but that same feature presented to the user who is NOT a site admin is downright malicious and exposes the site owner to a serious security risk or at least a serious and even more costly privacy risk.
BuddyPress and bbPress are both guilty of doing just that.But the interesting thing is:
The administrators of BuddyPress.org apparently do have a brain because they’ve made sure that this giant security/privacy hole is closed on this bbPress forum here.So, WHY THEN ARE THEY EXPOSING every other normal BuddyPress and bbPress user to that malicious behavior of BuddyPress and bbPress???
WHY???That’s what I wanna know.
Oh, you wanna know what’s that malicious behavior/security risk that BuddyPress and bbPress is exposing you to?
Easy!
Go to your own installation of bbPress, create a new topic/post and while creating it highlight a word and click that “insert link” button you see in the top row!
Does it ring a bell?In case you are very slow, lemme ring the bell for you here:
First, you need to open your eyes. That’s quite important.
Listening to the bell alone isn’t gonna help you.Secondly, take a look at that “Or link to existing content” thingy and explore the list that appears below!
See how it lists ALL OF YOUR PAGES including the secret thank-you pages with content that is supposed to be visible ONLY TO PEOPLE WHO HAVE PAID FOR THE PRODUCT!
As well as all of your test pages and other secret/private pages that you don’t want anyone to have access to.And in case you don’t think that’s a good idea, you are not alone.
The admins of BuddyPress.org don’t think that’s a good idea either.
That’s why on this website, on this bbPress forum here they have removed that security/privacy threat!That’s right! If you try the “insert link” feature in this forum here, you’ll immediately notice that this malicious “Or link to existing content” feature has been disabled.
It’s not suggesting any of the internal pages on BuddyPress.org here.GOOD THINKING!
And it’s good to know that at least the admins of BuddyPress.org do have a brain.Now, in a bbPress forum you could sort of “fix” this issue by making your forum extremely inconvenient for your users.
Just go to your forum settings and uncheck “Add toolbar & buttons to textareas to help with HTML formatting”.But is that something you really want to do???
Do you really want your forum appear as if was coded in 1997?
Do you really want to deprive all normal forum users of being able to format their posts?
And even users who know HTML, would they want to type HTML markup when posting in a forum?But hey, while bbPress offers at least a 1997-style kill switch to switch off that malicious behavior of bbPress, BuddyPress does NOT offer such switch at all.
So, if, for example, you have something like BuddyPress Docs installed (a very helpful plugin by the way), then you’ll find yourself facing the same damn problem!
Now for my final question to the admins of BuddyPress.org:
Do you know what negligence is?You are guilty of negligence because while having protected your own site with some custom coding, you are exposing all other people using your software to a serious security/privacy risk!
FIX IT!
I want people to be able to easily format my forum posts and BuddyPress posts (using TinyMCE) WITHOUT exposing my private pages!
Otherwise I might just as well publish my admin password on my home page.WHY THE HELL is the custom code that you have implemented on this site here (and on WordPress.org to protect your sites from malicious attacks) is not part of the core BuddyPress code???????
P.S.
I couldn’t keep this post any shorter because when I see such a tremendous amount of stupidity (or negligence in this case) it just drives me mad.WordPress version 4.5.2
Buddypress version 2.5.3ColorMag Theme
When I installed bp and turned extended profiles, if I go to the toolbar in the upper right and choose Profile-Edit it goes to something like this:
/members/[username]/profile/edit/group/1/
And it’s a 404 page.
Also, if I click on any of the users in the backend including me the Admin, it says they’re marked as spam but yet the active/spam toggle is set to active not spam.
In addition, the register page doesn’t work and just loops back to home page.
Am I supposed to do some kind of setup other than checking the button the button that I want extended profiles in order to make this work? The documentation on this site for this just says it’s pending.
I’ve turned it off so I can at least use regular profile management but would love to access the extended profiles capabilities.
- WordPress