I made a new database table for saving names
New PHP that adds names one-by-one as people arrive
Used a PHP script with the Facebook Graph API call listed below to populate the names for all the ids that were already in the players and games database tables that are already present
Added PHP and MySQL joins to send the new name data through to the SBR game page javascript
The page javascript was actually mostly ready to accommodate the name data I mostly just had to comment out all the javascript and PHP calls to get names from Facebook that seemed to be all over the place and are no longer needed
That's it for today, but: Upcoming plans for the next upcoming changes will either be to fix the jumpy data on player, game, top ranked player pages and/or the bug in B.H. Baby's Beeversi game and/or both[DONE]
So the way it's getting names now is one by one with a call like this
$comma_separated_list_of_ids=implode(',',$_player_ids_array); $url = 'https://graph.facebook.com/?access_token='.$access_token.'&ids='. $comma_separated_list_of_ids.'&fields=name,first_name,last_name'; //***** you can put 'id' instead of 'ids' for just getting one-by-one. The FB return limit on multiple names is 50 at a time, and you can get more with subsequent requests but then there is also another hourly limit that cut responses off if you request too many during a certain period ***** $info = json_decode(file_get_contents($url), true);
Turn ids into id if you just want one.
This is the main way (I think maybe the only way now) that SBR is getting names from Facebook.
(But just one-by-one with one id at a time and 'id' instead of 'ids')
This is actually the line copied from the call I used to get groups to populate the database (up to 50 at a time) - and the call to get the single name is exactly like it except that ids is id instead. Its the fb graph api. I think its correct but they change it on me every couple years it seems like so who knows anyways that is currently the way that Super Bomb Reversi gets peoples facebook names from facebook (it is core functionality this may help you to build your own facebook app I dont know)
Comments
arlon
Sun, 08/27/2017 - 14:11
Permalink
online players page, active players page, top ranked..fixed!
I just fixed all the side pages except the games pages thats next (its still flashy)
online players - no longer flashy and uses db names
active players - no longer flashy and uses db names
top ranked players - no longer flashy and uses db names
top ranked players no moves waiting timeout levels considered - no longer flashy and uses db names
ranking rules - no longer flashy
next: games pages (get rid of flashiness)
arlon
Sun, 08/27/2017 - 14:15
Permalink
games page accidentally fixed from side effects of fixing others
games page-went to fix it - its no longer flashy - it was using the same library i just fixed. (extra whitespace at the bottom of an included php library file haha!)
The names still come from FB. Not the db. but it works! it doesn't 'keep updating' like it did (the flashiness is gone!) so its still going to run out of names after people look at that for too long (i'm going to fix it maybe still today but it's less pressing so i'm taking a break for a minute)
arlon
Thu, 09/07/2017 - 21:24
Permalink
games pages updated with db names
games pages updated with db names starting just now.
next up is: game VS (top) panel - names from db - images from graph api - unranked players ranks not showing up as 'UNDEFINED' rank
player pages updated with db names and graph api icons
bh baby beeversi bug
arlon
Fri, 09/08/2017 - 23:21
Permalink
player pages updated with db names and graph api icons
player pages updated with db names and graph api icons
arlon
Sat, 09/09/2017 - 18:37
Permalink
game VS (top) panel-names from db - images from graph api-DONE
game VS (top) panel - names from db - images from graph api - DONE
arlon
Sun, 08/27/2017 - 14:17
Permalink
haha
player page still has a flashy name. Thats almost all thats left of the flashy! I'll fix it later.
arlon
Fri, 09/08/2017 - 23:22
Permalink
FIXED
FIXED
arlon
Sun, 08/27/2017 - 14:28
Permalink
no names on games page
it does need to use db names so i'll get to it in a little bit here
arlon
Fri, 09/08/2017 - 23:22
Permalink
FIXED
FIXED
100001431277194...
Tue, 09/19/2017 - 23:17
Permalink
I kinda liked it when it was all jumpy but then I'm a grasshoppe
oh well