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

problem with a block module that implements a form

Hi all,

I'm tryng to define a block module that includes a form in it.
The functionality of the module is plainly to display a form that includes a single 'select' item and a submit
button. The select item will allow a user to choose from a list of categories. When the submit button is chosen, the page will simply redirect to the chosen category's main page. Hope that is clear.

I've still not tried writing the code for the redirecting of the page. Thats because my code
for the form is not working and I cant get it to work.
I've tried all sort of things but just getting a blank page all the time..
I thought it might be an incorrect syntax for the code that generates the form. I'm running drupal 4.7, can anyone tell me if theres something wrong with my syntax???
The following is the code for my module, can some one please help me out on this?
Or if there are any suggestions on how I can achieve the same thing using a different approach that maybe
doesn't include using a new module....
cheers

<?php
// $Id: top_menu.module,v 1.118 2006/04/07 15:32:17 unconed Exp $

/**
* @file
* Enables the top menu
*/

function top_menu_help($section='') {
$output = '';
switch ($section) {
case "admin/modules#description":
$output = t("Displays a Combo Box top menu for the Categories");
break;
}
return $output;
}

function top_menu_perm() {
return array('access top_menu', 'administer top_menu');

Post count rank module

Helo. I'm trying to port the post count rank module to drupal 4.7. I think is almost finish all the porting, but I can't make the settings page saves the postcount_rank_fieldid and postcount_rank_metrics vars.

I'm a little noob whit drupal so I can't figure where I'm wrong. Here is the code please help me.


<?php
define('PROFILE_HIDDEN',4);

function postcount_rank_help($section) {
switch($section) {
case 'admin/modules#description':
return t("This module allows you to give users a custom rank based on postcount and assign it to a custom 'list' type profile field");
break;
}
}

function postcount_rank_settings() {
$result = db_query("SELECT fid, title, options FROM {profile_fields} WHERE visibility = %d AND type = 'selection'",PROFILE_HIDDEN);
$fid = variable_get('postcount_rank_fieldid',-1);
$list_values = '';
while($field = db_fetch_array($result)) {
$options[$field['fid']] = $field['title'];
if ($field['fid'] == $fid)
$list_values = $field['options'];
}

$form['profile_field'] = array(
'#type' => 'fieldset',
'#title' => t('Postcount rank settings'),
);

if ($options){
$form['profile_field']['field'] = array(
'#type' => 'select',
'#title' => t('Profile Field'),
'#default_value' => $fid,
'#options' => $options,

Hidden form fileds getting lost, filestore2

I need filestore2 working in 4.7, so I took the cvs and figured I could make it work. It was 90% converted to 4.7. I have corrected several bugs but have hit the wall with this. The field fsid is not getting set in the db record. If I amend the db manually, everything is good. My debugging tells me that $node->fsid disappears between validate and insert. Other fields (eg url) are fine. The only thing different about fsid is that it is a hidden field on the form because the user has no need to know about it, it is the record number in fscache.

CCK + Taxonomy Terms

I've set CCK up and got some custom content types happening, but now I would like to assign terms from the taxonomy when creating nodes of the new custom type.

Is there an eay way to achieve this?

Thanks, Nick

hook_menu($may_cache)

i have read the documents but i cannot fully understand what it for, could anyone explain this parameter in other words?

thx a lot!

Has anyone connected Fedex to Drupal

I am going to be looking into connecting e-commerce shipping with Fedex, probably using shipcalc. I'm not sure where to start, so I thought I would see if anyone has attempted this before?

Pages

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