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

HOWTO assign a user to a role programatically

I have an application where I'd like to assign users to a role programatically, if the user meets some criteria. I am finding this difficult to do, since Drupal appears to be unsetting anything that I set in the users_roles table of the database.

Right now, I use hook_user to add a portion of the user registration/edit screen that deals with the application's user settings. I've put code into the 'validate', 'update' and 'insert' options, but I've tried:

An easier way to insert images?

Hi,
I am fairly new to the Drupal system (but I love it!) except for the handling of images. I noticed that there are a few posts about this topic and I thought that I would share a method that I am using that has worked reasonably well for me.
It requires image_filter to be installed, and uses a user block to generate thumbnails of uploaded images. The block allows you to scroll through a list of the thumbnails and select your image - the image filter tag is generated in the block above the list (you still have to copy and paste it into the relevant text field).

Parent-Child-Relationship between nodes || Menu Item Type 116 (menu.module lacking feature)

(1) Lets have a menu called "Navigation" with an Item, SubItem, SubSubItem and SubSubItem this way:
Math -> Summer Contest 2005 -> Exercises -> Exercise 1

(2) I don't want the menu to expand further "Summer Contest 2005", so "Summer Contest 2005" is a leaf. This is, because I have the links to the articels on level deeper in the articel itself.

But I don't want to miss the breadcrumb. Let's say I am on "Exercise 1":
I want the breadcrumb: Home -> Math -> Summer Contest 2005 -> Exercises

Furthermore I want to have "Math -> Summer Contest 2005" expanded in the Navigation menu.

(3) Now, my current solution:

Look for the values of "type" in the table "menu". "Summer Contest 2005" and "Exercises" will have:
118 = MENU_CUSTOM_ITEM | MENU_MODIFIED_BY_ADMIN
= MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB | MENU_CREATED_BY_ADMIN | MENU_MODIFIABLE_BY_ADMIN | MENU_MODIFIED_BY_ADMIN

If I disable the Items, they would have:
112 = MENU_CREATED_BY_ADMIN | MENU_MODIFIABLE_BY_ADMIN | MENU_MODIFIED_BY_ADMIN

Now, what I want is:
116 = MENU_VISIBLE_IN_BREADCRUMB | MENU_CREATED_BY_ADMIN | MENU_MODIFIABLE_BY_ADMIN | MENU_MODIFIED_BY_ADMIN

Changing this in the database (and flushing the cache) will truely do want I wanted, but it's not achievable with the menu module.

(4) So what do you suggest? A feature that needs to be added to the menu module? Or something to do with a new module? Or maybe another solution?

WYSIWYG module which supports Opera?

Does any of the available HTML editors support the Opera browser?

Simplenews question re web hosting limitation

My web host limits the amount of mail I can send in an hour (200). Is the Simplenews module equipped to deal with this limitation? I understand that cronjob handles all unsent mail in the "maximum send time" setting, but I'm not sure if this setting/feature addresses this limitation. (Incidentally, my site is set to run cron every hour.)

Thanks in advance! :)

Problem with GSiteMap or bot?

Hi,

I have noticed since the begginning of this week, my bandwidth have been going crazy, it has took 4 gbs since the begginning of the week, which is really not normal, and my online users have been going up to 3500 to 4000 users. I click on Administer and it always gives me this error for a whole bunch of nodes.

taxonomy/term/445 not found. and when i click on details they give me this in the location field : /taxonomy/term/445?PHPSESSID=8c816fbb34e89ac29352a34d3c26dcb3

and this repeats for all kinds of different nodes.

Pages

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