User login

Complete

To be used with care. Pages are complete only when they meet the posting guidelines.

Dumping the MySQL structure for only certain tables

NOTE: These notes are in the process of being turned into a script that will work for shared-table multisite installations as well as regular Drupal sites.

mysql structure only certain tables

http://www.datanamic.com/support/mysqldump.html

mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR mysqldump [OPTIONS] --all-databases [OPTIONS]

-no-data, -d

NOTE: These notes are in the process of being turned into a script that will work for shared-table multisite installations as well as regular Drupal sites.

mysql structure only certain tables

http://www.datanamic.com/support/mysqldump.html

mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR mysqldump [OPTIONS] --all-databases [OPTIONS]

-no-data, -d

Do not write any table row information (that is, do not dump table contents). This is very useful if you want to dump only the CREATE TABLE statement for the table.

Stop Drupal from shortening long usernames

drupal shortening long usernames

http://lists.drupal.org/pipermail/support/2007-June/005042.html

If you wanted to override this, you could define a new function in

drupal shortening long usernames

http://lists.drupal.org/pipermail/support/2007-June/005042.html

If you wanted to override this, you could define a new function in

the template.php file of your theme. To do this, simply copy the of
the existing function from <http://api.drupal.org/api/5/function/
theme_username> and rename it to your-theme's-name_username. Then
depending on what you want to do, you could simply comment out the line

$name = drupal_substr($object->name, 0, 15) .'...';

or change the value (15) to something long enough to allow the user's

Google Apps integration with Drupal

google apps drupal integration

What's out there:

Anyone interested in helping write a "Google Apps Integration Module"?
http://drupal.org/node/108906

Google Apps for Education
http://groups.drupal.org/node/2958
- that page is just idle speculation as of 2007 July.

google apps drupal integration

What's out there:

Anyone interested in helping write a "Google Apps Integration Module"?
http://drupal.org/node/108906

Google Apps for Education
http://groups.drupal.org/node/2958
- that page is just idle speculation as of 2007 July.

Google Summer-of-code project (not even one of Drupal's 20) to integrate Drupal with the Google Apps API:
http://www.techsanctuary.com/drupal-google-apps-integration

Some thoughts from Boris Mann of Bryght:
http://bryght.com/blog/boris-mann/google-apps-now-extensible-open-source-connections

Sending pictures by e-mail to a Drupal site

Dan successfully did this with the mailhandler and mailsave modules.

He'll have to post how. Here's some utterly irrelevant and useless background:

Images with mailhandler... back in 2003!
http://drupal.org/node/2702

I successfully implemented imagehandler.module for Drupal 4.0. Since mailhandler and image module has changed a lot since, you probably need retune the function. It currently supports only JPG.

Dan successfully did this with the mailhandler and mailsave modules.

He'll have to post how. Here's some utterly irrelevant and useless background:

Images with mailhandler... back in 2003!
http://drupal.org/node/2702

<

blockquote>
I successfully implemented imagehandler.module for Drupal 4.0. Since mailhandler and image module has changed a lot since, you probably need retune the function. It currently supports only JPG.

function imagehandler_mailhandler($node, $stream, $msg_number, $mailbox) {
$image = mailhandler_get_part($stream, $msg_number, "IMAGE/JPEG");

Transfering files directly between two servers: setting up ssh keys

Search words: upload ssh

Two servers with ssh keys instead of password logins won't let you copy a file directly between servers until you set this up.

(These instructions may be incomplete.)

On the new server:

cp /home/dan/.ssh/id_rsa.pub /home/dan/

If there is no file like that or .pub, make it first: ssh-keygen -t dsa

From your computer:

Search words: upload ssh Two servers with ssh keys instead of password logins won't let you copy a file directly between servers until you set this up. (These instructions may be incomplete.) On the new server: cp /home/dan/.ssh/id_rsa.pub /home/dan/

Install profiles don't work in nested subdirectories

At least in Drupal 5, installation profiles cannot be in subdirectories or named differently from their main directory.

Warning: require_once(./profiles/agaric_recipes_basic/agaric_recipes_basic.profile) [function.require-once]: failed to open stream: No such file or directory in /var/www/drupal-5-live/install.php on line 69

Fatal error: require_once() [function.require]: Failed opening required './profiles/agaric_recipes_basic/agaric_recipes_basic.profile' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/drupal-5-live/install.php on line 69

At least in Drupal 5, installation profiles cannot be in subdirectories or named differently from their main directory.

Warning: require_once(./profiles/agaric_recipes_basic/agaric_recipes_basic.profile) [function.require-once]: failed to open stream: No such file or directory in /var/www/drupal-5-live/install.php on line 69

Fatal error: require_once() [function.require]: Failed opening required './profiles/agaric_recipes_basic/agaric_recipes_basic.profile' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/drupal-5-live/install.php on line 69

Making a new release for your updated Drupal module

Making a new release, using CVS tags and all that stuff you have to do, for your updated Drupal module. This should work for youth theme or install profile, also.

If you've been following the Agaric method of committing a project to Drupal's CVS you'll have a folder with a checkout for each of the Drupal versions you are maintaining your module for.

Just navigate to the one where you need to make changes, such as:

Ebony:~/workspace/agaricdrupal/registration_role/contrib-5.x-1.x

Making a new release, using CVS tags and all that stuff you have to do, for your updated Drupal module. This should work for youth theme or install profile, also.

If you've been following the Agaric method of committing a project to Drupal's CVS you'll have a folder with a checkout for each of the Drupal versions you are maintaining your module for.

Just navigate to the one where you need to make changes, such as:

Ebony:~/workspace/agaricdrupal/registration_role/contrib-5.x-1.x

Strange no line breaks issue in Mac OS X terminal vi text editor

drupal my cvs module has no line breaks
screwy line breaks in vi
^M instead of line breaks
the whole module code is on one line in the command line vim text editor.

This was noticed after attempting, and failing, to apply a one-letter change patch. (Well I guess patches always change at least one line, so after applying a one-line patch that failed.) But I don't think this was the source of my problems, as copying and pasting through anything but SubEthaEdit seemed the leave the same problem, even copy-paste through TextWrangler left the file a mess.

drupal my cvs module has no line breaks
screwy line breaks in vi
^M instead of line breaks
the whole module code is on one line in the command line vim text editor.

This was noticed after attempting, and failing, to apply a one-letter change patch. (Well I guess patches always change at least one line, so after applying a one-line patch that failed.) But I don't think this was the source of my problems, as copying and pasting through anything but SubEthaEdit seemed the leave the same problem, even copy-paste through TextWrangler left the file a mess.

As noted in my commit message:

Getting the current domain in a Drupal site

drupal get url base

My way:

$url = $_SERVER['HTTP_REFERER']
$domain = parse_url($url, PHP_URL_HOST);
if(substr($domain, 0, 4) == 'www.') $domain = substr($domain, 4);

Used in the Agaric recipe profile for setting the files system location.

The way settings.php did it:

if (isset($_SERVER['HTTP_HOST'])) {
  $domain = '.'. preg_replace('`^www.`', '', $_SERVER['HTTP_HOST']);

drupal get url base

My way:

$url = $_SERVER['HTTP_REFERER']
$domain = parse_url($url, PHP_URL_HOST);
if(substr($domain, 0, 4) == 'www.') $domain = substr($domain, 4);

Used in the Agaric recipe profile for setting the files system location.

The way settings.php did it:

if (isset($_SERVER['HTTP_HOST'])) {
  $domain = '.'. preg_replace('`^www.`', '', $_SERVER['HTTP_HOST']);

Installing IMAP functions for PHP on Debian: an Agaric saga

Fatal error: Call to undefined function imap_open() in /var/www/drupal-5/modules/contributed/mailhandler-5.x-1.1.tar/mailhandler/mailhandler.module on line 16

Probably the Debian package php-net-imap which installs:

http://pear.php.net/package/Net_IMAP

(no useful documentation there) just doesn't do it.

So:

Fatal error: Call to undefined function imap_open() in /var/www/drupal-5/modules/contributed/mailhandler-5.x-1.1.tar/mailhandler/mailhandler.module on line 16

Probably the Debian package php-net-imap which installs:

http://pear.php.net/package/Net_IMAP

(no useful documentation there) just doesn't do it.

So:

http://us.php.net/manual/en/ref.imap.php

Do it.

Update:

Fascinating.

Searching for
php imap debian
brought nothing useful, just that silly pear package and some defunct Debian and Ubuntu packages.

However, searching for:

Syndicate content