scriptygoddess

11 Jan, 2007

Email Friendly URLs

Posted by: Jennifer In: Bookmarks

Ever email someone a really long link and have the thing wrap to two lines, and then your friend gets the email clicks on the link but it's broken so they can't go to it? I just found this website: Email URL that will give you a simple URL to send to people and it will redirect them to the long complicated URL.

So for example this URL: http://www.amazon.com/o/ASIN/B000B7TBNE/ref=s9_asin_image_0/002-1630007-1917641
can simply be this url:
http://emailurl.com/1GZ374

No idea how long they store the referrer though. (I'll bet you could write a script that basically does the same thing for your personal use and stores it forever on your own database…)

Comments Off on Email Friendly URLs

09 Jan, 2007

Vertical Center Text in DIV

Posted by: Jennifer In: Bookmarks|CSS|CSS related

Like I said, I'm still fighting my way through understanding CSS. Here's a little tid-bit I finally understand today. Had a bit of text that I wanted to have centered in a nav bar. "vertical-align: middle;" didn't seem to do anything. Found this article which said this:

the thing with vertical-align is that it's vertical aligning text according to the default line-height of the inline-text boxes. You can manipulate that by setting the line-height to the same height as your block, but this will only be effective if the line of text (link) does not wrap onto more than one line.

NOW it makes sense…

So if you had:

<div id="nav"><a href="#" class="centerme">Home</a></div>

Then:

#nav {
height: 25px;
line-height: 25px;
}
.centerme {
vertical-align: middle;
}

should do the trick…

08 Jan, 2007

1px Background Image Shift

Posted by: Jennifer In: CSS

I'm still fighting my way to understand CSS – so if there's a better way to do this, feel free to let me know.

I wanted a black center column, that I would put content boxes with a white background over it. So I created my background with the centered black column, used CSS to center it and repeat the background vertically. Then I created my content box, centered that using "margin: 0 auto;". As per usual, looks great in Firefox, but IE has the box shifted over to the left by 1px.

See example here.

Poked around online. First I found this article which was talking about a different kind of shifting. They wanted you to add "html { min-height: 100%; margin-bottom: 1px; }" to your styles so that the page doesn't shift suddenly when scrollbars appear on one page and not the other. (what they have you add forces scrollbars to show on every page)

Then I found this article which explains what's happening. Because I'm centering the background via one method, and the content via another – this is the reason why it's different. They suggest using a wrapper div to center the background – thus centering everything via the same method. The only problem with this is that I wanted that black column to extend the full height of the browser window. (below the content). Just doing "height: 100%" didn't seem to work.

So I happened to have still put the code in for the scrollbar thing, and just for kicks added a 1px margin to the left side… and strangely it works. (At least on IE and Firefox on the PC. I don't have access to a mac anymore, so no idea what happens there).

See revised example here.

I'm happy I got it to work.. but I'm not sure why it does.

04 Jan, 2007

Captcha

Posted by: Jennifer In: Bookmarks|PHP Related

Just installed this captcha code on a form and it was extremely simple to do and so far seems to work great. Just thought I'd share. :)

Comments Off on Captcha

28 Dec, 2006

Cube Cart vs. Zen Cart

Posted by: Jennifer In: product review|shopping cart

I've been fighting with these two e-commerce systems the last few days. I've never worked with either of them before, so it's been a learning experience, to say the least.

What I have discovered is that I (and your experience may vary) can not stand Zen Cart. I liked the idea of it being free, and open source, and etc. etc. – but it's just unusable. I had already designed what I wanted the store to look like and needed to go apply that design to their theme. It took hours and hours and I finally gave up. One of the biggest problems is that tables were so embedded into the "basic" design, that modifying anything meant screwing everything else up.

Then I gave Cube Cart a try – (which is free if you agree to keep their copyright notice at the bottom). First of all, it's a store, I'm sure my client will have no issue paying the pretty minimal fee to remove the copyright – but before I ask them to shell out the money, I want to make sure that I can actually use the system, and apply the design. Which so far I've been able to do – mainly because their basic design is a CSS-based layout!! Not only that, the template files are easy to figure out and understand which one will do what. In just a few hours I've been able to get three times as far as I did futzing around with Zen Cart.

My only complaint is that I can't find a comprehensive "tag" (or XML) list and/or a good tutorial on how to modify everything about the template. It's been a lot of trial and error – and some of the things I wanted to do apparently require a mod (that usually costs money). Again, it would be nice to TRY some of them to see if it does what I want, but not all the mods have that same "try first – buy after" philosophy.

Still – modifying Cube Cart, even without a tutorial, had been infinitely easier than it was with Zen Cart. And the nice thing is that now that I've been working on modifying the Cube Cart pages for a little while, I feel a lot more confident about what I'm doing.

Update Well, I'm getting a little frustrated with Cube Cart. Ran into a few snags with shipping that I can't seem to fix. Going to give either one or both LiteCommerce and X-Cart a try. If anyone has worked with any of these shopping cart packages – I'd love to hear what your experience is. Liked it? Loved it? Hated it? Prefer a different package? (if so why?) Feel free to link to a post on your own blog that talks about it.

Update 1/4/07: One of the things we wanted to do was have a "fixed/custom shipping cost" for the products (ie. not have it calculate shipping based on weight or whatever) – as well as not make it required for users to have to "register" in order to make a purchase… X-Cart apparently does both of these… Going to try to install their demo version and give it a test drive. I'll keep posting updates on the progress…

Update 1/5/07: Well, heard a few horror stories about customizing X-Cart – as well I can't even install their demo because of that Ioncube thing. Here's a long list of other shopping cart packages. Eenee Meenee Minee Mo… /sigh

Update 1/7/07: Was considering Sunshop – but am now hesitating after reading this review. Next one up for review: Extcart / Avactis (are these TWO different packages? or the same one??)

Update 1/12/07: This has been quite the saga. I have tested out more shopping cart packages than I can count at this point. The ones that had the features I needed, had confusing templates. The ones that had easy to customize templates, didn't have the features I needed. I'm not interested in writing my own. Whole companies are made out of just writing this type of software, and that is not the business I want to be in. So I took a look at Squirrelcart. I had originally dismissed them because they didn't have a "demo/trial" copy I could install and play with. But at this point I was desperate. I looked at their online admin demo, and it appeared to have the features we needed. I asked their sales department for a sample template I could look at and they sent me one right away. There's a lot of files, but they're not completely confusing. The part that sold me was their documentation that outlines all the templates what they do and how to find the template you need to modify. As well, all the templates are pretty well commented so if there's something showing up on your page and you want to find the template it came from you can just view source and it's usually noted in the comments. I was told if I purchased the software I would have a 14 day evaluation period, so I bought it. I'm still in the process of customizing it for our client, but I've gotten pretty far in a fairly short amount of time. They don't currently support the payment gateway we've signed on with, but I'm told they can add it. Still waiting to hear the final word on that. So far I've been pretty satisfied and would recommend them.

Update 1/16/07: I spent a big portion of the weekend tinkering around with Squirrelcart, and implementing our custom template for it and I'm still very pleased with it. I know there's been a number of comments suggesting trying other carts, some of them I had tested and didn't care for. I know Squirrelcart is missing some features some other packages have, but the important part is that it had what we needed. Should a client come along that needed one of those other features (that Squirrelcart doesn't currently have), then I'll probably have to look into some other packages, but in the meantime, I'm satisfied with what I got. In any case, feel free to keep the comments and suggestions coming. It's always interesting to see what else is out there, and it will be good reference should I need to look for another cart in the future. :)

IMPORTANT NOTE PLEASE NOTE THE DATES at which this post and comments were made. I have indicated the versions of the software discussed in this thread on this post (and summarized some of the comments as well – consider that one the "Cliff Notes" version of this very long thread).

UPDATED 8/12/2008 Due to the length of this thread, I've both closed comments on this thread and opened up a seperate forum so that discussion can continue. Shopping Cart specific forums are here. (I created a number of other forum topics close to my heart as well)

23 Dec, 2006

Decoder Button

Posted by: Jennifer In: Scripts|WordPress Plugins

Had to create a plugin. Guess this means I'm getting back in the groove. ;P Referring back to these posts, this plugin will make a button on your edit post/page making it possible to paste some code you wanted to show, select the code, then click "decode" – which will convert your < to &lt; and > to &gt; in the selection – so that it doesn't break your page.

Installation instructions:
Download the Decoder Button plugin. (Save that page and just make sure the rename it to "decoder_button.php") Upload it to your wp-content/plugins folder, and activate on the plugins page in your wordpress admin interface.

Somewhat along the same lines as this older post

I had a "purchase" page where I wanted to allow the user to either purchase items on the site via credit card, or they could choose to pay via paypal. So two buttons. One that says "Pay with Credit Card" another that says "Pay with Paypal"… the paypal button should submit the form to paypal. The pay with credit card should submit the form to the next step on the site itself.

So in this case the form tag looks like this (with nothing in the value for action) :

<form name="paymentform" action="" method="post">

And the submit buttons look something like this:

<input type="button" name="paypal" value="Pay by PayPal" onClick="document.paypalForm.action='https://www.paypal.com/cgi-bin/webscr'; document.paymentform.submit();" />
<input type="button" name="creditcard" value="Pay by Credit Card" onClick="document.paymentform.action='paymentinfo.php'; document.paymentform.submit();" />

One thing to note – do NOT name any of the buttons "submit" otherwise it won't work.

22 Dec, 2006

Overcoming the upgrade

Posted by: Jennifer In: WordPress: Lessons Learned

I'll make notes of issues I ran into and the solutions as I go along, but so far I've had two three issues come up when upgrading.

1) When I ran the upgrade, it sort of died before finishing… I refreshed and it told me it was all set. Checked on the main page, and everything seemed to be okay – but when I logged in to start tinkering around with the settings, I couldn't log in completely. I got the dashboard with no navigation and then I clicked on something and all it wanted to do was send me to the profile page – but with nothing showing except "You do not have sufficient permissions to access this page". Googled for a solution and found one on Mark's site. Ran his script, and all was well again.

2) Then I discovered that clicking on the the "previous entries" link at the bottom sent me to a "page can not be found" error page. Google to the rescue – and found one on the WordPress Codex… (scroll ALLLL the way down to "Paged Navigation doesn't work" – There it will tell you that the error I was getting was due to the .htaccess file that WordPress generates. Delete the contents (or at least the wordpress stuff in there) and manually add the code back in from the Options -> Permalinks page. Again, all was well again.

3) This one was really weird. I had a post that was showing up in Firefox but not IE. It was like it didn't exist at all on IE. Wasn't in the source. Try to pull up the post page, and it gives you a 404 error not found. Turns out – and maybe this was because of the glitch during the upgrade – the post didn't have any status indicated. It wasn't marked as "Published", "Draft", or "Private". (The weird thing is that, then WHY did Firefox show it at all?!?) Anyway, clicking the "Published" box and re-saving the post seemed to fix the problem.

If you find any other broken links or errors, etc. – please let me know!

22 Dec, 2006

Hi… again

Posted by: Jennifer In: Announcements

=blows the dust off=
Uhm… Hi. Yeah, it's been awhile. Life has been great. Family is doing great. I've started working again (from home) woo hoo! And as such, there's a few things I've wanted to post here. Little tid bits of things. No big scripts at the moment. So, just upgrading to the latest WP, using a theme by andreasviklund.com – but I need to update the header photo. :) And then I'll be posting again, here and there.

Also – in the interest of being able to stay at home for as long as possible – I'll be adding GoogleAdSense to the site. (There's a few posts with ads on them already). I've held off doing the ad thing for a long time… but the time has come to sell out survive. See you soon…

(Speaking of blowing off the dust… over 400,000 spam comments that were stuck in moderation were deleted) LOL! Comments will be coming back online shortly…

Still on hiatus :) but wanted to post a little javascript (mainly for my future reference) I've used a few times in various applications.

One function will clear the "default" text in a field when the user clicks into it. The second function will replace the default text in the field if the field was left blank.

This goes inside the <head></head> tags:

<script type="text/javascript">
function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
}
}
function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}
</script>

Then you add the following onclick, onblur events to your field. (Shown in bold):

<input type="text" name="myfield" value="default text" onclick="clickclear(this, 'default text')" onblur="clickrecall(this,'default text')" />

Uses? a search field – your "default text" could give clues about what you can search for. ie "Enter keyword or item #". Or it could display the format of the content you want from your user, ie. a date field with this as the default text "MM-DD-YYYY".

Update 11/16/05 Updated script on the suggestion of Joan and Sunny.

Update 11/24/05 Here's another neat way to do this without the "onclick" and "onblur" embedded in the input tag itself.

Comments Off on clear default text onClick – restore if nothing entered

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements