Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 26 total)

  • Masoud
    Participant

    @masoud1111

    hello @r-a-y

    ok. very good that it will get fixed.
    thank you for your attention and answer.


    Masoud
    Participant

    @masoud1111

    on the iphone 6 plus, the situation will get worse.
    the .moxie-shim.moxie-shim-html5 will go near the Upload Section, just about 5px under the Texts :
    ” your profile photo will be used on your profile and throu…. ”

    thanks .


    Masoud
    Participant

    @masoud1111

    hi @danbp
    your explanations was complete. i understood completely.
    and thank you very much for the help.
    the code worked well.
    actually i changed it a little to fit my requirements .
    i added some other elements to the css

    #item-header-avatar p {
    width: 90px;
    height: 15px;
    position : absolute;
    top : 90px;
    right : 0px;
    text-align: center;
    vertical-align: middle;
    line-height: 15px; 
    margin-top: 3px;
    border:1px solid green;
    background: green;
    color: black;
    }

    again, thank you for help.


    Masoud
    Participant

    @masoud1111

    @danbp
    hi.
    1 – first of all i have to thank you for your time, and complete explanation on this. i’m so grateful for that.
    ———
    2 – second, i have to apologize for my limited knowledge.
    i am at the beginning and still learning about php, DB, wordpress, and bp.
    so sorry if i had mistakes in codes.
    ———
    3 – third, i have to say that:
    i was not aware of this, that the usage of components are not the same. just like the example you said about buddy nav bar.
    in this code (which was not working) :

    <?php
     if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) {
     if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) )
     $bp->default_component = 'mentions' ;
    }
    ?>

    my logic was : if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) i use this code to understand if it’s a component or not.
    then after with this bp_is_active( 'activity' ) it will be checked , if it’s activity or not
    and with this isset( $bp->pages->activity ) to check if activity is to check whether activity is set or not.
    and if all true, then set and define a new nav default tab to mentions with this $bp->default_component = 'mentions'

    but it seems that my logic/codes are wrong from the start 🙁
    ———
    or for this code that i tried, and also went wrong:
    <?php define( 'BP_ACTIVITY_DEFAULT_EXTENSION', 'mentions' ); ?>
    my logic was, the <?php define( 'BP_ACTIVITY_DEFAULT_EXTENSION' part will force the bp, to set the default landing tab to activity.
    and with the second part , 'mentions' ); ?> it will force the Activity component to load on mentions sub-nav item.
    ———
    4 – i have to thank you for the group example. i didn’t know that set such a thing is possible.
    it was clear . i read it. and i’m trying to learn more about it.

    at last , i have to thank you again for the clear explanations.


    Masoud
    Participant

    @masoud1111

    hi @danbp
    and many thanks for your answer.

    i’ve read the docs already. but i read them again as you said.

    according to the docs, you can

    //Change the default tab opened when looking at a group (default is home):
    define( 'BP_GROUPS_DEFAULT_EXTENSION', 'members' );

    but i want to Change the default tab opened when looking at a Activity (default is Personal):

    so i put some codes (in bp-custom), to override :

    —-
    i’ve tried this (in bp-custom):
    <?php define( 'BP_ACTIVITY_DEFAULT_EXTENSION', 'mentions' ); ?>
    but i got 500 internal error.
    —-
    i’ve also tried this one (in bp-custom):

    <?php
     if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) {
     if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) )
     $bp->default_component = 'mentions' ;
    }
    ?>

    but i got error 500 internal again.
    —-
    and i’ve tried this one too (in bp-custom):

    function change_activity_default_tab()
    {
    global $bp;
    set[$bp->activity(current_action)]->mentions
    }
    

    and 500 internal error again.
    —-

    as i’ve read in the docs before, and i realized that it might be possible to change the Activity default extension too. (activity default tab is Personal (when you browse the prof , or click on switch from another tab to activity tab (when you click on activity tab) ) )

    so i came here for detail and get more help to solve it.

    i’d be grateful if you help me with this one too.

    thanks for your time and help.


    Masoud
    Participant

    @masoud1111

    any idea?


    Masoud
    Participant

    @masoud1111

    is there a hook or action?
    or something i can put into a function like:

    function change_activity_default_tab()
    {
    global $bp;
    set[$bp->activity(current_action)]->mentions
    }
    

    Masoud
    Participant

    @masoud1111

    hi @danbp , and so many manyyy thanks for your help.
    it worked like a charm ^_^


    Masoud
    Participant

    @masoud1111

    re installed my theme + buddypress plugin solved my problem.
    i dont know wat caused this problem. because everything is just like before, and now it’s working.
    thanks for your help @danbp and @sharmavishal


    Masoud
    Participant

    @masoud1111

    no no. i checked everything twice, sure abt that.
    i really dont know wat has happened to register page.
    i will backup my data, and detele the theme + buddypress plugin
    then i will reinstall them again.
    maybe that’ll work.


    Masoud
    Participant

    @masoud1111

    yes, of course i do have a register page. and in the setting everything is ok.
    i said, i tested the registeration page on the previous version. then i disabled the registeration. until now.
    now i re enabled it. and see things is not ok.


    Masoud
    Participant

    @masoud1111

    @shanebp tnx a lot 😀
    please mark this topic as resolved. i used your suggestion, and sorted it out. it’s ok now.


    Masoud
    Participant

    @masoud1111

    @shanebp
    hi. tnx for answer and patience. got 5 more minutes? 🙂
    i read and worked on what you said. and if i want to be honest, i could’t do anything special unfortunately.
    now, i want to ask your opinion about this idea:
    i’ve come up with the idea of hiding that field. (not email field), how?
    with the use of if condition… (if it’s not empty show it. if it has data, hide it)!
    ——-
    i’ve created a custom-meta with this code in theme functions:

    add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
    add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
    function my_save_extra_profile_fields( $user_id ) {
    if ( !current_user_can( 'edit_user', $user_id ) )
    	return false;
    /* Copy and paste this line for additional fields. */
    add_user_meta( $user_id, ‘person_relation’, 30318 );
    update_usermeta( absint( $user_id ), 'person_relation', wp_kses_post( $_POST['person_relation'] ) );
    update_user_meta( $user_id, 'person_relation', $_POST['person_relation'] );
    }

    and used it in my buddypress signup form, to get data from users. ok?
    after what you said, i went to edit.php (copy to my theme buddypress folder…)
    and added these codes. but it seems that they do not recieve/send data at all.
    it looks like they are empty!! 😐
    after <?php at the start,
    i added :

    global $user, $user_id;
    $person_relation = get_the_author_meta( 'person_relation', $user->ID );
    $user_id = get_current_user_id();

    and in the <form> ,
    i added this piece of code (not working)
    then copied and changed the “save changes button”.
    so there is 2 buttons. one is for my-custom-meta, and the other is for buddypress form.
    buddypress edit page
    if user writes the name and click save. the box/button, all should gone. and i have to see the data in Users admin panel.
    but nothing is getting save… and i dont know where am i doing it wrong

    <?php if( $person_relation == '' ): ?>
    <tr>
    <th><label for="person_relation">Invitor's Name</label></th>
    <td>
    <input type="text" name="person_relation" id="person_relation" value="<?php update_usermeta( $user_id, 'person_relation', $_POST['person_relation'] ); ?>" class="regular-text" /><br />
    <span class="description">Please enter your invitor's name.</span>
    </td>
    </tr>
    <input type="hidden" id="userID" value="<?php echo $user_id ?>"/>
    <div class="submit">
    <input type="submit" name="profile-group-edit-submit" id="profile-group-edit-submit" value="<?php esc_attr_e( 'Save Name', 'buddypress' ); ?> " />
    </div>
    <input type="hidden" name="person_relation" id="person_relation" value="<?php update_usermeta( $user_id, 'person_relation', $_POST['person_relation'] ); ?>" />
    <?php add_action( 'personal_options_update', 'my_save_extra_profile_fields' ); ?>
    <?php add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' ); ?>
    <?php do_action( 'xprofile_profile_field_data_updated'); ?>
    <?php endif; ?>

    so sorry for long description. tnx for help.
    any suggestions do you have?


    Masoud
    Participant

    @masoud1111

    @shanebp
    hi, and thanks for your attention.
    i edited my answer! i read your answer more carefully.
    is it still possible to use the hook you mentioned even for custom-user-meta?
    i’ve created a custom meta, and want to get it from users, only for limited times.
    so do_action( ‘xprofile_profile_field_data_updated’, $field_id, $value )
    what can i use for $field_id?
    and for $value?
    sorry again, i have to read more abt hooks cause i know nothing abt them.
    thanks again.


    Masoud
    Participant

    @masoud1111

    solved it.
    hopefully someone from wordpres.org helped me.
    here is the link for anyone in the future faced the same problem as me.
    wordpress.org page

    the answer was:
    If you want to add some user meta info in user database while registration you need to use “user_register” filter like below code:Add code in your themes function.php file

    add_action( 'user_register', 'my_user_meta_save', 10, 1 );
    function my_user_meta_save( $user_id ) {
        if ( isset( $_POST['first_name'] ) )
            update_user_meta($user_id, 'first_name', $_POST['first_name']);
    }

    Masoud
    Participant

    @masoud1111

    i’ve managed to create a extra field by ID, and this is the function to save it.
    it’s name is “person_relation”.

    add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
    add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
    function my_save_extra_profile_fields( $user_id ) {
    	if ( !current_user_can( 'edit_user', $user_id ) )
    		return false;
    	/* Copy and paste this line for additional fields. Make sure to change name '' to the field ID. */
    	update_usermeta( $user_id, 'person_relation', $_POST['person_relation'] );
    }

    now
    1) any suggestion on how should i make this box appear on group 1 ?
    * or in the setting page?
    and
    2) how should i get the value of it? (it’s a text input)? i heard that i have to use “POST[]” method? is it the right way? and how?


    Masoud
    Participant

    @masoud1111

    @sharmavishal
    hi. thanks for the answer, i got it.


    Masoud
    Participant

    @masoud1111

    @danbp
    do i need to update the codes in my theme manually, everytime you roll an update for the plugin?
    because as it’s said in many places, when i create a folder named “Buddypress”
    in my theme, it will override the original. correct?

    for example. now it’s version 2.5.3 and i copied the general.php from plugin in my theme’s buddypress folder.
    so when the version 2.6.0 is out, do i need to copy and replace general.php from plugin to theme again?(as to use the most recent codes)?

    so do i need to? or not?

    sorry for my question, if it sounds stupid.


    Masoud
    Participant

    @masoud1111

    @shanebp
    hi, the function worked very well.
    and thanks for your help.


    Masoud
    Participant

    @masoud1111

    @danbp
    thanks for your complete explanation. but there is not such a file members/single/settings/general.php in my socialchef theme.
    and yes, i do have a buddypress folder in my socialchef theme.
    so i created the path. and copied the general.php from buddypress plugin files to the destination folder.
    and did the changes as i want.
    thanks a lot.


    Masoud
    Participant

    @masoud1111

    @danbp
    first of all i have to thank you for your quick answer and great support.
    i am very satisfied with the support of this plugin. you guys are great.
    thank you very much.
    —-
    1 & 2 ) the function worked great, but the “private message” button in profile still remains!
    i mean if a user can not send message so there is no need to show them that button.
    is it possible to show that button only to admins too?

    3)
    oh no no. i didnt mean WP DASHBOARD.
    i dont want users to be able to change their email account on their own, after sign-up(bp sing up form), unless they contact admin of site, and request the change of email.
    the option of changing email account is in
    Setting Tab > General Tab
    there is a place for them to write their new email and …
    i want to hide and disable it for normal users and available only for admin.
    look at this picture please.
    the red area.


    Masoud
    Participant

    @masoud1111

    @shanebp
    thank you very much.
    the code above run with no eror.
    —–
    UPDATE:
    i put it in my theme functions.php. and it works.
    by mistake i was thinking that i have to put it in bp-custom.php to make it work.
    but it has to be in FUNCTIONS.PHP of your THEME.


    Masoud
    Participant

    @masoud1111

    @shanebp
    no still not working. but thank you for your help and notice.


    Masoud
    Participant

    @masoud1111

    @shanebp
    many thanks to you for your help.
    but unfortunately this code you said, does not work.
    and still redirected to wp-login.php
    i put the code in bp-custom.php

    what other codes do you suggest please?
    thanks for your notice.


    Masoud
    Participant

    @masoud1111

    @shanebp
    oops!
    i have to use “root”
    instead of “redirect” 😐
    because root points for not-logged-in-users.
    and redirect points for successfully-logged in users!
    sorry for that mistake.
    now i’ve set
    root = $redirect=get_home_url ( int $blog_id = null, string $path = '/login', string|null $scheme = null );
    but error again! 🙁

    correction:
    i want to call mode 1. so it points to root.
    and set root landing page for not logged in users to a page like “login” so ==>> ‘site.com/login’

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