Much of the styling and theming a designer specifies in a Drupal design mockup can be easily implemented. Once in a while, you'll run into a request that seems simple, but gets far more involved.
In this project, I'm using both Drupal Blocks and Panels Panes. Blocks are used in the overall site layout/theme. Panes are used within the content area. Currently, there are five custom Panels layouts, and 15 custom Pages. Panels has made the content area customization significantly more straightforward.
A section of my current project will be hosted by an external server/service. I hand them a HTML file, and they build their content within it. One problem is that the header search form must still work. For security reasons, Drupal won't accept a Form Post without the correct Form ID, so we need Drupal to generate the form.
A common web design feature is to move the label for a form field into the field value, then clear the field once it gains focus. There are many ways to implement this functionality, but this is the Drupal 7 theming method.
- Open your template.php file.
- We will use hook_form_alter() to change the value of the search field:
Update 10/24/11: This article is the most popular article on my site. To simplify everything, I've implemented this as Image Caption Formatter on drupal.org.
My sister owns a HP laptop. Recently, while powered up, she knocked it off an ottoman. This caused a head crash and intermittent clicking noises indicating a broken hard disk. When powered, the drive responded, but would no longer boot into Windows. I put the drive in an external enclosure and was able to quickly backup all of her data. The majority of the data was luckily intact and accessible.
Currently, minecraft.net is down. When minecraft.net is down you can still play single player, but multiplayer won't work. You can connect to a server, but login will fail with a 503 errror.
To temporarily fix the problem in v1.3, edit the server.properties file stored in the same directory as the server jar/exe. Change online-mode=true to online-mode=false to disable account authorization. Save the file. Restart the server and you'll be able to connect without a 503 error.
The most important thing to remember about hard disks is that they will fail. Often, they will do it without warning. So you must make back ups and keep them current.
Recently, I had a drive fail with excessive bad sectors. It happened after I had moved a new set of photos off my memory card, but before I had copied the files to my backup drive. The bad sectors corrupted the directory structure on the drive, but I doubted the actual file data was effected. It was time for a PhotoRec recovery.
We recently purchased a new computer for my mother. She wanted nothing to do with Windows, and asked if we could install Linux. An Ubuntu 10.10 install went well, but a few things were missing. Namely, the 10hr+ battery life claimed by the manufacturer. I quickly discovered the LCD brightness was set to 100% and both video cards were enabled.
Drupal 6 provides a files table for managing files in your custom modules, but the correct usage isn't well/obviously documented. The following code works best in my experience:
$file = new stdClass();
$file->filename = file_munge_filename(trim(basename($_FILES['files']['name'][$source]), '.'), $extensions);
$file->filepath = $_FILES['files']['tmp_name'][$source];
$file->filemime = file_get_mimetype($file->filename);
$file->filesize = $_FILES['files']['size'][$source];
$file->uid = $user->uid;
$file->status = FILE_STATUS_TEMPORARY; //'FILE_STATUS_PERMANENT'