User login

How to

Information on how to do something... anything.

Do something immediately after a node is created

Hell this would have helped:

Add 'insert/update post' op to hook_nodeapi
http://drupal.org/node/27007

Why couldn't it have gone in two years ago!? JVanDyk should have forked Drupal ;-)

His book would have been "Introduction to Vrupal 1"

Oh... needless panic. For my simple needs this wasn't a problem.

Restarting Apache the safe way: test first (ironically, discovered accidentally)

Even in GNU-Linux, don't believe everything you read.

Parsing XML with PHP for Drupal

Thanks to walkah for pointing out the exciting possibilities of Drupal and PHP 5's SimpleXML extension. (And before you ask, yes, we're taking medication to deal with this too-easy excitability issue.)

http://us3.php.net/simplexml

See list of MySQL databases via GNU Linux shell command line

Dirty secret is this will work with Windows or anything else that runs MySQL, as well as the recommended Debian, Ubuntu, Red Hat / RHEL (which is what CentOS really is) etc.

mysql -u root -p

(The long form, which is quite unnecessary, is " mysql --user=user-name --password=your-password")

Once in the MySQL command line utility:

SHOW DATABASES;

Then to see what's in a particular database:

USE agaric_example
SHOW TABLES;

Removing the view tab from embedded profiles on user pages

Solution:

How to remove view/edit tabs?

http://drupal.org/node/83090

nodeprofile remove embedded view and edit links from profile
http://api.drupal.org/api/function/theme_menu_local_tasks/5

Note the approach:

Do not allow users to post content to organic groups except from within an organic group

Note that removing any content type you add this to from the "Create content" menu (Organic groups provides its own create content menu) is highly advised.

Furthermore we're going to restrict people (non-admins) to one and only one group at a time.

This approach allows Agaric to hack in whatever exceptions we want later (planned: allow posts for discussion spaces to post to post to multiple discussion spaces), without hacking organic groups (skip down to the resolution to see Agaric's solution).

Theming google map popups to use imagecache with Views and GMap module in Drupal

So you can pass in the imagecache presets namespace directly into your GMap view for use in pop-ups.

I had (apparently) figured this out a while ago but had Dan going through the code print_r'ing views variables to try to figure out where we could intercept the file ID and change the path to imagecache... and the path was already imagecache.

Any imagecache type you create can be chosen for CCK image

Moral of the story, when you're dealing with Views, assume it can be done through the user interface. There is full and amazing Imagecache support of Views.

How to grep through insanely nested folders to find a string

Agaric forever owes a huge debt of gratitude (and a drink or something) to jmorahan, IRC hero.

I think I have a menu_rebuild that's being called way too often. What is the unix command for looking through everything in a whole nested directory, from Drupal root on down? grep something something menu_rebuild something something?
(please don't tell me to 'man grep' -- that's what I did and why what little I knew about how to use it has been lost, as evidenced by this query)

jmorahan
grep -nHR menu_rebuild /path/to/drupal/root

Theme Views FastSearch Search Bar

This implementation of hook form_alter (use your own module name instead of wsf_action) will cut down on the giant textfield used by Views FastSearch by default.

The commented out code is what you can use to identify what the heck is going on in any form.

Syndicate content