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

Help needed - I made a change to user_menu and locked ALL accounts out of the site

Ok, I'm a fairly seasoned Drupal programmer, but I screwed up and managed to lock myself out of the site I'm developing.

I was trying to setup access rights to certain 'user/xxxx' paths, to prevent anyone who might know Drupal from accessing them, as I created alternative paths with alternative pages to handle all the necessary functionality.

Unfortunately I added an 'admin' level access right to the plain old 'user' path in the user_menu() function, then opened 'admin/modules' to apply the changes and that's where things went wrong.

Forms API and with and Custom date

Hi There,
I am having sone dificulty getting my hook_update to recognise and update my 'date'.

I can do update with other fields ok.

 $day= format_date($node->work->date_of_work,'custom','j');
  $month= format_date($node->work->date_of_work,'custom','n');
  $year= format_date($node->work->date_of_work,'custom','Y');
  $form['date_of_work'] = array(
      '#type'          => 'date',
      '#title'         => t('Date of Work'),
      //'#default_value' => array('year' => 1997, 'month' => 1, 'day' => 1),
          '#default_value' => array('day' => isset($node->work->date_of_work) ? $day : 1,
                                    'month' => isset($node->work->data_of_work) ? $month : 12,
                                    'year' => isset($node->work->date_of_work) ? $year : 1989
                                    ),
      '#description'   => t("Date of the work if known"),
    );

If I substitute $node->date_of_work['year'] for a integer it works fine.
How do I get the value out of this array, please?


function catres_update($node) {
db_query("UPDATE {cr_work} SET
title = '%s',
date_of_work = '%d',
WHERE nid = '%d' ",
$node->title,
HOW to get this value ???
mktime(0,0,0,11,11,$node->date_of_work['year']),

Example Codes for "FrontPage" Design

Hi All:

I would like to create my Frontpage in a "newspaper" type format. Currently I am using the Democratica theme in a simple blogging format. If you have a good Frontpage layout that resembles those used by newspapers - then can you please share with me?

Thanks,
Dkaps

Simple form module and XML output

Is there a way or a module available that will allow me to do this:

1st. The user comes and makes an account and during this process checks which alert they wish to subscribe to and gets there contact phone number.
2nd. They are added to a list (preferable XML output) of people interested in this alert.
3rd. After all of this I can use this list with a system like Voxeo to call the person.

Thanks and I am excited about being a drupal user,
JBP

Inventory control in ecommerce module doesn't work.

Installed the ecommerce module and enabled all of the ecommerce modules that I could find (just in case). I can setup any product just fine, but if I use the inventory control, no product quantity is ever shown, either for admin or for anyone. I can also put more than the inventory of the product into the shopping cart as well...Um was this a feature that just doesn't work yet? I have no clue what I could be doing wrong.

Creating several sub pages from one node using a custom node type

Hi all,

I am trying to write a custom node type that will split its content over several pages. Specifically, the content is a product. I want the three pages to represent:

  • general overview
  • technical specifications
  • price list

I have built the content type and all of the necessary fields. I am now trying to use the menu callback system to filter page requests to the right view (I wonder if 'view' is an omen, and this can be done with the views module?). Bascially, if the url has an extra term that doesnt map to a menu item it should fire the relevant callback function.

As an example, a product path may be
www.example.com/products/generators/mx20

This will map directly to a product on the menu item and display the default information (general overview). If the request is appended to
www.example.com/products/generators/mx20/specifications

I want Drupal to check the path, realise it doesnt exist, and then use the 'specifications' argument to direct the module to run the "myModule_view_specifications" function, which in turn serves the specifications page.

The following code does not seem to do that! (although I had it working briefly and can't tell what I have changed ;(


$items[] = array(
'path' => 'specifications',
'title' => t('Specifications'),
'callback' => 'myModule_view_specifications',
'access' => true,

Pages

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