<?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; 代码人生</title>
	<atom:link href="http://www.yaoyingying.com/category/php-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yaoyingying.com</link>
	<description>Wordpress, Drupal 二次开发~</description>
	<lastBuildDate>Wed, 08 Feb 2012 12:54:01 +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>让Qtranslate 支持 Custom Taxonomy</title>
		<link>http://www.yaoyingying.com/2012/02/08/%e8%ae%a9qtranslate-%e6%94%af%e6%8c%81-custom-taxonomy/</link>
		<comments>http://www.yaoyingying.com/2012/02/08/%e8%ae%a9qtranslate-%e6%94%af%e6%8c%81-custom-taxonomy/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 12:52:19 +0000</pubDate>
		<dc:creator>姚 迎迎</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[代码人生]]></category>
		<category><![CDATA[Custom Taxonomy]]></category>
		<category><![CDATA[Qtranslate]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.yaoyingying.com/?p=1674</guid>
		<description><![CDATA[If you wanted to automatically detect taxonomies, and then add translation edit fields here is some code： 如果你想要自动探测 Custom Taxonomy，然后给他们加上翻译字段, 把这段代码放在主题的 function.php 里。 function qtranslate_edit_taxonomies&#40;&#41;&#123; $args=array&#40; 'public' =&#62; true , '_builtin' =&#62; false &#41;; $output = 'object'; // or objects $operator = 'and'; // 'and' or 'or' &#160; $taxonomies = get_taxonomies&#40;$args,$output,$operator&#41;; &#160; if &#40;$taxonomies&#41; &#123; foreach [...]]]></description>
		<wfw:commentRss>http://www.yaoyingying.com/2012/02/08/%e8%ae%a9qtranslate-%e6%94%af%e6%8c%81-custom-taxonomy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>去除 wordpress 链接中的域名</title>
		<link>http://www.yaoyingying.com/2012/01/05/remove-domain-from-wordpress-links/</link>
		<comments>http://www.yaoyingying.com/2012/01/05/remove-domain-from-wordpress-links/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 11:03:10 +0000</pubDate>
		<dc:creator>姚 迎迎</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WordPress Theme]]></category>

		<guid isPermaLink="false">http://www.yaoyingying.com/?p=1634</guid>
		<description><![CDATA[上次说到去除一些不必需的 class 和 ID， 从上图看出，这些 domain name 似乎也是不必须的，如果像下图： 这样会不会更好呢，下面的代码可以实现这个效果。 add_filter&#40;'walker_nav_menu_start_el' , 'yao_walker_nav_menu_start_el' , 10 , 2&#41;; function yao_walker_nav_menu_start_el&#40;$item_output, $item&#41;&#123; //print_r($item); $home_url = home_url&#40;&#41;; $site_url = site_url&#40;&#41;; preg_match&#40;&#34;/^(http:\/\/)?([^\/]+)/i&#34;,site_url&#40;&#41;, $matches&#41;; $domain = $matches&#91;0&#93;; if&#40; $domain == $home_url&#41;&#123; $replace = ''; &#125;else&#123; $replace = str_replace&#40;$matches&#91;0&#93;, '', site_url&#40;&#41;&#41;; &#125; $item-&#62;url = str_replace&#40;$home_url,$replace,$item-&#62;url&#41;; &#160; $attributes = ! empty&#40; $item-&#62;attr_title &#41; [...]]]></description>
		<wfw:commentRss>http://www.yaoyingying.com/2012/01/05/remove-domain-from-wordpress-links/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>清理wordpress菜单里的 id 和 class</title>
		<link>http://www.yaoyingying.com/2012/01/03/clear-id-and-classes-in-your-wordpress-navigation/</link>
		<comments>http://www.yaoyingying.com/2012/01/03/clear-id-and-classes-in-your-wordpress-navigation/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 04:08:54 +0000</pubDate>
		<dc:creator>姚 迎迎</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WordPress Theme]]></category>

		<guid isPermaLink="false">http://www.yaoyingying.com/?p=1612</guid>
		<description><![CDATA[wordpress 默认的菜单会产生很多 id 和 class 在代码里，打多时候，这些都是不需要的。 通过下面2个滤镜，可以去除那些我们不需要的 class 和 ID add_filter&#40;'nav_menu_css_class' , 'special_nav_class' , 10 , 2&#41;; function special_nav_class&#40;$classes, $item&#41;&#123; $current_and_home = array&#40;&#34;current-menu-item&#34;, &#34;menu-item-home&#34;, 'last'&#41;; $classes = array_intersect&#40;$item-&#38;gt;classes,$current_and_home&#41;; //保留有需要的 class return $classes; &#125; &#160; add_filter&#40;'nav_menu_item_id' , 'special_nav_item_id' , 10 , 2&#41;; function special_nav_item_id&#40;$item_id, $item&#41;&#123; $item_id = &#34;&#34;; //去除 id return $item_id; &#125; 清理之后如： 不过尚有 class=”" [...]]]></description>
		<wfw:commentRss>http://www.yaoyingying.com/2012/01/03/clear-id-and-classes-in-your-wordpress-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal7 获取自定义字段的值</title>
		<link>http://www.yaoyingying.com/2011/12/20/get-field-value-in-drupal-7/</link>
		<comments>http://www.yaoyingying.com/2011/12/20/get-field-value-in-drupal-7/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 10:41:31 +0000</pubDate>
		<dc:creator>姚 迎迎</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.yaoyingying.com/?p=1605</guid>
		<description><![CDATA[http://demo.com/drupal710/sites/default/files/news/4852401.jpg 上传到drupal7 的媒体或文件通常是这样一个地址。 http://demo.com/drupal710 我们可以通过 global $base_url 来获得。 sites/default/files 这一段，在drupal6 里可以通过 file_directory_path() 来获得的，可是在drupal7里被取消了，但是可以在 template.php 里重构这个函数，如下： function file_directory_path&#40;$scheme = 'public'&#41; &#123; return file_stream_wrapper_get_instance_by_scheme&#40;$scheme&#41;-&#62;getDirectoryPath&#40;&#41;; &#125; 下面的代码就是在 node 页面下获取自定义图片字段里上传的一个或过个图片。 可以建立一个block，运行此段代码。这样你可以任意定于这个block 的位置了，相比内置的位置选择，要灵活的多。 if &#40;arg&#40;0&#41; == 'node' &#38;&#38; is_numeric&#40;arg&#40;1&#41;&#41;&#41; $nodeid = arg&#40;1&#41;; if&#40;$nodeid&#41;&#123; $obj = node_load&#40;$nodeid&#41;; $items = field_get_items&#40;'node', $obj, 'field_image'&#41;; //echo count($items); if&#40;$items&#41;&#123; global $base_url; $a=0; while&#40;$a&#60;count&#40;$items&#41;&#41; &#123; echo [...]]]></description>
		<wfw:commentRss>http://www.yaoyingying.com/2011/12/20/get-field-value-in-drupal-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 只显示当前用户的文章</title>
		<link>http://www.yaoyingying.com/2011/12/15/list-posts-by-current-author/</link>
		<comments>http://www.yaoyingying.com/2011/12/15/list-posts-by-current-author/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 02:16:09 +0000</pubDate>
		<dc:creator>姚 迎迎</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.yaoyingying.com/?p=1600</guid>
		<description><![CDATA[当Wordpress在一个多用户的贡献者列表管理页面后，他可以看到不仅是他的文章，但也从其他捐助者的文章。即使他不能编辑其他职位，这仍可能是一个问题，如果有很多文章已经和他有搜索一页一页地找到他的文章。如何只显示他自己的文章？这段代码会显示如何做到这一点。 function mypo_parse_query_useronly&#40; $wp_query &#41; &#123; if &#40; strpos&#40; $_SERVER&#91; 'REQUEST_URI' &#93;, '/wp-admin/edit.php' &#41; !== false &#41; &#123; if &#40; !current_user_can&#40; 'level_10' &#41; &#41; &#123; global $current_user; $wp_query-&#62;set&#40; 'author', $current_user-&#62;id &#41;; &#125; &#125; &#125; &#160; add_filter&#40;'parse_query', 'mypo_parse_query_useronly' &#41;; 放在主题的 functions.php 里。]]></description>
		<wfw:commentRss>http://www.yaoyingying.com/2011/12/15/list-posts-by-current-author/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>怎么让WordPress自定义菜单在新窗口打开</title>
		<link>http://www.yaoyingying.com/2011/12/14/set-custom-menus-target-for-wordpress/</link>
		<comments>http://www.yaoyingying.com/2011/12/14/set-custom-menus-target-for-wordpress/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 07:12:52 +0000</pubDate>
		<dc:creator>姚 迎迎</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[custom menus]]></category>
		<category><![CDATA[target]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.yaoyingying.com/?p=1594</guid>
		<description><![CDATA[首先到 blog/wp-admin/nav-menus.php 页面。勾选上 链接目标。 然后在下面的自定义菜单区域，点开单个菜单单元 搞定。 Happy? Rel 属性设置以此类推。]]></description>
		<wfw:commentRss>http://www.yaoyingying.com/2011/12/14/set-custom-menus-target-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7步在 Drupal 7 中建立 Nivo Slider</title>
		<link>http://www.yaoyingying.com/2011/12/13/create-nivo-slider-for-drupal-7/</link>
		<comments>http://www.yaoyingying.com/2011/12/13/create-nivo-slider-for-drupal-7/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 07:37:55 +0000</pubDate>
		<dc:creator>姚 迎迎</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://www.yaoyingying.com/?p=1585</guid>
		<description><![CDATA[1. 在 info 文件里添加一个新REGION： 2. 在 page.tpl.php  找块地方来安置这个新的 REGION ： 3. 在结构里添加一个新的 内容类型 sliders 4. 设置这个内容模型的字段 5. 接下来就在这个内容模型里加两篇文章吧 6. OK 接着到 结构 区块 里新建一个区块，区块标题可以为空。 在区块内容里我使用 php code 的文本格式，加上下面的代码 从数据库的相关表里取出需要的字段值，这儿涉及的表还挺多。 区域设置 就选择我们之前设置的 slideshow，ok 保存，看看，刚刚加的两篇文章已经在前台页面显示了，内容都有了，附上CSS 和 JS 就OK 拉。 7. 到 主题文件夹里德 template.php 里德 hook_preprocess_html() 里加上 if&#40;theme_get_setting&#40;'slideshow'&#41;=='yes'&#41;&#123; drupal_add_css&#40;path_to_theme&#40;&#41; . '/css/pascal/pascal.css'&#41;; drupal_add_js&#40;base_path&#40;&#41;.'sites/all/libraries/nivo-slider/jquery.nivo.slider.pack.js'&#41;; drupal_add_js&#40;&#34;jQuery(window).load(function() {jQuery('#slider').nivoSlider();});&#34;,'inline'&#41;; &#125; OK拉，大公高成。当然亲，文件的位置不要搞错哦。]]></description>
		<wfw:commentRss>http://www.yaoyingying.com/2011/12/13/create-nivo-slider-for-drupal-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>探测设备系统</title>
		<link>http://www.yaoyingying.com/2011/11/24/device-os-detection/</link>
		<comments>http://www.yaoyingying.com/2011/11/24/device-os-detection/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 04:32:32 +0000</pubDate>
		<dc:creator>姚 迎迎</dc:creator>
				<category><![CDATA[代码人生]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.yaoyingying.com/?p=1577</guid>
		<description><![CDATA[Javascript 探测客户设备的操作系统 var deviceAgent = navigator.userAgent.toLowerCase&#40;&#41;; var isAndroid = deviceAgent.indexOf&#40;&#34;android&#34;&#41; &#62; -1; //&#38;&#38; ua.indexOf(&#34;mobile&#34;); &#160; var iOS = deviceAgent.match&#40;/(iphone&#124;ipod&#124;ipad)/&#41;; &#160; if &#40;iOS&#41; &#123; document.write&#40;'iOS'&#41;; &#125; else if&#40;isAndroid&#41; &#123; document.write&#40;'android'&#41;; &#125;else &#123; document.write&#40;navigator.platform&#41;; &#125; php 探测客户设备的操作系统 //Detect special conditions devices $iPod = stripos&#40;$_SERVER&#91;'HTTP_USER_AGENT'&#93;,&#34;iPod&#34;&#41;; $iPhone = stripos&#40;$_SERVER&#91;'HTTP_USER_AGENT'&#93;,&#34;iPhone&#34;&#41;; $iPad = stripos&#40;$_SERVER&#91;'HTTP_USER_AGENT'&#93;,&#34;iPad&#34;&#41;; if&#40;stripos&#40;$_SERVER&#91;'HTTP_USER_AGENT'&#93;,&#34;Android&#34;&#41; &#38;&#38; stripos&#40;$_SERVER&#91;'HTTP_USER_AGENT'&#93;,&#34;mobile&#34;&#41;&#41;&#123; $Android = true; &#125;else [...]]]></description>
		<wfw:commentRss>http://www.yaoyingying.com/2011/11/24/device-os-detection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关闭 WordPress 自动更新</title>
		<link>http://www.yaoyingying.com/2011/11/10/disable-wordpress-updates/</link>
		<comments>http://www.yaoyingying.com/2011/11/10/disable-wordpress-updates/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 07:42:14 +0000</pubDate>
		<dc:creator>姚 迎迎</dc:creator>
				<category><![CDATA[代码人生]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.yaoyingying.com/?p=1556</guid>
		<description><![CDATA[实际上这是个插件叫 Disable Updates，但是想就这点代码直接写在主题的功能文件里倒来得更加方便：]]></description>
		<wfw:commentRss>http://www.yaoyingying.com/2011/11/10/disable-wordpress-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Feeds 定制</title>
		<link>http://www.yaoyingying.com/2011/11/09/customizing-your-feeds/</link>
		<comments>http://www.yaoyingying.com/2011/11/09/customizing-your-feeds/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 08:01:33 +0000</pubDate>
		<dc:creator>姚 迎迎</dc:creator>
				<category><![CDATA[代码人生]]></category>
		<category><![CDATA[Feed]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WordPress Theme]]></category>

		<guid isPermaLink="false">http://www.yaoyingying.com/?p=1549</guid>
		<description><![CDATA[The Feed templates are located in the /wp-includes/feed-{type}.php files and include formats for rdf, rss, rss2 and atom. 这儿是一些默认的 rss 模板，定制自己的模板时可以参照。]]></description>
		<wfw:commentRss>http://www.yaoyingying.com/2011/11/09/customizing-your-feeds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

