init blog
This commit is contained in:
1 parent
5acc46db8e
commit
843783ce9a
1820 files changed
+539344
No files matched your search
@@ -0,0 +1 @@
|
||||
jQuery.ajax({type:"GET",url:viewsCacheL10n.admin_ajax_url,data:"postviews_id="+viewsCacheL10n.post_id+"&action=postviews",cache:!1});
|
||||
@@ -0,0 +1,207 @@
|
||||
<?php
|
||||
### Variables Variables Variables
|
||||
$base_name = plugin_basename( 'wp-postviews/postviews-options.php' );
|
||||
$base_page = 'admin.php?page='.$base_name;
|
||||
$id = (isset($_GET['id'] ) ? intval($_GET['id'] ) : 0);
|
||||
$mode = (isset($_GET['mode'] ) ? trim($_GET['mode'] ) : '' );
|
||||
$text = '';
|
||||
|
||||
### Form Processing
|
||||
if(!empty($_POST['Submit'] )) {
|
||||
check_admin_referer( 'wp-postviews_options' );
|
||||
$views_options = array(
|
||||
'count' => intval( views_options_parse('views_count') )
|
||||
, 'exclude_bots' => intval( views_options_parse('views_exclude_bots') )
|
||||
, 'display_home' => intval( views_options_parse('views_display_home') )
|
||||
, 'display_single' => intval( views_options_parse('views_display_single') )
|
||||
, 'display_page' => intval( views_options_parse('views_display_page') )
|
||||
, 'display_archive' => intval( views_options_parse('views_display_archive') )
|
||||
, 'display_search' => intval( views_options_parse('views_display_search') )
|
||||
, 'display_other' => intval( views_options_parse('views_display_other') )
|
||||
, 'use_ajax' => intval( views_options_parse('views_use_ajax') )
|
||||
, 'template' => trim( views_options_parse('views_template_template') )
|
||||
, 'most_viewed_template' => trim( views_options_parse('views_template_most_viewed') )
|
||||
);
|
||||
$update_views_queries = array();
|
||||
$update_views_text = array();
|
||||
$update_views_queries[] = update_option( 'views_options', $views_options );
|
||||
$update_views_text[] = __( 'Post Views Options', 'wp-postviews' );
|
||||
$i = 0;
|
||||
|
||||
foreach( $update_views_queries as $update_views_query ) {
|
||||
if( $update_views_query ) {
|
||||
$text .= '<p style="color: green;">' . $update_views_text[$i] . ' ' . __( 'Updated', 'wp-postviews' ) . '</p>';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if( empty( $text ) ) {
|
||||
$text = '<p style="color: red;">' . __( 'No Post Views Option Updated', 'wp-postviews' ) . '</p>';
|
||||
}
|
||||
}
|
||||
|
||||
$views_options = get_option( 'views_options' );
|
||||
|
||||
// Default
|
||||
if( !isset ( $views_options['use_ajax'] ) ) {
|
||||
$views_options['use_ajax'] = 1;
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[*/
|
||||
function views_default_templates(template) {
|
||||
var default_template;
|
||||
switch(template) {
|
||||
case 'template':
|
||||
default_template = "<?php _e( '%VIEW_COUNT% views', 'wp-postviews' ); ?>";
|
||||
break;
|
||||
case 'most_viewed':
|
||||
default_template = "<li><a href=\"%POST_URL%\" title=\"%POST_TITLE%\">%POST_TITLE%</a> - %VIEW_COUNT% <?php _e( 'views', 'wp-postviews' ); ?></li>";
|
||||
break;
|
||||
}
|
||||
jQuery("#views_template_" + template).val(default_template);
|
||||
}
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php if( !empty( $text ) ) { echo '<div id="message" class="updated fade"><p>' . $text . '</p></div>'; } ?>
|
||||
<form method="post" action="<?php echo admin_url( 'admin.php?page=' . plugin_basename( __FILE__ ) ); ?>">
|
||||
<?php wp_nonce_field( 'wp-postviews_options' ); ?>
|
||||
<div class="wrap">
|
||||
<h2><?php _e( 'Post Views Options', 'wp-postviews' ); ?></h2>
|
||||
<table class="form-table">
|
||||
<tr>
|
||||
<td valign="top" width="30%"><strong><?php _e( 'Count Views From:', 'wp-postviews' ); ?></strong></td>
|
||||
<td valign="top">
|
||||
<select name="views_count" size="1">
|
||||
<option value="0"<?php selected( '0', $views_options['count'] ); ?>><?php _e( 'Everyone', 'wp-postviews' ); ?></option>
|
||||
<option value="1"<?php selected( '1', $views_options['count'] ); ?>><?php _e( 'Guests Only', 'wp-postviews' ); ?></option>
|
||||
<option value="2"<?php selected( '2', $views_options['count'] ); ?>><?php _e( 'Registered Users Only', 'wp-postviews' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="30%"><strong><?php _e( 'Exclude Bot Views:', 'wp-postviews' ); ?></strong></td>
|
||||
<td valign="top">
|
||||
<select name="views_exclude_bots" size="1">
|
||||
<option value="0"<?php selected( '0', $views_options['exclude_bots'] ); ?>><?php _e( 'No', 'wp-postviews' ); ?></option>
|
||||
<option value="1"<?php selected( '1', $views_options['exclude_bots'] ); ?>><?php _e( 'Yes', 'wp-postviews' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if( defined( 'WP_CACHE' ) && WP_CACHE ): ?>
|
||||
<tr>
|
||||
<td valign="top" width="30%"><strong><?php _e( 'Use AJAX To Update Views:', 'wp-postviews' ); ?></strong></td>
|
||||
<td valign="top">
|
||||
<select name="views_use_ajax" size="1">
|
||||
<option value="0"<?php selected( '0', $views_options['use_ajax'] ); ?>><?php _e( 'No', 'wp-postviews' ); ?></option>
|
||||
<option value="1"<?php selected( '1', $views_options['use_ajax'] ); ?>><?php _e( 'Yes', 'wp-postviews' ); ?></option>
|
||||
</select>
|
||||
<p>
|
||||
<?php _e( 'You have caching enabled for your WordPress installation, by default WP-PostViews will use AJAX to update the view count. However in some cases, you might not want it.', 'wp-postviews' ); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php else: ?>
|
||||
<input type="hidden" name="views_use_ajax" value="0" />
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<strong><?php _e( 'Views Template:', 'wp-postviews' ); ?></strong><br /><br />
|
||||
<?php _e( 'Allowed Variables:', 'wp-postviews' ); ?><br />
|
||||
- %VIEW_COUNT%<br />
|
||||
- %VIEW_COUNT_ROUNDED%<br /><br />
|
||||
<input type="button" name="RestoreDefault" value="<?php _e( 'Restore Default Template', 'wp-postviews' ); ?>" onclick="views_default_templates( 'template' );" class="button" />
|
||||
</td>
|
||||
<td valign="top">
|
||||
<input type="text" id="views_template_template" name="views_template_template" size="70" value="<?php echo htmlspecialchars(stripslashes($views_options['template'] )); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<strong><?php _e( 'Most Viewed Template:', 'wp-postviews' ); ?></strong><br /><br />
|
||||
<?php _e( 'Allowed Variables:', 'wp-postviews' ); ?><br />
|
||||
- %VIEW_COUNT%<br />
|
||||
- %VIEW_COUNT_ROUNDED%<br />
|
||||
- %POST_TITLE%<br />
|
||||
- %POST_DATE%<br />
|
||||
- %POST_TIME%<br />
|
||||
- %POST_EXCERPT%<br />
|
||||
- %POST_CONTENT%<br />
|
||||
- %POST_URL%<br />
|
||||
- %POST_THUMBNAIL%<br />
|
||||
- %POST_CATEGORY_ID%<br /><br />
|
||||
<input type="button" name="RestoreDefault" value="<?php _e( 'Restore Default Template', 'wp-postviews' ); ?>" onclick="views_default_templates( 'most_viewed' );" class="button" />
|
||||
</td>
|
||||
<td valign="top">
|
||||
<textarea cols="80" rows="15" id="views_template_most_viewed" name="views_template_most_viewed"><?php echo htmlspecialchars(stripslashes($views_options['most_viewed_template'] )); ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3><?php _e( 'Display Options', 'wp-postviews' ); ?></h3>
|
||||
<p><?php _e( 'These options specify where the view counts should be displayed and to whom. By default view counts will be displayed to all visitors. Note that the theme files must contain a call to <code>the_views()</code> in order for any view count to be displayed.', 'wp-postviews' ); ?></p>
|
||||
<table class="form-table">
|
||||
<tr>
|
||||
<td valign="top"><strong><?php _e( 'Home Page:', 'wp-postviews' ); ?></strong></td>
|
||||
<td>
|
||||
<select name="views_display_home" size="1">
|
||||
<option value="0"<?php selected( '0', $views_options['display_home'] ); ?>><?php _e( 'Display to everyone', 'wp-postviews' ); ?></option>
|
||||
<option value="1"<?php selected( '1', $views_options['display_home'] ); ?>><?php _e( 'Display to registered users only', 'wp-postviews' ); ?></option>
|
||||
<option value="2"<?php selected( '2', $views_options['display_home'] ); ?>><?php _e( 'Don\'t display on home page', 'wp-postviews' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong><?php _e( 'Single Posts:', 'wp-postviews' ); ?></strong></td>
|
||||
<td>
|
||||
<select name="views_display_single" size="1">
|
||||
<option value="0"<?php selected( '0', $views_options['display_single'] ); ?>><?php _e( 'Display to everyone', 'wp-postviews' ); ?></option>
|
||||
<option value="1"<?php selected( '1', $views_options['display_single'] ); ?>><?php _e( 'Display to registered users only', 'wp-postviews' ); ?></option>
|
||||
<option value="2"<?php selected( '2', $views_options['display_single'] ); ?>><?php _e( 'Don\'t display on single posts', 'wp-postviews' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong><?php _e( 'Pages:', 'wp-postviews' ); ?></strong></td>
|
||||
<td>
|
||||
<select name="views_display_page" size="1">
|
||||
<option value="0"<?php selected( '0', $views_options['display_page'] ); ?>><?php _e( 'Display to everyone', 'wp-postviews' ); ?></option>
|
||||
<option value="1"<?php selected( '1', $views_options['display_page'] ); ?>><?php _e( 'Display to registered users only', 'wp-postviews' ); ?></option>
|
||||
<option value="2"<?php selected( '2', $views_options['display_page'] ); ?>><?php _e( 'Don\'t display on pages', 'wp-postviews' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong><?php _e( 'Archive Pages:', 'wp-postviews' ); ?></strong></td>
|
||||
<td>
|
||||
<select name="views_display_archive" size="1">
|
||||
<option value="0"<?php selected( '0', $views_options['display_archive'] ); ?>><?php _e( 'Display to everyone', 'wp-postviews' ); ?></option>
|
||||
<option value="1"<?php selected( '1', $views_options['display_archive'] ); ?>><?php _e( 'Display to registered users only', 'wp-postviews' ); ?></option>
|
||||
<option value="2"<?php selected( '2', $views_options['display_archive'] ); ?>><?php _e( 'Don\'t display on archive pages', 'wp-postviews' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong><?php _e( 'Search Pages:', 'wp-postviews' ); ?></strong></td>
|
||||
<td>
|
||||
<select name="views_display_search" size="1">
|
||||
<option value="0"<?php selected( '0', $views_options['display_search'] ); ?>><?php _e( 'Display to everyone', 'wp-postviews' ); ?></option>
|
||||
<option value="1"<?php selected( '1', $views_options['display_search'] ); ?>><?php _e( 'Display to registered users only', 'wp-postviews' ); ?></option>
|
||||
<option value="2"<?php selected( '2', $views_options['display_search'] ); ?>><?php _e( 'Don\'t display on search pages', 'wp-postviews' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong><?php _e( 'Other Pages:', 'wp-postviews' ); ?></strong></td>
|
||||
<td>
|
||||
<select name="views_display_other" size="1">
|
||||
<option value="0"<?php selected( '0', $views_options['display_other'] ); ?>><?php _e( 'Display to everyone', 'wp-postviews' ); ?></option>
|
||||
<option value="1"<?php selected( '1', $views_options['display_other'] ); ?>><?php _e( 'Display to registered users only', 'wp-postviews' ); ?></option>
|
||||
<option value="2"<?php selected( '2', $views_options['display_other'] ); ?>><?php _e( 'Don\'t display on other pages', 'wp-postviews' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="submit">
|
||||
<input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save Changes', 'wp-postviews' ); ?>" />
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,206 @@
|
||||
# WP-PostViews
|
||||
Contributors: GamerZ
|
||||
Donate link: https://lesterchan.net/site/donation/
|
||||
Tags: views, hits, counter, postviews
|
||||
Requires at least: 4.0
|
||||
Tested up to: 4.7
|
||||
Stable tag: 1.75
|
||||
|
||||
Enables you to display how many times a post/page had been viewed.
|
||||
|
||||
## Description
|
||||
|
||||
### Usage
|
||||
1. Open `wp-content/themes/<YOUR THEME NAME>/index.php`
|
||||
2. You may place it in archive.php, single.php, post.php or page.php also.
|
||||
3. Find: `<?php while (have_posts()) : the_post(); ?>`
|
||||
4. Add Anywhere Below It (The Place You Want The Views To Show): `<?php if(function_exists('the_views')) { the_views(); } ?>`
|
||||
5. Or you can use the shortcode `[views]` or `[views id="1"]` (where 1 is the post ID) in a post
|
||||
6. Go to `WP-Admin -> Settings -> PostViews` to configure the plugin.
|
||||
|
||||
### Build Status
|
||||
[](https://travis-ci.org/lesterchan/wp-postviews)
|
||||
|
||||
### Development
|
||||
[https://github.com/lesterchan/wp-postviews/](https://github.com/lesterchan/wp-postviews/ "https://github.com/lesterchan/wp-postviews/")
|
||||
|
||||
### Translations
|
||||
[http://dev.wp-plugins.org/browser/wp-postviews/i18n/](http://dev.wp-plugins.org/browser/wp-postviews/i18n/ "http://dev.wp-plugins.org/browser/wp-postviews/i18n/")
|
||||
|
||||
### Credits
|
||||
* Plugin icon by [Iconmoon](http://www.icomoon.io) from [Flaticon](http://www.flaticon.com)
|
||||
|
||||
### Donations
|
||||
I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
|
||||
|
||||
## Changelog
|
||||
### Version 1.75
|
||||
* NEW: Use WP_Query() for most/least viewed posts
|
||||
|
||||
### Version 1.74
|
||||
* NEW: Bump WordPress 4.7
|
||||
* NEW: Template variable %POST_CATEGORY_ID%. It returns Post's Category ID. If you are using Yoast SEO Plugin, it will return the priority Category ID. Props @FunFrog-BY
|
||||
|
||||
### Version 1.73
|
||||
* FIXED: In preview mode, don't count views
|
||||
|
||||
### Version 1.72
|
||||
* NEW: Add %POST_THUMBNAIL% to template variables
|
||||
|
||||
### Version 1.71
|
||||
* FIXED: Notices in Widget Constructor for WordPress 4.3
|
||||
|
||||
### Version 1.70
|
||||
* FIXED: Integration with WP-Stats
|
||||
|
||||
### Version 1.69
|
||||
* NEW: Shortcode `[views]` or [views id="POST_ID"]` to embed view count into post
|
||||
* NEW: Added template variable `%VIEW_COUNT_ROUNDED%` to support rounded view count like 10.1k or 11.2M
|
||||
|
||||
### Version 1.68
|
||||
* NEW: Added action hook 'postviews_increment_views' and 'postviews_increment_views_ajax'
|
||||
* NEW: Allow custom post type to be chosen under the widget
|
||||
|
||||
### Version 1.67
|
||||
* NEW: Allow user to not use AJAX to update the views even though WP_CACHE is true
|
||||
|
||||
### Version 1.66
|
||||
* NEW: Supports MultiSite Network Activation
|
||||
* NEW: Add %POST_DATE% and %POST_TIME% to template variables
|
||||
* NEW: Add China isearch engines bots
|
||||
* NEW: Ability to pass in an array of post types for get_most/least_*() functions. Props Leo Plaw.
|
||||
* FIXED: Moved uninstall to uninstall.php and hence fix missing nonce. Props Julio Potier.
|
||||
* FIXED: Notices and better way to get views from meta. Props daankortenbach.
|
||||
* FIXED: No longer needing add_post_meta() if update_post_meta() fails.
|
||||
|
||||
### Version 1.65 (02-06-2013)
|
||||
* FIXED: Views not showing in WP-Admin if "Display Options" is not set to "Display to everyone"
|
||||
|
||||
## Upgrade Notice
|
||||
|
||||
N/A
|
||||
|
||||
## Screenshots
|
||||
|
||||
1. PostViews
|
||||
2. Admin - PostViews Options
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
### How To View Stats With Widgets?
|
||||
* Go to `WP-Admin -> Appearance -> Widgets`
|
||||
* The widget name is Views.
|
||||
|
||||
### To Display Least Viewed Posts
|
||||
|
||||
```
|
||||
<?php if (function_exists('get_least_viewed')): ?>
|
||||
<ul>
|
||||
<?php get_least_viewed(); ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
```
|
||||
|
||||
* The first value you pass in is the post type that you want. If you want to get every post types, just use 'both'. It also supports PHP array: example `array('post', 'page')`.
|
||||
* The second value you pass in is the maximum number of post you want to get.
|
||||
* Default: get_least_viewed('both', 10);
|
||||
|
||||
### To Display Most Viewed Posts
|
||||
|
||||
```
|
||||
<?php if (function_exists('get_most_viewed')): ?>
|
||||
<ul>
|
||||
<?php get_most_viewed(); ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
```
|
||||
|
||||
* The first value you pass in is the post type that you want. If you want to get every post types, just use 'both'. It also supports PHP array: example `array('post', 'page')`.
|
||||
* The second value you pass in is the maximum number of post you want to get.
|
||||
* Default: get_most_viewed('both', 10);
|
||||
|
||||
### To Display Least Viewed Posts By Tag
|
||||
|
||||
```
|
||||
<?php if (function_exists('get_least_viewed_tag')): ?>
|
||||
<ul>
|
||||
<?php get_least_viewed_tag(); ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
```
|
||||
|
||||
* The first value you pass in is the tag id.
|
||||
* The second value you pass in is the post type that you want. If you want to get every post types, just use 'both'. It also supports PHP array: example `array('post', 'page')`.
|
||||
* The third value you pass in is the maximum number of post you want to get.
|
||||
* Default: get_least_viewed_tag(1, 'both', 10);
|
||||
|
||||
### To Display Most Viewed Posts By Tag
|
||||
|
||||
```
|
||||
<?php if (function_exists('get_most_viewed_tag')): ?>
|
||||
<ul>
|
||||
<?php get_most_viewed_tag(); ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
```
|
||||
|
||||
* The first value you pass in is the tag id.
|
||||
* The second value you pass in is the post type that you want. If you want to get every post types, just use 'both'. It also supports PHP array: example `array('post', 'page')`.
|
||||
* The third value you pass in is the maximum number of post you want to get.
|
||||
* Default: get_most_viewed_tag(1, 'both', 10);
|
||||
|
||||
### To Display Least Viewed Posts For A Category
|
||||
|
||||
```
|
||||
<?php if (function_exists('get_least_viewed_category')): ?>
|
||||
<ul>
|
||||
<?php get_least_viewed_category(); ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
```
|
||||
|
||||
* The first value you pass in is the category id.
|
||||
* The second value you pass in is the post type that you want. If you want to get every post types, just use 'both'. It also supports PHP array: example `array('post', 'page')`.
|
||||
* The third value you pass in is the maximum number of post you want to get.
|
||||
* Default: get_least_viewed_category(1, 'both', 10);
|
||||
|
||||
### To Display Most Viewed Posts For A Category
|
||||
|
||||
```
|
||||
<?php if (function_exists('get_most_viewed_category')): ?>
|
||||
<ul>
|
||||
<?php get_most_viewed_category(); ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
```
|
||||
|
||||
* The first value you pass in is the category id.
|
||||
* The second value you pass in is the post type that you want. If you want to get every post types, just use 'both'. It also supports PHP array: example `array('post', 'page')`.
|
||||
* The third value you pass in is the maximum number of post you want to get.
|
||||
* Default: get_most_viewed_category(1, 'both', 10);
|
||||
|
||||
### To Sort Most/Least Viewed Posts
|
||||
* You can use: `<?php query_posts( array( 'meta_key' => 'views', 'orderby' => 'meta_value_num', 'order' => 'DESC' ) ); ?>`
|
||||
* Or pass in the variables to the URL: `http://yoursite.com/?v_sortby=views&v_orderby=desc`
|
||||
* You can replace DESC with ASC if you want the least viewed posts.
|
||||
|
||||
### To Display Updating View Count With LiteSpeed Cache
|
||||
Use: `<div id="postviews_lscwp"></div>` to replace `<?php if(function_exists('the_views')) { the_views(); } ?>`.
|
||||
NOTE: The id can be changed, but the div id and the ajax function must match.
|
||||
Replace the ajax query in `wp-content/plugins/wp-postviews/postviews-cache.js` with
|
||||
|
||||
```
|
||||
jQuery.ajax({
|
||||
type:"GET",
|
||||
url:viewsCacheL10n.admin_ajax_url,
|
||||
data:"postviews_id="+viewsCacheL10n.post_id+"&action=postviews",
|
||||
cache:!1,
|
||||
success:function(data) {
|
||||
if(data) {
|
||||
jQuery('#postviews_lscwp').html(data+' views');
|
||||
}
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Purge the cache to use the updated pages.
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* Uninstall plugin
|
||||
*/
|
||||
|
||||
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
|
||||
exit ();
|
||||
|
||||
if ( is_multisite() ) {
|
||||
$ms_sites = function_exists( 'get_sites' ) ? get_sites() : wp_get_sites();
|
||||
|
||||
if( 0 < count( $ms_sites ) ) {
|
||||
foreach ( $ms_sites as $ms_site ) {
|
||||
$blog_id = class_exists( 'WP_Site' ) ? $ms_site->blog_id : $ms_site['blog_id'];
|
||||
switch_to_blog( $blog_id );
|
||||
uninstall();
|
||||
restore_current_blog();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uninstall();
|
||||
}
|
||||
|
||||
function uninstall() {
|
||||
global $wpdb;
|
||||
|
||||
$option_names = array( 'views_options', 'widget_views_most_viewed', 'widget_views' );
|
||||
|
||||
if( count( $option_names ) > 0 ) {
|
||||
foreach( $option_names as $option_name ) {
|
||||
delete_option( $option_name );
|
||||
}
|
||||
}
|
||||
|
||||
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = 'views'" );
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,347 @@
|
||||
# Copyright (C) 2012 WP-PostViews
|
||||
# This file is distributed under the same license as the WP-PostViews package.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WP-PostViews 1.61\n"
|
||||
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-postviews\n"
|
||||
"POT-Creation-Date: 2012-05-22 00:48:11+00:00\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"PO-Revision-Date: 2012-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
||||
#: postviews-options.php:46 postviews-options.php:139
|
||||
msgid "Post Views Options"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:51
|
||||
msgid "Updated"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:56
|
||||
msgid "No Post Views Option Updated"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:63 postviews-options.php:303
|
||||
msgid "UNINSTALL WP-PostViews"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:71
|
||||
msgid "Setting Key '%s' has been deleted."
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:75
|
||||
msgid "Error deleting Setting Key '%s'."
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:85
|
||||
msgid "Post Meta Key '%s' has been deleted."
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:89
|
||||
msgid "Error deleting Post Meta Key '%s'."
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:111 postviews-options.php:261
|
||||
msgid "Uninstall WP-PostViews"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:112
|
||||
msgid ""
|
||||
"<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-PostViews "
|
||||
"Will Be Deactivated Automatically."
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:125 wp-postviews.php:797
|
||||
msgid "%VIEW_COUNT% views"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:128 wp-postviews.php:798
|
||||
msgid "views"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:142
|
||||
msgid "Count Views From:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:145
|
||||
msgid "Everyone"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:146
|
||||
msgid "Guests Only"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:147
|
||||
msgid "Registered Users Only"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:152
|
||||
msgid "Exclude Bot Views:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:155
|
||||
msgid "No"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:156 postviews-options.php:302
|
||||
msgid "Yes"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:162
|
||||
msgid "Views Template:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:163 postviews-options.php:174
|
||||
msgid "Allowed Variables:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:165 postviews-options.php:180
|
||||
msgid "Restore Default Template"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:173
|
||||
msgid "Most Viewed Template:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:187
|
||||
msgid "Display Options"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:188
|
||||
msgid ""
|
||||
"These options specify where the view counts should be displayed and to whom. "
|
||||
"\tBy default view counts will be displayed to all visitors. Note that the "
|
||||
"theme files must contain a call to <code>the_views()</code> in order for any "
|
||||
"view count to be displayed."
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:191
|
||||
msgid "Home Page:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:194 postviews-options.php:204
|
||||
#: postviews-options.php:214 postviews-options.php:224
|
||||
#: postviews-options.php:234 postviews-options.php:244
|
||||
msgid "Display to everyone"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:195 postviews-options.php:205
|
||||
#: postviews-options.php:215 postviews-options.php:225
|
||||
#: postviews-options.php:235 postviews-options.php:245
|
||||
msgid "Display to registered users only"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:196
|
||||
msgid "Don't display on home page"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:201
|
||||
msgid "Single Posts:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:206
|
||||
msgid "Don't display on single posts"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:211
|
||||
msgid "Pages:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:216
|
||||
msgid "Don't display on pages"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:221
|
||||
msgid "Archive Pages:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:226
|
||||
msgid "Don't display on archive pages"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:231
|
||||
msgid "Search Pages:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:236
|
||||
msgid "Don't display on search pages"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:241
|
||||
msgid "Other Pages:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:246
|
||||
msgid "Don't display on other pages"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:252
|
||||
msgid "Save Changes"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:263
|
||||
msgid ""
|
||||
"Deactivating WP-PostViews plugin does not remove any data that may have been "
|
||||
"created, such as the views data. To completely remove this plugin, you can "
|
||||
"uninstall it here."
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:266
|
||||
msgid "WARNING:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:267
|
||||
msgid ""
|
||||
"Once uninstalled, this cannot be undone. You should use a Database Backup "
|
||||
"plugin of WordPress to back up all the data first."
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:270
|
||||
msgid "The following WordPress Options/PostMetas will be DELETED:"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:275
|
||||
msgid "WordPress Options"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:276
|
||||
msgid "WordPress PostMetas"
|
||||
msgstr ""
|
||||
|
||||
#: postviews-options.php:303
|
||||
msgid ""
|
||||
"You Are About To Uninstall WP-PostViews From WordPress.\\nThis Action Is Not "
|
||||
"Reversible.\\n\\n Choose [Cancel] To Stop, [OK] To Uninstall."
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:42
|
||||
msgid "PostViews"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:191 wp-postviews.php:233 wp-postviews.php:280
|
||||
#: wp-postviews.php:327 wp-postviews.php:374 wp-postviews.php:421
|
||||
msgid "N/A"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:472
|
||||
msgid "There is no excerpt because this is a protected post."
|
||||
msgstr ""
|
||||
|
||||
#. #-#-#-#-# plugin.pot (WP-PostViews 1.61) #-#-#-#-#
|
||||
#. Plugin Name of the plugin/theme
|
||||
#: wp-postviews.php:574 wp-postviews.php:576 wp-postviews.php:604
|
||||
msgid "WP-PostViews"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:587 wp-postviews.php:589 wp-postviews.php:618
|
||||
msgid "%s Most Viewed Post"
|
||||
msgid_plural "%s Most Viewed Posts"
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#: wp-postviews.php:592 wp-postviews.php:594 wp-postviews.php:624
|
||||
msgid "%s Most Viewed Page"
|
||||
msgid_plural "%s Most Viewed Pages"
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#: wp-postviews.php:606
|
||||
msgid "<strong>%s</strong> view was generated."
|
||||
msgid_plural "<strong>%s</strong> views were generated."
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#: wp-postviews.php:674
|
||||
msgid "WP-PostViews views statistics"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:675 wp-postviews.php:725
|
||||
msgid "Views"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:734
|
||||
msgid "Title:"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:737
|
||||
msgid "Statistics Type:"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:739
|
||||
msgid "Least Viewed"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:740
|
||||
msgid "Least Viewed By Category"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:742
|
||||
msgid "Most Viewed"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:743
|
||||
msgid "Most Viewed By Category"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:748
|
||||
msgid "Include Views From:"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:750
|
||||
msgid "Posts & Pages"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:751
|
||||
msgid "Posts Only"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:752
|
||||
msgid "Pages Only"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:757
|
||||
msgid "No. Of Records To Show:"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:760
|
||||
msgid "Maximum Post Title Length (Characters):"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:761
|
||||
msgid "<strong>0</strong> to disable."
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:764
|
||||
msgid "Category IDs:"
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:765
|
||||
msgid "Separate mutiple categories with commas."
|
||||
msgstr ""
|
||||
|
||||
#: wp-postviews.php:768
|
||||
msgid "* If you are not using any category statistics, you can ignore it."
|
||||
msgstr ""
|
||||
|
||||
#. Plugin URI of the plugin/theme
|
||||
msgid "http://lesterchan.net/portfolio/programming/php/"
|
||||
msgstr ""
|
||||
|
||||
#. Description of the plugin/theme
|
||||
msgid ""
|
||||
"Enables you to display how many times a post/page had been viewed. Modified "
|
||||
"by <a href=\"http://DPotter.net/Technical/\" title=\"David's Technical "
|
||||
"Musings\">David Potter</a> to include options for when and where to display "
|
||||
"view counts."
|
||||
msgstr ""
|
||||
|
||||
#. Author of the plugin/theme
|
||||
msgid "Lester 'GaMerZ' Chan"
|
||||
msgstr ""
|
||||
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "http://lesterchan.net"
|
||||
msgstr ""
|
||||
Reference in new issue
Block a user