<?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>Interactive Llama :: Interactive media tutorials and tips &#187; PHP</title>
	<atom:link href="http://www.interactivellama.com/blog/archives/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.interactivellama.com/blog</link>
	<description>Interactive media tutorials and tips</description>
	<lastBuildDate>Wed, 23 Nov 2011 15:25:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Gallery2 titles and keywords search engine optimization script</title>
		<link>http://www.interactivellama.com/blog/archives/gallery2-titles-and-keywords-search-engine-optimization-script/</link>
		<comments>http://www.interactivellama.com/blog/archives/gallery2-titles-and-keywords-search-engine-optimization-script/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 15:01:01 +0000</pubDate>
		<dc:creator>Stephen James</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Productivity & Workflow]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[gallery2]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[photograph]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">/blog/?p=137</guid>
		<description><![CDATA[If you are interested in the open-source image gallery web application, Gallery, you have probably read the Thirteen Ways To Add SEO To Gallery2. If you haven’t, then read that tutorial first. Within that tutorial, I mention a bulk renaming script that I have used for years with Gallery2 to change titles and keywords. This [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="float: left;" src="/blog/wp-content/uploads/2009/01/gallery2-logo.jpg" alt="" width="230" height="150" />If you are interested in the open-source image gallery web application, <a href="http://gallery.menalto.com/">Gallery</a>, you have probably read the <a href="http://gallery.menalto.com/node/70008">Thirteen Ways To Add SEO To Gallery2</a>. If you haven’t, then read that tutorial first. Within that tutorial, I mention a bulk renaming script that I have used for years with Gallery2 to change titles and keywords. This post is about that title and keyword generating bulk script. It removes some common naming conventions from the titles and removes common words from the keyword list. Do people really want to see all the photographs that contain the articles, &#8220;a,&#8221; &#8220;an&#8221; and &#8220;the.&#8221; I certainly wouldn&#8217;t.</p>
<p>The default title for Gallery2 item uploads is the file name of the image. It easier to name your files well from the beginning from the safety of either than edit the URL, titles, and keywords for your item after they are uploaded. My naming convention for a file name is photo_set-photo_subset-people_or_objects. For a photo of my parents, my bride and myself at my wedding, I used &#8220;wedding-party-parents-rachel-stephen.jpg&#8221;<span id="more-137"></span></p>
<p>When creating titles this script does the following via regular expressions:</p>
<ul>
<li>Removes &#8216;copy&#8217; (a common OS-X filename suffix)</li>
<li>Removes underscores at beginning</li>
<li>Removes underscores at end</li>
<li>Removes double underscores</li>
<li>Removes left and right parenthesis</li>
<li>Removes all single digit numbers and letters</li>
<li>Replaces underscores and hyphens with space</li>
</ul>
<p>When creating keywords from titles, this script removes the following common words and inserts commas between the remaining words:</p>
<blockquote><p>a, about, above, across, act, add, after, again, against, all, along, also, amid, among, an, and, any, are, around, as, at, back, be, been, before, behind, below, beneath, beside, besides, between, beyond, but, by, came, can, cause, change, close, come, concerning, considering, could, cover, cross, despite, did, differ, do, does, down, draw, during, each, even, every, except, excepting, excluding, far, few, find, follow, following, for, found, four, from, get, give, go, grow, had, hard, has, have, he, her, here, high, him, his, how, if, in, inside, into, is, it, just, keep, know, large, last, late, left, let, like, little, long, look, made, make, many, may, might, minus, more, most, move, much, must, my, near, never, no, now, of, off, on, one, only, onto, opposite, or, other, our, out, outside, over, own, part, past, per, plus, put, regarding, right, said, same, saw, say, see, self, set, she, should, side, small, so, some, still, such, take, tell, than, that, the, their, them, then, there, these, they, thing, this, three, through, to, too, toward, towards, try, two, under, underneath, unlike, until, up, upon, us, use, versus, very, via, want, was, way, we, went, were, what, when, where, which, while, who, why, will, with, within, without, would, you, your</p></blockquote>
<p><strong>Usage</strong></p>
<p>You can either edit the setup variables in the script or use URL variables (such as &#8220;?field=g_keywords&amp;begin_id=3000&#8243;). That example would insert keywords (test insert, not commit) based on the titles of all items after item 3000.</p>
<p><strong>Requirements</strong></p>
<ul>
<li>Some familiarity with the PHP language</li>
<li>Login credentials: server, username, database name, password</li>
<li>Item ID to begin with (default is 0, that is &#8220;all items&#8221;)</li>
<li>If you want to change my default title word removal listed above, familiarity with regular expressions</li>
</ul>
<p>Download <a href="/blog/wp-content/uploads/2009/01/gallery-seo-titles-keywords-smjdesign.txt">Gallery2 titles and keywords SEO script</a></p>
<p><em>NOTE: You will need to rename the &#8220;.txt&#8221; file to &#8220;.php&#8221; in order to run it on your server. Also this script will edit not only item names, but also albums. I&#8217;ve included copious comments in this script to aid in customizing it to your needs.<br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.interactivellama.com/blog/archives/gallery2-titles-and-keywords-search-engine-optimization-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SideBlog changes: remove titles, link post content</title>
		<link>http://www.interactivellama.com/blog/archives/sideblog-changes-remove-titles-link-post-content/</link>
		<comments>http://www.interactivellama.com/blog/archives/sideblog-changes-remove-titles-link-post-content/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 15:12:54 +0000</pubDate>
		<dc:creator>Stephen James</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Social Networks]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[sideblog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">/blog/?p=126</guid>
		<description><![CDATA[As you already know, I post all my non-reply tweets from Twitter on my personal blog with Twitter Tools. I do not display the posts with the Twitter Tools widget, but with SideBlog. With SideBlog you can place all posts from a particular category in the sidebar. I have chosen to show only my &#8220;Tweets [...]]]></description>
			<content:encoded><![CDATA[<p>As you already know, I <a href="/blog/archives/ignore-direct-tweets-and-seo-urls-with-twitter-tools-wordpress-plug-in/">post all my non-reply tweets from Twitter</a> on my personal blog with Twitter Tools. I do not display the posts with the Twitter Tools widget, but with <a href="http://wordpress.org/extend/plugins/sideblog/">SideBlog</a>. With SideBlog you can place all posts from a particular category in the sidebar. I have chosen to show only my &#8220;Tweets from Twitter&#8221; category. The original output of SideBlog places a title, post content and a permalinked &#8220;#&#8221; at the end of the post. This wasn&#8217;t minimalistic enough, and on top of that with Twitter Tools the first 40 characters of your content is your title, so you are repeating yourself. I don&#8217;t care for the pound sign, &#8220;#&#8221;, either. So I made the following changes to the plug-in.<span id="more-126"></span></p>
<p><strong>Edit One</strong><br />
This edit comments out all the SideBlog plug-in&#8217;s output except for the permalink and the content. You will find this code within SideBlog 5.1 at about line 170 within the function, sideblog($asidecategory=&#8221;).</p>
<pre><code class="js">// smjdesign BEGIN edit
$replacements[] = $sideblog_content-&gt;post_title;
// $replacements[] = wpautop($sideblog_content-&gt;post_content);
// $replacements[] = "&lt;a href=\"" . $permalink . "\"&gt;#&lt;/a&gt;";
$replacements[] = "&lt;a href=\"" . $permalink . "\"&gt;"
.format_if_content_contains_link($sideblog_content-&gt;post_content);
// $replacements[] = "&lt;a href=\"" . $permalink . "\" title=\""
.$sideblog_content-&gt;post_title . "\"&gt;"
.$sideblog_content-&gt;post_title . "&lt;/a&gt;";
// $replacements[] = $sideblog_content-&gt;post_date;
// $replacements[] = "&lt;a href=\"" . $permalink . "\"&gt;"
.$sideblog_content-&gt;post_date . "&lt;/a&gt;";
// $replacements[] = $excerpt;
// $replacements[] = $excerpt2;
// smjdesign END edit</code></pre>
<p><strong>Edit Two:<br />
</strong>Place the function, format_if_content_contains_link(), within sideblog.php. I have placed around line 200 after function, sideblog(). This function tests to see if the post content contains a link. There are better (non Regular Expression) ways to do this with PHP5. This function is needed to make content that contain links valid HTML (or XHTML). If not used, links tags will encapsulate other links tags.</p>
<pre><code>// smjdesign BEGIN edit
function format_if_content_contains_link($content) {
	if( substr($content, strlen($content)-4 , 4) == "&lt;/a&gt;" ) {
		$content_arr = split("&lt;a href",$content);
		$content = preg_replace( "/&lt;a href/", "&lt;/a&gt;&lt;a href", $content, 1);
	}
	else {
		$content .= "&lt;/a&gt;";
	}
	return ($content);
}
// smjdesign END edit</code></pre>
<p>You can view the output of these changes in the sidebar at my personal site, <a href="http://www.smjdesign.com/rachelandstephen/">Rachel and Stephen</a>.</p>
<p><strong>How to keep SideBlog posts within your post query</strong></p>
<p>I noticed that quite a few people are discovering this page by wanting to NOT exclude &#8220;SideBlog categories&#8221; from the general post query (i.e.- from index.php). To do that, you will want to remove/comment out the filter:</p>
<pre><code>add_filter('pre_get_posts','sideblog_post_filter');<code></pre>
<p>from the sideblog.php plugin file. I like to include my "SideBlog category" within the general listing, since these are asides or mini-posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.interactivellama.com/blog/archives/sideblog-changes-remove-titles-link-post-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

