<?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>不知所云 &#187; xiaonei</title>
	<atom:link href="http://leo-n.com/tag/xiaonei/feed" rel="self" type="application/rss+xml" />
	<link>http://leo-n.com</link>
	<description>Leo.N&#039;s Blog</description>
	<lastBuildDate>Tue, 12 Oct 2010 14:36:46 +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>不用插件实现分享博文至校内</title>
		<link>http://leo-n.com/share-to-xiaonei-without-plugins.html</link>
		<comments>http://leo-n.com/share-to-xiaonei-without-plugins.html#comments</comments>
		<pubDate>Tue, 30 Jun 2009 14:17:00 +0000</pubDate>
		<dc:creator>Leo.N</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[xiaonei]]></category>

		<guid isPermaLink="false">http://leo-n.com/archives/2009/06/%e4%b8%8d%e7%94%a8%e6%8f%92%e4%bb%b6%e5%ae%9e%e7%8e%b0%e5%88%86%e4%ba%ab%e5%8d%9a%e6%96%87%e8%87%b3%e6%a0%a1%e5%86%85.html</guid>
		<description><![CDATA[其实这是别人在Wordpress.org.cn上提出来的问题，因为我也时不时弄下校内，所以就研究了下怎么实现。 首先，找到你所使用模板里的single.php，用文本编辑器打开（注意选择用UTF-8编码，某则会出现乱码）。 在适当位置添加一下代码： &#60;a href="http://share.xiaonei.com/share/buttonshare.do?link=&#60;?php the_permalink() ?&#62;&#38;title=&#60;?php the_title(); ?&#62;"target="_blank"&#62;分享到校内&#60;/a&#62; 解释： http://share.xiaonei.com/share/buttonshare.do?link= 是校内提交分享地址的接口，等号后面的就是所需提交的地址； &#60;?php the_permalink() ?&#62; 这个是WordPress提取当前页面url的函数； &#60;?php the_title(); ?&#62; 这个是提取当前日志标题的函数。 这样，我们就像搭积木搬的搭出一段分享日志到校内的代码。 另外还有一种方法，根据校内提供给FireFox快速分享标签的代码，我们可以直接拿过来套用： &#60;a href="javascript:void((function(s,d,e){if(/xiaonei\.com/.test(d.location))return;var%20f='http://share.xiaonei.com/share/buttonshare.do?link=',u=d.location,l=d.title,p=[e(u),'&#38;title=',e(l)].join('');function%20a(){if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent));"&#62;分享到校内&#60;/a&#62; 对于这一串长的恶心的javascript代码，我也无能力详细解释了，反正用上去效果绝对不错。 对于代码添加位置的说明： 一般来说找到single.php里面的&#60;div id="comments"&#62;，添加于这个之上； 如果你的single.php有&#60;div id="copyright"&#62;，你可以直接添加在这里面； 如果没有，你可以先定义个&#60;div id="share"&#62; ，然后添加这里面添加上面所写的代码； 到这里，我们就可以以此类推的添加更多的分享网站： 以下代码收集于网络，未作有效性测试。 &#60;a href="http://shuqian.qq.com/post?from=3&#38;title=&#60;?php the_title(); ?&#62;&#38;uri=&#60;?php the_permalink() ?&#62;" target="_blank"&#62;QQ书签&#60;/a&#62; &#60;a href="http://cang.baidu.com/do/add?it=&#60;?php the_title(); ?&#62;&#38;iu=&#60;?php the_permalink() ?&#62;" target="_blank"&#62;百度收藏&#60;/a&#62; &#60;a href="http://del.icio.us/post?url=&#60;?php the_permalink() ?&#62;&#38;title=&#60;?php the_title(); ?&#62;" [...]]]></description>
			<content:encoded><![CDATA[<p>其实这是别人在Wordpress.org.cn上提出来的问题，因为我也时不时弄下校内，所以就研究了下怎么实现。</p>
<p>首先，找到你所使用模板里的single.php，用文本编辑器打开（注意选择用UTF-8编码，某则会出现乱码）。</p>
<p>在适当位置添加一下代码：</p>
<blockquote><p><code>&lt;a href="http://share.xiaonei.com/share/buttonshare.do?link=</code><code>&lt;?php the_permalink() ?&gt;&amp;title=&lt;?php the_title(); ?&gt;"target="_blank"&gt;分享到校内&lt;/a&gt;</code></p></blockquote>
<p>解释：</p>
<blockquote><p><code>http://share.xiaonei.com/share/buttonshare.do?link=</code></p></blockquote>
<p>是校内提交分享地址的接口，等号后面的就是所需提交的地址；</p>
<blockquote><p><code>&lt;?php the_permalink() ?&gt;</code></p></blockquote>
<p>这个是WordPress提取当前页面url的函数；</p>
<blockquote><p><code>&lt;?php the_title(); ?&gt;</code></p></blockquote>
<p>这个是提取当前日志标题的函数。</p>
<p>这样，我们就像搭积木搬的搭出一段分享日志到校内的代码。</p>
<p>另外还有一种方法，根据校内提供给FireFox快速分享标签的代码，我们可以直接拿过来套用：</p>
<p><span id="more-409"></span></p>
<blockquote><p><code>&lt;a href="javascript:void((function(s,d,e){if(/xiaonei\.com/.test(d.location))return;var%20f='http://share.xiaonei.com/share/buttonshare.do?link=',u=d.location,l=d.title,p=[e(u),'&amp;title=',e(l)].join('');function%20a(){if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent));"&gt;分享到校内&lt;/a&gt;</code></p></blockquote>
<p>对于这一串长的恶心的javascript代码，我也无能力详细解释了，反正用上去效果绝对不错。</p>
<p>对于代码添加位置的说明：</p>
<p>一般来说找到single.php里面的<code>&lt;div id="comments"&gt;</code>，添加于这个之上；</p>
<p>如果你的single.php有<code>&lt;div id="copyright"&gt;</code>，你可以直接添加在这里面；</p>
<p>如果没有，你可以先定义个<code>&lt;div id="share"&gt;</code> ，然后添加这里面添加上面所写的代码；</p>
<p>到这里，我们就可以以此类推的添加更多的分享网站：</p>
<blockquote><p>以下代码收集于网络，未作有效性测试。</p>
<p><code>&lt;a href="http://shuqian.qq.com/post?from=3&amp;title=&lt;?php the_title(); ?&gt;&amp;uri=&lt;?php the_permalink() ?&gt;" target="_blank"&gt;QQ书签&lt;/a&gt;<br />
&lt;a href="http://cang.baidu.com/do/add?it=&lt;?php the_title(); ?&gt;&amp;iu=&lt;?php the_permalink() ?&gt;" target="_blank"&gt;百度收藏&lt;/a&gt;<br />
&lt;a href="http://del.icio.us/post?url=&lt;?php the_permalink() ?&gt;&amp;title=&lt;?php the_title(); ?&gt;" target="_blank"&gt;Del.icio.us&lt;/a&gt;<br />
&lt;a href="http://google.com/bookmarks/mark?op=edit&amp;bkmk=&lt;?php the_permalink() ?&gt;&amp;title=&lt;?php the_title(); ?&gt;" target="_blank"&gt;Google书签&lt;/a&gt;<br />
&lt;a href="http://www.xianguo.com/service/submitfav/?link=&lt;?php the_permalink() ?&gt;&amp;title=&lt;?php the_title(); ?&gt;" target="_blank"&gt;鲜果&lt;/a&gt;<br />
&lt;a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=&lt;?php the_permalink() ?&gt;&amp;=&lt;?php the_title(); ?&gt;" target="_blank"&gt;yahoo收藏&lt;/a&gt;<br />
&lt;a href="http://digg.com/submit?phase=2&amp;url=&lt;?php the_permalink() ?&gt;&amp;title=&lt;?php the_title(); ?&gt;" target="_blank"&gt;digg&lt;/a&gt;<br />
&lt;a href="http://www.diglog.com/submit.aspx?title=&lt;?php the_title(); ?&gt;&amp;url=&lt;?php the_permalink() ?&gt;"&gt;diglog&lt;/a&gt;</code></p></blockquote>
<p>当然，为了保持页面整洁，我们可以在主题样式中定义一下：</p>
<blockquote><p>可根据自己喜好修改。</p>
<p><code>#share p {<br />
border-bottom:1px solid #D2D2D2;<br />
color:#717171;<br />
font-size:12px;<br />
line-height:25px;<br />
margin-right:20px;<br />
background:#99FF99;<br />
}</code></p></blockquote>
<p>由于各个模板的single.php不尽相同，所以我也无法提供确切的代码添加位置，要用的话务必先在本地环境中摸索测试下再上传。</p>
]]></content:encoded>
			<wfw:commentRss>http://leo-n.com/share-to-xiaonei-without-plugins.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

