secret
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
$last_reply_time = 0;
if (isset($comments[(count($comments) - 1)])) {
$last_reply_time = strtotime($comments[(count($comments) - 1)]->comment_date_gmt);
}
else if (count($social_items)) {
$latest_item = null;
foreach ($social_items as $service => $items) {
foreach ($items as $comment) {
if ($latest_item === null) {
$latest_item = strtotime($comment->comment_date_gmt);
}
else {
$time = strtotime($comment->comment_date_gmt);
if ($time > $latest_item) {
$latest_item = $time;
}
}
}
}
 
if ($latest_item !== null) {
$last_reply_time = $latest_item;
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.