<?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>trylife &#187; 帝国CMS</title>
	<atom:link href="http://www.trylife.cn/tag/%e5%b8%9d%e5%9b%bdcms/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trylife.cn</link>
	<description>life&#039;s short , try more...</description>
	<lastBuildDate>Sun, 05 Feb 2012 23:33:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>帝国CMS ping 插件 [未完]</title>
		<link>http://www.trylife.cn/ecms-ping-plugin/</link>
		<comments>http://www.trylife.cn/ecms-ping-plugin/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 21:41:03 +0000</pubDate>
		<dc:creator>TryLife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[帝国CMS]]></category>
		<category><![CDATA[帝国CMS二次开发]]></category>
		<category><![CDATA[帝国CMS SEO插件]]></category>
		<category><![CDATA[帝国CMS插件]]></category>

		<guid isPermaLink="false">http://www.trylife.cn/?p=906</guid>
		<description><![CDATA[帝国CMS ping 插件]]></description>
			<content:encoded><![CDATA[<h3>一 什么是PING服务</h3>
<p>过程上简单的讲就是没发布一个新文章，都会通知搜索引擎(google baidu等等)，搜索引擎会很快派来蜘蛛抓取你的新文章，这样会提高收录的速度（特殊网站除外）;<span style="color: #ff0000;">都是针对博客的，不知道收录方面对其他CMS有什么效果；</span></p>
<p><strong>以上是trylife个人的解释，下面是COPY百度的：</strong>ping是基于XML_RPC标准协议的更新通告服务，是用于blog在内容更新时通知百度blogsearch及时进行抓取、更新的方式。百度 blogsearch在成功接受到ping以后，会立刻进行抓取并更新。使用ping服务，可以让百度blogsearch在第一时间抓取到您博客上的新 内容。</p>
<p><strong>下面是COPY google的：</strong>通过 Google“博客搜索”Ping API, 用户可以程序化的方式将博客内容的更新通知给 Google“博客搜索”引擎。这对于经常更新博客内容的用户尤其有用。博客服务提供商的管理人员也可以利用此API将其平台上的博客内容变化向 Google 通告，以便 Google“博客搜索”及时抓取来自这一服务提供商的最新内容。为设置对 Google“博客搜索”的自动 Ping 机制，请按照如下所述设置XML-RPC客户端或REST客户端以发送请求。您可以任选一种方法进行通知；两者都将按照相同的方式进行处理。</p>
<h3>二 帝国CMS PING插件功能需求</h3>
<p>1.是否开启<br />
2.PING服务地址列表<br />
3.功能支持栏目<br />
4.动作选项：后台录入 前台投稿 采集更新 采集器更新<br />
5.针对采集器的设置(针对其他操作增加PING功能)</p>
<h3>三 帝国CMS PING插件实现思路</h3>
<p>功能的实现思路很简单，通过在（后台添加信息/会员投稿/采集入库）函数体内信息录入成功 和 返回代码前加入PING功能函数；注意：采集入库是循环录入只有所有需要入库内容循环完才有返回成功代码，所以帝国自带的采集入库是在循环录入代码中加入PING函数的；另外采集器是通过前台/后台重复投稿脚本来实现的，我们要在采集器的脚本中加入我们的PING函数；我们按着其他情况来对待。</p>
<p><strong>数据库:</strong><br />
数据库这里我们设置两个字段id,item每行记录一个功能的设置；主要针对增加PING功能的可拓展性选择这样的记录方式；固定操作动作可以使用行记录比如帝国CMS的phome_enewspublic(系统设置记录表)</p>
<p><strong>新建[文件/函数/目录]：</strong><br />
1.根据PING功能写函数 (PING函数 缓存更新函数 插件设置函数)<br />
2.函数定义在一个新文件里这样对于插件作者备份查看函数方便 比如：e/trylife/ping/function.php<br />
3.将2中的文件require到e/userfun.php (建议大家都这样做)<br />
4.其他文件 插件设置文件e/trylife/ping/index.php</p>
<p><strong>更改[函数]：</strong><br />
主要更改 后台/前台/采集 增加信息函数 在函数成功printerror()前加入我们的PING函数就可以；</p>
<p><strong>缓存文件：</strong><br />
1.设置缓存<br />
2.PING地址缓存</p>
<h3>四 帝国CMS PING插件 制作</h3>
<p>待续 <span style="color: #ff0000;">[最近忙，先写文章放到这，后面有时间去挖掘实现，再看看自己过段时间的想法是不是一样]</span></p>
<h3>五 帝国CMS PING插件 测试</h3>
<p>针对SEO和不同站点收录速度的测试不好做，测试主要针对一个已经被收站，PING后蜘蛛来的速度来评估；主要记录文章发布时间和蜘蛛来的时间；</p>
<h3>六 帝国CMS PING插件 讨论&amp;总结</h3>
]]></content:encoded>
			<wfw:commentRss>http://www.trylife.cn/ecms-ping-plugin/feed/</wfw:commentRss>
		<slash:comments>61</slash:comments>
		</item>
		<item>
		<title>帝国CMS发展预测 &#8211; 后台自定义的开始</title>
		<link>http://www.trylife.cn/ecms-custom-backgroubd-end/</link>
		<comments>http://www.trylife.cn/ecms-custom-backgroubd-end/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 17:12:08 +0000</pubDate>
		<dc:creator>TryLife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[帝国CMS]]></category>
		<category><![CDATA[帝国CMS二次开发]]></category>
		<category><![CDATA[帝国CMS预测]]></category>

		<guid isPermaLink="false">http://www.trylife.cn/?p=802</guid>
		<description><![CDATA[帝国CMS - 后台自定义的开始 帝国CMS二次开发]]></description>
			<content:encoded><![CDATA[<p>帝国CMS6.5增加了后台管理信息的自定义列表，这一功能的增加特别有利于模型的开发；在6.0及其以前为了后台管理列表根据自己的需要显示字段和功能都是在e/admin/ListNews.php修改源文件，内容增多后大大降低了后台管理信息的效率～；同时开始了后台信息自定义管理的一个方式；同时trylife推测，帝国CMS对后台功能自定义管理模式的小火苗已经然绕起来了，以后的版本中将可能会有更多的后台自定义管理模式；</p>
<p>同时帝国CMS6.5主打帝国CMS 安全 强大 灵活 中的 <strong>安全；</strong>接下来的版本可能会突出灵活这一特性，再次跟进和加固帝国CMS的能力；trylife推测改进会针对后台，及其前台动态页面范围内进行改进；trylife觉得接下来的版本帝国CMS粉丝们们所期望的集成AJAX/JUQERY无刷新功能应该不会集成进去，跟进的功能应该会更有利和方便于<strong>帝国CMS二次开发</strong>和有程序基础的人士；</p>
<p>更多分解请关注www.trylife.cn</p>
<p>本文来源转载请保留：<a title="帝国CMS二次开发" href="http://www.trylife.cn/ecms-custom-backgroubd-end/">http://www.trylife.cn/ecms-custom-backgroubd-end/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.trylife.cn/ecms-custom-backgroubd-end/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>帝国CMS二次开发工具与软件</title>
		<link>http://www.trylife.cn/ecms-repeatedly-development-tools-and-soft/</link>
		<comments>http://www.trylife.cn/ecms-repeatedly-development-tools-and-soft/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 01:34:45 +0000</pubDate>
		<dc:creator>TryLife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[帝国CMS二次开发]]></category>
		<category><![CDATA[帝国CMS]]></category>
		<category><![CDATA[帝国CMS二次开发参考手册]]></category>
		<category><![CDATA[帝国CMS二次开发工具]]></category>

		<guid isPermaLink="false">http://www.trylife.cn/?p=744</guid>
		<description><![CDATA[trylife认为下面的工具对你二次开发帝国CMS会是一个很好的协助 1.帝国CMS数据字典 在线浏览:http://dd.trylife.com.cn/ 下载：http://bbs.phome.net/showthread-34-135168-0.html 2.phpxref 下载地址：http://phpxref.sourceforge.net/ 3.deamweaver cs4 最好是dreamweaver CS5 CS4和CS5都能加载PHP require/include 所引用的文件，CS5相对增多了服务器环境，可以提示语法信息 4.一个经常更新的帝国CMS二次开发相关网站（帝国CMS二次开发手册暂时还没有） 比方我的博客：http://www.trylife.cn 我也是想通过经常在博客写帝国CMS二次开发文章，最后集结成手册! 以上工具相关使用方法我会在trylife博客最近的文章里叙述]]></description>
			<content:encoded><![CDATA[<p><strong>trylife认为下面的工具对你二次开发帝国CMS会是一个很好的协助</strong></p>
<p><strong>1.帝国CMS数据字典</strong></p>
<p>在线浏览:http://dd.trylife.com.cn/<br />
下载：http://bbs.phome.net/showthread-34-135168-0.html<br />
<strong>2.phpxref</strong></p>
<p>下载地址：http://phpxref.sourceforge.net/</p>
<p><strong>3.deamweaver cs4 最好是dreamweaver CS5</strong></p>
<p>CS4和CS5都能加载PHP require/include 所引用的文件，CS5相对增多了服务器环境，可以提示语法信息</p>
<p><strong>4.一个经常更新的帝国CMS二次开发相关网站（帝国CMS二次开发手册暂时还没有）</strong></p>
<p>比方我的博客：<a href="http://www.trylife.cn">http://www.trylife.cn</a> 我也是想通过经常在博客写帝国CMS二次开发文章，最后集结成手册!</p>
<p>以上工具相关使用方法我会在trylife博客最近的文章里叙述</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trylife.cn/ecms-repeatedly-development-tools-and-soft/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>帝国CMS模板 PHP错误类型调试技巧</title>
		<link>http://www.trylife.cn/debug-php-error-of-empirecms-template/</link>
		<comments>http://www.trylife.cn/debug-php-error-of-empirecms-template/#comments</comments>
		<pubDate>Sun, 30 May 2010 19:45:13 +0000</pubDate>
		<dc:creator>TryLife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[帝国CMS二次开发]]></category>
		<category><![CDATA[帝国CMS]]></category>
		<category><![CDATA[帝国CMS模板]]></category>

		<guid isPermaLink="false">http://www.trylife.cn/?p=727</guid>
		<description><![CDATA[自从帝国CMS模板支持程序代码之后，帝国CMS模板变得更加灵活，同样的程序代码灵动标签也有很大几率的造成错误,当然也有其标签语法引起的错误下面trylife的演示就是标签语法出错引起的！；但是很可惜的是错误所显示的行数和模板的行数是不对应的（模板变量和模板标签解析引起的，不过这是无法避免的），在模板原文件中查找起来比较麻烦；幸好帝国CMS的模板是临时生成缓存文件的，打开缓存文件对照模板源文件即可调试；说的比较迷糊，跟trylife一起看下面的图： 这个是帝国默认的首页模板，看行数是85行； 我将最后一个逗号改成了中文的逗号 注意：这里就是为了出个错，能看到下面的错误，为了演示调试的方法 提交后系统报错在123行 这样在原模板中是很难去找的； 我们按着报错提供的文件；\e\data\tmp\index.php 打开文件后跳转123行， 看到错误是一个中文的逗号引起的； 根据上限关系确定位置；（比如标志性的下载更新） 也可以也可以复制整个参数回到模板源文件搜，例如搜：&#8216;download&#8217;,4,26,0,18,9，0 另外提一下：e/data/tmp/是模板缓存目录 这里除了因生成HTML而临时生成的模板缓存外，还有动态页面的模板缓存]]></description>
			<content:encoded><![CDATA[<p>自从帝国CMS模板支持程序代码之后，帝国CMS模板变得更加灵活，同样的程序代码灵动标签也有很大几率的造成错误,当然也有其标签语法引起的错误下面trylife的演示就是标签语法出错引起的！；但是很可惜的是错误所显示的行数和模板的行数是不对应的（模板变量和模板标签解析引起的，不过这是无法避免的），在模板原文件中查找起来比较麻烦；幸好帝国CMS的模板是临时生成缓存文件的，打开缓存文件对照模板源文件即可调试；说的比较迷糊，跟trylife一起看下面的图：</p>
<p style="text-align: center;"><img class="size-full wp-image-728  aligncenter" title="帝国CMS模板调试" src="http://www.trylife.cn/wp-content/uploads/2010/05/empirecms-template-error.jpg" alt="" width="601" height="174" /><br />
<span style="color: #000080;">这个是帝国默认的首页模板，看行数是85行；<br />
我将最后一个逗号改成了中文的逗号</span></p>
<p style="text-align: center;"><span style="color: #ff0000;">注意：这里就是为了出个错，能看到下面的错误，为了演示调试的方法</span></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-729" title="empirecms-template-error2" src="http://www.trylife.cn/wp-content/uploads/2010/05/empirecms-template-error2.jpg" alt="" width="600" /><br />
<span style="color: #000080;">提交后系统报错在123行<br />
这样在原模板中是很难去找的；<br />
我们按着报错提供的文件；\e\data\tmp\index.php</span></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-730" title="empirecms-template-error3" src="http://www.trylife.cn/wp-content/uploads/2010/05/empirecms-template-error3.jpg" alt="" width="603" height="245" /><br />
<span style="color: #000080;">打开文件后跳转123行，<br />
看到错误是一个中文的逗号引起的；<br />
根据上限关系确定位置；（比如标志性的下载更新）<br />
也可以也可以复制整个参数回到模板源文件搜，例如搜：</span><span style="color: #003300;"><strong>&#8216;download&#8217;,4,26,0,18,9，0</strong> </span></p>
<p><span style="color: #ff0000;"><strong>另外提一下：e/data/tmp/是模板缓存目录 这里除了因生成HTML而临时生成的模板缓存外，还有动态页面的模板缓存</strong></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.trylife.cn/debug-php-error-of-empirecms-template/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>帝国CMS核心文件简要描述 e/class/</title>
		<link>http://www.trylife.cn/simple-description-empirecms-core-file/</link>
		<comments>http://www.trylife.cn/simple-description-empirecms-core-file/#comments</comments>
		<pubDate>Sun, 30 May 2010 07:47:59 +0000</pubDate>
		<dc:creator>TryLife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[帝国CMS二次开发]]></category>
		<category><![CDATA[帝国CMS]]></category>
		<category><![CDATA[帝国CMS二次开发文档]]></category>
		<category><![CDATA[帝国CMS文件]]></category>

		<guid isPermaLink="false">http://www.trylife.cn/?p=715</guid>
		<description><![CDATA[整理的比较粗，trylife认为大致了解下就可以；主要的文件db_sql.php config.php connect.php 一定要打开看看特别是db_sql.php，SQL类简化语法用来操作数据库会很舒服；其他文件可以在过程中慢慢熟悉常用的缓存文件也是必须要了解的 文件名 6.0 6.5 应用 adminfun.php √ √ 管理员登陆/登陆记录/操作记录等相关函数 CheckClassLevel.php √ √ 前台栏目权限文件，当设置栏目权限后此文件将会被引用到页面 CheckLevel.php √ √ 前台信息权限文件，当设置信息权限后此文件将会被引用到页面 chtmlfun.php √ √ 后台操作批量生成相关函数 例如：刷心所有内容页 cjfun.php √ √ 采集函数文件 class.smtp.php √ √ SMTP邮件类 classfun.php √ √ 栏目与专题操作函数 comdofun.php √ √ 反馈/留言/站内信息相关函数 com_functions.php √ √ 和comdofun,php差不多比较杂 自定义页面/权限/批量相关链接等 config.php √ √ 核心配置文件包括数据库信息/系统配置缓存/模型缓存 connect.php √ √ 核心文件包括数据库连接和各种常用/通用函数 copypath.php [...]]]></description>
			<content:encoded><![CDATA[<p><strong>整理的比较粗，trylife认为大致了解下就可以；主要的文件<span style="color: #003300;"><span style="color: #008000;">db_sql.php config.php connect.php</span> </span>一定要打开看看特别是<span style="color: #008000;">db_sql.php<span style="color: #000000;">，SQL类简化语法用来操作数据库会很舒服；其他文件可以在过程中慢慢熟悉</span></span><a href="http://www.trylife.cn/empirecms-cache-files/" target="_blank"><span style="color: blue;">常用的缓存文件也是必须要了解的</span></a></strong></p>
<table>
<thead>
<tr>
<th>文件名</th>
<th>6.0</th>
<th>6.5</th>
<th>应用</th>
</tr>
</thead>
<tbody>
<tr>
<td>adminfun.php</td>
<td>√</td>
<td>√</td>
<td>管理员登陆/登陆记录/操作记录等相关函数</td>
</tr>
<tr>
<td>CheckClassLevel.php</td>
<td>√</td>
<td>√</td>
<td>前台栏目权限文件，当设置栏目权限后此文件将会被引用到页面</td>
</tr>
<tr>
<td>CheckLevel.php</td>
<td>√</td>
<td>√</td>
<td>前台信息权限文件，当设置信息权限后此文件将会被引用到页面</td>
</tr>
<tr>
<td>chtmlfun.php</td>
<td>√</td>
<td>√</td>
<td>后台操作批量生成相关函数 例如：刷心所有内容页</td>
</tr>
<tr>
<td>cjfun.php</td>
<td>√</td>
<td>√</td>
<td>采集函数文件</td>
</tr>
<tr>
<td>class.smtp.php</td>
<td>√</td>
<td>√</td>
<td>SMTP邮件类</td>
</tr>
<tr>
<td>classfun.php</td>
<td>√</td>
<td>√</td>
<td>栏目与专题操作函数</td>
</tr>
<tr>
<td>comdofun.php</td>
<td>√</td>
<td>√</td>
<td>反馈/留言/站内信息相关函数</td>
</tr>
<tr>
<td>com_functions.php</td>
<td>√</td>
<td>√</td>
<td>和comdofun,php差不多比较杂 自定义页面/权限/批量相关链接等</td>
</tr>
<tr>
<td>config.php</td>
<td>√</td>
<td>√</td>
<td>核心配置文件包括数据库信息/系统配置缓存/模型缓存</td>
</tr>
<tr>
<td>connect.php</td>
<td>√</td>
<td>√</td>
<td>核心文件包括数据库连接和各种常用/通用函数</td>
</tr>
<tr>
<td>copypath.php</td>
<td>√</td>
<td>√</td>
<td>拷贝目录类</td>
</tr>
<tr>
<td>db_sql.php</td>
<td>√</td>
<td>√</td>
<td>SQL类</td>
</tr>
<tr>
<td>delpath.php</td>
<td>√</td>
<td>√</td>
<td>删除目录类</td>
</tr>
<tr>
<td>doiconv.php</td>
<td>√</td>
<td>√</td>
<td>字符集转换类</td>
</tr>
<tr>
<td>DownSysFun.php</td>
<td>√</td>
<td>√</td>
<td>下载模型函数文件</td>
</tr>
<tr>
<td>EmpireCMS_version.php</td>
<td>√</td>
<td>√</td>
<td>版本号记录文件</td>
</tr>
<tr>
<td>enpath.php</td>
<td>√</td>
<td>√</td>
<td>防盗链下载/在线观看地址加密文件</td>
</tr>
<tr>
<td>epinyin.php</td>
<td>√</td>
<td>√</td>
<td>汉字转拼音文件</td>
</tr>
<tr>
<td>filefun.php</td>
<td>√</td>
<td>√</td>
<td>文件操作函数</td>
</tr>
<tr>
<td>ftp.php</td>
<td>√</td>
<td>√</td>
<td>FTP类</td>
</tr>
<tr>
<td>functions.php</td>
<td>√</td>
<td>√</td>
<td>核心函数文件木有具体方面函数太多。。。</td>
</tr>
<tr>
<td>gd.php</td>
<td>√</td>
<td>√</td>
<td>图片处理函数</td>
</tr>
<tr>
<td>hinfofun.php</td>
<td>√</td>
<td>√</td>
<td>后台添加/修改函数</td>
</tr>
<tr>
<td>hplfun.php</td>
<td>√</td>
<td>√</td>
<td>评论相关函数</td>
</tr>
<tr>
<td>memberfun.php</td>
<td>√</td>
<td>√</td>
<td>后台-&gt;会员相关函数</td>
</tr>
<tr>
<td>moddofun.php</td>
<td>√</td>
<td>√</td>
<td>模型相关函数</td>
</tr>
<tr>
<td>phpzip.inc.php</td>
<td>√</td>
<td>√</td>
<td>ZIP类库</td>
</tr>
<tr>
<td>qinfofun.php</td>
<td>√</td>
<td>√</td>
<td>前台投稿函数库</td>
</tr>
<tr>
<td>qmemberfun.php</td>
<td>√</td>
<td>√</td>
<td>前台会员操作相关函数</td>
</tr>
<tr>
<td>q_functions.php</td>
<td>√</td>
<td>√</td>
<td>前台相关函 数站内信息、好友什么的</td>
</tr>
<tr>
<td>schallfun.php</td>
<td>√</td>
<td>√</td>
<td>全站搜索相关</td>
</tr>
<tr>
<td>SendEmail.inc.php</td>
<td>√</td>
<td>√</td>
<td>邮件发送类</td>
</tr>
<tr>
<td>ShopSysFun.php</td>
<td>√</td>
<td>√</td>
<td>商城系统函文件</td>
</tr>
<tr>
<td>tempfun.php</td>
<td>√</td>
<td>√</td>
<td>模板函数</td>
</tr>
<tr>
<td>t_functions.php</td>
<td>√</td>
<td>√</td>
<td>系统标签函数文件爱你</td>
</tr>
<tr>
<td>user.php</td>
<td>√</td>
<td>√</td>
<td>会员系统函文件</td>
</tr>
<tr>
<td>userfun.php</td>
<td>√</td>
<td>√</td>
<td>自定义函数文件</td>
</tr>
<tr>
<td>onclickfun.php</td>
<td>×</td>
<td>√</td>
<td>点击记录相关函数 主要为点击缓存增加的</td>
</tr>
</tbody>
</table>
<p><strong>转载留个出处：http://www.trylife.cn/simple-description-empirecms-core-file</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.trylife.cn/simple-description-empirecms-core-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>帝国CMS几个常用缓存文件</title>
		<link>http://www.trylife.cn/empirecms-cache-files/</link>
		<comments>http://www.trylife.cn/empirecms-cache-files/#comments</comments>
		<pubDate>Sat, 29 May 2010 01:35:16 +0000</pubDate>
		<dc:creator>TryLife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[帝国CMS二次开发]]></category>
		<category><![CDATA[帝国CMS]]></category>
		<category><![CDATA[帝国CMS缓存文件]]></category>

		<guid isPermaLink="false">http://www.trylife.cn/?p=670</guid>
		<description><![CDATA[1.e/class/config.php 这个文件除了记录数据库连接信息，还记录着网站参数缓存,模型缓存，COOKIE前缀，文件类型等 数组/变量 解释 后台对应操作位置 $public_r 网站参数缓存 后台-&#62;系统设置-&#62;参数设置 $emod_r 模型设置数据缓存 后台-&#62;管理数据表-&#62;管理模型-&#62;修改模型 2.e/data/dbcache/class.php 栏目及其专题缓存 文件同时引用了同目录下的class1.php class*.php ztclass.php 数组/变量 解释 后台对应操作位置 $class_r 栏目设置缓存 增加/修改任意栏目 或系统设置-&#62;数据更新-&#62;更新缓存 $class_zr 专题设置缓存 增加/修改任意专题 或系统设置-&#62;数据更新-&#62;更新缓存 3.e/data/dbcache/MemberLevel.php 会员组设置缓存文件 数组/变量 解释 后台对应操作位置 $level_r 会员组设置缓存 增加/修改任意会员组 或系统设置-&#62;数据更新-&#62;更新缓存 4.e/data/dbcache/notcj.php 防采集干扰代码，貌似这个不常用。 数组/变量 解释 后台对应操作位置 $notcj_r 管理防采集随机字符缓存 插件管理-&#62; 管理防采集随机字符 5.e/data/dbcache/SearchAllTb.php 全站搜索数据缓存 数组/变量 解释 后台对应操作位置 $schalltb_r 全站搜索数据缓存 插件管理-&#62; 管理防采集随机字符 转载给留个出处：http://www.trylife.cn]]></description>
			<content:encoded><![CDATA[<p><span style="color: #008000;"><strong>1.e/class/config.php </strong><br />
这个文件除了记录数据库连接信息，还记录着网站参数缓存,模型缓存，COOKIE前缀，文件类型等</span></p>
<table width="500">
<thead>
<tr>
<th>数组/变量</th>
<th>解释</th>
<th>后台对应操作位置</th>
</tr>
</thead>
<tbody>
<tr>
<td>$public_r</td>
<td>网站参数缓存</td>
<td>后台-&gt;系统设置-&gt;参数设置</td>
</tr>
<tr>
<td>$emod_r</td>
<td>模型设置数据缓存</td>
<td>后台-&gt;管理数据表-&gt;管理模型-&gt;修改模型</td>
</tr>
</tbody>
</table>
<p><span style="color: #008000;"><strong>2.e/data/dbcache/class.php </strong><br />
栏目及其专题缓存 文件同时引用了同目录下的class1.php class*.php ztclass.php</span></p>
<table width="500">
<thead>
<tr>
<th>数组/变量</th>
<th>解释</th>
<th>后台对应操作位置</th>
</tr>
</thead>
<tbody>
<tr>
<td>$class_r</td>
<td>栏目设置缓存</td>
<td>增加/修改任意栏目 或系统设置-&gt;数据更新-&gt;更新缓存</td>
</tr>
<tr>
<td>$class_zr</td>
<td>专题设置缓存</td>
<td>增加/修改任意专题 或系统设置-&gt;数据更新-&gt;更新缓存</td>
</tr>
</tbody>
</table>
<p><span style="color: #008000;"><strong>3.e/data/dbcache/MemberLevel.php </strong><br />
会员组设置缓存文件</span></p>
<table width="500">
<thead>
<tr>
<th>数组/变量</th>
<th>解释</th>
<th>后台对应操作位置</th>
</tr>
</thead>
<tbody>
<tr>
<td>$level_r</td>
<td>会员组设置缓存</td>
<td>增加/修改任意会员组 或系统设置-&gt;数据更新-&gt;更新缓存</td>
</tr>
</tbody>
</table>
<p><span style="color: #008000;"><strong>4.e/data/dbcache/notcj.php </strong><br />
防采集干扰代码，貌似这个不常用。</span></p>
<table width="500">
<thead>
<tr>
<th>数组/变量</th>
<th>解释</th>
<th>后台对应操作位置</th>
</tr>
</thead>
<tbody>
<tr>
<td>$notcj_r</td>
<td>管理防采集随机字符缓存</td>
<td>插件管理-&gt; 管理防采集随机字符</td>
</tr>
</tbody>
</table>
<p><span style="color: #008000;"><strong>5.e/data/dbcache/SearchAllTb.php </strong><br />
全站搜索数据缓存</span></p>
<table width="500">
<thead>
<tr>
<th>数组/变量</th>
<th>解释</th>
<th>后台对应操作位置</th>
</tr>
</thead>
<tbody>
<tr>
<td>$schalltb_r</td>
<td>全站搜索数据缓存</td>
<td>插件管理-&gt; 管理防采集随机字符</td>
</tr>
</tbody>
</table>
<p><strong><span style="color: #008000;">转载给留个出处：http://www.trylife.cn</span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.trylife.cn/empirecms-cache-files/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>DoTranFile() 帝国CMS文件上传函数</title>
		<link>http://www.trylife.cn/dotranfile-empirecms-functions/</link>
		<comments>http://www.trylife.cn/dotranfile-empirecms-functions/#comments</comments>
		<pubDate>Thu, 27 May 2010 15:41:05 +0000</pubDate>
		<dc:creator>TryLife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[帝国CMS二次开发]]></category>
		<category><![CDATA[帝国CMS]]></category>
		<category><![CDATA[帝国CMS函数]]></category>

		<guid isPermaLink="false">http://www.trylife.cn/?p=652</guid>
		<description><![CDATA[一、简要描述 $filer=DoTranFile($file,$file_name,$file_type,$file_size,$classid,$ecms=0); Ecms版本:6.0 参数： $file $file_name 文件名包括拓展名 例如：image.jpg $file_type 文件类型描述 例如：image/pjpeg $file_size 文件大小 单位KB $classid 栏目ID $ecms=0 可选 错误信息提示 遵循 e/class/connect.php function printerror() 函数定义位置：e/class/connect.php 返回值：成功返回数组 失败跳出程序又printerror()打印错误 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; 数组成员key 解释 filetype:文件类型 例如:.jpg insertfile:文件名无拓展名 例如：img filename:文件名包括拓展名 例如：img.jpg filepath:文件目录 例如：2010-05-27 savepath:文件硬盘目录 例如：D:\php\***\d/file/classfile/2010-05-27/ url:文件网站绝对目录 例如：/d/file/classfile/2010-05-27/name.jpg name: 缩略图（其实没有生成缩略图只是给了这个路径） D:\php\****\d/file/classfile/2010-05-27/small + name yname:D:\php\***\d/file/classfile/2010-05-27/name.jpg tran:1 filesize:文件大小 单位KB 二、函数源代码 //上传文件 function DoTranFile($file,$file_name,$file_type,$file_size,$classid,$ecms=0){ global [...]]]></description>
			<content:encoded><![CDATA[<h3>一、简要描述</h3>
<p><strong>$filer=DoTranFile($file,$file_name,$file_type,$file_size,$classid,$ecms=0);</strong><br />
Ecms版本:6.0</p>
<p>参数：<br />
$file<br />
$file_name 文件名包括拓展名 例如：image.jpg<br />
$file_type 文件类型描述 例如：image/pjpeg<br />
$file_size 文件大小 单位KB<br />
$classid 栏目ID<br />
$ecms=0 可选 错误信息提示 遵循 e/class/connect.php function printerror()<br />
函数定义位置：e/class/connect.php</p>
<p>返回值：成功返回数组 失败跳出程序又printerror()打印错误<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
数组成员key 解释<br />
filetype:文件类型 例如:.jpg<br />
insertfile:文件名无拓展名 例如：img<br />
filename:文件名包括拓展名 例如：img.jpg<br />
filepath:文件目录 例如：2010-05-27<br />
savepath:文件硬盘目录 例如：D:\php\***\d/file/classfile/2010-05-27/<br />
url:文件网站绝对目录 例如：/d/file/classfile/2010-05-27/name.jpg<br />
name: 缩略图（其实没有生成缩略图只是给了这个路径） D:\php\****\d/file/classfile/2010-05-27/small + name<br />
yname:D:\php\***\d/file/classfile/2010-05-27/name.jpg<br />
tran:1<br />
filesize:文件大小 单位KB</p>
<h3>二、函数源代码</h3>
<pre class="php">//上传文件
function DoTranFile($file,$file_name,$file_type,$file_size,$classid,$ecms=0){
	global $public_r,$class_r,$doetran;

	//文件类型
	$r[filetype]=GetFiletype($file_name);

	//文件名
	$r[insertfile]=ReturnDoTranFilename($file_name,$classid);
	$r[filename]=$r[insertfile].$r[filetype];

	//日期目录
	$r[filepath]=FormatFilePath($classid,$mynewspath,0);
	$filepath=$r[filepath]?$r[filepath].'/':$r[filepath];

	//存放目录
	$fspath=ReturnFileSavePath($classid);
	$r[savepath]=ECMS_PATH.$fspath['filepath'].$filepath;

	//附件地址
	$r[url]=$fspath['fileurl'].$filepath.$r[filename];

	//缩图文件
	$r[name]=$r[savepath]."small".$r[insertfile];

	//附件文件
	$r[yname]=$r[savepath].$r[filename];
	$r[tran]=1;

	//验证类型
	if(CheckSaveTranFiletype($r[filetype]))
	{
		if($doetran)
		{
			$r[tran]=0;
			return $r;
		}
		else
		{
			printerror('TranFail','',$ecms);
		}
	}

	//上传文件
	$cp=@move_uploaded_file($file,$r[yname]);
	if(empty($cp))
	{
		if($doetran)
		{
			$r[tran]=0;
			return $r;
		}
		else
		{
			printerror('TranFail','',$ecms);
		}
	}
	DoChmodFile($r[yname]);
	$r[filesize]=(int)$file_size;
	return $r;
}

//远程保存忽略地址
function CheckNotSaveUrl($url){
	global $public_r;
	if(empty($public_r['notsaveurl']))
	{
		return 0;
    }
	$r=explode("\r\n",$public_r['notsaveurl']);
	$count=count($r);
	$re=0;
	for($i=0;$i&lt;$count;$i++)
	{
		if(empty($r[$i]))
		{continue;}
		if(stristr($url,$r[$i]))
		{
			$re=1;
			break;
	    }
    }
	return $re;
}</pre>
<h3>三、函数注释</h3>
<pre class="php"><!--p
function DoTranFile($file,$file_name,$file_type,$file_size,$classid,$ecms=0){

	/*$public_r 全站设置缓存定义在e/class/config.php
	 *$class_r  栏目设置数组包括专题缓存生成在e/data/dbcache/class.php
	 *$doetran  是一个函数外部设置的变量,表示是否能转文件的意思，一般定义在表单处理的脚本中例如e/DoInfo/ecms.php
	 **/
	global $public_r,$class_r,$doetran;

	//文件类型
	//GetFiletype() 取得文件的拓展名 函数定义在e/class/connect.php
	$r[filetype]=GetFiletype($file_name);

	//文件名
	//这个文件名ReturnDoTranFilename 就是md5(unipid(mircotime()))两个参数在函数里没用到
	//ReturnDoTranFilename()定义在 e/class/connect.php
	//生成的文件名链接文件类型组合成带拓展名的文件名
	$r[insertfile]=ReturnDoTranFilename($file_name,$classid);
	$r[filename]=$r[insertfile].$r[filetype];

	//日期目录
	$r[filepath]=FormatFilePath($classid,$mynewspath,0);
	$filepath=$r[filepath]?$r[filepath].'/':$r[filepath];

	//存放目录
	//返回附件目录 ReturnFileSavePath()返回的是一个数组 定义在e/class/connect.php
	//ECMS_PATH是帝国在服务器中安装路径常量定义在e/class/connect.php头部
	$fspath=ReturnFileSavePath($classid);
	$r[savepath]=ECMS_PATH.$fspath['filepath'].$filepath;

	//附件地址
	$r[url]=$fspath['fileurl'].$filepath.$r[filename];

	//缩图文件
	//这个函数木有生成缩略图，只是作为一个数组成员返回
	$r[name]=$r[savepath]."small".$r[insertfile];

	//附件文件
	$r[yname]=$r[savepath].$r[filename];
	$r[tran]=1;

	//验证类型
	//CheckSaveTranFiletype() 返回布尔类型 e/class/connect.php
	//一些保留的文件类型比如.php,php3,php4返回true,其他返回false
	if(CheckSaveTranFiletype($r[filetype]))
	{
		//上边检验出有有保留文件类型则执行
		//$r[tran]=0;表示附件木有传到服务器
		//允许上传附件的情况，返回了数组，
		//主要tran这个成员值为0下面的程序就不用在把附件内容写到数据库里了
		if($doetran)
		{
			$r[tran]=0;
			return $r;
		}
		//不允许上传的情况直接返回错误 printerror 函数里有eixt自动不执行下面的程序
		else
		{
			printerror('TranFail','',$ecms);
		}
	}

	//上传文件
	//移动上传的文件
	$cp=@move_uploaded_file($file,$r[yname]);
	if(empty($cp))
	{
		if($doetran)
		{
			$r[tran]=0;
			return $r;
		}
		else
		{
			printerror('TranFail','',$ecms);
		}
	}
	//设置文件权限 DoChmodFile()定义在e/class/connect.php
	DoChmodFile($r[yname]);
	$r[filesize]=(int)$file_size;
	return $r;
}
--></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.trylife.cn/dotranfile-empirecms-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>帝国CMS二次开发 帝国CMS团购插件</title>
		<link>http://www.trylife.cn/empirecms-buy-in-group-exta/</link>
		<comments>http://www.trylife.cn/empirecms-buy-in-group-exta/#comments</comments>
		<pubDate>Wed, 26 May 2010 16:01:14 +0000</pubDate>
		<dc:creator>TryLife</dc:creator>
				<category><![CDATA[Website]]></category>
		<category><![CDATA[帝国CMS]]></category>
		<category><![CDATA[帝国CMS 团购插件]]></category>
		<category><![CDATA[帝国CMS二次开发]]></category>

		<guid isPermaLink="false">http://www.trylife.cn/?p=649</guid>
		<description><![CDATA[标题就是为了看，如果有人定制可以联系我博客右侧的QQ； 现在团购兴起，并且新闻看起来都抄的很热；一个以团购为核心的网站想快速出效果，大规模的广告肯定是必不可少；新闻媒体绝对是一种很有效的广告方式，抄的很热也很能理解！ 行业网站/行业资源团购方向会比较好，对于已经有行业站的朋友，新增团购项目拓展，压力比较小，站内有会员也不用其他站广告聚团购人气；主站挂个广告就可以了（主站已经有人气的情况下哦）；负担小压力小可以尝试下，形成行业团购模式之后，将会是地面方向一笔很好的收入！可以尝试下！]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-650  aligncenter" title="groupcn" src="http://www.trylife.cn/wp-content/uploads/2010/05/groupcn.jpg" alt="" width="320" height="256" /></p>
<p>标题就是为了看，如果有人定制可以联系我博客右侧的QQ；</p>
<p>现在团购兴起，并且新闻看起来都抄的很热；一个以团购为核心的网站想快速出效果，大规模的广告肯定是必不可少；新闻媒体绝对是一种很有效的广告方式，抄的很热也很能理解！</p>
<p>行业网站/行业资源团购方向会比较好，对于已经有行业站的朋友，新增团购项目拓展，压力比较小，站内有会员也不用其他站广告聚团购人气；主站挂个广告就可以了（主站已经有人气的情况下哦）；负担小压力小可以尝试下，形成行业团购模式之后，将会是地面方向一笔很好的收入！可以尝试下！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trylife.cn/empirecms-buy-in-group-exta/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>帝国CMS二次开发 商城服装批发 颜色尺码 手！</title>
		<link>http://www.trylife.cn/ecms-shop-color-size-handle/</link>
		<comments>http://www.trylife.cn/ecms-shop-color-size-handle/#comments</comments>
		<pubDate>Fri, 21 May 2010 12:10:13 +0000</pubDate>
		<dc:creator>TryLife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[帝国CMS]]></category>
		<category><![CDATA[帝国CMS 服装批发 手]]></category>
		<category><![CDATA[帝国CMS二次开发]]></category>
		<category><![CDATA[帝国CMS商城]]></category>
		<category><![CDATA[帝国CMS颜色尺寸]]></category>

		<guid isPermaLink="false">http://www.trylife.cn/?p=629</guid>
		<description><![CDATA[帝国CMS商城 颜色-尺码 手 :批量订单 帝国CMS商城 颜色-尺码 手 :单个加入购物车 帝国CMS商城 颜色-尺码 手 :单个加入购物车 帝国CMS商城 颜色-尺码 手 :购物车 帝国CMS商城 颜色-尺码 手 :购物车 帝国CMS商城 颜色-尺码 手 :购物车]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.trylife.cn/wp-content/uploads/2010/05/ecms-shop-shou1.jpg"><img class="aligncenter size-full wp-image-622" title="ecms-shop-shou1" src="http://www.trylife.cn/wp-content/uploads/2010/05/ecms-shop-shou1.jpg" alt="帝国CMS商城 颜色-尺码 手 :批量订单" width="600" /></a></p>
<p style="text-align: center;"><strong><span style="color: #008000;">帝国CMS商城 颜色-尺码 手 :批量订单</span></strong></p>
<p style="text-align: center;"><a href="http://www.trylife.cn/wp-content/uploads/2010/05/ecms-shop-shou1.jpg"><img class="aligncenter size-full wp-image-622" title="ecms-shop-shou1" src="http://www.trylife.cn/wp-content/uploads/2010/05/ecms-shop-shou2.jpg" alt="帝国CMS商城 颜色-尺码 手 :单个加入购物车" width="600" /></a></p>
<p style="text-align: center;"><strong><span style="color: #008000;">帝国CMS商城 颜色-尺码 手 :单个加入购物车</span></strong></p>
<p style="text-align: center;"><a href="http://www.trylife.cn/wp-content/uploads/2010/05/ecms-shop-shou1.jpg"><img class="aligncenter size-full wp-image-622" title="ecms-shop-shou1" src="http://www.trylife.cn/wp-content/uploads/2010/05/ecms-shop-shou3.jpg" alt="" width="600" /></a><br />
<span style="color: #008000;"><strong>帝国CMS商城 颜色-尺码 手 :单个加入购物车</strong></span></p>
<p style="text-align: center;"><a href="http://www.trylife.cn/wp-content/uploads/2010/05/ecms-shop-shou1.jpg"><img class="aligncenter size-full wp-image-622" title="ecms-shop-shou1" src="http://www.trylife.cn/wp-content/uploads/2010/05/ecms-shop-shou4.jpg" alt="帝国CMS商城 颜色-尺码 手 :购物车" width="600" /></a><br />
<span style="color: #008000;"><strong>帝国CMS商城 颜色-尺码 手 :购物车</strong></span></p>
<p style="text-align: center;"><a href="http://www.trylife.cn/wp-content/uploads/2010/05/ecms-shop-shou1.jpg"><img class="aligncenter size-full wp-image-622" title="ecms-shop-shou1" src="http://www.trylife.cn/wp-content/uploads/2010/05/ecms-shop-shou5.jpg" alt="帝国CMS商城 颜色-尺码 手 :购物车" width="600" /></a><br />
<strong><span style="color: #008000;">帝国CMS商城 颜色-尺码 手 :购物车</span></strong></p>
<p style="text-align: center;"><a href="http://www.trylife.cn/wp-content/uploads/2010/05/ecms-shop-shou1.jpg"><img class="aligncenter size-full wp-image-622" title="ecms-shop-shou1" src="http://www.trylife.cn/wp-content/uploads/2010/05/ecms-shop-shou6.jpg" alt="帝国CMS商城 颜色-尺码 手 :购物车" width="600" /></a><br />
<span style="color: #008000;"><strong>帝国CMS商城 颜色-尺码 手 :购物车</strong></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.trylife.cn/ecms-shop-color-size-handle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>帝国CMS二次开发 &#8211;  num() 与 num1()</title>
		<link>http://www.trylife.cn/ecms-repeatedly-development-num/</link>
		<comments>http://www.trylife.cn/ecms-repeatedly-development-num/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 03:29:18 +0000</pubDate>
		<dc:creator>TryLife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[ECMS二次开发]]></category>
		<category><![CDATA[num()]]></category>
		<category><![CDATA[num1()]]></category>
		<category><![CDATA[帝国CMS]]></category>
		<category><![CDATA[帝国CMS二次开发]]></category>

		<guid isPermaLink="false">http://www.trylife.cn/?p=544</guid>
		<description><![CDATA[一、话前唠叨 今天trylife接上两篇继续说帝国CMS SQL类中的对象num()与num1();上边两篇查阅下面两个连接： query()  与 query1() http://www.trylife.cn/ecms-repeatedly-development-with-db_sql-php/ fetch() 与 fetch1() http://www.trylife.cn/ecms-repeatedly-development-fetch/ 简述： 对象num()和num1()都执行的mysql_num_rows(),只是前者参数是SQL语句，后者是SQL语句执行结果；用于获得行数； 二、num()示例 三、num1()示例 四、讨论部分 1.为啥num()用的是SQL语句 num1()用的是SQL语句执行结果 同样的还是过来看源代码，e/class/db_sql.php;看到num()函数体中 $this->sql=$this->query($query);和fetch1一样的道理，先交给对象query()执行后，得到结果用于参数； function num($query) { $this->sql=$this->query($query); $this->num=mysql_num_rows($this->sql); return $this->num; } function num1($sql) { $this->num=mysql_num_rows($sql); return $this->num; } 2.用多了可能会想写$num[],其实返回的不是数组，而是整数(整型) var_dump()函数可以帮助我们检查数据类型，并且可以看到数据内容；]]></description>
			<content:encoded><![CDATA[<h4>一、话前唠叨</h4>
<p>今天trylife接上两篇继续说帝国CMS SQL类中的对象num()与num1();上边两篇查阅下面两个连接：</p>
<p>
<strong>query()  与 query1()</strong> <a href="http://www.trylife.cn/ecms-repeatedly-development-with-db_sql-php/">http://www.trylife.cn/ecms-repeatedly-development-with-db_sql-php/</a><br />
<strong>fetch() 与 fetch1()</strong> <a href="http://www.trylife.cn/ecms-repeatedly-development-fetch/">http://www.trylife.cn/ecms-repeatedly-development-fetch/</a>
</p>
<p>
<strong>简述：</strong> 对象num()和num1()都执行的mysql_num_rows(),只是前者参数是SQL语句，后者是SQL语句执行结果；用于获得行数；
</p>
<h4>二、num()示例</h4>
<pre name="code" class="php">
<?php
include("../../class/connect.php");
include("../../class/db_sql.php");
$link=db_connect();
$empire=new mysqlquery();

$num=$empire->num("select id from {$dbtbpre}ecms_news");
echo $num;

db_close();
$empire=null;
?>
</pre>
<h4>三、num1()示例</h4>
<pre name="code" class="php">
<?php
include("../../class/connect.php");
include("../../class/db_sql.php");
$link=db_connect();
$empire=new mysqlquery();

$sql=$empire->query("select * from {$dbtbpre}ecms_news");
$num1=$empire->num1($sql);
echo $num1;

db_close();
$empire=null;
?>
</pre>
<p><span id="more-544"></span></p>
<h4>四、讨论部分</h4>
<p><strong>1.为啥num()用的是SQL语句 num1()用的是SQL语句执行结果</strong><br />
同样的还是过来看源代码，e/class/db_sql.php;看到num()函数体中 $this->sql=$this->query($query);和fetch1一样的道理，先交给对象query()执行后，得到结果用于参数；</p>
<pre name="code" class="php">
	function num($query)
	{
		$this->sql=$this->query($query);
		$this->num=mysql_num_rows($this->sql);
		return $this->num;
	}
	function num1($sql)
	{
		$this->num=mysql_num_rows($sql);
		return $this->num;
	}
</pre>
<p><strong>2.用多了可能会想写$num[],其实返回的不是数组，而是整数(整型)</strong><br />
var_dump()函数可以帮助我们检查数据类型，并且可以看到数据内容；</p>
<pre name="code" class="php">
<pre name="code" class="php">
<?php
include("../../class/connect.php");
include("../../class/db_sql.php");
$link=db_connect();
$empire=new mysqlquery();

$num=$empire->num("select id from {$dbtbpre}ecms_news");
var_dump($num);

db_close();
$empire=null;
?>
</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.trylife.cn/ecms-repeatedly-development-num/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

