Permissions reference

In Drupal 7, the permissions are documented in Drupal itself on the Permissions page (Admin > People > Permissions or http://example.com/admin/people/permissions) and in the Help reference pages at http://example.com/admin/help (in the Toolbar).

This page documents the permissions that core modules expose in Drupal 6. These permissions are found under User Management > Permissions in the administration screen(s) or http://example.com/admin/user/permissions[/optional-role-id]. (In Drupal 5, they are found under User Management > Access Control or http://example.com/admin/user/access[/optional-role-id].)

Please note that this page is only for core modules. See the child pages for documentation about access permissions for specific contributed modules.

Aggregator module

access news feeds
Permission to allow view only access to news feeds.
administer news feeds
Permission to create and configure news feeds.

Block module

Accessing CCK field data (single, multiple, or shared) from another module

note- this is taken from KarenS's post to the development list

To access data stored by CCK within another module, you need to determine which table it's stored in.

To find the right table for a field for a SQL query, use the CCK API, like this:

$db_info = content_database_info($field);
$table = $db_info['table'];

That will always return the right table for the requested field.

$field needs to be the complete field array, not just the field name, so if you only have the field name, you would do:

$field = content_fields(my_field_name);
$db_info = content_database_info($field);
$table = $db_info['table'];

content_database_info($field) also contains info about the columns declared by the field so you know what field names to use in a SQL query. It returns an array that looks like:

Drupal V5.x warning: Cannot add header information

A very common error while trying to modify the user profile in Drupal 5.x is:

warning: Cannot add header information - headers already sent

This is usually an issue associated with line breaks or text file encoding.

FAQ: Frequently Asked Questions

Description

The Frequently Asked Questions (faq) module allows users with the 'administer faq' permission to create question and answer pairs which they want displayed on the 'faq' page. The 'faq' page is automatically generated from the FAQ nodes configured and the layout of this page can be modified on the settings page. Users will need the 'view faq' permission to view the 'faq page' page.

Content Injector (AdSense Injector) Insertion Template Tricks

Note: This page describes the 2.5 and later releases up to 6.x-2.x and the 7.0 release. Later releases use a different insertion template format.

Consider the default node insertion template (formatted for readability):

<div class="ad-auto-inserted" style="float:left; margin: 0 1em .25em 0;">
[adsense:120x240:1:1]
</div>
%body
<br class="clear"/>
[adsense:468x60:1:1]

On full node views, this will insert a 120x240 left-floating ad block before the node body, then, after the body text, a 468x60 ad will be appended, both ads using the adsense module's group 1 and channel 1 settings.

Now, then, what else can we do? How about putting an ad on both the left and right side of the top of the node, as well as at the bottom? We can do that very easily, using inline float styles (for the purposes of this example - it's cleaner to use stylesheet-defined CSS rules).

(Yes, this is probably annoying in-your-face advertising, and I wouldn't recommend it, but it serves to demonstrate capabilities.)

<div class="ad-auto-inserted" style="float:left; margin: 0 1em .25em 0;">
[adsense:120x240:1:1]
</div>
<div class="ad-auto-inserted" style="float:right; margin: 0 0 .25em 1em;">
[adsense:120x240:1:1]
</div>
%body
<br class="clear"/>
[adsense:468x60:1:1]

Give it a try.

Calculating depreciation and valuation

Here are a couple of snippets designed to calculate the straight-line depreciation and the estimated current value of a given node.

the user input CCK fields are two dates (requires the date module) and two (currency) values:
1. purchase_date (iso date format)
2. expire_date (iso date format)
3. purchase_value (decimal format)
4. expire_value (decimal format) - this is the 'scrap value' of the item when it reaches the end of it's useful life.

The first function calculates the annual rate of depreciation:
<?php
if (!$node->nid) node_save($node);
$start_date = date_make_date($node->field_purchase_date[0]['value']);
$start = $start_date->db->parts;
$end_date = date_make_date($node->field_expire_date[0]['value']);
$end = $end_date->db->parts;

$start_decimal = $start['year'] + ($start['mon'] / 12); // this gives the annual depreciation
$end_decimal = $end['year'] + ($end['mon'] / 12);
// $start_decimal = ($start['year'] * 12) + $start['mon']; // this would give the monthly depreciation
// $end_decimal = ($end['year'] * 12) + $end['mon'];

$useful_life = $end_decimal - $start_decimal;

$start_value = ($node->field_purchase_value[0]['value']);
$end_value = ($node->field_expire_value[0]['value']);

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x