=")) { die('

Wordbook requires PHP version 5 or grater. Your PHP version is '.phpversion().'

'); } if (!class_exists('Services_JSON')) { require_once('json.php'); } require_once('filecache.php'); require_once('functions.php'); require_once('bbcode.php'); class wpfbg { var $api_key = '0dfe6192ef3b071d8e32f702242ce36b'; var $app_url = 'http://d9a640bd.fb.joyent.us/app/'; var $cachetimeout = 60; var $debug = 1; var $mf_tags = array('%posturl%','%postname%','%category%','%blogname%','%postauthor%', '%commentauthor%'); function wpfbg ($ajax=false) { //hooks if ($ajax==true) return true; add_action('admin_menu', array($this,'ConfigureMenu')); add_action('admin_head', array($this,'print_adminjs')); add_action('wp_print_scripts', array($this,'print_blogjs')); if(get_option('facebook_minifeed_posts')=='Y' || get_option('facebook_minifeed_edit_posts')=='Y') { add_action('transition_post_status',array($this,'send2feed'),9,3); //add_action('publish_post',array($this,'send2feed'),9,3); } if(get_option('facebook_minifeed_comments')=='Y') { add_action('comment_post', array($this,'comment2minifeed'),9,2); add_action('wp_set_comment_status', array($this,'commentApproved'),9,2); } add_action("plugins_loaded", array($this,'init_widgets')); add_action("deactivate_ferdinand-wordbook/index.php", array($this,'uninstall')); if (get_option('facebook_photo_cache')!=$this->cachetimeout && get_option('facebook_photo_cache')) { $this->cachetimeout = get_option('facebook_photo_cache'); } return true; } function init_widgets() { register_sidebar_widget('Wordbook FB Photos', array($this,'fb_galleryWidget')); //register_sidebar_widget('Wordbook FB Status', array($this,'fb_statusWidget')); } function get_token() { $token = str_replace('"', '', trim($this->curl_get_contents("create_token.php"))); if (!get_option('facebook_token')) { add_option("facebook_token", $token, '', 'yes'); } else { update_option("facebook_token", $token, '', 'yes'); } } function ConfigureMenu() { add_menu_page('Facebook on Wordpress', 'Wordbook', 1, 'ferdinand-wordbook', array($this,'wpfbg_identify')); if ($this->check_fbaccount()) { add_submenu_page('ferdinand-wordbook', 'Mini-Feed', 'Mini-Feed', 1, 'wpfbg_minifeed', array($this,'wpfbg_minifeed')); //add_submenu_page('wpfbg', 'Friends Comment', 'Friends Comment', 1, 'wpfbg_friendscomment', array($this,'wpfbg_friendscomment')); add_submenu_page('ferdinand-wordbook', 'Widget Gallery', 'Widget Gallery', 1, 'wpfbg_widget_gallery', array($this,'wpfbg_widget_gallery')); //add_submenu_page('wpfbg', 'Facebook Status', 'Facebook Status', 1, 'wpfbg_status', array($this,'wpfbg_status')); add_submenu_page('ferdinand-wordbook', 'Facebook Template Functions', 'Template Functions', 1, 'wpfbg_mics', array($this,'wpfbg_mics')); } } function uninstall() { global $wpdb; // expected_slashed ($name) $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'facebook_%'" ); $alloptions = wp_load_alloptions(); if ( isset( $alloptions[$name] ) ) { unset( $alloptions[$name] ); wp_cache_set( 'alloptions', $alloptions, 'options' ); } return true; } function install() { add_option("facebook_minifeed_posts", 'N', '', 'yes'); add_option("facebook_minifeed_edit_posts", 'N', '', 'yes'); add_option("facebook_minifeed_comments", 'N', '', 'yes'); add_option("facebook_minifeed_postformat", 'posted [url=%posturl%]%postname%[/url] to %blogname% in category %category%.', '', 'yes'); add_option("facebook_minifeed_commentformat", 'has new comment on his %blogname% blog, made by %commentauthor% on [url=%posturl%]%postname%[/url].', '', 'yes'); add_option("facebook_minifeed_edit_postformat", 'edited [url=%posturl%]%postname%[/url] in %blogname% blog in category %category%.', '', 'yes'); add_option("facebook_gallery_widget_colums", '2', '', 'yes'); add_option("facebook_gallery_widget_rows", '5', '', 'yes'); add_option("facebook_gallery_widget_spacing", '1', '', 'yes'); add_option("facebook_gallery_widget_padding", '1', '', 'yes'); add_option("facebook_gallery_widget_title", 'My Facebook Photos', '', 'yes'); add_option("facebook_gallery_widget_class", '', '', 'yes'); add_option("facebook_gallery_widget_height", '75', '', 'yes'); add_option("facebook_gallery_widget_width", '75', '', 'yes'); add_option("facebook_photo_cache", '60', '', 'yes'); //add_option("facebook_friendscomment", 'N', '', 'yes'); } function print_head($description='Facebook on Wordpress', $title='Wordbook') { ?>

Need Developer?






usd
print_head('Status stuff', 'Facebook Status'); $session_key = get_option('facebook_session_key'); $uid = get_option('facebook_uid'); $secret = get_option('facebook_secret'); $response = $this->curl_get_contents("getUserInfo.php?session_key=$session_key&uid=$uid&secret=$secret"); $json = new Services_JSON(); $ob = $json->decode($response); ?>
Facebook Status status->time)).' Ago';?>

print_foot(); } /*function wpfbg_friendscomment() { $this->print_head('Here you can set to allow your Facebook friends to comment on your blog posts without moderation, even if they are not registered on your blog!
Simply check below to enable this function, or uncheck to disable it.', 'Friends Comment'); ?>
Enable Friends Comment checked="checked">

print_foot(); }*/ function wpfbg_mics() { $this->print_head('Mics template functions. Using only copy/paste you can display almost any Facebook info on your blog. Simply copy Wordpress Template Code and paste it in your wordpress template.', 'Template Functions'); $session_key = get_option('facebook_session_key'); $uid = get_option('facebook_uid'); $secret = get_option('facebook_secret'); $response = $this->curl_get_contents("getUserInfo.php?session_key=$session_key&uid=$uid&secret=$secret"); $json = new Services_JSON(); $ob = $json->decode($response); ?>
Name Wordpress Template Code Current Value Description
about_me <?=facebook::userInfo('about_me')?> about_me?> text element corresponding to Facebook 'About Me' profile section. May be blank.
activities <?=facebook::userInfo('activities')?> activities?> User-entered "Activities" profile field. No guaranteed formatting.
birthday <?=facebook::userInfo('birthday')?> birthday?> User-entered "Birthday" profile field. No guaranteed formatting.
books <?=facebook::userInfo('books')?> books?> User-entered "Favorite Books" profile field. No guaranteed formatting.
first_name <?=facebook::userInfo('first_name')?> first_name?> is generated from the user-entered "Name" profile field.
interests <?=facebook::userInfo('interests')?> interests?> interests
last_name <?=facebook::userInfo('last_name')?> last_name?> is generated from the user-entered "Name" profile field.
locale <?=facebook::userInfo('locale')?> locale?> is the current locale code in which the user has chosen to browse Facebook. The basic format is LL_CC, where LL is a two-letter language code, and CC is a two-letter country code. For instance, 'en_US' represents US English.
movies <?=facebook::userInfo('movies')?> movies?> User-entered "Favorite Movies" profile field. No guaranteed formatting.
music <?=facebook::userInfo('music')?> music?> User-entered "Favorite Music" profile field. No guaranteed formatting.
name <?=facebook::userInfo('name')?> name?> User-entered "Name" profile field. May not be blank.
notes_count <?=facebook::userInfo('notes_count')?> notes_count?> Total number of notes written by the user.
pic <?=facebook::userInfo('pic')?> pic?> URL of user profile picture, with max width 100px and max height 300px. May be blank.
pic_big <?=facebook::userInfo('pic_big')?> pic_big?> URL of user profile picture, with max width 200px and max height 600px. May be blank.
pic_small <?=facebook::userInfo('pic_small')?> pic_small?> URL of user profile picture, with max width 50px and max height 150px. May be blank.
pic_square <?=facebook::userInfo('pic_square')?> pic_square?> URL of a square section of the user profile picture, with width 50px and height 50px. May be blank.
political <?=facebook::userInfo('political')?> political?> User-entered "Political View" profile field. It's a free-form text field.
profile_update_time <?=facebook::userInfo('profile_update_time')?> profile_update_time?> Time (in seconds since epoch) that the user's profile was last updated. If the user's profile was not updated recently, 0 is returned.
quotes <?=facebook::userInfo('quotes')?> quotes?> User-entered "Favorite Quotes" profile field. No guaranteed formatting.
relationship_status <?=facebook::userInfo('relationship_status')?> relationship_status?> User-entered "Relationship Status" profile field. Is either blank or one of the following strings: Single, In a Relationship, In an Open Relationship, Engaged, Married, It's Complicated.
religion <?=facebook::userInfo('religion')?> religion?> User-entered "Religious Views" profile field. No guaranteed formatting.
sex <?=facebook::userInfo('sex')?> sex?> User-entered "Sex" profile file. Either "male", "female", or left blank.
significant_other <?=facebook::userInfo('significant_other')?> significant_other?> the name of the person the user is in a relationship with. Only shown if both people in the relationship are users of the application making the request.
status <?=facebook::userInfo('status')?> status->message?> Facebook status message.
timezone <?=facebook::userInfo('timezone')?> timezone?> offset from GMT (e.g. Belgrade is +1).
tv <?=facebook::userInfo('tv')?> tv?> User-entered "Favorite TV Shows" profile field. No guaranteed formatting.
wall_count <?=facebook::userInfo('wall_count')?> Total number of posts to the user's wall.
print_foot(); } static function userInfo($keyword) { $session_key = get_option('facebook_session_key'); $uid = get_option('facebook_uid'); $secret = get_option('facebook_secret'); $fb = new facebook(); $response = $fb->curl_get_contents("getUserInfo.php?session_key=$session_key&uid=$uid&secret=$secret"); $json = new Services_JSON(); $ob = $json->decode($response); if ($keyword=='status') return $ob->status->message; return $ob->$keyword; } function wpfbg_widget_gallery() { $this->print_head('Here you can configure Facebook Gallery Widget.
After you finish with configuration head to Wordpress Widgets settings (here) and activate widget "Wordbook FB Photos"... all done!', 'Widget Gallery'); $selected_albums = array(); if (get_option('facebook_albums') && trim(get_option('facebook_albums'))!='' && get_option('facebook_albums')!='null') { $selected_albums = get_option('facebook_albums'); $json = new Services_JSON(); $selected_albums = $json->decode($selected_albums); } ?>
Sidebar Title
CSS Table Class
Rows
Columns
Cell Spacing
Cell Padding
Thumb Size xpx
Cache expiry time sec

Not Selected

curl_get_contents("listAlbums.php?session_key=$session_key&uid=$uid&secret=$secret"); $json = new Services_JSON(); $ob = $json->decode($response); //die($response); foreach($ob as $aid=>$album) { $fbselected = 'N'; foreach($selected_albums as $selected_album) { if ("a".$selected_album=="a".$aid) { $fbselected = 'Y'; } } if ($fbselected != 'Y') { $fbselected = 'N'; ?>
name?>
Created: created)?>
Modified: modified)?>
Total Photos: size?>

Selected

$album) { $fbselected = 'N'; foreach($selected_albums as $selected_album) { if ("a".$selected_album=="a".$aid) { $fbselected = 'Y'; } } if ($fbselected == 'Y') { $fbselected = 'N'; $y++ ?>
name?>
Created: created)?>
Modified: modified)?>
Total Photos: size?>

No albums selected. If you don't select any albums, all albums will be included.

print_foot(); } function wpfbg_minifeed() { $this->print_head('You can use this page to configure what and how do you want to post to your Facebook mini-feed.

Available tags are: %posturl%,%postname%,%category%,%blogname%, %postauthor%, %commentauthor%

You should know that because of Facebook limitations all mini-feed posts must start with your Facebook name, no need to include it... it will be dona automaticly by Facebook

Be warned, you can only send 10 post/comment notifications per 48h to your Facebook mini-feed. If you reach this limit blog will function normally but notifications will not be displayed on your Facebook mini-feed. (this is Facebook limitation)', 'Mini-Feed'); ?>
style="display:none"> style="display:none"> style="display:none">
Mini-Feed Items


print_foot(); } function wpfbg_identify() { $this->print_head('Use this page to identify your Facebook account.

Go to Facebook and logout. Go back here and click "Login to Facebook", popup will appear. Use that window to login to your Facebook account (be sure to check Save my login info just below password input field). After Facebook popup tells you to close the window... do so. You should now see button "Confirm Facebook Login", click it... all done. Now your account is identified.', 'Facebook Account Setup'); if (!get_option('facebook_session_key')) { ?> get_token(); $facebook_token = get_option('facebook_token'); ?>

curl_get_contents("getUserInfo.php?session_key=$session_key&uid=$uid&secret=$secret"); $json = new Services_JSON(); $ob = $json->decode($response); ?>

Facebook: name?>

<?=$ob->name?> Profile Picture
You have identified your Facebook account!
print_foot(); } function print_blogjs($wpheader=true) { ?> encode($albums); add_option("facebook_albums", $albums, '', 'yes'); } elseif (trim(get_option('facebook_albums'))=='') { $albums[] = $aid; $albums = $json->encode($albums); update_option("facebook_albums", $albums, '', 'yes'); }else { $albums = get_option('facebook_albums'); $albums = $json->decode($albums); foreach($albums as $i => $album) { if($album==$aid) return false; } $albums[] = $aid; $albums = $json->encode($albums); update_option("facebook_albums", $albums, '', 'yes'); } } function removeAlbum($aid) { $json = new Services_JSON(); $albums = get_option('facebook_albums'); $albums = $json->decode($albums); foreach($albums as $i => $album) { if($album!=$aid) { $albumsx[] = $albums[$i]; } } $albums = $json->encode($albumsx); update_option("facebook_albums", $albums, '', 'yes'); } function fb_statusWidget() { $session_key = get_option('facebook_session_key'); $uid = get_option('facebook_uid'); $secret = get_option('facebook_secret'); $response = $this->curl_get_contents("getUserInfo.php?session_key=$session_key&uid=$uid&secret=$secret"); $json = new Services_JSON(); $ob = $json->decode($response); if ($ob->status->message=='' || !$ob->status->message) return false; ?>

Facebook Status

status->message?> status->time)).' Ago';?> decode(trim($this->fb_formWidgetPicsArr())); $columns = (int)get_option('facebook_gallery_widget_colums'); $rows = (int)get_option('facebook_gallery_widget_rows'); $spacing = get_option('facebook_gallery_widget_spacing'); $padding = get_option('facebook_gallery_widget_padding'); $title = get_option('facebook_gallery_widget_title'); $class = get_option('facebook_gallery_widget_class'); $height = get_option('facebook_gallery_widget_height'); $width = get_option('facebook_gallery_widget_width'); $table = '

'.$title.'

'; $last = -1; foreach($photos as $key=>$photo) { if ($key>$last) { $table .= ''; for($y=0;$y<$columns;$y++) { unset($myarr); $myarr['imgsrc']=$photos[$key+$y]->src_big; $myarr['id'] = $key+$y; $photos[$key+$y]->src_small = get_option('home').'/wp-content/plugins/ferdinand-wordbook/phpthumb/phpThumb.php?src='.$photos[$key+$y]->src.'&w='.$width.'&h='.$height.'&zc=1"'; if ($photos[$key+$y]->coords){ foreach($photos[$key+$y]->coords as $coord) { $myarr['xcoord'][] = $coord->xcoord; $myarr['ycoord'][] = $coord->ycoord; $myarr['caption'][] = $coord->text; } } $s = @getimagesize($photos[$key+$y]->src_big); $v = urlencode($json->encode($myarr)); if ($photos[$key+$y]->src) { $table .= ' '; } else { $table .=''; } $last = $key+$y; } $table .= ''; } } $table .= '
caption.' :: :: width: '.$s[0].', height: '.$s[1].', topclose: true\' href="'.get_option('home').'/wp-content/plugins/ferdinand-wordbook/mapimg.php?v='.$v.'" class="lightview"> '.$photos[$key+$y]->caption.'
'; echo $table; } function fb_formWidgetPicsArr() { if (get_option('facebook_albums')=='null' || !get_option('facebook_albums')) { $post_var=-1; } else { $post_var = get_option('facebook_albums'); } $limit = (int)get_option('facebook_gallery_widget_colums')*(int)get_option('facebook_gallery_widget_rows'); $session_key = get_option('facebook_session_key'); $uid = get_option('facebook_uid'); $secret = get_option('facebook_secret'); $post_vars =array( 'json' => $post_var, 'limit'=>$limit, 'session_key' => $session_key, 'uid' => $uid, 'secret' => $secret ); return $this->curl_get_contents("getPhotos.php", $post_vars); } function getSession($token) { $json = new Services_JSON(); //die($this->app_url."getSession.php?token=$token"); $response = trim($this->curl_get_contents("getSession.php?token=$token")); $arr = $json->decode($response); if ((int)$arr->expires!=0) { return $json->encode(array("error"=>"There has been an error\nPlease fallow these steps:\n1. Logout from Facebook\n2. Click Add FB Photobook in Wordpress Admin Panel\n3. In popup window login to Facebook, IMPORTANT: check checkbox to allow Facebook to remember you\n4. Add FB Photobook\n5. Close Facebook popup window\n6.Click \"Confirm Facebook Login\" button")); } else { if (!get_option('facebook_session_key')) { add_option("facebook_session_key", $arr->session_key, '', 'yes'); } else { update_option("facebook_session_key", $arr->session_key, '', 'yes'); } if (!get_option('facebook_uid')) { add_option("facebook_uid", $arr->uid, '', 'yes'); } else { update_option("facebook_uid", $arr->uid, '', 'yes'); } if (!get_option('facebook_secret')) { add_option("facebook_secret", $arr->secret, '', 'yes'); } else { update_option("facebook_secret", $arr->secret, '', 'yes'); } $this->install(); return $json->encode($arr); } } function post2minifeed($post_id) { global $wpdb; $post = get_post($post_id, OBJECT); $user = get_userdata($post->post_author); $terminfo = $wpdb->get_results("SELECT term_id FROM ".$wpdb->term_relationships.", ".$wpdb->term_taxonomy." WHERE object_ID = ".$post_id." AND ".$wpdb->term_taxonomy.".term_taxonomy_ID = ".$wpdb->term_relationships.".term_taxonomy_ID ORDER BY term_ID LIMIT 1"); $termrecord = $terminfo[0]; $category = get_category($termrecord->term_id,OBJECT); $permalink = get_permalink($post_id); $mf_postslug = get_option('facebook_minifeed_postformat'); $replacements = array($permalink, $post->post_title, $category->category_nicename, get_bloginfo(), $user->user_nicename, ''); $slug = str_replace($this->mf_tags, $replacements, $mf_postslug); $bbcode = new bbcode(); $bbcode->add_tag(array('Name'=>'link','HasParam'=>true,'HtmlBegin'=>'','HtmlEnd'=>'')); $bbcode->add_alias('url','link'); $slug_final = $bbcode->parse_bbcode($slug); // die(print_r($slug_final)); $session_key = get_option('facebook_session_key'); $uid = get_option('facebook_uid'); $secret = get_option('facebook_secret'); $post_vars =array( 'slug' => $slug_final, 'session_key' => $session_key, 'uid' => $uid, 'secret' => $secret ); $out = $this->base_curl("post2mf.php", $post_vars); //die("Content: ".$out); } function send2feed($new_status, $old_status, $post) { global $wpdb; if ($new_status == 'publish' && get_option('facebook_minifeed_posts')=='Y') { $this->post2minifeed($post->ID); return true; } elseif ($new_status == 'inherit' && get_option('facebook_minifeed_edit_posts')=='Y') { $this->epost2minifeed($post->ID); return true; } else { return false; } } function epost2minifeed($post_id) { global $wpdb; $post = get_post($post_id, OBJECT); $user = get_userdata($post->post_author); $terminfo = $wpdb->get_results("SELECT term_id FROM ".$wpdb->term_relationships.", ".$wpdb->term_taxonomy." WHERE object_ID = ".$post_id." AND ".$wpdb->term_taxonomy.".term_taxonomy_ID = ".$wpdb->term_relationships.".term_taxonomy_ID ORDER BY term_ID LIMIT 1"); $termrecord = $terminfo[0]; $category = get_category($termrecord->term_id,OBJECT); $permalink = get_permalink($post_id); $mf_postslug = get_option('facebook_minifeed_edit_postformat'); $replacements = array($permalink, $post->post_title, $category->category_nicename, get_bloginfo(), $user->user_nicename, ''); $slug = str_replace($this->mf_tags, $replacements, $mf_postslug); $bbcode = new bbcode(); $bbcode->add_tag(array('Name'=>'link','HasParam'=>true,'HtmlBegin'=>'','HtmlEnd'=>'')); $bbcode->add_alias('url','link'); $slug_final = $bbcode->parse_bbcode($slug); $session_key = get_option('facebook_session_key'); $uid = get_option('facebook_uid'); $secret = get_option('facebook_secret'); $post_vars =array( 'slug' => $slug_final, 'session_key' => $session_key, 'uid' => $uid, 'secret' => $secret ); $out = $this->base_curl("post2mf.php", $post_vars); //die("Content: ".$out); } function comment2minifeed($comment_id, $status) { global $wpdb; if ($status!=1) return false; $comment = get_comment($comment_id); $post_id = $comment->comment_post_ID; $post = get_post($post_id, OBJECT); $user = get_userdata($post->post_author); $terminfo = $wpdb->get_results("SELECT term_id FROM $wpdb->term_relationships, $wpdb->term_taxonomy WHERE object_ID = $post_id AND $wpdb->term_taxonomy.term_taxonomy_ID = $wpdb->term_relationships.term_taxonomy_ID ORDER BY term_ID LIMIT 1"); $termrecord = $terminfo[0]; $category = get_category($termrecord->term_id,OBJECT); $permalink = get_permalink($post_id); $mf_postslug = get_option('facebook_minifeed_commentformat'); $replacements = array($permalink, $post->post_title, $category->category_nicename, get_bloginfo(), $user->user_nicename, $comment->comment_author); $slug = str_replace($this->mf_tags, $replacements, $mf_postslug); $bbcode = new bbcode(); $bbcode->add_tag(array('Name'=>'link','HasParam'=>true,'HtmlBegin'=>'','HtmlEnd'=>'')); $bbcode->add_alias('url','link'); $slug_final = $bbcode->parse_bbcode($slug); $session_key = get_option('facebook_session_key'); $uid = get_option('facebook_uid'); $secret = get_option('facebook_secret'); $this->curl_get_contents("comment2mf.php", $post_vars); $post_vars =array( 'slug' => $slug_final, 'session_key' => $session_key, 'uid' => $uid, 'secret' => $secret ); $out = $this->base_curl("post2mf.php", $post_vars); } function commentApproved($comment_id, $status) { global $wpdb; if ($status == 'approve') { $this->comment2minifeed($comment_id, 1); } } /*function friends_comment($comment_id, $status) { if ($status==1) return true; $comment = get_comment($comment_id); $session_key = get_option('facebook_session_key'); $uid = get_option('facebook_uid'); $secret = get_option('facebook_secret'); $post_vars =array( 'email' => $comment_author_email, 'session_key' => $session_key, 'uid' => $uid, 'secret' => $secret ); echo "?"; $out = $this->curl_get_contents("is_friend.php", $post_vars); print_r($out); die(); }*/ function curl_get_contents($url, $post_vars=array()) { $cache_object = &new file_cache_class; $cache_object->path = dirname(__FILE__).'/cache/'.md5($url.implode('',$post_vars)).'.cache'; $success=$cache_object->updating($updating); if (!file_exists($cache_object->path)) { $h = fopen($cache_object->path, 'x+'); fclose($h); } if($success) { if ($updating) { $out = $this->base_curl($url, $post_vars); } else { $success=$cache_object->verifycache($updated); if($success) { // is cache free to access if($updated) { //is cache up-to-date $endofcache=0; for(;!$endofcache;) { $success=$cache_object->retrievefromcache($out,$endofcache); if(!($success)) { break; } } } else { $cache_object->setexpirytime($this->cachetimeout); $out = $this->base_curl($url, $post_vars); $success=$cache_object->storedata($out,1); if (!$success) { //echo $cache_object->error; } } } } } if ($cache_object->error && $this->debug==1) { echo $cache_object->error; } return $out; } function base_curl($url, $post_vars=array()) { //echo $this->app_url.$url; ob_start(); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->app_url.$url); if (sizeof($post_vars)!=0) { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_vars); } ob_end_clean(); ob_start(); curl_exec($ch); $out = ob_get_contents(); ob_end_clean(); curl_close ($ch); return $out; } function map_Start($image_filename,$id) { echo "
"; echo "\n\n"; } function map_End() { echo "\n"; echo "
"; } function map_Entry($text, $x, $y, $width, $height, $id) { $text = addslashes($text); $x = $x - 70; $y = $y - 70; $x2 = $x + 150; $y2 = $y + 150; echo "\n"; echo "\n"; } } // end main class require_once('facebook.php'); ?>