<?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>skidu</title>
	<atom:link href="http://www.skidu.me/feed" rel="self" type="application/rss+xml" />
	<link>http://www.skidu.me</link>
	<description>走走看看记记 &#124; 瞎折腾 &#124; skidu的口水基地</description>
	<lastBuildDate>Sun, 12 Feb 2012 16:36:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>整理一下自己在山寨Lofter中常用的Smarty方法</title>
		<link>http://www.skidu.me/sth-about-smarty.html</link>
		<comments>http://www.skidu.me/sth-about-smarty.html#comments</comments>
		<pubDate>Sun, 12 Feb 2012 16:35:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP学习]]></category>
		<category><![CDATA[smarty]]></category>
		<category><![CDATA[smarty empty]]></category>
		<category><![CDATA[smarty in_array]]></category>
		<category><![CDATA[smarty入门]]></category>
		<category><![CDATA[smarty数组]]></category>

		<guid isPermaLink="false">http://www.skidu.me/?p=1233</guid>
		<description><![CDATA[Lofter的山寨计划已经完成有快20天了，总的来说这不是一次成功的山寨，至少没有达到我的预期期望。

不过，难过归难过，遇到的一些小东西还是要整理出来的，今天先简单整理整理一下Smarty模板引擎吧。

还是得感谢一下组里面的晓龙童鞋吧，若不是他昨天问到我几个关于Smary的问题的话，我估计就又会把整理这活给抛一边去了╮(╯▽╰)╭

<span class="readmore"><a href="http://www.skidu.me/sth-about-smarty.html" title="整理一下自己在山寨Lofter中常用的Smarty方法">阅读全文——共2451字</a></span>]]></description>
			<content:encoded><![CDATA[<p>Lofter的山寨计划已经完成有快20天了，总的来说这不是一次成功的山寨，至少没有达到我的预期期望。</p>
<p>不过，难过归难过，遇到的一些小东西还是要整理出来的，今天先简单整理整理一下Smarty模板引擎吧。</p>
<p>还是得感谢一下组里面的晓龙童鞋吧，若不是他昨天问到我几个关于Smary的问题的话，我估计就又会把整理这活给抛一边去了╮(╯▽╰)╭</p>
<p>好了，下面开始正题：</p>
<p>·关于Smarty：</p>
<p>Smarty是一个使用PHP模板引擎，嗯，引擎，不过别一看“引擎”俩字就蒙了，说白了它其实就是一个别人写好的类而已，自己拿过来new一下就可以用。好吧，skidu承认自己在文笔方面确实不行，各路大神如果实在需要专业点的介绍文档还请移步度娘百科- -</p>
<p>·Smarty的安装：</p>
<p>解压下载后的Smarty压缩文件，将其中的lib文件夹拷贝到自己需要的目录即可<br />
下载地址：<a href="http://www.smarty.net/download">http://www.smarty.net/download</a><br />
本例中存放目录为：本地www根目录/<span class='wp_keywordlink_affiliate'><a href="http://www.skidu.me/tag/smarty" title="查看 smarty 中的全部文章" target="_blank">smarty</a></span>/lib</p>
<p>·快速实现一个Smarty的应用</p>
<p>首先，咱在<span class='wp_keywordlink_affiliate'><a href="http://www.skidu.me/tag/smarty" title="查看 smarty 中的全部文章" target="_blank">smarty</a></span>目录创建一个新的php文档（1.php）</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
	require(&quot;./libs/Smarty.class.php&quot;);  //包含Smarty主文件
	$tpl = new Smarty();  //实例化Smarty对象
	$tpl-&gt;template_dir=&quot;./templates&quot;;  //设置模板目录位置
	$tpl-&gt;compile_dir=&quot;./coms&quot;;  //设置合成文件存放目录位置
	$tpl-&gt;left_delimiter=&quot;&lt;{&quot;;  //设置左定界符，默认是&quot;{&quot;，个人习惯使用&quot;&lt;{&quot;
	$tpl-&gt;right_delimiter=&quot;}&gt;&quot;; //同上，默认是&quot;}&quot;
	$tpl-&gt;assign(&quot;hello&quot;,&quot;测试内容&quot;);
		//向模板分配一个变量“hello”，变量的内容为“测试内容”，可以为任意值
		//比如数据库查询结果等
	$tpl-&gt;display(&quot;1.html&quot;);
		//设置模板显示
?&gt;
</pre>
<p>接着，咱再在templates目录中创建一个1.html的文件，并在文档中输入<{$hello}><br />
用浏览器访问1.php,这时你看见了什么？<br />
<a href="http://www.skidu.me/wp-content/uploads/2012/02/1.png"><img src="http://www.skidu.me/wp-content/uploads/2012/02/1.png" alt="" title="demo1" width="299" height="114" class="alignnone size-full wp-image-1234" /></a></p>
<p>怎么样，很简单就实现了吧~</p>
<p>你可以将任意需要在网页中显示的内容分配给Smarty，然后再在模板文件中直接使用变量来输出内容。字符串、数组神马的都可以直接assign，当然，资源类型的变量是不能直接这么玩的<br />
需要注意的是，在模板中使用js、css、img等任意资源的时候，其url应相对于访问的php文件设置而非该模板文件本身！</p>
<p>·Smarty中数组的遍历</p>
<p>Smarty也有自己的数组遍历方法，分别是foreach和section，如果和php中咱们常用的遍历方法进行对比的话你会发现，其实这两个分别就是php中的foreac和for两种遍历方法</p>
<p>section遍历说明：</p>
<p>在需要遍历的位置插入<br />
<xmp><{section loop=分配的变量名 name=自己随意取一个名字}></xmp><br />
遍历内容<br />
<xmp><{/section}></xmp><br />
来进行遍历。</p>
<p>对于索引式数组，咱可以使用<xmp><{$变量名['索引值']}></xmp>直接读取值，而对于关联式数组则需使用<xmp><{$变量名.索引值}></xmp>进行读取了。<br />
比如数组$a=array(“one”,”two”,”three”,”four”,”five”)，咱$tpl->assign(“arr1&#8243;,$a)过后，在模板中<{$arr1['0']}>即可读取值one<br />
对于数组$b=array(“no1&#8243;=>”one”,”noo”=>”two”),$tpl->assing(“arr2&#8243;,$b)，则需要使用<{$arr2.noo}>才可读取值two而不是<{$arr2['noo']}><br />
好吧，不妨思考一下，数组$c=array(“one”=>”aaaa”,”two”=>”bbb”,”ccc”,”three”=>”ddd”)我们要怎样才能读取到值ccc？</p>
<p>有了它能做什么？<br />
比如说我们从数据库用户表中读取了三个用户的信息，包含ID、用户名、邮箱、电话号码等，那么它就应该是这样一种情况</p>
<pre class="brush: plain; title: ; notranslate">
$data = array(
	array(
		'id'=&gt;1,
		'username'=&gt;'张三',
		'email'=&gt;'zhangsan@qq.com',
		'phone'=&gt;'110'
		),
	array(
		'id'=&gt;2,
		'username'=&gt;'李四',
		'email'=&gt;'lisi@qq.com',
		'phone'=&gt;'120'
		),
	array(
		'id'=&gt;3,
		'username'=&gt;'王五',
		'email'=&gt;'wangwu@qq.com',
		'phone'=&gt;'119'
		)
	);
</pre>
<p>
我们将它分配给模板</p>
<pre class="brush: php; title: ; notranslate">
$tpl-&gt;assign(&quot;user&quot;,$data);
</pre>
<p>模板中我们该怎么用呢？好吧，我喜欢用section来进行遍历，我们就用一个简单的表格来输出它吧！</p>
<pre class="brush: plain; title: ; notranslate">
&lt;table&gt;
	&lt;tr&gt;
		&lt;th&gt;ID&lt;/th&gt;&lt;th&gt;用户名&lt;/th&gt;&lt;th&gt;邮箱&lt;/th&gt;&lt;th&gt;电话&lt;/th&gt;
	&lt;/tr&gt;
	&lt;{section loop=$user name=&quot;info&quot;}&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;{$user[info].id}&gt;&lt;/td&gt;
			&lt;td&gt;&lt;{$user[info].username}&gt;&lt;/td&gt;
			&lt;td&gt;&lt;{$user[info].email}&gt;&lt;/td&gt;
			&lt;td&gt;&lt;{$user[info].phone}&gt;&lt;/td&gt;
		&lt;/tr&gt;
	&lt;{/section}&gt;
&lt;/table&gt;
</pre>
<p>看到了什么？<br />
<a href="http://www.skidu.me/wp-content/uploads/2012/02/11.png"><img src="http://www.skidu.me/wp-content/uploads/2012/02/11.png" alt="" title="demo2" width="291" height="172" class="alignnone size-full wp-image-1235" /></a></p>
<p>·Smarty中的判断<br />
<xmp>{<if>}{<elseif>}{<else>}{</if>}</xmp><br />
怎么样，是不是和php中是一样的呢？仅仅是需要多写个定界符而已嘛~O(∩_∩)O~<br />
想必各位在php中已经玩的不爱了，这里就不多占篇幅了吧~</p>
<p>嗯，还差些什么呢，skidu一时有点思维短路，想不大起来了，那就简单说几句在山寨过程中遇到的一些小麻烦吧。<br />
当初skidu手册翻烂都没有翻出来，只好请教google，后来还是再Smarty官方论坛中找到了答案：</p>
<p><span class='wp_keywordlink_affiliate'><a href="http://www.skidu.me/tag/smarty" title="查看 smarty 中的全部文章" target="_blank">smarty</a></span>中使用in_array()<br />
{if 需要判断的变量 | in_array:目标数组}</p>
<p>empty()功能<br />
嗯，这个我承认是自己想太多了，直接使用<{if $data eq ""}><{/if}>进行判断即可</p>
<p>先写这些吧，如果后面想起来别的了就继续在本文更新</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skidu.me/sth-about-smarty.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Burst.Net 优惠码一枚</title>
		<link>http://www.skidu.me/burst-winter.html</link>
		<comments>http://www.skidu.me/burst-winter.html#comments</comments>
		<pubDate>Thu, 09 Feb 2012 06:52:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[乱七八糟]]></category>

		<guid isPermaLink="false">http://www.skidu.me/?p=1230</guid>
		<description><![CDATA[最近Linux部分的学习任务感觉有点繁重，很久没有来博客溜达了，甚至连邮箱都很少去打理了

今天闲里偷忙看了看邮箱才发现Burst又有优惠码了

广告神马的就不多说了，网上一搜一大把。

<span class="readmore"><a href="http://www.skidu.me/burst-winter.html" title="Burst.Net 优惠码一枚">阅读全文——共241字</a></span>]]></description>
			<content:encoded><![CDATA[<p>最近Linux部分的学习任务感觉有点繁重，很久没有来博客溜达了，甚至连邮箱都很少去打理了<br />
今天闲里偷忙看了看邮箱才发现Burst又有优惠码了<br />
广告神马的就不多说了，网上一搜一大把。<br />
因为skidu的博客之前几乎一直是丢在Burst的一枚年付VPS中的，自我感觉性价比还算不错~<br />
优惠码贴出来给有需要的朋友吧~~<br />
优惠码：WINTER20<br />
优惠幅度：20%<br />
适用范围：所有VPS套餐（应该也包括Win的VPS吧，字面上skidu是这么理解的）<br />
好了，传送门，Burst官网：<a href="http://go.skidu.me/burst" title="Burst.Net" target="_blank">www.burst.net</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skidu.me/burst-winter.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MYSQL查询一周内的数据(最近7天的)的方法</title>
		<link>http://www.skidu.me/mysql%e6%9f%a5%e8%af%a2%e4%b8%80%e5%91%a8%e5%86%85%e7%9a%84%e6%95%b0%e6%8d%ae%e6%9c%80%e8%bf%917%e5%a4%a9%e7%9a%84%e7%9a%84%e6%96%b9%e6%b3%95.html</link>
		<comments>http://www.skidu.me/mysql%e6%9f%a5%e8%af%a2%e4%b8%80%e5%91%a8%e5%86%85%e7%9a%84%e6%95%b0%e6%8d%ae%e6%9c%80%e8%bf%917%e5%a4%a9%e7%9a%84%e7%9a%84%e6%96%b9%e6%b3%95.html#comments</comments>
		<pubDate>Tue, 03 Jan 2012 11:30:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP学习]]></category>
		<category><![CDATA[网摘分享]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[最近一周]]></category>
		<category><![CDATA[最近七天]]></category>

		<guid isPermaLink="false">http://www.skidu.me/?p=1222</guid>
		<description><![CDATA[这个方法是在网上找到的，因为在lofter山寨计划中写到一个功能块的时候需要用到这种查询方法，所以skidu将它记录下来

查询一天：



<span class="readmore"><a href="http://www.skidu.me/mysql%e6%9f%a5%e8%af%a2%e4%b8%80%e5%91%a8%e5%86%85%e7%9a%84%e6%95%b0%e6%8d%ae%e6%9c%80%e8%bf%917%e5%a4%a9%e7%9a%84%e7%9a%84%e6%96%b9%e6%b3%95.html" title="MYSQL查询一周内的数据(最近7天的)的方法">阅读全文——共748字</a></span>]]></description>
			<content:encoded><![CDATA[<p>这个方法是在网上找到的，因为在lofter山寨计划中写到一个功能块的时候需要用到这种查询方法，所以skidu将它记录下来</p>
<p>查询一天：</p>
<pre class="brush: plain; title: ; notranslate">
select * from table where to_days(column_time) = to_days(now());
select * from table where date(column_time) = curdate();
</pre>
<p>查询一周：</p>
<pre class="brush: plain; title: ; notranslate">
select * from table where DATE_SUB(CURDATE(), INTERVAL 7 DAY)
 &lt;= date(column_time);
</pre>
<p>查询一个月：</p>
<pre class="brush: plain; title: ; notranslate">
select * from table where
 DATE_SUB(CURDATE(), INTERVAL INTERVAL 1 MONTH)
 &lt;= date(column_time);
</pre>
<hr />
占用宝地，再记录两条MySQL获取随机内容的语句</p>
<pre class="brush: plain; title: ; notranslate">
SELECT * FROM `table`
WHERE id &gt;=
(SELECT floor( RAND() * ((SELECT MAX(id) FROM `table`)-(SELECT MIN(id) FROM `table`)) +
(SELECT MIN(id) FROM `table`)))
ORDER BY id LIMIT 1;
</pre>
<pre class="brush: plain; title: ; notranslate">
SELECT *
FROM `table` AS t1 JOIN
(SELECT ROUND(RAND() * ((SELECT MAX(id) FROM `table`)-(SELECT MIN(id) FROM `table`))+
(SELECT MIN(id) FROM `table`))
AS id) AS t2
WHERE t1.id &gt;= t2.id
ORDER BY t1.id LIMIT 1;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.skidu.me/mysql%e6%9f%a5%e8%af%a2%e4%b8%80%e5%91%a8%e5%86%85%e7%9a%84%e6%95%b0%e6%8d%ae%e6%9c%80%e8%bf%917%e5%a4%a9%e7%9a%84%e7%9a%84%e6%96%b9%e6%b3%95.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>记录一条正则</title>
		<link>http://www.skidu.me/preg-table.html</link>
		<comments>http://www.skidu.me/preg-table.html#comments</comments>
		<pubDate>Tue, 03 Jan 2012 03:37:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP学习]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php正则]]></category>
		<category><![CDATA[正则 table]]></category>
		<category><![CDATA[正则匹配表格]]></category>

		<guid isPermaLink="false">http://www.skidu.me/?p=1217</guid>
		<description><![CDATA[今天在百度知道看见有人在问怎么用正则匹配出一个网页中的表格，我想都没想就直接丢了个

/&#60;table.*&#60;\/table&#62;/

上去，结果发现这个表达式是错误的~~囧tz~~

<span class="readmore"><a href="http://www.skidu.me/preg-table.html" title="记录一条正则">阅读全文——共178字</a></span>]]></description>
			<content:encoded><![CDATA[<p>今天在百度知道看见有人在问怎么用正则匹配出一个网页中的表格，我想都没想就直接丢了个
<pre class="brush: plain; title: ; notranslate">/&lt;table.*&lt;\/table&gt;/</pre>
<p>上去，结果发现这个表达式是错误的~~囧tz~~<br />
几经折腾，终于让我给搞出来了~~</p>
<pre class="brush: plain; title: ; notranslate">/&lt;table.*&gt;[^{]*?&lt;\/table&gt;/sm</pre>
<p>百试不爽哦亲（至少目前还没发现问题）~~ <img src='http://www.skidu.me/wp-includes/images/smilies/yct/yct007.gif' alt=':woo:' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.skidu.me/preg-table.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>也发一个视频采集函数</title>
		<link>http://www.skidu.me/php-function-video-collection.html</link>
		<comments>http://www.skidu.me/php-function-video-collection.html#comments</comments>
		<pubDate>Sat, 31 Dec 2011 05:58:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP学习]]></category>
		<category><![CDATA[56采集]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php采集]]></category>
		<category><![CDATA[优酷缩略图]]></category>
		<category><![CDATA[优酷采集]]></category>
		<category><![CDATA[土豆采集]]></category>
		<category><![CDATA[酷6采集]]></category>

		<guid isPermaLink="false">http://www.skidu.me/?p=1209</guid>
		<description><![CDATA[大概是昨天把，skidu的项目完成了后台阶段的开发，嗯，功能很简陋，但剩下的时间也不多了，所以skidu果断转入了部分前台功能的编写，因为是要山寨lofter.com，而目标站里面有一个功能就是发布视频文章的时候只需要输入视频所在网页的网址系统就能自动匹配出正确的视频地址、视频标题。于是，大概折腾了有小半天时间后，skidu写出了下面这个小函数。代码暂时只是实现了功能，并未进行性能优化处理，有兴趣的朋友可以参考参考，如若后面有时间优化它的话我会更新函数。

代码如下，配有简单注释说明(变量是自己随意命名的╮(╯▽╰)╭)~~

<span class="readmore"><a href="http://www.skidu.me/php-function-video-collection.html" title="也发一个视频采集函数">阅读全文——共2449字</a></span>]]></description>
			<content:encoded><![CDATA[<p>大概是昨天把，skidu的项目完成了后台阶段的开发，嗯，功能很简陋，但剩下的时间也不多了，所以skidu果断转入了部分前台功能的编写，因为是要山寨lofter.com，而目标站里面有一个功能就是发布视频文章的时候只需要输入视频所在网页的网址系统就能自动匹配出正确的视频地址、视频标题。于是，大概折腾了有小半天时间后，skidu写出了下面这个小函数。代码暂时只是实现了功能，并未进行性能优化处理，有兴趣的朋友可以参考参考，如若后面有时间优化它的话我会更新函数。<br />
代码如下，配有简单注释说明(变量是自己随意命名的╮(╯▽╰)╭)~~</p>
<pre class="brush: php; title: ; notranslate">
/**
  *获取视频信息
  *@param string $url 视频所在页面的网址（非视频地址）
  *@return Array $result 包含视频标题(title)、视频真实地址(content)、视频缩略图(thumb)的一个一维数组
  *@todo 暂时只支持优酷、土豆、酷六、56网的视频采集
  *@author skidu
  *@license skidu http://wwww.skidu.me/
  */
function getvideo($url){
	$url_r = &quot;/http:\/\/[\w]+\.(youku.com|tudou.com|ku6.com|56.com)[\/](.*)\/(.*)/&quot;;
	preg_match_all($url_r,$url,$n_url);
	if($n_url){
		$a = fopen($url,'rb');
		//优酷/土豆/酷6/56网
		switch($n_url[1][0]){
			//优酷采集
			case &quot;youku.com&quot;:
				preg_match_all('/id_(.*)\.html/',$url,$content);
				$title_r = &quot;/&lt;title&gt;(.*) -(.*)- 优酷视频 - 在线观看&lt;\/title&gt;/U&quot;;
				$img_r = &quot;/\+0800\|(.*?)\|\&quot;&gt;/i&quot;;
				while (!feof($a)) {
					$inn .= fread($a, 1024);
					preg_match_all($title_r,$inn,$title);
					preg_match_all($img_r,$inn,$img);
				}
				$title = $title[1][0];
				$content = &quot;http://player.youku.com/player.php/sid/&quot;.$content[1][0].&quot;/v.swf&quot;;
				$image   = $img[1][0];
				break;
			//土豆采集
			case &quot;tudou.com&quot;:
				$title_r = &quot;/,kw = title = \&quot;(.*)\&quot;/&quot;;
				$img_r = &quot;/,thumbnail = pic = \'(.*)\'/&quot;;
				$vid_r = &quot;/,iid_code = icode = \'(.*)\'/U&quot;;
				while (!feof($a)) {
					$inn.= iconv(&quot;gbk&quot;,&quot;utf-8&quot;,fread($a, 1024));
					preg_match_all($title_r,$inn,$title);
					preg_match_all($vid_r,$inn,$vid);
					preg_match_all($img_r,$inn,$img_array);
				}
				$title = $title[1][0];
				$content = &quot;http://www.tudou.com/v/&quot;.$vid[1][0].&quot;/v.swf&quot;;
				$image= $img_array[1][0];
				break;
			//酷六采集
			case &quot;ku6.com&quot;:
				$title_r = &quot;/&lt;meta name=\&quot;title\&quot; content=\&quot;(.*)\&quot; \/&gt;/U&quot;;
				$img_r =&quot;/, cover: \&quot;(.*)\&quot;, data: {/&quot;;
				$content_r = &quot;/&lt;p class=\&quot;con_A\&quot;&gt;&lt;input class=\&quot;text_A\&quot; value=\&quot;(.*)\&quot; title=\&quot;点击右侧复制按钮直接复制内容\&quot; readonly&gt;&lt;span class=\&quot;flash\&quot;&gt;加载中&lt;\/span&gt;&lt;\/p&gt;/U&quot;;
				while (!feof($a)) {
					$inn.= iconv(&quot;gbk&quot;,&quot;utf-8&quot;,fread($a, 1024));
					preg_match_all($title_r,$inn,$title);
					preg_match_all($img_r,$inn,$img_array);
					preg_match_all($content_r,$inn,$content);
				}
				$content = $content[1][0];
				$title = $title[1][0];
				$image = $img_array[1][0];
				break;
			//56采集
			case &quot;56.com&quot;:
				$hr = explode(&quot;/&quot;,$url);
				$id=$hr[4];
				$title_r = &quot;/&lt;title&gt;(.*) -(.*)-56网视频&lt;\/title&gt;/U&quot;;
				$img_r = &quot;/var _oFlv_c = \{(.*)\&quot;img\&quot;:\&quot;(.*)\&quot;\};/U&quot;;
				while (!feof($a)) {
					$inn.= fread($a, 1024);
					preg_match_all($title_r,$inn,$title);
					preg_match_all($img_r,$inn,$img_array);
				}
				$title = $title[1][0];
				$trans = array(&quot;\\&quot; =&gt; &quot;&quot;);
				$image = strtr($img_array[2][0], $trans);
				$content = &quot;http://player.56.com/&quot;.$id.&quot;.swf&quot;;
				break;
		}
		$result = array(
				&quot;title&quot;=&gt;$title,
				&quot;content&quot;=&gt;$content,
				&quot;thumb&quot;=&gt;$image
			);
		return $result;
	}else{
		return &quot;暂不支持发布该网站的视频！&quot;;
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.skidu.me/php-function-video-collection.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lofter</title>
		<link>http://www.skidu.me/lofter.html</link>
		<comments>http://www.skidu.me/lofter.html#comments</comments>
		<pubDate>Sat, 24 Dec 2011 11:16:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP学习]]></category>
		<category><![CDATA[lamp兄弟连]]></category>
		<category><![CDATA[lofter]]></category>
		<category><![CDATA[lofter.com]]></category>

		<guid isPermaLink="false">http://www.skidu.me/?p=1207</guid>
		<description><![CDATA[skidu.me搬新家了，一只位于WebNX的小VPS，价格比以前贵了不少，不过暂时感觉还算可以，月付加定期备份以防不测吧。

其实今天是想上来简单BB两句的，写了一个礼拜累计5W字的文档感觉自己手都快抽经了。

嗯，其实skidu是在准备第二期项目，这次是和2个同学一块做的，不过skidu依然感觉工作量很大。

<span class="readmore"><a href="http://www.skidu.me/lofter.html" title="Lofter">阅读全文——共472字</a></span>]]></description>
			<content:encoded><![CDATA[<p>skidu.me搬新家了，一只位于WebNX的小VPS，价格比以前贵了不少，不过暂时感觉还算可以，月付加定期备份以防不测吧。<br />
其实今天是想上来简单BB两句的，写了一个礼拜累计5W字的文档感觉自己手都快抽经了。<br />
嗯，其实skidu是在准备第二期项目，这次是和2个同学一块做的，不过skidu依然感觉工作量很大。<br />
这次项目是让我们高仿一个网站，目标站自己选，不知怎么回事我忽然就想起来了网易微博客，于是我们这组苦逼就选定<span class='wp_keywordlink_affiliate'><a href="http://www.skidu.me/tag/lofter-com" title="查看 lofter.com 中的全部文章" target="_blank">lofter.com</a></span>了。<br />
不搞不知道，原来写个项目是这么蛋疼，《需求说明书》、《编码规范》、《程序设计说明书》、《数据库设计说明书》……一大堆的分析文档 <img src='http://www.skidu.me/wp-includes/images/smilies/yct/yct033.gif' alt=':yaa:' class='wp-smiley' /><br />
嗯，截止今天为止，这些说明书差不多都算完成了，不过可能还是有遗漏的地方，那就在后面开发过程中慢慢添加吧！<br />
这次项目中skidu主要负责做网站后台，截止到目前为止差不多完成了35%的进度，当然，这个后台也是简化版的 <img src='http://www.skidu.me/wp-includes/images/smilies/yct/yct009.gif' alt=':xianmu:' class='wp-smiley' /><br />
不知道有木有哪位朋友玩过新浪微博API呢，skidu自己折腾许久都没能接入成功，各种纠结啊 <img src='http://www.skidu.me/wp-includes/images/smilies/yct/yct028.gif' alt=':da:' class='wp-smiley' /><br />
好吧，项目工期很紧，就不多BB了，继续苦逼敲代码去</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skidu.me/lofter.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>安卓机版卡农</title>
		<link>http://www.skidu.me/android-canon.html</link>
		<comments>http://www.skidu.me/android-canon.html#comments</comments>
		<pubDate>Fri, 09 Dec 2011 13:23:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[网摘分享]]></category>
		<category><![CDATA[卡农]]></category>
		<category><![CDATA[安卓]]></category>

		<guid isPermaLink="false">http://www.skidu.me/?p=1205</guid>
		<description><![CDATA[

]]></description>
			<content:encoded><![CDATA[<p><embed src="http://player.youku.com/player.php/sid/XMzAyMTc3MjY0/v.swf" allowFullScreen="true" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skidu.me/android-canon.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery——返回顶部</title>
		<link>http://www.skidu.me/jquery-top.html</link>
		<comments>http://www.skidu.me/jquery-top.html#comments</comments>
		<pubDate>Mon, 05 Dec 2011 14:38:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP学习]]></category>

		<guid isPermaLink="false">http://www.skidu.me/?p=1186</guid>
		<description><![CDATA[在北京这边的学习不知不觉就过去两个多月了，感觉前不久才完成了一期项目，现在又要开始新的项目了，各种期待中~~

好吧，今天出来吐槽只是想分享一段JQuery代码，高手勿喷~~

嗯，功能很简单，skidu萌生写这个代码的原因是因为我自己这个博客的皮肤有那个功能，嗯，就是“返回顶部”╮(╯▽╰)╭

<span class="readmore"><a href="http://www.skidu.me/jquery-top.html" title="jQuery——返回顶部">阅读全文——共519字</a></span>]]></description>
			<content:encoded><![CDATA[<p>在北京这边的学习不知不觉就过去两个多月了，感觉前不久才完成了一期项目，现在又要开始新的项目了，各种期待中~~<br />
好吧，今天出来吐槽只是想分享一段JQuery代码，高手勿喷~~<br />
嗯，功能很简单，skidu萌生写这个代码的原因是因为我自己这个博客的皮肤有那个功能，嗯，就是“返回顶部”╮(╯▽╰)╭<br />
作为一个曾经不明真相的我表示对这个小功能很是好奇，学了JS有快一周了，JQuery的使用也有两三天了，嗯，这个小功能还是被我琢磨出来了，貌似挺简单的，直接上代码吧~~<br />
首先是HTML代码部分，在需要插入“返回顶部”的位置加入以下代码：</p>
<pre class="brush: xml; title: ; notranslate">
&lt;a href=&quot;#&quot; id=&quot;top&quot;&gt;返回&lt;/a&gt;
</pre>
<p>接着，CSS代码，固定一下浏览器窗口</p>
<pre class="brush: css; title: ; notranslate">
#top{position:fixed;bottom:0;right:10px;}
</pre>
<p>嗯，最后就是JQuery代码了~~</p>
<pre class="brush: jscript; title: ; notranslate">
$('#top').click(function(){
  $('html,body').animate({scrollTop: '0px'}, 800);return false;
});
</pre>
<p>当然，代码不唯一，大家可以根据自己的喜好书写~~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skidu.me/jquery-top.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>闲来无事帖个视频~</title>
		<link>http://www.skidu.me/video-music.html</link>
		<comments>http://www.skidu.me/video-music.html#comments</comments>
		<pubDate>Sun, 20 Nov 2011 14:18:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[乱七八糟]]></category>
		<category><![CDATA[山寨]]></category>
		<category><![CDATA[翻唱]]></category>

		<guid isPermaLink="false">http://www.skidu.me/?p=1182</guid>
		<description><![CDATA[这个视频是这个周末skidu写采集规则的时候无意发现的，原文是这么描述的：原来我们在KTV里唱的很多都是韩国歌啊 华语歌弱爆了。。

大家听听就知道了。翻唱感觉已经很常见了，不过这么一下子拉出来这么多摆在skidu面前还是让俺小小滴受惊吓了一场……

不好说是谁翻唱谁吧，毕竟skidu在这方面也没太多了解，纯娱乐~呵呵

]]></description>
			<content:encoded><![CDATA[<p>这个视频是这个周末skidu写采集规则的时候无意发现的，原文是这么描述的：原来我们在KTV里唱的很多都是韩国歌啊 华语歌弱爆了。。<br />
大家听听就知道了。<span class='wp_keywordlink_affiliate'><a href="http://www.skidu.me/tag/%e7%bf%bb%e5%94%b1" title="查看 翻唱 中的全部文章" target="_blank">翻唱</a></span>感觉已经很常见了，不过这么一下子拉出来这么多摆在skidu面前还是让俺小小滴受惊吓了一场……<br />
不好说是谁<span class='wp_keywordlink_affiliate'><a href="http://www.skidu.me/tag/%e7%bf%bb%e5%94%b1" title="查看 翻唱 中的全部文章" target="_blank">翻唱</a></span>谁吧，毕竟skidu在这方面也没太多了解，纯娱乐~呵呵<br />
<embed src="http://www.tudou.com/v/HZOTJ3QJ3OI/v.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="opaque" width="480" height="400"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skidu.me/video-music.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>inner join查询的简单运用</title>
		<link>http://www.skidu.me/sql-inner-join.html</link>
		<comments>http://www.skidu.me/sql-inner-join.html#comments</comments>
		<pubDate>Thu, 10 Nov 2011 18:33:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP学习]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[SQL内联]]></category>
		<category><![CDATA[内联]]></category>
		<category><![CDATA[内联查询]]></category>

		<guid isPermaLink="false">http://www.skidu.me/?p=1177</guid>
		<description><![CDATA[今天感觉状态还不错，第一个纯过程化编写的项目也进入了垒代码的最后阶段，嗯，就剩一个订单查询功能了（应涛哥要求，我们的第一个项目都是做一个简单的小商城系统）~~

今晚在编写具体的查询语句的时候遇到了一些麻烦，首先还是简要介绍一下我弄的跟这个相关的数据库字段什么的吧



<span class="readmore"><a href="http://www.skidu.me/sql-inner-join.html" title="inner join查询的简单运用">阅读全文——共1231字</a></span>]]></description>
			<content:encoded><![CDATA[<p>今天感觉状态还不错，第一个纯过程化编写的项目也进入了垒代码的最后阶段，嗯，就剩一个订单查询功能了（应涛哥要求，我们的第一个项目都是做一个简单的小商城系统）~~<br />
今晚在编写具体的查询语句的时候遇到了一些麻烦，首先还是简要介绍一下我弄的跟这个相关的数据库字段什么的吧</p>
<pre>
订单表（orders）：
id（做唯一标示用）、uid（购买用户的ID号）、name（收件人名字）address（收件地址）、code（邮编）、phone（取件联系电话）、addtime（订单添加时间、下单时间）、sum（该订单总金额）、content（订单详情）；
订单详情表（detail）：
id（唯一标示）、orderid（订单id号）、goodsid（商品ID号）、name（商品名称）、price（商品单价）、num（购买数量）</pre>
<p>因为是做订单查询，这里skidu想做的简单一些，就查查订单的ID、包含商品的名字、订单状态（是否发货等）、订单操作（支付、确认收货神马的），那么我就需要在orders表和detail表这两个表中分别进行查询然后整合数据才能完成我的要求，呃，好麻烦╮(╯▽╰)╭</p>
<p>于是我想起了前几天涛哥简单提及过的什么左联右联<span class='wp_keywordlink_affiliate'><a href="http://www.skidu.me/tag/%e5%86%85%e8%81%94" title="查看 内联 中的全部文章" target="_blank">内联</a></span>的查询方式，立即行动，看了看当天的笔记，然后整理了一下思路，好吧，再简单测试了几次，skidu需要的SQL语句终于写出来了O(∩_∩)O！</p>
<pre>
mysql> select content,name,state from orders inner join detail on orders.content=detail.orderid where content=(select content from orders where uid=2 group by uid);
+--------------------------+--------------------------------------+-------+
|         content          |             name                     | state |
+--------------------------+--------------------------------------+-------+
| 201111101735561320946556 | 克仕（Benks）Magic HSR高清防指纹     |   0   |
| 201111101735561320946556 | 蓝魔（RAMOS） W12 MID 平板电脑8?     |   0   |
| 201111101735561320946556 | 佳能（Canon） IXUS220 HS 数码相?     |   0   |
| 201111101735561320946556 | 佳能（Canon） 320EX 闪光灯           |   0   |
| 201111101735561320946556 | 宾得（PENTAX） K-r（DAL 18-55mm      |   0   |
+--------------------------+--------------------------------------+-------+
5 rows in set (0.00 sec)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.skidu.me/sql-inner-join.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

