User types, user accounts and a couple of other tricks

Hi folks

I have only recently discovered drupal. I had heard of it but not investigated.

So...I'm planning a new website with some specific needs. I'd like some advice on whether my needs could be met using drupal.

Firstly is the user types. I will have three user types but 1 of these is a 'sub-user', that is, a user managed by one of the other types of user.

  1. Private user
  2. Business user (& 3. Business Sub-user).

The sub-user would effectively be an employee/agent of a business user. The main business user will be able to add/edit/remove and review the activities of their 'sub-users'. (Provide access to a staff member for the purposes of using the site on behalf of the business user.)
Private users can register themselves via the website, business users will be added by the site admin only.

This brings me the users' accounts.
Private users will have an account into which they can deposit funds in order to make purchases of the sites services.
This would require the typical user 'control panel' where users can view transaction history, current balance etc.
As admin, I would also need to be able to generate accounting type reports of this information for private users.
Private users must have funds in their account in order to purchase services.

Views Glossary Question

Hi All,

Using the default Views glossary in the Drupal 7 version I have managed to create my A-Z list displaying as I want, apart from one aspect.

Demo here: http://www.ocduk.org/ProductionDemo/glossary

Having trouble putting SPAN tags in primary links menu

Drupal 7:

Here is what I have so far:

function alphanews_links__system_main_menu($variables) {
  $output = '';
  foreach ($variables['links'] as $link) {
  	if (empty($link['localized_options'])) {
	    $link['localized_options'] = array();
	}
  	$link['localized_options']['html'] = TRUE;
    $output .= l('<span>'. $link['title'] .'</span>', $link['href'], $link['localized_options']);
  }
  return $output;
}

This is putting the links inside span tags, but I lost the ul and li tags for the list.

Autorefresh with javascript (Drupal 7)

Hello all, I just went through converting an autoupdate explanation to Drupal 7, and I figure maybe another person can use it. For the sake of demonstration, I edited form example tutorial 7 in http://api.drupal.org/api/examples/form_example--form_example_tutorial.i...

Note: Original article for Drupal 6 with some explanation is here
http://toddkrokowski.blogspot.com/2008/06/auto-refresh-div-using-jquery-...

Here's what I did:

This assumes drupal is in the "site" folder.

Place this code in the function form_example_tutorial_7 which is in the file form_example_tutorial.inc

  drupal_add_js('autoupdate.js', 'file');

  $form["test"] = array(
      '#markup' => "<div class=autorefresh>" .
       "(Example Text That Should Be Replaced)" .
       "</div>",
  );

Create this script file and name it autoupdate.js

Place this file in the the site folder.

function autoupdate() {
  //alert('autoupdate is running');
  jQuery.ajax(
  {
    type: "POST",
    url: "http://yoursite.com/site/examples/form_example/refresh",
    cache: false,
    success: function(data) {
      var result = JSON.parse(data);
      jQuery("div.autorefresh").fadeIn("slow").html(result['html']);
    }
  });
  //alert('autoupdate is complete');
}

setInterval("autoupdate()", 2500);

Place this code in form_example.module file

How to change Block weight according to path

Hi all,

I'm trying to change the order of my block according to path, but I can't figure out how.

I tried to change the weight of the block using the theme_preprocess_page but nothing works.
I already did this:

Theme configuration

In Druapl 6, I can choose theme for specified user through editing his account ("Theme configuration" block).
In Drupal 7, I cannot find the related options.
Could anyone tell me how can I choose theme for specified user in Druapl 7?

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x