Loading in extra data

Status
Not open for further replies.

Jerry

vBulletin.com Staff
Joined
Feb 4, 2004
Messages
62
Hey all, I've got a task to deal with ........ I'm integrating a XF board with a Facebook game and visa versa.

First step is that I need to get some data from the game database so I can use it in the message_user_info template (show the level & awards, give links to game profiles for admins etc).

So I need to get xf_user_external_auth.provider_key (the facebook ID) and then use that to get the player data from the game database.

Though where to load it in and how to grab the extra data ?

I'm all ears :)
 

Cezz

OMG Member
Joined
Sep 24, 2010
Messages
581
Hey all, I've got a task to deal with ........ I'm integrating a XF board with a Facebook game and visa versa.

First step is that I need to get some data from the game database so I can use it in the message_user_info template (show the level & awards, give links to game profiles for admins etc).

So I need to get xf_user_external_auth.provider_key (the facebook ID) and then use that to get the player data from the game database.

Though where to load it in and how to grab the extra data ?

I'm all ears :)

It would have to be a full addon, I recommend hooking to the template hook for message_user_info_extra, the $user array is passed with the hook so you would then need to do a call to whatever class deals with the facebook auth or maybe directly query the DB using the userID that is passed... you can then parse this data however you want and attach your extra info to the end of that hook!
 

ragtek

OMG Member
Joined
Jul 4, 2007
Messages
149
It would have to be a full addon, I recommend hooking to the template hook for message_user_info_extra, the $user array is passed with the hook so you would then need to do a call to whatever class deals with the facebook auth or maybe directly query the DB using the userID that is passed... you can then parse this data however you want and attach your extra info to the end of that hook!
Hm, if you have 50 posts per page from 50 different people, this would add 50 additional queries:D

I would try to cache the data
OR
grab as first the poster userids from the thread ( maybe postmodel->getPostsInThreadSimple, or i would prefer a own method with userid + xf_user_external_auth.provider_key) then get the posters data from the game database and save them in the local cache, and then use the hook to show them^^
 

Jerry

vBulletin.com Staff
Joined
Feb 4, 2004
Messages
62
All the game player data will be in memcache, so 50 hits might not be a problem.

Cheers.
 

Cezz

OMG Member
Joined
Sep 24, 2010
Messages
581
Hm, if you have 50 posts per page from 50 different people, this would add 50 additional queries:D

I would try to cache the data
OR
grab as first the poster userids from the thread ( maybe postmodel->getPostsInThreadSimple, or i would prefer a own method with userid + xf_user_external_auth.provider_key) then get the posters data from the game database and save them in the local cache, and then use the hook to show them^^

I think it would be important to use a decent model and utilize proper caching, then the additional query's wouldn't make that much of an impact...
 

The Pet Board

OMG Member
Joined
Aug 23, 2011
Messages
86
If you get this working, I would love to see a live site to see what is possible. If you share the add-on you make and ask for donations you would probably make your development costs back easily since many people on xenforo.com are looking for an arcade add-on or something similar!
 
Status
Not open for further replies.
Top