Having problems installing Drupal? See the Installation Guide for more information.

Finding a simple language switch

I'm not the first to ask, but I believe there must be a simple script possible so that a user can switch to another localisation (language) with a simple click. In my case, the default is French and I want English users to simply click on a link called, for example, "English navigation" (instead of asking them to create an account, etc.).

I imagine the "simplest" might be a script that identifies the default language selected in the user's browser (IE, Netscape, etc.) and tells Drupal to use that localisation for the session.

BUT it wouldn't always work, so I tried the following code proposed by Steph* a good while ago. Unfortunately, I couldn't figure out where to write "en" or "English" in the code to make it work. Yet I don't even know if this small php file would override the default language on my site.:?

Can someone tell me if this php trick would work and where to stick the "en" or "English"?

Thanks,
Mic

function locale_init() {
global $defaultLanguage,$lang,$languages;

// first set the defaultLanguage, if lang was passed in php
// initialize localization system
session_register("defaultLanguage");
if ($lang)
$defaultLanguage = $lang;

return ($languages ? ((is_object($user) && $user->id &&
$user->language) ? $user->language : $defaultLanguage ? $defaultLanguage
: key($languages)) : 0);
}

[This is followed by an html script to return to the main page of the site]

* Found at:
http://lists.drupal.org/archives/drupal-support/2002-12/msg00044.html

i/frame and i/layer tags suddenly not working

I had inserted i/frame and i/layer tags pointing to a remote-hosted calendar to a node on my site. It was all working brilliantly until I started uploading, testing and aborting some of the modules. Now the calendar page doesn't show up at all within my drupal site.

What could be the problem? Can anyone help?

Thanks.

amazon help requested in 4.2

when installing amazon module (4.2) on drupal (4.2) i get an ungly error, causing page to step rendering when block is enabled:
Fatal error: Unknown function: drupal_url() in /var/www/html/myblog/modules/amazon.module on line 402

before installing i dropped two old amazon tables and did insert the new amazone.mysal again.

anyone else seen this or know how to solve this?

Inserting Avatars in Node View

I've been attempting to have avatars appear next to the author's name in every node displayed on the front page, AKA LiveJournal style. The website is View Online at http://view.rit.edu. I've already installed profile.module to enable avatars.

I'm using a modified version of the Trip theme. Here's the code I've inserted...

        

        
        
        $filename = profile_avatar_path($node->uid,".jpg");
        print "<img class=\"avatar\" src=\"";
          if (!file_exists($filename)) {
                $filename =  profile_avatar_path(1, ".jpg");
          }
        print $filename;
        print "\" align=\"top\">";
        

<?php print strtr(t("%a | %b"), array("%a" => format_name($node), "%b" => format_date($node->created, "medium"))); ?
>

-->

However, it seems to be working only for two users, uid #2 and #3. Can anyone help? Thank you!

Content depending on Login?

Hi everybody,
is there a way to personalize parts of the content, so that we could display different content and/or navigation-structur depending on the user/group that is logged in?

Greetings from Germany
ES

Help: Changed theme and now cannot get into drupal

I am using the new 4.2.0 -- I just did a clean install. I was working on a new theme (actually altering an old theme) and not thinking I set it as the default theme. There seems there is an error in what I did and I cannot get back to anything in drupal to reset it. I just get an error that basically says there there is an error at line 174 of includes/themes.inc. What do I need to reset to a more benign theme? Or is there a backdoor page that will allow me to do this.

Pages

Subscribe with RSS Subscribe to RSS - Installing Drupal