Forum Replies Created
-
Hi again,
Well, now I have a fresh install of both WPMU(2.8.5.2) and BP(1.1.2) on my localhost. I do not have any other plugins apart from BP installed and still the same problem.
I have added some ‘required’ custom fields to the ‘Base’ Profile Group. Even though the user fills them during the registration, they still appear blank on the ‘Edit Profile’ page (in BP members) and he has to fill them again (editing and saving works).
I have the same install on my server, but there I upgraded from earlier versions and apparently, this problem does not occur there. Not sure what’s going on??!
Please HEELLP!!
-Sib.
Thanks for your reply Jeff. I understand that the register.php directly contains all the elements now.
However, we liked the registration page of the default ‘bphome’ theme (BP 1.0.3) better (earlier) and accordingly we customized our site theme(premium edu-clean home theme for WPMU) to have a register page like that.
To achieve this, I created a custom page template register.php with code similar to that of bphome’s and plonked it in my theme folder. There if you see, the page template is divided into right-column, center-column, left-column (it hosts the registration section)
The code for this register.php is something like:
<?php get_header(); ?>
<!-- div content starts -->
<div id="content" class="widecolumn">
....
....
<div id="left-column">
<div class="register bp_core_widget_welcome">
<h2 class="widgettitle"><?php _e( 'Register for an Account', 'buddypress' ) ?></h2>
<?php bp_core_signup_do_signup() ?>
</div>
</div>
</div><!-- div content ends -->
<?php get_footer(); ?>It’s the bp_core_signup_do_signup() that is responsible for including the content of the registration page in the left-column.
Here is how my current registration page looks like:
http://www.cmswebusa.com/testsib/reg_pg.png
The registration section on the left is included in that section due to the bp_core_signup_do_signup() call. We still haven’t converted to the new single theme way, but we have already upgraded our BP to 1.1.2 and since then our custom fields just don’t get saved. Not sure what to do here?! I was wondering this could be happening coz of the deprecated function call. Also, how do I still make the registration section appear in the left-column of my page? Is there a function to include the register template or something?
Thanks,
Sib
Earlier when we were using WPMU 2.8.4a with BP 1.1, our registration form worked fine and all the custom fields got saved just fine. Only after the upgrades, are we experiencing this issue. Did not touch the WPMU install, just upgraded BP, that’s it!
However, we do have a custom registration page which is different than wp-signup.php. On this page we are calling bp_core_signup_do_signup() which is deprecated in BP1.1.2. Could that possibly be creating the issue? Is there any alternative to this call in the newer version?
We really need to fix this asap, users are already grumbling. Any troubleshooting advice is greatly appreciated.
Thanks,
Sib
Thank you for your help John.
I would like to delete some of my earlier duplicate posts, don’t see how.
-Sib
Wow, what’s happening?
I see some posts without logging in and when I log in, and try to reply to them, they disappear. Same way, the posts that I have already made are nowhere in sight? Is this some kind of a bug?
Hi moderators,
Any particular reason why I see my previous post (the one with the links) in this topic only when I log in and not otherwise?
Sure, will refer the codex for adapting to the new theme way John, thanks!
These are the links that I’m referring to, great documentation available to help users with all the info they need to switch to the 1.1 theme architecture :
https://codex.buddypress.org/getting-started/upgrading-from-10x/
https://codex.buddypress.org/how-to-guides/upgrading-a-buddypress-1-0-theme-for-buddypress-1-1/
https://buddypress.org/blog/news/the-new-buddypress-theme-architecture/
https://buddypress.org/forums/topic/details-about-the-new-theme-architecture
https://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/
https://buddypress.org/forums/topic/extending-wordpress-themes-post-experiences
Meanwhile, is there any alternative to bp_core_signup_do_signup() in BP 1.1.2?
Thanks,
Sib
Yup, that is the problem it seems – the old 2-theme structure.
I am using the premium ‘edu-clean’ home theme coupled with the BP default ‘bpmember’ theme which is no longer in existence after I have upgraded my BP to 1.1.2. I needed to customize my ‘register’ page. Instead of using WPMU wp-signup.php, I wanted my signup page similar to bphome’s.
To accomplish this, I simply created a page template(register.php) similar to bphome’s. Added a new page with the register slug, associated it with this template and made the user redirect from wp-signup.php to /register.
My problem is, on my register template I have used <?php bp_core_signup_do_signup() ?> to display the registration form in the left-column widget. Now, from what I understand, this function is deprecated in 1.1.2. Perhaps, this is the reason my profile fields aren’t getting saved? I still am not sure, but in any case, I would like to replace this function with its equivalent function in 1.1.2.
I want to retain this layout (i.e using edu-clean as the WPMU theme and bpmember as the BP theme) as of now. I still haven’t gotten the hang of the new single-theme architecture, but I’m working on it. Until I get that right, is there any way we can save our site users the trouble of having to save their profile fields twice?
Please advice!
-Sib
No, this function does not take any parameters from what I know. It is supposed to work as is. But it doesn’t in my case either. Not sure why.
This is the workaround that I am using in my members-loop which does seem to work:
‘global $site_members_template ;
$frndCnt = friends_get_friend_count_for_user($site_members_template->member->id) ;
echo $frndCnt ;’
-Sib
Well, I would be happy to share the solution, but I don’t really think my way is all that elegant, there’s got to be a better way and I’m waiting for someone to suggest it to me.
Meanwhile, I am still using the old 2-theme model. I made some customizations in my bpmember theme to achieve this and put in some code in plugins/bp-custom.php as well.
Firstly, we have a custom profile field called ‘Role’. And we wanted to have separate Role-tabs (as you can see on our site) to list all members for THAT role.
To achieve this, I completely changed the bpmember/directories/members/index.php code and put in my ‘Role’ tab-structure there. Then, instead of making the members index file call the members-loop, I wrote a modified version of the members-loop, made it as a function and put it in my bp-custom.php. Now I make a call to this function (which is basically the members-loop) from my bpmember/directories/members/index.php page.
To give you an eg of how we display all companies under the Company tab:
In my bpmember/directories/members/index.php, under the code section for ‘Company’ tab I make a call like:
display_members_by_role(‘Company’);
In my bp-custom.php, I have written a function display_members_by_role($role) which is nothing but a slightly modified version of the members-loop.
Here, in the ‘while’ for members-loop, I check for the Role field for that user-id. For this eg, if the Role is ‘Company’, print that member in the company-listing, else not.
This is the code I have put in the members-loop which checks the custom profile field (which is this case is ‘Role’) and it’s value for that user-id:
...
...
<?php while ( bp_site_members() ) : bp_the_site_member(); ?>
<?php
global $site_members_template ;
$arr = BP_XProfile_ProfileData::get_value_byfieldname(array('Role'), $site_members_template->member->id) ;
if( $arr['Role'] == $role) //$role is the role value received by the function, in this eg - Company
{
//do whatever
}
<?php endwhile; ?>
....
....Same logic is used for all other roles.
BTW, get_value_byfieldname() can return values for multiple fields too. In case you want to retrieve values of more than one profile fields, its easily possible. Say I want the ‘City’ custom field value too, then I would pass something like –
$arr = BP_XProfile_ProfileData::get_value_byfieldname(array(‘Role’,’City’)
and access the ‘City’ value using $arr[‘City’]
This function is pretty handy.
While I am able to print the members belonging to that corresponding role using this logic, what I can’t get into place is the pagination part. The pagination still takes into account ‘All’ members since the members-loop technically does retrieve all members.
All I have done is put a condition in order to just get the members for that role displayed. I was wondering if I should put in a separate pagination module, or if there is any other way of achieving this whole thing.
-Sib
Ah, thanks DJPaul!
Eagerly awaiting the updated version.
-Sib
Hi,
Achievements is an amazing plugin. It forms the core of our site. We allow member upgrades based solely on their achievements.
However, I too get the same error (warning only thrown on the ‘Summary’ page)
Using WPMU 2.8.4, BP 1.1.2, Achievements 1.1
Any word on the new version? Or some quick fix that we could try perhaps?
Thanks,
Sib
Hi, I tried to achieve this by putting an ‘if’ in the members-loop which is basically called for each tab. For each corresponding role tab, I check if the current member in the while loop belongs to that role, if yes, only then I print that member under that role tab.
http://www.cmswebusa.com/testsib/all_tab.png
http://www.cmswebusa.com/testsib/member_tab.png
http://www.cmswebusa.com/testsib/vendor_tab.png
I did not change the core for this, instead I changed the index.php of my BP theme and also added a bp-custom.php with some customized code. Not sure if this is the most elegant way of doing this. Was there any hook or something which I could’ve used maybe?
Sib
Hi,
This is my first time with BP, just started off.. so pardon me in case I don’t understand your query correctly.
I suppose, since you are using the field user_login as your where clause, you can either use signups or users table to get the user_email field. However, only users has the field ID, signups doesn’t, so aren’t you better off using users ?
I guess since you want to tie up wpmu/bp to your plugin, so this might work:
SELECT distinct(u.ID), u.user_email FROM {$wpdb->users} u
LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id
WHERE u.user_login='{$username}’
Thanks,
Sib