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

Detect New Form API

I've written the following code for a module to detect whether the installed version of Drupal uses the new form API. It works, and I just want to see if there's an already existing or better way to do this.

/*
**	Are we using Drupal 4.7 or 4.6.3? Returns true if we have access to the new Forms API
*/
function image_tab_new_forms_API() {
  static $new_API;
  if (!isset($new_API)) {
    $new_API = function_exists('drupal_get_form');
  }
  return $new_API;
}

Thanks,
Aaron

$check_output - is it enough?

Okay as some of you might know, I'm currently developing the tablemanager.module and have NO previous php or mysql programming experience ;o) And I think I'm doing alright at the moment!

The module completely works (although maybe the code is ugly!) and in its current attic state (version 1.1.2.10), is actually finished... But... At the moment the module passes all the table data to a validation function... which is completely empty and does nothing but pass the remark // to do... then return right back again. Not really a problem particularly as anonymous users do not have access to it unless you give them permission to, but in the future I'd planned to have a function which allows an admin to set tables to be 'accessible to all roles' so that maybe people could add their contact details to it, or their CD collections, or any type of collections... Anyways, the point of this is that if anonymous users *will* be allowed access (even if it isn't yet) then the data needs to be stripped of anything malicious because the tables are stored in the database. I'm completely worried that my module is going to be a security hole... So I need to get this right for my own peace of mind!!!

Is it enough to just pass the data through $check_ouput()? I'm guessing it is, as anonymous users can post into the forums using the default filtered html option (which check_output uses by default) - and this will strip any nastiness out??? Right??? Or... Should I completely restrict whats entered by doing something like this:

<?php
$test = "blah blah test"; // string to be tested
$name="name"; // form_textfield name
if (eregi('[^a-z 0-9_-]', $test)) {
form_set_error($name, t('The specified string contains one or more illegal characters.

A problem about my account page

I want to modify content of my account page,e.g: http://www.test.com:8080/drupal?q=user/1.
could you tell me which code file creates content of this page?

Monthly Node Listings Module

Hi,

I have put together a module for monthly listings based on the work Prometheus6 has already done. You may download it from here:

http://www.e3internet.com/greenhouse/kirill/monthly-archive-drupal-plugi...

Feedback would be appreciated.

Thank you.

in hook_form, a way to search for values to insert?

So here's the deal: I am making a module that is similar to the movie review module. I am trying to extend it with a node type for cast/crew ("people"). What I need is a way to, on the movie review editing page, have a way to easily add the people related to the show. Optimally, I would like users to be able to hit a button on the form, which makes a new window pop up in which they can search for people by name or whatever, and then click on one of the names in the search results, and the name gets inserted into the form.

Making the PM module individually themable

I've been modifying the Private Message (PM) module, adding some functions, fixing a bug or two, and arranging the controls into logical/esthetic groups. The task is nearly complete, but I'm having difficulty understanding how to code with theming in mind.

I've had the notion that the PM feature should be able to be themed apart from the rest of the site--if a site administrator should desire this--but I don't know my way around the Drupal/PHPTemplate setup to know if I'm going about it right, or making a mess. Is the code, as written, already entirely themable in a way of which I'm unaware?

Pages

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