Skip to content
This repository has been archived by the owner on May 3, 2018. It is now read-only.

Commit

Permalink
add human readable time to issued_at value
Browse files Browse the repository at this point in the history
  • Loading branch information
Colm Doyle committed Jan 15, 2013
1 parent df6c30d commit 748a330
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion canvas/index.php
Expand Up @@ -59,6 +59,16 @@
$token_expiry_human = '';
}

if ($signed_request['issued_at']){
$token_issue = $signed_request['issued_at'];
if (is_int($token_issue)) {
$token_issue_human = '(' .date("M j Y, Hi e", $token_issue). ')';
}
} else {
$token_issue = 'No issue time provided';
$token_issue_human = '';
}

if ($signed_request['user_id']){
$user_id = $signed_request['user_id'];
$user_name = json_decode(curl_call('https://graph.facebook.com/'.$signed_request['user_id']), true);
Expand Down Expand Up @@ -329,7 +339,7 @@
Issue Time
</span>
</td>
<td><?php echo $signed_request['issued_at'];?></td>
<td><?php echo $token_issue .' '. $token_issue_human;?></td>
</tr>
</table>
</div>
Expand Down
12 changes: 11 additions & 1 deletion page-tab/index.php
Expand Up @@ -72,6 +72,16 @@
$token_expiry_human = '';
}

if ($signed_request['issued_at']){
$token_issue = $signed_request['issued_at'];
if (is_int($token_issue)) {
$token_issue_human = '(' .date("M j Y, Hi e", $token_issue). ')';
}
} else {
$token_issue = 'No issue time provided';
$token_issue_human = '';
}

if ($signed_request['user_id']){
$user_id = $signed_request['user_id'];
$user_name = json_decode(curl_call('https://graph.facebook.com/'.$signed_request['user_id']), true);
Expand Down Expand Up @@ -277,7 +287,7 @@
Issue Time
</span>
</td>
<td><?php echo $signed_request['issued_at'];?></td>
<td><?php echo $token_issue .' '. $token_issue_human;?></td>
</tr>
<tr>
<td>
Expand Down

0 comments on commit 748a330

Please sign in to comment.