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

problems with do_search and advanced search

I'm still having a terrible time implementing an advaced search. I've created an advanced search form and I can add these values to the query_string. But I can't seem to get my do_search function to work in hook_search. It's really frustrating....

How can I pass the value from the basic form to do_search and still have an advanced search? Here's my hook_search function

<?php>
function image_search($op = 'search', $keys = null) {
# print 3 1's
#$dump = print_r($keys);
#error_log($dump,0);
switch ($op) {
case 'name':
return t('image');
case 'reset':
variable_del('image_cron_last');
return;
case 'search':
$reader_name = search_query_extract($keys, 'reader_name');
$reader_home_town = search_query_extract($keys, 'reader_home_town');
$gallery_name = search_query_extract($keys, 'gallery_name');
$gallery_description = search_query_extract($keys, 'gallery_description');
$photo_description = search_query_extract($keys, 'photo_description');
$published_date = search_query_extract($keys, 'published_date');
#print "

$keys

";
$find = do_search($keys,'node');
// Load results
$results = array();
foreach ($find as $item)
{
$node = node_load($item->sid);

// Get node output (filtered and with module-specific fields).
if (node_hook($node, 'view')) {

array_filter() and array_keys()

Hi,

Anyone able to tell me,please, how I might debug this code , to find out what $element is not an Array. My attempt just returned ArrayArrayArrayArray etc etc

array_filter(): The first argument should be an array in /home/web/multisite/modules/contrib/catres.module on line 880.
array_keys(): The first argument should be an array in /home/web/multisite/modules/contrib/catres.module on line 880.

hook_exit problem/question

I finally wrote my first module, and of course it couldn't be something simple, but had to poke around in the internals of the drupal system itself.

My problem is that I want to add some HTML to the generated page after all is said and done, so I looked at hook_exit and read in the http://api.drupal.org/api/4.7/function/hook_exit page that

get form_file() information

Hello,
I have a module with a function which makes a form with a file element:

$form .= form_file(t('Attach'), "filename", 50);
$form .= form_hidden ("form_field_referer", $_SERVER[HTTP_REFERER]);
$form .= form_submit (t("Send Message"), "op", $edit['op'] );
$output .= theme("box", $title, $message . form($form, "post"));
return $output;

Impossible to change the title of a module

Hi,

I've got a weird bug with my little module. I've implemented a few hooks such as hook_menu, hook_perm, hook_access and hook_page, added a few specifics function and that's about all.
The bug I have is that whatever value I give to the "title" in the menu hook, I always get the same string : Booking (which was the title I gave the very first time I put my module online). I also can not give a translation to this title (the website is designed to be french and english).

How to create new collection of products with subproduct?

Hello,

I try to use the E-Commerce package and I try to create the new collection of products with subproduct, eg.:

Apparel product:

  • Coke (nid: 14)
  • Hamburger (nid: 26)

Collection of products:

  • Hamburger menu. This product contains the following items:
    • Coke (nid: 14)
    • Hamburker (nid: 26)

and I try to create the product variation for eg. "menu size":

Pages

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