Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Predefined User-Attributes Extension

Hi.
I wrote an extension which allows administrators to predefine attributes. Administrators may add custom fields like "Phone-Nr." or "Shirt-Size" (Respect your users privacy) to the Accounts-Page. User may fill this information on Appliance and on the Account "Personal Information" page.

http://twoantennas.com/sr/wp-content/files/2006/04/PredefinedAttributes.php.zip

http://lussumo.com/addons/?PostBackAction=AddOn&AddOnID=20 (edited)

The extension uses the field "Attribute" in "User" table and disables user-defined "Label"-"Value" pairs. The "User" and "UserManager" classes are extened. The "CustomIdentityForm" and "CustomApplyForm" classes are overwritten to handel user inputs.
In the first version the extension has to be configured in the php-file.

I'm working with Vanilla since a short time. This is my first extension. I hope to get some feedback and tipps in this forum.

Thanks,
Michael
«134

Comments

  • I hope you'll be adding this to the new repository?
  • MarkMark Vanilla Staff
    Sounds great - you should upload it to the Vanilla Add-Ons directory :)
  • edited April 2006
    /me shouts ECHO! and listens to it reverberating round the room.
  • MarkMark Vanilla Staff
    doh~!
  • I have no screenshot yet and will add it tomorrow.
  • This is for 0.9.2?
  • Yes, Version: 0.9.2 Where do I get 1.0?
  • A couple days from now, you'll be able to get it right here.
  • @michaelontheroof

    Very nice extension - however without realizing it I killed some other user defined labels that were already there :-) no prob though.

    Make sure you get yours up in the new add-ons area!
  • Now in the add-ons directory:
    http://lussumo.com/addons/?PostBackAction=AddOn&AddOnID=20

    @ccmehil: I added a warning to the description, which will be displayed in the extension manager. Sorry for your losses.
  • No big lose, helps if I read first though :-) again no biggie and excellent extension.
  • I added two new functions to the extension: 1) Attributes may now be declared as hidden, and are then only visible for administartors and the user itself. 2) The type of a form element for an attribute can be defined as "select", "radio" or (text)"input". So <select>-fields and Radio-Buttons are possible with custom values. ..Thanks to Vanillas Select and Radio class.. @Bergamont: Are there many differences between extension development for 0.9.x and 1.0? Is it possible to check out an unstable 1.0, anywhere? I'm now going to write an export extension for user data and it would be nice to make sure it'll work in 1.0, too.
  • you can grab the latest copy of 0.9.3 off the svn, which is the version being beta tested over at the vanilladev site, and once all the bugs have been ironed out will be released publically as v1. There will be no major code changes (besides eradicating bugs, i suspect 99% of which will be part of the theme side anyway) between now and then so if you want to code some extensions for v1 then thats your best bet.
  • ithcyithcy New
    edited April 2006
    what minisweeper said.

    the major difference is that in 0.9.3 and 1.0, extensions reside in their own folder.
    in 0.9.2 it was like: extensions/MyExtension.php
    in 1.0 it's like: extensions/MyExtension/default.php.

    i've changed several 0.9.2 extensions to the new format just by renaming them and so far they've all worked fine.

    also this thread has information about the SVN.
  • minisweeper, ithcy,
    thank you for this info and the right links
  • I released Predefined Attributes Extension for Vanilla 1 over here: http://lussumo.com/addons/?PostBackAction=AddOn&AddOnID=20.

    Any suggestions and feedback?
  • I've tried the Extension for Vanilla 1 and I only get the following error:

    Parse error: parse error, expecting `')'' in /home/webtree/htdocs/vanilla/extensions/PredefinedAttributes_v0.3.1/default.php on line 102
  • Hello hutstein,

    i don't have this error. In line 102 is the Constructor
    
    function PredefinedAttributes(&$Context, &$User = null) {
    
    Which php Version are you running?
    In old version you may have to change it to
    
    function PredefinedAttributes(&$Context, &$User = false) {
    
    Grüsse aus Hamburg*
  • It's PHP Version 4.3.3

    i've changed it to
    function PredefinedAttributes(&$Context, &$User = false) {
    but it doesn't work. I get the same error.

    If i Change it to
    function PredefinedAttributes($Context, $User = null) {
    I don't get this error, but the extension doesn't work...

    Grüsse aus Deggendorf, Bayern
  • I'm sorry, I'm not sure why it won't work for you

    Does anyone else got the same error on Line 102?
Sign In or Register to comment.