User login

Drupal Development

Set a module weight using its .install file

in placement.install

<?php
function placement_install() {
  db_query("UPDATE {system} SET weight = 10 WHERE name = 'placement'");
}
?>

The query is the same in both MySQL and PostgreSQL so for these databases (which are what Drupal core supports) this does not need to be placed in a switch statement.

Resolution

Using CVS for developing modules

We can commit to Drupal.org CVS and use it just like we use subversion to manage our sites. No more trying to develop a module in subversion and contribute changes to CVS, just do everything in CVS. It's not that much worse than SVN.

Don't believe me? Watch:

Creating a random password... the Drupal way

Lesson of the day: don't reinvent Drupal functions.

Making a quick random number

Not truly random in some cosmic computer science sense, but good enough for non-mission critical (or rather, nothing for anyone to exploit the not-complete-randomness) uses.

http://www.php-scripts.com/php_diary/122799.php3

<?php
srand(time());
$random = (rand()%9);
?>

Resolution

Agaric and lots of others need: an open source, modular messaging framework

In the context of an e-mail / mailing list manager:

Every news organization, every nonprofit, every community-oriented business or organization needs e-mail that allows personalization and tracking of recipient actions in response. Another common need is for mailing lists, which allow group participation in e-mail conversation, and for forums, which allow group conversations online.

Neither need is met well currently, particularly when it comes to integration with web sites, custom processing, and (for multiple mailing lists) prevention of duplicate messages.

Save as draft

Add a “Save as Draft” function to the blog, similar to other blogging programs.

If client doesn't have administer nodes privileges-- but she does, right?)

http://drupal.org/project/save_as_draft
dan hak 12:18
she does
benjamin melançon 12:19
ok, then they can just use 'unpublished' -- that's the only clean way without a lot of Drupal pain i think-- the heaviness of an access control module.

Use drupal_set_message with print_r to see the view code

Moving this tip over from where I posted it at Lullabot in their 50 tiips thread.

Specifically, put this in the custom argument code:

<?php
drupal_set_message('<pre>' . print_r($view, TRUE) . '</pre>');
?>

(PHP tags used for formatting here and are not entered into the argument code textbox.

To do this on a live site without regular folks seeing, while you're online as user #1, you can use this:

Agaric wants a way to decide who sees what status messages

Agaric wants a way to hide certain status messages -- such as the one produced by the update status module! -- from certain users.

http://api.drupal.org/api/function/drupal_set_message/6
and
http://api.drupal.org/api/function/theme_status_messages/6

Drupal Salesforce-integrated Contact Form: Specific Use Case

As discussed, for the contact page, I want the following fields automatically submitted through to the LEADS tab in Salesforce:

1. Company Name

2. Contact Name (First Name and Last Name – 2 fields)

3. E-mail Address

4. Phone Number

5. Address (Address, City, State, Postal/Zip code, Country)

6. Additional comments box (optional)

I can add any field to Salesforce so let me know if you need me to do that.

Syndicate content