<?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>Gosdot &#187; php</title>
	<atom:link href="http://gosdot.com/unity/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://gosdot.com/unity</link>
	<description>ux, data, design</description>
	<lastBuildDate>Sat, 22 May 2010 22:17:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MagpieRSS: Truncating Titles with fetch_rss()</title>
		<link>http://gosdot.com/unity/2008/09/22/magpierss-truncating-titles-with-fetch_rss/</link>
		<comments>http://gosdot.com/unity/2008/09/22/magpierss-truncating-titles-with-fetch_rss/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 06:50:00 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[magpie]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snoopy]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://gosdot.com/unity/?p=318</guid>
		<description><![CDATA[Truncating RSS titles for the fetch_rss() option of MagpieRSS turned out to be trickier than I initially expected.  If you aren&#8217;t a hardcore php programmer and you&#8217;re just trying to fancy up your Wordpress blog, it can be a little obtuse as to how to achieve this.  After a few Google searches turned [...]]]></description>
			<content:encoded><![CDATA[<p>Truncating RSS titles for the <code>fetch_rss()</code> option of MagpieRSS turned out to be trickier than I initially expected.  If you aren&#8217;t a hardcore php programmer and you&#8217;re just trying to fancy up your Wordpress blog, it can be a little obtuse as to how to achieve this.  After a few Google searches turned up nothing I came up with this solution&#8230;</p>
<pre>
&lt;h3&gt;Title of Your RSS Feed&lt;/h3&gt;
&lt;?php
// assign the feed to a variable named 'feed'
$feed = 'http://url-of-your-rss-feed.com/feed/';
	if ($feed) {
		include_once(ABSPATH . WPINC . '/rss.php');
// define that 'feed' is also your url
$url = $feed;
$rss = fetch_rss($feed);
// string to return if feed fails
 	if ($rss == false){
$string .= "[No Feed To Retrieve]";
	return $string;
}
$maxitems = 10;
$items = array_slice($rss-&gt;items, 0, $maxitems);
	foreach ( $items as $item ) :
// define the string which is '$title'
// define the action 'substr' means sub-string or 'part of a string'
// define where the feed string starts - first letter is '0'
// define the length of the feed string - 55 characters
// define the trailing characters - "..."
$title = substr($item['title'],0,55)." ... ";
?&gt;
&lt;ul&gt;
&lt;li&gt;
// link to the rss item origin with the description as the title
&lt;a href='&lt;?php echo $item['link']; ?&gt;' title='&lt;?php echo $item['description']; ?&gt;'&gt;
// print the truncated RSS title
&lt;?php print $title; ?&gt;
&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;?php endforeach;
}
?&gt;
&lt;br /&gt;&lt;br /&gt;
</pre>
<p>This code will allow you to truncate and print the titles of an rss feed. No more worries about whether or not that aggregated feed from Twitter or another blog will break your design.</p>
]]></content:encoded>
			<wfw:commentRss>http://gosdot.com/unity/2008/09/22/magpierss-truncating-titles-with-fetch_rss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Locked out of BBPress?</title>
		<link>http://gosdot.com/unity/2008/07/18/locked-out-of-bbpress/</link>
		<comments>http://gosdot.com/unity/2008/07/18/locked-out-of-bbpress/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 18:06:05 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[bbpress]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://gosdot.com/unity/?p=317</guid>
		<description><![CDATA[So I just spent the last fifteen minutes trying to hack my way back into my BBpress forums at code.appfrica.net.  The problem was that BBPress doesn&#8217;t consider admins the &#8217;super users&#8217; of the account.  The &#8216;administrator&#8217; rank just allows you to moderate the forum, not it&#8217;s look or anything else.  To do [...]]]></description>
			<content:encoded><![CDATA[<p>So I just spent the last fifteen minutes trying to hack my way back into my BBpress forums at code.appfrica.net.  The problem was that BBPress doesn&#8217;t consider admins the &#8217;super users&#8217; of the account.  The &#8216;administrator&#8217; rank just allows you to moderate the forum, not it&#8217;s look or anything else.  To do that you need to be what&#8217;s called a &#8216;keymaster&#8217;.  Keymasters can do anything while Administrators can do &#8216;almost&#8217; anything but that almost is pretty useless when you want to change the look of your forum!  </p>
<p>For the sake of others out there who might run into the same problem, here&#8217;s how I did it.  It&#8217;s pretty simple but no one has published anything as straight forward as this, yet (or at least I didn&#8217;t find one in my Google searches).</p>
<ol>
<li>Log into your MySQL database via PHP Admin</li>
<li>Find the &#8216;xx_usermeta&#8217; area.</li>
<li>Find the username of the account you want want to make the &#8216;keymaster&#8217;.</li>
<li>Look for the area that looks like this <code>a:1:{s:13:"administrator";b:1;}</code> and replace it with <code>a:1:{s:9:"keymaster";b:1;}</code>. </li>
<li>Log-In to the account to make sure everything worked.</li>
<li>Pat yourself on the back buckaroo, you&#8217;re done!</li>
</ol>
<p>If you know hacking, you know that having an account with the username &#8216;Admin&#8217; can be a security risk.  I got locked out of my account after changing my name from &#8216;Admin&#8217; to something else to make it harder for potential hackers to get into my forums.  Then I deleted the account called &#8216;Admin&#8217; because I thought it was enough that I promoted my new username to <em>administration</em> status.  The BBPress manual doesn&#8217;t mention the fact if you delete the Admin account, you&#8217;re deleting the sole <em>keymaster</em> effectively locking you out of the real administration of the back end of your site!</p>
<p>This technique should fix everything&#8230;at least for BBPress 0.9.0.2, the version that I used this on.</p>
]]></content:encoded>
			<wfw:commentRss>http://gosdot.com/unity/2008/07/18/locked-out-of-bbpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
