Quickly Change Your Language 0.1

Misc MOD Downloads for phpBB3 -- Any MOD that does not fit into any other category
Forum rules
Image Please feel free to download any MOD's here, support for each MOD is located it's own thread.

To post your own MOD, please first read the MOD Guidelines

Re: Quickly Change Your Language 0.1

Postby Kjell » 03 Oct 2007, 06:34

If I change default_lang to lang_name in includes/ucp/ucp_register.php it´s working


Code: Select all
//      if ($change_lang || $user_lang != $config['default_lang'])
      if ($change_lang || $user_lang != $config['lang_name'])
Kjelle
My work - My farm - Ware I live - phpBB support Sweden
"The globe is round, think global", My rules: Be teased is okay on a funny way ;)
User avatar
Kjell    
Supporter
Supporter
 
Posts: 490
Joined: 14 Feb 2007, 13:09
Location: Nordic of Sweden
Favorite Team: NHL N-ville,Forsberg
Gender: Male
phpBB Knowledge: 8


Re: Quickly Change Your Language 0.1

Postby LEW21 » 03 Oct 2007, 12:05

Find:
Code: Select all
      if ($user->lang_name != $userdata['user_lang'] && $userdata['user_id'] != ANONYMOUS)

Replace with:
Code: Select all
      if ($user->lang_name != $user->data['user_lang'] && $user->data['user_id'] != ANONYMOUS)



Already fixed in dev version.
phpBB3.PL - User-friendly Polish phpBB 3.0 support
LEW21    
Translator
Translator
 
Posts: 901
Joined: 01 Jun 2006, 03:51
Location: Warsaw, Poland
Gender: Male
phpBB Knowledge: 10

Re: Quickly Change Your Language 0.1

Postby Kjell » 03 Oct 2007, 12:55

Sorry LEW21, same problem as before.
Let samone tray this mod here on STG and tell us if the have same problems....
Kjelle
My work - My farm - Ware I live - phpBB support Sweden
"The globe is round, think global", My rules: Be teased is okay on a funny way ;)
User avatar
Kjell    
Supporter
Supporter
 
Posts: 490
Joined: 14 Feb 2007, 13:09
Location: Nordic of Sweden
Favorite Team: NHL N-ville,Forsberg
Gender: Male
phpBB Knowledge: 8

Re: Quickly Change Your Language 0.1

Postby Stoker » 03 Feb 2008, 15:55

I dont know if You can use this:
http://www.yoursite.com/ucp.php?mode=re ... ge_lang=en
As You can see it redirects the user to the english registration page.
Stoker
Stoker    
Borg Drone
Borg Drone
 
Posts: 401
Joined: 24 Nov 2007, 11:05
Location: Denmark
Favorite Team: Highslide JS
Gender: Male
phpBB Knowledge: 4

Re: Quickly Change Your Language 0.1

Postby newaira » 20 Mar 2008, 09:04

I have added a link based toggle if there are only two languages and a drop down language selection if there are more than two. If you are want you can add it to the mod.

Open: includes/functions.php
Find:
Code: Select all
      'S_DISPLAY_PM'         => ($config['allow_privmsg'] && $user->data['is_registered'] && ($auth->acl_get('u_readpm') || $auth->acl_get('u_sendpm'))) ? true : false,
      'S_DISPLAY_MEMBERLIST'   => (isset($auth)) ? $auth->acl_get('u_viewprofile') : 0,
      'S_NEW_PM'            => ($s_privmsg_new) ? 1 : 0,

Add after:
Code: Select all
      'S_LANG_QUICK_SELECT'   => language_quick_select($user->lang_name), // create a quick language selection


Find:
Code: Select all
?>

Add before:
Code: Select all
/**
* Create a toggle between two languages or a drop down if there are more than two languages.
*/
function language_quick_select($default)
{
   global $db, $user;
   
   $sql = 'SELECT COUNT(*) as total_languages FROM ' . LANG_TABLE;
   $db->sql_query($sql);
   $total_languages = (int) $db->sql_fetchfield('total_languages');
   $db->sql_freeresult();

   $language_options = '';
   if ($total_languages < 2)
   {
      // There is only one language, so no need to create a selection
   }
   else
   {
      // Generate the url with appended lang var
      $url = build_url('lang');
      $url_parts = parse_url($url);
      if (0 == utf8_strlen($url_parts['query']))
      {
         $url .= '?lang=';
      }
      else
      {
         $url .= '&amp;lang=';
      }

      if ($total_languages == 2)
      {
            // Only 2 languages, so create a link for the non-current language
         $sql = 'SELECT lang_iso, lang_local_name
            FROM ' . LANG_TABLE . "
            WHERE lang_iso <> '".$db->sql_escape($default)."'";
         $db->sql_query($sql);
         $row = $db->sql_fetchrow();
         $db->sql_freeresult();
         
         $language_options = '<a href="'.$url.$row['lang_iso'].'">'.$row['lang_local_name'].'</a>';
      }
      else
      {
            // More than 2 languages so create a drop down to choose a language
         $language_options  = '<select onchange="location.href=\''.$url.'\'+this.options[this.selectedIndex].value">';
         $language_options .= language_select($default);
         $language_options .= '</select>';
      }
   }
   
   return $language_options;
}


Open: styles/prosilver/template/overall_header.html
Find:
Code: Select all
         <div id="site-description">
            <a href="{U_INDEX}" title="{L_INDEX}" id="logo">{SITE_LOGO_IMG}</a>
            <h1>{SITENAME}</h1>
            <p>{SITE_DESCRIPTION}</p>
            <p style="display: none;"><a href="#start_here">{L_SKIP}</a></p>
         </div>

Add after:
Code: Select all
         <div id="quick-lang-select">
            {S_LANG_QUICK_SELECT}
         </div>


Open: styles/prosilver/theme/common.css
Or you could do this through the admin interface by going to Styles -> Themes -> Prosilver -> Edit if you don't want to modify the original file.
Find:
Code: Select all
#search-box {
   color: #FFFFFF;
   position: relative;
   margin-top: 30px;

Replace with:
Code: Select all
#search-box {
   color: #FFFFFF;
   position: relative;
   margin-top: 20px;


Find:
Code: Select all
#site-description h1 {
   margin-right: 0;
}

Add after:
Code: Select all
/* Quick language selection */
#quick-lang-select {
   float: right;
   width:29%;
   text-align:right;
   margin-right:1%;
}

#quick-lang-select a, #quick-lang-select a:visited {
   color: white;
}
newaira
Crewman
Crewman
 
Posts: 1
Joined: 20 Mar 2008, 08:16
Gender: Male

Re: Quickly Change Your Language 0.1

Postby Berlo » 17 Aug 2008, 02:49

I know this sounds very wierd, but after 2 months of using the script, it stopped working suddenly without any changes to the forum done by me. Any ideas?
My URL is a temporary one. Can that be the case?
I have tried it with 2 browsers and 2 computers, so I don't believe it's cookies or something.

Thanks in advance!
Berlo
Berlo
Crewman
Crewman
 
Posts: 2
Joined: 17 Aug 2008, 02:46
Gender: Male

Re: Quickly Change Your Language 0.1

Postby Berlo » 11 Sep 2008, 08:52

Nothing?
Berlo
Crewman
Crewman
 
Posts: 2
Joined: 17 Aug 2008, 02:46
Gender: Male

Re: Quickly Change Your Language 0.1

Postby bjongen » 18 Jan 2009, 15:21

Hello;

I have been using this mod since it came out with much pleasure. Now I have updated to 3.0.4 and it stopped working; the error message says: "Language file ./../language/en/en/common.php couldn't be opened." (mark the double "en/en/"!). Can anybody help me how to get it right? Many thanks in advance, Regards, Bart

[EDIT] PS; I have seen some other mods with this function (e.g. http://www.phpbb.com/community/viewtopi ... &t=1368745) but I would prefer this mod, as I only need to edit just 1 file. This is the only mod on my site and I would like to keep it as "clean" as possible... thanks in advance!
User avatar
bjongen    
Cadet III
Cadet III
 
Posts: 38
Joined: 09 Dec 2006, 16:30
Location: The Netherlands
Gender: Male
phpBB Knowledge: 5

Re: Quickly Change Your Language 0.1

Postby liptonace » 19 Feb 2009, 14:56

Just change one line:

Find:
Code: Select all
      $user->lang_path = "{$phpbb_root_path}language/{$user->lang_name}/";


Replace with:
Code: Select all
      $user->lang_path = "{$phpbb_root_path}language/";


End :DD
liptonace    
Crewman
Crewman
 
Posts: 5
Joined: 19 Feb 2009, 14:52
Gender: Male
phpBB Knowledge: 3

Re: Quickly Change Your Language 0.1

Postby nosferatus » 29 Jun 2009, 02:07

When I am trying to reach index.php with clean cookies, i receive this message 'Language file ./language//common.php couldn't be opened.' If I open index.php?lang=en -Ok. All these steps I have done. Pls, reveiw my forum - http://forum.vampiregothicstyle.com/
Last edited by nosferatus on 01 Jul 2009, 02:14, edited 1 time in total.
nosferatus
Crewman
Crewman
 
Posts: 2
Joined: 26 Feb 2009, 03:18
Gender: Male
phpBB Knowledge: 1

PreviousNext

Return to Miscellaneous MODs, Hacks and Downloads

Who is online

Users browsing this forum: No registered users and 13 guests

cron