User login

You are here

php

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

UC Bitcoin updated to 1.3

Got bored and gave the Drupal Ubercart Bitcoin Module some love, now it's even easier to accept Bitcoin payments.

new module: taxonomy freetag detection

Sometimes there is the need to manage some keywords relating to an article, but only for a certain few important subset of words.

For example you might have some tricky financial blog entry and need to grab certain keywords from it.

Well wait no more try Taxonomy Freetag Detection

Drupal Migrate with QueryPath (Handy for Lotus Notes, Custom Blogs etc)

Recently I had the chance to work with some really talented guys porting an old (albeit financially successful ) site to Drupal from Lotus Notes, What? I hear you shout, Lotus Notes??, Yes.

Using Drupal's hook update with batch reporting

Something handy for running batch run's, good to have it down as a solid example.

function our_migration_update_3(&$sandbox) {
  $sandbox['#finished'] = 0;
  // Multi-part update.
  if (!isset($sandbox['user_from'])) {
    $sandbox['user_from'] = 0;
    $sandbox['user_count'] = 10;
  }
  else {
    $sandbox['#finished'] = $sandbox['user_from']/$sandbox['user_count'];
    $sandbox['user_from'] += 1;
    sleep(2);
    if ($sandbox['user_from'] == $sandbox['user_count']) {
      $sandbox['#finished'] = 1;
      return t('our migration state 2 complete');
    }
  }
}

Jenkins continuous integration server on debian ubuntu hardy

Recently had to work with a 8.04 debian hardy machine and install Jenkins An extendable open source continuous integration server however it depends on some libs not quite available in JRE6, so Jenkins wont start correctly and you get sun.security.util.DerValue not found ..

Easy Peasy YouTube integration

Recently I added some fun functionality to tshirtslayer, that is when a user win's one of the tshirt thumbnail guessing competitions, they get to add a couple of youtube videos to the official tshirtslayer youtube playlist - and they do this through the tshirtslayer website by entering in the youtube video ID's.

Let's look at the basics, as I had never worked with the GData API before.

First obviously you have to grab the extra library, extract it something and set the path in your php.ini.

Pages

Subscribe to RSS - php