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

Select images from a category

I want to select all images from a certain category (category module) for image gallery kind of thing. My plan to solve this;

1. Select all nodes from a category
2. Check which are images (image module)
3. Use them

Or is there any better way to solve it?

I'm not requesting a piece of code (althou it would be nice ;), but just some points in the right direction (function names?).

Cheers Johan F

Preventing the delete button showing for OG administrators

Hi Folks

I would like to prevent the delete button showing on a edit page for og administrators who did not publish the content.

Here is what i know so far ...

From node.module i can see that we need to have node_access('delete', $edit) return 0 for our case presently it returns 1

function node_form($edit) {
..
1364
if ($edit->nid && node_access('delete', $edit)) {
$output .= form_submit(t('Delete'));
}

after looking at node_access

function node_access($op, $node = NULL, $uid = NULL) {

Non Node module using form API to get information from custom nodes..and display it .(in an MS Project Module)

Hello,

I've successfully developped a set of custom node modules:
-One to upload an MS project xml file (generated from a little javascript script), for me as a team leader
-Another to allow my team members to create their weekly: It create a 'team_weekly' node with the task list that are in plan for the current week and the current user, and using a "dynamic" form (form API drupal 4.7) collect their working time for each tasks + some other custom fields for our corporate weekly template, everything ends in a mysql table.

First thing : I was new to php/mysql/drupal (but a long time C/C++ developper) and the drupal framework seem sto be pretty straight forward, even if I've started with a "not so simple module :-)" so kudos to you guys.

Second step: I want to create some "team tracking pages" in which I want to :
-display a form that has fileds like how many weeks? Which resources?. and a submit button.
-at submit, do all my own db queries ... and display the results.

And it is where I'm pretty stuck: I can't find what type of module I have to build.
here : http://drupal.org/node/55868 there is an example of a "block" module. But in my case I would need a "full" page module, with a two steps approach (first fill in a form then submit then display results).

Any help, pointer to existing module/example would help me a lot as I don't know what to start here.

Thanks for your help.

load and view hooks

So I have been working feverishly to get my module to display custom data fields, but with no luck. My code is as follows:

Help with views: way to sort numerically on title?

Any ideas on how to accomplish this? I have a date that begins every title of a certain flexinode type-- when I list the nodes with a view, I want to list them in order of the most recent date: 2006/05/30 (for example-- the date is always in this format, so it should be fairly reliable to sort on this).

Display help

Hello - I am pretty new to the Drupal scene (2 weeks), but I felt like I was learning pretty quickly; however, I've hit a pretty big problem that I'm not sure how to approach. I created a custom module that is supposed to display a business name, its location, and a
wry comment" about it. It is as follows:

/
/**
* Implementation of hook_node_info().
*/
function biz_node_info() {
return array('biz' => array('name' => t('Suburban Business'), 'base' => 'biz'));
}

/**
* Implementation of hook_perm().
*/
function biz_perm() {
return array('create suburban business', 'edit own suburban business');
}

/**
* Implementation of hook_access().
*/
function biz_access($op, $node) {
global $user;

if ($op == 'create') {
return user_access('create suburban business');
}

if ($op == 'update' || $op == 'delete') {
if (user_access('edit own suburban business') && ($user->uid == $node->uid)) {
return TRUE;
}
}
}

/**
* Implementation of hook_menu().
*/
function biz_menu($may_cache) {
$items = array();

if ($may_cache) {
$items[] = array('path' => 'node/add/biz', 'title' => t('Suburban Business'),
'access' => user_access('create suburban business'));
}

return $items;
}

/**
* Implementation of hook_form().
*/
function biz_form(&$node) {

//$form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#required' => TRUE, '#default_value' => $node->title, '#rows' => 1, '#required' => TRUE);

Pages

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