Drupal - CCK email field from PHP
Q: How do I access a node's CKK email field from PHP, I tried $node->my_email_field[0]['value'] and it didn't work?!
Q: A lot of fields can be accessed via ['value'] but not the CCK emailfield, instead use:
$node->my_email_field[0]['email']I keep forgetting this and have to switch on devel module and use dvm() to check the field makeup which is a pain - so I am writing it down now!
- Kevin's blog
- 1902 reads
- Comments
Drupal 'facebook social' like views field
Q: How can I include a facebook like button from the 'Facebook social plugins integration' module in a view as a field, the module doesn't seem to have views integration?
A: Install the ' Views Custom Field' module, create a new PHP field in your view and then include the PHP code that follows...
- Kevin's blog
- Read more
- 2514 reads
- Comments
Drupal - PHP Add Taxonomy Term
Q: How can I programmatically create or add new Taxonomy Terms using PHP code?
A: Call the function taxonomy_save_term() passing in the details of the new taxonomy term.
- Kevin's blog
- 1 comment
- Read more
- 3110 reads
- Comments
Drupal - Memory Error & Disable Module
Q: I am working on my drupal website and have just enabled a module, now when I try to go to the Admin / Modules page I just get a PHP 'out of memory' error! How can I disable the offending module so that I can get back into the Modules Page?
A: You just need to run some database queries to switch off the offending module using phpMyAdmin or similar.
- Kevin's blog
- 1 comment
- Read more
- 813 reads
- Comments
Installing Magento on Blacknight Unix
Submitted by Kevin on Thu, 02/07/2009 - 11:32
When you try to install magento 1.3.x on Blacknight Unix hosting you may (immediatly) get the following error:
'Whoops, it looks like you have an invalid PHP version.'
Well, don't panic, this is a very similar situation to the one outlined in this earlier drupal post. Your hosting does have the correct version of PHP installed (5.2.x) it's just that the default version is an older one. You just need to disable the older PHP version, wait a few minutes and things should be ok then.
- Kevin's blog
- Add new comment
- Read more
- 1002 reads
- Comments
Drupal, Bad Block PHP & Broken Site!
Q: I was changing some PHP code in one of my blocks, saved it, and now my website won't display at all - how can I fix the problem?
A: This is a real pain, but to get around the problem you can update your drupal database directly to switch off the block, your website should then work again and you can fix the PHP error.
Sometimes if you save a block that contains a PHP error, your drupal website may no longer display at all, and you can't easily undo the error or switch off the block as you can't access the admin pages - very worrying stuff!
- Kevin's blog
- 9 comments
- Read more
- 988 reads
- Comments









