how to : force a presentation for a user when he register  Bottom

Go to page 1 - 2 [+1]:

  • If you wan't to force a user to present himself when he registered on your zikula,you can do it easily in two steps.

    step 1 :

    Create a custom field "_PRESENTATION", and check the field "required" in the dynamic field

    index.php?module=Profil&type=admin

    step 2 :

    if you wan't to automatically create a message when the user registered

    add the following code just the step after the user is registered

    in "users_user_finishnewuser" after

    Code

    after  (!$registered) {
            LogUtil::registerError(_USERS_REGISTRATIONFAILED);
        } else {


    add

    Code

    //log the user
         pnUserLogIn($uname, $pass, false);
         $forum_id=2; // forum id where the message will be stored
        // we create the subject
         $topic_id = pnModAPIFunc('pnForum', 'user', 'storenewtopic',
                                      array('forum_id'         => $forum_id,
                                            'subject'          => "presentation of ".$uname,
                                            'message'          => $dynadata['_PRESENTATION'],
                                            'attach_signature' => false,
                                            'subscribe_topic'  => false));




    edited by: mumuri, Jan 10, 2009 - 06:55 AM
  • Can you make the same thing for PNphpbb2 forum entry?

    --
    [ stevencopley.com ]
  • i think it's possible but i don't know the module PNphpBB2 module, perhaps you can ask their team.

    note that this code is very ugly, in order to do it in more clean way, you can create hook (indeed, there is call to pnModCallHook in the "users_userapi_finishnewuser" function, i didn't see it before)

    Code

    pnModCallHooks('item', 'create', $uid, array('module' => 'Users'));


    In order to do this

    registering the hook

    register a hook in your pnInit function (pninit.php YourModule_init() )

    Code

    if (!pnModRegisterHook('item',
                               'create',
                               'API',
                               'YourModule',
                               'user',
                               'create')) {
       
            return false;
        }



    creating the hook

    create a function "YourModule_user_create" and implements its. Note that you can have the user info with his UID.

    (sample in the EZComments module)
    http://code.zikula.org/core/ticket/839#comment:1



    edited by: mumuri, Jan 11, 2009 - 07:37 AM
  • I'm looking for the place to edit and change. I'm looking in Profile but I just do not see? Can you direct us as to what module is used to add?

    TIA...

    mumuri

    If you wan't to force a user to present himself when he registered on your zikula,you can do it easily in two steps.

    step 1 :

    Create a custom field "_PRESENTATION"
    Check the field "required"
    In the dynamic field index.php?module=Profil&type=admin
  • in the admin of the "Profile" module, there is a lot of fields (occupation, interest etc ...), you just have to create one more field, in this module.
  • Nevermind.. And where's my delete button in the template?



    edited by: HalbrookTech, Jan 12, 2009 - 03:36 AM

    --
    Home Page | Find on Facebook | Follow on Twitter
  • It looks like you have somewhat detailed 3 steps in Step 1:

    Step 1) Create a custom field "_PRESENTATION"

    Note: In the above I have found that in Profiles using link 'Create Account Panel Property', and there is a field titled 'Property label' which I have added '_PRESENTATION' (less the quotes).

    Step 2) Check the field "required"

    Note: In the above I have found the field titled 'Required'. I was unable to place a check in there so I'm fairly sure it is supposed to be 'Yes'.

    Step 3) In the dynamic field 'index.php?module=Profil&type=admin'

    Note: in the above I can not find a field titled 'Dynamic' to place 'index.php?module=Profil&type=admin' (less the quotes) in?

    TIA...



    edited by: mesteele101, Jan 13, 2009 - 12:40 AM
  • No, there's only two steps. Step 1, add the property. Step two modify the code.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • So what is this below? I'm reading this and I'm confused.

    You said in Step 1 all I need to do is add the Property which I'm guessing is '_PRESENTATION', and that is it?

    In the below, the original poster wants more done in step 1?

    Code

    step 1 :

    Create a custom field "_PRESENTATION", and check the field "required" in the dynamic field

    index.php?module=Profil&type=admin


    It looks like in the original post, step 2 is optional.

    Code

    if you wan't to automatically create a message when the user registered

    add the following code just the step after the user is registered


    I'm confused... icon_confused

    Just below where you add the '_PRESENTATION' it states to add a define in a global.php to go along with the '_PRESENTATION'. Doing this really screws up some things... I'm guessing the global.php that you create as instructed supersedes some other global.php somewhere.

    As I see it; what I should be doing is:

    1) Go into the profile module
    2) Select the Create Account Panel Property link
    3) Add _PRESENTATION to the field titled 'Property label'
    4) Click the green checkmark to create the new property label

    Now, if I want it to send the profile to a predefined forum then I would add the code in Step 2, and if I really do not care post profiles to a forum I can omit this?

    What exactly is this going to force the new user to do?

    TIA...



    edited by: mesteele101, Jan 12, 2009 - 02:19 PM
  • Well, if you don't want to do step 2, then that kinda kills the whole point of the project doesn't it? I dunno, I'm still trying to get my American English mind around exactly what we're trying to do. I THINK it's force an introduction post in a forum when a new user signs up, right?

    --
    Home Page | Find on Facebook | Follow on Twitter
  • I was thinking it would force new users to complete their profile?

    I thought there was a already an option to display or send a post for a new user?

    I'm still confused icon_rolleyes
  • Maybe I should do the process and see what happens :)

    --
    Home Page | Find on Facebook | Follow on Twitter
  • no, you don't have too, HalbrookTech ;), it's right what you've said

    Code

    it's force an introduction post in a forum when a new user signs up


    and ... in order to do this you have to create a mandatory field in the profile module

    why because, the validation process is managed by the Zikula Core
    --------
    then in the second step, you create physically the message in pnForum
  • OK, now it is making some sense. The requirement is pnForum. :(

    I'm still a little fuzzy on the correct procedure to implement this hack. However, I'm not running pnForum at the moment.
  • So you'd register a hook, in pnForum/Dizkus and create the hook function, which would basically be a redirect to the create post function right?

    --
    Home Page | Find on Facebook | Follow on Twitter

Go to page 1 - 2 [+1]:

This list is based on users active over the last 60 minutes.