<?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; Hack</title>
	<atom:link href="http://xuplus.com/article/tag/hack/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>[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.php 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;{$smarty.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>[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.php”){<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.php 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>[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_utf8.php文件如下，支持google书签、美味书签、Sina Vivi、365Key、BlogChina、Poco、Sohu、天极、和讯、QQ、百度。如果采用gb2312编码或者gbk编码则编辑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.php这个文件。</p>
<pre class="csharpcode">&lt;?php
<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.php<span class="kwrd">&lt;</span>{$smarty.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>
	</channel>
</rss>

