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

Need help with PHP snippet and weight! - Can't seem to get the SQL right!

I am actually making a change for a drupal 4.6 site where now the customer wants certain articles listed by their own arbitrary way of listing it. I thought I'll just enable the weight module and sort by sticky ASC but obviously that doesn't work.

Unable to create a working "my bookmarks" link using Views

yes i know this topic is posted many time...but i haven't found a solution get this problem solved!
does anyone have the some prob?
meanwhile (i dont know if this one is really a alternative) i use favourite nodes modul...

Ajax Page Update module

Hey folks,

A lot of folks have had an idea for an Ajax module which would allow for content on your pages to be updated via Ajax, which would mean that page reloads, and hopefully database calls, could be minimized. I've got an unobtrusive Javascript which I've constructed which takes all of the links of the page, and sends the calls via Javascript to the server, where a server-side script returns the contents of the appropriate file. If Javascript is disabled, the links will operate as normal (or if the browser the user is using doesn't support Ajax properly).

Form field next to each other

Is there a way to tell the form that he has to put 2 fields next to each other instead off top down?
For example i want to create a form where the user can input a begin end end date. It's not functional that you provide a textbox with 100 characters for the begindate and the same for enddate. Therefore i want to tell the form the date field has only 12 characters and he has to put the begin and end date next to each other. Or is it something i have to theme?

Form validation question

I have a user form on which I want to perform input validation before processing the data. hook_validate() seems like it'd be perfect for this, but I'm not getting the expected results. Basically, I have a page that displays an options form on initial load. After the user submits the form, the real content is displayed based on the selected options.

What I want to do is validate the form input prior to serving the real content. If the input is not valid, re-display the form along with an error message; otherwise, proceed to the content. Please see the example code below - the if/else seems to be the significant part, as I'll describe after the code.

function ssh_page() {
  $output = '';

  // Display host selection form
  if (empty($POST['host_select'])) {
    $output .= drupal_get_form('ssh_page_host_form', $form);

  // Display SSH applet
  } else {
    ob_start();
    ?> <SNIP - a lot of HTML> <?php
    $output .= ob_get_contents();
    ob_end_clean();
  }

  // Show output
  return $output;
}

function ssh_page_host_form_validate($form_id, $form_values) {
  echo "blah";
  form_set_error('', t('test'));
}

Help with a DB query

I've created a module that uses nodeapi to add a select box to a node, so that when a user creates a node, they can select yes or no to save the node as a template or not. The selection gets written to a db table with two fields, which are nid and template. Now I need to be able to query the db and get a list of all of the nodes that have been saved as templates by a particular user. I've been reading up on INNER JOIN, but I'm kind of new to this, and I'm not sure how to construct the query. Does anyone have any guidance they could give on this?

thanks,

duggoff

Pages

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