月度归档:2011年03月

WordPress Download Monitor插件使用详解

Download Monitor是管理文件下载的WordPress插件,可指定文件只允许登陆下载,具有下载统计功能,同时含有一个下载页面(可点击本站顶部导航栏的下载查看效果)。另外单条下载效果如下面的插件下载。

提出一个概念——短标签(官方文档上是short-tag),就是用类似于用[]括起来的部分(包括[])。WordPress Download Monitor插件支持的短标签为download_page、download、downloads3 个。短标签中可以包含一个或多个属性;属性由属性名和属性值两部分组成,中间用等于号=连接,属性值需要用半角双引号””括起来;属性与短标签名、属性与属性之间用空格隔开。比如短标签download id=”2″ format=”3″包括值为2的id属性和值为3的 format属性。具体属性值的意义如下:

在前台显示文章或页面内容时,WordPress Download Monitor插件会查找以上3个短标签,然后替换为相应的HTML进行显示。

使用download_page在页面里,该页面会被替换为下载页面

使用download会被替换为一条下载项

使用downloads会被替换为多条下载项

具体替换成的HTML内容(即显示的样子)由短标签可选的属性与值决定。下面会具体介绍。

使用介绍:

安装激活WordPress Download Monitor插件,略过。

1、插件配置

在后台管理菜单底部找到下载管理,在这里进行插件的配置、下载项的管理和下载日志的查看。

分类管理:添加、删除下载分类。需要先行设置。

自定义输出样式:单条下载项被替换成的HTML内容,其中每次下载输出HTML不同的部分用变量表示,类似于{url},具体可用的变量在后台设置界面上有提示。这里需要懂一点HTML知识,如果你还欠缺的话,赶紧去补习一下。添加新样式后会对应有一个ID,我们记为FormatID,因为后面会用到。需要先行设置。

自定义下载地址:设置下载链接的URL格式,如果不做设置的话,使用默认下载地址wp-content/plugins/wp- download_monitor/download.php?id=的格式。设置的话需要服务器支持URL重写,或自行通过404方法实现对永久链接的支持。可不做修改。

其他选项:自行看设置旁边的说明。可不做修改。

以上配置中分类和输出样式需要使用插件前做好设置,其他可保留不动。

2、添加下载项

【插件v3.3之前的版本】在下载管理里有两项功能:添加本地文件和添加已有文件。两者唯一的差别是是否上传下载文件。添加本地文件是在添加时选择本机电脑的文件并上传到服务器上(上传后文件位置是在配置的其他选项里设置的),而添加已有文件则是直接添加一个已经在网络上可访问的下载链接作为下载源。添加一个下载项时具体的填写的内容直接看添加界面的提示即可。【插件v3.3之后的版本】下载管理里添加新下载项(Add New),已将之前版本的添加本地文件和添加已有文件合并,用上传文件或者填入文件的地址来区分是上传本地文件还是使用已有文件。

自定义字段如果你不懂的话就别踩它,一般人估计也用不到。添加一个下载项后在下载管理->编辑界面可以看到下载项的ID,我们记为 DownloadID,后面会用到。

3、添加下载页面

下载页面类似本站顶部导航栏下载链接打开后的页面,罗列了所有下载项的页面。

添加方法是:在后台管理界面,添加一个新页面,标题和永久链接自定,内容最简洁的只需要输入download_page即可。在前台打开这个新添加的页面就变成下载页面了,因为短标签被替换成了下载页面。

当然,可以做一些自定义的设定,只需要为短标签download_page增加一些属性;如希望下载页面每个分类默认热门下载只显示5个,每个下载项使用输出样式FormatID为3,只要使用短标签

download_page pop_cat_count=”5″ format=”3″即可。具体可使用的属性看这里。

4、在文章中添加下载链接

在编辑文章界面,可以直接在文章编辑区需要插入下载链接的地方直接输入短标签,即一个向下的箭头符号,插入后会显示代码,例如:

download id=”1″(这里的id值就对应上面下载项添加后获得的DownloadID);或是切换到HTML源代码模式下在编辑工具栏里有一个下载管理下拉选框,直接选择一个即可,系统会为你在文章编辑区光标所在的地方插入类似[download id=”1″]的短标签,当然其中1会被替换为你选择的下载项对应的DownloadID。

为了让下载链接显示样式不同,可以为短标签添加format属性,类似download id=”2″ format=”2″,其中format对应上面配置自定义输出样式添加时获得的FormatID。指定format后,输出地下载链接会用对应的输出样式去显示。其他可使用的属性看这里。

通过此插件上传的文件位于网站目录 /wp-content/uploads/downloads/年/月/ 下。

更多文章:

WordPress Download Monitor插件标签使用

Philosophy of science(Essay 1)

Essay 1

 The philosophy of science course makes me think about the science itself dialectically, what science is, how to understand it and what the attitudes we should keep are to realize it.

The characteristics for genuine science come up with some philosophers are seen as demarcation criterion. The Karl Popper’s theory shows that the important difference between science and pseudoscience is based on the refutability or testability or falsifiability. It is unlike empirical work which is mainly gained form observation and experiment. The astrology is considered to be pseudoscience by Popper because it is not testable and refutable. But in Thomas S. Kuhn’s theory, he thought that the understanding of science should not only be the basement of objectivity, but also the attention to the subjectivity. His criterion for Astrology which he thought was not a science was that it was not to solve puzzles. It was more like practical arts [1]. The scientific research is to make hypothesis which should be on the basis of facts and previous theories, and try to make exception to falsify the hypothesis. And then make new hypothesis or abandon it. This is a procedure like trial and error.

According to Lakatos’s theory, the demarcation of science and pseudoscience has an important relationship with political and social issues. It’s hard to tell the demarcation and it’s more like the difference to distinguish the methods in researching scientific and non-scientific theories. Some theories, such as “all creatures die out”, are testable and refutable. If one of all the creatures is found to be never dead, the theory turns out to be wrong. But it is impossible to find the result because we can not predict the future. Such kind of theory we put forward is just based on a logic thought. Lakatos was to explore which research program was more proper instead of seeking whether an assumption was genuine.

The science is relative to social values which generates the objectivity of science. In Longino’s theory, the observation and statistics are often used as the evidence for the assumptions, but they are determined by human opinions. These called evidences are divided to support the different kinds of assumptions. And only those reasonable assumptions with supported evidence may be accepted by people and be viewed to be true. In Kuhm’s opinion, science progress via revolutions. This is also viewed as paradigm change. That is to say, science comes form the stages: prescience, normal science and puzzle-solving.

In the positivism, Carnap made a relationship between scientific and phenomenalistic terms using logical syntax. He also combined explanation with laws which can be used to predict new things and explain the existing things [1]. But to Hempel, when talking about idealized and everyday reasoning, he thought the explanations didn’t have to be made to every detailed thing. And phenomenon or facts can be added to those explanations which make them more persuadable.

In Lyotard’s theory, the ontology is switched to the validity of knowledge and the status of intellectuals to show his digestion of identity and integrity and Metadiscourse exile [2].

References:

 [1] Boman, Magnus. Philosophy of Science, course notes, KTH, 2010.

 [2] http://www.marxists.org/reference/subject/philosophy/works/fr/lyotard.htm