This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Article module: Limiting the latest articles in a block

I am trying to figure how to limit the number of latest articles displayed in a block. I have searched the php manual on limiting the arrays, but didn't come up with anything usable.

I believe that function that handles this in the article module is the following:

Catching database errors on insert/update

Hi All,

I am having a bit of a problem understanding how to trap and handle database errors. Lets say i have a table with the following definition:

CREATE TABLE test (
nid INTEGER(10) UNSIGNED NOT NULL,
email VARCHAR(128) NOT NULL,
UNIQUE INDEX u_email_idx(email)
)

For the purposes of this discussion, email is a field that contains a unique email address. The uniqueness of this address is enforced by the unique index u_email_idx.

[Help] Change code

global $user;

if (user_access("access content")) {
  $stories = "";

  $queryResult = db_query_range("SELECT n.uid, u.name, max(n.nid) FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE n.type = 'story' AND n.status = 1 GROUP BY n.uid, u.name ORDER BY 3 DESC", 0, 3);

  while ($node = db_fetch_object($queryResult)) {
    $stories .= node_title_list(db_query_range("SELECT n.title, n.nid FROM {node} n WHERE n.type = 'story' AND n.status = 1 AND n.uid = " . $node->uid . " ORDER BY n.nid DESC", 0, 3));
    }

  return $stories
      . "

How to import data into flexinode node types

Hi all,
I would like to use flexinode to create custom node types. I'm ready with the design, but now I need to import data from my previous CMS into Drupal.
Any ideas on how to write such a migration script ??
Should I write a specific module, or is it better to write a PHP script completely out of Drupal ??

Thanks in advance for your help

Matteo

Newletters & Archive

I am in need of a module that allows an Admin role to send different emails/newsletters to registered members, and then archive them.

For example, the site I'm working on is for a non-profit. The Director sends out an informal update to the association members every week. I need to enable a form to send these and have the sent messages archived in a "Notes from..." heading. She also does monthly newsletters and infrequent legislative updages, each of these would have to be archived under a "Newletter" and "Legislative Update" heading.

Changing the display of weblink nodes

While weblinks are treated as nodes inside the drupal they are displayed not like all other nodes (like story, filestore or blog entry). And think it's not right. I wanted to modify the module by myself but my poor knowledge of PHP prevented me from succeeding.
All that i figured out is that in this module a theme_weblink_node_short function is used to display weblinks in a nodes-list. In all other modules as far as i understood no such "special" functions are used.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions