<?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>SoleSky &#187; php</title>
	<atom:link href="http://www.solesky.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.solesky.com</link>
	<description>My love, My life,My soul</description>
	<lastBuildDate>Mon, 19 Dec 2011 03:38:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Create a Page of posts</title>
		<link>http://www.solesky.com/2009/07/create-a-page-of-posts/</link>
		<comments>http://www.solesky.com/2009/07/create-a-page-of-posts/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 00:34:47 +0000</pubDate>
		<dc:creator>calcifer</dc:creator>
				<category><![CDATA[Technique]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.solesky.com/?p=827</guid>
		<description><![CDATA[Maybe sometimes we need to create a page to collect many posts that have same factor, or they are about the same topic. For example, now I have posted several posts about my journey at Yangshuo. Then I wanna create a page to display them. My plan is to create a page called &#8220;footprints&#8221; that [...]]]></description>
			<content:encoded><![CDATA[<p>Maybe sometimes we need to create a page to collect many posts that have same factor, or they are about the same topic. For example, now I have posted several posts about my journey at Yangshuo. Then I wanna create a page to display them. My plan is to create a page called &#8220;footprints&#8221; that can show a list of all my posts about journey. And then, I wanna create a sub-page to display some of them, focused on the Yangshou journey. Like this:<br />
<img class="alignnone size-full wp-image-829" title="page&amp;subpages" src="http://www.solesky.com/wp-content/uploads/2009/07/screenshot_002.png" alt="page&amp;subpages" width="246" height="213" /><br />
Then the first step is to create the &#8220;footprints&#8221; page. There are several ways to do that.</p>
<ul>
<li> The lazy one is to let it done with some plugins, such things related with &#8220;list&#8221;, anyway, I don&#8217;t remember <img src='http://www.solesky.com/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' />  . That&#8217;s quite easy to make it work. So let&#8217;s go to the second one.</li>
<li> DIY the page by yourself.  When you decide to DIY such page by yourself, we have to make a file called template file which control how the page display.</li>
</ul>
<p>The way to create a template file:</p>
<p><span id="more-827"></span></p>
<ol>
<li>: Make a copy of your &#8220;index.php&#8221; in the using theme folder, or the &#8220;single.php&#8221; if you want the comment feature. And add a few line to mention that this is a template file, just like:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Template Name: yangshuo
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Then rename as &#8220;tour.php&#8221;.
</li>
<li> : Modify some codes.<br />
you can replace the codes which fetching the posts data by new codes that get the post list function.<br />
Or make it as what I do:<br />
Find the sentence about fetching all post like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>replace with</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> query_posts<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;cat=55&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> update_post_caches<span style="color: #009900;">&#40;</span><span style="color: #000088;">$posts</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>That is to choose those category belong to &#8220;tour&#8221; (ID =55).<br />
Then find and delete the part of post content:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                &lt;div class=&quot;content&quot;&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;div class=&quot;fixed&quot;&gt;&lt;/div&gt;
		&lt;/div&gt;</pre></td></tr></table></div>

<p>Then we got a &#8220;list&#8221; that display the post only with those title and some meta information. <a href="http://www.solesky.com/footprints/">Like this</a>
</li>
<li> : Add page called &#8220;footprints&#8221; that using this template and publish~ </li>
<p>       In fact there is another way to do that, by using the search feature of word press.</p>
<ol>
<li> : We need a search link that show the post related to tour. <a href="http://www.solesky.com/category/tour-fun/">Like this: http://www.solesky.com/category/tour-fun/</a>
</li>
<li> : Create a template called tour2.php by copying the index.php and add a heading like this:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Template Name: tour
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;script&gt;location=&quot;http://www.solesky.com/category/tour-fun&quot;&lt;/script&gt;</pre></td></tr></table></div>

</li>
<p>Maybe you are clear now. This time we use the script to make a automatic &#8220;jump&#8221; to the search page of &#8220;tour&#8221;. That also make a good list for us. But this time we can&#8217;t modify the detail such as the order and meta and so on. Anyway, this methods is easier~
</li>
<p>OK, the &#8220;footprints&#8221; page show a list of posts about all my tour.<br />
Then I have to create different feature like Yangshuo tour feature.</p>
<p>The steps are quite similar. Create a template file called &#8220;yangshuo&#8221; and do step 1 as when we create the &#8220;tour.php&#8221; above.</p>
<p>Now we find the codes</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>And modify it to display only on the topic about Yangshuo.<br />
This time we use tag selection instead, so we replace this line by:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> query_posts<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag=yangshuo&amp;order=ASC'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
       <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> update_post_caches<span style="color: #009900;">&#40;</span><span style="color: #000088;">$posts</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>That&#8217;s to say we only query the posts those have Yangshuo tag from database.</p>
<p>And I don&#8217;t modify the rest part cause I want to display the content.</p>
<p><a href="http://www.solesky.com/footprints/yangshuo/">Like this</a></p>
<p>Then make a sub page called &#8220;Yangshuo&#8221; belongs to the &#8220;footprint&#8221; page using this template file and publish~<br />
~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solesky.com/2009/07/create-a-page-of-posts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Zend Studio for Eclipse&#8230; So many red crosses  -_-!</title>
		<link>http://www.solesky.com/2008/08/zend-studio-for-eclipse-so-many-red-cross-_/</link>
		<comments>http://www.solesky.com/2008/08/zend-studio-for-eclipse-so-many-red-cross-_/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 00:55:22 +0000</pubDate>
		<dc:creator>calcifer</dc:creator>
				<category><![CDATA[Technique]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sloesky.com/?p=80</guid>
		<description><![CDATA[I downloaded the Zend Studio for Eclipse yesterday. As it&#8217;s based on Eclipse IDE, I hoped that it will be very helpful for me to edit and test php project. But&#8230; There were so many red crosses appeared when I import my WP It&#8217;s impossible that WP has so many mistakes, so I check them [...]]]></description>
			<content:encoded><![CDATA[<p> <img src='http://www.solesky.com/wp-includes/images/smilies/icon_confused.gif' alt=':???:' class='wp-smiley' />  I downloaded the Zend Studio for Eclipse yesterday. As it&#8217;s based on Eclipse IDE, I hoped that it will be very helpful for me to edit and test php project. But&#8230;<br />
There were so many red crosses appeared when I import my WP  <img src='http://www.solesky.com/wp-includes/images/smilies/icon_sad.gif' alt=':sad:' class='wp-smiley' /><br />
It&#8217;s impossible that WP has so many mistakes, so I check them up to find out what&#8217; up.<br />
Damn! It&#8217;s almost the cause of html separation. Such as the failure of matching &lt;div&gt;<br />
and so on. Obviously they are all not mistakes. Just to separate the pages so that pages can use the common part.<br />
OMG&#8230; Why Zend Studio for Eclipse is so foolish&#8230; I am quite disappointed&#8230;<br />
Maybe there are so option in ZS4E that I haven&#8217;t found them, so is there anybody to help me? <img src='http://www.solesky.com/wp-includes/images/smilies/icon_question.gif' alt=':?:' class='wp-smiley' /><br />
<a class="highslide-image" onclick="return hs.expand(this, {captionId:'caption_1219884924121'});" href="http://farm4.static.flickr.com/3043/2804785132_9c2058b714.jpg"><img title="Click to enlarge" src="http://farm4.static.flickr.com/3043/2804785132_9c2058b714_t.jpg" alt="image" /></a></p>
<div id="caption_1219884924121" class="highslide-caption">ZS4E</div>
]]></content:encoded>
			<wfw:commentRss>http://www.solesky.com/2008/08/zend-studio-for-eclipse-so-many-red-cross-_/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

