User login

Drupal signup forms, validate the domain name has a valid MX server

Whilst the general regex validation of email addresses is fairly good in Drupal, what happens if they enter a domain that does not exist? Well they can still sign up, and the email will bounce.

Let's use the simple but reliable dns_get_record in PHP to do the dirty work for us.

function my_helper_form_user_register_form_alter(&$form, &$form_state) {
  $form['#validate'][] = 'my_email_form_validate';

}

Extending Drupal's Honeypot module with log checking

Using some simple bash command like awk and sed, I cooked up this quick drush hack to examine the server logs, there's a specific robot getting around that continuously hits up the "/user/password?name=xyz" URL, this simple line fed script grabs the IP address in the first column, sort's them, counts how many uniq's there are, then uses awk again to only print out IP's that have tried this URL more than 2 times.

Facebook style realtime event notifications in Drupal+Node.JS

Ok so this one is a bit of a hack, but on my TShirtSlayer website it fits very nicely.

Essentially I wanted to do something similar to the way FB does automatic realtime notifications but instead of focusing on people, I wanted the the focus to be on the taxonomy (things added to the site broken down by category), this is our message/event we want to spread to other users.

Tips for testing Drupal Migrate (simpletest)

Recently completed a complex job where there was significant work in lining up exported fields exported with Views data export (CSV) into the excellent migrate module, basically so the operator could export data into excel spreadsheet, adjust and re-migrate

So here's some tips I learnt.

Synchronising comments in Drupal with YouTube playlists

Here's some nice hack to synchronise peoples comments in the forum - that contain youtube links to actual youtube playlists in your account.

For example, this is great on TShirtSlayer because it's a music related website, and people often paste in links to youtube, it's a lot of fun to play a youtube playlist back when it's based on really good discussion on your website

So let's get started, I really prefer to use Drush for these kinds of events, however you could create some kind of queue mechanism from the comment being submitted instead

Drupal webform - I have the worlds laziest progress bar

I've been working on a couple of project's using the greatly improved and very popular Drupal webform module with lots of pagebreaks (pages), unfortunately for these projects some medium level of backwards compatibily is required (damn you old browsers), so here's some cheap and cheerful jQuery to inject a simple Progressbar, I like this method better because it does not require one to customise the node-webform.tpl.php

(note: the following is for Drupal-7 release of webform only)

Site specific CAPTCHA images (or how I learned to beat the 'bot)

Recently, After some massive work upgrading TShirtSlayer from Drupal-5 to Drupal-7 (!) I enabled the Drupal "reCaptcha" and "Captcha" modules, only to discover they are totally and utterly useless, it was almost like they were making it easier for bots to find and get into the site by allowing the bots the right search text to locate the site in the search engines (probably where very carefully crafted software would then go and generate accounts on my site)

HOW TO: Configuring Drupal's Ubercart Bitcoin Payment module

So there's been a bit of noise about better documentation for setting up the Ubercart Bitcoin Payment's module, so you can accept Bitcoin payment's in the equivalent market rates to your existing currencies on your shop.

So, I assume that since you have your Ubercart shop setup, you probably got as far as setting up something like the Paypal gateway or whatever, and that you have a functioning existing shop working.

Now, onto Bitcoin.

Pages

Subscribe to Front page feed