Forum Replies Created
-
In reply to: xprofile_insert_field_group() ignoring ID
This is a basic mysql table structure issue.
The
idfield is set toauto increment.
So it you really want theidto be 1, you need to flush thebp_xprofile_groupstable.
But that may orphan any data you have inbp_xprofile_fieldsor cause mismatches with data in the
bp_xprofile_datatable.Perhaps the
idfield should not be an argument inxprofile_insert_field_group.Does it really matter what the
idis?In reply to: Per-group Identity?I can’t create a profile field for every possible group.
You can create a custom profile field by extending
BP_XProfile_Field_Type.
That custom field could pull in the group names for that member and allow them to enter a name per group name.You can filter the member name by using the filter hook in
bp_member_name(), found in:
buddypress\bp-members\bp-members-template.phpHow, when and why you apply that filter is up to you.
The same filter may not work for bbPress, but they probably have something equivalent.
In reply to: Per-group Identity?Creating some custom fields won’t be enough.
afaik – you want separate and multiple ‘sub’ identities for each user.
That won’t be easy, but even so, creation of sub-identities is only part of the issue.
Parsing out which sub to use in which situation for content creation and display will be a tangle.But take a look at group meta
In the activity loop, there is no such thing as
$post->ID.Try:
$item_id = bp_get_activity_secondary_item_id(); $songurls[] = get_metadata('post', $item_id, 'wpcf-song-upload', true);But if you know it’s post meta, why not use that function?
$songurls[] = get_post_meta( $item_id, 'wpcf-song-upload', true);And put your
foreachloop after theendwhile;In reply to: Login Fields Do Not Display- Cannot Access AnythingIn reply to: Per-group Identity?Please do not post duplicate topics!
In reply to: How do i get rid of ::before arrows?Your image is broken.
Have you tried switching to a theme like WP 2013?
If the arrows go away, then you know there is an issue in your original theme.In reply to: Importing posts from a Yahoo groupI’m not aware of any existing code for that task.
Can you export the group posts from Yahoo?
Then a developer could look at the structure and probably write code to map the fields.In reply to: Per-group Identity?No, afaik, his name will be the same across the site.
There are probably ways to filter group member names, but it would require extensive knowledge of BP and access to your site – iow. you should hire a BP developer.
In reply to: Can I create template parts instead of full page?If
my-theme/buddypress/members/single/index-component-profile.php
is your version ofmy-theme/buddypress/members/single/profile.php
then don’t use a different file name.It’s much easier to do a
template overload.Please stop posting duplicate topics!
You’re probably making a mistake with single vs double quotes.
Try:function getCustomMembersForm(){ $str = 'This will be the start of my form.<br/>'; $str .= 'Put "something" in quotes.<br/>'; $str .= 'And this will be the end of my form.'; return $str; }I’ll bet you’re using
echoin your shortcode functions.So their output appears before the page content is rendered.
Usereturninstead ofecho.
https://codex.wordpress.org/Shortcode_APIIn reply to: Newbie questions re bbpress and buddy pressIf you want networking and messaging and forums – you need both BP and bbPress.
Some info re BP and forums:
In reply to: Auto assign new member to group upon registrationThe first argument is an integer, not a string.
groups_join_group( $group_id, $user_id = 0 )Since you are only handling 2 specific groups, you could hardcode the
$group_id.
groups_join_group( 3, $user_id );Or you could get the id like this:
$group_id = groups_get_id( 'Teachers' );In reply to: [Resolved] bp_has_forum_topics() returns emptybp = BuddyPress
bbp = bbPressIn reply to: [Resolved] bp_has_forum_topics() returns emptyI think
bp_has_forum_topics()only works on BP pages.
Trybbp_has_topics()In reply to: Retrieve a variable from a GETI’m calling it from the buddypress-xprofile-custom-fields-type plugin, do you think could be some filter that intercept querystring and reset it ?
I doubt it.
Where in the plugin are you calling it?
In a function?
And what is that function hooked to?
Is that hook being called on the page where you manually call the $_GET? Probably not.In reply to: Retrieve a variable from a GETif I print $_GET it return an empty array
Then there is nothing in $_GET. You should see $_GET variables in the browser address
if (isset($_GET['var1'])) echo "OK"; else echo "There is no variable called 'var1' being passed.";In reply to: Buddypress Field On Member loop – Need Links…
$myjob = xprofile_get_field_data( 'Job', $user_id ); if ( is_array( $myjob ) ) { foreach( $myjob as $job ) { $search_url = add_query_arg( array( 's' => urlencode( $job ) ), bp_get_members_directory_permalink() ); echo '<br/><div class="my_job"><a href="' . esc_url( $search_url ) . '" rel="nofollow">' . $job . '</a></div>'; } } else { $search_url = add_query_arg( array( 's' => urlencode( $myjob ) ), bp_get_members_directory_permalink() ); echo '<br/><div class="my_job"><a href="' . esc_url( $search_url ) . '" rel="nofollow">' . $myjob . '</a></div>'; }In reply to: Buddypress Field On Member loop – Need Links<?php $country = bp_get_member_profile_data( 'field=Country' ); if ( $country != false ) { $href = site_url() . '/members/?s=' . $country . '&members_search_submit=Search'; echo '<a href="' . $href . '">' . $country . '</a>'; } ?>In reply to: Buddypress Field On Member loop – Need LinksTry:
$href = site_url() . '/members/?s=' . bp_member_profile_data( 'field=Country' ) . '&members_search_submit=Search';In reply to: Problem with CKEditorProbably a javascript conflict. Check your browser console.
In general, it’s best to use wp_editor instead of ckeditor.
In reply to: Buddypress Checkbox field dataa:3:{i:0;s:7:”English”;i:1;s:4:”Math”;i:2;s:10:”Substitute”;}
is a serialized array.BuddyPress will unserialize profile data via
xprofile_get_field_data( $field, $user_id = 0, $multi_format = 'array' )
and return an array.But if you want to do this in the context of a search query, you probably want to use wildcards in the mysql statement, for example:
%math%.
This can be tricky to implement if you haven’t done it before.There is already a good plugin that does member searches based on profile field values:
https://wordpress.org/plugins/bp-profile-search/In reply to: Problems adding new menu itemPlease use the
codebutton when posting code.You need to include the
default_subnav_slugfield inbp_core_new_nav_item:
https://gist.github.com/shanebp/5d3d2f298727a0a036e5