Sorry to distract from the most-important Drupal 4.7B2 debugging efforts. I am in the thick of developing a site for a pro bono client, and they want to be able to generate traditional blogrolls (i.e., alphabetical lists linking to other websites) -- but broken down by taxonomy terms. I'll lay out the code. Maybe someone can see what I'm missing.
This code works on several 4.6 installations I have. This creates an alphabetized blogroll linking directly to the destination sites, using all published weblinks:
/* This php snippet generates an alphabetical blogroll list
* drawn from weblinks nodes on your site.
* Links connect to destination, not the weblink node.
* Limit is offered as an option.
*/
$nlimit = 100;
$result = db_query(db_rewrite_sql("SELECT n.title, w.lid
FROM {node} n
INNER JOIN {weblinks_node} wn ON n.nid = wn.nid
INNER JOIN {weblinks} w ON wn.lid = w.lid
WHERE n.type = 'weblink'
AND n.status = 1
AND n.moderate = 0
ORDER BY n.title
LIMIT $nlimit"));
$output = '<div class="item-list"><ul>';
while ($node = db_fetch_object($result)) {
$output .= '<li>' . l($node->title, 'weblink/goto/' . $node->lid);
}
$output .= '</ul></div>';
return $output;
Drawing from that, I tried to add a restriction to the query so that output includes only weblinks of a certain taxonomy term:
<?php
/**
* This php snippet creates an alpha blogroll