How to add Facebook like buttons to your website
If you are looking to add facebook like buttons to your website, whether it be for users to like your website or specific content on your website, Facebook offers an extremely easy way to accomplish this.
Facebook offers a variety of ways to integrate like buttons such as HTML5, XFBML, IFRAME, and URL. If you're interested, check out:
How to Setup MySQL on Mac OS X without MacPorts
After many unsuccessful attempts to install MySQL using MacPorts, I gave up and tried something much simpler. Go to the MySQL downloads page (http://dev.mysql.com/downloads/mysql/) and download the latest DMG (http://dev.mysql.com/downloads/mirror.php?id=408354). The DMG will come with two packages, the application and a package to make MySQL run on startup. Also install MySQL.prefPane to have a nice interface to stop/start mysql daemon. To start, just go to your system preferences and click the MySQL icon to start. And that's it, go to command line and type:
/usr/local/mysql/bin/mysql
Installing Gearman on Amazon's EC2 Linux AMI Micro Instance
I have recently been using Amazon Web Services to setup an array of different servers for use with gearmand, memcached, etc. There are some dependencies but yum makes it easy to grab these and get them installed. The gearmand version below maybe out of date, so please check launchpad.net for the latest version.
Node Import playing nice with Organic Groups
Out of the box the Node Import module doesn't play nice with the Organic Groups module. When trying to configure nodes to be posted into a group after the content import, two Drupal database tables are important: og_access_post and og_ancestry. The og_access_post table has two columns, nid and og_public. The og_public field should either 0 or 1 depending on whether you want the post to be public or not. The og_ancestry table also has two columns, nid and group_nid. After importing content, it is import to update these two tables with the appropriate data.
Function to retrieve a content type form array
.code {
background: #ffffd0; margin: 12px 12px 12px 12px; padding: 3px 3px 3px 3px;
}
//$form['#field_info'] contains information about cck fields
function _cck_form_array($type) {
module_load_include('inc', 'node', 'node.pages');
global $user;
$form_state = array();
$node = array('type' => $type, 'uid' => $user->uid, 'name' => $user->name);
$form = drupal_retrieve_form($type.'_node_form',$form_state,$node);
drupal_prepare_form($type.'_node_form', $form, $form_state);
return $form;
}
Node Import Tip
I was unable to import node reference fields that were autocomplete fields. To make this work, I had to change the node reference field to a select field. Then in the csv, use the Title of the node to import that reference. Also, when trying to import a field that is a single on/off checkbox, I wasn't able to import the on value. I kept receiving an invalid value error. To fix this I had to change the single on/off value to a regular select field.
Applying Drupal Patches in Windows
Download GNU Patch Utility
Navigate to module directory you are patching.
Type "patch -p0 < path/file.patch --binary"
Without --binary you will receive the message "Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."
Removing orphaned actions
Use the url:
?q=admin/settings/actions/manage/orphan
to remove orphaned actions
How to setup WAMP to send emails over the Gmail smtp
This article explains how to setup WAMP to send emails over the Gmail smtp server using the PHP-function mail().
Software needed
Wamp - Download
Stunnel - Download
Sendmail - Download
Requirements:
Enable POP for your Gmail account
Port 465 (or 587) must be opened to the internet
Drupal install database configuration page: no result or no error messages and page reloads
When trying to install Drupal and entering database credentials, the page just reloads with no error messages displayed. The problem is because the default.settings.php file was renamed instead of copied. You must copy this file and rename the copy.
