Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • ссылка не рабоатет
    вот мой вариант https://yadi.sk/d/_Mkhrod4m9TUt
    но не все выражения почему то подхватило

    ws256

    (@ws256)

    You know WP-PostViews plugin?

    In it, the file wp-postviews.php
    You can create a new function (approximately 266 line)

    ### Function: Display month viewed Page/Post
    if(!function_exists('get_month_viewed')) {
    	function get_month_viewed($mode = '', $limit = 50, $chars = 0, $display = true) {
    		global $wpdb, $post;
    		$views_options = get_option('views_options');
    		$where = '';
    		$temp = '';
    		$output = '';
    		if(!empty($mode) && $mode != 'both') {
    			$where = "post_type = '$mode'";
    		} else {
    			$where = '1=1';
    		}
    		$start_date = mktime(0,0,0,date("m")-1,date("d"),date("Y"));
    		$date_limit = "post_date BETWEEN '".date("Y-m-d", $start_date)."' AND '".current_time('mysql')."'";
    
    		$most_viewed = $wpdb->get_results("SELECT DISTINCT $wpdb->posts.*, (meta_value+0) AS views FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON $wpdb->postmeta.post_id = $wpdb->posts.ID WHERE $date_limit AND $where AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER  BY views DESC LIMIT $limit");
    		if($most_viewed) {
    			foreach ($most_viewed as $post) {
    				$post_views = intval($post->views);
    				$post_title = get_the_title();
    				if($chars > 0) {
    					$post_title = snippet_text($post_title, $chars);
    				}
    				$post_excerpt = views_post_excerpt($post->post_excerpt, $post->post_content, $post->post_password, $chars);
    				$post_content = get_the_content();
    				$temp = stripslashes($views_options['most_viewed_template']);
    				$temp = str_replace("%VIEW_COUNT%", number_format_i18n($post_views), $temp);
    				$temp = str_replace("%POST_TITLE%", $post_title, $temp);
    				$temp = str_replace("%POST_EXCERPT%", $post_excerpt, $temp);
    				$temp = str_replace("%POST_CONTENT%", $post_content, $temp);
    				$temp = str_replace("%POST_URL%", get_permalink(), $temp);
    				$output .= $temp;
    			}
    		} else {
    			$output = '<li>'.__('N/A', 'wp-postviews').'</li>'."\n";
    		}
    		if($display) {
    			echo $output;
    		} else {
    			return $output;
    		}
    	}
    }

    meta_key = ‘views’ replaced by ‘wpfp_favorites’

    All this is not right, but I have to retrieve the past month most viewed work.

    create a page template

    <ol>
    <?php if (function_exists('wpfp_widget_view')): ?>
    <?php wpfp_widget_view('15'); ?>
    <?php endif; ?>
    </ol>

    Options pass did not work for me, but it displays what is listed in the widget settings should be applied in the admin

    Could you explain how did you do that, please?
    Which file, which line… do you just add the jQuery.noConflict(); ?

    In heder.php my template, where calls are used scripts jQuery plugins.
    However, third-party scripts can connect the other plug-ins wordpress. More calls can be in the footer.

    Yes that would be great ws256 if you have a fix, but let us know exactly where.

    it depends on the template rather than the plug-in.

    I solved this problem. The plugin works. In all of whom have only a black screen or loading gif – is a conflict of scripts jQuery. To see the default template include, for example “twentyeleven”. I had a conflict of preloadCssImages.jQuery_v5.js
    jQuery.noConflict();
    add and enjoy

    Exact same problem. And in the pattern of activation after the plugin has stopped working tag:
    <?php the_ID(); ?>
    think that it is connected as a plugin like can not get post ID

Viewing 7 replies - 1 through 7 (of 7 total)