<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[刘新修]]></title> 
<link>http://pic1.liuxinxiu.com:80/index.php</link> 
<description><![CDATA[刘新修的个人博客 (Liuxinxiu'S Blog)]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[刘新修]]></copyright>
<item>
<link>http://pic1.liuxinxiu.com:80/s//</link>
<title><![CDATA[DEDE如何调用phpwind论坛指定的新帖 loop调用discuz大全]]></title> 
<author>刘新修 &lt;admin@yourname.com&gt;</author>
<category><![CDATA[H5/JS/CSS]]></category>
<pubDate>Thu, 02 Sep 2010 16:21:27 +0000</pubDate> 
<guid>http://pic1.liuxinxiu.com:80/s//</guid> 
<description>
<![CDATA[ 
	<div class="f14"><p>在DEDE中，这是调用论坛新帖的代码，那么如何实现调用如从第三开始到第十的帖子呢？在DEDE中有个limit&quot;3,10&quot;的条件项，在调用phpwind论坛要如何实现这个功能？？ <br /><br />&#123;dede:loop table='pw_threads' sort='tid' row='4' if='fid=10'&#125; <br />&lt;li&gt; &lt;a href=&quot;../read.php?tid=[field:tid/]&quot;&gt;[field:subject function=&quot;cn_substr('@me',28)&quot;/] <br />&lt;/a&gt; &lt;/li&gt;&#123;/dede:loop&#125;</p><p><span style="color: #ff0000"><font size="5">注意一点：要pw_threads换成你的数据库名称，且要在同一个数据库里面。</font></span></p><p>&#123;dede:loop table=&quot;pw_threads&quot; sort=&quot;tid&quot; row=&quot;17&quot;&#125;<br />&lt;li&gt;<br />&lt;a href='/Forum/read-Server-tid-[field:tid /].html' target=&quot;_blank&quot;&gt;<br />[field:subject function=&quot;cn_substr('@me',30)&quot; /]([field:lastpost function=&quot;date('m-d','@me')&quot; /])<br />&lt;/a&gt;&lt;/li&gt;<br />&#123;/dede:loop&#125;</p><p>&nbsp;</p><p>[5.3版] 用Loop解决首页调用自定义字段！</p><div class="c">&nbsp;</div><div class="tpc_content"><p>&#123;dede:loop table=&quot;自定义字段所在的表名&quot; sort='aid' row=&quot;显示的条数&quot; if=&quot;typeid =栏目ID&quot;&#125;<br />[field:自定义的字段名 /]<br />&#123;/dede:loop&#125;<br /><br />参考代码：<br />&#123;dede:loop table=&quot;dede_addonarticle&quot; sort='aid' row=&quot;10&quot; if=&quot;typeid =1&quot;&#125;<br />[field:zdy /]<br />&#123;/dede:loop&#125;<br /><br />比较简单的方法，个人认为比SQL好用。</p><p>&nbsp;</p><div class="f14">把&lt;a href='/phpwind/read.php?tid=[field:tid /]'&gt; 里面的phpwind改成你的论坛目录<br />然后把<br />&#123;dede:loop table=&quot;pw_threads&quot; sort=&quot;tid&quot; row=&quot;10&quot;&#125;<br />&lt;a href='/phpwind/read.php?tid=[field:tid /]'&gt;<br />&middot;[field:subject function=&quot;cn_substr('@me',30)&quot; /]([field:lastpost function=&quot;date('m-d H:M','@me')&quot; /])<br />&lt;/a&gt;<br />&lt;br/&gt;<br />&#123;/dede:loop&#125;<br />这段加入到你的模板里就可以了。</div><p>&nbsp;</p><p>&nbsp;</p><p><font size="5"><strong>loop调用discuz大全</strong></font></p><div class="c">&nbsp;</div><div class="tips black" style="width: auto">&nbsp;</div><div class="c">&nbsp;</div><div class="tpc_content"><p>我想在首页调用特定栏目的精华帖，但是JS太慢，想生成HTML。<br /><br /><br />我现在是这样调最新帖的，请问怎么调某个板块的精华帖？<br /><br />论坛最新主题：&lt;br/&gt;<br />&#123;dede:loop table=&quot;cdb_threads&quot; sort=&quot;tid&quot; row=&quot;10&quot;&#125;<br />&lt;a href=&quot;/dz/viewthread.php?tid=[field:tid /]&quot;&gt;<br />&middot;[field:subject function=&quot;cn_substr('@me',30)&quot; /]([field:lastpost function=&quot;date('m-d H:M','@me')&quot; /])<br />&lt;/a&gt;<br />&lt;br/&gt;<br />&#123;/dede:loop&#125;<br /><br /><br /><br />刚刚试了下，这样可以调特定板块的主题，现在就想问，怎么调精华主题？<br /><br />论坛最新主题：&lt;br/&gt;<br />&#123;dede:loop table=&quot;cdb_threads&quot; if=&quot;fid=5 and displayorder!=-1&quot; sort=&quot;tid&quot; row=&quot;10&quot;&#125;<br />&lt;a href=&quot;/dz/viewthread.php?tid=[field:tid /]&quot;&gt;<br />&middot;[field:subject function=&quot;cn_substr('@me',30)&quot; /]([field:lastpost function=&quot;date('m-d H:M','@me')&quot; /])<br />&lt;/a&gt;<br />&lt;br/&gt;<br />&#123;/dede:loop&#125;<br /><br /><br />再次发现，这样可以显示精华帖。<br /><br />论坛最新主题：&lt;br/&gt;<br />&#123;dede:loop table=&quot;cdb_threads&quot; if=&quot;fid=5 AND digest&gt;0 and displayorder!=-1 &quot; sort=&quot;tid&quot; row=&quot;10&quot;&#125;<br />&lt;a href=&quot;/dz/viewthread.php?tid=[field:tid /]&quot;&gt;<br />&middot;[field:subject function=&quot;cn_substr('@me',30)&quot; /]([field:lastpost function=&quot;date('m-d H:M','@me')&quot; /])<br />&lt;/a&gt;<br />&lt;br/&gt;<br />&#123;/dede:loop&#125;<br /><br /><br /><br />这样又可以按查看次数排序：<br />论坛最新主题：&lt;br/&gt;<br />&#123;dede:loop table=&quot;cdb_threads&quot; if=&quot;fid=5 and displayorder!=-1&quot; sort=&quot;views&quot; row=&quot;10&quot;&#125;<br />&lt;a href=&quot;/dz/viewthread.php?tid=[field:tid /]&quot;&gt;<br />&middot;[field:subject function=&quot;cn_substr('@me',30)&quot; /]([field:lastpost function=&quot;date('m-d H:M','@me')&quot; /])<br />&lt;/a&gt;<br />&lt;br/&gt;<br />&#123;/dede:loop&#125;</p><p>&nbsp;</p><p>今天我告诉大家一些在织梦dedecms里面调用discuz论坛帖子的一些方法，这些方法都是好不容易从网上搜来的，这次一次奉献给大家啦。 <br />　　首先要注意的是下面的代码中都有table=&quot;cdb_threads&quot;这句。这句不是适用所有网站的，这个地方cbd是你论坛的表前缀名称，大家根据自己的论坛修改成合适的表前缀名。再者，我是把织梦和discuz 论坛放在一个数据库里面的，才开始放在两个数据库，整合了半天不成功，不知道是什么原因。后面放在一个数据库里面成功了。但是没有在放到两个数据库里面做测试，大家也可以测试下，告诉我结果了。按道理来说不限制放进同一个数据库才合理些!最后m-d H:M 带表是发布的时间，如果只要(日-月)时间格式的，把 H:M去掉即可。</p><p>　　1、论坛最新主题调用代码如下：</p><p>&#123;dede:loop table=&quot;cdb_threads&quot; sort=&quot;tid&quot; row=&quot;10&quot;&#125;<br />&lt;a href=&quot;/bbs/viewthread.php?tid=[field:tid /]&quot;&gt;<br />&middot;[field:subject function=&quot;cn_substr('@me',30)&quot; /]([field:lastpost function=&quot;date('m-d H:M','@me')&quot; /])&lt;/a&gt;<br />&lt;br/&gt;<br />&#123;/dede:loop&#125;</p><p>这个连接地址你可以写相对路径，也可以写绝对路径。</p><p>　　如果是discuz动态论坛，链接地址如http://bbs.xxx.com/viewthread.php?tid=[field:tid /]</p><p>　　如果是discuz静态论坛，连接地址如http://bbs.xxx.com/thread-[field:tid /]-1-1.html</p><p>2、论坛指定版块帖子调用方法：</p><p>&#123; dede:loop table=&quot;cdb_threads&quot; if=&quot;fid=1 or fid=2 and displayorder!=-1&quot; sort=&quot;tid&quot; row=&quot;6&quot; &#125; <br />&lt;a href=&quot;/bbs/viewthread dot php?tid=[field:tid /]&quot; target=&quot;_blank&quot;&gt; <br />&middot;[field:subject function=&quot;cn_substr(' @ me',50)&quot; /] &lt;/a&gt; <br />&lt;br/&gt; <br />&#123; /dede:loop &#125;</p><p>其中的fid=1 or fid=2是论坛主题分类id，可以按照自己要求来修改，如果是一个分类就直接写fid=x</p><p>3、论坛调精华主题调用代码如下：</p><p>&#123;dede:loop table=&quot;cdb_threads&quot; if=&quot;displayorder!=-1&quot; sort=&quot;tid&quot; row=&quot;10&quot;&#125;<br />&lt;a href=&quot;/bbs/viewthread.php?tid=[field:tid /]&quot;&gt;<br />&middot;[field:subject function=&quot;cn_substr('@me',30)&quot; /]([field:lastpost function=&quot;date('m-d H:M','@me')&quot; /])&lt;/a&gt;<br />&lt;br/&gt;<br />&#123;/dede:loop&#125;</p><p>如果想调用某个板块的精华主题代码如下：</p><p>&#123;dede:loop table=&quot;cdb_threads&quot; if=&quot;fid=5 and displayorder!=-1&quot; sort=&quot;tid&quot; row=&quot;10&quot;&#125;<br />&lt;a href=&quot;/bbs/viewthread.php?tid=[field:tid /]&quot;&gt;<br />&middot;[field:subject function=&quot;cn_substr('@me',30)&quot; /]([field:lastpost function=&quot;date('m-d H:M','@me')&quot; /])&lt;/a&gt;<br />&lt;br/&gt;<br />&#123;/dede:loop&#125;</p><p>其中的fid=5是论坛主题分类id，可以按照自己要求来修改，</p><p>　　如果想调用论坛所有的板块的最新精华主题只要去掉fid=5 and 就可以了。</p><p>　　4、调用的帖子列表这可以按查看次数排序，代码如下：</p><p>&#123;dede:loop table=&quot;cdb_threads&quot; sort=&quot;views&quot; row=&quot;10&quot;&#125;<br />&lt;a href=&quot;/dz/viewthread.php?tid=[field:tid /]&quot;&gt;<br />&middot;[field:subject function=&quot;cn_substr('@me',30)&quot; /]([field:lastpost function=&quot;date('m-d H:M','@me')&quot; /])&lt;/a&gt;<br />&lt;br/&gt;<br />&#123;/dede:loop&#125;<br />其中sort=&quot;views&quot; 就是控制按照查看次数排序的代码</p><p>5、论坛置顶版块帖子调用方法举例：</p><p>&#123; dede:loop table=&quot;cdb_threads&quot; sort=&quot;dateline&quot; if=&quot;fid='3' and typeid='51'&quot; row=&quot;10&quot; &#125; <br />&lt;a href=&quot;/a/bbs/viewthread dot php?tid=[field:tid /]&quot; target=&quot;_blank&quot;&gt; <br />&middot;[field:subject function=&quot;cn_substr(' @ me',30)&quot; /]&lt;/a&gt; &lt;br&gt; <br />&#123; /dede:loop &#125;</p><p>6、论坛版块名称调用方法：</p><p>&#123; dede:loop table=&quot;cdb_forums&quot; sort=&quot;displayorder&quot; row=&quot;16&quot; col=&quot;4&quot; &#125; <br />&lt;a href=&quot;/bbs/viewthread dot php?fid=[field:fid /]&quot;&gt;&middot;[field:name function=&quot;cn_substr(' @me',30)&quot; /] &lt;/a&gt; <br />&#123; /dede:loop &#125;</p><p>注：这种方法这个还有点问题，它会将论坛分区、版块都调出来。望达人改进!</p><p>附：dedecms的LOOP 标记规则</p><p>　　功能说明：用于调用任意表的数据，一般用于调用论坛贴子之类的操作</p><p>　　适用范围：所有模板</p><p>　　基本语法:</p><p>　　&#123; dede:loop table=' sort='' row='' if='' &#125;</p><p>　　[1] table 表示查询的数据表</p><p>　　[2] sort 用于排序的字段 也可以加&quot;views&quot;(查看次数排列)</p><p>　　[3] row 返回结果的条数</p><p>　　[4] if 查询条件</p><p>7、调用论坛帖子中的图片方法，网上搜到的，我自己还没有做测试。</p><p>&#123;dede:sql sql=&quot;SELECT`cdb_attachments`.`aid`,`cdb_attachments`.`attachment`,`cdb_threads`.`tid`, `cdb_threads`.`fid`,`cdb_threads`.`subject` FROM `cdb_attachments` LEFT JOIN `cdb_threads`</p><p>ON`cdb_threads`.`tid`=`cdb_attachments`.`tid` WHERE `cdb_attachments`.`readperm`='0' AND`displayorder`&gt;='0' AND `filetype`='image/pjpeg' GROUP BY tid LIMIT 0,1 &quot;&#125; <br />&lt;a href=&quot;/bbs/viewthread.php?tid=[field:tid /]&quot;&gt; <br />&lt;img src=&quot;/bbs/attachments/[field:attachment/]&quot; ALT=&quot;[field:subject/]&quot; width=&quot;100&quot; height=&quot;80&quot; border=&quot;0&quot; /&gt; <br />&lt;/A&gt; <br />&#123;/dede:sql&#125;</p></div></div></div><div>&nbsp;</div><p>&nbsp;</p><br/>Tags - <a href="http://pic1.liuxinxiu.com:80/tags/phpwind/" rel="tag">phpwind</a>
]]>
</description>
</item><item>
<link>http://pic1.liuxinxiu.com:80/s//#blogcomment</link>
<title><![CDATA[[评论] DEDE如何调用phpwind论坛指定的新帖 loop调用discuz大全]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://pic1.liuxinxiu.com:80/s//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>