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

Tabbed Menus with MENU_LOCAL_TASK

Hello,

I'm having some serious problems visualizing a tabbed menu for my module.

The code is as follows and the tabbed menu should only appear in the administration settings form page for the module:

function iqtest_menu($may_cache) {
global $user;
$items = array();
//$access = user_access('administer iqtest');
//$title = variable_get("iqtest_nav_link", "iqtest");
if ($may_cache) {

$items[] = array(
'path' => 'mymodule',
'callback' => 'mymodule_page',
'title' => $title,
'access' => user_access('access content'),
);

$items[] = array(
'path' => 'admin/settings/mymodule',
'title' => t('Administer Module'),
'description' => t('Administer settings for the module'),
'callback' => 'drupal_get_form',
'callback arguments' => array('mymodule_admin_settings'),
'access' => user_access('administer site configuration'),
);

$item[] = array(
'path' => 'admin/settings/mymodule/one',
'title' => t('One'),
'callback'=> 'mymodule_admin_settings',
'access' => user_access('administer site configuration'),
'weight'=> 0,
'type' =>MENU_DEFAULT_LOCAL_TASK,
);
$item[] = array(
'path' => 'admin/settings/mymodule/two',
'title' => t('Two'),
'callback'=> 'mymodule_load_two',

E-commerce discount applied to only one item

Hi,

I'm using Drupal 5.1 and Ecommerce 5.x-3.0.
I created a role discount of 50% on my products.
The problem is that when I add an item to my shopping cart (product A, base price 30 €), and then change the quantity of products A I want to buy (let's say 10), the final price will be : 1*15€ + 9*30€ = 285 €, instead of 150 €.

Anyone could help ?

Thanks!

Kris.

Cannot override user authentication

Hi,

I'm working on implementing a two factor authentication module for drupal. Basically, there's a third field on any user login form that asks for a character from a grid (the grid is randomly generated for each user on registration). The form asks for say the character(token) in cell A4 on the grid, and checks it.

Which hook to invoke on loading a node?

I don't want to be dissing anyone, but I believe that the trackback module does not properly perform its stated function of "autodiscovering" a linking website when a user clicks on the link from that other website to mine, and, because I can't get any feedback from the module developers I'm trying to have a look at it myself. But I'm a hopeless programmer and very new to the drupal internals so I wonder if someone could answer this quite generic question (ie no real knowledge of trackback.module required):

I *believe* what needs to happen is that every time a node is requested from a browser, it needs to load something that will check for a referrer url and then run a function in the module that checks whether the referring page has a link to the node being requested and if so put that in the trackback_received table (after running some checks for spam. I presume that doing a database call is quicker than parsing the referrer page and so doing a quick check on that trackback_received table to see if that particular referrer has been checked and stored previous wold be a good idea.

So my specific question is which hook - if that's the right term - would be used to intercept this request?

file path openning with fopen, works fine under both linux and windows?

I am making a drupal module, which requires open and read a local file under my module directory.
Under windows, I have to write like : fopen('modules/my-module/file-to-open.dat', rb);
Under Linux or Unix : fopen('modules\my-module\file-to-open.dat', rb); instead.

How can I write a sentence which can work well both under windows and linux, without changing codes manually.

Thanks.

Adding custom autocomplete field to user registration form

I'm trying to tie into hook_user() and case register through a custom module I've built. I can add fields to the registration form just fine but when it comes to setting up the autocomplete field I'm having some issues with the autocomplete_path. My module code for the autocomplete field:

Pages

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