Forum Replies Created
-
In reply to: Site Wide Activity stream not working
WordPress stores posts in database tables of the form wp_x_posts, where x is the blog id. Comments are in wp_x_comments. Time created should be the last column.
Have you looked at the timezone settings for the two blogs that are causing the problems? WordPress > Dashboard > General.
Untested, but the following should work.
1) Copy all those functions above to a plugin file/functions.php/bp-custom.php
2) Add a unique prefix to each function, so as to avoid PHP errors. Eg jeff_bp_update_status_button, etc.
3) In jeff_get_update_status_button and jeff_get_clear_status_button, add the following:
if ( !is_site_admin )
return false;You can put it right after the line that reads global $bp;.
4) In jeff_bp_the_status, change all references to the original functions (like bp_update_status_button) to your new functions (jeff_bp_update_status_button).
5) In the template file that handles profile status ([child-theme-path]/profile/profile-header.php – copy the same file over from the parent theme if it doesn’t exist yet), change
bp_the_status()to
jeff_bp_the_status()In reply to: Rename components1. Rename slugs by defining global constants in /wp-config.php. Eg:
define ( 'BP_GROUPS_SLUG', 'clubs' );2. Page titles are generated by bp_page_title(), which is defined in bp-core/bp-core-templatetags.php. It looks to me like they are properly localized, though. Maybe there’s a missing translation in the .po/.mo files? What language are you using?
In reply to: Broken delete buttons in 1.1.3Hm – I am running the same setup (WPMU 2.8.6/BP 1.1.3) in a production environment and have no problem with the delete button.
Have you tried scattering alert statements to see where in the ajax process things are getting hung up?
alert('Test');in the javascript andreturn("test");in ajax.phpIn reply to: Site Wide Activity stream not workingYes, UTC-5 should be correct.
I’m not sure what subdomain installation would have to do with it one way or another. It’s not impossible, I guess?
In reply to: Site Wide Activity stream not workingI’m almost certain that the problem has to do with items being tagged with timestamps from the future. The function bp_core_time_since() in bp-core.php returns the message [Use GMT Timezone] when the timestamp on an item is greater than the value returned by the core PHP function time().
The timestamp for blog comment and for blog entrie activity comes from the timestamp attached to those items in the databases corresponding to the individual blogs. That means that the timestamps on blog entries in at least some wp_x_posts and wp_x_comments blogs are incorrect by at least a few hours. I don’t know how this would happen. You can set timezones on a blog-by-blog basis, but I assume that WP ignores timezone settings when stamping new entries and looks only at GMT unix time.
I’m not sure what to recommend. Go into the database and look at the timestamps on some of those rogue comments and entries. Verify that they are indeed incorrect. If they are, then you’re looking at a WordPress problem. Try making sure that those blogs are set to the correct time zone (Dashboard > General, I think) and see if the problem persists.
In reply to: Broken delete buttons in 1.1.3Peter – I’m not sure what’s causing your particular problem, but my understanding of most of the AJAX in BP is that you need the following parts:
1) Correct class names in the theme files, or in the core files that generate the html
2) If you’re using bp-sn-parent for a parent theme, the JS for AJAX is located in bp-sn-parent/_inc/js/ajax.js. (Search the file for class names from (1) if you want to know where to start in that file.) ajax.js contains the jquery that waits for user interaction with ajax-enabled elements on the page. When the user interacts (eg clicks on a delete button with class “acomment-delete” to delete an activity item), the code in ajax.js prepares the necessary post variables and sends them to the php handler mentioned in the post action.
3) Those PHP action functions are located in bp-sn-parent/_inc/ajax.php. They do the server-side processing and return markup back to the javascript.
Hope that points you in the right direction.
In reply to: Site Wide Activity stream not workingI ask because there seems to be some strange mismatches between the time-ago listed on your stream and the times attached to the source items (at least in the case of blog comments, which have a public timestamp). Are the timestamps that are appearing on your activity stream correct? For instance, did this friendship “bbrian017 and No Modest Bear are now friends” happen around 3:08 EST?
I also notice the pattern that only blog posts and comments are showing up at the top of the list with the [Use GMT timezone] message. Is it possible that there’s an issue with the way that your blog time zones are configured (eg are they set in the future?) or perhaps with the way the blog component is recording blog activity? Or am I wrong and there has been different kinds of activity with the [Use GMT timezone] message?
In reply to: Site Wide Activity stream not workingBbrian017 – what time zone are you in?
In reply to: Site Wide Activity stream not workingThanks for the info. Even if listing that stuff doesn’t lead directly to a solution, it helps to rule out a bunch of stuff.
You say that old stuff is staying at the top. Is it the same old stuff? Ie are there are a few activity items that are stuck at the top? Or do the old items at the top of the list change and eventually move down the list?
If it’s just a few pesky items, it could be that the timestamp on those items somehow got corrupted and BP thinks that they’re from the future. Try deleting just those activity items.
Are the timestamps on activity items (“x minutes ago” etc) correct?
In reply to: Site Wide Activity stream not workingIt’ll be easier for others to help if they know more:
In reply to: Create Group Button from within Group DirectoryTry
<a class="button" href="<?php echo bp_root_domain() . '/' . BP_GROUPS_SLUG . '/create/' ?>"><?php _e( 'Create a Group', 'buddypress' ) ?></a>. Make sure you wrap it inif ( is_user_logged_in() )as bp_root_domain() will be empty for non-logged-in usersMy pleasure. Good luck getting acquainted with BuddyPress
As for your other question, here are a few places to start:
1) Make a Gender field and a Enter the Competition field in Dashboard > BuddyPress > Profile Fields. Make sure they’re required on registration.
2) If by “top nav menu” you mean the thing that floats across the top of the screen, you can add to it by creating a button inside of a php function, then using add_action to attach the function to the bp_adminbar_menus hook. See buddypress/bp-core/bp-core-adminbar.php to see how it works in the core code.
3) Use a plugin like JJJ’s https://wordpress.org/extend/plugins/bp-member-filter/ to create the filters that will populate the pages that the “Men” and “Women” dropdowns will point to.
This is getting a bit complicated, and will involve calling the $bp global variable, so it’s best to move it to a self-contained function that will then be called in your templates.
Put the following in your child theme’s functions.php file (create one if it doesn’t exist, making sure you have the opening and closing
<?phpand?>tags).function jeff_signup_profile_link() {
global $bp;
if (!is_user_logged_in() ) {
echo '<li ';
if ( bp_is_page( BP_REGISTER_SLUG ) )
echo 'class="selected"';
echo '><a href="register">Sign up!</a></li>';
} else {
echo '<li ';
if ( $bp->loggedin_user->domain == $bp->displayed_user->domain )
echo 'class="selected"';
echo '><a href="';
echo $bp->loggedin_user->domain;
echo '">My Profile</a></li>';
}
}Then, in your template file where you’d like the link to appear, use
<?php jeff_signup_profile_link() ?>Glad you got the extra bit, jeffreeeeey, but you might want to clean up that code a bit, to make sure you close the HTML tags correctly:
<?php if ( !is_user_logged_in() ) { ?><li <?php if ( bp_is_page( BP_REGISTER_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="register">Sign up!</a></li><?php } ?>What exactly do you want the else clause to do? Do you want different button to show up when the user is logged in?
You’ve got the right idea but your syntax is wrong. Presumably you don’t want the button (ie the li list item) to show up at all for logged-in users. So you need to put the entire button inside of an if statement:
<?php if ( !is_user_logged_in() ) { ?><li><a href="register">Register</a></li><?php } ?>Also, be patient! 9.5 hours to wait for help isn’t all that much time!
In reply to: Auto-complete stopped workingNot yet, Erich, but it’s next on my list of things to add to this plugin.
In reply to: Auto-complete stopped workinghaloid – I wrote a plugin for group invitations that uses the same autocomplete code as the messaging system to allow group mods to invite any member to a group: https://wordpress.org/extend/plugins/invite-anyone/. So it’s definitely possible to extend BP to do what you’re asking. I haven’t looked at the code for messaging, but if it’s anything like the invite code, it’d be pretty easy to do. A quick glance at bp-messages.php makes it look like you could probably alter BP to do what you want it to do by finding the function messages_ajax_autocomplete_results in bp-messages.php, commenting out the code that populates $friends, and replacing it with a list of all site members (you could use exactly the code I use in the Invite Anyone plugin).
Better still would be to build it into a plugin. Wouldn’t be too hard. If I get a chance in the next few weeks, I might take a look at it.
In reply to: Removing Activiation+1 to @nexia sharing the TOS plugin! I’ve got a 3/4-built plugin but I’ve been putting off the extra work I’d need to do to make it viable
In reply to: Invite AnyoneHi Gpo1 – The plugin can’t do this right now. The next thing I’m going to add to the plugin is the ability to invite individual members to your BuddyPress community via email address (as this is the thing that’s most needed for my particular project). After that I might look into doing some sort of FB connect.
In reply to: Can only send invites to friends.Oo oo, I’ll take the $1!
In reply to: How to get all Group nav items?It looks like $bp->bp_options_nav[groups] is populated differently when you’re inside of the group loop than when you’re not. That’s probably at least in part because the optionsbar items are different for different groups (some don’t have the forum activated, for example) and even for different users (admins vs mods vs regular members). In any case, if you put your code inside of a group loop
if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group();you might get what you’re looking for for each individual group.
My understanding is that the technical details of the merge are only just now beginning to be discussed. See the links here: http://wpmututorials.com/news/merge-news/, including the merge trac ticket, which was only opened 10 days ago. That ticket would be a good thing to monitor as the merge approaches.
As far as the BuddyPress end of things is concerned, I’m assuming that Andy’s recent work on non-MU compatibility is a step in the direction of ensuring that the move to 3.0 doesn’t break BP. But I have a sense that the details of how the merge will affect existing sites, and in particular those running BP, will not emerge until some of the technical details of the merge start to get decided.
In reply to: Feature Request: HastagsAndy, I see that you’ve commented in bp_search_form_type_select() (bp-core/bp-core-templatetags.php) that eventually there’ll be a single search page to bring together all content types. Am I right that it doesn’t exist yet? If not, where do you think hashtag search links should link, since all search is specific either to groups or forums or members or blogs?