<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hpyer 的未知空间 &#187; 中文</title>
	<atom:link href="http://hpyer.cn/tag/%e4%b8%ad%e6%96%87/feed" rel="self" type="application/rss+xml" />
	<link>http://hpyer.cn</link>
	<description>现实的世界里寻找点滴的未知空间</description>
	<lastBuildDate>Thu, 02 Sep 2010 11:22:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>WordPress Download Monitor 中文帮助文档</title>
		<link>http://hpyer.cn/wordpress-download-monitor-documentation-zh-cn.html</link>
		<comments>http://hpyer.cn/wordpress-download-monitor-documentation-zh-cn.html#comments</comments>
		<pubDate>Wed, 03 Mar 2010 15:15:55 +0000</pubDate>
		<dc:creator>Hpyer</dc:creator>
				<category><![CDATA[WordPress 扩展]]></category>
		<category><![CDATA[Download Monitor]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[帮助]]></category>

		<guid isPermaLink="false">http://hpyer.cn/?p=710</guid>
		<description><![CDATA[　　非常感谢您的关注与支持，本页面目前仍在制作当中，将会在近期与大家见面。但由于本人的工作关系，进度可能不会很快。如果有任何问题，可以在此留言，我将尽力解答。当然，由于我并不是插件的制作者，并不一定能解决所有的问题，还请大家谅解，谢谢！ 　　本页面将会参照官网帮助文档进行汉化。【2010年3月7日更新】 下载地址:官方下载（英文） &#124; :本站下载（中文） 快速入门 后台管理 使用方法 常见问题 下 载 页 如何安装 到 wordpress.org 的插件页下载 Download Monitor，中文版请点击这里。 解压缩您下载到的 download-monitor.x.y.z.zip（其中的 x.y.z 为版本号）文件，并将其中的 download-monitor 文件夹上传到您服务器的插件目录（通常为：wp-content/plugins）下。 登录您的 WordPress 后台，转到插件页面，并激活（启用）本插件。一旦插件激活成功，程序会自动创建所需的数据表到数据库中。 如果您可以在 WordPress 后台看到 &#8216;下载管理&#8217;（英文版为：Downloads） 这一菜单的话，那么恭喜！您已经完成插件的安装。 配置您的 Download Monitor 下载分类 导航： 下载管理 &#62; 分类 您可以在该段落对分类进行管理。分类是可以嵌套的（树形）。从 3.3.3 版起，每个下载文件可以指定多个分类。输入名称并选择一个上级分类（如果您想进行嵌套的话）后点击“添加”按钮即可完成添加分类的操作。 注：每个分类都有一个唯一的 ID。当您在文章中显示分类的时候，此 ID 号将作为参考。 自定义输出样式 导航： 下载管理 &#62; 配置 &#62; 自定义输出样式 您可以在此定义下载链接所输出的样式。自定义样式应该是包含特殊“标签”的 [...]]]></description>
			<content:encoded><![CDATA[<p>　　非常感谢您的关注与支持，本页面目前仍在制作当中，将会在近期与大家见面。但由于本人的工作关系，进度可能不会很快。如果有任何问题，可以在此留言，我将尽力解答。当然，由于我并不是插件的制作者，并不一定能解决所有的问题，还请大家谅解，谢谢！<span id="more-710"></span></p>
<p>　　本页面将会参照<a href="http://blue-anvil.com/archives/wordpress-download-monitor-3-documentation" target="_blank">官网帮助文档</a>进行汉化。【2010年3月7日更新】</p>
<link rel="stylesheet" type="text/css" href="http://demo.hpyer.cn/js/tabs/tabs.css" /><script type="text/javascript" src="http://demo.hpyer.cn/js/jquery/jquery.pack.js"></script><script type="text/javascript" src="http://demo.hpyer.cn/js/jquery/jquery.ui.core-tabs.pack.js"></script>
<p>下载地址:<a href="http://wordpress.org/extend/plugins/download-monitor/" target="_blank">官方下载（英文）</a> | :<a href="http://hpyer.cn/wordpress-plugin-download-monitor.html" target="_blank">本站下载（中文）</a></p>
<div id="dm_tabs" class="tab_me">
<ul>
<li><a href="#fragment-1">快速入门</a></li>
<li><a href="#fragment-2">后台管理</a></li>
<li><a href="#fragment-3">使用方法</a></li>
<li><a href="#fragment-4">常见问题</a></li>
<li><a href="#fragment-5">下 载 页</a></li>
</ul>
<div id="fragment-1">
<h2>如何安装</h2>
<ol>
<li>到 wordpress.org 的插件页下载 <a href="http://wordpress.org/extend/plugins/download-monitor/" target="_blank">Download Monitor</a>，中文版请<a href="http://hpyer.cn/wordpress-plugin-download-monitor.html" target="_blank">点击这里</a>。</li>
<li>解压缩您下载到的 download-monitor.x.y.z.zip（其中的 x.y.z 为版本号）文件，并将其中的 <code>download-monitor</code> 文件夹上传到您服务器的插件目录（通常为：wp-content/plugins）下。</li>
<li>登录您的 WordPress 后台，转到插件页面，并激活（启用）本插件。一旦插件激活成功，程序会自动创建所需的数据表到数据库中。</li>
<li>如果您可以在 WordPress 后台看到 &#8216;下载管理&#8217;（英文版为：Downloads） 这一菜单的话，那么恭喜！您已经完成插件的安装。</li>
</ol>
<h2>配置您的 Download Monitor</h2>
<h3>下载分类</h3>
<p>导航：
<pre>下载管理 &gt; 分类</pre>
</p>
<p>您可以在该段落对分类进行管理。分类是可以嵌套的（树形）。从 3.3.3 版起，每个下载文件可以指定多个分类。输入名称并选择一个上级分类（如果您想进行嵌套的话）后点击“添加”按钮即可完成添加分类的操作。</p>
<p>注：每个分类都有一个唯一的 ID。当您在文章中显示分类的时候，此 ID 号将作为参考。</p>
<h3>自定义输出样式</h3>
<p>导航：
<pre>下载管理 &gt; 配置 &gt; 自定义输出样式</pre>
</p>
<p>您可以在此定义下载链接所输出的样式。自定义样式应该是包含特殊“标签”的 HTML 代码。您可以使用下列会被自动替换为相应下载信息的标签。</p>
<ul>
<li>
<pre>{url} &#8211; 下载文件的 URL 地址（仅仅地址而已）</pre>
</li>
<li>
<pre>{id} &#8211; 下载文件的 ID</pre>
</li>
<li>
<pre>{user} &#8211; 发布者的用户名</pre>
</li>
<li>
<pre>{version} &#8211; 下载文件的版本号</pre>
</li>
<li>
<pre>{version,&quot;before&quot;,&quot;after&quot;} &#8211; 下载文件的版本号。如果未设置则不输出。请将 before 和 after 分别替换为前后的修饰文本或 HTML 代码。</pre>
</li>
<li>
<pre>{title} &#8211; 下载文件的标题</pre>
</li>
<li>
<pre>{size} &#8211; 文件大小</pre>
</li>
<li>
<pre>{categories} &#8211; 输出以逗号分隔的分类列表。</pre>
</li>
<li>
<pre>{categories, &quot;<em>link</em>&quot;} &#8211; 输出以逗号分隔并包含您所设定了连接样式的分类列表。% 将被替换为分类的 ID，%2 将被替换为分类名。这一标签可以在 &#91;download_page&#93; 中使用。</pre>
</li>
<li>
<pre>{category,&quot;before&quot;,&quot;after&quot;} 或 {category} &#8211; 第一个分类。请将 before 和 after 分别替换为前后的修饰文本或 HTML 代码。</pre>
</li>
<li>
<pre>{category_other,&quot;before&quot;,&quot;after&quot;} 或 {category_other} &#8211; 第一个分类（如果未设置分类则返回“其他”）。请将 before 和 after 分别替换为前后的修饰文本或 HTML 代码。</pre>
</li>
<li>
<pre>{category_ID} &#8211; 第一个分类的 ID。</pre>
</li>
<li>
<pre>{hits} &#8211; 当前点击数</pre>
</li>
<li>
<pre>{hits,&quot;No hits&quot;,&quot;1 Hit&quot;,&quot;% hits&quot;} &#8211; 格式化输出点击数。% 将被替换为点击数的数字。</pre>
</li>
<li>
<pre>{image_url} &#8211; 下载文件的图片的 URL</pre>
</li>
<li>
<pre>{description,&quot;before&quot;,&quot;after&quot;} 或 {description} &#8211; 下载文件的描述信息。如果未设置则不输出。请将 before 和 after 分别替换为前后的修饰文本或 HTML 代码。</pre>
</li>
<li>
<pre>{description-autop,&quot;before&quot;,&quot;after&quot;} 或 {description-autop} &#8211; 自动在前后包含 &lt;p&gt; 和 &lt;/p&gt; 的描述信息（转换为空两行的段落）。</pre>
</li>
<li>
<pre>{date,&quot;Y-m-d&quot;} &#8211; 发布日期。第二个参数为需要输出的日期格式。</pre>
</li>
<li>
<pre>{tags} &#8211; 输出以逗号分隔的标签列表。</pre>
</li>
<li>
<pre>{tags, &quot;<em>link</em>&quot;} &#8211; 输出以逗号分隔并包含您所设定了连接样式的标签列表。% 将被替换为标签的 ID，%2 将被替换为标签名。</pre>
</li>
<li>
<pre>{thumbnail} &#8211; 输出缩略图的 URL 地址（或图像占位符）</pre>
</li>
<li>
<pre>{meta-<em>key</em>} &#8211; 自定义字段的值</pre>
</li>
<li>
<pre>{meta-autop-<em>key</em>} &#8211; 自动在前后包含 &lt;p&gt; 和 &lt;/p&gt; 的自定义字段的值。</pre>
</li>
<li>
<pre>{filetype} &#8211; 文件类型（如：zip）</pre>
</li>
<li>
<pre>{filetype_icon} &#8211; 文件类型的图标（16x16像素）</pre>
</li>
</ul>
<p>示例一：图片样式的下载链接。鼠标悬停在图片上方会显示下载次数</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Olive;">&lt;</span><span style="color: Green;">a</span><span style="color: Gray;"> </span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">{url}</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">title</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">已下载 {hits} 次</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">&gt;&lt;</span><span style="color: Green;">img</span><span style="color: Gray;"> </span><span style="color: #00008b;">src</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">{image_url}</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">alt</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">{title}</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Olive;">/&gt;&lt;/</span><span style="color: Green;">a</span><span style="color: Olive;">&gt;</span></div></div>
<p>示例二：文本方式的链接。鼠标悬停在链接上方会显示下载次数，而链接后则紧跟着该下载文件的描述信息</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Olive;">&lt;</span><span style="color: Green;">a</span><span style="color: Gray;"> </span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">{url}</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">title</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">已下载 {hits} 次</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Olive;">&gt;</span><span style="color: Gray;">{title}</span><span style="color: Olive;">&lt;/</span><span style="color: Green;">a</span><span style="color: Olive;">&gt;</span><span style="color: Gray;"> - {description}</span></div></div>
<p>对于分类、自定义样式的调用，都是通过其对应的 ID 进行的，而非名称。</p>
<p>使用自定义样式可以让您自由、灵活的选择自己喜欢的下载样式。例如：链接、列表项或者表格等等 &#8211; 一切皆由您喜欢！</p>
<h3>自定义下载地址</h3>
<p>导航：
<pre>下载管理 &gt; 配置 &gt; 自定义下载地址</pre>
</p>
<p>该选项允许您对文件的下载地址进行伪装，使其更为美观。默认情况下，下载地址为如下样式：</p>
<p>
<pre>http://yourdomain.com/wp-content/plugins/download-monitor/download.php?id=1</pre>
</p>
<p>请在文本框中输入一些字符来伪装链接的前半部分。例如输入
<pre>downloads/</pre>
<p> 并保存后，下载地址即可伪装为如下样式：</p>
<p>
<pre>http://yourdomain.com/downloads/1</pre>
</p>
<p>请在下拉框（默认为 ID）中选择链接的后半部分样式。例如选择 &#8216;文件名&#8217; 并保存后，下载地址即可伪装为如下样式：</p>
<p>
<pre>http://yourdomain.com/downloads/filename.zip</pre>
</p>
<p><em>重要说明</em>：请确保您所填写的字符（例如上文将到的 downloads）并不是一个真实存在于服务器上的文件夹，并且它也不能是任何文章/页面的别名，以保证文件可以被正常下载。</p>
<p>设置该选项后，您必须重新保存永久链接以使设置生效。</p>
<h3>常规选项</h3>
<p>导航：
<pre>下载管理 &gt; 配置 &gt; 常规选项</pre>
</p>
<ul>
<li><em>&#8220;未找到下载链接&#8221; 时跳转到 URL</em> &#8211; （可选）当用户请求的文件未找到时，页面将会自动跳转到您在此设置的 URL 地址。</li>
<li><em>当有用户点击了需要登录后才能下载的文件时，所跳转的页面:</em> &#8211; （可选）</li>
<li><em>下载图片的路径</em> &#8211; 当您需要使用 #image 标签或者样式中定义了 {image_url} 标签时，则需要设置该图片地址。</li>
<li><em>默认输出样式</em> &#8211; （可选）当未指定输出样式的情况下，默认的输出样式。</li>
</ul>
<h3>重建数据库</h3>
<p> <em>3.3.3 版起，该功能已被取消。</em><br />
<del>
<p>导航：
<pre>下载管理 &gt; 配置 &gt; 重建数据库</pre>
</p>
<p>如果您发现程序有问题（如无法添加新的下载文件等），则可能是数据库有错误。该功能可以重新创建数据库表格（使用前请先备份您的数据库）。</p>
<p></del></p>
<p><a href="#dm_tabs"><span class="ui-icon ui-icon-circle-arrow-n"> </span>Top</a></p>
</div>
<div id="fragment-2">
<h2>添加下载文件</h2>
<p>文件可以通过三种方式添加</p>
<ol>
<li>使用
<pre>下载管理 &gt; 添加文件</pre>
<p> 页面来上传并添加一个新文件。</li>
<li><del>使用
<pre>下载管理 &gt; 添加已有文件</pre>
<p> 页面来选择一个已经上传/远程主机上的文件。</del> <em>3.3.3 版起被合并到“添加文件”页面中</em></li>
<li>使用文章发布页的上传程序（参见下文：&#8216;使用文章发布页的上传程序&#8217;）</li>
<li>使用指定目录进行批量添加。 <em>3.3.3 版起新增</em></li>
</ol>
<p>“添加下载文件”的表格应该不需要多做解释了，不过我还是会用以小段文字解释“自定义字段”和“仅会员下载”。新上传的文件会被保存在 wp-content/uploads/downloads/xxxx/xx/ 文件夹中（类似图片的保存方式）。</p>
<p><strong>自定义字段</strong>允许您定义关于所添加文件的附加信息 &#8211; 只需要添加“名称”和“值”即可。您可以使用
<pre>{meta-<em>key</em>}</pre>
<p> 和
<pre>{meta-<em>autop-key</em>}</pre>
<p> 这两个自定义样式中的标签来调用字段的数据。它们有各种各样的用处，例如，如果我希望给每个文件包含一个缩略图，那么我可以添加一个名为“thumbnail-path”的自定义字段。然后，我就可以在自定义输出样式中这样使用：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Olive;">&lt;</span><span style="color: Green;">a</span><span style="color: Gray;"> </span><span style="color: #00008b;">href</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">{url}</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">title</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">已下载 {hits} 次</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">&gt;&lt;</span><span style="color: Green;">img</span><span style="color: Gray;"> </span><span style="color: #00008b;">src</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">{meta-thumbnail-path}</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">alt</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">缩略图</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Olive;">/&gt;</span><span style="color: Gray;"> {title}</span><span style="color: Olive;">&lt;/</span><span style="color: Green;">a</span><span style="color: Olive;">&gt;</span></div></div>
<p>每个下载文件可以添加多个自定义字段，只要你愿意。</p>
<p><strong>仅会员下载</strong>选项，当您勾选这项后，则只有在用户登录后才可以下载。如果用户尚未登录则会看到一个必须登录后才能下载的提示信息，或者页面将被自动转到您在后台设置的<em>当有访客点击了需要登录后才能下载的文件时，所跳转的页面</em>。</p>
<p>一个简单的方式是，您可以添加一个名为 <em>min-level</em> 的自定义字段来设置用户下载该文件所需的最小权限。</p>
<h3>查看、编辑、删除文件</h3>
<p>Download Monitor 的主管理页面中可以查看到所有的下载文件，并且每个下载都有对应的编辑和删除按钮。编辑的页面和添加新下载的页面完全一致。删除的同时也将会删除文件，不过前提是该文件是通过本插件的“添加新下载”的页面上传的。</p>
<h3>下载日志</h3>
<p>
<pre>下载管理 &gt; 下载日志</pre>
<p>页面中将会列出最近被下载的文件以及用户的 ID 和 IP 地址。这些数据不是用于统计的，所以如果您愿意，可以使用“清空日志”按钮安全的删除所有下载日志。</p>
<h3>下载统计</h3>
<p>在插件的主管理页面可以查看到下载次数，不过，如果你应该注意到 WordPress 的后台控制台的两个统计 Widget。一个用于显示最热门的五个下载，另一个则显示每周、每月的下载情况。</p>
<p>
<div id="attachment_531" class="wp-caption aligncenter" style="width: 310px"><a rel="lightbox" href="http://blue-anvil.com/wp-content/uploads/2009/04/widget-screenshot.png"><img class="size-medium wp-image-531" title="widget-screenshots" src="http://blue-anvil.com/wp-content/uploads/2009/04/widget-screenshot-300x232.png" alt="widget-screenshots" width="300" height="232" /></a>
<p class="wp-caption-text">widget-screenshots</p>
</div>
<h3>使用文章发布页的上传程序</h3>
<p>在 WordPress 的文章发布页面中，您会在编辑器上方的“添加媒体”图标旁边看到一个“向下的箭头” &#8211; 这个箭头可以让您即便在发布文章的时候也能很方便的使用 Download Monitor。</p>
<p>
<div id="attachment_534" class="wp-caption aligncenter" style="width: 66px"><img class="size-full wp-image-534" title="uploader-icon" src="http://blue-anvil.com/wp-content/uploads/2009/04/uploader-icon.png" alt="uploader-icon" width="56" height="57" />
<p class="wp-caption-text">uploader-icon</p>
</div>
<p>在这个界面中，您可以添加一个新文件（并且插入到文章中），或者通过“查看所有下载”按钮来查看到已经添加到 Download Monitor 的文件，找到您要的文件后，点击右边的“插入到文章”即可。</p>
<p><em>注</em>：您看到的插入一句类似
<pre>&#91;download id="1"&#93;</pre>
<p> 的代码是正常的，在用户查看文章的时候，其会被自动解析成对应的下载链接。</p>
<p><a href="#dm_tabs"><span class="ui-icon ui-icon-circle-arrow-n"> </span>Top</a></p>
</div>
<div id="fragment-3">
<h2>输出您的下载</h2>
<p>Download monitor 提供了很多方式来将下载输出到您的文章、页面或者模版。</p>
<h3>Shortcodes</h3>
<p>Shortcodes 是最好的包含下载的方式（以后将会代替传统的标签）。</p>
<h4>输出单个下载</h4>
<p>
<pre>&#91;download id="1" format="1" autop="false"&#93;</pre>
</p>
<p>该 shortcode 根据 format 所指定的自定义样式输出您选择的单个下载（通过设置 id 的值），以及一个可选的 autop 参数（true 或 false，默认 false 并且表示为不用 &lt;p&gt;&lt;/p&gt; 标签进行封装）。同样有效的使用方法：</p>
<p>
<pre>&#91;download id="1"&#93;</pre>
</p>
<p>
<pre>&#91;download id="2" format="2"&#93;</pre>
</p>
<h4>输出多个下载</h4>
<p>
<pre>&#91;downloads query="limit=5&amp;orderby=rand" format="1" wrap="ul" before="&amp;lt;li&amp;gt;" after="&amp;lt;/li&amp;gt;" autop="false"&#93;</pre>
</p>
<p>该 shortcode 将检索并输出多个下载到文章中。所有的参数都是可选的。</p>
<p>&#8216;query&#8217; 设置一个包含各种选项的查询字符串（请参阅下文对 get_downloads() 函数的说明，它们使用相同的查询字符串）。默认情况为检索随机的五个下载。通常会使用该 shortcode 来显示一个分类的下载。您可以添加
<pre>&amp;category=1</pre>
<p> （将 1 替换为要显示的分类的 ID）到查询字符串中。</p>
<p>&#8216;Format&#8217; 设置一个自定义输出样式的 ID 来改变每个下载的输出样式。</p>
<p>&#8216;Wrap&#8217; 默认情况下，所有下载将使用无序列表进行封装。如果您想使用其它方式（例如：表格）进行封装，可以将该选项设置为空白。</p>
<p>&#8216;Before&#8217; 和 &#8216;after&#8217; 为每个下载的封装代码（默认为列表项）。如果您要更改这两个参数的值，请确保您设置大代码都进行过编码，如：将 &lt; 替换为
<pre>&amp;lt;</pre>
<p>。</p>
<p>&#8216;autop&#8217; 可选值为 true 货 false，false 表示为不用 &lt;p&gt;&lt;/p&gt; 标签进行封装。</p>
<p>同样有效的使用方法：</p>
<p>
<pre>&#91;downloads&#93;</pre>
</p>
<p>
<pre>&#91;downloads query="limit=5&amp;orderby=hits"&#93;</pre>
</p>
<p>
<pre>&#91;downloads query="limit=5&amp;orderby=hits" format="2"&#93;</pre>
</p>
<p>
<pre>&#91;download query="limit=5&amp;orderby=hits" wrap="" before="&amp;lt;p&amp;gt;" after="&amp;lt;/p&amp;gt;"&#93;</pre>
</p>
<h4>显示一个特殊的下载页面</h4>
<p>使用 &#91;
<pre>download_page</pre>
<p>&#93; 这个 shortcode。请参阅“下载页”章节。</p>
<h4>在模版中解析 shortcode</h4>
<p>您知道还可以在文章意外的地方使用 shortcode 吗？只需要使用
<pre>do_shortcode()</pre>
<p> 函数执行您的 shortcode 即可。示例：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Blue;">do_shortcode</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">[download id=&quot;1&quot;]</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></div></div>
<h3>
<pre>get_downloads()</pre>
<p> 模版函数</h3>
<p>该函数将返回所有符合查询条件的下载。它只有一个包含查询字符串的参数。默认值如下：</p>
<p>
<pre>'limit' =&gt; '', 'offset' =&gt; 0, 'vip' =&gt; 0 'category' =&gt; '', 'orderby' =&gt; 'id', 'order' =&gt; 'ASC'</pre>
</p>
<p>和大多数 WordPress 的函数一样，请将上面提到的属性使用 &amp; 符号连接到一起来组成查询字符串。例如：
<pre>limit=5&amp;orderby=hits&amp;order=desc</pre>
</p>
<p>&#8216;
<pre>limit</pre>
<p>&#8216; 设置需要返回的记录数量，必须是整数。takes an integer and will return that many posts.</p>
<p>&#8216;
<pre>offset</pre>
<p>&#8216; 设置开始返回的记录的索引号，索引号必须为整数，且从 0 开始（也就是说，0 表示第一条记录，1 表示第二条记录，以此类推）。</p>
<p>&#8216;
<pre>vip</pre>
<p>&#8216; 可选值为：1 (true) 货 0 (false)。如果设置为 true，则只会显示用户有权访问的下载（非会员将无法看到仅会员才能下载的文件）。</p>
<p>&#8216;
<pre>category</pre>
<p>&#8216; 设置需要返回下载文件的分类 ID，多个 ID 请用<em>英文逗号</em>分隔。</p>
<p>&#8216;
<pre>orderby</pre>
<p>&#8216; 对所有下载进行排序。可选值：id, hits（下载次数）, title（标题）, date（日期）, filename（文件名）, 以及 random（随机）。最新添加：也可以使用 &#8216;meta&#8217;</p>
<p>&#8216;
<pre>meta_name</pre>
<p>&#8216; 当 orderby 设置为 meta 时，将根据这里设置的字段进行排序。只有设置了所指定字段的下载文件才会显示。</p>
<p>&#8216;
<pre>order</pre>
<p>&#8216; 可选值：&#8216;ASC&#8217; 为升序，&#8216;DESC&#8217; 为降序。</p>
<p>get_downloads() 返回一个数组，每个数组元素为包含下列属性的对象：</p>
<ul>
<li>size</li>
<li>url</li>
<li>title</li>
<li>version</li>
<li>hits</li>
<li>image</li>
<li>desc</li>
<li>category</li>
<li>category_id</li>
<li>id</li>
<li>date</li>
<li>memberonly</li>
</ul>
<p><em>使用方法</em>：（输出最热门下载的列表）</p>
<div class="hl-surround"><div class="hl-main"><span style="color: #00008b;">$dl</span><span style="color: Gray;"> = </span><span style="color: Blue;">get_downloads</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">limit=5&amp;orderby=hits&amp;order=desc</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Green;">if</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Gray;">!</span><span style="color: Green;">empty</span><span style="color: Olive;">(</span><span style="color: #00008b;">$dl</span><span style="color: Olive;">))</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">echo</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;ul class=&quot;downloadList&quot;&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">foreach</span><span style="color: Olive;">(</span><span style="color: #00008b;">$dl</span><span style="color: Gray;"> </span><span style="color: Green;">as</span><span style="color: Gray;"> </span><span style="color: #00008b;">$d</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #00008b;">$date</span><span style="color: Gray;"> = </span><span style="color: Blue;">date</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">jS M Y</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">, </span><span style="color: Blue;">strtotime</span><span style="color: Olive;">(</span><span style="color: #00008b;">$d</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">date</span><span style="color: Olive;">))</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">echo</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;li&gt;&lt;a href=&quot;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">.</span><span style="color: #00008b;">$d</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">url</span><span style="color: Gray;">.</span><span style="color: #8b0000;">'</span><span style="color: Red;">&quot; title=&quot;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">.</span><span style="color: Blue;">__</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">Version</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">wp-download_monitor</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: #8b0000;">'</span><span style="color: Red;"> </span><span style="color: #8b0000;">'</span><span style="color: Gray;">.</span><span style="color: #00008b;">$d</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">version</span><span style="color: Gray;">.</span><span style="color: #8b0000;">'</span><span style="color: Red;"> </span><span style="color: #8b0000;">'</span><span style="color: Gray;">.</span><span style="color: Blue;">__</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">downloaded</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">wp-download_monitor</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: #8b0000;">'</span><span style="color: Red;"> </span><span style="color: #8b0000;">'</span><span style="color: Gray;">.</span><span style="color: #00008b;">$d</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">hits</span><span style="color: Gray;">.</span><span style="color: #8b0000;">'</span><span style="color: Red;"> </span><span style="color: #8b0000;">'</span><span style="color: Gray;">.</span><span style="color: Blue;">__</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">times</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">wp-download_monitor</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: #8b0000;">'</span><span style="color: Red;">&quot; &gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">.</span><span style="color: #00008b;">$d</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">title</span><span style="color: Gray;">.</span><span style="color: #8b0000;">'</span><span style="color: Red;"> (</span><span style="color: #8b0000;">'</span><span style="color: Gray;">.</span><span style="color: #00008b;">$d</span><span style="color: Gray;">-&gt;</span><span style="color: Blue;">hits</span><span style="color: Gray;">.</span><span style="color: #8b0000;">'</span><span style="color: Red;">)&lt;/a&gt;&lt;/li&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Olive;">}</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">echo</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">&lt;/ul&gt;</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;<br /></span><span style="color: Olive;">}</span><span style="color: Gray;"></span></div></div>
<p><a href="#dm_tabs"><span class="ui-icon ui-icon-circle-arrow-n"> </span>Top</a></p>
</div>
<div id="fragment-4">
<h2>FAQ</h2>
<h3>My Downloads don&#8217;t work or the download page is not found/error 500&#8217;s, wtf?</h3>
<p>Several reasons can cause this. First things first &#8211; check the plugin folders permissions. The folder and files should be readable &#8211; especially download.php so check! Also, avoid setting to 777 at all costs. Second, resave permalink settings &#8211; this can often cause hiccups. Finally, check the path to the download is correct by editing it &#8211; try entering the url directly into the address bar. If its not found, you cannot blame the plugin!</p>
<h3>My hits are not showing up! Help?</h3>
<p>Admin hits are not counted, log out and try! Also ensure that if you have set the &#8216;custom url&#8217; option that the custom url does not actually match the physical location of the file.</p>
<h3>I have wordpress installed in a sub directory and my downloads don&#8217;t work</h3>
<p>Go to settings &gt; misc in wordpress admin and check the &#8216;Store uploads in this folder&#8217; setting is correct. Sometimes wordpress screws this up. You may also notice that normal uploads in wordpress (e.g. via the media panel) don&#8217;t work correctly either if this setting is wrong.</p>
<h3>I get an &#8216;error saving to database error&#8217;. What&#8217;s happening?</h3>
<p>The download tables may not exist. Use the option in Downloads &gt; configuration &gt; Recreate Download Database.</p>
<h3>My member only downloads are corrupted/don&#8217;t work, why?</h3>
<p>To hide the URL, member only downloads are forced by using PHP&#8217;s readfile function. If the download is hosted externally, or the server does not support it properly the download may be corrupted. To turn off forced downloading add the custom field &#8216;force&#8217; to the download and set it to &#8216;0&#8242;.</p>
<h3>I want my downloads to be parsed in a custom field using get_post_meta(), can I do this?</h3>
<p>WordPress does not have a filter I can hook into for this function, so to make this work wrap it in the relevant functions. For old style download links (&#91;Download id not defined&#93;) use
<pre>wp_dlm_parse_downloads()</pre>
<p> else use
<pre>do_shortcode()</pre>
<p>. For example:</p>
<p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">echo</span><span style="color: Gray;"> </span><span style="color: Blue;">do_shortcode</span><span style="color: Olive;">(</span><span style="color: Blue;">get_post_meta</span><span style="color: Olive;">(</span><span style="color: #00008b;">$post</span><span style="color: Gray;">-&amp;</span><span style="color: Blue;">amp</span><span style="color: Gray;">;</span><span style="color: Blue;">gt</span><span style="color: Gray;">;</span><span style="color: Blue;">ID</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">Download</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: Green;">true</span><span style="color: Olive;">))</span><span style="color: Gray;">;</span></div></div>
</p>
<h3>What happened to the old tags?</h3>
<p>They still exist &#8211; they are just no longer supported. See below.</p>
<p>The following (older) tags will work in your posts but are no longer supported (shortcodes are now preferred). These are mainly here for backward compatibility.</p>
<h4>Output a download with a custom format:</h4>
<p>Use the admin panel to define custom formats to output your links and then use
<pre>&#91;download#id#format=id&#93;</pre>
<p> or just
<pre>&#91;download#id&#93;</pre>
<p> if you set one as default.</p>
<h4>Other output functions:</h4>
<p>To show download links, use the following tags:</p>
<ol>
<li><strong>Link/hits</strong> &#8211;
<pre>&#91;download#id&#93;</pre>
</li>
<li><strong>Link w/o hits</strong> &#8211;
<pre>&#91;download#id#nohits&#93;</pre>
</li>
<li><strong>URL only</strong> &#8211;
<pre>&#91;download#id#url&#93;</pre>
</li>
<li><strong>Hits only </strong>-
<pre>&#91;download#id#hits&#93;</pre>
</li>
<li><strong>Link with image</strong> &#8211;
<pre>&#91;download#id#image&#93;</pre>
</li>
<li><strong>Link/hits/filesize</strong> &#8211;
<pre>&#91;download#id#size&#93;</pre>
</li>
<li><strong>Link/filesize</strong> &#8211;
<pre>&#91;download#id#size#nohits&#93;</pre>
</li>
</ol>
<p>There are a few other <strong>template tags</strong> to use in your wordpress templates. Replace &#8216;$no&#8217; with the amount of downloads to show.</p>
<ol>
<li>Most downloaded &#8211;
<pre>&lt;?php wp_dlm_show_downloads(1,$no); ?&gt;</pre>
</li>
<li>Most recent &#8211;
<pre>&lt;?php wp_dlm_show_downloads(2,$no); ?&gt;</pre>
</li>
<li>Random &#8211;
<pre>&lt;?php wp_dlm_show_downloads(3,$no); ?&gt;</pre>
</li>
</ol>
<h4>Show all downloads:</h4>
<p>Add the tag
<pre>&#91;#show_downloads&#93;</pre>
<p> to a page.</p>
<h4>Show downloads with category selector:</h4>
<p>Add the tag
<pre>&#91;#advanced_downloads&#93;</pre>
<p> to a page.</p>
<h4>Show downloads in a single category:</h4>
<p>Use
<pre>&#91;download_cat#id&#93;</pre>
<p> replacing id with the id of the category.</p>
<p><a href="#dm_tabs"><span class="ui-icon ui-icon-circle-arrow-n"> </span>Top</a></p>
</div>
<div id="fragment-5">
<h2>Download Page</h2>
<p>I gave in. I was going to release this as a paid add-on, but I&#8217;ve changed my mind because I trust you guys to make donations to ensure support continues for this plugin. So here we go; the download page addon (as seen on this site in the &#8216;Downloads&#8217; page) is now built into download monitor (version 3.1 +). The download page includes a sorting, pagination, and search function.</p>
<h3>Usage</h3>
<p>To create a download page, first create a wordpress page (or post) and insert the following shortcode:</p>
<p>
<pre>&#91;download_page&#93;</pre>
</p>
<p>Easy huh? But theres more. This shortcode has the following options:</p>
<ul>
<li>base_heading_level (integer) &#8211; Category headings on the page are this level. Defaults to 3 (h3)</li>
<li>pop_count (integer) &#8211; How many popular downloads to show.  Default is 4.</li>
<li>pop_cat_count (integer) &#8211; How many popular downloads to show per category. Default is 4.</li>
<li>show_uncategorized (integer) &#8211; Set to 1 (default) to show an uncategorized section, or 0 to hide it.</li>
<li>per_page (integer) &#8211; How many downloads to show per page. Default is 20.</li>
<li>format &#8211; ID of custom format to use.</li>
<li>exclude &#8211; Comma separated list of downloads to exclude from the listings.</li>
</ul>
<p>So for example, to show 5 popular downloads I&#8217;d use:</p>
<p>
<pre>&#91;download_page pop_count="5"&#93;</pre>
</p>
<p>Easy peasy.</p>
<h3>Customisation</h3>
<p>So you want to customise the look? You can probably do that with CSS, either in your themes CSS file or by customising the styles.css which came with the plugin &#8211; this is found in download-monitor/page-addon/styles.css.</p>
<p>If for any reason the output looks unstyled completely, your version of wordpress may not support the way I added the styles.css file, so just paste the css code from that into your themes css file.</p>
<h3>Configuring Download Data</h3>
<p>The download page add-on is smart and uses your downloads custom fields to show the information. It lets you show an unlimited amount of custom fields like this:</p>
<ol>
<li>You add custom fields to a download, for example, &#8216;licence&#8217; with value &#8216;Free (GNU General Public License)&#8217;.</li>
<li>You then add a custom field called &#8216;include_fields&#8217; and list the names of the fields to include on the download page separated by commas, e.g. tags,licence,wordpress-plugin-directory-page,documentation.</li>
</ol>
<p>There are a few reserved custom field names you can use too:</p>
<ul>
<li><strong>post_id </strong>= add an id of an associated post to the download &#8211; the read more link on the download page will link to this post.</li>
<li><strong>side_content</strong> = some content to show underneath the download link. On my site ive inserted some adsense code.</li>
<li><strong>thumbnail</strong> = path to an image for the download&#8217;s thumbnail. 112&#215;112 is ideal for this.</li>
<li><strong>hide_download_button</strong> = Won&#8217;t show the download button. I&#8217;ve done this for my paid icon set because they cannot be downloaded from the site.</li>
<li><strong>hide_hits </strong>= Hide hit count</li>
</ul>
<p>Finally, remember I did not have to release this add-on for free, so please consider making a donation to ensure I continue developing download monitor in the future.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" type="hidden" value="_s-xclick" />
<input name="hosted_button_id" type="hidden" value="9582380" />
<input alt="PayPal - The safer, easier way to pay online." name="submit" src="https://www.paypal.com/en_GB/i/btn/btn_donate_LG.gif" type="image" /> <img src="https://www.paypal.com/en_GB/i/scr/pixel.gif" border="0" alt="" width="1" height="1" /><br />
</form>
<p><a href="#dm_tabs"><span class="ui-icon ui-icon-circle-arrow-n"> </span>Top</a></p>
</div>
</div>
<p><script type="text/javascript">$("#dm_tabs > ul").tabs();</script></p>
]]></content:encoded>
			<wfw:commentRss>http://hpyer.cn/wordpress-download-monitor-documentation-zh-cn.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
