HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Where do i findout Current user data

I am new to vanilla but i have web developer . I have a task to display user photo , name , karma ,etc detail on home page...i do not know where i should go

Comments

  • If you have to ask where to find the username, you don't have a developer. Whatever that guy said that his qualification is, search for somebody with a different profile. That person most probably will not deliver.

    But anyway, maybe I'm unfair and you maybe got the question wrong. Here are some information that should be obvious for a developer:

    Vanilla uses an autowiring router

    Configuration can be found the /conf/config.php file

    Views are in /applications/whatever/views (as a reference only! If he starts changing files there, fire him immediately! )

    All views can be overridden in a theme (no view should, though)

    It would be best to clone a simple theme

    Code will require a themehooks file. To "enhance" a view with "karma" info, you would write an event handler that injects data to the controller


    Well, that's for a start. Tell him he should register an account here and ask his questions directly. He might be a little lost how to start or how to solve specific problems. I would prefer he starts a discussion for that where he can mention me, but I would also answer to PMs

  • Oh, could it be that you are the developer for that task:

    Remember that everything you do needs to be done in your own theme folder. Read everything in the docs about theming

  • Sorry for the first response, I thought you were the guy who wanted to hire somebody for his theme and now is asking questions for his developer...

    So back to your initial question. I recommend that you download the Vanilla source code and take it as a reference for what I'm telling. There's a helper function called userPhoto. It's in /library/core/functions.render.php and you might find more interesting functions there.

    I think you have renamed the User.Score column to karma. And that's already the answer.


    But if you need that for the homepage, you might be on the wrong track. I think what you would need would be a new view for the me module. Because in a normal page call, that info is already there. It's just displayed in a different way. And that's where you have to start.

    Let's say you have a theme called "aepel" (forgive me aepel if this is not "your" developer ;-) ) then copy /applications/dashboard/views/modules/me.php to /themes/theme-aepel/views/modules/me.php and edit that file so that it shows what you need to see. You will find that this view itself already is a good reference.

    Another tip: stick to Vanillas css naming conventions and override the existing css rules (yes, that will require a lot of "!important"s)

  • Oh yes, and if this module is not the right position, take a look at the default.master.tpl files that you find in the theme subfolders.

Sign In or Register to comment.