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

file upload ~/files directory .htaccess file

I noticed there is a .htaccess file in the ~/files directory. If I don't alter the .htaccess file I get server errors trying to download/view attachments. I deleted the .htaccess file and was able to successfully view/download attachments.

However when I uploaded another attachment the .htaccess came back. I figure this must be part of the internal workings of the module. With the return of .htaccess came the server error when viewing/downloading the attachment.

I opened the file and commented out the only line

i18n issues

Hey

I'm working on a site with multiple languages. When I have both french and english enabled, a great deal of the site remains in english. However when the english is disabled... it's able to cope as a nearly-fully french site. This says to me that the translation strings are around, but are not being called whenever the english module is in.

location: is there a Drupal module that maps zip codes to cities/metropolitan regions?

I want to group by users by location -- e.g. San Francisco Bay Area, New York City. I see on some other sites where only zip code and country is collected for the user, but the information displayed is by city (eg New York City). Is there any Drupal module that can do this?

I looked at location module before but it seems like it didn't do it. There were some interesting threads about this, but I'm not aware of anything that was finished.

There might be modules or work-in-progress I missed. Your comments appreciated.

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 .

Pages

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