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

If I limit max # of characters in cck, does it help or hurt performance ?

I'm using many cck text fields for first name, last name, etc. I guess the default field length is 255. (is that right?) If I limit it to 50, does it help or hurt performance? thank you.

File upload via Form API

Dear Drupal developers,

I'm trying to upload a file to the server via module, using Forms API. Form is displayed via menu callback as expected. However file is not uploaded. Here's my code:

<?php
function date_pic_settings_form()
{
// Not very interesting code is skipped

if( user_access('date_pic manager') ) {
$form['font'] = array(
'#type' => 'file',
'#title' => 'TTF font file',
);

$form['#attributes'] = array('enctype' => "multipart/form-data");
}

$form['submit'] = array('#type' => 'submit', '#value' => t('Set week Nº') );
return $form;
}

function date_pic_admin_page()
{
// ......
$out .= drupal_get_form('date_pic_settings_form', date_pic_settings_form() );
// ....
print theme('page', $out);
}

function date_pic_settings_form_validate($form_id, $form_values)
{
if(!$file=file_check_upload('font') ) {
form_set_error('font', t('Font file unavailable!') );
}
}

function date_pic_settings_form_submit($form_id, $form_values)
{
if( isset($form_values['font']) && user_access('date_pic manager') ) {
$dir = drupal_get_path('module', 'date_pic') . '/fonts';

if( file_check_directory( $dir ) ) {
$file = file_save_upload('font', $dir, true);
variable_set('date_pic_font', $dir . '/' . $file);
} else {
drupal_set_message( t('WARNING: Server DIR is not accessible. Consult with site admin!', 'status') );

Glossary module

Hi, everyone! Recently I started examining the Drupal , especially the Glossary module. I have several questions:
1. Is it possible when searching a term to show it on a different page?
2. I want to show the term for example in an IFRAME, but I don't know how to do that....

Any advises will be helpful. Thanks in advance .

modify edit/view tabs for a specific node-type.

I want to hide edit tab et rename view tab on my node-type only.
(without hacking drupal core if possible)

how to give link to any page in drupal

hello everybody,
I want to the link on page how to give link to any page in drupal. Please help
Regards,
Anjeet

Ecommerce 4.6 errors

hi,

Drupal 4.6 installed
module ecommerce for drupal 4.6 installed

Unable to checkout with items. Products , carts , address are working but when its time to check out, those errors:

warning: Cannot modify header information - headers already sent by (output started at /home/maha/public_html/includes/common.inc:384) in /home/maha/public_html/modules/ecommerce/paypal/paypal.module on line 139.

Pages

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