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

Q: drupal_execute does not use $form['#action'] ?

I am trying to submit a form with drupal_execute() and it doesn't seem to be giving me the result I expect.

I have created 2 pages here. Test and Test2. Test is the page that I go to that automatically submits the form and test2 is the page that receives the data.

If I go to test the data is not being submitted to test2, as nothing is being inserted into the database.

Here is my code:

Using forms for searching complex information with multiple fields

How best can I use drupal forms API to develop a complex search form and return results across multiple pages if necessary.

I am developing a search module that can search an external database in many different ways. Some of the search forms will allow searching several different fields in a database separately. The search results if more than 20 need to be paginated across pages.

I had been doing a simple search like so:
function simple_search_form()
{
....
$form[] = array( '#type'=>'textfield', '#name'=>'search');
return $form;
}

function simple_search_form_submit($id, $values)
{
return 'simplesearch/'.$values['search'];
}

The callback to simplesearch is declared in a menu and
function simplesearch_callback($searchkey)
{
/* search in database and use pager and table to display results. */
}

This works but feels a bit like a hack - is there a better or preferred approach? I considered using multipart forms; but am unable to integrate "pager" into those to avoid the jumping around as in the example above.

Am I a SQL Idiot?

I need to first find out if a certain value X exists in a certain column in a certain table. Ideally, I just want a binary value returned, so I can proceed with other stuff, depending on whether or not X exists. I've reduced it to one line of Drupal code:

$value_exists = db_result(db_query("SELECT IF (%d in (SELECT id FROM {some_table}), 1, 0)", $value));

It works! But it still seems pretty convoluted. Anyone know if there's a more elegant way to test if a value exists?

THANKS!

Adding an item to the navigation menu

Hi,

I am wanting my module to add an item to the navigation menu, i gather for this i need to use hook_menu, but I am not sure exactly how, can anyone help me?

Events and Movie Database

Hello,

Does anyone know how I can input a Movie Database record into my Events Calandar. By this I mean you input the date range in the movie db module and it shows the full record in the events calendar module.

Been playing around with it a bit, but not having much luck, my previous posts have been ignored, so I'd really apprecoiate some help!

Credibility Rating Index -- which module to choose?

I'm trying to find a single comprehensive and integrated voting-recomendation-karma solution and I wanted to see what advise you would give.

In the epoch of Web2.0 when there is so much content springing from so many sources, and when credibility of text is under increasing doubt, it is a MUST to have an excellent rating-promotion-recomendation-credibility rating system.

Basically I want to have a User's Credibility and Popularity Index displayed on their profile. This Index will be calculated through a combination of factors:

1) Importantly: the points that user gets when on his Profile page someone clicks "Pay Respect to this user" or "Give credit" or something like that, in which case a fixed number of points will be given, but not subtracted from the giver

2) the points that he receives everytime someone adds him to their Buddylist and when their blog is added to Subscription list

3) the weighted average star rating that he receives on his blog posts, comments, reviews and other nodes (like in Karma module)

4) the points that he receives for creating new content of various types that he posts (like in User Points module)

5) the points that he receives for inviting new members to join the club (like in User Point module)

6) the points that he receives when someone visits his Profile page

Pages

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