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

"Textarea" form type - how to identify line breaks ??

Suppose that in my module settings page, I have a "textarea":

$form['mymod_entries'] = array(
    '#type' => 'textarea',
    '#title' => t('Entries'),
    '#default_value' => variable_get('mymod_entries', '')
  );

Now somewhere else in my module functions i retrieve this setting:

$d = variable_get('mymod_entries',''))

and what I want is to manipulate this data by each line, eg:

PaypalPro and Drupal 5

I have a Drupal 5 site starting soon and I need the ability to charge users for a subscription to the site. Essentially users are buying a role. There are no products and I don't really need shopping carts, store fronts, etc. I know there was some work done a while back for 4.7 and roles but this solution has to be 5.0 compatible. Paypal Pro is also mandatory.

I've looked around but there doesn't seem to be much support for Paypal Pro. I've tried the contrib/paypalpro in CVS HEAD but it complains that "Paypalpro Express module is required to use PayPal Pro." I'm not even sure what that module is. Even if I had it, I don't know where I go from here.

Obviously my solution is going to require me to get my hands dirty and that's fine. I'm a very experienced programmer but mostly with Java. I'm slowly getting up to speed on PHP and Drupal and I understand the PayPal Pro API using Java. Here are my options as I see them. I would appreciate any feedback or suggestions on how best to solve my usecase (Paypal Pro to buy a user role).

1.) Somehow leverage existing paypalpro module. First step would be to look into the PHP code and try to understand what its doing.

2.) Write my own paypal module using phpPayPalPro. Its a sourceforge project which apparently supports PaypalPro using PHP.

Custom module road block

I'm making a custom module for a client and it's almost all working. What it does is allows individual users to add additional text fields into a node as they need to. I have the add and update working just fine. The problem I'm having is how can I delete individual text fields from the node? For example I add 3 new text fields and I realize that I only needed two. Is there a way to delete that unwanted text box?

Any e-commerce module for drupal 5.0

Is there any e-commerce module for drupal 5.0?

Adding to 'Submitted by' line without modifying template

I am presently working on a module that adds a 'time to read' estimate to the 'Submitted by' line:

Submitted by admin on Wed, 2007-01-17 05:45. | Estimated time to read: less than 1 min

Currently, I am adding the estimation information to the node object using hook_nodeapi() (see code fragment) and then modifying the node.tpl.php file in my theme to display the information. What I want is to be able to add the estimated read time information without having
to modify the theme.

Forms that generate pull-down menus

I have been recently trying to use drupal as an itranet based CMS for my company and i started out by using CCK to create my custom nodes. I noticed that CCK, although powerfull is in places, a little limted. I decided to write my own modules to get the structure i wanted. What i an looking for is when i create my form for my module. I want to have a pull down menu that is generated from another table in my database. So instead of a simple pull down menu like this:

$form['basic_attributes']['personal_title'] = array(
'#type' => 'select',
'#title' => t('Title'),
'#default_value' => $node->personal_title,
'#options' => array(
'Mr' => 'Mr',
'Mrs' => 'Mrs',
'Miss' => 'Miss',
'Ms' => 'Ms'
),
'#description' => t('Please choose an option.'),
);

I want to create something like this: (this is NOT the actual syntax, just an explanation)

// Load the data to create the menu

$record = query(SELECT * FROM pull_down_menu_table);

$form['basic_attributes']['personal_title'] = array(
'#type' => 'select',
'#title' => t('Title'),
'#default_value' => $node->personal_title,

// Generate the pull down options

foreach $record blah blah blah
),
'#description' => t('Please choose an option.'),
);

Pages

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