Drupal Module Development

Syndicate content
For assistance with module development.
Updated: 47 min 31 sec ago

ENQUIRY ON SOME MODULES *IMPORTANT*

1 hour 46 min ago

Pls can people give me the best modules for these functionalities:

Job application form - Can post job application forms on my site and applicants can apply.

Live Chat - open source

online registration forms.

Thanks you guys.

Categories: Drupal

creating text file from a view.

1 hour 51 min ago

I am about to start building a module that I would like to have views integration, but want to get some advice before I start.
The project will be to create a custom text file on the server that would be available for wget request from the DRUPAL server. Its actually a configuration and custom data file that would be updated every day. So its not something that will be an HTML document. The files are almost like flat files.

I am thinking that there are a couple solutions, but I want to make sure I am not missing something obvious.

Option 1... theme a VIEW. Some special tips on this would be interesting.
Option 2.. there is already a Module that allows for custom generated files.
Option 3... There are MODULES that come very close to creating a custom file... that i can HACK.. so please make some suggestions.
Option 4... Create a custom Module. Either use the Views API, or just use the SQL in VIEWS UI to get a dataset.

Just fyi... I want to use VIEWS becuase even thought there is only one set of data on the DRUPAL server ( the master ).. there are about 5 different machines that need to pull from this DB and they are all different, and require different file layouts.

thanks in advance...

Categories: Drupal

" Warning: date_create(): " error installing D7

2 hours 4 min ago

Hi,

I'm updating my own module from drupal 6 to drupal 7, and so I've downloaded the drupal-7.0-alpha2.tar.gz file and tried to install it. Before even trying out my module, on one of the very first screens (after unpacking drupal and setting up the requested folders in the 'sites' directory) I get this error:

Warning: date_create(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in format_date() (line 1814 of .../common.inc).

(I've removed some personal info...)

This message repeats many many times, and I cannot enter my password or root user name. I have a database in place and the settings file is set up properly. Since this isn't the nightly snapshot, I thought that there wouldn't be much of a problem installing it so that I could continue work on my module. I've searched the drupal site and found not much about date_create(). Can anybody point me in the right direction to understand this problem, and how I can fix it? Thanks.

Categories: Drupal

Problem with adding tab to user profile page using hoolk_menu() and MENU_LOCAL_TASK

2 hours 30 min ago

I'm trying to add a tab to the user profile page. The hook_menu() documentation states that menu items of the type MENU_LOCAL_TASK is rendered as a tab by default. I implemented the following hook_menu() in my module

<?php

//implementation of hook_menu()
function modulename_menu()
{      $items['user/%user/listing'] = array(
        'title' => 'Module Name',
        'page_callback' => '_display_content',
        'access arguments' => array('access content'), //only users who have the permission 'access content' can access this menu resource
        'type' => MENU_LOCAL_TASK,
    );   
}
?>

This hook displays the appropriate tab on the user profile page right next to the 'view' and 'edit' tabs. But when I click on the tab I get the following error -

Fatal error: require_once() [function.require]: Failed opening required 'sites/all/modules/modulename/user.pages.inc' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\irp\includes\menu.inc on line 346

Why does this error show up? And why does the module require a user.pages.inc file? Also does this error have something to do with the missing menu item type MENU_DEFAULT_LOCAL_TASK ?

Please help..

Categories: Drupal

hook_menu_link_alter not called

4 hours 49 min ago

I'm need to modify some links as they are added to the menu_links table, but the menu_link_alter hook does not seem to be running. Maybe I'm not understanding when the hook is called or I need to enable it somehow?

I've tried echoing and logging with no results. Also having the same problem with menu_alter.

function mymodule_menu_link_alter(&$item,$menu) {
echo "link alter";
        $fh= fopen('/mylogs/log.txt','w');
fwrite($fh,"link alter");
fclose($fh);
}

Categories: Drupal

Block module not picking up .po files?

6 hours 38 min ago

Hi.

I'm currently working on a block module that takes some text input and creates a standard footer. At the moment the block is up working, but now I want to add translations for the static text (wrapped in t() in the module and is successfully generated to .po files).

For this I've used the Translation Template Extractor (POTX) to generate a standard modulename.pot file from which I've created sv.po and en.po files with Poedit (following this guide). The files currently resides in modulename/translations/ and as far as I can see, it should work so that when I switch between the sites different languages the block text should switch accordingly. Only thing is, it don't.

I've tried to inactivate and reactivate the module and flushing cache to no avail but the module still doesn't use my .po files. As it is now I feel I don't know what else to try. Is there perhaps something I need to add to the .module or .info file manually to get Drupal to look for the translations?

Full code for the module is available here.

Categories: Drupal

problem with the PHP filter in views

11 hours 2 min ago

hi,

I installed the module viewsphpfilter "
http://drupal.org/project/viewsphpfilter

and when I put the filter in place
it does not work

I have selected node Fitlre PHP
and PHP mode

Here are my source

$ nid = array ('1136 ', '1116');

Thank you for your help

Categories: Drupal

content on white page

11 hours 29 min ago

I have a module that does some stuff. One of them is showing a lot of information i a table. But there is so much info to show that it doesn't fit in the layout of the site.
So i would like to just show it on a white page with non of the rest of layout of the site.

How can i do this?

I would like to keep the css theme since the table uses this.

Categories: Drupal

Data Tables, Forms, Reports

13 hours 10 min ago

Is there any module available with the following features (As like MS - Access)?

1. Data Tables
2. Data importing & Exporting (as csv)
3. Data input forms creation
4. Reports or Views (using queries) creation
-----------------------------------------------------------------
Forms <----> Tables <---- > Queries / Reports
-----------------------------------------------------------------

Admin can enter or import or view data in Table format
End users can enter data using Data forms
Also, Users can search for a particular record

If a module is available, it will be very useful to do the following:

1. Processing Applications for Job / Course
2. Publishing Results for University / College Examinations
3. Processing consolidated reports of students / employees
4. Maintaining complete profiles of employees or students
5. Maintaining Attendance, Payroll processing.... etc.,

Categories: Drupal

trigger JS for anonymous session start, by visitor country... input?

Fri, 2010-03-12 03:30

My client needs to show (anonymous) foreigners a message when they arrive at the site... no matter which page they're visiting.
I'm going to show the message via jQuery 'Meerkat' plugin, but that's not the challenge.
Seems like I need to write a module (or a block?) that essentially does this:
1) is this a new session for anonymous visitor? (is this the first pageview of this session?)
2) if yes to (1), is the visitor IP from another country
3) if yes to (1) & (2), then add javascript...

I can't seem to find any documentation on (1): how do I determine if this is a visitor's first page-view (for this session)?

Categories: Drupal

using #ahah along with either the popups module or the modal dialogue module

Thu, 2010-03-11 21:37

Hi,
I've created a module that allows me to create a correlation between two types of nodes on my site. What I'd like to do is in the form for node type 'A' is create a pop-up box that allows me to choose a relationship from node type 'B' doing some type of search through all the created nodes of type 'B'. Then when I've selected a node, have that selection be reflected back on my original form.

I've gotten started on it as you can see below, but my first issue is that with modal dialogues, I can't get the dialogue to open to my menu item that I've defined ('relation_ab/search')..it always opens simply to 'node/add'. I've tried it with other paths as well to no avail.

Am I going about this properly?

So far what I've got:

in the function that creates the form:
 
$form['relation_ab']['button'] = array(
    '#type' => 'button',
    '#value' => t('Add a relationship'),
    '#weight' => 15,
    '#ahah' => array(
      'path' => 'relation_ap/add',
      'event' => 'click',
      'method' => 'append',
      'wrapper' => 'relation_ab',
      'progress' => array('type' => 'throbber'),
    ),
  );

Then in my ahah call back function:

function relation_ab_add() {
$data = 'var modalOptions = {url: "relation_ab/search", autoFit:true};
Drupal.modalFrame.open(modalOptions)';

read more

Categories: Drupal

how i can get value of #disabled=true textfield?

Thu, 2010-03-11 19:18

i found, that after submiting form, items that are #disabled are not present in $form_state['values'].
but i need it. variant of making textfield (in my case) editable cant be taken.

Categories: Drupal

Book Pages in panel/Views

Thu, 2010-03-11 18:49

In my website i have more than 30 books with approx 6000 book pages (NODE). And i have used extensively book navigation in website. Now i want to give diff look of those book pages using Panel or Mini Panel with different other information and some ads. So i need a views or something that while using panels i can use column with books pages and others column (panel if with 3 column) some thing other be it ads or others links.

Ho w do i go ahead, will this can be achieve using panels and views, if yes how to use or create views with book pages and the same view can be fit in panels
Guide me... thnks in advance

Categories: Drupal

Mailchimp API-Email Form Only

Thu, 2010-03-11 17:34

I've installed the "mailchimp" module (http://drupal.org/project/mailchimp) on a site I am developing, but don't really need or want the "first name", "last name" forms. I am only interested in the "email" form. I've tried copying the code in firebug and reconstructing the parts I need in a new block. However, once I try to submit an email, nothing goes through to mailchimp. Any one know a solution or interested in making an attempt? Check out my site if you'd like to play around. www.sproutonlinetherapy.com. Thanks.

Categories: Drupal

Shortcode equivalent?

Thu, 2010-03-11 17:32

Hello,

I've built plugins for Joomla and Wordpress, and they both have some form of a "shortcode". Basically a snippet of code you can put into a page that will get rendered by the plugin.

Looking at the docs, this doesn't seem to be possible with Drupal. What is the best approach to doing this?

I've seen mention of full page nodes... but am still confused about how the user would embed something in the post.

Thanks!

-J

Categories: Drupal

form API - make element required only if another element is selected

Thu, 2010-03-11 16:45

Is this possible through the Drupal form API?

So for example, I have an address form. The postcode field is required unless you select Ireland as your country, then it's optional.

With the Drupal form API, you set what is required and then Drupal renders the form. Is there a way to alter requirements using JavaScript?

Thanks

Categories: Drupal

Image not dispaly in manage image and sort image tab in node_gallery module

Thu, 2010-03-11 16:19

I have recently installed the Node Gallery module and it looks like everything is working fine. I create a Gallery and then go to upload images into that gallery and it looks like the images upload but then when I go to Manage or Sort images, no images show up in the Gallery. Does anyone know why this is happening? All the permissions are set correctly.

Categories: Drupal

NODE_ACCESS MODULE PROBLEM

Thu, 2010-03-11 16:14

I have used the node_access to module for specific modes.this is because i want these nodes to b accessed by only authenticated users that i have created.But after enabling this module i am unable to deny edit and delete permissions for authenticated users.i do it for anonymous users.there are check boxes for permissions for each node.i check the deny edit and delete for authenticated users nad click on save permissions.it shows changes saved but again these boxes automatically become unchecked and permissions are not set thus allowing authenticated users to edit the content.i dont want these.

please help.immediate help will be really appreciated .i am doing it as a third projetc which i need to submit this week.so please try and help me quickly.
thank you in advance.

Categories: Drupal

Documentation in book structure

Thu, 2010-03-11 16:00

Hello!

I wonder where in the book structure I should place my documentation nodes for my modules:
http://drupal.org/project/support_custom_email
http://drupal.org/project/support_fields

I've been searching for hours now without finding any clues.

Can someone point me in the right direction?

Categories: Drupal

Indexing custom made page

Thu, 2010-03-11 15:42

Heya,

I made a custom page, like this:

$items['mailing_list'] = array(
'title' => 'Mailing list',
'page callback' => 'mailing_list_page',
'access arguments' => array('access mailing list'),
);

I define the content in mailing_list_page(). But now, is it possible to index the content on that page, so it can be found by searching?

Categories: Drupal