Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthormafro
    • CommentTimeMar 24th 2008 edited
     # 1
    Hey all,

    I recently followed the wordpress integration tutorial and setup a forum/blog hybrid. A bit more tinkering with the login/session stuff has made this quite seamless now.

    The problem im having is accessing Wordpress information from within Vanilla. It was my understanding (from the article) that I could map different DB columns into my User object like this, in conf/database.php:

    // Also map the Wordpress columns into Vanilla
    $DatabaseColumns['User']['display_name'] = 'display_name';

    However when I test in the forum the $this->Context->Session->User object doesnt have this field.

    Similarly, I tried to map a new $Definition in conf/language.php like so:

    $Definition['SignOut'] = 'Logout';
    And this doesnt display in Vanilla.

    Can someone give me a pointer here? Until I work out what's going on with the architecture of Vanilla, it's really difficult to debug.
    Thanks all!
    mafro
    •  
      CommentAuthorWallPhone
    • CommentTimeMar 24th 2008 edited
     # 2
    If you are mapping new items to the user object, it won't have the property until its been retrieved from the database, which means you will have to edit the library/Vanilla.Class.User.php file and add that line to the GetProperiesFromDataset() function. It's probably better to map the existing Vanilla property to the Wordpress naming convention--so assuming that the Wordpress' display_name column is basically the same as Vanilla's name property, you would map it this way: $DatabaseColumns['User']['Name'] = 'display_name';

    You're basically telling Vanilla to look for a column in the database called 'display_name' instead of Vanilla's default of 'Name'.

    Dictionary definitions should also be written in Vanilla's conventions like they are in language/English/definitions.php:$Context->Dictionary['SignOut'] = 'Logout';
    You only need to copy & paste the definitions you want to change to conf/language.php
    • CommentAuthormafro
    • CommentTimeMar 25th 2008
     # 3
    Thats great WallPhone, thanks for the reply. Very concise and to the point, 5 stars.

    I had clearly just got the Dictionary bit wrong - but I had assumed with the Database mapping columns stuff that the SQL was built dynamically from the column mappings you create in the configuration.. And wouldn't that make more sense?

    Anyways.. I got it working using your example above of mapping into 'Name'. It would be more useful for me if I could not overwrite the login name, and say for example map onto a different Vanilla column:
    $DatabaseColumns['User']['FirstName'] = 'display_name';
    However this doesn't work..
    Any input appreciated.
    mafro
Add your comments
    Username Password
  • Format comments as