<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>php</title>
  <link rel="alternate" type="text/html" href="http://tumbleweed.org.za/tags/php"/>
  <link rel="self" type="application/atom+xml" href="http://tumbleweed.org.za/taxonomy/term/20/atom/feed"/>
  <id>http://tumbleweed.org.za/taxonomy/term/20/atom/feed</id>
  <updated>2008-09-19T08:16:10+00:00</updated>
  <entry>
    <title>MediaWiki extensions</title>
    <link rel="alternate" type="text/html" href="http://tumbleweed.org.za/code/mediawiki-extensions" />
    <id>http://tumbleweed.org.za/code/mediawiki-extensions</id>
    <published>2008-01-05T21:41:25+00:00</published>
    <updated>2008-09-21T12:24:47+00:00</updated>
    <author>
      <name>tumbleweed</name>
    </author>
    <category term="code" />
    <category term="mediawiki" />
    <category term="php" />
    <category term="Static Page" />
    <summary type="html"><![CDATA[<p>I&#8217;ve written several <a href="http://www.mediawiki.org">MediaWiki</a> extensions, mainly for the <a href="http://wiki.clug.org.za/"><span class="caps"><span class="caps">CLUG</span></span> Wiki</a>. I don&#8217;t think any of them are particularly beautiful or maintained, but they are an essential part of our wiki, and might be useful to somebody&nbsp;out&nbsp;there&#8230;</p>

<h2>Category&nbsp;Gallery:</h2>

<p>Written for <a href="http://wiki.clug.org.za/wiki/ClugPark">ClugPark</a>, this extension displays all the images in a category together, as&nbsp;a&nbsp;gallery.</p>

<p>Usage:</p>

<div class="geshifilter"><div class="xml geshifilter-xml" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;category-gallery</span> <span class="re0">category</span>=<span class="st0">&quot;PicturesOfPenguins&quot;</span> <span class="re0">resizewidth</span>=<span class="st0">&quot;50&quot;</span> <span class="re0">width</span>=<span class="st0">&quot;60&quot;</span> <span class="re0">height</span>=<span class="st0">&quot;60&quot;</span><span class="re2">&gt;</span><span class="re1">&lt;category-gallery<span class="re2">&gt;</span></span></span></div></div>

<h2>Mailman&nbsp;subscribe&nbsp;links:</h2>

<p>Written for the <a href="http://wiki.clug.org.za/wiki/CLUG_Mailing_Lists">Mailing Lists</a> page, this extension displays mailman&nbsp;subscribe&nbsp;forms.</p>

<p>Usage:</p>

<div class="geshifilter"><div class="xml geshifilter-xml" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;mailman<span class="re2">&gt;</span></span></span>http://lists.example.com/mailman/subscribe/foobar<span class="sc3"><span class="re1">&lt;/mailman<span class="re2">&gt;</span></span></span></div></div>

<h2>Obfuscate&nbsp;e-mail&nbsp;addresses:</h2>

<p>Written for the <a href="http://wiki.clug.org.za/wiki/Committee_Contact_Details">Contact a Committee Member</a> page. I use my own simple Javascript that replaces <span class="geshifilter"><code class="geshifilter-text">innerHTML</code></span> and <span class="geshifilter"><code class="geshifilter-text">href</code></span> when you mouse over an e-mail link. I think&nbsp;it&#8217;s&nbsp;spambot-proof.</p>

<p>Usage:</p>

<div class="geshifilter"><div class="xml geshifilter-xml" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;email</span> <span class="re0">domain</span>=<span class="st0">&quot;example.com&quot;</span><span class="re2">&gt;</span></span>foobar<span class="sc3"><span class="re1">&lt;/email<span class="re2">&gt;</span></span></span></div></div>
    ]]></summary>
    <content type="html"><![CDATA[<p>I&#8217;ve written several <a href="http://www.mediawiki.org">MediaWiki</a> extensions, mainly for the <a href="http://wiki.clug.org.za/"><span class="caps">CLUG</span> Wiki</a>. I don&#8217;t think any of them are particularly beautiful or maintained, but they are an essential part of our wiki, and might be useful to somebody out&nbsp;there&#8230;</p>

<h2>Category&nbsp;Gallery:</h2>

<p>Written for <a href="http://wiki.clug.org.za/wiki/ClugPark">ClugPark</a>, this extension displays all the images in a category together, as a&nbsp;gallery.</p>

<p>Usage:</p>

<div class="geshifilter"><div class="xml geshifilter-xml" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;category-gallery</span> <span class="re0">category</span>=<span class="st0">&quot;PicturesOfPenguins&quot;</span> <span class="re0">resizewidth</span>=<span class="st0">&quot;50&quot;</span> <span class="re0">width</span>=<span class="st0">&quot;60&quot;</span> <span class="re0">height</span>=<span class="st0">&quot;60&quot;</span><span class="re2">&gt;</span><span class="re1">&lt;category-gallery<span class="re2">&gt;</span></span></span></div></div>

<h2>Mailman subscribe&nbsp;links:</h2>

<p>Written for the <a href="http://wiki.clug.org.za/wiki/CLUG_Mailing_Lists">Mailing Lists</a> page, this extension displays mailman subscribe&nbsp;forms.</p>

<p>Usage:</p>

<div class="geshifilter"><div class="xml geshifilter-xml" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;mailman<span class="re2">&gt;</span></span></span>http://lists.example.com/mailman/subscribe/foobar<span class="sc3"><span class="re1">&lt;/mailman<span class="re2">&gt;</span></span></span></div></div>

<h2>Obfuscate e-mail&nbsp;addresses:</h2>

<p>Written for the <a href="http://wiki.clug.org.za/wiki/Committee_Contact_Details">Contact a Committee Member</a> page. I use my own simple Javascript that replaces <code>innerHTML</code> and <code>href</code> when you mouse over an e-mail link. I think it&#8217;s&nbsp;spambot-proof.</p>

<p>Usage:</p>

<div class="geshifilter"><div class="xml geshifilter-xml" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;email</span> <span class="re0">domain</span>=<span class="st0">&quot;example.com&quot;</span><span class="re2">&gt;</span></span>foobar<span class="sc3"><span class="re1">&lt;/email<span class="re2">&gt;</span></span></span></div></div>
    ]]></content>
  </entry>
  <entry>
    <title>Wordpress -&gt; Drupal</title>
    <link rel="alternate" type="text/html" href="http://tumbleweed.org.za/code/wp-to-drupal" />
    <id>http://tumbleweed.org.za/code/wp-to-drupal</id>
    <published>2008-01-02T22:06:44+00:00</published>
    <updated>2008-01-03T18:15:33+00:00</updated>
    <author>
      <name>tumbleweed</name>
    </author>
    <category term="code" />
    <category term="drupal" />
    <category term="Howto" />
    <category term="migrate" />
    <category term="php" />
    <category term="wordpress" />
    <summary type="html"><![CDATA[<p>This is my script for migrating from Wordpress to Drupal. I know that there is already a <a href="http://www.borber.com/en/projects/wp2drupal">migration script</a> out there, but I still wrote my own for a&nbsp;few&nbsp;reasons:</p>

<ul>
<li>My needs are simple, and I knew what&nbsp;I&nbsp;wanted.</li>
<li>I wanted to migrate comments and pingbacks if possible. This turned out to&nbsp;be&nbsp;easy.</li>
<li>I wanted to learn more about coding&nbsp;for&nbsp;Drupal.</li>
<li>I&#8217;d already started writing it when I saw&nbsp;Borek&#8217;s&nbsp;migrator.</li>
<li>I wanted to migrate straight to Drupal 5, not&nbsp;4&nbsp;first.</li>
</ul>

<p>So here&nbsp;it&nbsp;is.</p>

<p>Limitations&nbsp;and&nbsp;bugs:</p>

<ul>
<li>Attached files are copied by requesting them off the old server. But thumbnails aren&#8217;t&nbsp;migrated&nbsp;too.</li>
<li>Pages aren&#8217;t migrated. But I&#8217;m sure this would be a piece of cake&nbsp;to&nbsp;fix</li>
<li>I put dumped my wordpress tables into my drupal database (They are all prefixed with <span class="geshifilter"><code class="geshifilter-text">wp-</code></span>). This is messy, but while <a href="http://drupal.org/node/18429">Drupal&#8217;s multi-database system</a> is a cool and would be perfect, it&#8217;s unworkable when you are debugging. Errors seem to be hooked in drupal, and if you have a broken <span class="caps"><span class="caps">SQL</span></span> query (for example) the error handling code hooks Drupal themes, which aren&#8217;t findable in the alternate-db world you&nbsp;are&nbsp;visiting.</li>
<li>All blog posts are migrated to a single user on the&nbsp;other&nbsp;side.</li>
<li>I&#8217;m pretty sure that I didn&#8217;t solve the character encoding issues, just&nbsp;sidestepped&nbsp;them&#8230;</li>
<li>I didn&#8217;t look into Drupal&nbsp;6&nbsp;compatibility.</li>
</ul>
    ]]></summary>
    <content type="html"><![CDATA[<p>This is my script for migrating from Wordpress to Drupal. I know that there is already a <a href="http://www.borber.com/en/projects/wp2drupal">migration script</a> out there, but I still wrote my own for a few&nbsp;reasons:</p>

<ul>
<li>My needs are simple, and I knew what I&nbsp;wanted.</li>
<li>I wanted to migrate comments and pingbacks if possible. This turned out to be&nbsp;easy.</li>
<li>I wanted to learn more about coding for&nbsp;Drupal.</li>
<li>I&#8217;d already started writing it when I saw Borek&#8217;s&nbsp;migrator.</li>
<li>I wanted to migrate straight to Drupal 5, not 4&nbsp;first.</li>
</ul>

<p>So here it&nbsp;is.</p>

<p>Limitations and&nbsp;bugs:</p>

<ul>
<li>Attached files are copied by requesting them off the old server. But thumbnails aren&#8217;t migrated&nbsp;too.</li>
<li>Pages aren&#8217;t migrated. But I&#8217;m sure this would be a piece of cake to&nbsp;fix</li>
<li>I put dumped my wordpress tables into my drupal database (They are all prefixed with <code>wp-</code>). This is messy, but while <a href="http://drupal.org/node/18429">Drupal&#8217;s multi-database system</a> is a cool and would be perfect, it&#8217;s unworkable when you are debugging. Errors seem to be hooked in drupal, and if you have a broken <span class="caps">SQL</span> query (for example) the error handling code hooks Drupal themes, which aren&#8217;t findable in the alternate-db world you are&nbsp;visiting.</li>
<li>All blog posts are migrated to a single user on the other&nbsp;side.</li>
<li>I&#8217;m pretty sure that I didn&#8217;t solve the character encoding issues, just sidestepped&nbsp;them&#8230;</li>
<li>I didn&#8217;t look into Drupal 6&nbsp;compatibility.</li>
</ul>
    ]]></content>
  </entry>
  <entry>
    <title>Amatomu Drupal Module</title>
    <link rel="alternate" type="text/html" href="http://tumbleweed.org.za/code/amatomu" />
    <id>http://tumbleweed.org.za/code/amatomu</id>
    <published>2007-12-30T21:44:58+00:00</published>
    <updated>2008-09-14T20:41:18+00:00</updated>
    <author>
      <name>tumbleweed</name>
    </author>
    <category term="amatomu" />
    <category term="code" />
    <category term="drupal" />
    <category term="Howto" />
    <category term="php" />
    <summary type="html"><![CDATA[<p>I&#8217;ve written a simple <a href="http://drupal.org/" title="Drupal, the CMS this site uses">drupal</a> module for including the <a href="http://www.amatomu.com/">Amatomu</a>&nbsp;tracker.</p>

<p>It also supports the &#8220;What&#8217;s hot in South African blogs&#8221; tag-cloud, albeit via ugly javascript. I&#8217;m not a fan of all this javascript <span class="caps"><span class="caps">DHTML</span></span> nonsense, but maybe they can be talked into providing a better&nbsp;<span class="caps"><span class="caps">API</span></span>&#8230;</p>

<p>Todo list (Things amatomu does that I don&#8217;t care for, and thus&nbsp;haven&#8217;t&nbsp;coded):</p>

<ul>
<li>I&#8217;d like to extend this to include support for the <a href="http://www.amatomu.com/widgets.php">shmaak button</a>s.</li>
<li>The&nbsp;rank&nbsp;ribbon.</li>
</ul>

<p>Available <a href="http://drupal.org/project/amatomu">from Drupal.org</a>. Releases for Drupal 5 and 6&nbsp;are&nbsp;available.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>I&#8217;ve written a simple <a href="http://drupal.org/" title="Drupal, the CMS this site uses">drupal</a> module for including the <a href="http://www.amatomu.com/">Amatomu</a>&nbsp;tracker.</p>

<p>It also supports the &#8220;What&#8217;s hot in South African blogs&#8221; tag-cloud, albeit via ugly javascript. I&#8217;m not a fan of all this javascript <span class="caps">DHTML</span> nonsense, but maybe they can be talked into providing a better&nbsp;<span class="caps">API</span>&#8230;</p>

<p>Todo list (Things amatomu does that I don&#8217;t care for, and thus haven&#8217;t&nbsp;coded):</p>

<ul>
<li>I&#8217;d like to extend this to include support for the <a href="http://www.amatomu.com/widgets.php">shmaak button</a>s.</li>
<li>The rank&nbsp;ribbon.</li>
</ul>

<p>Available <a href="http://drupal.org/project/amatomu">from Drupal.org</a>. Releases for Drupal 5 and 6 are&nbsp;available.</p>
    ]]></content>
  </entry>
  <entry>
    <title>SR Album</title>
    <link rel="alternate" type="text/html" href="http://tumbleweed.org.za/code/album" />
    <id>http://tumbleweed.org.za/code/album</id>
    <published>2007-12-29T18:13:39+00:00</published>
    <updated>2007-12-29T18:13:39+00:00</updated>
    <author>
      <name>tumbleweed</name>
    </author>
    <category term="album" />
    <category term="code" />
    <category term="Howto" />
    <category term="photograph" />
    <category term="php" />
    <category term="web" />
    <summary type="html"><![CDATA[<p>The scripts used to generate the album on my previous web site. The thumbnails are generated with Python (using ImageMagick&#8217;s convert) and displayed with a <span class="caps"><span class="caps">PHP</span></span> script. This split approach keeps the scripts&#8217; file-size down while not needing <span class="caps"><span class="caps">PHP</span></span> to process any images, which keeps the&nbsp;speed&nbsp;up.</p>

<p>It&#8217;s very primitive, but can look quite nice, and is&nbsp;easily&nbsp;automated.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>The scripts used to generate the album on my previous web site. The thumbnails are generated with Python (using ImageMagick&#8217;s convert) and displayed with a <span class="caps">PHP</span> script. This split approach keeps the scripts&#8217; file-size down while not needing <span class="caps">PHP</span> to process any images, which keeps the speed&nbsp;up.</p>

<p>It&#8217;s very primitive, but can look quite nice, and is easily&nbsp;automated.</p>
    ]]></content>
  </entry>
  <entry>
    <title>PHP4 for feisty - pbuilder for beginners</title>
    <link rel="alternate" type="text/html" href="http://tumbleweed.org.za/2007/06/10/php4-for-feisty-pbuilder-for-beginners" />
    <id>http://tumbleweed.org.za/2007/06/10/php4-for-feisty-pbuilder-for-beginners</id>
    <published>2007-06-10T20:40:36+00:00</published>
    <updated>2008-09-19T08:16:10+00:00</updated>
    <author>
      <name>tumbleweed</name>
    </author>
    <category term="clug" />
    <category term="linux" />
    <category term="php" />
    <category term="software" />
    <category term="ubuntu" />
    <summary type="html"><![CDATA[<p>I helped Robbster out on #clug today, building php4 for feisty (it&#8217;s been dropped after edgy, in favour of php5). If you want to install it, don&#8217;t care about security holes, and want to use the debs I created, add this line to your apt sources list, and&nbsp;go&nbsp;wild:</p>

<div class="geshifilter"><div class="apt_sources geshifilter-apt_sources" style="font-family:monospace;"><span class="kw1">deb</span> <span class="re0">http://ftp.leg.uct.ac.za/pub/stuff/tmp/php4-feisty</span> ./</div></div>

<p>If on the other hand you want to know how to do it (so when the next <span class="caps"><span class="caps">PHP</span></span> security hole appears tomorrow, you can build the latest version <em>yourself</em>),&nbsp;read&nbsp;on:</p>

<p>I&#8217;ve never used <a href="http://www.netfort.gr.jp/~dancer/software/pbuilder-doc/pbuilder-doc.html">pbuilder</a> before, so it&nbsp;was&nbsp;fun:</p>

<div class="geshifilter"><div class="text geshifilter-text" style="font-family:monospace;"># aptitude install pbuilder</div></div>

<p>Edit <span class="geshifilter"><code class="geshifilter-text">/etc/pbuilderrc</code></span> to point to your closest mirror, and uncomment the <span class="geshifilter"><code class="geshifilter-text">COMPONENTS</code></span>line (so that you get&nbsp;universe&nbsp;included)</p>

<div class="geshifilter"><div class="text geshifilter-text" style="font-family:monospace;"># pbuilder create</div></div>

<p>Now pbuilder is ready for work. Get the <a href="http://packages.debian.org/unstable/source/php4">latest sources from debian</a> (Download those 3 files at the end, dsc, orig.tar.gz&nbsp;and&nbsp;diff)</p>

<div class="geshifilter"><div class="text geshifilter-text" style="font-family:monospace;"># pbuilder build *.dsc</div></div>

<p>Sit back&nbsp;and&nbsp;watch&#8230;</p>

<p>When it&#8217;s done, you probably want to create a <a href="http://www.debian.org/doc/manuals/repository-howto/repository-howto#id2452849">trivial repository</a> of&nbsp;your&nbsp;debs:</p>

<div class="geshifilter"><div class="text geshifilter-text" style="font-family:monospace;"># cd /var/cache/pbuilder/result/; dpkg-scanpackages . /dev/null | gzip -c -9 &gt; Packages.gz</div></div>

<p>Then add this to your <span class="geshifilter"><code class="geshifilter-text">sources.list</code></span></p>

<div class="geshifilter"><div class="apt_sources geshifilter-apt_sources" style="font-family:monospace;"><span class="kw1">deb</span> <span class="re0">file:///var/cache/pbuilder/result/</span> ./</div></div>

<p>Wohoo. Remember to watch out for those <em>security</em>&nbsp;holes&#8230;</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>I helped Robbster out on #clug today, building php4 for feisty (it&#8217;s been dropped after edgy, in favour of php5). If you want to install it, don&#8217;t care about security holes, and want to use the debs I created, add this line to your apt sources list, and go&nbsp;wild:</p>

<div class="geshifilter"><div class="apt_sources geshifilter-apt_sources" style="font-family:monospace;"><span class="kw1">deb</span> <span class="re0">http://ftp.leg.uct.ac.za/pub/stuff/tmp/php4-feisty</span> ./</div></div>

<p>If on the other hand you want to know how to do it (so when the next <span class="caps">PHP</span> security hole appears tomorrow, you can build the latest version <em>yourself</em>), read&nbsp;on:</p>

<p>I&#8217;ve never used <a href="http://www.netfort.gr.jp/~dancer/software/pbuilder-doc/pbuilder-doc.html">pbuilder</a> before, so it was&nbsp;fun:</p>

<div class="geshifilter"><div class="text geshifilter-text" style="font-family:monospace;"># aptitude install pbuilder</div></div>

<p>Edit <code>/etc/pbuilderrc</code> to point to your closest mirror, and uncomment the <code>COMPONENTS</code>line (so that you get universe&nbsp;included)</p>

<div class="geshifilter"><div class="text geshifilter-text" style="font-family:monospace;"># pbuilder create</div></div>

<p>Now pbuilder is ready for work. Get the <a href="http://packages.debian.org/unstable/source/php4">latest sources from debian</a> (Download those 3 files at the end, dsc, orig.tar.gz and&nbsp;diff)</p>

<div class="geshifilter"><div class="text geshifilter-text" style="font-family:monospace;"># pbuilder build *.dsc</div></div>

<p>Sit back and&nbsp;watch&#8230;</p>

<p>When it&#8217;s done, you probably want to create a <a href="http://www.debian.org/doc/manuals/repository-howto/repository-howto#id2452849">trivial repository</a> of your&nbsp;debs:</p>

<div class="geshifilter"><div class="text geshifilter-text" style="font-family:monospace;"># cd /var/cache/pbuilder/result/; dpkg-scanpackages . /dev/null | gzip -c -9 &gt; Packages.gz</div></div>

<p>Then add this to your <code>sources.list</code></p>

<div class="geshifilter"><div class="apt_sources geshifilter-apt_sources" style="font-family:monospace;"><span class="kw1">deb</span> <span class="re0">file:///var/cache/pbuilder/result/</span> ./</div></div>

<p>Wohoo. Remember to watch out for those <em>security</em>&nbsp;holes&#8230;</p>
    ]]></content>
  </entry>
</feed>
