.htaccess and localhost issues

Hi all

I have a drupal website and have been using an XAMPP local server, i have several sites on the server and this morning they all worked fine.

On my main site "Site 1" i was getting duplicate sites, google was finding http://www.site1.com and http://site1.com, so i editted the .htaccess file as follows:

Images

How come when I add the same URL path for the same image in multiple nodes, Drupal creates a new image file and gives it a new name eg.

file/image.jpg
file/image_0.jpg

This happens even when I import.

Seems crazy as now my files are 10 times the size they need to be. Am I missing something?

User friendly commerce modules?

Questions for commerce. Has any work been done to make the creation of products and product displays easier - apart from the bulk operation module.

1) I am looking for a way to dynamically adding more options to e.g. the attributes color and size when creating the product, so I do not have to do all of that in advance in the product type view.

2) I am looking for an easier way to create products with the correct combinations of attributes instead of commerce just adding all possible combinations of the attributes I check off when using the bulk creation module.

Attempting my first module: Assign user a role based on their email

I am writing my first module ever lol - what a newb haha. I am attempting to write a module where users registering an account will automatically be assigned a role - determined by the email account they registered their account with. So I began by talking with a friend on the Drupal IRC who said i should look into the presave hook (http://api.drupal.org/api/drupal/modules--user--user.api.php/function/ho...). So I took up their advice, however not sure how to assign the roles. Below is what I have so far:


<?php
/* $Id$ */

/**
* @file
* Automatically assign role based on email domain associated upon registration.
*/

function user_email_roles_user_presave(&$edit, $account, $category) {

// Get domain
$mailContainer = $account->mail;
$splitIndex = strpos($mailContainer, '@')+1;
$emailLength = strlen($mailContainer);
$emailDomain = substr($mailContainer, $splitIndex, $emailLength);

switch ( $emailDomain ) {
case 'unh.edu':
//assign unh role
break;
case 'wildcats.unh.edu':
//assign unh role
break;
case default:
//assign 'public' role
break;

}

// Assign users roles
// if (isset($edit['mymodule_foo'])) {

Drop-down menus don't open on iPhone

Hi. I have a website with a main menu that drops down. The website automatically changes its layout when viewed from an iPhone, but the dropdown menu's don't appear. I'm using the "Sky" theme and the DHTML Module. The static navigation is set to "none", but it still happens with other settings turned on. The menu's change colour, but nothing else happens.

The website is located at kanyon.us I've only tried it on iOS, but I bet it does the same thing on other devices.

Custom module and Google Maps API [solved]

Edit:
Browsers don't like width:100% height:100% on div's, thats what my problem was. I changed it too 500px width and 500px height and it worked fine. Once more, thanks for all the replies, took me a while to figure it out tho.

Hi,

I've ran into a problem with a custom module i'm developing. The module is a field you can add too a content type, the field it self is actually a form, address form. User enters zipcode, city, etc.

Now I have a database with all the latitudes and longtitudes of all address in a specific country. Through that I would like to show a google maps map and put in a marker etc on the location the user entered in the form.

The problem is, I thought it would be easy to just use drupal_add_js function with all the neccessary javascript thats needed for google maps api, however this doesnt seem to work. What I have now:

<?php
function my_module_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
$element = array();

if($display['type'] == 'my_module_formatter'){
foreach($items as $delta => $item){
$markup = $item['my_module_street'] . ' ' . $item['my_module_homenumber']. '
' . strtoupper($item['my_module_postalcode']) . ' ' . $item['my_module_city']. '
';

$query = db_select('my_module_data');

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x