Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to add date of birth from About Me plugin to Registeration?

Hi All!
Need help with some customization. I'm using About Me plugin to make user profiles on my Vanilla Forum and need to add Date Of Birth from About Me plugin to Register page. I'm using Version 2.0.18.8

So I copy this to register page:


<?php
     echo $this->Form->Label('Date of Birth', 'Birthday');
     echo $this->Form->Date('BD', $this->GenderOptions);
     ?>
</li>
<li>
    <table>
        <tr>
            <td>
                <?php
                     echo $this->Form->CheckBox('HideBD', T('Don't show DOB'), array('value' => '1'));
                ?>
            </td>
            <td>
                <?php
                     echo $this->Form->CheckBox('HideBY', T('Don't show year'), array('value' => '1'));
                ?>
            </td>
        </tr>
    </table>
</li>

But, after register Profile still clear. How to make it show DOB after register on a profile tab?
Sorry, for my bad english...And thanks for help!

Comments

  • hgtonighthgtonight ∞ · New Moderator

    The issue is that registering a new user uses the User model and the data you are capturing needs to be stored in the AboutMe model. You will have to hook into the entry controller registration successful event and look for your data. Then update the about me model.

    Something like below will get you started:

    public function EntryController_RegistrationSuccessful_Handler($Sender) {
      $FormValues = $Sender->Form->FormValues();
    
      // Use this to find your data
      decho($FormValues);
    
      $AboutMeModel = new Gdn_Model('AboutMe');
      $AboutMeModel->Save($FormValues);
    }
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • yeah...I'm not good at Vanilla. Could you write how can I do that? What files I need to change?

  • hgtonighthgtonight ∞ · New Moderator

    Are you experienced with PHP?

    You can learn more about plugin development on the community wiki: http://vanillawiki.homebrewforums.net/index.php/Practical_Example:_How_to_Extend_Existing_Forms

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

    peregrineUnderDog
  • A had some exp with php a long time ago... But I'm afraid this solution not for me. I haven't got time to learn how to write plugins for forum. Any ideas how to make it more simple??? Because this is the basic function of all forums I have ever seen exept Vanilla ;)... I haven't got any thought this will be so hard...

  • peregrineperegrine MVP
    edited December 2013

    @Dreyti said:
    A had some exp with php a long time ago... But I'm afraid this solution not for me. I haven't got time to learn how to write plugins for forum. Any ideas how to make it more simple??? Because this is the basic function of all forums I have ever seen exept Vanilla ;)... I haven't got any thought this will be so hard...

    you could look at this to get ideas:

    http://vanillaforums.org/addon/registrationrole-plugin

    short of this, if you don't have time, and if a volunteer doesn't have time, you may need to go the pay for what-you-want route. good luck.

    php was only created 19 years ago, so it wasn't too long ago in the scheme of things :)

    http://www.php.net/manual/en/history.php.php

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.