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

24

Comments

  • that has to be an error in the array definitions above line 102. post your $Attributes array for us, hutstein?
  • Good idea ithcy.
    I didn't thought that far..
  • ithcyithcy New
    edited May 2006
    incidentally, the extension doesn't work on my local vanilla either, but it's not the same problem :)
    it won't install itself and gives no errors. i'm trying to figure out why. (php 5.1.1/ mysql 5.0.18)
  • edited May 2006
    I hadn't changed the $attributes array it's exactly like i've downloaded the extension:

    Sorry I don't know how to post code formatted... now i know it
    var $Attributes = array( array( "Label" => "Phone-Nr.", "Required" => true, "Value" => "", "Hidden" => true, "Description" => "A short description will be displayed on the personal Information page only." ), array( "Label" => "T-Shirt-Size", "Required" => false, "Value" => "M", "Hidden" => false, "Type" => "Select", "Data" => array("XS", "S", "M", "X", "XL") ), array( "Label" => "City", "Required" => false, "Value" => "m", "Hidden" => false, "Type" => "Select", "Data" => array("Tokio", "Mexico", "New York", "Mumbai", "Sao Paulo", "Delhi") ) );
  • put <code></code> tags around it

    that's funny.. have you changed anything else ?
  • No I haven't changed anything else, I only renamed the extension to default.php and created a folder "PredefindedAttributes"
  • when I change it like this, it works:
    function PredefinedAttributes(&$Context, &$User) {

    is the default value false or null important?
  • Thanks to ithcy for taking the time to try an installation. Did you call "settings.php?PostBackAction=InstallPredefinedAttributes" after enabling the extension in the extension manager page? You need to do so, so the "PredefinedAttributes" column will be created in the Users table.

    hutstein, right: the filename has to be default.php.
    Parse error: parse error, expecting `')'' in /home/webtree/htdocs/vanilla/extensions/PredefinedAttributes_v0.3.1/default.php on line 102
    is a typo error I don't have in the file.
  • @michaelontheroof: yes, i did that before, but it still didn't install.
    but i changed line 102 to &$User=false and did it again, and it works!
    thanks for the tips :)
  • p.s. i have a request for the next version: checkboxes!
    thanks again.
  • About line 102:

    I've tried this:
    function PredefinedAttributes($Context, $User = false) { $this->Context = $Context; $this->User = $User; $this->Context->DatabaseColumns['User'][$this->ColumnName] = $this->ColumnName; }

    Anyway, it doesn't work.

    Still waiting for new version...
    ---
    PS
    Ooops. Working!
  • Guys.

    I installed this extension but no matter what I did it did not work at all. I need to remove all changes it made on other files because my forum does not work now, but what files were effected? Does anyone have an idea?

    Levy
  • Follow up on previous post:

    I missed an essential post from hutstein

    function PredefinedAttributes(&$Context, &$User) {

    My forum works atleast :)

    Thank you and keep up the good work guys.... I' m loving this.
  • edited June 2006
    .. and another one.

    When I try to install the extension as described after activating it, I get this error msg:

    Warning: Missing argument 2 for predefinedattributes() in /srv/vefir/personal/levy/weareone/forum/extensions/PredefinedAttributes/default.php on line 102 PredefinedAttributes.Install(); The error occurred on or near: You have an error in your SQL syntax near 'COMMENT 'Created by Predefined Attributes Extension ' AFTER Attributes' at line 3

    I checked the DB and the column has not been inserted to the USER table. Any ideas on how to get this installed?

    Levy
  • Hi levy, i'll check any reasons for your problems tomorrow. And (to mark) add a read me file finally...
  • Levy,
    i uploaded a new version of the extension:
    function PredefinedAttributes(&$Context, $User = false) {
    should be the best solution for the constructor. The 2nd argument has to be optional.

    The database errors results from the "Missing argument 2" error you got first. Without this error the SQL Query will work.

    but what files were effected?
    No other files are changed by the extension.

    Hope it'll finally work for you.
  • @michael: thx for the extension! I have a problem, however. After activating the extension I get this error: Parse error: syntax error, unexpected '=', expecting ')' in /hsphere/local/home/tools/tools.web.surftown.se/storaa/forum/extensions/PredefinedAttributes/default.php on line 102 It shows on every vanilla page - I needed to remove the extension manually in my extensions.php file to bring the forum alive again. Any ideas?
  • Hi Thomas,

    maybe you have an error in the var $Attributes array on line 53.
    Did you changed the Attributes definition in the Array.

    Is the error still there on a 'clean' installation (without changes) of the extension?

    Michael
  • Suggestion: the fields should be searchable from the 'search users' functionality
  • just thinking some more on this... would it be possible to put the data straight into the existing users attributes field instead?
Sign In or Register to comment.