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

_user() question - Last stumbling block for my module

Hi

I am desperate for figure this out, its really the last thing I need to finish off my Drupal site. I am using 4.7-beta4 and I want a status bar for users. The information for the bar should be loaded into $user. The API suggests that
this is possible but using the hook _user.

I have tried this numerous ways and I can get any information I add to $user to be persistent. I have posted about this a number of times including 46551 and 46414. I realise that it seems to work for everyone so could some please please
point out what I am doing wrong in this example where I try to add a string to $user and display it in a block:


<?php
function block_example_help($section) {
switch ($section) {
case 'admin/modules#description':
// This description is shown in the listing at admin/modules.
return t('An example module showing how to define a block.');
}
}

function block_example_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
case 'list':
$blocks[0]['info'] = t('Example: configurable text string');
return $blocks;
case 'configure':
$form = array();
if ($delta == 0) {
$form['block_example_string'] = array(
'#type' => 'textfield',
'#title' => t('Block contents'),
'#size' => 60,
'#description' => t('This string will appear in the example block.'),
'#default_value' =>
variable_get('block_example_string', t('Some example content.')),
);
}
return $form;
case 'save':
if ($delta == 0) {
variable_set('block_example_string', $edit['block_example_string']);
}
return;
case 'view': default:
switch ($delta) {
case 0:
$block['subject'] = t('Title of block #1');
$block['content'] = block_example_contents(1);
break;
}
return $block;
}
}
function block_example_contents($which_block) {
global $user;
if ($which_block == 1) {
$output = variable_get('block_example_string', t('A default value.'));
$output .="

Profile style information (People, Businesses, or other listings) using templates

I am working on a project for a paid professional listing service that pairs contractors with customers. While somewhat new to Drupal, I have decided to implement this solution using it. I am just soliciting some advice…

First, is there already a preexisting module that offers much of the features I am seeking? I have checked for myself and I do not believe there is an out of the box solution, but I do not want to reinvent the wheel.

Display a users name in the title of a menu item

I am new to Drupal and searched for this but found nothing.

wiki type module

Ive been trying a few things with a local drupal and was trying to do some wiki like module. The wiki module for drupal 4.6 can do wiki like syntax and wiki links, but doesn't define a wiki node type. It makes sence to have a custom node type for registered users, though a page module could do this. It is possible to make a wikinode content type using a custom module. You can also link /wiki/nodetitle to wiki node and the noad_load/ show to render it instead of /node/$nid.

In drupal 4.7 new form API, how to make use of the new date type?

Hi, I'm creating a new module, I have a field named "Due Date", which need three select drop down in mm/dd/yyyy format.

So at first, I use
$form[due_date] = array('#type' => 'date', ......);

A problem with flexinode

Hi,

I have a problem. I just dont know what should i do to fix it. I installed the flexinode plugin to my drupal site. And when i try to add new content type i have and error:

Fatal error: Call to undefined function: drupal_get_form() in /home/keldrir2/public_html/proov/modules/flexinode/flexinode.module on line 831

And when i try to look the Content Types i have another error:

Fatal error: Call to undefined function: drupal_add_js() in /home/keldrir2/public_html/proov/modules/flexinode/flexinode.module on line 361

Pages

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