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

Locale for anonymous user, a development question

Hello,

I am currently working on a multilingual Web Site.

I would like to know if there is a way (code question) to change the interface translation for anonymous user.

I have taken a look to the locale.module code, but I can not figure how to use it to make interface changed for anonymous user. I am abble to find user browser default language or add a link that allow the user to change language, I can compare the language against locale to see if it is available and I can save his configuration in a cookie. But I am unable to change interface translation !

Disable authoring information and other fieldsets

If you want to hide authoring information and the other fieldsets on new/edit node pages, add something like this to a module. It seems to work, but please reply if anyone's got a better solution.

You'll need to change 'news_article_node_form' to e.g. 'page_node_form' or whatever your node type is. Alternatively if you want it for all node types.


<?php
// Implementation of hook_form_alter
function news_article_form_alter($form_id, &$form) {

if ($form_id == 'news_article_node_form') {

// We're going to hide various fields by setting default values for them

$form['author']['#type'] = 'value';
$form['author']['name'] = array('#type'=>'value', '#value'=>$form['author']['name']['#default_value']);
$form['author']['date'] = array('#type'=>'value', '#value'=>$form['author']['date']['#default_value']);

$form['options']['#type'] = 'value';
$form['options']['status'] = array('#type'=>'value', '#value'=>$form['options']['status']['#default_value']);
$form['options']['moderate'] = array('#type'=>'value', '#value'=>$form['options']['moderate']['#default_value']);
$form['options']['promote'] = array('#type'=>'value', '#value'=>$form['options']['promote']['#default_value']);
$form['options']['sticky'] = array('#type'=>'value', '#value'=>$form['options']['sticky']['#default_value']);
$form['options']['revisions'] = array('#type'=>'value', '#value'=>$form['options']['revisions']['#default_value']);

CiviCRM and Photos

Hello,

I would like to developp a site like yellows pages with the ability to display photos. Anybody knows how to to that with civiCRM or another module to suggest ?

Thank's in advance for advises.

A blog-inspired module

I'm new to Drupal and developing a new module for listing out a user's podcast(s). It is basically for a community directory of podcasts, but I used the blog.module as a template since it had a lot of the functionality I was looking for.

I've got the individual node pages working and the last-10 block too, but the other pages are busted or not found.

To be specific, the list of recent nodes, specific user-owed nodes and the feed don't work. Any ideas?


/**
* Implementation of hook_view().
*/
function podlisting_view(&$node, $teaser = FALSE, $page = FALSE) {
$node = node_prepare($node, $teaser);
$profile = theme('podlisting_profile', $node);
$node->body .= $profile;
$node->teaser .= $profile;
}

/**
* Implementation of hook_user().
*/
function podlisting_user($type, &$edit, &$user) {
if ($type == 'view' && user_access('edit own podlisting', $user)) {
$form['podlisting'] = array(
'#type' => 'item', '#title' => t('podlisting'),
'#value' => l(t('associated podlistings'), "podlisting/$user->uid", array('title' => t("Check out %username's podlistings.", array('%username' => $user->name))))
);
return array(t('Vlogs') => $form);
}
}

/**
* Menu callback; displays a Drupal page containing recent podlisting entries.
*/
function podlisting_page($a = NULL, $b = NULL) {

if (is_numeric($a)) { // $a is a user ID

a simple link as MENU_LOCAL_TASK

Hi everybody.

I want to create a MENU_LOCAL_TASK link which simply links to 'node/add/mymodule' .
I don't need callbacks or other. Simply send clicks on the little tab (created near view and edit)
to the 'node/add/mymodule' page.

How can I do this on drupal 4.7 ?

This looks simple to me but I'm stuck with this! (maybe I'm too tired)

Thanks Fabio

Encrypted / restricted flexinode field

As part of an Intranet project in Drupal I'm looking to hold sensitive data such as passwords and contact phone numbers in nodes.

The content types are defined by Flexinode.

I'm looking to build a new Flexinode field type which will take plain text and encrypt it in the database (so not searchable). The field will only be displayed if the viewing user has the right permission/role too.

Pages

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