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.
Options

Use Vanilla for external profiles

edited August 2006 in Vanilla 1.0 Help
Hi! I want to show the users of one group on an external page in a different way - as an book :-) That means two profiles per page and a navigation to move forewards and backwards. How can I create a template for that and how can I call this template on an external page? Thanks for any advice!

Comments

  • Options
    edited August 2006
    Okay - "all" I need is a funktion which lists the real name and the predefined attributes and can be called with a user-id like this:

    image

    But I cant't figure out how to solve this. I think for an experienced programmer this is no problem at all, but for me....

    Thanks for your help!
  • Options
    NickENickE New
    edited August 2006
    If you mean the typical user info, then use the UserManager::GetUserById() function and retrieve the data from the User object. If you're referring to the predefined attributes extension, then it appears the extension adds a colum in the LUM_User table called PredefinedAttributes, which contains a serialized array. You could probably use delegates to get this along with the normal user info when GetUserById is called.
  • Options
    If you're referring to the predefined attributes extension
    Yes, I do - I think I'm able to list the typical user info, but not that kind of array...
  • Options
    All you have to do is retrieve the string, send it through unserialize(), then loop through it displaying each item.
  • Options
    Thank you again - I had a look on the predifined attributes extension and managed to return some values:

    $data = unserialize($row_Recordset1['PredefinedAttributes']); unserialize($data);
    returns
    Array ( [0] => Array ( [Label] => Phone-Nr. [Value] => 030 ) [1] => Array ( [Label] => T-Shirt-Size [Value] => M ) )

    there seems to be an array inside the array :-(
  • Options
    You only need to call unserialize once, and to loop through the info is as simple as:
    for($i = 0; $i < count($data); $i++)
    	echo($data[$i]['Label'].': '.$data[$i]['Value']);
  • Options
    Ahhh! Thanks a lot, that's it!

    I'll publish the result when I'm done!
  • Options
    Good luck with that idea!
  • Options
    Good luck!
This discussion has been closed.