<?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>:: TechBlog :: &#187; Code</title>
	<atom:link href="http://techblog.touchbasic.com/html/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.touchbasic.com/html</link>
	<description>Techblog is collection of articles covering a wide variety of tech related topics including: Linux, Microsoft, Google, web development, web design, open source, wordpress, security, and more.</description>
	<lastBuildDate>Fri, 06 May 2011 00:58:22 +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>Quick fix to get Simple Tags plugin working with WordPress 2.9+</title>
		<link>http://techblog.touchbasic.com/html/quick-fix-to-get-simple-tags-working-with-wordpress-2-9/</link>
		<comments>http://techblog.touchbasic.com/html/quick-fix-to-get-simple-tags-working-with-wordpress-2-9/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 23:01:46 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[simple tags]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/?p=636</guid>
		<description><![CDATA[Note: There&#8217;s a new version of Simple Tags that works with WP 2.9.1 so no need for this hack anymore. If you&#8217;re using the Simple Tags plugin, you might be holding off on upgrading to WordPress 2.9.1 because this plugin is only Compatible up to: 2.8. Well, turns out the plugin does actually seem to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note: There&#8217;s a new version of Simple Tags that works with WP 2.9.1 so no need for this hack anymore.</strong></p>
<p>If you&#8217;re using the <a href="http://wordpress.org/extend/plugins/simple-tags/">Simple Tags</a> plugin, you might be holding off on upgrading to WordPress 2.9.1 because this plugin is only Compatible up to: 2.8.</p>
<p>Well, turns out the plugin does actually seem to work with WP 2.9.x &#8212; but you have to make a quick edit to the plugin file itself. Now, normally i&#8217;m not a fan of hacking plugin files to get things working because your changes would be lost with each new release. But, in this case, i figured that when the author does decide to release an update, i would be ok with losing these changes because they would no longer be necessary anyway.</p>
<p>Note: if you&#8217;re not comfortable editing plugin files directly (although this edit is really easy), then maybe you should wait until the author releases an official update. Otherwise, i&#8217;ve included the bit of code here for reference.</p>
<p><strong>To get Simple Tags working with WP 2.9+</strong></p>
<p>1) Open simple-tags.php and find the line:</p>
<p><code>if ( strpos($wp_version, '2.7') !== false || strpos($wp_version, '2.8') !== false  ) {</code></p>
<p>2) Change that to:</p>
<p><code>if ( strpos($wp_version, '2.7') !== false || strpos($wp_version, '2.8') !== false || strpos($wp_version, '2.9') !== false  ) {</code></p>
<p>That&#8217;s right, it&#8217;s just a matter of adding the additional condition which allows WP version 2.9 to work.</p>
<p>As always, be sure to backup and test this fix on your own site before going live.</p>
<p>This fix was found / documented here:<br />
- <a href="http://www.wordpress-fr.net/support/viewtopic.php?pid=173448#p173448">http://www.wordpress-fr.net/support/viewtopic.php?pid=173448#p173448</a><br />
- <a href="http://www.herewithme.fr/simple-tags-et-wordpress-2-8#comment-34072">http://www.herewithme.fr/simple-tags-et-wordpress-2-8#comment-34072</a></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/quick-fix-to-get-simple-tags-working-with-wordpress-2-9/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to increase the size of a VMware vmdk file formatted as linux lvm</title>
		<link>http://techblog.touchbasic.com/html/how-to-increase-the-size-of-a-vmware-vmdk-file-formatted-as-linux-lvm/</link>
		<comments>http://techblog.touchbasic.com/html/how-to-increase-the-size-of-a-vmware-vmdk-file-formatted-as-linux-lvm/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 05:03:33 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[fdisk]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[virtual disk]]></category>
		<category><![CDATA[vista]]></category>
		<category><![CDATA[vmdk]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/?p=293</guid>
		<description><![CDATA[VMware can run many cool operating systems on a single host computer. But, having run the software for an extended amount of time, i eventually always run out of space on my guest OSes. This happened a few times before, but it wasn&#8217;t until my VM really froze up on me that i figured it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.vmware.com">VMware</a> can run many cool operating systems on a single host computer. But, having run the software for an extended amount of time, i eventually always run out of space on my guest OSes. This happened a few times before, but it wasn&#8217;t until my VM really froze up on me that i figured it was time to look into extending or expanding the current virtual disk i had in use.</p>
<p><strong>Have you ever tried increasing the size of a vmdk file / virtual hard disk ?</strong><br />
<em>It&#8217;s not that easy.. and it&#8217;s kind of confusing.</em></p>
<p>So, once i finally figured out how to do it, i thought it would be useful to write it down so that i wouldn&#8217;t forget next time this happened. Here goes..</p>
<p><strong>In my example i have: </strong><br />
- a Windows Vista host OS running a <a href="http://fedoraproject.org/">Fedora Core</a> guest OS<br />
- an 8GB vmdk file (formatted as Linux LVM &#8211; fedora fs) on the guest OS which i have backed up before attempting anything here !!! </p>
<p><strong>I want to:</strong><br />
- increase the 8GB vmdk file to 16GB<br />
- not lose any data saved on the vmdk file<br />
- not move any data off/on the vmdk file</p>
<h2>Follow these Steps:</h2>
<ol>
<li>Download and Install: <a href="http://downloads.vmware.com/d/details/workstation_6_5_3_for_windows/dHdiZHdodGJAJXQ=">VMware Workstation for Windows</a> (trial)</li>
<li>Note the location of the VMware Workstation folder (after install) &#8211; in my case it&#8217;s &#8220;C:\Program Files\VMware\VMware Workstation&#8221;</li>
<li>Open a Windows Command Prompt and navigate to the folder where your vmdk file resides and execute the following command:<br /><code>"C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager.exe" -x 16GB "Name of Your Virtual Disk File.vmdk"</code><br />Ok, now you just made the disk twice as big but you can&#8217;t use the space yet because it&#8217;s inactive, unpartitioned, unformatted, and still utterly useless to us. (but not for long)</li>
<li>Next, boot up the guest OS and log in as root. Verify that there is in fact a large amount of unallocated space/sectors by typing the command: <code>fdisk -l</code></li>
<li>Then we&#8217;ll partition and format the new portion of the disk. First select the disk: <code>fdisk /dev/sda</code></li>
<li>Type &#8220;n&#8221; at the fdisk menu to create a new partition</li>
<li>Type &#8220;p&#8221; for primary partition, and then select the appropriate partition number, as well as first and last cylinders to set how large to make the new partition (defaults &#8211; ie: use all the free space &#8211; worked well for me here)</li>
<li>Type &#8220;t&#8221; to change the partition&#8217;s system id, then type &#8220;8e&#8221; to switch it to Linux LVM </li>
<li>Type &#8220;w&#8221; to write the table to disk and exit fdisk. You might get a warning about needing to reboot for changes to take effect &#8211; either way, reboot your guest OS just to be safe.</li>
<li>Once rebooted, log in as root again and verify  the new partition exists. Type &#8220;fdisk -l&#8221; to see a list of partitions. In my case, the new partition is: /dev/sda3</li>
<li>Now comes the confusing part. We&#8217;re going to merge the new partition into the current Volume Group (which is just what fedora calls it&#8217;s own virtual disks that are made up of a bunch of virtual LVM partitions). So, first, to &#8220;create&#8221; the necessary &#8220;physical volume&#8221; from our newly created disk partition (/dev/sda3) first type: <code>pvcreate /dev/sda3</code></li>
<li>You need to find out the name of the Volume Group before you can extend it to include the newly created physical volume. Type: <code>vgdisplay</code> and look for the first line, &#8220;VG Name&#8221; &#8211; in this case it was VolGroup00 [<a href="http://techblog.touchbasic.com/html/how-to-increase-the-size-of-a-vmware-vmdk-file-formatted-as-linux-lvm/#comment-36074">thanks agm</a>]</li>
<li>Next, you need to extend the Volume Group to include the newly created physical volume. Type: <code>vgextend VolGroup00 /dev/sda3</code></li>
<li>Then, type: <code>pvscan</code> You should see the new partition (/1dev/sda3) in the list of partitions and the total should read approximately 16GB (the amount we set earlier). In my example, it said 15.75GB</li>
<li>Now type: <code>lvextend -L+8GB /dev/VolGroup00/LogVol00</code> to increase / extend the Logical Volume by 8GB (to a total of 16GB).</li>
<li>Finally, to resize the filing system type: <code>resize2fs /dev/VolGroup00/LogVol00</code></li>
</ol>
<p>Now your fedora guest OS should have twice the amount of space and your VM should be running smoothly.<br />
Repeat this process if / when the vmdk file gets filled up again and runs out of space ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/how-to-increase-the-size-of-a-vmware-vmdk-file-formatted-as-linux-lvm/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>WordPress Plugin &#8211; Notify Admin Only of WP Updates</title>
		<link>http://techblog.touchbasic.com/html/wordpress-plugin-notify-admin-only-of-wp-updates/</link>
		<comments>http://techblog.touchbasic.com/html/wordpress-plugin-notify-admin-only-of-wp-updates/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 15:42:15 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[notify admin]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/?p=274</guid>
		<description><![CDATA[Update: This plugin is tested and known to be working with WP 2.9.1 ok, with the release of WordPress 2.8.3 &#8211; if finally got around to upgrading my Notify Admin Only plugin to work with WP 2.8+ Download Plugin: Notify Admin Only v2.0 in case you&#8217;re not sure what this plugin actually does, well, it [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update: This plugin is tested and known to be working with WP 2.9.1</strong></p>
<p>ok, with the release of WordPress 2.8.3 &#8211; if finally got around to upgrading my Notify Admin Only plugin to work with WP 2.8+</p>
<h2>Download Plugin: <a href='http://touchbasic.googlepages.com/notify_admin_only.php'>Notify Admin Only v2.0</a></h2>
<p>in case you&#8217;re not sure what this plugin actually does, well, it removes this text from the backend that says: &#8220;A new version of WordPress is available! Please notify the site administrator&#8221; &#8211; (see the images below).</p>
<p>great for admins who don&#8217;t want their many users to ever see the WordPress Update nag.</p>
<p><img id="image185" src="http://techblog.touchbasic.com/html/wp-content/uploads/2007/10/wp_notice.jpg" alt="wp notifying the admin" /></p>
<p>anyway the new code is really simple: (thanks <a href="http://techblog.touchbasic.com/html/wp-231-plugin-notify-admin-only-of-wordpress-updates/#comment-35611">Lazzymonk</a>)</p>
<p><code lang="php"><br />
< ?php<br />
function stop_wpupdate() {<br />
	if ( current_user_can('manage_options') ) {<br />
		return;<br />
	} else {<br />
		remove_action( 'admin_notices', 'update_nag', 3 );<br />
	}<br />
}<br />
add_action( 'admin_notices', 'stop_wpupdate', 1 );<br />
?><br />
</code></p>
<p><a href="http://techblog.touchbasic.com/html/wp-231-plugin-notify-admin-only-of-wordpress-updates/">the old plugin</a> is here and only works for WP 2.3 &#8211; 2.5 series.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/wordpress-plugin-notify-admin-only-of-wp-updates/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Single unified login for multiple WordPress 2.8 installs in subdirectories using cookies</title>
		<link>http://techblog.touchbasic.com/html/single-unified-login-for-multiple-wordpress-2-8-installs-in-subdirectories-using-cookies/</link>
		<comments>http://techblog.touchbasic.com/html/single-unified-login-for-multiple-wordpress-2-8-installs-in-subdirectories-using-cookies/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 16:11:27 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[single login]]></category>
		<category><![CDATA[single sign on]]></category>
		<category><![CDATA[ssi]]></category>
		<category><![CDATA[subdirectories]]></category>
		<category><![CDATA[unified login]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/?p=215</guid>
		<description><![CDATA[i used to have a single sign on working between several WordPress sites, one in the root directory, others in subdirectories, even a few installs that ran off of subdomains. basically, you could log in to one site and you&#8217;d be logged into all of these sites. that was before the big upgrade of WP [...]]]></description>
			<content:encoded><![CDATA[<p>i used to have a single sign on working between several WordPress sites, one in the root directory, others in subdirectories, even a few installs that ran off of subdomains. basically, you could log in to one site and you&#8217;d be logged into all of these sites.</p>
<p><em>that was before the big upgrade of WP 2.5 -</em></p>
<p>that&#8217;s right, i&#8217;m sure many out there can remember the chaos that came with upgrading your WordPress blog beyond version 2.5. there was an entirely new backend to get used to, but there were also lots of small code changes that created compatibility issues in many plugins and themes. one of the major changes was the way WordPress was to handle cookies and authentication in general which was made to be more secure. as a result, coders were offered new methods of integrating logins but (at the time) there was little to no clear, accurate documentation detailing how to achieve this task.</p>
<p>i spent many hours last year (with WordPress 2.5 and 2.6), and then again earlier this year (with WordPress 2.7), and then again this weekend (with WordPress 2.8).. until i finally got it working with the help of a relatively new plugin and some new blog posts describing how others attempted this now seemingly daunting task.</p>
<p>anyway, i thought i&#8217;d share my notes as well as the steps i took to get this working with my setup. it&#8217;s currently being used on <a href="http://www.indyish.com/">indyish.com</a> to unify the various WordPress installs into one cohesive multi-user site.</p>
<p>Note: These steps assume you&#8217;ve already got your WordPress sites setup using a shared user database. So, you can log into any of your sites individually with the same credentials, see all the same users under &#8220;Users&#8221; > &#8220;Authors &#038; Users&#8221; &#8211; <strong>but you want to get it so logging into one site automatically logs you into all of your sites</strong>.</p>
<p>Therefore, you have already added the following to the wp-config.php files for any of the sites other than the root site:</p>
<p><code lang="php"><br />
define('CUSTOM_USER_TABLE','wp_users'); // shared user db<br />
define('CUSTOM_USER_META_TABLE','wp_usermeta');  // shared usermeta<br />
</code></p>
<ol>
<li>To start with, you&#8217;re going to need to download and install this plugin: <a href="http://wordpress.org/extend/plugins/root-cookie/">root Cookie Path</a>. Make sure to activate the plugin on all of the sites (the root site, as well as any subdirectory sites).</li>
<li>Once all your sites are using a root cookie, you need to open up the wp-config.php files for any <strong>non-root sites</strong> (ie: subdirectory sites).</li>
<li>Now here&#8217;s the trickier part&#8230; go to your root site (ie: yourdomain.com) and get the following info from your Global Options page: <strong>AUTH_SALT</strong> and <strong>LOGGED_IN_SALT</strong>. You can find the Global Options page for your WordPress install at: http://www.yourdomain.com/wp-admin/options.php (replace &#8220;yourdomain&#8221; with <em>your actual domain</em>)</li>
<li>When you have these 2 values, you need to paste them into the wp-config.php files for <strong>every single non-root site you want to integrate</strong>. Use the following syntax:<br />
<code lang="php"><br />
define('AUTH_SALT', 'some-crazy-wacky-random-long-string-of-characters');<br />
define('LOGGED_IN_SALT', 'some-crazy-wacky-random-long-string-of-characters');<br />
</code></li>
<li>Then, you need to make sure <strong>all of your sites</strong> are using the same &#8220;secret keys&#8221;. Paste that info into the wp-config.php files for each of the <strong>non-root sites</strong> you want to integrate. You can get secret keys fresh from the <a href="https://api.wordpress.org/secret-key/1.1/">WordPress API page</a> if you haven&#8217;t already added them to your wp-config.php file. It should look something like this.<br />
<code lang="php"><br />
define('AUTH_KEY',        'some-crazy-wacky-random-long-string-of-characters');<br />
define('SECURE_AUTH_KEY', 'some-crazy-wacky-random-long-string-of-characters');<br />
define('LOGGED_IN_KEY',   'some-crazy-wacky-random-long-string-of-characters');<br />
define('NONCE_KEY',       'some-crazy-wacky-random-long-string-of-characters');<br />
</code></li>
<li>Finally, add this cookie information to the wp-config.php files for all your <strong>non-root sites</strong>:<br />
<code lang="php"><br />
$baseurl = 'http://www.yourdomain.com'; // replace with the actual domain name for your root site<br />
$cookiehash = md5($baseurl);<br />
define('COOKIEHASH', $cookiehash);</p>
<p>define ('AUTH_COOKIE', 'wordpress_'.COOKIEHASH);<br />
define ('SECURE_AUTH_COOKIE', 'wordpress_sec_'.COOKIEHASH);<br />
define ('LOGGED_IN_COOKIE','wordpress_logged_in_'.COOKIEHASH);<br />
define ('TEST_COOKIE', 'wordpress_test_cookie');<br />
</code></li>
</ol>
<p>That should do it!</p>
<p>Note: Some people have gone ahead and modified the WordPress capabilities.php file in order to get a role assigned to newly registered users, but this step is optional and requires editing a core WordPress file (a change which wouldn&#8217;t persist from one upgrade to another). I prefer to just assign a role manually to any new user that needs access to one of the non-root sites. Or, you could find another trigger to use before calling the function that sets the new role. Still, if you want to go as far as modifying core WP files, here is the code used by <a href="http://kiranthomman.com/setting-single-login-across-multiple-wordpress-27-installs-using-a-single-domain/">Kiran</a>: (but i haven&#8217;t tried it personally)<br />
<code lang="php"><br />
function _init_caps() {<br />
global $wpdb;<br />
// $this->cap_key = $wpdb->prefix . ‘capabilities’; /* original code */<br />
$this->cap_key = ‘wp_capabilities’; /*modified code */<br />
$this->caps = &#038;$this->{$this->cap_key};<br />
if ( ! is_array( $this->caps ) )<br />
$this->caps = array();<br />
$this->get_role_caps();<br />
}<br />
</code></p>
<p>Finally, here are some resources i used to help me out (most recently):</p>
<ul>
<li><a href="http://opensourceexperiments.wordpress.com/2009/02/01/setting-up-a-common-userbase-across-multiple-wordpress-installations/">Setting up a common login across multiple wordpress installations</a></li>
<li><a href="http://kiranthomman.com/setting-single-login-across-multiple-wordpress-27-installs-using-a-single-domain/">Setting single login across multiple WordPress 2.7 installs using a single domain</a></li>
<li><a href="http://www.linickx.com/archives/831/root-cookie-path-14-an-update-for-wordpress-27">root Cookie Path 1.4 an Update for WordPress 2.7</a></li>
<li><a href="http://wordpress.org/extend/plugins/root-cookie/">root Cookie Path</a></li>
</ul>
<p>Here are some other sites (for reference) which i used earlier on this year:</p>
<ul>
<li><a href="http://justintadlock.com/archives/2008/09/20/installing-two-wordpress-blogs-with-the-same-users">Installing two WordPress blogs with the same users</a></li>
<li><a href="http://wordpress.org/support/topic/170987">HOWTO: Set up secret keys in WordPress 2.6+</a></li>
<li><a href="http://boren.nu/archives/2008/07/14/ssl-and-cookies-in-wordpress-26/">SSL and Cookies in WordPress 2.6</a></li>
<li><a href="http://codex.wordpress.org/Editing_wp-config.php#Secret_Key_IMPORTANT">Editing wp-config.php</a></li>
<li><a href="http://codex.wordpress.org/Installing_Multiple_Blogs">Installing Multiple Blogs</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/single-unified-login-for-multiple-wordpress-2-8-installs-in-subdirectories-using-cookies/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>WP 2.3 Plugin &#8211; Per Post Creative Commons License</title>
		<link>http://techblog.touchbasic.com/html/wp-23-plugin-per-post-creative-commons-license/</link>
		<comments>http://techblog.touchbasic.com/html/wp-23-plugin-per-post-creative-commons-license/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 22:33:31 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Copyright]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[cc]]></category>
		<category><![CDATA[creative commons]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[licensing]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/wp-23-plugin-per-post-creative-commons-license/</guid>
		<description><![CDATA[This plugin will add the ability to choose different Creative Commons licensing structures for different posts that you publish to your WordPress blog. As far as i could tell, there are currently 2 other CC plugins for WordPress &#8211; wpLicense and cc-configurator &#8211; however both of them only let you set your license on a [...]]]></description>
			<content:encoded><![CDATA[<p>This plugin will add the ability to choose different Creative Commons licensing structures for different posts that you publish to your WordPress blog.</p>
<p>As far as i could tell, there are currently 2 other CC plugins for WordPress &#8211; <a href="http://wiki.creativecommons.org/WpLicense">wpLicense</a> and <a href="http://www.g-loaded.eu/2006/01/14/creative-commons-configurator-wordpress-plugin/">cc-configurator</a> &#8211; however both of them only let you set your license on a global level. That is, they let you pick one license for all your posts and pages throughout your entire site. I thought it might be useful if each WP user/author could choose between different CC licenses and be able to set them on a post-by-post basis. So, i modified the wpLicense plugin to do just that. </p>
<blockquote><p><strong>&#8220;The main purpose of this plugin is to give WP admins who run sites with multiple users/authors the option let these users/authors set specific CC licensing terms on a post by post basis.&#8221;</strong></p></blockquote>
<p><strong>How it works:</strong><br />
It uses the <a href="http://api.creativecommons.org/docs/readme_15.html#details-license-uri-uri">CC api</a> and the <a href="http://wiki.creativecommons.org/JsWidget">JsWidget</a> to add a new section to the write/edit post page and then displays a small CC graphic/button and text on your published posts for all to see. The widget lets you choose the appropriate licensing structure and then your choice is automatically saved to a custom field the next time you click &#8220;Save and Continue Editing&#8221;, &#8220;Save&#8221;, or &#8220;Publish&#8221;. Then, it uses the CC api (details-license-uri-uri) to call some javascript that displays a small graphic/button and some text linking back to the definitions for the license you have chosen. Jquery was used to insert the new CC license section to the write/edit post pages as well as to open/close the new section. I also had to use Jquery to fix the tooltips for the JsWidget. Lastly, this plugin is optimized so that it will add only 1 DB query (the cc_js_result_uri) to each post that has set a CC license and stores it to a custom field for that given post &#8211; whereas the wpLicense plugin seemed to use 3 seperate db queries to set the global licencing for the site.</p>
<p><strong>Screenshots:</strong><br />
Check out the plugin in action.<br />
<a href='http://techblog.touchbasic.com/html/wp-23-plugin-per-post-creative-commons-license/cc-edit-post-view/' rel='attachment wp-att-202' title='cc edit post view'><img style="float:left;margin:15px;padding:2px;border:1px solid #bbb;" src='http://techblog.touchbasic.com/html/wp-content/uploads/2008/02/cc-edit-post.thumbnail.jpg' alt='cc edit post view' /></a><a href='http://techblog.touchbasic.com/html/wp-23-plugin-per-post-creative-commons-license/cc-view-post-license/' rel='attachment wp-att-203' title='cc view post license'><img style="float:left;margin:15px;padding:2px;border:1px solid #bbb;" src='http://techblog.touchbasic.com/html/wp-content/uploads/2008/02/cc-view-post.thumbnail.jpg' alt='cc view post license' /></a></p>
<div style="clear:both;"></div>
<p><span id="more-201"></span></p>
<p><strong>Download:</strong><br />
Click on the following link to download the plugin: <a href="http://touchbasic.googlepages.com/per-post-license_v0.2.zip">per-post-license_v.02.zip</a></p>
<p><strong>Requirements:</strong><br />
1. This plugin has been testing and works on WP 2.3.x using the default theme (but it is still a work in progess / comments and suggestions are welcome).<br />
2. Your web server needs either curl (most have it installed and it&#8217;s the default setting used in this plugin) or URL file-access enabled (to be able to run file_get_contents() instead of curl).</p>
<p><strong>Install:</strong><br />
1. Unzip and Copy the per-post-license folder to your plugins directiory and activate it.<br />
2. Add the template function (see next paragraph) to where you&#8217;d like the CC image/button and text to appear on your post (this might be the single.php or footer.php template file).<br />
3. Go to the Write post page or Edit an existing post.<br />
4. Look for the new section marked &#8220;CC License&#8221; and click the small &#8220;plus&#8221; sign to open the section.<br />
5. Select &#8220;A Creative Commons license&#8221; and choose the appropriate licensing structure.<br />
6. Save the post and You&#8217;re Done!</p>
<p><strong>WP Template Function:</strong><br />
Add the following function to the WP template file (like single.php, or footer.php) to get the CC license to appear on your post.<br />
<code lang="php">
<div id="cc_code">< ?php if(function_exists('cc_insert_html')) { cc_insert_html($display=true); } /* get cc code */ ?></div>
<p></code></p>
<p><strong>Template Options:</strong><br />
Right now, there are only 2 options that you can use with the cc_insert_html() template function.<br />
1. The first is the $display variable. [$display=true ---> will show the CC license , $display=false will not]<br />
2. The second is the $use_curl variable [default is set to --> $use_curl=true , if you explicitly set $use_curl=false the plugin will revert to the php function file_get_contents() which is not always enabled on all web servers]</p>
<p><strong>CSS styles:</strong><br />
Here is a sample style you can use to center, add padding and margins, as well as a horizontal dashed separator (you can ofcourse use any style you like). You would add this code to your style.css file in your template directory.<br />
<code lang="css">#cc_code { text-align:center; font-size:11px; width:450px; margin-top:25px; padding-top:25px; border-top:1px dashed #ccc; }</code><br />
You could also just use inline css and replace the < div id="cc_code" > and add these styles directly &#8211; something like < div style="text-align:center; font-size:11px;" >.</p>
<p><strong>To Do:</strong><br />
- get rss/atom feeds showing CC license<br />
- possibly add CC to header (if appropriate)<br />
- option to set per author licensing (for all an author&#8217;s posts)<br />
- option to set global default license for entire site<br />
- option to turn off graphic/button and just show text<br />
- option to choose/add an existing licensing structure (other than CC) by providing a URL<br />
- create another template function to gather and list all posts with CC licensing (by title)</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/wp-23-plugin-per-post-creative-commons-license/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Using Subversion with WordPress &#8211; Part 2: Maintaining Vendor Branches and Upgrading WP Core Files</title>
		<link>http://techblog.touchbasic.com/html/using-subversion-with-wordpress-part-2-maintaining-vendor-branches-and-upgrading-wp-core-files/</link>
		<comments>http://techblog.touchbasic.com/html/using-subversion-with-wordpress-part-2-maintaining-vendor-branches-and-upgrading-wp-core-files/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 23:01:11 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[merging]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[vendor branches]]></category>
		<category><![CDATA[vendor drop]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/using-subversion-with-wordpress-part-2-maintaining-vendor-branches-and-upgrading-wp-core-files/</guid>
		<description><![CDATA[This article assumes you have already read, &#8220;Using Subversion with WordPress &#8211; Part 1: Creating Vendor Branches and Integrating your Existing Code&#8220;. In short, you want to use Subversion to track/maintain local versions of both WordPress code and your own internal project code, side-by-side, all in the same svn repository. In the previously mentioned article [...]]]></description>
			<content:encoded><![CDATA[<p><em>This article assumes you have already read, &#8220;<a href="http://techblog.touchbasic.com/html/using-subversion-with-wordpress-part-1-creating-vendor-branches-and-integrating-your-existing-code/">Using Subversion with WordPress &#8211; Part 1: Creating Vendor Branches and Integrating your Existing Code</a>&#8220;. In short, you want to use Subversion to track/maintain local versions of both WordPress code and your own internal project code, side-by-side, all in the same svn repository.</em></p>
<p>In the previously mentioned article we used WordPress version 2.3.1 as our initial vendor drop. The following procedure illustrates how to use <em>svn merge</em> to quickly upgrade WordPress core files from version 2.3.1 to version 2.3.2 &#8211; without losing your local changes &#8211; but could be used as a general outline for upgrading any version of WordPress provided you followed the steps discussed in Part 1. Note: Backup your files and database before attempting any of this. Also, although not strictly required, the following steps assume you have some kind of shell access (like ssh) and a command line subversion client (like svn).</p>
<p><strong><em>Maintaining Vendor Branches -</em></strong><br />
To perform this upgrade, we check out a copy of our current vendor branch (which contains our WP 2.3.1 source code), and replace that code with the new WP 2.3.2 source code. So, we simply copy the new files on top of existing files and directories. The goal here is to make our current directory contain only the new WP 2.3.2 code, and to ensure that all that code is under version control. I use the <em>svn export</em> command to grab the WP 2.3.2 source code &#8211; but downloading and extracting the WP files manually works just as well.</p>
<p><span id="more-193"></span></p>
<p>1. Prepare Current and New Code<br />
<code><br />
$ mkdir upgrade<br />
$ cd upgrade<br />
$ svn co http://svn.yourdomain.com/vendor/wordpress/current/<br />
$ svn export http://svn.automattic.com/wordpress/tags/2.3.2/<br />
â€¦<br />
</code></p>
<p>2. Copy, Resolve Conflicts, and Commit Changes<br />
<code><br />
$ cd current [optionally, delete all files but NOT folders / dont delete .svn folders]<br />
$ cp -a ../2.3.2/* .<br />
$ svn status<br />
$ svn ci -m "commiting WP 2.3.2 vendor drop to current branch"<br />
$ cd ../../<br />
$ rm -rf upgrade<br />
â€¦<br />
</code></p>
<p>3. Tag the New Version<br />
Our current branch now contains the new vendor drop. We tag the new version (in the same way we previously tagged the version 2.3.1 vendor drop &#8211; in <a href="http://techblog.touchbasic.com/html/using-subversion-with-wordpress-part-1-creating-vendor-branches-and-integrating-your-existing-code/">Part 1</a>)<br />
<code><br />
$ svn copy http://svn.yourdomain.com/vendor/wordpress/current  \<br />
           http://svn.yourdomain.com/vendor/wordpress/2.3.2      \<br />
           -m "tagging WordPress 2.3.2"<br />
â€¦<br />
</code></p>
<p>4. Merge the Differences and Commit Changes<br />
Checkout a copy of your current project (from <a href="http://techblog.touchbasic.com/html/using-subversion-with-wordpress-part-1-creating-vendor-branches-and-integrating-your-existing-code/">Part 1</a> &#8211; we used the folder: &#8220;newproject&#8221;). Merge the differences between the tag of the previous version (WP 2.3.1) and the new current version into our main development branch. Type <em>svn status</em> to see what files were modified and resolve any conflicts. Run <em>svn add</em> and <em>svn delete</em> commands where appropriate. Commit the changes and our local version of WP will now been completely upgraded without over-writing or deleting any existing modifications we may have previously made.<br />
<code><br />
$ mkdir newproject<br />
$ cd newproject<br />
$ svn co http://svn.yourdomain.com/branches/newproject .<br />
$ svn merge http://svn.yourdomain.com/vendor/wordpress/2.3.1      \<br />
            http://svn.yourdomain.com/vendor/wordpress/current  .<br />
$ svn status<br />
$ svn ci -m 'merging WordPress 2.3.2 into the main branch'<br />
â€¦<br />
</code></p>
<p>That&#8217;s all there is to it! </p>
<p>And, best of all, every change made to your internal project code  &#8211; including those made to WP core files &#8211; is now documented and tracked from within your own local version control system.</p>
<p>Note: Don&#8217;t forget to visit http://www.yourdomain.com/wp-admin/upgrade.php in your web browser once you&#8217;ve completed all of these steps to make sure any database upgrades get applied as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/using-subversion-with-wordpress-part-2-maintaining-vendor-branches-and-upgrading-wp-core-files/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Using Subversion with WordPress &#8211; Part 1: Creating Vendor Branches and Integrating your Existing Code</title>
		<link>http://techblog.touchbasic.com/html/using-subversion-with-wordpress-part-1-creating-vendor-branches-and-integrating-your-existing-code/</link>
		<comments>http://techblog.touchbasic.com/html/using-subversion-with-wordpress-part-1-creating-vendor-branches-and-integrating-your-existing-code/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 01:03:57 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[merging]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[vendor branches]]></category>
		<category><![CDATA[vendor drop]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/using-subversion-with-wordpress-part-1-creating-vendor-branches-and-integrating-your-existing-code/</guid>
		<description><![CDATA[This article assumes that you&#8217;ve read the basic svn howto and the more specific one provided on the WP Codex but would like to try or need a setup similar to that described here on a page called: Vendor branches. In short, you want to use Subversion to track/maintain local versions of both WordPress code [...]]]></description>
			<content:encoded><![CDATA[<p>This article assumes that you&#8217;ve read the <a href="http://codex.wordpress.org/Using_Subversion">basic svn howto</a> and the <a href="http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion">more specific one</a> provided on the WP Codex but would like to try or need a setup similar to that described <a href="http://svnbook.red-bean.com/en/1.4/svn.advanced.vendorbr.html">here</a> on a page called: Vendor branches. In short, you want to use Subversion to track/maintain local versions of both WordPress code and your own internal project code, side-by-side, all in the same svn repository.</p>
<p><strong>Scenario:</strong><br />
Let&#8217;s say you have an in-house web developement project that is built upon or otherwise dependent on the WordPress core files. This can be for something as simple as creating/customizing your own WP themes and plugins, or as complex as maintaining your own modified versions of WP core files, with additional components/modules, etc. The important thing is that you imagine a scenario where you are already using Subversion to commit changes/updates to this internal project of yours. However, a problem occurs whenever a new version of WordPress is released. You need to upgrade the WP core files whithout losing any of the custom modifications you&#8217;ve been making up until now. Ideally, you would like to apply (to your internal project) only the changes made to the upgraded WP core files without over-writing any of your own work.</p>
<p><strong>Solution:</strong></p>
<blockquote><p>&#8220;The solution to this problem is to use vendor branches. A vendor branch is a directory tree in your own version control system that contains information provided by a third-party entity, or vendor. Each version of the vendor&#8217;s data that you decide to absorb into your project is called a vendor drop.&#8221; (<a href="http://svnbook.red-bean.com/en/1.4/svn.advanced.vendorbr.html">quote</a>)</p></blockquote>
<p>So, in this case, the third-party entity or vendor, is WordPress. What we want to do is: absorb the WP code into our own project. The rest of this article is going to illustrate the concept of &#8220;vendor drops&#8221; as they would apply to this particular scenario and using WordPress as the third-party vendor. Some of the benefits of this method are described in the article that the previously mentioned quote came from. In addition, this article goes on to describe the exact same process (but in more general terms) in a section entitled: General Vendor Branch Management Procedure. Well, here is my &#8220;Specific Vendor Branch Management Procedure&#8221; for WordPress.</p>
<p><strong><em>Vendor Branch Management &#8211; Description</em></strong></p>
<blockquote><p>&#8220;Managing vendor branches generally works like this. You create a top-level directory (such as /vendor) to hold the vendor branches. Then you import the third party code into a subdirectory of that top-level directory. You then copy that subdirectory into your main development branch (for example, /trunk) at the appropriate location. You always make your local changes in the main development branch. With each new release of the code you are tracking you bring it into the vendor branch and merge the changes into /trunk, resolving whatever conflicts occur between your local changes and the upstream changes.&#8221; (<a href="http://svnbook.red-bean.com/en/1.4/svn.advanced.vendorbr.html">quote</a>)</p></blockquote>
<p><strong><em>Our Setup -</em></strong><br />
Let&#8217;s use WordPress 2.3.1 as an example. A newer version of WP (2.3.2) was just released and we&#8217;ll be using that version in a follow-up article to show how you can maintain this setup across multiple WP version upgrades without losing your local changes. However, for right now, we&#8217;ll assume that this is your first vendor drop and that your current project is already using Subversion and is also built against WP 2.3.1. In theory, you could use this same procedure with any version of WP &#8211; just make sure to start with an initial vendor drop that is the exact same version of WP as the one your project is currently using. Remember, we are not upgrading WP yet. We are just importing the WP code into our existing subversion-based system, side-by-side with our internal project. Note: Backup your files and database before attempting any of this. Also, although not strictly required, the following steps assume you have some kind of shell access (like ssh) and a command line subversion client (like svn).</p>
<p><span id="more-192"></span></p>
<p><strong><em>Creating Vendor Branches -</em></strong></p>
<p>1. Download Vendor Source Code<br />
<code><br />
$ mkdir workspace<br />
$ cd workspace<br />
$ svn export http://svn.automattic.com/wordpress/tags/2.3.1/<br />
â€¦<br />
</code></p>
<p>2. Importing Initial Vendor Drop<br />
<code><br />
$ cd 2.3.1<br />
$ svn import . http://svn.yourdomain.com/vendor/wordpress/current        \<br />
             -m "importing initial WordPress vendor drop"<br />
$ cd ../<br />
$ rm -rf 2.3.1<br />
â€¦<br />
</code></p>
<p>3. Tagging Initial Vendor Drop<br />
<code><br />
$ svn copy http://svn.yourdomain.com/vendor/wordpress/current        \<br />
           http://svn.yourdomain.com/vendor/wordpress/2.3.1        \<br />
           -m "tagging WordPress 2.3.1"<br />
â€¦<br />
</code></p>
<p>4. Copying Vendor Drop into a New Branch<br />
<code><br />
$ svn copy http://svn.yourdomain.com/vendor/wordpress/2.3.1        \<br />
           http://svn.yourdomain.com/branches/newproject        \<br />
           -m "bringing WordPress 2.3.1 into the new branch"<br />
â€¦<br />
</code></p>
<p>5. Check Out and Add Customizations<br />
We check out our project&#8217;s new branch &#8211; which now includes a copy of our first WP vendor drop &#8211; and we begin customizing or re-applying any changes to the code. Unless you&#8217;re starting from scratch, this probably just involves copying over any files and folders that were previously a part of your internal project code. Since we made sure to import the exact same version of WP that was used in our in-house development (this is not an upgrade) &#8211; there should be no conflicts and fewer surprises.<br />
<code><br />
$ mkdir newproject<br />
$ cd newproject<br />
$ svn co http://svn.yourdomain.com/branches/newproject .<br />
$ cp -a /path/to/your/oldproject/* .<br />
â€¦<br />
</code></p>
<p>6. Resolve conflicts and Commit Changes<br />
Type <em>svn status</em> to see what files were modified and resolve any conflicts. Run <em>svn add</em> and <em>svn delete</em> commands where appropriate. Commit the changes and our modified version of WP is now completely integrated into our in-house project.<br />
<code><br />
$ svn ci -m "commiting changes into the new branch"<br />
$ cd ../<br />
$ rm -rf newproject<br />
â€¦<br />
</code></p>
<p>That&#8217;s It! You&#8217;re Done.</p>
<p>At this point you might be thinking to yourself: &#8220;Well, that&#8217;s not exactly a time saver.. now is it?&#8221; And, you&#8217;d be right! But we won&#8217;t stop there! With WordPress integrated into our in-house versioning system &#8211; we can now use <em>svn merge</em> to quickly perform WP upgrades on our internal project code without risk of ever deleting or over-writing our own work.</p>
<p>And, best of all, every change made to your internal project code &#8211; including those made to WP core files &#8211; will now be documented and tracked from within your own local version control system.</p>
<p><strong><em>[ Be sure to check back for the follow-up article entitled: "<a href="http://techblog.touchbasic.com/html/using-subversion-with-wordpress-part-2-maintaining-vendor-branches-and-upgrading-wp-core-files/">Using Subversion with WordPress - Part 2: Maintaining Vendor Branches and Upgrading WP Core Files</a>" ]</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/using-subversion-with-wordpress-part-1-creating-vendor-branches-and-integrating-your-existing-code/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WordPress 2.3 Plugin &#8211; ezmlm mailing list subscribe form</title>
		<link>http://techblog.touchbasic.com/html/wordpress-23-plugin-ezmlm-mailing-list-subscribe-form/</link>
		<comments>http://techblog.touchbasic.com/html/wordpress-23-plugin-ezmlm-mailing-list-subscribe-form/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 21:15:18 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[ezmlm]]></category>
		<category><![CDATA[mailing list]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/wordpress-23-plugin-ezmlm-mailing-list-subscribe-form/</guid>
		<description><![CDATA[ezmlm is a qmail-based mailing list manager written by Dan J. Bernstein. From their site: &#8220;It has all the basic functionality of a mailing list manager, such as subscriber address management including automated bounce handling as well as message distribution and archiving. Its purpose is to efficiently send a message to a large number of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ezmlm.org/">ezmlm</a> is a qmail-based mailing list manager written by Dan J. Bernstein. </p>
<blockquote><p>From their site: &#8220;It has all the basic functionality of a mailing list manager, such as subscriber address management including automated bounce handling as well as message distribution and archiving. Its purpose is to efficiently send a message to a large number of recipients with minimal delay. It allows automated additions and subtractions from the subscriber database.&#8221;</p></blockquote>
<p>i have seen it installed as the default built-in mailing list software for some shared hosting providers.<br />
i needed a way to let visitors subscribe/unsubscribe to the ezmlm mailing list directly from a webpage.<br />
but, when i searched the web for any existing WordPress plugins that could do this &#8211; i could not find any.<br />
so, i thought there might be some wordpress users or admins that want to integrate ezmlm with their website using a standard web-based html signup form and some php magic.</p>
<p><strong>description:</strong><br />
This plugin will allow visitors to subscribe and unsubscribe to your ezmlm mailing list &#8211; directly from your website &#8211; without having to manually send an email from their email client.</p>
<p>tested with WordPress 2.3.x<br />
tested on Superb Hosting, and ezmlm mailing list software.</p>
<p><strong>features:</strong></p>
<ol>
<li>basic error and spam checking built right into the plugin.</li>
<li>automatically prints out a &#8220;Thank You&#8221; or &#8220;Error&#8221; message on submit</li>
<li>you can use css to style the submit form to your heart&#8217;s content.</li>
<li>works even when your ezmlm is on a different server than you web server.</li>
<li>choose between using a standard text button or an image as your submit button.</li>
<li>choose between using the defulat privacy message, a custom message, or no message at all.</li>
</ol>
<p><span id="more-196"></span></p>
<p><strong>download:</strong><br />
<a href="http://touchbasic.googlepages.com/ezmlm-signup-form.php">ezmlm subscribe form v1.0</a></p>
<p><strong>basic install:</strong></p>
<ol>
<li>download the plugin file, place it in the plugins directory, and active the plugin.</li>
<li>configure the plugin by going to Options > ezmlm signup form (see below for more details).</li>
<li>add the following code to your theme where you would like the ezmlm subscribe/unsubscribe form to appear.</li>
</ol>
<p><code lang="php">< ?php if( function_exists('ezmlm_submit_form') ) { ezmlm_submit_form($display = true); } ?></code></p>
<p><strong>ezmlm options:</strong><br />
There are only 4 configuration options so far..</p>
<ol>
<li>Set the Name of your mailing list (for example, you would enter: newsletter, if your mailing list was at: newsletter-subscribe@yourdomain.com)</li>
<li>Set the Domain of your mailing list (for example, you would enter: yourdomain.com, if your mailing list was at: newsletter-subscribe@yourdomain.com)</li>
<li>If you want to use an Image as the submit button: Enter the full URL to the image file (URL format: http://www.yourlocation.com/path/to/image.jpg &#8211; leave this blank and the form will use a standard text submit button)</li>
<li>If you want to set a custom privacy message: Enter it in the textarea provided (Or, type: DEFAULT and the default message will be displayed. Or, leave this area blank to have no privacy message displayed at all. Hint: you can use html in here too.)</li>
</ol>
<p><strong>screencap:</strong><br />
<img class="center" style="border:1px solid #ccc; padding:5px;" src='http://techblog.touchbasic.com/html/wp-content/uploads/2008/01/ezemlm-options-sreencap.jpg' alt='ezmlm signup plugin - screencap of option setting' /><br />
<img class="center" style="border:1px solid #ccc; padding:5px;" src='http://techblog.touchbasic.com/html/wp-content/uploads/2008/01/ezmlm-signup-box.jpg' alt='ezmlm signup plugin - screencap of signup box output' /></p>
<p><strong>advanced usage:</strong><br />
- Template Tags &#8211;<br />
To place ezmlm signup form on a specific page &#8211; like page 408 &#8211; add the following code to your page.php template file.<br />
<code lang="php">< ?php if(is_page(408)) {<br />
if( function_exists('ezmlm_submit_form') ) { ezmlm_submit_form($display = true); }<br />
} ?></code></p>
<p>- Custom CSS -<br />
You can style the signup form by adding the following IDs to your style.css file.<br />
#ezmlmform (is the ID for the entire form)<br />
#urlsubmit (is the ID for the image upload button)<br />
<code lang="css"><br />
/* example usage */<br />
#ezmlmform { border:1px solid #000; padding:5px; }<br />
</code></p>
<p><strong>credits:</strong><br />
Much of this code was borrowed from a forum thread called: ezmlm php subscribe/unsubscribe form<br />
Documented here: <a href="http://forum.qmailrocks.org/showpost.php?p=16649&#038;postcount=2">http://forum.qmailrocks.org/showpost.php?p=16649&#038;postcount=2</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/wordpress-23-plugin-ezmlm-mailing-list-subscribe-form/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>WP 2.3 Plugin &#8211; Limit Visibility by Capability</title>
		<link>http://techblog.touchbasic.com/html/wp-23-plugin-limit-visibility-by-capability/</link>
		<comments>http://techblog.touchbasic.com/html/wp-23-plugin-limit-visibility-by-capability/#comments</comments>
		<pubDate>Fri, 21 Dec 2007 06:10:35 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/wp-23-plugin-limit-visibility-by-capability/</guid>
		<description><![CDATA[This plugin is pretty simple (yet effective) &#8211; so i&#8217;ll try and keep things short. You can use this plugin to limit the visibility of your WordPress 2.3 site to only logged in users that have a specific (pre-defined) WP Capability. Any of the standard WP Capabilities can be used, like: read, edit_posts, publish_posts, edit_users, [...]]]></description>
			<content:encoded><![CDATA[<p>This plugin is pretty simple (yet effective) &#8211; so i&#8217;ll try and keep things short.</p>
<p>You can use this plugin to limit the visibility of your WordPress 2.3 site to only logged in users that have a specific (pre-defined) WP Capability. Any of the standard <a href="http://codex.wordpress.org/Roles_and_Capabilities">WP Capabilities</a> can be used, like: read, edit_posts, publish_posts, edit_users, manage_options, etc. Custom capabilities can also be used.</p>
<p>Good for multi-blog setups with unified logins (single login with shared cookies) where you want some users to be able to access one site but not another unless they have certain permissions. </p>
<p>This plugin is based on <a href ="http://blog.taragana.com/index.php/archive/angsumans-authenticated-wordpress-plugin-password-protection-for-your-wordpress-blog/">Angsuman&#8217;s Authenticated WordPress Plugin</a>. All I did was combine his redirect function with some of my own logic. Now you can have slightly finer grained control over who is allowed to acces your WP site.</p>
<p><strong>Download:</strong><br />
You can get the Limit Visibility by Capability plugin (v1.0) <strong><a href="http://touchbasic.googlepages.com/limit_by_caps.php">here</a></strong>.</p>
<p><strong>Install:</strong><br />
1. Place the file: limit_by_caps.php in your /wp-content/plugins/ directory.<br />
2. Activate the plugin.<br />
3. Navigate to the Options >> Limit Visibility subpage to enable your settings.</p>
<p><strong>By default, after you activate this plugin it will:</strong><br />
1. Redirect all visitors who try to access your site (who are not logged in) to the Login page. (using Angsuman&#8217;s function)<br />
2. Redirect all logged in users without the &#8220;manage_options&#8221; capability (everyone except the Admin) to http://wordpress.org</p>
<p><strong>You can also Customize the Settings:</strong> (recommended)<br />
1. Change the minimum Capability required to access the site to something lower. (eg: using publish_posts will typically allow all Authors, Editors, and Admins in &#8211; but not Contributors or Subscribers)<br />
2. Change the external URL that logged in (but rejected) users get sent to into one of your choosing. (so if you are protecting a subdomain you might send these users to the top-level, &#8220;main&#8221; domain)</p>
<p><strong>Here&#8217;s a screencap of the Options >> Limit Visibility subpage:</strong></p>
<p><img id="image190" src="http://techblog.touchbasic.com/html/wp-content/uploads/2007/12/limit_by_caps.jpg" alt="Limit Visibility by Capability Seetings - screencap" /></p>
<p><strong>Additional Notes:</strong><br />
- Block posts, comments, searches, feeds<br />
- Deny access to the entire back-end of WP (no dashboard, no write post, etc)<br />
<del datetime="2007-12-21T06:31:32+00:00">- No access to uploaded files (no images, no pdfs, requests for exact URLs still get blocked)</del> still working on this..<br />
- Works well with Options >> Privacy turned &#8220;On&#8221; (block search engines and spiders)<br />
- Compatible with <a href="http://www.economysizegeek.com/wp-mail/">Postie</a> plugin (post via email still works)</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/wp-23-plugin-limit-visibility-by-capability/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to get the WPG2 plugin to work with Thickbox</title>
		<link>http://techblog.touchbasic.com/html/how-to-get-the-wpg2-plugin-to-work-with-thickbox/</link>
		<comments>http://techblog.touchbasic.com/html/how-to-get-the-wpg2-plugin-to-work-with-thickbox/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 21:12:07 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[g2image]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[thickbox]]></category>
		<category><![CDATA[WPG2]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/how-to-get-the-wpg2-plugin-to-work-with-thickbox/</guid>
		<description><![CDATA[If you have a Gallery2 installation intergrated with WordPress 2.3 &#8211; using the WPG2 plugin &#8211; then you are probably aware that the G2Image chooser includes a choice for inserting images into posts using the LightBox effect and pointing to a full-sized image. Well, i needed a choice/option that worked in a similar way but [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a Gallery2 installation intergrated with WordPress 2.3 &#8211; using the WPG2 plugin &#8211; then you are probably aware that the G2Image chooser includes a choice for inserting images into posts using the LightBox effect and pointing to a full-sized image.</p>
<p>Well, i needed a choice/option that worked in a similar way but for Thickbox. Since both Lightbox and Thickbox are triggered by including special attributes on each anchor (a link) and pointing to a full-sized image &#8211; i figured it could not be that hard to find and edit the code that inserts the LightBox bit and swap it out for some Thickbox code.</p>
<blockquote><p>LightBox format is: < a href="fullsized.jpg" rel="lightbox" >< img src="thumb.jpg" />< /a ><br />
ThickBox format is: < a href="fullsized.jpg" class="thickbox" >< img src="thumb.jpg" />< /a ></p></blockquote>
<p>All i ended up doing was adding the thickbox class=&#8221;thickbox&#8221; in addition to the lightbox rel=&#8221;lightbox&#8221;.</p>
<p>So the final result inserts the combined code into your WordPress posts:</p>
<blockquote><p>< a href="fullsized.jpg" class="thickbox" rel="lightbox" >< img src="thumb.jpg" />< /a ></p></blockquote>
<p>Now it works with either Lightbox or Thickbox scripts (i wouldn&#8217;t use both at the same time).<br />
Note: you still need to provide the appropriate javascript (Thickbox or Lightbox) and link to it in your header file for this to work.</p>
<blockquote><p>Tested with:<br />
WordPress v2.3.1<br />
Gallery2 v2.2.3 core 1.2.0.5<br />
WPG2 v3.0.2</p></blockquote>
<p>Anyway, here are the 3 WPG2 plugin files i edited to get this going:</p>
<blockquote><p>
<strong>wp-content/plugins/wpg2/g2image/g2image.php</strong> &#8211; [download the changed file <a href="http://touchbasic.googlepages.com/g2image.php">here</a>]<br />
<strong>wp-content/plugins/wpg2/g2image/jscripts/functions.js</strong> &#8211; [download the changed file <a id="p187" href="http://techblog.touchbasic.com/html/wp-content/uploads/2007/11/functions.js">here</a>]<br />
<strong>wp-content/plugins/wpg2/wpg2embed.inc</strong> &#8211; [download the changed file <a href="http://touchbasic.googlepages.com/wpg2embed.inc">here</a>]
</p></blockquote>
<p>These are the exact edits i made (but watch out! because copy/pasting seems to change the single quote marks):</p>
<p>g2image.php &#8211; modify option to give choice (in dropdown menu of W2Image chooser) for specifically inserting Thickbox<br />
	[code lang="php"] $message['thumbnail_lightbox'] = T_('Thumbnail with LightBox link to Fullsized Image'); [/code]<br />
	[code lang="php"] $message['thumbnail_lightbox'] = T_('Thumbnail with ThickBox link to Fullsized Image'); [/code]</p>
<p>functions.js &#8211; modify javascript to do the actual inserting of code with Thickbox<br />
	[code lang="php"] htmlCode += '<a href="' + fullsize_img[i] + '" rel="lightbox'; [/code]<br />
	[code lang="php"] htmlCode += '<a href="' + fullsize_img[i] + '" class="thickbox" rel="lightbox'; [/code]</p>
<p>wpg2embed.inc - modify wpg2tag so option (in dropdown menu of W2Image chooser) will work with Thickbox [optional]<br />
Note: for this to work you also need to have "Should WPG2 Tags have Lightbox Support?" set to "Yes" in your backend: WPG2 > Lightbox Options.<br />
	[code lang="php"] $img = str_replace('><img ', ' rel="lightbox['.$post-/>ID.']"><img ', $img); [/code]<br />
	[code lang="php"] $img = str_replace('/><img ', ' class="thickbox" rel="lightbox['.$post-/>ID.']"><img ', $img); [/code]</a/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/how-to-get-the-wpg2-plugin-to-work-with-thickbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

