function al2fb_render_admin($al2fb)
{
    ?>
	<div class="wrap">
	<h2><?php 
    _e('Add Link to Facebook', c_al2fb_text_domain);
    ?>
</h2>
<?php 
    // Get current user
    global $user_ID;
    get_currentuserinfo();
    // Check for app share
    if (is_multisite()) {
        $shared_user_ID = get_site_option(c_al2fb_option_app_share);
    } else {
        $shared_user_ID = get_option(c_al2fb_option_app_share);
    }
    if ($shared_user_ID && $shared_user_ID != $user_ID) {
        $userdata = get_userdata($shared_user_ID);
        echo '<div id="message" class="error fade al2fb_error"><p>';
        echo __('Only this user can access the settings:', c_al2fb_text_domain);
        echo ' ' . $userdata->user_login . ' (id=' . $shared_user_ID . ')</p></div>';
        echo '</div>';
        return;
    }
    // Get settings
    $charset = get_bloginfo('charset');
    if (is_multisite()) {
        global $blog_id;
        $config_url = get_admin_url($blog_id, 'admin.php?page=' . $al2fb->main_plugin_name, 'admin');
    } else {
        $config_url = admin_url('admin.php?page=' . $al2fb->main_plugin_name);
    }
    if (isset($_REQUEST['debug'])) {
        $config_url .= '&debug=1';
    }
    if (isset($_REQUEST['tabs'])) {
        $config_url .= '&tabs=0';
    }
    if (isset($_REQUEST['multiple'])) {
        $count = isset($_REQUEST['sites']) && is_int($_REQUEST['sites']) ? $_REQUEST['sites'] : 1;
        if (!WPAL2Int::Set_multiple($_REQUEST['multiple'], $count)) {
            echo '<div id="message" class="updated fade al2fb_notice"><p>Code accepted (' . $count . ')</p></div>';
        }
    }
    // Decode picture type
    $pic_type = get_user_meta($user_ID, c_al2fb_meta_picture_type, true);
    $pic_wordpress = $pic_type == 'wordpress' ? ' checked' : '';
    $pic_media = $pic_type == 'media' ? ' checked' : '';
    $pic_featured = $pic_type == 'featured' ? ' checked' : '';
    $pic_facebook = $pic_type == 'facebook' ? ' checked' : '';
    $pic_post = $pic_type == 'post' ? ' checked' : '';
    $pic_avatar = $pic_type == 'avatar' ? ' checked' : '';
    $pic_userphoto = $pic_type == 'userphoto' ? ' checked' : '';
    $pic_custom = $pic_type == 'custom' ? ' checked' : '';
    $pic_size = get_user_meta($user_ID, c_al2fb_meta_picture_size, true);
    $pic_thumbnail = $pic_size == 'thumbnail' ? ' checked' : '';
    $pic_medium = $pic_size == 'medium' || empty($pic_size) ? ' checked' : '';
    $pic_large = $pic_size == 'large' ? ' checked' : '';
    // Decode privacy
    $priv_type = get_user_meta($user_ID, c_al2fb_meta_privacy, true);
    $priv_none = $priv_type == '' ? ' checked' : '';
    $priv_everyone = $priv_type == 'EVERYONE' ? ' checked' : '';
    $priv_friends = $priv_type == 'ALL_FRIENDS' ? ' checked' : '';
    $priv_network = $priv_type == 'NETWORKS_FRIENDS' ? ' checked' : '';
    $priv_fof = $priv_type == 'FRIENDS_OF_FRIENDS' ? ' checked' : '';
    $priv_me = $priv_type == 'SELF' ? ' checked' : '';
    $priv_some = $priv_type == 'SOME_FRIENDS' ? ' checked' : '';
    if (!current_theme_supports('post-thumbnails') || !function_exists('get_post_thumbnail_id') || !function_exists('wp_get_attachment_image_src')) {
        $pic_featured .= ' disabled';
    }
    if (!in_array('user-photo/user-photo.php', get_option('active_plugins'))) {
        $pic_userphoto .= ' disabled';
    }
    // Like button
    $like_layout = get_user_meta($user_ID, c_al2fb_meta_like_layout, true);
    $like_layout_standard = $like_layout == 'standard' ? ' checked' : '';
    $like_layout_button = $like_layout == 'button_count' ? ' checked' : '';
    $like_layout_box = $like_layout == 'box_count' ? ' checked' : '';
    $like_layout_simple = $like_layout == 'button' ? ' checked' : '';
    $like_action = get_user_meta($user_ID, c_al2fb_meta_like_action, true);
    $like_action_like = $like_action == 'like' ? ' checked' : '';
    $like_action_recommend = $like_action == 'recommend' ? ' checked' : '';
    $like_font = get_user_meta($user_ID, c_al2fb_meta_like_font, true);
    $like_color = get_user_meta($user_ID, c_al2fb_meta_like_colorscheme, true);
    $like_color_light = $like_color == 'light' ? ' checked' : '';
    $like_color_dark = $like_color == 'dark' ? ' checked' : '';
    // Subscribe button
    $subscribe_layout = get_user_meta($user_ID, c_al2fb_meta_subscribe_layout, true);
    // Comment link option
    $comments_nolink = get_user_meta($user_ID, c_al2fb_meta_fb_comments_nolink, true);
    if (empty($comments_nolink)) {
        $comments_nolink = 'author';
    } else {
        if ($comments_nolink == 'on') {
            $comments_nolink = 'none';
        }
    }
    // Linking to posts on group pages doesn't work
    if ($comments_nolink == 'link' && get_user_meta($user_ID, c_al2fb_meta_use_groups, true) && get_user_meta($user_ID, c_al2fb_meta_group, true)) {
        $comments_nolink = 'author';
    }
    $comments_nolink_none = $comments_nolink == 'none' ? ' checked' : '';
    $comments_nolink_author = $comments_nolink == 'author' ? ' checked' : '';
    $comments_nolink_link = $comments_nolink == 'link' ? ' checked' : '';
    if (get_user_meta($user_ID, c_al2fb_meta_use_groups, true) && get_user_meta($user_ID, c_al2fb_meta_group, true)) {
        $comments_nolink_link = ' disabled';
    }
    // Face pile
    $pile_size = get_user_meta($user_ID, c_al2fb_meta_pile_size, true);
    // Check connectivity
    if (!ini_get('allow_url_fopen') && !function_exists('curl_init')) {
        echo '<div id="message" class="error fade al2fb_error"><p>' . __('Your server may not allow external connections', c_al2fb_text_domain) . '</p></div>';
    }
    al2fb_render_debug_info($al2fb);
    echo '<div class="al2fb_sidebar">';
    al2fb_render_resources($al2fb);
    echo '</div>';
    ?>
	<div class="al2fb_options">

	<div class="al2fb_instructions" style="width: 550px;">
	<strong><?php 
    _e('Please be aware that comment integration or showing Facebook messages in the widget could harm the privacy of other Facebook users!', c_al2fb_text_domain);
    ?>
</strong>
	</div>

<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_client_id, true) && get_user_meta($user_ID, c_al2fb_meta_app_secret, true)) {
        ?>
		<hr />
		<a name="authorize"></a>
		<h3><?php 
        _e('Authorization', c_al2fb_text_domain);
        ?>
</h3>

		<div id="al2fb_auth">
<?php 
        if ($al2fb->Is_authorized($user_ID)) {
            if (get_option(c_al2fb_option_version) != 10) {
                echo '<span>' . __('Plugin is authorized', c_al2fb_text_domain) . '</span><br />';
            }
            // Get page name
            try {
                $page_ids = WPAL2Int::Get_page_ids($user_ID);
                foreach ($page_ids as $page_id) {
                    $info = WPAL2Int::Get_fb_info_cached($user_ID, empty($page_id) ? 'me' : $page_id);
                    _e('Links will be added to', c_al2fb_text_domain);
                    echo ' <a href="' . $info->link . '" target="_blank">' . htmlspecialchars($info->name, ENT_QUOTES, $charset);
                    if (!empty($info->category)) {
                        echo ' - ' . htmlspecialchars($info->category, ENT_QUOTES, $charset);
                    }
                    echo '</a><br />';
                    if ($al2fb->debug) {
                        echo print_r($info, true) . '<br />';
                    }
                }
            } catch (Exception $e) {
                echo '<div id="message" class="error fade al2fb_error"><p>' . htmlspecialchars($e->getMessage(), ENT_QUOTES, $charset) . '</p></div>';
            }
        }
        ?>
		<table><tr>
		<td>
			<form method="get" action="<?php 
        echo $config_url;
        ?>
">
			<input type="hidden" name="al2fb_action" value="init">
			<p class="submit">
			<input type="submit" class="button-primary" value="<?php 
        _e('Authorize', c_al2fb_text_domain);
        ?>
" />
			</p>
			</form>
		</td>
<?php 
        if (false && !get_user_meta($user_ID, c_al2fb_meta_donated, true)) {
            ?>
			<td>
				<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
				<input type="hidden" name="cmd" value="_s-xclick">
				<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHZwYJKoZIhvcNAQcEoIIHWDCCB1QCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYApWh+oUn2CtY+7zwU5zu5XKj096Mj0sxBhri5/lYV7i7B+JwhAC1ta7kkj2tXAbR3kcjVyNA9n5kKBUND+5Lu7HiNlnn53eFpl3wtPBBvPZjPricLI144ZRNdaaAVtY32pWX7tzyWJaHgClKWp5uHaerSZ70MqUK8yqzt0V2KKDjELMAkGBSsOAwIaBQAwgeQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIn3eeOKy6QZGAgcDKPGjy/6+i9RXscvkaHQqjbFI1bE36XYcrttae+aXmkeicJpsm+Se3NCBtY9yt6nxwwmxhqNTDNRwL98t8EXNkLg6XxvuOql0UnWlfEvRo+/66fqImq2jsro31xtNKyqJ1Qhx+vsf552j3xmdqdbg1C9IHNYQ7yfc6Bhx914ur8UPKYjy66KIuZBCXWge8PeYjuiswpOToRN8BU6tV4OW1ndrUO9EKZd5UHW/AOX0mjXc2HFwRoD22nrapVFIsjt2gggOHMIIDgzCCAuygAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wHhcNMDQwMjEzMTAxMzE1WhcNMzUwMjEzMTAxMzE1WjCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMFHTt38RMxLXJyO2SmS+Ndl72T7oKJ4u4uw+6awntALWh03PewmIJuzbALScsTS4sZoS1fKciBGoh11gIfHzylvkdNe/hJl66/RGqrj5rFb08sAABNTzDTiqqNpJeBsYs/c2aiGozptX2RlnBktH+SUNpAajW724Nv2Wvhif6sFAgMBAAGjge4wgeswHQYDVR0OBBYEFJaffLvGbxe9WT9S1wob7BDWZJRrMIG7BgNVHSMEgbMwgbCAFJaffLvGbxe9WT9S1wob7BDWZJRroYGUpIGRMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwYRiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmHMYIBmjCCAZYCAQEwgZQwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMTAyMDcwOTQ4MTlaMCMGCSqGSIb3DQEJBDEWBBQOOy+JroeRlZL7jGU/azSibWz1fjANBgkqhkiG9w0BAQEFAASBgCUXDO9KLIuy/XJwBa6kMWi0U1KFarbN9568i14mmZCFDvBmexRKhnSfqx+QLzdpNENBHKON8vNKanmL9jxgtyc88WAtrP/LqN4tmSrr0VB5wrds/viLxWZfu4Spb+YOTpo+z2hjXCJzVSV3EDvoxzHEN1Haxrvr1gWNhWzvVN3q-----END PKCS7-----">
				<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
				</form>
			</td>
			<td>
				<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=marcel%40bokhorst%2ebiz&lc=US&item_name=Add%20Link%20to%20Facebook%20WordPress%20plugin&item_number=Marcel%20Bokhorst&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted"><?php 
            _e('Donate in EUR', c_al2fb_text_domain);
            ?>
</a>
			</td>
			<td>
				<a href="http://flattr.com/thing/315162/Add-Link-to-Facebook-WordPress-plugin" target="_blank">
				<img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a>
			</td>
<?php 
        }
        ?>

		</tr></table>

		</div>
		<a href="#" id="al2fb_auth_show"><?php 
        _e('Show', c_al2fb_text_domain);
        ?>
</a>
		<script type="text/javascript">
			jQuery(document).ready(function($) {
				if (<?php 
        echo $al2fb->Is_authorized($user_ID) && get_user_meta($user_ID, c_al2fb_meta_donated, true) ? 'true' : 'false';
        ?>
)
					$('#al2fb_auth').hide();
				else
					$('#al2fb_auth_show').hide();

				$('#al2fb_auth_show').click(function() {
					$('#al2fb_auth').show();
					$('#al2fb_auth_show').hide();
					return false;
				});
			});
		</script>
<?php 
    }
    ?>

	<hr />
	<a name="configure"></a>
	<h3><?php 
    _e('Easy setup', c_al2fb_text_domain);
    ?>
</h3>

	<form method="post" action="<?php 
    echo $config_url;
    ?>
">
	<input type="hidden" name="al2fb_action" value="config">
	<?php 
    wp_nonce_field(c_al2fb_nonce_action, c_al2fb_nonce_name);
    ?>

	<div id="al2fb_config">

	<div class="al2fb_instructions">
	<h4><?php 
    _e('To get an App ID and App Secret you have to create a Facebook application', c_al2fb_text_domain);
    ?>
</h4>
	<span><strong><?php 
    _e('You have to fill in the following:', c_al2fb_text_domain);
    ?>
</strong></span>
	<table>
		<tr>
			<td><span class="al2fb_label"><strong><?php 
    _e('App Name:', c_al2fb_text_domain);
    ?>
</strong></span></td>
			<td><span class="al2fb_data"><?php 
    _e('Anything you like, will appear as "via ..." below the message', c_al2fb_text_domain);
    ?>
</span></td>
		</tr>
		<tr>
			<td><span class="al2fb_label"><strong><?php 
    _e('Website > Site URL:', c_al2fb_text_domain);
    ?>
</strong></span></td>
			<td><span class="al2fb_data" style="color: red;"><strong><?php 
    echo htmlspecialchars(WPAL2Int::Redirect_uri(), ENT_QUOTES, $charset);
    ?>
</strong></span></td>
		</tr>
	</table>
	<a href="http://developers.facebook.com/" target="_blank"><?php 
    _e('Click here to create', c_al2fb_text_domain);
    ?>
</a>
	<span><?php 
    _e('and navigate to \'<em>Apps</em>\' and then to \'<em>Create New App</em>\'', c_al2fb_text_domain);
    ?>
</span><br />
	<br />
	<strong><a href="http://wordpress.org/extend/plugins/add-link-to-facebook/other_notes/" target="_blank"><?php 
    _e('Setup guide & user manual', c_al2fb_text_domain);
    ?>
</a></strong>
	</div>

	<div class="al2fb_form">
	<table class="form-table al2fb_border">
	<tr valign="top"><th scope="row">
		<label for="al2fb_client_id"><strong><?php 
    _e('App ID:', c_al2fb_text_domain);
    ?>
</strong></label>
	</th><td>
		<input id="al2fb_client_id" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_client_id;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_client_id, true);
    ?>
" />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_app_secret"><strong><?php 
    _e('App Secret:', c_al2fb_text_domain);
    ?>
</strong></label>
	</th><td>
		<input id="al2fb_app_secret" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_app_secret;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_app_secret, true);
    ?>
" />
	</td></tr>

<?php 
    if (isset($_REQUEST['debug'])) {
        ?>
		<tr valign="top"><th scope="row">
			<label for="al2fb_access_token"><strong><?php 
        _e('Access token:', c_al2fb_text_domain);
        ?>
</strong></label>
		</th><td>
			<input id="al2fb_access_token" class="al2fb_text" name="<?php 
        echo c_al2fb_meta_access_token;
        ?>
" type="text" value="<?php 
        echo get_user_meta($user_ID, c_al2fb_meta_access_token, true);
        ?>
" />
<?php 
        echo '<br /><span>' . get_user_meta($user_ID, c_al2fb_meta_token_time, true) . '</span>';
        ?>
		</td></tr>
<?php 
    }
    if ($al2fb->Is_authorized($user_ID)) {
        try {
            $app = WPAL2Int::Get_fb_application_cached($user_ID);
            ?>
			<tr valign="top"><th scope="row">
				<label for="al2fb_app_name"><?php 
            _e('App Name:', c_al2fb_text_domain);
            ?>
</label>
			</th><td>
				<a id="al2fb_app_name" href="<?php 
            echo $app->link;
            ?>
" target="_blank"><?php 
            echo htmlspecialchars($app->name, ENT_QUOTES, $charset);
            ?>
</a>
			</td></tr>
<?php 
        } catch (Exception $e) {
            echo '<div id="message" class="error fade al2fb_error"><p>' . htmlspecialchars($e->getMessage(), ENT_QUOTES, $charset) . '</p></div>';
        }
    }
    if (current_user_can('manage_options')) {
        ?>
		<tr valign="top"><th scope="row">
			<label for="al2fb_app_share"><?php 
        _e('Share with all users on this site:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_app_share" name="<?php 
        echo c_al2fb_option_app_share;
        ?>
" type="checkbox"<?php 
        if (get_site_option(c_al2fb_option_app_share)) {
            echo ' checked="checked"';
        }
        ?>
 />
		</td></tr>
<?php 
    }
    ?>
	</table>
	</div>

	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>

	</div>
	<a href="#" id="al2fb_config_show"><?php 
    _e('Show', c_al2fb_text_domain);
    ?>
</a>
	<script type="text/javascript">
		jQuery(document).ready(function($) {
			if (<?php 
    echo $al2fb->Is_authorized($user_ID) ? 'true' : 'false';
    ?>
)
				$('#al2fb_config').hide();
			else
				$('#al2fb_config_show').hide();

			$('#al2fb_config_show').click(function() {
				$('#al2fb_config').show();
				$('#al2fb_config_show').hide();
				return false;
			});
		});
	</script>

	<hr />
	<h3><?php 
    _e('Additional settings', c_al2fb_text_domain);
    ?>
</h3>

	<ul class="al2fb_tabs" id="al2fb_tab_settings">
		<li><a href="#al2fb_tab_picture"><?php 
    _e('Picture', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_page_group"><?php 
    _e('Page/group', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_appearance"><?php 
    _e('Appearance', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_comments"><?php 
    _e('Comments', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_like_button"><?php 
    _e('Like button', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_like_box"><?php 
    _e('Like box', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_subscribe_button"><?php 
    _e('Subscribe button', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_comments_plugin"><?php 
    _e('Comments plugin', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_face_pile"><?php 
    _e('Face pile', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_login"><?php 
    _e('Login', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_activity_feed"><?php 
    _e('Activity feed', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_common"><?php 
    _e('Common', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_misc"><?php 
    _e('Misc.', c_al2fb_text_domain);
    ?>
</a></li>
		<li><a href="#al2fb_tab_admin"><?php 
    _e('Admin', c_al2fb_text_domain);
    ?>
</a></li>
	</ul>

	<div class="al2fb_tab_container">
	<div id="al2fb_tab_picture" class="al2fb_tab_content">
	<h4><?php 
    _e('Link picture', c_al2fb_text_domain);
    ?>
</h4>
	<table class="form-table al2fb_border">
	<tr valign="top"><th scope="row">
		<label for="al2fb_picture_type"><?php 
    _e('Link picture:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input type="radio" name="<?php 
    echo c_al2fb_meta_picture_type;
    ?>
" value="wordpress"<?php 
    echo $pic_wordpress;
    ?>
><?php 
    _e('WordPress logo', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_picture_type;
    ?>
" value="media"<?php 
    echo $pic_media;
    ?>
><?php 
    _e('First attached image', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_picture_type;
    ?>
" value="featured"<?php 
    echo $pic_featured;
    ?>
><?php 
    _e('Featured post image', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_picture_type;
    ?>
" value="facebook"<?php 
    echo $pic_facebook;
    ?>
><?php 
    _e('Let Facebook select', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_picture_type;
    ?>
" value="post"<?php 
    echo $pic_post;
    ?>
><?php 
    _e('First image in the post', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_picture_type;
    ?>
" value="avatar"<?php 
    echo $pic_avatar;
    ?>
><?php 
    _e('Avatar of author', c_al2fb_text_domain);
    ?>
<br />
<?php 
    if ($pic_type == 'userphoto' || $al2fb->debug) {
        ?>
			<input type="radio" name="<?php 
        echo c_al2fb_meta_picture_type;
        ?>
" value="userphoto"<?php 
        echo $pic_userphoto;
        ?>
><?php 
        _e('Image from User Photo plugin', c_al2fb_text_domain);
        ?>
<br />
<?php 
    }
    ?>
		<input type="radio" name="<?php 
    echo c_al2fb_meta_picture_type;
    ?>
" value="custom"<?php 
    echo $pic_custom;
    ?>
><?php 
    _e('Custom picture below', c_al2fb_text_domain);
    ?>
<br />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_picture"><?php 
    _e('Custom picture URL:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_picture" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_picture;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_picture, true);
    ?>
" />
		<br /><span class="al2fb_explanation"><?php 
    echo str_replace('50', '200', __('At least 50 x 50 pixels', c_al2fb_text_domain));
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_picture_default"><?php 
    _e('Default picture URL:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_picture_default" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_picture_default;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_picture_default, true);
    ?>
" />
		<br /><span class="al2fb_explanation"><?php 
    _e('Default WordPress logo', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_picture_size"><?php 
    _e('Picture size sent to Facebook:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input type="radio" name="<?php 
    echo c_al2fb_meta_picture_size;
    ?>
" value="thumbnail"<?php 
    echo $pic_thumbnail;
    ?>
><?php 
    _e('thumbnail', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_picture_size;
    ?>
" value="medium"<?php 
    echo $pic_medium;
    ?>
><?php 
    _e('medium', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_picture_size;
    ?>
" value="large"<?php 
    echo $pic_large;
    ?>
><?php 
    _e('large', c_al2fb_text_domain);
    ?>
<br />
		<span class="al2fb_explanation"><?php 
    _e('Facebook will always show a small picture', c_al2fb_text_domain);
    ?>
</span><br />
		<span class="al2fb_explanation"><?php 
    _e('Only works for pictures from the media library', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_icon"><?php 
    _e('URL news feed icon:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_icon" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_icon;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_icon, true);
    ?>
" />
		<br /><span class="al2fb_explanation"><?php 
    _e('Does anybody know where this appears on Facebook?', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>
	</table>
	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>
	</div>

	<div id="al2fb_tab_page_group" class="al2fb_tab_content">
<?php 
    if ($al2fb->Is_authorized($user_ID)) {
        try {
            if (!get_user_meta($user_ID, c_al2fb_meta_use_groups, true) || !get_user_meta($user_ID, c_al2fb_meta_group, true) || WPAL2Int::Check_multiple()) {
                // Get personal page
                try {
                    $me = WPAL2Int::Get_fb_me_cached($user_ID, true);
                } catch (Exception $e) {
                    if ($al2fb->debug) {
                        print_r($e);
                    }
                    $me = null;
                }
                // Get other pages
                try {
                    $pages = WPAL2Int::Get_fb_pages_cached($user_ID);
                } catch (Exception $e) {
                    if ($al2fb->debug) {
                        print_r($e);
                    }
                    $pages = null;
                }
                $selected_page = get_user_meta($user_ID, c_al2fb_meta_page, true);
                $extra_page = get_user_meta($user_ID, c_al2fb_meta_page_extra, true);
                if (empty($extra_page) || !is_array($extra_page)) {
                    $extra_page = array();
                }
                ?>
				<div id="al2fb_pages">
				<h4><?php 
                _e('Facebook page', c_al2fb_text_domain);
                ?>
</h4>
				<table class="form-table al2fb_border">
				<tr valign="top"><th scope="row">
					<label for="al2fb_page"><?php 
                _e('Add to page:', c_al2fb_text_domain);
                ?>
</label>
				</th><td>
					<select class="al2fb_select" id="al2fb_page" name="<?php 
                echo c_al2fb_meta_page;
                ?>
">
<?php 
                echo '<option value="-"' . ($selected_page == '-' ? ' selected' : '') . '>' . __('None', c_al2fb_text_domain) . '</option>';
                if ($me) {
                    echo '<option value=""' . ($selected_page ? '' : ' selected') . '>' . htmlspecialchars($me->name, ENT_QUOTES, $charset) . ' (' . __('Personal', c_al2fb_text_domain) . ')</option>';
                }
                if ($pages && $pages->data) {
                    foreach ($pages->data as $page) {
                        echo '<option value="' . $page->id . '"';
                        if ($page->id == $selected_page) {
                            echo ' selected';
                        }
                        if (empty($page->name)) {
                            $page->name = '?';
                        }
                        echo '>' . htmlspecialchars($page->name, ENT_QUOTES, $charset) . ' (' . htmlspecialchars($page->category, ENT_QUOTES, $charset) . ')</option>';
                    }
                }
                ?>
					</select>
				</td></tr>
				<tr valign="top"><th scope="row">
					<label for="al2fb_page"><?php 
                _e('Add also to pages:', c_al2fb_text_domain);
                ?>
</label>
				</th><td>
<?php 
                if (WPAL2Int::Check_multiple()) {
                    echo '<table>';
                    if ($me) {
                        echo '<tr><td><input type="checkbox"' . (in_array('me', $extra_page) ? ' checked="checked"' : '') . ' name="al2fb_page_extra[]" value="me"></td>';
                        echo '<td>' . htmlspecialchars($me->name, ENT_QUOTES, $charset) . ' (' . __('Personal', c_al2fb_text_domain) . ')</td></tr>';
                    }
                    if ($pages && $pages->data) {
                        foreach ($pages->data as $page) {
                            if (empty($page->name)) {
                                $page->name = '?';
                            }
                            echo '<tr><td><input type="checkbox"' . (in_array($page->id, $extra_page) ? ' checked="checked"' : '') . ' name="' . c_al2fb_meta_page_extra . '[]" value="' . $page->id . '"></td>';
                            echo '<td>' . htmlspecialchars($page->name, ENT_QUOTES, $charset) . ' (' . htmlspecialchars($page->category, ENT_QUOTES, $charset) . ')</td></tr>';
                        }
                    }
                    echo '</table>';
                } else {
                    echo '<strong>';
                    _e('This option is only available in', c_al2fb_text_domain);
                    echo ' <a href="http://www.faircode.eu/al2fbpro/?url=' . WPAL2Int::Redirect_uri() . '" target="_blank">Add Link to Facebook Pro</a>';
                    echo '</strong>';
                    $mu = WPAL2Int::Get_multiple_url();
                    if ($mu) {
                        echo '<p><span style="color: red;"><strong>' . htmlspecialchars($mu, ENT_QUOTES, $charset) . '</strong></span></p>';
                    }
                }
                ?>
				</td></tr>
				</table>
				</div>
<?php 
                if (get_user_meta($user_ID, c_al2fb_meta_use_groups, true) && !WPAL2Int::Check_multiple()) {
                    ?>
					<script type="text/javascript">
						jQuery(document).ready(function($) {
							$('#al2fb_pages').hide();
						});
					</script>
<?php 
                }
            }
            ?>
			<h4><?php 
            _e('Facebook group', c_al2fb_text_domain);
            ?>
</h4>
			<table class="form-table al2fb_border">
			<tr valign="top"><th scope="row">
				<label for="al2fb_use_groups"><?php 
            _e('Use groups:', c_al2fb_text_domain);
            ?>
</label>
			</th><td>
				<input id="al2fb_use_groups" name="<?php 
            echo c_al2fb_meta_use_groups;
            ?>
" type="checkbox"<?php 
            if (get_user_meta($user_ID, c_al2fb_meta_use_groups, true)) {
                echo ' checked="checked"';
            }
            ?>
 />
			</td></tr>
<?php 
            if (get_user_meta($user_ID, c_al2fb_meta_use_groups, true)) {
                // Check links API
                if (get_option(c_al2fb_option_uselinks)) {
                    echo '<tr><td>&nbsp;</td><td style="color: Red"><strong>' . __('Disable the links API to use this feature', c_al2fb_text_domain) . '</strong></td></tr>';
                }
                // Get groups
                try {
                    //$groups = WPAL2Int::Get_fb_groups_cached($user_ID);
                    $groups = null;
                } catch (Exception $e) {
                    if ($al2fb->debug) {
                        print_r($e);
                    }
                    $groups = null;
                }
                $selected_group = get_user_meta($user_ID, c_al2fb_meta_group, true);
                $extra_group = get_user_meta($user_ID, c_al2fb_meta_group_extra, true);
                if (empty($extra_group) || !is_array($extra_group)) {
                    $extra_group = array();
                }
                ?>
				<tr valign="top"><th scope="row">
					<label for="al2fb_group"><?php 
                _e('Add to group:', c_al2fb_text_domain);
                ?>
</label>
				</th><td> 
				<input id="al2fb_group" class="al2fb_text" name="<?php 
                echo c_al2fb_meta_group;
                ?>
" type="text" value="<?php 
                echo htmlentities(get_user_meta($user_ID, c_al2fb_meta_group, true), ENT_QUOTES, get_bloginfo('charset'));
                ?>
" />
				<br /><span class="al2fb_explanation"><?php 
                _e('Add Group ID you want post to be published to. eg. https://www.facebook.com/groups/[532264143508747]', c_al2fb_text_domain);
                ?>
</span><br />
					<!--<select class="al2fb_select" id="al2fb_group" name="<?php 
                echo c_al2fb_meta_group;
                ?>
">
<?php 
                // echo '<option value=""' . ($selected_group ? '' : ' selected') . '>' . __('None', c_al2fb_text_domain) . '</option>';
                // if ($groups && $groups->data)
                // foreach ($groups->data as $group) {
                // echo '<option value="' . $group->id . '"';
                // if ($group->id == $selected_group)
                // echo ' selected';
                // echo '>' . htmlspecialchars($group->name, ENT_QUOTES, $charset) . '</option>';
                // }
                ?>
					</select> -->
				</td></tr>

				<tr valign="top"><th scope="row">
					<label for="al2fb_page"><?php 
                _e('Add also to groups:', c_al2fb_text_domain);
                ?>
</label>
				</th><td>
<?php 
                if (WPAL2Int::Check_multiple()) {
                    echo '<table>';
                    if ($groups && $groups->data) {
                        foreach ($groups->data as $group) {
                            if (empty($group->name)) {
                                $group->name = '?';
                            }
                            echo '<tr><td><input type="checkbox"' . (in_array($group->id, $extra_group) ? ' checked="checked"' : '') . ' name="' . c_al2fb_meta_group_extra . '[]" value="' . $group->id . '"></td>';
                            echo '<td>' . htmlspecialchars($group->name, ENT_QUOTES, $charset) . '</td></tr>';
                        }
                    }
                    echo '</table>';
                } else {
                    echo '<strong>';
                    _e('This option is only available in', c_al2fb_text_domain);
                    echo ' <a href="http://www.faircode.eu/al2fbpro/?url=' . WPAL2Int::Redirect_uri() . '" target="_blank">Add Link to Facebook Pro</a>';
                    echo '</strong>';
                }
                $mu = WPAL2Int::Get_multiple_url();
                if ($mu) {
                    echo '<p><span style="color: red;"><strong>' . htmlspecialchars($mu, ENT_QUOTES, $charset) . '</strong></span></p>';
                }
                ?>
				</td></tr>
<?php 
            }
            ?>
			</table>

			<h4><?php 
            _e('Facebook friends', c_al2fb_text_domain);
            ?>
</h4>
			<table class="form-table al2fb_border">
			<tr valign="top"><th scope="row">
				<label for="al2fb_friend"><?php 
            _e('Add to wall of friends:', c_al2fb_text_domain);
            ?>
</label>
			</th><td>
				<p style="color: red;"><strong><a href="https://developers.facebook.com/blog/post/2012/10/10/growing-quality-apps-with-open-graph/">Facebook will not allow</a> adding to friends walls from February 6th, 2013 anymore</strong></p>
<?php 
            if (time() < strtotime('6 February 2013')) {
                if (WPAL2Int::Check_multiple()) {
                    // Check links API
                    if (get_option(c_al2fb_option_uselinks)) {
                        echo '<p style="color: Red"><strong>' . __('Disable the links API to use this feature', c_al2fb_text_domain) . '</strong></p>';
                    }
                    // Get friends
                    try {
                        $friends = WPAL2Int::Get_fb_friends_cached($user_ID);
                    } catch (Exception $e) {
                        if ($al2fb->debug) {
                            print_r($e);
                        }
                        $friends = null;
                    }
                    $extra_friend = get_user_meta($user_ID, c_al2fb_meta_friend_extra, true);
                    if (empty($extra_friend) || !is_array($extra_friend)) {
                        $extra_friend = array();
                    }
                    echo '<table>';
                    if ($friends && $friends->data) {
                        usort($friends->data, 'al2fb_compare_friends');
                        foreach ($friends->data as $friend) {
                            if (empty($friend->name)) {
                                $friend->name = '?';
                            }
                            echo '<tr><td><input type="checkbox"' . (in_array($friend->id, $extra_friend) ? ' checked="checked"' : '') . ' name="' . c_al2fb_meta_friend_extra . '[]" value="' . $friend->id . '"></td>';
                            echo '<td>' . htmlspecialchars($friend->name, ENT_QUOTES, $charset) . '</td></tr>';
                        }
                    }
                    echo '</table>';
                } else {
                    echo '<strong>';
                    _e('This option is only available in', c_al2fb_text_domain);
                    echo ' <a href="http://www.faircode.eu/al2fbpro/?url=' . WPAL2Int::Redirect_uri() . '" target="_blank">Add Link to Facebook Pro</a>';
                    echo '</strong>';
                }
            }
            ?>
			</td></tr>
			</table>

			<p class="submit">
			<input type="submit" class="button-primary" value="<?php 
            _e('Save', c_al2fb_text_domain);
            ?>
" />
			</p>
<?php 
        } catch (Exception $e) {
            echo '<div id="message" class="error fade al2fb_error"><p>' . htmlspecialchars($e->getMessage(), ENT_QUOTES, $charset) . '</p></div>';
        }
    } else {
        ?>
		<h4><?php 
        _e('First authorize the plugin', c_al2fb_text_domain);
        ?>
</h4>
<?php 
    }
    ?>
	</div>

	<div id="al2fb_tab_appearance" class="al2fb_tab_content">
	<h4><?php 
    _e('Link appearance', c_al2fb_text_domain);
    ?>
</h4>
	<table class="form-table al2fb_border">
	<tr valign="top"><th scope="row">
		<label for="al2fb_caption"><?php 
    _e('Use site title as caption:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_caption" name="<?php 
    echo c_al2fb_meta_caption;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_caption, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
		<br /><span class="al2fb_explanation">&quot;<?php 
    echo html_entity_decode(get_bloginfo('title'), ENT_QUOTES, get_bloginfo('charset'));
    ?>
&quot;</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_msg"><?php 
    _e('Use excerpt as message:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_msg" name="<?php 
    echo c_al2fb_meta_msg;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_msg, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_auto_excerpt"><?php 
    _e('Automatically generate excerpt:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_auto_excerpt" name="<?php 
    echo c_al2fb_meta_auto_excerpt;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_auto_excerpt, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_trailer"><?php 
    _e('Text trailer:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_trailer" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_trailer;
    ?>
" type="text" value="<?php 
    echo htmlentities(get_user_meta($user_ID, c_al2fb_meta_trailer, true), ENT_QUOTES, get_bloginfo('charset'));
    ?>
" />
		<br /><span class="al2fb_explanation"><?php 
    _e('For example "Read more ..."', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_hyperlink"><?php 
    _e('Keep hyperlinks:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_hyperlink" name="<?php 
    echo c_al2fb_meta_hyperlink;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_hyperlink, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
		<br /><span class="al2fb_explanation"><?php 
    _e('The hyperlink title will be removed', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_shortlink"><?php 
    _e('Use short URL:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_shortlink" name="<?php 
    echo c_al2fb_meta_shortlink;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_shortlink, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
		<br /><span class="al2fb_explanation"><?php 
    _e('If available', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_privacy"><?php 
    _e('Privacy:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<span class="al2fb_explanation"><?php 
    _e('Only works for your personal wall', c_al2fb_text_domain);
    ?>
</span><br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_privacy;
    ?>
" value=""<?php 
    echo $priv_none;
    ?>
><?php 
    _e('Default', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_privacy;
    ?>
" value="EVERYONE"<?php 
    echo $priv_everyone;
    ?>
><?php 
    _e('Everyone', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_privacy;
    ?>
" value="ALL_FRIENDS"<?php 
    echo $priv_friends;
    ?>
><?php 
    _e('All friends', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_privacy;
    ?>
" value="FRIENDS_OF_FRIENDS"<?php 
    echo $priv_fof;
    ?>
><?php 
    _e('Friends of friends', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_privacy;
    ?>
" value="SELF"<?php 
    echo $priv_me;
    ?>
><?php 
    _e('Only me', c_al2fb_text_domain);
    ?>
<br />
	</td></tr>

	</table>
	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>
	</div>

	<div id="al2fb_tab_comments" class="al2fb_tab_content">
	<h4><?php 
    _e('Facebook comments', c_al2fb_text_domain);
    ?>
</h4>
	<table class="form-table al2fb_border">
	<tr valign="top"><th scope="row">
		<label for="al2fb_fb_comments"><?php 
    _e('Integrate comments from Facebook:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_fb_comments" name="<?php 
    echo c_al2fb_meta_fb_comments;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_fb_comments, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_fb_comments_trailer"><?php 
    _e('Comment trailer:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_fb_comments_trailer" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_fb_comments_trailer;
    ?>
" type="text" value="<?php 
    echo htmlentities(get_user_meta($user_ID, c_al2fb_meta_fb_comments_trailer, true), ENT_QUOTES, get_bloginfo('charset'));
    ?>
" />
		<br /><span class="al2fb_explanation"><?php 
    _e('For example "Read more ..."', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_fb_comments_postback"><?php 
    _e('Post WordPress comments back to Facebook:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_fb_comments_postback" name="<?php 
    echo c_al2fb_meta_fb_comments_postback;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_fb_comments_postback, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_fb_comments_only"><?php 
    _e('Do not send pingbacks and trackbacks:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_fb_comments_only" name="<?php 
    echo c_al2fb_meta_fb_comments_only;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_fb_comments_only, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_fb_comments_copy"><?php 
    _e('Copy comments from Facebook to WordPress:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_fb_comments_copy" name="<?php 
    echo c_al2fb_meta_fb_comments_copy;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_fb_comments_copy, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
		<br /><span class="al2fb_explanation"><?php 
    _e('Enables for example editing of Facebook comments', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_fb_comments_nolink"><?php 
    _e('Link Facebook comment to:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input type="radio" name="<?php 
    echo c_al2fb_meta_fb_comments_nolink;
    ?>
" value="none"<?php 
    echo $comments_nolink_none;
    ?>
><?php 
    _e('None', c_al2fb_text_domain);
    ?>
<br />
		<span class="al2fb_explanation"><?php 
    _e('Disables displaying of Facebook avatars too', c_al2fb_text_domain);
    ?>
</span><br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_fb_comments_nolink;
    ?>
" value="author"<?php 
    echo $comments_nolink_author;
    ?>
><?php 
    _e('Profile author', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_fb_comments_nolink;
    ?>
" value="link"<?php 
    echo $comments_nolink_link;
    ?>
><?php 
    _e('Added link', c_al2fb_text_domain);
    ?>
 (<?php 
    _e('Does not work for groups', c_al2fb_text_domain);
    ?>
)<br />
		<span class="al2fb_explanation"><?php 
    _e('Disables displaying of Facebook avatars too', c_al2fb_text_domain);
    ?>
</span><br />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_fb_likes"><?php 
    _e('Integrate likes from Facebook:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_fb_likes" name="<?php 
    echo c_al2fb_meta_fb_likes;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_fb_likes, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_post_likers"><?php 
    _e('Show likers below the post text:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_post_likers" name="<?php 
    echo c_al2fb_meta_post_likers;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_post_likers, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>
	</table>
	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>
	</div>

	<div id="al2fb_tab_like_button" class="al2fb_tab_content">
	<h4><?php 
    _e('Facebook like button', c_al2fb_text_domain);
    ?>
</h4>
	<table class="form-table al2fb_border">
	<tr valign="top"><th scope="row">
		<label for="al2fb_post_like_button"><?php 
    _e('Show Facebook like button:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_post_like_button" name="<?php 
    echo c_al2fb_meta_post_like_button;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_post_like_button, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
		<br /><a class="al2fb_explanation" href="http://developers.facebook.com/docs/reference/plugins/like/" target="_blank"><?php 
    _e('Documentation', c_al2fb_text_domain);
    ?>
</a>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_layout"><?php 
    _e('Layout:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input type="radio" name="<?php 
    echo c_al2fb_meta_like_layout;
    ?>
" value="standard"<?php 
    echo $like_layout_standard;
    ?>
><?php 
    _e('Standard', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_like_layout;
    ?>
" value="button_count"<?php 
    echo $like_layout_button;
    ?>
><?php 
    _e('Button with count', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_like_layout;
    ?>
" value="box_count"<?php 
    echo $like_layout_box;
    ?>
><?php 
    _e('Box with count', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_like_layout;
    ?>
" value="button"<?php 
    echo $like_layout_simple;
    ?>
><?php 
    _e('Button', c_al2fb_text_domain);
    ?>
<br />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_width"><?php 
    _e('Width:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_numeric" id="al2fb_like_width" name="<?php 
    echo c_al2fb_meta_like_width;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_like_width, true);
    ?>
" />
		<span><?php 
    _e('Pixels', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_action"><?php 
    _e('Action:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input type="radio" name="<?php 
    echo c_al2fb_meta_like_action;
    ?>
" value="like"<?php 
    echo $like_action_like;
    ?>
><?php 
    _e('Like', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_like_action;
    ?>
" value="recommend"<?php 
    echo $like_action_recommend;
    ?>
><?php 
    _e('Recommend', c_al2fb_text_domain);
    ?>
<br />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_top"><?php 
    _e('Show at the top of the post:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_like_top" name="<?php 
    echo c_al2fb_meta_like_top;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_like_top, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_send"><?php 
    _e('Show Facebook send button:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_like_send" name="<?php 
    echo c_al2fb_meta_post_send_button;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_post_send_button, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
		<br /><a class="al2fb_explanation" href="http://developers.facebook.com/docs/reference/plugins/send/" target="_blank"><?php 
    _e('Documentation', c_al2fb_text_domain);
    ?>
</a>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_combine"><?php 
    _e('Combine Facebook like and send buttons:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_combine" name="<?php 
    echo c_al2fb_meta_post_combine_buttons;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_post_combine_buttons, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_share"><?php 
    _e('Share button:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_like_share" name="<?php 
    echo c_al2fb_meta_like_share;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_like_share, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	</table>
	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>
	</div>

	<div id="al2fb_tab_like_box" class="al2fb_tab_content">
	<h4><?php 
    _e('Facebook like box', c_al2fb_text_domain);
    ?>
</h4>
	<table class="form-table al2fb_border">

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_box_width"><?php 
    _e('Width:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_numeric" id="al2fb_like_box_width" name="<?php 
    echo c_al2fb_meta_like_box_width;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_like_box_width, true);
    ?>
" />
		<span><?php 
    _e('Pixels', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_box_height"><?php 
    _e('Height:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_numeric" id="al2fb_like_box_height" name="<?php 
    echo c_al2fb_meta_like_box_height;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_like_box_height, true);
    ?>
" />
		<span><?php 
    _e('Pixels', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_box_noheader"><?php 
    _e('Disable like box header:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_box_noheader" name="<?php 
    echo c_al2fb_meta_like_box_noheader;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_like_box_noheader, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_box_nostream"><?php 
    _e('Disable like box stream:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_box_nostream" name="<?php 
    echo c_al2fb_meta_like_box_nostream;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_like_box_nostream, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	</table>
	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>
	</div>

	<div id="al2fb_tab_subscribe_button" class="al2fb_tab_content">
	<h4><?php 
    _e('Subscribe button', c_al2fb_text_domain);
    ?>
</h4>
	<table class="form-table al2fb_border">

	<tr valign="top"><th scope="row">
		<label for="al2fb_subscribe_layout"><?php 
    _e('Layout:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<select class="al2fb_select" id="al2fb_subscribe_layout" name="<?php 
    echo c_al2fb_meta_subscribe_layout;
    ?>
">
		<option value="standard" <?php 
    echo $subscribe_layout == 'standard' ? 'selected' : '';
    ?>
><?php 
    _e('Standard', c_al2fb_text_domain);
    ?>
</option>
		<option value="button_count" <?php 
    echo $subscribe_layout == 'button_count' ? 'selected' : '';
    ?>
><?php 
    _e('Button with count', c_al2fb_text_domain);
    ?>
</option>
		<option value="box_count" <?php 
    echo $subscribe_layout == 'box_count' ? 'selected' : '';
    ?>
><?php 
    _e('Box with count', c_al2fb_text_domain);
    ?>
</option>
		</select>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_subscribe_width"><?php 
    _e('Width:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_numeric" id="al2fb_subscribe_width" name="<?php 
    echo c_al2fb_meta_subscribe_width;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_subscribe_width, true);
    ?>
" />
		<span><?php 
    _e('Pixels', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	</table>
	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>
	</div>

	<div id="al2fb_tab_comments_plugin" class="al2fb_tab_content">
	<h4><?php 
    _e('Facebook comments plugin', c_al2fb_text_domain);
    ?>
</h4>
	<table class="form-table al2fb_border">

	<tr valign="top"><th scope="row">
		<label for="al2fb_comments_posts"><?php 
    _e('Number of posts:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_numeric" id="al2fb_comments_posts" name="<?php 
    echo c_al2fb_meta_comments_posts;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_comments_posts, true);
    ?>
" />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_comments_width"><?php 
    _e('Width:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_numeric" id="al2fb_comments_width" name="<?php 
    echo c_al2fb_meta_comments_width;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_comments_width, true);
    ?>
" />
		<span><?php 
    _e('Pixels', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_comments_auto"><?php 
    _e('Display automatically after post:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_comments_auto" name="<?php 
    echo c_al2fb_meta_comments_auto;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_comments_auto, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
		<br /><span><?php 
    _e('There is no comment integration for the Facebook comments plugin!', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	</table>
	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>
	</div>

	<div id="al2fb_tab_face_pile" class="al2fb_tab_content">
	<h4><?php 
    _e('Facebook face pile', c_al2fb_text_domain);
    ?>
</h4>
	<table class="form-table al2fb_border">

	<tr valign="top"><th scope="row">
		<label for="al2fb_pile_size"><?php 
    _e('Size:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<select class="al2fb_select" id="al2fb_pile_size" name="<?php 
    echo c_al2fb_meta_pile_size;
    ?>
">
		<option value="small" <?php 
    echo $pile_size == 'small' ? 'selected' : '';
    ?>
><?php 
    _e('Small', c_al2fb_text_domain);
    ?>
</option>
		<option value="large" <?php 
    echo $pile_size == 'large' ? 'selected' : '';
    ?>
><?php 
    _e('Large', c_al2fb_text_domain);
    ?>
</option>
		</select>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_pile_width"><?php 
    _e('Width:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_numeric" id="al2fb_pile_width" name="<?php 
    echo c_al2fb_meta_pile_width;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_pile_width, true);
    ?>
" />
		<span><?php 
    _e('Pixels', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	</table>
	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>
	</div>

	<div id="al2fb_tab_login" class="al2fb_tab_content">
	<h4><?php 
    _e('Facebook login', c_al2fb_text_domain);
    ?>
</h4>
	<table class="form-table al2fb_border">

	<tr valign="top"><th scope="row">
		<label for="al2fb_reg_width"><?php 
    _e('Registration width:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_numeric" id="al2fb_reg_width" name="<?php 
    echo c_al2fb_meta_reg_width;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_reg_width, true);
    ?>
" />
		<span><?php 
    _e('Pixels', c_al2fb_text_domain);
    ?>
</span>
		<br /><a class="al2fb_explanation" href="http://developers.facebook.com/docs/plugins/registration/" target="_blank"><?php 
    _e('Documentation', c_al2fb_text_domain);
    ?>
</a>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_login_width"><?php 
    _e('Login width:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_numeric" id="al2fb_login_width" name="<?php 
    echo c_al2fb_meta_login_width;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_login_width, true);
    ?>
" />
		<span><?php 
    _e('Pixels', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_login_regurl"><?php 
    _e('Login registration URL:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_text" id="al2fb_login_regurl" name="<?php 
    echo c_al2fb_meta_login_regurl;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_login_regurl, true);
    ?>
" />
		<br /><a class="al2fb_explanation" href="http://developers.facebook.com/docs/reference/plugins/login/" target="_blank"><?php 
    _e('Documentation', c_al2fb_text_domain);
    ?>
</a>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_reg_success"><?php 
    _e('Registration success URL:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_text" id="al2fb_reg_success" name="<?php 
    echo c_al2fb_meta_reg_success;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_reg_success, true);
    ?>
" />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_login_redir"><?php 
    _e('Login redirect URL:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_text" id="al2fb_login_redir" name="<?php 
    echo c_al2fb_meta_login_redir;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_login_redir, true);
    ?>
" />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_login_add_links"><?php 
    _e('Allow adding links with login:'******' checked="checked"';
    }
    if (!current_user_can('manage_options')) {
        echo ' disabled';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row" colspan="2">
		<label for="al2fb_login_html"><?php 
    _e('Text or HTML when logged in:', c_al2fb_text_domain);
    ?>
</label>
		<br />
		<textarea id="al2fb_login_html" name="<?php 
    echo c_al2fb_meta_login_html;
    ?>
" cols="75" rows="10"><?php 
    echo get_user_meta($user_ID, c_al2fb_meta_login_html, true);
    ?>
</textarea>
	</th><td>
	</td></tr>

	</table>
	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>
	</div>

	<div id="al2fb_tab_activity_feed" class="al2fb_tab_content">
	<h4><?php 
    _e('Facebook activity feed', c_al2fb_text_domain);
    ?>
</h4>
	<table class="form-table al2fb_border">

	<tr valign="top"><th scope="row">
		<label for="al2fb_act_width"><?php 
    _e('Width:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_numeric" id="al2fb_act_width" name="<?php 
    echo c_al2fb_meta_act_width;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_act_width, true);
    ?>
" />
		<span><?php 
    _e('Pixels', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_act_height"><?php 
    _e('Height:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_numeric" id="al2fb_act_height" name="<?php 
    echo c_al2fb_meta_act_height;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_act_height, true);
    ?>
" />
		<span><?php 
    _e('Pixels', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_act_header"><?php 
    _e('Show header:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_act_header" name="<?php 
    echo c_al2fb_meta_act_header;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_act_header, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_act_recommend"><?php 
    _e('Show recommendations:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_act_recommend" name="<?php 
    echo c_al2fb_meta_act_recommend;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_act_recommend, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	</table>
	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>
	</div>

	<div id="al2fb_tab_common" class="al2fb_tab_content">
	<h4><?php 
    _e('Facebook common', c_al2fb_text_domain);
    ?>
</h4>
	<table class="form-table al2fb_border">

	<tr valign="top"><th scope="row">
		<label for="al2fb_post_nohome"><?php 
    _e('Do not show on the home page:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_post_nohome" name="<?php 
    echo c_al2fb_meta_like_nohome;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_like_nohome, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_post_noposts"><?php 
    _e('Do not show on posts:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_post_noposts" name="<?php 
    echo c_al2fb_meta_like_noposts;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_like_noposts, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_post_nopages"><?php 
    _e('Do not show on pages:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_post_nopages" name="<?php 
    echo c_al2fb_meta_like_nopages;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_like_nopages, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_post_noarchives"><?php 
    _e('Do not show in archives:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_post_noarchives" name="<?php 
    echo c_al2fb_meta_like_noarchives;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_like_noarchives, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_post_nocategories"><?php 
    _e('Do not show in categories:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_post_nocategories" name="<?php 
    echo c_al2fb_meta_like_nocategories;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_like_nocategories, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_faces"><?php 
    _e('Faces:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_like_faces" name="<?php 
    echo c_al2fb_meta_like_faces;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_like_faces, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_pile_rows"><?php 
    _e('Maximum count of rows:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input class="al2fb_numeric" id="al2fb_pile_rows" name="<?php 
    echo c_al2fb_meta_pile_rows;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_pile_rows, true);
    ?>
" />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_font"><?php 
    _e('Font:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<select class="al2fb_select" id="al2fb_like_font" name="<?php 
    echo c_al2fb_meta_like_font;
    ?>
">
		<option value="" <?php 
    echo empty($like_font) ? 'selected' : '';
    ?>
></option>
		<option value="arial" <?php 
    echo $like_font == 'arial' ? 'selected' : '';
    ?>
>arial</option>
		<option value="lucida grande" <?php 
    echo $like_font == 'lucida grande' ? 'selected' : '';
    ?>
>lucida grande</option>
		<option value="segoe ui" <?php 
    echo $like_font == 'segoe ui' ? 'selected' : '';
    ?>
>segoe ui</option>
		<option value="tahoma" <?php 
    echo $like_font == 'tahoma' ? 'selected' : '';
    ?>
>tahoma</option>
		<option value="trebuchet ms" <?php 
    echo $like_font == 'trebuchet ms' ? 'selected' : '';
    ?>
>trebuchet ms</option>
		<option value="verdana" <?php 
    echo $like_font == 'verdana' ? 'selected' : '';
    ?>
>verdana</option>
		</select>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_color"><?php 
    _e('Color scheme:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input type="radio" name="<?php 
    echo c_al2fb_meta_like_colorscheme;
    ?>
" value="light"<?php 
    echo $like_color_light;
    ?>
><?php 
    _e('Light', c_al2fb_text_domain);
    ?>
<br />
		<input type="radio" name="<?php 
    echo c_al2fb_meta_like_colorscheme;
    ?>
" value="dark"<?php 
    echo $like_color_dark;
    ?>
><?php 
    _e('Dark', c_al2fb_text_domain);
    ?>
<br />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_box_border"><?php 
    _e('Border color:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_like_box_border" name="<?php 
    echo c_al2fb_meta_like_box_border;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_like_box_border, true);
    ?>
" />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_like_link"><?php 
    _e('Link to:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_like_link" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_like_link;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_like_link, true);
    ?>
" />
		<br /><span class="al2fb_explanation"><?php 
    _e('Default the post or page', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_open_graph"><?php 
    _e('Use Open Graph protocol:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_open_graph" name="<?php 
    echo c_al2fb_meta_open_graph;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_open_graph, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
		<br /><a class="al2fb_explanation" href="http://developers.facebook.com/docs/opengraph/" target="_blank"><?php 
    _e('Documentation', c_al2fb_text_domain);
    ?>
</a>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_open_graph_type"><?php 
    _e('Open Graph protocol <em>og:type</em>:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_open_graph_type" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_open_graph_type;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_open_graph_type, true);
    ?>
" />
		<br /><span class="al2fb_explanation"><?php 
    _e('Default \'article\'', c_al2fb_text_domain);
    ?>
</span>
		<a class="al2fb_explanation" href="http://developers.facebook.com/docs/opengraph/#types" target="_blank"><?php 
    _e('Documentation', c_al2fb_text_domain);
    ?>
</a>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_open_graph_admin"><?php 
    _e('Facebook administrators:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_open_graph_admin" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_open_graph_admins;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_open_graph_admins, true);
    ?>
" />
		<br /><span class="al2fb_explanation"><?php 
    _e('Separate multiple administrators by a comma without spaces', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	</table>
	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>
	</div>

	<div id="al2fb_tab_misc" class="al2fb_tab_content">
	<a name="misc"></a>
	<h4><?php 
    _e('Miscelaneous settings', c_al2fb_text_domain);
    ?>
</h4>
	<table class="form-table al2fb_border">
	<tr valign="top"><th scope="row">
		<label for="al2fb_exclude_default"><?php 
    _e('Do not add link by default:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_exclude_default" name="<?php 
    echo c_al2fb_meta_exclude_default;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_exclude_default, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_exclude_default_video"><?php 
    _e('Do not add video by default:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_exclude_default_video" name="<?php 
    echo c_al2fb_meta_exclude_default_video;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_exclude_default_video, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_not_post_list"><?php 
    _e('Don\'t show a summary in the post list:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_not_post_list" name="<?php 
    echo c_al2fb_meta_not_post_list;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_not_post_list, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_add_new_page"><?php 
    _e('Add links for new pages:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_add_new_page" name="<?php 
    echo c_al2fb_meta_add_new_page;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_add_new_page, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_show_permalink"><?php 
    _e('Show link to the added link on Facebook:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_show_permalink" name="<?php 
    echo c_al2fb_meta_show_permalink;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_show_permalink, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_social_noexcerpt"><?php 
    _e('Do not show social plugins in excerpts:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_social_noexcerpt" name="<?php 
    echo c_al2fb_meta_social_noexcerpt;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_social_noexcerpt, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
		<br /><span class="al2fb_explanation"><?php 
    _e('For example like button', c_al2fb_text_domain);
    ?>
<span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_fb_encoding"><?php 
    _e('Facebook character encoding:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_fb_encoding" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_fb_encoding;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_fb_encoding, true);
    ?>
" />
		<br /><span class="al2fb_explanation"><?php 
    _e('Default UTF-8; do not change if no need', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_fb_locale"><?php 
    _e('Facebook locale:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_fb_locale" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_fb_locale;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_fb_locale, true);
    ?>
" />
		<br /><span class="al2fb_explanation"><?php 
    _e('Do not change if no need', c_al2fb_text_domain);
    ?>
<span>&nbsp;(<?php 
    echo str_replace('-', '_', get_bloginfo('language'));
    ?>
)</span></span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_param_name"><?php 
    _e('Extra URL parameter', c_al2fb_text_domain);
    ?>
:</label>
	</th><td>
		<input id="al2fb_param_name" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_param_name;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_param_name, true);
    ?>
" />
		&nbsp;=&nbsp;
		<input id="al2fb_param_value" class="al2fb_text" name="<?php 
    echo c_al2fb_meta_param_value;
    ?>
" type="text" value="<?php 
    echo get_user_meta($user_ID, c_al2fb_meta_param_value, true);
    ?>
" />
		<br /><span class="al2fb_explanation"><?php 
    _e('For example for Google Anaylytics', c_al2fb_text_domain);
    ?>
</span>
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_clear_errors"><?php 
    _e('Clear all error messages:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_clear_errors" name="<?php 
    echo c_al2fb_meta_clear_errors;
    ?>
" type="checkbox" />
	</td></tr>

	<tr valign="top"><th scope="row">
		<label for="al2fb_donated"><?php 
    _e('I have donated to this plugin:', c_al2fb_text_domain);
    ?>
</label>
	</th><td>
		<input id="al2fb_donated" name="<?php 
    echo c_al2fb_meta_donated;
    ?>
" type="checkbox"<?php 
    if (get_user_meta($user_ID, c_al2fb_meta_donated, true)) {
        echo ' checked="checked"';
    }
    ?>
 />
	</td></tr>
	</table>
	<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save', c_al2fb_text_domain);
    ?>
" />
	</p>
	</div>

	<div id="al2fb_tab_admin" class="al2fb_tab_content">
<?php 
    if (current_user_can('manage_options')) {
        ?>
		<h4><?php 
        _e('Administrator options', c_al2fb_text_domain);
        ?>
</h4>
		<table class="form-table al2fb_border">
		<tr valign="top"><th scope="row">
			<label for="al2fb_timeout"><?php 
        _e('Facebook communication timeout:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input class="al2fb_numeric" id="al2fb_timeout" name="<?php 
        echo c_al2fb_option_timeout;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_timeout);
        ?>
" />
			<span><?php 
        _e('Seconds', c_al2fb_text_domain);
        ?>
</span>
			<br /><span class="al2fb_explanation"><?php 
        _e('Default 15 seconds', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_nonotice"><?php 
        _e('Do not display notices:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_nonotice" name="<?php 
        echo c_al2fb_option_nonotice;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_nonotice)) {
            echo ' checked="checked"';
        }
        ?>
 />
			<br /><span class="al2fb_explanation"><?php 
        _e('Except on this page', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_min_cap"><?php 
        _e('Required capability to use plugin:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<select class="al2fb_select" id="al2fb_min_cap" name="<?php 
        echo c_al2fb_option_min_cap;
        ?>
">
<?php 
        // Get list of capabilities
        global $wp_roles;
        $capabilities = array();
        foreach ($wp_roles->role_objects as $key => $role) {
            if (is_array($role->capabilities)) {
                foreach ($role->capabilities as $cap => $grant) {
                    $capabilities[$cap] = $cap;
                }
            }
        }
        sort($capabilities);
        // List capabilities and select current
        $min_cap = get_option(c_al2fb_option_min_cap);
        foreach ($capabilities as $cap) {
            echo '<option value="' . $cap . '"';
            if ($cap == $min_cap) {
                echo ' selected';
            }
            echo '>' . $cap . '</option>';
        }
        ?>
			</select>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_no_post_submit"><?php 
        _e('Hide post submit additions too:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_no_post_submit" name="<?php 
        echo c_al2fb_option_no_post_submit;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_no_post_submit)) {
            echo ' checked="checked"';
        }
        ?>
 />
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_min_cap_comment"><?php 
        _e('Required capability to view Facebook comments:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<select class="al2fb_select" id="al2fb_min_cap_comment" name="<?php 
        echo c_al2fb_option_min_cap_comment;
        ?>
">
<?php 
        // List capabilities and select current
        $min_cap = get_option(c_al2fb_option_min_cap_comment);
        echo '<option value=""';
        if (empty($min_cap)) {
            echo ' selected';
        }
        echo '>' . __('None', c_al2fb_text_domain) . '</option>';
        foreach ($capabilities as $cap) {
            echo '<option value="' . $cap . '"';
            if ($cap == $min_cap) {
                echo ' selected';
            }
            echo '>' . $cap . '</option>';
        }
        ?>
			</select>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_cache"><?php 
        _e('Refresh Facebook comments every:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input class="al2fb_numeric" id="al2fb_cache" name="<?php 
        echo c_al2fb_option_msg_refresh;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_msg_refresh);
        ?>
" />
			<span><?php 
        _e('Minutes', c_al2fb_text_domain);
        ?>
</span>
			<br /><span class="al2fb_explanation"><?php 
        _e('Default every 10 minutes', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_maxage"><?php 
        _e('Refresh Facebook comments for:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input class="al2fb_numeric" id="al2fb_maxage" name="<?php 
        echo c_al2fb_option_msg_maxage;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_msg_maxage);
        ?>
" />
			<span><?php 
        _e('Days', c_al2fb_text_domain);
        ?>
</span>
			<br /><span class="al2fb_explanation"><?php 
        _e('Default 7 days', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_cron"><?php 
        _e('Refresh Facebook comments in the background:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_cron" name="<?php 
        echo c_al2fb_option_cron_enabled;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_cron_enabled)) {
            echo ' checked="checked"';
        }
        ?>
 />
			<br /><span class="al2fb_explanation"><?php 
        _e('Using Wordress cron', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_max_descr"><?php 
        _e('Maximum text length with trailer:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input class="al2fb_numeric" id="al2fb_max_descr" name="<?php 
        echo c_al2fb_option_max_descr;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_max_descr);
        ?>
" />
			<span><?php 
        _e('Characters', c_al2fb_text_domain);
        ?>
</span>
			<br /><span class="al2fb_explanation"><?php 
        _e('Default 256 characters', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_max_text"><?php 
        _e('Maximum Facebook text length:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input class="al2fb_numeric" id="al2fb_max_text" name="<?php 
        echo c_al2fb_option_max_text;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_max_text);
        ?>
" />
			<span><?php 
        _e('Characters', c_al2fb_text_domain);
        ?>
</span>
			<br /><span class="al2fb_explanation"><?php 
        _e('Default 10,000 characters', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_max_comment"><?php 
        _e('Maximum comment length with trailer:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input class="al2fb_numeric" id="al2fb_max_comment" name="<?php 
        echo c_al2fb_option_max_comment;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_max_comment);
        ?>
" />
			<span><?php 
        _e('Characters', c_al2fb_text_domain);
        ?>
</span>
			<br /><span class="al2fb_explanation"><?php 
        _e('Default 256 characters', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_exclude_custom"><?php 
        _e('Do not add links for custom post types:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_exclude_custom" name="<?php 
        echo c_al2fb_option_exclude_custom;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_exclude_custom)) {
            echo ' checked="checked"';
        }
        ?>
 />
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_exclude_type"><?php 
        _e('Exclude these custom post types:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input class="al2fb_text" id="al2fb_exclude_type" name="<?php 
        echo c_al2fb_option_exclude_type;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_exclude_type);
        ?>
" />
			<br /><span class="al2fb_explanation"><?php 
        _e('Separate by commas', c_al2fb_text_domain);
        ?>
</span>
<?php 
        echo '<br /><span class="al2fb_explanation">';
        $first = true;
        $post_types = get_post_types('', 'names');
        foreach ($post_types as $post_type) {
            if ($first) {
                $first = false;
            } else {
                echo ',';
            }
            echo htmlspecialchars($post_type, ENT_QUOTES, $charset);
        }
        echo '</span>';
        ?>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_exclude_cat"><?php 
        _e('Exclude these categories:', c_al2fb_text_domain);
        ?>
</label>
			<br /><span class="al2fb_explanation"><?php 
        _e('Use category ID\'s', c_al2fb_text_domain);
        ?>
</span>
		</th><td>
			<input class="al2fb_text" id="al2fb_exclude_cat" name="<?php 
        echo c_al2fb_option_exclude_cat;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_exclude_cat);
        ?>
" />
			<br /><span class="al2fb_explanation"><?php 
        _e('Separate by commas', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_exclude_tag"><?php 
        _e('Exclude these tags:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input class="al2fb_text" id="al2fb_exclude_tag" name="<?php 
        echo c_al2fb_option_exclude_tag;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_exclude_tag);
        ?>
" />
			<br /><span class="al2fb_explanation"><?php 
        _e('Separate by commas', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_exclude_author"><?php 
        _e('Exclude these authors:', c_al2fb_text_domain);
        ?>
</label>
			<br /><span class="al2fb_explanation"><?php 
        _e('Use login names', c_al2fb_text_domain);
        ?>
</span>
		</th><td>
			<input class="al2fb_text" id="al2fb_exclude_author" name="<?php 
        echo c_al2fb_option_exclude_author;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_exclude_author);
        ?>
" />
			<br /><span class="al2fb_explanation"><?php 
        _e('Separate by commas', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_metabox_type"><?php 
        _e('Add meta box for these custom post types:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input class="al2fb_text" id="al2fb_metabox_type" name="<?php 
        echo c_al2fb_option_metabox_type;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_metabox_type);
        ?>
" />
			<br /><span class="al2fb_explanation"><?php 
        _e('Separate by commas', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_noverifypeer"><?php 
        _e('Do not verify the peer\'s certificate:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_noverifypeer" name="<?php 
        echo c_al2fb_option_noverifypeer;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_noverifypeer)) {
            echo ' checked="checked"';
        }
        ?>
 />
			<br /><span class="al2fb_explanation"><?php 
        _e('Try this in case of cURL error 60', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_use_cacerts"><?php 
        _e('Use bundled CA certificates:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_use_cacerts" name="<?php 
        echo c_al2fb_option_use_cacerts;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_use_cacerts)) {
            echo ' checked="checked"';
        }
        ?>
 />
			<br /><span class="al2fb_explanation"><?php 
        _e('Try this in case of cURL error 60', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_shortcode"><?php 
        _e('Execute shortcodes in widgets:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_shortcode" name="<?php 
        echo c_al2fb_option_shortcode_widget;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_shortcode_widget)) {
            echo ' checked="checked"';
        }
        ?>
 />
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_noshortcode"><?php 
        _e('Do not execute shortcodes for texts:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_noshortcode" name="<?php 
        echo c_al2fb_option_noshortcode;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_noshortcode)) {
            echo ' checked="checked"';
        }
        ?>
 />
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_nofilter"><?php 
        _e('Do not execute filters for texts:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_nofilter" name="<?php 
        echo c_al2fb_option_nofilter;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_nofilter)) {
            echo ' checked="checked"';
        }
        ?>
 />
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_nofilter"><?php 
        _e('Do not execute filters for comments:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_nofilter" name="<?php 
        echo c_al2fb_option_nofilter_comments;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_nofilter_comments)) {
            echo ' checked="checked"';
        }
        ?>
 />
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_use_ssp"><a href="http://yro.slashdot.org/story/11/09/03/0115241/Heises-Two-Clicks-For-More-Privacy-vs-Facebook"><?php 
        _e('Use Heise social share privacy:', c_al2fb_text_domain);
        ?>
</a></label>
		</th><td>
			<input id="al2fb_use ssp" name="<?php 
        echo c_al2fb_option_use_ssp;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_use_ssp)) {
            echo ' checked="checked"';
        }
        ?>
 />
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_ssp_info"><?php 
        _e('Heise privacy policy URL:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input class="al2fb_text" id="al2fb_ssp_info" name="<?php 
        echo c_al2fb_option_ssp_info;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_ssp_info);
        ?>
" />
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_filter_prio"><?php 
        _e('Priority filter \'the_content\':', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input class="al2fb_text" id="al2fb_filter_prio" name="<?php 
        echo c_al2fb_option_filter_prio;
        ?>
" type="text" value="<?php 
        echo get_option(c_al2fb_option_filter_prio);
        ?>
" />
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_noasync"><?php 
        _e('No asynchronous Facebook script:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_noasync" name="<?php 
        echo c_al2fb_option_noasync;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_noasync)) {
            echo ' checked="checked"';
        }
        ?>
 />
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_noscript"><?php 
        _e('Do not include Facebook script:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_noscript" name="<?php 
        echo c_al2fb_option_noscript;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_noscript)) {
            echo ' checked="checked"';
        }
        ?>
 />
			<br /><span class="al2fb_explanation"><?php 
        _e('In case of conflicts with other Facebook plugins', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_uselinks"><?php 
        _e('Use links API instead of feed API:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_uselinks" name="<?php 
        echo c_al2fb_option_uselinks;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_uselinks)) {
            echo ' checked="checked"';
        }
        ?>
 />
			<br /><span class="al2fb_explanation"><?php 
        _e('Doesn\'t work for groups!', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_norefresh"><?php 
        _e('Do not refresh access token:', c_al2fb_text_domain);
        ?>
</label>
		</th><td>
			<input id="al2fb_norefresh" name="<?php 
        echo c_al2fb_option_notoken_refresh;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_notoken_refresh)) {
            echo ' checked="checked"';
        }
        ?>
 />
		</td></tr>

		<tr valign="top"><th scope="row">
			<label for="al2fb_clean"><?php 
        _e('Clean on deactivate:', c_al2fb_text_domain);
        ?>
</label>
			<br />
			<span class="al2fb_explanation"><strong><?php 
        _e('Upgrade deactivates the plugin!', c_al2fb_text_domain);
        ?>
</strong></span>
		</th><td>
			<input id="al2fb_clean" name="<?php 
        echo c_al2fb_option_clean;
        ?>
" type="checkbox"<?php 
        if (get_option(c_al2fb_option_clean)) {
            echo ' checked="checked"';
        }
        ?>
 />
			<br /><span class="al2fb_explanation"><?php 
        _e('All data, except link id\'s', c_al2fb_text_domain);
        ?>
</span>
		</td></tr>

		<tr valign="top"><th scope="row" colspan="2">
			<label for="al2fb_css"><?php 
        _e('Additional styling rules (CSS):', c_al2fb_text_domain);
        ?>
</label>
			<br />
			<textarea id="al2fb_css" name="<?php 
        echo c_al2fb_option_css;
        ?>
" cols="75" rows="10"><?php 
        echo get_option(c_al2fb_option_css);
        ?>
</textarea>
		</th><td>
		</td></tr>
		</table>

<?php 
        if (isset($_REQUEST['debug'])) {
            ?>
			<h4><?php 
            _e('Debug options', c_al2fb_text_domain);
            ?>
</h4>
			<table class="form-table al2fb_border">
			<tr valign="top"><th scope="row">
				<label for="al2fb_siteurl"><?php 
            _e('Use site URL as request URI:', c_al2fb_text_domain);
            ?>
</label>
			</th><td>
				<input id="al2fb_siteurl" name="<?php 
            echo c_al2fb_option_siteurl;
            ?>
" type="checkbox"<?php 
            if (get_option(c_al2fb_option_siteurl)) {
                echo ' checked="checked"';
            }
            ?>
 />
			</td></tr>

			<tr valign="top"><th scope="row">
				<label for="al2fb_nocurl"><?php 
            _e('Do not use cURL:', c_al2fb_text_domain);
            ?>
</label>
			</th><td>
				<input id="al2fb_nocurl" name="<?php 
            echo c_al2fb_option_nocurl;
            ?>
" type="checkbox"<?php 
            if (get_option(c_al2fb_option_nocurl)) {
                echo ' checked="checked"';
            }
            ?>
 />
			</td></tr>

			<tr valign="top"><th scope="row">
				<label for="al2fb_use_pp"><?php 
            _e('Use publish_post action:', c_al2fb_text_domain);
            ?>
</label>
			</th><td>
				<input id="al2fb_use_pp" name="<?php 
            echo c_al2fb_option_use_pp;
            ?>
" type="checkbox"<?php 
            if (get_option(c_al2fb_option_use_pp)) {
                echo ' checked="checked"';
            }
            ?>
 />
			</td></tr>

			<tr valign="top"><th scope="row">
				<label for="al2fb_debug"><?php 
            _e('Debug:', c_al2fb_text_domain);
            ?>
</label>
			</th><td>
				<input id="al2fb_debug" name="<?php 
            echo c_al2fb_option_debug;
            ?>
" type="checkbox"<?php 
            if (get_option(c_al2fb_option_debug)) {
                echo ' checked="checked"';
            }
            ?>
 />
			</td></tr>
			</table>
<?php 
        }
        ?>
		<p class="submit">
		<input type="submit" class="button-primary" value="<?php 
        _e('Save', c_al2fb_text_domain);
        ?>
" />
		</p>
<?php 
    } else {
        ?>
		<h4><?php 
        _e('Only for administrators', c_al2fb_text_domain);
        ?>
</h4>
<?php 
    }
    ?>
	</div>

	</div>
	<a href="<?php 
    echo $config_url . '&tabs=0';
    ?>
"><?php 
    _e('No tab pages', c_al2fb_text_domain);
    ?>
</a>

	<script type="text/javascript">
		jQuery(document).ready(function($) {
			if (window.location.search.substr(window.location.search.length - 6) == 'tabs=0') {
				$('#al2fb_tab_settings').hide();
				$('.al2fb_tab_container').removeClass('al2fb_tab_container');
				$('.al2fb_tab_content').removeClass('al2fb_tab_content');
			}
			else {
				$('.al2fb_tab_content').hide();
				if (window.location.search.substr(window.location.search.length - 4) == 'rate') {
					$('ul.al2fb_tabs li:has(a[href=#al2fb_tab_misc])').addClass('active').show();
					$('#al2fb_tab_misc').show();
					$('html, body').animate({scrollTop: $('#al2fb_tab_settings').offset().top}, 2000);
				}
				else {
					$('ul.al2fb_tabs li:first').addClass('active').show();
					$('.al2fb_tab_content:first').show();
				}

				$('ul.al2fb_tabs li').click(function() {
					$('ul.al2fb_tabs li').removeClass('active');
					$(this).addClass('active');
					$('.al2fb_tab_content').hide();
					var activeTab = $(this).find('a').attr('href');
					$(activeTab).show();
					return false;
				});
			}
		});
	</script>
	</form>
	</div>
	</div>
<?php 
}
function al2fb_debug_info($al2fb)
{
    // Get current user
    global $user_ID;
    get_currentuserinfo();
    // Get users
    global $wpdb;
    $users = $wpdb->get_var('SELECT COUNT(ID) FROM ' . $wpdb->users);
    // Get versions
    global $wp_version;
    if (!function_exists('get_plugins')) {
        require_once ABSPATH . 'wp-admin/includes/plugin.php';
    }
    $plugin_folder = get_plugins('/' . plugin_basename(dirname(__FILE__)));
    $plugin_version = $plugin_folder[basename($al2fb->main_file)]['Version'];
    $curl_version = 'No';
    if (function_exists('curl_init')) {
        $v = curl_version();
        $curl_version = $v['version'];
    }
    // Get charset, token
    $charset = get_bloginfo('charset');
    // Get application
    try {
        if ($al2fb->Is_authorized($user_ID)) {
            $a = WPAL2Int::Get_fb_application_cached($user_ID);
            $app = '<a href="' . $a->link . '" target="_blank">' . $a->name . '</a>';
        } else {
            $app = 'n/a';
        }
    } catch (Exception $e) {
        $app = get_user_meta($user_ID, c_al2fb_meta_client_id, true) . ': ' . $e->getMessage();
    }
    // Sharing
    if (is_multisite()) {
        $shared_user_ID = get_site_option(c_al2fb_option_app_share);
    } else {
        $shared_user_ID = get_option(c_al2fb_option_app_share);
    }
    // Get picture
    $picture = '<a href="' . get_user_meta($user_ID, c_al2fb_meta_picture, true) . '" target="_blank">' . get_user_meta($user_ID, c_al2fb_meta_picture, true) . '</a>';
    $picture_default = '<a href="' . get_user_meta($user_ID, c_al2fb_meta_picture_default, true) . '" target="_blank">' . get_user_meta($user_ID, c_al2fb_meta_picture_default, true) . '</a>';
    // Get theme data
    $theme_data = get_theme_data(STYLESHEETPATH . '/style.css');
    $info = '<div class="al2fb_debug"><table border="1">';
    $info .= '<tr><td>Time:</td><td>' . date('c') . '</td></tr>';
    $info .= '<tr><td>Server software:</td><td>' . htmlspecialchars($_SERVER['SERVER_SOFTWARE'], ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>SAPI:</td><td>' . htmlspecialchars(php_sapi_name(), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>PHP version:</td><td>' . PHP_VERSION . '</td></tr>';
    $info .= '<tr><td>spl_autoload_register:</td><td>' . (version_compare(PHP_VERSION, '5.1.2', '>=') ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>safe_mode:</td><td>' . (ini_get('safe_mode') ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>open_basedir:</td><td>' . ini_get('open_basedir') . '</td></tr>';
    $info .= '<tr><td>User agent:</td><td>' . htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>WordPress version:</td><td>' . $wp_version . '</td></tr>';
    $info .= '<tr><td>Theme name:</td><td>' . '<a href="' . $theme_data['URI'] . '" target="_blank">' . htmlspecialchars($theme_data['Name'], ENT_QUOTES, $charset) . '</a>' . '</td></tr>';
    $info .= '<tr><td>Theme version:</td><td>' . htmlspecialchars($theme_data['Version'], ENT_QUOTES, $charset) . '</td></tr>';
    $active = get_option('active_plugins', array());
    foreach (get_plugins() as $plugin_tag => $plugin_data) {
        if (in_array($plugin_tag, $active)) {
            $info .= '<tr><td>Active plugin:</td><td><a href="' . $plugin_data['PluginURI'] . '" target="_blank">' . htmlspecialchars($plugin_data['Name'], ENT_QUOTES, $charset) . ' ' . $plugin_data['Version'] . '</a></td></tr>';
        }
    }
    if (is_multisite()) {
        $current_site = get_current_site();
        $blog_details = get_blog_details($current_site->blog_id, true);
        $main_site_url = strtolower(trailingslashit($blog_details->siteurl));
        $blog_count = get_blog_count();
        if (!$blog_count || $al2fb->debug) {
            wp_update_network_counts();
            $blog_count = get_blog_count();
        }
    } else {
        $current_site = null;
        $blog_details = null;
        $main_site_url = null;
        $blog_count = -1;
    }
    $info .= '<tr><td>Plugin version:</td><td>' . $plugin_version . (WPAL2Int::Check_multiple() ? 'p' : '') . '</td></tr>';
    $info .= '<tr><td>Settings version:</td><td>' . get_option(c_al2fb_option_version) . '</td></tr>';
    $info .= '<tr><td>Multi site:</td><td>' . (is_multisite() ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Site id:</td><td>' . $al2fb->site_id . '</td></tr>';
    $info .= '<tr><td>Blog id:</td><td>' . $al2fb->blog_id . '</td></tr>';
    $info .= '<tr><td>Current site:</td><td><pre>' . print_r($current_site, true) . '</pre></td></tr>';
    $info .= '<tr><td>Blog details:</td><td><pre>' . print_r($blog_details, true) . '</pre></td></tr>';
    $info .= '<tr><td>Blog count:</td><td>' . $blog_count . '</td></tr>';
    $info .= '<tr><td>Number of users:</td><td>' . $users . '</td></tr>';
    $info .= '<tr><td>Blog address (home):</td><td><a href="' . get_home_url() . '" target="_blank">' . htmlspecialchars(get_home_url(), ENT_QUOTES, $charset) . '</a></td></tr>';
    $info .= '<tr><td>WordPress address (site):</td><td><a href="' . get_site_url() . '" target="_blank">' . htmlspecialchars(get_site_url(), ENT_QUOTES, $charset) . '</a></td></tr>';
    $info .= '<tr><td>Redirect URI:</td><td><a href="' . WPAL2Int::Redirect_uri() . '" target="_blank">' . htmlspecialchars(WPAL2Int::Redirect_uri(), ENT_QUOTES, $charset) . '</a></td></tr>';
    $info .= '<tr><td>Authorize URL:</td><td><a href="' . WPAL2Int::Authorize_url($user_ID) . '" target="_blank">' . htmlspecialchars(WPAL2Int::Authorize_url($user_ID), ENT_QUOTES, $charset) . '</a></td></tr>';
    $info .= '<tr><td>Authorization init:</td><td>' . htmlspecialchars(get_option(c_al2fb_log_redir_init), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Authorization check:</td><td>' . htmlspecialchars(get_option(c_al2fb_log_redir_check), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Redirect time:</td><td>' . htmlspecialchars(get_option(c_al2fb_log_redir_time), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Redirect referer:</td><td><a href="' . get_option(c_al2fb_log_redir_ref) . '" target="_blank">' . htmlspecialchars(get_option(c_al2fb_log_redir_ref), ENT_QUOTES, $charset) . '</a></td></tr>';
    $info .= '<tr><td>Redirect from:</td><td>' . htmlspecialchars(get_option(c_al2fb_log_redir_from), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Redirect to:</td><td><a href="' . get_option(c_al2fb_log_redir_to) . '" target="_blank">' . htmlspecialchars(get_option(c_al2fb_log_redir_to), ENT_QUOTES, $charset) . '</a></td></tr>';
    $info .= '<tr><td>Get token:</td><td><a href="' . get_option(c_al2fb_log_get_token) . '" target="_blank">' . htmlspecialchars(get_option(c_al2fb_log_get_token), ENT_QUOTES, $charset) . '</a></td></tr>';
    $info .= '<tr><td>Authorized:</td><td>' . ($al2fb->Is_authorized($user_ID) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Authorized time:</td><td>' . get_option(c_al2fb_log_auth_time) . '</td></tr>';
    $info .= '<tr><td>Token time:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_token_time, true) . '</td></tr>';
    $info .= '<tr><td>User agent:</td><td>' . get_option(c_al2fb_log_ua) . '</td></tr>';
    $info .= '<tr><td>allow_url_fopen:</td><td>' . (ini_get('allow_url_fopen') ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>cURL:</td><td>' . $curl_version . '</td></tr>';
    $info .= '<tr><td>openssl loaded:</td><td>' . (extension_loaded('openssl') ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Encoding:</td><td>' . htmlspecialchars(get_option('blog_charset'), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Facebook:</td><td>' . htmlspecialchars(get_user_meta($user_ID, c_al2fb_meta_fb_encoding, true), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Locale:</td><td>' . htmlspecialchars(WPLANG, ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Facebook:</td><td>' . htmlspecialchars(WPAL2Int::Get_locale($user_ID), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>mb_convert_encoding:</td><td>' . (function_exists('mb_convert_encoding') ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Application:</td><td>' . $app . '</td></tr>';
    $info .= '<tr><td>User:</td><td>' . $user_ID . '=' . get_the_author_meta('user_login', $user_ID) . '</td></tr>';
    $info .= '<tr><td>Shared user:</td><td>' . $shared_user_ID . '=' . get_the_author_meta('user_login', $shared_user_ID) . '</td></tr>';
    $info .= '<tr><td>Picture type:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_picture_type, true) . '</td></tr>';
    $info .= '<tr><td>Custom picture URL:</td><td>' . $picture . '</td></tr>';
    $info .= '<tr><td>Default picture URL:</td><td>' . $picture_default . '</td></tr>';
    $info .= '<tr><td>Picture size:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_picture_size, true) . '</td></tr>';
    try {
        $page_ids = WPAL2Int::Get_page_ids($user_ID);
        foreach ($page_ids as $page_id) {
            $pinfo = WPAL2Int::Get_fb_info_cached($user_ID, empty($page_id) ? 'me' : $page_id);
            $info .= '<tr><td>Wall:</td><td><a href="' . $pinfo->link . '">';
            $info .= htmlspecialchars($pinfo->name, ENT_QUOTES, $charset);
            if (!empty($pinfo->category)) {
                $info .= ' - ' . htmlspecialchars($pinfo->category, ENT_QUOTES, $charset);
            }
            $info .= '</a></td></tr>';
        }
    } catch (Exception $e) {
        $info .= '<tr><td>Page:</td><td>' . htmlspecialchars($e->getMessage(), ENT_QUOTES, $charset) . '</a></td></tr>';
    }
    $info .= '<tr><td>Use groups:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_use_groups, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Caption:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_caption, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Excerpt:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_msg, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Trailer:</td><td>' . htmlspecialchars(get_user_meta($user_ID, c_al2fb_meta_trailer, true), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Hyperlink:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_hyperlink, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Shortlink:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_shortlink, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Page link:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_add_new_page, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>FB comments:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_fb_comments, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>FB comments postback:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_fb_comments_postback, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>FB comments copy:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_fb_comments_copy, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>FB comments no link:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_fb_comments_nolink, true) . '</td></tr>';
    $info .= '<tr><td>FB likes:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_fb_likes, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Importing:</td><td>' . (get_option(c_al2fb_log_importing) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Post likers:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_post_likers, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Post like button:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_post_like_button, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Not home page:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_like_nohome, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Not posts:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_like_noposts, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Not pages:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_like_nopages, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Not archives:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_like_noarchives, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Not categories:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_like_nocategories, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Like layout:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_like_layout, true) . '</td></tr>';
    $info .= '<tr><td>Like faces:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_like_faces, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Like width:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_like_width, true) . '</td></tr>';
    $info .= '<tr><td>Like action:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_like_action, true) . '</td></tr>';
    $info .= '<tr><td>Like font:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_like_font, true) . '</td></tr>';
    $info .= '<tr><td>Like color scheme:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_like_colorscheme, true) . '</td></tr>';
    $info .= '<tr><td>Like link:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_like_link, true) . '</td></tr>';
    $info .= '<tr><td>Like top:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_like_top, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Send button:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_post_send_button, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Combine buttons:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_post_combine_buttons, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Like box width:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_like_box_width, true) . '</td></tr>';
    $info .= '<tr><td>Like box height:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_like_box_height, true) . '</td></tr>';
    $info .= '<tr><td>Like box border:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_like_box_border, true) . '</td></tr>';
    $info .= '<tr><td>Like box no header:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_like_box_noheader, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Like box no stream:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_like_box_nostream, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Comments posts:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_comments_posts, true) . '</td></tr>';
    $info .= '<tr><td>Comments width:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_comments_width, true) . '</td></tr>';
    $info .= '<tr><td>Comments auto:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_comments_auto, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Facepile size:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_pile_size, true) . '</td></tr>';
    $info .= '<tr><td>Facepile width:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_pile_width, true) . '</td></tr>';
    $info .= '<tr><td>Facepile rows:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_pile_rows, true) . '</td></tr>';
    $info .= '<tr><td>Registration width:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_reg_width, true) . '</td></tr>';
    $info .= '<tr><td>Login width:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_login_width, true) . '</td></tr>';
    $info .= '<tr><td>Registration URL:</td><td><a href="' . get_user_meta($user_ID, c_al2fb_meta_login_regurl, true) . '" target="_blank">Link</a></td></tr>';
    $info .= '<tr><td>Redir URL:</td><td><a href="' . get_user_meta($user_ID, c_al2fb_meta_login_redir, true) . '" target="_blank">Link</a></td></tr>';
    $info .= '<tr><td>Add links:</td><td>' . (get_option(c_al2fb_option_login_add_links) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Login text/HTML:</td><td><a href="' . htmlspecialchars(get_user_meta($user_ID, c_al2fb_meta_login_html, true), ENT_QUOTES, $charset) . '" target="_blank">Link</a></td></tr>';
    $info .= '<tr><td>Activity width:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_act_width, true) . '</td></tr>';
    $info .= '<tr><td>Activity height:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_act_height, true) . '</td></tr>';
    $info .= '<tr><td>Activity header:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_act_header, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Activity recommend:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_act_recommend, true) ? 'Yes' : 'No') . '</td></tr>';
    $fid = get_user_meta($user_ID, c_al2fb_meta_facebook_id, true);
    $info .= '<tr><td>Facebook ID:</td><td><a href="' . WPAL2Int::Get_fb_profilelink($fid) . '" target="_blank">' . $fid . '</a></td></tr>';
    $info .= '<tr><td>OGP:</td><td>' . (get_user_meta($user_ID, c_al2fb_meta_open_graph, true) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>OGP type:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_open_graph_type, true) . '</td></tr>';
    $info .= '<tr><td>OGP admins:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_open_graph_admins, true) . '</td></tr>';
    $info .= '<tr><td>Timeout ms:</td><td>' . get_option(c_al2fb_option_timeout) * 1000 . '</td></tr>';
    $info .= '<tr><td>No notices:</td><td>' . (get_option(c_al2fb_option_nonotice) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Min. capability:</td><td>' . htmlspecialchars(get_option(c_al2fb_option_min_cap), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Min. capability comments:</td><td>' . htmlspecialchars(get_option(c_al2fb_option_min_cap_comment), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Refresh comments:</td><td>' . htmlspecialchars(get_option(c_al2fb_option_msg_refresh), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Refresh age:</td><td>' . htmlspecialchars(get_option(c_al2fb_option_msg_maxage), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Max. length:</td><td>' . htmlspecialchars(get_option(c_al2fb_option_max_descr), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Max. text length:</td><td>' . htmlspecialchars(get_option(c_al2fb_option_max_text), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Exclude post types:</td><td>' . htmlspecialchars(get_option(c_al2fb_option_exclude_type), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Exclude categories:</td><td>' . htmlspecialchars(get_option(c_al2fb_option_exclude_cat), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Exclude tags:</td><td>' . htmlspecialchars(get_option(c_al2fb_option_exclude_tag), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Exclude authors:</td><td>' . htmlspecialchars(get_option(c_al2fb_option_exclude_author), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Meta box:</td><td>' . htmlspecialchars(get_option(c_al2fb_option_metabox_type), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>No verify peer:</td><td>' . (get_option(c_al2fb_option_noverifypeer) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Shortcode/widget:</td><td>' . (get_option(c_al2fb_option_shortcode_widget) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>No shortcode:</td><td>' . (get_option(c_al2fb_option_noshortcode) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>No filter:</td><td>' . (get_option(c_al2fb_option_nofilter) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>No filter comments:</td><td>' . (get_option(c_al2fb_option_nofilter_comments) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Site URL:</td><td>' . (get_option(c_al2fb_option_siteurl) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Do not use cURL:</td><td>' . (get_option(c_al2fb_option_nocurl) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Use publish_post:</td><td>' . (get_option(c_al2fb_option_use_pp) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Debug:</td><td>' . (get_option(c_al2fb_option_debug) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>SSP:</td><td>' . (get_option(c_al2fb_option_use_ssp) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>SSP info:</td><td><a href="' . get_option(c_al2fb_option_ssp_info) . '">link</a></td></tr>';
    $info .= '<tr><td>Filter prio:</td><td>' . intval(get_option(c_al2fb_option_filter_prio)) . '</td></tr>';
    $info .= '<tr><td>No script:</td><td>' . (get_option(c_al2fb_option_noscript) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Links API:</td><td>' . (get_option(c_al2fb_option_uselinks) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>No token refresh:</td><td>' . (get_option(c_al2fb_option_notoken_refresh) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Clean:</td><td>' . (get_option(c_al2fb_option_clean) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>CSS:</td><td>' . htmlspecialchars(get_option(c_al2fb_option_css), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>wp_get_attachment_thumb_url:</td><td>' . (function_exists('wp_get_attachment_thumb_url') ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>wp_get_attachment_image_src:</td><td>' . (function_exists('wp_get_attachment_image_src') ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>theme - post-thumbnails:</td><td>' . (current_theme_supports('post-thumbnails') ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>get_post_thumbnail_id:</td><td>' . (function_exists('get_post_thumbnail_id') ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>wp_get_attachment_image_src:</td><td>' . (function_exists('wp_get_attachment_image_src') ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Max exec time:</td><td>' . ini_get('max_execution_time') . '</td></tr>';
    $info .= '<tr><td>Memory usage:</td><td>' . memory_get_usage() . '/' . ini_get('memory_limit') . '</td></tr>';
    $info .= '<tr><td>Links added:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_stat, true) . '</td></tr>';
    $info .= '<tr><td>Current week:</td><td>' . get_user_meta($user_ID, c_al2fb_meta_week, true) . '</td></tr>';
    // Last posts
    $posts = new WP_Query(array('posts_per_page' => 10));
    while ($posts->have_posts()) {
        $posts->next_post();
        $userdata = get_userdata($posts->post->post_author);
        $link_ids = get_post_meta($posts->post->ID, c_al2fb_meta_link_id, false);
        // Selected picture
        $selected_picture = null;
        $image_id = get_post_meta($posts->post->ID, c_al2fb_meta_image_id, true);
        if (!empty($image_id) && function_exists('wp_get_attachment_thumb_url')) {
            $selected_picture = wp_get_attachment_thumb_url($image_id);
        }
        // Attached picture
        $attached_picture = null;
        $images = array_values(get_children('post_type=attachment&post_mime_type=image&order=ASC&post_parent=' . $posts->post->ID));
        if (!empty($images) && function_exists('wp_get_attachment_image_src')) {
            $picture = wp_get_attachment_image_src($images[0]->ID, 'thumbnail');
            if ($picture && $picture[0]) {
                $attached_picture = $picture[0];
            }
        }
        // Feature picture
        $featured_picture = null;
        if (current_theme_supports('post-thumbnails') && function_exists('get_post_thumbnail_id') && function_exists('wp_get_attachment_image_src')) {
            $picture_id = get_post_thumbnail_id($posts->post->ID);
            if ($picture_id) {
                $picture = wp_get_attachment_image_src($picture_id, 'thumbnail');
                if ($picture && $picture[0]) {
                    $featured_picture = $picture[0];
                }
            }
        }
        // First picture in post
        $post_picture = null;
        $content = $posts->post->post_content;
        if (!get_option(c_al2fb_option_nofilter)) {
            $content = apply_filters('the_content', $content);
        }
        if (preg_match('/< *img[^>]*src *= *["\']([^"\']*)["\']/i', $content, $matches)) {
            $post_picture = $matches[1];
        }
        // Author avatar
        $avatar_picture = null;
        $avatar = get_avatar($userdata->user_email);
        if (!empty($avatar)) {
            if (preg_match('/< *img[^>]*src *= *["\']([^"\']*)["\']/i', $avatar, $matches)) {
                $avatar_picture = $matches[1];
            }
        }
        // Actual picture
        $picture = $al2fb->Get_link_picture($posts->post, $al2fb->Get_user_ID($posts->post));
        // Imported comments
        $xuser_ID = WPAL2Facebook::Get_user_ID($posts->post);
        $excluded = WPAL2Facebook::Is_excluded($posts->post);
        $post_type = $posts->post->post_type;
        $nointegrate = get_post_meta($posts->post->ID, c_al2fb_meta_nointegrate, true);
        $comment_status = $posts->post->comment_status;
        $recent = WPAL2Facebook::Is_recent($posts->post);
        $comments_enabled = get_user_meta($xuser_ID, c_al2fb_meta_fb_comments, true);
        $fbi = array();
        $comment_count = '?';
        if ($xuser_ID && !$excluded && $post_type != 'reply' && !$nointegrate && $comment_status == 'open' && $recent && $comments_enabled) {
            $fb_comments = WPAL2Int::Get_comments_or_likes($posts->post, false);
            if ($fb_comments) {
                $comment_count = 0;
                foreach ($fb_comments->data as $fb_comment) {
                    $comment_count++;
                    $fbi[] = $fb_comment->id;
                }
            }
        }
        // Exported comments
        $fbo = array();
        $total_count = '-';
        $stored_count = '-';
        $stored_comments = get_comments('post_id=' . $posts->post->ID);
        if ($stored_comments) {
            $total_count = count($stored_comments);
            $stored_count = 0;
            foreach ($stored_comments as $comment) {
                $fbid = get_comment_meta($comment->comment_ID, c_al2fb_meta_fb_comment_id, true);
            }
            if ($fbid) {
                $stored_count++;
                $fbo[] = $fbid;
            }
        }
        $info .= '<tr><td>' . $posts->post->post_type . ' #' . $posts->post->ID . ':</td>';
        $info .= '<td><a href="' . get_permalink($posts->post->ID) . '" target="_blank">' . htmlspecialchars(get_the_title($posts->post->ID), ENT_QUOTES, $charset) . '</a>';
        $info .= ' by ' . htmlspecialchars($userdata->user_login, ENT_QUOTES, $charset) . ' (' . $posts->post->post_author . ')';
        $info .= ' @ ' . $posts->post->post_date;
        $info .= ' <a href="' . $picture['picture'] . '" target="_blank">result:' . $picture['picture_type'] . '</a>';
        if (!empty($selected_picture)) {
            $info .= ' <a href="' . $selected_picture . '" target="_blank">selected</a>';
        }
        if (!empty($attached_picture)) {
            $info .= ' <a href="' . $attached_picture . '" target="_blank">attached</a>';
        }
        if (!empty($featured_picture)) {
            $info .= ' <a href="' . $featured_picture . '" target="_blank">featured</a>';
        }
        if (!empty($post_picture)) {
            $info .= ' <a href="' . $post_picture . '" target="_blank">post</a>';
        }
        if (!empty($avatar_picture)) {
            $info .= ' <a href="' . $avatar_picture . '" target="_blank">avatar</a>';
        }
        if (!empty($link_ids)) {
            foreach ($link_ids as $link_id) {
                $info .= ' <a href="' . WPAL2Int::Get_fb_permalink($link_id) . '" target="_blank">Facebook</a>';
            }
        }
        $info .= ' user='******' exluded=' . ($excluded ? 'Y' : 'N') . ' integrate=' . (!$nointegrate ? 'Y' : 'N');
        $info .= ' status=' . $comment_status . ' recent=' . ($recent ? 'Y' : 'N') . ' enabled=' . ($comments_enabled ? 'Y' : 'N');
        $info .= ' count=' . $comment_count;
        $info .= ' export=' . $stored_count . '/' . $total_count;
        $info .= '</td></tr>';
        $info .= '<tr><td>Comments in:</td><td>' . implode(', ', $fbi) . '</td></tr>';
        $info .= '<tr><td>Comments out:</td><td>' . implode(', ', $fbo) . '</td></tr>';
    }
    // Last link pictures
    $posts = new WP_Query(array('meta_key' => c_al2fb_meta_link_picture, 'posts_per_page' => 5));
    while ($posts->have_posts()) {
        $posts->next_post();
        $link_picture = get_post_meta($posts->post->ID, c_al2fb_meta_link_picture, true);
        if (!empty($link_picture)) {
            $info .= '<tr><td>Link picture #' . $posts->post->ID . ':</td>';
            $info .= '<td><a href="' . get_permalink($posts->post->ID) . '" target="_blank">' . htmlspecialchars(get_the_title($posts->post->ID), ENT_QUOTES, $charset) . '</a>';
            $info .= ' ' . htmlspecialchars($link_picture, ENT_QUOTES, $charset);
            $info .= ' @ ' . $posts->post->post_date . '</td></tr>';
        }
    }
    // Last logs
    $posts = new WP_Query(array('meta_key' => c_al2fb_meta_log, 'posts_per_page' => 10));
    while ($posts->have_posts()) {
        $posts->next_post();
        $info .= '<tr><td>Log post:</td>';
        $info .= '<td><a href="' . get_permalink($posts->post->ID) . '" target="_blank">' . htmlspecialchars(get_the_title($posts->post->ID), ENT_QUOTES, $charset) . '</a></td></tr>';
        $logs = get_post_meta($posts->post->ID, c_al2fb_meta_log, false);
        if (!empty($logs)) {
            foreach ($logs as $log) {
                $info .= '<tr><td>Log:</td>';
                $info .= '<td>' . htmlspecialchars($log, ENT_QUOTES, $charset) . '</td></tr>';
            }
        }
    }
    // Last errors
    $posts = new WP_Query(array('meta_key' => c_al2fb_meta_error, 'posts_per_page' => 10));
    while ($posts->have_posts()) {
        $posts->next_post();
        $error = get_post_meta($posts->post->ID, c_al2fb_meta_error, true);
        if (!empty($error)) {
            $info .= '<tr><td>Error:</td>';
            $info .= '<td>' . htmlspecialchars($error, ENT_QUOTES, $charset) . '</td></tr>';
            $info .= '<tr><td>Error time:</td>';
            $info .= '<td>' . htmlspecialchars(get_post_meta($posts->post->ID, c_al2fb_meta_error_time, true), ENT_QUOTES, $charset) . '</td></tr>';
            $info .= '<tr><td>Error post:</td>';
            $info .= '<td><a href="' . get_permalink($posts->post->ID) . '" target="_blank">' . htmlspecialchars(get_the_title($posts->post->ID), ENT_QUOTES, $charset) . '</a></td></tr>';
        }
    }
    $info .= '<tr><td>Last error:</td><td>' . htmlspecialchars(get_option(c_al2fb_last_error), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Last error time:</td><td>' . htmlspecialchars(get_option(c_al2fb_last_error_time), ENT_QUOTES, $charset) . '</td></tr>';
    $info .= '<tr><td>Last request:</td><td><pre>' . htmlspecialchars(get_option(c_al2fb_last_request), ENT_QUOTES, $charset) . '</pre></td></tr>';
    $info .= '<tr><td>Last request time:</td><td>' . get_option(c_al2fb_last_request_time) . '</td></tr>';
    $info .= '<tr><td>Last response:</td><td><pre>' . htmlspecialchars(get_option(c_al2fb_last_response), ENT_QUOTES, $charset) . '</pre></td></tr>';
    $info .= '<tr><td>Last response time:</td><td>' . get_option(c_al2fb_last_response_time) . '</td></tr>';
    $info .= '<tr><td>Last texts:</td><td><pre>' . htmlspecialchars(get_option(c_al2fb_last_texts), ENT_QUOTES, $charset) . '</pre></td></tr>';
    $info .= '<tr><td>Cron enabled:</td><td>' . (get_option(c_al2fb_option_cron_enabled) ? 'Yes' : 'No') . '</td></tr>';
    $info .= '<tr><td>Cron time:</td><td>' . get_option(c_al2fb_option_cron_time) . '</td></tr>';
    $info .= '<tr><td>Cron posts:</td><td>' . get_option(c_al2fb_option_cron_posts) . '</td></tr>';
    $info .= '<tr><td>Cron comments:</td><td>' . get_option(c_al2fb_option_cron_comments) . '</td></tr>';
    $info .= '<tr><td>Cron likes:</td><td>' . get_option(c_al2fb_option_cron_likes) . '</td></tr>';
    $info .= '</table></div>';
    $info .= '<pre>$_SERVER=' . print_r($_SERVER, true) . '</pre>';
    // Comments
    $comments = get_comments('number=20');
    foreach ($comments as $comment) {
        $fb_id = get_comment_meta($comment->comment_ID, c_al2fb_meta_fb_comment_id, true);
        $comment->fb_comment_id = $fb_id;
    }
    $info .= '<pre>comments=' . print_r($comments, true) . '</pre>';
    // Info self
    $extra = $_REQUEST['debug'] == 2;
    if ($extra) {
        try {
            $me = WPAL2Int::Get_fb_me_cached($user_ID, true);
            $info .= '<pre>me=' . print_r($me, true) . '</pre>';
        } catch (Exception $e) {
            $info .= '<pre>me=' . $e->getMessage() . '</pre>';
        }
    }
    // Info App
    try {
        $info .= '<pre>app=' . print_r(WPAL2Int::Get_fb_application_cached($user_ID), true) . '</pre>';
    } catch (Exception $e) {
        $info .= '<pre>app=' . $e->getMessage() . '</pre>';
    }
    // Info pages
    try {
        $pages = WPAL2Int::Get_fb_pages_cached($user_ID);
        if ($extra) {
            foreach ($pages->data as $page) {
                try {
                    $page->info = WPAL2Int::Get_fb_info($user_ID, $page->id);
                } catch (Exception $e) {
                    $page->info = $e->getMessage();
                }
            }
        }
        $info .= '<pre>pages=' . print_r($pages, true) . '</pre>';
        $ep = get_user_meta($user_ID, c_al2fb_meta_page_extra, true);
        $info .= '<pre>extra=' . print_r($ep, true) . '</pre>';
    } catch (Exception $e) {
        $info .= '<pre>pages=' . $e->getMessage() . '</pre>';
    }
    // Info groups
    try {
        $groups = WPAL2Int::Get_fb_groups_cached($user_ID);
        if ($extra) {
            foreach ($groups->data as $group) {
                try {
                    $group->info = WPAL2Int::Get_fb_info($user_ID, $group->id);
                } catch (Exception $e) {
                    $group->info = $e->getMessage();
                }
            }
        }
        $info .= '<pre>groups=' . print_r($groups, true) . '</pre>';
    } catch (Exception $e) {
        $info .= '<pre>groups=' . $e->getMessage() . '</pre>';
    }
    return $info;
}
 function Manage_posts_custom_column($column_name, $post_ID)
 {
     if ($column_name == 'al2fb') {
         $charset = get_bloginfo('charset');
         $post = get_post($post_ID);
         $user_ID = self::Get_user_ID($post);
         $link_ids = get_post_meta($post->ID, c_al2fb_meta_link_id, false);
         if ($link_ids) {
             foreach ($link_ids as $link_id) {
                 try {
                     $page_id = WPAL2Int::Get_page_from_link_id($link_id);
                     $link = WPAL2Int::Get_fb_permalink($link_id);
                     $info = WPAL2Int::Get_fb_info_cached($user_ID, $page_id);
                     echo '<a href="' . $link . '" target="_blank">' . htmlspecialchars($info->name, ENT_QUOTES, $charset) . '</a><br />';
                 } catch (Exception $e) {
                     echo htmlspecialchars($e->getMessage(), ENT_QUOTES, $charset);
                 }
             }
         } else {
             echo '<span>' . __('No', c_al2fb_text_domain) . '</span>';
         }
         $link_id = get_post_meta($post->ID, c_al2fb_meta_link_id, true);
         if ($link_id && self::Is_recent($post)) {
             // Show number of comments
             if (get_user_meta($user_ID, c_al2fb_meta_fb_comments, true)) {
                 $count = 0;
                 $fb_comments = WPAL2Int::Get_comments_or_likes($post, false);
                 if ($fb_comments && $fb_comments->data) {
                     $count = count($fb_comments->data);
                 }
                 echo '<span>' . $count . ' ' . __('comments', c_al2fb_text_domain) . '</span><br />';
             }
             // Show number of likes
             if ($post->ping_status == 'open' && get_user_meta($user_ID, c_al2fb_meta_fb_likes, true)) {
                 $count = 0;
                 $fb_likes = WPAL2Int::Get_comments_or_likes($post, true);
                 if ($fb_likes && $fb_likes->data) {
                     $count = count($fb_likes->data);
                 }
                 echo '<span>' . $count . ' ' . __('likes', c_al2fb_text_domain) . '</span><br />';
             }
         }
     }
 }
 static function Get_subscribe_button($post)
 {
     $user_ID = WPAL2Facebook::Get_user_ID($post);
     if ($user_ID && !WPAL2Facebook::Is_excluded_post_type($post) && !WPAL2Int::social_in_excerpt($user_ID)) {
         // Get options
         $font = get_user_meta($user_ID, c_al2fb_meta_like_font, true);
         $colorscheme = get_user_meta($user_ID, c_al2fb_meta_like_colorscheme, true);
         $faces = get_user_meta($user_ID, c_al2fb_meta_like_faces, true);
         $layout = get_user_meta($user_ID, c_al2fb_meta_subscribe_layout, true);
         $width = get_user_meta($user_ID, c_al2fb_meta_subscribe_width, true);
         // Get link
         $page_id = WPAL2Int::Get_page_id($user_ID, false);
         $info = WPAL2Int::Get_fb_info_cached($user_ID, empty($page_id) ? 'me' : $page_id);
         // Send button
         $content = '<div class="al2fb_subscribe_button">';
         $content .= '<div id="fb-root"></div>';
         $content .= WPAL2Int::Get_fb_script($user_ID);
         $content .= '<fb:subscribe';
         $content .= ' font="' . (empty($font) ? 'arial' : $font) . '"';
         $content .= ' colorscheme="' . (empty($colorscheme) ? 'light' : $colorscheme) . '"';
         $content .= ' show_faces="' . ($faces ? 'true' : 'false') . '"';
         $content .= ' layout="' . (empty($layout) ? 'standard' : $layout) . '"';
         $content .= ' width="' . (empty($width) ? '450' : $width) . '"';
         $content .= ' href="' . $info->link . '"></fb:subscribe>';
         $content .= '</div>';
         return $content;
     } else {
         return '';
     }
 }