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

success using the backport module for Drupal 4.6 w/the CCK and Views modules?

I have a site that is at Drupal 4.6 and they really want to use the CCK and Views module but they aren't ready to upgrade to Drupal 4.7, so my question is have fols had success using the backport module against Drupal 4.6 and successfully used the CCK and Views modules?

db_query an foreach in Drupal

Need a help!!!
I'm new in Drupal and now i work on my own module.
I have upload.module and upload_image.module at my Drupal 4.7. I made a node with 4 upload pictures by upload_image.module (pict1.jpg, pict2.jpg, pict3.jpg, pict4.jpg). I want to get filepath from "files" by node in my own module. But have a problem. I recive from query only first line from "files"

My query

Advice on extensible module architecture please.

I am working on a fairly complex module(s) and could do with some advice/pointers on which way to take the development.

The module allows the creation of tournaments and tournament fixtures, where one tournament can have many fixtures associated with it. In version 1, the module was hard-coded for the scores and attributes of one single game, but for version 2 I want to extend this to an open architecture to allow for more game types to be added.

I see this happening as follows:
- the 'core' module handles all the generic things to do with the tournaments and their fixtures, the event's duration, whether the event is a ladder, league, etc.
- game-specific sub-modules that have their own db tables for storing results specific to that game, algorithms for determining the order of results.
- additional sub-modules can be added whenever a new game needs to be accommodated.

A game could be any type of computer game (FPS, RTS, RPG) or even a real-world game (tennis, football, etc.). In each case, different stats and results need storing and the way players are ranked is different.

I would like the interface to behave as follows:
a - create a new tournament node, on the create node form, they select the game type from a list.
b - once the game type is specified, select the conditions for ranking.
c - create tournament fixtures, that are now specific to the game type.

Modify user_access function in the user.module

In the user.module, there is the user_access function to retrieve permissions for a user:

    $result = db_query("SELECT DISTINCT(p.perm) FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid WHERE r.rid IN (%s)", implode(',', array_keys($account->roles)));

I am trying to replace it with this:

    $result = db_query("SELECT DISTINCT(p.perm) FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid WHERE r.rid IN (%s)", implode(',', array_keys(user_all_roles($account))));

user_all_roles($account) is supposed to return an array of roles which contains the values in $account->roles plus additional values if the context determines a group. I can't figure out a way to debug other than trial and error, and it appears that the roles from $account->roles aren't being returned.

I can't figure out why. I'm basically merging two arrays. Below is the code for user_all_roles(). Can anybody help? Thanks.

//
// This function takes the global $account value from user_access function and returns a list
// of group and non-group roles for this user
//
function user_all_roles($user) {

// This will be the process to get BOTH the group and non-group roles for a user

$uid = $user->uid;

$ogroles = array();
$x1 = 0;
//
// This will by default add the anonymous user. That way we know there is at least

drupal_set_message after form submit = crashed ?

I am upgrading a personal module to 4.7 and then i have a big problem to put a drupal_set_message in a *_submit function. I simplified my module to this grr.module.

And even with this simple module, all i get when i submit is a apache crash.

My configuration :
Drupal 4.7.3
WinXP SP1
EasyPhp 1.8.0.1 : Mysql 4.1.9, PHP 4.3.10, Apache 1.3.33

It drive me crazy tonight ... Can someone test this if he got the same probleme ?

Thanks for your help.

<?php

function grr_perm(){
return array('grr');
}

function grr_menu(){
$item = array();

$item[] = array('path' => 'grr',
'title' => 'Grr',
'callback' => '_grr_mail_new',
'access' => user_access('grr'),
);
$item[] = array('path' => 'grr/hello',
'title' => 'Hello',
'callback' => '_grr_hello',
'access' => user_access('grr'),
);

return $item;
}

function _grr_hello()
{
return 'Hello';
}

function _grr_mail_new($data=NULL)
{
$critere = array('1' => 'CP seulement','2' => 'Expert seulement','3' => 'CP et Expert');
$content ='';
$form['name'] = array(
'#type' => 'textfield',
'#title' => 'Nom de la nouvelle list',
'#default_value' => $data['name'],
'#size' => 60,
'#maxlength' => 255,
'#description' => NULL,
'#attributes' => NULL,
'#required' => TRUE,

Thumbnails IMCE

Hey there, hope this is in the right Forum. Anyhow, i would like all images put into TinyMCE by IMCE, to appear in the top left corner as a thumbnail, that when clicked would link to a full res picture. Any suggestions? Cheers Y'all.

Pages

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