La til litt flere pluginger, men tror ikke vi trenger halvparten.

This commit is contained in:
Øyvind Bakkeli committed 2011-07-06 18:29:21 +02:00
1 parent a279120521
commit 12c0ea0604
139 files changed
+11787 -2

No files matched your search

@@ -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;
}
@@ -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;
}
@@ -0,0 +1,10 @@
/*****************************/
/* Hide the 'Facebook social plugin' text and icon
/*****************************/
a.uiLinkSubtle {
display: none;
}
a.UIImageBlock_ICON_Image {
display: none;
}
@@ -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;
}
@@ -0,0 +1,7 @@
/*****************************/
/* Hide the faces associated with the Like button
/*****************************/
div.connect_widget_sample_connections {
display: none;
}
@@ -0,0 +1,7 @@
/*****************************/
/* Hide the profile picture beside each comment
/*****************************/
div.wallkit_profilepic {
display: none;
}
@@ -0,0 +1,9 @@
@charset "UTF-8";
/*****************************/
/* Hide the WordPress commenting form
/*****************************/
#respond, #commentform, #addcomment, .entry-comments {
display: none;
}
@@ -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;
}
@@ -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;
}
@@ -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 -->
@@ -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;
}
?>
@@ -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);
}
?>
@@ -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);
}
}
?>
@@ -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>";
}
@@ -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 username and Link
$username = $comments[$i]['fromid'];
if ($username == '1309634065') { // if anon user
$username = '<span class="aname">$comments[$i][username]</span>';
} else {
$username = '<a target="_blank" href="https://www.facebook.com/profile.php?id='
. $username
.'">'. $users[$index]['name'] .'</a>';
}
// make pretty
$commenttext = $comments[$i]['text'];
$order = array("\r\n", "\n", "\r");
$replace = '<br />';
// Processes \r\n's first so they aren't converted twice.
$commenttext = str_replace($order, $replace, $commenttext);
// url of post/page on which comment was made
$post_id = substr($comments[$i]['xid'],20);
$commenturl = get_permalink($post_id);
// make pretty alternations
$parity = ($par&1)
? "comment byuser comment-author-admin odd alt thread-odd thread-alt depth-1 comment-item approved":
"comment byuser comment-author-admin even thread-even depth-1 comment-item approved";
$imgurl = $users[$index]['pic_square'];
// what will be written to the dashboard widget
$htmlout .=
'<div class="'.$parity.'">'.
'<img alt="" src="'.$imgurl.'" class="avatar avatar-50 photo" height="50" width="50"/>'.
'<div class="dashboard-comment-wrap">'.
'<h4 class="comment-meta"> From '.
'<cite class="comment-author"><a href="https://www.facebook.com/profile.php?id='.$comments[$i]['fromid'].'">'.$username.'</a></cite> on '.
'<a href="'.$commenturl.'">'.get_post($post_id)->post_title.'</a>
<abbr style="font-size:.8em" title="'.date('r',$comments[$i]['time']).'"> '.date('d M Y',$comments[$i]['time']).'</abbr>
<span class="approve">[Pending]</span>'.
'</h4>
<blockquote>
<p>'.$commenttext.'</p>
</blockquote>
<p class="row-actions">
<span class="trash wallkit_actionset">
<a id="deletecomm'.$i.'" href="#" class="delete vim-d vim-destructive" title="Delete this comment">
delete
</a>
</span>'.
"<script>
jQuery('#deletecomm".$i."').click(function(data) {
FB.api({
method: 'comments.remove',"
.'comment_id: "'.$comments[$i]['id'].'", '
.'xid: "'.$comments[$i]['xid'].'", '
.'access_token: "'.$atoken.'", '
."},
function(response) {
if (!response || response.error_code) {
alert('ERROR: Failed to delete comment.');
} else {
alert('Comment Deleted');
window.location.reload();
}
});
});
</script>
</p>
</div>
</div>";
}
$htmlout .= '</div>';
print_r($htmlout);
}
}
// Create the function used in the action hook
function fbcomments_add_dashboard_widgets() {
global $fbc_options;
if ($fbc_options['showDBWidget'] == true)
wp_add_dashboard_widget('dashboard_widget', 'Recent Facebook comments', 'fbcomments_dashboard_widget_function');
}
/**********************************
Page recent comments widget
**********************************/
/* add styles before wp_head is loaded
see: http://bit.ly/igYFYu
*/
function conditionally_add_scripts_and_styles($posts){
if (empty($posts)) return $posts;
// enqueue here
wp_enqueue_style('fbc_rc_widgets-style', FBCOMMENTS_CSS_WIDGETS);
return $posts;
}
/**
* Recent_Comments widget class
*
* @since 3.0.0
*/
class FBCRC_Widget extends WP_Widget {
/** constructor */
function FBCRC_Widget() {
$widget_ops = array( 'description' => __('The most recent Facebook comments.') );
parent::WP_Widget(false, $name = 'Recent Facebook Comments', $widget_ops);
}
/** @see WP_Widget::widget */
function widget($args, $instance) {
extract( $args );
$title = apply_filters('widget_title', $instance['title']);
global $fbc_options;
$atoken = $fbc_options['accessToken'];
$fb = fbComments_getFbApi();
/*
select post_id, fromid, time, text, post_fbid
from comment
where object_id
in (select comments_fbid from link_stat where url="http://developers.facebook.com/blog/post/472")'
*/
$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";
// $commurl = urlencode('');
// $commentsq = "SELECT fromid, text, id, time, username, xid, post_id, post_fbid, object_id ".
// "FROM comment ".
// "WHERE (xid IN (SELECT xid FROM comments_info WHERE app_id={$fbc_options['appId']})) ".
// "OR object_id IN (SELECT comments_fbid FROM link_stat WHERE url='$commurl') ".
// "ORDER BY time desc";
// $commentsq = "SELECT post_id, fromid, time, text, post_fbid ".
// 'FROM comment'.
// "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);
$comments = $fb->api($query);
if ( ! $number = (int) $instance['number'] )
$number = 5;
else if ( $number < 1 )
$number = 1;
$ncomms = sizeof($comments[0]['fql_result_set']);
// if no comments, display no comments; otherwise display the greater of $ncomms and $number comments
$ncomms = $ncomms == 0 ? 0 : ($ncomms < $number ? $ncomms : $number);
$output = '<ul id="fbc_rc_widget">';
$parity = '';
$users = $comments[1]['fql_result_set'];
$comments = $comments[0]['fql_result_set'];
$show_avatar = isset($instance['show_avatar']) ? $instance['show_avatar'] : true;
for ($i=0,$par=0;$i<$ncomms;$i++,$par++) {
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 meta
$username = $comments[$i]['fromid'];
if ($username == '1309634065') { // if anon user
$username = $comments[$i]['username'];
} else {
$username = '<a target="_blank" href="https://www.facebook.com/profile.php?id='.$username.'">'.$users[$index]['name'].'</a>';
}
// print user defined number of words, if there are less than this, don't trim
$commenttext = trim($comments[$i]['text'], ' ');
$nwords = count(explode(" ",$commenttext));
$dwords = $nwords <= $instance['word_count'] ? $nwords : $instance['word_count'];
if ($nwords > $dwords) {
preg_match("/^(\S+\s+){0,$dwords}/", $commenttext, $matches); // match spaces (nth space will be at end of nth word)
$commenttext = trim($matches[0]) . '[...]';
}
// print line breaks as such
$order = array("\r\n", "\n", "\r"); // Processes \r\n's first so they aren't converted twice.
$replace = '<br />';
$commenttext = str_replace($order, $replace, $commenttext);
// url of post/page on which comment was made
$post_id = substr($comments[$i]['xid'],20);
$commenturl = get_permalink($post_id);
// to allow alternating styles on comments
$parity = ($par&1) ? "odd": "even";
// display avatar only if option is checked
if ($show_avatar) {
$imgurl = $users[$index]['pic_square'];
$imgclass = '';
} else {
$imgurl = $users[$index]['pic_square'];
$imgclass = 'style="display:none"';
}
// what will be written to the widget
$output .=
'<li class="fbc_rc_comment '.$parity.'">
<div class="fbc_rc_comment-meta">
<cite class="fbc_rc_comment-author"><a href="https://www.facebook.com/profile.php?id='.$comments[$i]['fromid'].'">'.$username.'</a></cite>
<abbr class="fbc_rc_date" title="'.date('r',$comments[$i]['time']).'">'.date('d M Y',$comments[$i]['time']).'</abbr>
</div>
<img alt="" src="'.$imgurl.'" class="avatar" height="50" width="50" '.$imgclass.' />
<div class="fbc_rc_text">'.$commenttext.'</div>
<div class="fbc_rc_permalink"><a href="'.$commenturl.'"> '.get_post($post_id)->post_title.'</a></div>
</li>';
}
$output .= '</ul>';
// print everything out
echo $before_widget;
if ( $title )
echo $before_title . $title . $after_title;
echo $output;
echo $after_widget;
}
/** @see WP_Widget::update */
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['number'] = (int) $new_instance['number'];
$instance['word_count'] = (int) $new_instance['word_count'];
if ( isset($new_instance['show_avatar']) )
$instance['show_avatar'] = 1;
else
$instance['show_avatar'] = 0;
return $instance;
}
/** @see WP_Widget::form */
function form($instance) {
$instance = wp_parse_args( (array) $instance, array( 'show_avatar' => true ) );
$title = isset($instance['title']) ? esc_attr($instance['title']) : 'Recent Comments';
$number = isset($instance['number']) ? absint($instance['number']) : 5;
$word_count = isset($instance['word_count']) ? absint($instance['word_count']) : 50;
?>
<p>
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
</p>
<p>
<label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Max number of comments to show:'); ?></label>
<input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" />
</p>
<p>
<label for="<?php echo $this->get_field_id('word_count'); ?>"><?php _e('Max number of words per comment to show:'); ?></label>
<input id="<?php echo $this->get_field_id('word_count'); ?>" name="<?php echo $this->get_field_name('word_count'); ?>" type="text" value="<?php echo $word_count; ?>" size="3" />
</p>
<p>
<input class="checkbox" type="checkbox" <?php checked( $instance['show_avatar'], true ); ?> id="<?php echo $this->get_field_id( 'show_avatar' ); ?>" name="<?php echo $this->get_field_name( 'show_avatar' ); ?>" />
<label for="<?php echo $this->get_field_id( 'show_avatar' ); ?>">Check to display avatar</label>
</p>
<?php
}
} // class FBCRC_Widget
function fbComments_dashboard_widget_init() {
if (is_admin()) {
wp_enqueue_script('jquery');
}
}
?>
@@ -0,0 +1,272 @@
<?php
/*
Plugin Name: Facebook Comments for WordPress
Plugin URI: http://we8u.com/facebook-comments
Description: Allows your visitors to comment on posts using their Facebook profile. Supports custom styles, notifications, combined comment counts, etc.
Author: we8u
Version: 3.1.3
Author URI: http://we8u.com/
*/
define('FBCOMMENTS_ERRORS', false); # Set to true while developing, false for a release
define('FBCOMMENTS_VER', '3.1.3');
define('FBCOMMENTS_REQUIRED_PHP_VER', '5.0.0');
define('FBCOMMENTS_AUTHOR', 'we8u');
define('FBCOMMENTS_WEBPAGE', 'http://we8u.com/facebook-comments/');
define('FBCOMMENTS_PATH', plugins_url('facebook-comments-for-wordpress/'));
define('FBCOMMENTS_CSS_ADMIN', FBCOMMENTS_PATH . 'css/facebook-comments.css');
define('FBCOMMENTS_CSS_HIDEWPCOMMENTS', FBCOMMENTS_PATH . 'css/facebook-comments-hidewpcomments.css');
define('FBCOMMENTS_CSS_HIDEFBLINK', FBCOMMENTS_PATH . 'css/facebook-comments-hidefblink.css');
define('FBCOMMENTS_CSS_HIDELIKE', FBCOMMENTS_PATH . 'css/facebook-comments-hidelike.css');
define('FBCOMMENTS_CSS_DARKSITE', FBCOMMENTS_PATH . 'css/facebook-comments-darksite.css');
define('FBCOMMENTS_CSS_HIDELIKEANDDARKSITE', FBCOMMENTS_PATH . 'css/facebook-comments-custom.css');
define('FBCOMMENTS_CSS_WIDGETS', FBCOMMENTS_PATH . 'css/facebook-comments-widgets.css');
if (FBCOMMENTS_ERRORS) {
error_reporting(E_ALL); # Ensure all errors and warnings are verbose
}
# Include common functions
require_once 'facebook-comments-core.php';
require_once 'facebook-comments-recentcomments.php';
require_once 'facebook-comments-combinecomments.php';
require_once 'facebook-comments-display.php';
require_once 'scripts/facebook.php'; # Facebook API wrapper
wp_enqueue_script('jquery');
/**********************************
Globals
**********************************/
global $fbComments_defaults;
$fbComments_defaults = array(
'appId' => '',
'appSecret' => '',
'accessToken' => null,
'xid' => fbComments_getRandXid(),
'includeFbJs' => true,
'includeFbJsOldWay' => false,
'includeFbmlLangAttr' => true,
'includeOpenGraphLangAttr' => true,
'includeOpenGraphMeta' => true,
'includeFbComments' => true,
'hideWpComments' => false,
'combineCommentCounts' => true,
'notify' => true,
'language' => 'en_US',
'displayTitle' => true,
'title' => 'facebook comments:',
'numPosts' => 10,
'width' => 500,
'displayLocation' => 'before',
'displayPagesOrPosts' => 'posts',
'publishToWall' => true,
'reverseOrder' => false,
'hideFbLikeButton' => false,
'containerCss' => 'margin: 20px 0;',
'titleCss' => 'margin-bottom: 15px; font-size: 140%; font-weight: bold; border-bottom: 2px solid #000; padding-bottom: 5px;',
'darkSite' => '',
'noBox' => false,
'dashNumComments' => 10,
'v1plusv2' => false,
// 'newUser' => false,
'notifyUserList' => '',
'showDBWidget' => false,
'enableCache' => false,
'commentVersion' => 'new',
'fbCommentCount' => true,
'v2ccstyle' => 'border:none; overflow:hidden; width:130px; padding-left:-15px; height:12px;',
'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;'
),
'like' => array( 'layout' => 'standard',
'showFaces' => true,
'width' => 450,
'verb' => 'like',
'font' => 'arial',
'color' => 'light',
'style' => 'height: 62px; width: 100%;'
)
);
/**********************************
Activation hooks/actions
**********************************/
# make sure default settings get loaded on plugin updates
$oldver = get_option('fbComments_ver');
if (is_admin() && $oldver != FBCOMMENTS_VER) {
fbComments_doUpdate();
}
register_activation_hook(__FILE__, 'fbComments_init_hack');
register_deactivation_hook(__FILE__, 'fbComments_deactivate_hack'); # hack may not be needed here
register_uninstall_hook(__FILE__, 'fbComments_uninit_hack'); # or here
# stupid wordpress, can't call function in an included file in activation hook?
function fbComments_init_hack() { fbComments_init(); }
function fbComments_deactivate_hack() { fbComments_deactivate(); }
function fbComments_uninit_hack() { fbComments_uninit(); }
global $fbc_options; # main options array in wp database options table
$fbc_options = get_option('fbComments');
# Display a message prompting the user to enter a Facebook application ID and secret upon plugin activation (if they aren't already set)
if (get_option('fbComments_displayAppIdWarning')) {
add_action('admin_notices', create_function( '', "echo '<div class=\"error\"><p><strong>".sprintf(__('The Facebook comments box will not be included in your posts until you set a valid application ID and application secret. Please <a href="%s">set your application ID and secret now</a> using the options page.', 'facebook-comments'), admin_url('options-general.php?page=facebook-comments'))."</strong></p></div>';" ) );
# display the message only upon activation
update_option('fbComments_displayAppIdWarning', false);
}
# Enqueue correct stylesheet if user wants to hide the WordPress commenting form
if ($fbc_options['hideWpComments']) {
function fbComments_enqueueHideWpCommentsCss() {
wp_register_style('fbComments_hideWpComments', FBCOMMENTS_CSS_HIDEWPCOMMENTS, array(), FBCOMMENTS_VER);
wp_enqueue_style('fbComments_hideWpComments');
}
add_action('init', 'fbComments_enqueueHideWpCommentsCss');
}
# Add appropriate language attributes (must use get_option() because $fbc_options[] isn't available at this point)
if (($fbc_options['includeFbmlLangAttr']) || ($fbc_options['includeOpenGraphLangAttr'])) {
function fbComments_includeLangAttrs($attributes='') {
$opts = get_option('fbComments');
if ($opts['includeFbmlLangAttr']) {
$attributes .= ' xmlns:fb="http://www.facebook.com/2008/fbml"';
}
if ($opts['includeOpenGraphLangAttr']) {
$attributes .= ' xmlns:og="http://opengraphprotocol.org/schema/"';
}
return $attributes;
}
add_filter('language_attributes', 'fbComments_includeLangAttrs');
}
# Add OpenGraph meta information
if ($fbc_options['includeOpenGraphMeta']) {
function fbComments_addOpenGraphMeta() {
global $wp_query;
global $fbc_options;
$postId = $wp_query->post->ID;
$postTitle = single_post_title('', false);
$postUrl = get_permalink($postId);
$siteName = get_bloginfo('name');
$appId = $fbc_options['appId'];
if (strlen($fbc_options['notifyUserList']) > 0) { echo "<meta property='fb:admins' content='{$fbc_options['notifyUserList']}'>"; }
echo "<meta property='og:title' content='$postTitle' />",
"<meta property='og:site_name' content='$siteName' />",
"<meta property='og:url' content='$postUrl' />",
"<meta property='og:type' content='article' />",
"<meta property='fb:app_id' content='$appId'>\n";
}
add_action('wp_head', 'fbComments_addOpenGraphMeta');
}
/**********************************
Settings page
**********************************/
add_action('admin_init', 'fbComments_adminPage_init' );
add_action('admin_menu', 'fbComments_adminPage');
# Init plugin options to white list our options
function fbComments_adminPage_init() {
register_setting('fbComments_options', 'fbComments', 'fbComments_sanatize');
}
# Add settings page
function fbComments_adminPage() {
add_options_page(__('Facebook Comments for WordPress Options'), __('Facebook Comments'), 'manage_options', 'facebook-comments', 'fbComments_includeAdminPage');
}
# Draw the settings page
function fbComments_includeAdminPage() {
include('facebook-comments-admin.php');
}
# Sanitize and validate input. Accepts an array, returns a sanitized array.
function fbComments_sanatize($input) {
$input['title'] = esc_attr($input['title']);
$input['containerCss'] = esc_attr($input['containerCss']);
$input['titleCss'] = esc_attr($input['titleCss']);
$input['dashNumComments'] = absint($input['dashNumComments']);
$input['numPosts'] = absint($input['numPosts']);
$input['width'] = absint($input['width']);
return $input;
}
# add "Settings" link to plugin on plugins page
add_filter('plugin_action_links', 'fbComments_settingsLink', 0, 2);
function fbComments_settingsLink($actionLinks, $file) {
if (($file == 'facebook-comments-for-wordpress/facebook-comments.php') && function_exists('admin_url')) {
$settingsLink = '<a href="' . admin_url('options-general.php?page=facebook-comments') . '">' . __('Settings') . '</a>';
# Add 'Settings' link to plugin's action links
array_unshift($actionLinks, $settingsLink);
}
return $actionLinks;
}
# display changelog on "Plugins" page
add_action('after_plugin_row', 'display_changelog', 50, 2);
# make sure both are set to avoid fatal error upon getting fbapi
if (empty($fbc_options['appId']) || empty($fbc_options['appSecret'])) {
fbComments_log("App ID or secret not set, not loading widgets");
} else {
# hook for admin dashboard widget
add_action('init', 'fbcomments_dashboard_widget_init'); # load jquery
add_action('wp_dashboard_setup', 'fbcomments_add_dashboard_widgets');
# register FBCRC_Widget widget
add_filter('the_posts', 'conditionally_add_scripts_and_styles'); # the_posts gets triggered before wp_head
add_action('widgets_init', create_function('', 'return register_widget("FBCRC_Widget");'));
}
/**********************************
Program entry point
**********************************/
# Ensure we're able to display the comment box
if ($fbc_options['includeFbComments']) {
add_filter('comments_array', 'facebook_comments');
}
# Display like button on index
if ('top' == $fbc_options['indexLikebtn']['display'] || 'bottom' == $fbc_options['indexLikebtn']['display']) {
add_filter('the_content', 'fbc_show_like_index');
}
# Display facebook comment count instead of WordPress one
if ($fbc_options['fbCommentCount'] && $fbc_options['commentVersion'] == 'v2') {
add_filter('comments_number', 'fbc_facebook_comment_count');
# Else combine the Facebook and WordPress comment counts, if desired
} else if ($fbc_options['combineCommentCounts'] &&
!empty($fbc_options['appId']) &&
!empty($fbc_options['appSecret']) &&
$fbc_options['commentVersion'] != 'v2') { # we don't want comment caching to load if it's useless--as it is with v2
add_filter('get_comments_number', 'fbComments_combineCommentCounts');
}
?>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@@ -0,0 +1,268 @@
=== Facebook Comments for WordPress ===
Contributors: thinkswan, we8u, .shaun, AlmogBaku, sboddez
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=fbc%40we8u%2ecom&lc=US&item_name=Facebook%20Comments%20for%20WordPress&item_number=shaund&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
Tags: facebook comments, comments, facebook, social graph, posts, pages, discussion, community
Requires at least: 3.0.4
Tested up to: 3.1.1
Stable tag: 3.1.3
Allows your visitors to comment on posts using their Facebook profile. Supports custom styles, notifications, combined comment counts, recent comments widget, etc.
== Description ==
Official site (check for the latest): http://j.mp/fbc_official || Twitter: http://twitter.com/we8u
This plugin integrates the Facebook commenting system (new, old or both) right into your website.
If a reader is logged into Facebook while viewing any comment-enabled page or post,
they'll be able to leave a comment using their Facebook profile.
**Features:**
* Styles can all be customized to fit your site's theme (v1 only)
* Number of comments displayed can be adjusted
* Option to post comments directly to a user's Facebook profile page (v1 only)
* Comments can be included on pages only, posts only or both
* Comments can be shown in chronological order or with the most recent comments first (v1 only)
* Facebook comments can be attached to WordPress comments or inserted manually anywhere in your theme
* WordPress comments can be hidden on pages/posts where Facebook comments are enabled
* Comment counts on pages/posts reflect both the Facebook and WordPress comments (v1 only)
* Email notifications can be sent whenever a comment is posted
* facebook notifications can also be sent whenever a comment is posted
== Installation ==
1. Unzip `facebook-comments-for-wordpress.3.1.3.zip` to your `/wp-content/plugins/` directory
2. Activate the plugin through the `Plugins` menu in WordPress (depending on the number of posts on your site, activation may take a moment because the plugin is caching all of your comment counts)
3. Setup the plugin options by using the `Facebook Comments` page (located under the `Settings` menu)
* Note that a `Facebook application ID` is required. For details on how to get one, including a screenshot walkthrough,
check out http://we8u.com/facebook-comments/#install
* In order to keep your comments through upgrades, you **must** set a unique `XID`. This `XID` will be maintained when you
upgrade the plugin
== Frequently Asked Questions ==
If you need help, please refer to the official FAQ at http://we8u.com/facebook-comments/#faq.
== Changelog ==
= 3.1.3 =
* Feature: Dark style now available for dark sites with the v2 comment system ("v2 only" option).
* Bugfix: Fixed a bug that was causing comment caching to be slow.
= 3.1 =
`Dev Time: 33hrs`
* Important: I highly recommend using "v2 only", as it is, by far, the most feature-filled. If you have old comments, you can use "Display both v1 and v2 comments"
* Issue: If you see `Warning: http://example.com/example_post is unreachable.`, [make sure your app settings are correct](http://on.fb.me/myappsettings) (enter `http`&shy;`://example.com/` for "Site URL" and `example.com` for "Site Domain", note the lack of http or a trailing slash, this is important)
* Feature: Like button integrated into plugin. Enable on settings page. You can fully customize it there as well.
* Feature: Like button can also be added to the top or bottom of each post on the site's main page (same "like" count as the one in comments)
* Feature: Comment count for 'v2 only' comments now displayed. Customizable on plugin's settings page.
* Settings: Reorganized settings page to make clear what applies to which version of facebook comment system
* Bugfix: Users should no longer see "Fatal error: Cannot use object of type WP_Error as array in wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-admin.php on line 71"
* Bugfix: "Comments Closed" should no longer display inappropriately
* Bugfix: The 'delete' link on the dashboard recent comments widget is functional again
* Bugfix: A request to facebook that times out no longer incorrectly asserts that the application ID is incorrect
* Bugfix: No longer dies if facebook is unreachable (i.e., no more "Uncaught CurlException: 6: [...] name lookup timed out thrown on line 622")
* Bugfix: ...and no more "Uncaught CurlException: 1: [...] thrown on line 519"
* Bugfix: Activation should no longer be slow on sites with many comments
* Bugfix: Other small edge case bug fixes
= 3.0.2.2 =
`Dev Time: 18hrs`
* To see what facebook has changed/removed in v2, please read this: http://bit.ly/fbc3_changes. Briefly, gone is custom css, dark site, like button. If you want these, select "v1 only" (the default) on the settings page.
* IMPORTANT: WRITE DOWN YOUR XID BEFORE INSTALL THIS. This should be completely unnecessary, but it's just a wise precaution to take.
* Added a notice in the plugin settings which displays your XID from 2.1.2 or before.
* Now displays "Comments Disabled" if comments are disabled for a page/post
* Bugfix: Fixed a conflict with a global variable which was causing the plugin to not load on certain sites.
* Bugfix: The visual editor should work again.
* Bugfix: Those who were unable to activate the plugin should now be able to (see next option).
* Option: Ability to disable comment caching (disabled by default).
* Option: Ability to show only v2 comments. See details on option page.
= 3.0.2 =
* Updated to handle the way WP3.1 updates plugins. see: [this link](http://bit.ly/wp3_1noupdate)
= 3.0.1 =
* Bugfix: Fixed a mistake where settings (including old app ID, secret and xid) weren't being copied from previous installations.
* Feature: Added setting to hide Dashboard Recent Comments admin widget.
* See a demo of facebook's new comment system here: http://bit.ly/fknVz8
= 3.0.0 =
`Dev Time: 41hrs`
* Upgraded to use the latest method of getting facebook comments, which means, THREADED COMMENTS! Yay!
* Option: Ability to display recent facebook comments as a widget
* Option: Ability to moderate facebook comments from dashboard
* Both of which can be styled via the stylesheet located in wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-widgets.css
* Bugfix: Changed jQuery call to fix some conflicts users were having with other jQuery-using plugins (such as the fb like plugin)
* Removed dependency on cURL. Now uses wp_remote_get. (note: facebook.php still uses cURL)
* For a complete overview of changes, see http://we8u.com/fbc3
= 2.1.2 =
* Option: Ability to uncheck the **Post comment to my Facebook profile** box by default
* Bugfix: Pre-activation checks have been converted to warnings (if you receive a `Parse error` when activating, please ensure you're running PHP v5.0.0 or higher on your server)
= 2.1.1 =
* Bugfix: Replaced all `file_get_contents()` instances with cURL calls (since some web servers don't allow file fetching by URL for security reasons)
* Bugfix: Combined comment counts now work when comments are included manually (as long as the option is checked)
* The plugin now checks your PHP version (must be v5.0.0 or greater) and ensures you have the cURL extension installed before activating
= 2.1 =
* Bugfix: Removed the option to set widths as a percentage because the JavaScript was breaking the plugin for almost everyone (no more multiple inclusions)
* Bugfix: Switched from PHP's default mail() function to WordPress' built-in wp_mail() function for sending email notifications
* Bugfix: Removed JavaScript logging to ensure the plugin works in Firefox and IE again (these browsers do not have `console.log` defined unless Firebug is installed)
* Your current XID will now be emailed to you when you deactivate the plugin (this allows you to retrieve your site's comments should you ever activate the plugin again)
= 2.0 =
* Option: Send email notifications to the site admin whenever a Facebook comment is posted
* Option: Ability to load the JavaScript SDK the old way (for those of you who experienced issues with v1.6)
* Option: Ability to set the comment box width to `100%`
* Bugfix: Whitespace is now trimmed from the application ID, the application secret, all CSS styles and the XID to prevent loading issues
* Bugfix: Links on the plugin settings page have been updated to point to the correct information on the website now
* Bugfix: Cleaned up various parts of the code (no more PHP notices)
* Comment counts are now cached (no more slow load times on the main page). Depending on the number of posts you have on your site, it may take a few moments to activate the plugin because it retrieves the Facebook comment count for every post during activation for caching
* Added both PHP and JavaScript error logging to make troubleshooting easier
* Both a Facebook application ID **and** an application secret are required for the plugin to work now
= 1.6 =
* Comment inclusion code is now far more lightweight
* Facebook and WordPress comments are now counted together
= 1.5.2 =
* Bugfix: WordPress commenting form should now be properly hidden for most themes
* Bugfix: `type` attribute is now set in the script inclusion (so older browsers will render it properly)
= 1.5.1 =
* Bugfix: Fixes the bug where hiding the WordPress comments caused errors in `foreach()` loops on certain themes
* Moved all stylesheets to `css/` folder and all images to `images/` folder for better organization
= 1.5 =
* Option: WordPress comments can be hidden on pages/posts where Facebook comments are enabled
* Option: Like button can be hidden
* Option: `Facebook Social Plugins` text and icon is hidden
* Option: Custom stylesheet for darker websites can be included (as a result, ability to reference your own custom stylesheet was removed)
* Bugfix: Comments now render properly in Internet Explorer (due to `FBML` reference)
* Added `title` and `url` attributes to the `<fb:comments>` tag so the Like button links to the correct page when clicked
* Facebook comments can now be linked to by appending `#facebook-comments` to the end of a post/page's URL
* Support for 100+ languages is now available (including Arabic, Hebrew, Spanish and all other requested languages)
= 1.4.1 =
* Bugfix: WordPress comments are no longer hidden when the Pages only or Posts only options are selected
= 1.4 =
* Option: Include comments on pages only, posts only or both
* Tested and works properly with WordPress 3.0
= 1.3 =
* Bugfix: Settings/XID are no longer lost when upgrading
* Bugfix: Anonymous posting now works properly
* Option: Allow user to hide the `Facebook comments:` title
* Added `Settings` link to plugin's action links on the `Plugins` page
* Redesigned settings page
* Refactored code to prepare for next release
= 1.2 =
* Bugfix: Facebook comments will be hidden on posts on which WordPress comments are disabled
* Bugfix: Facebook comments are retained through upgrades (you **must** set a XID to keep your comments)
* Feature: add Facebook comments anywhere in your theme by manually inserting `<?php if (function_exists('facebook_comments')) facebook_comments(); ?>` where you'd like them to show up
* Option: Change `Facebook comments:` title to anything you want
* Option: Allow user to reverse the order of the Facebook comments so they're in chronological order (like WordPress comments)
* Option: Allow removal of the grey box behind the composer
* Option: Allow use of external stylesheet to alter the appearance of the Facebook comments section
* Option: Receive Facebook notifications whenever someone posts a comment
* Option: Uncheck `Post comment to my Facebook profile` box by default
* Assorted code maintenance
= 1.1 =
* Fixed bug: Plugin's settings are no longer reset/removed when activating/deactivating other plugins
* New option: Ability to hide the Facebook comments box without having to deactivate the plugin (in case you want to keep
your settings)
* Minor style changes
= 1.0 =
* Initial release
== Upgrade Notice ==
= 3.1.3 =
Option to change style for dark sites for v2 users. Fixed issue causing plugin to be slow/crash for some people.
= 3.1 =
`{33hrs}` See http://j.mp/fbc-3_1. Lots of stuff. You're gonna want this update. Integrated like button, v2 comment count, bugfixes. Upgrade. No, really, do it.
= 3.0.2.2 =
* Upgrade, then pray...
* If you're using any 3.0.x version, this update resolves most issues with those versions.
* Multisite users, this may or may not work for you. If you have it installed on a WP MS site, drop me a line at fbc-multisite@we8u.com, if it's working, or even if it isn't.
* If you have used 2.1.2 or earlier on your site, then the XID from that version will display as a notice on the settings page (wp-admin/options-general.php?page=facebook-comments). This is just a precaution, everything should load automatically
* See changelog for more.
= 3.0.2 =
This update does the same thing as deactivating then reactivating 3.0.1. The reason for this update is that WP3.1 changed the way plugins update. see: http://bit.ly/wp3_1noupdate
= 3.0.1 =
This update will bring back your xid and fix any other problems you may have had with settings when upgrading to 3.0.0. Sorry for the trouble.
= 3.0.0 =
This update adds a few bug fixes and enhancements, as well as the option to use facebook's new comment system, which enables threading and many other features. Also included in this update are recent comment widgets and the ability to moderate comments on the Dashboard. Note, facebook's new v2 comments are somewhat buggy, see: http://we8u.com/fbc3
= 2.1.2 =
This update adds an option to uncheck the Post comment to my Facebook profile box by default, as well as changing the pre-activation checks to notices to fix the activation issues some people were having. (If you receive a Parse error when activating, please ensure you're running PHP v5.0.0 or higher on your server.)
= 2.1.1 =
This update replaces all file_get_contents() instances with cURL calls. This should bring the plugin back to a healthy state for everyone who doesn't have file fetching by URL enabled on their web server (which was a surprising number of people). Combined comment counts now work when the comments are included manually as well.
= 2.1 =
This update fixes a bug that caused the plugin to break in Firefox, as well as a bug that caused the comments to be included multiple times on some themes. It also removes the width as a percentage feature because it crippled the plugin for nearly everyone.
= 2.0 =
This update introduces both comment count caching (no more slow load times on the main page) and email notifications whenever a Facebook comment is posted. It also includes an option to load the JavaScript SDK the old way (for those of you who experienced issues with v1.6) and an option to set the comment box width to 100%.
= 1.6 =
This update introduces the highly-anticipated combined comment counts feature.
= 1.5.2 =
This update fixes a bug where the WordPress commenting form couldn't be hidden.
= 1.5.1 =
This update fixes a bug where hiding the WordPress comments caused errors with `foreach()` loops.
= 1.5 =
This update provides options to hide the Like button and to hide the WordPress comments section on pages/posts
where Facebook comments are enabled. The comments also render properly in Internet Explorer now.
= 1.4.1 =
This update provides a simple bugfix where WordPress comments were being hidden if the Pages only or Posts only
option was selected.
= 1.4 =
This update ensures compatibility with WordPress 3.0, and also provides an option to include the comments on pages
only, posts only or both.
= 1.3 =
This update adds the option to remove the `Facebook comments:` title, fixes a bug where settings are lost, allows
anonymous posting and provides a brand new configuration page.
= 1.2 =
This update fixes a bug where the Facebook comments are not consistent across upgrades. Also provides new options.
= 1.1 =
This update fixes a critical bug where the plugin's settings are reset or removed every time any other plugin is
activated/deactivated. Also provides new options.
== Known Issues ==
For a short list of known issues, please refer to the official website at http://we8u.com/facebook-comments/#issues.
== Upcoming Features ==
For a list of upcoming features, please refer to the official website at http://we8u.com/facebook-comments/#upcoming.
== Screenshots ==
1. The Facebook commenting box, complete with comments.
2. Anonymous posting for users without a Facebook account.
3. Using a custom stylesheet.
4. The plugin settings page.
5. Recent Comments widget
6. Recent Comments widget settings
7. Dashboard recent comments
Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

@@ -0,0 +1,968 @@
<?php
if (!function_exists('curl_init')) {
throw new Exception('Facebook needs the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
throw new Exception('Facebook needs the JSON PHP extension.');
}
/**
* Thrown when an API call returns an exception.
*
* @author Naitik Shah <naitik@facebook.com>
*/
class FacebookApiException extends Exception
{
/**
* The result from the API server that represents the exception information.
*/
protected $result;
/**
* Make a new API Exception with the given result.
*
* @param Array $result the result from the API server
*/
public function __construct($result) {
$this->result = $result;
$code = isset($result['error_code']) ? $result['error_code'] : 0;
if (isset($result['error_description'])) {
// OAuth 2.0 Draft 10 style
$msg = $result['error_description'];
} else if (isset($result['error']) && is_array($result['error'])) {
// OAuth 2.0 Draft 00 style
$msg = $result['error']['message'];
} else if (isset($result['error_msg'])) {
// Rest server style
$msg = $result['error_msg'];
} else {
$msg = 'Unknown Error. Check getResult()';
}
parent::__construct($msg, $code);
}
/**
* Return the associated result object returned by the API server.
*
* @returns Array the result from the API server
*/
public function getResult() {
return $this->result;
}
/**
* Returns the associated type for the error. This will default to
* 'Exception' when a type is not available.
*
* @return String
*/
public function getType() {
if (isset($this->result['error'])) {
$error = $this->result['error'];
if (is_string($error)) {
// OAuth 2.0 Draft 10 style
return $error;
} else if (is_array($error)) {
// OAuth 2.0 Draft 00 style
if (isset($error['type'])) {
return $error['type'];
}
}
}
return 'Exception';
}
/**
* To make debugging easier.
*
* @returns String the string representation of the error
*/
public function __toString() {
$str = $this->getType() . ': ';
if ($this->code != 0) {
$str .= $this->code . ': ';
}
return $str . $this->message;
}
}
/**
* Provides access to the Facebook Platform.
*
* @author Naitik Shah <naitik@facebook.com>
*/
class Facebook
{
/**
* Version.
*/
const VERSION = '2.1.2';
/**
* Default options for curl.
*/
public static $CURL_OPTS = array(
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_USERAGENT => 'facebook-php-2.0',
);
/**
* List of query parameters that get automatically dropped when rebuilding
* the current URL.
*/
protected static $DROP_QUERY_PARAMS = array(
'session',
'signed_request',
);
/**
* Maps aliases to Facebook domains.
*/
public static $DOMAIN_MAP = array(
'api' => 'https://api.facebook.com/',
'api_read' => 'https://api-read.facebook.com/',
'graph' => 'https://graph.facebook.com/',
'www' => 'https://www.facebook.com/',
);
/**
* The Application ID.
*/
protected $appId;
/**
* The Application API Secret.
*/
protected $apiSecret;
/**
* The active user session, if one is available.
*/
protected $session;
/**
* The data from the signed_request token.
*/
protected $signedRequest;
/**
* Indicates that we already loaded the session as best as we could.
*/
protected $sessionLoaded = false;
/**
* Indicates if Cookie support should be enabled.
*/
protected $cookieSupport = false;
/**
* Base domain for the Cookie.
*/
protected $baseDomain = '';
/**
* Indicates if the CURL based @ syntax for file uploads is enabled.
*/
protected $fileUploadSupport = false;
/**
* Initialize a Facebook Application.
*
* The configuration:
* - appId: the application ID
* - secret: the application secret
* - cookie: (optional) boolean true to enable cookie support
* - domain: (optional) domain for the cookie
* - fileUpload: (optional) boolean indicating if file uploads are enabled
*
* @param Array $config the application configuration
*/
public function __construct($config) {
$this->setAppId($config['appId']);
$this->setApiSecret($config['secret']);
if (isset($config['cookie'])) {
$this->setCookieSupport($config['cookie']);
}
if (isset($config['domain'])) {
$this->setBaseDomain($config['domain']);
}
if (isset($config['fileUpload'])) {
$this->setFileUploadSupport($config['fileUpload']);
}
}
/**
* Set the Application ID.
*
* @param String $appId the Application ID
*/
public function setAppId($appId) {
$this->appId = $appId;
return $this;
}
/**
* Get the Application ID.
*
* @return String the Application ID
*/
public function getAppId() {
return $this->appId;
}
/**
* Set the API Secret.
*
* @param String $appId the API Secret
*/
public function setApiSecret($apiSecret) {
$this->apiSecret = $apiSecret;
return $this;
}
/**
* Get the API Secret.
*
* @return String the API Secret
*/
public function getApiSecret() {
return $this->apiSecret;
}
/**
* Set the Cookie Support status.
*
* @param Boolean $cookieSupport the Cookie Support status
*/
public function setCookieSupport($cookieSupport) {
$this->cookieSupport = $cookieSupport;
return $this;
}
/**
* Get the Cookie Support status.
*
* @return Boolean the Cookie Support status
*/
public function useCookieSupport() {
return $this->cookieSupport;
}
/**
* Set the base domain for the Cookie.
*
* @param String $domain the base domain
*/
public function setBaseDomain($domain) {
$this->baseDomain = $domain;
return $this;
}
/**
* Get the base domain for the Cookie.
*
* @return String the base domain
*/
public function getBaseDomain() {
return $this->baseDomain;
}
/**
* Set the file upload support status.
*
* @param String $domain the base domain
*/
public function setFileUploadSupport($fileUploadSupport) {
$this->fileUploadSupport = $fileUploadSupport;
return $this;
}
/**
* Get the file upload support status.
*
* @return String the base domain
*/
public function useFileUploadSupport() {
return $this->fileUploadSupport;
}
/**
* Get the data from a signed_request token
*
* @return String the base domain
*/
public function getSignedRequest() {
if (!$this->signedRequest) {
if (isset($_REQUEST['signed_request'])) {
$this->signedRequest = $this->parseSignedRequest(
$_REQUEST['signed_request']);
}
}
return $this->signedRequest;
}
/**
* Set the Session.
*
* @param Array $session the session
* @param Boolean $write_cookie indicate if a cookie should be written. this
* value is ignored if cookie support has been disabled.
*/
public function setSession($session=null, $write_cookie=true) {
$session = $this->validateSessionObject($session);
$this->sessionLoaded = true;
$this->session = $session;
if ($write_cookie) {
$this->setCookieFromSession($session);
}
return $this;
}
/**
* Get the session object. This will automatically look for a signed session
* sent via the signed_request, Cookie or Query Parameters if needed.
*
* @return Array the session
*/
public function getSession() {
if (!$this->sessionLoaded) {
$session = null;
$write_cookie = true;
// try loading session from signed_request in $_REQUEST
$signedRequest = $this->getSignedRequest();
if ($signedRequest) {
// sig is good, use the signedRequest
$session = $this->createSessionFromSignedRequest($signedRequest);
}
// try loading session from $_REQUEST
if (!$session && isset($_REQUEST['session'])) {
$session = json_decode(
get_magic_quotes_gpc()
? stripslashes($_REQUEST['session'])
: $_REQUEST['session'],
true
);
$session = $this->validateSessionObject($session);
}
// try loading session from cookie if necessary
if (!$session && $this->useCookieSupport()) {
$cookieName = $this->getSessionCookieName();
if (isset($_COOKIE[$cookieName])) {
$session = array();
parse_str(trim(
get_magic_quotes_gpc()
? stripslashes($_COOKIE[$cookieName])
: $_COOKIE[$cookieName],
'"'
), $session);
$session = $this->validateSessionObject($session);
// write only if we need to delete a invalid session cookie
$write_cookie = empty($session);
}
}
$this->setSession($session, $write_cookie);
}
return $this->session;
}
/**
* Get the UID from the session.
*
* @return String the UID if available
*/
public function getUser() {
$session = $this->getSession();
return $session ? $session['uid'] : null;
}
/**
* Gets a OAuth access token.
*
* @return String the access token
*/
public function getAccessToken() {
$session = $this->getSession();
// either user session signed, or app signed
if ($session) {
return $session['access_token'];
} else {
return $this->getAppId() .'|'. $this->getApiSecret();
}
}
/**
* Get a Login URL for use with redirects. By default, full page redirect is
* assumed. If you are using the generated URL with a window.open() call in
* JavaScript, you can pass in display=popup as part of the $params.
*
* The parameters:
* - next: the url to go to after a successful login
* - cancel_url: the url to go to after the user cancels
* - req_perms: comma separated list of requested extended perms
* - display: can be "page" (default, full page) or "popup"
*
* @param Array $params provide custom parameters
* @return String the URL for the login flow
*/
public function getLoginUrl($params=array()) {
$currentUrl = $this->getCurrentUrl();
return $this->getUrl(
'www',
'login.php',
array_merge(array(
'api_key' => $this->getAppId(),
'cancel_url' => $currentUrl,
'display' => 'page',
'fbconnect' => 1,
'next' => $currentUrl,
'return_session' => 1,
'session_version' => 3,
'v' => '1.0',
), $params)
);
}
/**
* Get a Logout URL suitable for use with redirects.
*
* The parameters:
* - next: the url to go to after a successful logout
*
* @param Array $params provide custom parameters
* @return String the URL for the logout flow
*/
public function getLogoutUrl($params=array()) {
return $this->getUrl(
'www',
'logout.php',
array_merge(array(
'next' => $this->getCurrentUrl(),
'access_token' => $this->getAccessToken(),
), $params)
);
}
/**
* Get a login status URL to fetch the status from facebook.
*
* The parameters:
* - ok_session: the URL to go to if a session is found
* - no_session: the URL to go to if the user is not connected
* - no_user: the URL to go to if the user is not signed into facebook
*
* @param Array $params provide custom parameters
* @return String the URL for the logout flow
*/
public function getLoginStatusUrl($params=array()) {
return $this->getUrl(
'www',
'extern/login_status.php',
array_merge(array(
'api_key' => $this->getAppId(),
'no_session' => $this->getCurrentUrl(),
'no_user' => $this->getCurrentUrl(),
'ok_session' => $this->getCurrentUrl(),
'session_version' => 3,
), $params)
);
}
/**
* Make an API call.
*
* @param Array $params the API call parameters
* @return the decoded response
*/
public function api(/* polymorphic */) {
$args = func_get_args();
if (is_array($args[0])) {
try { return $this->_restserver($args[0]); }
catch (Exception $e) {
self::errorLog("$e");
return 'Request to facebook timed out';
}
} else {
return call_user_func_array(array($this, '_graph'), $args);
}
}
/**
* Invoke the old restserver.php endpoint.
*
* @param Array $params method call object
* @return the decoded response object
* @throws FacebookApiException
*/
protected function _restserver($params) {
// generic application level parameters
$params['api_key'] = $this->getAppId();
$params['format'] = 'json-strings';
$result = json_decode($this->_oauthRequest(
$this->getApiUrl($params['method']),
$params
), true);
// results are returned, errors are thrown
if (is_array($result) && isset($result['error_code'])) {
throw new FacebookApiException($result);
}
return $result;
}
/**
* Invoke the Graph API.
*
* @param String $path the path (required)
* @param String $method the http method (default 'GET')
* @param Array $params the query/post data
* @return the decoded response object
* @throws FacebookApiException
*/
protected function _graph($path, $method='GET', $params=array()) {
if (is_array($method) && empty($params)) {
$params = $method;
$method = 'GET';
}
$params['method'] = $method; // method override as we always do a POST
$result = json_decode($this->_oauthRequest(
$this->getUrl('graph', $path),
$params
), true);
// results are returned, errors are thrown
if (is_array($result) && isset($result['error'])) {
$e = new FacebookApiException($result);
switch ($e->getType()) {
// OAuth 2.0 Draft 00 style
case 'OAuthException':
// OAuth 2.0 Draft 10 style
case 'invalid_token':
$this->setSession(null);
}
throw $e;
}
return $result;
}
/**
* Make a OAuth Request
*
* @param String $path the path (required)
* @param Array $params the query/post data
* @return the decoded response object
* @throws FacebookApiException
*/
protected function _oauthRequest($url, $params) {
if (!isset($params['access_token'])) {
$params['access_token'] = $this->getAccessToken();
}
// json_encode all params values that are not strings
foreach ($params as $key => $value) {
if (!is_string($value)) {
$params[$key] = json_encode($value);
}
}
return $this->makeRequest($url, $params);
}
/**
* Makes an HTTP request. This method can be overriden by subclasses if
* developers want to do fancier things or use something other than curl to
* make the request.
*
* @param String $url the URL to make the request to
* @param Array $params the parameters to use for the POST body
* @param CurlHandler $ch optional initialized curl handle
* @return String the response text
*/
protected function makeRequest($url, $params, $ch=null) {
if (!$ch) {
$ch = curl_init();
}
$opts = self::$CURL_OPTS;
if ($this->useFileUploadSupport()) {
$opts[CURLOPT_POSTFIELDS] = $params;
} else {
$opts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&');
}
$opts[CURLOPT_URL] = $url;
// disable the 'Expect: 100-continue' behaviour. This causes CURL to wait
// for 2 seconds if the server does not support this header.
if (isset($opts[CURLOPT_HTTPHEADER])) {
$existing_headers = $opts[CURLOPT_HTTPHEADER];
$existing_headers[] = 'Expect:';
$opts[CURLOPT_HTTPHEADER] = $existing_headers;
} else {
$opts[CURLOPT_HTTPHEADER] = array('Expect:');
}
curl_setopt_array($ch, $opts);
$result = curl_exec($ch);
if (curl_errno($ch) == 60) { // CURLE_SSL_CACERT
// self::errorLog('Invalid or no certificate authority found, using bundled information');
curl_setopt($ch, CURLOPT_CAINFO,
dirname(__FILE__) . '/fb_ca_chain_bundle.crt');
$result = curl_exec($ch);
}
if ($result === false) {
$e = new FacebookApiException(array(
'error_code' => curl_errno($ch),
'error' => array(
'message' => curl_error($ch),
'type' => 'CurlException',
),
));
curl_close($ch);
self::errorLog("$e");
return 'Request to facebook timed out';
}
curl_close($ch);
return $result;
}
/**
* The name of the Cookie that contains the session.
*
* @return String the cookie name
*/
protected function getSessionCookieName() {
return 'fbs_' . $this->getAppId();
}
/**
* Set a JS Cookie based on the _passed in_ session. It does not use the
* currently stored session -- you need to explicitly pass it in.
*
* @param Array $session the session to use for setting the cookie
*/
protected function setCookieFromSession($session=null) {
if (!$this->useCookieSupport()) {
return;
}
$cookieName = $this->getSessionCookieName();
$value = 'deleted';
$expires = time() - 3600;
$domain = $this->getBaseDomain();
if ($session) {
$value = '"' . http_build_query($session, null, '&') . '"';
if (isset($session['base_domain'])) {
$domain = $session['base_domain'];
}
$expires = $session['expires'];
}
// prepend dot if a domain is found
if ($domain) {
$domain = '.' . $domain;
}
// if an existing cookie is not set, we dont need to delete it
if ($value == 'deleted' && empty($_COOKIE[$cookieName])) {
return;
}
if (headers_sent()) {
self::errorLog('Could not set cookie. Headers already sent.');
// ignore for code coverage as we will never be able to setcookie in a CLI
// environment
// @codeCoverageIgnoreStart
} else {
setcookie($cookieName, $value, $expires, '/', $domain);
}
// @codeCoverageIgnoreEnd
}
/**
* Validates a session_version=3 style session object.
*
* @param Array $session the session object
* @return Array the session object if it validates, null otherwise
*/
protected function validateSessionObject($session) {
// make sure some essential fields exist
if (is_array($session) &&
isset($session['uid']) &&
isset($session['access_token']) &&
isset($session['sig'])) {
// validate the signature
$session_without_sig = $session;
unset($session_without_sig['sig']);
$expected_sig = self::generateSignature(
$session_without_sig,
$this->getApiSecret()
);
if ($session['sig'] != $expected_sig) {
self::errorLog('Got invalid session signature in cookie.');
$session = null;
}
// check expiry time
} else {
$session = null;
}
return $session;
}
/**
* Returns something that looks like our JS session object from the
* signed token's data
*
* TODO: Nuke this once the login flow uses OAuth2
*
* @param Array the output of getSignedRequest
* @return Array Something that will work as a session
*/
protected function createSessionFromSignedRequest($data) {
if (!isset($data['oauth_token'])) {
return null;
}
$session = array(
'uid' => $data['user_id'],
'access_token' => $data['oauth_token'],
'expires' => $data['expires'],
);
// put a real sig, so that validateSignature works
$session['sig'] = self::generateSignature(
$session,
$this->getApiSecret()
);
return $session;
}
/**
* Parses a signed_request and validates the signature.
* Then saves it in $this->signed_data
*
* @param String A signed token
* @param Boolean Should we remove the parts of the payload that
* are used by the algorithm?
* @return Array the payload inside it or null if the sig is wrong
*/
protected function parseSignedRequest($signed_request) {
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
// decode the data
$sig = self::base64UrlDecode($encoded_sig);
$data = json_decode(self::base64UrlDecode($payload), true);
if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {
self::errorLog('Unknown algorithm. Expected HMAC-SHA256');
return null;
}
// check sig
$expected_sig = hash_hmac('sha256', $payload,
$this->getApiSecret(), $raw = true);
if ($sig !== $expected_sig) {
self::errorLog('Bad Signed JSON signature!');
return null;
}
return $data;
}
/**
* Build the URL for api given parameters.
*
* @param $method String the method name.
* @return String the URL for the given parameters
*/
protected function getApiUrl($method) {
static $READ_ONLY_CALLS =
array('admin.getallocation' => 1,
'admin.getappproperties' => 1,
'admin.getbannedusers' => 1,
'admin.getlivestreamvialink' => 1,
'admin.getmetrics' => 1,
'admin.getrestrictioninfo' => 1,
'application.getpublicinfo' => 1,
'auth.getapppublickey' => 1,
'auth.getsession' => 1,
'auth.getsignedpublicsessiondata' => 1,
'comments.get' => 1,
'connect.getunconnectedfriendscount' => 1,
'dashboard.getactivity' => 1,
'dashboard.getcount' => 1,
'dashboard.getglobalnews' => 1,
'dashboard.getnews' => 1,
'dashboard.multigetcount' => 1,
'dashboard.multigetnews' => 1,
'data.getcookies' => 1,
'events.get' => 1,
'events.getmembers' => 1,
'fbml.getcustomtags' => 1,
'feed.getappfriendstories' => 1,
'feed.getregisteredtemplatebundlebyid' => 1,
'feed.getregisteredtemplatebundles' => 1,
'fql.multiquery' => 1,
'fql.query' => 1,
'friends.arefriends' => 1,
'friends.get' => 1,
'friends.getappusers' => 1,
'friends.getlists' => 1,
'friends.getmutualfriends' => 1,
'gifts.get' => 1,
'groups.get' => 1,
'groups.getmembers' => 1,
'intl.gettranslations' => 1,
'links.get' => 1,
'notes.get' => 1,
'notifications.get' => 1,
'pages.getinfo' => 1,
'pages.isadmin' => 1,
'pages.isappadded' => 1,
'pages.isfan' => 1,
'permissions.checkavailableapiaccess' => 1,
'permissions.checkgrantedapiaccess' => 1,
'photos.get' => 1,
'photos.getalbums' => 1,
'photos.gettags' => 1,
'profile.getinfo' => 1,
'profile.getinfooptions' => 1,
'stream.get' => 1,
'stream.getcomments' => 1,
'stream.getfilters' => 1,
'users.getinfo' => 1,
'users.getloggedinuser' => 1,
'users.getstandardinfo' => 1,
'users.hasapppermission' => 1,
'users.isappuser' => 1,
'users.isverified' => 1,
'video.getuploadlimits' => 1);
$name = 'api';
if (isset($READ_ONLY_CALLS[strtolower($method)])) {
$name = 'api_read';
}
return self::getUrl($name, 'restserver.php');
}
/**
* Build the URL for given domain alias, path and parameters.
*
* @param $name String the name of the domain
* @param $path String optional path (without a leading slash)
* @param $params Array optional query parameters
* @return String the URL for the given parameters
*/
protected function getUrl($name, $path='', $params=array()) {
$url = self::$DOMAIN_MAP[$name];
if ($path) {
if ($path[0] === '/') {
$path = substr($path, 1);
}
$url .= $path;
}
if ($params) {
$url .= '?' . http_build_query($params, null, '&');
}
return $url;
}
/**
* Returns the Current URL, stripping it of known FB parameters that should
* not persist.
*
* @return String the current URL
*/
protected function getCurrentUrl() {
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'
? 'https://'
: 'http://';
$currentUrl = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$parts = parse_url($currentUrl);
// drop known fb params
$query = '';
if (!empty($parts['query'])) {
$params = array();
parse_str($parts['query'], $params);
foreach(self::$DROP_QUERY_PARAMS as $key) {
unset($params[$key]);
}
if (!empty($params)) {
$query = '?' . http_build_query($params, null, '&');
}
}
// use port if non default
$port =
isset($parts['port']) &&
(($protocol === 'http://' && $parts['port'] !== 80) ||
($protocol === 'https://' && $parts['port'] !== 443))
? ':' . $parts['port'] : '';
// rebuild
return $protocol . $parts['host'] . $port . $parts['path'] . $query;
}
/**
* Generate a signature for the given params and secret.
*
* @param Array $params the parameters to sign
* @param String $secret the secret to sign with
* @return String the generated signature
*/
protected static function generateSignature($params, $secret) {
// work with sorted data
ksort($params);
// generate the base string
$base_string = '';
foreach($params as $key => $value) {
$base_string .= $key . '=' . $value;
}
$base_string .= $secret;
return md5($base_string);
}
/**
* Prints to the error log if you aren't in command line mode.
*
* @param String log message
*/
protected static function errorLog($msg) {
// disable error log if we are running in a CLI environment
// @codeCoverageIgnoreStart
if (php_sapi_name() != 'cli') {
error_log($msg);
}
// uncomment this if you want to see the errors on the page
// print 'error_log: '.$msg."\n";
// @codeCoverageIgnoreEnd
}
/**
* Base64 encoding that doesn't need to be urlencode()ed.
* Exactly the same as base64_encode except it uses
* - instead of +
* _ instead of /
*
* @param String base64UrlEncodeded string
*/
protected static function base64UrlDecode($input) {
return base64_decode(strtr($input, '-_', '+/'));
}
}
@@ -0,0 +1,124 @@
<!-- saved from url=(0073)https://github.com/facebook/php-sdk/raw/master/src/fb_ca_chain_bundle.crt -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">-----BEGIN CERTIFICATE-----
MIIFgjCCBGqgAwIBAgIQDKKbZcnESGaLDuEaVk6fQjANBgkqhkiG9w0BAQUFADBm
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSUwIwYDVQQDExxEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
ZSBDQS0zMB4XDTEwMDExMzAwMDAwMFoXDTEzMDQxMTIzNTk1OVowaDELMAkGA1UE
BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExEjAQBgNVBAcTCVBhbG8gQWx0bzEX
MBUGA1UEChMORmFjZWJvb2ssIEluYy4xFzAVBgNVBAMUDiouZmFjZWJvb2suY29t
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9rzj7QIuLM3sdHu1HcI1VcR3g
b5FExKNV646agxSle1aQ/sJev1mh/u91ynwqd2BQmM0brZ1Hc3QrfYyAaiGGgEkp
xbhezyfeYhAyO0TKAYxPnm2cTjB5HICzk6xEIwFbA7SBJ2fSyW1CFhYZyo3tIBjj
19VjKyBfpRaPkzLmRwIDAQABo4ICrDCCAqgwHwYDVR0jBBgwFoAUUOpzidsp+xCP
nuUBINTeeZlIg/cwHQYDVR0OBBYEFPp+tsFBozkjrHlEnZ9J4cFj2eM0MA4GA1Ud
DwEB/wQEAwIFoDAMBgNVHRMBAf8EAjAAMF8GA1UdHwRYMFYwKaAnoCWGI2h0dHA6
Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9jYTMtZmIuY3JsMCmgJ6AlhiNodHRwOi8vY3Js
NC5kaWdpY2VydC5jb20vY2EzLWZiLmNybDCCAcYGA1UdIASCAb0wggG5MIIBtQYL
YIZIAYb9bAEDAAEwggGkMDoGCCsGAQUFBwIBFi5odHRwOi8vd3d3LmRpZ2ljZXJ0
LmNvbS9zc2wtY3BzLXJlcG9zaXRvcnkuaHRtMIIBZAYIKwYBBQUHAgIwggFWHoIB
UgBBAG4AeQAgAHUAcwBlACAAbwBmACAAdABoAGkAcwAgAEMAZQByAHQAaQBmAGkA
YwBhAHQAZQAgAGMAbwBuAHMAdABpAHQAdQB0AGUAcwAgAGEAYwBjAGUAcAB0AGEA
bgBjAGUAIABvAGYAIAB0AGgAZQAgAEQAaQBnAGkAQwBlAHIAdAAgAEMAUAAvAEMA
UABTACAAYQBuAGQAIAB0AGgAZQAgAFIAZQBsAHkAaQBuAGcAIABQAGEAcgB0AHkA
IABBAGcAcgBlAGUAbQBlAG4AdAAgAHcAaABpAGMAaAAgAGwAaQBtAGkAdAAgAGwA
aQBhAGIAaQBsAGkAdAB5ACAAYQBuAGQAIABhAHIAZQAgAGkAbgBjAG8AcgBwAG8A
cgBhAHQAZQBkACAAaABlAHIAZQBpAG4AIABiAHkAIAByAGUAZgBlAHIAZQBuAGMA
ZQAuMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjANBgkqhkiG9w0BAQUF
AAOCAQEACOkTIdxMy11+CKrbGNLBSg5xHaTvu/v1wbyn3dO/mf68pPfJnX6ShPYy
4XM4Vk0x4uaFaU4wAGke+nCKGi5dyg0Esg7nemLNKEJaFAJZ9enxZm334lSCeARy
wlDtxULGOFRyGIZZPmbV2eNq5xdU/g3IuBEhL722mTpAye9FU/J8Wsnw54/gANyO
Gzkewigua8ip8Lbs9Cht399yAfbfhUP1DrAm/xEcnHrzPr3cdCtOyJaM6SRPpRqH
ITK5Nc06tat9lXVosSinT3KqydzxBYua9gCFFiR3x3DgZfvXkC6KDdUlDrNcJUub
a1BHnLLP4mxTHL6faAXYd05IxNn/IA==
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIGVTCCBT2gAwIBAgIQCFH5WYFBRcq94CTiEsnCDjANBgkqhkiG9w0BAQUFADBs
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
ZSBFViBSb290IENBMB4XDTA3MDQwMzAwMDAwMFoXDTIyMDQwMzAwMDAwMFowZjEL
MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
LmRpZ2ljZXJ0LmNvbTElMCMGA1UEAxMcRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
Q0EtMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9hCikQH17+NDdR
CPge+yLtYb4LDXBMUGMmdRW5QYiXtvCgFbsIYOBC6AUpEIc2iihlqO8xB3RtNpcv
KEZmBMcqeSZ6mdWOw21PoF6tvD2Rwll7XjZswFPPAAgyPhBkWBATaccM7pxCUQD5
BUTuJM56H+2MEb0SqPMV9Bx6MWkBG6fmXcCabH4JnudSREoQOiPkm7YDr6ictFuf
1EutkozOtREqqjcYjbTCuNhcBoz4/yO9NV7UfD5+gw6RlgWYw7If48hl66l7XaAs
zPw82W3tzPpLQ4zJ1LilYRyyQLYoEt+5+F/+07LJ7z20Hkt8HEyZNp496+ynaF4d
32duXvsCAwEAAaOCAvcwggLzMA4GA1UdDwEB/wQEAwIBhjCCAcYGA1UdIASCAb0w
ggG5MIIBtQYLYIZIAYb9bAEDAAIwggGkMDoGCCsGAQUFBwIBFi5odHRwOi8vd3d3
LmRpZ2ljZXJ0LmNvbS9zc2wtY3BzLXJlcG9zaXRvcnkuaHRtMIIBZAYIKwYBBQUH
AgIwggFWHoIBUgBBAG4AeQAgAHUAcwBlACAAbwBmACAAdABoAGkAcwAgAEMAZQBy
AHQAaQBmAGkAYwBhAHQAZQAgAGMAbwBuAHMAdABpAHQAdQB0AGUAcwAgAGEAYwBj
AGUAcAB0AGEAbgBjAGUAIABvAGYAIAB0AGgAZQAgAEQAaQBnAGkAQwBlAHIAdAAg
AEMAUAAvAEMAUABTACAAYQBuAGQAIAB0AGgAZQAgAFIAZQBsAHkAaQBuAGcAIABQ
AGEAcgB0AHkAIABBAGcAcgBlAGUAbQBlAG4AdAAgAHcAaABpAGMAaAAgAGwAaQBt
AGkAdAAgAGwAaQBhAGIAaQBsAGkAdAB5ACAAYQBuAGQAIABhAHIAZQAgAGkAbgBj
AG8AcgBwAG8AcgBhAHQAZQBkACAAaABlAHIAZQBpAG4AIABiAHkAIAByAGUAZgBl
AHIAZQBuAGMAZQAuMA8GA1UdEwEB/wQFMAMBAf8wNAYIKwYBBQUHAQEEKDAmMCQG
CCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wgY8GA1UdHwSBhzCB
hDBAoD6gPIY6aHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0SGlnaEFz
c3VyYW5jZUVWUm9vdENBLmNybDBAoD6gPIY6aHR0cDovL2NybDQuZGlnaWNlcnQu
Y29tL0RpZ2lDZXJ0SGlnaEFzc3VyYW5jZUVWUm9vdENBLmNybDAfBgNVHSMEGDAW
gBSxPsNpA/i/RwHUmCYaCALvY2QrwzAdBgNVHQ4EFgQUUOpzidsp+xCPnuUBINTe
eZlIg/cwDQYJKoZIhvcNAQEFBQADggEBAF1PhPGoiNOjsrycbeUpSXfh59bcqdg1
rslx3OXb3J0kIZCmz7cBHJvUV5eR13UWpRLXuT0uiT05aYrWNTf58SHEW0CtWakv
XzoAKUMncQPkvTAyVab+hA4LmzgZLEN8rEO/dTHlIxxFVbdpCJG1z9fVsV7un5Tk
1nq5GMO41lJjHBC6iy9tXcwFOPRWBW3vnuzoYTYMFEuFFFoMg08iXFnLjIpx2vrF
EIRYzwfu45DC9fkpx1ojcflZtGQriLCnNseaIGHr+k61rmsb5OPs4tk8QUmoIKRU
9ZKNu8BVIASm2LAXFszj0Mi0PeXZhMbT9m5teMl5Q+h6N/9cNUm/ocU=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIEQjCCA6ugAwIBAgIEQoclDjANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC
VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u
ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc
KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u
ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEy
MjIxNTI3MjdaFw0xNDA3MjIxNTU3MjdaMGwxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xKzApBgNV
BAMTIkRpZ2lDZXJ0IEhpZ2ggQXNzdXJhbmNlIEVWIFJvb3QgQ0EwggEiMA0GCSqG
SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGzOVz5vvUu+UtLTKm3+WBP8nNJUm2cSrD
1ZQ0Z6IKHLBfaaZAscS3so/QmKSpQVk609yU1jzbdDikSsxNJYL3SqVTEjju80lt
cZF+Y7arpl/DpIT4T2JRvvjF7Ns4kuMG5QiRDMQoQVX7y1qJFX5x6DW/TXIJPb46
OFBbdzEbjbPHJEWap6xtABRaBLe6E+tRCphBQSJOZWGHgUFQpnlcid4ZSlfVLuZd
HFMsfpjNGgYWpGhz0DQEE1yhcdNafFXbXmThN4cwVgTlEbQpgBLxeTmIogIRfCdm
t4i3ePLKCqg4qwpkwr9mXZWEwaElHoddGlALIBLMQbtuC1E4uEvLAgMBAAGjggET
MIIBDzASBgNVHRMBAf8ECDAGAQH/AgEBMCcGA1UdJQQgMB4GCCsGAQUFBwMBBggr
BgEFBQcDAgYIKwYBBQUHAwQwMwYIKwYBBQUHAQEEJzAlMCMGCCsGAQUFBzABhhdo
dHRwOi8vb2NzcC5lbnRydXN0Lm5ldDAzBgNVHR8ELDAqMCigJqAkhiJodHRwOi8v
Y3JsLmVudHJ1c3QubmV0L3NlcnZlcjEuY3JsMB0GA1UdDgQWBBSxPsNpA/i/RwHU
mCYaCALvY2QrwzALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7
UISX8+1i0BowGQYJKoZIhvZ9B0EABAwwChsEVjcuMQMCAIEwDQYJKoZIhvcNAQEF
BQADgYEAUuVY7HCc/9EvhaYzC1rAIo348LtGIiMduEl5Xa24G8tmJnDioD2GU06r
1kjLX/ktCdpdBgXadbjtdrZXTP59uN0AXlsdaTiFufsqVLPvkp5yMnqnuI3E2o6p
NpAkoQSbB6kUCNnXcW26valgOjDLZFOnr241QiwdBAJAAE/rRa8=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC
VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u
ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc
KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u
ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1
MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE
ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j
b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF
bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg
U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA
A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/
I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3
wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC
AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb
oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5
BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p
dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk
MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp
b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu
dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0
MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi
E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa
MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI
hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN
95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd
2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=
-----END CERTIFICATE-----
</pre></body></html>
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,71 @@
msgid ""
msgstr ""
"Project-Id-Version: Most Popular Posts\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-07-09 00:48-0500\n"
"PO-Revision-Date: \n"
"Last-Translator: Wes Goodhoofd <w@wesg.ca>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: _e\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: .\n"
#: most-popular.php:64
msgid "Title: "
msgstr ""
#: most-popular.php:69
msgid "Number of posts to display: "
msgstr ""
#: most-popular.php:75
msgid "Show comment count "
msgstr ""
#: most-popular.php:80
msgid "Include zero comment posts "
msgstr ""
#: most-popular.php:83
msgid "If both of the following options are enabled, the <em>only category</em> option is respected."
msgstr ""
#: most-popular.php:86
msgid "Show comments from all categories "
msgstr ""
#: most-popular.php:90
msgid "Only show posts in this category."
msgstr ""
#: most-popular.php:94
msgid "Exclude posts from no categories "
msgstr ""
#: most-popular.php:98
msgid "Exclude posts in this category."
msgstr ""
#: most-popular.php:102
msgid "Only show posts in the last "
msgstr ""
#: most-popular.php:104
msgid "All"
msgstr ""
#: most-popular.php:127
msgid "Get least commented posts "
msgstr ""
#: most-popular.php:132
msgid "Child UL class "
msgstr ""
#: most-popular.php:231
msgid "No posts to display"
msgstr ""
+251
View File
@@ -0,0 +1,251 @@
<?php
/*
Plugin Name: Most Popular Posts
Plugin URI: http://www.wesg.ca/2008/08/wordpress-widget-most-popular/
Description: Display a link to the most popular posts on your blog according to the number of comments.
Author: Wes Goodhoofd
Version: 1.6
Author URI: http://www.wesg.ca
*/
global $defaults;
add_action("widgets_init", create_function('', 'return register_widget("Most_Popular_Posts");'));
// default values
$defaults = array(
'title' => 'Most Popular Posts',
'number' => 5,
'comment' => ' checked',
'zero' => ' checked',
'onlycheck' => ' checked',
'only' => 1,
'exclude' => 1,
'excludecheck' => ' checked',
'time' => '',
'duration' => '',
'parentclass' => '',
'childclass' => '',
'listclass' => '',
'reverse' => '',
);
class Most_Popular_Posts extends WP_Widget {
function Most_Popular_Posts() {
$widget_ops = array('description' => __( "Displays links to the posts with the most comments." ) );
$this->WP_Widget('most_popular_posts', __('Most Popular Posts'), $widget_ops);
}
function form($instance) {
global $defaults;
//load translations
$plugin_dir = basename(dirname(__FILE__));
load_plugin_textdomain( 'most-popular-posts', null, $plugin_dir );
// check if options are saved, otherwise use defaults
if (mpm_isEmpty($instance))
$instance = $defaults;
$title = esc_attr($instance['title']);
$number = esc_attr($instance['number']);
$comment = esc_attr($instance['comment']);
$zero = esc_attr($instance['zero']);
$onlycheck = esc_attr($instance['onlycheck']);
$only = esc_attr($instance['only']);
$excludecheck = esc_attr($instance['excludecheck']);
$exclude = esc_attr($instance['exclude']);
$time = esc_attr($instance['time']);
$timeunit = esc_attr($instance['duration']);
$childclass = esc_attr($instance['childclass']);
$reverse = esc_attr($instance['reverse']);
//create widget configuration panel
?>
<p><label for="<?php echo $this->get_field_name('title'); ?>"><?php _e('Title: ', 'most-popular-posts'); ?> </label>
<input type="text" size="30" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title;?>" id="widget-most_popular_posts" />
</p>
<p>
<label for="<?php echo $this->get_field_name('number'); ?>"><?php _e('Number of posts to display: ', 'most-popular-posts'); ?></label>
<input type="text" name="<?php echo $this->get_field_name('number'); ?>" value="<?php echo $number;?>" size="5" />
</p>
<p>
<input type="checkbox" name="<?php echo $this->get_field_name('comment'); ?>" value="checked" <?php echo $comment;?> />
<label for="<?php echo $this->get_field_name('comment'); ?>"><?php _e('Show comment count ', 'most-popular-posts'); ?></label>
</p>
<p>
<input type="checkbox" name="<?php echo $this->get_field_name('zero'); ?>" value="checked" <?php echo $zero;?> />
<label for="<?php echo $this->get_field_name('zero'); ?>"><?php _e('Include zero comment posts ', 'most-popular-posts'); ?></label>
</p>
<p><?php _e('If both of the following options are enabled, the <em>only category</em> option is respected.', 'most-popular-posts'); ?></p>
<p> <input type="checkbox" name="<?php echo $this->get_field_name('onlycheck'); ?>" value="checked" <?php echo $onlycheck;?> />
<label for="<?php echo $this->get_field_name('onlycheck'); ?>"><?php _e('Show comments from all categories ', 'most-popular-posts'); ?></label></p>
<p>
<?php wp_dropdown_categories('hierarchical=1&selected=' . $only . '&orderby=name&show_count=1&name=' . $this->get_field_name('only') . '&hide_empty=0'); ?><br />
<label for="<?php echo $this->get_field_name('only'); ?>"><?php _e('Only show posts in this category.', 'most-popular-posts'); ?></label>
</p>
<p> <input type="checkbox" name="<?php echo $this->get_field_name('excludecheck'); ?>" value="checked" <?php echo $excludecheck;?> />
<label for="<?php echo $this->get_field_name('excludecheck'); ?>"><?php _e('Exclude posts from no categories ', 'most-popular-posts'); ?></label></p>
<p>
<?php wp_dropdown_categories('hierarchical=1&selected=' . $exclude . '&orderby=name&show_count=1&name=' . $this->get_field_name('exclude') . '&hide_empty=0'); ?><br />
<label for="<?php echo $this->get_field_name('exclude')?>"><?php _e('Exclude posts in this category.', 'most-popular-posts'); ?></label>
</p>
<p>
<label for="<?php echo $this->get_field_name('time')?>"><?php _e('Only show posts in the last ', 'most-popular-posts'); ?></label>
<br /><select name="<?php echo $this->get_field_name('time')?>">
<option value="all"><?php _e('All', 'most-popular-posts'); ?></option>
<?php
for ($i = 1; $i <= 12; $i++) {
if ($time == $i)
$selected = ' selected';
else
$selected = '';
echo "<option value=" . $i . $selected . ">" . $i . "</option>\n";
} ?>
</select>
<select name="<?php echo $this->get_field_name('duration')?>">
<?php $duration = array('all', 'day', 'week', 'month');
foreach ($duration as $select) {
if ($timeunit == $select)
$selected = ' selected';
else
$selected = '';
echo "<option value=" . $select . $selected . ">" . $select . "</option>\n";
} ?></select>
</p>
<p>
<input type="checkbox" name="<?php echo $this->get_field_name('reverse'); ?>" value="checked" <?php echo $reverse;?> />
<label for="<?php echo $this->get_field_name('reverse'); ?>"><?php _e('Get least commented posts ', 'most-popular-posts'); ?></label>
</p>
<h3>Formatting</h3>
<p>
<label for="<?php echo $this->get_field_name('childclass')?>"><?php _e('Child UL class ', 'most-popular-posts'); ?></label>
<br /> <input type="text" name="<?php echo $this->get_field_name('childclass')?>" value="<?php echo $childclass;?>" />
</p>
<?php
}
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['number'] = strip_tags($new_instance['number']);
$instance['comment'] = strip_tags($new_instance['comment']);
$instance['zero'] = strip_tags($new_instance['zero']);
$instance['onlycheck'] = strip_tags($new_instance['onlycheck']);
$instance['only'] = strip_tags($new_instance['only']);
$instance['excludecheck'] = strip_tags($new_instance['excludecheck']);
$instance['exclude'] = strip_tags($new_instance['exclude']);
$instance['time'] = strip_tags($new_instance['time']);
$instance['duration'] = strip_tags($new_instance['duration']);
$instance['nestedlist'] = strip_tags($new_instance['nestedlist']);
$instance['childclass'] = strip_tags($new_instance['childclass']);
$instance['reverse'] = strip_tags($new_instance['reverse']);
return $instance;
}
function widget($args, $instance) {
global $wpdb;
global $defaults;
extract($args);
if (mpm_isEmpty($instance))
$instance = $defaults;
//check if zero comments are needed
if ($instance['zero'] != 'checked')
$zero = '&& comment_count > 0 ';
//sort out the duration system
if (($instance['duration'] != 'all') && ($instance['time'] != 'all')) {
//get current time of Wordpress
$time = current_time('mysql', 1);
$period = $instance['duration'];
//new date to compare
$new_date = date('Y-m-d H:i:s', strtotime($time . "-" . $instance['time'] . " " . $instance['duration']));
$compare = " AND (post_date_gmt >= '" . $new_date . "')";
}
// determine count order
if ($instance['reverse'] == 'checked')
$reverse = 'ASC';
else
$reverse = 'DESC';
//get the post data from the database
if (($instance['excludecheck'] == 'checked') && ($instance['onlycheck'] == 'checked')) {
$query = "SELECT ID, post_title, comment_count, post_date FROM " . $wpdb->posts . " WHERE post_type = 'post' && post_status = 'publish' " . $zero . $compare . " ORDER BY comment_count " . $reverse . " LIMIT " . $instance['number'];
$posts = $wpdb->get_results($query);
}
else if (($instance['excludecheck'] != 'checked') && ($instance['onlycheck'] == 'checked')) {
$query = "select ID, post_title, comment_count, post_date from " . $wpdb->posts . " where ID in (select object_ID from " . $wpdb->term_relationships . " where " . $wpdb->term_relationships . ".term_taxonomy_id in (select term_taxonomy_id from " . $wpdb->term_taxonomy . " where term_id != " . $instance['exclude'] . " AND taxonomy = 'category')) AND post_type = 'post'" . $compare . " order by comment_count " . $reverse . " limit " . $instance['number'];
$posts = $wpdb->get_results($query);
}
else {
$query = "select ID, post_title, comment_count, post_date from " . $wpdb->posts . " where ID in (select object_ID from " . $wpdb->term_relationships . " where " . $wpdb->term_relationships . ".term_taxonomy_id = (select term_taxonomy_id from " . $wpdb->term_taxonomy . " where term_id = " . $instance['only'] . " AND taxonomy = 'category')) AND post_type = 'post'" . $compare . " order by comment_count " . $reverse . " limit " . $instance['number'];
$posts = $wpdb->get_results($query);
}
// start widget output
echo $before_widget . "\n";
echo $before_title . $instance['title'] . $after_title . "\n";
if ($instance['nestedlist'] == 'checked') {
if ($instance['parentclass'] == '')
echo '<li>';
else
echo '<li class="' . $instance['parentclass'] . '">';
}
if ($instance['childclass'] == '')
echo '<ul>';
else
echo '<ul class="' . $instance['childclass'] . '">' . "\n";
//display each page as a link
if (!empty($posts)) {
foreach ($posts as $links) {
if ($instance['comment'] == 'checked')
$comments = ' (' . $links->comment_count . ')';
if ($instance['listclass'] != '')
$li_class = ' class="' . $instance['listclass'] . '"';
echo "\t" . '<li' . $li_class . '><a href="' . get_permalink($links->ID) . '">' . $links->post_title . '</a>' . $comments . '</li>' . "\n";
}
}
else {
echo "\n\t" . '<li>';
_e('No posts to display', 'most-popular-posts');
echo '</li>' . "\n";
}
?>
</ul>
<?php
echo $after_widget . "\n";
}
}
function mpm_isEmpty($array) {
$i = 0;
foreach ($array as $elements) {
if (strlen($elements) == 0)
$i++;
}
if ($i == count($array))
return true;
else
return false;
}
?>
@@ -0,0 +1,112 @@
=== Most Popular Posts ===
Contributors: wesg
Donate link: http://www.wesg.ca/2008/08/wordpress-widget-most-popular/#donate
Tags: widget, most popular, comments, sidebar
Requires at least: 2.8
Tested up to: 3.0
Stable tag: 1.6
This is a very simple widget that displays a link to the top commented posts on your blog.
== Description ==
Most Popular Posts is a basic widget for your sidebar that creates a list of links to the top posts on your blog according to the number of comments on the post. You can customize many aspects of the plugin to fit in your blog.
Updates include including and excluding categories, reverse the order of comments and incorporation of WordPress widget standards.
For a complete list of the changes from each version, please visit <a href="http://www.wesg.ca/2008/08/wordpress-widget-most-popular/#changelog">the plugin homepage</a>.
For examples and tips on using the plugin, please check <a href="http://www.wesg.ca/2008/08/wordpress-widget-most-popular/#examples">the examples</a> on the plugin homepage.
Be sure to check out my other plugins at <a href="http://wordpress.org/extend/plugins/profile/wesg">my Wordpress profile</a>.
= Usage =
Used exclusively as a widget at the current time.
== Installation ==
1. Upload the folder most-popular-posts to your Wordpress plugin directory.
1. Activate the plugin from the plugin panel.
1. Navigate to the widget configuration panel and customize the widget.
== FAQ ==
= What is the purpose of this widget? =
While I thought a widget like this was very common, I had trouble finding one for my blog. That led me to create this basic widget that simply displays a link to the top commented posts. You can customize the title, number of posts, and whether you want to display the comment count.
= Is it configurable? =
Sure. Have a look at the options in the widget configuration panel.
= Can I only show posts from a single category if I want? =
Yes. As of version 1.3, more control is available for categories. You can select a single category for the links, or exclude a single category. All options are available from the widget configuration panel.
= What do these options mean? =
**Show comment count**
Display the number of comments associated with the post beside the link.
**Include zero comment posts**
Show links to posts that do not yet have any comments.
**Show comments from all categories**
Check if you want links to be displayed for posts in any category.
**Only show posts in this category**
Show links to posts that are only in this category. The previous checkbox must be unchecked for this setting to take effect.
**Exclude posts from no categories**
Check if you don't want to exclude links from a specific category.
**Exclude posts in this category**
Skip posts that fall in this category. The previous checkbox must be unchecked for this setting to take effect.
**Nest widget inside list**
When this is checked, the widget will use an additional `<li>` element around it. Toggle this option to see how the widget best fits in with your theme.
**Classes**
This box includes options to style the list components of the plugin. To match the list with your theme, add a class here, then insert a class declaration in your style sheet.
**Show posts in the last x days/weeks/months**
By request, version 1.4.3 includes an option to only show links to posts from certain a certain time period. This is determined by the date the post was published, not the comments themselves.
**Get least commented posts**
Toggle the order in which posts are displayed.
== Changelog ==
= 1.0 =
* Initial release
= 1.1 =
* Added support for using the list as a function in a post
= 1.2 =
* Updated for WordPress 2.7
* Add localization capability
= 1.3 =
* Added categories to exclude
* Added categories to include
* Switch off nonzero comment posts
= 1.4 =
* Added exclude post checkbox
* Added include post checkbox
* Stopped drafts from being displayed
= 1.4.1 =
* Excludes posts with multiple categories
= 1.4.2 =
* Added control for formatting the list to match website theme
= 1.4.3 =
* Added ability to only display links to posts from a specific timeframe
= 1.5 =
* Rewritten to conform to WP 2.8+ widget standards
* Added reverse order option
Binary file not shown.
@@ -0,0 +1,23 @@
.shadowbox .notice {
background-color: #ffebe8;
border-color: #c00;
border-width: 1px;
border-style: solid;
padding: 0 0.6em;
margin: 5px 15px 2px;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.shadowbox .notice a {
color: #c00;
}
.shadowbox .notice p {
margin: 0.5em 0;
line-height: 1;
padding: 2px;
}
.shadowbox .notice {
margin: 5px 0 15px;
}
@@ -0,0 +1,9 @@
.hidden {
display: none;
}
/* Resolves a problem where cancel link shows up in default blue */
#sb-loading a {
color: #fff;
text-decoration: none;
}
@@ -0,0 +1,600 @@
<?php
/**
* Shadowbox class for admin actions
*
* This class contains all functions and actions required for Shadowbox to work in the admin of WordPress
*
* @package shadowbox-js
* @subpackage Admin
* @since 3.0.0.1
*/
class ShadowboxAdmin extends Shadowbox {
/**
* Full file system path to the main plugin file
*
* @since 3.0.0.0
* @var string
*/
var $plugin_file;
/**
* Path to the main plugin file relative to WP_CONTENT_DIR/plugins
*
* @since 3.0.0.0
* @var string
*/
var $plugin_basename;
/**
* Name of options page hook
*
* @since 3.0.0.1
* @var string
*/
var $options_page_hookname;
/**
* PHP 4 Style constructor which calls the below PHP5 Style Constructor
*
* @since 3.0.0.1
* @return none
*/
function ShadowboxAdmin () {
$this->__construct();
}
/**
* Setup backend functionality in WordPress
*
* @return none
* @since 3.0.0.0
*/
function __construct () {
Shadowbox::__construct ();
if ( version_compare ( $this->get_option ( 'version' ) , $this->dbversion , '!=' ) && ! empty ( $this->options ) )
$this->check_upgrade ();
// Full path and plugin basename of the main plugin file
$this->plugin_file = dirname ( dirname ( __FILE__ ) ) . '/shadowbox-js.php';
$this->plugin_basename = plugin_basename ( $this->plugin_file );
// ajax hooks so that we can build/output shadowbox.js
add_action ( 'wp_ajax_shadowboxjs' , array ( &$this , 'build_shadowbox' ) );
add_action ( 'wp_ajax_nopriv_shadowboxjs' , array ( &$this , 'build_shadowbox' ) );
// Load localizations if available
load_plugin_textdomain ( 'shadowbox-js' , false , 'shadowbox-js/localization' );
// Activation hook
register_activation_hook ( $this->plugin_file , array ( &$this , 'init' ) );
// Whitelist options
add_action ( 'admin_init' , array ( &$this , 'register_settings' ) );
// Activate the options page
add_action ( 'admin_menu' , array ( &$this , 'add_page' ) ) ;
}
/**
* Whitelist the shadowbox-js options
*
* @since 3.0.0.1
* @return none
*/
function register_settings () {
register_setting ( 'shadowbox' , 'shadowbox' , array ( &$this , 'update' ) );
}
/**
* Enqueue javascript required for the admin settings page
*
* @return none
* @since 2.0.3
*/
function admin_js () {
wp_enqueue_script ( 'jquery' );
wp_enqueue_script ( 'shadowbox-js-helper' , $this->plugin_url () . '/js/shadowbox-admin-helper.js' , array ( 'jquery' ) , $this->version , true );
wp_localize_script ( 'shadowbox-js-helper' , 'shadowboxJsHelperL10n' , array (
'advConfShow' => __( 'Show Advanced Configuration' , 'shadowbox-js' ) ,
'advConfHide' => __( 'Hide Advanced Configuration' , 'shadowbox-js' ) ,
'messageConfirm' => __( 'Do you agree that you are not using FLV support for commercial purposes or have already purchased a license for JW FLV Media Player?' , 'shadowbox-js' )
) );
}
/**
* Enqueue CSS required for the admin settings page
*
* @return none
* @since 3.0.3
*/
function admin_css () {
wp_enqueue_style ( 'shadowbox-admin-css' , apply_filters ( 'shadowbox-admin-css' , $this->plugin_url () . '/css/admin.css' ) , false , $this->version , 'screen' );
}
/**
* Return a list of the languages available to shadowbox.js
*
* @since 2.0.3.3
* @return array
*/
function languages () {
$languages = array (
'ar' , // Arabic
'ca' , // Catalan
'cs' , // Czech
'da' , // Danish
'de-CH' , // Swiss German
'de-DE' , // German
'en' , // English
'es' , // Spanish
'et' , // Estonian
'fi' , // Finnish
'fr' , // French
'gl' , // Galician
'he' , // Hebrew
'hu' , // Hungarian
'id' , // Indonesian
'is' , // Icelandic
'it' , // Italian
'ja' , // Japanese
'ko' , // Korean
'my' , // Burmese
'nl' , // Dutch
'no' , // Norwegian
'pl' , // Polish
'pt-BR' , // Brazilian Portuguese
'pt-PT' , // Portuguese
'ro' , // Romanian
'ru' , // Rusian
'sk' , // Slovak
'sv' , // Swedish
'tr' , // Turkish
'zh-CN' , // Chinese (Simplified)
'zh-TW' // Chinese (Traditional)
);
return $languages;
}
/**
* Try to set Shadowbox language based on defined language for WordPress
*
* @since 2.0.3.3
* @return string
*/
function set_lang () {
if ( defined ( 'WPLANG' ) )
$wp_lang = WPLANG;
else
$wp_lang = 'en';
switch ( $wp_lang ) {
case 'ar' :
$lang = 'ar'; // Arabic
break;
case 'ca' :
$lang = 'ca'; // Catalan
break;
case 'cs_CZ' :
$lang = 'cs'; // Czech
break;
case 'da_DK' :
$lang = 'da'; // Danish
break;
case 'de_DE' :
$lang = 'de-DE'; // German
break;
case 'es_ES' :
$lang = 'es'; // Spanish
break;
case 'et' :
$lang = 'et'; // Estonian
break;
case 'fi' :
case 'fi_FI':
$lang = 'fi'; // Finnish
break;
case 'fr_BE' :
case 'fr_FR' :
$lang = 'fr'; // French
break;
case 'gl_ES' :
$lang = 'gl'; // Galician
break;
case 'he_IL' :
$lang = 'he'; // Hebrew
break;
case 'hu_HU' :
$lang = 'hu'; // Hungarian
break;
case 'id_ID' :
$lang = 'id'; // Indonesian
break;
case 'is_IS' :
$lang = 'is'; // Icelandic
break;
case 'it_IT' :
$lang = 'it'; // Italian
break;
case 'ja' :
$lang = 'ja'; // Japanese
break;
case 'ko_KR' :
$lang = 'ko'; // Korean
break;
case 'my_MM' :
$lang = 'my'; // Burmese
break;
case 'nl' :
case 'nl_NL' :
$lang = 'nl'; // Dutch
break;
case 'nn_NO' :
$lang = 'no'; // Norwegian
break;
case 'pl_PL' :
$lang = 'pl'; // Polish
break;
case 'pt_BR' :
$lang = 'pt-BR'; // Brazilian Portuguese
break;
case 'pt_PT' :
$lang = 'pt-PT'; // Portuguese
break;
case 'ro' :
$lang = 'ro'; // Romanian
break;
case 'ru_RU' :
case 'ru_UA' :
$lang = 'ru'; // Rusian
break;
case 'sk' :
$lang = 'sk'; // Slovak
break;
case 'sv_SE' :
$lang = 'sv'; // Swedish
break;
case 'tr' :
$lang = 'tr'; // Turkish
break;
case 'zh_CN' :
$lang = 'zh-CN'; // Chinese (Simplified)
break;
default :
$lang = 'en'; // English
break;
}
return $lang;
}
/**
* Return the default list of enabled players available with Shadowbox
*
* @return array
* @since 3.0.0.0
*/
function players () {
$players = array (
'html' ,
'iframe' ,
'img' ,
'qt' ,
'swf' ,
'wmp'
);
return $players;
}
/**
* Return the default options
*
* @return array
* @since 2.0.3
*/
function defaults () {
$defaults = array (
'version' => $this->dbversion ,
'library' => 'base' ,
'language' => $this->set_lang () ,
'smartLoad' => 'false' ,
'useCache' => 'true' ,
'autoimg' => 'true' ,
'automov' => 'true' ,
'autotube' => 'true' ,
'autoaud' => 'true' ,
'autoflv' => 'false' ,
'enableFlv' => 'false' ,
'genericVideoWidth' => 640 ,
'genericVideoHeight'=> 385 ,
'autoDimensions' => 'false' ,
'animateFade' => 'true' ,
'animate' => 'true' ,
'animSequence' => 'sync' ,
'autoplayMovies' => 'true' ,
'continuous' => 'false' ,
'counterLimit' => 10 ,
'counterType' => 'default' ,
'displayCounter' => 'true' ,
'displayNav' => 'true' ,
'enableKeys' => 'true' ,
'fadeDuration' => 0.35 ,
'flashBgColor' => '#000000' ,
'flashParams' => '{bgcolor:"#000000", allowFullScreen:true}' ,
'flashVars' => '{}' ,
'flashVersion' => '9.0.0' ,
'handleOversize' => 'resize' ,
'handleUnsupported' => 'link' ,
'initialHeight' => 160 ,
'initialWidth' => 320 ,
'modal' => 'false' ,
'overlayColor' => '#000' ,
'overlayOpacity' => 0.8 ,
'players' => $this->players () ,
'resizeDuration' => 0.35 ,
'showMovieControls' => 'true' ,
'showOverlay' => 'true' ,
'skipSetup' => 'false' ,
'slideshowDelay' => 0 ,
'useSizzle' => 'false' ,
'viewportPadding' => 20
);
return $defaults;
}
/**
* Initialize the default options during plugin activation
*
* @return none
* @since 2.0.3
*/
function init () {
if ( ! get_option ( 'shadowbox' ) ) {
$this->options = $this->defaults ();
add_option ( 'shadowbox' , $this->options );
} else {
$this->check_upgrade ();
}
$this->build_shadowbox ( true ); // Attempt to build and cache shadowbox.js
}
/**
* Check if an upgraded is needed
*
* @return none
* @since 3.0.0.1
*/
function check_upgrade () {
if ( $this->version_compare ( array ( '3.0.0.0' => '<' ) ) )
$this->upgrade ( '3.0.0.0' );
else if ( $this->version_compare ( array ( '3.0.0.0' => '>' , '3.0.0.2' => '<' ) ) )
$this->upgrade ( '3.0.0.2' );
else if ( $this->version_compare ( array ( '3.0.0.2' => '>' , '3.0.3' => '<' ) ) )
$this->upgrade ( '3.0.3' );
else if ( $this->version_compare ( array ( '3.0.3' => '>' , '3.0.3.3' => '<' ) ) )
$this->upgrade ( '3.0.3.3' );
}
/**
* Compare Versions
*
* @param array Array of the version you want to compare to the version stored in the database as the key and the operator as the value
* @return bool
* @since 3.0.0.2
*/
function version_compare ( $versions ) {
foreach ( $versions as $version => $operator ) {
if ( version_compare ( $this->get_option ( 'version' ) , $version , $operator ) )
$response = true;
else
$response = false;
}
return $response;
}
/**
* Upgrade options
*
* @return none
* @since 3.0.0.0
*/
function upgrade ( $ver ) {
if ( $ver == '3.0.0.0' ) { // Upgrades for versions below 3.0.0.0
$newopts = array (
'version' => '3.0.0.0' ,
'smartLoad' => 'false' ,
'enableFlv' => 'false' ,
'tubeWidth' => 640 ,
'tubeHeight' => 385 ,
'players' => $this->players () ,
'autoDimensions' => 'false' ,
'showOverlay' => 'true' ,
'skipSetup' => 'false' ,
'flashParams' => '{bgcolor:"#000000", allowFullScreen:true}' ,
'flashVars' => '{}' ,
'flashVersion' => '9.0.0'
);
unset ( $this->options['ie8hack'] , $this->options['skin'] );
$this->options = array_merge ( $this->options , $newopts );
update_option ( 'shadowbox' , $this->options );
} else if ( $ver == '3.0.0.2' ) { // Upgrades for versions below 3.0.0.2
$newopts = array (
'version' => '3.0.0.2' ,
'useSizzle' => 'false' ,
'genericVideoHeight'=> $this->options['tubeHeight'] ,
'genericVideoWidth' => $this->options['tubeWidth']
);
if ( $this->options['enableFlv'] == 'true' )
$newopts['autoflv'] = 'true';
else
$newopts['autoflv'] = 'false';
unset ( $this->options['tubeHeight'] , $this->options['tubeWidth'] );
$this->options = array_merge ( $this->options , $newopts );
update_option ( 'shadowbox' , $this->options );
} else if ( $ver == '3.0.3' ) { // Upgrades for versions below 3.0.3
$this->options['version'] = '3.0.3';
if ( in_array ( $this->options['library'] , array( 'ext' , 'dojo') ) )
$this->options['library'] = 'base';
update_option ( 'shadowbox', $this->options );
} else if ( $ver == '3.0.3.3' ) { // Upgrades for versions below 3.0.3.3
$this->options['version'] = '3.0.3.3';
$this->options['useCache'] = 'true';
update_option ( 'shadowbox' , $this->options );
}
$this->check_upgrade ();
}
/**
* Update/validate the options in the options table from the POST
*
* @since 3.0.0.1
* @return none
*/
function update ( $options ) {
// Make sure there are no empty values, seems users like to clear out options before saving
foreach ( $this->defaults () as $key => $value ) {
if ( ( ! isset ( $options[$key] ) || empty ( $options[$key] ) ) && $key != 'delete' && $key != 'default' && $key != 'players' )
$options[$key] = $value;
}
if ( isset ( $options['delete'] ) && $options['delete'] == 'true' ) { // Check if we are supposed to remove options
delete_option ( 'shadowbox' );
} else if ( isset ( $options['default'] ) && $options['default'] == 'true' ) { // Check if we are supposed to reset to defaults
$this->options = $this->defaults ();
$this->build_shadowbox ( true ); // Attempt to build and cache shadowbox.js
return $this->options;
} else {
if ( ! isset ( $options['autoflv'] ) || $options['enableFlv'] == 'false' )
$options['autoflv'] = 'false';
unset ( $options['delete'] , $options['default'] );
$this->options = $options;
$this->build_shadowbox ( true ); // Attempt to build and cache shadowbox.js
return $this->options;
}
}
/**
* Build the JS output for shadowbox.js
*
* Shadowbox.js is now built in a very specific order,
* so to dynamically load what we want, we need to build
* the JavaScript dynamically, this causes issues with
* determining the path to shadowbox.js also, so we have to
* do some hacks further down too.
*
* @since 3.0.3
* @param $tofile Boolean write output to file instead of echoing
* @return none
*/
function build_shadowbox ( $tofile = false ) {
// If the user is filtering the url for shadowbox.js just bail out here
if ( has_filter ( 'shadowbox-js' ) )
return;
$plugin_url = $this->plugin_url ();
$plugin_dir = WP_PLUGIN_DIR . '/' . dirname ( $this->plugin_basename );
// Ouput correct content-type, and caching headers
if ( ! $tofile )
cache_javascript_headers();
$output = '';
// Start build
foreach ( array ( 'intro' , 'core' , 'util' ) as $include ) {
// Replace S.path with the correct path, so we don't have to rely on autodetection which is broken with this method
if ( $include == 'core' )
$output .= str_replace ( 'S.path=null;' , "S.path='$plugin_url/shadowbox/';" , file_get_contents ( "$plugin_dir/shadowbox/$include.js" ) );
else
$output .= file_get_contents ( "$plugin_dir/shadowbox/$include.js" );
}
$library = $this->get_option ( 'library' );
$output .= file_get_contents ( "$plugin_dir/shadowbox/adapters/$library.js" );
foreach ( array ( 'load' , 'plugins' , 'cache' ) as $include )
$output .= file_get_contents ( "$plugin_dir/shadowbox/$include.js" );
if ( $this->get_option ( 'useSizzle' ) == 'true' && $this->get_option ( 'library' ) != 'jquery' )
$output .= file_get_contents ( "$plugin_dir/shadowbox/find.js" );
$players = (array) $this->get_option ( 'players' );
if ( in_array ( 'flv' , $players ) || in_array ( 'swf' , $players ) )
$output .= file_get_contents ( "$plugin_dir/shadowbox/flash.js" );
$language = $this->get_option ( 'language' );
$output .= file_get_contents ( "$plugin_dir/shadowbox/languages/$language.js" );
foreach ( $players as $player )
$output .= file_get_contents ( "$plugin_dir/shadowbox/players/$player.js" );
foreach ( array ( 'skin' , 'outro' ) as $include )
$output .= file_get_contents ( "$plugin_dir/shadowbox/$include.js" );
// if we are supposed to write to a file then do so
if ( $tofile && $this->get_option ( 'useCache' ) == 'true' ) {
$uploads = wp_upload_dir ();
if ( empty( $uploads['error'] ) && ! empty( $uploads['basedir'] ) )
$basedir = $uploads['basedir'];
else
$basedir = WP_CONTENT_DIR . '/uploads';
$shadowbox_dir = "$basedir/shadowbox-js/";
$shadowbox_file = $shadowbox_dir . $this->md5 () . '.js';
if ( ! is_dir ( $shadowbox_dir ) && is_writable ( $basedir ) )
wp_mkdir_p ( $shadowbox_dir );
if ( ! file_exists ( $shadowbox_file ) && is_dir ( $shadowbox_dir ) && is_writable ( $shadowbox_dir ) ) {
$fh = @fopen ( $shadowbox_file, 'w+' );
@fwrite ( $fh , $output );
@fclose ( $fh );
$chmod = defined ( 'FS_CHMOD_FILE' ) ? FS_CHMOD_FILE : 0644;
if ( ( fileperms ( $shadowbox_dir ) & 0777 ) != $chmod )
@chmod ( $shadowbox_file , $chmod );
}
} else if ( ! $tofile ) { // otherwise just echo (backup call to admin-ajax.php for on the fly building)
die ( $output );
}
}
/**
* Add the options page
*
* @return none
* @since 2.0.3
*/
function add_page () {
if ( current_user_can ( 'manage_options' ) ) {
$this->options_page_hookname = add_options_page ( __( 'Shadowbox JS' , 'shadowbox-js' ) , __( 'Shadowbox JS' , 'shadowbox-js' ) , 'manage_options' , 'shadowbox-js' , array ( &$this , 'admin_page' ) );
add_action ( "admin_print_scripts-{$this->options_page_hookname}" , array ( &$this , 'admin_js' ) );
add_action ( "admin_print_styles-{$this->options_page_hookname}" , array ( &$this , 'admin_css' ) );
add_filter ( "plugin_action_links_{$this->plugin_basename}" , array ( &$this , 'filter_plugin_actions' ) );
add_contextual_help($this->options_page_hookname, 'This is Shadowbox JS');
}
}
/**
* Add a settings link to the plugin actions
*
* @param array $links Array of the plugin action links
* @return array
* @since 2.0.3
*/
function filter_plugin_actions ( $links ) {
$settings_link = '<a href="' . menu_page_url ( 'shadowbox-js' , false ) . '">' . __( 'Settings' , 'shadowbox-js' ) . '</a>';
array_unshift ( $links, $settings_link );
return $links;
}
/**
* Output the options page
*
* @return none
* @since 2.0.3
*/
function admin_page () {
if ( ! @include ( 'options-page.php' ) ) {
_e ( sprintf ( '<div id="message" class="updated fade"><p>The options page for the <strong>Shadowbox JS</strong> cannot be displayed. The file <strong>%s</strong> is missing. Please reinstall the plugin.</p></div>' , dirname ( __FILE__ ) . '/options-page.php' ) );
}
}
}
@@ -0,0 +1,352 @@
<?php
/**
* Shadowbox class for frontend actions
*
* This class contains all functions and actions required for Shadowbox to work on the frontend of WordPress
*
* @since 3.0.0.1
* @package shadowbox-js
* @subpackage Frontend
*/
class ShadowboxFrontend extends Shadowbox {
/**
* PHP 4 Style constructor which calls the below PHP5 Style Constructor
*
* @since 3.0.0.1
* @return none
*/
function ShadowboxFrontend () {
$this->__construct();
}
/**
* Setup frontend functionality for WordPress
*
* @return none
* @since 3.0.0.0
*/
function __construct () {
Shadowbox::__construct ();
// Only add these actions when we have options in the database
// This allows for selecting to delete options from the admin page
if ( ! empty ( $this->options ) ) {
add_action ( 'plugins_loaded' , array ( &$this , 'styles' ) , 7 );
add_action ( 'plugins_loaded' , array ( &$this , 'scripts' ) , 8 );
if ( $this->get_option ( 'smartLoad' ) == 'false' )
add_action ( 'wp_footer' , array ( &$this , 'configure' ) , 11 );
// Automatically add Shadowbox to links
if ( $this->is_automatic ( 'any' ) ) {
if ( $this->get_option ( 'smartLoad' ) == 'false' )
add_filter ( 'the_content', array ( &$this, 'add_attr_to_link' ) , 12 , 2 );
else
add_filter ( 'the_posts' , array ( &$this , 'process_posts_early' ) , 10 , 2 );
add_filter ( 'wp_get_attachment_link' , array ( &$this , 'add_attr_to_link' ) , 12 , 2 );
}
// If we are automating for images make sure we link directly to the attachment
if ( $this->is_automatic ( 'img' ) )
add_filter ( 'attachment_link' , array ( &$this , 'attachment_direct_linkage' ) , 10 , 2 );
if ( ! function_exists ( 'get_admin_url' ) )
add_filter ( 'admin_url' , array ( &$this , 'admin_url_scheme' ) );
}
}
/**
* Do processing on the_posts instead of the_content, this allows us to determine
* if we should enqueue JS and CSS early enough to not have to perform "hacks" to
* get JS to load in the footer and to keep the CSS from loading when we don't
* need it
*
* @since 3.0.3.3
* @param array $posts posts
* @param object $context provided context from the apply_filters call
* @return array
*/
function process_posts_early ( $posts, $context ) {
if ( ! empty ( $posts ) ) {
for ( $i = 0; $i < count ( $posts ); $i++ ) {
$posts[$i]->post_content = $this->add_attr_to_link ( $posts[$i]->post_content , $posts[$i] );
if ( preg_match ( '%(?<!\[)\[gallery[ \]]%i', $posts[$i]->post_content ) && $this->get_option ( 'smartLoad' ) == 'true' )
$this->possibly_enqueue ( 'shadowbox' );
if ( ! empty ( $posts[$i]->post_excerpt ) ) {
$posts[$i]->post_excerpt = $this->add_attr_to_link ( $posts[$i]->post_excerpt , $posts[$i] );
if ( preg_match ( '%(?<!\[)\[gallery[ \]]%i', $posts[$i]->post_excerpt ) && $this->get_option ( 'smartLoad' ) == 'true' )
$this->possibly_enqueue ( 'shadowbox' );
}
}
}
return $posts;
}
/**
* Replace the URL scheme with the correct scheme.
*
* Versions of WP before 3.0 do not support telling admin_url which scheme to use,
* so we filter it, to make sure it is using the correct one.
*
* @since 3.0.3.3
* @param string $url The url to filter
* @return string
*/
function admin_url_scheme ( $url ) {
$scheme = is_ssl() ? 'https' : 'http';
return str_replace ( array ( 'http://' , 'https://' ) , "$scheme://" , $url );
}
/**
* Enqueue Shadowbox CSS
*
* @return none
* @since 2.0.3
*/
function styles () {
$plugin_url = $this->plugin_url ();
$shadowbox_css = apply_filters ( 'shadowbox-css' , $plugin_url . '/shadowbox/shadowbox.css' );
wp_register_style ( 'shadowbox-css' , $shadowbox_css , false , $this->sbversion , 'screen' );
wp_register_style ( 'shadowbox-extras' , apply_filters ( 'shadowbox-extras' , $plugin_url . '/css/extras.css' ) , false , $this->version , 'screen' );
if ( $this->get_option ( 'smartLoad' ) != 'true' ) {
wp_enqueue_style ( 'shadowbox-css' );
wp_enqueue_style ( 'shadowbox-extras' );
}
}
/**
* Enqueue Shadowbox javascript and dependencies
*
* @return none
* @since 2.0.3
*/
function scripts () {
$plugin_url = $this->plugin_url ();
$adapter = $this->get_option ( 'library' );
$language = $this->get_option ( 'language' );
$players = $this->get_option ( 'players' );
// Make sure we don't run into cross site scripting or similar errors by calling from the correct scheme
$scheme = is_ssl() ? 'https' : 'http';
$md5 = $this->md5 ();
$uploads = wp_upload_dir ();
if ( empty( $uploads['error'] ) && ! empty( $uploads['basedir'] ) ) {
$baseurl = $uploads['baseurl'];
$basedir = $uploads['basedir'];
} else {
$baseurl = WP_CONTENT_URL . '/uploads';
$basedir = WP_CONTENT_DIR . '/uploads';
}
$shadowbox_url = "$baseurl/shadowbox-js/$md5.js";
$shadowbox_file = "$basedir/shadowbox-js/$md5.js";
wp_register_script ( 'yui' , apply_filters ( 'yui ' , "$scheme://ajax.googleapis.com/ajax/libs/yui/2.8.0r4/build/yahoo-dom-event/yahoo-dom-event.js" ) , false , apply_filters ( 'yui-version' , '2.8.0' ) , true );
wp_register_script ( 'mootools' , apply_filters ( 'mootools' , "$scheme://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js" ) , false , apply_filters ( 'mootools-version' , '1.2.4' ) , true );
// Check if we have a cached shadowbox.js from build_shadowbox, else use admin-ajax.php and build and delivery on the fly
if ( $this->is_world_readable ( $shadowbox_file ) && $this->get_option ( 'useCache' ) == 'true' ) {
$shadowbox = $shadowbox_url;
} else {
$shadowbox = add_query_arg ( array ( 'action' => 'shadowboxjs' , 'cache' => $md5) , admin_url ( 'admin-ajax.php' , $scheme ) );
}
$dependency = $adapter != 'base' ? array ( $adapter ) : false;
wp_register_script ( 'shadowbox' , apply_filters ( 'shadowbox-js' , $shadowbox ) , $dependency , $this->sbversion , true );
// If we aren't smart loading go ahead and enqueue, otherwise we will enqueue later
if ( $this->get_option ( 'smartLoad' ) != 'true' )
wp_enqueue_script ( 'shadowbox' );
}
/**
* Possibly enqueue a script to the footer if it is not already enqueued
*
* Used to enqueue a script to the footer in mid page as long as the
* script is not already enqueued.
*
* @return none
* @since 3.0.0.0
*/
function possibly_enqueue ( $script ) {
if ( did_action ( 'wp_head' ) )
return;
wp_enqueue_style ( 'shadowbox-css' );
wp_enqueue_style ( 'shadowbox-extras' );
wp_enqueue_script ( $this->get_option ( 'library' ) );
wp_enqueue_script ( $script );
add_action ( 'wp_footer' , array ( &$this , 'configure' ) , 11 );
}
/**
* Echo Shadowbox configuration and initialization scripts
*
* @return none
* @since 0.1
*/
function configure () {
$plugin_url = $this->plugin_url();
$library = $this->get_option ( 'library' );
$start = "\n<!-- Begin Shadowbox JS v{$this->version} -->\n";
$start .= "<!-- Selected Players: " . implode ( ', ', (array) $this->get_option ( 'players' ) ) . " -->\n";
$end = "<!-- End Shadowbox JS -->\n\n";
// Shadowbox initialization options
foreach ( array_keys ( $this->options ) as $key )
if ( ! in_array ( $key , $this->protected_options () ) )
$params[$key] = $this->get_option ( $key );
$init_vars = apply_filters ( 'shadowbox_conf' , $params );
$init_opts = '';
foreach ( $init_vars as $key => $value ) {
if ( in_array ( $key , array ( 'flashParams' , 'flashVars' ) ) ) {
$init_opts .= "\t\t$key: " . $this->esc ( $value , 'htmledit' ) . ",\n";
} else if ( in_array ( $value , array ( 'true' , 'false' ) ) || is_int ( $value ) ) {
$init_opts .= "\t\t$key: " . $this->esc ( $value ) . ",\n";
} else if ( is_string ( $value ) ) {
$init_opts .= "\t\t$key: \"" . $this->esc ( $value ) . "\",\n";
}
}
// The full Shadowbox configuration
$init = "<script type=\"text/javascript\">\n";
$init .= "/* <![CDATA[ */\n";
$init .= " var shadowbox_conf = {\n";
$init .= rtrim ( $init_opts , " ,\n" ) . "\n";
$init .= " };\n";
$init .= " Shadowbox.init(shadowbox_conf);\n";
$init .= "/* ]]> */\n";
$init .= "</script>\n";
echo $start . $init . $end;
}
/**
* This function is called by the add_filter WordPress function to
* link the gallery images directly to their full size counterpart
*
* @param string $link The link of the attachment
* @param integer $id The id of the post
* @return string
* @since 2.0.1
*/
function attachment_direct_linkage ( $link , $id ) {
$mimetypes = array ( 'image/jpeg' , 'image/png' , 'image/gif' );
$post = get_post ( $id );
if ( in_array ( $post->post_mime_type , $mimetypes ) )
return wp_get_attachment_url ( $id );
else
return $link;
}
/**
* This function is called by the add_filter WordPress function to add
* the rel="shadowbox[post-123]" attribute to all links of a specified
* type.
*
* @param string $content The content of the post
* @return string
* @since 2.0.3
*/
function add_attr_to_link ( $content , $post_or_id = null ) {
if ( empty ( $content ) )
return $content;
// Set the album ID, if the image is coming from a gallery use the gallery ID, otherwise use the ID of the post
if ( is_object ( $post_or_id ) ) {
$albumid = "sbpost-{$post_or_id->ID}";
} elseif ( is_int ( $post_or_id ) && $post_or_id != 0 ) {
$p = get_post ( $post_or_id );
$albumid = "sbalbum-{$p->post_parent}";
} else {
global $post;
if ( isset ( $post) && is_object ( $post ) && is_int ( $post->ID ) )
$albumid = "sbpost-{$post->ID}";
else
$albumid = "sbgroup-" . time();
}
$img_pattern = '/<a(.*?)href=([\'"])([^>]*)\.(bmp|gif|jpe|jpe?g|png)\\2(.*?)>/i';
$mov_pattern = '/<a(.*?)href=([\'"])([^>]*)\.(swf|dv|moo?v|movie|asf|wmv?|avi|mpe?g)\\2(.*?)>/i';
$aud_pattern = '/<a(.*?)href=([\'"])([^>]*)\.(mp3|aac)\\2(.*?)>/i';
$tube_pattern = '/<a(.*?)href=([\'"])([^>]*)(youtube\.com\/(watch|v\/)|video\.google\.com\/googleplayer.swf)(.*?)\\2(.*?)>/i';
$flv_pattern = '/<a(.*?)href=([\'"])([^>]*)\.(flv|f4v|mp4)\\2(.*?)>/i';
$master_pattern = '/<a(.*?)href=([\'"])([^>]*)(\.(bmp|gif|jpe|jpe?g|png|swf|flv|f4v|dv|moo?v|movie|mp4|asf|wmv?|avi|mpe?g|mp3|aac)\\2|(youtube\.com\/(watch|v\/)|video\.google\.com\/googleplayer.swf))(.*?)>/i';
// Rel attrs for different file types
$img_rel_attr = 'rel=$2shadowbox[' . $albumid . '];player=img;$2';
$mov_rel_attr = 'rel=$2shadowbox[' . $albumid . '];width=' . $this->get_option ( 'genericVideoWidth' ) . ';height=' . $this->get_option ( 'genericVideoHeight' ) . ';$2';
$aud_rel_attr = 'rel=$2shadowbox[' . $albumid . '];player=flv;width=500;height=0;$2';
$tube_rel_attr = 'rel=$2shadowbox[' . $albumid . '];player=swf;width=' . $this->get_option ( 'genericVideoWidth' ) . ';height=' . $this->get_option ( 'genericVideoHeight' ) . ';$2';
$flv_rel_attr = 'rel=$2shadowbox[' . $albumid . '];player=flv;width=' . $this->get_option ( 'genericVideoWidth' ) . ';height=' . $this->get_option ( 'genericVideoHeight' ) . ';$2';
// Replacement patterns
$img_replace = '<a$1href=$2$3.$4$2 ' . $img_rel_attr . '$5>';
$mov_replace = '<a$1href=$2$3.$4$2 ' . $mov_rel_attr . '$5>';
$aud_replace = '<a$1href=$2$3.$4$2 ' . $aud_rel_attr . '$5>';
$tube_replace = '<a$1href=$2$3$4$6$2 ' . $tube_rel_attr . '$7>';
$flv_replace = '<a$1href=$2$3.$4$2 ' . $flv_rel_attr . '$5>';
// Non specific search patterns
$rel_pattern = '/\ rel=([\'"])(.*?)\\1/i';
$box_rel_pattern = '/\ rel=([\'"])(.*?)(shadow|light|no)box(.*?)\\1/i';
$slbox_rel_pattern = '/\ rel=([\'"])(.*?)(shadow|light)box(.*?)\\1/i';
if ( preg_match_all ( $master_pattern , $content , $links ) ) {
$modify = false;
foreach ( $links[0] as $link ) {
if ( preg_match ( $img_pattern , $link ) && $this->get_option ( 'autoimg' ) == "true" ) {
$link_pattern = $img_pattern;
$rel_attr = $img_rel_attr;
$link_replace = $img_replace;
$modify = true;
} else if ( preg_match ( $mov_pattern , $link ) && $this->get_option ( 'automov' ) == "true" ) {
$link_pattern = $mov_pattern;
$rel_attr = $mov_rel_attr;
$link_replace = $mov_replace;
$modify = true;
} else if ( preg_match ( $aud_pattern , $link ) && $this->get_option ( 'autoaud' ) == "true" ) {
$link_pattern = $aud_pattern;
$rel_attr = $aud_rel_attr;
$link_replace = $aud_replace;
$modify = true;
} else if ( preg_match ( $tube_pattern , $link ) && $this->get_option ( 'autotube' ) == "true" ) {
$link_pattern = $tube_pattern;
$rel_attr = $tube_rel_attr;
$link_replace = $tube_replace;
$modify = true;
} else if ( preg_match ( $flv_pattern , $link ) && $this->get_option ( 'autoflv' ) == "true" ) {
$link_pattern = $flv_pattern;
$rel_attr = $flv_rel_attr;
$link_replace = $flv_replace;
$modify = true;
}
if ( ! preg_match ( $rel_pattern , $link ) && $modify === true ) {
$link_replace = preg_replace ( $link_pattern , $link_replace , $link );
$content = str_replace ( $link , $link_replace , $content );
} else if ( ! preg_match ( $box_rel_pattern , $link ) && $modify === true ) {
preg_match ( $rel_pattern , $link , $link_rel );
$link_no_rel = preg_replace( $rel_pattern , '' , $link );
$link_replace = preg_replace ( $link_pattern , $link_replace , $link_no_rel );
$content = str_replace ( $link , $link_replace , $content );
}
$modify = false;
}
}
// Check to see if we need to try to load shadowbox and dependencies into the footer
if ( preg_match ( $slbox_rel_pattern , $content ) && $this->get_option ( 'smartLoad' ) == 'true' ) {
$this->possibly_enqueue ( 'shadowbox' );
}
return $content;
}
}
@@ -0,0 +1,614 @@
<?php
/**
* Intermingled PHP and HTML for the options page
*
* This file contains all PHP and HTML required for the Shadowbox Options Page in the admin of WordPress
*
* @package shadowbox-js
* @subpackage options-page
* @since 3.0.0.4
*/
?>
<div class="wrap shadowbox">
<h2><?php _e( 'Shadowbox JS' , 'shadowbox-js' ); ?></h2>
<?php if ( has_filter ( 'shadowbox-js' ) ) : ?>
<div id="shadowbox-override" class="notice">
<p>
<strong>
<?php _e( 'The URL for shadowbox.js has been overridden. Numerous options on this page will not display when the URL for shadowbox.js has been overriden as they will not have any effect.' ); ?>
</strong>
</p>
</div>
<?php endif; ?>
<form action="options.php" method="post">
<?php settings_fields ( 'shadowbox' ); ?>
<?php if ( ! empty ( $this->options ) ) : // Start option check. Don't show most of the form if there are no options in the db ?>
<input type="hidden" name="shadowbox[version]" value="<?php echo $this->esc ( $this->dbversion , 'attr' ); ?>" />
<h3><?php _e( 'General' , 'shadowbox-js' ); ?></h3>
<p><?php _e( 'These are general options for the Shadowbox Javascript that tell Shadowbox how to run, how to look and what language to use.' , 'shadowbox-js' ); ?></p>
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php _e( 'Javascript Library' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[library]">
<option value="base"<?php selected ( 'base' , $this->get_option ( 'library' ) ); ?>><?php _e( 'None' , 'shadowbox-js' ); ?></option>
<option value="yui"<?php selected ( 'yui' , $this->get_option ( 'library' ) ); ?>>YUI</option>
<option value="prototype"<?php selected ( 'prototype' , $this->get_option ( 'library' ) ); ?>>Prototype</option>
<option value="jquery"<?php selected ( 'jquery' , $this->get_option ( 'library' ) ); ?>>jQuery</option>
<option value="mootools"<?php selected ( 'mootools' , $this->get_option ( 'library' ) ); ?>>Mootools</option>
</select>
<br />
<?php _e( 'Default is None.' , 'shadowbox-js' ); ?>
<?php if ( has_filter ( 'shadowbox-js' ) ) : ?>
<div id="shadowbox-override-library" class="notice">
<p>
<strong>
<?php _e( 'The URL for shadowbox.js has been overridden. The above setting must match the library/adapter that was chosen when building shadowbox.js or Shadowbox will not function.' ); ?>
</strong>
</p>
</div>
<?php endif; ?>
</td>
</tr>
<?php if ( ! has_filter ( 'shadowbox-js' ) ) : ?>
<tr valign="top">
<th scope="row">
<?php _e( 'Language' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[language]">
<?php foreach ( $this->languages () as $language ) : ?>
<option value="<?php echo $language; ?>"<?php selected ( $language , $this->get_option ( 'language' ) ); ?>><?php echo $language; ?></option>
<?php endforeach; ?>
<?php unset ( $language ); ?>
</select>
<br />
<?php _e( 'Default is en.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Players' , 'shadowbox-js' ); ?>
</th>
<td>
<p><input type="checkbox" name="shadowbox[players][]" value="html"<?php checked ( true , in_array ( 'html' , (array) $this->get_option ( 'players' ) ) ); ?>/>HTML</p>
<p><input type="checkbox" name="shadowbox[players][]" value="iframe"<?php checked ( true , in_array ( 'iframe' , (array) $this->get_option ( 'players' ) ) ); ?>/>IFRAME</p>
<p><input type="checkbox" name="shadowbox[players][]" value="img"<?php checked ( true , in_array ( 'img' , (array) $this->get_option ( 'players' ) ) ); ?>/>IMG</p>
<p><input type="checkbox" name="shadowbox[players][]" value="qt"<?php checked ( true , in_array ( 'qt' , (array) $this->get_option ( 'players' ) ) ); ?>/>QT</p>
<p><input type="checkbox" name="shadowbox[players][]" value="swf"<?php checked ( true , in_array ( 'swf' , (array) $this->get_option ( 'players' ) ) ); ?>/> SWF</p>
<p><input type="checkbox" name="shadowbox[players][]" value="wmp"<?php checked ( true , in_array ( 'wmp' , (array) $this->get_option ( 'players' ) ) ); ?>/> WMP</p>
<?php if ( $this->get_option ( 'enableFlv' ) != 'true' ) $class = ' class="hidden"'; else $class = ''; ?>
<p id="flvplayer"<?php echo $class; ?>><input type="checkbox" name="shadowbox[players][]" value="flv"<?php checked ( true , in_array ( 'flv' , (array) $this->get_option ( 'players' ) ) ); ?>/>FLV</p>
<?php _e( 'The list of enabled or disabled players. Default is HTML, IFRAME, IMG, QT, SWF and WMP. The FLV option will not be available until you <a href="#enableFlv">enable FLV support</a> as outlined below.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Enable FLV Support' , 'shadowbox-js' ); ?>
</th>
<td>
<select id="enableFlv" name="shadowbox[enableFlv]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'enableFlv' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'enableFlv' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'By enabling FLV support you are agreeing to the the <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">noncommercial license</a> used by JW FLV Media Player. The JW FLV Media Player is licensed under the terms of the <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. After enabling FLV support you will need to select FLV from the list of players above, and optionally enable automation for FLV links under "Shadowbox Automation". Default is false.' , 'shadowbox-js' ); ?>
</td>
</tr>
<?php endif; ?>
<tr valign="top">
<th scope="row">
<?php _e( 'Enable Smart Loading' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[smartLoad]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'smartLoad' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'smartLoad' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Enabling this will only load Shadowbox and its dependencies when needed based on the content of your posts. Please note that when enabling this Shadowbox will not be loaded if rel="shadowbox" is not found in the content of your post(s). If you experience problems after enabling this, try disabling. Default is false.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Use Cached shadowbox.js' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[useCache]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'useCache' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'useCache' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'This will allow this plugin to create a cached copy of shadowbox.js in wp-content/uploads/shadowbox-js. With this disabled the shadowbox.js file will be built on the fly during each page load. If you experience problems with this plugin not working with this enabled, try disabling. Default is true.' , 'shadowbox-js' ); ?>
</td>
</tr>
</table>
<h3 id="sbadvancedtitle"><?php _e( 'Advanced Configuration' , 'shadowbox-js' ); ?></h3>
<p><input id="sbadvancedbtn" type="button" class="button" value="<?php _e( 'Show Advanced Configuration' , 'shadowbox-js' ); ?>" style="display:none; font-weight: bold; width: 216px;"/></p>
<table id="sbadvanced" class="form-table">
<tr valign="top">
<th scope="row">
<?php _e( 'Animate' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[animate]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'animate' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'animate' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this false to disable all fancy animations (except fades). This can improve the overall effect on computers with poor performance. Defaults to true.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Fade Animations' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[animateFade]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'animateFade' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'animateFade' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this false to disable all fading animations. Defaults to true.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Animation Sequence' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[animSequence]">
<option value="wh"<?php selected ( 'wh' , $this->get_option ( 'animSequence' ) ); ?>>wh</option>
<option value="hw"<?php selected ( 'hw' , $this->get_option ( 'animSequence' ) ); ?>>hw</option>
<option value="sync"<?php selected ( 'sync' , $this->get_option ( 'animSequence' ) ); ?>>sync</option>
</select>
<br />
<?php _e( 'The animation sequence to use when resizing Shadowbox. May be either "wh" (width first, then height), "hw" (height first, then width), or "sync" (both simultaneously). Defaults to "sync".' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Modal' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[modal]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'modal' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'modal' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this true to disable listening for mouse clicks on the overlay that will close Shadowbox. Defaults to false.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Show Overlay' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[showOverlay]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'showOverlay' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'showOverlay' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this false to disable showing the overlay. Defaults to true.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Overlay Color' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[overlayColor]" value="<?php echo $this->esc ( $this->get_option ( 'overlayColor' ) , 'attr' ); ?>" size="7" />
<br />
<?php _e( 'The color to use for the modal overlay (in hex). Defaults to "#000".' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Overlay Opacity' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[overlayOpacity]" value="<?php echo $this->esc ( $this->get_option ( 'overlayOpacity' ) , 'attr' ); ?>" size="4" />
<br />
<?php _e( 'The opacity to use for the modal overlay. Defaults to 0.8.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Flash Background Color' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[flashBgColor]" value="<?php echo $this->esc ( $this->get_option ( 'flashBgColor' ) , 'attr' ); ?>" size="7" />
<br />
<?php _e( 'The default background color to use for Flash movies. Defaults to "#000000".' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Auto-Play Movies' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[autoplayMovies]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'autoplayMovies' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'autoplayMovies' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this false to disable automatically playing movies when they are loaded. Defaults to true.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Show Movie Controls' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[showMovieControls]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'showMovieControls' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'showMovieControls' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this false to disable displaying QuickTime and Windows Media player movie control bars. Defaults to true.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Slideshow Delay' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[slideshowDelay]" value="<?php echo $this->esc ( $this->get_option ( 'slideshowDelay' ) , 'attr' ); ?>" size="2" style="width: 1.5em;" />
<br />
<?php _e( 'A delay (in seconds) to use for slideshows. If set to anything other than 0, this value determines an interval at which Shadowbox will automatically proceed to the next piece in the gallery. Defaults to 0.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Resize Duration' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[resizeDuration]" value="<?php echo $this->esc ( $this->get_option ( 'resizeDuration' ) , 'attr' ); ?>" size="4" />
<br />
<?php _e( 'The duration (in seconds) of the resizing animations. Defaults to 0.55.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Fade Duration' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[fadeDuration]" value="<?php echo $this->esc ( $this->get_option ( 'fadeDuration' ) , 'attr' ); ?>" size="4" />
<br />
<?php _e( 'The duration (in seconds) of the fade animations. Defaults to 0.35.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Display Navigation' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[displayNav]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'displayNav' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'displayNav' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this false to hide the gallery navigation controls. Defaults to true.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Continuous' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[continuous]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'continuous' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'continuous' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this true to enable "continuous" galleries. By default, the galleries will not let a user go before the first image or after the last. Enabling this feature will let the user go directly to the first image in a gallery from the last one by selecting "Next". Defaults to false.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Display Counter' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[displayCounter]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'displayCounter' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'displayCounter' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this false to hide the gallery counter. Counters are never displayed on elements that are not part of a gallery. Defaults to true.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Counter Type' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[counterType]">
<option value="default"<?php selected ( 'default' , $this->get_option ( 'counterType' ) ); ?>><?php _e( 'default' , 'shadowbox-js' ); ?></option>
<option value="skip"<?php selected ( 'skip' , $this->get_option ( 'counterType' ) ); ?>><?php _e( 'skip' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'The mode to use for the gallery counter. May be either "default" or "skip". The default counter is a simple "1 of 5" message. The skip counter displays a separate link to each piece in the gallery, enabling quick navigation in large galleries. Defaults to "default".' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Counter Limit' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[counterLimit]" value="<?php echo $this->esc ( $this->get_option ( 'counterLimit' ) , 'attr' ); ?>" size="3" />
<br />
<?php _e( 'Limits the number of counter links that will be displayed in a "skip" style counter. If the actual number of gallery elements is greater than this value, the counter will be restrained to the elements immediately preceding and following the current element. Defaults to 10.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Viewport Padding' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[viewportPadding]" value="<?php echo $this->esc ( $this->get_option ( 'viewportPadding' ) , 'attr' ); ?>" size="3" />
<br />
<?php _e( 'The amount of padding (in pixels) to maintain around the edge of the browser window. Defaults to 20.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Handle Oversize' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[handleOversize]">
<option value="none"<?php selected ( 'none' , $this->get_option ( 'handleOversize' ) ); ?>><?php _e( 'none' , 'shadowbox-js' ); ?></option>
<option value="resize"<?php selected ( 'resize' , $this->get_option ( 'handleOversize' ) ); ?>><?php _e( 'resize' , 'shadowbox-js' ); ?></option>
<option value="drag"<?php selected ( 'drag' , $this->get_option ( 'handleOversize' ) ); ?>><?php _e( 'drag' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'The mode to use for handling content that is too large for the viewport. May be one of "none", "resize", or "drag" (for images). The "none" setting will not alter the image dimensions, though clipping may occur. Setting this to "resize" enables on-the-fly resizing of large content. In this mode, the height and width of large, resizable content will be adjusted so that it may still be viewed in its entirety while maintaining its original aspect ratio. The "drag" mode will display an oversized image at its original resolution, but will allow the user to drag it within the view to see portions that may be clipped. Defaults to "resize".' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Handle Unsupported' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[handleUnsupported]">
<option value="link"<?php selected ( 'link' , $this->get_option ( 'handleUnsupported' ) ); ?>><?php _e( 'link' , 'shadowbox-js' ); ?></option>
<option value="remove"<?php selected ( 'remove' , $this->get_option ( 'handleUnsupported' ) ); ?>><?php _e( 'remove' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'The mode to use for handling unsupported media. May be either "link" or "remove". Media are unsupported when the browser plugin required to display the media properly is not installed. The link option will display a user-friendly error message with a link to a page where the needed plugin can be downloaded. The remove option will simply remove any unsupported gallery elements from the gallery before displaying it. With this option, if the element is not part of a gallery, the link will simply be followed. Defaults to "link".' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Auto Dimensions' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[autoDimensions]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'autoDimensions' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'autoDimensions' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this true to automatically set the initialHeight and initialWidth automatically from the configured object\'s height and width. Defaults to false.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Initial Height' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[initialHeight]" value="<?php echo $this->esc ( $this->get_option ( 'initialHeight' ) , 'attr' ); ?>" size="3" />
<br />
<?php _e( 'The height of Shadowbox (in pixels) when it first appears on the screen. Defaults to 160.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Initial Width' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[initialWidth]" value="<?php echo $this->esc ( $this->get_option ( 'initialWidth' ) , 'attr' ); ?>" size="3" />
<br />
<?php _e( 'The width of Shadowbox (in pixels) when it first appears on the screen. Defaults to 320.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Enable Keys' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[enableKeys]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'enableKeys' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'enableKeys' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this false to disable keyboard navigation of galleries. Defaults to true.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Skip Setup' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[skipSetup]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'skipSetup' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'skipSetup' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this true to skip Shadowbox.setup() during Shadowbox.init(). For purposes of this plugin you will have to manually add Shadowbox.setup() to the footer of your theme. Defaults to false.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Use Sizzle' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[useSizzle]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'useSizzle' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'useSizzle' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Set this true to enable loading the <a href="http://sizzlejs.com/">Sizzle.js</a> CSS selector library. Note that if you choose not to use Sizzle you may not use CSS selectors to set up your links. In order to use Sizzle.js you must set Skip Setup to true. Defaults to false.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Flash Params' , 'shadowbox-js' ); ?>
</th>
<td>
<textarea name="shadowbox[flashParams]" rows="10" cols="50"><?php echo $this->esc ( $this->get_option ( 'flashParams' ) , 'htmledit' ); ?></textarea>
<br />
<?php _e( 'A list of parameters (in a JavaScript object) that will be passed to a flash &lt;object&gt;. For a partial list of available parameters, see <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701">this page</a>. Only one parameter is specified by default: bgcolor. Defaults to {bgcolor:"#000000", allowFullScreen:true}.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Flash Vars' , 'shadowbox-js' ); ?>
</th>
<td>
<textarea name="shadowbox[flashVars]" rows="10" cols="50"><?php echo $this->esc ( $this->get_option ( 'flashVars' ), 'htmledit' ); ?></textarea>
<br />
<?php _e( 'A list of variables (in a JavaScript object) that will be passed to a flash movie as <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16417">FlashVars</a>. Defaults to {}.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Flash Version' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[flashVersion]" value="<?php echo $this->esc ( $this->get_option ( 'flashVersion' ) , 'attr' ); ?>" size="5" />
<br />
<?php _e( 'The minimum Flash version required to play a flash movie (as a string). Defaults to "9.0.0".' , 'shadowbox-js' ); ?>
</td>
</tr>
</table>
<h3><?php _e( 'Shadowbox Automation' , 'shadowbox-js' ); ?></h3>
<p><?php _e( 'These options will give you the capability to have Shadowbox automatically used for all of a certain file type.' , 'shadowbox-js' ); ?></p>
<table class="form-table">
<tr valign="top">
<th scope="row">
<acronym title="bmp, gif, png, jpg, and jpeg"><?php _e( 'Image Links' , 'shadowbox-js' ); ?></acronym>
</th>
<td>
<select name="shadowbox[autoimg]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'autoimg' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'autoimg' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Default is true.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<acronym title="flv, f4v, and mp4"><?php _e( 'FLV Links' , 'shadowbox-js' ); ?></acronym>
</th>
<td>
<select id="autoflv" name="shadowbox[autoflv]"<?php if ( $this->get_option ( 'enableFlv' ) == 'false' && ! has_filter ( 'shadowbox-js' ) ) { echo ' disabled="disabled"'; } ?>>
<option value="true"<?php selected ( 'true' , $this->get_option ( 'autoflv' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'autoflv' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php if ( ! has_filter ( 'shadowbox-js' ) )
_e( 'Default is false. To enable this option you must first <a href="#enableFlv">enable FLV support</a>.' , 'shadowbox-js' );
else
_e( 'Default is false.' , 'shadowbox-js' );
?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<acronym title="swf, flv, f4v, dv, mov, moov, movie, mp4, asf, wm, wmv, avi, mpg and mpeg"><?php _e( 'Movie Links' , 'shadowbox-js' ); ?></acronym>
</th>
<td>
<select name="shadowbox[automov]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'automov' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'automov' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Default is true.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<acronym title="mp3, aac"><?php _e( 'Music Links' , 'shadowbox-js' ); ?></acronym>
</th>
<td>
<select name="shadowbox[autoaud]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'autoaud' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'autoaud' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Default is true.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'YouTube and Google Video Links' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[autotube]">
<option value="true"<?php selected ( 'true' , $this->get_option ( 'autotube' ) ); ?>><?php _e( 'true' , 'shadowbox-js' ); ?></option>
<option value="false"<?php selected ( 'false' , $this->get_option ( 'autotube' ) ); ?>><?php _e( 'false' , 'shadowbox-js' ); ?></option>
</select>
<br />
<?php _e( 'Default is true.' , 'shadowbox-js' ); ?>
</td>
</tr>
</table>
<h3><?php _e( 'Sizes' , 'shadowbox-js' ); ?></h3>
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php _e( 'Generic Video Width' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[genericVideoWidth]" value="<?php echo $this->esc ( $this->get_option ( 'genericVideoWidth' ) , 'attr' ); ?>" size="3" />
<br />
<?php _e( 'The width of Shadowbox (in pixels) when displaying videos. Defaults to 640.' , 'shadowbox-js' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Generic Video Height' , 'shadowbox-js' ); ?>
</th>
<td>
<input type="text" name="shadowbox[genericVideoHeight]" value="<?php echo $this->esc ( $this->get_option ( 'genericVideoHeight' ) , 'attr' ); ?>" size="3" />
<br />
<?php _e( 'The height of Shadowbox (in pixels) when when displaying videos. Defaults to 385.' , 'shadowbox-js' ); ?>
</td>
</tr>
</table>
<?php else : // Else option check. Display this if there are no options in the DB ?>
<div id="error" class="error"><p><strong><?php _e( 'The settings for this plugin have been deleted. The plugin can now be' , 'shadowbox-js' ); ?> <a href="<?php echo wp_nonce_url ( 'plugins.php?action=deactivate&amp;plugin=' . $this->plugin_basename , 'deactivate-plugin_' . $this->plugin_basename ); ?>" title="<?php _e( 'Deactivate Shadowbox JS' , 'shadowbox-js' ); ?>" style="border-bottom: none;"><?php _e( 'deactivated' , 'shadowbox-js' ); ?></a>. <?php _e( 'If you want to create the settings with their defaults so this plugin can be used again, set "Reset to Defaults" to "true" and click "Save Changes"' , 'shadowbox-js' ); ?>.</strong></p></div>
<?php endif; // End Option Check ?>
<h3><?php _e( 'Resets' , 'shadowbox-js' ); ?></h3>
<p><?php _e( 'These options will allow you to revert the options back to their defaults or to remove the options from the database for a clean uninstall.' , 'shadowbox-js' ); ?></p>
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php _e( 'Reset to Defaults' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[default]">
<option value="false" selected="selected"><?php _e( 'false' , 'shadowbox-js' ); ?></option>
<option value="true"><?php _e( 'true' , 'shadowbox-js' ); ?></option>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Delete Options for a Clean Uninstall' , 'shadowbox-js' ); ?>
</th>
<td>
<select name="shadowbox[delete]">
<option value="false" selected="selected"><?php _e( 'false' , 'shadowbox-js' ); ?></option>
<option value="true"><?php _e( 'true' , 'shadowbox-js' ); ?></option>
</select>
</td>
</tr>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e( 'Save Changes' , 'shadowbox-js' ) ?>" />
</p>
</form>
</div>
@@ -0,0 +1,22 @@
jQuery(document).ready(function (){
var sbadvshow = shadowboxJsHelperL10n.advConfShow;
var sbadvhide = shadowboxJsHelperL10n.advConfHide;
jQuery('#sbadvancedbtn').show();
jQuery('#sbadvancedtitle').hide();
jQuery('#sbadvanced').hide();
jQuery('#sbadvancedbtn').click(function(){
jQuery('#sbadvanced').toggle();
jQuery(this).attr('value',jQuery(this).attr('value') == sbadvshow ? sbadvhide : sbadvshow);
});
jQuery('#enableFlv').change(function(){
if (jQuery(this).val() == 'true') {
var response = confirm(shadowboxJsHelperL10n.messageConfirm);
if ( ! response ) {
jQuery(this).val('false');
} else {
jQuery('#flvplayer').show();
jQuery('#autoflv').removeAttr('disabled');
}
}
});
});
@@ -0,0 +1,523 @@
msgid ""
msgstr ""
"Project-Id-Version: shadowbox-js\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-03-28 09:46-0600\n"
"PO-Revision-Date: 2010-03-28 09:46-0600\n"
"Last-Translator: Matt Martz <matt@sivel.net>\n"
"Language-Team: Matt Martz <matt@sivel.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: /var/www/trunk/wp-content/plugins/shadowbox-js\n"
"X-Poedit-SearchPath-0: .\n"
#: shadowbox-js.php:146
#, php-format
msgid "Shadowbox JS has been automatically deactivated because the file <strong>%s</strong> is missing. Please reinstall the plugin and reactivate."
msgstr ""
#: inc/admin.php:100
#: inc/options-page.php:116
msgid "Show Advanced Configuration"
msgstr ""
#: inc/admin.php:101
msgid "Hide Advanced Configuration"
msgstr ""
#: inc/admin.php:102
msgid "Do you agree that you are not using FLV support for commercial purposes or have already purchased a license for JW FLV Media Player?"
msgstr ""
#: inc/admin.php:580
#: inc/options-page.php:13
msgid "Shadowbox JS"
msgstr ""
#: inc/admin.php:595
msgid "Settings"
msgstr ""
#: inc/options-page.php:18
msgid "The URL for shadowbox.js has been overridden. Numerous options on this page will not display when the URL for shadowbox.js has been overriden as they will not have any effect."
msgstr ""
#: inc/options-page.php:27
msgid "General"
msgstr ""
#: inc/options-page.php:28
msgid "These are general options for the Shadowbox Javascript that tell Shadowbox how to run, how to look and what language to use."
msgstr ""
#: inc/options-page.php:32
msgid "Javascript Library"
msgstr ""
#: inc/options-page.php:36
msgid "None"
msgstr ""
#: inc/options-page.php:43
msgid "Default is None."
msgstr ""
#: inc/options-page.php:48
msgid "The URL for shadowbox.js has been overridden. The above setting must match the library/adapter that was chosen when building shadowbox.js or Shadowbox will not function."
msgstr ""
#: inc/options-page.php:58
msgid "Language"
msgstr ""
#: inc/options-page.php:68
msgid "Default is en."
msgstr ""
#: inc/options-page.php:73
msgid "Players"
msgstr ""
#: inc/options-page.php:84
msgid "The list of enabled or disabled players. Default is HTML, IFRAME, IMG, QT, SWF and WMP. The FLV option will not be available until you <a href=\"#enableFlv\">enable FLV support</a> as outlined below."
msgstr ""
#: inc/options-page.php:89
msgid "Enable FLV Support"
msgstr ""
#: inc/options-page.php:93
#: inc/options-page.php:107
#: inc/options-page.php:124
#: inc/options-page.php:137
#: inc/options-page.php:164
#: inc/options-page.php:177
#: inc/options-page.php:220
#: inc/options-page.php:233
#: inc/options-page.php:276
#: inc/options-page.php:289
#: inc/options-page.php:302
#: inc/options-page.php:375
#: inc/options-page.php:408
#: inc/options-page.php:421
#: inc/options-page.php:434
#: inc/options-page.php:481
#: inc/options-page.php:494
#: inc/options-page.php:511
#: inc/options-page.php:524
#: inc/options-page.php:537
#: inc/options-page.php:581
#: inc/options-page.php:592
msgid "true"
msgstr ""
#: inc/options-page.php:94
#: inc/options-page.php:108
#: inc/options-page.php:125
#: inc/options-page.php:138
#: inc/options-page.php:165
#: inc/options-page.php:178
#: inc/options-page.php:221
#: inc/options-page.php:234
#: inc/options-page.php:277
#: inc/options-page.php:290
#: inc/options-page.php:303
#: inc/options-page.php:376
#: inc/options-page.php:409
#: inc/options-page.php:422
#: inc/options-page.php:435
#: inc/options-page.php:482
#: inc/options-page.php:495
#: inc/options-page.php:512
#: inc/options-page.php:525
#: inc/options-page.php:538
#: inc/options-page.php:580
#: inc/options-page.php:591
msgid "false"
msgstr ""
#: inc/options-page.php:97
msgid "By enabling FLV support you are agreeing to the the <a href=\"http://creativecommons.org/licenses/by-nc-sa/3.0/\">noncommercial license</a> used by JW FLV Media Player. The JW FLV Media Player is licensed under the terms of the <a href=\"http://creativecommons.org/licenses/by-nc-sa/3.0/\">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. After enabling FLV support you will need to select FLV from the list of players above, and optionally enable automation for FLV links under \"Shadowbox Automation\". Default is false."
msgstr ""
#: inc/options-page.php:103
msgid "Enable Smart Loading"
msgstr ""
#: inc/options-page.php:111
msgid "Enabling this will only load Shadowbox and its dependencies when needed based on the content of your posts.\tPlease note that when enabling this Shadowbox will not be loaded if rel=\"shadowbox\" is not found in the content of your post(s). If you experience problems after enabling this, try disabling. Default is false."
msgstr ""
#: inc/options-page.php:115
msgid "Advanced Configuration"
msgstr ""
#: inc/options-page.php:120
msgid "Animate"
msgstr ""
#: inc/options-page.php:128
msgid "Set this false to disable all fancy animations (except fades). This can improve the overall effect on computers with poor performance. Defaults to true."
msgstr ""
#: inc/options-page.php:133
msgid "Fade Animations"
msgstr ""
#: inc/options-page.php:141
msgid "Set this false to disable all fading animations. Defaults to true."
msgstr ""
#: inc/options-page.php:146
msgid "Animation Sequence"
msgstr ""
#: inc/options-page.php:155
msgid "The animation sequence to use when resizing Shadowbox. May be either \"wh\" (width first, then height), \"hw\" (height first, then width), or \"sync\" (both simultaneously). Defaults to \"sync\"."
msgstr ""
#: inc/options-page.php:160
msgid "Modal"
msgstr ""
#: inc/options-page.php:168
msgid "Set this true to disable listening for mouse clicks on the overlay that will close Shadowbox. Defaults to false."
msgstr ""
#: inc/options-page.php:173
msgid "Show Overlay"
msgstr ""
#: inc/options-page.php:181
msgid "Set this false to disable showing the overlay. Defaults to true."
msgstr ""
#: inc/options-page.php:186
msgid "Overlay Color"
msgstr ""
#: inc/options-page.php:191
msgid "The color to use for the modal overlay (in hex). Defaults to \"#000\"."
msgstr ""
#: inc/options-page.php:196
msgid "Overlay Opacity"
msgstr ""
#: inc/options-page.php:201
msgid "The opacity to use for the modal overlay. Defaults to 0.8."
msgstr ""
#: inc/options-page.php:206
msgid "Flash Background Color"
msgstr ""
#: inc/options-page.php:211
msgid "The default background color to use for Flash movies. Defaults to \"#000000\"."
msgstr ""
#: inc/options-page.php:216
msgid "Auto-Play Movies"
msgstr ""
#: inc/options-page.php:224
msgid "Set this false to disable automatically playing movies when they are loaded. Defaults to true."
msgstr ""
#: inc/options-page.php:229
msgid "Show Movie Controls"
msgstr ""
#: inc/options-page.php:237
msgid "Set this false to disable displaying QuickTime and Windows Media player movie control bars. Defaults to true."
msgstr ""
#: inc/options-page.php:242
msgid "Slideshow Delay"
msgstr ""
#: inc/options-page.php:247
msgid "A delay (in seconds) to use for slideshows. If set to anything other than 0, this value determines an interval at which Shadowbox will automatically proceed to the next piece in the gallery. Defaults to 0."
msgstr ""
#: inc/options-page.php:252
msgid "Resize Duration"
msgstr ""
#: inc/options-page.php:257
msgid "The duration (in seconds) of the resizing animations. Defaults to 0.55."
msgstr ""
#: inc/options-page.php:262
msgid "Fade Duration"
msgstr ""
#: inc/options-page.php:267
msgid "The duration (in seconds) of the fade animations. Defaults to 0.35."
msgstr ""
#: inc/options-page.php:272
msgid "Display Navigation"
msgstr ""
#: inc/options-page.php:280
msgid "Set this false to hide the gallery navigation controls. Defaults to true."
msgstr ""
#: inc/options-page.php:285
msgid "Continuous"
msgstr ""
#: inc/options-page.php:293
msgid "Set this true to enable \"continuous\" galleries. By default, the galleries will not let a user go before the first image or after the last. Enabling this feature will let the user go directly to the first image in a gallery from the last one by selecting \"Next\". Defaults to false."
msgstr ""
#: inc/options-page.php:298
msgid "Display Counter"
msgstr ""
#: inc/options-page.php:306
msgid "Set this false to hide the gallery counter. Counters are never displayed on elements that are not part of a gallery. Defaults to true."
msgstr ""
#: inc/options-page.php:311
msgid "Counter Type"
msgstr ""
#: inc/options-page.php:315
msgid "default"
msgstr ""
#: inc/options-page.php:316
msgid "skip"
msgstr ""
#: inc/options-page.php:319
msgid "The mode to use for the gallery counter. May be either \"default\" or \"skip\". The default counter is a simple \"1 of 5\" message. The skip counter displays a separate link to each piece in the gallery, enabling quick navigation in large galleries. Defaults to \"default\"."
msgstr ""
#: inc/options-page.php:324
msgid "Counter Limit"
msgstr ""
#: inc/options-page.php:329
msgid "Limits the number of counter links that will be displayed in a \"skip\" style counter. If the actual number of gallery elements is greater than this value, the counter will be restrained to the elements immediately preceding and following the current element. Defaults to 10."
msgstr ""
#: inc/options-page.php:334
msgid "Viewport Padding"
msgstr ""
#: inc/options-page.php:339
msgid "The amount of padding (in pixels) to maintain around the edge of the browser window. Defaults to 20."
msgstr ""
#: inc/options-page.php:344
msgid "Handle Oversize"
msgstr ""
#: inc/options-page.php:348
msgid "none"
msgstr ""
#: inc/options-page.php:349
msgid "resize"
msgstr ""
#: inc/options-page.php:350
msgid "drag"
msgstr ""
#: inc/options-page.php:353
msgid "The mode to use for handling content that is too large for the viewport. May be one of \"none\", \"resize\", or \"drag\" (for images). The \"none\" setting will not alter the image dimensions, though clipping may occur. Setting this to \"resize\" enables on-the-fly resizing of large content. In this mode, the height and width of large, resizable content will be adjusted so that it may still be viewed in its entirety while maintaining its original aspect ratio. The \"drag\" mode will display an oversized image at its original resolution, but will allow the user to drag it within the view to see portions that may be clipped. Defaults to \"resize\"."
msgstr ""
#: inc/options-page.php:358
msgid "Handle Unsupported"
msgstr ""
#: inc/options-page.php:362
msgid "link"
msgstr ""
#: inc/options-page.php:363
msgid "remove"
msgstr ""
#: inc/options-page.php:366
msgid "The mode to use for handling unsupported media. May be either \"link\" or \"remove\". Media are unsupported when the browser plugin required to display the media properly is not installed. The link option will display a user-friendly error message with a link to a page where the needed plugin can be downloaded. The remove option will simply remove any unsupported gallery elements from the gallery before displaying it. With this option, if the element is not part of a gallery, the link will simply be followed. Defaults to \"link\"."
msgstr ""
#: inc/options-page.php:371
msgid "Auto Dimensions"
msgstr ""
#: inc/options-page.php:379
msgid "Set this true to automatically set the initialHeight and initialWidth automatically from the configured object's height and width. Defaults to false."
msgstr ""
#: inc/options-page.php:384
msgid "Initial Height"
msgstr ""
#: inc/options-page.php:389
msgid "The height of Shadowbox (in pixels) when it first appears on the screen. Defaults to 160."
msgstr ""
#: inc/options-page.php:394
msgid "Initial Width"
msgstr ""
#: inc/options-page.php:399
msgid "The width of Shadowbox (in pixels) when it first appears on the screen. Defaults to 320."
msgstr ""
#: inc/options-page.php:404
msgid "Enable Keys"
msgstr ""
#: inc/options-page.php:412
msgid "Set this false to disable keyboard navigation of galleries. Defaults to true."
msgstr ""
#: inc/options-page.php:417
msgid "Skip Setup"
msgstr ""
#: inc/options-page.php:425
msgid "Set this true to skip Shadowbox.setup() during Shadowbox.init(). For purposes of this plugin you will have to manually add Shadowbox.setup() to the footer of your theme. Defaults to false."
msgstr ""
#: inc/options-page.php:430
msgid "Use Sizzle"
msgstr ""
#: inc/options-page.php:438
msgid "Set this true to enable loading the <a href=\"http://sizzlejs.com/\">Sizzle.js</a> CSS selector library. Note that if you choose not to use Sizzle you may not use CSS selectors to set up your links. In order to use Sizzle.js you must set Skip Setup to true. Defaults to false."
msgstr ""
#: inc/options-page.php:443
msgid "Flash Params"
msgstr ""
#: inc/options-page.php:448
msgid "A list of parameters (in a JavaScript object) that will be passed to a flash &lt;object&gt;. For a partial list of available parameters, see <a href=\"http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701\">this page</a>. Only one parameter is specified by default: bgcolor. Defaults to {bgcolor:\"#000000\", allowFullScreen:true}."
msgstr ""
#: inc/options-page.php:453
msgid "Flash Vars"
msgstr ""
#: inc/options-page.php:458
msgid "A list of variables (in a JavaScript object) that will be passed to a flash movie as <a href=\"http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16417\">FlashVars</a>. Defaults to {}."
msgstr ""
#: inc/options-page.php:463
msgid "Flash Version"
msgstr ""
#: inc/options-page.php:468
msgid "The minimum Flash version required to play a flash movie (as a string). Defaults to \"9.0.0\"."
msgstr ""
#: inc/options-page.php:472
msgid "Shadowbox Automation"
msgstr ""
#: inc/options-page.php:473
msgid "These options will give you the capability to have Shadowbox automatically used for all of a certain file type."
msgstr ""
#: inc/options-page.php:477
msgid "Image Links"
msgstr ""
#: inc/options-page.php:485
#: inc/options-page.php:515
#: inc/options-page.php:528
#: inc/options-page.php:541
msgid "Default is true."
msgstr ""
#: inc/options-page.php:490
msgid "FLV Links"
msgstr ""
#: inc/options-page.php:499
msgid "Default is false. To enable this option you must first <a href=\"#enableFlv\">enable FLV support</a>."
msgstr ""
#: inc/options-page.php:501
msgid "Default is false."
msgstr ""
#: inc/options-page.php:507
msgid "Movie Links"
msgstr ""
#: inc/options-page.php:520
msgid "Music Links"
msgstr ""
#: inc/options-page.php:533
msgid "YouTube and Google Video Links"
msgstr ""
#: inc/options-page.php:545
msgid "Sizes"
msgstr ""
#: inc/options-page.php:549
msgid "Generic Video Width"
msgstr ""
#: inc/options-page.php:554
msgid "The width of Shadowbox (in pixels) when displaying videos. Defaults to 640."
msgstr ""
#: inc/options-page.php:559
msgid "Generic Video Height"
msgstr ""
#: inc/options-page.php:564
msgid "The height of Shadowbox (in pixels) when when displaying videos. Defaults to 385."
msgstr ""
#: inc/options-page.php:569
msgid "The settings for this plugin have been deleted. The plugin can now be"
msgstr ""
#: inc/options-page.php:569
msgid "Deactivate Shadowbox JS"
msgstr ""
#: inc/options-page.php:569
msgid "deactivated"
msgstr ""
#: inc/options-page.php:569
msgid "If you want to create the settings with their defaults so this plugin can be used again, set \"Reset to Defaults\" to \"true\" and click \"Save Changes\""
msgstr ""
#: inc/options-page.php:571
msgid "Resets"
msgstr ""
#: inc/options-page.php:572
msgid "These options will allow you to revert the options back to their defaults or to remove the options from the database for a clean uninstall."
msgstr ""
#: inc/options-page.php:576
msgid "Reset to Defaults"
msgstr ""
#: inc/options-page.php:587
msgid "Delete Options for a Clean Uninstall"
msgstr ""
#: inc/options-page.php:598
msgid "Save Changes"
msgstr ""
+301
View File
@@ -0,0 +1,301 @@
=== Shadowbox JS ===
Contributors: sivel
Donate Link: http://sivel.net/donate
Tags: shadowbox-js, shadowbox, js, javascript, overlay, images, movies, audio, youtube, formatting, links, post, posts, lightbox, thickbox, lightview
Requires at least: 3.1
Tested up to: 3.2
Stable tag: 3.0.3.8
Shadowbox is an online media vieiwing application similar to Lightbox and Thickbox but with more functionality. Supports all types of media.
== Description ==
Shadowbox is an online media viewing application that supports all of the web's most popular media publishing formats. Shadowbox is written entirely in JavaScript and CSS and is highly customizable. Using Shadowbox, website authors can display a wide assortment of media in all major browsers without navigating users away from the linking page.
This plugin uses [Shadowbox](http://www.shadowbox-js.com/) written by [Michael J. I. Jackson](http://mjijackson.com).
Javascript libraries supported are: None, YUI, Prototype, jQuery and MooTools. Prototype and jQuery are used from the Javascript libraries included with Wordpress, YUI is loaded from Yahoo APIs and Mootools is loaded from Google APIs.
This plugin can also be used as a drop in lightbox replacement, without requiring you to edit posts already using lightbox.
By default this plugin will use Shadowbox for all image links, movie links, audio links and YouTube/Google Video links including those generated by the [gallery] shortcode.
Shadowbox is licensed under the terms of the [Shadowbox.js License](http://shadowbox-js.com/LICENSE). This license grants personal, non-commercial users the right to use Shadowbox without paying a fee. It also provides an option for users who wish to use Shadowbox for commercial purposes. You are encouraged to review the terms of the license before using Shadowbox. If you would like to use Shadowbox for commercial purposes, you can purchase a license from [http://www.shadowbox-js.com/](http://www.shadowbox-js.com/).
This plugin also makes use of the [JW FLV Player](http://www.longtailvideo.com/players/jw-flv-player/). JW FLV Player is licensed under the terms of the [Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License](http://creativecommons.org/licenses/by-nc-sa/3.0/). If you would like to use JW FLV Player for commercial purposes, you can purchase a license from [https://www.longtailvideo.com/players/order2](https://www.longtailvideo.com/players/order2).
Please use the Shadowbox JS [support forum](http://wordpress.org/tags/shadowbox-js) for problems or questions with this plugin. Support questions will be ignored if left as comments on my site, through my contact form or by email. The only supported location for support questions is [http://wordpress.org/tags/shadowbox-js](http://wordpress.org/tags/shadowbox-js).
This plugin is absolutely not supported when used in combination with the Thesis theme. Please do not ask for support if y
ou are using such a configuration.
== Installation ==
1. Upload the `shadowbox-js` folder to the `/wp-content/plugins/` directory or install directly through the plugin installer.
1. Activate the plugin through the 'Plugins' menu in WordPress or by using the link provided by the plugin installer
1. Optional: Visit the settings page in the Admin at `Settings -> Shadowbox JS`
1. Optional: Activate the 'Shadowbox JS - Use Title from Image' plugin to push the title from 'img' tags onto the parent 'a' tag
== Frequently Asked Questions ==
= What image file types will this plugin automatically add Shadowbox to? =
bmp, gif, png, jpg, and jpeg
= What movie file types will this plugin automatically add Shadowbox to? =
swf, flv, f4v, dv, mov, moov, movie, mp4, asf, wm, wmv, avi, mpg and mpeg
= What audio file types will this plugin automatically add Shadowbox to? =
mp3 and aac
= When I click on my YouTube links I see the full YouTube web site and not just my video. What is wrong? =
You have probably used the wrong form of the YouTube URL. If you used something like `http:&#47;&#47;www.youtube.com&#47;watch?v=3D3kFn_3xRY` that will disaply the YouTube website and not just the video. To just get the video use a link that looks like `http:&#47;&#47;www.youtube.com&#47;v&#47;3D3kFn_3xRY`.
= How can I use a custom Shadowbox skin without having to worry about it being deleted during the upgrade process? =
The first thing you will need to do is to download shadowbox.js source from the github repository: [http://github.com/mjijackson/shadowbox/downloads](http://github.com/mjijackson/shadowbox/downloads)
Second modify and build as required, then follow the next 2 FAQs for using a custom shadowbox.js and a custom shadowbox.css. I will not tell you how to build shadowbox, you can find that information in the source download.
You do not necessarily have to do both. It is possible to only load a custom markup or only a custom css.
= How can I use my own custom shadowbox.js? =
This can be accomplished using filters. You will need to run a filter on 'shadowbox-js'; and here is some sample code to show you how:
`
function custom_shadowbox_js($url) {
return get_bloginfo('stylesheet_directory') . '/js/shadowbox.js';
}
add_filter('shadowbox-js', 'custom_shadowbox_js');
`
Just drop that code, modifying to your needs, in your themes functions.js or as a custom plugin and enjoy.
= How can I use my own custom shadowbox.css? =
Just as above this can be accomplished using filters. You will need to run a filter on 'shadowbox-css'; and here is some sample code to show you how:
`
function custom_shadowbox_css($url) {
return get_bloginfo('stylesheet_directory') . '/css/shadowbox.css';
}
add_filter('shadowbox-css', 'custom_shadowbox_css');
`
Just drop that code, modifying to your needs, in your themes functions.js or as a custom plugin and enjoy.
= Can I selectively load Shadowbox on pages that need it? =
Yes. However this functionality requires WordPress 2.8. If you are running WordPress 2.8 and you would like to enable this functionality visit `Settings -> Shadowbox JS` and set `Enable Smart Loading` to `true`.
= Why isn't this plugin working? =
Check to make sure that you have `<?php wp_head(); ?>` in your themes header.php and `<?php wp_footer(); ?>` in your themes fotoer.php. See the default WordPress theme for examples. Also see the FAQ below.
= This plugin has stopped working since I installed another plugin or another plugin has stopped working since I installed this plugin. What can I do? =
Try changing the Javascript Library used by this plugin to something other than 'None' on the Shadowbox JS settings page in the WordPress admin.
== Screenshots ==
1. An Image
2. A Website
3. A YouTube Video
== Upgrade ==
1. Use the plugin updater in WordPress or...
1. Deactivate the Shadowbox JS plugin
1. Delete the previous `shadowbox-js` folder from the `/wp-content/plugins/` directory
1. Upload the new `shadowbox-js` folder to the `/wp-content/plugins/` directory
1. Activate the Shadowbox JS plugin
1. Optional: Visit the settings page in the WordPress admin at `Settings -> Shadowbox JS`
== Usage ==
1. By default this plugin will add the activator attribute to all image links, movie links, audio links and YouTube/Google Video links that do not already have the activator attribute. Meaning basically, by default all images in the posts on your site will automatically be displayed using Shadowbox.
= If you want more fine grain control over the links continue with the next steps. If not then stop here. =
1\. Create a link in your post in the following format (This link can be to pretty much anything including websites, video files, YouTube, Google Video and inline content):
`&lt;a href="http://domain.tld/directory/to/image.jpg" rel="shadowbox[album]"&gt;Image&lt;/a&gt;`
2\. Be sure to include `rel="shadowbox"` as this activates the plugin.
3\. If `rel="shadowbox[album]"` is included the portion listed here as `[album]` will group multiple pictures into an album called album. Do not use `[gallery]` to define an album as WordPress has a shortcode that will interfere.
4\. If you are using this as a lightbox replacement you do not need to change `rel="lightbox"` to `rel="shadowbox"`. Shadowbox.js supports `rel="lightbox"` natively.
5\. If you want to make a gallery/album and only want one link to display you can use `class="hidden"` to hide the additional links.
6\. See [http://shadowbox-js.com/doc/usage.html#markup](http://shadowbox-js.com/doc/usage.html#markup) for detailed markup instructions.
7\. If you are using using Shadowbox globally for all images but have an image you do not wish to use Shadowbox on use `rel="nobox"` in your image link.
== Upgrade Notice ==
= 3.0.3.8 =
Missing javascript dependency registration, hook into post generation later if Smart Loading is disabled, and fix Javascript code comments so that broken HTML minification processes will not have any affect on Shadowbox.
= 3.0.3.7 =
Hook into post generation later if Smart Loading is disabled, and fix Javascript code comments so that broken HTML minification processes will not have any affect on Shadowbox.
= 3.0.3.5 =
Hook into post generation later if Smart Loading is disabled, and fix Javascript code comments so that broken HTML minification processes will not have any affect on Shadowbox.
= 3.0.3.4 =
Version 3.0.3.4 addresses a bug where other plugins registering `[post]` or `[album]` could interfere and cause invalid HTML and general unexpected results.
= 3.0.3.3 =
This version adds support to not used the cached shadowbox.js, better smart loading options to not load JS and CSS when not needed and significant code cleanup and optimization.
= 3.0.3.2 =
This version upgrades shadowbox.js to version 3.0.3 from upstream, adds new filters, removes pre WordPress 2.8 compatibility, and removes Ext and Dojo support. Also in this release is a sub plugin to push the title from 'img' tags onto the 'a' tags.
== Changelog ==
= 3.0.3.8 (2011-06-08): =
* Due to large reworkings script dependencies were not being loaded when a library other than 'None' was selected on the settings page
= 3.0.3.7 (2011-06-07): =
* Missed a merge
= 3.0.3.6 (2011-06-07): =
* Had to bump the version because I forgot to do so previsouly for 3.0.3.5 for the sub plugin, this should fix update notices
= 3.0.3.5 (2011-06-07): =
* Update Javascript code comments to be safe with broken HTML minification processes
* Hook into the_content if Smart Loading is disabled instead of the_posts
* Better post id detection for gallery grouping
= 3.0.3.4 (2011-06-02): =
* Make the Shadowbox 'album' names a little more unique to bypass a bug in the WordPress shortcode regex where a '-' is seen as the ending delimiter in a shortcode name
= 3.0.3.3 (2011-05-31): =
* Create new escaping functions to get around problems with plugins and themes filtering the builtin escaping functions
* Make sure cached file is world readable before trying to enqueue it
* Add option to disable creating and using the cached shadowbox.js
* Code cleanups
* Hook into the_posts instead of the_content for easier determination if styles and scripts should be enqueued.
* Regular Expression enhancements
* Add option to not used the cached shadowbox.js and have it generate on page load
= 3.0.3.2 (2010-04-05): =
* Replace missed wp_htmledit_pre functions in the options page
= 3.0.3.1 (2010-04-05): =
* Replace wp_htmledit_pre with htmlspecialchars as it seems themes and plugins are adding output using it's filter
= 3.0.3 (2010-04-03): =
* Upgrade shadowbox.js to 3.0.3
* Graceful degredation when plugin PHP files are missing
* Remove custom upgrade notices in favor of the new built in functionality
* Separate out the plugin into additional files for better organization
* WordPress 2.8 minimum requirement
* Make sure options are not blank, if a user tries to update an option with nothing in the admin, revert to the default value
* Create a lot of filters so people can hook in and override things
* Add additional plugin to push the title from 'img' tags to 'a' tags
* Remove Dojo and Ext support
= 3.0.0.3 (2009-11-07): =
* Fix empty options on activation for new installs
= 3.0.0.2 (2009-10-30): =
* Update shadowbox.js build from upstream
* Add option to disable sizzle.js
* Enhance Upgrade Logic
* Add Dutch translation
* Update to not start anything until init at earliest
* Split FLV from Auto Movies so that we can force certain file types to use the FLV player
* Replace logic to use the video height and width for all videos by defualt, not just Youtube and Google Video
= 3.0.0.1 (2009-06-30): =
* Bring back PHP4 support
* Increase speed by reducing the number of queries
* Code cleanup
* Add changelog output to upgrade notice in admin. Requires WordPress 2.8
* Do not display majority of the settings page form if the options have been removed from the database
* Fix broken localization directory name in code and update localization template
* Remove unused javascript files
* Add Russian translation
= 3.0.0.0 (2009-06-10): =
* Updated Shadowbox to 3.0b1
* Code cleanup and optimization, will only load the code into memory that is needed
* Removed IE8 hack since Shadowbox 3.0 now supports IE8
* Added options to the admin page for modifying the default size of YouTube videos
* Full screen in YouTube videos is now supported
* Added options to the admin page for modifying flashVars, flashParams and minimum flash version required
* Added option to the admin page for disabling Shadowbox.setup so that Shadowbox.setup can be run from another script to allow image maps through area tags
* Disabled the FLV player by default since it has a non-commercial license. Must enable FLV player after accepting licensing in the admin
* Added capability for loading shadowbox only when needed. Requires WordPress 2.8.
* Added capability for only loading the shadowbox players you want.
= 2.0.4.1 (2009-03-24): =
* Add IE8 support by way of the X-UA-Compatibile meta tag
= 2.0.4.0 (2009-03-18): =
* Use domready events for javascript libraries other than None for intialization of shadowbox so that shadowbox works before the page is completely loaded
* Initial support for WordPress 2.8, more updates will finalized as WordPress 2.8 is finalized
* Bulgarian translation for shadowbox.js added
* Code cleanup
* Change default size for Youtube videos
* Add automation to the_excerpt so links in custom excerpts can utilize shadowbox
* Support for custom skins using a filter (see the FAQ)
= 2.0.3.3 (2009-01-23): =
* Fix issue where replacement was trying to be done when no replacements were necessary
* Add feature to attempt to automatically set Shadowbox language based on defined WordPress language
* Only load the required javascript in the admin when on the shadowbox-js settings page
* Clean up code
= 2.0.3.2 (2008-12-26): =
* Fix animate and animateFade select options, were true/true, now true/false
* Fix PHP warnings about non-existent $_POST array indexes
= 2.0.3.1 (2008-12-23): =
* Updated invalid php start tag
= 2.0.3.0 (2008-12-23): =
* Added options page to admin interface
* Added support to automatically use Shadowbox for movie, audio and YouTube/Google Video links.
= 2.0.2.1 (2008-09-22): =
* Fixed typo in variable name containing the previous rel attribute of the link
= 2.0.2 (2008-09-22): =
* Added support to automatically use Shadowbox to display all images in your posts including those generated by the [gallery] shortcode.
* Added deactivator rel attribute. Use rel="nobox" to not use Shadowbox to display an image when global activation is configured.
= 2.0.1 (2008-08-25): =
* updated code for readability
* Added support for [gallery] shortcode
= 2.0 (2008-08-11): =
* Updated shadowbox.js to version 2.0
* Added various options and changes to support shadowbox.js version 2.0
* Updated javascript library locations to use Google APIs and Yahoo APIs where applicable.
* Changed versioning of the plugin to match that of the shadowbox.js version
= 0.4 (2008-04-10): =
* Updated to use assetURL for location to shadowbox files
* Cleaned up code and added extended comments
* Added extras.css with support for hidden class
* Added support to not include javascript libraries
= 0.3 (2008-02-26): =
* Updated Shadowbox.js to version 1.0 Final
* Added support for Ext, Dojo and MooTools Javascript Libraries
* Removed lightbox2shadowbox function/filter as Shadowbox.js now natively supports rel="lightbox"
* Consolidated repetitive code
* Removed images that were not in use
* Selected MooTools as the default as it contains the smallest payload
= 0.2 (2008-02-22): =
* Initial Public Release
Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

@@ -0,0 +1,284 @@
<?php
/**
* Shadowbox is an online media viewing application that supports all of the web's
* most popular media publishing formats. Shadowbox is written entirely in
* JavaScript and CSS and is highly customizable. Using Shadowbox, website authors
* can display a wide assortment of media in all major browsers without navigating
* users away from the linking page.
*
* @author Matt Martz <matt@sivel.net>
* @version 3.0.3.8
* @package shadowbox-js
*/
/*
Plugin Name: Shadowbox JS
Plugin URI: http://sivel.net/wordpress/shadowbox-js/
Description: A javascript media viewer similar to Lightbox and Thickbox. Supports all types of media, not just images.
Version: 3.0.3.8
Author: Matt Martz
Author URI: http://sivel.net/
Text Domain: shadowbox-js
Domain Path: shadowbox-js/localization
License: LGPL
Shadowbox JS (c) 2008-2011 Matt Martz (http://sivel.net/)
Shadowbox JS is released under the GNU General Public License (LGPL)
http://www.gnu.org/licenses/lgpl-2.1.txt
Shadowbox (c) 2007-2010 Michael J. I. Jackson (http://www.shadowbox-js.com/)
Shadowbox is licensed under the Shadowbox.js License version 1.0
http://www.shadowbox-js.com/LICENSE
JW FLV Media Player (c) 2008 LongTail As Solutions (http://www.longtailvideo.com/)
JW FLV Media Player is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License
http://creativecommons.org/licenses/by-nc-sa/3.0/
*/
/**
* Shadowbox class for common actions between admin and frontend
*
* This class contains all of the shared functions required for Shadowbox to work
* on the frontend and admin of WordPress
*
* @since 3.0.0.1
* @package shadowbox-js
* @subpackage frontend
*/
class Shadowbox {
/**
* Plugin Version
*
* Holds the current plugin version.
*
* @since 3.0.0.4
* @var int
*/
var $version = '3.0.3.8';
/**
* Plugin Options Version
*
* Holds the current options version. Does not hold the current plugin version.
*
* @since 3.0.0.0
* @var int
*/
var $dbversion = '3.0.3.3';
/**
* Shadowbox Version
*
* Holds the current shadowbox.js version.
*
* @since 3.0.0.4
* @var int
*/
var $sbversion = '3.0.3';
/**
* Options array containing all options for this plugin
*
* @since 3.0.0.1
* @var string
*/
var $options;
/**
* Setup shared functionality for ADmin and Front End
*
* @return none
* @since 3.0.0.1
*/
function __construct () {
$this->options = get_option ( 'shadowbox' );
}
/**
* Get specific option from the options table
*
* @param string $option Name of option to be used as array key for retrieving the specific value
* @return mixed
* @since 2.0.3
*/
function get_option ( $option , $options = null ) {
if ( is_null ( $options ) )
$options = &$this->options;
if ( isset ( $options[$option] ) )
return $options[$option];
else
return false;
}
/**
* Get the full URL to the plugin
*
* @return string
* @since 2.0.3
*/
function plugin_url () {
$plugin_url = plugins_url ( plugin_basename ( dirname ( __FILE__ ) ) );
return $plugin_url;
}
/**
* Return an md5 based off of the current options of the plugin and the
* current version of shadowbox.js.
*
* This is used for creating unique cache files and for cache busting.
*
* @since 3.0.3
* @return string
*/
function md5 () {
return md5 ( serialize ( $this->options ) . $this->sbversion );
}
/**
* Checks if a file is world readable
*
* @since 3.0.3.3
* @param string $file File to be checked for being world readable
* @return boolean
*/
function is_world_readable ( $file ) {
if ( @file_exists ( $file ) && ( @fileperms ( $file ) & 0444 ) == 0444 )
return true;
else
return false;
}
/**
* Escape string to prevent against nasty things.
*
* This is a wrapper function to add some additional measures for making
* sure users don't break things
*
* @since 3.0.3.3
* @param string $string The string to be escaped
* @param string $type The type of escaping to do
* @return string
*/
function esc ( $string , $type = 'js' ) {
global $wp_filter , $merged_filters;
// Some themes and plugins hook into these filters and muck things up
// Remove all filters attached and then restore afterwards
$filters = compact ( $wp_filter , $merged_filters );
remove_all_filters ( 'js_escape' );
remove_all_filters ( 'htmledit_pre' );
remove_all_filters ( 'attribute_escape' );
$string = strip_tags ( $string );
switch ( $type ) {
case 'attr' :
$string = esc_attr ( $string );
break;
case 'htmledit' :
$string = wp_htmledit_pre ( $string );
break;
case 'js' :
default:
$string = esc_js ( $string );
break;
}
// Restore filters that were removed above
extract ( $filters );
return $string;
}
/**
* Deactivate this plugin and die
*
* Used to deactivate the plugin when files critical to it's operation can not be loaded
*
* @since 3.0.0.4
* @return none
*/
function deactivate_and_die ( $file ) {
load_plugin_textdomain ( 'shadowbox-js' , false , 'shadowbox-js/localization' );
$message = sprintf ( __( "Shadowbox JS has been automatically deactivated because the file <strong>%s</strong> is missing. Please reinstall the plugin and reactivate." ) , $file );
if ( ! function_exists ( 'deactivate_plugins' ) )
include ( ABSPATH . 'wp-admin/includes/plugin.php' );
deactivate_plugins ( __FILE__ );
wp_die ( $message );
}
/**
* Returns whether or not a specific type or all of the automations are enabled
*
* @return boolean
* @since 2.0.4.0
*/
function is_automatic ( $type = null , $options = null ) {
if ( is_null ( $options ) )
$options = &$this->options;
switch ( $type ) {
case 'img' :
case 'mov' :
case 'aud' :
case 'tube' :
case 'flv' :
if ( $this->get_option ( "auto{$type}" , $options ) == "true" )
return true;
else
return false;
break;
default :
if (
$this->get_option ( 'autoimg' , $options ) == "true" ||
$this->get_option ( 'automov' , $options ) == "true" ||
$this->get_option ( 'autoaud' , $options ) == "true" ||
$this->get_option ( 'autotube' , $options ) == "true" ||
$this->get_option ( 'autoflv' , $options ) == "true"
)
return true;
else
return false;
break;
}
}
function protected_options () {
return array (
'library' ,
'language' ,
'version' ,
'smartLoad' ,
'useCache' ,
'autoimg' ,
'automov' ,
'autotube' ,
'autoaud' ,
'autoflv' ,
'enableFlv' ,
'genericVideoWidth' ,
'genericVideoHeight' ,
'players'
);
}
}
/**
* Instantiate the ShadowboxFrontend or ShadowboxAdmin Class
*
* Deactivate and die if files can not be included
*/
if ( is_admin () ) {
if ( @include ( dirname ( __FILE__ ) . '/inc/admin.php' ) ) {
$ShadowboxAdmin = new ShadowboxAdmin ();
} else {
Shadowbox::deactivate_and_die ( dirname ( __FILE__ ) . '/inc/admin.php' );
}
} else {
if ( @include ( dirname ( __FILE__ ) . '/inc/frontend.php' ) ) {
$ShadowboxFrontend = new ShadowboxFrontend ();
} else {
Shadowbox::deactivate_and_die ( dirname ( __FILE__ ) . '/inc/frontend.php' );
}
}
@@ -0,0 +1,97 @@
<?php
/**
* ShadowboxTitlePush class for Pushing the image attribute onto anchor tags
*
* This class contains all functions and actions required for ShadowboxTitle to work on the frontend of WordPress
*
* @since 3.0.3
* @package shadowbox-js
* @subpackage TitlePush
*/
/*
Plugin Name: Shadowbox JS - Use Title from Image
Plugin URI: http://sivel.net/wordpress/shadowbox-js/
Description: Push the title attribute from the img tag to the anchor tag
Version: 3.0.3.8
Author: Matt Martz
Author URI: http://sivel.net/
Text Domain: shadowbox-js
Domain Path: shadowbox-js/localization
License: LGPL
Shadowbox JS (c) 2008-2010 Matt Martz (http://sivel.net/)
Shadowbox JS is released under the GNU General Public License (LGPL)
http://www.gnu.org/licenses/lgpl-2.1.txt
Shadowbox (c) 2007-2010 Michael J. I. Jackson (http://www.shadowbox-js.com/)
Shadowbox is licensed under the Shadowbox.js License version 1.0
http://www.shadowbox-js.com/LICENSE
JW FLV Media Player (c) 2008 LongTail As Solutions (http://www.longtailvideo.com/)
JW FLV Media Player is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License
http://creativecommons.org/licenses/by-nc-sa/3.0/
*/
class ShadowboxTitlePush {
/**
* PHP 4 Style constructor which calls the below PHP5 Style Constructor
*
* @since 3.0.3
* @return none
*/
function ShadowboxTitlePush () {
$this->__construct();
}
/**
* Setup plugin and hook into WordPress
*
* @return none
* @since 3.0.3
*/
function __construct () {
add_filter ( 'the_content' , array ( &$this , 'push_title_to_anchor' ) , 11 );
add_filter ( 'the_excerpt' , array ( &$this , 'push_title_to_anchor' ) , 11 );
add_filter ( 'wp_get_attachment_link' , array ( &$this , 'push_title_to_anchor' ) , 11 );
}
/**
* Filter the_content and the_excerpt finding a title attribute on an <img> tag
* and pushing it to the parent <a> tag if the title attribute does not exist on
* the <a> tag.
*
* @since 3.0.3
* @param string $content The content of the post
* @return string
*/
function push_title_to_anchor ( $content ) {
$master_pattern = '%<a[^>]+><img[^>]+></a>%';
$anchor_pattern = '%(<a[^>]+)>%';
if ( preg_match_all ( $master_pattern , $content , $links ) ) {
foreach ( $links[0] as $link ) {
$anchor_title_pattern = '%<a[^>]+title=([\'"]).*?\\1[^>]+?>%';
$img_title_pattern = '%<img[^>]+(title=([\'"]).*?\\2)[^>]+?>%';
if ( preg_match ( $img_title_pattern , $link , $title ) && ! preg_match ( $anchor_title_pattern , $link ) ) {
$link_replace = preg_replace ( $anchor_pattern , '$1 ' . $title[1] . '>' , $link );
$content = str_replace ( $link , $link_replace , $content );
}
}
}
return $content;
}
}
/**
* Instantiate the ShadowboxTitlePush Class
*/
if ( ! is_admin () ) {
$ShadowboxTitlePush = new ShadowboxTitlePush ();
}
@@ -0,0 +1,65 @@
Copyright 2007-2010 Michael J. I. Jackson, all rights reserved.
The following licenses are applicable to version 3.0 of the Shadowbox.js library
and greater. The term "library" is used throughout to mean all code, images, and
documentation that are distributed as part of the library.
Shadowbox.js Non-Commercial License version 1.0
Under the terms of this license, the licensee is granted the following privileges:
- The right to use the library as part of a website or application that is not
used for commercial purposes
- The right to modify the library to suit his purpose.
Under no circumstance is the licensee permitted to redistribute the source code,
images, or documentation contained in the library. All redistribution rights
remain with the copyright holder unless specific prior written permission is
obtained.
Under no circumstance shall this copyright notice or list of conditions be
modified or removed from the code distribution in either source or binary form.
This software is provided by the copyright holder and contributors "as is" and
any express or implied warranties, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose are disclaimed.
In no event shall the copyright holder or contributors be liable for any direct,
indirect, incidental, special, exemplary, or consequential damages (including, but
not limited to, procurement of substitute goods or services; loss of use, data, or
profits; or business interruption) however caused and on any theory of liability,
whether in contract, strict liability, or tort (including negligence or otherwise)
arising in any way out of the use of this software, even if advised of the
possibility of such damage.
Shadowbox.js Commercial License version 1.0
Under the terms of this license, the licensee is granted the following privileges:
- The right to use the library as part of a website or application that is
used for commercial purposes
- The right to modify the library to suit his purpose.
Under no circumstance is the licensee permitted to redistribute the source code,
images, or documentation contained in the library. All redistribution rights
remain with the copyright holder unless specific prior written permission is
obtained.
Under no circumstance shall this copyright notice or list of conditions be
modified or removed from the code distribution in either source or binary form.
This software is provided by the copyright holder and contributors "as is" and
any express or implied warranties, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose are disclaimed.
In no event shall the copyright holder or contributors be liable for any direct,
indirect, incidental, special, exemplary, or consequential damages (including, but
not limited to, procurement of substitute goods or services; loss of use, data, or
profits; or business interruption) however caused and on any theory of liability,
whether in contract, strict liability, or tort (including negligence or otherwise)
arising in any way out of the use of this software, even if advised of the
possibility of such damage.
@@ -0,0 +1,73 @@
Overview
--------
Shadowbox is a flexible media viewer that supports all of the web's most popular
media publishing formats. Shadowbox is written entirely in JavaScript and CSS and
is highly customizable. Using Shadowbox, website authors can display a wide
assortment of media in all major browsers without navigating users away from the
linking page.
For more information, please see http://shadowbox-js.com/.
Installation and Usage
----------------------
For detailed installation and usage instructions, please see the usage page at
http://shadowbox-js.com/usage.html.
How to Build
------------
IMPORTANT: The following instructions are for those who would like to create a custom build
of Shadowbox on their own machines. Most users will not want to do this and instead should
simply download, install, and use Shadowbox as described on the Shadowbox website at
http://shadowbox-js.com/usage.html.
In order to build Shadowbox on your own machine you must have the Ruby programming
language (http://ruby-lang.org/) installed as well as the Rake build tool
(http://rake.rubyforge.org/). Simply edit the parameters in `build.yml` to your liking
and run the following command from the project root directory:
$ rake
Note: If you want to build a compressed version of the code (which is the default), you
will also need Java installed. You can always use the web interface on the Shadowbox website
(http://shadowbox-js.com/download.html) to build your own version of the code if you are
unable to do it on your own.
How to Run Tests and Examples
-----------------------------
The Shadowbox test suite is written with QUnit (http://github.com/jquery/qunit). To run the
tests, you first need to build the code using the `build:tests` Rake task.
$ rake build:tests
Once you have built the code, open `tests/index.html` in your browser of choice. Likewise,
to run any of the examples you first need to run the `build:examples` Rake task before
opening the example HTML file in your browser.
$ rake build:examples
How to Contribute
-----------------
If you would like to contribute to the project please email me your contribution/patch
at mjijackson@gmail.com. I'm more than happy to accomodate fixes and modifications that
make Shadowbox a better product.
Bugs
----
Please report any bugs that you may find at http://github.com/mjijackson/shadowbox/issues.
License
-------
The Shadowbox license is available online at http://shadowbox-js.com/LICENSE.
Credits
-------
Shadowbox employs several open source libraries including Sizzle.js (http://sizzlejs.com/)
and swfobject (http://code.google.com/p/swfobject/).
@@ -0,0 +1 @@
function getTarget(b){var a=b.target?b.target:b.srcElement;return a.nodeType==3?a.parentNode:a}function getPageXY(b){var a=b.pageX||(b.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),c=b.pageY||(b.clientY+(document.documentElement.scrollTop||document.body.scrollTop));return[a,c]}function preventDefault(a){a.preventDefault()}function keyCode(a){return a.which?a.which:a.keyCode}function addEvent(d,c,b){if(d.addEventListener){d.addEventListener(c,b,false)}else{if(d.nodeType===3||d.nodeType===8){return}if(d.setInterval&&(d!==window&&!d.frameElement)){d=window}if(!b.__guid){b.__guid=addEvent.guid++}if(!d.events){d.events={}}var a=d.events[c];if(!a){a=d.events[c]={};if(d["on"+c]){a[0]=d["on"+c]}}a[b.__guid]=b;d["on"+c]=addEvent.handleEvent}}addEvent.guid=1;addEvent.handleEvent=function(d){var a=true;d=d||addEvent.fixEvent(((this.ownerDocument||this.document||this).parentWindow||window).event);var b=this.events[d.type];for(var c in b){this.__handleEvent=b[c];if(this.__handleEvent(d)===false){a=false}}return a};addEvent.preventDefault=function(){this.returnValue=false};addEvent.stopPropagation=function(){this.cancelBubble=true};addEvent.fixEvent=function(a){a.preventDefault=addEvent.preventDefault;a.stopPropagation=addEvent.stopPropagation;return a};function removeEvent(c,b,a){if(c.removeEventListener){c.removeEventListener(b,a,false)}else{if(c.events&&c.events[b]){delete c.events[b][a.__guid]}}};
@@ -0,0 +1 @@
var events=[];function getTarget(a){return a.target}function getPageXY(a){return[a.pageX,a.pageY]}function preventDefault(a){a.preventDefault()}function keyCode(a){return a.keyCode}function addEvent(c,b,a){var d=dojo.connect(c,name,a);events.push({el:c,type:b,handle:d})}function removeEvent(c,b,a){dojo.forEach(events,function(f,d){if(f&&f.el==c&&f.type==b){dojo.disconnect(f.handle);events[d]=null}})};
@@ -0,0 +1 @@
var E=Ext.lib.Event;function getTarget(a){return E.getTarget(a)}function getPageXY(a){return[E.getPageX(a),E.getPageY(a)]}function preventDefault(a){E.preventDefault(a)}function keyCode(a){return E.getCharCode(a)}function addEvent(c,b,a){E.addListener(c,name,a)}function removeEvent(c,b,a){E.removeListener(c,name,a)};
@@ -0,0 +1 @@
function getTarget(a){return a.target}function getPageXY(a){return[a.pageX,a.pageY]}function preventDefault(a){a.preventDefault()}function keyCode(a){return a.keyCode}function addEvent(c,b,a){jQuery(c).bind(b,a)}function removeEvent(c,b,a){jQuery(c).unbind(b,a)}jQuery.fn.shadowbox=function(a){return this.each(function(){var c=jQuery(this);var d=jQuery.extend({},a||{},jQuery.metadata?c.metadata():jQuery.meta?c.data():{});var b=this.className||"";d.width=parseInt((b.match(/w:(\d+)/)||[])[1])||d.width;d.height=parseInt((b.match(/h:(\d+)/)||[])[1])||d.height;Shadowbox.setup(c,d)})};
@@ -0,0 +1 @@
function getTarget(a){return a.target}function getPageXY(a){return[a.page.x,a.page.y]}function preventDefault(a){a.preventDefault()}function keyCode(a){return a.code}function addEvent(c,b,a){$(c).addEvent(b,a)}function removeEvent(c,b,a){$(c).removeEvent(b,a)};
@@ -0,0 +1 @@
var E=Event;function getTarget(a){return E.element(a)}function getPageXY(a){return[E.pointerX(a),E.pointerY(a)]}function preventDefault(a){E.stop(a)}function keyCode(a){return a.keyCode}function addEvent(c,b,a){E.observe(c,b,a)}function removeEvent(c,b,a){E.stopObserving(c,b,a)};
@@ -0,0 +1 @@
var E=YAHOO.util.Event;function getTarget(a){return E.getTarget(a)}function getPageXY(a){return[E.getPageX(a),E.getPageY(a)]}function preventDefault(a){E.preventDefault(a)}function keyCode(a){return a.keyCode}function addEvent(c,b,a){E.addListener(c,b,a)}function removeEvent(c,b,a){E.removeListener(c,b,a)};
@@ -0,0 +1 @@
var relAttr=/^(light|shadow)box/i,expando="shadowboxCacheKey",cacheKey=1;S.cache={};S.select=function(b){var c=[];if(!b){var a;each(document.getElementsByTagName("a"),function(f,g){a=g.getAttribute("rel");if(a&&relAttr.test(a)){c.push(g)}})}else{var e=b.length;if(e){if(typeof b=="string"){if(S.find){c=S.find(b)}}else{if(e==2&&typeof b[0]=="string"&&b[1].nodeType){if(S.find){c=S.find(b[0],b[1])}}else{for(var d=0;d<e;++d){c[d]=b[d]}}}}else{c.push(b)}}return c};S.setup=function(a,b){each(S.select(a),function(c,d){S.addCache(d,b)})};S.teardown=function(a){each(S.select(a),function(b,c){S.removeCache(c)})};S.addCache=function(c,a){var b=c[expando];if(b==undefined){b=cacheKey++;c[expando]=b;addEvent(c,"click",handleClick)}S.cache[b]=S.makeObject(c,a)};S.removeCache=function(a){removeEvent(a,"click",handleClick);delete S.cache[a[expando]];a[expando]=null};S.getCache=function(b){var a=b[expando];return(a in S.cache&&S.cache[a])};S.clearCache=function(){for(var a in S.cache){S.removeCache(S.cache[a].link)}S.cache={}};function handleClick(a){S.open(this);if(S.gallery.length){preventDefault(a)}};
Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

@@ -0,0 +1 @@
var S={version:"3.0.3"};var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")>-1||ua.indexOf("win32")>-1){S.isWindows=true}else{if(ua.indexOf("macintosh")>-1||ua.indexOf("mac os x")>-1){S.isMac=true}else{if(ua.indexOf("linux")>-1){S.isLinux=true}}}S.isIE=ua.indexOf("msie")>-1;S.isIE6=ua.indexOf("msie 6")>-1;S.isIE7=ua.indexOf("msie 7")>-1;S.isGecko=ua.indexOf("gecko")>-1&&ua.indexOf("safari")==-1;S.isWebKit=ua.indexOf("applewebkit/")>-1;var inlineId=/#(.+)$/,galleryName=/^(light|shadow)box\[(.*?)\]/i,inlineParam=/\s*([a-z_]*?)\s*=\s*(.+)\s*/,fileExtension=/[0-9a-z]+$/i,scriptPath=/(.+\/)shadowbox\.js/i;var open=false,initialized=false,lastOptions={},slideDelay=0,slideStart,slideTimer;S.current=-1;S.dimensions=null;S.ease=function(a){return 1+Math.pow(a-1,3)};S.errorInfo={fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}};S.gallery=[];S.onReady=noop;S.path=null;S.player=null;S.playerId="sb-player";S.options={animate:true,animateFade:true,autoplayMovies:true,continuous:false,enableKeys:true,flashParams:{bgcolor:"#000000",allowfullscreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",onChange:noop,onClose:noop,onFinish:noop,onOpen:noop,showMovieControls:true,skipSetup:false,slideshowDelay:0,viewportPadding:20};S.getCurrent=function(){return S.current>-1?S.gallery[S.current]:null};S.hasNext=function(){return S.gallery.length>1&&(S.current!=S.gallery.length-1||S.options.continuous)};S.isOpen=function(){return open};S.isPaused=function(){return slideTimer=="pause"};S.applyOptions=function(a){lastOptions=apply({},S.options);apply(S.options,a)};S.revertOptions=function(){apply(S.options,lastOptions)};S.init=function(c,f){if(initialized){return}initialized=true;if(S.skin.options){apply(S.options,S.skin.options)}if(c){apply(S.options,c)}if(!S.path){var e,b=document.getElementsByTagName("script");for(var d=0,a=b.length;d<a;++d){e=scriptPath.exec(b[d].src);if(e){S.path=e[1];break}}}if(f){S.onReady=f}bindLoad()};S.open=function(b){if(open){return}var a=S.makeGallery(b);S.gallery=a[0];S.current=a[1];b=S.getCurrent();if(b==null){return}S.applyOptions(b.options||{});filterGallery();if(S.gallery.length){b=S.getCurrent();if(S.options.onOpen(b)===false){return}open=true;S.skin.onOpen(b,load)}};S.close=function(){if(!open){return}open=false;if(S.player){S.player.remove();S.player=null}if(typeof slideTimer=="number"){clearTimeout(slideTimer);slideTimer=null}slideDelay=0;listenKeys(false);S.options.onClose(S.getCurrent());S.skin.onClose();S.revertOptions()};S.play=function(){if(!S.hasNext()){return}if(!slideDelay){slideDelay=S.options.slideshowDelay*1000}if(slideDelay){slideStart=now();slideTimer=setTimeout(function(){slideDelay=slideStart=0;S.next()},slideDelay);if(S.skin.onPlay){S.skin.onPlay()}}};S.pause=function(){if(typeof slideTimer!="number"){return}slideDelay=Math.max(0,slideDelay-(now()-slideStart));if(slideDelay){clearTimeout(slideTimer);slideTimer="pause";if(S.skin.onPause){S.skin.onPause()}}};S.change=function(a){if(!(a in S.gallery)){if(S.options.continuous){a=(a<0?S.gallery.length+a:0);if(!(a in S.gallery)){return}}else{return}}S.current=a;if(typeof slideTimer=="number"){clearTimeout(slideTimer);slideTimer=null;slideDelay=slideStart=0}S.options.onChange(S.getCurrent());load(true)};S.next=function(){S.change(S.current+1)};S.previous=function(){S.change(S.current-1)};S.setDimensions=function(o,f,m,n,e,a,k,h){var j=o,d=f;var i=2*k+e;if(o+i>m){o=m-i}var c=2*k+a;if(f+c>n){f=n-c}var b=(j-o)/j,l=(d-f)/d,g=(b>0||l>0);if(h&&g){if(b>l){f=Math.round((d/j)*o)}else{if(l>b){o=Math.round((j/d)*f)}}}S.dimensions={height:o+e,width:f+a,innerHeight:o,innerWidth:f,top:Math.floor((m-(o+i))/2+k),left:Math.floor((n-(f+c))/2+k),oversized:g};return S.dimensions};S.makeGallery=function(e){var a=[],d=-1;if(typeof e=="string"){e=[e]}if(typeof e.length=="number"){each(e,function(g,h){if(h.content){a[g]=h}else{a[g]={content:h}}});d=0}else{if(e.tagName){var b=S.getCache(e);e=b?b:S.makeObject(e)}if(e.gallery){a=[];var f;for(var c in S.cache){f=S.cache[c];if(f.gallery&&f.gallery==e.gallery){if(d==-1&&f.content==e.content){d=a.length}a.push(f)}}if(d==-1){a.unshift(e);d=0}}else{a=[e];d=0}}each(a,function(g,h){a[g]=apply({},h)});return[a,d]};S.makeObject=function(d,c){var e={content:d.href,title:d.getAttribute("title")||"",link:d};if(c){c=apply({},c);each(["player","title","height","width","gallery"],function(f,g){if(typeof c[g]!="undefined"){e[g]=c[g];delete c[g]}});e.options=c}else{e.options={}}if(!e.player){e.player=S.getPlayer(e.content)}var a=d.getAttribute("rel");if(a){var b=a.match(galleryName);if(b){e.gallery=escape(b[2])}each(a.split(";"),function(f,g){b=g.match(inlineParam);if(b){e[b[1]]=b[2]}})}return e};S.getPlayer=function(c){if(c.indexOf("#")Line truncated
@@ -0,0 +1,9 @@
/*
* Sizzle CSS Selector Engine - v1.0
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*
* Modified for inclusion in Shadowbox.js
*/
S.find=(function(){var m=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,n=0,p=Object.prototype.toString,h=false,g=true;[0,0].sort(function(){g=false;return 0});var c=function(x,e,A,B){A=A||[];var D=e=e||document;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!x||typeof x!=="string"){return A}var y=[],u,F,I,t,w=true,v=d(e),C=x;while((m.exec(""),u=m.exec(C))!==null){C=u[3];y.push(u[1]);if(u[2]){t=u[3];break}}if(y.length>1&&i.exec(x)){if(y.length===2&&j.relative[y[0]]){F=q(y[0]+y[1],e)}else{F=j.relative[y[0]]?[e]:c(y.shift(),e);while(y.length){x=y.shift();if(j.relative[x]){x+=y.shift()}F=q(x,F)}}}else{if(!B&&y.length>1&&e.nodeType===9&&!v&&j.match.ID.test(y[0])&&!j.match.ID.test(y[y.length-1])){var E=c.find(y.shift(),e,v);e=E.expr?c.filter(E.expr,E.set)[0]:E.set[0]}if(e){var E=B?{expr:y.pop(),set:l(B)}:c.find(y.pop(),y.length===1&&(y[0]==="~"||y[0]==="+")&&e.parentNode?e.parentNode:e,v);F=E.expr?c.filter(E.expr,E.set):E.set;if(y.length>0){I=l(F)}else{w=false}while(y.length){var H=y.pop(),G=H;if(!j.relative[H]){H=""}else{G=y.pop()}if(G==null){G=e}j.relative[H](I,G,v)}}else{I=y=[]}}if(!I){I=F}if(!I){throw"Syntax error, unrecognized expression: "+(H||x)}if(p.call(I)==="[object Array]"){if(!w){A.push.apply(A,I)}else{if(e&&e.nodeType===1){for(var z=0;I[z]!=null;z++){if(I[z]&&(I[z]===true||I[z].nodeType===1&&k(e,I[z]))){A.push(F[z])}}}else{for(var z=0;I[z]!=null;z++){if(I[z]&&I[z].nodeType===1){A.push(F[z])}}}}}else{l(I,A)}if(t){c(t,D,A,B);c.uniqueSort(A)}return A};c.uniqueSort=function(t){if(o){h=g;t.sort(o);if(h){for(var e=1;e<t.length;e++){if(t[e]===t[e-1]){t.splice(e--,1)}}}}return t};c.matches=function(e,t){return c(e,null,null,t)};c.find=function(z,e,A){var y,w;if(!z){return[]}for(var v=0,u=j.order.length;v<u;v++){var x=j.order[v],w;if((w=j.leftMatch[x].exec(z))){var t=w[1];w.splice(1,1);if(t.substr(t.length-1)!=="\\"){w[1]=(w[1]||"").replace(/\\/g,"");y=j.find[x](w,e,A);if(y!=null){z=z.replace(j.match[x],"");break}}}}if(!y){y=e.getElementsByTagName("*")}return{set:y,expr:z}};c.filter=function(C,B,F,v){var u=C,H=[],z=B,x,e,y=B&&B[0]&&d(B[0]);while(C&&B.length){for(var A in j.filter){if((x=j.match[A].exec(C))!=null){var t=j.filter[A],G,E;e=false;if(z===H){H=[]}if(j.preFilter[A]){x=j.preFilter[A](x,z,F,H,v,y);if(!x){e=G=true}else{if(x===true){continue}}}if(x){for(var w=0;(E=z[w])!=null;w++){if(E){G=t(E,x,w,z);var D=v^!!G;if(F&&G!=null){if(D){e=true}else{z[w]=false}}else{if(D){H.push(E);e=true}}}}}if(G!==undefined){if(!F){z=H}C=C.replace(j.match[A],"");if(!e){return[]}break}}}if(C===u){if(e==null){throw"Syntax error, unrecognized expression: "+C}else{break}}u=C}return z};var j=c.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(y,t){var v=typeof t==="string",x=v&&!/\W/.test(t),z=v&&!x;if(x){t=t.toLowerCase()}for(var u=0,e=y.length,w;u<e;u++){if((w=y[u])){while((w=w.previousSibling)&&w.nodeType!==1){}y[u]=z||w&&w.nodeName.toLowerCase()===t?w||false:w===t}}if(z){c.filter(t,y,true)}},">":function(y,t){var w=typeof t==="string";if(w&&!/\W/.test(t)){t=t.toLowerCase();for(var u=0,e=y.length;u<e;u++){var x=y[u];if(x){var v=x.parentNode;y[u]=v.nodeName.toLowerCase()===t?v:false}}}else{for(var u=0,e=y.length;u<e;u++){var x=y[u];if(x){y[u]=w?x.parentNode:x.parentNode===t}}if(w){c.filter(t,y,true)}}},"":function(v,t,x){var u=n++,e=r;if(typeof t==="string"&&!/\W/.test(t)){var w=t=t.toLowerCase();e=a}e("parentNode",t,u,v,w,x)},"~":function(v,t,x){var u=n++,e=r;if(typeof t==="string"&&!/\W/.test(t)){var w=t=t.toLowerCase();e=a}e("previousSibling",t,u,v,w,x)}},find:{ID:function(t,u,v){if(typeof u.getElementById!=="undefined"&&!v){var e=u.getElementById(t[1]);return e?[e]:[]}},NAME:function(u,x){if(typeof x.getElementsByName!=="undefined"){var t=[],w=x.getElementsByName(u[1]);for(var v=0,e=w.length;v<e;v++){if(w[v].getAttribute("name")===u[1]){t.push(w[v])}}return t.length===0?null:t}},TAG:function(e,t){return t.getElementsByTagName(e[1])}},preFilter:{CLASS:function(v,t,u,e,y,z){v=" "+v[1].replace(/\\/g,"")+" ";if(z){return v}for(var w=0,x;(x=t[w])!=null;w++){if(x){if(y^(x.className&&(" "+x.className+" ").replace(/[\t\n]/g," ").indexOf(v)>=0)){if(!u){e.push(x)}}else{if(u){t[w]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(t,e){return t[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var t=/(-?)(\d*)n((?:\+|-)?\dLine truncated
@@ -0,0 +1,17 @@
/*
* SWFObject v2.1 <http://code.google.com/p/swfobject/>
* Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
* This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*
* Modified for inclusion in Shadowbox.js
*/
S.flash=(function(){var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],objIdArr=[],listenersArr=[],script,timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);
/*@cc_on
ie = true;
@if (@_win32)
windows = true;
@elif (@_mac)
mac = true;
@end
@*/
return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();var onDomLoad=function(){if(!ua.w3cdom){return}addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write("<script id=__ie_ondomload defer=true src=//:><\/script>");script=getElementById("__ie_ondomload");if(script){addListener(script,"onreadystatechange",checkReadyState)}}catch(e){}}if(ua.webkit&&typeof doc.readyState!=UNDEF){timer=setInterval(function(){if(/loaded|complete/.test(doc.readyState)){callDomLoadFunctions()}},10)}if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,null)}addLoadEvent(callDomLoadFunctions)}();function checkReadyState(){if(script.readyState=="complete"){script.parentNode.removeChild(script);callDomLoadFunctions()}}function callDomLoadFunctions(){if(isDomLoaded){return}if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t)}catch(e){return}}isDomLoaded=true;if(timer){clearInterval(timer);timer=null}var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){addListener(win,"onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn}}}}}function main(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj)}setVisibility(id,true)}else{if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i])}else{displayAltContent(obj)}}}}else{setVisibility(id,true)}}}function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName=="DATA"){e.setAttribute("src",a[i].nodeValue)}else{e.setAttribute(a[i].nodeName,a[i].nodeValue)}}}var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName=="PARAM"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"))}}}obj.parentNode.replaceChild(e,obj)}}function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId}}else{storedAltContent=abstractAltContent(obj)}if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310"}if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId)}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName=="PARAM")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(el){if(typeof attObj.id==UNDEF){attObj.id=id}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i.toLowerCase()!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHLine truncated
@@ -0,0 +1,8 @@
/*!
* Shadowbox.js, version 3.0.3
* http://shadowbox-js.com/
*
* Copyright 2007-2010, Michael J. I. Jackson
* 2010-03-10 00:00:00 +0000
*/
(function(window, undefined) {
@@ -0,0 +1 @@
S.lang={code:"ar",of:"من",loading:"جار التحميل",cancel:"خروج",next:"التالى",previous:"السابق",play:"بدء",pause:"ايقاف",close:"اغلاق",errors:{single:'يجب ان تقوم بتنصيب اضافة المتصفح <a href="{0}">{1}</a> لعرض هذا المحتوى.',shared:'يجب ان تقوم بتنصيب الاضافتين <a href="{0}">{1}</a> و <a href="{2}">{3}</a>للمتصفح لعرض هذا المحتوى.',either:'يجب ان قوم بتنصيب اما الاضافة التاليى <a href="{0}">{1}</a> او <a href="{2}">{3}</a> للمتصفح لعرض هذا المحتوى.'}};
@@ -0,0 +1 @@
S.lang={code:"ca",of:"de",loading:"carregant",cancel:"Cancel·la",next:"Següent",previous:"Anterior",play:"Reprodueix",pause:"Pausa",close:"Tanca",errors:{single:'Heu d\'instal·lar el complement <a href="{0}">{1}</a> al vostre navegador per veure el contingut.',shared:'Heu d\'instal·lar els complements <a href="{0}">{1}</a> i <a href="{2}">{3}</a> al vostre navegador per veure el contingut.',either:'Heu d\'instal·lar el complement <a href="{0}">{1}</a> o el complement <a href="{2}">{3}</a> al vostre navegador per veure el contingut.'}};
@@ -0,0 +1 @@
S.lang={code:"cs",of:"z(e)",loading:"nahrávám",cancel:"Zrušit",next:"Další",previous:"Předchozí",play:"Přehrát",pause:"Pauza",close:"Zavřít",errors:{single:'Pro správné zobrazení je potřeba nainstalovat tento zásuvný modul do Vašeho prohlížeče: <a href="{0}">{1}</a>.',shared:'Pro správné zobrazení je potřeba nainstalovat oba tyto zásuvné moduly do Vašeho prohlížeče: <a href="{0}">{1}</a> a <a href="{2}">{3}</a>.',either:'Pro správné zobrazení je potřeba do Vašeho prohlížeče nainstalovat jeden z následujících zásuvných modulů: <a href="{0}">{1}</a> nebo <a href="{2}">{3}</a>.'}};
@@ -0,0 +1 @@
S.lang={code:"da",of:"af",loading:"loader",cancel:"Annuller",next:"NÊste",previous:"Forrige",play:"Start",pause:"Pause",close:"Luk",errors:{single:'Du skal installere dette <a href="{0}">{1}</a> browser plugin for at se indholdet.',shared:'Du skal installere bÂde <a href="{0}">{1}</a> og <a href="{2}">{3}</a> browser plugins for at se indholdet.',either:'Du skal enten installere dette <a href="{0}">{1}</a> eller dette <a href="{2}">{3}</a> browser plugin for at se dette indhold.'}};
@@ -0,0 +1 @@
S.lang={code:"de-CH",of:"von",loading:"lade",cancel:"Abbrechen",next:"weiter",previous:"zurück",play:"Abspielen",pause:"Pause",close:"Schliessen",errors:{single:'Um den Inhalt anzeigen zu können muss die Browser-Erweiterung <a href="{0}">{1}</a> installiert werden.',shared:'Um den Inhalt anzeigen zu können müssen die beiden Browser-Erweiterungen <a href="{0}">{1}</a> und <a href="{2}">{3}</a> installiert werden.',either:'Um den Inhalt anzeigen zu können muss eine der beiden Browser-Erweiterungen <a href="{0}">{1}</a> oder <a href="{2}">{3}</a> installiert werden.'}};
@@ -0,0 +1 @@
S.lang={code:"de",of:"von",loading:"ladend",cancel:"Abbrechen",next:"Nächste",previous:"Vorige",play:"Abspielen",pause:"Pause",close:"Schließen",errors:{single:'Um den Inhalt anzeigen zu können muss die Browser-Erweiterung <a href="{0}">{1}</a> installiert werden.',shared:'Um den Inhalt anzeigen zu können müssen die beiden Browser-Erweiterungen <a href="{0}">{1}</a> und <a href="{2}">{3}</a> installiert werden.',either:'Um den Inhalt anzeigen zu können muss eine der beiden Browser-Erweiterungen <a href="{0}">{1}</a> oder <a href="{2}">{3}</a> installiert werden.'}};
@@ -0,0 +1 @@
S.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}};
@@ -0,0 +1 @@
S.lang={code:"es",of:"de",loading:"cargando",cancel:"Cancelar",next:"Siguiente",previous:"Anterior",play:"Reproducir",pause:"Pausa",close:"Cerrar",errors:{single:'Debes instalar el plugin <a href="{0}">{1}</a> en el navegador para ver este contenido.',shared:'Debes instalar el <a href="{0}">{1}</a> y el <a href="{2}">{3}</a> en el navegador para ver este contenido.',either:'Debes instalar o bien el <a href="{0}">{1}</a> o el <a href="{2}">{3}</a> en el navegador para ver este contenido.'}};
@@ -0,0 +1 @@
S.lang={code:"et",of:"/",loading:"laen",cancel:"Katkesta",next:"Järgmine",previous:"Eelmine",play:"Start",pause:"Paus",close:"Sulge",errors:{single:'Lehekülje vaatamiseks installeerige browser\'i plugin <a href="{0}">{1}</a>.',shared:'Lehekülje vaatamiseks installeerige plugin\'id <a href="{0}">{1}</a> ja <a href="{2}">{3}</a>.',either:'Lehekülje vaatamiseks installeerige kas <a href="{0}">{1}</a> või <a href="{2}">{3}</a> plugin.'}};
@@ -0,0 +1 @@
S.lang={code:"fi",of:"/",loading:"ladataan",cancel:"Peruuta",next:"Seuraava",previous:"Edellinen",play:"Toista",pause:"Pysäytä",close:"Sulje",errors:{single:'Sinun on asennettava <a href="{0}">{1}</a> nähdäksesi sisällön.',shared:'Sinun on asennettava <a href="{0}">{1}</a> - ja <a href="{2}">{3}</a> selainlaajennukset nähdäksesi sisällön.',either:'Sinun on asennetteva joko <a href="{0}">{1}</a> tai <a href="{2}">{3}</a> selainlaajennus nähdäksesi sisällön.'}};
@@ -0,0 +1 @@
S.lang={code:"fr",of:"de",loading:"chargement",cancel:"Annuler",next:"Suivant",previous:"Précédent",play:"Lire",pause:"Pause",close:"Fermer",errors:{single:'Vous devez installer le plugin <a href="{0}">{1}</a> pour afficher ce contenu.',shared:'Vous devez installer les plugins <a href="{0}">{1}</a> et <a href="{2}">{3}</a> pour afficher ce contenu.',either:'Vous devez installer le plugin <a href="{0}">{1}</a> ou <a href="{2}">{3}</a> pour afficher ce contenu.'}};
@@ -0,0 +1 @@
S.lang={code:"gl",of:"de",loading:"cargando",cancel:"Cancelar",next:"Seguinte",previous:"Anterior",play:"Reproducir",pause:"Pausa",close:"Pechar",errors:{single:'É necesario instalar o plugin <a href="{0}">{1}</a> para visualizar este contido.',shared:'É necesario instalar os plugins <a href="{0}">{1}</a> e <a href="{2}">{3}</a> para visualizar este contido.',either:'É necesario instalar o plugin <a href="{0}">{1}</a> ou o plugin <a href="{2}">{3}</a> para visualizar este contido.'}};
@@ -0,0 +1 @@
S.lang={code:"he",of:"מתוך",loading:"טוען",cancel:"ביטול",next:"הבא",previous:"הקודם",play:"נגן",pause:"השהה",close:"סגור",errors:{single:'על גבי הדפדפן על מנת לצפות בתוכן<a href="{0}">{1}</a> עליך להתקין את התקן ה.',shared:'על גבי הדפדפן על מנת לצפות בתוכן <a href="{0}">{1}</a> and <a href="{2}">{3}</a> עליך להתקין את שני ההתקנים.',either:'על מנת לצפות בתוכן <a href="{0}">{1}</a> או <a href="{2}">{3}</a> עליך להתקין התקן.'}};
@@ -0,0 +1 @@
S.lang={code:"hu",of:"/",loading:"Bet�lt�s",cancel:"M�gse",next:"K�vetkez�",previous:"El�z�",play:"Lej�tsz�s",pause:"Sz�net",close:"Bez�r�s",errors:{single:'A tartalom megjelen�t�s�hez a k�vetkez� b�v�tm�ny sz�ks�ges: <a href="{0}">{1}</a>.',shared:'A tartalom megjelen�t�s�hez a k�vetkez� k�t b�v�tm�ny sz�ks�ges: <a href="{0}">{1}</a>, <a href="{2}">{3}</a>.',either:'A tartalom megjelen�t�s�hez a k�vetkez� b�v�tm�nyek valamelyik�t telep�tenie kell: <a href="{0}">{1}</a> vagy <a href="{2}">{3}</a>.'}};
@@ -0,0 +1 @@
S.lang={code:"id",of:"dari",loading:"pengisian",cancel:"Batal",next:"Berikut",previous:"Sebelum",play:"Mainkan",pause:"Hentikan",close:"Tutup",errors:{single:'Anda harus memasang plugin browser <a href="{0}">{1}</a> untuk melihat isi ini.',shared:'Anda harus memasang kedua plugin browser <a href="{0}">{1}</a> dan <a href="{2}">{3}</a> untuk melihat isi ini.',either:'Anda harus memasang plugin browser <a href="{0}">{1}</a> atau <a href="{2}">{3}</a> untuk melihat isi ini.'}};
@@ -0,0 +1 @@
S.lang={code:"is",of:"af",loading:"hleð",cancel:"Hætta",next:"Næsta",previous:"Fyrri",play:"Spila",pause:"Pása",close:"Loka",errors:{single:'Þú verður að setja inn ... <a href="{0}">{1}</a> vafra íforritið til að skoða þetta efni.',shared:'Þú verður að setja inn bæði <a href="{0}">{1}</a> og <a href="{2}">{3}</a> vafra íforritin til að skoða þetta efni.',either:'Þú verður að setja inn annað hvort <a href="{0}">{1}</a> eða <a href="{2}">{3}</a> vafra íforritin til að skoða þetta efni.'}};
@@ -0,0 +1 @@
S.lang={code:"it",of:"di",loading:"in caricamento",cancel:"Annulla",next:"Avanti",previous:"Indietro",play:"Play",pause:"Pausa",close:"Chiudi",errors:{single:'È necessario installare il plugin <a href="{0}">{1}</a> per poter vedere questo contenuto.',shared:'È necessario installare i plugin <a href="{0}">{1}</a> e <a href="{2}">{3}</a> per poter vedere questo contenuto.',either:'È necessario installare o il plugin <a href="{0}">{1}</a> o <a href="{2}">{3}</a> per poter vedere questo contenuto.'}};
@@ -0,0 +1 @@
S.lang={code:"ja",of:"/",loading:"読込中",cancel:"取消",next:"次",previous:"前",play:"再生",pause:"一時停止",close:"閉じる",errors:{single:'このコンテンツを表示するにはプラグイン <a href="{0}">{1}</a> を追加する必要があります。',shared:'このコンテンツを表示するにはプラグイン <a href="{0}">{1}</a> と <a href="{2}">{3}</a> を追加する必要があります。',either:'このコンテンツを表示するにはプラグイン <a href="{0}">{1}</a> または <a href="{2}">{3}</a> を追加する必要があります。'}};
@@ -0,0 +1 @@
S.lang={code:"ko",of:"중",loading:"로딩 중",cancel:"취소",next:"다음",previous:"이전",play:"재생",pause:"잠시 멈춤",close:"닫기",errors:{single:'이 내용을 보려면 <a href="{0}">{1}</a> 브라우저 플러그인을 설치하십시오.',shared:'이 내용을 보려면 <a href="{0}">{1}</a> 와/과 <a href="{2}">{3}</a> 브라우저 플러그인을 설치하십시오.',either:'이 내용을 보려면 <a href="{0}">{1}</a> 또는 <a href="{2}">{3}</a> 브라우저 플러그인을 설치하십시오.'}};
@@ -0,0 +1 @@
S.lang={code:"my",of:"",loading:"memuat turun",cancel:"Batal",next:"Seterusnya",previous:"Sebelum",play:"Mainkan",pause:"Hentikan",close:"Tutup",errors:{single:'Anda perlu memasang <a href="{0}">{1}</a> plugin pelayar bagi melihat kandungan ini.',shared:'Anda perlu memasang kedua-dua <a href="{0}">{1}</a> dan <a href="{2}">{3}</a> plugin pelayar bagi melihat kandungan ini.',either:'Anda perlu memasang samada <a href="{0}">{1}</a> atau <a href="{2}">{3}</a> plugin pelayar bagi melihat kandungan ini.'}};
@@ -0,0 +1 @@
S.lang={code:"nl",of:"van",loading:"laden",cancel:"Annuleren",next:"Volgende",previous:"Vorige",play:"Play",pause:"Pause",close:"Sluiten",errors:{single:'U moet de <a href="{0}">{1}</a> browser plugin installeren om dit media type te kunnen bekijken.',shared:'U moet de <a href="{0}">{1}</a> en de <a href="{2}">{3}</a> browser plugins installeren om dit media type te kunnen bekijken.',either:'U moet de <a href="{0}">{1}</a> of de <a href="{2}">{3}</a> browser plugin installeren om dit media type te kunnen bekijken.'}};
@@ -0,0 +1 @@
S.lang={code:"no",of:"av",loading:"laster",cancel:"Avbryt",next:"Neste",previous:"Forrige",play:"Spill",pause:"Pause",close:"Lukk",errors:{single:'Du må installere <a href="{0}">{1}</a> for å kunne se dette innholdet.',shared:'Du må installere både <a href="{0}">{1}</a> og <a href="{2}">{3}</a> for å kunne se dette innholdet.',either:'Du må enten installere <a href="{0}">{1}</a> eller <a href="{2}">{3}</a> for å kunne se dette innholdet.'}};
@@ -0,0 +1 @@
S.lang={code:"pl",of:"z",loading:"wczytywanie",cancel:"Anuluj",next:"Dalej",previous:"Wróć",play:"Odtwarzaj",pause:"Pauza",close:"Zamknij",errors:{single:'Musisz zainstalować plugin <a href="{0}">{1}</a> aby zobaczyć zawartość',shared:'Musisz zainstalować pluginy <a href="{0}">{1}</a> i <a href="{2}">{3}</a> aby zobaczyć zawartość ',either:'Musisz zainstalować plugin <a href="{0}">{1}</a> lub <a href="{2}">{3}</a> aby zobaczyć zawartość'}};
@@ -0,0 +1 @@
S.lang={code:"pt-BR",of:"de",loading:"carregando",cancel:"Cancelar",next:"Próximo",previous:"Anterior",play:"Play",pause:"Pause",close:"Fechar",errors:{single:'Você precisa instalar o plugin <a href="{0}">{1}</a> para visualizar o conteúdo.',shared:'Você precisa instalar os plugins <a href="{0}">{1}</a> e <a href="{2}">{3}</a>, para visualizar o conteúdo.',either:'Você precisa instalar o plugin <a href="{0}">{1}</a> ou o plugin <a href="{2}">{3}</a>, para visualizar o conteúdo.'}};
@@ -0,0 +1 @@
S.lang={code:"pt-PT",of:"de",loading:"A Carregar...",cancel:"Cancelar",next:"Seguinte",previous:"Anterior",play:"Reproduzir",pause:"Pausa",close:"Fechar",errors:{single:'É necessário instalar o plugin <a href="{0}">{1}</a> para visualizar este conteúdo.',shared:'É necessário instalar os plugins <a href="{0}">{1}</a> e <a href="{2}">{3}</a> para visualizar este conteúdo.',either:'É necessário instalar o plugin <a href="{0}">{1}</a> ou o plugin <a href="{2}">{3}</a> para visualizar este conteúdo.'}};
@@ -0,0 +1 @@
S.lang={code:"ro",of:"din",loading:"se incarca",cancel:"Revocare",next:"Inainte",previous:"Inapoi",play:"Ruleaza",pause:"Pauza",close:"Inchide",errors:{single:'Pentru a vizualiza acest continut trebuie sa instalati acest plugin <a href="{0}">{1}</a>.',shared:'Pentru a vizualiza acest continut trebuie sa instalati pluginurile <a href="{0}">{1}</a> si <a href="{2}">{3}</a>.',either:'Pentru a vizualiza acest continut trebuie sa instalati pluginul <a href="{0}">{1}</a> sau <a href="{2}">{3}</a>.'}};
@@ -0,0 +1 @@
S.lang={code:"ru",of:"из",loading:"загрузка",cancel:"Отмена",next:"Следующая",previous:"Предыдущая",play:"Пуск",pause:"Пауза",close:"Закрыть",errors:{single:'Вы должны установить для браузера плагин <a href="{0}">{1}</a>, чтобы просмотривать этот контент.',shared:'Чтобы просмотреть этот контент, вы должны установить и <a href="{0}">{1}</a>, и <a href="{2}">{3}</a>.',either:'Вы должны установить или <a href="{0}">{1}</a> плагин, или <a href="{2}">{3}</a>, чтобы просмотреть этот контент.'}};
@@ -0,0 +1 @@
S.lang={code:"sk",of:"z",loading:"Načítava",cancel:"Zruš",next:"Ďalej",previous:"Predchádzjúci",play:"Prehraj",pause:"Zastav",close:"Zavrieť",errors:{single:'Na prezeranie obsahu je potrebné nainštalovať tento plugin <a href="{0}">{1}</a> do prehľiadača.',shared:'Na prezeranie obsahu je potrebné nainštalovať tieto pluginy <a href="{0}">{1}</a> a <a href="{2}">{3}</a> do prehľiadača.',either:'Na prezeranie obsahu je potrebné nainštalovať niektorý z týchto pluginov <a href="{0}">{1}</a> alebo <a href="{2}">{3}</a> do prehľiadača.'}};
@@ -0,0 +1 @@
S.lang={code:"sv",of:"av",loading:"laddar",cancel:"Avbryt",next:"Nästa",previous:"Föregående",play:"Spela",pause:"Pausa",close:"Stäng",errors:{single:'Du måste installera insticksprogrammet <a href="{0}">{1}</a> för att kunna visa innehållet.',shared:'Du måste installera både insticksprogram <a href="{0}">{1}</a> och <a href="{2}">{3}</a> för att kunna visa innehållet.',either:'Du måste installera antingen insticksprogram <a href="{0}">{1}</a>, eller <a href="{2}">{3}</a> för att kunna visa innehållet.'}};
@@ -0,0 +1 @@
S.lang={code:"tr",of:"/",loading:"yükleniyor",cancel:"İptal",next:"Sonraki",previous:"Önceki",play:"Oynat",pause:"Durdur",close:"Kapat",errors:{single:'Bu içeriği görmek için <a href="{0}">{1}</a> eklentisini kurmanız gerekiyor.',shared:'Bu içeriği görmek için <a href="{0}">{1}</a> ve <a href="{2}">{3}</a> eklentilerini kurmanız gerekiyor.',either:'Bu içeriği görmek için <a href="{0}">{1}</a> veya <a href="{2}">{3}</a> eklentilerinden birini kurmanız gerekiyor.'}};
@@ -0,0 +1 @@
S.lang={code:"zh-CN",of:"的",loading:"读取中",cancel:"取消",next:"下一页",previous:"上一页",play:"执行",pause:"暂停",close:"关闭",errors:{single:'您必须安装 <a href="{0}">{1}</a> 这个浏览外挂程式才能检视这里的内容。',shared:'您必须安装 <a href="{0}">{1}</a> 和 <a href="{2}">{3}</a> 这两个浏览外挂程式才能检视这里的内容。',either:'您必须安装 <a href="{0}">{1}</a> 或者是 the <a href="{2}">{3}</a> 这两个其中一个浏览外挂程式才能检视这里的内容。'}};
@@ -0,0 +1 @@
S.lang={code:"zh-TW",of:"的",loading:"讀取中",cancel:"取消",next:"下一頁",previous:"上一頁",play:"執行",pause:"暫停",close:"關閉",errors:{single:'您必須安裝 <a href="{0}">{1}</a> 這個瀏覽外掛程式才能檢視這裡的內容。',shared:'您必須安裝 <a href="{0}">{1}</a> 和 <a href="{2}">{3}</a> 這兩個瀏覽外掛程式才能檢視這裡的內容。',either:'您必須安裝 <a href="{0}">{1}</a> 或者是 the <a href="{2}">{3}</a> 這兩個其中一個瀏覽外掛程式才能檢視這裡的內容。'}};
@@ -0,0 +1 @@
var loaded=false,DOMContentLoaded;if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);S.load()}}else{if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);S.load()}}}}function doScrollCheck(){if(loaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(doScrollCheck,1);return}S.load()}function bindLoad(){if(document.readyState==="complete"){return S.load()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",S.load,false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",S.load);var a=false;try{a=window.frameElement===null}catch(b){}if(document.documentElement.doScroll&&a){doScrollCheck()}}}}S.load=function(){if(loaded){return}if(!document.body){return setTimeout(S.load,13)}loaded=true;checkSupport();S.onReady();if(!S.options.skipSetup){S.setup()}S.skin.init()};
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Loaded 100 of 139 files, more files were not shown because too many files have changed in this diff. Show more