drupal
Here's a link to the article: https://www.newmediadenver.com/blog/using-haversine-formula-drupal7
The problem I was handled at work was pretty simple - we're putting together a multi-language site, with English and Spanish data. However, if you search on something that's part of a proper name which shows on both English and Spanish data, then you were getting a mix of English and Spanish nodes. What we wanted was a way to automatically filter the search by the current language, something that I couldn't find anywhere. So, I rolled up my sleeves and created this:
Here's a useful module that I keep forgetting the name of, so I wanted to note it down: Stage File Proxy. It's not something you use for a live site, it's something you use while developing.
The basic idea is this: you're working on a site that's since gone live, making changes for the client. It's easy enough to get a copy of the database, but the files can be a pain to keep replacing, interlacing test files with live images. Stage File Proxy fixes this by snooping in on imagecache and, when a file is missing, then it grabs it off of the live site, copies it to the local directory, and then you've got the file locally and all your imagecache files get generated for you!
There's a version for six and for seven, and there's no ui for it yet, although there is a patch for it. Then again, once you've got the simple settings done, you don't need to worry about them again!
Here's a quick snippet I just found out today: The jquery cookie plugin is presented as part of Drupal 7. This is really cool and useful, but I must note that it's not automatically included on every page load, so you'll want to include it if you want to use it, and as well it doesn't seem to actually be documented anywhere on drupal.org.
Happily, the original documentation for the plugin is at https://github.com/carhartl/jquery-cookie/blob/master/README.rdoc, and is pretty good, although I suggest reading it through at least twice, as at first I missed that you can read, as well as set, cookies with this. Basically the parameters are the cookie name, the cookie value, and then an options object which says the expiration, the path, the domain, and such. Note that the expiration can _either_ be a date, or a number of days.
Hopefully this will help other folks out with using the jquery cookie plugin with Drupal 7.
(I originally wrote this for G+, but since it's long enough, I'm making it a blog post too.)
So, I'm making a new component for webform in Drupal, called 'Multigrid'. It's based on the grid component, which if you don't remember it, allows you to define a set of common options (like, neutral, dislike, hate beyond rational thought) and define a set of questions, and then it sets up a grid of radio buttons, where the answers are across the top and the questions go along the left side.
If you're picturing the online survey you filled out recently in the mistaken hope that you might win $500 after eating at sit-down-chain-restaurant-326, then that's pretty much it.
I really like Drupalcamp LA. It was a bit of a whim, the first time I went out there, but I went and had a blast. Not only did I get to enjoy Drupal with different folks than I saw at home, but I also got to spend a little time with my brother, who lives there.
Well, near there. LA's kind of a big place.
I've gotten a notice about this year's DrupalCamp LA, and it sounds cool, but this year I'm not going to be able to go, with the baby arriving sometime in August. Sorry guys!
Hopefully I'll get to go out next year. Maybe I'll bring along the kid.
Does anyone know how to use drush to quiet a crying baby? :)
It's been a very long week to me leading up to Drupal Camp Colorado, but it's been a successful and satisfying one. Over the weekend I complained a few times at people not to let me run three presentations, but honestly, I loved it! Really, I quite like standing in front of folks and trying to teach them something I'm passionate about, and I was lucky enough to do it three times. I may not get to do that again, really - with the way the Drupal community is growing these days in Colorado, more and more people will be available to step up and help out with sessions like this.
Here's where I plan to list links to various resources and presentations for Drupalcamp Colorado 2011!
First off is the windows_drupal_handout.odt, which is in openoffice format. This file describes how to set up Drupal on your Windows computer, and is the handout I plan to give out at the camp during How to setup a Drupal Development Environment for Windows.
Things are going really well with the baby. Wednesday, Tammy went in for another ultrasound, where they determined that everything they could see is definitely a-ok, and that in another three months we'll have a baby girl to enjoy. Since she had to take the afternoon off to go to the doctor, she headed up to Boulder, where I'd been working for almost two months, to join me.
Something useful sounding from #drupal-colorado:
<cyberswat> drush php-eval '_field_info_collate_fields(TRUE); _field_info_collate_fields()' ... arrrrrggggghhhh /me curses loudly
<cyberswat> should never have to run that
<cyberswat> c4rl: if you ever have an instance where your installing new fields and instances and every piece of code tells you that everything worked from the update hook but you still don't see the instance then run the above
<cyberswat> that took between 4:00am and now to figure out
<cyberswat> for some reason field_cache_clear(); in field_create_instance() didn't do the above as it should have
<cyberswat> field_read_instances() reads from the db not cache
<cyberswat> so when your drush_print_r ing away you'll see wrong information telling you everything is golden
This sounds like an important thing to remember.