diary of an indie game developer

 

Archive for the 'Web Dev' Category

The PHPList Experiment

Tuesday, May 13th, 2008

We have a lot of small business clients, so we’re always looking for ways to save them money.  High monthly subscription fees, or expensive software that requires yearly upgrades, can be a major barrier for someone just starting their business.  That’s one reason we use OSCommerce for online stores and Wordpress as a mini-CMS.  (Another reason is that these two open source projects have huge, involved communities, who are constantly writing all sorts of useful add-ons.)

With that mindset, we decided to give PHPList a go.  In short, it’s not the right solution for our clients.  Wordpress bucks the open source trend in that it has a well-designed, easy to use interface.  We’ve had little problem handing it off to clients and letting them update their own sites.  (They still require some support, but that’s content for another post.)  PHPList, on the other hand, is designed squarely by coders, for… if not coders, at least highly technical people with a patient try and try again attitude.

For example, a green check mark in the “bl l” category means “don’t ever send this person email” (while a red X means, please, send email to this person).  The default for mailing list imports and user sign-ups is to send that user text-only emails– not a multipart “HTML if you can, text if you can’t” email.  Message sent logs are indecipherable: I still don’t know what it means that I sent one newsletter to 82 users, which includes 4 HTML emails and… 134 text emails?  Isn’t 134 greater than 82?

PHPList does some things right.  It’s great about preventing duplicate mailings, for example, which is crucial when you’re sending to a large list that might get cranky if they get a few too many newsletters.  It also makes sending a test email fairly simple, another big plus.

PHPList is certainly powerful enough to run a newsletter.  However, most of our clients don’t have large tech departments– they have a technically inclined  person who’s already overworked, and doesn’t want to spend a lot of time handling a new responsibility.  We’re experimenting with new options now.  Having rejected quite a few programs out of hand simply because their web sites are far too obnoxious (seriously– ask me and I can email you a link), and others for insufficient flexibility, we’re currently browsing MailChimp.  If we have a successful deployment with one of the new programs, I’ll post about it here.

Disabling Comments in Old Wordpress Posts

Wednesday, May 7th, 2008

I like leaving comments on for old entries, in case people happen across my site via Google and decide to say something. Some clients prefer to keep discussion on newer posts, though. Plus, given that most of the spam attempts happen to old entries, I can see the logic in shutting down comments on old posts.

There used to be a plugin floating around to do this, but it seems to be gone. I’m not going to make a plugin out of this change (though it would be helpful if you’ve enabled auto-update for Wordpress), but here’s how to disable comments on old posts:

  1. Open wp-includes\comment-template.php.
  2. Change this line:
    if ( 'open' == $post->comment_status)
    to this:
    if ( 'open' == $post->comment_status && time() < strtotime($post->post_date)+60*60*24*30 )
  3. Figure out what to do with the rest of your day.

The “60*60*24*30″ math up there is for 30 days (60 seconds times 60 minutes times 24 hours times 30 days), which you can of course change to whatever you’d like.

Like many Wordpress tweaks, the coding itself is trivial– you just need to know where to look. Speaking of which, ever want to know how to get a list of all the fields in the $post object? It’s in the documentation for the get_post function.

GoDaddy Hosting (Mini-)Review

Tuesday, December 18th, 2007

A client of ours had their site hosted with GoDaddy, so I took the time to dig through it a bit.  First, the good: it seems reasonably peppy, and you can easily switch between Windows and Linux hosting.

Unfortunately, you only get one database user per database– the admin user.  You cannot create additional users.  GoDaddy’s help documentation is pretty sparse, so it took me an email to support to figure this out, but they confirmed it.  (Actually, they told me that it’s not possible to create multiple users in a “shared hosting environment”, by which I suppose they mean theirs, as every other host I’ve dealt with hasn’t had a problem doing so.)

That’s pretty much the start and end of my experience with GoDaddy web hosting.  I suspect their other advanced features are similarly limited, but until they fix the database user issue there’s no sense in finding out.  GoDaddy web hosting seems perfectly fine if you just want to post a few files, but HostGator is dirt cheap and far more functional.

Quick Google AdWords Tip: Kill the Content Network

Friday, December 14th, 2007

I’ve found that a lot of people want Google AdWords, but they don’t have the time to properly manage them.  It takes a while to understand all the data they throw at you, and hiring someone to manage your campaign is prohibitively expensive for many budgets.  So, whenever I come across a super quick tip to help out with an AdWords campaign, I’ll make sure to post it.

The first one is easy: kill off your content network ads.  If you go into your campaign details in your AdWords management area, you’ll see a check box to enable or disable content network advertising.  Content network ads show up on other sites (not Google search) that have signed up for the program, and which Google thinks are relevant to your ad.  Disable them and save your changes.

Why disable content network ads?  You only pay per click, so even if people are less likely to click on content network ads than normal ads, a click is a click, right?  Not really: in most campaigns I’ve managed, I’ve found that content network clicks are worth considerably less than a search engine ad click.  The visitors spend less time on the site and are less likely to buy.

If you have more time to manage your campaign, you can set separate content network bids that are much lower than your search engine marketing bids, based on your statistics which will show you how valuable a content network visitor is to you.  (Every campaign is different, so your results will vary.)  Keep in mind, though, that Google enables content network advertising by default: meaning that lots of people are unknowingly overpaying for these low-quality ads.  This means that bargains in content network advertising are few and far between.

How to Make Paypal’s Continue Shopping Button Work in Firefox

Wednesday, July 18th, 2007

Just a quickie, since I’ve seen this question around a lot.

If you follow Paypal’s instructions for their basic shopping cart (the one that takes the visitor to Paypal from your site, with their “Add to Cart” button), the “Continue Shopping” button will not work in Firefox.  It also opens the window in a new tab, and may make it full screen height.

The workaround is simple.  In each form tag, put target=”self”.  Add a new input tag, type=”hidden”, name=”shopping_url”, value=”whatever_url_you_want_continue_shopping_to_point_at.html”.

The Joys of an Unspecified Format

Tuesday, May 15th, 2007

I’m currently importing batches of CSV (comma separated value) data into a MySQL database, using phpmyadmin.

As you might expect, phpmyadmin has a default character to “separate” the “values”.  As you might not expect, the default is… a semicolon.

Position:fixed in IE < 7

Wednesday, April 25th, 2007

Continuing in the vein of nothing’s simple in web development, here’s a great writeup on how to get fixed positioning in IE.  One solution requires that you put IE into “quirks” mode, and the other has even more serious drawbacks, but they seem to be the best solutions available.  Either don’t do fixed positioning, or use one of these solutions at your own risk!

The Perfect Popup

Tuesday, April 10th, 2007

As a web developer, sometimes (rarely!) you just can’t get around creating a popup. Maybe you want to be able to define some terms, and can’t use a floating div because of Internet Explorer z-order bugs. Perhaps your client just really, really wants one.

This simple request– make a popup– is actually much more difficult than it seems. Window size and positioning requirements frequently preclude the use of target=”_blank”. Once you move to Javascript, though, you run into browsers running sans Javascript, popup blockers, and search engine unfriendliness.

To anyone who’s been in web development for a while, this isn’t a surprise: almost any seemingly small task becomes a maze of browser incompatibilities, security settings, search engine optimization, user experience, accessibility for the blind, and on and on. You need a toolkit you can return to, or you’ll end up spending hours or days on every “minor” feature.

Accessify provides some great scripts and tips to augment your bag of tricks. Returning to the subject at hand, they have this extensive walk-through of their perfect popup script. Web developers: it’s probably better than whatever you’re currently using for popups, on those rare occasions you have to use them. Everyone else: it’s a frightening demonstration of how much thought goes into what, on first glance, looks like one line of code.

Multiple stylesheets with TinyMCE

Tuesday, March 6th, 2007

It looks like the TinyMCE editor (the default editor for Wordpress) doesn’t support specifying multiple stylesheets for edited content. This is particularly common, since you’ll generally want to use your site’s CSS, plus a CSS full of overrides for the editor.

There are some helpful tips on the TinyMCE forums, but I’ll sum up the simplest hack here: simply write a PHP file that includes all the stylesheets you want.  My file here (copied from forum user “unfold”):

Filename: editor-styles.css.php
$includeme = $_SERVER[’DOCUMENT_ROOT’].”/sitesubdir/site-style.css”; if (file_exists($includeme)) {include($includeme);}
$includeme = $_SERVER[’DOCUMENT_ROOT’].”/sitesubdir/editor-overrides.css”; if (file_exists($includeme)) {include($includeme);}
?>

I still feel like TinyMCE should offer the option by default, since it’s so common, but I won’t argue with such a quick solution!

Creating a .htaccess file in Windows

Friday, February 16th, 2007

How many times has this happened to you?

  • File->New->Text Document.
  • Change from “New Text Document.txt” to “.htaccess”.
  • Windows: “You must type a file name.”
  • Hit F2 to rename.
  • Change from “New Text Document.txt” to “.htaccess”.
  • Windows: “You must type a file name.”

That’s right– Windows won’t let you create a file starting with a period.  Fret no more!

  • Open Notepad, Vim, or whatever you like.  Create a new document.
  • Save as .htaccess.
  • Hooray!  Other programs are not subject to explorer’s restrictions.