<?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>Dominic.Xu&#039;s 博客 &#187; XOOPS</title>
	<atom:link href="http://xuplus.com/article/category/web/xoops-web/feed" rel="self" type="application/rss+xml" />
	<link>http://xuplus.com</link>
	<description>Web 2.0 生活</description>
	<lastBuildDate>Wed, 24 Aug 2011 05:26:12 +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>Xoops中获取模块配置参数的方法。</title>
		<link>http://xuplus.com/article/2008/03/a92.html</link>
		<comments>http://xuplus.com/article/2008/03/a92.html#comments</comments>
		<pubDate>Fri, 28 Mar 2008 02:59:54 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[参数]]></category>

		<guid isPermaLink="false">http://xuplus.com/article/2008/03/a92.html</guid>
		<description><![CDATA[Xoops群（53219504，17380705）中有人询问在开发的时候，怎样获取在xoops_version.php中添加的参数值。其实Xoops中统一管理模块的参数是非常好的一种做法（将在下一个平台性项目中借鉴这个做法），获取的方法也非常简单，针对不同的情况可以分别实现如下： 1、更改现有模块代码，且现有模块代码中包含了全局性变量$xoopsModuleConfig的情况 这种情况比较简单： global $xoopsModuleConfig; $configvalue=$xoopsModuleConfig["xxxx"]; //xxxx为xoops_vesion.php中定义的参数对应名称 2、现有模块代码中不包含$xoopsModuleConfig或者自行开发简单模块且不使用Framework $module_handler = &#38;xoops_gethandler('module');//获取module句柄$module_handler $module = $module_handler-&#62;getByDirname("xxx");//xxx为模块目录名称，获取特定module操作句柄$module $config_handler = &#38;xoops_gethandler('config');//获取config的句柄$config_handler $criteria = new CriteriaCompo(new Criteria('conf_modid', $module-&#62;getVar('mid')));// 根据上述module的id构建查询参数$criteria $configs =&#38; $config_handler-&#62;getConfigs($criteria);//用config句柄获得特定module的参数配置结果集 foreach(array_keys($configs) as $i) { $moduleConfig[$configs[$i]-&#62;getVar('conf_name')] = $configs[$i]-&#62;getConfValueForOutput();//转化成数组 } unset($configs); 之后直接使用$moduleConfig['xxxx']就可以访问了，也可以把$moduleConfig设置为全局变量。 3、使用Framework的模块 load_functions("config"); $moduleConfig = mod_loadConfg("moduledirname"); 使用Framework的情况可以参考article中代码。 标签： XOOPS, 参数]]></description>
			<content:encoded><![CDATA[<p>Xoops群（53219504，17380705）中有人询问在开发的时候，怎样获取在xoops_version.php中添加的参数值。其实Xoops中统一管理模块的参数是非常好的一种做法（将在下一个平台性项目中借鉴这个做法），获取的方法也非常简单，针对不同的情况可以分别实现如下：</p>
<p>1、更改现有模块代码，且现有模块代码中包含了全局性变量$xoopsModuleConfig的情况</p>
<p>这种情况比较简单：</p>
<pre class="csharpcode">global $xoopsModuleConfig;
$configvalue=$xoopsModuleConfig[<span class="str">"xxxx"</span>];
//xxxx为xoops_vesion.php中定义的参数对应名称</pre>
<p>2、现有模块代码中不包含$xoopsModuleConfig或者自行开发简单模块且不使用Framework</p>
<pre class="csharpcode">$module_handler = &amp;<a href="http://xuplus.com/article/tag/xoops" class="st_tag internal_tag" rel="tag" title="标签 XOOPS 下的日志">xoops</a>_gethandler(<span class="str">'module'</span>);<span class="rem">//获取module句柄$module_handler</span>
$module = $module_handler-&gt;getByDirname(<span class="str">"xxx"</span>);<span class="rem">//xxx为模块目录名称，获取特定module操作句柄$module</span>
$config_handler = &amp;xoops_gethandler(<span class="str">'config'</span>);<span class="rem">//获取config的句柄$config_handler</span>
$criteria = <span class="kwrd">new</span> CriteriaCompo(<span class="kwrd">new</span> Criteria(<span class="str">'conf_modid'</span>, $module-&gt;getVar(<span class="str">'mid'</span>)));<span class="rem">// 根据上述module的id构建查询参数$criteria</span>
$configs =&amp; $config_handler-&gt;getConfigs($criteria);<span class="rem">//用config句柄获得特定module的参数配置结果集</span>

<span class="kwrd">foreach</span>(array_keys($configs) <span class="kwrd">as</span> $i)
{
$moduleConfig[$configs[$i]-&gt;getVar(<span class="str">'conf_name'</span>)] = $configs[$i]-&gt;getConfValueForOutput();<span class="rem">//转化成数组</span>
}
unset($configs);</pre>
<p>之后直接使用$moduleConfig['xxxx']就可以访问了，也可以把$moduleConfig设置为全局变量。</p>
<p>3、使用Framework的模块</p>
<pre class="csharpcode">load_functions(<span class="str">"config"</span>);
$moduleConfig = mod_loadConfg(<span class="str">"moduledirname"</span>);</pre>
<p>使用Framework的情况可以参考article中代码。</p>
<style type="text/css">
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }
</style>

	标签： <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e5%8f%82%e6%95%b0" title="参数" rel="tag">参数</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2008/03/a92.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[Hack]Xoops中article模块分类显示页面同时显示子分类文章的方法</title>
		<link>http://xuplus.com/article/2007/12/a79.html</link>
		<comments>http://xuplus.com/article/2007/12/a79.html#comments</comments>
		<pubDate>Thu, 27 Dec 2007 05:02:55 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article模块]]></category>
		<category><![CDATA[Hack]]></category>

		<guid isPermaLink="false">http://xuplus.com/article/2007/12/a79.html</guid>
		<description><![CDATA[D.J.老大的article模组确实好用，但是在分类文章列表显示页面view.category.php这个文件中却只显示给定栏目ID的文章和子分类列表及子分类文章数。虽然个人比较喜欢这种方式，但这种方式并不适合目前国内流行文章管理系统在显示栏目的文章方式，一般的网站在现实栏目时需要将分类的子分类文章也同时显示出来。 针对目前大多数都是采用两级分类的方式，我对view.category.php做了一些Hack: 1、在view.category.php 97行附近修改如下： $counts_category =&#38; $category_handler-&#62;getCategoryCounts(array_keys($categories), &#34;access&#34;); &#160;&#160;&#160; //Add By XuYong 获取子栏目下给定篇数文章 &#160;&#160;&#160; $articles_perpage = (empty($start) &#38;&#38; empty($list)) ? $xoopsModuleConfig[&#34;articles_category&#34;] : $xoopsModuleConfig[&#34;articles_perpage&#34;]; &#160;&#160;&#160; //End Add foreach( $categories as $id=&#62;$cat){ &#160;&#160;&#160; //Add By XuYong 获取子栏目下给定篇数文章 &#160;&#160;&#160; $subcriteria = new CriteriaCompo(new Criteria(&#34;ac.ac_publish&#34;, 0, &#34;&#62;&#34;)); &#160;&#160;&#160; $subarticle_id =&#38; $article_handler-&#62;getIdsByCategory($cat, $articles_perpage, 0, $subcriteria); &#160;&#160;&#160; if(count($subarticle_id)&#62;0){ &#160;&#160;&#160;&#160;&#160;&#160;&#160; $criteria = [...]]]></description>
			<content:encoded><![CDATA[<p>D.J.老大的article模组确实好用，但是在分类文章列表显示页面view.category.php这个文件中却只显示给定栏目ID的文章和子分类列表及子分类文章数。虽然个人比较喜欢这种方式，但这种方式并不适合目前国内流行文章管理系统在显示栏目的文章方式，一般的网站在现实栏目时需要将分类的子分类文章也同时显示出来。</p>
<p>针对目前大多数都是采用两级分类的方式，我对view.category.php做了一些Hack:</p>
<p>1、在view.category.<a href="http://xuplus.com/article/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a> 97行附近修改如下：</p>
<p>$counts_category =&amp; $category_handler-&gt;getCategoryCounts(array_keys($categories), &quot;access&quot;);    <br />&#160;&#160;&#160; //Add By XuYong 获取子栏目下给定篇数文章 </p>
<p>&#160;&#160;&#160; $articles_perpage = (empty($start) &amp;&amp; empty($list)) ? $xoopsModuleConfig[&quot;articles_category&quot;] : $xoopsModuleConfig[&quot;articles_perpage&quot;];    <br />&#160;&#160;&#160; //End Add </p>
<p>foreach( $categories as $id=&gt;$cat){    <br />&#160;&#160;&#160; //Add By XuYong 获取子栏目下给定篇数文章     <br />&#160;&#160;&#160; $subcriteria = new CriteriaCompo(new Criteria(&quot;ac.ac_publish&quot;, 0, &quot;&gt;&quot;));     <br />&#160;&#160;&#160; $subarticle_id =&amp; $<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>_handler-&gt;getIdsByCategory($cat, $articles_perpage, 0, $subcriteria);     <br />&#160;&#160;&#160; if(count($subarticle_id)&gt;0){     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $criteria = new Criteria(&quot;art_id&quot;, &quot;(&quot;.implode(&quot;,&quot;,$subarticle_id).&quot;)&quot;, &quot;IN&quot;);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $tags = array(&quot;uid&quot;, &quot;writer_id&quot;, &quot;art_title&quot;, &quot;art_summary&quot;, &quot;art_image&quot;, &quot;art_pages&quot;, &quot;art_categories&quot;, &quot;art_time_publish&quot;, &quot;art_counter&quot;, &quot;art_comments&quot;, &quot;art_trackbacks&quot;);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $subarticles_obj =&amp; $article_handler-&gt;getAll($criteria, $tags);     <br />&#160;&#160;&#160; }else{     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $subarticles_obj = array();     <br />&#160;&#160;&#160; } </p>
<p>&#160;&#160;&#160; $subcatarticles = array();    <br />&#160;&#160;&#160; foreach ($subarticle_id as $id) {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $_article = array(     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;id&quot;&#160;&#160;&#160;&#160;&#160;&#160;&#160; =&gt; $id,     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;title&quot;&#160;&#160;&#160;&#160;&#160;&#160;&#160; =&gt; $subarticles_obj[$id]-&gt;getVar(&quot;art_title&quot;),     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;time&quot;&#160;&#160;&#160;&#160;&#160;&#160;&#160; =&gt; $subarticles_obj[$id]-&gt;getTime($xoopsModuleConfig[&quot;timeformat&quot;]),     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;image&quot;&#160;&#160;&#160;&#160;&#160;&#160;&#160; =&gt; $subarticles_obj[$id]-&gt;getImage(),     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;counter&quot;&#160;&#160;&#160; =&gt; $subarticles_obj[$id]-&gt;getVar(&quot;art_counter&quot;),     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;comments&quot;&#160;&#160;&#160; =&gt; $subarticles_obj[$id]-&gt;getVar(&quot;art_comments&quot;),     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;trackbacks&quot;=&gt; $subarticles_obj[$id]-&gt;getVar(&quot;art_trackbacks&quot;)     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; );     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(!empty($xoopsModuleConfig[&quot;display_summary&quot;])){     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $_article[&quot;summary&quot;] = $subarticles_obj[$id]-&gt;getSummary(true);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $subcatarticles[$id] = $_article;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; unset($_article);     <br />&#160;&#160;&#160; } </p>
<p>&#160;&#160;&#160; //End Add    <br />&#160;&#160;&#160; $subcategories[] = array(     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;id&quot;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; =&gt; $cat-&gt;getVar(&quot;cat_id&quot;),     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;title&quot;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; =&gt; $cat-&gt;getVar(&quot;cat_title&quot;),     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;articles&quot;&#160;&#160;&#160;&#160;&#160;&#160;&#160; =&gt; @intval($counts_article[$cat-&gt;getVar(&quot;cat_id&quot;)]),     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;categories&quot;&#160;&#160;&#160; =&gt; @intval($counts_category[$cat-&gt;getVar(&quot;cat_id&quot;)]),     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;subcatart&quot;&#160; =&gt; $subcatarticles     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; );     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; //Add By XuYong 获取子栏目下给定篇数文章     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; unset($subcatarticles);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; //End Add     <br />}     <br />unset($criteria);     <br />$criteria = new CriteriaCompo(new Criteria(&quot;ac.ac_feature&quot;, 0, &quot;&gt;&quot;));     <br />$criteria-&gt;setSort(&quot;ac.ac_feature&quot;); </p>
<p>2、修改模板文件article_category.html文件，134行附近修改如下：</p>
<p>&lt;{if count($categories) gt 0}&gt;    <br />&lt;div id=&quot;category&quot; class=&quot;article-category&quot;&gt; </p>
<p>&#160;&#160;&#160; &lt;{foreachq item=cat name=cat from=$categories}&gt;    <br />&#160;&#160;&#160; &lt;div class=&quot;category-header tdbg4&quot; stype=&quot;width:80%&quot;&gt;     <br />&lt;span class=&quot;sizscolor&quot;&gt;&lt;b&gt;&lt;a href=&quot;&lt;{$<a href="http://xuplus.com/article/tag/xoops" class="st_tag internal_tag" rel="tag" title="标签 XOOPS 下的日志">xoops</a>_url}&gt;/modules/&lt;{$<a href="http://xuplus.com/article/tag/xoops" class="st_tag internal_tag" rel="tag" title="标签 XOOPS 下的日志">xoops</a>_dirname}&gt;/view.category.php&lt;{$<a href="http://xuplus.com/article/tag/smarty" class="st_tag internal_tag" rel="tag" title="标签 Smarty 下的日志">smarty</a>.const.URL_DELIMITER}&gt;c&lt;{$cat.id}&gt;/list&quot;&gt;&lt;{$cat.title}&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;     <br />&#160;&#160;&#160; &lt;/div&gt; </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;{if count($cat.subcatart) gt 0}&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;div id=&quot;article_&lt;{$cat.id}&gt;&quot; class=&quot;article-article&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;table width=&quot;95%&quot; border=&quot;0&quot; align=&quot;center&quot; cellspacing=&quot;0&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;{foreachq item=article from=$cat.subcatart}&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;tr class=&quot;tdlist&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;td&#160; width=&quot;86%&quot; height=&quot;24&quot; class=&quot;tdlist&quot;&gt;&#183;&lt;a href=&quot;&lt;{$xoops_url}&gt;/modules/&lt;{$xoops_dirname}&gt;/view.article.php&lt;{$smarty.const.URL_DELIMITER}&gt;&lt;{$article.id}&gt;&quot;&gt;&lt;{$article.title}&gt;&lt;/a&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;{if $article.image}&gt;&lt;img src=&quot;&lt;{$xoops_url}&gt;/modules/&lt;{$xoops_dirname}&gt;/images/image.gif&quot; width=&quot;12px&quot; alt=&quot;&quot; /&gt;&lt;{/if}&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/td&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;td width=&quot;14%&quot; height=&quot;2&quot; class=&quot;tdlist&quot;&gt;&lt;{$article.time|date_format:&quot;%y-%d-%m&quot;}&gt;&lt;/td&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/tr&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;{/foreach}&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/table&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/div&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;{/if}&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;div class=&quot;article-section-title&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;span class=&quot;subject&quot;&gt; &lt;/span&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;span class=&quot;navigation&quot;&gt;&lt;a href=&quot;&lt;{$xoops_url}&gt;/modules/&lt;{$xoops_dirname}&gt;/view.category.php&lt;{$smarty.const.URL_DELIMITER}&gt;c&lt;{$cat.id}&gt;/list&quot;&gt;&lt;{$smarty.const._MORE}&gt;&lt;/a&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/span&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/div&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;     <br />&#160;&#160;&#160; &lt;{/foreach}&gt; </p>
<p>&lt;/div&gt;    <br />&lt;{/if}&gt;</p>
<p>其中有些样式和一些修改是根据当前需要改的，需要根据自身情况调整。</p>
<p>效果demo；</p>
<p><a href="http://xuplus.com/uploads/2007/12/view-category-hack-demo.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="430" alt="view_category_hack_demo" src="http://xuplus.com/uploads/2007/12/view-category-hack-demo-thumb.jpg" width="505" border="0" /></a> </p>
<p>&#160;</p>
<p>Hack后的iview.category.php和模板文件下载：<iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-2b707ffec38c35d2.skydrive.live.com/embedrowdetail.aspx/Public/%e7%bd%91%e7%bb%9c%e5%85%b1%e4%ba%ab/view_category_hack_withsubcatart.rar" frameborder="0" scrolling="no"></iframe></p>

	标签： <a href="http://xuplus.com/article/tag/article%e6%a8%a1%e5%9d%97" title="article模块" rel="tag">article模块</a>, <a href="http://xuplus.com/article/tag/hack" title="Hack" rel="tag">Hack</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/12/a79.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Xoops中weblinks模组1.13版简体中文UTF8字符集乱码解决及语言包</title>
		<link>http://xuplus.com/article/2007/12/a76.html</link>
		<comments>http://xuplus.com/article/2007/12/a76.html#comments</comments>
		<pubDate>Wed, 26 Dec 2007 13:10:00 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[weblinks]]></category>
		<category><![CDATA[乱码]]></category>

		<guid isPermaLink="false">http://xuplus.com/article/2007/12/a76.html</guid>
		<description><![CDATA[今天xoops.org.cn上有人说道weblinksV1.13版本在用UTF8字符集的时候碰到乱码和RSS、ATOM输出乱码的问题，发现手上的一个小东西也存在这样的问题，虽然weblinks模组现在http://ohwada.net推出了1.82.1版本的weblinks模组，但需要装他们的happy_linux模组，而且目前还没有一个简体中文语言包，也就不想升级到新的weblinks模组了。在培训的间隙，花了点时间分析了以下问题，然来是从简体中文gb2312字符集语言包转换成UTF8语言包时候，虽然可以使用了，但是缺少了关键的UTF8转换处理函数（UTF8是不需要再转换的），导致本身就是utf8的字符串被二次编码，就导致乱码了。 解决办法是在weblinks_language_convert.php文件中加入utf8转换函数。需要清除cache目录中对应的缓存文件。 &#160; //Add By Xuyong //utf8 字符集不需要转化 //End Add function convert_from_utf8($text) { &#160;&#160;&#160; return ($text); } function convert_to_utf8($text) { &#160;&#160;&#160; return ($text); } 完整utf8语言包： 标签： utf8, weblinks, 乱码]]></description>
			<content:encoded><![CDATA[<p>今天<a href="http://xoops.org.cn" target="_blank">xoops.org.cn</a>上有人说道weblinksV1.13版本在用UTF8字符集的时候碰到乱码和RSS、ATOM输出乱码的问题，发现手上的一个小东西也存在这样的问题，虽然weblinks模组现在<a title="http://ohwada.net" href="http://ohwada.net">http://ohwada.net</a>推出了1.82.1版本的weblinks模组，但需要装他们的happy_linux模组，而且目前还没有一个简体中文语言包，也就不想升级到新的weblinks模组了。在培训的间隙，花了点时间分析了以下问题，然来是从简体中文gb2312字符集语言包转换成UTF8语言包时候，虽然可以使用了，但是缺少了关键的UTF8转换处理函数（UTF8是不需要再转换的），导致本身就是utf8的字符串被二次编码，就导致乱码了。</p>
<p>解决办法是在weblinks_language_convert.php文件中加入utf8转换函数。需要清除cache目录中对应的缓存文件。</p>
<p>&#160;</p>
<blockquote><p>//Add By Xuyong      <br />//<a href="http://xuplus.com/article/tag/utf8" class="st_tag internal_tag" rel="tag" title="标签 utf8 下的日志">utf8</a> 字符集不需要转化       <br />//End Add       <br />function convert_from_utf8($text)       <br />{       <br />&#160;&#160;&#160; return ($text);       <br />}       <br />function convert_to_utf8($text)       <br />{       <br />&#160;&#160;&#160; return ($text);       <br />} </p>
<p>完整utf8语言包：<iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 26px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-2b707ffec38c35d2.skydrive.live.com/embedrow.aspx/Public/%e7%bd%91%e7%bb%9c%e5%85%b1%e4%ba%ab/weblinksv1.13_schinese_utf8.rar" frameborder="0" scrolling="no"></iframe></p>
</blockquote>

	标签： <a href="http://xuplus.com/article/tag/utf8" title="utf8" rel="tag">utf8</a>, <a href="http://xuplus.com/article/tag/weblinks" title="weblinks" rel="tag">weblinks</a>, <a href="http://xuplus.com/article/tag/%e4%b9%b1%e7%a0%81" title="乱码" rel="tag">乱码</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/12/a76.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用XOOPS构建专题门户社区网站——安徽车市网</title>
		<link>http://xuplus.com/article/2007/08/a60.html</link>
		<comments>http://xuplus.com/article/2007/08/a60.html#comments</comments>
		<pubDate>Mon, 27 Aug 2007 07:40:30 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[网站管理]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=60</guid>
		<description><![CDATA[因合作原因，已经于2007年8月份退出了安徽车市网团队，其团队新开发人员可能是更喜欢phpcms，抛弃了XOOPS，于2008年1月15日完成用phpcms替换XOOPS。至此，安徽车市网和XOOPS无关，和dominic无关。  此文发表于CSDN：http://news.csdn.net/n/20070827/107973.html 2007年初“车行江淮网”决定改版，目标是“将原来小型网站转换成一个综合性汽车专题门户网站和本地汽车社区网站”。我们在进行技术分析时认为，要实现这个目标就需要一个包含内容管理可自由扩展的系统，一个拥有强大的用户管理、页面风格布局管理的系统，一个有基本的文章管理、百科（Wiki）、社区、论坛、图片管理的系统。在综合评估了ASP.Net、JSP、PHP等语言平台下十多种系统之后，我们被XOOPS的面向对象的可扩展智能建站思想吸引，在阅读了几个系统核心源代码之后，发现XOOPS的核心在面向对象方面实现的最彻底，于是XOOPS成为改版“车行江淮网”的不二选择。改版之后的网站命名为“安徽车市网”(http://www.ahcarmarket.com) “安徽车市网”以符合中文习惯的Article文章管理模块为基础，利用Article模块向外提供了富有Web 2.0元素的汽车资讯服务，最大程度地面向搜索引擎优化，并通过MediaWiki模块提供专门的汽车百科服务。充分利用XOOPS中强大的主题、风格、区块（局部）概念和功能，辅以Page模块自由布局功能和区块皮肤概念，完美实现各个页面的局部自定义显示而不需要太多额外工作量，XOOPS中优良的缓存设计又很好的提供了页面显示速度。 利用XOOPS优秀的可扩展性，“安徽车市网”被打造成一个集资讯、报价、汽车资料、汽车百科、论坛、博客、汽车图库、相册、广告服务、展览服务等多项服务为一身的汽车专题门户社区网站；利用XOOPS优良的架构，“安徽车市网”将通过利用反向代理等技术实现廉价的快速网站访问。XOOPS在不断完善、不断发展壮大，是构建多功能、多服务的门户网站或者社区网站的最佳选择！ 标签： XOOPS]]></description>
			<content:encoded><![CDATA[<p><font color="#ff0000"><strong>因合作原因，已经于2007年8月份退出了安徽车市网团队，其团队新开发人员可能是更喜欢phpcms，抛弃了XOOPS，于2008年1月15日完成用phpcms替换XOOPS。至此，安徽车市网和XOOPS无关，和dominic无关。</strong> </font></p>
<p><font color="#ff0000">此文发表于CSDN：</font><a href="http://news.csdn.net/n/20070827/107973.html"><font color="#ff0000">http://news.csdn.net/n/20070827/107973.html</font></a></p>
<p>2007年初“车行江淮网”决定改版，目标是“将原来小型网站转换成一个综合性汽车专题门户网站和本地汽车社区网站”。我们在进行技术分析时认为，要实现这个目标就需要一个包含内容管理可自由扩展的系统，一个拥有强大的用户管理、页面风格布局管理的系统，一个有基本的文章管理、百科（Wiki）、社区、论坛、图片管理的系统。在综合评估了ASP.Net、JSP、PHP等语言平台下十多种系统之后，我们被XOOPS的面向对象的可扩展智能建站思想吸引，在阅读了几个系统核心源代码之后，发现XOOPS的核心在面向对象方面实现的最彻底，于是XOOPS成为改版“车行江淮网”的不二选择。改版之后的网站命名为“安徽车市网”(<a href="http://www.ahcarmarket.com">http://www.ahcarmarket.com</a>)</p>
<p>“安徽车市网”以符合中文习惯的Article文章管理模块为基础，利用Article模块向外提供了富有Web 2.0元素的汽车资讯服务，最大程度地面向搜索引擎优化，并通过MediaWiki模块提供专门的汽车百科服务。充分利用XOOPS中强大的主题、风格、区块（局部）概念和功能，辅以Page模块自由布局功能和区块皮肤概念，完美实现各个页面的局部自定义显示而不需要太多额外工作量，XOOPS中优良的缓存设计又很好的提供了页面显示速度。</p>
<p>利用XOOPS优秀的可扩展性，“安徽车市网”被打造成一个集资讯、报价、汽车资料、汽车百科、论坛、博客、汽车图库、相册、广告服务、展览服务等多项服务为一身的汽车专题门户社区网站；利用XOOPS优良的架构，“安徽车市网”将通过利用反向代理等技术实现廉价的快速网站访问。XOOPS在不断完善、不断发展壮大，是构建多功能、多服务的门户网站或者社区网站的最佳选择！</p>

	标签： <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/08/a60.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHPMailer类发送中文邮件兼谈解决XOOPS中文发送邮件乱码</title>
		<link>http://xuplus.com/article/2007/08/a57.html</link>
		<comments>http://xuplus.com/article/2007/08/a57.html#comments</comments>
		<pubDate>Tue, 07 Aug 2007 05:25:41 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[XOOPS]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=57</guid>
		<description><![CDATA[xoops.org.cn论坛上又有人问xoops发送中文邮件乱码的问题。domecc给出了一个临时办法，还提供一个网址http://www.thedevlog.com/dev/log-29.html来对utf8编码系统做修正。 其实PHPMailer已经是非常成熟的PHP类了（当然需要打上前一段时间出现的bug的补丁），对于邮件头和邮件体的编码处理已经非常好了，http://www.thedevlog.com/dev/log-29.html中提到修改EncodeHeader并编码，实际上EncodeHeader后面的代码就是完成将头部编码的功能，所以不需要修改该函数。 要成功实现发送中文邮件，设置phpmailer类两个值即可。 $mail = new PHPMailer(); $mail-&#62;CharSet = “UTF-8&#8243;; // 设置字符集编码，GB2312 GBK $mail-&#62;Encoding = “base64&#8243;;//设置文本编码方式 …… 这样保证了邮件标题和正文内容全部不会乱码，当然邮件内容的字符集需要和给定的CharSet内容一致。 回过头来看看xoops中为什么邮件乱码，在xoops中发送邮件首先我们使用了具体语言的xoopsmailerlocal.php文件中XoopsMailerLocal类，而XoopsMailerLocal类继承自class\xoopsmailer.php中的XoopsMailer类，而XoopsMailer类的multimailer成员指向自class\mail\xoopsmultimailer.php中的XoopsMultiMailer类的实体，XoopsMultiMailer类是从PHPMailer派生的。 问题就出在XoopsMailer的构造函数上。在XoopsMultiMailer类的构造函数中（xoopsmultimailer.php中177行）指定了CharSet值为strtolower( _CHARSET )，这样做本来在绝大多数邮件系统中均不会出现乱码，但在XoopsMailer类的sendMail方法（xoopsmailer.php中378行）却重新指定了字符集和文本编码方式： $this-&#62;multimailer-&#62;CharSet = $this-&#62;charSet;         $this-&#62;multimailer-&#62;Encoding = $this-&#62;encoding; 这样导致前面在构造multimailer的时候指定了字符集为XOOPS系统字符集strtolower( _CHARSET )（utf-8或者gb2312），到sendMail方法中却换成了XoopsMailer的成员charSet的值，而XoopsMailer的构造函数并没有让charSet随系统变化，而是取默认值：iso-8859-1。邮件客户端收到邮件按照iso-8859-1来显示邮件内容当然会乱码。所以我们只要正确的给XoopsMailer类实体赋给正确字符集（_CHARSET）即可。 解决办法是： 打开htdocs\class\xoopsmailer.php ，137行附近 $this-&#62;multimailer = new XoopsMultiMailer(); $this-&#62;reset(); 后面添加一行： $this-&#62;charSet = strtolower( _CHARSET ); $this-&#62;encoding = &#8216;base64&#8242;; 更完美的解决办法是： 打开htdocs\language\schinese\xoopsmailerlocal.php和htdocs\language\schinese_utf8\xoopsmailerlocal.php 修改为： &#60;?php class XoopsMailerLocal [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://xuplus.com/article/tag/xoops" class="st_tag internal_tag" rel="tag" title="标签 XOOPS 下的日志">xoops</a>.org.cn论坛上又有人问xoops发送中文邮件乱码的问题。domecc给出了一个临时办法，还提供一个网址<a href="http://www.thedevlog.com/dev/log-29.html" title="http://www.thedevlog.com/dev/log-29.html">http://www.thedevlog.com/dev/log-29.html</a>来对utf8编码系统做修正。</p>
<p>其实PHPMailer已经是非常成熟的PHP类了（当然需要打上前一段时间出现的bug的补丁），对于邮件头和邮件体的编码处理已经非常好了，<a href="http://www.thedevlog.com/dev/log-29.html" title="http://www.thedevlog.com/dev/log-29.html">http://www.thedevlog.com/dev/log-29.html<font color="#333333">中提到修改EncodeHeader</font></a>并编码，实际上EncodeHeader后面的代码就是完成将头部编码的功能，所以不需要修改该函数。</p>
<p>要成功实现发送中文邮件，设置phpmailer类两个值即可。</p>
<blockquote><p>$mail = new PHPMailer();<br />
$mail-&gt;CharSet = “UTF-8&#8243;; // 设置字符集编码，GB2312 GBK<br />
$mail-&gt;Encoding = “base64&#8243;;//设置文本编码方式<br />
……</p></blockquote>
<p>这样保证了邮件标题和正文内容全部不会乱码，当然邮件内容的字符集需要和给定的CharSet内容一致。</p>
<p>回过头来看看xoops中为什么邮件乱码，在xoops中发送邮件首先我们使用了具体语言的xoopsmailerlocal.php文件中XoopsMailerLocal类，而XoopsMailerLocal类继承自class\xoopsmailer.php中的XoopsMailer类，而XoopsMailer类的multimailer成员指向自class\mail\xoopsmultimailer.php中的XoopsMultiMailer类的实体，XoopsMultiMailer类是从PHPMailer派生的。</p>
<p>问题就出在XoopsMailer的构造函数上。在XoopsMultiMailer类的构造函数中（xoopsmultimailer.php中177行）指定了CharSet值为strtolower( _CHARSET )，这样做本来在绝大多数邮件系统中均不会出现乱码，但在XoopsMailer类的sendMail方法（xoopsmailer.php中378行）却重新指定了字符集和文本编码方式：</p>
<blockquote><p>$this-&gt;multimailer-&gt;CharSet = $this-&gt;charSet;<br />
        $this-&gt;multimailer-&gt;Encoding = $this-&gt;encoding;</p></blockquote>
<p>这样导致前面在构造multimailer的时候指定了字符集为XOOPS系统字符集strtolower( _CHARSET )（utf-8或者gb2312），到sendMail方法中却换成了XoopsMailer的成员charSet的值，而XoopsMailer的构造函数并没有让charSet随系统变化，而是取默认值：iso-8859-1。邮件客户端收到邮件按照iso-8859-1来显示邮件内容当然会乱码。所以我们只要正确的给XoopsMailer类实体赋给正确字符集（_CHARSET）即可。</p>
<p>解决办法是：</p>
<blockquote><p>打开htdocs\class\xoopsmailer.<a href="http://xuplus.com/article/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a> ，137行附近<br />
$this-&gt;multimailer = new XoopsMultiMailer();<br />
$this-&gt;reset();<br />
后面添加一行：<br />
$this-&gt;charSet = strtolower( _CHARSET );<br />
$this-&gt;encoding = &#8216;base64&#8242;;</p></blockquote>
<p>更完美的解决办法是：</p>
<blockquote><p>打开htdocs\language\schinese\xoopsmailerlocal.php和htdocs\language\schinese_<a href="http://xuplus.com/article/tag/utf8" class="st_tag internal_tag" rel="tag" title="标签 utf8 下的日志">utf8</a>\xoopsmailerlocal.php 修改为：<br />
&lt;?php<br />
class XoopsMailerLocal extends XoopsMailer {</p>
<p>    function XoopsMailerLocal(){<br />
        $this-&gt;XoopsMailer();<br />
        $this-&gt;charSet = strtolower( _CHARSET );<br />
        $this-&gt;encoding = &#8216;base64&#8242;;<br />
    }<br />
}<br />
?&gt;</p></blockquote>
<p>实则是xoops 中文版bug。</p>
<p>另外，为什么要指定encoding呢，这里涉及到email的原理，email产生的年代用7bit就足够表示所有ASCII字符可打印字符了，email发展到全世界之后，多字节语种的需要，需要使用8bit或者16bit或者更多bit来表示一个完整的字，但老式的网络设备和一些邮件系统并不能很好的处理不是7bit的内容或者并不能很好处理多字节的文本内容，这样就需要将文本做一个编码，base64和quoted-printable便是email中用来解决这个问题的最流行方法。email中附件都是用base64来编码具体内容的，用base64编码之后的邮件除非文本内容和指定字符集不一致或者本身就是乱码，否则不会出现乱码的。</p>
<p>当时给ceiea做Windows下邮件系统时候对email做了全面的分析，还是有些用处的。</p>
<p>[tags]PHPMailer,<a href="http://xuplus.com/article/tag/%e4%b8%ad%e6%96%87" class="st_tag internal_tag" rel="tag" title="标签 中文 下的日志">中文</a>,邮件,XOOPS[/tags]</p>

	标签： <a href="http://xuplus.com/article/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/08/a57.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>[Hack]将artile模组中的文章的关键词加入到HTML的Meta头中</title>
		<link>http://xuplus.com/article/2007/08/a56.html</link>
		<comments>http://xuplus.com/article/2007/08/a56.html#comments</comments>
		<pubDate>Wed, 01 Aug 2007 10:12:39 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[关键词]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=56</guid>
		<description><![CDATA[HTML页面的keywords Meta是非常重要的一个Meta，它提供给搜索引擎以指引，告诉当前页面的主要内容，虽然目前很多搜索引擎均不在把把keywords作为唯一标示，但其重要性还是显著的。XOOPS中可以在后台设置Meta Keywords，通过Smarty变量xoops_meta_keywords写入HTML页面，但这种方式导致所有页面的这个Meta头都一样，影响了keywords Meta的效果，修改article模组的view.article.php文件和主题模板文件即可达到即兼顾系统设置和页面个性化keywords Meta的目的，我们将发布文章的录入的tag显示在HTML Meta头中。 首先修改htdocs\modules\article\view.article.php文件289行附近， 将原来的 if(@include_once XOOPS_ROOT_PATH.”/modules/tag/include/tagbar.php”){     $xoopsTpl-&#62;assign(&#8216;tagbar&#8217;, tagBar($article_obj-&#62;getVar(“art_keywords”, “n”))); } 修改成： $extra_meta_keywords = $article_obj-&#62;getVar(“art_keywords”, “n”);//Modifyed By XuYong 添加tag到html的meta标签 if(@include_once XOOPS_ROOT_PATH.”/modules/tag/include/tagbar.php”){     $xoopsTpl-&#62;assign(&#8216;tagbar&#8217;, tagBar($article_obj-&#62;getVar(“art_keywords”, “n”)));     if(!empty($extra_meta_keywords))$extra_meta_keywords = str_replace(tag_get_delimiter(), “,”, $extra_meta_keywords);//Modifyed By XuYong 添加tag到html的meta标签 } $xoopsTpl -&#62; assign(“extra_meta_keywords”,$extra_meta_keywords);//Modifyed By XuYong 添加tag到html的meta标签  即通过增加extra_meta_keywords Smarty变量达到个性化keywords Meta 的目的。 再修改站点所用到的主题模板文件theme.html，将原来的 &#60;meta name=”keywords” content=”&#60;{$xoops_meta_keywords}&#62;” /&#62;  修改成 [...]]]></description>
			<content:encoded><![CDATA[<p>HTML页面的keywords Meta是非常重要的一个Meta，它提供给搜索引擎以指引，告诉当前页面的主要内容，虽然目前很多搜索引擎均不在把把keywords作为唯一标示，但其重要性还是显著的。XOOPS中可以在后台设置Meta Keywords，通过Smarty变量xoops_meta_keywords写入HTML页面，但这种方式导致所有页面的这个Meta头都一样，影响了keywords Meta的效果，修改article模组的view.<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>.php文件和主题模板文件即可达到即兼顾系统设置和页面个性化keywords Meta的目的，我们将发布文章的录入的tag显示在HTML Meta头中。</p>
<p>首先修改htdocs\modules\article\view.article.php文件289行附近，</p>
<p>将原来的</p>
<blockquote><p>if(@include_once <a href="http://xuplus.com/article/tag/xoops" class="st_tag internal_tag" rel="tag" title="标签 XOOPS 下的日志">XOOPS</a>_ROOT_PATH.”/modules/tag/include/tagbar.<a href="http://xuplus.com/article/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a>”){<br />
    $xoopsTpl-&gt;assign(&#8216;tagbar&#8217;, tagBar($article_obj-&gt;getVar(“art_keywords”, “n”)));<br />
}</p></blockquote>
<p>修改成：</p>
<blockquote><p>$extra_meta_keywords = $article_obj-&gt;getVar(“art_keywords”, “n”);//Modifyed By XuYong 添加tag到html的meta标签<br />
if(@include_once XOOPS_ROOT_PATH.”/modules/tag/include/tagbar.php”){<br />
    $xoopsTpl-&gt;assign(&#8216;tagbar&#8217;, tagBar($article_obj-&gt;getVar(“art_keywords”, “n”)));<br />
    if(!empty($extra_meta_keywords))$extra_meta_keywords = str_replace(tag_get_delimiter(), “,”, $extra_meta_keywords);//Modifyed By XuYong 添加tag到html的meta标签<br />
}<br />
$xoopsTpl -&gt; assign(“extra_meta_keywords”,$extra_meta_keywords);//Modifyed By XuYong 添加tag到html的meta标签</p></blockquote>
<p> 即通过增加extra_meta_keywords Smarty变量达到个性化keywords Meta 的目的。</p>
<p>再修改站点所用到的主题模板文件theme.html，将原来的</p>
<blockquote><p>&lt;meta name=”keywords” content=”&lt;{$xoops_meta_keywords}&gt;” /&gt;</p></blockquote>
<p> 修改成</p>
<blockquote><p>&lt;meta name=”keywords” content=”&lt;{$extra_meta_keywords}&gt;,&lt;{$xoops_meta_keywords}&gt;” /&gt;</p></blockquote>

	标签： <a href="http://xuplus.com/article/tag/article" title="article" rel="tag">article</a>, <a href="http://xuplus.com/article/tag/hack" title="Hack" rel="tag">Hack</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e5%85%b3%e9%94%ae%e8%af%8d" title="关键词" rel="tag">关键词</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/08/a56.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Hack]让article模组显示的文章打印功能和RSS输出功能使用站点Logo</title>
		<link>http://xuplus.com/article/2007/08/a55.html</link>
		<comments>http://xuplus.com/article/2007/08/a55.html#comments</comments>
		<pubDate>Wed, 01 Aug 2007 09:53:40 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[Hack]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=55</guid>
		<description><![CDATA[article模组中显示的文章的时候下面的工具箱中的打印功能输出页面头部会打印个图片，而这个图片却是article模组xoops_version.php中配置的模块图片，打印出来实在是有些刺眼，RSS输出的地方也是这样。还是改成站点的Logo图片比较好 首先修改htdocs\modules\article\print.php文件90行处， 将原来的 $print_data["image"] = XOOPS_URL . “/modules/” . $xoopsModule-&#62;getVar(“dirname”) . “/” . $xoopsModule-&#62;getInfo( &#8216;image&#8217; );  修改成： $print_data["image"] = XOOPS_URL . “/images/logo.jpg”;//Modified By XuYong 采用站点Logo 再修改htdocs\modules\article\xml.php 284行附近， 将原来的 “url”            =&#62; XOOPS_URL.”/modules/”.$GLOBALS["artdirname"].”/”.$xoopsModule-&#62;getInfo(“image”), 修改成： “url”            =&#62; XOOPS_URL.”/images/logo.jpg”, 其中Logo的具体路径要根据实际情况调整。 标签： article, Hack, XOOPS]]></description>
			<content:encoded><![CDATA[<p>article模组中显示的文章的时候下面的工具箱中的打印功能输出页面头部会打印个图片，而这个图片却是article模组xoops_version.php中配置的模块图片，打印出来实在是有些刺眼，RSS输出的地方也是这样。还是改成站点的Logo图片比较好</p>
<p>首先修改htdocs\modules\<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>\print.php文件90行处，</p>
<p>将原来的</p>
<blockquote><p>$print_data["image"] = <a href="http://xuplus.com/article/tag/xoops" class="st_tag internal_tag" rel="tag" title="标签 XOOPS 下的日志">XOOPS</a>_URL . “/modules/” . $xoopsModule-&gt;getVar(“dirname”) . “/” . $xoopsModule-&gt;getInfo( &#8216;image&#8217; );</p></blockquote>
<p> 修改成：</p>
<blockquote><p>$print_data["image"] = XOOPS_URL . “/images/logo.jpg”;//Modified By XuYong 采用站点Logo</p></blockquote>
<p>再修改htdocs\modules\article\xml.<a href="http://xuplus.com/article/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a> 284行附近，</p>
<p>将原来的</p>
<blockquote><p>“url”            =&gt; XOOPS_URL.”/modules/”.$GLOBALS["artdirname"].”/”.$xoopsModule-&gt;getInfo(“image”),</p></blockquote>
<p>修改成：</p>
<blockquote><p>“url”            =&gt; XOOPS_URL.”/images/logo.jpg”,</p></blockquote>
<p>其中Logo的具体路径要根据实际情况调整。</p>

	标签： <a href="http://xuplus.com/article/tag/article" title="article" rel="tag">article</a>, <a href="http://xuplus.com/article/tag/hack" title="Hack" rel="tag">Hack</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/08/a55.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Hack]解决article模组中添加文章时使用html标签导致段落换行不正确的问题</title>
		<link>http://xuplus.com/article/2007/08/a54.html</link>
		<comments>http://xuplus.com/article/2007/08/a54.html#comments</comments>
		<pubDate>Wed, 01 Aug 2007 09:22:23 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[Hack]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=54</guid>
		<description><![CDATA[article模组发布文章是在编辑器下面有几个选项：“使用HTML标签”、“使用表情图”、“启用Xoops内置码”、“启用换行符(如果启用HTML标签，建议关闭) ”，一般都是选中状态（可能有配置项，但是好像默认是都选中），不明白的是为什么里面都提示“如果启用HTML标签，建议关闭”了就是不把第一个和第四个做成反选（加个Javascript控制一下就可以了），直接导致发布文章之后文章显示会换行2次，在HTML源代码中可以看到在行跟行之间出现了&#60;BR&#62;&#60;BR&#62;2次，导致行与行之间多出一个br。 解决办法：编辑htdocs\modules\article\edit.article.php文件111行， 将原来的 $dobr = $article_obj-&#62;isNew() &#124;&#124; $newpage; 改成： //Modified By XuYong 根据 $dohtml 调整$dobr默认值 if($dohtml==0) {     $dobr = $article_obj-&#62;isNew() &#124;&#124; $newpage; } else {     $dobr = 0; }  这样设置了“使用HTML标签”就会自动关闭“启用换行符”了。 标签： article, Hack, XOOPS]]></description>
			<content:encoded><![CDATA[<p>article模组发布文章是在编辑器下面有几个选项：“使用HTML标签”、“使用表情图”、“启用Xoops内置码”、“启用换行符(如果启用HTML标签，建议关闭) ”，一般都是选中状态（可能有配置项，但是好像默认是都选中），不明白的是为什么里面都提示“如果启用HTML标签，建议关闭”了就是不把第一个和第四个做成反选（加个Javascript控制一下就可以了），直接导致发布文章之后文章显示会换行2次，在HTML源代码中可以看到在行跟行之间出现了&lt;BR&gt;&lt;BR&gt;2次，导致行与行之间多出一个br。</p>
<p>解决办法：编辑htdocs\modules\<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>\edit.<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>.php文件111行，</p>
<p>将原来的</p>
<blockquote><p>$dobr = $article_obj-&gt;isNew() || $newpage;</p></blockquote>
<p>改成：</p>
<blockquote><p>//Modified By XuYong 根据 $dohtml 调整$dobr默认值<br />
if($dohtml==0)<br />
{<br />
    $dobr = $article_obj-&gt;isNew() || $newpage;<br />
}<br />
else<br />
{<br />
    $dobr = 0;<br />
}</p></blockquote>
<p> 这样设置了“使用HTML标签”就会自动关闭“启用换行符”了。</p>

	标签： <a href="http://xuplus.com/article/tag/article" title="article" rel="tag">article</a>, <a href="http://xuplus.com/article/tag/hack" title="Hack" rel="tag">Hack</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/08/a54.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[Hack]让Article模组子分类的文章可以加入到上级分类的专题中</title>
		<link>http://xuplus.com/article/2007/07/a49.html</link>
		<comments>http://xuplus.com/article/2007/07/a49.html#comments</comments>
		<pubDate>Thu, 26 Jul 2007 01:54:01 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[Hack]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=49</guid>
		<description><![CDATA[当在article的某个分类添加了一个专题之后，目前的限制了将该分类下级分类的文章添加到这个专题中，这点限制在我看来不是很合理，作为拥有下级分类的分类，从隶属关系上讲下级分类的文章也应当属于该分类的，而且作为拥有下级分类的文章，这个分类所直接隶属的文章应当非常少，只有放到其下所有分类都不合适的时候，才放入该分类中。 修改htdocs\modules\article\cp.article.php文件212行附近， 原来为： unset($subCategories_obj); if(!empty($category_id)){ $criteria = new CriteriaCompo(new Criteria("top_expire", time(), "&#62;")); $topics_obj =&#38; $topic_handler-&#62;getByCategory($category_id, $xoopsModuleConfig["topics_max"], 0, $criteria, array("top_title")); if(count($topics_obj)&#62;0) foreach($topics_obj as $id=&#62;$topic){ $topics[] = array( 修改为： unset($subCategories_obj); if(!empty($category_id)){ $criteria = new CriteriaCompo(new Criteria("top_expire", time(), "&#62;")); //Hack by XuYong 子分类的文章可以加入到上级分类的专题中 $category_pid= 0; if(!empty($category_id))$category_pid = $category_obj-&#62;getVar("cat_pid"); // $topics_obj =&#38; $topic_handler-&#62;getByCategory($category_id, $xoopsModuleConfig["topics_max"], 0, $criteria, array("top_title")); $topics_obj =&#38; [...]]]></description>
			<content:encoded><![CDATA[<p>当在article的某个分类添加了一个专题之后，目前的限制了将该分类下级分类的文章添加到这个专题中，这点限制在我看来不是很合理，作为拥有下级分类的分类，从隶属关系上讲下级分类的文章也应当属于该分类的，而且作为拥有下级分类的文章，这个分类所直接隶属的文章应当非常少，只有放到其下所有分类都不合适的时候，才放入该分类中。</p>
<p>修改htdocs\modules\<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>\cp.<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>.php文件212行附近，</p>
<p>原来为：</p>
<pre class="csharpcode">    unset($subCategories_obj);
    <span class="kwrd">if</span>(!empty($category_id)){
        $criteria = <span class="kwrd">new</span> CriteriaCompo(<span class="kwrd">new</span> Criteria(<span class="str">"top_expire"</span>, time(), <span class="str">"&gt;"</span>));
        $topics_obj =&amp; $topic_handler-&gt;getByCategory($category_id, $xoopsModuleConfig[<span class="str">"topics_max"</span>], 0, $criteria, array(<span class="str">"top_title"</span>));
        <span class="kwrd">if</span>(count($topics_obj)&gt;0) <span class="kwrd">foreach</span>($topics_obj <span class="kwrd">as</span> $id=&gt;$topic){
            $topics[] = array(</pre>
<style type="text/css">  .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt  {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>
<p><font size="2">修改为：</font></p>
<pre class="csharpcode">    unset($subCategories_obj);
    <span class="kwrd">if</span>(!empty($category_id)){
        $criteria = <span class="kwrd">new</span> CriteriaCompo(<span class="kwrd">new</span> Criteria(<span class="str">"top_expire"</span>, time(), <span class="str">"&gt;"</span>));
        <span class="rem">//<a href="http://xuplus.com/article/tag/hack" class="st_tag internal_tag" rel="tag" title="标签 Hack 下的日志">Hack</a> by XuYong 子分类的文章可以加入到上级分类的专题中</span>
        $category_pid= 0;
        <span class="kwrd">if</span>(!empty($category_id))$category_pid = $category_obj-&gt;getVar(<span class="str">"cat_pid"</span>);
        <span class="rem">//        $topics_obj =&amp; $topic_handler-&gt;getByCategory($category_id, $xoopsModuleConfig["topics_max"], 0, $criteria, array("top_title"));</span>
                $topics_obj =&amp; $topic_handler-&gt;getByCategory($category_pid, $xoopsModuleConfig[<span class="str">"topics_max"</span>], 0, $criteria, array(<span class="str">"top_title"</span>));
        <span class="rem">//End Hack</span>
        <span class="kwrd">if</span>(count($topics_obj)&gt;0) <span class="kwrd">foreach</span>($topics_obj <span class="kwrd">as</span> $id=&gt;$topic){
            $topics[] = array(</pre>
<style type="text/css">  .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt  {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>

	标签： <a href="http://xuplus.com/article/tag/article" title="article" rel="tag">article</a>, <a href="http://xuplus.com/article/tag/hack" title="Hack" rel="tag">Hack</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/07/a49.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Hack]更改article模组输出feed时时间不对的缺陷</title>
		<link>http://xuplus.com/article/2007/07/a48.html</link>
		<comments>http://xuplus.com/article/2007/07/a48.html#comments</comments>
		<pubDate>Thu, 26 Jul 2007 01:32:10 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[时区]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=48</guid>
		<description><![CDATA[服务时区设置为+8，在命令行行下显示正常，XOOPS中设置服务器所在时区为+0800，可article输出的feed时时间却怎么也不对，导致outlookRSS订阅中显示的文章时间也不对均为GMT+1600时区，哪有这样的时区哦，时区范围GMT-1200～GMT+1200。 修改方法如下： 1、修改htdocs\modules\article\class\feedcreator.class.php文件中739行附近FeedDate类的构造函数FeedDate如下： 1: function FeedDate($dateString="") { 2: $tzOffset = 0; 3: if ($dateString=="") $dateString = date("r"); 4:   5: //if (is_integer($dateString)) { 6: if (is_numeric($dateString)) { 7: $this-&#62;unix = $dateString; 8: return; 9: } 10: //Hack By XuYong 调整日期格式 11: if (preg_match("~(?:(?:Mon&#124;Tue&#124;Wed&#124;Thu&#124;Fri&#124;Sat&#124;Sun),\\s+)?(\\d{1,2})\\s+([a-zA-Z]{3})\\s+(\\d{4})\\s+(\\d{2}):(\\d{2}):(\\d{2})\\s+(.*)~",$dateString,$matches)) { 12: $months = Array("Jan"=&#62;1,"Feb"=&#62;2,"Mar"=&#62;3,"Apr"=&#62;4,"May"=&#62;5,"Jun"=&#62;6,"Jul"=&#62;7,"Aug"=&#62;8,"Sep"=&#62;9,"Oct"=&#62;10,"Nov"=&#62;11,"Dec"=&#62;12); 13: $this-&#62;unix = gmmktime($matches[4],$matches[5],$matches[6],$months[$matches[2]],$matches[1],$matches[3]); 14: if (substr($matches[7],0,1)=='+' [...]]]></description>
			<content:encoded><![CDATA[<p>服务时区设置为+8，在命令行行下显示正常，XOOPS中设置服务器所在时区为+0800，可article输出的feed时时间却怎么也不对，导致outlookRSS订阅中显示的文章时间也不对均为GMT+1600<a href="http://xuplus.com/article/tag/%e6%97%b6%e5%8c%ba" class="st_tag internal_tag" rel="tag" title="标签 时区 下的日志">时区</a>，哪有这样的时区哦，时区范围GMT-1200～GMT+1200。</p>
<p>修改方法如下：</p>
<p>1、修改htdocs\modules\<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>\class\feedcreator.class.php文件中739行附近FeedDate类的构造函数FeedDate如下：</p>
<p style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border: gray 1px solid; padding: 4px">
<p style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">function</span> FeedDate($dateString=<span style="color: #006080">""</span>) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   2:</span>     $tzOffset = 0;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   3:</span>     <span style="color: #0000ff">if</span> ($dateString==<span style="color: #006080">""</span>) $dateString = date(<span style="color: #006080">"r"</span>);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   4:</span>  </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   5:</span>     <span style="color: #008000">//if (is_integer($dateString)) {</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   6:</span>     <span style="color: #0000ff">if</span> (is_numeric($dateString)) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   7:</span>         $<span style="color: #0000ff">this</span>-&gt;unix = $dateString;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   8:</span>         <span style="color: #0000ff">return</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   9:</span>     }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  10:</span>    <span style="color: #008000">//<a href="http://xuplus.com/article/tag/hack" class="st_tag internal_tag" rel="tag" title="标签 Hack 下的日志">Hack</a> By XuYong 调整日期格式</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  11:</span>     <span style="color: #0000ff">if</span> (preg_match(<span style="color: #006080">"~(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s+)?(\\d{1,2})\\s+([a-zA-Z]{3})\\s+(\\d{4})\\s+(\\d{2}):(\\d{2}):(\\d{2})\\s+(.*)~"</span>,$dateString,$matches)) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  12:</span>         $months = Array(<span style="color: #006080">"Jan"</span>=&gt;1,<span style="color: #006080">"Feb"</span>=&gt;2,<span style="color: #006080">"Mar"</span>=&gt;3,<span style="color: #006080">"Apr"</span>=&gt;4,<span style="color: #006080">"May"</span>=&gt;5,<span style="color: #006080">"Jun"</span>=&gt;6,<span style="color: #006080">"Jul"</span>=&gt;7,<span style="color: #006080">"Aug"</span>=&gt;8,<span style="color: #006080">"Sep"</span>=&gt;9,<span style="color: #006080">"Oct"</span>=&gt;10,<span style="color: #006080">"Nov"</span>=&gt;11,<span style="color: #006080">"Dec"</span>=&gt;12);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  13:</span>         $<span style="color: #0000ff">this</span>-&gt;unix = gmmktime($matches[4],$matches[5],$matches[6],$months[$matches[2]],$matches[1],$matches[3]);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  14:</span>         <span style="color: #0000ff">if</span> (substr($matches[7],0,1)==<span style="color: #006080">'+'</span> OR substr($matches[7],0,1)==<span style="color: #006080">'-'</span>) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  15:</span>             $tzOffset = (substr($matches[7],0,3) * 60 + substr($matches[7],-2)) * 60;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  16:</span>         } <span style="color: #0000ff">else</span> {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  17:</span>             <span style="color: #0000ff">if</span> (strlen($matches[7])==1) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  18:</span>                 $oneHour = 3600;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  19:</span>                 $ord = ord($matches[7]);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  20:</span>                 <span style="color: #0000ff">if</span> ($ord &lt; ord(<span style="color: #006080">"M"</span>)) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  21:</span>                     $tzOffset = (ord(<span style="color: #006080">"A"</span>) - $ord - 1) * $oneHour;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  22:</span>                 } elseif ($ord &gt;= ord(<span style="color: #006080">"M"</span>) AND $matches[7]!=<span style="color: #006080">"Z"</span>) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  23:</span>                     $tzOffset = ($ord - ord(<span style="color: #006080">"M"</span>)) * $oneHour;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  24:</span>                 } elseif ($matches[7]==<span style="color: #006080">"Z"</span>) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  25:</span>                     $tzOffset = 0;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  26:</span>                 }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  27:</span>             }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  28:</span>             <span style="color: #0000ff">switch</span> ($matches[7]) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  29:</span>                 <span style="color: #0000ff">case</span> <span style="color: #006080">"UT"</span>:</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  30:</span>                 <span style="color: #0000ff">case</span> <span style="color: #006080">"GMT"</span>:    $tzOffset = 0;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  31:</span>             }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  32:</span>         }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  33:</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  34:</span>         $tzOffset += date(<span style="color: #006080">"Z"</span>,0);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  35:</span>         $<span style="color: #0000ff">this</span>-&gt;unix += $tzOffset;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  36:</span>  </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  37:</span>         <span style="color: #0000ff">if</span> (TIME_ZONE!=<span style="color: #006080">""</span>)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  38:</span>         {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  39:</span>             $server_TZ = abs(intval($GLOBALS[<span style="color: #006080">'xoopsConfig'</span>][<span style="color: #006080">'server_TZ'</span>] * 3600.0));</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  40:</span>             $<span style="color: #0000ff">this</span>-&gt;unix += ($server_TZ - date(<span style="color: #006080">"Z"</span>, 0)) % 43200;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  41:</span>         }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  42:</span>  </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  43:</span>         <span style="color: #0000ff">return</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  44:</span>     }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  45:</span>     <span style="color: #0000ff">if</span> (preg_match(<span style="color: #006080">"~(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(.*)~"</span>,$dateString,$matches)) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  46:</span>         $<span style="color: #0000ff">this</span>-&gt;unix = gmmktime($matches[4],$matches[5],$matches[6],$matches[2],$matches[3],$matches[1]);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  47:</span>         <span style="color: #0000ff">if</span> (substr($matches[7],0,1)==<span style="color: #006080">'+'</span> OR substr($matches[7],0,1)==<span style="color: #006080">'-'</span>) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  48:</span>             $tzOffset = (substr($matches[7],0,3) * 60 + substr($matches[7],-2)) * 60;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  49:</span>         } <span style="color: #0000ff">else</span> {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  50:</span>             <span style="color: #0000ff">if</span> ($matches[7]==<span style="color: #006080">"Z"</span>) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  51:</span>                 $tzOffset = 0;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  52:</span>             }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  53:</span>         }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  54:</span>         $tzOffset += date(<span style="color: #006080">"Z"</span>,0);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  55:</span>         $<span style="color: #0000ff">this</span>-&gt;unix += $tzOffset;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  56:</span>  </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  57:</span>         <span style="color: #0000ff">if</span> (TIME_ZONE!=<span style="color: #006080">""</span>)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  58:</span>         {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  59:</span>             $server_TZ = abs(intval($GLOBALS[<span style="color: #006080">'xoopsConfig'</span>][<span style="color: #006080">'server_TZ'</span>] * 3600.0));</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  60:</span>             $<span style="color: #0000ff">this</span>-&gt;unix += ($server_TZ - date(<span style="color: #006080">"Z"</span>, 0)) % 43200;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  61:</span>         }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  62:</span>         <span style="color: #0000ff">return</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  63:</span>     }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  64:</span>     $<span style="color: #0000ff">this</span>-&gt;unix = 0;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  65:</span> }</pre>
<p><font size="3">2、修改htdocs\modules\article\class\xml.php文件58行，</font></p>
<p><font size="3">原来为：</font></p>
<p>$TIME_ZONE = $prefix.date(“H:i”, $server_TZ);</p>
<p><font size="3">修改为：</font></p>
<p>$TIME_ZONE = $prefix.date(“H:i”, ($server_TZ &#8211; date(“Z”, 0)) % 43200); //Hack By XuYong 调整时区显示，防止出现+1600时区</p>

	标签： <a href="http://xuplus.com/article/tag/article" title="article" rel="tag">article</a>, <a href="http://xuplus.com/article/tag/feed" title="feed" rel="tag">feed</a>, <a href="http://xuplus.com/article/tag/hack" title="Hack" rel="tag">Hack</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e6%97%b6%e5%8c%ba" title="时区" rel="tag">时区</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/07/a48.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Fixed]Article模组取某个分类的子分类时出错的Bug</title>
		<link>http://xuplus.com/article/2007/07/a47.html</link>
		<comments>http://xuplus.com/article/2007/07/a47.html#comments</comments>
		<pubDate>Thu, 26 Jul 2007 01:08:25 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[Bug Fixed]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=47</guid>
		<description><![CDATA[当我们使用XOOPS的article模组时，如果我们想获取某个分类的所有子分类时，会发现取到的数据有可能不是我们所需要的，返回的却是所有分类，当然这个Bug只存在于article模组1.0版本中，下个版本中可能会被修正。（不知道D.J.什么时候出下个版本呢） 修改htdocs\modules\article\class\category.php文件中378行附近， 原来为： $category_array = $tree-&#62;getAllChild(0); 修改之后： $category_array = $tree-&#62;getAllChild($pid);//Modifyed By XuYong 没有使用$pid，导致没有起到任何作用 即可。 标签： article, Bug Fixed, XOOPS]]></description>
			<content:encoded><![CDATA[<p>当我们使用XOOPS的article模组时，如果我们想获取某个分类的所有子分类时，会发现取到的数据有可能不是我们所需要的，返回的却是所有分类，当然这个Bug只存在于article模组1.0版本中，下个版本中可能会被修正。（不知道D.J.什么时候出下个版本呢）</p>
<p>修改htdocs\modules\<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>\class\category.php文件中378行附近，</p>
<p>原来为：</p>
<p>$category_array = $tree-&gt;getAllChild(0);</p>
<p>修改之后：</p>
<p>$category_array = $tree-&gt;getAllChild($pid);<span class="rem">//Modifyed By XuYong 没有使用$pid，导致没有起到任何作用</span></p>
<style type="text/css">  .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt  {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>
<p>即可。</p>

	标签： <a href="http://xuplus.com/article/tag/article" title="article" rel="tag">article</a>, <a href="http://xuplus.com/article/tag/bug-fixed" title="Bug Fixed" rel="tag">Bug Fixed</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/07/a47.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XOOPS中修正获取真实用户名的Bug (Fixed)</title>
		<link>http://xuplus.com/article/2007/07/a46.html</link>
		<comments>http://xuplus.com/article/2007/07/a46.html#comments</comments>
		<pubDate>Wed, 25 Jul 2007 23:53:26 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[Bug Fix]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=46</guid>
		<description><![CDATA[调用XOOPS中返回用户姓名时，通过getUnameFromId返回用户姓名时，如果希望返回用户真实姓名时，但是当用户没有填写真实姓名的时候返回的将会是空串，下面这个Hack就用于解决这个问题，当用户没有填写真实姓名时返回用户登录名。 htdocs\kernel\user.php文件，139行附近将getUnameFromId函数做如下修改即可： 原函数： 1: function getUnameFromId( $userid, $usereal = 0 ) 2: { 3: $userid = intval($userid); 4: $usereal = intval($usereal); 5: if ($userid &#62; 0) { 6: $member_handler =&#38; xoops_gethandler('member'); 7: $user =&#38; $member_handler-&#62;getUser($userid); 8: if (is_object($user)) { 9: $ts =&#38; MyTextSanitizer::getInstance(); 10: if ( $usereal ) { 11: return $ts-&#62;htmlSpecialChars($user-&#62;getVar('name')); 12: } else [...]]]></description>
			<content:encoded><![CDATA[<p>调用XOOPS中返回用户姓名时，通过getUnameFromId返回用户姓名时，如果希望返回用户真实姓名时，但是当用户没有填写真实姓名的时候返回的将会是空串，下面这个Hack就用于解决这个问题，当用户没有填写真实姓名时返回用户登录名。</p>
<p>htdocs\kernel\user.php文件，139行附近将getUnameFromId函数做如下修改即可：</p>
<p>原函数：</p>
<p style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border: gray 1px solid; padding: 4px">
<p style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">function</span> getUnameFromId( $userid, $usereal = 0 )</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   2:</span> {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   3:</span>     $userid = intval($userid);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   4:</span>     $usereal = intval($usereal);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   5:</span>     <span style="color: #0000ff">if</span> ($userid &gt; 0) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   6:</span>         $member_handler =&amp; <a href="http://xuplus.com/article/tag/xoops" class="st_tag internal_tag" rel="tag" title="标签 XOOPS 下的日志">xoops</a>_gethandler(<span style="color: #006080">'member'</span>);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   7:</span>         $user =&amp; $member_handler-&gt;getUser($userid);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   8:</span>         <span style="color: #0000ff">if</span> (is_object($user)) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   9:</span>             $ts =&amp; MyTextSanitizer::getInstance();</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  10:</span>             <span style="color: #0000ff">if</span> ( $usereal ) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  11:</span>                 <span style="color: #0000ff">return</span> $ts-&gt;htmlSpecialChars($user-&gt;getVar(<span style="color: #006080">'name'</span>));</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  12:</span>             } <span style="color: #0000ff">else</span> {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  13:</span>                 <span style="color: #0000ff">return</span> $ts-&gt;htmlSpecialChars($user-&gt;getVar(<span style="color: #006080">'uname'</span>));</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  14:</span>             }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  15:</span>         }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  16:</span>     }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  17:</span>     <span style="color: #0000ff">return</span> $GLOBALS[<span style="color: #006080">'xoopsConfig'</span>][<span style="color: #006080">'anonymous'</span>];</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  18:</span> }</pre>
<p>修改之后函数为：</p>
<p style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border: gray 1px solid; padding: 4px">
<p style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">function</span> getUnameFromId( $userid, $usereal = 0 )</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   2:</span>     {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   3:</span>         $userid = intval($userid);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   4:</span>         $usereal = intval($usereal);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   5:</span>         <span style="color: #0000ff">if</span> ($userid &gt; 0) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   6:</span>             $member_handler =&amp; xoops_gethandler(<span style="color: #006080">'member'</span>);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   7:</span>             $user =&amp; $member_handler-&gt;getUser($userid);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   8:</span>             <span style="color: #0000ff">if</span> (is_object($user)) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">   9:</span>                 $ts =&amp; MyTextSanitizer::getInstance();</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  10:</span>                 <span style="color: #0000ff">if</span> ( $usereal ) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  11:</span>                     <span style="color: #0000ff">if</span>(trim($user-&gt;getVar(<span style="color: #006080">'name'</span>)) != <span style="color: #006080">''</span>) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  12:</span>                         <span style="color: #0000ff">return</span> $ts-&gt;htmlSpecialChars($user-&gt;getVar(<span style="color: #006080">'name'</span>));</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  13:</span>                     } <span style="color: #0000ff">else</span> {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  14:</span>                         <span style="color: #0000ff">return</span> $ts-&gt;htmlSpecialChars($user-&gt;getVar(<span style="color: #006080">'uname'</span>));</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  15:</span>                     }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  16:</span>                 } <span style="color: #0000ff">else</span> {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  17:</span>                     <span style="color: #0000ff">return</span> $ts-&gt;htmlSpecialChars($user-&gt;getVar(<span style="color: #006080">'uname'</span>));</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  18:</span>                 }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  19:</span>             }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  20:</span>         }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #606060">  21:</span>         <span style="color: #0000ff">return</span> $GLOBALS[<span style="color: #006080">'xoopsConfig'</span>][<span style="color: #006080">'anonymous'</span>];</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  22:</span>     }</pre>

	标签： <a href="http://xuplus.com/article/tag/bug-fix" title="Bug Fix" rel="tag">Bug Fix</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/07/a46.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Hack]给XOOPS的Transfer服务书签应用增加几种在线书签</title>
		<link>http://xuplus.com/article/2007/07/a45.html</link>
		<comments>http://xuplus.com/article/2007/07/a45.html#comments</comments>
		<pubDate>Wed, 25 Jul 2007 23:53:10 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Transfer]]></category>
		<category><![CDATA[书签]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=45</guid>
		<description><![CDATA[xoops中的transfer API非常好，但是其书签功能中支持的在线书签服务实在太少，我添加了几种现在流行的在线书签服务，当然我们还可以添加更多。 修改htdocs\Frameworks\transfer\plugin\bookmark\language\schinese_utf8.php文件如下，支持google书签、美味书签、Sina Vivi、365Key、BlogChina、Poco、Sohu、天极、和讯、QQ、百度。如果采用gb2312编码或者gbk编码则编辑htdocs\Frameworks\transfer\plugin\bookmark\language\schinese.php这个文件。 &#60;?php /** * Transfer handler for XOOPS * * This is intended to handle content intercommunication between modules as well as components * There might need to be a more explicit name for the handle since it is always confusing * * @copyright The XOOPS project http://www.xoops.org/ * @license http://www.fsf.org/copyleft/gpl.html GNU [...]]]></description>
			<content:encoded><![CDATA[<p>xoops中的transfer API非常好，但是其书签功能中支持的在线书签服务实在太少，我添加了几种现在流行的在线书签服务，当然我们还可以添加更多。</p>
<p>修改htdocs\Frameworks\<a href="http://xuplus.com/article/tag/transfer" class="st_tag internal_tag" rel="tag" title="标签 Transfer 下的日志">transfer</a>\plugin\bookmark\language\schinese_<a href="http://xuplus.com/article/tag/utf8" class="st_tag internal_tag" rel="tag" title="标签 utf8 下的日志">utf8</a>.php文件如下，支持google书签、美味书签、Sina Vivi、365Key、BlogChina、Poco、Sohu、天极、和讯、QQ、百度。如果采用gb2312编码或者gbk编码则编辑htdocs\Frameworks\transfer\plugin\bookmark\language\schinese.php这个文件。</p>
<pre class="csharpcode">&lt;?<a href="http://xuplus.com/article/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a>
<span class="rem">/**</span>
<span class="rem"> * Transfer handler for <a href="http://xuplus.com/article/tag/xoops" class="st_tag internal_tag" rel="tag" title="标签 XOOPS 下的日志">XOOPS</a></span>
<span class="rem"> *</span>
<span class="rem"> * This is intended to handle content intercommunication between modules as well as components</span>
<span class="rem"> * There might need to be a more explicit name for the handle since it is always confusing</span>
<span class="rem"> *</span>
<span class="rem"> * @copyright    The XOOPS project http://www.xoops.org/</span>
<span class="rem"> * @license        http://www.fsf.org/copyleft/gpl.html GNU public license</span>
<span class="rem"> * @author        Taiwen Jiang (phppp or D.J.) &lt;php_pp@hotmail.com&gt;</span>
<span class="rem"> * @since        3.00</span>
<span class="rem"> * @version        $Id$</span>
<span class="rem"> * @package        Frameworks::transfer</span>
<span class="rem"> */</span> 

define(<span class="str">"_MD_TRANSFER_BOOKMARK"</span>, <span class="str">"<a href="http://xuplus.com/article/tag/%e4%b9%a6%e7%ad%be" class="st_tag internal_tag" rel="tag" title="标签 书签 下的日志">书签</a>"</span>);
define(<span class="str">"_MD_TRANSFER_BOOKMARK_DESC"</span>, <span class="str">"添加到书签"</span>); 

<span class="rem">/* Chinese */</span>
define(<span class="str">"_MD_TRANSFER_BOOKMARK_ITEMS"</span>,
    <span class="str">"&lt;span id=\"<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>-bookmarkit\"&gt;&lt;ul class=\"list-bookmark\" id=\"bookmarkit\"&gt;"</span>
    . <span class="str">"&lt;li&gt;&lt;a href=\"javascript:void(google = window.open('http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;title=' + encodeURIComponent('%1\$s')+ '&amp;bkmk=' + encodeURIComponent('%2\$s') , 'google')); google.focus();\"&gt;[&lt;strong style='color:red'&gt;Google&lt;/strong&gt;]&lt;/a&gt;  &lt;/li&gt;"</span>
. <span class="str">"&lt;li&gt;&lt;a title=\"Delicious\" href=\"javascript:void(delicious=window.open('http://del.icio.us/post?url='+encodeURIComponent('%2\$s')+'&amp;title='+encodeURIComponent('%1\$s'), 'delicious'));delicious.focus();\"&gt;[&lt;strong style='color:#0000FF'&gt;del.icio.us&lt;/strong&gt;]&lt;/a&gt;  &lt;/li&gt;"</span>
. <span class="str">"&lt;li&gt;&lt;a href=\"javascript:void(vivi = window.open('http://vivi.sina.com.cn/collect/icollect.php?pid=28&amp;title=' + encodeURIComponent('%1\$s') + '&amp;url=' + encodeURIComponent('%2\$s') + '&amp;desc=' + encodeURIComponent(t), 'vivi')); vivi.focus();\"&gt;[&lt;strong style='color:red'&gt;新浪 VIVI&lt;/strong&gt;]&lt;/a&gt;  &lt;/li&gt;"</span>
. <span class="str">"&lt;li&gt;&lt;a href=\"javascript:void(365key = window.open('http://www.365key.com/storeit.aspx?t=' + encodeURIComponent('%1\$s') +'&amp;u=' + encodeURIComponent('%2\$s') + '&amp;c=' + encodeURIComponent(t), 'keyit')); 365key.focus();\"&gt;[&lt;strong style='color:#a287be'&gt;365k&lt;/strong&gt;&lt;strong style='color:#00CC00'&gt;e&lt;/strong&gt;&lt;strong style='color:#9575B6'&gt;y&lt;/strong&gt;]&lt;/a&gt;  &lt;/li&gt;"</span>
. <span class="str">"&lt;li&gt;&lt;a href=\"javascript:void(blogchina = window.open('http://blogmark.blogchina.com/jsp/key/quickaddkey.jsp?k=' + encodeURI('%1\$s') + '&amp;u='+encodeURI('%2\$s') + '&amp;c='+encodeURI(t), 'blogchina')); keyit.focus();\"&gt;[&lt;strong style='color:#74B779'&gt;博采中心&lt;/strong&gt;]&lt;/a&gt;  &lt;/li&gt;"</span>
. <span class="str">"&lt;li&gt;&lt;a href=\"javascript:void(poco = window.open('http://my.poco.cn/fav/storeIt.php?t=' + encodeURIComponent('%1\$s') + '&amp;u=' + encodeURIComponent('%2\$s') + '&amp;c=' + encodeURIComponent(t), 'keyit')); poco.focus();\"&gt;[&lt;strong style='color:#29B5DE'&gt;Poco&lt;/strong&gt;]&lt;/a&gt;  &lt;/li&gt;"</span>
. <span class="str">"&lt;li&gt;&lt;a href=\"javascript:void(sohu = window.open('http://z.sohu.com/storeit.do?t=' + encodeURIComponent('%1\$s') + '&amp;u=' + encodeURIComponent('%2\$s') +'&amp;c=' + encodeURIComponent(t), 'sohu')); sohu.focus();\"&gt;[&lt;strong style='color:#505050'&gt;SOHU狐摘&lt;/strong&gt;]&lt;/A&gt;  &lt;/li&gt;"</span>
. <span class="str">"&lt;li&gt;&lt;a href=\"javascript:void(yesky = window.open('http://hot.yesky.com/dp.aspx?t=' + encodeURIComponent('%1\$s') + '&amp;u=' + encodeURIComponent('%2\$s') + '&amp;c=' + encodeURIComponent(t) + '&amp;st=2', 'yesky')); yesky.focus();\"&gt;[&lt;strong style='color:#99CF17'&gt;天极&lt;/strong&gt;&lt;strong style='color:#FF7F00'&gt;网摘&lt;/strong&gt;]&lt;/a&gt;  &lt;/li&gt;"</span>
. <span class="str">"&lt;li&gt;&lt;a href=\"javascript:void(hexun = window.open('http://bookmark.hexun.com/post.aspx?title=' + encodeURIComponent(t) + '&amp;url=' + encodeURIComponent(u) + '&amp;excerpt=' + encodeURIComponent(e), 'HexunBookmark')); hexun.focus();\"&gt;[&lt;strong style='color:#3366CC'&gt;和讯网摘&lt;/strong&gt;]&lt;/a&gt;  &lt;/li&gt;"</span>
. <span class="str">"&lt;li&gt;&lt;a href=\"javascript:void(qq = window.open('http://shuqian.qq.com/post?title=' + encodeURIComponent('%1\$s')+ '&amp;uri=' + encodeURIComponent('%2\$s') +'&amp;jumpback=2&amp;noui=1', 'qq')); qq.focus();\"&gt;[QQ&lt;strong style='color:#74B779'&gt;书签&lt;/strong&gt;]&lt;/a&gt;  &lt;/li&gt;"</span>
. <span class="str">"&lt;li&gt;&lt;a href=\"javascript:void(baidu = window.open('http://cang.baidu.com/do/add?it=' + encodeURIComponent('%1\$s')+ '&amp;iu=' + encodeURIComponent('%2\$s') +'&amp;dc=&amp;fr=ien#nw=1'', 'baidu')); baidu.focus();\"&gt;[&lt;strong style='color:red'&gt;百度搜藏&lt;/strong&gt;]&lt;/a&gt;  &lt;/li&gt;"</span>
. <span class="str">"&lt;/ul&gt;&lt;/span&gt;"</span>
    );
?&gt;</pre>
<style type="text/css">    .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt  {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>

	标签： <a href="http://xuplus.com/article/tag/hack" title="Hack" rel="tag">Hack</a>, <a href="http://xuplus.com/article/tag/transfer" title="Transfer" rel="tag">Transfer</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e4%b9%a6%e7%ad%be" title="书签" rel="tag">书签</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/07/a45.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Hack]在XOOPS的article模组中显示完整文章标题</title>
		<link>http://xuplus.com/article/2007/07/a44.html</link>
		<comments>http://xuplus.com/article/2007/07/a44.html#comments</comments>
		<pubDate>Wed, 25 Jul 2007 23:51:17 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[title属性]]></category>
		<category><![CDATA[模组]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=44</guid>
		<description><![CDATA[D.J.老大开发的article非常好用，其中有一个小缺陷：当我们获取文章列表时一般会对文章标题截取给定长度，但是当我们这样做之后，文章列表中文章标题是被截断了，但是对应A标签的title属性中也使用了截断之后的文字。这样导致的结果是当我们把鼠标移动到文章标题上面的时候，并不能看到完整的标题。 解决办法如下： 1、修改htdocs\modules\article\blocks\block.php和blocks.article.php文件，在162行附近加入如下行代码 $_art["art_fulltitle"] = $_art["art_title"];//Modifyed By XuYong 修改之后完整代码为： $_art["art_fulltitle"] = $_art["art_title"];//Modifyed By XuYong if(!empty($options[3])){ $_art["art_title"] = xoops_substr($_art["art_title"], 0, $options[3]); } 2、在对应的模板文件中使用art_fulltitle来显示超链接的title属性。可修改article_block_article.html文件如下： &#60;ul class="blkList"&#62; &#60;{foreach item=article from=$block.articles name=art}&#62; &#60;li&#62;&#60;span class="blkTime"&#62;&#60;{$article.time}&#62;&#60;/span&#62;&#60;a href="&#60;{$xoops_url}&#62;/modules/&#60;{$block.dirname}&#62;/view.article.php&#60;{$smarty.const.URL_DELIMITER}&#62;&#60;{$article.art_id}&#62;/c&#60;{$article.cat_id}&#62;" target="_blank" title="&#60;{$article.art_fulltitle}&#62;"&#62;&#60;{$article.art_title&#124;smartTruncate:19}&#62;&#60;/a&#62;&#60;/li&#62; &#60;{/foreach}&#62; &#60;/ul&#62; 标签： article, Hack, title属性, XOOPS, 模组]]></description>
			<content:encoded><![CDATA[<p>D.J.老大开发的article非常好用，其中有一个小缺陷：当我们获取文章列表时一般会对文章标题截取给定长度，但是当我们这样做之后，文章列表中文章标题是被截断了，但是对应A标签的title属性中也使用了截断之后的文字。这样导致的结果是当我们把鼠标移动到文章标题上面的时候，并不能看到完整的标题。</p>
<p>解决办法如下：</p>
<p>1、修改htdocs\modules\<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>\blocks\block.php和blocks.<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>.php文件，在162行附近加入如下行代码</p>
<pre class="csharpcode">     $_art[<span class="str">"art_fulltitle"</span>] = $_art[<span class="str">"art_title"</span>];//Modifyed By XuYong</pre>
<style type="text/css">  .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt  {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>
<p>修改之后完整代码为：</p>
<pre class="csharpcode">            $_art[<span class="str">"art_fulltitle"</span>] = $_art[<span class="str">"art_title"</span>];<span class="rem">//Modifyed By XuYong</span>
        <span class="kwrd">if</span>(!empty($options[3])){
            $_art[<span class="str">"art_title"</span>] = <a href="http://xuplus.com/article/tag/xoops" class="st_tag internal_tag" rel="tag" title="标签 XOOPS 下的日志">xoops</a>_substr($_art[<span class="str">"art_title"</span>], 0, $options[3]);
        }</pre>
<style type="text/css">  .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt  {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>
<p>2、在对应的模板文件中使用art_fulltitle来显示超链接的title属性。可修改article_block_article.html文件如下：</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">ul</span> <span class="attr">class</span><span class="kwrd">="blkList"</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span>{foreach item=article from=$block.articles name=art}<span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">li</span><span class="kwrd">&gt;&lt;</span><span class="html">span</span> <span class="attr">class</span><span class="kwrd">="blkTime"</span><span class="kwrd">&gt;&lt;</span>{$article.time}<span class="kwrd">&gt;&lt;/</span><span class="html">span</span><span class="kwrd">&gt;&lt;</span><span class="html">a</span> <span class="attr">href</span>="&lt;{$<span class="attr">xoops_url</span>}<span class="kwrd">&gt;</span>/modules/<span class="kwrd">&lt;</span>{$block.dirname}<span class="kwrd">&gt;</span>/view.article.<a href="http://xuplus.com/article/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a><span class="kwrd">&lt;</span>{$<a href="http://xuplus.com/article/tag/smarty" class="st_tag internal_tag" rel="tag" title="标签 Smarty 下的日志">smarty</a>.const.URL_DELIMITER}<span class="kwrd">&gt;&lt;</span>{$article.art_id}<span class="kwrd">&gt;</span>/c<span class="kwrd">&lt;</span>{$article.cat_id}<span class="kwrd">&gt;</span>" target="_blank" title="<span class="kwrd">&lt;</span>{$article.art_fulltitle}<span class="kwrd">&gt;</span>"<span class="kwrd">&gt;&lt;</span>{$article.art_title|smartTruncate:19}<span class="kwrd">&gt;&lt;/</span><span class="html">a</span><span class="kwrd">&gt;&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span>{/foreach}<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">ul</span><span class="kwrd">&gt;</span></pre>
<style type="text/css">  .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt  {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>

	标签： <a href="http://xuplus.com/article/tag/article" title="article" rel="tag">article</a>, <a href="http://xuplus.com/article/tag/hack" title="Hack" rel="tag">Hack</a>, <a href="http://xuplus.com/article/tag/title%e5%b1%9e%e6%80%a7" title="title属性" rel="tag">title属性</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e6%a8%a1%e7%bb%84" title="模组" rel="tag">模组</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/07/a44.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Hack]让article模组中显示用户真实姓名</title>
		<link>http://xuplus.com/article/2007/07/a43.html</link>
		<comments>http://xuplus.com/article/2007/07/a43.html#comments</comments>
		<pubDate>Wed, 25 Jul 2007 23:50:39 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[模组]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=43</guid>
		<description><![CDATA[目前XOOPS中article模组显示的都是文章发布者的登录名，有些时候显示真实姓名可能更恰当，特别是当提交者是单位的时候，这里提一个临时解决方案，最佳方案是放到配置项中由管理员配置显示。 修改htdocs\modules\article\class\article.php文件中的getAuthor函数如下即可： function &#38;getAuthor($retrieveUname = false) { $author["uid"] = $this-&#62;getVar("uid"); if($retrieveUname){ $author["name"] = XoopsUser::getUnameFromId($author["uid"],1) ; } return $author; } 配合XOOPS中修正获取真实用户名的Bug (Fixed) 效果更好。 标签： article, Hack, XOOPS, 模组]]></description>
			<content:encoded><![CDATA[<p>目前XOOPS中article模组显示的都是文章发布者的登录名，有些时候显示真实姓名可能更恰当，特别是当提交者是单位的时候，这里提一个临时解决方案，最佳方案是放到配置项中由管理员配置显示。</p>
<p>修改htdocs\modules\<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>\class\<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>.php文件中的getAuthor函数如下即可：</p>
<pre class="csharpcode"><span class="kwrd">function</span> &amp;getAuthor($retrieveUname = <span class="kwrd">false</span>)
    {
        $author[<span class="str">"uid"</span>] = $<span class="kwrd">this</span>-&gt;getVar(<span class="str">"uid"</span>);
        <span class="kwrd">if</span>($retrieveUname){
            $author[<span class="str">"name"</span>] = XoopsUser::getUnameFromId($author[<span class="str">"uid"</span>],1) ;
        }
        <span class="kwrd">return</span> $author;
    }</pre>
<style type="text/css">.csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt  {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>
<p>配合<a rel="bookmark" href="http://xuplus.com/article/2007/07/a46.html" title="到《XOOPS中修正获取真实用户名的Bug (Fixed)》的永久链接">XOOPS中修正获取真实用户名的Bug (Fixed) </a>效果更好。</p>

	标签： <a href="http://xuplus.com/article/tag/article" title="article" rel="tag">article</a>, <a href="http://xuplus.com/article/tag/hack" title="Hack" rel="tag">Hack</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e6%a8%a1%e7%bb%84" title="模组" rel="tag">模组</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/07/a43.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XOOPS开发工作可以告一段落了</title>
		<link>http://xuplus.com/article/2007/07/a42.html</link>
		<comments>http://xuplus.com/article/2007/07/a42.html#comments</comments>
		<pubDate>Wed, 25 Jul 2007 05:30:05 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[模组]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=42</guid>
		<description><![CDATA[前段时间在家的时候帮朋友改版了网站——安徽车市（http://www.ahcarmarket.com），用的是XOOPS 2.0.16的UTF-8版。2003年的时候做安徽大中专毕业生就业信息网的时候用了XOOPS，后来在给一个朋友弄他们公司网站的时候也用了XOOPS，个人感觉XOOPS还是非常强大的一个Portal（个人觉得比CMS更贴切）。安徽车市的开发工作将移交给一个小伙来完成，今后很长一段时间内应该不会从事XOOPS的开发了，XOOPS这么好的东西也开始没落了，社区人员越来越少，新版本的发布也越来越少了。 这次开发安徽车市采用了一下模组： article文章模组作为 资讯中心，修正了UTF-8下pdf输出乱码的问题 auto汽车信息及报价 未开发完成 googlemaps地图，更改为中文地图，准备用于企业标注和电子地图 mediawiki维基，作为汽车百科 newbb论坛 Openads广告管理，自己集成Openads（原PHPAdsNews） page页面布局模组，自己更改了一些东西，适用于UTF8环境和防止用户误操作和页面静态化。 protector保护模组 securityimage图片验证码 sitemap站点地图，有修改，主动生成sitemap.xml文件， smartobject smartprofile system系统管理 tag标签， tinycontent用于站点介绍 xcgal相册模组，用于汽车图库 xmmemberstats会员管理 准备用上addresses，后台也做了一些美化。 hack和优化了相当多的内容，有时间整理一下再发布吧。里面最为满意的模组就是article和tag模组集合使用，加上URL重写，可以产生大量的链接，这个网站做到了2500篇左右的文章（还没有大量使用tag）加上5000左右的汽车信息连接页面（这个没有集成transfer和tag，对于链接数没有什么贡献），在baidu上面拥有13800个链接，在google上面拥有15000多个链接，在yahoo上面有8000多个连接。 Page模组也非常好，完全可以实现主题、布局、区块、皮肤的应用。 其实这个网站还有一些开发工作没有开发完成，这个月上班之后就没有投入精力了，转交给别人之后，应该不会再从事XOOPS的开发工作了 标签： XOOPS, 模组]]></description>
			<content:encoded><![CDATA[<p><font size="2">前段时间在家的时候帮朋友改版了网站——</font><a target="_blank" href="http://www.ahcarmarket.com/"><font size="2">安徽车市</font></a><font size="2">（</font><a href="http://www.ahcarmarket.com"><font size="2">http://www.ahcarmarket.com</font></a><font size="2">），用的是XOOPS 2.0.16的UTF-8版。2003年的时候做</font><a target="_blank" href="http://www.ahbys.com/"><font size="2">安徽大中专毕业生就业信息网</font></a><font size="2">的时候用了XOOPS，后来在给一个朋友弄他们公司网站的时候也用了XOOPS，个人感觉XOOPS还是非常强大的一个Portal（个人觉得比CMS更贴切）。安徽车市的开发工作将移交给一个小伙来完成，今后很长一段时间内应该不会从事XOOPS的开发了，XOOPS这么好的东西也开始没落了，社区人员越来越少，新版本的发布也越来越少了。</font></p>
<p><font size="2">这次开发</font><a target="_blank" href="http://www.ahcarmarket.com"><font size="2">安徽车市</font></a><font size="2">采用了一下模组：<br />
article文章模组作为 资讯中心，修正了UTF-8下pdf输出乱码的问题<br />
auto汽车信息及报价 未开发完成<br />
googlemaps地图，更改为中文地图，准备用于企业标注和电子地图<br />
mediawiki维基，作为汽车百科<br />
newbb论坛<br />
Openads广告管理，自己集成Openads（原PHPAdsNews）<br />
page页面布局模组，自己更改了一些东西，适用于UTF8环境和防止用户误操作和页面静态化。<br />
protector保护模组<br />
securityimage图片验证码<br />
sitemap站点地图，有修改，主动生成sitemap.xml文件，<br />
smartobject<br />
smartprofile<br />
system系统管理<br />
tag标签，<br />
tinycontent用于站点介绍<br />
xcgal相册模组，用于汽车图库<br />
xmmemberstats会员管理<br />
准备用上addresses，后台也做了一些美化。</font></p>
<p><font size="2">hack和优化了相当多的内容，有时间整理一下再发布吧。里面最为满意的模组就是article和tag模组集合使用，加上URL重写，可以产生大量的链接，这个网站做到了2500篇左右的文章（还没有大量使用tag）加上5000左右的汽车信息连接页面（这个没有集成transfer和tag，对于链接数没有什么贡献），在baidu上面拥有13800个链接，在google上面拥有15000多个链接，在yahoo上面有8000多个连接。</font></p>
<p><font size="2">Page模组也非常好，完全可以实现主题、布局、区块、皮肤的应用。</font></p>
<p><font size="2">其实这个网站还有一些开发工作没有开发完成，这个月上班之后就没有投入精力了，转交给别人之后，应该不会再从事XOOPS的开发工作了</font></p>

	标签： <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e6%a8%a1%e7%bb%84" title="模组" rel="tag">模组</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/07/a42.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XOOPS的Page模组UTF-8字符编码下的使用方法</title>
		<link>http://xuplus.com/article/2007/06/a38.html</link>
		<comments>http://xuplus.com/article/2007/06/a38.html#comments</comments>
		<pubDate>Mon, 25 Jun 2007 07:06:14 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[Page]]></category>
		<category><![CDATA[UTF 8]]></category>
		<category><![CDATA[xajax]]></category>
		<category><![CDATA[中文]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=38</guid>
		<description><![CDATA[文明猪汉化了非常好用的Page模组，其功能强大得过了头，充分体现了数据展现分离思想，将Xoops中原本主题、布局、区块的概念扩充到主题、布局、区块、皮肤，将原来相对固定的布局方式更改为随意布局的形式（如果可以直接拖动就更完美了），将然来局限于系统提供的区块提升到可以随意创建区块和随意利用区块的高度，但是目前Page模组仅仅只能使用GB2312编码上，如果网站采用UTF-8编码这不能利用这个Page模组。之前就找到了解决的办法，这次乘解决xajax中文显示的问题一并写出来吧。 其实这个bug是由xajax库引起的（参见我另外一篇文章：PHP中xajax库中文问题及提示返回XML文件无效的解决办法 ），解决办法是： 将page目录下所有文件全部采用UTF-8无BOM格式保存（当然语言文件不必要），至少server/page.server.php这个文件需要采用UTF-8无BOM格式保存（UltraEdit 操作方法：F12或另存为界面中格式下拉框选择‘UTF-8－无 BOM’），index.php这个也需要UTF-8无BOM格式保存，另外建立对应的UTF-8编码的语言文件。再将Framework目录下xajax目录下所有的php文件全部使用UTF-8无BOM格式保存。一般即可。 之前的一个项目中使用了UTF-8格式的Page模组，这个模组的UTF-8格式支持包还是让文明猪来发布吧，不过有需要的也可以联系我。   标签： Page, PHP, UTF 8, xajax, XOOPS, 中文]]></description>
			<content:encoded><![CDATA[<p><font size="3">文明猪汉化了非常好用的Page模组，其功能强大得过了头，充分体现了数据展现分离思想，将Xoops中原本主题、布局、区块的概念扩充到主题、布局、区块、皮肤，将原来相对固定的布局方式更改为随意布局的形式（如果可以直接拖动就更完美了），将然来局限于系统提供的区块提升到可以随意创建区块和随意利用区块的高度，但是目前Page模组仅仅只能使用GB2312编码上，如果网站采用UTF-8编码这不能利用这个Page模组。之前就找到了解决的办法，这次乘解决xajax中文显示的问题一并写出来吧。</font></p>
<p><font size="3">其实这个bug是由xajax库引起的（参见我另外一篇文章：<a href="http://xuplus.com/article/2007/06/a35.html">PHP中xajax库中文问题及提示返回XML文件无效的解决办法 </a>），解决办法是：</font></p>
<p><font size="3">将page目录下所有文件全部采用UTF-8无BOM格式保存（当然语言文件不必要），至少server/<a href="http://xuplus.com/article/tag/page" class="st_tag internal_tag" rel="tag" title="标签 Page 下的日志">page</a>.server.php这个文件需要采用UTF-8无BOM格式保存（UltraEdit 操作方法：F12或另存为界面中格式下拉框选择‘UTF-8－无 BOM’），index.php这个也需要UTF-8无BOM格式保存，另外建立对应的UTF-8编码的语言文件。再将Framework目录下xajax目录下所有的php文件全部使用UTF-8无BOM格式保存。一般即可。</font></p>
<p><font size="3">之前的一个项目中使用了UTF-8格式的Page模组，这个模组的UTF-8格式支持包还是让文明猪来发布吧，不过有需要的也可以联系我。</font></p>
<p> </p>

	标签： <a href="http://xuplus.com/article/tag/page" title="Page" rel="tag">Page</a>, <a href="http://xuplus.com/article/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://xuplus.com/article/tag/utf-8" title="UTF 8" rel="tag">UTF 8</a>, <a href="http://xuplus.com/article/tag/xajax" title="xajax" rel="tag">xajax</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e4%b8%ad%e6%96%87" title="中文" rel="tag">中文</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/06/a38.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>调整Smarty 模板引擎参数提高cache、templates_c目录读写性能</title>
		<link>http://xuplus.com/article/2007/04/a19.html</link>
		<comments>http://xuplus.com/article/2007/04/a19.html#comments</comments>
		<pubDate>Wed, 25 Apr 2007 09:10:09 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[Web应用]]></category>
		<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Smarty]]></category>
		<category><![CDATA[分级目录]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=19</guid>
		<description><![CDATA[在用Xoops建立一个站点（只用Smarty引擎也一样）时，开启缓存之后cache和templates_c这两个目录用不了多长时间就充满了上千个文件乃至几十万个文件，操作一个包含数量巨大的文件的目录本来就很慢，这样会导致这两个目录的文件读取、删除、更新都很慢，本打算写一个cache handler来解决这个问题，在跟踪Smarty代码的时候发现Smarty已经解决了这个问题，那就是Smarty的use_sub_dirs属性，将该属性设置为true即可。PHP示例代码 [coolcode lang="php"]&#60;?php   require &#8216;../libs/Smarty.class.php&#8217;;   $smarty = new Smarty;   $smarty-&#62;use_sub_dirs = true;   $smarty-&#62;compile_check = true; $smarty-&#62;debugging = true; $smarty-&#62;caching = true; $smarty-&#62;cache_lifetime = 60; $smarty-&#62;assign(“Name”,”Fred Irving Johnathan Bradley Peppergill”); $smarty-&#62;assign(“FirstName”,array(“John”,”Mary”,”James”,”Henry”)); $smarty-&#62;assign(“LastName”,array(“Doe”,”Smith”,”Johnson”,”Case”)); $smarty-&#62;assign(“Class”,array(array(“A”,”B”,”C”,”D”), array(“E”, “F”, “G”, “H”),       array(“I”, “J”, “K”, “L”), array(“M”, “N”, “O”, “P”)));   $smarty-&#62;assign(“contacts”, array(array(“phone” =&#62; “1&#8243;, [...]]]></description>
			<content:encoded><![CDATA[<p><font size="3">在用Xoops建立一个站点（只用Smarty引擎也一样）时，开启缓存之后cache和templates_c这两个目录用不了多长时间就充满了上千个文件乃至几十万个文件，操作一个包含数量巨大的文件的目录本来就很慢，这样会导致这两个目录的文件读取、删除、更新都很慢，本打算写一个cache handler来解决这个问题，在跟踪Smarty代码的时候发现Smarty已经解决了这个问题，那就是Smarty的<font color="#ff0000">use_sub_dirs</font>属性，将该属性设置为true即可。PHP示例代码</font></p>
<p>[coolcode lang="<a href="http://xuplus.com/article/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a>"]&lt;?<a href="http://xuplus.com/article/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a><br />
 <br />
require &#8216;../libs/<a href="http://xuplus.com/article/tag/smarty" class="st_tag internal_tag" rel="tag" title="标签 Smarty 下的日志">Smarty</a>.class.php&#8217;;<br />
 <br />
$smarty = new Smarty;<br />
 <br />
$smarty-&gt;use_sub_dirs = true;<br />
 <br />
$smarty-&gt;compile_check = true;<br />
$smarty-&gt;debugging = true;<br />
$smarty-&gt;caching = true;<br />
$smarty-&gt;cache_lifetime = 60;<br />
$smarty-&gt;assign(“Name”,”Fred Irving Johnathan Bradley Peppergill”);<br />
$smarty-&gt;assign(“FirstName”,array(“John”,”Mary”,”James”,”Henry”));<br />
$smarty-&gt;assign(“LastName”,array(“Doe”,”Smith”,”Johnson”,”Case”));<br />
$smarty-&gt;assign(“Class”,array(array(“A”,”B”,”C”,”D”), array(“E”, “F”, “G”, “H”),<br />
      array(“I”, “J”, “K”, “L”), array(“M”, “N”, “O”, “P”)));<br />
 <br />
$smarty-&gt;assign(“contacts”, array(array(“phone” =&gt; “1&#8243;, “fax” =&gt; “2&#8243;, “cell” =&gt; “3&#8243;),<br />
      array(“phone” =&gt; “555-4444&#8243;, “fax” =&gt; “555-3333&#8243;, “cell” =&gt; “760-1234&#8243;)));<br />
 <br />
$smarty-&gt;assign(“option_values”, array(“NY”,”NE”,”KS”,”IA”,”OK”,”TX”));<br />
$smarty-&gt;assign(“option_output”, array(“New York”,”Nebraska”,”Kansas”,”Iowa”,”Oklahoma”,”Texas”));<br />
$smarty-&gt;assign(“option_selected”, “NE”);<br />
 <br />
$smarty-&gt;display(&#8216;index.tpl&#8217;);<br />
 <br />
?&gt;<br />
[/coolcode]</p>
<p><font size="3">对应Xoops中编辑Class\template.php文件第58行附近更改<font color="#ff0000">var $use_sub_dirs = false;</font>为<font color="#ff0000">var $use_sub_dirs = true;</font>即可。</font></p>

	标签： <a href="http://xuplus.com/article/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://xuplus.com/article/tag/smarty" title="Smarty" rel="tag">Smarty</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e5%88%86%e7%ba%a7%e7%9b%ae%e5%bd%95" title="分级目录" rel="tag">分级目录</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/04/a19.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XOOPS中article模块 文章管理界面 的友好模板</title>
		<link>http://xuplus.com/article/2007/04/a12.html</link>
		<comments>http://xuplus.com/article/2007/04/a12.html#comments</comments>
		<pubDate>Wed, 18 Apr 2007 03:40:30 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[中文习惯]]></category>
		<category><![CDATA[文章管理]]></category>
		<category><![CDATA[模块]]></category>
		<category><![CDATA[模板]]></category>
		<category><![CDATA[界面友好]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=12</guid>
		<description><![CDATA[D.J. 开发的article模块确实很好用,但是他的文章管理界面不太符合中国人使用习惯(被ASP CMS 惯坏了)，充分发扬XOOPS的全部模板定制精神，做了一个针对文章管理的功能的友好模板。采用了表格显示文章列表的方式。如图：   下载附件解压到themes\你的主题名称\modules\article覆盖或者解压到modules\article\templates覆盖并在后台更新article模块.  下载地址:article_cparticle.html  标签： article, XOOPS, 中文习惯, 文章管理, 模块, 模板, 界面友好]]></description>
			<content:encoded><![CDATA[<p><font size="4">D.J. 开发的article模块确实很好用,但是他的文章管理界面不太符合中国人使用习惯(被ASP CMS 惯坏了</font><font size="4">)，充分发扬XOOPS的全部模板定制精神，做了一个针对文章管理的功能的友好模板。采用了表格显示文章列表的方式。如图：</font></p>
<p> <img width="500" src="http://xuplus.com/uploads/Image/editarticle.JPG" height="732" /></p>
<p><font size="4">下载附件解压到themes\你的主题名称\modules\article覆盖或者解压到modules\<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>\templates覆盖并在后台更新article模块.</font></p>
<p> <font size="4">下载地址:<a href="http://xuplus.com/uploads/2007/04/article_cparticle.rar">article_cparticle.html</a> </font></p>

	标签： <a href="http://xuplus.com/article/tag/article" title="article" rel="tag">article</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e4%b8%ad%e6%96%87%e4%b9%a0%e6%83%af" title="中文习惯" rel="tag">中文习惯</a>, <a href="http://xuplus.com/article/tag/%e6%96%87%e7%ab%a0%e7%ae%a1%e7%90%86" title="文章管理" rel="tag">文章管理</a>, <a href="http://xuplus.com/article/tag/%e6%a8%a1%e5%9d%97" title="模块" rel="tag">模块</a>, <a href="http://xuplus.com/article/tag/%e6%a8%a1%e6%9d%bf" title="模板" rel="tag">模板</a>, <a href="http://xuplus.com/article/tag/%e7%95%8c%e9%9d%a2%e5%8f%8b%e5%a5%bd" title="界面友好" rel="tag">界面友好</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/04/a12.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Xoops中FCKeditor的上传文件时中文文件名解决方案</title>
		<link>http://xuplus.com/article/2007/04/a8.html</link>
		<comments>http://xuplus.com/article/2007/04/a8.html#comments</comments>
		<pubDate>Thu, 12 Apr 2007 10:22:43 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[fckeditor]]></category>
		<category><![CDATA[上传]]></category>
		<category><![CDATA[中文]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=8</guid>
		<description><![CDATA[使用FCKeditor上传图片、Flash等文件时，文件名中的中文会显示为乱码并在在服务器上面保存有些全部为乱码文件，不能正常显示，在网上搜了一下前辈们的解决方法，没找到很好的解决办法。看来还有N多的人和我一样的困惑，但解决办法又如此的简单： 将 editor\filemanager\browser\default\frmupload.html 文件的编码改为UTF-8即可。 如果不能解决则 编辑upload.php文件 // Compose the file path. //Modifyed By XuYong 修正UTF-8的问题 $sFileName =iconv(“utf-8&#8243;,”gbk”,$sFileName); //End Modifyed 环境XOOPS 2.0.16 UTF-8 标签： article, fckeditor, XOOPS, 上传, 中文]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: 10pt">使用FCKeditor上传图片、Flash等文件时，文件名中的中文会显示为乱码并在在服务器上面保存有些全部为乱码文件，不能正常显示，在网上搜了一下前辈们的解决方法，没找到很好的解决办法。看来还有N多的人和我一样的困惑，但解决办法又如此的简单： </span></p>
<p><span style="font-size: 10pt">将 editor\filemanager\browser\default\frmupload.html 文件的编码改为UTF-8即可。 </span></p>
<p><span style="font-size: 10pt">如果不能解决则 </span></p>
<p><span style="font-size: 10pt">编辑upload.php文件 </span></p>
<p><span style="font-size: 10pt">// Compose the file path. </span></p>
<p><span style="font-size: 10pt">//Modifyed By XuYong 修正UTF-8的问题 </span></p>
<p><span style="font-size: 10pt">$sFileName =iconv(“utf-8&#8243;,”gbk”,$sFileName); </span></p>
<p><span style="font-size: 10pt">//End Modifyed </span></p>
<p><span style="font-size: 10pt"></span>环境XOOPS 2.0.16 UTF-8</p>

	标签： <a href="http://xuplus.com/article/tag/article" title="article" rel="tag">article</a>, <a href="http://xuplus.com/article/tag/fckeditor" title="fckeditor" rel="tag">fckeditor</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e4%b8%8a%e4%bc%a0" title="上传" rel="tag">上传</a>, <a href="http://xuplus.com/article/tag/%e4%b8%ad%e6%96%87" title="中文" rel="tag">中文</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/04/a8.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>XOOPS中Fckeditor 在arctile模组中上传失败解决方法</title>
		<link>http://xuplus.com/article/2007/04/a7.html</link>
		<comments>http://xuplus.com/article/2007/04/a7.html#comments</comments>
		<pubDate>Thu, 12 Apr 2007 10:21:03 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[XOOPS]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[fckeditor]]></category>
		<category><![CDATA[上传]]></category>

		<guid isPermaLink="false">http://xuplus.com/?p=7</guid>
		<description><![CDATA[上传过程提示信息： This file uploader is disabled. Please check the “editor/filemanager/upload/php/config.php” file 使用过程中可能出现问题。有以下几个地方要修改 modules\article\fckeditor.upload.php 中必须定义 define(“FCKUPLOAD_DISABLED”, 1); 修改class\xoopseditor\FCKeditor\editor\filemanager\upload\php\upload.php 文件头部为 //Modifyed By XuYong 解决有时不能顺利获取config.php等文件 $current_path =dirname(__FILE__); if ( DIRECTORY_SEPARATOR != “/” ) $current_path = str_replace( DIRECTORY_SEPARATOR, “/”, $current_path); require($current_path.&#8217;/config.php&#8217;) ; require($current_path.&#8217;/util.php&#8217;) ; /* require(&#8216;config.php&#8217;) ; require(&#8216;util.php&#8217;) ; */ //End Modifyed 修改class\xoopseditor\FCKeditor\editor\filemanager\upload\php\connector.php 文件头部为 //Modifyed By XuYong 解决有时不能顺利获取config.php等文件 $current_path [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: 10pt">上传过程提示信息： </span></p>
<p><span style="font-size: 10pt; color: red"><em>This file uploader is disabled. Please check the “editor/filemanager/upload/<a href="http://xuplus.com/article/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a>/config.<a href="http://xuplus.com/article/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a>” file </em></span></p>
<p><span style="font-size: 10pt">使用过程中可能出现问题。有以下几个地方要修改 </span></p>
<p><span style="font-size: 10pt; color: red">modules\<a href="http://xuplus.com/article/tag/article" class="st_tag internal_tag" rel="tag" title="标签 article 下的日志">article</a>\<a href="http://xuplus.com/article/tag/fckeditor" class="st_tag internal_tag" rel="tag" title="标签 fckeditor 下的日志">fckeditor</a>.upload.php </span></p>
<p><span style="font-size: 10pt">中必须定义 </span></p>
<p><span style="font-size: 10pt; color: red">define(“FCKUPLOAD_DISABLED”, 1); </span></p>
<p><span style="font-size: 10pt">修改<span style="color: red">class\xoopseditor\FCKeditor\editor\filemanager\upload\php\upload.php</span> </span></p>
<p><span style="font-size: 10pt">文件头部为 </span></p>
<p><span style="font-size: 10pt">//Modifyed By XuYong 解决有时不能顺利获取config.php等文件 </span></p>
<p><span style="font-size: 10pt">$current_path =dirname(__FILE__); </span></p>
<p><span style="font-size: 10pt">if ( DIRECTORY_SEPARATOR != “/” ) $current_path = str_replace( DIRECTORY_SEPARATOR, “/”, $current_path); </span></p>
<p><span style="font-size: 10pt; color: red">require($current_path.&#8217;/config.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt; color: red">require($current_path.&#8217;/util.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt">/* </span></p>
<p><span style="font-size: 10pt">require(&#8216;config.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt">require(&#8216;util.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt">*/ </span></p>
<p><span style="font-size: 10pt">//End Modifyed </span></p>
<p><span style="font-size: 10pt">修改<span style="color: red">class\xoopseditor\FCKeditor\editor\filemanager\upload\php\connector.php</span> </span></p>
<p><span style="font-size: 10pt">文件头部为 </span></p>
<p><span style="font-size: 10pt">//Modifyed By XuYong 解决有时不能顺利获取config.php等文件 </span></p>
<p><span style="font-size: 10pt">$current_path =dirname(__FILE__); </span></p>
<p><span style="font-size: 10pt">if ( DIRECTORY_SEPARATOR != “/” ) $current_path = str_replace( DIRECTORY_SEPARATOR, “/”, $current_path);<span style="color: red"> </span></span></p>
<p><span style="font-size: 10pt; color: red">require($current_path.&#8217;/config.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt; color: red">require($current_path.&#8217;/util.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt; color: red">require($current_path.&#8217;/io.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt; color: red">require($current_path.&#8217;/basexml.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt; color: red">require($current_path.&#8217;/commands.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt">/* </span></p>
<p><span style="font-size: 10pt">include(&#8216;config.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt">include(&#8216;util.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt">include(&#8216;io.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt">include(&#8216;basexml.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt">include(&#8216;commands.php&#8217;) ; </span></p>
<p><span style="font-size: 10pt">*/ </span></p>
<p><span style="font-size: 10pt">//End Modifyed </span></p>
<p>环境：<a href="http://xuplus.com/article/tag/xoops" class="st_tag internal_tag" rel="tag" title="标签 XOOPS 下的日志">XOOPS</a> 2.0.16 UTF-8</p>
<p><span style="font-size: 10pt"></span></p>

	标签： <a href="http://xuplus.com/article/tag/article" title="article" rel="tag">article</a>, <a href="http://xuplus.com/article/tag/fckeditor" title="fckeditor" rel="tag">fckeditor</a>, <a href="http://xuplus.com/article/tag/xoops" title="XOOPS" rel="tag">XOOPS</a>, <a href="http://xuplus.com/article/tag/%e4%b8%8a%e4%bc%a0" title="上传" rel="tag">上传</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2007/04/a7.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

