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

Converting 4.6 - 4.7 + advice wanted on etiquette

I have some half-dozen modules that need converting to Drupal 4.7 - and since I'm a plagiarist at heart a lot of "my" code is a bit opaque to me. Imagine my dismay when I saw the list of critical-looking modifications that have to be made to Drupal modules to upgrade from 4.6 to 4.7!

Chat module

I've played with a few chat modules, but I would like to know is there any way to restrict access to chat modules based on roles? I would like two different roles to have 2 different chat boxes. Is there anything like that available?

My other alternative would be to make a simple chat module using ajax and just get it done that way.

What do you think?

Adding hooks for insert, update, delete, load to core modules.

I'm trying to add several fields to the core blog.module -- for image id handling, and a few other things I need for our site.

In my own node type modules, I have been using hook_insert, hook_delete, hook_update, hook_load - to manage updates to a seperate table. But when I try to do the same thing within the blog.module, these hooks don't get called. Wondering if there is another way for handling a core module?

Modified section is below... the form seems to work fine. I have a node_blog table with the new fields in it.

Thanks
-Greg

<?php
/**
* Implementation of hook_form().
*/
function blog_form(&$node) {
global $nid;

$form['blogentry'] = array('#type' => 'fieldset', '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => -5, '#title' => t('Blog Entry'));
$form['blogentry']['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5);
$form['blogentry']['body_filter']['body'] = array('#type' => 'textarea', '#title' => t('Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE);
//$form['body_filter']['filter'] = filter_form($node->format);

$form['blogimage'] = array('#type' => 'fieldset', '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => -4, '#title' => t('Blog Post Images'));
$form['blogimage']['imgId'] = array('#type' => 'textfield', '#title' => t('Full Size Image Id'), '#default_value' => $node->imgId, '#size' => 10, '#description' =>t('Enter the Image ID number for full size image from Gallery.'));

Problem previewing with 2 forms on page

I have a custom node type which has a form attached to it, showing on the bottom of the page. When somebody "previews" the node during creation, they can no longer submit the node. Clicking the button does nothing. This only happens in IE, and I'm stumped.

This is probably not the best way I could've set this up, but any help would be appreciated.

Signature pre-included in comment form: my little fix.

This was definitely one of the most annoying things about my new Drupal installation. In addition to having user signatures added to every post once it's been submit, it has also added a signature to a reply box BEFORE submitting, basically resulting in a double signature.

You can imagine how annoying this may be when people post a reply and every time they see a signature added to a FIRST line of their new post. To begin writing they have to either delete that pre-added signature or move cursor to the beginning of the line. It's a serious usability issue if you ask me.

So I asked a few times in IRC, searched the forums like crazy, but I found no solution except for a signature.module for 4.6. I am using 4.7 though.

So then I went to comment.module, searched for "signature" in a comment.module file and got only two occurences. The second one is the culprit. It is the 1324:

 $edit['comment'] ? $edit['comment'] : $user->signature, '#required' => TRUE);
  $form['comment_filter']['format'] = filter_form($edit['format']);

What I did to simply get rid of the added signature in a text area is delete this part of that line: ? $edit['comment'] : $user->signature

And it was gone. I tested to see if replying after this change works and it does so everything seems fine.

It is probably best to have the removed part only commented out as a slight reminder of where you made the edit. The final line should then look like this:

job website?

HI
i m planning to make a community website at work
i work in a airport and i wanna make a website for all the employees and employers inside the airport
so that people can mingle among each other and information for the people who dont work in the airport

i have a question i want to have a job section where people can post the jobs and people can post there resume too

is there a module that can help me do it
and if the module comes with a instructions and know how it will be grt

Thanks for the help

Pages

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