Installation, Configuration, & Upgrades  :: 
Optional Fields to Required?
 Top

  • Hi folks, I'm a new user of PN, and so far I've loved the ease of admin and setup. But I'm afraid I've run into a little hinderance in my user setup.
    I'm trying to get two things done:
    1) Get a dropdown list. A new one. No clue where to find that.
    2) Make certain fields required (like a the dropdown list above, and maybe one of the text fields).
    I'm not sure if either can be done from what I can tell, and I'm sure it'll require some kind of coding, but I'm willing to do whatever it takes.
    If anyone replies, I thank you a head of time!

    -Bryan Witherspoon-
    http://ramshead.harshmage.com/new/
  • Anyone know? I'm also interested in this.
  • Well, to get a drop down, you'd have to hack the USer system I think either X-User or pncUserHack one or both will help with the required info things.
  • I am interested in doing this also... but like mhalbrook said, it would require a hack. Unfortunately the extra user info doesn't have this functionality... I may be forced by a corporate client to develop a solution for this yet... if so I will post on the forums :)

    keep searching, someone may have pulled it off, if you find something I would be interested to know :)

    good luck
  • ok... just so happens the cookie crumbled and I had to start making steps towards making optional user info compulsory. I havn't got it compulsory as such, but I've tidyed up the new user page to look a lot nicer and force the user to go over the optional fields before clicking NewUser (submit).

    If you're interested, code hack below

    You can edit the language file and user.php to say that the fields are required, however they obviously wont be enforced by PN if someone omits a field.

    See it in action here

    file = modules/NS-NewUser/user.php starting line 131

    (double check the line number to start, I have made other changes to this file, it will be around 131 if not 131)

    Code

    echo "<tr>"
            ."<td align='right'>&nbsp;</td>"
            ."<td><input type=\"hidden\" name=\"module\" value=\"NS-NewUser\">\n"
            ."<input type=\"hidden\" name=\"op\" value=\"finishnewuser\">\n"
        //  Original New User (submit button) location, inbetween required and compulsory items
        //  ."<input type=\"submit\" value=\" "
        //  . _NEWUSER . "\">\n"
            . "</td>"
            ."</tr>\n";

        echo "<tr>"
            ."<td>&nbsp;</td>"
            ."<td><font class=\"pn-normal\">" . _COOKIEWARNING . "</font></td>"
            ."</tr>";

        if (pnConfigGetVar('reg_optitems')) {
           //Cut out all the 'as a registered user you blah blah blah' can change to put custom info in, or leave... I found that editing the language file for these variables doesn't work. Havn't found a solution so far, but its easier for me to just edit the code.  Other people will prefer to edit the Lang file, I'm sure someone's encountered this before, search around.
    /*      echo "<tr>"
                ."<td>&nbsp;</td>"
                ."<td><font class=\"pn-normal\"><b>" . _ASREGUSER . "</b></font><br>\n"
                ."<font class=\"pn-normal\">"
                ."<br />- " . _ASREG1
                ."<br />- " . _ASREG2
                ."<br />- " . _ASREG3
                ."<br />- " . _ASREG4
                ."<br />- " . _ASREG5
                ."<br />- " . _ASREG6
                ."<br />- " . _ASREG7
                ."</font></td>"
                ."</tr>\n";

            echo "<tr>"
                ."<td>&nbsp;</td>"
                ."<td><font class=\"pn-normal\"><b>" . _OPTIONALITEMS . "</b></font></td>"
                ."</tr>\n" . ""; */

                // Display optional items to register
            optionalitems();
        }
    //this is where newuser btn should be
          echo  "<tr><td>&nbsp;</td>"
                ."<td>"
                . "<input type=\"submit\" value=\" "
                . _NEWUSER . "\">\n"
                . "</td>"
                ."</tr>\n";

        echo "</table>\n";
        echo "</form>\n";
        CloseTable();
        include 'footer.php';
    }
  • Ok, ok, I'll say it : pncUserHack : http://dev.pnconcept.com/txt/pncua16instructions_eng.txt

    ;)

    --
    Chestnut !
    Support via Private message won't be answered...
    http://dev.pnconcept.com
    http://www.postnuke-france.org
  • ooooo looks very interesting.... thanks Chestnut
  • works great chestnut.

    I dont think this is an issues cause by your hack, but when a user goes to edit their information, the language associations for dynamic user data dont show properly.

    i.e. it displays "_USERNUM" as opposed to "Number of Users" (as defined in the new-user language file)

    I added this to the user language file also but it didn't make a difference. (note this works fine when the user actually registers on the registration page)

    *confuzzled* :?

    EDIT
    : Search and you shall find http://forums.postnuke.com/index.php?name=PNphpBB2&file=viewtopic&t=20674&highlight=dynamic+user+data :D
  • Some constants were moved in the pn726 release and they were moved to language/xxx/global.php or user.php or in the module the global.php of the module... can't remember.

    --
    Chestnut !
    Support via Private message won't be answered...
    http://dev.pnconcept.com
    http://www.postnuke-france.org
This list is based on the users active over the last 60 minutes.