8ric.com

Searching products, comparise prices, shop online and save at www.8ric.com: here has stores, products and buying guides to help you find what and where to buy at the best price.
PS: just lauching......

how do you create a batch?

I have a set of commands I want to run when a form is submitted. The commands list can get large causeing php timeouts so I have determined that I need to use the batch API in order to avoid this.

The code snippet I found from batch API is as follows

<?php
function batch_example($options1, $options2, $options3, $options4) {
  $batch = array(
    'operations' => array(
      array('batch_example_process', array($options1, $options2)),
      array('batch_example_process', array($options3, $options4)),
      ),
    'finished' => 'batch_example_finished',
    'title' => t('Processing Example Batch'),
    'init_message' => t('Example Batch is starting.'),
    'progress_message' => t('Processed @current out of @total.'),
    'error_message' => t('Example Batch has encountered an error.'),
    'file' => drupal_get_path('module', 'batch_example') . '/batch_example.inc',
  );
  batch_set($batch);

  // If this function was called from a form submit handler, stop here,
  // FAPI will handle calling batch_process().

  // If not called from a submit handler, add the following,
  // noting the url the user should be sent to once the batch
  // is finished.
  // IMPORTANT: 
  // If you set a blank parameter, the batch_process() will cause an infinite loop

  batch_process('node/1');
}
?>

Modules

Is there any way to find modules that are available.
Currently it seems painful.

I am looking for a class schedule where people can register for classes.
Is this possible??
Thanks!

Migrate multisite localhost problem

I am trying to migrate my localhost files from my old XP windows machine to a new Windows 7 one. I've reinstalled Wamp and copied all the old sites files to my new machine. I modified the hosts and httpd-vhosts files and uploaded the database files to mysql. The sites show up and appear to work fine with one exception, when I try to login with my admin account nothing happens. I'm not logged in, no error message, nothing.

If anyone has any ideas, I'd really appreciate it.

Thanks
Sharon

Basic module to create types (auto_nodetitle)

I am creating a module that that will create all the required types for the application. I also wan it to setup the automatic node titles with a set formula.

I have the basic install working fine... Custom_type_instal()...but The automatic title generation option is set to disabled. I see in the auto_node title they defined "AUTO_NODETITLE_ENABLED", but I am not sure how to use it.

I also need to select "Automatically generate the title and hide the title field" in the code and set the format "[node:field_custom_1], [node:field_custom_2]"

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x