"));

Eric @ EricBess WebHome Eric @ EricBess WebHome

胜不骄,败不馁,胸有激雷而面如平湖 - Not arrogance, not defeated Holderness, chest and face a shock such as mine Pinghu

Chinese (Simplified) flagItalian flagKorean flagPortuguese flagEnglish flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flagSwedish flagNorwegian flag
By N2H

WordPress 文章访问量插件:CountPosts WordPress plug-in traffic to the article: CountPosts

CountPosts :可以知道blog总访问量和每篇文章的访问量 CountPosts: blog can know the total number of visits and each article of visits

也可以直接下载 Can also be downloaded directly

使用方法: How to use:

1.单篇文章访问量<?php HitThisPost('Hits:',''); ?>加入到single.php和index.php文件中位置可按个人喜好选择 1. Single article of visits <? Php HitThisPost ( 'Hits :','');?> Added to single.php and index.php document position can express their personal preferences

2.总访问量<?php mainCounter('Visits:',''); ?>一般放到sidebar.php 2. The total number of visits <? Php mainCounter ( 'Visits :','');?> General put sidebar.php
'总访问量' 可以按个人喜好修改 'Total traffic' can be modified according to personal preference

3. 访问量最多的文章< ?php TopHitsList(); ?>一般放到sidebar.php 3. Visits up to the article <? Php TopHitsList ();?> General put sidebar.php
默认是五篇,要想显示成10篇修改CountPosts.php文件里的TopHitsList函数 The default is five, in order to appear as 10 to amend the document CountPosts.php TopHitsList function
$top = 5 改成$top = 10 $ top = 5 into $ top = 10

问题描述: Description of the problem:

这个插件在启用的时候会在wp-posts表中建立一个新的字段post_hits,所以系统会提示下面这样的错误信息: This plug-in the opening of the time in wp-posts in the table to establish a new field post_hits, so this will be prompted to the following error message:

WordPress 数据库错误: [Unknown column ‘post_hits' in ‘field list'] WordPress database error: [Unknown column 'post_hits' in' field list ']
SELECT post_hits FROM wp_posts SELECT post_hits FROM wp_posts

可以不用在乎这个提示,关键的是插件提供的显示点击排行的函数中有一点小问题,就是它会将wp-posts表中所有的记录显示出来,甚至包括草稿和附件,所以在这里需要修改这个函数,请做如下的修改。 This can not depend on tips, the key is the plug-in the ranks of the show click function in a small problem is that it will wp-posts in the table all the records show, and even including the annex to the draft and, so here need to be amended This function, please make the following changes.
找到TopHitsList函数定义的地方,在函数体中找到下面的代码: TopHitsList find the definition of function, function in the body found in the code below:

$SQL = "SELECT ID, post_title, post_hits,  guid FROM " . $table_prefix . $ SQL = "SELECT ID, post_title, post_hits, guid FROM". $ Table_prefix.
"posts ORDER BY post_hits DESC LIMIT 0, " . $top; "posts ORDER BY post_hits DESC LIMIT 0,". $ top;

将上面的代码修改如下: The above code will be amended to read as follows:

$SQL = "SELECT ID, post_title, post_hits,  guid FROM " . $table_prefix . $ SQL = "SELECT ID, post_title, post_hits, guid FROM". $ Table_prefix.
"posts WHERE post_type='post' AND post_status='publish' ORDER BY post_hits DESC LIMIT 0, " . $top; "posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_hits DESC LIMIT 0,". $ top;

本站提供的下载已解决这个问题。 Powered provides the download to solve this problem.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet) (No Ratings Yet)
Loading ... Loading ... Loading ...
-欢迎为本文评级 -- Welcome to this paper rating

相关日志 Related Log

本文读者也关心以下内容: In this paper, readers also concerned about the following:

  • N/A N / A

01月3rd, 2008 01月3 rd, 2008 作者: eric | WordPress | Trackback ? | 无评论 | Author: eric | WordPress | Trackback? | No comment | Email This Post Print This Post | 61 views | 61 views

Add a Comment Add a Comment

Leave a reply Leave a reply

:mrgreen::|:twisted::arrow:8O:):?8):evil::D:idea::oops::P:roll:;):cry::o:lol::x:(:!::?:

  1. You will post the following soon. You will post the following soon.
    Go ahead and start typing. Go ahead and start typing.
No Comments Hide Post Comments No Comments Hide Post Comments