Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Счетчик Facebook с кэшированием
- function nlt_getFacebookCounter($pageID='225279994223146') {
- $output = get_transient('facebook_counter');
- if ( $output === false || $output == '' ) {
- $data = json_decode(@file_get_contents('http://graph.facebook.com/' . $pageID));
- $output = $data->likes;
- set_transient( 'facebook_counter', $output, 60*10 );
- }
- echo $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement