drupal-module

How to register a user to Drupal 6.x without using the API?

We have to have a "register" method available via web service that is written in java so hence forth we do not have access to the Drupal API. But we need to be able to register a user successfully. Simply adding a user to the users table will not do it as the newly created users are never able to login successfully. Again I love the Drup...

Theming Ubercart Order Panes

Hello I am working on an Ubercart installation on a Drupal site we are producing. Everything is going smoothly, but I am now trying to setup the order page template (uc_order module), so that the frontend developers can style it up. The page is the one you view when you go to user/[UID]/order/[ORDER-ID]. I understand how to use hooks...

Acces/See settings page for a custom odule

Hi, I upgraded a module from 5 to 6. I only have one problem: I can access the settings page for it, but can not see the contents of it. This is my code: function agbnagscreen_menu() { global $user; $items = array(); if (agbnagscreen_nag($user)) { // var_dump($_GET['q']); die(); drupal_goto(sprintf('%s/%s', AGBNAGS...

Am I referencing the polls content type wrong in my Drupal module?

I have the following module, which affects how users arrive at two different content types, "question" and "poll". Question is a CCK content type, poll is the default poll content type, but it works perfectly for question, taking a user who goes to, i.e., http://sparechangenews.net/content/are-you-seeing-evidence-economic-recovery (whi...

How can I separate admin menus?

Hello guys I would like to separate administrator menus (the menus that appear after login as admin) from normal menus. I have to show admin menus in some other blocks. I don't like to use any modules for this, let me know how can done this with code, Thank you ...

How to split the code of a module into separated files

I am very curious to know how a Drupal module can be dis-integrated into multiple include files. A number of hook support to link include components, like hook_menu, hook_theme etc. Once I planned to simplify one of my complex module that have reached to 2.3K of lines with half of its feature set. I have to roll back all those steps due...

query database and store results in array in drupal module

I have a table in my database called gsm_tariff. basically i just want to run a simple select query "SELECT * FROM {gsm_tariff} WHERE Country='Afghanistan' and store the results in an array. Can anyone help me with how to do this please. I know where to put the code and everything I just need the code to do the query and store the result...

Sending email with attachment

I've a custom form (created with form API) that need send an uploaded file by email. The current form submit handler send the email withouth attachment using drupal_mail(). So I'm looking for a solution to properly send email with attachment from Drupal. Mime Mail seems overkill because HTML mail, templating and its other features are n...

Webcam Solution

Is anyone successfully embedding webcam videos in nodes where those videos are private on the hosting service? I especially would appreciate hearing about OG-supporting solutions. Thanks. ...

please let me know what the following lines of code mean

Hi, What is mean by the following code, I found it in the comment module (drupal 6) return theme('box', $title, drupal_get_form('comment_form', $edit, $title)); I have used this theme function before, but I had defined some themes under hook_theme(). but I didn't see any themes defined as 'box', also I found same theme 'table' Could...

Module uninstall clean-up

Is there a hook that I can implement in my module so that I can run some clean up code when my module is uninstalled. I create a number of variables using variable_set() and I would like to delete these variables when the module is uninstalled. ...

Can a module download files?

I have a drupal module that requires other files from the web. Is it possible for the module to download these files as its being activated? ...

Drupal form submit, form after_build

What is the difference between $form['#submit'] and $form['#after_build']? ...

How to uninstall a module that overrides the core user module?

One of my developers wanted to override some functionality of the core user module. He made a copy of the core user module and placed it in the sites/all/modules folder. Something in the functionality screwed up and now I am not sure how to uninstall it. I have tried deleting the module from the sites/all/modules folder and it now crashe...

hook_load/hook_view not called

I have a module with four node types declared. My problem is, hook_load, hook_view is never called. I used drupal_set_message to find out if certain hook is being called. And I found out hook_load, hook_view isn't. Just to give you clear picture, here's my structure of hook_load HERE'S UPDATED ONE function mymodule_node_info(){ retu...

Looking for Drupal webform tutorial

I have setup a Drupal site and will work with a designer to customize some webforms. Is there any tutorial out there which can help a designer (he also knows some PHP but not a programmer background) to get started? I hope he can learn how to: add fields theme the form Thanks~ ...

Remove drupal module javascript, replace with my own in template.php

I am trying to remove the default lightbox.js file coming from the Lightbox2 module, by using template.php, and load in my own. I would like to do this via template.php if possible, and not place this code in a custom module. I am adding my javascript file, then unsetting the module javascript file. The problem is $vars['scripts'] isn't ...

How to get the names of the terms from the field of taxonomy?

In my module, I am trying to get the all names of terms that comma-separated in the field of taxonomy ( for create/edit node ). For example: a,b,c,d : <?php function mymodule_form_alter(&$form, $form_state, $form_id) { if($form_id == 'story_node_form') { $form['#submit'][] = 'mymodule_form_mysubmit'; } } function mymodule...

Why are certain 3rd party modules not saving admin settings properly?

There are two modules that I have documented where admin settings not get saved in my Drupal 6 installation. Specifically I am talking about logintoboggan and Service Links modules. When I make admin changes and hit save and then hit refresh later on: all my settings revert back. Why? I also found out that the same code base works fin...

Drupal module to show data in table formet

Is there a Drupal module which: opens a user-defined table in the same Drupal database displays all the columns and rows in HTML <table> format (best if) supports pagination (optionally) allow filtering of data range via SQL Thanks! ...