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

What date-time format to use in Drupal modules? How to identify the current user?

I'm thinking of writing a module for Drupal which would need its own database table, one of the fields being a timestamp for when a node is updated. What kind of database field should I use? I notice that MySQL has column types "datetime" and "timestamp", but that Drupal seems to keep dates in column type "int(11)".

I would also like to be able to find the uid of the user who is executing the current transaction (eg, editing a node).

Any help, or a pointer to the documentation, would be welcome.

pager and "distinct" within sql queries

this was maybe already pointed out .

If you build a table with a pager based on a sql query in which you use the distinct keyword, Be sure to adapt your call to the pager_query() function in consequence.

you have to specify the fourth parameter of this function : $count_query. If you don't, the system will try with his own count query which is just a replacement of your select by a count(*). Which will get you more record count than you actually have with you query using distinct.

Article-submission-review

I am hoping to use Drupal as a platform to handle an article submission-review-approval-publish process. Basically, a user submits a paper, the editor appoints a reviewer to review the paper, the reviewer adds a comment, finally the editor approves or rejects the paper. If the paper is approved, it is published.

I wonder if someone has the experience of writing a module for a similar purpose.
Thank you.

smartypants + csv tables documentation

hei this is a real save time module! I've founded verty simple an yet powerful. I use in conjunction with CSV table module to do escaping formatting of my pages. But I 'can' t really founded any full documentation, only some examples.

Can someone give me an URL to find these docs ?

Taxonomoy Question (again)

I seem to have gotten my previous problem fixed however I'm given another problem.
While I can access my node directly (IE: node/29)
and assign it a category, I don't see it in my taxonomoy_menu nor do I see it while viewing the taxonomoy group.
What function in Drupal 4.5 handles this stuff?
I've dug all over the documentation however things are given too brief of an explanation for me to find something valuable.
I'm under the impression it's another small typo again, but tracing it has proven to be rather difficult.

Thanks for your time!

Private forums module

Greetings,

I'm very new to drupal, and I'm getting started trying by trying to create a new module which will allow registered users full access to a set of public and private forums, but guests will only have read access to public forums. Here's where I've got to so far. (This is with drupal v4.5 downloaded from this site a couple of days ago, running on WinXP Home on Apache with a MySQL backend.)

Created a new module named pforums.module and a new table named pforum. Both are more or less clones of forum.module and forum table. All references to forum in pforum.module are replaced by pforum.

Added code to create and check two new privileges in pforums_perm and pforums_access so I can configure roles to be able to view/post to pforums.

Amended pforums_menu to check "access pforum topics" rather than "access content" when checking if a user can read the contents of pforum.

This allows me to have two forum types: pforums and forums. Assign read/write privileges to registered user role and no privileges to guests. This works fine. All users can read the public forums and only registered users can read the pforums.

However, here it gets tricky. I want users to be able to use tracker.module to list past forum posts, but I don't want guests to be able to list the pforum posts. Unfortunately tracker.module lists all recent content based on the contents of the node table. Although if a guest clicks on the header of a pforum post he gets an "Access denied" page, even so I would prefer for this particular site if those headers weren't visible in the first place.

Pages

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