This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <li class='<?php echo(isset($navigationActiveState['translation']) && $this->request->named['segment_id']=='default' ? 'active' : '') ?>'> | |
| <?php echo $this->Html->link('<i class="fa fa-table"></i> Translations Q8', array( | |
| 'plugin' => 'translate', | |
| 'admin' => true, | |
| 'controller' => 'backend', | |
| 'action' => 'index', | |
| 'segment_id' => 'default' | |
| ), array('escape' => false)); ?> | |
| </li> | |
| <li class='<?php echo(isset($navigationActiveState['translation']) && $this->request->named['segment_id']=='f24' ? 'active' : '') ?>'> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static function getClosestTimezone($lat, $lng) { | |
| $diffs = array(); | |
| foreach(DateTimeZone::listIdentifiers() as $timezoneID) { | |
| $timezone = new DateTimeZone($timezoneID); | |
| $location = $timezone->getLocation(); | |
| $tLat = $location['latitude']; | |
| $tLng = $location['longitude']; | |
| $diffLat = abs($lat - $tLat); | |
| $diffLng = abs($lng - $tLng); | |
| $diff = $diffLat + $diffLng; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DOES NOT WORK WITH ACCESS TOKENS FROM MOBILE | |
| $fbUser = (new \Facebook\FacebookRequest( | |
| $session, 'GET', '/me?access_token=' . $fbAccessToken | |
| ))->execute()->getGraphObject(\Facebook\GraphUser::className())->asArray(); | |
| WILL WORK | |
| $session = new \Facebook\FacebookSession($fbAccessToken); | |
| $fbUser = (new \Facebook\FacebookRequest( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function ensureFbUser($fbAccessToken) { | |
| try { | |
| $fbUser = (new \Facebook\FacebookRequest( | |
| $session, 'GET', '/me?access_token=' . $fbAccessToken | |
| ))->execute()->getGraphObject(\Facebook\GraphUser::className())->asArray(); | |
| $user = $this->findByFbId($fbUser['id']); | |
| if(empty($user)) { | |
| $this->create(); | |
| $user = $this->save(array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Info": { | |
| "Records": "1", | |
| "RequestDateTime": "12-06-2014 10:24:32", | |
| "Server": "live.ultimate.dk @ resultsdb1", | |
| "ProcessingTime": "0.4977", | |
| "Event": "KMD IRONMAN Copenhagen 2013", | |
| "Method": "resultsinfo", | |
| "APICacheKey": "0123456789" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NJSONObject records = json.optNJSONObject("Records"); | |
| //Check if null | |
| NJSONObject record = records.getNJSONObject("Record"); | |
| //Check if null | |
| NJSONObject tracking = record.optNJSONObject("Tracking"); | |
| //Check if null | |
| String gpsPosition = tracking.optString("GPSPosition",null); | |
| if(gpsPosition != null){ | |
| String[] gpsPositionArray = gpsPosition.split(","); | |
| double lat = Double.parseDouble(gpsPositionArray[0]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String gpsPosition = tracking.optString("GPSPosition",null); | |
| if(gpsPosition != null){ | |
| String[] gpsPositionArray = gpsPosition.split(","); | |
| double lat = Double.parseDouble(gpsPositionArray[0]); | |
| double lng = Double.parseDouble(gpsPositionArray[1]); | |
| //Save a latlng object on user | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Info": { | |
| "Records": "1", | |
| "RequestDateTime": "11-06-2014 21:13:13", | |
| "Server": "live.ultimate.dk @ resultsdb1", | |
| "ProcessingTime": "0.1279", | |
| "Event": "Holmenkollmarsjen 2013 - Live Demo", | |
| "Method": "resultsinfo", | |
| "APICacheKey": "3543656546" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dafadf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| test: "test" | |
| } |
NewerOlder