diff --git a/wp-content/plugins/facebook-comments-for-wordpress.3.1.3.zip b/wp-content/plugins/facebook-comments-for-wordpress.3.1.3.zip new file mode 100644 index 0000000..91aa173 Binary files /dev/null and b/wp-content/plugins/facebook-comments-for-wordpress.3.1.3.zip differ diff --git a/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-custom.css b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-custom.css new file mode 100644 index 0000000..fa7cf34 --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-custom.css @@ -0,0 +1,34 @@ +/*****************************/ +/* Hide the Like button AND use stylesheet for a dark website +/*****************************/ + +/* Hide the 'Facebook social plugin' text and icon */ +a.uiLinkSubtle { + display: none; +} +a.UIImageBlock_ICON_Image { + display: none; +} + +/* Affects the entire Facebook Comments area */ +div.wallkit_frame { + background: #000; +} +/* Affects the gray box surrounding the post box */ +div.gray_box { + background: #000; + border: none; +} +/* Affects the post box */ +div.wallkit_post { + color: #fff; +} +/* Affects the comments displayed */ +div.wallkit_form { + color: #fff; +} + +/* Hide the Like button */ +div.like { + display: none; +} diff --git a/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-darksite.css b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-darksite.css new file mode 100644 index 0000000..66865e8 --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-darksite.css @@ -0,0 +1,29 @@ +/*****************************/ +/* Styles for a site with a dark background +/*****************************/ + +/* Hide the 'Facebook social plugin' text and icon */ +a.uiLinkSubtle { + display: none; +} +a.UIImageBlock_ICON_Image { + display: none; +} + +/* Affects the entire Facebook Comments area */ +div.wallkit_frame { + background: #000; +} +/* Affects the gray box surrounding the post box */ +div.gray_box { + background: #000; + border: none; +} +/* Affects the post box */ +div.wallkit_post { + color: #fff; +} +/* Affects the comments displayed */ +div.wallkit_form { + color: #fff; +} diff --git a/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hidefblink.css b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hidefblink.css new file mode 100644 index 0000000..96ea918 --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hidefblink.css @@ -0,0 +1,10 @@ +/*****************************/ +/* Hide the 'Facebook social plugin' text and icon +/*****************************/ + +a.uiLinkSubtle { + display: none; +} +a.UIImageBlock_ICON_Image { + display: none; +} diff --git a/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hidelike.css b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hidelike.css new file mode 100644 index 0000000..26248d7 --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hidelike.css @@ -0,0 +1,16 @@ +/*****************************/ +/* Hide the Like button and text +/*****************************/ + +/* Hide the 'Facebook social plugin' text and icon */ +a.uiLinkSubtle { + display: none; +} +a.UIImageBlock_ICON_Image { + display: none; +} + +/* Hide the Like button */ +div.like { + display: none; +} diff --git a/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hidelikefaces.css b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hidelikefaces.css new file mode 100644 index 0000000..7b5d87c --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hidelikefaces.css @@ -0,0 +1,7 @@ +/*****************************/ +/* Hide the faces associated with the Like button +/*****************************/ + +div.connect_widget_sample_connections { + display: none; +} diff --git a/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hideprofilepics.css b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hideprofilepics.css new file mode 100644 index 0000000..2be605d --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hideprofilepics.css @@ -0,0 +1,7 @@ +/*****************************/ +/* Hide the profile picture beside each comment +/*****************************/ + +div.wallkit_profilepic { + display: none; +} diff --git a/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hidewpcomments.css b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hidewpcomments.css new file mode 100644 index 0000000..d306785 --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-hidewpcomments.css @@ -0,0 +1,9 @@ +@charset "UTF-8"; + +/*****************************/ +/* Hide the WordPress commenting form +/*****************************/ + +#respond, #commentform, #addcomment, .entry-comments { + display: none; +} diff --git a/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-widgets.css b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-widgets.css new file mode 100644 index 0000000..26a36b0 --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments-widgets.css @@ -0,0 +1,77 @@ +@charset "UTF-8"; + +/*****************************/ +/* Dashboard widget styles +/*****************************/ + + +/*****************************/ +/* Normal, page widget styles + + displayed here in order rendered +/*****************************/ +/* Each post is styled as follows: +
  • +
    + + + USERNAME + + + + Date/Time + +
    + +
    + COMMENT CONTENT +
    + +
  • +*/ + +/* 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; +} + diff --git a/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments.css b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments.css new file mode 100644 index 0000000..6588ef8 --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/css/facebook-comments.css @@ -0,0 +1,38 @@ +@charset "UTF-8"; + +/*****************************/ +/* Main Styles +/*****************************/ + +br.gutter { + height: 10px; +} +p.indent { + padding-left: 15px; +} +input.donateButton { + float: left; + padding: 7px 10px 10px 0; +} +span.donateText { + float: left; + padding-top: 13px; + font-weight: bold; +} +div#poststuff h3 { + cursor: default; +} +div.gutter { + margin-top: 20px; +} +div.contain-floats { + overflow: auto; +} +div#icon-help { + display: block; + float: left; + background: url(../images/help_icon.png) no-repeat; + height: 36px; + width: 36px; + margin: 14px 6px 0 0; +} diff --git a/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-admin.php b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-admin.php new file mode 100644 index 0000000..3529eee --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-admin.php @@ -0,0 +1,611 @@ +

    ' . __('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.') . '

    '; +} +$id_help = <<< END +

    Need help? Okay, do you have a facebook app?

    +

    Yes, I do

    +
      +
    1. Get a list of your applications from here: Facebook Application List
    2. +
    3. Select the application you want, then copy and paste the Application ID and Application Secret from there to the boxes below.
    4. +
    + +

    No, I haven't created an application yet

    +
      +
    1. Go here to create it: Create a facebook app
    2. +
    3. 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 {$homeurl} and paste it in the "Site URL" box. Now click "Save Changes". Done!
    4. +
    5. Get your app id and app secret from here: +Facebook Application List
    6. +
    7. Select the application you created, then copy and paste the Application ID and Application Secret from there to the boxes below.
    8. +
    +END; + + +if (version_compare(phpversion(), FBCOMMENTS_REQUIRED_PHP_VER) == -1) { + echo '

    ' . __('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.') . '

    '; +} +?> + + + +
    + +

    + +
    + + + + + + +
    +
    official FAQ'); ?> +
    + +
    + + +
    + +$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 '

    ' . __("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.") . '

    '; + + if (empty($fbc_options['appId']) || empty($fbc_options['appSecret'])) + echo '

    ' . __('The Facebook comments box will not be included in your posts until you set a valid application ID and application secret.').'

    '.$id_help.'
    '; + elseif ($errors != false) + echo '

    ' . __($errors) . '

    '.$id_help.'
    '; + + $_loadversion = get_option('fbComments_xid'); + # 2.1.2 loaded? + $_loadversion = (strlen($_loadversion) < 1) ? 'loaded' : $_loadversion; +?> + +
    XID from version 2.1.2:
    +
    +

    + +
    +

    here
    + * 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).
    + * "v1 only" will use only the old system (only way to have custom css, like button, etc.).
    + * "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).
    '); ?> + +

    +

    > + +

    + size="20"> + +

    */ ?> +
    +
    + +
    +

    + +
    +

    Help): '); ?> + + Facebook application page)'); ?>

    + +

    Help): '); ?> + + Facebook application page)'); ?>

    + +

    size="20"> + +

    + +

    size="20"> +

    + +

    size="20"> +

    + +

    > + +

    + +

    > + +

    + +

    > + +

    + +

    size="20"> + +

    + + + +

    + + Moderation Settings

    +
    +
    + +
    +

    +
    +

    +

    +
    +
    + +
    +

    + + "; + + $indexlikebtn = ""; + ?> + +
    +

    <meta property='og:type' content='article' />
    + Here, the left button has content='product', while the right has content='article'
    + click 'Update Options' to see the effect of changeing each's settings") ?> +

    +
    + + + + +
    +

    Hiding like button'; + ?> +

    + +

    size="20"> +

    + +

    + +

    +

    size="20"> +

    + +

    +

    + +

    + +

    +

    + +

    +

    + + light for light backgrounds, dark for dark'); ?> +

    + +

    '); ?> +

    +
    + +

    Hiding like button'; + ?> +

    + +

    '); ?> + +

    + +

    + +

    size="20"> +

    + +

    +

    + +

    + +

    +

    + +

    +

    + +

    + +

    (min height is 62px if displaying profile pics or using "box_count", 25px otherwise)
    '); ?> +

    + +
    +
    +
    + +
    +

    + +
    +

    +

    size="20"> + +

    + +
    +

    +

    +

    + +

    size="20"> +

    + +
    +
    + +
    +

    + +
    +

    size="20"> + + General Settings page)"); ?>

    + +

    here): '); ?> + + for multiple users, seperate with commas and no spaces (e.g., ID1,ID2,ID3)'); ?>

    +
    +
    + + +
    +

    + +
    +

    +

    + +

    size="20"> +

    + +

    + +

    + +

    + + In development; see here for manual instructions)"); ?> +

    +

    + +

    +

    size="20"> +

    + + + +
    +
    + +
    +

    + +
    +

    +

    +
    +
    + +
    +

    + +
    +

    +

    +
    +
    + +
    +

    + +
    +

    + +

    +
    +
    + +
    +

    + +
    +

    + + Learn more)"); ?>

    + +

    size="20"> + +

    + +

    size="20"> + +

    + +

    size="20"> + +

    + +

    size="20"> + +

    + +

    size="20"> + +

    +
    +
    + + + + + +
    + +
    +

    + +
    +
    + + + + + + + + + + + + +

    Currency: +

    + +

    Amount: +

    + +

    +

    +
    +
    +
    + +
    +
    diff --git a/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-ajax.php b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-ajax.php new file mode 100644 index 0000000..0fcccef --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-ajax.php @@ -0,0 +1,79 @@ +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; + } + +?> diff --git a/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-combinecomments.php b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-combinecomments.php new file mode 100644 index 0000000..480f789 --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-combinecomments.php @@ -0,0 +1,110 @@ +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); +} + +?> \ No newline at end of file diff --git a/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-core.php b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-core.php new file mode 100644 index 0000000..1cda719 --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-core.php @@ -0,0 +1,286 @@ + '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,'
    ') == 0) { $accessToken = substr($accessToken, 13); } + else { echo '
    didnt find accesstoken line 161 comments-core
    '; $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 = '

    ' . __("Request to facebook timed-out. Please try again in a few moments.") . '

    '; + + + + 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 .= '
    '; + + $changes = file_get_contents("../wp-content/plugins/facebook-comments-for-wordpress/readme.txt"); + $changes = strstr($changes, '= '.FBCOMMENTS_VER.' ='); + $changes = str_replace("\n",'
    ',$changes); + $changes = substr($changes, 0, strpos($changes, '=', 14)); + $version = substr($changes, 0, $pos=strpos($changes, '
    ')); + $version = str_replace(' ','', str_replace('=','', $version)); + $changes = substr($changes, $pos+6,strlen($changes)); + $changes = $version.'
    '.$changes.'
    '; + $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 .= '
    '; + + } else { + $output .= '
    '; + $output .= sprintf(__('ERROR: %s'), $api->get_error_message()); + $output .= '
    '; + } + 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); + } +} +?> \ No newline at end of file diff --git a/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-display.php b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-display.php new file mode 100644 index 0000000..8e4cb2f --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-display.php @@ -0,0 +1,292 @@ +post->ID; + // Return out of function if commenting is closed for this post + if (!comments_open()) { + echo "

    Comments Closed

    "; + 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\n +\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
    \n"; + + if ($fbc_options['displayTitle']) { + echo "\t

    " . __($fbc_options['title']) . "

    \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 + +
    \n"; + + if ($fbc_options['displayTitle']) { + echo "\t

    " . __($fbc_options['title']) . "

    \n"; + } + + echo "\t
    " . __("Your Facebook comments would normally appear here, but you haven't set a valid application ID or application secret yet. Go set them now.") . "
    +
    \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
    +\n"; + } else { + echo "\n
    +\n"; + } + } + + function fbComments_printCommentCatchAndNotificationScripts($xid, $postTitle, $postUrl) { + global $fbc_options; + + echo " +\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"; + // } + $siteisdark = ''; + if ($fbc_options['darkSite'] == true) $siteisdark = "colorscheme='dark'"; + if (!$fbc_options['hideFbLikeButton']) { + $likebtn = ""; + } else $likebtn = ''; + + if ($fbc_options['v1plusv2'] == 1) { + echo "\n"; + update_option('fbComments', $fbc_options); + echo $likebtn,"\n"; + echo "\t
    "; + + echo "\t"; + + } else if ($fbc_options['commentVersion'] == 'v2migrated') { + // $newpostUrl = urlencode(urlencode($postUrl)); + echo "\n"; + echo $likebtn,"\n"; + echo "\t"; + + } else if ($fbc_options['commentVersion'] == 'v2') { + echo "\n"; + echo $likebtn,"\n"; + echo "\t"; + + } else if ($fbc_options['commentVersion'] == 'v1') { + echo "\n"; + echo $likebtn,"\n"; + echo "\t"; + } +echo "
    \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 = ""; + + 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 ""; + // echo "\tcmt comments"; + } \ No newline at end of file diff --git a/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-recentcomments.php b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-recentcomments.php new file mode 100644 index 0000000..018a09d --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments-recentcomments.php @@ -0,0 +1,375 @@ +"fql.multiquery","queries"=>$query,'access_token'=>$atoken); + $result = $fb->api($query); + + $comments = $result; + if (!is_array($comments)) { print_r('No response from facebook.com'); return; } + $ncomms = sizeof($comments[0]['fql_result_set']); + $dcomms = $ncomms < $fbc_options['dashNumComments'] ? $ncomms : $fbc_options['dashNumComments']; + + if ($ncomms == 0) { echo "
    + Administer Comments

    " + .'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 + "
    + " + ."
    + Administer Comments

    " + // should probably change this to class so that it validates + .'
    '; + + $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'. $users[$index]['name'] .''; + } + + // make pretty + $commenttext = $comments[$i]['text']; + $order = array("\r\n", "\n", "\r"); + $replace = '
    '; + + // 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 .= + '
    '. + ''. + '
    '. + '

    From '. + ''.$username.' on '. + ''.get_post($post_id)->post_title.' + '.date('d M Y',$comments[$i]['time']).' + [Pending]'. + '

    +
    +

    '.$commenttext.'

    +
    +

    + + + + delete + + + '. + " +

    +
    +
    "; + } + $htmlout .= '
    '; + 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 = ''; + + // 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; + + ?> +

    + + +

    +

    + + +

    +

    + + +

    +

    + id="get_field_id( 'show_avatar' ); ?>" name="get_field_name( 'show_avatar' ); ?>" /> + +

    + diff --git a/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments.php b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments.php new file mode 100644 index 0000000..b41af80 --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/facebook-comments.php @@ -0,0 +1,272 @@ + '', + '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 '

    ".sprintf(__('The Facebook comments box will not be included in your posts until you set a valid application ID and application secret. Please set your application ID and secret now using the options page.', 'facebook-comments'), admin_url('options-general.php?page=facebook-comments'))."

    ';" ) ); + + # 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 ""; } + echo "", + "", + "", + "", + "\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 = '' . __('Settings') . ''; + + # 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'); + } + +?> diff --git a/wp-content/plugins/facebook-comments-for-wordpress/images/help_icon.png b/wp-content/plugins/facebook-comments-for-wordpress/images/help_icon.png new file mode 100644 index 0000000..f435edc Binary files /dev/null and b/wp-content/plugins/facebook-comments-for-wordpress/images/help_icon.png differ diff --git a/wp-content/plugins/facebook-comments-for-wordpress/readme.txt b/wp-content/plugins/facebook-comments-for-wordpress/readme.txt new file mode 100644 index 0000000..6f15c14 --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/readme.txt @@ -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¤cy_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`­`://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 `` 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 `` 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 diff --git a/wp-content/plugins/facebook-comments-for-wordpress/screenshot-1.png b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-1.png new file mode 100644 index 0000000..a6a3ce0 Binary files /dev/null and b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-1.png differ diff --git a/wp-content/plugins/facebook-comments-for-wordpress/screenshot-2.png b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-2.png new file mode 100644 index 0000000..948b492 Binary files /dev/null and b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-2.png differ diff --git a/wp-content/plugins/facebook-comments-for-wordpress/screenshot-3.png b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-3.png new file mode 100644 index 0000000..996ae7a Binary files /dev/null and b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-3.png differ diff --git a/wp-content/plugins/facebook-comments-for-wordpress/screenshot-4.png b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-4.png new file mode 100644 index 0000000..b87bc32 Binary files /dev/null and b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-4.png differ diff --git a/wp-content/plugins/facebook-comments-for-wordpress/screenshot-5.png b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-5.png new file mode 100644 index 0000000..edc6d7a Binary files /dev/null and b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-5.png differ diff --git a/wp-content/plugins/facebook-comments-for-wordpress/screenshot-6.png b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-6.png new file mode 100644 index 0000000..ec1e456 Binary files /dev/null and b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-6.png differ diff --git a/wp-content/plugins/facebook-comments-for-wordpress/screenshot-7.png b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-7.png new file mode 100644 index 0000000..1ff732a Binary files /dev/null and b/wp-content/plugins/facebook-comments-for-wordpress/screenshot-7.png differ diff --git a/wp-content/plugins/facebook-comments-for-wordpress/scripts/facebook.php b/wp-content/plugins/facebook-comments-for-wordpress/scripts/facebook.php new file mode 100644 index 0000000..d09d5a6 --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/scripts/facebook.php @@ -0,0 +1,968 @@ + + */ +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 + */ +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, '-_', '+/')); + } +} diff --git a/wp-content/plugins/facebook-comments-for-wordpress/scripts/fb_ca_chain_bundle.crt b/wp-content/plugins/facebook-comments-for-wordpress/scripts/fb_ca_chain_bundle.crt new file mode 100644 index 0000000..de9d56f --- /dev/null +++ b/wp-content/plugins/facebook-comments-for-wordpress/scripts/fb_ca_chain_bundle.crt @@ -0,0 +1,124 @@ + + +
    -----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-----
    +
    \ No newline at end of file diff --git a/wp-content/plugins/most-popular-posts.1.6.zip b/wp-content/plugins/most-popular-posts.1.6.zip new file mode 100644 index 0000000..d1e31eb Binary files /dev/null and b/wp-content/plugins/most-popular-posts.1.6.zip differ diff --git a/wp-content/plugins/most-popular-posts/most-popular-posts-hi_IN.mo b/wp-content/plugins/most-popular-posts/most-popular-posts-hi_IN.mo new file mode 100755 index 0000000..2c5b660 Binary files /dev/null and b/wp-content/plugins/most-popular-posts/most-popular-posts-hi_IN.mo differ diff --git a/wp-content/plugins/most-popular-posts/most-popular-posts.mo b/wp-content/plugins/most-popular-posts/most-popular-posts.mo new file mode 100644 index 0000000..3bc78b8 Binary files /dev/null and b/wp-content/plugins/most-popular-posts/most-popular-posts.mo differ diff --git a/wp-content/plugins/most-popular-posts/most-popular-posts.po b/wp-content/plugins/most-popular-posts/most-popular-posts.po new file mode 100644 index 0000000..6f94575 --- /dev/null +++ b/wp-content/plugins/most-popular-posts/most-popular-posts.po @@ -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 \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 only category 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 "" + diff --git a/wp-content/plugins/most-popular-posts/most-popular.php b/wp-content/plugins/most-popular-posts/most-popular.php new file mode 100755 index 0000000..bac5ef1 --- /dev/null +++ b/wp-content/plugins/most-popular-posts/most-popular.php @@ -0,0 +1,251 @@ + '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 +?> +

    + +

    + +

    + + +

    + +

    + /> + +

    + +

    + /> + +

    + +

    only category option is respected.', 'most-popular-posts'); ?>

    + +

    /> +

    + +

    + get_field_name('only') . '&hide_empty=0'); ?>
    + +

    + +

    /> +

    + +

    + get_field_name('exclude') . '&hide_empty=0'); ?>
    + +

    + +

    + +
    + +

    + +

    + /> + +

    + +

    Formatting

    +

    + +
    +

    + 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 '
  • '; + else + echo '
  • '; +} + if ($instance['childclass'] == '') + echo '
      '; + else + echo '
        ' . "\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" . '' . $links->post_title . '' . $comments . '' . "\n"; + } +} +else { + echo "\n\t" . '
      • '; + _e('No posts to display', 'most-popular-posts'); + echo '
      • ' . "\n"; + } +?> +
      + \ No newline at end of file diff --git a/wp-content/plugins/most-popular-posts/readme.txt b/wp-content/plugins/most-popular-posts/readme.txt new file mode 100644 index 0000000..54b9ecd --- /dev/null +++ b/wp-content/plugins/most-popular-posts/readme.txt @@ -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 the plugin homepage. + +For examples and tips on using the plugin, please check the examples on the plugin homepage. + +Be sure to check out my other plugins at my Wordpress profile. + += 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 `
    • ` 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 \ No newline at end of file diff --git a/wp-content/plugins/neuf-events b/wp-content/plugins/neuf-events index 7fb4219..cf6e6cb 160000 --- a/wp-content/plugins/neuf-events +++ b/wp-content/plugins/neuf-events @@ -1 +1 @@ -Subproject commit 7fb42190ca84042a31da120a5c5d9c9eb1fbe5a8 +Subproject commit cf6e6cb7b4de3648e4772a2ff9a03ab5128c7c83 diff --git a/wp-content/plugins/shadowbox-js.3.0.3.8.zip b/wp-content/plugins/shadowbox-js.3.0.3.8.zip new file mode 100644 index 0000000..9338022 Binary files /dev/null and b/wp-content/plugins/shadowbox-js.3.0.3.8.zip differ diff --git a/wp-content/plugins/shadowbox-js/css/admin.css b/wp-content/plugins/shadowbox-js/css/admin.css new file mode 100644 index 0000000..a36db0d --- /dev/null +++ b/wp-content/plugins/shadowbox-js/css/admin.css @@ -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; +} diff --git a/wp-content/plugins/shadowbox-js/css/extras.css b/wp-content/plugins/shadowbox-js/css/extras.css new file mode 100644 index 0000000..b937356 --- /dev/null +++ b/wp-content/plugins/shadowbox-js/css/extras.css @@ -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; +} diff --git a/wp-content/plugins/shadowbox-js/inc/admin.php b/wp-content/plugins/shadowbox-js/inc/admin.php new file mode 100644 index 0000000..eb24fe0 --- /dev/null +++ b/wp-content/plugins/shadowbox-js/inc/admin.php @@ -0,0 +1,600 @@ +__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 = '' . __( 'Settings' , 'shadowbox-js' ) . ''; + 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 ( '

      The options page for the Shadowbox JS cannot be displayed. The file %s is missing. Please reinstall the plugin.

      ' , dirname ( __FILE__ ) . '/options-page.php' ) ); + } + } +} diff --git a/wp-content/plugins/shadowbox-js/inc/frontend.php b/wp-content/plugins/shadowbox-js/inc/frontend.php new file mode 100644 index 0000000..c65138a --- /dev/null +++ b/wp-content/plugins/shadowbox-js/inc/frontend.php @@ -0,0 +1,352 @@ +__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 ( '%(?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 ( '%(?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\n"; + $start .= "\n"; + $end = "\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 = "\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 = '/]*)\.(bmp|gif|jpe|jpe?g|png)\\2(.*?)>/i'; + $mov_pattern = '/]*)\.(swf|dv|moo?v|movie|asf|wmv?|avi|mpe?g)\\2(.*?)>/i'; + $aud_pattern = '/]*)\.(mp3|aac)\\2(.*?)>/i'; + $tube_pattern = '/]*)(youtube\.com\/(watch|v\/)|video\.google\.com\/googleplayer.swf)(.*?)\\2(.*?)>/i'; + $flv_pattern = '/]*)\.(flv|f4v|mp4)\\2(.*?)>/i'; + $master_pattern = '/]*)(\.(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 = ''; + $mov_replace = ''; + $aud_replace = ''; + $tube_replace = ''; + $flv_replace = ''; + + // 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; + } +} diff --git a/wp-content/plugins/shadowbox-js/inc/options-page.php b/wp-content/plugins/shadowbox-js/inc/options-page.php new file mode 100644 index 0000000..c5db9ce --- /dev/null +++ b/wp-content/plugins/shadowbox-js/inc/options-page.php @@ -0,0 +1,614 @@ + +
      +

      + +
      +

      + + + +

      +
      + +
      + + options ) ) : // Start option check. Don't show most of the form if there are no options in the db ?> + +

      +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      + + +
      +

      + + + +

      +
      + +
      + + + +
      + +
      + + +

      get_option ( 'players' ) ) ); ?>/>HTML

      +

      get_option ( 'players' ) ) ); ?>/>IFRAME

      +

      get_option ( 'players' ) ) ); ?>/>IMG

      +

      get_option ( 'players' ) ) ); ?>/>QT

      +

      get_option ( 'players' ) ) ); ?>/> SWF

      +

      get_option ( 'players' ) ) ); ?>/> WMP

      + get_option ( 'enableFlv' ) != 'true' ) $class = ' class="hidden"'; else $class = ''; ?> +

      >get_option ( 'players' ) ) ); ?>/>FLV

      + enable FLV support as outlined below.' , 'shadowbox-js' ); ?> +
      + + + +
      + noncommercial license used by JW FLV Media Player. The JW FLV Media Player is licensed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. 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' ); ?> +
      + + + +
      + +
      + + + +
      + +
      +

      +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + Sizzle.js 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' ); ?> +
      + + + +
      + this page. Only one parameter is specified by default: bgcolor. Defaults to {bgcolor:"#000000", allowFullScreen:true}.' , 'shadowbox-js' ); ?> +
      + + + +
      + FlashVars. Defaults to {}.' , 'shadowbox-js' ); ?> +
      + + + +
      + +
      +

      +

      + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      + +
      + + + +
      + enable FLV support.' , 'shadowbox-js' ); + else + _e( 'Default is false.' , 'shadowbox-js' ); + ?> +
      + + + +
      + +
      + + + +
      + +
      + + + +
      + +
      +

      + + + + + + + + + +
      + + + +
      + +
      + + + +
      + +
      + +

      . .

      + +

      +

      + + + + + + + + + +
      + + + +
      + + + +
      +

      + +

      +
      +
      diff --git a/wp-content/plugins/shadowbox-js/js/shadowbox-admin-helper.js b/wp-content/plugins/shadowbox-js/js/shadowbox-admin-helper.js new file mode 100644 index 0000000..880a815 --- /dev/null +++ b/wp-content/plugins/shadowbox-js/js/shadowbox-admin-helper.js @@ -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'); + } + } + }); +}); diff --git a/wp-content/plugins/shadowbox-js/localization/shadowbox-js-template.po b/wp-content/plugins/shadowbox-js/localization/shadowbox-js-template.po new file mode 100644 index 0000000..24914cf --- /dev/null +++ b/wp-content/plugins/shadowbox-js/localization/shadowbox-js-template.po @@ -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 \n" +"Language-Team: Matt Martz \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 %s 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 enable FLV support 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 noncommercial license used by JW FLV Media Player. The JW FLV Media Player is licensed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. 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 Sizzle.js 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 <object>. For a partial list of available parameters, see this page. 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 FlashVars. 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 enable FLV support." +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 "" + diff --git a/wp-content/plugins/shadowbox-js/readme.txt b/wp-content/plugins/shadowbox-js/readme.txt new file mode 100644 index 0000000..919f0a3 --- /dev/null +++ b/wp-content/plugins/shadowbox-js/readme.txt @@ -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://www.youtube.com/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://www.youtube.com/v/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 `` in your themes header.php and `` 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): + +`<a href="http://domain.tld/directory/to/image.jpg" rel="shadowbox[album]">Image</a>` + +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 diff --git a/wp-content/plugins/shadowbox-js/screenshot-1.png b/wp-content/plugins/shadowbox-js/screenshot-1.png new file mode 100644 index 0000000..7f5c966 Binary files /dev/null and b/wp-content/plugins/shadowbox-js/screenshot-1.png differ diff --git a/wp-content/plugins/shadowbox-js/screenshot-2.png b/wp-content/plugins/shadowbox-js/screenshot-2.png new file mode 100644 index 0000000..310f4cf Binary files /dev/null and b/wp-content/plugins/shadowbox-js/screenshot-2.png differ diff --git a/wp-content/plugins/shadowbox-js/screenshot-3.png b/wp-content/plugins/shadowbox-js/screenshot-3.png new file mode 100644 index 0000000..fc6393d Binary files /dev/null and b/wp-content/plugins/shadowbox-js/screenshot-3.png differ diff --git a/wp-content/plugins/shadowbox-js/shadowbox-js.php b/wp-content/plugins/shadowbox-js/shadowbox-js.php new file mode 100644 index 0000000..2442fe2 --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox-js.php @@ -0,0 +1,284 @@ + + * @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 %s 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' ); + } +} diff --git a/wp-content/plugins/shadowbox-js/shadowbox-title-push.php b/wp-content/plugins/shadowbox-js/shadowbox-title-push.php new file mode 100644 index 0000000..1c94f9f --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox-title-push.php @@ -0,0 +1,97 @@ +__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 tag + * and pushing it to the parent tag if the title attribute does not exist on + * the tag. + * + * @since 3.0.3 + * @param string $content The content of the post + * @return string + */ + function push_title_to_anchor ( $content ) { + $master_pattern = '%]+>]+>%'; + $anchor_pattern = '%(]+)>%'; + + if ( preg_match_all ( $master_pattern , $content , $links ) ) { + + foreach ( $links[0] as $link ) { + $anchor_title_pattern = '%]+title=([\'"]).*?\\1[^>]+?>%'; + $img_title_pattern = '%]+(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 (); +} diff --git a/wp-content/plugins/shadowbox-js/shadowbox/LICENSE b/wp-content/plugins/shadowbox-js/shadowbox/LICENSE new file mode 100644 index 0000000..59e6eb6 --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox/LICENSE @@ -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. diff --git a/wp-content/plugins/shadowbox-js/shadowbox/README b/wp-content/plugins/shadowbox-js/shadowbox/README new file mode 100644 index 0000000..c34fc75 --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox/README @@ -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/). diff --git a/wp-content/plugins/shadowbox-js/shadowbox/adapters/base.js b/wp-content/plugins/shadowbox-js/shadowbox/adapters/base.js new file mode 100644 index 0000000..7e0444a --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox/adapters/base.js @@ -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]}}}; \ No newline at end of file diff --git a/wp-content/plugins/shadowbox-js/shadowbox/adapters/dojo.js b/wp-content/plugins/shadowbox-js/shadowbox/adapters/dojo.js new file mode 100644 index 0000000..1dc950b --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox/adapters/dojo.js @@ -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}})}; \ No newline at end of file diff --git a/wp-content/plugins/shadowbox-js/shadowbox/adapters/ext.js b/wp-content/plugins/shadowbox-js/shadowbox/adapters/ext.js new file mode 100644 index 0000000..9f68323 --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox/adapters/ext.js @@ -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)}; \ No newline at end of file diff --git a/wp-content/plugins/shadowbox-js/shadowbox/adapters/jquery.js b/wp-content/plugins/shadowbox-js/shadowbox/adapters/jquery.js new file mode 100644 index 0000000..f44b202 --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox/adapters/jquery.js @@ -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)})}; \ No newline at end of file diff --git a/wp-content/plugins/shadowbox-js/shadowbox/adapters/mootools.js b/wp-content/plugins/shadowbox-js/shadowbox/adapters/mootools.js new file mode 100644 index 0000000..fb67cc3 --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox/adapters/mootools.js @@ -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)}; \ No newline at end of file diff --git a/wp-content/plugins/shadowbox-js/shadowbox/adapters/prototype.js b/wp-content/plugins/shadowbox-js/shadowbox/adapters/prototype.js new file mode 100644 index 0000000..ff293bb --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox/adapters/prototype.js @@ -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)}; \ No newline at end of file diff --git a/wp-content/plugins/shadowbox-js/shadowbox/adapters/yui.js b/wp-content/plugins/shadowbox-js/shadowbox/adapters/yui.js new file mode 100644 index 0000000..2322e7e --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox/adapters/yui.js @@ -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)}; \ No newline at end of file diff --git a/wp-content/plugins/shadowbox-js/shadowbox/cache.js b/wp-content/plugins/shadowbox-js/shadowbox/cache.js new file mode 100644 index 0000000..329b793 --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox/cache.js @@ -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-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;dm){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("#")>-1&&c.indexOf(document.location.href)==0){return"inline"}var d=c.indexOf("?");if(d>-1){c=c.substring(0,d)}var b,a=c.match(fileExtension);if(a){b=a[0].toLowerCase()}if(b){if(S.img&&S.img.ext.indexOf(b)>-1){return"img"}if(S.swf&&S.swf.ext.indexOf(b)>-1){return"swf"}if(S.flv&&S.flv.ext.indexOf(b)>-1){return"flv"}if(S.qt&&S.qt.ext.indexOf(b)>-1){if(S.wmp&&S.wmp.ext.indexOf(b)>-1){return"qtwmp"}else{return"qt"}}if(S.wmp&&S.wmp.ext.indexOf(b)>-1){return"wmp"}}return"iframe"};function filterGallery(){var d=S.errorInfo,e=S.plugins,g,h,l,c,k,b,j,a;for(var f=0;f'+sprintf(S.lang.errors[k],b)+"
  • "}else{h=true}}else{if(g.player=="inline"){c=inlineId.exec(g.content);if(c){j=get(c[1]);if(j){g.content=j.innerHTML}else{h=true}}else{h=true}}else{if(g.player=="swf"||g.player=="flv"){a=(g.options&&g.options.flashVersion)||S.options.flashVersion;if(S.flash&&!S.flash.hasFlashPlayerVersion(a)){g.width=310;g.height=177}}}}if(h){S.gallery.splice(f,1);if(f0?f-1:f}}--f}}}function listenKeys(a){if(!S.options.enableKeys){return}(a?addEvent:removeEvent)(document,"keydown",handleKey)}function handleKey(c){if(c.metaKey||c.shiftKey||c.altKey||c.ctrlKey){return}var b=keyCode(c),a;switch(b){case 81:case 88:case 27:a=S.close;break;case 37:a=S.previous;break;case 39:a=S.next;break;case 32:a=typeof slideTimer=="number"?S.pause:S.play;break}if(a){preventDefault(c);a()}}function load(i){listenKeys(false);var h=S.getCurrent();var e=(h.player=="inline"?"html":h.player);if(typeof S[e]!="function"){throw"unknown player "+e}if(i){S.player.remove();S.revertOptions();S.applyOptions(h.options||{})}S.player=new S[e](h,S.playerId);if(S.gallery.length>1){var f=S.gallery[S.current+1]||S.gallery[0];if(f.player=="img"){var d=new Image();d.src=f.content}var g=S.gallery[S.current-1]||S.gallery[S.gallery.length-1];if(g.player=="img"){var c=new Image();c.src=g.content}}S.skin.onLoad(i,waitReady)}function waitReady(){if(!open){return}if(typeof S.player.ready!="undefined"){var a=setInterval(function(){if(open){if(S.player.ready){clearInterval(a);a=null;S.skin.onReady(show)}}else{clearInterval(a);a=null}},10)}else{S.skin.onReady(show)}}function show(){if(!open){return}S.player.append(S.skin.body,S.dimensions);S.skin.onShow(finish)}function finish(){if(!open){return}if(S.player.onLoad){S.player.onLoad()}S.options.onFinish(S.getCurrent());if(!S.isPaused()){S.play()}listenKeys(true)}; \ No newline at end of file diff --git a/wp-content/plugins/shadowbox-js/shadowbox/expressInstall.swf b/wp-content/plugins/shadowbox-js/shadowbox/expressInstall.swf new file mode 100644 index 0000000..86958bf Binary files /dev/null and b/wp-content/plugins/shadowbox-js/shadowbox/expressInstall.swf differ diff --git a/wp-content/plugins/shadowbox-js/shadowbox/find.js b/wp-content/plugins/shadowbox-js/shadowbox/find.js new file mode 100644 index 0000000..b98fb47 --- /dev/null +++ b/wp-content/plugins/shadowbox-js/shadowbox/find.js @@ -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":function(y,t){var w=typeof t==="string";if(w&&!/\W/.test(t)){t=t.toLowerCase();for(var u=0,e=y.length;u=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((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(t[1]+(t[2]||1))-0;e[3]=t[3]-0}e[0]=n++;return e},ATTR:function(w,t,u,e,x,y){var v=w[1].replace(/\\/g,"");if(!y&&j.attrMap[v]){w[1]=j.attrMap[v]}if(w[2]==="~="){w[4]=" "+w[4]+" "}return w},PSEUDO:function(w,t,u,e,x){if(w[1]==="not"){if((m.exec(w[3])||"").length>1||/^\w/.test(w[3])){w[3]=c(w[3],null,null,t)}else{var v=c.filter(w[3],t,u,true^x);if(!u){e.push.apply(e,v)}return false}}else{if(j.match.POS.test(w[0])||j.match.CHILD.test(w[0])){return true}}return w},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(u,t,e){return !!c(e[3],u).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(t,e){return e===0},last:function(u,t,e,v){return t===v.length-1},even:function(t,e){return e%2===0},odd:function(t,e){return e%2===1},lt:function(u,t,e){return te[3]-0},nth:function(u,t,e){return e[3]-0===t},eq:function(u,t,e){return e[3]-0===t}},filter:{PSEUDO:function(y,u,v,z){var t=u[1],w=j.filters[t];if(w){return w(y,v,u,z)}else{if(t==="contains"){return(y.textContent||y.innerText||b([y])||"").indexOf(u[3])>=0}else{if(t==="not"){var x=u[3];for(var v=0,e=x.length;v=0)}}},ID:function(t,e){return t.nodeType===1&&t.getAttribute("id")===e},TAG:function(t,e){return(e==="*"&&t.nodeType===1)||t.nodeName.toLowerCase()===e},CLASS:function(t,e){return(" "+(t.className||t.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(x,v){var u=v[1],e=j.attrHandle[u]?j.attrHandle[u](x):x[u]!=null?x[u]:x.getAttribute(u),y=e+"",w=v[2],t=v[4];return e==null?w==="!=":w==="="?y===t:w==="*="?y.indexOf(t)>=0:w==="~="?(" "+y+" ").indexOf(t)>=0:!t?y&&e!==false:w==="!="?y!==t:w==="^="?y.indexOf(t)===0:w==="$="?y.substr(y.length-t.length)===t:w==="|="?y===t||y.substr(0,t.length+1)===t+"-":false},POS:function(w,t,u,x){var e=t[2],v=j.setFilters[e];if(v){return v(w,u,t,x)}}}};var i=j.match.POS;for(var f in j.match){j.match[f]=new RegExp(j.match[f].source+/(?![^\[]*\])(?![^\(]*\))/.source);j.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+j.match[f].source)}var l=function(t,e){t=Array.prototype.slice.call(t,0);if(e){e.push.apply(e,t);return e}return t};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(s){l=function(w,v){var t=v||[];if(p.call(w)==="[object Array]"){Array.prototype.push.apply(t,w)}else{if(typeof w.length==="number"){for(var u=0,e=w.length;u";var e=document.documentElement;e.insertBefore(t,e.firstChild);if(document.getElementById(u)){j.find.ID=function(w,x,y){if(typeof x.getElementById!=="undefined"&&!y){var v=x.getElementById(w[1]);return v?v.id===w[1]||typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id").nodeValue===w[1]?[v]:undefined:[]}};j.filter.ID=function(x,v){var w=typeof x.getAttributeNode!=="undefined"&&x.getAttributeNode("id");return x.nodeType===1&&w&&w.nodeValue===v}}e.removeChild(t);e=t=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){j.find.TAG=function(t,x){var w=x.getElementsByTagName(t[1]);if(t[1]==="*"){var v=[];for(var u=0;w[u];u++){if(w[u].nodeType===1){v.push(w[u])}}w=v}return w}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){j.attrHandle.href=function(t){return t.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=c,u=document.createElement("div");u.innerHTML="

    ";if(u.querySelectorAll&&u.querySelectorAll(".TEST").length===0){return}c=function(y,x,v,w){x=x||document;if(!w&&x.nodeType===9&&!d(x)){try{return l(x.querySelectorAll(y),v)}catch(z){}}return e(y,x,v,w)};for(var t in e){c[t]=e[t]}u=null})()}(function(){var e=document.createElement("div");e.innerHTML="
    ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}j.order.splice(1,0,"CLASS");j.find.CLASS=function(t,u,v){if(typeof u.getElementsByClassName!=="undefined"&&!v){return u.getElementsByClassName(t[1])}};e=null})();function a(t,y,x,B,z,A){for(var v=0,u=B.length;v0){w=e;break}}}e=e[t]}B[v]=w}}}var k=document.compareDocumentPosition?function(t,e){return t.compareDocumentPosition(e)&16}:function(t,e){return t!==e&&(t.contains?t.contains(e):true)};var d=function(e){var t=(e?e.ownerDocument||e:0).documentElement;return t?t.nodeName!=="HTML":false};var q=function(e,z){var v=[],w="",x,u=z.nodeType?[z]:z;while((x=j.match.PSEUDO.exec(e))){w+=x[0];e=e.replace(j.match.PSEUDO,"")}e=j.relative[e]?e+"*":e;for(var y=0,t=u.length;y + * Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis + * This software is released under the MIT License + * + * 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(" +
    +

    +

    Wordpress Popular Posts

    + +

    +

    +

    ">.


    + + + + + + +
    +

    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    +
    +

    + + + + + + + + + + + + + + + + + + + +
    get_mostpopular()<?php get_mostpopular(); ?>
    <?php get_mostpopular("range=weekly&limit=7"); ?>
    wpp_get_views()<?php wpp_get_views($post->ID); ?>
    <?php wpp_get_views(15); ?>
    +
    +

    + +

    +
    +

    :

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    headerheader="Popular Posts"
    header_start<h2>header_start="<h2>"
    header_end</h2>header_end="</h2>"
    limit10limit=10
    range"daily", "weekly", "monthly", "all"dailyrange="daily"
    order_by"comments", "views", "avg" commentsorder_by="comments"
    pages1 (true), (0) false1pages=1
    title_length25title_length=25
    excerpt_length55excerpt_length=55
    excerpt_format1 (true), (0) false0excerpt_format=1
    cats_to_excludecats_to_exclude="1,55,74"
    thumbnail_width15thumbnail_width=30
    thumbnail_height15thumbnail_height=30
    thumbnail_selection"wppgenerated", "usergenerated"wppgeneratedthumbnail_selection="wppgenerated"
    rating1 (true), (0) false0rating=1
    stats_comments1 (true), 0 (false)1stats_comments=1
    stats_views1 (true), (0) false0stats_views=1
    stats_author1 (true), (0) false0stats_author=1
    stats_date1 (true), (0) false0stats_date=1
    stats_date_format0stats_date_format='F j, Y'
    wpp_start<ul>wpp_start="<ul>"
    wpp_end</ul>wpp_end="</ul>"
    post_start<li>post_start="<li>"
    post_end</li>post_end="</li>"
    do_pattern1 (true), (0) false0do_pattern=1
    pattern_form: {image}, {title}, {summary}, {stats}, {rating}{image} {title}: {summary} {stats}pattern_form="{image} {title}: {summary} {stats}"
    +
    +
      +

    +


    + + + + + + + + + + + + +
    " onclick="confirm_reset_cache()" />
     
    " onclick="confirm_reset_all()" />
    +
    +
    +
    +

    +

    .

    + /wordpress-popular-posts/btn_donateCC_LG_global.gif" width="122" height="47" alt="" border="0" /> + +
    \ No newline at end of file diff --git a/wp-content/plugins/wordpress-popular-posts/no_thumb.jpg b/wp-content/plugins/wordpress-popular-posts/no_thumb.jpg new file mode 100644 index 0000000..d2f59fa Binary files /dev/null and b/wp-content/plugins/wordpress-popular-posts/no_thumb.jpg differ diff --git a/wp-content/plugins/wordpress-popular-posts/readme.txt b/wp-content/plugins/wordpress-popular-posts/readme.txt new file mode 100644 index 0000000..a81d3a1 --- /dev/null +++ b/wp-content/plugins/wordpress-popular-posts/readme.txt @@ -0,0 +1,237 @@ +=== Wordpress Popular Posts === +Contributors: Ikki24 +Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=dadslayer%40gmail%2ecom&lc=GB&item_name=Wordpress%20Popular%20Posts%20Plugin¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG_global%2egif%3aNonHosted +Tags: popular, posts, widget, seo, wordpress +Requires at least: 2.8 +Tested up to: 3.0.0 +Stable tag: 2.1.4 + +With Wordpress Popular Posts, you can show your visitors what are the most popular entries on your blog. + +== Description == + +Wordpress Popular Posts is a highly customizable sidebar widget that displays the most popular posts on your blog. You can use it as a template tag, too! + +**IMPORTANT NOTICES:** + +From **version 2.0** and on, **Wordpress Popular Posts** requires at least **Wordpress 2.8** in order to function correctly. If you are not running Wordpress 2.8 or can't update your blog right now, please don't upgrade to/install version 2.x! + +Also, if you are upgrading from any version prior to 1.4.6, please [update to 1.4.6](http://downloads.wordpress.org/plugin/wordpress-popular-posts.1.4.6.zip) before moving to 2.x! + +**What's new** + +* Include a **thumbnail** of your posts! **Pick one of your choice** or **let Wordpress Popular Posts generate it for you**! (*see the [FAQ section](http://wordpress.org/extend/plugins/wordpress-popular-posts/faq/) for technical requirements*) +* From version 2.0.3 and on, Wordpress Popular Posts will include a **Dashboard panel** where you can monitor what are the most popular posts on your site directly from your wp-admin area! +* Wordpress Popular Posts is now **multi-widget** capable! Install multiple instances of Wordpress Popular Posts on your sidebars, each with its own unique settings! +* **Shortcode support!** - from version 2.0, you can showcase your most popular posts on pages, too! +* **Category exclusion** - Want to exclude certain categories from the listing? Use the *Exclude Category* option! +* **Automatic maintenance** - Wordpress Popular Posts will wipe out from its cache automatically all those posts that have not been viewed more than 30 days from the current date, keeping the popular ones on the list! This ensures that your cache table will remain as compact as possible! (You can also clear it manually if you like, [look here for instructions](http://wordpress.org/extend/plugins/wordpress-popular-posts/faq/)!). +* **Template tags** - Don't feel like using widgets? No problem! You can still embed your most popular entries on your theme using the **wpp_get_mostpopular()** template tag. Additionally, a *new* tag has been included on this release: **wpp_gets_views()**. For usage and instructions, please refer to the [instalation section](http://wordpress.org/extend/plugins/wordpress-popular-posts/installation/). + +**Other features** + +* Use **your own layout**! Control how your most popular posts are shown on your theme. +* *Wordpress Popular Posts can be localized*! Languages included on this release: *English* (default), *Italian* and *Spanish*. Wanna know how to translate Wordpress Popular Posts into your language? See the [FAQ section](http://wordpress.org/extend/plugins/wordpress-popular-posts/faq/) for more! +* *Time Range* - list your most popular posts within a specific time range (eg. today's popular posts, this week's popular posts, etc.)! +* [WP-PostRatings](http://wordpress.org/extend/plugins/wp-postratings/) support added! Show your visitors how your readers are rating your posts! +* Wanna show your readers a sneak peak of your most popular entries? Wordpress Popular Posts can include excerpts, too! +* List your posts either by **comment count**, **views** or **average daily views**. Sorted by **comment count** by default. +* You can also list those pages of your blog (About, Services, Archives, etc.) that are getting a lot of attention from your readers. Enabled by default. + +== Installation == + +1. Download the plugin and extract its contents. +2. Upload the `wordpress-popular-posts` folder to the `/wp-content/plugins/` directory. +3. Activate **Wordpress Popular Posts** plugin through the 'Plugins' menu in WordPress. +4. In your admin console, go to Appeareance > Widgets, drag the Wordpress Popular Posts widget to wherever you want it to be and click on Save. +5. (optional) Go to Appeareance > Editor. On "Theme Files", click on `header.php` and make sure that the `` tag is present (should be right before the closing `` tag). + +That's it! + += Using Wordpress Popular Posts on Pages = + +If you want to use Wordpress Popular Posts on your pages (a "Hall of Fame" page, for example) please use the shortcode `[wpp]`. Attributes are **optional**, however you can use them if needed. You can find a complete list of the attributes Wordpress Popular Posts currently supports at your *wp-admin > Settings > Wordpress Popular Posts* page. + +**Usage:** + +`[wpp]` + +`[wpp attribute='value']` + + += Template Tags = + + +***wpp_get_mostpopular*** + +Due to the fact that some themes are not widget-ready, or that some blog users don't like widgets at all, there's another choice: the **wpp_get_mostpopular** template tag. With it, you can embed the most popular posts of your blog on your site's sidebar without using a widget. This function also accepts parameters (optional) so you can customize the look and feel of the listing. + + +**Usage:** + +Without any parameters: + +`` + + +Using parameters: + + +`` + + +For a complete list of parameters (also known as "attributes"), please check your *wp-admin > Settings > Wordpress Popular Posts* page. + + +***wpp_get_views()*** + +The **wpp_get_views** template tag retrieves the views count of a single post since the plugin was installed. It only accepts one parameter: the post ID (eg. echo wpp_get_views(15)). If the function doesn't get passed a post ID when called, it'll return false instead. + +**Usage:** + +`` + +== Frequently Asked Questions == + +* *I'm getting "Sorry. No data so far". What's up with that?* +There are a number of reasons that might explain why you are seeing this message: Wordpress Popular Posts won't count views generated by logged in users (if your blog requires readers to be logged in to access its contents, [this tutorial](http://wordpress.org/support/topic/398760) is for you); your current theme does not have the [wp_header()](http://codex.wordpress.org/Theme_Development#Plugin_API_Hooks) tag in its <head> section, required by my plugin to keep track of what your visitors are viewing on your site; no one has seen your posts/pages since Wordpress Popular Posts activation, you should give it some time. Wordpress Popular Posts works based on views, mainly. Whenever a post gets a view, WPP will register it on its cache table. Only those posts registered by my plugin will be listed. It doesn't really make much difference if a post has got a lot of comments or not if it hasn't been cached by my plugin - it still needs to be viewed by someone/people in order to rank as popular. + +* *I'm unable to activate the "Display post thumbnail" option. Why?* +Make sure that: your host is running **PHP 4.3 or higher**; the **GD library** is installed and [enabled by your host](http://wordpress.org/support/topic/289778#post-1366038); your "wordpress-popular-posts/scripts/cache" directory **exists** and is **writable**; there are images on your posts (either attachted or selected under Featured Image). + +* *I want to use custom thumbnails. Can it be done?* Yup. Please follow these instructions to [use your own thumbnails](http://wordpress.org/support/topic/413441#post-1562888). + +* *Can I embed my most popular posts in any other ways than via sidebar widgets?* +Yes. You have two other ways to achieve this: via **shortcode** [wpp] (so you can embed it directly on your posts / pages), or via **template tag**. + +* *What are the parameters that the wpp_get_mostpopular() template tag and the [wpp] shortcode accept?* +You can find a complete list of parameters via wp-admin > Settings > Wordpress Popular Posts under the section "What attributes does Wordpress Popular Posts shortcode [wpp] have?". + +* *I would like to clear Wordpress Popular Posts cache and start over. How can I do that?* +If you go to *wp-admin > Settings > Wordpress Popular Posts*, you'll find two buttons that should do what you need: **Clear cache** and **Clear all data**. The first one just wipes out what's in cache, keeping the historical data intact (All-time). The latter, wipes out everything from Wordpress Popular Posts data tables - even the historical data. Note that this **cannot be undone**. + +* *Does your plugin include any css stylesheets?* +Yes, *but* there are no predefined styles (well, almost). It's there for you to style your most popular posts list as you like. You might need a hand with that if you don't know html/css, though. + +* *Would you help me style my list, please?* +For a small donation, sure why not? + +* *I want your plugin to have x or y functionality. Would you do it for me?* +I usually accept suggestions, yes. However, if it doesn't fit the nature of my plugin (to list popular posts) or requires something that might affect other users' experiences, chances are that I won't implement it. However, I could cook up a customized version of Wordpress Popular Posts just for you if you really, really need that special feature/capability ... but it won't be for free. + +* *I want to translate your plugin into my language / help you update a PO file. What do I need to do?* +There's a PO file included with Wordpress Popular Posts. If your language is not already supported by my plugin, you can use a [gettext](http://www.gnu.org/software/gettext/) editor like [Poedit](http://www.poedit.net/) to translate all definitions into your language. If you want to, you can send me your resulting PO and MO files to *me at cabrerahector dot com* so I can include them on the next release of my plugin. + +* *Help! I'm having some issues with your plugin! What should I do?* +Please don't, and read my words carefully, don't use my email address to contact me for support (unless I authorize you to do so). It'll surely be of more help for other people running into similar issues if you posted your doubts/questions/suggestions on the [Wordpress Popular Posts Support forums](http://wordpress.org/tags/wordpress-popular-posts?forum_id=10) (please be as descriptive as possible)! + +== Screenshots == + +1. Widgets Control Panel. +2. Wordpress Popular Posts Widget. +3. Wordpress Popular Posts Widget on Kubrik Theme's sidebar. +4. Wordpress Popular Posts Stats panel. + +== Changelog == += 2.1.4 = +* Added italian localization. Thanks Gianni! +* Added charset detection. +* Fixed bug preventing HTML View / Visual View on Edit Post page from working. + += 2.1.1 = +* Fixed bug preventing widget title from being saved. +* Fixed bug affecting blogs with Wordpress installed somewhere else than domain's root. +* Added htmlentities to post titles. +* Added default thumbnail image if none is found in the post. + += 2.1.0 = +* Title special HTML entities bug fixed. +* Thumbnail feature improved! Wordpress Popular Posts now supports The Post Thumbnail feature. You can choose whether to select your own thumbnails, or let Wordpress Popular Posts create them for you! +* Shortcode bug fixed. Thanks Krokkodriljo! +* Category exclusion feature improved. Thanks raamdev! + += 2.0.3 = +* Added a Statistics Dashboard to Admin panel so users can view what's popular directly from there. +* Users can now select a different date format. +* get_mostpopular() function deprecated. Replaced with wpp_get_mostpopular(). +* Cache maintenance bug fixed. +* Several UI enhancements were applied to this version. + += 2.0.2 = +* "Keep text format and links" feature introduced. If selected, formatting tags and hyperlinks won't be removed from excerpt. +* Post title excerpt html entities bug fixed. It was causing the excerpt function to display more characters than the requested by user. +* Several shortcode bugs fixed (range, order_by, do_pattern, pattern_form were not working as expected). + += 2.0.1 = +* Post title excerpt now includes html entities. Characters like ÅÄÖ should display properly now. +* Post excerpt has been improved. Now it supports the following HTML tags: a, b, i, strong, em. +* Template tag wpp_get_views() added. Retrieves the views count of a single post. +* Template tag get_mostpopular() re-added. Parameter support included. +* Shortcode bug fixed (range was always "daily" no matter what option was being selected by the user). + += 2.0.0 = +* Plugin rewritten to support Multi-Widget capabilities +* Cache table implemented +* Shortcode support added +* Category exclusion feature added +* Ajax update added - plugin is now compatible with caching plugins such as WP Super Cache +* Thumbnail feature improved - some bugs were fixed, too +* Maintenance page added + += 1.5.1 = +* Widget bug fixed + += 1.5.0 = +* Database improvements implemented +* WP-PostRatings support added +* Thumbnail feature added + += 1.4.6 = +* Bug in get_mostpopular function affected comments on single.php +* "Show pageviews" option bug fixed +* Added "content formatting tags" functionality + += 1.4.5 = +* Added new localizable strings +* Fixed Admin page coding bug that was affecting the styling of WPP + += 1.4.4 = +* HTML Markup customizer added +* Removed some unnessesary files + += 1.4.3 = +* Korean and Swedish are supported + += 1.4.2 = +* Code snippet bug found + += 1.4.1 = +* Found database bug affecting only new installations + += 1.4 = +* Massive code enhancement +* CSS bugs fixed +* Features added: Time Range; author and date (stats tag); separate settings for Widget and Code Snippet + += 1.3.2 = +* Permalink bug fixed + += 1.3.1 = +* Admin panel styling bug fixed + += 1.3 = +* Added an Admin page for a better management of the plugin +* New sorting options (sort posts by comment count, by pageviews, or by average daily views) added + += 1.2 = +* Added extra functionalities to Wordpress Popular Post plugin core + += 1.1 = +* Fixed comment count bug + += 1.0 = +* Public release + +== Upgrade Notice == + +From version 2.x and on, Wordpress Popular Posts requires at least Wordpress 2.8 in order to function properly. If you can't move to Wordpress 2.8 or newer right now, please install version 1.5.1. \ No newline at end of file diff --git a/wp-content/plugins/wordpress-popular-posts/screenshot-1.gif b/wp-content/plugins/wordpress-popular-posts/screenshot-1.gif new file mode 100644 index 0000000..1b171b6 Binary files /dev/null and b/wp-content/plugins/wordpress-popular-posts/screenshot-1.gif differ diff --git a/wp-content/plugins/wordpress-popular-posts/screenshot-2.gif b/wp-content/plugins/wordpress-popular-posts/screenshot-2.gif new file mode 100644 index 0000000..b3ee910 Binary files /dev/null and b/wp-content/plugins/wordpress-popular-posts/screenshot-2.gif differ diff --git a/wp-content/plugins/wordpress-popular-posts/screenshot-3.gif b/wp-content/plugins/wordpress-popular-posts/screenshot-3.gif new file mode 100644 index 0000000..ee1bdb7 Binary files /dev/null and b/wp-content/plugins/wordpress-popular-posts/screenshot-3.gif differ diff --git a/wp-content/plugins/wordpress-popular-posts/screenshot-4.gif b/wp-content/plugins/wordpress-popular-posts/screenshot-4.gif new file mode 100644 index 0000000..07cfb46 Binary files /dev/null and b/wp-content/plugins/wordpress-popular-posts/screenshot-4.gif differ diff --git a/wp-content/plugins/wordpress-popular-posts/scripts/cache/Thumbs.db b/wp-content/plugins/wordpress-popular-posts/scripts/cache/Thumbs.db new file mode 100644 index 0000000..b98cd94 Binary files /dev/null and b/wp-content/plugins/wordpress-popular-posts/scripts/cache/Thumbs.db differ diff --git a/wp-content/plugins/wordpress-popular-posts/scripts/timthumb.php b/wp-content/plugins/wordpress-popular-posts/scripts/timthumb.php new file mode 100644 index 0000000..a8cac43 --- /dev/null +++ b/wp-content/plugins/wordpress-popular-posts/scripts/timthumb.php @@ -0,0 +1,614 @@ + +*/ + +/* +$sizeLimits = array( + "100x100", + "150x150", +); +*/ + +define ('CACHE_SIZE', 250); // number of files to store before clearing cache +define ('CACHE_CLEAR', 5); // maximum number of files to delete on each cache clear +define ('VERSION', '1.09'); // version number (to force a cache refresh + +$imageFilters = array( + "1" => array(IMG_FILTER_NEGATE, 0), + "2" => array(IMG_FILTER_GRAYSCALE, 0), + "3" => array(IMG_FILTER_BRIGHTNESS, 1), + "4" => array(IMG_FILTER_CONTRAST, 1), + "5" => array(IMG_FILTER_COLORIZE, 4), + "6" => array(IMG_FILTER_EDGEDETECT, 0), + "7" => array(IMG_FILTER_EMBOSS, 0), + "8" => array(IMG_FILTER_GAUSSIAN_BLUR, 0), + "9" => array(IMG_FILTER_SELECTIVE_BLUR, 0), + "10" => array(IMG_FILTER_MEAN_REMOVAL, 0), + "11" => array(IMG_FILTER_SMOOTH, 0), +); + +// sort out image source +$src = get_request("src", ""); +if($src == "" || strlen($src) <= 3) { + displayError("no image specified"); +} + +// clean params before use +$src = cleanSource($src); +// last modified time (for caching) +$lastModified = filemtime($src); + +// get properties +$new_width = preg_replace("/[^0-9]+/", "", get_request("w", 0)); +$new_height = preg_replace("/[^0-9]+/", "", get_request("h", 0)); +$zoom_crop = preg_replace("/[^0-9]+/", "", get_request("zc", 1)); +$quality = preg_replace("/[^0-9]+/", "", get_request("q", 80)); +$filters = get_request("f", ""); + +if ($new_width == 0 && $new_height == 0) { + $new_width = 100; + $new_height = 100; +} + +// set path to cache directory (default is ./cache) +// this can be changed to a different location +$cache_dir = './cache'; + +// get mime type of src +$mime_type = mime_type($src); + +// check to see if this image is in the cache already +check_cache( $cache_dir, $mime_type ); + +// if not in cache then clear some space and generate a new file +cleanCache(); + +ini_set('memory_limit', "30M"); + +// make sure that the src is gif/jpg/png +if(!valid_src_mime_type($mime_type)) { + displayError("Invalid src mime type: " .$mime_type); +} + +// check to see if GD function exist +if(!function_exists('imagecreatetruecolor')) { + displayError("GD Library Error: imagecreatetruecolor does not exist"); +} + +if(strlen($src) && file_exists($src)) { + + // open the existing image + $image = open_image($mime_type, $src); + if($image === false) { + displayError('Unable to open image : ' . $src); + } + + // Get original width and height + $width = imagesx($image); + $height = imagesy($image); + + // don't allow new width or height to be greater than the original + if( $new_width > $width ) { + $new_width = $width; + } + if( $new_height > $height ) { + $new_height = $height; + } + + // generate new w/h if not provided + if( $new_width && !$new_height ) { + + $new_height = $height * ( $new_width / $width ); + + } elseif($new_height && !$new_width) { + + $new_width = $width * ( $new_height / $height ); + + } elseif(!$new_width && !$new_height) { + + $new_width = $width; + $new_height = $height; + + } + + // create a new true color image + $canvas = imagecreatetruecolor( $new_width, $new_height ); + imagealphablending($canvas, false); + // Create a new transparent color for image + $color = imagecolorallocatealpha($canvas, 0, 0, 0, 127); + // Completely fill the background of the new image with allocated color. + imagefill($canvas, 0, 0, $color); + // Restore transparency blending + imagesavealpha($canvas, true); + + if( $zoom_crop ) { + + $src_x = $src_y = 0; + $src_w = $width; + $src_h = $height; + + $cmp_x = $width / $new_width; + $cmp_y = $height / $new_height; + + // calculate x or y coordinate and width or height of source + + if ( $cmp_x > $cmp_y ) { + + $src_w = round( ( $width / $cmp_x * $cmp_y ) ); + $src_x = round( ( $width - ( $width / $cmp_x * $cmp_y ) ) / 2 ); + + } elseif ( $cmp_y > $cmp_x ) { + + $src_h = round( ( $height / $cmp_y * $cmp_x ) ); + $src_y = round( ( $height - ( $height / $cmp_y * $cmp_x ) ) / 2 ); + + } + + imagecopyresampled( $canvas, $image, 0, 0, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h ); + + } else { + + // copy and resize part of an image with resampling + imagecopyresampled( $canvas, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height ); + + } + + if ($filters != "") { + // apply filters to image + $filterList = explode("|", $filters); + foreach($filterList as $fl) { + $filterSettings = explode(",", $fl); + if(isset($imageFilters[$filterSettings[0]])) { + + for($i = 0; $i < 4; $i ++) { + if(!isset($filterSettings[$i])) { + $filterSettings[$i] = null; + } + } + + switch($imageFilters[$filterSettings[0]][1]) { + + case 1: + + imagefilter($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1]); + break; + + case 2: + + imagefilter($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2]); + break; + + case 3: + + imagefilter($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3]); + break; + + default: + + imagefilter($canvas, $imageFilters[$filterSettings[0]][0]); + break; + + } + } + } + } + + // output image to browser based on mime type + show_image($mime_type, $canvas, $cache_dir); + + // remove image from memory + imagedestroy($canvas); + +} else { + + if(strlen($src)) { + displayError("image " . $src . " not found"); + } else { + displayError("no source specified"); + } + +} + +/** + * + */ +function show_image($mime_type, $image_resized, $cache_dir) { + + global $quality; + + // check to see if we can write to the cache directory + $is_writable = 0; + $cache_file_name = $cache_dir . '/' . get_cache_file(); + + if(touch($cache_file_name)) { + + // give 666 permissions so that the developer + // can overwrite web server user + chmod($cache_file_name, 0666); + $is_writable = 1; + + } else { + + $cache_file_name = NULL; + header('Content-type: ' . $mime_type); + + } + + $quality = floor($quality * 0.09); + + imagepng($image_resized, $cache_file_name, $quality); + + if($is_writable) { + show_cache_file($cache_dir, $mime_type); + } + + imagedestroy($image_resized); + + displayError("error showing image"); + +} + +/** + * + */ +function get_request( $property, $default = 0 ) { + + if( isset($_REQUEST[$property]) ) { + + return $_REQUEST[$property]; + + } else { + + return $default; + + } + +} + +/** + * + */ +function open_image($mime_type, $src) { + + if(stristr($mime_type, 'gif')) { + + $image = imagecreatefromgif($src); + + } elseif(stristr($mime_type, 'jpeg')) { + + @ini_set('gd.jpeg_ignore_warning', 1); + $image = imagecreatefromjpeg($src); + + } elseif( stristr($mime_type, 'png')) { + + $image = imagecreatefrompng($src); + + } + + return $image; + +} + +/** + * clean out old files from the cache + * you can change the number of files to store and to delete per loop in the defines at the top of the code + */ +function cleanCache() { + + $files = glob("cache/*", GLOB_BRACE); + + $yesterday = time() - (24 * 60 * 60); + + if (count($files) > 0) { + + usort($files, "filemtime_compare"); + $i = 0; + + if (count($files) > CACHE_SIZE) { + + foreach ($files as $file) { + + $i ++; + + if ($i >= CACHE_CLEAR) { + return; + } + + if (filemtime($file) > $yesterday) { + return; + } + + unlink($file); + + } + + } + + } + +} + +/** + * compare the file time of two files + */ +function filemtime_compare($a, $b) { + + return filemtime($a) - filemtime($b); + +} + +/** + * determine the file mime type + */ +function mime_type($file) { + + if (stristr(PHP_OS, 'WIN')) { + $os = 'WIN'; + } else { + $os = PHP_OS; + } + + $mime_type = ''; + + if (function_exists('mime_content_type')) { + $mime_type = mime_content_type($file); + } + + // use PECL fileinfo to determine mime type + if (!valid_src_mime_type($mime_type)) { + if (function_exists('finfo_open')) { + $finfo = finfo_open(FILEINFO_MIME); + $mime_type = finfo_file($finfo, $file); + finfo_close($finfo); + } + } + + // try to determine mime type by using unix file command + // this should not be executed on windows + if (!valid_src_mime_type($mime_type) && $os != "WIN") { + if (preg_match("/FREEBSD|LINUX/", $os)) { + $mime_type = trim(@shell_exec('file -bi "' . $file . '"')); + } + } + + // use file's extension to determine mime type + if (!valid_src_mime_type($mime_type)) { + + // set defaults + $mime_type = 'image/png'; + // file details + $fileDetails = pathinfo($file); + $ext = strtolower($fileDetails["extension"]); + // mime types + $types = array( + 'jpg' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'png' => 'image/png', + 'gif' => 'image/gif' + ); + + if (strlen($ext) && strlen($types[$ext])) { + $mime_type = $types[$ext]; + } + + } + + return $mime_type; + +} + +/** + * + */ +function valid_src_mime_type($mime_type) { + + if (preg_match("/jpg|jpeg|gif|png/i", $mime_type)) { + return true; + } + + return false; + +} + +/** + * + */ +function check_cache($cache_dir, $mime_type) { + + // make sure cache dir exists + if (!file_exists($cache_dir)) { + // give 777 permissions so that developer can overwrite + // files created by web server user + mkdir($cache_dir); + chmod($cache_dir, 0777); + } + + show_cache_file($cache_dir, $mime_type); + +} + +/** + * + */ +function show_cache_file($cache_dir) { + + $cache_file = $cache_dir . '/' . get_cache_file(); + + if (file_exists($cache_file)) { + + $gmdate_mod = gmdate("D, d M Y H:i:s", filemtime($cache_file)); + + if(! strstr($gmdate_mod, "GMT")) { + $gmdate_mod .= " GMT"; + } + + if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"])) { + + // check for updates + $if_modified_since = preg_replace("/;.*$/", "", $_SERVER["HTTP_IF_MODIFIED_SINCE"]); + + if ($if_modified_since == $gmdate_mod) { + header("HTTP/1.1 304 Not Modified"); + exit; + } + + } + + $fileSize = filesize($cache_file); + + // send headers then display image + header("Content-Type: image/png"); + header("Accept-Ranges: bytes"); + header("Last-Modified: " . $gmdate_mod); + header("Content-Length: " . $fileSize); + header("Cache-Control: max-age=9999, must-revalidate"); + header("Expires: " . $gmdate_mod); + + readfile($cache_file); + + exit; + + } + +} + +/** + * + */ +function get_cache_file() { + + global $lastModified; + static $cache_file; + + if(!$cache_file) { + $cachename = $_SERVER['QUERY_STRING'] . VERSION . $lastModified; + $cache_file = md5($cachename) . '.png'; + } + + return $cache_file; + +} + +/** + * check to if the url is valid or not + */ +function valid_extension ($ext) { + + if (preg_match("/jpg|jpeg|png|gif/i", $ext)) { + return TRUE; + } else { + return FALSE; + } + +} + +/** + * tidy up the image source url + */ +function cleanSource($src) { + + // remove slash from start of string + if(strpos($src, "/") == 0) { + $src = substr($src, -(strlen($src) - 1)); + } + + // remove http/ https/ ftp + $src = preg_replace("/^((ht|f)tp(s|):\/\/)/i", "", $src); + // remove domain name from the source url + $host = $_SERVER["HTTP_HOST"]; + $src = str_replace($host, "", $src); + $host = str_replace("www.", "", $host); + $src = str_replace($host, "", $src); + + // don't allow users the ability to use '../' + // in order to gain access to files below document root + + // src should be specified relative to document root like: + // src=images/img.jpg or src=/images/img.jpg + // not like: + // src=../images/img.jpg + $src = preg_replace("/\.\.+\//", "", $src); + + // get path to image on file system + $src = get_document_root($src) . '/' . $src; + + return $src; + +} + +/** + * + */ + +function get_document_root ($src) { + + // check for unix servers + if(@file_exists($_SERVER['DOCUMENT_ROOT'] . '/' . $src)) { + return $_SERVER['DOCUMENT_ROOT']; + } + + // check from script filename (to get all directories to timthumb location) + $parts = array_diff(explode('/', $_SERVER['SCRIPT_FILENAME']), explode('/', $_SERVER['DOCUMENT_ROOT'])); + $path = $_SERVER['DOCUMENT_ROOT'] . '/'; + foreach ($parts as $part) { + $path .= $part . '/'; + if (file_exists($path . $src)) { + return $path; + } + } + + // the relative paths below are useful if timthumb is moved outside of document root + // specifically if installed in wordpress themes like mimbo pro: + // /wp-content/themes/mimbopro/scripts/timthumb.php + $paths = array( + ".", + "..", + "../..", + "../../..", + "../../../..", + "../../../../.." + ); + + foreach($paths as $path) { + if(@file_exists($path . '/' . $src)) { + return $path; + } + } + + // special check for microsoft servers + if(!isset($_SERVER['DOCUMENT_ROOT'])) { + $path = str_replace("/", "\\", $_SERVER['ORIG_PATH_INFO']); + $path = str_replace($path, "", $_SERVER['SCRIPT_FILENAME']); + + if( @file_exists( $path . '/' . $src ) ) { + return $path; + } + } + + displayError('file not found ' . $src); + +} + +/** + * generic error message + */ +function displayError($errorString = '') { + + header('HTTP/1.1 400 Bad Request'); + die($errorString); + +} +?> \ No newline at end of file diff --git a/wp-content/plugins/wordpress-popular-posts/stats.php b/wp-content/plugins/wordpress-popular-posts/stats.php new file mode 100644 index 0000000..c65bfe3 --- /dev/null +++ b/wp-content/plugins/wordpress-popular-posts/stats.php @@ -0,0 +1,119 @@ + + + + +
    +

    +

    Wordpress Popular Posts Stats

    +

    +
    + + + + + +
    +
    + +
    + wpp_end=]'); ?> +
    +
    + wpp_end=]'); ?> +
    +
    + wpp_end=]'); ?> +
    +
    + wpp_end=]'); ?> +
    +
    + +
    \ No newline at end of file diff --git a/wp-content/plugins/wordpress-popular-posts/style/wpp.css b/wp-content/plugins/wordpress-popular-posts/style/wpp.css new file mode 100644 index 0000000..62c61e6 --- /dev/null +++ b/wp-content/plugins/wordpress-popular-posts/style/wpp.css @@ -0,0 +1,42 @@ +/* +Wordpress Popular Posts plugin stylesheet +Developed by Hector Cabrera + +Use the following classes to style your popular posts list as you like. +*/ + +/* title styles */ +.wpp-post-title { +} + +/* thumbnail styles */ +img.wpp-thumbnail { + border:none; +} + +/* excerpt styles */ +.wpp-excerpt { +} + +/* Stats tag styles */ +.post-stats { + font-size:9px; + font-weight:bold; +} + + .wpp-comments { + } + + .wpp-views { + } + + .wpp-author { + font-style:italic; + } + + .wpp-date { + } + +/* WP-PostRatings styles */ +.wpp-rating { +} \ No newline at end of file diff --git a/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts-es_ES.mo b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts-es_ES.mo new file mode 100644 index 0000000..f322f09 Binary files /dev/null and b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts-es_ES.mo differ diff --git a/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts-es_ES.po b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts-es_ES.po new file mode 100644 index 0000000..3d72d33 --- /dev/null +++ b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts-es_ES.po @@ -0,0 +1,691 @@ +msgid "" +msgstr "" +"Project-Id-Version: Wordpress Popular Posts\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-07-01 10:18-0430\n" +"PO-Revision-Date: \n" +"Last-Translator: Hector Cabrera \n" +"Language-Team: Héctor Cabrera \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: English\n" +"X-Poedit-Country: VENEZUELA\n" +"X-Poedit-SourceCharset: iso-8859-1\n" +"X-Poedit-KeywordsList: __;_e\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: .\n" + +#: maintenance.php:58 +msgid "This operation will delete all entries from Wordpress Popular Posts' cache table and cannot be undone." +msgstr "Esta operación eliminará todas las entradas del cache de Wordpress Popular Posts y no puede revertirse." + +#: maintenance.php:58 +#: maintenance.php:66 +msgid "Do you want to continue?" +msgstr "¿Quieres continuar?" + +#: maintenance.php:66 +msgid "This operation will delete all stored info from Wordpress Popular Posts' data tables and cannot be undone." +msgstr "Esta operación eliminará toda la información almacenada de las tablas de data de Wordpress Popular Posts y no puede revertirse." + +#: maintenance.php:78 +msgid "Whoa! What just happened in here?!" +msgstr "¡Whoa! ¿Qué pasó aquí?" + +#: maintenance.php:79 +msgid "Previous users of Wordpress Popular Posts will remember that earlier versions of my plugin used to display a Settings page over here. However, from version 2.0 and on things will be slightly different." +msgstr "Los usuarios previos de Wordpress Popular Posts recordarán que versiones anteriores de mi plugin mostraba una página de Configuración aquí. Sin embargo, desde la versión 2.0 en adelante las cosas serán algo diferentes." + +#: maintenance.php:80 +msgid "Wordpress Popular Posts has gone multi-widget so now you'll be able to install multiple instances of my plugin on your sidebars, each with its own unique settings! Because of that, having a General Settings page to handle all instances is simply not a good idea. Fear not, my friend, since you still can set each instance's configuration via" +msgstr "Wordpress Popular Posts ahora es multi-widget, podrás instalar múltiples instancias de mi plugin en tus barras laterales, ¡cada una con su configuración propia! Por ello, tener una página de Configuración General para manejar todas las instancias no es una buena idea. No temas, amigo mío, ya que puedes manejar la configuración de cada instancia a través de la sección" + +#: maintenance.php:80 +msgid "Widgets page" +msgstr "Widgets" + +#: maintenance.php:84 +msgid "Help" +msgstr "Ayuda" + +#: maintenance.php:85 +msgid "What does \"Include pages\" do?" +msgstr "¿Qué hace \"Incluir páginas\"?" + +#: maintenance.php:87 +msgid "If checked, Wordpress Popular Posts will also list the most viewed pages on your blog. Enabled by default." +msgstr "Si de tilda, Wordpress Popular Posts también listará las páginas más populares en tu blog. Habilitado por defecto." + +#: maintenance.php:89 +msgid "What does \"Display post rating\" do?" +msgstr "¿Qué hace \"Mostrar rating del post\"?" + +#: maintenance.php:91 +msgid "If checked, Wordpress Popular Posts will show how your readers are rating your most popular posts. This feature requires having WP-PostRatings plugin installed and enabled on your blog for it to work. Disabled by default." +msgstr "Si se tilda, Wordpress Popular Posts mostrará como tus lectores están calificando tus posts más populares. Esta funcionalidad requiere que el plugin WP-PostRatings esté instalado y activado en tu blog para que funcione. Deshabilitado por defecto." + +#: maintenance.php:93 +msgid "What does \"Shorten title output\" do?" +msgstr "¿Qué hace \"Acortar títulos\"?" + +#: maintenance.php:95 +msgid "If checked, all posts titles will be shortened to \"n\" characters. A new \"Shorten title to\" option will appear so you can set it to whatever you like. Disabled by default." +msgstr "Si se tilda, todos los títulos de posts se acortará \"n\" caracteres. Una nueva opción, \"Acortar título a\" aparecerá para que puedas configurarlo como gustes. Desactivado por defecto." + +#: maintenance.php:97 +msgid "What does \"Display post excerpt\" do?" +msgstr "¿Qué hace \"Mostrar extracto del post\"?" + +#: maintenance.php:99 +msgid "If checked, Wordpress Popular Posts will also include a small extract of your posts in the list. Similarly to the previous option, you will be able to decide how long the post excerpt should be. Disabled by default." +msgstr "Si se tilda, Wordpress Popular Posts también incluirá un pequeño extracto de tus posts en la lista. Similarmente a la opción anterior, podrás decidir qué tan largo debe ser el extracto. Desactivado por defecto." + +#: maintenance.php:101 +msgid "What does \"Keep text format and links\" do?" +msgstr "¿Qué hace \"Mantener formato de texto y links\"?" + +#: maintenance.php:103 +msgid "If checked, and if the Post Excerpt feature is enabled, Wordpress Popular Posts will keep the styling tags (eg. bold, italic, etc) that were found in the excerpt. Hyperlinks will remain intact, too." +msgstr "Si se tilda, y si Mostrar Extracto del Post está habilitado, Wordpress Popular Posts mantendrá las etiquetas de estilo (ejem. bold, italic, etc) que se encontraron en el extracto. Los hipervínculos se mantendrán intactos también." + +#: maintenance.php:105 +msgid "What does \"Exclude Categories\" do?" +msgstr "¿Qué hace \"Excluir Categorías\"?" + +#: maintenance.php:107 +msgid "If checked, Wordpress Popular Posts will exclude from the listing all those entries that belong to specific categories. When entering more than one Category ID, you need to use commas to separate them (eg. 1,5,12 - no spaces!). Disabled by default." +msgstr "Si se tilda, Wordpress Popular Posts excluirá del listado todas aquellas entradas pertenecientes a categorías específicas. Cuando se ingresa más de un ID de Categoría, necesitas utilizar comas para separarlas (ejem. 1,5,12 - !sin espacios!). Deshabilitado por defecto." + +#: maintenance.php:109 +msgid "What does \"Display post thumbnail\" do?" +msgstr "¿Qué hace \"Mostrar miniatura\"?" + +#: maintenance.php:111 +msgid "If checked, Wordpress Popular Posts will attempt to find the very first image of each post in the listing and turn it into a thumbnail. Note that for this option to work you must check that: your current web host is running PHP 4.3+ or higher and the GD Library is installed and enabled; also that your \"wordpress-popular-posts/scripts/cache\" directory exists and is writable. Disabled by default." +msgstr "Si se tilda, Wordpress Popular Posts intentará encontrar la primera imagen de cada post para convertirla en una miniatura (thumbnail). Nota que para que esta opción funcione debes verificar que: tu host está corre bajo PHP 4.3+ o mejor y que la librería GD está instalada y habilitada; tambié que tu carpeta \"wordpress-popular-posts/scripts/cache\" existe is es escribible. Desactivada por defecto." + +#: maintenance.php:113 +msgid "What does \"Generate all thumbnails for me\" and \"Use thumbnails selected by me\" do?" +msgstr "¿Qué hacen \"Genera las miniaturas por mi\" y \"Usa las miniaturas que seleccioné\"?" + +#: maintenance.php:115 +msgid "The first option tells Wordpress Popular Posts to generate automatically all thumbnails from the first image attached to each post. If you select the latter, Wordpress Popular Posts will use the thumbnail you have selected for each post on the Post Edit Screen in the Post Thumbnail metabox (this also requires including add_theme_support(\"post-thumbnails\") to your theme's functions.php file)." +msgstr "La primera opción le dice a Wordpress Popular Posts que genere automáticamente todas las miniaturas de la primera imagen adjuntada a cada entrada. Si seleccionas la última, Wordpress Popular Posts utilizará la miniatura que seleccionaste en la caja de para cada entrada (esto también requiere incluir add_theme_support(\"post-thumbnails\") al archivo functions.php de tu tema actual)." + +#: maintenance.php:117 +msgid "What does \"Display comment count\" do?" +msgstr "¿Qué hace \"Mostrar comentarios\"?" + +#: maintenance.php:119 +msgid "If checked, Wordpress Popular Posts will display how many comments each popular post has got until now. Enabled by default." +msgstr "Si se tilda, Wordpress Popular Posts mostrará cuántos comentarios ha obtenido cada post popular hasta ahora. Habilitado por defecto." + +#: maintenance.php:121 +msgid "What does \"Display views\" do?" +msgstr "¿Qué hace \"Mostrar vistas\"?" + +#: maintenance.php:123 +msgid "If checked, Wordpress Popular Posts will show how many pageviews a single post has gotten so far since this plugin was installed. Disabled by default." +msgstr "Si se tilda, Wordpress Popular Posts mostrará cuántas vistas ha obtenido un post desde la instalación de este plugin. Deshabilitado por defecto." + +#: maintenance.php:125 +msgid "What does \"Display author\" do?" +msgstr "¿Qué hace \"Mostrar autor\"?" + +#: maintenance.php:127 +msgid "If checked, Wordpress Popular Posts will display the name of the author of each entry listed. Disabled by default." +msgstr "Si se tilda, Wordpress Popular Posts mostrará el nombre del autor de cada entrada listada. Deshabilitado por defecto." + +#: maintenance.php:129 +msgid "What does \"Display date\" do?" +msgstr "¿Qué hace \"Mostrar fecha\"?" + +#: maintenance.php:131 +msgid "If checked, Wordpress Popular Posts will display the date when each popular posts was published. Disabled by default." +msgstr "Si se tilda, Wordpress Popular Posts mostrará la fecha en que cada post popular fue publicado. Deshabilitado por defecto." + +#: maintenance.php:133 +msgid "What does \"Use custom HTML Markup\" do?" +msgstr "¿Qué hace \"Utilizar Markup HTML personalizado\"?" + +#: maintenance.php:135 +msgid "If checked, you will be able to customize the HTML markup of your popular posts listing. For example, you can decide whether to wrap your posts in an unordered list, an ordered list, a div, etc. If you know xHTML/CSS, this is for you! Disabled by default." +msgstr "Si se tilda, podrás personalizar el markup HTML (la estructura HTML) del listado de tus posts. Por ejemplo, puedes decidir si tus posts estarán dentro de una lista desordenada (ul), una lista ordenada (ol), un div, etc. Si sabes xHTML/CSS, ¡esto es para tí!" + +#: maintenance.php:137 +msgid "What does \"Use content formatting tags\" do?" +msgstr "¿Qué hace \"Utilizar etiquetas de contenido\"?" + +#: maintenance.php:139 +msgid "If checked, you can decide the order of the items displayed on each entry. For example, setting it to \"{title}: {summary}\" (without the quotes) would display \"Post title: excerpt of the post here\". Available tags: {image}, {title}, {summary}, {stats} and {rating}. Disabled by default." +msgstr "Si se tilda, puedes decidir el orden de los items mostrados en cada entrada. Por ejemplo, configurarlo como \"{title}: {summary}\" (sin las comillas) mostraría \"Título del post: extracto del post aquí\". Etiquetas disponibles: {image}, {title}, {summary}, {stats} y {rating}. Deshabilitado por defecto." + +#: maintenance.php:141 +msgid "What are \"Template Tags\"?" +msgstr "¿Qué son los \"Template Tags\"?" + +#: maintenance.php:143 +msgid "Template Tags are simply php functions that allow you to perform certain actions. For example, Wordpress Popular Posts currently supports two different template tags: get_mostpopular() and wpp_get_views()." +msgstr "Los Template Tags son simplemente funciones php que te permiten realizar ciertas acciones. Por ejemplo, Wordpress Popular Posts actualmante soporte dos template tags diferentes: get_mostpopular y wpp_get_views()." + +#: maintenance.php:145 +msgid "What are the template tags that Wordpress Popular Posts supports?" +msgstr "¿Cuáles template tags soporta Wordpress Popular Posts?" + +#: maintenance.php:147 +msgid "The following are the template tags supported by Wordpress Popular Posts:" +msgstr "Los siguientes son los template tags soportados por Wordpress Popular Posts:" + +#: maintenance.php:150 +msgid "Template tag" +msgstr "Template tag" + +#: maintenance.php:151 +#: maintenance.php:179 +msgid "What it does " +msgstr "Qué hace" + +#: maintenance.php:152 +msgid "Parameters" +msgstr "Parámetros" + +#: maintenance.php:153 +#: maintenance.php:182 +msgid "Example" +msgstr "Ejemplo" + +#: maintenance.php:157 +msgid "Similar to the widget functionality, this tag retrieves the most popular posts on your blog. While it can be customized via parameters, these are not needed for it to work." +msgstr "Al igual que la funcionalidad tipo widget, este tag obtiene los posts más populares de tu blog. Puede ser personalizado via parámetros, pero no son necesarios para que funcione." + +#: maintenance.php:158 +msgid "Please refer to \"What attributes does Wordpress Popular Posts shortcode [wpp] have?\"" +msgstr "Favor leer \"¿Cuáles template tags soporta Wordpress Popular Posts?\"" + +#: maintenance.php:163 +msgid "Displays the number of views of a single post. Post ID required, or it will return false." +msgstr "Muestra el número de vistas de un post. Se requiere el ID del post, o la función retornará falso." + +#: maintenance.php:164 +msgid "Post ID" +msgstr "ID del Post" + +#: maintenance.php:169 +msgid "What are \"shortcodes\"?" +msgstr "¿Qué son los \"shortcodes\"?" + +#: maintenance.php:171 +msgid "Shortcodes are hooks that allow us to call a php function by simply typing something like [shortcode]. With Wordpress Popular Posts, the shortcode [wpp] will let you insert a list of the most popular posts in posts content and pages too! For more information about shortcodes, please visit" +msgstr "Los shortcodes son hooks que nos permiten llamar a una función php simplemente escribiendo algo como [shortcode]. Con Wordpress Popular Posts, el shortcode [wpp] te permitirá insertar una lista de los posts más populares en páginas y en los contenidos de los posts. Para más informació visita" + +#: maintenance.php:173 +msgid "What attributes does Wordpress Popular Posts shortcode [wpp] have?" +msgstr "¿Qué atributos tiene el shortcode [wpp] de Wordpress Popular Posts?" + +#: maintenance.php:175 +msgid "There are a number of attributes Wordpress Popular Posts currently supports:" +msgstr "Hay un número de atributos que Wordpress Popular Posts actualmente soporta:" + +#: maintenance.php:178 +msgid "Attributes" +msgstr "Atributos" + +#: maintenance.php:180 +msgid "Possible values" +msgstr "Valores Posibles" + +#: maintenance.php:181 +msgid "Defaults to" +msgstr "Por defecto" + +#: maintenance.php:186 +msgid "Sets a heading for the list" +msgstr "Setea el encabezado de la lista" + +#: maintenance.php:187 +#: maintenance.php:194 +#: maintenance.php:201 +#: maintenance.php:257 +#: maintenance.php:320 +#: maintenance.php:327 +#: maintenance.php:334 +#: maintenance.php:341 +#: maintenance.php:348 +msgid "Text string" +msgstr "Cadena de texto" + +#: maintenance.php:188 +#: wordpress-popular-posts.php:183 +msgid "Popular Posts" +msgstr "Entradas Populares" + +#: maintenance.php:193 +msgid "Set the opening tag for the heading of the list" +msgstr "Setea la etiqueta html de apertura del encabezado de la lista" + +#: maintenance.php:200 +msgid "Set the closing tag for the heading of the list" +msgstr "Setea la etiqueta de cierre del encabezado de la lista" + +#: maintenance.php:207 +msgid "Sets the maximum number of popular posts to be shown on the listing" +msgstr "Setea el número máximo de posts populares a mostrarse en la lista" + +#: maintenance.php:208 +#: maintenance.php:236 +#: maintenance.php:243 +#: maintenance.php:264 +#: maintenance.php:271 +msgid "Positive integer" +msgstr "Entero positivo" + +#: maintenance.php:214 +msgid "Tells Wordpress Popular Posts to retrieve the most popular entries within the time range specified by you" +msgstr "Le dice a Wordpress Popular Posts que debe traer los posts más populares que estén dentro del tiempo especificado por tí." + +#: maintenance.php:221 +msgid "Sets the sorting option of the popular posts" +msgstr "Setea el valor por el cual deben ordenarse los posts populares" + +#: maintenance.php:222 +msgid "(for average views per day)" +msgstr "(vistas promedio por día)" + +#: maintenance.php:228 +msgid "Tells Wordpress Popular Posts whether to consider or not pages while building the popular list" +msgstr "Le dice a Wordpress Popular Posts si debe considerar o no las páginas mientras construye la lista popular" + +#: maintenance.php:235 +msgid "If set, Wordpress Popular Posts will shorten each post title to \"n\" characters whenever possible" +msgstr "Si se setea, Wordpress Popular Posts acortará cada título a \"n\" caracteres cuando sea posible" + +#: maintenance.php:242 +msgid "If set, Wordpress Popular Posts will build and include an excerpt of \"n\" characters long from the content of each post listed as popular" +msgstr "Si se setea, Wordpress Popular Posts construirá e insertará un extracto de \"n\" caracteres de largo del contenido de cada post listado como popular" + +#: maintenance.php:249 +msgid "If set, Wordpress Popular Posts will maintaing all styling tags (strong, italic, etc) and hyperlinks found in the excerpt" +msgstr "Si se setea, Wordpress Popular Posts mantendrá las etiquetas de formato (strong, italic, etc) y los hipervínculos encontrados en el extracto" + +#: maintenance.php:256 +msgid "If set, Wordpress Popular Posts will exclude all entries that belong to the specified category(ies)." +msgstr "Si se setea, Wordpress Popular Posts excluirá todas las entradas que pertenezcan a las categorías especificadas." + +#: maintenance.php:258 +msgid "None" +msgstr "Ninguno" + +#: maintenance.php:263 +msgid "If set, and if your current server configuration allows it, you will be able to display thumbnails of your posts. This attribute sets the width for thumbnails" +msgstr "Si se setea, y si la configuración actual de tu servidor lo permite, podrás mostrar miniaturas (thumbnails) de tus posts. Este atributo setea el ancho de las miniaturas" + +#: maintenance.php:270 +msgid "If set, and if your current server configuration allows it, you will be able to display thumbnails of your posts. This attribute sets the height for thumbnails" +msgstr "Si se setea, y si la configuración actual de tu servidor lo permite, podrás mostrar miniaturas (thumbnails) de tus posts. Este atributo setea el alto de las miniaturas" + +#: maintenance.php:277 +msgid "Sets the source of thumbnails to use for each post listed. If set to wppgenerated Wordpress Popular Posts will create the images for you, otherwise it will use the thumbnails selected by you. *Requires enabling The Post Thumbnail feature on your theme*" +msgstr "Setea la fuente de las miniaturas a utilizar con cada post en el listado. Si se setea como wppgenerated Wordpress Popular Posts creará las imágenes por ti, caso contrario utilizará las miniaturas que has seleccionado. *Requiere habilitar la funcionalidad de The Post Thumbnail en tu tema*" + +#: maintenance.php:284 +msgid "If set, and if the WP-PostRatings plugin is installed and enabled on your blog, Wordpress Popular Posts will show how your visitors are rating your entries" +msgstr "Si se setea, y si el plugin WP-PostRatings está instalado y activo en tu blog, Wordpress Popular Posts mostrará cómo tus visitantes califican tus entradas" + +#: maintenance.php:291 +msgid "If set, Wordpress Popular Posts will show how many comments each popular post has got until now" +msgstr "Si se setea, Wordpress Popular Posts mostrará cuántos comentarios ha obtenido cada post popular hasta ahora" + +#: maintenance.php:298 +msgid "If set, Wordpress Popular Posts will show how many views each popular post has got since it was installed" +msgstr "Si se setea, Wordpress Popular Posts mostrará cuántas vistas ha obtenido cada post popular desde que se instaló el plugin" + +#: maintenance.php:305 +msgid "If set, Wordpress Popular Posts will show who published each popular post on the list" +msgstr "Si se setea, Wordpress Popular Posts mostrará quién publicó cada uno de los posts populares de la lista" + +#: maintenance.php:312 +msgid "If set, Wordpress Popular Posts will when each popular post on the list was published" +msgstr "Si se setea, Wordpress Popular Posts mostrará cuando fue publicado cada post en la lista" + +#: maintenance.php:319 +msgid "Sets the date format" +msgstr "Setea el formato de la fecha" + +#: maintenance.php:326 +msgid "Sets the opening tag for the listing" +msgstr "Setea la etiqueta de apertura de la lista" + +#: maintenance.php:333 +msgid "Sets the closing tag for the listing" +msgstr "Setea la etiqueta de cierre de la lista" + +#: maintenance.php:340 +msgid "Sets the opening tag for each item on the list" +msgstr "Setea la etiqueta de apertura de cada item en la lista" + +#: maintenance.php:347 +msgid "Sets the closing tag for each item on the list" +msgstr "Setea la etiqueta de cierre de cada item en la lista" + +#: maintenance.php:354 +msgid "If set, this option will allow you to decide the order of the contents within each item on the list." +msgstr "Si se setea, esta opción te permitirá decidir el orden de los contenidos de cada item en la lista" + +#: maintenance.php:361 +msgid "If set, you can decide the order of each content inside a single item on the list. For example, setting it to \"{title}: {summary}\" would output something like \"Your Post Title: summary here\". This attribute requires do_pattern to be true." +msgstr "Si se setea, puedes decidir el orden de los contenidos de cada item en la lista. Por ejemplo, configurarlo como \"{title}: {summary}\" mostraría algo como \"Tu título: extracto del post aquí\". Este atributo requiere que do_pattern sea true." + +#: maintenance.php:362 +msgid "Available tags" +msgstr "Etiquetas disponibles" + +#: maintenance.php:371 +msgid "Maintenance Settings" +msgstr "Opciones de Mantenimiento" + +#: maintenance.php:372 +msgid "Wordpress Popular Posts keeps historical data of your most popular entries for up to 30 days. If for some reason you need to clear the cache table, or even both historical and cache tables, please use the buttons below to do so." +msgstr "Wordpress Popular Posts guarda data histórica de tus posts más populares por hasta 30 días. Si por alguna razón necesitas limpiar el cache, o inclusive tanto el cache como la tabla histórica, por favor utiliza los botones de abajo." + +#: maintenance.php:375 +msgid "Empty cache" +msgstr "Vaciar cache" + +#: maintenance.php:376 +msgid "Use this button to manually clear entries from WPP cache only" +msgstr "Utiliza este botón para limpiar manualmente todas las entradas del cache de Wordpress Popular Posts" + +#: maintenance.php:382 +msgid "Clear all data" +msgstr "Eliminar toda la data" + +#: maintenance.php:383 +msgid "Use this button to manually clear entries from all WPP data tables" +msgstr "Utiliza este botón para limpiar toda la data de Wordpress Popular Posts" + +#: maintenance.php:391 +msgid "Do you like this plugin?" +msgstr "¿Te gusta este plugin?" + +#: maintenance.php:391 +msgid "Rate Wordpress Popular Posts!" +msgstr "¡Califica Wordpress Popular Posts!" + +#: maintenance.php:391 +msgid "Rate it 5" +msgstr "¡Dale un 5" + +#: maintenance.php:391 +msgid "on the official Plugin Directory!" +msgstr "en el directorio oficial de plugins!" + +#: maintenance.php:392 +msgid "Do you love this plugin?" +msgstr "¿Te encanta este plugin?" + +#: maintenance.php:392 +#: maintenance.php:393 +msgid "Buy me a beer!" +msgstr "¡Cómprame una cerveza!" + +#: maintenance.php:392 +msgid "Each donation motivates me to keep releasing free stuff for the Wordpress community!" +msgstr "¡Cada donativo me motiva a seguir contribuyendo con la comunidad Wordpress!" + +#: stats.php:90 +msgid "Click on each tab to see what are the most popular entries on your blog today, this week, last 30 days or all time since Wordpress Popular Posts was installed." +msgstr "Haga clic en cada pestaña para ver cuáles son las entradas más populares en su blog hoy, esta semana, en los últimos 30 dís o desde que se instaló Wordpress Popular Posts." + +#: stats.php:92 +msgid "Yesterday" +msgstr "Ayer" + +#: stats.php:93 +#: wordpress-popular-posts.php:242 +msgid "Today" +msgstr "Hoy" + +#: stats.php:94 +msgid "Weekly" +msgstr "Semanalmente" + +#: stats.php:95 +msgid "Monthly" +msgstr "Mensualmente" + +#: stats.php:96 +#: wordpress-popular-posts.php:245 +msgid "All-time" +msgstr "Todos" + +#: wordpress-popular-posts.php:236 +msgid "Title:" +msgstr "Título:" + +#: wordpress-popular-posts.php:238 +msgid "Show up to:" +msgstr "Mostrar hasta:" + +#: wordpress-popular-posts.php:239 +msgid "posts" +msgstr "posts" + +#: wordpress-popular-posts.php:240 +msgid "Time Range:" +msgstr "Rango de tiempo:" + +#: wordpress-popular-posts.php:243 +msgid "Last 7 days" +msgstr "Últimos 7 días" + +#: wordpress-popular-posts.php:244 +msgid "Last 30 days" +msgstr "Últimos 30 días" + +#: wordpress-popular-posts.php:248 +msgid "Sort posts by:" +msgstr "Ordernar posts por:" + +#: wordpress-popular-posts.php:250 +msgid "Comments" +msgstr "Comentarios" + +#: wordpress-popular-posts.php:251 +msgid "Total views" +msgstr "Vistas" + +#: wordpress-popular-posts.php:252 +msgid "Avg. daily views" +msgstr "Vistas por día" + +#: wordpress-popular-posts.php:255 +msgid "Include pages" +msgstr "Incluir páginas" + +#: wordpress-popular-posts.php:257 +msgid "Display post rating" +msgstr "Mostrar calificación del post" + +#: wordpress-popular-posts.php:259 +msgid "Shorten title output" +msgstr "Acortar título" + +#: wordpress-popular-posts.php:261 +msgid "Shorten title to" +msgstr "acortar título a" + +#: wordpress-popular-posts.php:261 +#: wordpress-popular-posts.php:268 +msgid "characters" +msgstr "caracteres" + +#: wordpress-popular-posts.php:263 +msgid "Display post excerpt" +msgstr "Mostrar extracto del post" + +#: wordpress-popular-posts.php:266 +msgid "Excerpt Properties" +msgstr "Propiedades del extracto" + +#: wordpress-popular-posts.php:267 +msgid "Keep text format and links" +msgstr "Mantener formato de texto y links" + +#: wordpress-popular-posts.php:268 +msgid "Excerpt length:" +msgstr "Longitud del extracto:" + +#: wordpress-popular-posts.php:272 +msgid "Exclude categories" +msgstr "Excluir categorías" + +#: wordpress-popular-posts.php:275 +msgid "Categories to exclude" +msgstr "Categorías a excluir" + +#: wordpress-popular-posts.php:276 +msgid "ID(s) (comma separated, no spaces):" +msgstr "ID(s) (separado por comas, sin espacios):" + +#: wordpress-popular-posts.php:282 +msgid "Thumbnail settings" +msgstr "Configuración de la miniatura" + +#: wordpress-popular-posts.php:283 +msgid "Display post thumbnail" +msgstr "Mostrar miniatura" + +#: wordpress-popular-posts.php:286 +msgid "Generate all thumbnails for me" +msgstr "Genera las miniaturas por mi" + +#: wordpress-popular-posts.php:287 +msgid "Use thumbnails selected by me" +msgstr "Usa las ministuras que seleccioné" + +#: wordpress-popular-posts.php:289 +msgid "Width:" +msgstr "Ancho:" + +#: wordpress-popular-posts.php:290 +#: wordpress-popular-posts.php:292 +msgid "px" +msgstr "px" + +#: wordpress-popular-posts.php:291 +msgid "Height:" +msgstr "Alto:" + +#: wordpress-popular-posts.php:299 +msgid "Stats Tag settings" +msgstr "Configuración del Stats Tag" + +#: wordpress-popular-posts.php:300 +msgid "Display comment count" +msgstr "Mostrar comentarios" + +#: wordpress-popular-posts.php:301 +msgid "Display views" +msgstr "Mostrar vistas" + +#: wordpress-popular-posts.php:302 +msgid "Display author" +msgstr "Mostrar autor" + +#: wordpress-popular-posts.php:303 +msgid "Display date" +msgstr "Mostrar fecha" + +#: wordpress-popular-posts.php:306 +msgid "Date Format" +msgstr "Formato de la fecha" + +#: wordpress-popular-posts.php:317 +msgid "HTML Markup settings" +msgstr "Configuración del Markup HTML" + +#: wordpress-popular-posts.php:318 +msgid "Use custom HTML Markup" +msgstr "Utilizar Markup HTML personalizado" + +#: wordpress-popular-posts.php:321 +msgid "Before / after title:" +msgstr "Antes / después del título:" + +#: wordpress-popular-posts.php:323 +msgid "Before / after Popular Posts:" +msgstr "Antes / después de los Post Populares:" + +#: wordpress-popular-posts.php:325 +msgid "Before / after each post:" +msgstr "Antes / después de cada post:" + +#: wordpress-popular-posts.php:329 +msgid "Use content formatting tags" +msgstr "Utilizar etiquetas de contenido" + +#: wordpress-popular-posts.php:332 +msgid "Content format:" +msgstr "Formato del contenido:" + +#: wordpress-popular-posts.php:400 +msgid "Success! The cache table has been cleared!" +msgstr "!Eacute;xito! !El cache ha sido vaciado!" + +#: wordpress-popular-posts.php:402 +msgid "Error: cache table does not exist." +msgstr "Error: la tabla cache no existe." + +#: wordpress-popular-posts.php:408 +msgid "Success! All data have been cleared!" +msgstr "!Eacute;xito! !Toda la data ha sido eliminada!" + +#: wordpress-popular-posts.php:410 +msgid "Error: one or both data tables are missing." +msgstr "Error: una o ambas tablas de datos no existen." + +#: wordpress-popular-posts.php:413 +msgid "Invalid action." +msgstr "Acción inválida." + +#: wordpress-popular-posts.php:416 +msgid "Sorry, you do not have enough permissions to do this. Please contact the site administrator for support." +msgstr "Lo lamento, no tienes suficientes permisos para hacer esto. Por favor contacta al administrador del sitio." + +#: wordpress-popular-posts.php:600 +msgid "Sorry. No data so far." +msgstr "Lo lamento, no hay información aún." + +#: wordpress-popular-posts.php:644 +msgid " comment(s)" +msgstr "comentario(s)" + +#: wordpress-popular-posts.php:647 +msgid " view(s)" +msgstr "vista(s)" + +#: wordpress-popular-posts.php:652 +msgid " view(s) per day" +msgstr "vista(s) por día" + +#: wordpress-popular-posts.php:665 +#: wordpress-popular-posts.php:667 +msgid "by" +msgstr "por" + +#: wordpress-popular-posts.php:672 +#: wordpress-popular-posts.php:674 +msgid "posted on" +msgstr "publicado el" + +#: wordpress-popular-posts.php:973 +msgid "Your Wordpress version is too old. Wordpress Popular Posts Plugin requires at least version 2.8 to function correctly. Please update your blog via Tools > Upgrade." +msgstr "Tu versión de Wordpress es muy antigua. El plugin Wordpress Popular Posts requiere al menos la versión 2.8 para funcionar correctamente. Por favor actualiza tu blog via Herramientas > Actualizar." + +#: wordpress-popular-posts.php:1096 +msgid "Wordpress Popular Posts Stats" +msgstr "Estadísticas de Wordpress Popular Posts" + +#~ msgid "See statistics also in" +#~ msgstr "Ver estadísticas en" diff --git a/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts-it_IT.mo b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts-it_IT.mo new file mode 100644 index 0000000..593092a Binary files /dev/null and b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts-it_IT.mo differ diff --git a/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts-it_IT.po b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts-it_IT.po new file mode 100644 index 0000000..065a4ca --- /dev/null +++ b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts-it_IT.po @@ -0,0 +1,689 @@ +msgid "" +msgstr "" +"Project-Id-Version: Wordpress Popular Posts in italiano\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-07-13 18:47+0100\n" +"PO-Revision-Date: \n" +"Last-Translator: Gianni Diurno (aka gidibao) \n" +"Language-Team: Gianni Diurno | gidibao.net \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Italian\n" +"X-Poedit-Country: ITALY\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-KeywordsList: __;_e\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: .\n" + +#: maintenance.php:58 +msgid "This operation will delete all entries from Wordpress Popular Posts' cache table and cannot be undone." +msgstr "Questa operazione (irreversibile) cancellerà tutte le pubblicazioni presenti nella tabella per la cache di Wordpress Popular Posts." + +#: maintenance.php:58 +#: maintenance.php:66 +msgid "Do you want to continue?" +msgstr "Desideri proseguire?" + +#: maintenance.php:66 +msgid "This operation will delete all stored info from Wordpress Popular Posts' data tables and cannot be undone." +msgstr "Questa operazione (irreversibile) cancellerà tutte le info allocate nella tabella per la cache di Wordpress Popular Posts." + +#: maintenance.php:78 +msgid "Whoa! What just happened in here?!" +msgstr "Oh oh! Cosa é successo?!" + +#: maintenance.php:79 +msgid "Previous users of Wordpress Popular Posts will remember that earlier versions of my plugin used to display a Settings page over here. However, from version 2.0 and on things will be slightly different." +msgstr "Gli utenti di vecchia data di Wordpress Popular Posts ricorderanno sicuramente che nelle precedenti versioni del mio plugin veniva qui mostrata la pagina delle impostazioni: dalla versione 2.0 le cose sono un po' cambiate..." + +#: maintenance.php:80 +msgid "Wordpress Popular Posts has gone multi-widget so now you'll be able to install multiple instances of my plugin on your sidebars, each with its own unique settings! Because of that, having a General Settings page to handle all instances is simply not a good idea. Fear not, my friend, since you still can set each instance's configuration via" +msgstr "Grazie ai multi-widget di Wordpress Popular Posts potrai installare nella sidebar più richieste ogniuna delle quali con delle proprie impostazioni! In ragione di questo, nella pagina delle impostazioni generali potrai gestire tutte le richieste. Niente paura amico mio: puoi operare sulle impostazioni anche dalla pagina dei" + +#: maintenance.php:80 +msgid "Widgets page" +msgstr "Widget" + +#: maintenance.php:84 +msgid "Help" +msgstr "Info aiuto" + +#: maintenance.php:85 +msgid "What does \"Include pages\" do?" +msgstr "A cosa serve \"Includi pagine\"?" + +#: maintenance.php:87 +msgid "If checked, Wordpress Popular Posts will also list the most viewed pages on your blog. Enabled by default." +msgstr "Se attiva, Wordpress Popular Posts includerà anche la lista delle pagine più viste del tuo blog. Attiva da predefinite." + +#: maintenance.php:89 +msgid "What does \"Display post rating\" do?" +msgstr "A cosa serve \"Mostra valutazione articoli\"?" + +#: maintenance.php:91 +msgid "If checked, Wordpress Popular Posts will show how your readers are rating your most popular posts. This feature requires having WP-PostRatings plugin installed and enabled on your blog for it to work. Disabled by default." +msgstr "Se attiva, Wordpress Popular Posts mostrerà il voto espresso dai tuoi lettori. Affinché questa opzione possa funzionare sarà necessario che tu abbia installato ed attivato il plugin WP-PostRatings. Non attiva da predefinite." + +#: maintenance.php:93 +msgid "What does \"Shorten title output\" do?" +msgstr "A cosa serve \"Abbreviazione titoli\"?" + +#: maintenance.php:95 +msgid "If checked, all posts titles will be shortened to \"n\" characters. A new \"Shorten title to\" option will appear so you can set it to whatever you like. Disabled by default." +msgstr "Se attiva, tutti i titoli degli articoli saranno abbreviati in \"n\" caratteri. Apparirà una nuova opzione a nome \"Abbrevia il titolo in\" così potrai impostare a tuo piacere. Non attiva da predefinite." + +#: maintenance.php:97 +msgid "What does \"Display post excerpt\" do?" +msgstr "A cosa serve \"Mostra estratto articolo\"?" + +#: maintenance.php:99 +msgid "If checked, Wordpress Popular Posts will also include a small extract of your posts in the list. Similarly to the previous option, you will be able to decide how long the post excerpt should be. Disabled by default." +msgstr "Se attivo, Wordpress Popular Posts includerà anche nella lista un breve estratto dei tuoi articoli. Così come per l'opzione precedente, avrai la possibilità di scegliere la lunghezza dell'estratto. Non attiva da predefinite." + +#: maintenance.php:101 +msgid "What does \"Keep text format and links\" do?" +msgstr "A cosa serve \"Mantieni il formato del testo e lascia i link\"?" + +#: maintenance.php:103 +msgid "If checked, and if the Post Excerpt feature is enabled, Wordpress Popular Posts will keep the styling tags (eg. bold, italic, etc) that were found in the excerpt. Hyperlinks will remain intact, too." +msgstr "Se attiva e nel caso in cui la funzione \"Mostra estratto articolo\" fosse operativa, Wordpress Popular Posts manterrà i tag di stile (ad es. bold, italic, etc) presenti nell'estratto. Anche i link non verranno rimossi." + +#: maintenance.php:105 +msgid "What does \"Exclude Categories\" do?" +msgstr "A cosa serve \"Escludi categorie\"?" + +#: maintenance.php:107 +msgid "If checked, Wordpress Popular Posts will exclude from the listing all those entries that belong to specific categories. When entering more than one Category ID, you need to use commas to separate them (eg. 1,5,12 - no spaces!). Disabled by default." +msgstr "Se attiva, Wordpress Popular Posts escluderà dall'elenco tutte le pubblicazioni relative a quella specifica categoria. Volessi in serire una o più ID categoria, ricordati che dovrai separarle con una virgola (es. 1,5,12 - nessuna spaziatura!). Non attiva da predefinite." + +#: maintenance.php:109 +msgid "What does \"Display post thumbnail\" do?" +msgstr "A cosa serve \"Mostra miniature articolo\"?" + +#: maintenance.php:111 +msgid "If checked, Wordpress Popular Posts will attempt to find the very first image of each post in the listing and turn it into a thumbnail. Note that for this option to work you must check that: your current web host is running PHP 4.3+ or higher and the GD Library is installed and enabled; also that your \"wordpress-popular-posts/scripts/cache\" directory exists and is writable. Disabled by default." +msgstr "Se attiva, Wordpress Popular Posts proverà a trovare la prima immagine di ogni articolo presente nell'elenco quindi, la renderà una miniatura. Ti ricordo che affinché questa opzione possa funzionare sarà necessario che tu l'abbia attivata: il tuo web host deve utilizzare PHP 4.3+ o superiore ed avere installata ed attiva la Libreria GD inoltre, dovrà essere presente nonché scrivibile la cartella \"wordpress-popular-posts/scripts/cache\". Non attiva da predefinite." + +#: maintenance.php:113 +msgid "What does \"Generate all thumbnails for me\" and \"Use thumbnails selected by me\" do?" +msgstr "A cosa servono \"Genera tutte le miniature\" e \"Usa le miniature da me indicate\"?" + +#: maintenance.php:115 +msgid "The first option tells Wordpress Popular Posts to generate automatically all thumbnails from the first image attached to each post. If you select the latter, Wordpress Popular Posts will use the thumbnail you have selected for each post on the Post Edit Screen in the Post Thumbnail metabox (this also requires including add_theme_support(\"post-thumbnails\") to your theme's functions.php file)." +msgstr "La prima opzione richiederà a Wordpress Popular Posts di generare la miniatura (in automatico) dalla prima immagine allegata in ogni articolo. Selezionando la seconda, Wordpress Popular Posts utilizzerà la miniatura da te indicata nella sezione \"Immagine in evidenza\" dell'editor (é necessario che il file functions.php tuo tema contenga add_theme_support(\"post-thumbnails\"))." + +#: maintenance.php:117 +msgid "What does \"Display comment count\" do?" +msgstr "A cosa serve \"Mostra totale commenti\"?" + +#: maintenance.php:119 +msgid "If checked, Wordpress Popular Posts will display how many comments each popular post has got until now. Enabled by default." +msgstr "Se attiva, Wordpress Popular Posts mostrerà il numero attuale dei commenti ricevuti da ogni articolo più popolare. Attiva da predefinite." + +#: maintenance.php:121 +msgid "What does \"Display views\" do?" +msgstr "A cosa serve \"Mostra letture\"?" + +#: maintenance.php:123 +msgid "If checked, Wordpress Popular Posts will show how many pageviews a single post has gotten so far since this plugin was installed. Disabled by default." +msgstr "Se attiva, Wordpress Popular Posts mostrerà quante volte é stato visualizzato l'articolo dalla prima installazione del plugin in poi. Non attiva da predefinite." + +#: maintenance.php:125 +msgid "What does \"Display author\" do?" +msgstr "A cosa serve \"Mostra autore\"?" + +#: maintenance.php:127 +msgid "If checked, Wordpress Popular Posts will display the name of the author of each entry listed. Disabled by default." +msgstr "Se attiva, Wordpress Popular Posts mostrerà nell'elenco delle pubblicazioni il nome dell'autore. Non attiva da predefinite." + +#: maintenance.php:129 +msgid "What does \"Display date\" do?" +msgstr "A cosa serve \"Mostra la data\"?" + +#: maintenance.php:131 +msgid "If checked, Wordpress Popular Posts will display the date when each popular posts was published. Disabled by default." +msgstr "Se attiva, Wordpress Popular Posts mostrerà la data di pubblicazione di ogni articolo più popolare. Non attiva da predefinite." + +#: maintenance.php:133 +msgid "What does \"Use custom HTML Markup\" do?" +msgstr "A cosa serve \"Usa markup HTML personale\"?" + +#: maintenance.php:135 +msgid "If checked, you will be able to customize the HTML markup of your popular posts listing. For example, you can decide whether to wrap your posts in an unordered list, an ordered list, a div, etc. If you know xHTML/CSS, this is for you! Disabled by default." +msgstr "Se attiva, avrai la possibilità di personalizzare il markup HTML dell'elenco degli articoli più popolari. Ad esempio, volessi disporre gli articoli con un elenco puntato o numerato, con un div, etc. Utilizzare questa opzione solo in caso di esperienza con il xHTML/CSS. Non attiva da predefinite." + +#: maintenance.php:137 +msgid "What does \"Use content formatting tags\" do?" +msgstr "A cosa serve \"Utilizza tag formattazione contenuto\"?" + +#: maintenance.php:139 +msgid "If checked, you can decide the order of the items displayed on each entry. For example, setting it to \"{title}: {summary}\" (without the quotes) would display \"Post title: excerpt of the post here\". Available tags: {image}, {title}, {summary}, {stats} and {rating}. Disabled by default." +msgstr "Se attiva, potrai decidere la disposizione dei termini per ogni articolo. Ad esempio, impostando a \"{title}: {summary}\" (senza le virgolette) verrà mostrato \"Nome dell'articolo: qui l'estratto dell'articolo\". Tag disponibili: {image}, {title}, {summary}, {stats} e {rating}. Non attivo da predefinite." + +#: maintenance.php:141 +msgid "What are \"Template Tags\"?" +msgstr "Cosa sono i \"Template Tags\"?" + +#: maintenance.php:143 +msgid "Template Tags are simply php functions that allow you to perform certain actions. For example, Wordpress Popular Posts currently supports two different template tags: get_mostpopular() and wpp_get_views()." +msgstr "I Template Tags sono delle semplici funzioni php che ti permettono di eseguire delle date azioni. Ad esempio, per il momento Wordpress Popular Posts supporta due distinti template tags: get_mostpopular() e wpp_get_views()." + +#: maintenance.php:145 +msgid "What are the template tags that Wordpress Popular Posts supports?" +msgstr "Quali sono i template tags supportati da Wordpress Popular Posts?" + +#: maintenance.php:147 +msgid "The following are the template tags supported by Wordpress Popular Posts:" +msgstr "A seguire, i template tags supportati Wordpress Popular Posts:" + +#: maintenance.php:150 +msgid "Template tag" +msgstr "Template tag" + +#: maintenance.php:151 +#: maintenance.php:179 +msgid "What it does " +msgstr "A cosa serve?" + +#: maintenance.php:152 +msgid "Parameters" +msgstr "Parametri" + +#: maintenance.php:153 +#: maintenance.php:182 +msgid "Example" +msgstr "Esempio" + +#: maintenance.php:157 +msgid "Similar to the widget functionality, this tag retrieves the most popular posts on your blog. While it can be customized via parameters, these are not needed for it to work." +msgstr "Simile alla funzionalità del widget, questo tag estrarrà gli articoli più popolari del tuo blog. Sebbene esso possa essere personalizzato grazie ai parametri, questi ultimi non ne determinano il funzionamento in sè." + +#: maintenance.php:158 +msgid "Please refer to \"What attributes does Wordpress Popular Posts shortcode [wpp] have?\"" +msgstr "Fai riferimento a \"Quali attributi ha lo shortcode [wpp] di Wordpress Popular Posts?\"" + +#: maintenance.php:163 +msgid "Displays the number of views of a single post. Post ID required, or it will return false." +msgstr "Mostra il numero delle visualizzazioni di un singolo articolo. E' necessaria la ID dell'articolo affinché questa opzione possa funzionare." + +#: maintenance.php:164 +msgid "Post ID" +msgstr "ID articolo" + +#: maintenance.php:169 +msgid "What are \"shortcodes\"?" +msgstr "Cosa sono gli \"shortcodes\"?" + +#: maintenance.php:171 +msgid "Shortcodes are hooks that allow us to call a php function by simply typing something like [shortcode]. With Wordpress Popular Posts, the shortcode [wpp] will let you insert a list of the most popular posts in posts content and pages too! For more information about shortcodes, please visit" +msgstr "Gli Shortcodes sono degli hooks che ti permettono di richiamare una funzione php inserendo nell'articolo un qualcosa del tipo [shortcode]. Con Wordpress Popular Posts, lo shortcode [wpp] farà sì che tu possa inserire gli articoli più popolari direttamente nel contenuto degli articoli/pagine! Per maggiori informazioni, visita la pagina" + +#: maintenance.php:173 +msgid "What attributes does Wordpress Popular Posts shortcode [wpp] have?" +msgstr "Quali attributi ha lo shortcode [wpp] di Wordpress Popular Posts?" + +#: maintenance.php:175 +msgid "There are a number of attributes Wordpress Popular Posts currently supports:" +msgstr "Ecco il numero degli attributi al momento supportati da Wordpress Popular Posts:" + +#: maintenance.php:178 +msgid "Attributes" +msgstr "Attributi" + +#: maintenance.php:180 +msgid "Possible values" +msgstr "Valore" + +#: maintenance.php:181 +msgid "Defaults to" +msgstr "Predefinita" + +#: maintenance.php:186 +msgid "Sets a heading for the list" +msgstr "Imposta un titolo per l'elenco" + +#: maintenance.php:187 +#: maintenance.php:194 +#: maintenance.php:201 +#: maintenance.php:257 +#: maintenance.php:320 +#: maintenance.php:327 +#: maintenance.php:334 +#: maintenance.php:341 +#: maintenance.php:348 +msgid "Text string" +msgstr "Stringa di testo" + +#: maintenance.php:188 +#: wordpress-popular-posts.php:191 +msgid "Popular Posts" +msgstr "Gli articoli più popolari" + +#: maintenance.php:193 +msgid "Set the opening tag for the heading of the list" +msgstr "Imposta un tag di apertura per il titolo dell'elenco" + +#: maintenance.php:200 +msgid "Set the closing tag for the heading of the list" +msgstr "Imposta un tag di chiusura per il titolo dell'elenco" + +#: maintenance.php:207 +msgid "Sets the maximum number of popular posts to be shown on the listing" +msgstr "Imposta il numero massimo di articoli più popolari da mostrare nell'elenco" + +#: maintenance.php:208 +#: maintenance.php:236 +#: maintenance.php:243 +#: maintenance.php:264 +#: maintenance.php:271 +msgid "Positive integer" +msgstr "Intero positivo" + +#: maintenance.php:214 +msgid "Tells Wordpress Popular Posts to retrieve the most popular entries within the time range specified by you" +msgstr "Richiedi a Wordpress Popular Posts di recuperare gli articoli più popolari in relazione all'intervallo di tempo da te specificato" + +#: maintenance.php:221 +msgid "Sets the sorting option of the popular posts" +msgstr "Imposta l'opzione per la disposizione degli articoli più popolari" + +#: maintenance.php:222 +msgid "(for average views per day)" +msgstr "(per media letture giornaliere)" + +#: maintenance.php:228 +msgid "Tells Wordpress Popular Posts whether to consider or not pages while building the popular list" +msgstr "Richiedi a Wordpress Popular Posts di considerare oppure no se inserire le pagine nell'elenco" + +#: maintenance.php:235 +msgid "If set, Wordpress Popular Posts will shorten each post title to \"n\" characters whenever possible" +msgstr "Se attiva, Wordpress Popular Posts ridurrà a \"n\" caratteri il titolo di ogni articolo (se posibile)" + +#: maintenance.php:242 +msgid "If set, Wordpress Popular Posts will build and include an excerpt of \"n\" characters long from the content of each post listed as popular" +msgstr "Se attiva, Wordpress Popular Posts preparerà ed inserirà un estratto composto da \"n\" ricavato da ogni articolo presente nell'elenco dei più popolari" + +#: maintenance.php:249 +msgid "If set, Wordpress Popular Posts will maintaing all styling tags (strong, italic, etc) and hyperlinks found in the excerpt" +msgstr "Se attiva, Wordpress Popular Posts non modificherà i tag di stile (grassetto, corsivo, etc) ed i link presenti negli estratti" + +#: maintenance.php:256 +msgid "If set, Wordpress Popular Posts will exclude all entries that belong to the specified category(ies)." +msgstr "Se attiva, Wordpress Popular Posts escluderà tutte le pubblicazioni appartenenti a quella data categoria/e." + +#: maintenance.php:258 +msgid "None" +msgstr "Nessuna" + +#: maintenance.php:263 +msgid "If set, and if your current server configuration allows it, you will be able to display thumbnails of your posts. This attribute sets the width for thumbnails" +msgstr "Se attiva e nel caso in cui la configurazione del server lo permettesse, avrai la possibilità di mostrare le miniature dei tuoi articoli. Questa voce imposta la larghezza delle miniature" + +#: maintenance.php:270 +msgid "If set, and if your current server configuration allows it, you will be able to display thumbnails of your posts. This attribute sets the height for thumbnails" +msgstr "Se attiva e nel caso in cui la configurazione del server lo permettesse, avrai la possibilità di mostrare le miniature dei tuoi articoli. Questa voce imposta l'altezza delle miniature" + +#: maintenance.php:277 +msgid "Sets the source of thumbnails to use for each post listed. If set to wppgenerated Wordpress Popular Posts will create the images for you, otherwise it will use the thumbnails selected by you. *Requires enabling The Post Thumbnail feature on your theme*" +msgstr "Imposta la fonte di riferimento per le miniature da utilizzare per ogni articolo. Impostando a wppgenerated, Wordpress Popular Posts creerà al posto tuo le immagini diversamente, saranno utilizzate le miniature da te selezionate. *E' necessario che il tuo tema supporti la funzione \"Post Thumbnail\" *" + +#: maintenance.php:284 +msgid "If set, and if the WP-PostRatings plugin is installed and enabled on your blog, Wordpress Popular Posts will show how your visitors are rating your entries" +msgstr "Se attiva e nel caso in cui il plugin WP-PostRatings fosse stato installato ed attivato nel tuo blog, Wordpress Popular Posts ti mostrerà come i visitatori hanno votato le tue pubblicazioni" + +#: maintenance.php:291 +msgid "If set, Wordpress Popular Posts will show how many comments each popular post has got until now" +msgstr "Se attiva, Wordpress Popular Posts mostrerà il numero attuale dei commenti ricevuti da ogni articolo più popolare" + +#: maintenance.php:298 +msgid "If set, Wordpress Popular Posts will show how many views each popular post has got since it was installed" +msgstr "Se attiva, Wordpress Popular Posts mostrerà quante volte é stato letto ogni singolo articolo più popolare dal momento in cui é stato attivato il plugin" + +#: maintenance.php:305 +msgid "If set, Wordpress Popular Posts will show who published each popular post on the list" +msgstr "Se attiva, Wordpress Popular Posts mostrerà l'autore di ogni singola pubblicazione presente nella lista" + +#: maintenance.php:312 +msgid "If set, Wordpress Popular Posts will when each popular post on the list was published" +msgstr "Se attiva, Wordpress Popular Posts mostrerà la data di pubblicazione di ogni articolo presente nella lista" + +#: maintenance.php:319 +msgid "Sets the date format" +msgstr "Imposta formato data" + +#: maintenance.php:326 +msgid "Sets the opening tag for the listing" +msgstr "Imposta il tag di apertura per l'elenco" + +#: maintenance.php:333 +msgid "Sets the closing tag for the listing" +msgstr "Imposta il tag di chiusura per l'elenco" + +#: maintenance.php:340 +msgid "Sets the opening tag for each item on the list" +msgstr "Imposta il tag di apertura per ogni termine nell'elenco" + +#: maintenance.php:347 +msgid "Sets the closing tag for each item on the list" +msgstr "Imposta il tag di chiusura per ogni termine nell'elenco" + +#: maintenance.php:354 +msgid "If set, this option will allow you to decide the order of the contents within each item on the list." +msgstr "Se attiva, questa opzione ti permetterà di scegliere la disposizione dei contenuti presenti in ogni singolo termine dell'elenco." + +#: maintenance.php:361 +msgid "If set, you can decide the order of each content inside a single item on the list. For example, setting it to \"{title}: {summary}\" would output something like \"Your Post Title: summary here\". This attribute requires do_pattern to be true." +msgstr "Se attiva, potrai scegliere la disposizione del contenuto presente in ogni singolo termine dell'elenco. Ad esempio, impostando a \"{title}: {summary}\" l'output dovrebbe risultare come \"Il titolo dell'articolo: il riassunto qui\". Questa opzione richiede che il do_pattern sia stato impostato a true." + +#: maintenance.php:362 +msgid "Available tags" +msgstr "Tag disponibili" + +#: maintenance.php:371 +msgid "Maintenance Settings" +msgstr "Impostazioni manutenzione" + +#: maintenance.php:372 +msgid "Wordpress Popular Posts keeps historical data of your most popular entries for up to 30 days. If for some reason you need to clear the cache table, or even both historical and cache tables, please use the buttons below to do so." +msgstr "Wordpress Popular Posts conserverà per un periodo massimo di 30 giorni uno storico dei dati relativo agli articoli più popolari. Utilizza i pulsanti qui sotto nel caso in cui dovessi svuotare la tabella della cache oppure tanto la tabella dello storico quanto quella della cache." + +#: maintenance.php:375 +msgid "Empty cache" +msgstr "Svuota la cache" + +#: maintenance.php:376 +msgid "Use this button to manually clear entries from WPP cache only" +msgstr "Usa questo pulsante per svuotare manualmente la sola cache di Wordpress Popular Posts per gli articoli" + +#: maintenance.php:382 +msgid "Clear all data" +msgstr "Svuota tutti i dati" + +#: maintenance.php:383 +msgid "Use this button to manually clear entries from all WPP data tables" +msgstr "Usa questo pulsante per svuotare manualmente i dati da tutte le tabelle di Wordpress Popular Posts" + +#: maintenance.php:391 +msgid "Do you like this plugin?" +msgstr "Ti é piaciuto questo plugin?" + +#: maintenance.php:391 +msgid "Rate Wordpress Popular Posts!" +msgstr "Vota per Wordpress Popular Posts!" + +#: maintenance.php:391 +msgid "Rate it 5" +msgstr "Vota 5 stelle" + +#: maintenance.php:391 +msgid "on the official Plugin Directory!" +msgstr "nella Plugin Directory ufficiale!" + +#: maintenance.php:392 +msgid "Do you love this plugin?" +msgstr "Questo plugin ti é stato utile?" + +#: maintenance.php:392 +#: maintenance.php:393 +msgid "Buy me a beer!" +msgstr "Offrimi una birra!" + +#: maintenance.php:392 +msgid "Each donation motivates me to keep releasing free stuff for the Wordpress community!" +msgstr "Ogni donazione sarà per me un incentivo a proseguire lo sviluppo di questo plugin gratuito!" + +#: stats.php:90 +msgid "Click on each tab to see what are the most popular entries on your blog today, this week, last 30 days or all time since Wordpress Popular Posts was installed." +msgstr "Clicca su ogni tab per vedere quali sono state le più lette pubblicazioni del tuo blog per oggi, per gli ultimi 30 giorni oppure dal primo momento in cui é stato attivato Wordpress Popular Posts." + +#: stats.php:92 +msgid "Yesterday" +msgstr "Ieri" + +#: stats.php:93 +#: wordpress-popular-posts.php:250 +msgid "Today" +msgstr "Oggi" + +#: stats.php:94 +msgid "Weekly" +msgstr "Settimanale" + +#: stats.php:95 +msgid "Monthly" +msgstr "Mensile" + +#: stats.php:96 +#: wordpress-popular-posts.php:253 +msgid "All-time" +msgstr "Complessivo" + +#: wordpress-popular-posts.php:244 +msgid "Title:" +msgstr "Titolo:" + +#: wordpress-popular-posts.php:246 +msgid "Show up to:" +msgstr "Mostra sino a:" + +#: wordpress-popular-posts.php:247 +msgid "posts" +msgstr "articoli" + +#: wordpress-popular-posts.php:248 +msgid "Time Range:" +msgstr "Intervallo di tempo:" + +#: wordpress-popular-posts.php:251 +msgid "Last 7 days" +msgstr "Ultimi 7 giorni" + +#: wordpress-popular-posts.php:252 +msgid "Last 30 days" +msgstr "Ultimi 30 giorni" + +#: wordpress-popular-posts.php:256 +msgid "Sort posts by:" +msgstr "Mostra articoli in relazione a:" + +#: wordpress-popular-posts.php:258 +msgid "Comments" +msgstr "Commenti" + +#: wordpress-popular-posts.php:259 +msgid "Total views" +msgstr "Letture complessive" + +#: wordpress-popular-posts.php:260 +msgid "Avg. daily views" +msgstr "Media letture giornaliere" + +#: wordpress-popular-posts.php:263 +msgid "Include pages" +msgstr "Includi pagine" + +#: wordpress-popular-posts.php:265 +msgid "Display post rating" +msgstr "Mostra valutazione articoli" + +#: wordpress-popular-posts.php:267 +msgid "Shorten title output" +msgstr "Output titolo abbreviato" + +#: wordpress-popular-posts.php:269 +msgid "Shorten title to" +msgstr "Abbrevia il titolo in" + +#: wordpress-popular-posts.php:269 +#: wordpress-popular-posts.php:276 +msgid "characters" +msgstr "caratteri" + +#: wordpress-popular-posts.php:271 +msgid "Display post excerpt" +msgstr "Mostra estratto articolo" + +#: wordpress-popular-posts.php:274 +msgid "Excerpt Properties" +msgstr "Proprietà estratto" + +#: wordpress-popular-posts.php:275 +msgid "Keep text format and links" +msgstr "Mantieni il formato del testo e lascia i link" + +#: wordpress-popular-posts.php:276 +msgid "Excerpt length:" +msgstr "Lunghezza estratto:" + +#: wordpress-popular-posts.php:280 +msgid "Exclude categories" +msgstr "Esclusione categorie" + +#: wordpress-popular-posts.php:283 +msgid "Categories to exclude" +msgstr "Categorie da escludere" + +#: wordpress-popular-posts.php:284 +msgid "ID(s) (comma separated, no spaces):" +msgstr "ID (separa con una virgola, nessuna spaziatura):" + +#: wordpress-popular-posts.php:290 +msgid "Thumbnail settings" +msgstr "Impostazioni miniatura" + +#: wordpress-popular-posts.php:291 +msgid "Display post thumbnail" +msgstr "Mostra miniatura articolo" + +#: wordpress-popular-posts.php:294 +msgid "Generate all thumbnails for me" +msgstr "Genera tutte le miniature" + +#: wordpress-popular-posts.php:295 +msgid "Use thumbnails selected by me" +msgstr "Uso le miniature da me indicate" + +#: wordpress-popular-posts.php:297 +msgid "Width:" +msgstr "Larghezza:" + +#: wordpress-popular-posts.php:298 +#: wordpress-popular-posts.php:300 +msgid "px" +msgstr "px" + +#: wordpress-popular-posts.php:299 +msgid "Height:" +msgstr "Altezza:" + +#: wordpress-popular-posts.php:307 +msgid "Stats Tag settings" +msgstr "Impostazioni tag statistiche" + +#: wordpress-popular-posts.php:308 +msgid "Display comment count" +msgstr "Mostra totale commenti" + +#: wordpress-popular-posts.php:309 +msgid "Display views" +msgstr "Mostra letture" + +#: wordpress-popular-posts.php:310 +msgid "Display author" +msgstr "Mostra autore" + +#: wordpress-popular-posts.php:311 +msgid "Display date" +msgstr "Mostra la data" + +#: wordpress-popular-posts.php:314 +msgid "Date Format" +msgstr "Formato data" + +#: wordpress-popular-posts.php:325 +msgid "HTML Markup settings" +msgstr "Impostazioni markup HTML" + +#: wordpress-popular-posts.php:326 +msgid "Use custom HTML Markup" +msgstr "Usa markup HTML personale" + +#: wordpress-popular-posts.php:329 +msgid "Before / after title:" +msgstr "Prima / dopo titolo:" + +#: wordpress-popular-posts.php:331 +msgid "Before / after Popular Posts:" +msgstr "Prima / dopo Popular Posts:" + +#: wordpress-popular-posts.php:333 +msgid "Before / after each post:" +msgstr "Prima / dopo ogni articolo:" + +#: wordpress-popular-posts.php:337 +msgid "Use content formatting tags" +msgstr "Utilizza tag formattazione" + +#: wordpress-popular-posts.php:340 +msgid "Content format:" +msgstr "Formato contenuti:" + +#: wordpress-popular-posts.php:407 +msgid "Success! The cache table has been cleared!" +msgstr "Ottimo! La tabella della cache é stata svuotata!" + +#: wordpress-popular-posts.php:409 +msgid "Error: cache table does not exist." +msgstr "Errore: la tabella per la cache non esiste." + +#: wordpress-popular-posts.php:415 +msgid "Success! All data have been cleared!" +msgstr "Ottimo! Sono stati svuotati tutti i dati!" + +#: wordpress-popular-posts.php:417 +msgid "Error: one or both data tables are missing." +msgstr "Errore: una od entrambe le tabelle non esistono." + +#: wordpress-popular-posts.php:420 +msgid "Invalid action." +msgstr "Azione non valida." + +#: wordpress-popular-posts.php:423 +msgid "Sorry, you do not have enough permissions to do this. Please contact the site administrator for support." +msgstr "Non hai i permessi necessari per potere compiere questa operazione. Contatta l'amministratore del sito." + +#: wordpress-popular-posts.php:612 +msgid "Sorry. No data so far." +msgstr "Nessun dato ancora." + +#: wordpress-popular-posts.php:655 +msgid " comment(s)" +msgstr " commento/i" + +#: wordpress-popular-posts.php:658 +msgid " view(s)" +msgstr " lettura/e" + +#: wordpress-popular-posts.php:663 +msgid " view(s) per day" +msgstr " lettura/e al giorno" + +#: wordpress-popular-posts.php:676 +#: wordpress-popular-posts.php:678 +msgid "by" +msgstr "di" + +#: wordpress-popular-posts.php:683 +#: wordpress-popular-posts.php:685 +msgid "posted on" +msgstr "pubblicato sotto" + +#: wordpress-popular-posts.php:973 +msgid "Your Wordpress version is too old. Wordpress Popular Posts Plugin requires at least version 2.8 to function correctly. Please update your blog via Tools > Upgrade." +msgstr "La tua versione di WordPress é datata. Affinché il plugin Wordpress Popular Posts possa funzionare correttamente, sarà necessaria una versione 2.8 o superiore. Aggiorna via Strumenti > Upgrade." + +#: wordpress-popular-posts.php:1098 +msgid "Wordpress Popular Posts Stats" +msgstr "Statistiche Wordpress Popular Posts" + diff --git a/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts.mo b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts.mo new file mode 100644 index 0000000..aff944f Binary files /dev/null and b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts.mo differ diff --git a/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts.php b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts.php new file mode 100644 index 0000000..f6deb83 --- /dev/null +++ b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts.php @@ -0,0 +1,1159 @@ +<?php wpp_get_mostpopular(); ?> +Version: 2.1.4 +Author: Héctor Cabrera +Author URI: http://wordpress.org/extend/plugins/wordpress-popular-posts +License: GPL2 +*/ + +if (basename($_SERVER['SCRIPT_NAME']) == basename(__FILE__)) exit('Please do not load this page directly'); + +/** + * Load Wordpress Popular Posts to widgets_init. + * @since 2.0 + */ +add_action('widgets_init', 'load_wpp'); + +function load_wpp() { + register_widget('WordpressPopularPosts'); +} + +/** + * Wordpress Popular Posts class. + */ + +if ( !class_exists('WordpressPopularPosts') ) { + class WordpressPopularPosts extends WP_Widget { + // plugin global variables + var $version = "2.1.4"; + var $qTrans = false; + var $postRating = false; + var $thumb = false; + var $pluginDir = ""; + var $charset = "UTF-8"; + var $magicquotes = false; + + // constructor + function WordpressPopularPosts() { + global $wp_version; + + // widget settings + $widget_ops = array( 'classname' => 'popular-posts', 'description' => 'The most Popular Posts on your blog.' ); + + // widget control settings + $control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => 'wpp' ); + + // create the widget + $this->WP_Widget( 'wpp', 'Wordpress Popular Posts', $widget_ops, $control_ops ); + + // set plugin path + if (empty($this->pluginDir)) $this->pluginDir = WP_PLUGIN_URL . '/wordpress-popular-posts'; + + // set charset + $this->charset = get_bloginfo('charset'); + + // detect PHP magic quotes + $this->magicquotes = get_magic_quotes_gpc(); + + // add ajax update to wp_ajax_ hook + add_action('wp_ajax_nopriv_wpp_update', array(&$this, 'wpp_ajax_update')); + add_action('wp_head', array(&$this, 'wpp_print_ajax')); + + // add ajax table truncation to wp_ajax_ hook + add_action('wp_ajax_wpp_clear_cache', array(&$this, 'wpp_clear_data')); + add_action('wp_ajax_wpp_clear_all', array(&$this, 'wpp_clear_data')); + + // print stylesheet + add_action('wp_head', array(&$this, 'wpp_print_stylesheet')); + + // activate textdomain for translations + add_action('init', array(&$this, 'wpp_textdomain')); + + // activate maintenance page + add_action('admin_menu', array(&$this, 'add_wpp_maintenance_page')); + + // database creation + register_activation_hook(__FILE__, $this->wpp_install()); + + // cache maintenance schedule + register_deactivation_hook(__FILE__, array(&$this, 'wpp_deactivation')); + add_action('wpp_cache_event', array(&$this, 'wpp_cache_maintenance')); + if (!wp_next_scheduled('wpp_cache_event')) { + $tomorrow = time() + 86400; + $midnight = mktime(0, 0, 0, + date("m", $tomorrow), + date("d", $tomorrow), + date("Y", $tomorrow)); + wp_schedule_event( $midnight, 'daily', 'wpp_cache_event' ); + } + + // Wordpress version check + if (version_compare($wp_version, '2.8.0', '<')) add_action('admin_notices', array(&$this, 'wpp_update_warning')); + + // qTrans plugin support + if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) $this->qTrans = true; + + // WP-Post Ratings plugin support + if (function_exists('the_ratings_results')) $this->postRating = true; + + // Can we create thumbnails? + if (extension_loaded('gd') && function_exists('gd_info') && version_compare(phpversion(), '4.3.0', '>=')) $this->thumb = true; + + // shortcode + if( function_exists('add_shortcode') ){ + add_shortcode('wpp', array(&$this, 'wpp_shortcode')); + add_shortcode('WPP', array(&$this, 'wpp_shortcode')); + } + + // set version + $wpp_ver = get_option('wpp_ver'); + if (!$wp_ver) { + add_option('wpp_ver', $this->version); + } else if (version_compare($wpp_ver, $this->version, '<')) { + update_option('wpp_ver', $this->version); + } + + // add stats page + add_action('admin_menu', array(&$this, 'wpp_stats')); + } + + // builds Wordpress Popular Posts' widgets + function widget($args, $instance) { + extract($args); + echo ""."\n"; + echo $before_widget . "\n"; + + // has user set a title? + if ($instance['title'] != '') { + if ($instance['markup']['custom_html'] && $instance['markup']['title-start'] != "" && $instance['markup']['title-end'] != "" ) { + echo htmlspecialchars_decode($instance['markup']['title-start'], ENT_QUOTES) . $instance['title'], ENT_QUOTES . htmlspecialchars_decode($instance['markup']['title-end'], ENT_QUOTES); + } else { + echo $before_title . $instance['title'] . $after_title; + } + } + + echo $this->get_popular_posts($instance, false); + echo $after_widget . "\n"; + echo ""."\n"; + } + + // updates each widget instance when user clicks the "save" button + function update($new_instance, $old_instance) { + + $instance = $old_instance; + + //$instance['title'] = htmlspecialchars( stripslashes(strip_tags( $new_instance['title'] )), ENT_QUOTES, 'UTF-8', FALSE ); + $instance['title'] = ($this->magicquotes) ? htmlspecialchars( stripslashes(strip_tags( $new_instance['title'] )), ENT_QUOTES ) : htmlspecialchars( strip_tags( $new_instance['title'] ), ENT_QUOTES ); + $instance['limit'] = is_numeric($new_instance['limit']) ? $new_instance['limit'] : 10; + $instance['range'] = $new_instance['range']; + $instance['order_by'] = $new_instance['order_by']; + $instance['pages'] = $new_instance['pages']; + $instance['shorten_title']['active'] = $new_instance['shorten_title-active']; + $instance['shorten_title']['length'] = is_numeric($new_instance['shorten_title-length']) ? $new_instance['shorten_title-length'] : 25; + $instance['post-excerpt']['active'] = $new_instance['post-excerpt-active']; + $instance['post-excerpt']['length'] = is_numeric($new_instance['post-excerpt-length']) ? $new_instance['post-excerpt-length'] : 55; + $instance['post-excerpt']['keep_format'] = $new_instance['post-excerpt-format']; + $instance['exclude-cats']['active'] = $new_instance['exclude-cats']; + $instance['exclude-cats']['cats'] = empty($new_instance['excluded']) ? '' : (ctype_digit(str_replace(",", "", $new_instance['excluded']))) ? $new_instance['excluded'] : ''; + if ($this->thumb) { // can create thumbnails + $instance['thumbnail']['active'] = $new_instance['thumbnail-active']; + $instance['thumbnail']['thumb_selection'] = empty($new_instance['thumb_selection']) ? "wppgenerated" : $new_instance['thumb_selection']; + $instance['thumbnail']['width'] = is_numeric($new_instance['thumbnail-width']) ? $new_instance['thumbnail-width'] : 15; + $instance['thumbnail']['height'] = is_numeric($new_instance['thumbnail-height']) ? $new_instance['thumbnail-height'] : 15; + } else { // cannot create thumbnails + $instance['thumbnail']['active'] = false; + $instance['thumbnail']['thumb_selection'] = "wppgenerated"; + $instance['thumbnail']['width'] = 15; + $instance['thumbnail']['height'] = 15; + } + + $instance['rating'] = $new_instance['rating']; + $instance['stats_tag']['comment_count'] = $new_instance['comment_count']; + $instance['stats_tag']['views'] = $new_instance['views']; + $instance['stats_tag']['author'] = $new_instance['author']; + $instance['stats_tag']['date']['active'] = $new_instance['date']; + $instance['stats_tag']['date']['format'] = empty($new_instance['date_format']) ? 'F j, Y' : $new_instance['date_format']; + $instance['markup']['custom_html'] = $new_instance['custom_html']; + $instance['markup']['wpp-start'] = empty($new_instance['wpp-start']) ? '<ul>' : htmlspecialchars( $new_instance['wpp-start'], ENT_QUOTES ); + $instance['markup']['wpp-end'] = empty($new_instance['wpp-end']) ? '</ul>' : htmlspecialchars( $new_instance['wpp-end'], ENT_QUOTES ); + $instance['markup']['post-start'] = empty ($new_instance['post-start']) ? '<li>' : htmlspecialchars( $new_instance['post-start'], ENT_QUOTES ); + $instance['markup']['post-end'] = empty ($new_instance['post-end']) ? '</li>' : htmlspecialchars( $new_instance['post-end'], ENT_QUOTES ); + $instance['markup']['title-start'] = empty($new_instance['title-start']) ? '' : htmlspecialchars( $new_instance['title-start'], ENT_QUOTES ); + $instance['markup']['title-end'] = empty($new_instance['title-end']) ? '' : htmlspecialchars( $new_instance['title-end'], ENT_QUOTES ); + $instance['markup']['pattern']['active'] = $new_instance['pattern_active']; + $instance['markup']['pattern']['form'] = empty($new_instance['pattern_form']) ? '{image} {title}: {summary} {stats}' : strip_tags( $new_instance['pattern_form'] ); + + return $instance; + } + + // widget's form + function form($instance) { + // set default values + $defaults = array( + 'title' => __('Popular Posts', 'wordpress-popular-posts'), + 'limit' => 10, + 'range' => 'daily', + 'order_by' => 'comments', + 'pages' => true, + 'shorten_title' => array( + 'active' => false, + 'length' => 25, + 'keep_format' => false + ), + 'post-excerpt' => array( + 'active' => false, + 'length' => 55 + ), + 'exclude-cats' => array( + 'active' => false, + 'cats' => '' + ), + 'thumbnail' => array( + 'active' => false, + 'width' => 15, + 'height' => 15 + ), + 'rating' => false, + 'stats_tag' => array( + 'comment_count' => true, + 'views' => false, + 'author' => false, + 'date' => array( + 'active' => false, + 'format' => 'F j, Y' + ) + ), + 'markup' => array( + 'custom_html' => false, + 'wpp-start' => '<ul>', + 'wpp-end' => '</ul>', + 'post-start' => '<li>', + 'post-end' => '</li>', + 'title-start' => '<h2>', + 'title-end' => '</h2>', + 'pattern' => array( + 'active' => false, + 'form' => '{image} {title}: {summary} {stats}' + ) + ) + ); + + // update instance's default options + $instance = wp_parse_args( (array) $instance, $defaults ); + + // form + ?> +

    +

    +


    +

    +

    + +

    +

    + +

    + id="get_field_id( 'pages' ); ?>" name="get_field_name( 'pages' ); ?>" /> [?]
    + postRating) : ?> + id="get_field_id( 'rating' ); ?>" name="get_field_name( 'rating' ); ?>" /> [?]
    + + id="get_field_id( 'shorten_title-active' ); ?>" name="get_field_name( 'shorten_title-active' ); ?>" /> [?]
    + +

    + + id="get_field_id( 'post-excerpt-active' ); ?>" name="get_field_name( 'post-excerpt-active' ); ?>" /> [?]
    + +
    + +    /> [?]
    +    +
    +
    + + id="get_field_id( 'exclude-cats' ); ?>" name="get_field_name( 'exclude-cats' ); ?>" /> [?]
    + +
    + +   
      

    +
    + +
    + +
    + + id="get_field_id( 'thumbnail-active' ); ?>" name="get_field_name( 'thumbnail-active' ); ?>" /> [?]
    + + + >
    + > + + + thumb) ? '' : 'disabled="disabled"' ?> />
    + + thumb) ? '' : 'disabled="disabled"' ?> />
    + + +
    + +
    +
    + + id="get_field_id( 'comment_count' ); ?>" name="get_field_name( 'comment_count' ); ?>" /> [?]
    + id="get_field_id( 'views' ); ?>" name="get_field_name( 'views' ); ?>" /> [?]
    + id="get_field_id( 'author' ); ?>" name="get_field_name( 'author' ); ?>" /> [?]
    + id="get_field_id( 'date' ); ?>" name="get_field_name( 'date' ); ?>" /> [?] + +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    + + id="get_field_id( 'custom_html' ); ?>" name="get_field_name( 'custom_html' ); ?>" /> [?]
    + +
    +


    + /> />

    +


    + /> />

    +


    + /> />

    +
    + + id="get_field_id( 'pattern_active' ); ?>" name="get_field_name( 'pattern_active' ); ?>" /> [?]
    + +
    +

    + />

    + +
    + show_errors(); + + $table = $wpdb->prefix . 'popularpostsdata'; + + // update popularpostsdata table + $exists = $wpdb->get_results("SELECT postid FROM $table WHERE postid = '$id'"); + if ($exists) { + $result = $wpdb->query("UPDATE $table SET last_viewed = NOW(), pageviews = pageviews + 1 WHERE postid = '$id'"); + } else { + $result = $wpdb->query("INSERT INTO $table (postid, day, last_viewed) VALUES ('".$id."', NOW(), NOW())"); + } + + // update popularpostsdatacache table + $isincache = $wpdb->get_results("SELECT id FROM ".$table."cache WHERE id = '".$id."' AND day = CURDATE()"); + if ($isincache) { + $result2 = $wpdb->query("UPDATE ".$table."cache SET pageviews = pageviews + 1 WHERE id = '".$id."' AND day = CURDATE()"); + } else { + $result2 = $wpdb->query("INSERT INTO ".$table."cache (id, day) VALUES ('".$id."', CURDATE())"); + } + + if (($result == 1) && ($result2 == 1)) { + die("OK"); + } else { + die($wpdb->print_error); + } + + } + + // clears Wordpress Popular Posts' data + function wpp_clear_data() { + $token = $_POST['token']; + $clear = isset($_POST['clear']) ? $_POST['clear'] : ''; + $key = get_option("wpp_rand"); + + if (current_user_can('manage_options') && ($token === $key) && !empty($clear)) { + global $wpdb; + // set table name + $table = $wpdb->prefix . "popularpostsdata"; + $cache = $wpdb->prefix . "popularpostsdatacache"; + + if ($clear == 'cache') { + if ( $wpdb->get_var("SHOW TABLES LIKE '$cache'") == $cache ) { + $wpdb->query("TRUNCATE TABLE $cache;"); + _e('Success! The cache table has been cleared!', 'wordpress-popular-posts'); + } else { + _e('Error: cache table does not exist.', 'wordpress-popular-posts'); + } + } else if ($clear == 'all') { + if ( $wpdb->get_var("SHOW TABLES LIKE '$table'") == $table && $wpdb->get_var("SHOW TABLES LIKE '$cache'") == $cache ) { + $wpdb->query("TRUNCATE TABLE $table;"); + $wpdb->query("TRUNCATE TABLE $cache;"); + _e('Success! All data have been cleared!', 'wordpress-popular-posts'); + } else { + _e('Error: one or both data tables are missing.', 'wordpress-popular-posts'); + } + } else { + _e('Invalid action.', 'wordpress-popular-posts'); + } + } else { + _e('Sorry, you do not have enough permissions to do this. Please contact the site administrator for support.', 'wordpress-popular-posts'); + } + + die(); + } + + // database install + function wpp_install() { + global $wpdb; + + // set table name + $table = $wpdb->prefix . "popularpostsdata"; + + // does popularpostsdata table exists? + if ( $wpdb->get_var("SHOW TABLES LIKE '$table'") != $table ) { // fresh setup + // create tables popularpostsdata and popularpostsdatacache + $sql = "CREATE TABLE " . $table . " ( UNIQUE KEY id (postid), postid int(10) NOT NULL, day datetime NOT NULL default '0000-00-00 00:00:00', last_viewed datetime NOT NULL default '0000-00-00 00:00:00', pageviews int(10) default 1 ); CREATE TABLE " . $table ."cache ( UNIQUE KEY id (id, day), id int(10) NOT NULL, day date NOT NULL, pageviews int(10) default 1 );"; + + require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); + dbDelta($sql); + } else { + $cache = $table . "cache"; + if ( $wpdb->get_var("SHOW TABLES LIKE '$cache'") != $cache ) { + // someone is upgrading from version 1.5.x + $sql = "CREATE TABLE " . $table ."cache ( UNIQUE KEY id (id, day), id int(10) NOT NULL, day date NOT NULL, pageviews int(10) default 1 );"; + + require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); + dbDelta($sql); + } + } + } + + // prints ajax script to theme's header + function wpp_print_ajax() { + // let's add jQuery + wp_print_scripts('jquery'); + + // create security token + $nonce = wp_create_nonce('wpp-token'); + + // get current post's ID + global $wp_query; + wp_reset_query(); + + // if we're on a page or post, load the script + if ( (is_single() || is_page()) && !is_user_logged_in() ) { + $id = $wp_query->post->ID; + ?> + + + + prefix . "popularpostsdata"; + + if ( $instance['pages'] ) { + $nopages = ''; + } else { + $nopages = "AND $wpdb->posts.post_type = 'post'"; + } + + switch( $instance['range'] ) { + case 'all': + $range = "post_date_gmt < '".gmdate("Y-m-d H:i:s")."'"; + break; + case 'yesterday': + $range = $table."cache.day >= '".gmdate("Y-m-d")."' - INTERVAL 1 DAY"; + break; + case 'daily': + $range = $table."cache.day = CURDATE()"; + break; + case 'weekly': + $range = $table."cache.day >= '".gmdate("Y-m-d")."' - INTERVAL 7 DAY"; + break; + case 'monthly': + $range = $table."cache.day >= '".gmdate("Y-m-d")."' - INTERVAL 30 DAY"; + break; + default: + $range = "post_date_gmt < '".gmdate("Y-m-d H:i:s")."'"; + break; + } + + // sorting options + switch( $instance['order_by'] ) { + case 'comments': + $sortby = 'comment_count'; + break; + case 'views': + $sortby = 'pageviews'; + break; + case 'avg': + $sortby = 'avg_views'; + break; + default: + $sortby = 'comment_count'; + break; + } + + + // dynamic query fields + $fields = ', '; + if ( $instance['stats_tag']['views'] || ($sortby != 'comment_count') ) { + if ( $instance['range'] == 'all') { + $fields .= "$table.pageviews AS 'pageviews' "; + } else { + if ( $sortby == 'avg_views' ) { + $fields .= "(SUM(".$table."cache.pageviews)/(IF ( DATEDIFF(CURDATE(), MIN(".$table."cache.day)) > 0, DATEDIFF(CURDATE(), MIN(".$table."cache.day)), 1) )) AS 'avg_views' "; + } else { + $fields .= "(SUM(".$table."cache.pageviews)) AS 'pageviews' "; + } + } + } + + if ( $instance['stats_tag']['comment_count'] ) { + if ( $fields != ', ' ) { + $fields .= ", $wpdb->posts.comment_count AS 'comment_count' "; + } else { + $fields .= "$wpdb->posts.comment_count AS 'comment_count' "; + } + } + + if ( $instance['stats_tag']['author'] ) { + if ( $fields != ', ' ) { + $fields .= ", (SELECT $wpdb->users.display_name FROM $wpdb->users WHERE $wpdb->users.ID = $wpdb->posts.post_author ) AS 'display_name'"; + } else { + $fields .= "(SELECT $wpdb->users.display_name FROM $wpdb->users WHERE $wpdb->users.ID = $wpdb->posts.post_author ) AS 'display_name'"; + } + } + if ( $instance['stats_tag']['date']['active'] ) { + if ( $fields != ', ' ) { + $fields .= ", $wpdb->posts.post_date_gmt AS 'date_gmt'"; + } else { + $fields .= "$wpdb->posts.post_date_gmt AS 'date_gmt'"; + } + } + + if (strlen($fields) == 2) $fields = ''; + + if ( $instance['range'] == 'all') { + $join = "LEFT JOIN $table ON $wpdb->posts.ID = $table.postid"; + $force_pv = "AND ".$table.".pageviews > 0 "; + } else { + $join = "RIGHT JOIN ".$table."cache ON $wpdb->posts.ID = ".$table."cache.id"; + $force_pv = ""; + } + + // Category excluding snippet suggested by user raamdev at http://wordpress.org/support/topic/397885 + // Thanks, raamdev! + if ( $instance['exclude-cats']['active'] && !empty($instance['exclude-cats']['cats']) ) { + $exclude = " AND $wpdb->posts.ID NOT IN ( + + SELECT object_id + FROM $wpdb->term_relationships AS r + JOIN $wpdb->term_taxonomy AS x ON x.term_taxonomy_id = r.term_taxonomy_id + JOIN $wpdb->terms AS t ON t.term_id = x.term_id + WHERE x.taxonomy = 'category' + AND object_id IN + ( + SELECT object_id + FROM $wpdb->term_relationships AS r + JOIN $wpdb->term_taxonomy AS x ON x.term_taxonomy_id = r.term_taxonomy_id + JOIN $wpdb->terms AS t ON t.term_id = x.term_id + WHERE x.taxonomy = 'category' + AND t.term_id IN (".$instance['exclude-cats']['cats']."))) "; + } else { + $exclude = ""; + } + + $mostpopular = $wpdb->get_results("SELECT $wpdb->posts.ID, $wpdb->posts.post_title $fields FROM $wpdb->posts $join WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_password = '' AND $range $force_pv $nopages $exclude GROUP BY $wpdb->posts.ID ORDER BY $sortby DESC LIMIT " . $instance['limit'] . ""); + + $content = ''; + + if ( !is_array($mostpopular) || empty($mostpopular) ) { + $content .= "

    ".__('Sorry. No data so far.', 'wordpress-popular-posts')."

    "."\n"; + } else { + + if ($instance['markup']['custom_html']) { + $content .= htmlspecialchars_decode($instance['markup']['wpp-start'], ENT_QUOTES) ."\n"; + } else { + $content .= "
      " . "\n"; + } + + foreach ($mostpopular as $wppost) { + + $post_stats = ""; + $stats = ""; + $thumb = ""; + $data = array(); + + // get post title + /* qTranslate integration check */ + ($this->qTrans) ? $tit = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($wppost->post_title) : $tit = $wppost->post_title; + + $tit = ($this->magicquotes) ? stripslashes($tit) : $tit; + $title_attr = htmlentities($tit, ENT_QUOTES, $this->charset); + + if ( $instance['shorten_title']['active'] && (strlen($tit) > $instance['shorten_title']['length'])) { + $tit = mb_substr($tit, 0, $instance['shorten_title']['length'], $this->charset) . "..."; + } + + $tit = htmlentities($tit, ENT_QUOTES, $this->charset); + + // get post excerpt + if ( $instance['post-excerpt']['active'] ) { + if ($instance['markup']['pattern']['active']) { + $post_content = "" . $this->get_summary($wppost->ID, $instance) . ""; + } else { + $post_content = ": " . $this->get_summary($wppost->ID, $instance) . "..."; + } + } else { + $post_content = ""; + } + + // build stats tag + if ( $instance['stats_tag']['comment_count'] ) { + $comment_count = (int) $wppost->comment_count; + $post_stats .= "" . $comment_count . " " . __(' comment(s)', 'wordpress-popular-posts') . ""; + } + if ( $instance['stats_tag']['views'] ) { + $views_text = __(' view(s)', 'wordpress-popular-posts'); + if ($instance['order_by'] == 'views') { + $pageviews = (int) $wppost->pageviews; + } else if ($instance['order_by'] == 'avg') { + $pageviews = ceil($wppost->avg_views); + if ($instance['range'] != 'daily') $views_text = __(' view(s) per day', 'wordpress-popular-posts'); + } else { + $pageviews = (int) $wppost->pageviews; + } + + if ($post_stats != "") { + $post_stats .= " | $pageviews $views_text"; + } else { + $post_stats .= "$pageviews $views_text"; + } + } + if ( $instance['stats_tag']['author'] ) { + if ($post_stats != "") { + $post_stats .= " | ".__('by', 'wordpress-popular-posts')." ".$wppost->display_name.""; + } else { + $post_stats .= __('by', 'wordpress-popular-posts')." ".$wppost->display_name.""; + } + } + if ( $instance['stats_tag']['date']['active'] ) { + if ($post_stats != "") { + $post_stats .= " | ".__('posted on', 'wordpress-popular-posts')." ".date($instance['stats_tag']['date']['format'], strtotime($wppost->date_gmt)).""; + } else { + $post_stats .= "".__('posted on', 'wordpress-popular-posts')." ".date($instance['stats_tag']['date']['format'], strtotime($wppost->date_gmt)).""; + } + } + + if (!empty($post_stats)) { + $stats = ' ' . $post_stats . ' '; + } + + // get thumbnail + if ($instance['thumbnail']['active'] && $this->thumb ) { + $tbWidth = $instance['thumbnail']['width']; + $tbHeight = $instance['thumbnail']['height']; + + // default image + $thumb = "ID)."\" class=\"wppnothumb\" title=\"". $title_attr ."\">pluginDir . "/no_thumb.jpg\" alt=\"".$title_attr."\" border=\"0\" class=\"wpp-thumbnail\" width=\"".$tbWidth."\" height=\"".$tbHeight."\" "."/>"; + + // let's try to retrieve the post thumbnail! + if ($instance['thumbnail']['thumb_selection'] == "usergenerated") { // use thumbnail selected by user + if (function_exists('get_the_post_thumbnail') && has_post_thumbnail( $wppost->ID )) { + $thumb = "ID)."\" title=\"". $title_attr ."\">" . get_the_post_thumbnail($wppost->ID, array($tbWidth), array('class' => 'wpp-thumbnail', 'alt' => $title_attr, 'title' => $title_attr) ) ." "; + } + } else if ($instance['thumbnail']['thumb_selection'] == "wppgenerated") { // Wordpress Popular Posts should attempt to create a thumbnail by itself + $img = $this->get_img($wppost->ID); + if ( ($img && !empty($img)) ) { + $thumb = "ID)."\" class=\"wppgen\" title=\"". $title_attr ."\">pluginDir . "/scripts/timthumb.php?src=". $img[1] ."&h=".$tbHeight."&w=".$tbWidth."&zc=1\" alt=\"".$title_attr."\" border=\"0\" class=\"wpp-thumbnail\" width=\"".$tbWidth."\" height=\"".$tbHeight."\" "."/>"; + } + } + } + + // get rating + if ($instance['rating'] && $this->postRating) { + $rating = ''.the_ratings_results($wppost->ID).''; + } else { + $rating = ''; + } + $data = array( + 'title' => ''. $tit .'', + 'summary' => $post_content, + 'stats' => $stats, + 'img' => $thumb, + 'id' => $wppost->ID + ); + + // build custom layout + if ($instance['markup']['custom_html']) { + if ($instance['markup']['pattern']['active']) { + $content .= htmlspecialchars_decode($instance['markup']['post-start'], ENT_QUOTES) . $this->format_content($instance['markup']['pattern']['form'], $data, $instance['rating']) . htmlspecialchars_decode($instance['markup']['post-end'], ENT_QUOTES) . "\n"; + } else { + $content .= htmlspecialchars_decode($instance['markup']['post-start'], ENT_QUOTES) . $thumb . ''. $tit .''.$post_content.' '. $stats . $rating . htmlspecialchars_decode($instance['markup']['post-end'], ENT_QUOTES) . "\n"; + } + } else { + $content .= '
    • '. $thumb .''. $tit .''. $post_content .' '. $stats . $rating .'
    • ' . "\n"; + } + } + + if ($instance['markup']['custom_html']) { + $content .= htmlspecialchars_decode($instance['markup']['wpp-end'], ENT_QUOTES) ."\n"; + } else { + $content .= "\n"."
    "."\n"; + } + + } + + if ($echo) { echo ""; } else { return $content; } + } + + // builds posts' excerpt + function get_summary($id, $instance){ + if (!is_numeric($id)) return false; + global $wpdb; + $excerpt = ""; + $result = ""; + + $result = $wpdb->get_results("SELECT post_excerpt FROM $wpdb->posts WHERE ID = " . $id, ARRAY_A); + + if (empty($result[0]['post_excerpt'])) { + // no custom excerpt defined, how lazy of you! + $result = $wpdb->get_results("SELECT post_content FROM $wpdb->posts WHERE ID = " . $id, ARRAY_A); + $excerpt = preg_replace("/\[caption.*\[\/caption\]/", "", $result[0]['post_content']); + } else { + // user has defined a custom excerpt, yay! + $excerpt = preg_replace("/\[caption.*\[\/caption\]/", "", $result[0]['post_excerpt']); + } + + $excerpt = preg_replace("/'); + } else { + $excerpt = strip_tags($excerpt); + } + + if (strlen($excerpt) > $instance['post-excerpt']['length']) { + $excerpt = $this->truncate($excerpt, $instance['post-excerpt']['length'], '', true, true); + } + + return $excerpt; + } + + // gets the first image of post / page + function get_img($id = "", $print = false) { + if ( empty($id) || !is_numeric($id) ) return false; + + // get post attachments + $attachments = get_children(array('post_parent' => $id, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order')); + + // no image has been found + if ( ! is_array($attachments) ) return false; + + $count = count($attachments); + $first_attachment = array_shift($attachments); + $img = wp_get_attachment_image($first_attachment->ID); + + preg_match('/<\s*img [^\>]*src\s*=\s*[\""\']?([^\""\'\s>]*)/i', $img, $imgm); + + if ($print) + echo $imgm[1]; + else + return $imgm; + + } + + // parses content structure defined by user + function format_content ($string, $data = array(), $rating) { + if (empty($string) || (empty($data) || !is_array($data))) return false; + + $params = array(); + $pattern = '/\{(summary|stats|title|image|rating)\}/i'; + preg_match_all($pattern, $string, $matches); + + for ($i=0; $i < count($matches[0]); $i++) { + if (strtolower($matches[0][$i]) == "{title}") { + $params[$matches[0][$i]] = $data['title']; + continue; + } + if (strtolower($matches[0][$i]) == "{stats}") { + $params[$matches[0][$i]] = $data['stats']; + continue; + } + if (strtolower($matches[0][$i]) == "{summary}") { + $params[$matches[0][$i]] = $data['summary']; + continue; + } + if (strtolower($matches[0][$i]) == "{image}") { + $params[$matches[0][$i]] = $data['img']; + continue; + } + // WP-PostRatings check + if ($rating) { + if (strtolower($matches[0][$i]) == "{rating}") { + $params[$matches[0][$i]] = the_ratings_results($data['id']); + continue; + } + } + } + + for ($i=0; $i < count($params); $i++) { + $string = str_replace($matches[0][$i], $params[$matches[0][$i]], $string); + } + + return $string; + } + + // code seen at http://www.gsdesign.ro/blog/cut-html-string-without-breaking-the-tags/ + // Since 2.0.1 + /** + * Truncates text. + * + * Cuts a string to the length of $length and replaces the last characters + * with the ending if the text is longer than length. + * + * @param string $text String to truncate. + * @param integer $length Length of returned string, including ellipsis. + * @param string $ending Ending to be appended to the trimmed string. + * @param boolean $exact If false, $text will not be cut mid-word + * @param boolean $considerHtml If true, HTML tags would be handled correctly + * @return string Trimmed string. + */ + function truncate($text, $length = 100, $ending = '...', $exact = true, $considerHtml = false) { + if ($considerHtml) { + // if the plain text is shorter than the maximum length, return the whole text + if (strlen(preg_replace('/<.*?>/', '', $text)) <= $length) { + return $text; + } + // splits all html-tags to scanable lines + preg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER); + $total_length = strlen($ending); + $open_tags = array(); + $truncate = ''; + foreach ($lines as $line_matchings) { + // if there is any html-tag in this line, handle it and add it (uncounted) to the output + if (!empty($line_matchings[1])) { + // if it's an "empty element" with or without xhtml-conform closing slash (f.e.
    ) + if (preg_match('/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $line_matchings[1])) { + // do nothing + // if tag is a closing tag (f.e.
    ) + } else if (preg_match('/^<\s*\/([^\s]+?)\s*>$/s', $line_matchings[1], $tag_matchings)) { + // delete tag from $open_tags list + $pos = array_search($tag_matchings[1], $open_tags); + if ($pos !== false) { + unset($open_tags[$pos]); + } + // if tag is an opening tag (f.e. ) + } else if (preg_match('/^<\s*([^\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) { + // add tag to the beginning of $open_tags list + array_unshift($open_tags, strtolower($tag_matchings[1])); + } + // add html-tag to $truncate'd text + $truncate .= $line_matchings[1]; + } + // calculate the length of the plain text part of the line; handle entities as one character + $content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $line_matchings[2])); + if ($total_length+$content_length> $length) { + // the number of characters which are left + $left = $length - $total_length; + $entities_length = 0; + // search for html entities + if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) { + // calculate the real length of all entities in the legal range + foreach ($entities[0] as $entity) { + if ($entity[1]+1-$entities_length <= $left) { + $left--; + $entities_length += strlen($entity[0]); + } else { + // no more characters left + break; + } + } + } + $truncate .= substr($line_matchings[2], 0, $left+$entities_length); + // maximum lenght is reached, so get off the loop + break; + } else { + $truncate .= $line_matchings[2]; + $total_length += $content_length; + } + // if the maximum length is reached, get off the loop + if($total_length>= $length) { + break; + } + } + } else { + if (strlen($text) <= $length) { + return $text; + } else { + $truncate = substr($text, 0, $length - strlen($ending)); + } + } + // if the words shouldn't be cut in the middle... + if (!$exact) { + // ...search the last occurance of a space... + $spacepos = strrpos($truncate, ' '); + if (isset($spacepos)) { + // ...and cut the text in this position + $truncate = substr($truncate, 0, $spacepos); + } + } + // add the defined ending to the text + $truncate .= $ending; + if($considerHtml) { + // close all unclosed html-tags + foreach ($open_tags as $tag) { + $truncate .= ''; + } + } + return $truncate; + } + + // plugin localization (Credits: Aleksey Timkov at@uadeveloper.com) + function wpp_textdomain() { + load_plugin_textdomain('wordpress-popular-posts', 'wp-content/plugins/wordpress-popular-posts'); + } + + // insert Wordpress Popular Posts' stylesheet in theme's head section, just in case someone needs it + function wpp_print_stylesheet() { + echo "\n".""."\n".''."\n".""."\n"; + } + + // create Wordpress Popular Posts' maintenance page + function wpp_maintenance_page() { + require (dirname(__FILE__) . '/maintenance.php'); + } + function add_wpp_maintenance_page() { + add_submenu_page('options-general.php', 'Wordpress Popular Posts', 'Wordpress Popular Posts', 10, __FILE__, array(&$this, 'wpp_maintenance_page')); + } + + // version update warning + function wpp_update_warning() { + $msg = '

    '.__('Your Wordpress version is too old. Wordpress Popular Posts Plugin requires at least version 2.8 to function correctly. Please update your blog via Tools > Upgrade.', 'wordpress-popular-posts').'

    '; + echo trim($msg); + } + + // cache maintenance + function wpp_cache_maintenance() { + global $wpdb; + $wpdb->query("DELETE FROM ".$wpdb->prefix."popularpostsdatacache WHERE day < DATE_SUB(CURDATE(), INTERVAL 30 DAY);"); + } + + // plugin deactivation + function wpp_deactivation() { + wp_clear_scheduled_hook('wpp_cache_event'); + remove_shortcode('wpp'); + remove_shortcode('WPP'); + + delete_option('wpp_ver'); + } + + // shortcode handler + function wpp_shortcode($atts = NULL, $content = NULL) { + extract( shortcode_atts( array( + 'header' => '', + 'limit' => 10, + 'range' => 'daily', + 'order_by' => 'comments', + 'pages' => true, + 'title_length' => 0, + 'excerpt_length' => 0, + 'excerpt_format' => 0, + 'cats_to_exclude' => '', + 'thumbnail_width' => 0, + 'thumbnail_height' => 0, + 'thumbnail_selection' => 'wppgenerated', + 'rating' => false, + 'stats_comments' => true, + 'stats_views' => false, + 'stats_author' => false, + 'stats_date' => false, + 'stats_date_format' => 'F j, Y', + 'wpp_start' => '
      ', + 'wpp_end' => '
    ', + 'post_start' => '
  • ', + 'post_end' => '
  • ', + 'header_start' => '

    ', + 'header_end' => '

    ', + 'do_pattern' => false, + 'pattern_form' => '{image} {title}: {summary} {stats}' + ), $atts ) ); + + // possible values for "Time Range" and "Order by" + $range_values = array("yesterday", "daily", "weekly", "monthly", "all"); + $order_by_values = array("comments", "views", "avg"); + $thumbnail_selector = array("wppgenerated", "usergenerated"); + + $shortcode_ops = array( + 'title' => strip_tags($header), + 'limit' => empty($limit) ? 10 : (is_numeric($limit)) ? (($limit > 0) ? $limit : 10) : 10, + 'range' => (in_array($range, $range_values)) ? $range : 'daily', + 'order_by' => (in_array($order_by, $order_by_values)) ? $order_by : 'comments', + 'pages' => empty($pages) ? false : $pages, + 'shorten_title' => array( + 'active' => empty($title_length) ? false : (is_numeric($title_length)) ? (($title_length > 0) ? true : false) : false, + 'length' => empty($title_length) ? 0 : (is_numeric($title_length)) ? $title_length : 0 + ), + 'post-excerpt' => array( + 'active' => empty($excerpt_length) ? false : (is_numeric($excerpt_length)) ? (($excerpt_length > 0) ? true : false) : false, + 'length' => empty($excerpt_length) ? 0 : (is_numeric($excerpt_length)) ? $excerpt_length : 0, + 'keep_format' => empty($excerpt_format) ? false : (is_numeric($excerpt_format)) ? (($excerpt_format > 0) ? true : false) : false, + ), + 'exclude-cats' => array( + 'active' => empty($cats_to_exclude) ? false : (ctype_digit(str_replace(",", "", $cats_to_exclude))) ? true : false, + 'cats' => empty($cats_to_exclude) ? '' : (ctype_digit(str_replace(",", "", $cats_to_exclude))) ? $cats_to_exclude : '' + ), + 'thumbnail' => array( + 'active' => empty($thumbnail_width) ? false : (is_numeric($thumbnail_width)) ? (($thumbnail_width > 0) ? true : false) : false, + 'thumb_selection' => (in_array($thumbnail_selection, $thumbnail_selector)) ? $thumbnail_selection : 'wppgenerated', + 'width' => empty($thumbnail_width) ? 0 : (is_numeric($thumbnail_width)) ? $thumbnail_width : 0, + 'height' => empty($thumbnail_height) ? 0 : (is_numeric($thumbnail_height)) ? $thumbnail_height : 0 + ), + 'rating' => empty($rating) ? false : (bool)$rating, + 'stats_tag' => array( + 'comment_count' => empty($stats_comments) ? false : $stats_comments, + 'views' => empty($stats_views) ? false : $stats_views, + 'author' => empty($stats_author) ? false : $stats_author, + 'date' => array( + 'active' => empty($stats_date) ? false : $stats_date, + 'format' => empty($stats_date_format) ? 'F j, Y' : $stats_date_format + ) + ), + 'markup' => array( + 'custom_html' => true, + 'wpp-start' => empty($wpp_start) ? '
      ' : $wpp_start, + 'wpp-end' => empty($wpp_end) ? '
    ' : $wpp_end, + 'post-start' => empty($post_start) ? '
  • ;' : $post_start, + 'post-end' => empty($post_end) ? '
  • ' : $post_end, + 'title-start' => empty($header_start) ? '' : $header_start, + 'title-end' => empty($header_end) ? '' : $header_end, + 'pattern' => array( + 'active' => empty($do_pattern) ? false : (bool)$do_pattern, + 'form' => empty($pattern_form) ? '{image} {title}: {summary} {stats}' : $pattern_form + ) + ) + ); + + $shortcode_content = ""; + + $shortcode_content .= ""."\n"; + + // is there a title defined by user? + if (!empty($header) && !empty($header_start) && !empty($header_end)) { + $shortcode_content .= $header_start . $header . $header_end; + } + + // print popular posts list + $shortcode_content .= $this->get_popular_posts($shortcode_ops, false); + + $shortcode_content .= ""."\n"; + + return $shortcode_content; + } + + // stats page + // Since 2.0.3 + function wpp_stats() { + if ( function_exists('add_submenu_page') ) add_submenu_page('index.php', __('Wordpress Popular Posts Stats'), __('Wordpress Popular Posts Stats'), 'manage_options', 'wpp-stats-display', array(&$this, 'wpp_stats_display')); + } + + function wpp_stats_display() { + require (dirname(__FILE__) . '/stats.php'); + } + } +} + +/** + * Wordpress Popular Posts template tags for use in themes. + */ + +// gets views count +// Since 2.0.0 +function wpp_get_views($id = NULL) { + // have we got an id? + if ( empty($id) || is_null($id) || !is_numeric($id) ) { + return "-1"; + } else { + global $wpdb; + + $table_name = $wpdb->prefix . "popularpostsdata"; + $result = $wpdb->get_results("SELECT pageviews FROM $table_name WHERE postid = '$id'", ARRAY_A); + + if ( !is_array($result) || empty($result) ) { + return "0"; + } else { + return $result[0]['pageviews']; + } + } +} + +// gets popular posts +// Since 2.0.3 +function wpp_get_mostpopular($args = NULL) { + + if (is_null($args)) { + echo do_shortcode('[wpp]'); + } else { + $atts = trim(str_replace("&", " ", $args)); + echo do_shortcode('[wpp '.$atts.']'); + } +} + +// gets popular posts +/** + * Deprecated in 2.0.3. + * Use wpp_get_mostpopular instead. + */ +function get_mostpopular($args = NULL) { + return wpp_get_mostpopular($args); +} + + +/** + * Wordpress Popular Posts 2.1.4 Changelog. + */ + +/* + = 2.1.4 = + * Added charset detection. +*/ \ No newline at end of file diff --git a/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts.po b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts.po new file mode 100644 index 0000000..677c450 --- /dev/null +++ b/wp-content/plugins/wordpress-popular-posts/wordpress-popular-posts.po @@ -0,0 +1,689 @@ +msgid "" +msgstr "" +"Project-Id-Version: Wordpress Popular Posts\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-07-01 10:18-0430\n" +"PO-Revision-Date: \n" +"Last-Translator: Hector Cabrera \n" +"Language-Team: Héctor Cabrera \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: English\n" +"X-Poedit-Country: VENEZUELA\n" +"X-Poedit-SourceCharset: iso-8859-1\n" +"X-Poedit-KeywordsList: __;_e\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: .\n" + +#: maintenance.php:58 +msgid "This operation will delete all entries from Wordpress Popular Posts' cache table and cannot be undone." +msgstr "" + +#: maintenance.php:58 +#: maintenance.php:66 +msgid "Do you want to continue?" +msgstr "" + +#: maintenance.php:66 +msgid "This operation will delete all stored info from Wordpress Popular Posts' data tables and cannot be undone." +msgstr "" + +#: maintenance.php:78 +msgid "Whoa! What just happened in here?!" +msgstr "" + +#: maintenance.php:79 +msgid "Previous users of Wordpress Popular Posts will remember that earlier versions of my plugin used to display a Settings page over here. However, from version 2.0 and on things will be slightly different." +msgstr "" + +#: maintenance.php:80 +msgid "Wordpress Popular Posts has gone multi-widget so now you'll be able to install multiple instances of my plugin on your sidebars, each with its own unique settings! Because of that, having a General Settings page to handle all instances is simply not a good idea. Fear not, my friend, since you still can set each instance's configuration via" +msgstr "" + +#: maintenance.php:80 +msgid "Widgets page" +msgstr "" + +#: maintenance.php:84 +msgid "Help" +msgstr "" + +#: maintenance.php:85 +msgid "What does \"Include pages\" do?" +msgstr "" + +#: maintenance.php:87 +msgid "If checked, Wordpress Popular Posts will also list the most viewed pages on your blog. Enabled by default." +msgstr "" + +#: maintenance.php:89 +msgid "What does \"Display post rating\" do?" +msgstr "" + +#: maintenance.php:91 +msgid "If checked, Wordpress Popular Posts will show how your readers are rating your most popular posts. This feature requires having WP-PostRatings plugin installed and enabled on your blog for it to work. Disabled by default." +msgstr "" + +#: maintenance.php:93 +msgid "What does \"Shorten title output\" do?" +msgstr "" + +#: maintenance.php:95 +msgid "If checked, all posts titles will be shortened to \"n\" characters. A new \"Shorten title to\" option will appear so you can set it to whatever you like. Disabled by default." +msgstr "" + +#: maintenance.php:97 +msgid "What does \"Display post excerpt\" do?" +msgstr "" + +#: maintenance.php:99 +msgid "If checked, Wordpress Popular Posts will also include a small extract of your posts in the list. Similarly to the previous option, you will be able to decide how long the post excerpt should be. Disabled by default." +msgstr "" + +#: maintenance.php:101 +msgid "What does \"Keep text format and links\" do?" +msgstr "" + +#: maintenance.php:103 +msgid "If checked, and if the Post Excerpt feature is enabled, Wordpress Popular Posts will keep the styling tags (eg. bold, italic, etc) that were found in the excerpt. Hyperlinks will remain intact, too." +msgstr "" + +#: maintenance.php:105 +msgid "What does \"Exclude Categories\" do?" +msgstr "" + +#: maintenance.php:107 +msgid "If checked, Wordpress Popular Posts will exclude from the listing all those entries that belong to specific categories. When entering more than one Category ID, you need to use commas to separate them (eg. 1,5,12 - no spaces!). Disabled by default." +msgstr "" + +#: maintenance.php:109 +msgid "What does \"Display post thumbnail\" do?" +msgstr "" + +#: maintenance.php:111 +msgid "If checked, Wordpress Popular Posts will attempt to find the very first image of each post in the listing and turn it into a thumbnail. Note that for this option to work you must check that: your current web host is running PHP 4.3+ or higher and the GD Library is installed and enabled; also that your \"wordpress-popular-posts/scripts/cache\" directory exists and is writable. Disabled by default." +msgstr "" + +#: maintenance.php:113 +msgid "What does \"Generate all thumbnails for me\" and \"Use thumbnails selected by me\" do?" +msgstr "" + +#: maintenance.php:115 +msgid "The first option tells Wordpress Popular Posts to generate automatically all thumbnails from the first image attached to each post. If you select the latter, Wordpress Popular Posts will use the thumbnail you have selected for each post on the Post Edit Screen in the Post Thumbnail metabox (this also requires including add_theme_support(\"post-thumbnails\") to your theme's functions.php file)." +msgstr "" + +#: maintenance.php:117 +msgid "What does \"Display comment count\" do?" +msgstr "" + +#: maintenance.php:119 +msgid "If checked, Wordpress Popular Posts will display how many comments each popular post has got until now. Enabled by default." +msgstr "" + +#: maintenance.php:121 +msgid "What does \"Display views\" do?" +msgstr "" + +#: maintenance.php:123 +msgid "If checked, Wordpress Popular Posts will show how many pageviews a single post has gotten so far since this plugin was installed. Disabled by default." +msgstr "" + +#: maintenance.php:125 +msgid "What does \"Display author\" do?" +msgstr "" + +#: maintenance.php:127 +msgid "If checked, Wordpress Popular Posts will display the name of the author of each entry listed. Disabled by default." +msgstr "" + +#: maintenance.php:129 +msgid "What does \"Display date\" do?" +msgstr "" + +#: maintenance.php:131 +msgid "If checked, Wordpress Popular Posts will display the date when each popular posts was published. Disabled by default." +msgstr "" + +#: maintenance.php:133 +msgid "What does \"Use custom HTML Markup\" do?" +msgstr "" + +#: maintenance.php:135 +msgid "If checked, you will be able to customize the HTML markup of your popular posts listing. For example, you can decide whether to wrap your posts in an unordered list, an ordered list, a div, etc. If you know xHTML/CSS, this is for you! Disabled by default." +msgstr "" + +#: maintenance.php:137 +msgid "What does \"Use content formatting tags\" do?" +msgstr "" + +#: maintenance.php:139 +msgid "If checked, you can decide the order of the items displayed on each entry. For example, setting it to \"{title}: {summary}\" (without the quotes) would display \"Post title: excerpt of the post here\". Available tags: {image}, {title}, {summary}, {stats} and {rating}. Disabled by default." +msgstr "" + +#: maintenance.php:141 +msgid "What are \"Template Tags\"?" +msgstr "" + +#: maintenance.php:143 +msgid "Template Tags are simply php functions that allow you to perform certain actions. For example, Wordpress Popular Posts currently supports two different template tags: get_mostpopular() and wpp_get_views()." +msgstr "" + +#: maintenance.php:145 +msgid "What are the template tags that Wordpress Popular Posts supports?" +msgstr "" + +#: maintenance.php:147 +msgid "The following are the template tags supported by Wordpress Popular Posts:" +msgstr "" + +#: maintenance.php:150 +msgid "Template tag" +msgstr "" + +#: maintenance.php:151 +#: maintenance.php:179 +msgid "What it does " +msgstr "" + +#: maintenance.php:152 +msgid "Parameters" +msgstr "" + +#: maintenance.php:153 +#: maintenance.php:182 +msgid "Example" +msgstr "" + +#: maintenance.php:157 +msgid "Similar to the widget functionality, this tag retrieves the most popular posts on your blog. While it can be customized via parameters, these are not needed for it to work." +msgstr "" + +#: maintenance.php:158 +msgid "Please refer to \"What attributes does Wordpress Popular Posts shortcode [wpp] have?\"" +msgstr "" + +#: maintenance.php:163 +msgid "Displays the number of views of a single post. Post ID required, or it will return false." +msgstr "" + +#: maintenance.php:164 +msgid "Post ID" +msgstr "" + +#: maintenance.php:169 +msgid "What are \"shortcodes\"?" +msgstr "" + +#: maintenance.php:171 +msgid "Shortcodes are hooks that allow us to call a php function by simply typing something like [shortcode]. With Wordpress Popular Posts, the shortcode [wpp] will let you insert a list of the most popular posts in posts content and pages too! For more information about shortcodes, please visit" +msgstr "" + +#: maintenance.php:173 +msgid "What attributes does Wordpress Popular Posts shortcode [wpp] have?" +msgstr "" + +#: maintenance.php:175 +msgid "There are a number of attributes Wordpress Popular Posts currently supports:" +msgstr "" + +#: maintenance.php:178 +msgid "Attributes" +msgstr "" + +#: maintenance.php:180 +msgid "Possible values" +msgstr "" + +#: maintenance.php:181 +msgid "Defaults to" +msgstr "" + +#: maintenance.php:186 +msgid "Sets a heading for the list" +msgstr "" + +#: maintenance.php:187 +#: maintenance.php:194 +#: maintenance.php:201 +#: maintenance.php:257 +#: maintenance.php:320 +#: maintenance.php:327 +#: maintenance.php:334 +#: maintenance.php:341 +#: maintenance.php:348 +msgid "Text string" +msgstr "" + +#: maintenance.php:188 +#: wordpress-popular-posts.php:183 +msgid "Popular Posts" +msgstr "" + +#: maintenance.php:193 +msgid "Set the opening tag for the heading of the list" +msgstr "" + +#: maintenance.php:200 +msgid "Set the closing tag for the heading of the list" +msgstr "" + +#: maintenance.php:207 +msgid "Sets the maximum number of popular posts to be shown on the listing" +msgstr "" + +#: maintenance.php:208 +#: maintenance.php:236 +#: maintenance.php:243 +#: maintenance.php:264 +#: maintenance.php:271 +msgid "Positive integer" +msgstr "" + +#: maintenance.php:214 +msgid "Tells Wordpress Popular Posts to retrieve the most popular entries within the time range specified by you" +msgstr "" + +#: maintenance.php:221 +msgid "Sets the sorting option of the popular posts" +msgstr "" + +#: maintenance.php:222 +msgid "(for average views per day)" +msgstr "" + +#: maintenance.php:228 +msgid "Tells Wordpress Popular Posts whether to consider or not pages while building the popular list" +msgstr "" + +#: maintenance.php:235 +msgid "If set, Wordpress Popular Posts will shorten each post title to \"n\" characters whenever possible" +msgstr "" + +#: maintenance.php:242 +msgid "If set, Wordpress Popular Posts will build and include an excerpt of \"n\" characters long from the content of each post listed as popular" +msgstr "" + +#: maintenance.php:249 +msgid "If set, Wordpress Popular Posts will maintaing all styling tags (strong, italic, etc) and hyperlinks found in the excerpt" +msgstr "" + +#: maintenance.php:256 +msgid "If set, Wordpress Popular Posts will exclude all entries that belong to the specified category(ies)." +msgstr "" + +#: maintenance.php:258 +msgid "None" +msgstr "" + +#: maintenance.php:263 +msgid "If set, and if your current server configuration allows it, you will be able to display thumbnails of your posts. This attribute sets the width for thumbnails" +msgstr "" + +#: maintenance.php:270 +msgid "If set, and if your current server configuration allows it, you will be able to display thumbnails of your posts. This attribute sets the height for thumbnails" +msgstr "" + +#: maintenance.php:277 +msgid "Sets the source of thumbnails to use for each post listed. If set to wppgenerated Wordpress Popular Posts will create the images for you, otherwise it will use the thumbnails selected by you. *Requires enabling The Post Thumbnail feature on your theme*" +msgstr "" + +#: maintenance.php:284 +msgid "If set, and if the WP-PostRatings plugin is installed and enabled on your blog, Wordpress Popular Posts will show how your visitors are rating your entries" +msgstr "" + +#: maintenance.php:291 +msgid "If set, Wordpress Popular Posts will show how many comments each popular post has got until now" +msgstr "" + +#: maintenance.php:298 +msgid "If set, Wordpress Popular Posts will show how many views each popular post has got since it was installed" +msgstr "" + +#: maintenance.php:305 +msgid "If set, Wordpress Popular Posts will show who published each popular post on the list" +msgstr "" + +#: maintenance.php:312 +msgid "If set, Wordpress Popular Posts will when each popular post on the list was published" +msgstr "" + +#: maintenance.php:319 +msgid "Sets the date format" +msgstr "" + +#: maintenance.php:326 +msgid "Sets the opening tag for the listing" +msgstr "" + +#: maintenance.php:333 +msgid "Sets the closing tag for the listing" +msgstr "" + +#: maintenance.php:340 +msgid "Sets the opening tag for each item on the list" +msgstr "" + +#: maintenance.php:347 +msgid "Sets the closing tag for each item on the list" +msgstr "" + +#: maintenance.php:354 +msgid "If set, this option will allow you to decide the order of the contents within each item on the list." +msgstr "" + +#: maintenance.php:361 +msgid "If set, you can decide the order of each content inside a single item on the list. For example, setting it to \"{title}: {summary}\" would output something like \"Your Post Title: summary here\". This attribute requires do_pattern to be true." +msgstr "" + +#: maintenance.php:362 +msgid "Available tags" +msgstr "" + +#: maintenance.php:371 +msgid "Maintenance Settings" +msgstr "" + +#: maintenance.php:372 +msgid "Wordpress Popular Posts keeps historical data of your most popular entries for up to 30 days. If for some reason you need to clear the cache table, or even both historical and cache tables, please use the buttons below to do so." +msgstr "" + +#: maintenance.php:375 +msgid "Empty cache" +msgstr "" + +#: maintenance.php:376 +msgid "Use this button to manually clear entries from WPP cache only" +msgstr "" + +#: maintenance.php:382 +msgid "Clear all data" +msgstr "" + +#: maintenance.php:383 +msgid "Use this button to manually clear entries from all WPP data tables" +msgstr "" + +#: maintenance.php:391 +msgid "Do you like this plugin?" +msgstr "" + +#: maintenance.php:391 +msgid "Rate Wordpress Popular Posts!" +msgstr "" + +#: maintenance.php:391 +msgid "Rate it 5" +msgstr "" + +#: maintenance.php:391 +msgid "on the official Plugin Directory!" +msgstr "" + +#: maintenance.php:392 +msgid "Do you love this plugin?" +msgstr "" + +#: maintenance.php:392 +#: maintenance.php:393 +msgid "Buy me a beer!" +msgstr "" + +#: maintenance.php:392 +msgid "Each donation motivates me to keep releasing free stuff for the Wordpress community!" +msgstr "" + +#: stats.php:90 +msgid "Click on each tab to see what are the most popular entries on your blog today, this week, last 30 days or all time since Wordpress Popular Posts was installed." +msgstr "" + +#: stats.php:92 +msgid "Yesterday" +msgstr "" + +#: stats.php:93 +#: wordpress-popular-posts.php:242 +msgid "Today" +msgstr "" + +#: stats.php:94 +msgid "Weekly" +msgstr "" + +#: stats.php:95 +msgid "Monthly" +msgstr "" + +#: stats.php:96 +#: wordpress-popular-posts.php:245 +msgid "All-time" +msgstr "" + +#: wordpress-popular-posts.php:236 +msgid "Title:" +msgstr "" + +#: wordpress-popular-posts.php:238 +msgid "Show up to:" +msgstr "" + +#: wordpress-popular-posts.php:239 +msgid "posts" +msgstr "" + +#: wordpress-popular-posts.php:240 +msgid "Time Range:" +msgstr "" + +#: wordpress-popular-posts.php:243 +msgid "Last 7 days" +msgstr "" + +#: wordpress-popular-posts.php:244 +msgid "Last 30 days" +msgstr "" + +#: wordpress-popular-posts.php:248 +msgid "Sort posts by:" +msgstr "" + +#: wordpress-popular-posts.php:250 +msgid "Comments" +msgstr "" + +#: wordpress-popular-posts.php:251 +msgid "Total views" +msgstr "" + +#: wordpress-popular-posts.php:252 +msgid "Avg. daily views" +msgstr "" + +#: wordpress-popular-posts.php:255 +msgid "Include pages" +msgstr "" + +#: wordpress-popular-posts.php:257 +msgid "Display post rating" +msgstr "" + +#: wordpress-popular-posts.php:259 +msgid "Shorten title output" +msgstr "" + +#: wordpress-popular-posts.php:261 +msgid "Shorten title to" +msgstr "" + +#: wordpress-popular-posts.php:261 +#: wordpress-popular-posts.php:268 +msgid "characters" +msgstr "" + +#: wordpress-popular-posts.php:263 +msgid "Display post excerpt" +msgstr "" + +#: wordpress-popular-posts.php:266 +msgid "Excerpt Properties" +msgstr "" + +#: wordpress-popular-posts.php:267 +msgid "Keep text format and links" +msgstr "" + +#: wordpress-popular-posts.php:268 +msgid "Excerpt length:" +msgstr "" + +#: wordpress-popular-posts.php:272 +msgid "Exclude categories" +msgstr "" + +#: wordpress-popular-posts.php:275 +msgid "Categories to exclude" +msgstr "" + +#: wordpress-popular-posts.php:276 +msgid "ID(s) (comma separated, no spaces):" +msgstr "" + +#: wordpress-popular-posts.php:282 +msgid "Thumbnail settings" +msgstr "" + +#: wordpress-popular-posts.php:283 +msgid "Display post thumbnail" +msgstr "" + +#: wordpress-popular-posts.php:286 +msgid "Generate all thumbnails for me" +msgstr "" + +#: wordpress-popular-posts.php:287 +msgid "Use thumbnails selected by me" +msgstr "" + +#: wordpress-popular-posts.php:289 +msgid "Width:" +msgstr "" + +#: wordpress-popular-posts.php:290 +#: wordpress-popular-posts.php:292 +msgid "px" +msgstr "" + +#: wordpress-popular-posts.php:291 +msgid "Height:" +msgstr "" + +#: wordpress-popular-posts.php:299 +msgid "Stats Tag settings" +msgstr "" + +#: wordpress-popular-posts.php:300 +msgid "Display comment count" +msgstr "" + +#: wordpress-popular-posts.php:301 +msgid "Display views" +msgstr "" + +#: wordpress-popular-posts.php:302 +msgid "Display author" +msgstr "" + +#: wordpress-popular-posts.php:303 +msgid "Display date" +msgstr "" + +#: wordpress-popular-posts.php:306 +msgid "Date Format" +msgstr "" + +#: wordpress-popular-posts.php:317 +msgid "HTML Markup settings" +msgstr "" + +#: wordpress-popular-posts.php:318 +msgid "Use custom HTML Markup" +msgstr "" + +#: wordpress-popular-posts.php:321 +msgid "Before / after title:" +msgstr "" + +#: wordpress-popular-posts.php:323 +msgid "Before / after Popular Posts:" +msgstr "" + +#: wordpress-popular-posts.php:325 +msgid "Before / after each post:" +msgstr "" + +#: wordpress-popular-posts.php:329 +msgid "Use content formatting tags" +msgstr "" + +#: wordpress-popular-posts.php:332 +msgid "Content format:" +msgstr "" + +#: wordpress-popular-posts.php:400 +msgid "Success! The cache table has been cleared!" +msgstr "" + +#: wordpress-popular-posts.php:402 +msgid "Error: cache table does not exist." +msgstr "" + +#: wordpress-popular-posts.php:408 +msgid "Success! All data have been cleared!" +msgstr "" + +#: wordpress-popular-posts.php:410 +msgid "Error: one or both data tables are missing." +msgstr "" + +#: wordpress-popular-posts.php:413 +msgid "Invalid action." +msgstr "" + +#: wordpress-popular-posts.php:416 +msgid "Sorry, you do not have enough permissions to do this. Please contact the site administrator for support." +msgstr "" + +#: wordpress-popular-posts.php:600 +msgid "Sorry. No data so far." +msgstr "" + +#: wordpress-popular-posts.php:644 +msgid " comment(s)" +msgstr "" + +#: wordpress-popular-posts.php:647 +msgid " view(s)" +msgstr "" + +#: wordpress-popular-posts.php:652 +msgid " view(s) per day" +msgstr "" + +#: wordpress-popular-posts.php:665 +#: wordpress-popular-posts.php:667 +msgid "by" +msgstr "" + +#: wordpress-popular-posts.php:672 +#: wordpress-popular-posts.php:674 +msgid "posted on" +msgstr "" + +#: wordpress-popular-posts.php:973 +msgid "Your Wordpress version is too old. Wordpress Popular Posts Plugin requires at least version 2.8 to function correctly. Please update your blog via Tools > Upgrade." +msgstr "" + +#: wordpress-popular-posts.php:1096 +msgid "Wordpress Popular Posts Stats" +msgstr "" + diff --git a/wp-content/themes/studio11 b/wp-content/themes/studio11 index c859ea4..90a43e7 160000 --- a/wp-content/themes/studio11 +++ b/wp-content/themes/studio11 @@ -1 +1 @@ -Subproject commit c859ea416d55199f56431922ec5d8fa4bc19008e +Subproject commit 90a43e7493edfec255f24a44097810d2b6f009a5