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

cck vs. own module

I've been looking for an anwser to this question: what is the reason that would make a developer to choose to write his own module instead of using cck? I haven't used cck much, yet, but I guess it's very powerfull, although writting your own module would give you full control of it. However, what's the point to go for an own module? Is there an exact answer to this? What is the exact limitation you have by using cck? Have anyone else thought on this matter and came up with a clear decision?

ANyone successfully integrated Drupal V5 and VBulletin forum?

There is a new module for doing this (http://drupal.org/project/drupalvb), but no demonstration or screenshot.

If anyone successfully did this with Drupal V5, can he show his site here? Just want to get a smell of how this module works.

Thanks in advance.

How to validate dynamically created fields?

The situation is this:

- I have two module-defined content types, "art shows" and "artists".

- Each show is associated to an undefined number of artists. The associations are stored in a special join table, "show-artist".

- On creation of a new show, there's only one 'artist' autocomplete field (the artist list is really long). I wrote a nice JQuery script that adds more fields on the fly when the user clicks a button. They are called artist_0, artist_1, artist_2, etc.

- After submission, hook_validate grabs these new fields directly from $_POST. It checks wether the names indeed exist in table "artist", and stores their nids in a variable that is passed to hook_insert (or update) via form_set_value. If a name is not on the table, it prints an error with form_set_error.

- hook_insert and hook_update write the associations to the join table, and hook_load retrieves them again when the node is viewed or edited.

- Everything works quite nicely as long as all values pass validation. But when there's an error, and the form is rendered again with the corresponding message at the top, all the new fields are lost. I'm not able to pass any data from hook_validate to hook_form.

- I tried modifying the $node object. Doesn't work. Tried creating new fields with form_set_value. Doesn't work.

View stories by Fivestar vote, year, month (Views, Fivestar modules)

Hello all, I was hoping for some help with the Views and Fivestar modules.

What I want is for visitors to go to http://www.example.com/ranking/2006/12/ and see all the stories that were published in December 2006 sorted by the Fivestar vote and the option to go to http://www.example.com/ranking/2006/ to see all the stories that were published in all of 2006 sorted by vote.

I want to get my hands dirty with my SQL database

I've been waiting for the node import module to be ported to 5.x -- http://drupal.org/project/node_import -- and so have had some to think about what I actually want to do with it. It's my hope to convert data from other standard formats to CSV and then to make nodes for an existing drupal site with the CSV data via the module.

Odd Menu Behaviour on Custom Module

For some very odd reason that I cannot at all fathom, when I install my module "Contacts", I get "Contact" and "Contacts xxx" showing up in the Create Content menu. I put the xxx in there to help me track down what's going on. Any ideas? I'm using Drupal 5.1 and I've created another module that works just fine.

<?php
// $Id: contacts.module,v 1.186 2006/03/27 18:02:48 killes Exp $

/**
* @file
* Enables users to submit contacts.
*/

/**
* Implementation of hook_node_info().
*/
function contacts_node_info() {
return array(
'contacts' => array(
'name' => t('Contacts xxx'),
'module' => 'contacts',
'description' => t("Contacts are used for everyone from employees to client company contacts."),
)
);
}

/**
* Implementation of hook_perm().
*/
function contacts_perm() {
return array('create contacts', 'edit contacts');
}

/**
* Implementation of hook_access().
*/
function contacts_access($op, $node) {
global $user;

if ($op == 'create') {
return user_access('create contacts');
}

if ($op == 'update' || $op == 'delete') {
if (user_access('edit contacts') && ($user->uid == $node->uid)) {
return TRUE;
}
}
}

/**
* Implementation of hook_menu().
*/
function contacts_menu($may_cache) {
$items = array();

// Set Admin Options
$items[] = array(

Pages

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