Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.

How-to use the UserMeta Table with my Plugin?

oliverraduneroliverraduner Contributing to Vanilla since 2010Switzerland ✭✭
edited September 2011 in Development
Hi there,

One of my Plugins is currently designed to add an extra row to the User DB-Table in order to save a custom user value. As I am assuming at the moment, this causes many troubles for users of my Plugin, because it will totally screw their Vanilla installation if this column does not yet exist in the DB-table.

I understood by following the development of Vanilla 2, that today there is a more "isolated" (sandbox?) way of doing this by using the UserMeta DB-Table. I did even look at some example plugins like EMailSubscribe and AboutMe, but honestly I didn't get rid of the DB integration they use.

Probably my problem is, that I "hack" today an additional filed into the existing /profile/edit/ popup (via "ProfileController_AddProfileTabs_Handler") and thus this automatically triggers the normal Profile-Save-SQL. Do I need to add my own Settings menu for a user, like it's done in the mentioned reference plugins?

Further, how does it work to write a user based entry to the UserMeta DB-Table and then read this value out when a) on this user's profile and b) read them all out for a global summary?

I would of course appreciate any hints to existing discussions, documentations, etc. as I was hopelessly lost when trying to search for myself :(

Thanks for any help guys!
Oliver

Comments

Sign In or Register to comment.