User login

Drupal Development

Figuring out Organic Groups Project module integration: output of project module's link altering hook

See also, for OG/Project integration, Adding and modifying organic group action (create content) links.

Figuring out organic project module

These are the links we have to deal with, from hook_project_page_link_alter().

Advanced Forum: module to consider later

For ScienceCollaboration.org and indeed for any of our sites, current or future, with a forum:

To consider later:

More advanced forum look and functionality. As of this writing, Advanced Forum is in alpha for both Drupal 5 and 6.

http://drupal.org/project/advanced_forum
http://drupal.org/node/227108

Resolution

RDFa in Drupal core: some suggestions from the semantic web community

http://drupal.org/project/vcard

Suggested simplification of the syntax, and a small correction, from <a href="http://lists.w3.org/Archives/Public/public-rdf-in-xhtml-tf/2008Oct/0026.html"

So the way I see this working for Taxonomy module is that a the URI for a publicly defined, shared ontology can be added to a Drupal term as metadata, which the proposed taxonomy_term_load hook would enable.

Ask Agaric: Whitespace at the end of lines in a Drupal module or theme?

Is this annoying or a useful feature. My IDE removes trailing whitespace. The disadvantage is that it takes you more time to see the real changes/fixes.

It is a good thing that your editor deletes whitespace at the end of lines, that conforms to coding standards. While your making small typo fixes like that, you should fix the indentation also; I see some things where you removed space at the end but the indentation was left at far too much; each progressive indent should be two spaces (and no tabs used at all).

For usability, Drupal should focus on the first relevant form field

For a basic, but nice, usability improvement Drupal, for all pages where a form is the center of attention, the first form field that people should type in should have the keyboard focus given to it.

Here's a method for doing it with JQuery: http://www.gerd-riesselmann.net/development/focus-first-form-field-with-jquery

Reviving FOAF (scavanging Walkah's Drupal 4.6-era foaf module)

The release page as of October only showed 4.6 and a HEAD version from the same date (November 13, 2006) and about the same size. (Maybe HEAD was compatible with 4.7, i didn't try to use it, but that's the one examined below).

Here are the parts Agaric found interesting:

From foaf_user (implementation of hook_user), we see the addition of an HTML header and, in the content, a link to a FOAF download:

Reinvite module: using the Drupal user_pass_reset_url function

Reinvite module: (mis)using Drupal's core function to generate instant login links for long-lost users.

All the answers we need are in the user password submit function:
http://api.drupal.org/api/function/user_pass_submit/4.7

Backtrace for a weird db_escape_string error on a very old Drupal 4.7 site

<?php
/**
 * Prepare user input for use in a database query, preventing SQL injection attacks.
 */
function db_escape_string($text) {
  global $active_db;
  if (is_array($text)) {  // three lines added for testing
    drupal_set_message('<pre>'. var_export(debug_backtrace(),TRUE) .'</pre>');
  }
  return mysql_real_escape_string($text, $active_db);
}

Drupal 6 theme from a module

Comment Module Example

Most of the time, the best way to learn is from looking at core. Randomly clicking around in a Drupal 6 download led us to modules/comment, where we noticed comment-folded.tpl.php. Aha! A template file with that name will probably not be called automatically by Drupal's template systems (as node.tpl.php might). So let's see just how comment.module handles this.

The _theme hook alerts Drupal to the presence of theming functions and, as in this case, a template:

Syndicate content