BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on #33041

    Hi,

    i found the solution, maybe that help someone.

    I create a function to catch non alpha characteres

    
    /**
     * Verifie si une chaine est alphabetique
     *
     * @param $string
     *
     * @return bool
     */
    function is_alpha($string)
    {
        // On cherche tt les caractères autre que [A-z]
        preg_match("/([^A-Za-z\s])/", $string, $result);
    
        // si on trouve des caractère autre que A-z
        if ( ! empty($result)) {
            return false;
        }
    
        return true;
    }
    

    I create my custom error messages

    
    add_action('bp_signup_validate', function () {
            $bp                   = buddypress();
            $firstname_field_post = $_POST['yoostart_signup_firstname'];
            $lastname_field_post  = $_POST['yoostart_signup_lastname'];
    
            if ( ! is_alpha($firstname_field_post)) {
                $bp->signup->errors['yoostart_signup_firstname'] = 'Le prenom ne doit comporter que des caracteres alphabétique';
            }
    
            if ( ! is_alpha($lastname_field_post)) {
                $bp->signup->errors['yoostart_signup_lastname'] = 'Le nom ne doit comporter que des caracteres alphabétique';
            }
        }
    );
    

    and i show them on register-form.php

    
    <!-- CUSTOM AHMED -->
     <div class="yoostart_name_details">
         <?php
         if (buddypress()->signup->errors['yoostart_signup_lastname']) {
             echo buddypress()->signup->errors['yoostart_signup_lastname'];
            }
        ?>
         <div class="lastname_field">
            <input type="text" name="yoostart_signup_lastname" id="yoostart_signup_lastname" value="<?= get_input('yoostart_signup_lastname') ?>" placeholder="Nom" required>
        </div>
        <?php
        if (buddypress()->signup->errors['yoostart_signup_firstname']) {
            echo buddypress()->signup->errors['yoostart_signup_firstname'];
        }
        ?>
        <div class="firstname_field">
            <input type="text" name="yoostart_signup_firstname" id="yoostart_signup_firstname" value="<?= get_input('yoostart_signup_firstname') ?>" placeholder="Prénom" required>
        </div>
    </div>
    <!-- CUSTOM AHMED -->
    
  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on #29655

    Hi Brajesh,

    that’s work with bp_init.
    Thank you.

    Regards
    Ahmed

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on #27609

    Hi Brajesh,
    Thanks for your help, the team of ultimate membership pro sended me the hook (ump_on_register_action), I will do that, thank you.

    Regards
    Ahmed

    • This reply was modified 4 years, 10 months ago by Ahmed.
  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on #14381

    Hi Brajesh,
    Sorry for my bad english, I’m from France 🙂
    My question is about membership levels (paidmembership pro) , on registration i automatically assign member type ENTREPRENEUR (with Buddypress member type pro) to membership level PREMIUM, for exemple. And i would like to prevent others member type to sélect this membership level after registration.

    Regards
    Ahmed.

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on #14371

    Hi Brajesh,
    I disable changing member type after registration for all members.

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on #14347

    Hi Brajesh,
    thank you for your response.

    • This reply was modified 6 years, 8 months ago by Ahmed.
  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on #10356

    hi Brajesh,
    The current strategy of sending email/notification on new visit is good, but just one email/notification, at this time users are notified every 5-10 seconds when other users visit their profile. In the end they receive 5-6 emails for just one visit.
    I may be incorrectly set the plugin.

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on #10187

    Hi Brajesh,
    Great, thank you 🙂

    Ahmed

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on #10145

    Hi Brajesh,
    it works, that my fault, i haven’t selected charset utf-8.
    Sorry

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on #10144

    hello Ravi,
    Thank you

    Ahmed