<?php

$proper_pages_prefixes = array("/projects","/wp-content/projects");
$matched_a_project_page = false;
foreach($proper_pages_prefixes as $proper_pages_prefix) {
	if ( substr($_SERVER["REQUEST_URI"],0,strlen($proper_pages_prefix)) == $proper_pages_prefix ) {
		$matched_a_project_page = true;
		break;
	}
}

$proper_articles_prefixes = array(
"/archives/2006/01/25/a-summary-of-the-threats-to-our-way-of-life",
"/archives/2006/01/11/why-swap-is-good-even-with-tons-of-ram/",
"/archives/2006/01/27/turning-the-tide-on-the-threats-to-our-way-of-life/"
);
$matched_an_article_page = false;
foreach($proper_articles_prefixes as $proper_article_prefix) {
        if ( substr($_SERVER["REQUEST_URI"],0,strlen($proper_article_prefix)) == $proper_article_prefix ) {
                $matched_an_article_page = true;
                break;
        }
}


$returnuri = "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
$returnuri = urlencode($returnuri);
$returnuri = "http://" . $_SERVER["SERVER_NAME"] . "/";

?><?php if ($matched_a_project_page) { ?>

<h2 id="heading-donate">Liked this software?</h2>
<ul class="boxmeup"><li>
<div>Did you find this useful?  Would you like to support the continued improvement of this software?</div>
<div><a href="https://www.paypal.com/xclick/business=rudd-o@rudd-o.com&amp;return=<?php print $returnuri; ?>" title="Leave a tip &mdash; you choose how much!">Then consider leaving a tip</a>.</div>
</li></ul>

<?php } elseif ($matched_an_article_page) { ?>

<h2 id="heading-donate">Liked this article?</h2>
<ul class="boxmeup"><li>
<div>Did you find it interesting?  Would you like to support this site?</div>
<div><a href="https://www.paypal.com/xclick/business=rudd-o@rudd-o.com&amp;return=<?php print $returnuri; ?>" title="Leave a tip &mdash; you choose how much!">Then consider leaving a tip</a>.</div>
</li></ul>

<?php } ?>
