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

Block access control and database

I'm modifying block.module to allow Drupal to display blocks based upon the role a user is assigned. I have this code:

  $rroles="SELECT name FROM role";
  $rrroles = db_fetch_array(db_query($rroles));
  
	   foreach ($rrroles as $reles => $names) {
		    $options = array();
		    $options[] = t($names);
	    }

But it only returns one result. I've tried a while loop but the page hangs. All help would be deeply appreciated.

Wordfilter

I installed wordfilter and added some of the standard words. I am assuming wordfilter works, but I was a bit taken aback when I notced that the offending words are listed on the compose tips page.

How do I take them off of there?

layout fix - suppress side blocks in this page?

Hi

I have a problem with a table over-lapping the side block.
http://urbits.com/_test/table_over.gif

So far, when I've needed to customise a page, it's been adding something in - that's going ok. But in this case I assume I need to understand is how blocks are suppressed on an adhoc basis. Is there an unhook_block() function (does that show my newbiness?)

External Quotation Module for Drupal Ecommerce Package

I'm going to do this, comments are welcome. I also have a quotation module proposal on its way.

External Quotation Module for Drupal Ecommerce Package

Goal

- Ease the purchase for large organizations like a university;

Features/rules

- In the normal cart, a registered user can generate an external quote instead of a real purchase, and external quote terms are displayed;
- An external quote can be purchased without need for user registration; FIXME: any security problem? What does the law say?
- In the order status/tracking page, user can: enquiry external quote status, remove an external quote if not being purchased and not expired;
- External quote is kept in the order status/tracking page as the way a normal order does;
- External quote is valid for a limited time (as it holds the stock) either specified by the administrator or any shorter product/service expire date.
- The status of the external quote is emailed to its requester automatically, including a purchase reminder several days before expire;
- External quote is identified by a unique number which is separated enough or coded to proof typo and malicious probing;
- Requester information is filled out by default at the check out page

How
- A database table for the external quotes with the fields: external quote number, internal order number, expire date, status; FIXME: I guess there should be an order table from the ecommerce module for normal order information including the buyer information???

Form API Help: Checkboxes

Hi-

I'm working on an action to send an email to everyone in a role group (e.g. "Send an email to editors when new content is in the draft state").

I need to set up a check box of roles. Here is the code:

$roles = user_roles();
$form['recipients'] = array(
        '#type' => 'checkboxes', 
        '#title' => t('Recipient Role Groups'), 
        '#options' => $roles,
        '#description' => t('Select which roles should receive this email.'),
    );

The creates an #options field with the form:

array( rid1 => 'role name 1', rid2 => 'role name 2' ...)

This works well at first, and I can properly save the form, but if I return to the edit screen later, the form isn't properly populated because I have an $edit array that looks like:

[recipients] => Array ( [3] => 3 [1] => 0 [2] => 0 [4] => 0 [5] => 0 [6] => 0 )

All the other fields (subject, message body, etc) are nicely filled in. I suspect this is because the options I supply in the code, don't match the options in the $edit array.

Any thoughts on how I can get these to mesh?

Thanks
-Mark

Filter and cache

Hi. I've been reading about the hook_filter and the ability to cache data. I noticed that in the database, the raw, unfiltered text is stored. I'm assuming the filter fires each time the node loads, unless the filtered text is in the cache. I have caching enabled in settings, but I understand that caching really only applies to anonymous users. Does filter caching work the same way? Is there a way to check to see if the logged in users are getting the cached versions of the filter output? I want my logged in users to get the cached versions since it is much faster. Thanks.

Pages

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