Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 20 replies - 1 through 20 (of 20 total)

  • dwdutch
    Participant

    @dwdutch

    Ewwww! Point well taken! Thanks, @boonebgorges

    I guess a good solution would be to find a plug-in that lets you “replicate/migrate” an existing user’s xprofile contents to a a new user then you can delete the original user.

    Fortunately, I’ve only had to deal with this situation one time and, although i thought it might be more problematic, it hasn’t so far.


    dwdutch
    Participant

    @dwdutch

    Hey, that works! Thanks a bunch!!

    I understand why that hook is a better selection and why the conditional is necessary but, I must admit, I don’t fully understand the concept of templates. I keep learning new stuff as i come across it so, I guess, this becomes yet another new topic to start digging around in BP forums to learn about.

    Very clever solution. Thank you.


    dwdutch
    Participant

    @dwdutch

    Thanks, I’ll use that as my default strategy but i was trying to be creative so that future upgrades wouldn’t require me to have to refresh the file. I tried doing the following:

    function postSignup_msg() {
    echo “blah, blah, blah”;
    echo “more blah, blah, blah”;
    }
    add_action( ‘bp_complete_signup’, ‘postSignup_msg’, 2 );

    To my surprise, a simple “echo” command doesn’t play nice with outputting information while maintaining the theme formatting and, frankly, i don’t know another way to output the info so that it will better align. any suggestions?


    dwdutch
    Participant

    @dwdutch

    Well, it wasn’t obvious but i did resolve my own question. The “Publish” vs. “Submit-for-Review” button option is determined by the users role definition. an AUTHOR will have the PUBLISH button available on a Post page; whereas, a CONTRIBUTOR will have the Submit-for-Review button.


    dwdutch
    Participant

    @dwdutch

    I think the following properly displays the output from bp_get_the_profile_field_options() as an example of when radio-buttons intermittently display incorrectly. Below that I also show a potential fix – although @jeffsayre or another BP-expert may have a better solution. (Thanks @hnla for explanation)


    <div id="field_125"><label><input checked="checked" type="radio" name="field_125" id="option_126" value="Professional">
    Professional</label>
    <label><input type="radio" name="field_125" id="option_127" value="Organizational">Organizational</label>
    <label><input checked="checked" type="radio" name="field_125" id="option_128" value="Standard">Standard</label>
    <label><input type="radio" name="field_125" id="option_129" value="Volunteer">Volunteer</label>
    <label><input type="radio" name="field_125" id="option_130" value="Student">Student</label></div>

    Notice that there are TWO checked=”checked” settings in the list. This occurs in the ‘radio’ switch statement of bp_get_the_profile_field_options() because of an IF-statement within a for-loop that I believe too liberally assigns the “checked” value to the default-value in the list regardless of whether or not there is already a set-value.

    One alternative is to assign a variable before the for-loop…

    $SomeValueChecked = FALSE;

    … then check this variable within the IF-stmt before setting the default-value. Something like the following:


    if ( $option_value == $options[$k]->name || $value == $options[$k]->name || ( $options[$k]->is_default_option && $SomeValueChecked == FALSE ) ) {
    $SomeValueChecked = TRUE;
    $selected = ' checked="checked"';
    }


    dwdutch
    Participant

    @dwdutch

    uuuughhh… I converted all of the “<" to be "["


    dwdutch
    Participant

    @dwdutch

    oops… I forgot that the html string wouldn’t display properly and I don’t know how to include it in this Post. Embarrassingly, I know coding well enough to debug but don’t know a simple strategy like how to display html soooo, i’ve converted all of the “<" characters to be "[" — hope it works.

    [div id=”field_125″>
    [label>
    [input checked=”checked” type=”radio” name=”field_125″ id=”option_126″ value=”Professional”>
    Professional
    [/label>[label>
    [input type=”radio” name=”field_125″ id=”option_127″ value=”Organizational”>
    Organizational
    [/label>[label>
    [input checked=”checked” type=”radio” name=”field_125″ id=”option_128″ value=”Standard”>
    Standard
    [/label>[label>
    [input type=”radio” name=”field_125″ id=”option_129″ value=”Volunteer”>
    Volunteer
    [/label>[label>[input type=”radio” name=”field_125″ id=”option_130″ value=”Student”>
    Student
    [/label>[/div>


    dwdutch
    Participant

    @dwdutch

    I’m refreshing this thread because I’m experiencing this same problem in my blog but I’ve not found a solution anywhere else in the forum. I believe I’ve tracked the problem to its source in bp-xprofile-templatetags.php but need a little help to resolve it.

    To recreate this issue, I have a 5-value radio-button sequence with the default-value being the 3rd value in the sequence and the assigned value being the 1st in the sequence. As a result, during the for-loop in the ‘radio’ switch case, TWO values are marked as being “checked” but (since it’s presented as radio-buttons) only the last in the sequence is reported as the activated button.

    The problem occurs because the if-statement that decides which field is “checked” is a series of ORs — this is correct for a checkbox field-type that can have multiple values. but for radio field-type, it should be either the set-value OR the default-value but not both.

    I’m still just a little too new with the code-base to be confident of what should be the correct fix but, having described the problem, I’m sure @jeffsayre or another BP-expert can propose a straight-forward correction.

    In case my description this doesn’t make sense, below is the $html string that is generated from the bp_get_the_profile_field_options() call on a radio-button field type:


    dwdutch
    Participant

    @dwdutch

    I tried the loop… this is AWESOME!!

    @boonebgorges: I agree with @r-a-y ’s advice — of course, without knowing the software structure of BP, it’s harder to find specific functions. Still… understanding the underlying concept of the “global” loop has freed my thought-processes. I had read the documentation on the Loop but didn’t grasp that this was such a basic underlying concept.

    Thanks, guys!


    dwdutch
    Participant

    @dwdutch

    Just to clarify… here’s what I’m doing. I’ve defined two xProfile groups: “Admin-only” and “Professional”. Next, I defined a membership-type field in that “Admin-only” group with values Pro, Standard and Volunteer. Finally, within the “Professional” group, I’ve provided several fields available only to that membership-type.

    Within my theme, I’ve modified edit.php to not display the SAVE CHANGES button on “Admin-only” edit-profile page unless user is a site administrator and to only display it on the “Professional” edit-profile page only if the user’s membership-type field (from the Admin-only” group) is set to Pro.

    Now, I’m working on a plug-in (because i don’t know how to add a page as part of a theme) that adds a unique page on my site that will list only those members who are membership-type=Pro. I want to display information from their respective Professional xProfile group fields. Eventually, I want to add filter capabilities to the top of the page based on the Professional xProfile group fields


    dwdutch
    Participant

    @dwdutch

    @DJPaul: I was looking for functions that might manipulate various xProfile fields (in particular) i was trying to extract info about checkbox type field. (I see that you may have provided me some insight on that topic in a separate thread).

    @boonebgorges: thanks for the clarification re: files used for themes – i was wondering why it was named as it was but i couldn’t find any explanation. I had looked at the members loop documentation and I saw that the while loop is controlled by bp_members() but since i could find no documentation on that function, I assumed that it must loop through all members on a site (which is overkill for my goal — i just need to identify a handful of members who have a certain xprofile value set THEN i want to display them).

    Meanwhile, back to this question… and my feeble attempt to avoid confusion.

    1) if I’m understanding you correctly then by calling bp_has_members( ‘include=3,7,24? ) I’m effectively setting up a “global” loop within my instantiation of BP that is incremented with each call to bp_members(). So, while within the “global” loop, all function call potentially reference the same current iteration of $user_id. Did i understand correctly?

    2) Yet, there must be certain functions that only refer to the currently logged-in user_id (e.g. is_site_admin()). How do i distinguish between which function type is which kind?

    3) Why can’t I find bp_has_members in http://bp-dev.org/phpxref/nav.html?_functions/index.html? Is there some other “official” place to go learn what functions exist and are available to me?


    dwdutch
    Participant

    @dwdutch

    Thanks for this, @r-a-y


    dwdutch
    Participant

    @dwdutch

    Thanks, @DJPaul . I’ll download and re-hack this, as appropriate.


    dwdutch
    Participant

    @dwdutch

    Anyone have a clue?


    dwdutch
    Participant

    @dwdutch

    Any insight, anyone?


    dwdutch
    Participant

    @dwdutch

    @David

    Thanks for the follow-up. I tried and it worked fine. Now, what’s odd is that (with the exception of the Custom Styles section) the lines in my file were the same. Okay, so my only explanation is that I must have had something else wrong on my site – after all, it was in the wee hours of the night that i was experimenting.

    Soooo, thank you for your input.

    Now, as I played with it more, I was able to successfully create my own unique child theme. I commented out the code for the sidebar login block (AND the comparable logout display) in sidebar.php but, here’s my question: why do your lines work?

    #sidebar-login-form,

    #login-text{display: none;}

    I went poking around in the buddypress forum and developers area but i didn’t find a comparable reference. How did you know about this “shortcut” (so i can find other such items if i need them)?


    dwdutch
    Participant

    @dwdutch

    just to close the loop… I commented out the is_site_admin() call in the plug-in Group-Documents.. et voila, my WP installation popped back up. sure enough, BP was deactived while Group-Documents was activated. I deactivated Group-Documents; removed my comments around the is_site_admin(); reactivated BP then reactivated group-Documents.

    Everything works great!

    Valuable lessons learned…

    1) I’ll always deactivate plug-in before upgrading.

    2) i know where to find the changelog

    Thanks, ya’ll!

    @xp02ed

    @peter-anselmo


    dwdutch
    Participant

    @dwdutch

    well, I admit that I’m new at both WP & BP so, i upgraded without first deactivating scripts. (in my defense, however, i did go tothe upgrades page but there were no instructions on how to go from 1.2 -> 1.2.1 and i assumed a minor upgrade might have only limited/isolated changes — ok, i was lazy. fortunately, i was on my practice site.

    right off the bat, i see that one of my plugins in the practice area is broken (“Group Documents”) . As buddypress tries to restart, the error reported is “Call to undefined function is_site_admin()”. obviously, this worked before the upgrade so, i’m wondering…

    1) has this function been deprecated and, if so, is there a replacement function?

    2) where do i find what changes were included in 1.2.1?


    dwdutch
    Participant

    @dwdutch

    Well, I tried all 4 options but have had no luck. At the heart of #1 & #2 was the fact that building a child theme (at least, for me) did not work. The description on the link seems straight forward enough but as i put files in-place (even without any additional customization attempt) the BP default theme did not fully recreate itself – i.e. neither the adminbar nor the sidebar re-appeared after i activated my skeleton theme. Approach #3 & #4 are very clever but they didn’t work wither. on #4, i think it didn’t like the echo statement not being terminated with a “;” and even after trying that it still threw an error.

    The positive out of this is that you’ve convinced me that creating a child theme really isn’t that hard. unfortunately, I just don’t have thte time nw to figure out why it didn’t work — although i triple-checked file placement, content, etc.

    Presumably, others are creating child themes so i must be over-looking something very simple. I’ll come back to this another day. (Of course, if you – or anyone – have any other suggestions, let me know and I’ll try those when i resume).


    dwdutch
    Participant

    @dwdutch

    Thanks, David. I’ll pursue these options then let you know what happens.

    As for login, Id like to use the “Login with Ajax” widget because it has a “Forgot password” option and it allows for redirects to custom URL on login and/or logout. I’d like to stay away from the WP screen, if possible.

    In fact, that’s yet another challenge: how to give them access to create Posts without seeing the WP-admin screens — especially since I want any profile changes to be done via BP (so they’ll see their xprofile fields) rather than the more simplistic WP fields. alas… for now, i need to get some of them started and I’ll have to save that battle for another day.

    This blog is for a private group of about 20 people.

Viewing 20 replies - 1 through 20 (of 20 total)
Skip to toolbar