getUrlThis(); if($facebook_like_and_comment->facebook_comment_dark_color)$use_dark=' data-colorscheme="dark"';else $use_dark=''; ?>
prefix.get_the_ID(); $cache_life = '86400'; //caching time, in seconds, 1 day $commentfb="https://graph.facebook.com/comments/?ids=$urlthis"; if (!file_exists($cache_file) or (time() - filemtime($cache_file) >= $cache_life)){ $data = json_decode(file_get_contents($commentfb),true); $cache_comment=''; foreach($data as $obj){ $cmt=$obj['data']; foreach($cmt as $cm){ $cache_comment.="
from: ".$cm['from']['name']."
"; $cache_comment.="message: ".$cm['message']."
"; if(isset($cm['comments'])){ $cache_comment.=$cm['comments']['count']." reply:
"; foreach($cm['comments']['data']as $reply){ $cache_comment.="
from: ".$reply['from']['name']."
"; $cache_comment.="message: ".$reply['message']."
"; } } $cache_comment.='
'; } } file_put_contents($cache_file,$cache_comment); echo $cache_comment; }else{ readfile($cache_file); } ?>
>