<?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"
	>

<channel>
	<title>scriptygoddess</title>
	<atom:link href="http://www.scriptygoddess.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptygoddess.com</link>
	<description></description>
	<pubDate>Mon, 05 May 2008 18:51:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Phone number validation with jquery</title>
		<link>http://www.scriptygoddess.com/archives/2008/05/03/phone-number-validation-with-jquery/</link>
		<comments>http://www.scriptygoddess.com/archives/2008/05/03/phone-number-validation-with-jquery/#comments</comments>
		<pubDate>Sun, 04 May 2008 06:43:44 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1517</guid>
		<description><![CDATA[One of the things I&#8217;ve been playing around with a lot recently is jquery. Why I didn&#8217;t jump on this bandwagon sooner, I&#8217;m not sure, but I am kicking myself for it. So I am still a bit of nub on the jquery front - but I like to think I pick things up quickly. [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things I&#8217;ve been playing around with a lot recently is jquery. Why I didn&#8217;t jump on this bandwagon sooner, I&#8217;m not sure, but I am kicking myself for it. So I am still a bit of nub on the jquery front - but I like to think I pick things up quickly. <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>So one thing I am now using jquery regularly for is form validation. <a href="http://www.scriptygoddess.com/archives/2003/02/09/javascript-validation/">Previously, form validation used to mean a lot of script writing</a>, not to mention a fair amount of dread.</p>
<p><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">Now it&#8217;s quite painless.</a></p>
<p>My current usage of that plugin is pretty basic until I get a better handle of it. But one thing that I have been requested a number of times, is to add validation for a phone number - which is not included in that plugin. I&#8217;m not sure this is the &#8220;right&#8221; or best way to do it - but it does work. <img src='http://www.scriptygoddess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The functions are basically the same as those provided <a href="http://www.smartwebby.com/DHTML/phone_no_validation.asp">here</a> with some minor modifications and altered to be used with the jquery plugin.</p>
<p>First of course you include the jquery javascript file:<br />
<code>&lt;script language="javascript" type="text/javascript" src="/js/jquery.min.js"&gt;&lt;/script&gt;</code></p>
<p>Then the validation plugin:<br />
<code>&lt;script type="text/javascript" src="/js/jquery.validate.pack.js"&gt;&lt;/script&gt;</code></p>
<p>Then you add the function to check the phone number:<br />
<code>&lt;script type="text/javascript"&gt;<br />
$.validator.addMethod("phone", function(strPhone) {<br />
	var digits = "0123456789";<br />
	var phoneNumberDelimiters = "()- ext.";<br />
	var validWorldPhoneChars = phoneNumberDelimiters + "+";<br />
	var minDigitsInIPhoneNumber = 10;<br />
	s=stripCharsInBag(strPhone,validWorldPhoneChars);<br />
	return (isInteger(s) &#038;&#038; s.length &gt;= minDigitsInIPhoneNumber);<br />
}, "Please enter a valid phone number");</code></p>
<p>Some &#8220;helper&#8221; functions:<br />
<code>function isInteger(s)<br />
{   var i;<br />
    for (i = 0; i &lt; s.length; i++)<br />
    {<br />
        // Check that current character is number.<br />
        var c = s.charAt(i);<br />
        if (((c &lt; "0") || (c &gt; "9"))) return false;<br />
    }<br />
    // All characters are numbers.<br />
    return true;<br />
}<br />
function stripCharsInBag(s, bag)<br />
{   var i;<br />
    var returnString = "";<br />
    // Search through string's characters one by one.<br />
    // If character is not in bag, append to returnString.<br />
    for (i = 0; i &lt; s.length; i++)<br />
    {<br />
        // Check that current character isn't whitespace.<br />
        var c = s.charAt(i);<br />
        if (bag.indexOf(c) == -1) returnString += c;<br />
    }<br />
    return returnString;<br />
}</code></p>
<p>Then the line that makes the jquery run:<br />
<code>$(document).ready(function() {<br />
	$("#myform").validate();<br />
});<br />
&lt;/script&gt;</code></p>
<p>To use the jquery validation plugin - I was just adding &#8220;required&#8221; as a class to those fields that were required. Like this:<br />
<code>&lt;input type="text" name="FirstName" class="required" /&gt;</code></p>
<p>You can check email structure by also adding the class &#8220;email&#8221;.<br />
<code>&lt;input type="text" name="EmailAddress" class="required email" /&gt;</code></p>
<p>And now, using the code above, if you add the class &#8220;phone&#8221; - it will check a phone number.<br />
<code>&lt;input type="text" name="PhoneNumber" class="required phone" /&gt;</code></p>
<p>(My code above allows for some additional characters beyond just numbers - so that it will accept parens around the area code - dashes or periods between the numbers and &#8220;e&#8221; &#8220;x&#8221; &#8220;t&#8221; characters as well - in case someone needs to include an extension.)</p>
<p>Typical disclaimer - like I said - I&#8217;m still a nub at jquery. There may be a better/easier way to do the above, so as always feel free to chime in if you know what that better/easier way is&#8230;</p>
<p><strong>Updated 5/5/08</strong> I do see a &#8220;phone&#8221; method in the &#8220;additional-methods.js&#8221; file&#8230; but I needed it do things a little differently&#8230; (like allowing extension numbers etc.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2008/05/03/phone-number-validation-with-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Suckerfish Dropdown navigation going behind content</title>
		<link>http://www.scriptygoddess.com/archives/2008/05/03/suckerfish-dropdown-navigation-going-behind-content/</link>
		<comments>http://www.scriptygoddess.com/archives/2008/05/03/suckerfish-dropdown-navigation-going-behind-content/#comments</comments>
		<pubDate>Sun, 04 May 2008 01:41:22 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1516</guid>
		<description><![CDATA[Awhile back, I had a project where I created a nice clean (X)HTML page including navigation using UL and LI tags. A few months later the client decided they wanted to add a dropdown menu to the navigation. No problem, I thought. We just add the embedded lists to the navigation - style it with [...]]]></description>
			<content:encoded><![CDATA[<p>Awhile back, I had a project where I created a nice clean (X)HTML page including navigation using UL and LI tags. A few months later the client decided they wanted to add a dropdown menu to the navigation. No problem, I thought. We just add the embedded lists to the navigation - style it with CSS - and use the <a href="http://www.htmldog.com/articles/suckerfish/dropdowns/">Suckerfish dropdown menu</a> technique. Easy Peasy.</p>
<p>Except when I implemented it, the drop down menus were showing up BEHIND the rest of the content instead of &#8220;above/over it&#8221;. </p>
<p>There was a lot of other things going on in the page, I have <a href="http://www.scriptygoddess.com/resources/1516/shovernavissue.htm">a simple example that demonstrates the issue</a>.</p>
<p>I&#8217;m sure it makes sense somehow, if I had a better grasp of what &#8220;position: relative&#8221; does to the document - beyond that &#8220;position: relative&#8221; allows items INSIDE a relatively positioned block to be absolutely positioned WITHIN it (which is why I had done that). The side effect though is that it does that crazy thing with the menu.</p>
<p>Oh the HOURS and HOURS to figure that out&#8230;. /sigh.</p>
<p><a href="http://www.scriptygoddess.com/resources/1516/shovernav.htm">Here is the same page</a> - with just that one line (position: relative) removed.</p>
<p>I&#8217;ve now seen this problem crop up a few times. In one case, I was working with a design that I had not originally created and even though there were no &#8220;position: relative&#8221; in any of the css files - the only way to get the menu to be ABOVE the content was to explicitly declare &#8220;position: static&#8221; inside the div tag itself. (Even just declaring it in the css wouldn&#8217;t fix it - somewhere else it must have still been getting overridden)</p>
<p>While I&#8217;m at the point where I can&#8217;t even imagine designing a page using a table based layout anymore, I still get hit with some CSS sticking points that I just don&#8217;t get. So if you have more insight on this feel free to elaborate in the comments. I&#8217;m just so glad I was able to get the menu working!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2008/05/03/suckerfish-dropdown-navigation-going-behind-content/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Submit is Not a Function (and getting links to submit all forms in CubeCart)</title>
		<link>http://www.scriptygoddess.com/archives/2008/03/15/submit-is-not-a-function-and-getting-links-to-submit-all-forms-in-cubecart/</link>
		<comments>http://www.scriptygoddess.com/archives/2008/03/15/submit-is-not-a-function-and-getting-links-to-submit-all-forms-in-cubecart/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 14:57:30 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
		
		<category><![CDATA[Javascript Related]]></category>

		<category><![CDATA[cubecart]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2008/03/15/submit-is-not-a-function-and-getting-links-to-submit-all-forms-in-cubecart/</guid>
		<description><![CDATA[&#8220;Why am I getting that Javascript error?? WTH is it talking about - submit IS a function!!&#8221;
So here&#8217;s the deal - if you have a form and an element in the form is named &#8220;submit&#8221; - if you try to call document.myform.submit() - you&#8217;ll end up getting the &#8220;submit is not a function&#8221; javascript error. [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Why am I getting that Javascript error?? WTH is it talking about - submit IS a function!!&#8221;</p>
<p>So here&#8217;s the deal - if you have a form and an element in the form is named &#8220;submit&#8221; - if you try to call <strong>document.myform.submit()</strong> - you&#8217;ll end up getting the &#8220;submit is not a function&#8221; javascript error. (Because to javascript - &#8220;submit&#8221; is now that object element in your form - not a function)</p>
<p>So the simple solution is if you plan on using the javascript function submit() - do not name any of your form elements &#8220;submit&#8221;.</p>
<p>That&#8217;s all well and good except if you&#8217;re working on code that isn&#8217;t completely yours - and if the PHP code to process the form is specifically looking for $_POST['submit'] like so:</p>
<p><code>if (isset($_POST['submit'])) { // process form }</code></p>
<p>then you now have another problem.</p>
<p>This was the case I ran into with CubeCart recently. Most of the forms do not require a submit element to be in the form in order to process it - but a handful did. The design I was working on needed all the buttons designed and to look the same. So my options were:</p>
<p>1) Just use the regular <strong>input type=&#8221;submit&#8221;</strong> button on those forms. (Ok - but then the site is inconsistent)</p>
<p>2) search for all instances of (isset($_POST['submit']) in the code and change it to some other element I can add to the page&#8230; ie:</p>
<p><code>&lt;input type="hidden" name="formsubmitted" /&gt;</code></p>
<p>and then in the code:</p>
<p><code>if (isset($_POST['formsubmitted'])) { // process form }</code></p>
<p>(Obviously this is not recommended in the case of CubeCart as it will make it really annoying to maintain/upgrade the cart!)</p>
<p>3) add that other &#8220;formsubmitted&#8221; element I noted above to the pages that need it - then towards the top of the MAIN index.php page (which is called with all pages on the store) add the following:</p>
<p><code>if (isset($_POST['formsubmitted'])) $_POST['submit'] = 1;</code></p>
<p>Thereby setting the value of $_POST['submit'] so it will process the form&#8230;</p>
<p>Another tip with using css-styled links for buttons that will submit forms in CubeCart - you don&#8217;t need to use document.FORMNAME.submit() - from any form you can use their &#8220;submitDoc(&#8217;FORMNAME&#8217;)&#8221; function like so:</p>
<p><code>&lt;a href="javascript:submitDoc('FORMNAME');" class="myButtonStyle"&gt;Send Form&lt;/a&gt;</code></p>
<p>Just make sure the form has a name (some of them don&#8217;t).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2008/03/15/submit-is-not-a-function-and-getting-links-to-submit-all-forms-in-cubecart/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to make a progress/goal (thermometer-like) bar graph with PHP</title>
		<link>http://www.scriptygoddess.com/archives/2008/02/23/how-to-make-a-progressgoal-thermometer-like-bar-graph-with-php/</link>
		<comments>http://www.scriptygoddess.com/archives/2008/02/23/how-to-make-a-progressgoal-thermometer-like-bar-graph-with-php/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 20:09:39 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2008/02/23/how-to-make-a-progressgoal-thermometer-like-bar-graph-with-php/</guid>
		<description><![CDATA[On one of my projects recently, they needed a dynamic bar graph that would show the progress towards a goal of donations. I&#8217;ve never done something like that before, and it turns out it&#8217;s actually pretty simple to do. I&#8217;ll explain how the code works and then include everything at the end.

What we&#8217;ll be doing [...]]]></description>
			<content:encoded><![CDATA[<p>On one of my projects recently, they needed a dynamic bar graph that would show the progress towards a goal of donations. I&#8217;ve never done something like that before, and it turns out it&#8217;s actually pretty simple to do. I&#8217;ll explain how the code works and then include everything at the end.<br />
<span id="more-1512"></span><br />
What we&#8217;ll be doing is calling a php script into the src of an img tag in HTML. The php processes how to draw that image. We pass values to the PHP script to tell it what to draw. I&#8217;m going to show this with those values hardcoded in that src path - but in practice these values would probably be pulled from a database that totals up those numbers into a &#8220;total donation&#8221; value.</p>
<p>So first things first - since we&#8217;ll be passing values in the src path - we need to check for them and then pull them into our script using $_GET: (also we&#8217;ll say we&#8217;re making a image with <a href="http://us3.php.net/manual/en/function.header.php">header</a>)</p>
<p><code>if (isset($_GET['cur']) &#038;&#038; isset($_GET['goal']) &#038;&#038; isset($_GET['height']) &#038;&#038; isset($_GET['width']) ) {<br />
header(&#8221;Content-type: image/png&#8221;);<br />
//setting the values we&#8217;ll use in our script pulled in from GET<br />
$height = trim($_GET['height']);<br />
$width = trim($_GET['width']);<br />
$goal = trim($_GET['goal']);<br />
$current = trim($_GET['cur']);</code></p>
<p>Next - for the text to be displayed on the bar graph - we&#8217;ll want to say what percent towards the goal we are. (Or if the goal is reached - just say 100%)</p>
<p><code>if ($current &gt; $goal) {<br />
//if we've reached the goal - just max out current value and say 100% achieved<br />
//if you don't mind text saying over 100% then you can remove the next two lines<br />
$current = $goal;<br />
$percent= "100%!";<br />
} else if ($current == "" || $current == "0") {<br />
//if no donations - just say 0%<br />
$percent = "0%";<br />
} else {<br />
//otherwise calculate the percent to goal text<br />
$percent = round(($current/$goal)*100) . "%";<br />
}</code></p>
<p>Now lets start building our bar graph. First we <a href="http://us3.php.net/manual/en/function.imagecreate.php">create an image</a> and assign a variable name so we can apply stuff to it. Then, to create colors we can use on our image, we use the <a href="http://us3.php.net/manual/en/function.imagecolorallocate.php">ImageColorAllocate </a>function in PHP - so that it understands it&#8217;s a color.</p>
<p><code>$im = @imagecreate($width,$height)<br />
or die("Cannot Initialize new GD image stream");<br />
$bg = imagecolorallocate($im,200,200,200); // grey<br />
$fg = imagecolorallocate($im,255,0,0); //red<br />
$text_color = imagecolorallocate($im, 0, 0, 0); //black</code></p>
<p>(<em>Side note: </em>The first color that is called with imagecolorallocate&#8230; this is the color which is used as the default background of the image even though it isn&#8217;t SPECIFICALLY &#8220;applied&#8221; to the image as such in any particular function.)</p>
<p>Now we need to calculate the &#8220;fill&#8221; box. The box I&#8217;m creating in this example grows UP. This part for some reason I had the toughest time trying to understand what the values were and how to calculate it. What &#8220;x&#8221; and &#8220;y&#8221; were in relation to my graphic. So now that I have a basic understanding of how it works, I&#8217;ll try to explain it in the way that I understand it.</p>
<p>We&#8217;re going to use the <a href="http://us3.php.net/manual/en/function.imagefilledrectangle.php">imagefilledrectangle</a> function to create the box in our graphic that shows how many donations we have. PHP.net shows the function like this:</p>
<p>imagefilledrectangle ($image, $x1, $y1, $x2, $y2, $color)</p>
<p>x1 and y1 are coordinates on our image. It starts at 0 at the top and then works <strong>across our width</strong> for our <em>x value</em>, and <strong>down our height</strong> for <em>y value</em>. x1,y1 are coordinates of the left point of our rectangle, and x2,y2 are the coordinates of the right point which is on the opposite/diagonal side of our rectangle. If we wanted to fill in our image completely and our image was 20pixels WIDE and 100pixels HIGH: the top left of the image x,y coordinate value is 0,0. Then we tell it the second x,y coordinate - again we go across the full width of the image for the x value (20pixels) and go down the height of the image to get the y value (100pixels). And if that didn&#8217;t confuse you, I made a diagram that should make all that clear as mud:</p>
<p><img src='http://www.scriptygoddess.com/wp-content/uploads/2008/02/goalgraphexplanation.jpg' alt='X Y coordinate diagram' /></p>
<p>In our thermometer/goal graph - that box is dynamic - so we need to calcuate that first x,y coordinate based on our donations. Specifically - the y coordinate - because that tells us how filled up our thermometer is. Here is how I calculate it. (Because you actually are still here even after my convoluted coordinate explanation I&#8217;ll spare you the explanation of how the calculation works and you can take my word for it that it will figure out the correct height based on the goal and current achieved donation values.)</p>
<p><code>$fill = $height-(($current/$goal)*$height);</code></p>
<p>And now we make our rectangle:</p>
<p><code>imagefilledrectangle($im, 0, $fill, $width, $height, $fg);</code></p>
<p>Now lets write on our picture what the percentage is. <a href="http://us3.php.net/manual/en/function.imagestring.php">imagstring</a> has a few parameters that get passed - first is of course the image variable, then a &#8220;font&#8221; number (default fonts are 1-5), then another x , y coordinate. This will be the top left corner of where the text will show up. For simplicity sake I just have it a little off the corner at the top., then our text (we defined this earlier), and then our text color - (also defined earlier)</p>
<p><code>imagestring($im, 3, 2, 2,  $percent, $text_color);</code></p>
<p>Then we output our image to the browser:</p>
<p><code>imagepng($im);</code></p>
<p>Clean up our mess and close our &#8220;if&#8221; statement:</p>
<p><code>imagedestroy($im);<br />
}</code></p>
<p><a href="http://scriptygoddess.com/resources/1512/goalgraph.php?cur=1650&#038;goal=3000&#038;width=30&#038;height=100">Here&#8217;s a demo</a>. </p>
<p><a href="http://scriptygoddess.com/downloads/goalgraph.txt">Here&#8217;s the whole thing in one file</a> (rename it with a .php extension). </p>
<p>Call it in your html like this:</p>
<p><code>&lt;img src="goalgraph.php?cur=1650&#038;goal=3000&#038;width=30&#038;height=100" alt="Help us get to our goal" /&gt;</code></p>
<p><strong>Bonus Tip</strong><br />
<a href="http://scriptygoddess.com/resources/1512/goaldemo.htm">Now position your bar graph over another image with css.</a><br />
(I removed the text in that last example because it was too thin&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2008/02/23/how-to-make-a-progressgoal-thermometer-like-bar-graph-with-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Buyer Beware! Do not host with HostICan!</title>
		<link>http://www.scriptygoddess.com/archives/2008/02/12/buyer-beware-do-not-host-with-hostican/</link>
		<comments>http://www.scriptygoddess.com/archives/2008/02/12/buyer-beware-do-not-host-with-hostican/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 00:05:24 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
		
		<category><![CDATA[complaint department]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2008/02/12/buyer-beware-do-not-host-with-hostican/</guid>
		<description><![CDATA[Rather than clean up this post - which was updated throughout my ordeal with them - I wanted to summarize the problem I had when I was hosted with HostICan.
When I first switched to them, they seemed great at the time. I was very happy. I even signed up as an affiliate and recommended them, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.scriptygoddess.com/archives/2008/01/18/hostican-also-known-as-hostisuck-hosticant-and-a-pleothra-of-other-nicknames/">Rather than clean up this post</a> - which was updated throughout my ordeal with them - I wanted to summarize the problem I had when I was hosted with HostICan.</p>
<p>When I first switched to them, they seemed great at the time. I was very happy. I even signed up as an affiliate and recommended them, sent clients to them. A few months after I signed up however, the problems began&#8230;</p>
<p>At first I got a threatening email from them saying my site was using too much CPU/Memory. I could not get any kind of helpful response via email so I finally called them. The guy I spoke to said it was a momentary spike - everything was fine - lets see if it happens again.</p>
<p>A few weeks (?) later, it happened again. Again, I called and was told to install wp-cache and that should fix the problem. So I did.</p>
<p>I had a few more back and forths with them. The end result was that starting in 2008 I think they changed their monitoring systems, from a threatening email - to simply taking your whole site down.</p>
<p>My site has not had a massive increase in posts, or visitors in a few years. In fact, because I&#8217;ve been so busy, posting here has been less and less, and number of visitors has roughly averaged the same or less.</p>
<p>Simply put, I wasn&#8217;t happy with their service anymore. In my previous post, people said &#8220;What do you expect when you pay ~$6 for hosting&#8221; (Actually I had paid more than that - but whatever). No matter what - if that&#8217;s the service you get with cheap hosting - so be it. But what happened next is inexcusable.</p>
<p>On their site, they say that if you&#8217;re not happy, you can get your money back&#8230; they ALSO say that if you are not happy within 30 days - you can get a full refund. Well, I&#8217;m not looking for a full refund, but since I paid for TWO YEARS up front, and the service obviously isn&#8217;t working for me anymore - I would like to get a <strong>prorated refund</strong>. This is standard policy with every host provider I have ever contacted. <a href="http://www.scriptygoddess.com/wp-content/uploads/2008/01/hosticansucks.jpg">On their site</a> the &#8220;30 day RISK FREE money back guarantee&#8221; wording - is COMPLETELY SEPARATE from their &#8220;Service guarantee&#8221;:</p>
<blockquote><p>SERVICE GUARANTEE:<br />
We guarantee that we&#8217;ll provide quality service:</p>
<p>* 99.9% Uptime Guarantee<br />
* 24/7/365 Phone &#038; Email Support<br />
* <strong>Your satisfaction or your money back.</strong> (emphasis mine)</p></blockquote>
<p>When I canceled I asked for my prorated refund, and I was told I would get nothing because I was canceling outside the 30-day window. Their friendly response:<br />
<em>You seem to miss one vital thing &#8220;30 day money back guarantee&#8221; and this applies within the 30 days &#8220;Your satisfaction or your money back.&#8221; not within 7 months.</em></p>
<p>They want to massively restrict CPU and take everyone&#8217;s site down - I guess, sure, thats what you get with cheap hosting - but to put up a VERY misleading &#8220;SERVICE GUARANTEE&#8221; - and keep hundreds of dollars for hosting I&#8217;m obviously not getting/using&#8230; This is a good business practice??</p>
<p>Whatever the restriction is on CPU usage - it was so tight that I had A LOT of problems getting my database off their system&#8230; I would try to export the database, and it wouldn&#8217;t let me&#8230; I had to manually export most of the rows for my posts and comments in small increments - and even then it skipped a few. It&#8217;s also interesting to note that if you browse around on their forums, you&#8217;ll see a bunch of people complaining of this problem.</p>
<p>People - be forewarned&#8230; This is not just cheap hosting&#8230; this is a BAD BUSINESS. <strong>I STRONGLY advise against hosting with them.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2008/02/12/buyer-beware-do-not-host-with-hostican/feed/</wfw:commentRss>
		</item>
		<item>
		<title>To iPhone or not to iPhone</title>
		<link>http://www.scriptygoddess.com/archives/2008/02/06/to-iphone-or-not-to-iphone/</link>
		<comments>http://www.scriptygoddess.com/archives/2008/02/06/to-iphone-or-not-to-iphone/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 18:26:02 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
		
		<category><![CDATA[babble]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2008/02/06/to-iphone-or-to-not-iphone/</guid>
		<description><![CDATA[I&#8217;m seriously contemplating getting an iPhone. This is kind of funny for two reasons - 1) 2 years ago I swore off pda phones. I never carried it with me, because the bulky pda phone I had did not fit in my pocket, and if I couldn&#8217;t just grab it and throw it in my [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m seriously contemplating getting an iPhone. This is kind of funny for two reasons - 1) 2 years ago I swore off pda phones. I never carried it with me, because the bulky pda phone I had did not fit in my pocket, and if I couldn&#8217;t just grab it and throw it in my pocket when I quickly dashed out of the house - it would never come with me - and a mobile phone isn&#8217;t so useful when you&#8217;re mobile and it&#8217;s stuck at home. 2) When they announced the iPhone I thought it looked pretty cool, but didn&#8217;t think I&#8217;d ever have a use for it. My little phone worked just fine - it made calls. At the time that&#8217;s all I needed it for. Then I added a text messaging plan&#8230; and then the ability to check emails - the last two worked but the little phone wasn&#8217;t really good at doing anything other than the original purpose - make calls. I tried to get it to connect to google maps&#8230; I only tried once, it was a major pain and really didn&#8217;t work.</p>
<p>When my brother showed me his iPhone a few months ago, and I saw how cool it was, I definitely had gadget envy. The touch screen wasn&#8217;t as confusing as it looked on demo videos. The keyboard I found easier to use than I expected (and WAY easier than txt msg with only 13 buttons). My cell phone plan is up and quite frankly I&#8217;m unimpressed with any of the new Verizon phones&#8230;</p>
<p>So I was just wondering for anyone who stops by here - if you have an iPhone - do you like it? Why? Can you just throw it in your pocket easily enough? I use a PC - how does it do for syncing with the PC? Where do you store your address book - how well does it sync with the iPhone?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2008/02/06/to-iphone-or-not-to-iphone/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wordpress meetup &#038; Digging (more than just snow)</title>
		<link>http://www.scriptygoddess.com/archives/2008/02/03/wordpress-meetup-digging-more-than-just-snow/</link>
		<comments>http://www.scriptygoddess.com/archives/2008/02/03/wordpress-meetup-digging-more-than-just-snow/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 20:00:17 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
		
		<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2008/02/03/wordpress-meetup-digging-more-than-just-snow/</guid>
		<description><![CDATA[I was able to stop by the Wordpress meetup here in Utah and finally got to meet The Matt! After &#8220;knowing&#8221; him online for many years. (By the way, it probably goes without saying - but Matt is a very cool guy. It was really nice talking to him, and I really liked listening to [...]]]></description>
			<content:encoded><![CDATA[<p>I was able to stop by the <a href="http://joseph.randomnetworks.com/archives/2008/01/25/utah-wordpress-meetup-with-matt-mullenweg/">Wordpress meetup</a> here in Utah and finally got to meet <em>The <a href="http://ma.tt">Matt</a>!</em> After &#8220;knowing&#8221; him online for many years. (By the way, it probably goes without saying - but Matt is a very cool guy. It was really nice talking to him, and I really liked listening to his thoughts, ideas, and plans for Wordpress. As introverted as I am, and as difficult as it was to *get out of the house* LOL - I&#8217;m really glad I got up there to meet him) In talking to him, he suggested I really needed to get Scripty into some current social networking trends - like Digg - Yeah, I know. This site, as clearly apparent from the default template, has sadly been victim to my ever expanding freelance work. But with the snow storm that rolled through here, and nothing else to do this morning - I finally got <a href="http://www.kennycarlile.net/wordpress/diggbadger/">DiggBadger</a> installed. So now my posts can be dugg if you feel so inclined&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2008/02/03/wordpress-meetup-digging-more-than-just-snow/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Have button (input element) go to new page with onclick</title>
		<link>http://www.scriptygoddess.com/archives/2008/01/25/have-button-input-element-go-to-new-page-with-onclick/</link>
		<comments>http://www.scriptygoddess.com/archives/2008/01/25/have-button-input-element-go-to-new-page-with-onclick/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 18:39:48 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2008/01/25/have-button-input-element-go-to-new-page-with-onclick/</guid>
		<description><![CDATA[This is probably considered &#8220;Javascript 101&#8243; - but I still had a bit of trouble finding just the right syntax to work. Simply needed a button to open a new page (in the same browser window):
&#60;input type="button" value="THERE REALLY ARE OTHER SEARCH ENGINES!"
onclick="location.href='http://www.yahoo.com'; return false" /&#62;
]]></description>
			<content:encoded><![CDATA[<p>This is probably considered &#8220;Javascript 101&#8243; - but I still had a bit of trouble finding just the right syntax to work. Simply needed a button to open a new page (in the same browser window):</p>
<p><code>&lt;input type="button" value="THERE REALLY ARE OTHER SEARCH ENGINES!"<br />
onclick="location.href='http://www.yahoo.com'; return false" /&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2008/01/25/have-button-input-element-go-to-new-page-with-onclick/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HostICan (also known as HostISuck, HostICant, and a plethora of other nicknames)&#8230;</title>
		<link>http://www.scriptygoddess.com/archives/2008/01/18/hostican-also-known-as-hostisuck-hosticant-and-a-pleothra-of-other-nicknames/</link>
		<comments>http://www.scriptygoddess.com/archives/2008/01/18/hostican-also-known-as-hostisuck-hosticant-and-a-pleothra-of-other-nicknames/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 21:29:06 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
		
		<category><![CDATA[complaint department]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2008/01/18/hostican-also-known-as-hostisuck-hosticant-and-a-pleothra-of-other-nicknames/</guid>
		<description><![CDATA[UPDATE: If you&#8217;re reading this then you&#8217;re reading me from the new host. Crossing fingers this works out better. (I could cleary see there was something wrong with HostIcan just in trying to do the move. For starters it took my site down just taking a backup of my site. As well it would not [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE:</strong> If you&#8217;re reading this then you&#8217;re reading me from the new host. Crossing fingers this works out better. (I could cleary see there was something wrong with HostIcan just in trying to do the move. For starters it took my site down just taking a backup of my site. As well it would not let me pull down a full backup of my database, and just reviewing the database to double check which lines it had decided to skip when trying to run the download, took the site down (meanwhile the new host had no problems with that). I have noticed a few &#8220;timeouts&#8221; - hopefully that&#8217;s something that will work itself out. /sigh</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>I am SO SORRY. To anyone who followed my advice and signed up with HostICan - I&#8217;m sorry. I&#8217;m SO SORRY. A million times over. As well, I am SO SORRY that I am hosted with them. If nothing else it was a huge learning experience on what to check on with a host provider.</p>
<p>When I first switched to them I thought they were great. I loved them. Well&#8230; the honeymoon is DEFINITELY over!!</p>
<p>You may have noticed that sometimes when you come to my site a &#8220;warning&#8221; of sorts is up that says I&#8217;m using too much &#8220;CPU/Memory&#8221; on their servers. NEVER. NOT ONCE on any host did I over use too much CPU/Memory - certainly not on a regular day to day basis. And anytime I might have had a script that I was running, the host helped me pinpoint which script was causing the problem. (I&#8217;m haven&#8217;t put anything new like that on my sites for a long time). (This didn&#8217;t even happen the time that my site got slashdotted.)</p>
<p>Despite saying this on their website:</p>
<p>SERVICE GUARANTEE:<br />
We guarantee that we&#8217;ll provide quality service:</p>
<p>    * 99.9% Uptime Guarantee<br />
    * 24/7/365 Phone &#038; Email Support<br />
    * <strong>Your satisfaction or your money back.</strong> (emphasis mine)</p>
<p>(Which, by the way, is NOT under the heading &#8220;30-day money back guarantee&#8221;) they still say they will not give me a refund / pro-rated or otherwise. (I paid for two-years up front when I signed up with them - and did so thinking that I would be able to get a refund (LIKE THEIR SITE SAYS) should things not work out.) So now I&#8217;ll be calling my credit card company to dispute the charge - and hopefully switch to a new host as soon as possible.</p>
<p>Ugh.</p>
<p>This by the way is the letter I&#8217;m sending my credit card company:<br />
<span id="more-1505"></span><br />
To Whom It May Concern:</p>
<p>I am writing to dispute a charge by HostICan on June 20, 2007 in the amount of $262.80. I had purchased hosting from them and paid for two years up front with the understanding that if I was not satisfied at any time with the service I would be able to receive a prorated refund.</p>
<p>The websites I have hosted with HostICan have been in service for 5+ years. I have been with a number of different host providers, and never had any trouble with CPU or Memory usage. Shortly after signing up with HostICan I noticed my sites would go down and in its place a “warning” message would come up saying that I was using too much CPU and/or memory resources on their servers. I contacted them and tried to understand why this was happening. They first suggested I wait and see if it happens again. It did. I contacted them again, and they suggested I use a specific plugin for my content management system that should help. I installed it. But nothing changed. I still saw my site going down.</p>
<p>They now say that I’ve &#8220;outgrown&#8221; the server I&#8217;m on and suggested I move to their more expensive plan which costs 5x more a month than what I&#8217;m paying now. My site hasn&#8217;t gotten significantly larger since when I first signed up with them, so I feel that this is not a fair assessment. I asked them to tell me the hardware configuration of the server I’m on, and I got two different answers. I asked them to verify/prove which answer was correct, and they could not.</p>
<p>When I asked about getting a prorated refund because I was not satisfied – I was told I would not get one because I was outside the 30-day guarantee. However, on their site, they specifically say that satisfaction is guaranteed. (<a href='http://www.scriptygoddess.com/wp-content/uploads/2008/01/hosticansucks.jpg' title='HostICan Sucks'>Please see printout from their website included with this fax</a>). The phrase &#8220;Your satisfaction or your money back&#8221; is listed before any mention of their &#8220;30-day money back guarantee&#8221;. If this is truly the case that you do not get a prorated refund – then I think their site is incredibly misleading. I took it to mean that if one cancelled within 30 days – all money would be refunded, and after that time, it would be a prorated refund, as is standard practice with other hosts I’ve contacted and hosted with.</p>
<p>As well, on their customer forums, it would seem that many other people are having a similar problem as I am. This leads me to believe there is a defect with either their servers or monitoring system. Instead of investigating the issue, they are belligerent and blame their customers.</p>
<p>Sincerely,&#8230;.</p>
<p>I thought it would be interesting to mention that I&#8217;ve been having trouble posting this even because my site has been going up and down like a yo-yo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2008/01/18/hostican-also-known-as-hostisuck-hosticant-and-a-pleothra-of-other-nicknames/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using Wordpress (with some modifications) as a CMS</title>
		<link>http://www.scriptygoddess.com/archives/2008/01/17/using-wordpress-with-some-modifications-as-a-cms/</link>
		<comments>http://www.scriptygoddess.com/archives/2008/01/17/using-wordpress-with-some-modifications-as-a-cms/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 19:55:36 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[WordPress Hacks]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2008/01/17/using-wordpress-with-some-modifications-as-a-cms/</guid>
		<description><![CDATA[For a long time one of the things I&#8217;ve liked about Wordpress is it&#8217;s flexibility. I recently did a project for Savvydog Design for one of their clients: the National WASP WWII Museum - that involved doing some customizations to Wordpress. They wanted most of the pages on the site to be editable (I used [...]]]></description>
			<content:encoded><![CDATA[<p>For a long time one of the things I&#8217;ve liked about Wordpress is it&#8217;s flexibility. I recently did a project for <a href="http://www.savvydog.com/">Savvydog Design</a> for one of their clients: the <a href="http://waspmuseum.org/">National WASP WWII Museum</a> - that involved doing some customizations to Wordpress. They wanted most of the pages on the site to be editable (I used Wordpress&#8217; pages functionality here), they also wanted to be able to enter in news items (these would be standard blog posts with a category of &#8220;news&#8221;), as well as be able to enter in events (these would also be standard blog posts with a category of &#8220;events&#8221;). They wanted the home page of the site to show some (editable) content at the top, and then list the last 3 news or event items. On the side bar, they wanted to be able to list the next 3 <em>upcoming </em>events. Here is how I put it all together:</p>
<p>*Please note - some of the customizations take a few things as assumptions - (for example how you have your permalinks set up, etc.) So if you use any of this, do so at your own risk (most especially the part about editing a core Wordpress file - I&#8217;m sure I&#8217;ll get heat for that from SOMEONE.) Your mileage may vary, and I don&#8217;t guarantee this will work with your setup, yadda yadda yadda&#8230;<br />
<span id="more-1503"></span><br />
<strong>1) Home Page</strong><br />
So we set this up as a page. The page had a custom template.</p>
<p>By the way, to make a custom template for the page - all you need to do is create the template - which will probably look similar to your index.php, except with any modifications you want to make - and then at the top, above any other code, have the following code so that Wordpress knows it&#8217;s a custom page template:<br />
<code>&lt;?php<br />
/*<br />
Template Name:CustomHomePage<br />
*/<br />
?&gt;</code></p>
<p>So in this case - I wanted the top portion to be editable as a page&#8230; So where the content belonged I had this:<br />
<code>&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;<br />
&lt;h1&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;<br />
&lt;?php the_content('&lt;p class="serif"&gt;Read the rest of this page &raquo;&lt;/p&gt;'); ?&gt;<br />
&lt;?php endwhile; endif; ?&gt;<br />
&lt;?php edit_post_link('Edit this entry.', '&lt;p&gt;', '&lt;/p&gt;'); ?&gt;</code></p>
<p>Now to list news and events - I wanted to allow them the ability to post news and event items that didn&#8217;t have to show up on the home page. So I created a third category called &#8220;Show on home page&#8221;. So they could enter an event or a news item in - indicate if it was a news or event item by selecting the appropriate category - and then if they wanted to have it show up on the home page, they would also indicate it as being in the &#8220;show on home page&#8221; category&#8230; To display that list of &#8220;posts&#8221; I had this:<br />
<code>&lt;?php<br />
$pageposts = $wpdb-&gt;get_results ("SELECT * FROM wp_posts, wp_term_relationships WHERE wp_term_relationships.object_id = wp_posts.ID &#038;&#038; wp_term_relationships.term_taxonomy_id = '<strong style="color:red">4</strong>&#8216; &#038;&#038; wp_posts.post_status = &#8216;publish&#8217; &#038;&#038; wp_posts.post_category = &#8216;0&#8242; &#038;&#038; wp_posts.post_type = &#8216;post&#8217; order by post_date desc limit 3&#8243;);<br />
foreach ($pageposts as $post):<br />
setup_postdata($post);<br />
?&gt;<br />
&lt;h2&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;Permanent Link to &lt;?php the_title(); ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;<br />
&lt;small&gt;&lt;?php the_time(&#8217;F jS, Y&#8217;) ?&gt;&lt;/small&gt;<br />
&lt;?php the_content(&#8217;Read the rest of this entry &raquo;&#8217;); ?&gt;<br />
&lt;?php endforeach; ?&gt;</code></p>
<p>So that&#8217;s doing a custom query to the database. It so happens that &#8220;show on home page&#8221; category has an id of 4 (you can see each category&#8217;s ID by looking at the manage->categories page.) So you put that &#8220;4&#8243; in where I have it in bold and red in the code&#8230;</p>
<p>This file gets uploaded to your theme directory. Then, to create a page using this template, create a new page (or &#8220;Write Page&#8221;) - and on the right hand side, you&#8217;ll see a box &#8220;Page Template&#8221; - your template should be in the list by what you named it at the top (in this example it would be &#8220;CustomHomePage&#8221;). The title for the page is what the page will be named.</p>
<p>Then, to get THAT page to show up as the &#8220;home&#8221; page - go to Options -&gt; Reading - and where you see Front page displays: select &#8220;static page&#8221; - and for &#8220;front page&#8221; select the page you created.</p>
<p><strong>2) Sidebar</strong><br />
So there were a few tricky things with the events. I wanted the user to be able to enter in all the information about an event, but to set the DATE of that event as the &#8220;date&#8221; of the &#8220;post&#8221; so it would show up chronologically - kind of like an events calendar. The problem is that Wordpress gives all posts with a date in the future a &#8220;post_status&#8221; of &#8220;future&#8221;&#8230; so if you&#8217;re looking for posts with a status of &#8220;publish&#8221; - you won&#8217;t find them. There was a plugin that I found that considered all posts with &#8220;future&#8221; status to be &#8220;publish&#8221; without making any core file modifications - but I found it also has a side effect of showing those &#8220;future&#8221; posts mixed in with my list of pages. I was concerned that this would cause too much confusion and opted instead to make a very minor change to one of the core files. (I&#8217;ve now gotten into the habit of keeping a log of any core file changes I make so that upgrades aren&#8217;t too stressful. If the changes are kept to a minimum -upgrading shouldn&#8217;t be too bad and the changes can be made again to the new updated files)</p>
<p>So, in order to change the status of those posts - and get them to show up normally, I edited wp-includes/post.php, at about line 667, and changed this line:<br />
<code>$post_status = 'future';</code><br />
to this instead:<br />
<code>$post_status = 'publish';</code></p>
<p>Now, in order to pull out JUST the next 3 <em>upcoming events</em>, I again did a custom post query. (in my sidebar.php template file)<br />
<code>&lt;?php<br />
//first set up what is the current date/time<br />
$now = gmdate('Y-m-d H:i:59');<br />
$pageposts = $wpdb-&gt;get_results ("SELECT * FROM wp_posts, wp_term_relationships WHERE wp_term_relationships.object_id = wp_posts.ID &#038;&#038; wp_term_relationships.term_taxonomy_id = '<strong style="color:red">3</strong>&#8216; &#038;&#038; wp_posts.post_status = &#8216;publish&#8217; &#038;&#038; wp_posts.post_category = &#8216;0&#8242; &#038;&#038; wp_posts.post_type = &#8216;post&#8217; &#038;&#038;  wp_posts.post_date_gmt &gt; &#8216;&#8221;.$now.&#8221;&#8216; order by post_date asc limit 3&#8243;);<br />
foreach ($pageposts as $post):<br />
setup_postdata($post);<br />
?&gt;<br />
&lt;h3&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;Permanent Link to &lt;?php the_title(); ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;<br />
&lt;p class=&#8221;date&#8221;&gt;&lt;?php the_time(&#8217;F jS, Y&#8217;) ?&gt;&lt;/p&gt;<br />
&lt;?php the_excerpt(); ?&gt;<br />
&lt;?php<br />
// to find out if there ARE any future events being displayed, I set this variable up so I can test for it later&#8230;<br />
$nextevents = true; ?&gt;<br />
&lt;?php endforeach; ?&gt;</code><br />
FYI - That &#8220;3&#8243; in red/bold&#8230; that&#8217;s the category ID for my events category.</p>
<p>So that&#8217;s all well and good - but what if it&#8217;s a slow month and there aren&#8217;t any future events yet. I don&#8217;t want that bar to empty&#8230; So I figure I&#8217;ll show the last (just past) event instead&#8230;<br />
<code>&lt;?php<br />
//if no future events show last (1) event<br />
if (!isset($nextevents)) {<br />
$now = gmdate('Y-m-d H:i:59');<br />
$pageposts = $wpdb-&gt;get_results ("SELECT * FROM wp_posts, wp_term_relationships WHERE wp_term_relationships.object_id = wp_posts.ID &#038;&#038; wp_term_relationships.term_taxonomy_id = '<strong style="color:red">3</strong>&#8216; &#038;&#038; wp_posts.post_status = &#8216;publish&#8217; &#038;&#038; wp_posts.post_category = &#8216;0&#8242; &#038;&#038; wp_posts.post_type = &#8216;post&#8217; &#038;&#038;  wp_posts.post_date_gmt &lt; &#8216;&#8221;.$now.&#8221;&#8216; order by post_date asc limit <strong>1</strong>&#8220;);<br />
foreach ($pageposts as $post):<br />
setup_postdata($post);<br />
?&gt;<br />
&lt;h3&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;Permanent Link to &lt;?php the_title(); ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;<br />
&lt;p class=&#8221;date&#8221;&gt;&lt;?php the_time(&#8217;F jS, Y&#8217;) ?&gt;&lt;/p&gt;<br />
&lt;?php the_excerpt(); ?&gt;<br />
&lt;?php endforeach; ?&gt;<br />
&lt;?php } ?&gt;</code></p>
<p>Those two things were probably the toughest. I do wish there was a setting in Wordpress somewhere so I can turn that setting posts in the future to PUBLISH instead of future. But I don&#8217;t think there&#8217;s a hook for it. Maybe they&#8217;ll add it in - and a plugin can be written to do that - so that no core modifications are necessary&#8230;</p>
<p><strong>3) Fun with navigation</strong><br />
So the next trick was getting the subnavigation to work the way we wanted. There was some main nav items (pages) and some of them would have subnavigation. If the page did have subnavigation, we wanted to make the main page part of the list of pages under that main heading. So for example&#8230; Here is some <strong>main nav</strong> items:</p>
<p><strong>About the museum - Donations - Photo Gallery</strong></p>
<p>About the museum has the following sub pages: (Directions - Membership) But when you click on the &#8220;About the museum&#8221; main navigation - we want that page to be the &#8220;default&#8221; first page&#8230; so in the sub nav area you&#8217;d have:</p>
<p>About the muesum<br />
Directions<br />
Membership</p>
<p>Otherwise, I think it wouldn&#8217;t be clear how you get to that first (top-level) page&#8230; </p>
<p>But I don&#8217;t ALWAYS want to show that main nav item in the sub navigation&#8230; Photo Gallery is only one page - there&#8217;s no need for subnavigation on that page at all&#8230; (will probably make more sense if you go see the finished version of the site and click around on the pages&#8230;)</p>
<p>In any case, this is how I did the subnavigation. Using a <a href="http://www.scriptygoddess.com/archives/2007/04/30/listing-subpages-in-wordpress/">trick I&#8217;d posted about before</a> - I get the list of subpages this way: (This goes at the very top of my header.php template file)</p>
<p><code>&lt;?php<br />
$page = $wp_query->post;<br />
$parent_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE ID ='$page->post_parent;'");<br />
if(!$parent_id) $parent_id = $post->ID;<br />
?&gt;</code></p>
<p>But now I also need to know if the page I&#8217;m on has subpages at all&#8230; and I need the name and the title of the parent page.. (you&#8217;ll see why and how I use this shortly)</p>
<p><code>&lt;?php<br />
$getasubpage = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE  post_parent = '$parent_id'");<br />
$hassubpages = false;<br />
if ($getasubpage) {<br />
$hassubpages = true;<br />
$parentpage = $wpdb->get_row("SELECT post_title, post_name  FROM $wpdb->posts WHERE ID = '$parent_id'");<br />
}<br />
?&gt;</code></p>
<p>Now where I want to list our subnavigation:</p>
<p><code>&lt;ul id="subnav"&gt;<br />
&lt;?php if(wp_list_pages("child_of=".$parent_id."&#038;echo=0")): ?&gt;<br />
&lt;li&lt;?php if ($parent_id == $post-&gt;ID) { echo ' class="current_page_item"'; } ?&gt;&gt;&lt;a href="&lt;?php echo "/".$parentpage-&gt;post_name."/"; ?&gt;"&gt;&lt;?php echo $parentpage-&gt;post_title; ?&gt;&lt;/a&gt;&lt;/li&gt;<br />
&lt;?php wp_list_pages("title_li=&#038;child_of=".$parent_id."&#038;sort_column=menu_order&#038;depth=1");?&gt;<br />
&lt;?php endif; ?&gt;<br />
&lt;/ul&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2008/01/17/using-wordpress-with-some-modifications-as-a-cms/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.737 seconds -->
<!-- Cached page served by WP-Cache -->
