Well, I'm new in this game and the world of drupal and I'm having some troubles to create a new module. I'm trying to build my own "birthday module". It needs the profile module where you have to create a birthday field. You must insert the id of this field in the settings of my module along with the number of days to look in the past and future.
Actually it works without a problem until I insert a number which result in a day of 1 january or later (47 days from now apparently). Then my block just don't come up as if there are no birthdays to display.
I suppose it has something to do with how I'm creating the dates but I don't see anything wrong:
// Create today's date, remove the "/" and create a time from the resulting string
// I use j because days smaller then 10 are stored as one digit
$today = date('m/j');
list($month,$day) = explode('/', $today);
$startTime = mktime(12, 0 , 0, $month, $day);
// Create the date from when you'll start the search for birthdays
// also convert from string to time
$from = date('m/j', $startTime - $daysPast*60*24*60);
$converFrom = strtotime($from);
// Create the last date to search for birthdays
// also convert from string to time
$until = date('m/j', $startTime + $daysFuture*60*24*60);
$converUntil = strtotime($until);
I'm working on sitenews module which among other functions has to remove nodes after certain period (hook_cron).
It is possible to issue 'DELETE FROM {...} WHERE ...' queries to remove everything from node, node_revisions, url_alias, sitenews, and maybe other tables. The problem is that I'm not sure if I know all the tables, which should be cleaned. Say, one day I'll decide to allow attachements to sitenews nodes and then I should check attachements table too.
I'm using the webforms module and I wanted to know if the default validate and submit functions can be used after the form values are redirected to another url. The reason for this is that when I redirect to another url to deal with the form values they are not stored in the database. Furthermore, no validation is done which allows for submission of blank mandatory fields.
I have a module with a page which lists all nodes of a custom type. I would like to add a "add node" link above the list, which would point to the same "node/add" link available under "create content".
The problem is this. The path for creating a new node is different than the page with the custom node list.
Bottom line, I would like to add one MENU_DEFAULT_LOCAL_TASK item as "List Nodes" and a second MENU_LOCAL_TASK item as "Add Node".
Does the above make sense? If so, can someone explain how this can be accomplished?
I'm trying to whip up a node type for a fairly simple inventory database where I need to record the date an item was received. The 'date' form element that I see is present in the 5.x FAPI seems nice, but I'm having trouble understanding what goes into this as the default value, and what gets returned. To me, it seems standard in Drupal that all dates are handled as timestamp values, but it seems that something different (an array?) is required for this form element.
i was trying to set a new view with a filter to selected userprofile attributes, so an user can search for like minded people. when i add a view, i got the following error messages,
Fatal error: Call to undefined function: views_handler_filter_role() in /home/mysite/public_html/modules/views/views_ui.module on line 733
i'd appreciate it very much if someone can tell me how to get around this.