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

E-Commerce Module - Blank Screen

I have been trying to install the e-commerce module, but without success. Iv'e ran the mysql script and placed the e-commerce directory in the module folder. Now when i login in and go to the module screen, i get a blank white screen. I've even tried taking out folders from the module like the contrib folder, but still just a blank white. Has anyone else run into this problem or have a suggestion? I'm using drupal 4.6 with php 5 on a linux machine. Thank you

Miles

Custom Module Development

I would like to create a custom module that include the following database field type:
* single-line textfield (OK)
* multi-line textfield
* checkbox
* list selection
* freeform list
* URL
* date

How can I modify the example module to include these fields?

Maybe we can create documentation for an advanced example node type!

Thanks, Darly

-------------------

The example module is documentated as follows:

Database definition:

CREATE TABLE node_example ( nid int(10) unsigned NOT NULL default '0', color varchar(255) NOT NULL default '', quantity int(10) unsigned NOT NULL default '0', PRIMARY KEY (nid) )

Implementation of hook_form().

Now it's time to describe the form for collecting the information specific to this node type. This hook requires us to return an array with a sub array containing information for each element in the form.

Code
function node_example_form(&$node) {
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'),
'#size' => 60, '#maxlength' => 128, '#required' => TRUE,
'#default_value' => $node->title);
$form['body'] = array('#type' => 'textarea', '#title' => t('Body'),
'#default_value' => $node->body, '#required' => FALSE );

// Now we define the form elements specific to our node type.
$form['color'] = array('#type' => 'textfield', '#title' => t('Color'),

Working on replacement profile module, tentatively called profileplus.module - ideas wanted!

I've begun work on a replacement for profile.module, which I am tentatively calling profileplus.module

While I considered suggesting at least some of the changes I am making to profile.module itself, I'm concerned that they might add overhead while adding features that many users might not need. And yes, I'm also a little shy about making major changes to core modules, since this will be among my very first Drupal projects.

In a nutshell, I've noticed that a common need for site owners is to be able to add different field types to profile.module easily. Currently, you have to hack the hard-coded field types to do this.

What I wanted was a way to add drop-in extensions (a la Flexinode), that would add new field types to profiles easily.

While working on that project, I realized that it wouldn't be too hard to add a little more functionality - such as field types that don't refer to the built-in profile values field, and which are display-only. Sometimes, you want to have things display in a user's profile, but it doesn't necessarily need to be edited or stored as an actual user variable.

For instance, I wanted an easy way to add lists of "recent nodes by this user" so that they appear in profiles.

Well... I've got that working... but then I decided, it would really be better if some of this stuff appeared in a tabbed interface, so that every displayable profile field thing doesn't appear on the same page. The user/edit pages have a tabbed interface for different sections - I think that profile viewing ought to have the same thing, so that only the necessary information is shown at a time, instead of an enormous page (if you have lots of profile fields).

Secondary Nav and the Drupal Module

I'm really stumped. I know how to make additional Navigation Menus using menu.module and I know how to add Menu Items using hook_menu. But for the life of me I don't see a way to add Menu Items to the additional Navigation Menu from my module.

I thought maybe I was asking too much and a block would work better since that's what menu.module creates for additional menus anyways. But then I need to use menu_tree, which seems really tied to menu ids and such.

Has anyone had the same problem and figured out a way around it?

Ben

Only Single Content/edit

Hi

Iam a starter with drupal and trying to learn stuff as i go on

Iam writing a module which basically is like a form with the user preferences. I want the user to fill this only once(He can edit this though)

So I created a node type called "pref" and actually finished the form and view in the user profiles. My problem is when a user logs in into the system, he sees create content.. Sees Preferences and then creates some preferences.

Amazon Associates Tools module block to use flexinode field for keywords

I wrote a response about a request for a similar feature in this module's tracker. Since the author of the module seems like a busy person I was thinking of doing it myself but I'm a newbie to Drupal and I'd really appreciate some help.

This is the current block hook which I need to update to instead of pulling ASINs (Amazon.com product IDs) from the db will use keywords from the node (a flexinode with a textfield called book keywords or similar) and get ASINs from the db with one or all those keywords in the title. The book title is the stored in the database table along with the ASINs. What I am unsure of is how I go about accessing the textfield of a flexinode. Any help is appreciated.

<?php/**
* block hook
*/
function amazon_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
case 'configure': {
$output = form_textfield(t('Block title'),
'amazon_blocktitle',
variable_get('amazon_blocktitle', t('We recommend')),
30, 120, t('Enter the title for the Amazon product block'));
return $output;
}
case 'save': {
variable_set('amazon_blocktitle', $edit['amazon_blocktitle']);
}
case 'list': {
$block[0]['info'] = t('Recomended book');
return $block;
}
case 'view': {
// get the number of amazonitem records
$amazon_counter = db_fetch_object(db_query("SELECT COUNT(ASIN) AS count FROM {amazonitem}"));
$max_record = $amazon_counter->count;
// generate a random number between 1 and the count
$random = rand(0, $max_record - 1);
// get that one record
$selected_book = db_fetch_object(db_query("SELECT * from {amazonitem} LIMIT $random,1"));
$block['subject'] = variable_get('amazon_blocktitle', t('We recommend'));
$block['content'] = '

Pages

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