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

php error with hook_insert or hook_load

With the following code, I'm getting warning: Invalid argument supplied for foreach(). This is obviously a syntax error on my part, but I'm not getting it.

In the implemented hook_insert function, I have the following code. (->images is supposed to be an array of image nodes loaded earlier in the code.)

Idea for profile extensions

On my web site I want to have additional profile fields based on the users role. Some roles need certain profile fields, while others do not. And further it would be BAD to let all roles have all the profile fields.

...so...

I took a look at the profile.module and have a proposal which I want to swing by y'all before I implement it.

Database new table:

  • profile_roles: "fid" matching profile.fid, "role_id" matching the role id -- affording a flexible mapping between role and profile fields ... TBD: Need a way to declare the profile field is suitable for all roles
  • Alternatively ... instead of making a new table, the profile table could have a new column "roles" in which you enter the roles as a space-separated item. Then to check whether that profile field is suitable for the given role you simply do a LIKE query.

The visible changes would be in the admin area where profile fields are defined. Profile field add/edit pages would list the roles, letting the admin define which roles the profile fields are appropriate for.

Then there's several places to change non-visible behavior ... because there's several places where a list of profile fields are made for either display or edit. Those places need changes to ensure that fields are not displayed when the user doesn't have the right role for the given field. The main one of concern is the edit page for the users profile, to make sure that edit widgets are not made for profile/roles they do not have.

drupal 4.6.3 + Gallery2.0.1

Please help with yet another integration problem, I tried to do my "homework" but I still cant get it working. New to drupal and php in general.

error when accessing www.jaynesfamily.net/gallery:

>Unable to initialize embedded Gallery
>Unable to initialize embedded Gallery
>You need to configure your embedded Gallery

My install:

fresh Drupal 4.6.3
fresh Gallery 2.0.1
both ok as standalone

How to tell if a node exists?

Is there a function to determine if a node exists? I could use node_load, but I'm not sure what it returns if a node has been deleted, and I don't actually need to load the node in this case, only to make sure it hasn't been deleted.

As a side note, is there a way to easily determine another node's type without loading it?

Thanks,
Aaron

Culture Fix Web Identity & Design
Digital Folk Art (my blog)

upload to free image hosting

request for a module that allow us upload images to free image hosting.
for example, like imageshack.us, etc...

this way, users' upload images will not take any space on our server.

rgds,
rex

image.module (4.6) can't add picture to gallery.

Hello.

There is no way to add picture to gallery.

And the gallery doesn't show up on the menu.

(I can create image taxinom/category, but thats another thing)

Pages

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