Web Development Archive

PHPlist: Advantages & disadvantages

Our main company, Medicology, derives the majority of its business from mailings to NHS staff. We currently use PHPlist to manage the sending of our emails, with the contacts being broken down into one of several lists based on the source of the contact and which day they are contacted on.

This works fine at the moment but we want to be able to have greater control over the mailings and who receives what, when. There are a few things that we’d like to do, some of which are easily done and some of which can’t be done.

Possible with PHPlist

  • Add extra contact information such as location, job title and hospital
  • Automatically schedule emails for later sending
  • Send emails through an external SMTP server requiring authentication
  • Rich Text Editor (RTE) built in for creation of good quality emails

These are all essential features for us and handled very well in PHPlist. There are some features that either don’t perform the way we want or are missing and which are also essential for us.

Missing from PHPlist

  • Skip sending to contacts if they’ve received an email within a certain time frame
  • Dynamically create lists based on selectable criteria (slighty supported in PHPlist but not to the extent we need)
  • Modify the content of the emails based on contact preferences or other database stored information

Although I’d like to continue using PHPlist, the business benefits of the missing features are too great to ignore so I think I’m going to have to make a decision and either start modifying our PHPlist installation or create my own mailing programme.

I’m going to have a look through the code for PHPlist, make a decision and then I’ll post back later.

Simply Add AdSense to your WordPress blog

Here’s a quick guide to Google AdSense to your WordPress blog. I’ve tried to keep it as simple as possible for the novice user but I’ve made a few assumptions:

  • You have a WordPress blog and know how to upload files to your webspace
  • You’ve already signed up for a Google AdSense account (if not, click on the banner on the right)
  • You won’t moan at me if you accidentally break something!

Ok, First go to your AdSense account and log in. Click on “AdSense Setup” and then “AdSense for Content”. Follow the guide to create your AdSense code (if you need help at any point, look at Google’s support pages). I’m going to show you how to add the adverts in the “Sidebar” (the strip on the right) so I recommend choosing either a Skyscraper or Vertical Banner.

Once you have you code leave it open in your browser and go to where you’re keeping your wordpress files on you PC. You’ll need to browse through the folders to:

wp-content\themes\default\

Open the file you’ll find in there called sidebar.php in a text editor (such as Notepad). All you have to do is paste your code in there. I recommend putting it at the bottom (just before the </div>) to put the ads below your other links.

Now just save the file and upload it to your webspace. Go have a look at your site and you should now have your ads on there!

If you can’t get it working, leave a comment and I’ll try and help when I get the chance.

AJAX Online Document Store

Here is the code for the simple AJAX online collaboration document store I wrote a while back.

You should just be able to upload it to the document root, edit the header.php and footer.php files to your design and everything should work. If not, try editing it to get it working on your server.

PHP Script to Import Sexshop365 into osCommerce

As I mentioned in the previous post I wanted to write a script to take the online CSV file from Sex Shop 365 and be able to import it directly into my osCommerce shops.

I’ve tested it and it works fine with my installation. You will have to modify it though as I’ve added an extra field (RRP) and modified the products_price based on this. If you’d like it, you can get the code from this page

PHP Code For Importing CSV Into osCommerce
Latest version for download as .txt file

The script should do the following:

  • Extract top level categories and import into database if not already there
  • Take sub categrories and import into database if not already there
  • Exrtact all products and import main information into products table
  • Add products name and description into products_description table
  • Match products to categories

Someone might find this useful. As per usual – back everything up first! No warranty is implied or given. Do write to me if you much up your database – I enjoy a good laugh (harsh, but for your own good newbies)

Importing sexshop365 CSV file into osCommerce

A while ago I decided I wanted to change suppliers from our existing one to Sex Shop 365 as the old one tend to be a bit slow making deliveries and you have to do all the ordering by email. Sex Shop 365 are much better since you can do everything through their site and they’re very good in general.

The only downside is that it means I’ve got to completely recreate the product database. On the up side, sexshop365 have their product range online in CSV format. Luckily there’s this osCommerice contribution that lets you import the CSV into the product database. It doesn’t do everything automatically so I’m going to work on a script to do everything and then put it up.

PayPal IPN Update

Well, the guy who ordered of me in the last post has been back on the shop and ordered again and it’s all working now. Only trouble is that I now didn’t get an email from the shop telling me an order had been placed. Luckily I get the emails from PayPal saying I’d received funds so I knew about it.

I’m going to have a look on Monday and see if there’s a known work around or if not, see if I can fix it. If I have to fix it, I’ll post the work around here.

osCommerce & PayPal IPN Invoice Error

I’ve just had an email from a customer about an order through one of our osCommerce run shops saying they had placed an order but when they had gone through to PayPal, they received a message saying

“ERROR DETECTED: This invoice has already been paid. For more information, please contact the merchant.”

I checked PayPal and there was no transaction but when checking in osCommerce the customer had placed an order which appeared to be paid for, After a bit of checking I found out what was causing the problem and the fix as well!

It appears that when using the PayPal IPN, it requires a unique Invoice Number for each transaction which isn’t a problem most of the time. We’ve had a problem because we’re using the same PayPal account (email address) for several shops. Unfortunately since we’re using seperate installations of osCommerce and therefore seperate databases for each, there’s sometimes a overlap of invoice numbers.

Luckily we aren’t the first and you can find the solution on this osCommerce Forums Thread

Modify the Page Title of a WordPress Post

I’m by no means a SEO expert but I roughly know what I’m doing and I’ve always thought that the default way WordPress displays the page titles for a post is a bit the wrong way round. A post should be optimised for the content on that particular page as opposed to the name of the blog which should mean that the post name should precede the blog name in the title tag, e.g.

<title>This is the post title » Blog Name</title>

You can do this by modifying a line of code within your header file. Go to:

WP root > wp-content > themes > theme_name > header.php

Open this file and replace the code within the title tags with the following:

<title><?php wp_title(‘ ‘); ?><?php if(wp_title(‘ ‘, false)) { echo ‘ &raquo;’; } ?> <?php bloginfo(‘name’); ?></title>

And that should be it!

AJAX Online Document Storage

I was asked at work to create a simple filestore online to store various files that needed to be accessed by various members of staff around the country. The basic requirements were:

  • Password protection
  • Checkin and checkout facility for each file
  • Basic usernames to track who has what
  • Windows explorer style folder structure
  • Upload new files, create folders and delete files or folders

Since I’ve been getting in AJAX recently I thought I would do the entire thing using it, obviously with PHP doing the background stuff. There was no real advantage of using AJAX, it was just a new project and was easily done in AJAX.

I’ve finished and tested it all now and everything is working quite well. I’ve just got to comment all the code and then I’m going to stick it all online for download if anyone wants it.

Edit: 17/07/2007
AJAX Document Store Code

phpBB and Image Verification Issues

I’ve been having the usual problems with spammers loading my board with registrations and profile with links to porn and viagra sites. I’ve got account activation enabled but couldn’t find the link to Enable Visual Confirmation.

After a bit of searching I found out that the problem was that I had installed a custom template that didn’t support the option in the Admin > Configuration page to allow me to turn it on. After googling I found this article that allows you to check your template for compatibility with visual confirmation. After making a few mods, everything was good.

The only problem now was that they were still showing up in the memberlist which kind of defeated the purpose. A few more searches and I found this post that shows you how to make the mods needed.

All fixed!