How to Set the Language Detection Progammatically

In Drupal 7, how do I set the language detection method progammatically ? The choices are detection by:

- URL
- Session
- User
- Browser

I would like to be able to change the detection method in a module, theme or installation profile.

Is there a function or API that I can use to achieve this ?
Thanks.

Twitter JS is breaking Theme JS

So I have a Twitter JS code I am trying to embed on the front homepage and it involves three JS files:

plus the JS code for the twitter feed. Now before I embed this code the rotating banners are working fine but when I add these script links, it breaks the rotating banners. The Theme I am using is Marinelli. Does anyone know how to use these twitter script links with this theme?

Viewing a entity

Hi

I am in the process of writing a cafepress module for DR7 and the first part is under review. I now want to extend this module and get the viewing under control. I would like to view the information in the same way as you view a node like www.example.com/cafepress/1. The entity "CPI_PRODUCTS" is working okay and i have a database full of the correct information. I have a cpi_products_load and save function. I also have the permissions setting correct. But there must be something wrong in the code. The code block is large so i will copy in what i think is importation if you want to have the complet code let me know.

****the error I get is page does not exist. *****(added later)


<?php

/**
* Implements hook_permission().
*/
function cafepress_import_permission() {
return array(
'administer cafepress' => array(
'title' => t('Administer Cafepress'),
),
'view cafepress' => array(
'title' => t('View Cafepress'),
),
);
}

/**
* Implements hook_entity_info().
*/
function cafepress_import_entity_info() {
$return['cpi_storesection'] = array(
'label' => t('Store Sections'),
'controller class' => 'EntityAPIController',
'base table' => 'cpi_storesection',
'entity keys' => array(
'id' => 'aid',
),
);
$return['cpi_products'] = array(

Menu items don't get translated

My menu items don't get translated, in a custom menu with the translation mode set to "translate and localize"
The menu items is set to "language neutral". "Language none" is not available...
The menu items appears and are translated in the translate interface.

Am I missing something

Here's my code

MYSQl connections

Is there any fix to this on shared hosting?

PDOException: SQLSTATE[42000] [1203] User vanhemelrijkkri_ already has more than 'max_user_connections' active connections in lock_may_be_available() (line 164 of /home/cust/v/a/vanhemelrijkkri_h1/www/Main/includes/lock.inc).

It blocks my site for hours or even days... I have contacted my host and I have looked on this site and google.. can't find anything to help me out

And no Im not a php programmer

D7 form API giving unexpected results with nested fieldsets generated dynamically

Hello,

I am building a module as a user interface to a separate database in drupal 7.2

The goal is to have a form generated dynamically from the database containing nested field-sets. Each report will have various sections, one section will have various elements and each element will have a number of items, each item will require rating with a set of radios.

The plan is to have the list of items within each element field-set shown in a table where each radio option is a column in the table.

The form function code I have so far is as follows. This is giving unexpected results. The foreach loop does not appear to be adding a new unique form element and I do not understand why. Please see the comments in the code.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x