Refresh Your SBR Page - New Version - Just Now

New Version - Just Now - Refresh Your SBR Page (F5)

Facebook declines name requests for names after a short period so the names disappeared. (Now Fixed (for the core activity menu only not the pages like game page and player page that will be next))

New Changes:

  • 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

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)

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)

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

player pages updated with db names and graph api icons

game VS (top) panel - names from db - images from graph api - DONE

player page still has a flashy name. Thats almost all thats left of the flashy! I'll fix it later.

FIXED

it does need to use db names so i'll get to it in a little bit here

FIXED

randomness