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

a basic mailman module, with an email user thrown in

I had been assured that developing a module which would send new users the mailman confirmation email was easy. And it was.

I had also been told that writing a module which would add a email form for the user profile page would be easy. It was, after figuring out what the global variables are.

Really, its two different modules, but I didn't see much point splitting them for my own purposes. Maybe it'll be useful for someone else. Developed on 4.5.

 function mailmanbasic_user($op, &$edit, &$user, $category)
{

 if($op=='insert')
  {
   mail("list-join@democracyformo.com", " ", " ","From: {$user->mail}\r\n");
  }

$user_profile = $user;
global $user; //user looking at page
 if ($op == 'view' && $user->uid > 0)
  {
        global $edit;

/*      dprint("<pre>");
        dprint_r($user);
        dprint('\n');
//      dprint_r($edit);
        dprint("</pre>"); */

        if($edit['subject'] && $edit['message'])
        {
          mail($user_profile->mail, $edit['subject'], $edit['message'], "From: {$user->name} <{$user->mail}>\r\n");
         return array(t('Email Sent') => t("Your email with the subject <strong>{$edit['subject']}</strong> was sent to {$user_profile->name}."));
        }
        else {
        $output = form_textfield("Subject", "subject", '', 25, 100);
        $output .= form_textarea("Message", "message", '', 80,8);
        $output .= form_submit("Submit");
        $output = form($output);
        return array(t('Send Email') => $output);
        }
  }

}

Some of the lines have been word-wrapped, I'm not sure if this will have any effect.

In block, how to find out current category?

I'm making a module that will make a few blocks. I want the content of the blocks to very based on what the category of the current focused item is. For instance, if there is a story about cats on the main page, i want the auxillary blocks to have information about cats. How do I tell in the sidebar if the main main item has changed?

help!

thanks!

Another flexinode mp3 field

I just needed a simple field which streams an existing mp3 file.

Fill in the absolute location of the audio file.

I only cared for quicktime plugin streaming for now.

You can find it here.

Cant get 4.5 image module to work on shared hosting

Hope this is not just me, but I can't seem to get the "Image" module to work at all on my shared hosting installation of Drupal. The shared hosting is Linux hosting and I do not have shell access, FYI.

-I was able to upload the module folder.

-I was able to run the SQL file to create the new table using phpmyadmin.

-I created the three directories needed by the module. For good measure, I used Windows Command Prompt's FTP to set the permissions of the folders to 777, i.e.:
literal site chmod tmp 777

Design question - taxonomy_nodeapi vs taxonomy_node_form?

Hi,

I'm curious about the implementation of the taxonomy module. It seems that every node that wants to have the taxonomy form information has to explicitly call taxonomy_node_form -- what is the advantage to this approach, instead of having taxonomy_nodeapi implement the 'form pre' case?

Thanks!
-Nate

Downloads

I hope I posted this in the right place.

I am looking for a similar funcionality as what the Nuke CMS's have in the form of a Download Module. A Module to manage or share files.... I.E a place to upload a file so that someone else can simply download. I don't want to create a web site or a link for this, I would prefer a Download manager, in loose terms. Is there something like that in drupal?? Have I just over looked it?

Pages

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