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

I need a DATE! Ok ok - I need dates to work!

Hi

I am stuck with dates. I have a node form where the user can enter a date - and I cna even store it correctly! But when I try to edit the node all comes crashing down around me :(

Details:
In my form I generate the date field like this:

<?php
  $form['startdate'] = array(
  '#type' => 'date',
  '#title' => t('Start Date'),
  '#default_value' => $node->startdate,
  '#description' => "The date on the competition will be open to entries.",
  '#required' => TRUE,
  );
?>

It shows up fine on the page and I can enter the date fine.
I store it in my database in a field " startdate int(11) NOT NULL " using this code in my insert hook:

<?php
    db_query("INSERT INTO fhsstadmin_competition (nid,startdate,enddate) VALUES (%d,%d, %d)",
        $node->nid,
        mktime(12,0,0,$node->startdate['month'],$node->startdate['day'],$node->startdate['year'])- $user->timezone,
        mktime(0,0,0,$node->enddate['month'],$node->enddate['day'],$node->enddate['year'])- $user->timezone
        );
?>

And when I view it using:

<?php
format_date($node->startdate,'short')
?>

It looks fine when I do this. So far so good. But when I try to edit the node I get an error

Fatal error: Cannot create references to/from string offsets nor overloaded objects in /var/www/FHSST2/includes/form.inc on line 310

How do I... enable CSS for a homegrown module

Hi, question from a noobie.

I have created a new module for my own use. I have uploaded it to my installation and it's working fine.

Now I've created a CSS file for the module, but I'm not sure how to get drupal to use it. Does drupal 'automagically detect' this CSS file or do I need to code something somewhere?

I have searched the docs but can't find the answer.

Yours naively, Lucy C

Q: Is there a module that links certain keywords on a page?

I was wondering if there was a module that would be able to take certain keywords from the page and then parse them as links to a certain location. This way, all the pages on a site would all interlink with each other much better. Does this make sense? Do you think something like this exists or would be a good idea?

Thanks!

Need help with Mail setup in XAMPP local install

I have xampp installed with Drupal 4.7b5 running. I have Mercury Mail running. But I'm missing something in the mail setup that's producing the error below:

warning: mail() [function.mail]: SMTP server response: 550 Address '' not known here. in C:\XAMPP\htdocs\drupal47b5\modules\user.module on line 400.

I think that once I get this problem resolved, I'll have a local install up and running, but at this point, I'm lost and need some guidance. It's probably a really basic setup step that I've missed or messed up.

Roger

Extend taxonomy_context

I would like to extend the taxonomy_context module through another module.

Presently, taxonomy_context creates an index page for each term. This index page displays titles and descriptions/teasers of nodes/terms belonging to the present term.

I want to create a feature where a single node can be designated as the 'node index' for a term.

Example

I have a term 'Science Instrument'. There are six story nodes that belong to this term. taxonomy_context will create an index page listing all six nodes:

http://kalawe.com/images/support/drupal/indexBefore.gif

I don't want this. I want taxonomy_context to only display the title and body of the node designated as the 'node index':
http://kalawe.com/images/support/drupal/indexAfter.gif

Code

I've created a new table 'node_index', with a single field 'nid' which is the node id of a node marked as an 'node index'.

It would get the term's id using the taxonomy_context_get_context() function:

$context = taxonomy_context_get_context();

This db query will fetch the proper index node:

SELECT gem_node_index.nid,rev.title,rev.body
FROM term_node,gem_node_index,node,node_revisions as rev
WHERE
term_node.tid=$context->tid
AND
term_node.nid=gem_node_index.nid
AND
gem_node_index.nid=node.nid
AND
node.vid=rev.vid

I don't want to hack the taxonomy_context module. How do I go about creating a new module to modify the term index pages taxonomy_context creates?

OG ERROR: call_user_func_array(): First argumented is expected to be a valid callback, 'og_approve' was given in /var/www/drupal

Hi, trying to use the OG modul with 4.6 I am getting an error, when I want to approve a user subscription to a group:

call_user_func_array(): First argumented is expected to be a valid callback, 'og_approve' was given in /var/www/drupal/includes/menu.inc on line 354.

maybe anyone knows about this?

Pages

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