Browse files

Added version 3.1.3 from http://plugins.svn.wordpress.org/facebook-co…

  • Loading branch information...
0 parents commit 3d7982719c5fb0e68f3a7503e1a1ba370bd57303 Steven Mathias committed Feb 3, 2012
34 css/facebook-comments-custom.css
@@ -0,0 +1,34 @@
+/*****************************/
+/* Hide the Like button AND use stylesheet for a dark website
+/*****************************/
+
+/* Hide the 'Facebook social plugin' text and icon */
+a.uiLinkSubtle {
+ display: none;
+}
+a.UIImageBlock_ICON_Image {
+ display: none;
+}
+
+/* Affects the entire Facebook Comments area */
+div.wallkit_frame {
+ background: #000;
+}
+/* Affects the gray box surrounding the post box */
+div.gray_box {
+ background: #000;
+ border: none;
+}
+/* Affects the post box */
+div.wallkit_post {
+ color: #fff;
+}
+/* Affects the comments displayed */
+div.wallkit_form {
+ color: #fff;
+}
+
+/* Hide the Like button */
+div.like {
+ display: none;
+}
29 css/facebook-comments-darksite.css
@@ -0,0 +1,29 @@
+/*****************************/
+/* Styles for a site with a dark background
+/*****************************/
+
+/* Hide the 'Facebook social plugin' text and icon */
+a.uiLinkSubtle {
+ display: none;
+}
+a.UIImageBlock_ICON_Image {
+ display: none;
+}
+
+/* Affects the entire Facebook Comments area */
+div.wallkit_frame {
+ background: #000;
+}
+/* Affects the gray box surrounding the post box */
+div.gray_box {
+ background: #000;
+ border: none;
+}
+/* Affects the post box */
+div.wallkit_post {
+ color: #fff;
+}
+/* Affects the comments displayed */
+div.wallkit_form {
+ color: #fff;
+}
10 css/facebook-comments-hidefblink.css
@@ -0,0 +1,10 @@
+/*****************************/
+/* Hide the 'Facebook social plugin' text and icon
+/*****************************/
+
+a.uiLinkSubtle {
+ display: none;
+}
+a.UIImageBlock_ICON_Image {
+ display: none;
+}
16 css/facebook-comments-hidelike.css
@@ -0,0 +1,16 @@
+/*****************************/
+/* Hide the Like button and text
+/*****************************/
+
+/* Hide the 'Facebook social plugin' text and icon */
+a.uiLinkSubtle {
+ display: none;
+}
+a.UIImageBlock_ICON_Image {
+ display: none;
+}
+
+/* Hide the Like button */
+div.like {
+ display: none;
+}
7 css/facebook-comments-hidelikefaces.css
@@ -0,0 +1,7 @@
+/*****************************/
+/* Hide the faces associated with the Like button
+/*****************************/
+
+div.connect_widget_sample_connections {
+ display: none;
+}
7 css/facebook-comments-hideprofilepics.css
@@ -0,0 +1,7 @@
+/*****************************/
+/* Hide the profile picture beside each comment
+/*****************************/
+
+div.wallkit_profilepic {
+ display: none;
+}
9 css/facebook-comments-hidewpcomments.css
@@ -0,0 +1,9 @@
+@charset "UTF-8";
+
+/*****************************/
+/* Hide the WordPress commenting form
+/*****************************/
+
+#respond, #commentform, #addcomment, .entry-comments {
+ display: none;
+}
77 css/facebook-comments-widgets.css
@@ -0,0 +1,77 @@
+@charset "UTF-8";
+
+/*****************************/
+/* Dashboard widget styles
+/*****************************/
+
+
+/*****************************/
+/* Normal, page widget styles
+
+ displayed here in order rendered
+/*****************************/
+/* Each post is styled as follows:
+<li class="fbc_rc_comment old/even">
+ <div class="fbc_rc_comment-meta">
+ <cite class="fbc_rc_comment-author">
+ <a href="https://www.facebook.com/profile.php?id=FACEBOOKID">
+ USERNAME
+ </a>
+ </cite>
+ <abbr class="fbc_rc_date">
+ Date/Time
+ </abbr>
+ </div>
+ <img class="avatar" height="50" width="50" />
+ <div class="fbc_rc_text">
+ COMMENT CONTENT
+ </div>
+ <div class="fbc_rc_permalink">
+ <a href=permalink>
+ Post or Page Title
+ </a>
+ </div>
+</li>
+*/
+
+/* Main widget, which is enclosed in a ul */
+#fbc_rc_widget {
+ width: auto;
+ margin-left:0 !important; /* override WP default */
+}
+li.fbc_rc_comment {
+ min-height: 80px; /* to prevent overlap */
+ height:100%;
+ position:relative;
+ margin:2px;
+ border-bottom: 1px dotted rgba(88,88,88,1);
+}
+/* odd and even are so you can style alternating posts differently, if you'd like to */
+ul#fbc_rc_widget li.odd { }
+ul#fbc_rc_widget li.even {
+ background-color:rgba(222,222,251,1);
+}/* change to float:left to display avatars on the left of comments */
+
+/* encloses both author and date */
+.fbc_rc_comment-meta { }
+.fbc_rc_comment-author { }
+.fbc_rc_date {
+ font-size:.8em;
+}
+
+ul#fbc_rc_widget .avatar {
+ float: right; /* change to float:left to display avatars on the left of comments */
+ padding-bottom: 2px;
+}
+
+/* main comment text */
+.fbc_rc_text {
+ margin: 5px;
+ padding-bottom:25px; /* to prevent post titles from overlapping with comment text */
+}
+
+.fbc_rc_permalink {
+ position: absolute;
+ bottom: 2px;
+}
+
38 css/facebook-comments.css
@@ -0,0 +1,38 @@
+@charset "UTF-8";
+
+/*****************************/
+/* Main Styles
+/*****************************/
+
+br.gutter {
+ height: 10px;
+}
+p.indent {
+ padding-left: 15px;
+}
+input.donateButton {
+ float: left;
+ padding: 7px 10px 10px 0;
+}
+span.donateText {
+ float: left;
+ padding-top: 13px;
+ font-weight: bold;
+}
+div#poststuff h3 {
+ cursor: default;
+}
+div.gutter {
+ margin-top: 20px;
+}
+div.contain-floats {
+ overflow: auto;
+}
+div#icon-help {
+ display: block;
+ float: left;
+ background: url(../images/help_icon.png) no-repeat;
+ height: 36px;
+ width: 36px;
+ margin: 14px 6px 0 0;
+}
611 facebook-comments-admin.php
@@ -0,0 +1,611 @@
+<?php
+
+if (FBCOMMENTS_ERRORS) {
+ error_reporting(E_ALL); # Ensure all errors and warnings are verbose
+}
+
+try {
+ $homeurl = home_url('/');
+} catch (Exception $e) {
+ $homeurl = get_bloginfo( 'home' );
+ echo '<div class="error"><p><strong>' . __('This plugin requires WordPress 3.0.4 or above. You are using ') . get_bloginfo( 'version' ) . __('. This plugin may still work, however it is not supported. Please update to the latest version of WordPress for the best experience.') . '</strong></p></div>';
+}
+$id_help = <<< END
+<p>Need help? Okay, do you have a facebook app?</p>
+<p><strong>Yes, I do</strong></p>
+<ol>
+<li>Get a list of your applications from here: <a target="_blank" href="http://www.facebook.com/developers/apps.php">Facebook Application List</a></li>
+<li>Select the application you want, then copy and paste the Application ID and Application Secret from there to the boxes below.</li>
+</ol>
+
+<p><strong>No, I haven't created an application yet</strong></p>
+<ol>
+<li>Go here to create it: <a target="_blank" href="//www.facebook.com/developers/createapp.php">Create a facebook app</a></li>
+<li>Good, your app is created. Now, make sure it knows where it's used: On the app's page, click "Edit Settings", then from the left navigation, click "Web Site".
+ You should now see "Core Settings". Copy <strong>{$homeurl}</strong> and paste it in the "Site URL" box. Now click "Save Changes". Done!</li>
+<li>Get your app id and app secret from here:
+<a target="_blank" href="http://www.facebook.com/developers/apps.php">Facebook Application List</a></li>
+<li>Select the application you created, then copy and paste the Application ID and Application Secret from there to the boxes below.</li>
+</ol>
+END;
+
+
+if (version_compare(phpversion(), FBCOMMENTS_REQUIRED_PHP_VER) == -1) {
+ echo '<div class="error"><p><strong>' . __('This plugin requires PHP v') . FBCOMMENTS_REQUIRED_PHP_VER . __(' or higher to run (you have PHP v')
+ . phpversion() . __('). Please ask your webhost to install the latest version of PHP on your server.') . '</strong></p></div>';
+}
+?>
+
+<link rel="stylesheet" type="text/css" href="<?php echo FBCOMMENTS_CSS_ADMIN; ?>" />
+
+<div class="wrap">
+ <?php screen_icon(); ?>
+ <h2><?php _e('Facebook Comments for WordPress Options'); ?></h2>
+
+ <form method="post" action="options.php">
+ <table border="1" style="width:100%">
+ <tbody><tr>
+ <td style="width:33%"> <input type="submit" class="button-primary" value="<?php _e('Update Options'); ?>" /></div> </td>
+ <td style="width:33%"> <div id="icon-help"></div>
+ <h6><?php _e('If you need help, please refer to the <a href="http://bit.ly/i3lThG">official FAQ</a>'); ?>
+ </h6>
+
+ </td>
+ <td style="width:auto">
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=fbc%40we8u%2ecom&lc=US&item_name=Facebook%20Comments%20for%20WordPress&item_number=shaunds&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted">
+ <img class="ppimg donateButton" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" style="float:right" /></a>
+ </td>
+ </tr></tbody>
+ </table>
+
+<?php
+ settings_fields('fbComments_options');
+ $fbc_options = get_option('fbComments');
+
+ $errors = false;
+ $response = wp_remote_get("https://www.facebook.com/apps/application.php?".http_build_query(array('id'=>$fbc_options['appId'])),
+ $args = array('method' => 'GET',
+ 'timeout' => '5',
+ 'redirection' => '5',
+ 'user-agent' => 'WordPress facebook comments plugin',
+ 'blocking' => true,
+ 'compress' => false,
+ 'decompress' => true,
+ 'sslverify' => false
+ ));
+
+ if (is_array($response)) {
+ $response = $response['body'];
+ $needle = 'wall';
+ if ( strpos($response, $needle) == false ) {
+ // $fbc_options['appId'] = 'INVALID APP ID';
+ $errors = 'ERROR! Invalid application ID. Please double check to make sure it is correct. Note that this is not the same thing as your Facebook user ID';
+ }
+ } else echo '<div class="error fade"><p><strong>' . __("Unable to verify application ID. This may be due to a network error. Ignore this warning if you know you have input the correct ID.") . '</strong></p></div>';
+
+ if (empty($fbc_options['appId']) || empty($fbc_options['appSecret']))
+ echo '<div class="error"><p><strong>' . __('The Facebook comments box will not be included in your posts until you set a valid application ID and application secret.').'</strong></p>'.$id_help.'</div>';
+ elseif ($errors != false)
+ echo '<div class="error"><p><strong>' . __($errors) . '</strong></p>'.$id_help.'</div>';
+
+ $_loadversion = get_option('fbComments_xid');
+ # 2.1.2 loaded?
+ $_loadversion = (strlen($_loadversion) < 1) ? 'loaded' : $_loadversion;
+?>
+
+ <div class="updated">XID from version 2.1.2: <?php if($_loadversion) echo $_loadversion; ?></div>
+ <div id="poststuff" class="postbox">
+ <h3><?php _e('Enable/Disable Facebook\'s New Comment System'); ?></h3>
+
+ <div class="inside">
+ <p><?php _e('Enable the just-released version of facebook\'s '.
+ 'comment plugin. This is quite new, and some people are having problems. '.
+ 'See discussion <a href="http://bit.ly/fuoDaM">here</a><br />
+ * Selecting "new" will show comments from both the old system and the new one in the same comment box (migrated="1", as described in the above link).<br />
+ * "v1 only" will use only the old system <em>(only way to have custom css, like button, etc.)</em>.<br />
+ * "v2 only" will use only the new system. This is the only way to get all the features of the new system (unless you select the option below).<br />'); ?>
+ <select name="fbComments[commentVersion]">
+ <option value="v2migrated"<?php if ($fbc_options['commentVersion'] == 'v2migrated') echo ' selected="selected"'; ?>>new</option>
+ <option value="v1"<?php if ($fbc_options['commentVersion'] == 'v1') echo ' selected="selected"'; ?>>v1 only</option>
+ <option value="v2"<?php if ($fbc_options['commentVersion'] == 'v2') echo ' selected="selected"'; ?>>v2 only</option>
+ </select>
+ </p>
+ <p><input type="checkbox" id="fbComments_v1plusv2" name="fbComments[v1plusv2]" value="1" <?php checked($fbc_options['v1plusv2'], 1 ); ?>>
+ <label for="fbComments_v1plusv2"> <?php _e('Display both v1 and v2 comments; ignores above setting (<b>only way to have both new and old comments show up</b>)'); ?>
+ </label>
+ </p>
+ <?php /*
+ <p><input type="checkbox" id="fbComments_newUser" name="fbComments[newUser]" value="1" <?php checked($fbc_options['newUser'], 1 ); ?> size="20">
+ <label for="fbComments_newUser"> <?php _e('If you are a <b>new user</b> of this plugin or currently <b>have no comments</b> on your site, '.
+ 'then check this box (you can ignore the above setting if you check this) <b>DON\'T CHECK IF YOUR SITE HAS COMMENTS</b>'); ?>
+ </label>
+ </p> */ ?>
+ </div>
+ </div>
+
+ <div id="poststuff" class="postbox">
+ <h3><?php _e('Basic Settings'); ?></h3>
+
+ <div class="inside">
+ <p><?php _e('Application ID (<a target="_blank" href="//we8u.com/facebook-comments/#install">Help</a>): '); ?>
+ <input type="text" name="fbComments[appId]" value="<?php echo $fbc_options['appId']; ?>" size="20">
+ <em><?php _e(' (This can be retrieved from your <a target="_blank" href="//www.facebook.com/developers/apps.php">Facebook application page</a>)'); ?></em></p>
+
+ <p><?php _e('Application Secret (<a target="_blank" href="//we8u.com/facebook-comments/#install">Help</a>): '); ?>
+ <input type="text" name="fbComments[appSecret]" value="<?php echo $fbc_options['appSecret']; ?>" size="20">
+ <em><?php _e(' (This can be retrieved from your <a target="_blank" href="//www.facebook.com/developers/apps.php">Facebook application page</a>)'); ?></em></p>
+
+ <p><input type="checkbox" id="fbComments_includeFbComments" name="fbComments[includeFbComments]" value="1" <?php checked($fbc_options['includeFbComments'], 1 ); ?> size="20">
+ <label for="fbComments_includeFbComments"><?php _e(' Include Facebook comments on blog'); ?></label>
+ <em><?php _e(" (Uncheck this if you want to hide the Facebook comments without having to deactivate the plugin)"); ?></em></p>
+
+ <p><input type="checkbox" id="fbComments_hideWpComments" name="fbComments[hideWpComments]" value="1" <?php checked($fbc_options['hideWpComments'], 1 ); ?> size="20">
+ <label for="fbComments_hideWpComments"> <?php _e('Hide WordPress comments on posts/pages where Facebook commenting is enabled'); ?></label></p>
+
+ <p><input type="checkbox" id="fbComments_combineCommentCounts" name="fbComments[combineCommentCounts]" value="1" <?php checked($fbc_options['combineCommentCounts'], 1 ); ?> size="20">
+ <label for="fbComments_combineCommentCounts"> <?php _e('Combine WordPress and Facebook comment counts (<em>only counts "v1 only" and "new", use below option if using "v2 only"</em>)'); ?></label></p>
+
+ <p><input type="checkbox" id="fbComments_fbCommentCount" name="fbComments[fbCommentCount]" value="1" <?php checked($fbc_options['fbCommentCount'], 1 ); ?>>
+ <label for="fbComments_fbCommentCount"> <?php _e('Enable native facebook comment count (<em>does nothing unless "v2 only" is selected</em>).'); ?>
+ </label>
+ </p>
+
+ <p><input type="checkbox" id="fbComments_showDBWidget" name="fbComments[showDBWidget]" value="1" <?php checked($fbc_options['showDBWidget'], 1 ); ?>>
+ <label for="fbComments_newUser"> <?php _e('Show the Dashboard Recent Comments admin widget'); ?>
+ </label>
+ </p>
+
+ <p><input type="checkbox" id="fbComments_enableCache" name="fbComments[enableCache]" value="1" <?php checked($fbc_options['enableCache'], 1 ); ?>>
+ <label for="fbComments_enableCache"> <?php _e('Enable comment caching (<em>enable if site is loading slowly</em>).'); ?>
+ </label>
+ </p>
+
+ <p><input type="checkbox" id="fbComments_darkSite" name="fbComments[darkSite]" value="1" <?php checked($fbc_options['darkSite'], 1 ); ?> size="20">
+ <label for="fbComments_darkSite"><?php _e('<em>*just added*</em> Use colors more easily visible on a <strong>dark</strong> website'); ?>
+ </label>
+ </p>
+
+
+
+ <p><a href="https://developers.facebook.com/tools/comments/?id=<?php echo $fbc_options['appId']; ?>">
+ <img class="img" src="https://s-static.ak.facebook.com/rsrc.php/v1/yh/r/sFEt4HFKXwP.gif" style="top: -1px;" width="15" height="16" />
+ Moderation Settings</a> <!--<em><strong>(inline editing of these settings is in development)</strong></em> --></p>
+ </div>
+ </div>
+
+ <div id="poststuff" class="postbox">
+ <h3><?php _e('v2 Comment Count Style'); ?></h3>
+ <div class="inside">
+ <p><?php _e("Anything you type here will be passed as is (so make sure it's correct) to the 'style=' of the comment count container "); ?>
+ <input type="text" name="fbComments[v2ccstyle]" value="<?php echo $fbc_options['v2ccstyle']; ?>" size="90" /></p>
+ </div>
+ </div>
+
+ <div id="poststuff" class="postbox">
+ <h3><?php _e('Like Button Settings'); ?></h3>
+
+ <?php
+ $likebtn = "<iframe src='http://www.facebook.com/plugins/like.php?"
+ .'href=we8u.com/facebook-comments&amp;'
+ ."layout={$fbc_options['like']['layout']}".'&amp;';
+ $likebtn .= ($fbc_options['like']['faces']) ? "show_faces=true" : "show_faces=false";
+ $likebtn .= '&amp;'
+ ."width={$fbc_options['like']['width']}".'&amp;'
+ ."action={$fbc_options['like']['verb']}".'&amp;'
+ ."font={$fbc_options['like']['font']}".'&amp;'
+ ."colorscheme={$fbc_options['like']['color']}"
+ ."' scrolling='no' frameborder='0' style='{$fbc_options['like']['style']}' allowTransparency='true'></iframe>";
+
+ $indexlikebtn = "<iframe src='http://www.facebook.com/plugins/like.php?"
+ .'href=we8u.com/&amp;'
+ ."layout={$fbc_options['indexLikebtn']['layout']}".'&amp;';
+ $indexlikebtn .= ($fbc_options['indexLikebtn']['faces']) ? "show_faces=true" : "show_faces=false";
+ $indexlikebtn .= '&amp;'
+ ."width={$fbc_options['indexLikebtn']['width']}".'&amp;'
+ ."action={$fbc_options['indexLikebtn']['verb']}".'&amp;'
+ ."font={$fbc_options['indexLikebtn']['font']}".'&amp;'
+ ."colorscheme={$fbc_options['indexLikebtn']['color']}"
+ ."' scrolling='no' frameborder='0' style='{$fbc_options['indexLikebtn']['style']}' allowTransparency='true'></iframe>";
+ ?>
+
+ <div class="inside">
+ <p><?php _e("Note, the style of the like button depends on the tag <code>&lt;meta property='og:type' content='article' /&gt;</code><br />
+ Here, the left button has <code>content='product'</code>, while the right has <code>content='article'</code><br />
+ <strong>click 'Update Options' to see the effect of changeing each's settings</strong>") ?>
+ </p>
+ <hr style="width:auto" />
+ <table><tr>
+ <td style="border-right: 1px dotted" VALIGN="top">
+ <div><p><?php
+ if (!$fbc_options['hideFbLikeButton']) echo $likebtn;
+ else echo '<span style="font-size:1.2em; font-weight:bold">Hiding like button</span>';
+ ?>
+ </p></div>
+
+ <p><input type="checkbox" id="fbComments_hideFbLikeButton" name="fbComments[hideFbLikeButton]" value="1" <?php checked($fbc_options['hideFbLikeButton'], 1 ); ?> size="20">
+ <label for="fbComments_hideFbLikeButton"><?php _e(' Hide the Like button and text '); ?></label></p>
+
+ <p><?php _e('Layout Sytle '); ?>
+ <select name="fbComments[like][layout]">
+ <option value="standard"<?php if ($fbc_options['like']['layout'] == 'standard') echo ' selected="selected"'; ?>>standard</option>
+ <option value="button_count"<?php if ($fbc_options['like']['layout'] == 'button_count') echo ' selected="selected"'; ?>>button_count</option>
+ <option value="box_count"<?php if ($fbc_options['like']['layout'] == 'box_count') echo ' selected="selected"'; ?>>box_count</option>
+ </select>
+ </p>
+ <p><input type="checkbox" id="fbComments_like_faces" name="fbComments[like][faces]" value="1" <?php checked($fbc_options['like']['faces'], 1 ); ?> size="20">
+ <label for="fbComments_like_faces"> <?php _e('Show profile pictures below like button for friends who "like"'); ?></label></p>
+
+ <p><?php _e('Width '); ?>
+ <input type="text" name="fbComments[like][width]" value="<?php echo $fbc_options['like']['width']; ?>" size="10" /></p>
+
+ <p><?php _e('Verb '); ?>
+ <select name="fbComments[like][verb]">
+ <option value="like"<?php if ($fbc_options['like']['verb'] == 'like') echo ' selected="selected"'; ?>>like</option>
+ <option value="recommend"<?php if ($fbc_options['like']['verb'] == 'recommend') echo ' selected="selected"'; ?>>recommend</option>
+ </select>
+ </p>
+ <p><?php _e('Font '); ?>
+ <select name="fbComments[like][font]">
+ <option <?php if ($fbc_options['like']['font'] == '') echo ' selected="selected"'; ?>></option>
+ <option value="arial"<?php if ($fbc_options['like']['font'] == 'arial') echo ' selected="selected"'; ?>>arial</option>
+ <option value="lucida+grande"<?php if ($fbc_options['like']['font'] == 'lucida+grande') echo ' selected="selected"'; ?>>lucida grande</option>
+ <option value="segoe+ui"<?php if ($fbc_options['like']['font'] == 'segoe+ui') echo ' selected="selected"'; ?>>segoe ui</option>
+ <option value="tahoma"<?php if ($fbc_options['like']['font'] == 'tahoma') echo ' selected="selected"'; ?>>tahoma</option>
+ <option value="trebuchet+ms"<?php if ($fbc_options['like']['font'] == 'trebuchet+ms') echo ' selected="selected"'; ?>>trebuchet ms</option>
+ <option value="verdana"<?php if ($fbc_options['like']['font'] == 'verdana') echo ' selected="selected"'; ?>>verdana</option>
+ </select>
+ </p>
+ <p><?php _e('Color Scheme '); ?>
+ <select name="fbComments[like][color]">
+ <option value="light"<?php if ($fbc_options['like']['color'] == 'light') echo ' selected="selected"'; ?>>light</option>
+ <option value="dark"<?php if ($fbc_options['like']['color'] == 'dark') echo ' selected="selected"'; ?>>dark</option>
+ </select>
+ <?php _e('<em>light for light backgrounds, dark for dark</em>'); ?>
+ </p>
+
+ <p><?php _e('CSS Style <br />'); ?>
+ <input type="text" name="fbComments[like][style]" value="<?php echo $fbc_options['like']['style']; ?>" size="60" /></p>
+ </td>
+
+ <td VALIGN="top">
+
+ <div><p><?php
+ if ($fbc_options['indexLikebtn']['display'] != 'none') echo $indexlikebtn;
+ else echo '<span style="font-size:1.2em; font-weight:bold">Hiding like button</span>';
+ ?>
+ </p></div>
+
+ <p><?php _e('Where to display a like button on each post on front page of site (index.php for most people) <br />'); ?>
+ <select name="fbComments[indexLikebtn][display]">
+ <option value="none"<?php if ($fbc_options['indexLikebtn']['display'] == 'none') echo ' selected="selected"'; ?>>don't</option>
+ <option value="top"<?php if ($fbc_options['indexLikebtn']['display'] == 'top') echo ' selected="selected"'; ?>>at the top of each post</option>
+ <option value="bottom"<?php if ($fbc_options['indexLikebtn']['display'] == 'bottom') echo ' selected="selected"'; ?>>at the bottom of each post</option>
+ </select>
+ </p>
+
+ <p><select name="fbComments[indexLikebtn][layout]">
+ <option value="standard"<?php if ($fbc_options['indexLikebtn']['layout'] == 'standard') echo ' selected="selected"'; ?>>standard</option>
+ <option value="button_count"<?php if ($fbc_options['indexLikebtn']['layout'] == 'button_count') echo ' selected="selected"'; ?>>button_count</option>
+ <option value="box_count"<?php if ($fbc_options['indexLikebtn']['layout'] == 'box_count') echo ' selected="selected"'; ?>>box_count</option>
+ </select></p>
+
+ <p><input type="checkbox" id="fbComments_indexLikebtn_faces" name="fbComments[indexLikebtn][faces]" value="1" <?php checked($fbc_options['indexLikebtn']['faces'], 1 ); ?> size="20">
+ <label for="fbComments_indexLikebtn_faces"> <?php _e('Show profile pictures'); ?></label></p>
+
+ <p><?php _e('Width '); ?>
+ <input type="text" name="fbComments[indexLikebtn][width]" value="<?php echo $fbc_options['indexLikebtn']['width']; ?>" size="10" /></p>
+
+ <p><?php _e('Verb '); ?>
+ <select name="fbComments[indexLikebtn][verb]">
+ <option value="like"<?php if ($fbc_options['indexLikebtn']['verb'] == 'like') echo ' selected="selected"'; ?>>like</option>
+ <option value="recommend"<?php if ($fbc_options['indexLikebtn']['verb'] == 'recommend') echo ' selected="selected"'; ?>>recommend</option>
+ </select>
+ </p>
+ <p><?php _e('Font '); ?>
+ <select name="fbComments[indexLikebtn][font]">
+ <option <?php if ($fbc_options['indexLikebtn']['font'] == '') echo ' selected="selected"'; ?>></option>
+ <option value="arial"<?php if ($fbc_options['indexLikebtn']['font'] == 'arial') echo ' selected="selected"'; ?>>arial</option>
+ <option value="lucida+grande"<?php if ($fbc_options['indexLikebtn']['font'] == 'lucida+grande') echo ' selected="selected"'; ?>>lucida grande</option>
+ <option value="segoe+ui"<?php if ($fbc_options['indexLikebtn']['font'] == 'segoe+ui') echo ' selected="selected"'; ?>>segoe ui</option>
+ <option value="tahoma"<?php if ($fbc_options['indexLikebtn']['font'] == 'tahoma') echo ' selected="selected"'; ?>>tahoma</option>
+ <option value="trebuchet+ms"<?php if ($fbc_options['indexLikebtn']['font'] == 'trebuchet+ms') echo ' selected="selected"'; ?>>trebuchet ms</option>
+ <option value="verdana"<?php if ($fbc_options['indexLikebtn']['font'] == 'verdana') echo ' selected="selected"'; ?>>verdana</option>
+ </select>
+ </p>
+ <p><?php _e('Color Scheme '); ?>
+ <select name="fbComments[indexLikebtn][color]">
+ <option value="light"<?php if ($fbc_options['indexLikebtn']['color'] == 'light') echo ' selected="selected"'; ?>>light</option>
+ <option value="dark"<?php if ($fbc_options['indexLikebtn']['color'] == 'dark') echo ' selected="selected"'; ?>>dark</option>
+ </select>
+ </p>
+
+ <p><?php _e('CSS Style <span style="font-size:.8em"><em>(min height is 62px if displaying profile pics or using "box_count", 25px otherwise)</em></span><br />'); ?>
+ <input type="text" name="fbComments[indexLikebtn][style]" value="<?php echo $fbc_options['indexLikebtn']['style']; ?>" size="60" /></p>
+
+ </td>
+ </tr></table>
+ </div>
+ </div>
+
+ <div id="poststuff" class="postbox">
+ <h3><?php _e('"v1 only" Settings'); ?></h3>
+
+ <div class="inside">
+ <h3><?php _e('Comments Box Settings'); ?></h3>
+ <p><input type="checkbox" id="fbComments_reverseOrder" name="fbComments[reverseOrder]" value="1" <?php checked($fbc_options['reverseOrder'], 1 ); ?> size="20">
+ <label for="fbComments_reverseOrder"><?php _e(' Reverse the order of the Facebook comments section'); ?></label>
+ <em><?php _e(' (Comments will appear in chronological order and the composer will be at the bottom)'); ?></em></p>
+
+ <br />
+ <h3><?php _e('Style Settings'); ?></h3>
+ <p><?php _e('Container Styles: '); ?><input type="text" name="fbComments[containerCss]" value="<?php echo $fbc_options['containerCss']; ?>" size="70">
+ <em><?php _e(' (These styles will be applied to a &lt;div&gt; element wrapping the comments box)'); ?></em></p>
+
+ <p><input type="checkbox" id="fbComments_noBox" name="fbComments[noBox]" value="1" <?php checked($fbc_options['noBox'], 1 ); ?> size="20">
+ <label for="fbComments_noBox"><?php _e(' Remove grey box surrounding Facebook comments'); ?></label></p>
+
+ </div>
+ </div>
+
+ <div id="poststuff" class="postbox">
+ <h3><?php _e('Notification Settings'); ?></h3>
+
+ <div class="inside">
+ <p><input type="checkbox" id="fbComments_notify" name="fbComments[notify]" value="1" <?php checked($fbc_options['notify'], 1 ); ?> size="20">
+ <label for="fbComments_notify"><?php _e(' Email me whenever a comment is posted'); ?></label>
+ <em><?php _e(" (Email notifications will be sent to the following address: " . get_bloginfo('admin_email') . ". You can change this on the <a href='" . admin_url('options-general.php') . "'>General Settings</a> page)"); ?></em></p>
+
+ <p><?php _e('Notify these facebook users of new comments (user ID, see <a href="//www.facebook.com/note.php?note_id=91532827198">here</a>): '); ?>
+ <input type="text" name="fbComments[notifyUserList]" value="<?php echo $fbc_options['notifyUserList']; ?>" size="60">
+ <em><?php _e(' <br />for multiple users, seperate with commas and no spaces (e.g., ID1,ID2,ID3)'); ?></em></p>
+ </div>
+ </div>
+
+
+ <div id="poststuff" class="postbox">
+ <h3><?php _e('Comments Box Settings'); ?></h3>
+
+ <div class="inside">
+ <p><?php _e('Facebook Comments Section Title: '); ?><input type="text" name="fbComments[title]" value="<?php echo $fbc_options['title']; ?>" size="30">
+ <em><?php _e(' (This is the title text displayed above the Facebook commenting section)'); ?></em></p>
+
+ <p><input type="checkbox" id="fbComments_displayTitle" name="fbComments[displayTitle]" value="1" <?php checked($fbc_options['displayTitle'], 1 ); ?> size="20">
+ <label for="fbComments_displayTitle"><?php _e(' Display the Facebook comments title (set above)'); ?></label></p>
+
+ <p><?php _e('Number of Posts to Display: '); ?><input type="text" name="fbComments[numPosts]" value="<?php echo $fbc_options['numPosts']; ?>" size="5" maxlength="3"></p>
+
+ <p><?php _e('Width of Comments Box (px): '); ?><input type="text" name="fbComments[width]" value="<?php echo $fbc_options['width']; ?>" size="5" maxlength="4"></p>
+
+ <p><?php _e('Display Facebook comments before or after WordPress comments? '); ?>
+ <select name="fbComments[displayLocation" disabled="disabled">
+ <option value="before"<?php if ($fbc_options['displayLocation'] == 'before') echo ' selected="selected"'; ?>>Before</option>
+ <option value="after"<?php if ($fbc_options['displayLocation'] == 'after') echo ' selected="selected"'; ?>>After</option>
+ </select>
+ <em><?php _e(" (<strong>In development; <a target='_blank' href='" . FBCOMMENTS_WEBPAGE . "#comment_placement'>see here</a> for manual instructions</strong>)"); ?></em>
+ </p>
+ <p><?php _e('Display Facebook comments on pages only, posts only or both? '); ?>
+ <select name="fbComments[displayPagesOrPosts]">
+ <option value="both"<?php if ($fbc_options['displayPagesOrPosts'] == 'both') echo ' selected="selected"'; ?>>Both</option>
+ <option value="pages"<?php if ($fbc_options['displayPagesOrPosts'] == 'pages') echo ' selected="selected"'; ?>>Pages only</option>
+ <option value="posts"<?php if ($fbc_options['displayPagesOrPosts'] == 'posts') echo ' selected="selected"'; ?>>Posts only</option>
+ </select>
+ </p>
+ <p><input type="checkbox" id="fbComments_publishToWall" name="fbComments[publishToWall]" value="1" <?php checked($fbc_options['publishToWall'], 1 ); ?> size="20">
+ <label for="fbComments_publishToWall"><?php _e(' Check the <strong>Post comment to my Facebook profile</strong> box by default'); ?></label></p>
+
+
+
+ </div>
+ </div>
+
+ <div id="poststuff" class="postbox">
+ <h3><?php _e('Style Settings'); ?></h3>
+
+ <div class="inside">
+ <p><?php _e('Title Styles: '); ?><input type="text" name="fbComments[titleCss]" value="<?php echo $fbc_options['titleCss']; ?>" size="70">
+ <em><?php _e(' (These styles will be applied to the title text above the comments box)'); ?></em></p>
+ </div>
+ </div>
+
+ <div id="poststuff" class="postbox">
+ <h3><?php _e('Dashboard Widget Settings'); ?></h3>
+
+ <div class="inside">
+ <p><?php _e('Number of Comments to Display: '); ?>
+ <input type="text" name="fbComments[dashNumComments]" value="<?php echo $fbc_options['dashNumComments']; ?>" size="5" maxlength="3"></p>
+ </div>
+ </div>
+
+ <div id="poststuff" class="postbox">
+ <h3><?php _e('Language Settings'); ?></h3>
+
+ <div class="inside">
+ <p><?php _e('Language for comments: '); ?>
+ <select name="fbComments[language]">
+ <option value="af_ZA"<?php if ($fbc_options['language'] == 'af_ZA') echo ' selected="selected"'; ?>>Afrikaans</option>
+ <option value="sq_AL"<?php if ($fbc_options['language'] == 'sq_AL') echo ' selected="selected"'; ?>>Albanian</option>
+ <option value="ar_AR"<?php if ($fbc_options['language'] == 'ar_AR') echo ' selected="selected"'; ?>>Arabic</option>
+ <option value="hy_AM"<?php if ($fbc_options['language'] == 'hy_AM') echo ' selected="selected"'; ?>>Armenian</option>
+ <option value="ay_BO"<?php if ($fbc_options['language'] == 'ay_BO') echo ' selected="selected"'; ?>>Aymara</option>
+ <option value="az_AZ"<?php if ($fbc_options['language'] == 'az_AZ') echo ' selected="selected"'; ?>>Azeri</option>
+ <option value="eu_ES"<?php if ($fbc_options['language'] == 'eu_ES') echo ' selected="selected"'; ?>>Basque</option>
+ <option value="be_BY"<?php if ($fbc_options['language'] == 'be_BY') echo ' selected="selected"'; ?>>Belarusian</option>
+ <option value="bn_IN"<?php if ($fbc_options['language'] == 'bn_IN') echo ' selected="selected"'; ?>>Bengali</option>
+ <option value="bs_BA"<?php if ($fbc_options['language'] == 'bs_BA') echo ' selected="selected"'; ?>>Bosnian</option>
+ <option value="bg_BG"<?php if ($fbc_options['language'] == 'bg_BG') echo ' selected="selected"'; ?>>Bulgarian</option>
+ <option value="ca_ES"<?php if ($fbc_options['language'] == 'ca_ES') echo ' selected="selected"'; ?>>Catalan</option>
+ <option value="ck_US"<?php if ($fbc_options['language'] == 'ck_US') echo ' selected="selected"'; ?>>Cherokee</option>
+ <option value="hr_HR"<?php if ($fbc_options['language'] == 'hr_HR') echo ' selected="selected"'; ?>>Croatian</option>
+ <option value="cs_CZ"<?php if ($fbc_options['language'] == 'cs_CZ') echo ' selected="selected"'; ?>>Czech</option>
+ <option value="da_DK"<?php if ($fbc_options['language'] == 'da_DK') echo ' selected="selected"'; ?>>Danish</option>
+ <option value="nl_BE"<?php if ($fbc_options['language'] == 'nl_BE') echo ' selected="selected"'; ?>>Dutch (Belgi&euml;)</option>
+ <option value="nl_NL"<?php if ($fbc_options['language'] == 'nl_NL') echo ' selected="selected"'; ?>>Dutch</option>
+ <option value="en_PI"<?php if ($fbc_options['language'] == 'en_PI') echo ' selected="selected"'; ?>>English (Pirate)</option>
+ <option value="en_GB"<?php if ($fbc_options['language'] == 'en_GB') echo ' selected="selected"'; ?>>English (UK)</option>
+ <option value="en_US"<?php if ($fbc_options['language'] == 'en_US') echo ' selected="selected"'; ?>>English (US)</option>
+ <option value="en_UD"<?php if ($fbc_options['language'] == 'en_UD') echo ' selected="selected"'; ?>>English (Upside Down)</option>
+ <option value="eo_EO"<?php if ($fbc_options['language'] == 'eo_EO') echo ' selected="selected"'; ?>>Esperanto</option>
+ <option value="et_EE"<?php if ($fbc_options['language'] == 'et_EE') echo ' selected="selected"'; ?>>Estonian</option>
+ <option value="fo_FO"<?php if ($fbc_options['language'] == 'fo_FO') echo ' selected="selected"'; ?>>Faroese</option>
+ <option value="tl_PH"<?php if ($fbc_options['language'] == 'tl_PH') echo ' selected="selected"'; ?>>Filipino</option>
+ <option value="fb_FI"<?php if ($fbc_options['language'] == 'fb_FI') echo ' selected="selected"'; ?>>Finnish (test)</option>
+ <option value="fi_FI"<?php if ($fbc_options['language'] == 'fi_FI') echo ' selected="selected"'; ?>>Finnish</option>
+ <option value="fr_CA"<?php if ($fbc_options['language'] == 'fr_CA') echo ' selected="selected"'; ?>>French (Canada)</option>
+ <option value="fr_FR"<?php if ($fbc_options['language'] == 'fr_FR') echo ' selected="selected"'; ?>>French (France)</option>
+ <option value="gl_ES"<?php if ($fbc_options['language'] == 'gl_ES') echo ' selected="selected"'; ?>>Galician</option>
+ <option value="ka_GE"<?php if ($fbc_options['language'] == 'ka_GE') echo ' selected="selected"'; ?>>Georgian</option>
+ <option value="de_DE"<?php if ($fbc_options['language'] == 'de_DE') echo ' selected="selected"'; ?>>German</option>
+ <option value="el_GR"<?php if ($fbc_options['language'] == 'el_GR') echo ' selected="selected"'; ?>>Greek</option>
+ <option value="gn_PY"<?php if ($fbc_options['language'] == 'gn_PY') echo ' selected="selected"'; ?>>Guaran&iacute;</option>
+ <option value="gu_IN"<?php if ($fbc_options['language'] == 'gu_IN') echo ' selected="selected"'; ?>>Gujarati</option>
+ <option value="he_IL"<?php if ($fbc_options['language'] == 'he_IL') echo ' selected="selected"'; ?>>Hebrew</option>
+ <option value="hi_IN"<?php if ($fbc_options['language'] == 'hi_IN') echo ' selected="selected"'; ?>>Hindi</option>
+ <option value="hu_HU"<?php if ($fbc_options['language'] == 'hu_HU') echo ' selected="selected"'; ?>>Hungarian</option>
+ <option value="is_IS"<?php if ($fbc_options['language'] == 'is_IS') echo ' selected="selected"'; ?>>Icelandic</option>
+ <option value="id_ID"<?php if ($fbc_options['language'] == 'id_ID') echo ' selected="selected"'; ?>>Indonesian</option>
+ <option value="ga_IE"<?php if ($fbc_options['language'] == 'ga_IE') echo ' selected="selected"'; ?>>Irish</option>
+ <option value="it_IT"<?php if ($fbc_options['language'] == 'it_IT') echo ' selected="selected"'; ?>>Italian</option>
+ <option value="ja_JP"<?php if ($fbc_options['language'] == 'ja_JP') echo ' selected="selected"'; ?>>Japanese</option>
+ <option value="jv_ID"<?php if ($fbc_options['language'] == 'jv_ID') echo ' selected="selected"'; ?>>Javanese</option>
+ <option value="kn_IN"<?php if ($fbc_options['language'] == 'kn_IN') echo ' selected="selected"'; ?>>Kannada</option>
+ <option value="kk_KZ"<?php if ($fbc_options['language'] == 'kk_KZ') echo ' selected="selected"'; ?>>Kazakh</option>
+ <option value="km_KH"<?php if ($fbc_options['language'] == 'km_KH') echo ' selected="selected"'; ?>>Khmer</option>
+ <option value="tl_ST"<?php if ($fbc_options['language'] == 'tl_ST') echo ' selected="selected"'; ?>>Klingon</option>
+ <option value="ko_KR"<?php if ($fbc_options['language'] == 'ko_KR') echo ' selected="selected"'; ?>>Korean</option>
+ <option value="ku_TR"<?php if ($fbc_options['language'] == 'ku_TR') echo ' selected="selected"'; ?>>Kurdish</option>
+ <option value="la_VA"<?php if ($fbc_options['language'] == 'la_VA') echo ' selected="selected"'; ?>>Latin</option>
+ <option value="lv_LV"<?php if ($fbc_options['language'] == 'lv_LV') echo ' selected="selected"'; ?>>Latvian</option>
+ <option value="fb_LT"<?php if ($fbc_options['language'] == 'fb_LT') echo ' selected="selected"'; ?>>Leet Speak</option>
+ <option value="li_NL"<?php if ($fbc_options['language'] == 'li_NL') echo ' selected="selected"'; ?>>Limburgish</option>
+ <option value="lt_LT"<?php if ($fbc_options['language'] == 'lt_LT') echo ' selected="selected"'; ?>>Lithuanian</option>
+ <option value="mk_MK"<?php if ($fbc_options['language'] == 'mk_MK') echo ' selected="selected"'; ?>>Macedonian</option>
+ <option value="mg_MG"<?php if ($fbc_options['language'] == 'mg_MG') echo ' selected="selected"'; ?>>Malagasy</option>
+ <option value="ms_MY"<?php if ($fbc_options['language'] == 'ms_MY') echo ' selected="selected"'; ?>>Malay</option>
+ <option value="ml_IN"<?php if ($fbc_options['language'] == 'ml_IN') echo ' selected="selected"'; ?>>Malayalam</option>
+ <option value="mt_MT"<?php if ($fbc_options['language'] == 'mt_MT') echo ' selected="selected"'; ?>>Maltese</option>
+ <option value="mr_IN"<?php if ($fbc_options['language'] == 'mr_IN') echo ' selected="selected"'; ?>>Marathi</option>
+ <option value="mn_MN"<?php if ($fbc_options['language'] == 'mn_MN') echo ' selected="selected"'; ?>>Mongolian</option>
+ <option value="ne_NP"<?php if ($fbc_options['language'] == 'ne_NP') echo ' selected="selected"'; ?>>Nepali</option>
+ <option value="se_NO"<?php if ($fbc_options['language'] == 'se_NO') echo ' selected="selected"'; ?>>Northern S&aacute;mi</option>
+ <option value="nb_NO"<?php if ($fbc_options['language'] == 'nb_NO') echo ' selected="selected"'; ?>>Norwegian (bokmal)</option>
+ <option value="nn_NO"<?php if ($fbc_options['language'] == 'nn_NO') echo ' selected="selected"'; ?>>Norwegian (nynorsk)</option>
+ <option value="ps_AF"<?php if ($fbc_options['language'] == 'ps_AF') echo ' selected="selected"'; ?>>Pashto</option>
+ <option value="fa_IR"<?php if ($fbc_options['language'] == 'fa_IR') echo ' selected="selected"'; ?>>Persian</option>
+ <option value="pl_PL"<?php if ($fbc_options['language'] == 'pl_PL') echo ' selected="selected"'; ?>>Polish</option>
+ <option value="pt_BR"<?php if ($fbc_options['language'] == 'pt_BR') echo ' selected="selected"'; ?>>Portuguese (Brazil)</option>
+ <option value="pt_PT"<?php if ($fbc_options['language'] == 'pt_PT') echo ' selected="selected"'; ?>>Portuguese (Portugal)</option>
+ <option value="pa_IN"<?php if ($fbc_options['language'] == 'pa_IN') echo ' selected="selected"'; ?>>Punjabi</option>
+ <option value="qu_PE"<?php if ($fbc_options['language'] == 'qu_PE') echo ' selected="selected"'; ?>>Quechua</option>
+ <option value="ro_RO"<?php if ($fbc_options['language'] == 'ro_RO') echo ' selected="selected"'; ?>>Romanian</option>
+ <option value="rm_CH"<?php if ($fbc_options['language'] == 'rm_CH') echo ' selected="selected"'; ?>>Romansh</option>
+ <option value="ru_RU"<?php if ($fbc_options['language'] == 'ru_RU') echo ' selected="selected"'; ?>>Russian</option>
+ <option value="sa_IN"<?php if ($fbc_options['language'] == 'sa_IN') echo ' selected="selected"'; ?>>Sanskrit</option>
+ <option value="sr_RS"<?php if ($fbc_options['language'] == 'sr_RS') echo ' selected="selected"'; ?>>Serbian</option>
+ <option value="zh_CN"<?php if ($fbc_options['language'] == 'zh_CN') echo ' selected="selected"'; ?>>Simplified Chinese (China)</option>
+ <option value="sk_SK"<?php if ($fbc_options['language'] == 'sk_SK') echo ' selected="selected"'; ?>>Slovak</option>
+ <option value="sl_SI"<?php if ($fbc_options['language'] == 'sl_SI') echo ' selected="selected"'; ?>>Slovenian</option>
+ <option value="so_SO"<?php if ($fbc_options['language'] == 'so_SO') echo ' selected="selected"'; ?>>Somali</option>
+ <option value="es_CL"<?php if ($fbc_options['language'] == 'es_CL') echo ' selected="selected"'; ?>>Spanish (Chile)</option>
+ <option value="es_CO"<?php if ($fbc_options['language'] == 'es_CO') echo ' selected="selected"'; ?>>Spanish (Colombia)</option>
+ <option value="es_MX"<?php if ($fbc_options['language'] == 'es_MX') echo ' selected="selected"'; ?>>Spanish (Mexico)</option>
+ <option value="es_ES"<?php if ($fbc_options['language'] == 'es_ES') echo ' selected="selected"'; ?>>Spanish (Spain)</option>
+ <option value="es_VE"<?php if ($fbc_options['language'] == 'es_VE') echo ' selected="selected"'; ?>>Spanish (Venezuela)</option>
+ <option value="es_LA"<?php if ($fbc_options['language'] == 'es_LA') echo ' selected="selected"'; ?>>Spanish</option>
+ <option value="sw_KE"<?php if ($fbc_options['language'] == 'sw_KE') echo ' selected="selected"'; ?>>Swahili</option>
+ <option value="sv_SE"<?php if ($fbc_options['language'] == 'sv_SE') echo ' selected="selected"'; ?>>Swedish</option>
+ <option value="sy_SY"<?php if ($fbc_options['language'] == 'sy_SY') echo ' selected="selected"'; ?>>Syriac</option>
+ <option value="tg_TJ"<?php if ($fbc_options['language'] == 'tg_TJ') echo ' selected="selected"'; ?>>Tajik</option>
+ <option value="ta_IN"<?php if ($fbc_options['language'] == 'ta_IN') echo ' selected="selected"'; ?>>Tamil</option>
+ <option value="tt_RU"<?php if ($fbc_options['language'] == 'tt_RU') echo ' selected="selected"'; ?>>Tatar</option>
+ <option value="te_IN"<?php if ($fbc_options['language'] == 'te_IN') echo ' selected="selected"'; ?>>Telugu</option>
+ <option value="th_TH"<?php if ($fbc_options['language'] == 'th_TH') echo ' selected="selected"'; ?>>Thai</option>
+ <option value="zh_HK"<?php if ($fbc_options['language'] == 'zh_HK') echo ' selected="selected"'; ?>>Traditional Chinese (Hong Kong)</option>
+ <option value="zh_TW"<?php if ($fbc_options['language'] == 'zh_TW') echo ' selected="selected"'; ?>>Traditional Chinese (Taiwan)</option>
+ <option value="tr_TR"<?php if ($fbc_options['language'] == 'tr_TR') echo ' selected="selected"'; ?>>Turkish</option>
+ <option value="uk_UA"<?php if ($fbc_options['language'] == 'uk_UA') echo ' selected="selected"'; ?>>Ukrainian</option>
+ <option value="ur_PK"<?php if ($fbc_options['language'] == 'ur_PK') echo ' selected="selected"'; ?>>Urdu</option>
+ <option value="uz_UZ"<?php if ($fbc_options['language'] == 'uz_UZ') echo ' selected="selected"'; ?>>Uzbek</option>
+ <option value="vi_VN"<?php if ($fbc_options['language'] == 'vi_VN') echo ' selected="selected"'; ?>>Vietnamese</option>
+ <option value="cy_GB"<?php if ($fbc_options['language'] == 'cy_GB') echo ' selected="selected"'; ?>>Welsh</option>
+ <option value="xh_ZA"<?php if ($fbc_options['language'] == 'xh_ZA') echo ' selected="selected"'; ?>>Xhosa</option>
+ <option value="yi_DE"<?php if ($fbc_options['language'] == 'yi_DE') echo ' selected="selected"'; ?>>Yiddish</option>
+ <option value="zu_ZA"<?php if ($fbc_options['language'] == 'zu_ZA') echo ' selected="selected"'; ?>>Zulu</option>
+ </select>
+ </p>
+ </div>
+ </div>
+
+ <div id="poststuff" class="postbox">
+ <h3><?php _e('Advanced Settings'); ?></h3>
+
+ <div class="inside">
+ <p><?php _e('Comments XID: '); ?>
+ <input type="text" name="fbComments[xid]" value="<?php echo $fbc_options['xid']; ?>" size="20">
+ <em><?php _e(" (Only change this if you know what you're doing. Must be a unique string. <a target='_blank' href='" . FBCOMMENTS_WEBPAGE . "#xid'>Learn more</a>)"); ?></em></p>
+
+ <p><input type="checkbox" id="fbComments_includeFbJs" name="fbComments[includeFbJs]" value="1" <?php checked(1, $fbc_options['includeFbJs']); ?> size="20">
+ <label for="fbComments_includeFbJs"><?php _e(' Include Facebook JavaScript SDK'); ?></label>
+ <em><?php _e(" (This should be checked unless you've manually included the SDK elsewhere)"); ?></em></p>
+
+ <p class="indent"><input type="checkbox" id="fbComments_includeFbJsOldWay" name="fbComments[includeFbJsOldWay]" value="1" <?php checked($fbc_options['includeFbJsOldWay'], 1 ); ?> size="20">
+ <label for="fbComments_includeFbJsOldWay"><?php _e(' The old way'); ?></label>
+ <em><?php _e(" (If the comments no longer load since updating the plugin, check this box to include the JavaScript SDK the old way. Combined comment counts and email notifications will not work with this option enabled)"); ?></em></p>
+
+ <p><input type="checkbox" id="fbComments_includeFbmlLangAttr" name="fbComments[includeFbmlLangAttr]" value="1" <?php checked($fbc_options['includeFbmlLangAttr'], 1 ); ?> size="20">
+ <label for="fbComments_includeFbmlLangAttr"><?php _e(' Include Facebook FBML reference'); ?></label>
+ <em><?php _e(" (This should be checked unless you have another plugin enabled that includes the FBML reference)"); ?></em></p>
+
+ <p><input type="checkbox" id="fbComments_includeOpenGraphLangAttr" name="fbComments[includeOpenGraphLangAttr]" value="1" <?php checked($fbc_options['includeOpenGraphLangAttr'], 1 ); ?> size="20">
+ <label for="fbComments_includeOpenGraphLangAttr"><?php _e(' Include OpenGraph reference'); ?></label>
+ <em><?php _e(" (This should be checked unless you have another plugin enabled that includes the OpenGraph reference)"); ?></em></p>
+
+ <p><input type="checkbox" id="fbComments_includeOpenGraphMeta" name="fbComments[includeOpenGraphMeta]" value="1" <?php checked($fbc_options['includeOpenGraphMeta'], 1 ); ?> size="20">
+ <label for="fbComments_includeOpenGraphMeta"><?php _e(' Include OpenGraph meta information'); ?></label>
+ <em><?php _e(" (This will add the following meta information to the page &lt;head&gt; to assist with Like button clicks: post/page title, site name, current URL and content type)"); ?></em></p>
+ </div>
+ </div>
+
+ <input type="hidden" name="fbComments[update]" value="1" />
+
+ <input type="submit" class="button-primary" value="<?php _e('Update Options'); ?>" />
+
+ </form> <!-- End Settings -->
+
+ <div id="poststuff" class="postbox gutter">
+ <h3><?php _e('Donate'); ?></h3>
+
+ <div class="inside contain-floats">
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="paypal">
+ <input type="hidden" name="cmd" value="_donations" />
+ <input type="hidden" name="business" value="fbc@we8u.com" />
+ <input type="hidden" name="item_name" value="Donation to Facebook Comments for WordPress plugin" />
+ <input type="hidden" name="item_number" value="0" />
+ <input type="hidden" name="notify_url" value="" />
+ <input type="hidden" name="no_shipping" value="1" />
+ <input type="hidden" name="return" value="<?php echo (!empty($_SERVER['HTTPS'])) ? 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] : 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; ?>" />
+ <input type="hidden" name="no_note" value="1" />
+ <input type="hidden" name="tax" value="0" />
+ <input type="hidden" name="bn" value="PP-DonationsBF" />
+ <input type="hidden" name="on0" value="Website" />
+
+ <p>Currency:
+ <select id="currency_code" name="currency_code">
+ <option value="USD">U.S. Dollars</option>
+ <option value="AUD">Australian Dollars</option>
+ <option value="CAD">Canadian Dollars</option>
+ <option value="EUR">Euros</option>
+ <option value="GBP">Pounds Sterling</option>
+ <option value="JPY">Yen</option>
+ </select></p>
+
+ <p>Amount:
+ <input type="text" name="amount" size="16" title="The amount you wish to donate" value="" /></p>
+
+ <p><input class="ppimg donateButton" type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" name="submit" style="border:0;" alt="Make a donation" />
+ <span class="donateText"></span></p>
+ </form>
+ </div>
+ </div>
+
+ <br />
+</div> <!-- End wrap -->
79 facebook-comments-ajax.php
@@ -0,0 +1,79 @@
+<?php
+ if (FBCOMMENTS_ERRORS) {
+ error_reporting(E_ALL); // Ensure all errors and warnings are verbose
+ }
+
+ // Load WordPress functions
+ require('../../../wp-load.php');
+
+ // Redirect to main page if this file was accessed directly
+ if (!$_POST['fn']) {
+ header('Location: ' . home_url());
+
+ exit();
+ }
+
+ global $fbc_options;
+
+ // Check if we want to update the comment count or send a notification email
+ switch ($_POST['fn']) {
+ // Update Facebook comment count
+ case "addComment":
+ fbComments_log('In ' . basename(__FILE__) . " with fn={$_POST['fn']}, xid={$_POST['xid']}");
+ $count = get_option("fbComments_commentCount_{$_POST['xid']}");
+ if (update_option("fbComments_commentCount_{$_POST['xid']}", $count+1)) {
+ fbComments_log(sprintf(' Updated Facebook comment count from %d to %d', $count, $count+1));
+ echo 'true';
+ } else {
+ fbComments_log(sprintf(' FAILED to update Facebook comment count from %d to %d', $count, $count+1));
+ echo 'false';
+ }
+
+ exit();
+ break;
+
+ // Email notifications
+ case "sendNotification":
+ fbComments_log('In ' . basename(__FILE__) . " with fn={$_POST['fn']}, xid={$_POST['xid']}, " .
+ "postTitle={$_POST['postTitle']}, postUrl={$_POST['postUrl']}, ");
+
+ fbComments_log(" Fetching comments using an access token of {$fbc_options['accessToken']}");
+ $comments = fbComments_getUrl("https://api.facebook.com/method/comments.get?xid={$_POST['xid']}&access_token={$fbc_options['accessToken']}&format=json");
+ $commentsJson = json_decode($comments);
+ $userId = $commentsJson[0]->fromid;
+ $comment = $commentsJson[0]->text;
+
+ fbComments_log(" Fetching user info using an access token of {$fbc_options['accessToken']}");
+ $user = fbComments_getUrl("https://api.facebook.com/method/users.getInfo?uids=$userId&fields=name&access_token={$fbc_options['accessToken']}&format=json");
+ $userJson = json_decode($user);
+ $username = $userJson[0]->name;
+ fbComments_log(" For latest comment, poster UID=$userId, poster name=$username, comment=$comment");
+
+ $to = get_bloginfo('admin_email');
+ $subject = "[Facebook Comments for WordPress] New comment: \"{$_POST['postTitle']}\"";
+
+ $message = "$username has posted a new comment on your post \"{$_POST['postTitle']}\":\n\n" .
+ "$comment\n\n" .
+ "You can see all Facebook comments on this post here: {$_POST['postUrl']}#facebook-comments";
+
+ // Wordwrap the message and strip slashes that may have wrapped quotes
+ $message = stripslashes(wordwrap($message, 70));
+
+ $headers = "From: $username <$to>\r\n" .
+ "Reply-To: $to\r\n" .
+ "X-Mailer: PHP" . phpversion();
+
+ // Send the email notification
+ if (wp_mail($to, $subject, $message, $headers)) {
+ fbComments_log(sprintf(' Sent email notification to %s', $to));
+ echo "true";
+ } else {
+ fbComments_log(sprintf(' FAILED to send email notification to %s', $to));
+ echo "false";
+ }
+
+ exit();
+ break;
+ }
+
+?>
110 facebook-comments-combinecomments.php
@@ -0,0 +1,110 @@
+<?php
+
+/**********************************
+ Combined comment counts (and caching)
+ **********************************/
+function fbComments_getCachedCommentCount($xid, $wpCommentCount) {
+ fbComments_log('In ' . __FUNCTION__ . "(xid=$xid, wpCommentCount=$wpCommentCount)");
+ global $fbc_options;
+
+ $fbCommentCount = get_option("fbComments_commentCount_$xid");
+
+ return fbComments_getProperCommentCount($fbCommentCount, $wpCommentCount);
+}
+
+function fbComments_getProperCommentCount($fbCommentCount=0, $wpCommentCount=0) {
+ fbComments_log('In ' . __FUNCTION__ . "(fbCommentCount=$fbCommentCount, wpCommentCount=$wpCommentCount)");
+ global $fbc_options, $wp_query, $wpdb;
+ $postId = $wp_query->post->ID;
+
+ // $comments = $wpdb->get_row("SELECT comment_count as count FROM wp_posts WHERE ID = '$postId'");
+ // $commentcount = $comments->count;
+ // wp_reset_query();
+ # If the WordPress comments are hidden, just return the Facebook comments count
+ if ($fbc_options['hideWpComments']) {
+ // if (!comments_open()) return $wpCommentCount;
+ fbComments_log(" Returning a Facebook comment count of $fbCommentCount");
+ return $fbCommentCount;
+ # If commenting is closed on this post or we shouldn't be displaying Facebook comments due to settings, just return the WordPress comments count
+ } elseif (!comments_open() ||
+ ($fbc_options['displayPagesOrPosts'] == 'pages') && (!is_page()) ||
+ ($fbc_options['displayPagesOrPosts'] == 'posts') && (!is_single())) {
+ return $wpCommentCount;
+ } else {
+ fbComments_log(sprintf(' Returning a combined comment count of %d', $fbCommentCount+$wpCommentCount));
+ return $fbCommentCount + $wpCommentCount;
+ }
+}
+
+/*
+ * Loops through all posts and caches the Facebook comment count
+ *
+ * Thanks to Almog Baku for help with the Facebook API calls (http://www.almogbaku.com/)
+ */
+function fbComments_cacheAllCommentCounts() {
+ global $fbc_options;
+ fbComments_log('In ' . __FUNCTION__ . '()');
+
+ $fb = fbComments_getFbApi();
+ $posts = get_posts(array('numberposts' => -1)); // Retrieve all posts
+
+ if ($posts) {
+ fbComments_log(sprintf(' Looping through %d posts', count($posts)));
+ foreach ($posts as $post) {
+ $xid = $fbc_options['xid'] . "_post{$post->ID}";
+ $query = array(
+ 'method' => 'fql.query',
+ 'query' => 'SELECT count FROM comments_info WHERE app_id="' . $fb->getAppId() . '" AND xid="' . $xid . '"'
+ );
+
+ try {
+ fbComments_log(" Retrieving Facebook comment count for post with xid=$xid");
+ $result = $fb->api($query);
+
+ if ($result) {
+ update_option("fbComments_commentCount_$xid", $result[0]['count']);
+ }
+ } catch (FacebookApiException $e) {
+ fbComments_log(" FAILED to retrieve Facebook comment count for post with xid=$xid error: $e");
+ }
+ }
+ }
+}
+
+
+function fbComments_combineCommentCounts($value) {
+ fbComments_log('In ' . __FUNCTION__ . "(value=$value)");
+ global $fbc_options, $wp_query;
+
+ $postId = $wp_query->post->ID;
+ $xid = $fbc_options['xid'] . "_post$postId";
+
+ // Return the cached comment count (if it exists)
+ if (get_option("fbComments_commentCount_$xid") !== null) {
+ return fbComments_getCachedCommentCount($xid, $value);
+ }
+
+ $fb = fbComments_getFbApi();
+
+ $query = array(
+ 'method' => 'fql.query',
+ 'query' => 'SELECT count FROM comments_info WHERE app_id="' . $fb->getAppId() . '" AND xid="' . $xid . '"'
+ );
+
+ try {
+ fbComments_log(" Comment count wasn't cached. Retrieving Facebook comment count for post with xid=$xid");
+ $result = $fb->api($query);
+
+ if ($result) {
+ // Cache the Facebook comment count
+ update_option("fbComments_commentCount_$xid", $result[0]['count']);
+
+ return fbComments_getProperCommentCount($result[0]['count'], $value);
+ }
+ } catch (FacebookApiException $e) {}
+
+ fbComments_log(" FAILED to retrieve Facebook comment count for post with xid=$xid");
+ return fbComments_getProperCommentCount(0, $value);
+}
+
+?>
286 facebook-comments-core.php
@@ -0,0 +1,286 @@
+<?php
+/**********************************
+Common functions
+**********************************/
+
+# Update database with default options upon manual plugin activation
+function fbComments_init() {
+ global $fbComments_defaults, $fbc_options;
+
+ add_option('fbComments', $fbComments_defaults); // on first install
+
+ # If the plugin has been activated before and we already have the integral settings, cache all Facebook comment counts
+ # iff comment caching is enabled. we don't want people with thousands of posts being unable to activate
+ if (!empty($fbc_options['appId']) &&
+ !empty($fbc_options['appSecret'])) {
+ update_option('fbComments_displayAppIdWarning', false);
+ if ($fbc_options['enableCache'] == true) { fbComments_cacheAllCommentCounts(); }
+ } else { update_option('fbComments_displayAppIdWarning', true); }
+}
+
+ /**
+ * Load settings from database on update.
+ *
+ * WordPress 3.1 changed activation hook firing on update. see: http://bit.ly/wp3_1noupdate
+ *
+ * @since 3.0.2
+ */
+function fbComments_doUpdate() {
+ global $fbComments_defaults, $fbc_options;
+
+ if (($_options = get_option('fbComments')) != false) $fbc_options = $_options;
+ add_option('fbComments', $fbComments_defaults); # copy defaults to db if fbComments doesn't exist
+
+ ###### 3.1 new settings ######
+ $fbc_options['fbCommentCount'] = 'true';
+ if (!isset($fbc_options['v2ccstyle'])) $fbc_options['v2ccstyle'] = 'border:none; overflow:hidden; width:130px; padding-left:-15px; height:12px;';
+ if (!isset($fbc_options['indexLikebtn'])) {
+ $fbc_options['indexLikebtn'] = array('display' => 'none',
+ 'layout' => 'button_count',
+ 'showFaces' => true,
+ 'width' => 450,
+ 'verb' => 'like',
+ 'font' => 'arial',
+ 'color' => 'light',
+ 'style' => 'height: 25px; width: 150px; border: medium none; overflow: hidden;'
+ );
+ }
+ if (!isset($fbc_options['like'])) {
+ $fbc_options['like'] = array('layout' => 'standard',
+ 'showFaces' => true,
+ 'width' => 450,
+ 'verb' => 'like',
+ 'font' => 'arial',
+ 'color' => 'light',
+ 'style' => 'height: 62px; width: 100%;'
+ );
+ }
+
+ # save id, secret, xid in case upgrading from 3.0.X[.X]
+ $save_appId = $fbc_options['appId'];
+ $save_appSecret = $fbc_options['appSecret'];
+ $save_xid = $fbc_options['xid'];
+
+ ###### 3.0.2.2 new settings ######
+ if (!isset($fbc_options['dashNumComments'])) $fbc_options['dashNumComments'] = 10;
+ if (strlen($fbc_options['commentVersion']) < 1) $fbc_options['commentVersion'] = 'v2migrated';
+
+ # handle upgrading from <=2.1.2
+ $oldver = get_option('fbComments_ver');
+ if (empty($oldver)) {
+ $fbc_options['appId'] = get_option('fbComments_appId');
+ if (strlen($$fbc_options['appId']) < 1) $fbc_options['appId'] = $save_appId;
+
+ $fbc_options['appSecret'] = get_option('fbComments_appSecret');
+ if (strlen($fbc_options['appSecret']) < 1) $fbc_options['appSecret'] = $save_appSecret;
+
+ $fbc_options['xid'] = get_option('fbComments_xid');
+ if (strlen($fbc_options['xid']) < 1) { $fbc_options['xid'] = $save_xid; }
+
+ if (get_option('fbComments_includeFbJs') == true) { $fbc_options['includeFbJs'] = true; }
+ if (get_option('fbComments_includeFbJsOldWay') == true) { $fbc_options['includeFbJsOldWay'] = true; }
+ if (get_option('fbComments_includeFbmlLangAttr') == true) { $fbc_options['includeFbmlLangAttr'] = true; }
+ if (get_option('fbComments_includeOpenGraphLangAttr') == true) { $fbc_options['includeOpenGraphLangAttr'] = true; }
+ if (get_option('fbComments_includeOpenGraphMeta') == true) { $fbc_options['includeOpenGraphMeta'] = true; }
+ if (get_option('fbComments_includeFbComments') == true) { $fbc_options['includeFbComments'] = true; }
+ if (get_option('fbComments_hideWpComments') == true) { $fbc_options['hideWpComments'] = true; }
+ if (get_option('fbComments_combineCommentCounts') == true) { $fbc_options['combineCommentCounts'] = true; }
+ if (get_option('fbComments_notify') == true) { $fbc_options['notify'] = true; }
+ if (get_option('fbComments_displayTitle') == true) { $fbc_options['displayTitle'] = true; }
+ if (get_option('fbComments_publishToWall') == true) { $fbc_options['publishToWall'] = true; }
+ if (get_option('fbComments_reverseOrder') == true) { $fbc_options['reverseOrder'] = true; }
+ if (get_option('fbComments_darkSite') == true) { $fbc_options['darkSite'] = true; }
+ if (get_option('fbComments_noBox') == true) { $fbc_options['noBox'] = true; }
+ if (strlen($fbc_options['language']) < 1) { $fbc_options['language'] = get_option('fbComments_language'); }
+ if (strlen($_title = get_option('fbComments_title')) > 1) $fbc_options['title'] = $_title;
+ if (strlen($_numPosts = get_option('fbComments_numPosts')) > 1) $fbc_options['numPosts'] = $_numPosts;
+ if (strlen($_width = get_option('fbComments_width')) > 1) $fbc_options['width'] = $_width;
+ if (strlen($_displayPagesOrPosts = get_option('fbComments_displayPagesOrPosts')) > 1) $fbc_options['displayPagesOrPosts'] = $_displayPagesOrPosts;
+ if (strlen($_containerCss = get_option('fbComments_containerCss')) > 1) $fbc_options['containerCss'] = $_containerCss;
+ if (strlen($_titleCss = get_option('fbComments_titleCss')) > 1) $fbc_options['titleCss'] = $_titleCss;
+ }
+
+ update_option('fbComments_ver', FBCOMMENTS_VER);
+ update_option('fbComments', $fbc_options);
+}
+
+// Email the site owner the current XID upon plugin deactivation
+function fbComments_deactivate() {
+ global $fbc_options;
+
+ $to = get_bloginfo('admin_email');
+ $subject = "[Facebook Comments for WordPress] Your current XID";
+
+ $message = "Thanks for trying out Facebook Comments for WordPress!\n\n" .
+ "We just thought you'd like to know that your current XID is: {$fbc_options['xid']}.\n\n" .
+ "This should be saved in your website's database, but in case it gets lost, you'll need this unique key to retrieve your comments should you ever choose to activate this plugin again.\n\n" .
+ "Have a great day!";
+
+ // Wordwrap the message and strip slashes that may have wrapped quotes
+ $message = stripslashes(wordwrap($message, 70));
+
+ $headers = "From: Facebook Comments for WordPress <$to>\r\n" .
+ "Reply-To: $to\r\n" .
+ "X-Mailer: PHP" . phpversion();
+
+ // Send the email notification
+ fbComments_log("Sending XID via email to $to");
+ if (wp_mail($to, $subject, $message, $headers)) {
+ fbComments_log(sprintf(' Sent XID via email to %s', $to));
+ } else {
+ fbComments_log(sprintf(' FAILED to send XID via email to %s', $to));
+ }
+}
+
+// Remove database entries upon the plugin being uninstalled
+function fbComments_uninit() {
+ delete_option('fbComments');
+}
+
+
+// Generate a random alphanumeric string for the comments XID
+function fbComments_getRandXid($length=15) {
+ $chars = array_merge(range('A', 'Z'), range('a', 'z'), range(0, 9));
+ $rand = '';
+
+ for ($i = 0; $i < $length; $i++) {
+ $rand .= $chars[mt_rand(0, count($chars)-1)];
+ }
+
+ return $rand;
+}
+
+// The application ID and application secret must be set before calling this function
+function fbComments_getFbApi() {
+ global $fbc_options;
+
+ $fbApiCredentials = array(
+ 'appId' => $fbc_options['appId'],
+ 'secret' => $fbc_options['appSecret']
+ );
+
+ return new Facebook($fbApiCredentials);
+}
+
+// The application ID and application secret must be set before calling this function
+function fbComments_storeAccessToken() {
+ fbComments_log('In ' . __FUNCTION__ . '()');
+ global $fbc_options;
+
+ if (!$fbc_options['accessToken']) {
+ $accessToken = fbComments_getUrl("https://graph.facebook.com/oauth/access_token?type=client_cred&client_id={$fbc_options['appId']}&client_secret={$fbc_options['appSecret']}");
+ fbComments_log(" got an access token of [$accessToken]");
+ if (strpos($accessToken,'<div class="error">') == 0) { $accessToken = substr($accessToken, 13); }
+ else { echo '<hr />didnt find accesstoken line 161 comments-core<hr />'; $accessToken = ''; }
+ if ($accessToken != '') {
+ fbComments_log(" Storing an access token of $accessToken");
+ $fbc_options['accessToken'] = $accessToken;
+ update_option('fbComments', $fbc_options);
+ } else {
+ fbComments_log(' FAILED to obtain an access token');
+ }
+ }
+}
+
+// sugar for calling wp_remote_get
+function fbComments_getUrl($url) {
+
+ $file_contents = wp_remote_get($url,
+ $args = array('method' => 'GET',
+ 'timeout' => '5',
+ 'redirection' => '5',
+ 'user-agent' => 'WordPress facebook comments plugin',
+ 'blocking' => true,
+ 'compress' => false,
+ 'decompress' => true,
+ 'sslverify' => false
+ ));
+ if (is_array($file_contents)) $file_contents = $file_contents['body'];
+ else $file_contents = '<div class="error"><p><strong>' . __("Request to facebook timed-out. Please try again in a few moments.") . '</strong></p></div>';
+
+
+
+ fbComments_log('In ' . __FUNCTION__ . "(url=$url)");
+
+ if (!$file_contents) {
+ fbComments_log(' FAILED to retrieve content via wp_remote_get');
+ }
+
+ return $file_contents;
+}
+
+/**
+* Display changelog on plugin settings page
+*
+* @since 3.1
+*/
+function display_changelog( $file, $plugin_data ) {
+if ($file == 'facebook-comments-for-wordpress/facebook-comments.php') {
+ global $wp_version;
+
+ if( is_plugin_active( 'wp-manage-plugins/wp-manage-plugins.php' ) ) {
+ $plugins_ignored = get_option('plugin_update_ignore');
+ if ( in_array( $file, array_keys($plugins_ignored) ) )
+ return false;
+ }
+
+ $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
+ $current = get_site_transient( 'update_plugins' );
+ if (!isset($current->response[$file])) return false;
+
+ $output = '';
+
+ $r = $current->response[ $file ];
+ include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
+ $columns = 3;
+
+ $cache_key = 'plugin_changelog_' . $r->slug;
+ $output = wp_cache_get($cache_key, 'fbc_clog');
+ if (false === $output) {
+ $api = plugins_api('plugin_information', array('slug' => $r->slug, 'fields' => array('tested' => true, 'requires' => false, 'rating' => false, 'downloaded' => false, 'downloadlink' => false, 'last_updated' => false, 'homepage' => false, 'tags' => false, 'sections' => true) ));
+ if ( !is_wp_error( $api ) && current_user_can('update_plugins') ) {
+ $is_active = is_plugin_active( $file );
+ $class = $is_active ? 'active' : 'inactive';
+ $class_tr = ' class="plugin-update-tr second ' . $class . '"';
+
+ $output .= '<tr' . $class_tr . '><td class="plugin-update clos-plugin-update" colspan="' . $columns . '"><div class="update-message clos-message" id="clos-message-' . $r->slug . '">';
+
+ $changes = file_get_contents("../wp-content/plugins/facebook-comments-for-wordpress/readme.txt");
+ $changes = strstr($changes, '= '.FBCOMMENTS_VER.' =');
+ $changes = str_replace("\n",'<br />',$changes);
+ $changes = substr($changes, 0, strpos($changes, '=', 14));
+ $version = substr($changes, 0, $pos=strpos($changes, '<br />'));
+ $version = str_replace(' ','', str_replace('=','', $version));
+ $changes = substr($changes, $pos+6,strlen($changes));
+ $changes = $version.'<div style="font-weight:normal">'.$changes.'</div>';
+ $output .= sprintf(__('What\'s changed in version %1$s'), $changes);
+ if ( isset($api->tested) && version_compare($api->tested, $cur_wp_version, '>=') ) {
+ $output .= ' ' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to we8u)'), $cur_wp_version);
+ } elseif ( isset($api->compatibility[$cur_wp_version][$r->new_version]) ) {
+ $compat = $api->compatibility[$cur_wp_version][$r->new_version];
+ $output .= ' ' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d of %4$d say it works)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]);
+ } else {
+ $output .= ' ' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version);
+ }
+ $output .= ' </div></td></tr>';
+
+ } else {
+ $output .= '<tr class="plugin-update-tr"><td colspan="' . $columns . '"><div class="update-message clos-message">';
+ $output .= sprintf(__('<strong>ERROR</strong>: %s'), $api->get_error_message());
+ $output .= '</div></td></tr>';
+ }
+ wp_cache_set($cache_key, $output, 'fbc_clog', 60*60*3);
+ }
+ echo $output;
+
+} # end if
+} # end display_changelog
+
+
+// Log to the Apache error log (usually located in /var/log/apache2/error_log)
+function fbComments_log($msg) {
+ if (FBCOMMENTS_ERRORS) {
+ error_log('fbComments: ' . $msg);
+ }
+}
+?>
292 facebook-comments-display.php
@@ -0,0 +1,292 @@
+<?php
+ /**********************************
+ Facebook comments box inclusion
+ **********************************/
+
+ // Insert Facebook comments manually or into the comments array
+ function facebook_comments($comments='') {
+ global $fbc_options, $wp_query;
+
+ // Return out of function if we're only supposed to display comments on pages OR posts
+ if (($fbc_options['displayPagesOrPosts'] == 'pages') && (!is_page())) {
+ return $comments;
+ }
+
+ if (($fbc_options['displayPagesOrPosts'] == 'posts') && (!is_single())) {
+ return $comments;
+ }
+
+ $postId = $wp_query->post->ID;
+ // Return out of function if commenting is closed for this post
+ if (!comments_open()) {
+ echo "<h2>Comments Closed</h2>";
+ return $comments;
+ }
+
+ $xid = $fbc_options['xid'] . "_post$postId";
+ $postTitle = get_the_title($postId);
+ $postUrl = get_permalink($postId);
+
+ // Decide which stylesheet to use
+ $customStylesheet = fbComments_getStylesheet();
+
+ // Only insert the Facebook comments if both an application ID and an application secret has been set
+ if (!empty($fbc_options['appId']) && !empty($fbc_options['appSecret'])) {
+ // Store our access token if it hasn't already been saved
+ fbComments_storeAccessToken();
+
+ echo "\n<!-- Facebook Comments for WordPress v" . FBCOMMENTS_VER . " by " . FBCOMMENTS_AUTHOR . " (" . FBCOMMENTS_WEBPAGE . ") -->\n
+<a name='facebook-comments'></a>\n";
+
+ if ($fbc_options['includeFbJs']) {
+ fbComments_includeFbJs();
+ }
+
+ // Print out the JavaScript that will catch new comments in order to update comment counts and send notifications
+ fbComments_printCommentCatchAndNotificationScripts($xid, $postTitle, $postUrl);
+
+ echo "\n<div id='fbComments' style='{$fbc_options['containerCss']}'>\n";
+
+ if ($fbc_options['displayTitle']) {
+ echo "\t<p style='{$fbc_options['titleCss']}'>" . __($fbc_options['title']) . "</p>\n";
+ }
+
+ // Print out the JavaScript for calculating the width of the comments box
+ fbComments_printFbCommentsTag($xid, $postTitle, $postUrl, $customStylesheet);
+
+ // Hide the WordPress commenting form if requested
+ if ($fbc_options['hideWpComments']) {
+ return array(); // Must return an empty array so foreach() loops in certain themes don't produce errors
+ }
+ } else { // If no application ID or application secret are set, display a message asking the user to set one (if they have permission to do so)
+ fbComments_handleNoAppId();
+ }
+
+ return $comments;
+ }
+
+ /**********************************
+ Facebook comments box helpers
+ **********************************/
+
+ function fbComments_getStylesheet() {
+ global $fbc_options;
+
+ if (($fbc_options['darkSite'])) {
+ return FBCOMMENTS_CSS_HIDELIKEANDDARKSITE . '?' . fbComments_getRandXid();
+ } else {
+ return FBCOMMENTS_CSS_HIDELIKE . '?' . fbComments_getRandXid();
+ }
+ }
+
+ function fbComments_handleNoAppId() {
+ global $fbc_options;
+
+ get_currentuserinfo(); // Get user info to see if the currently logged in user (if any) has the 'manage_options' capability
+
+ if (current_user_can('manage_options')) {
+ $fbc_optionsPage = admin_url('options-general.php?page=facebook-comments');
+
+ echo "\n<!-- Facebook Comments for WordPress v" . FBCOMMENTS_VER . " by " . FBCOMMENTS_AUTHOR . " (" . FBCOMMENTS_WEBPAGE . ") -->
+
+<div style='{$fbc_options['containerCss']}'>\n";
+
+ if ($fbc_options['displayTitle']) {
+ echo "\t<p style='{$fbc_options['titleCss']}'>" . __($fbc_options['title']) . "</p>\n";
+ }
+
+ echo "\t<div style='background-color: #ffebe8; border: 1px solid #c00; padding: 7px; font-weight: bold; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -khtml-border-radius: 5px;'>" . __("Your Facebook comments would normally appear here, but you haven't set a valid application ID or application secret yet. <a href='$fbc_optionsPage' style='color: #c00;'>Go set them now</a>.") . "</div>
+</div>\n";
+ }
+ }
+
+ function fbComments_includeFbJs() {
+ global $fbc_options;
+
+ // Decide whether or not to include the Facebook JavaScript library the old way or the new way
+ if ($fbc_options['includeFbJsOldWay']) {
+ echo "\n<div id='fb-root'></div>
+<script type='text/javascript'>
+ window.fbAsyncInit = function() {
+ FB.init({
+ appId: '{$fbc_options['appId']}',
+ status: true,
+ cookie: true,
+ xfbml: true
+ });
+ };
+
+ (function() {
+ var e = document.createElement('script'); e.async = true;
+ e.src = document.location.protocol + '//connect.facebook.net/{$fbc_options['language']}/all.js';
+ document.getElementById('fb-root').appendChild(e);
+ }());
+</script>\n";
+ } else {
+ echo "\n<div id='fb-root'></div>
+<script src='http://connect.facebook.net/{$fbc_options['language']}/all.js#appId={$fbc_options['appId']}&amp;xfbml=1' type='text/javascript'></script>\n";
+ }
+ }
+
+ function fbComments_printCommentCatchAndNotificationScripts($xid, $postTitle, $postUrl) {
+ global $fbc_options;
+
+ echo "
+<script type='text/javascript'>
+ var addedComment = function(response) {
+ //console.log('fbComments: Caught added comment');
+ //console.log('fbComments: Making AJAX call to update Facebook comment count');
+ $.post('" . FBCOMMENTS_PATH . "facebook-comments-ajax.php', { fn: 'addComment', xid: '$xid' }, function(resp) {
+ if (resp === 'true') {
+ //console.log('fbComments: Updated and cached Facebook comment count for post with xid=$xid');
+ } else {
+ //console.log('fbComments: FAILED to update Facebook comment count for post with xid=$xid');
+ }
+ });\n";
+
+ if ($fbc_options['notify']) {
+ echo "
+ //console.log('fbComments: Making AJAX call to send email notification');
+ $.post('" . FBCOMMENTS_PATH . "facebook-comments-ajax.php', { fn: 'sendNotification', xid: '$xid', postTitle: '$postTitle', postUrl: '$postUrl' }, function(resp) {
+ if (resp === 'true') {
+ //console.log('fbComments: Sent email notification');
+ } else {
+ //console.log('fbComments: FAILED to send email notification');
+ }
+ });";
+ }
+
+ echo "
+ };
+
+ FB.Event.subscribe('comments.add', addedComment);
+</script>\n";
+ }
+
+ function fbComments_printFbCommentsTag($xid, $postTitle, $postUrl, $customStylesheet) {
+ global $fbc_options;
+ // Since the 'publish_feed' option defaults to true, we need to pass it an explicit false if it's turned off
+ $publishToWall = ($fbc_options['publishToWall']) ? 'true' : 'false';
+ // if ($fbc_options['newUser'] == 1) {
+ // echo "\t<fb:comments href='$postUrl' ",
+ // "numposts='{$fbc_options['numPosts']}' ",
+ // "width='{$fbc_options['width']}' ",
+ // "publish_feed='$publishToWall' ",
+ // "</fb:comments>";
+ // }
+ $siteisdark = '';
+ if ($fbc_options['darkSite'] == true) $siteisdark = "colorscheme='dark'";
+ if (!$fbc_options['hideFbLikeButton']) {
+ $likebtn = "<iframe src='https://www.facebook.com/plugins/like.php?"
+ ."href=$postUrl".'&amp;'
+ ."layout={$fbc_options['like']['layout']}".'&amp;';
+
+ if ($fbc_options['like']['faces']) $likebtn .= 'show_faces=true&amp;';
+ else $likebtn .= 'show_faces=false&amp;';
+
+ $likebtn .= "width={$fbc_options['like']['width']}".'&amp;'
+ ."action={$fbc_options['like']['verb']}".'&amp;'
+ ."font={$fbc_options['like']['font']}".'&amp;'
+ ."colorscheme={$fbc_options['like']['color']}"
+ ."' scrolling='no' frameborder='0' style='{$fbc_options['like']['style']}' allowTransparency='true'></iframe>";
+ } else $likebtn = '';
+
+ if ($fbc_options['v1plusv2'] == 1) {
+ echo "<!-- facebook comments v1 + v2 -->\n";
+ update_option('fbComments', $fbc_options);
+ echo $likebtn,"\n";
+ echo "\t<fb:comments xid='$xid' href='$postUrl' $siteisdark ",
+ "numposts='{$fbc_options['numPosts']}' ",
+ "width='{$fbc_options['width']}' ",
+ "publish_feed='$publishToWall' ",
+ "migrated='1'></fb:comments><hr style='width:auto' />";
+
+ echo "\t<fb:comments xid='$xid' ",
+ "numposts='{$fbc_options['numPosts']}' ",
+ "width='{$fbc_options['width']}' ",
+ "simple='{$fbc_options['noBox']}' ",
+ "publish_feed='$publishToWall' ",
+ "reverse='{$fbc_options['reverseOrder']}' ",
+ "css='$customStylesheet' ",
+ "title='$postTitle' ",
+ "url='$postUrl' ",
+ "notify='true'></fb:comments>";
+
+ } else if ($fbc_options['commentVersion'] == 'v2migrated') {
+ // $newpostUrl = urlencode(urlencode($postUrl));
+ echo "<!-- facebook comments v2 with imported v1 comments -->\n";
+ echo $likebtn,"\n";
+ echo "\t<fb:comments xid='$xid' url='$postUrl' $siteisdark ",
+ "numposts='{$fbc_options['numPosts']}' ",
+ "width='{$fbc_options['width']}' ",
+ "publish_feed='$publishToWall' ",
+ "migrated='1'></fb:comments>";
+
+ } else if ($fbc_options['commentVersion'] == 'v2') {
+ echo "<!-- facebook comments v2 only -->\n";
+ echo $likebtn,"\n";
+ echo "\t<fb:comments xid='$xid' href='$postUrl' $siteisdark ",
+ "numposts='{$fbc_options['numPosts']}' ",
+ "width='{$fbc_options['width']}' ",
+ "publish_feed='$publishToWall' ",
+ "migrated='1'></fb:comments>";
+
+ } else if ($fbc_options['commentVersion'] == 'v1') {
+ echo "<!-- facebook comments v1 only -->\n";
+ echo $likebtn,"\n";
+ echo "\t<fb:comments xid='$xid' ",
+ "numposts='{$fbc_options['numPosts']}' ",
+ "width='{$fbc_options['width']}' ",
+ "simple='{$fbc_options['noBox']}' ",
+ "publish_feed='$publishToWall' ",
+ "reverse='{$fbc_options['reverseOrder']}' ",
+ "css='$customStylesheet' ",
+ "title='$postTitle' ",
+ "url='$postUrl' ",
+ "notify='true'></fb:comments>";
+ }
+echo "</div>\n";
+ }
+
+ /**
+ * Show like button before the_excerpt
+ *
+ * @since 3.1
+ */
+ function fbc_show_like_index($content) {
+ global $fbc_options, $wp_query;
+
+ wp_reset_query(); # so is_home always works
+ if (!is_home()) return $content;
+
+ $postUrl = get_permalink($wp_query->post->ID);
+
+ $likebtn = "<iframe src='https://www.facebook.com/plugins/like.php?"
+ ."href=$postUrl".'&amp;'
+ ."layout={$fbc_options['indexLikebtn']['layout']}".'&amp;';
+ $likebtn .= ($fbc_options['indexLikebtn']['faces']) ? 'show_faces=true&amp;' : 'show_faces=false&amp;';
+ $likebtn .= "width={$fbc_options['indexLikebtn']['width']}".'&amp;'
+ ."action={$fbc_options['indexLikebtn']['verb']}".'&amp;'
+ ."font={$fbc_options['indexLikebtn']['font']}".'&amp;'
+ ."colorscheme={$fbc_options['indexLikebtn']['color']}"
+ ."' scrolling='no' frameborder='0' style='{$fbc_options['indexLikebtn']['style']}' allowTransparency='true'></iframe>";
+
+ if ($fbc_options['indexLikebtn']['display'] == 'top') return $likebtn.$content;
+ return $content.$likebtn;
+ }
+
+ /**
+ * Show facebook iframe comment count
+ *
+ * @since 3.1
+ */
+ function fbc_facebook_comment_count($ccount='') {
+ global $fbc_options, $wp_query;
+ $postUrl = get_permalink($wp_query->post->ID);
+
+ echo "</a><iframe src='http://www.facebook.com/plugins/comments.php?href=$postUrl&permalink=1'"
+ ." scrolling='no' frameborder='0' style='{$fbc_options['v2ccstyle']}'"
+ ." allowTransparency='true'>
+ </iframe><a>";
+ // echo "\tcmt</a><fb:comments-count href='$postUrl'></fb:comments-count> comments<a>";
+ }
375 facebook-comments-recentcomments.php
@@ -0,0 +1,375 @@
+<?php
+
+ /**********************************
+ Dashboard recent comments widget
+ **********************************/
+ /**
+ * Display recent comments from facebook in a dashboard widget.
+ *
+ * @since 3.0.0
+ */
+ function fbcomments_dashboard_widget_function() {
+ global $fbc_options;
+
+ wp_register_style('widgets', FBCOMMENTS_CSS_WIDGETS, array(), FBCOMMENTS_VER);
+ wp_enqueue_style('widgets');
+
+ // needed for fb api call? excep 104 without it
+ fbComments_storeAccessToken();
+
+ $atoken = $fbc_options['accessToken'];
+ $fb = fbComments_getFbApi();
+
+
+ $commentsq = "SELECT fromid, text, id, time, username, xid, object_id ".
+ "FROM comment WHERE xid IN (SELECT xid FROM comments_info WHERE app_id={$fbc_options['appId']})".
+ "ORDER BY time desc";
+ $usersq = "SELECT id, name, url, pic_square FROM profile ".
+ "WHERE id IN (SELECT fromid FROM #comments)";
+
+ $query = '{
+ "comments": "' . $commentsq . '",
+ "users": "' . $usersq . '"
+ }';
+
+ $query = array("method"=>"fql.multiquery","queries"=>$query,'access_token'=>$atoken);
+ $result = $fb->api($query);
+
+ $comments = $result;
+ if (!is_array($comments)) { print_r('No&nbsp;response&nbsp;from&nbsp;facebook.com'); return; }
+ $ncomms = sizeof($comments[0]['fql_result_set']);
+ $dcomms = $ncomms < $fbc_options['dashNumComments'] ? $ncomms : $fbc_options['dashNumComments'];
+
+ if ($ncomms == 0) { echo "<div style='text-align:right; font-size:.8em'>
+ <a href='https://developers.facebook.com/tools/comments?id={$fbc_options['appId']}'>Administer Comments</a></div><hr />"
+ .'No Comments!';
+ } else {
+ // $ncomms = $ncomms < 10 ? $ncomms : 10;
+
+ $htmlout =
+ // using the old api to make calling from js easier
+ // the new graph api method is much cleaner, but it causes problems in opera
+ // since it returns a value, which opera then prompts the user to open or save
+ "<div id=\"fb-root\"></div>
+ <script>
+ window.fbAsyncInit = function() {
+ FB.init({appId: '{$fbc_options['appId']}', status: true, cookie: true, xfbml: true});
+ };
+ (function() {
+ var e = document.createElement('script'); e.async = true;
+ e.src = document.location.protocol +
+ '//connect.facebook.net/en_US/all.js';
+ document.getElementById('fb-root').appendChild(e);
+ }());
+ </script>"
+ ."<div style='text-align:right; font-size:.8em'>
+ <a href='https://developers.facebook.com/tools/comments?id={$fbc_options['appId']}'>Administer Comments</a></div><hr />"
+ // should probably change this to class so that it validates
+ .'<div id="the-comment-list" class="list:comment" style="margin-top: -1em">';
+
+ $parity = '';
+ $users = $comments[1]['fql_result_set'];
+ $comments = $comments[0]['fql_result_set'];
+ for ($i=0,$par=0;$i<$dcomms;$i++,$par++) {
+ // for people who use the same app id for more than one site,
+ // only return results unique to this xid
+ if ( strncmp($comments[$i]['xid'],$fbc_options['xid'],15) ) { $par--; continue; }
+
+ // find matching user
+ for ($j=0;$j<count($users);$j++) {
+ if ($comments[$i]['fromid'] == $users[$j]['id']) {
+ $index=$j;
+ break;
+ }
+ }
+
+ // Comment user