Slowly Organising Photos
February 22nd, 2012Decided a gallery package would be better than the blogging platform:
Avoca Music Festival - 23-25th March, 2012
February 20th, 2012Ahem
Chris Wilson in Avoca, there's other bands as well but Chris Wilson in Avoca...
Diary Date - 10-12 March, Russell Drever at Westbury Antiques
February 17th, 2012Russell's latest exhibition - which will be as beautiful as the last!
Open letter to Yahoo! account holders
February 13th, 2012Yahoo! account holders are being witheld information that they signed up to receive. This is not the fault of the services they signed up with, but rather the arcane and obscure mechanisms by which Yahoo! supposedly identifies spam sources. If you are a Yahoo! account holder, and you suspect that you are not getting email you should, chances are you are correct. Notify Yahoo! that their mechanisms for problem resolution simply do not work and you are going to vote with your fingers and move to another email provider.
The detail behind this is that I have two virtual servers that are with a VPS provider, on two completely different subnets and from the time they were commissioned, no email has been accepted by Yahoo! for its account holders with an error message that appears to be for persistent spamming. This is clearly an error, one that I have tried for weeks now to resolve with Yahoo! without success. They will not admit that their detection of spamming cannot be for mail they have yet to receive, but instead most likely for a previous owner of the IP addresses in question. They will not provide any clear information even as to the reason that we are - in their quaint and completely incorrect terminology - "deprioritized".
I don't really want prioiritised mail services, any level of mail service would be fine with me, and I suspect with those users who in good faith have signed up with one of the services we host. "Deprioritized" suggests that there is a chance the mail will get through, just not in a timely fashion. What we have is in fact a complete embargo on mail from our servers.
It doesn't matter how you wrap it up or what policies you quote ad-infinitum, Yahoo! If your system starts blocking mail on the first attempt then there is something wrong with your system, not mine. If it is for prior usage of the IP address, then provide me with the methods of showing that the IP address changed hands so you can reset your system. Don't lie to me and tell me that it is temporary and will resolve itself once I get my systems in line with your policies. It is not temporary, it is a complete block. My systems are in line with your policies and have been for quite some time. You will not answer any of my questions with anything other than a pointer or extract from your policy documents - so I have no idea (and I suspect neither do you) of why I am listed at all, let alone how to resolve it.
So if you are a Yahoo! account holder, stop this nonsense by switching provider. I can't be the only service provider that is affected this way, so even if you are not on one of the services we host, I can assure you there is a good probability you are affected.
If you are Yahoo!, stop this nonsense by acknowledging your system is flawed and fixing it.
Adding dynamic fields to Signups on Drupal
February 8th, 2012In my day job at SkySQL I work with Drupal as our content management system. One thing we often need to do is provide a way for people to sign up for events and the like. One such event is the upcoming SkySQL and MariaDB: Solutions Day for the MySQL® Database and unlike other events we needed to take into account the dietary requirements of those wishing to attend.
For events registration we use the Signup module and use a theme template function to provide a set of standard fields. The code looks something like this:
function ourtheme_signup_user_form($node) {
$form = array();
// If this function is providing any extra fields at all, the following
// line is required for form form to work -- DO NOT EDIT OR REMOVE.
$form['signup_form_data']['#tree'] = TRUE;
$form['signup_form_data']['FirstName'] = array(
'#type' => 'textfield',
'#title' => t('First Name'),
'#size' => 40, '#maxlength' => 64,
'#required' => TRUE,
);
$form['signup_form_data']['LastName'] = array(
'#type' => 'textfield',
'#title' => t('Last Name'),
'#size' => 40, '#maxlength' => 64,
'#required' => TRUE,
);
And so on, building up the elements and then returning the form. This is great because it allows us to have a standard set of fields for all signup pages, making life a lot simpler when creating content that requires registration. But the Solutions Day event required an extra field. I could have done this a number of ways, including putting logic in the template file to check for that particular node and only display the field then, or perhaps some other hack specific to this node. I, however, don't like specifics and tend to look for a generic solution, as the exception invariably becomes the rule.
For this exercise I wanted to be able to have a way of specifying for a particular node any extra fields that are available for this form. So I now have in the template.php file the following code:
// If there is a special field required for this, check and display
if (!empty($node->field_signup_extra) && !empty($node->field_signup_extra[0]['value'])) {
$extras = explode("\n", $node->field_signup_extra[0]['value']);
foreach ($extras as $field_def) {
$field_def = trim($field_def);
if (empty($field_def)) {
continue;
}
$elems = explode('|', $field_def);
$field_name = array_unshift($elems);
$form['signup_form_data'][$field_name] = array();
foreach ($elems as $field_element) {
list($key, $val) = explode('=',$field_element);
if ($key == 'options') {
$val = explode(',', $val);
}
$form['signup_form_data'][$field_name]['#' . $key] = $val;
}
}
}
Now all I need to do is create a field that is non-displayable but contains information to build extra fields. For example the content that describes the Dietary Requirements field is:
dietary_requirements|title=Dietary Requirements|size=40|type=textfield
The production version does a little more analysis of the input to ensure there are no possible attack vectors, but I've left that out for clarity sake.
Now, if I have an event (or other content type) that needs extra signup fields, I ensure that the content type has the new Signup Extras field and fill it on the new content with a simple field definition that Signup can use.
