Oz's blog

Oz's picture

Creating a new revision using node_save

When using node_save it might be useful to programmatically create a new revision or log a message on how the node was created. To do this is very easy. Simply add the following lines to your code:

$node = (object) NULL;
$node->type = "page";
$node->title = "Node Title";
$node->uid = 1;
$node->revision = 1;
$node->log = "Your log message here";

Oz's picture

Changing mysql root password denies access to phpmyadmin

I recently added a password to the the root account for mysql using the command:

mysqladmin -u root password your_password

I then noticed that I couldn't access phpmyadmin. So navigate to your phpmyadmin folder, (mine was C:\wamp\apps\phpmyadmin3.2.0.1) and open config.inc.php and change the following lines:

$cfg['Servers'][$i]['password'] = 'your_password';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

All should work now and phpmyadmin should be back up and running!

Oz's picture

Nodewords Tutorial from GotDrupal.com

In the midst of creating this site, I downloaded a module called SEO Checklist which is a great module when attempting to improve your Drupal SEO. Nodewords is a module that is on that list, but has a lot of different features available. I found a great tutorial on GotDrupal.com that really helped me understand all the different features Nodewords has to offer. I would recommend watching this to anyone who is interested in using the Nodewords module.

How To: Drupal SEO using Nodewords for Meta tags

Oz's picture

PHP recursively deleting non-empty directories

I needed a quick way to recursively delete a folder tree, and figured I could find something on the web out there rather than write my own. I found this code that worked like a charm.

Oz's picture

Submit buttons calling same handler

I had a form with multiple submit buttons each with their own unique validate and submit functions, but both buttons were calling the same validate and submit functions. In the form array, I had declared #validate and #submit as arrays with different function names, but still they were calling the same functions. I realized the #value parameter were both "Submit" and changed these each to their own unique values and voila it worked! Each submit button called their unique handler.

Oz's picture

PHP Directory Listing

I recently needed a script to help me recursively traverse a directory structure and figured I would browse around to see if somebody has posted source code anywhere before I went to the trouble of writing my own. Here is a link to an article posted on The Art of Web that gives a working script that does the job.


Oz's picture

Obtaining PayPal API Credentials

I needed to deliver a client with instructions on how to obtain PayPal API Credentials. I came across this site which contains great information and screen-shots about how to obtain API credentials.
Obtaining PayPal API Credentials

Oz's picture

Terms Of Service / Privacy Policy Document Generator

Here is a helpful link to a terms of service and privacy policy generator from Ben Nadel's blog. I used it to generate this sites terms of service and privacy policy.

Terms Of Service / Privacy Policy Document Generator

Oz's picture

Node Import Step 7 Bug

During step 7 of importing a csv file, I receive this warning

warning: Parameter 2 to drupal_retrieve_form() expected to be a reference, value given in E:\webserver\xampp\htdocs\database\sites\all\modules\node_import\node_import.inc on line 1842

To fix this, all that needs to be done is change:

$form = call_user_func_array('drupal_retrieve_form', $args);


$form = call_user_func_array('drupal_retrieve_form', &$args);

Syndicate content