Album covers view facebook link broken on mobile.
-
John,
What’s up, I messaged you on fb last week with this but maybe i’m blocked or something! This is Spencer from SlickRemix, my brother Justin and I created Feed Them Social some years back. Funny how throughout the years we’ve found so many people using your plugin along with ours, and we’re in the same facebook developer threads when things are buggy.
Anyway someone brought to our attention that when using a mobile device our Album Covers View on Facebook Link was taking him to a broken page on Facebook. Turns out Facebook is reformatting the url for mobile and that was the reason.
This desktop link
https://www.facebook.com/album.php?fbid=10150592518056919&id=50043151918&aid=381507&m2w
Turns into this on mobile
https://www.facebook.com/media/set/?set=a.10150592518056919.381507.50043151918After taking a look at your example and noticing the link was broken as well I thought I would share how we resolved the problem so you can fix yours too if you like. Taking our original $FBlink link we just did some simple parsing.
$url_parsed = parse_url($FBlink, PHP_URL_QUERY);
parse_str($url_parsed, $params);
$new_album_url = str_replace(‘album.php?fbid=’.$params[‘fbid’].’&id=’.$params[‘id’].’&aid=’.$params[‘aid’],’media/set/?set=a.’.$params[‘fbid’].’.’.$params[‘aid’].’.’.$params[‘id’], $FBlink);All the best!
- The topic ‘Album covers view facebook link broken on mobile.’ is closed to new replies.