• [MOD] Language select 4 0 5 1
Currently:  

Author Topic: [MOD] Language select  (Read 296274 times)

0 Members and 2 Guests are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Language select
« Reply #165 on: November 15, 2008, 01:47:37 AM »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline nhomauhoaphuong

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: [MOD] Language select
« Reply #166 on: November 16, 2008, 03:30:05 AM »
hi,
i changed the charset for my vietnamese font from ISO- to utf-8 and now in ACP and also on some images when i viewed it's showing this error too.  it's showing this error .. please help me to solved this.
thanks


Quote
Warning: Cannot modify header information - headers already sent by (output started at /home1/chuahuon/public_html/hinhanh/lang/vietnamese/main.php:1) in /home1/chuahuon/public_html/hinhanh/admin/admin_functions.php on line 168

Warning: Cannot modify header information - headers already sent by (output started at /home1/chuahuon/public_html/hinhanh/lang/vietnamese/main.php:1) in /home1/chuahuon/public_html/hinhanh/admin/admin_functions.php on line 169

Warning: Cannot modify header information - headers already sent by (output started at /home1/chuahuon/public_html/hinhanh/lang/vietnamese/main.php:1) in /home1/chuahuon/public_html/hinhanh/admin/admin_functions.php on line 170

Warning: Cannot modify header information - headers already sent by (output started at /home1/chuahuon/public_html/hinhanh/lang/vietnamese/main.php:1) in /home1/chuahuon/public_html/hinhanh/admin/admin_functions.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at /home1/chuahuon/public_html/hinhanh/lang/vietnamese/main.php:1) in /home1/chuahuon/public_html/hinhanh/admin/admin_functions.php on line 172

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Language select
« Reply #167 on: November 16, 2008, 03:42:27 AM »
As you've noticed your previous reply no longer under this topic anymore. It's because your issue has nothing to do with this topic.
http://www.4homepages.de/forum/index.php?topic=21404.0
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline nhomauhoaphuong

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: [MOD] Language select
« Reply #168 on: November 16, 2008, 04:01:57 AM »
i noticed that but i though i was wrong. but i dont think any body answer nor helping me over that topic, please help me out. 

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Language select
« Reply #169 on: April 01, 2009, 12:58:58 PM »
This has always been a great  mod, but for some reason it stops the Flash Keyword Cloud mod from working in every language except for English... .any one have any ideas on 1.7.6 ???
As long as I can finish my site before I die.

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Language select
« Reply #170 on: April 01, 2009, 01:13:19 PM »
Can you clarify this? you said to use this code:
Code: [Select]
if (isset($HTTP_GET_VARS['l']) || isset($HTTP_POST_VARS['l'])) {
  $requested_l = (isset($HTTP_GET_VARS['l'])) ? trim($HTTP_GET_VARS['l']) : trim($HTTP_POST_VARS['l']);
  if (file_exists(ROOT_PATH.'lang/'.$requested_l.'/main.php')) {
    if (!isset($HTTP_COOKIE_VARS['4images_lang'])) $l = $requested_l;
    $config['language_dir'] = $requested_l;
    setcookie('4images_lang', $requested_l, (time()+ 60 * 60 * 24 * 365), "/", "", 0);
  }
}
else
{
  if (isset($HTTP_COOKIE_VARS['4images_lang']) && file_exists(ROOT_PATH.'lang/'.$HTTP_COOKIE_VARS['4images_lang'].'/main.php'))
  {
    if ($HTTP_COOKIE_VARS['4images_lang'] != $config['language_dir']) $l = $HTTP_COOKIE_VARS['4images_lang'];
    $config['language_dir'] = $HTTP_COOKIE_VARS['4images_lang'];
  }
  else
  {
    //http://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt
    $lang_codes = array(
      "aa"=>"afar","ab"=>"abkhazian","ae"=>"avestan","af"=>"afrikaans","ak"=>"akan","am"=>"amharic","an"=>"aragonese","ar"=>"arabic","as"=>"assamese","av"=>"avaric","ay"=>"aymara","az"=>"azerbaijani",
      "ba"=>"bashkir","be"=>"belarusian","bg"=>"bulgarian","bh"=>"bihari","bi"=>"bislama","bm"=>"bambara","bn"=>"bengali","bo"=>"tibetan","br"=>"breton","bs"=>"bosnian",
      "ca"=>"catalan","ce"=>"chechen","ch"=>"chamorro","co"=>"corsican","cr"=>"cree","cs"=>"czech","cu"=>"church_slavic","cv"=>"chuvash","cy"=>"welsh",
      "da"=>"danish","de"=>"deutsch","dv"=>"divehi","dz"=>"dzongkha",
      "ee"=>"ewe","el"=>"greek","en"=>"english","eo"=>"esperanto","es"=>"spanish","et"=>"estonian","eu"=>"basque",
      "fa"=>"persian","ff"=>"fulah","fi"=>"finnish","fj"=>"fijian","fo"=>"faroese","fr"=>"french","fy"=>"frisian",
      "ga"=>"irish","gd"=>"gaelic","gl"=>"galician","gn"=>"guarani","gu"=>"gujarati","gv"=>"manx",
      "ha"=>"hausa","he"=>"hebrew","hi"=>"hindi","ho"=>"hiri_motu","hr"=>"croatian","ht"=>"haitian","hu"=>"hungarian","hy"=>"armenian","hz"=>"herero",
      "ia"=>"interlingua","id"=>"indonesian","ie"=>"interlingue","ig"=>"igbo","ii"=>"sichuan_yi","ik"=>"inupiaq","io"=>"ido","is"=>"icelandic","it"=>"italian","iu"=>"inuktitut",
      "ja"=>"japanese","jv"=>"javanese",
      "ka"=>"georgian","kg"=>"kongo","ki"=>"kikuyu","kj"=>"kuanyama","kk"=>"kazakh","kl"=>"kalaallisut","km"=>"khmer","kn"=>"kannada","ko"=>"korean","kr"=>"kanuri","ks"=>"kashmiri","ku"=>"kurdish","kv"=>"komi","kw"=>"cornish","ky"=>"kirghiz",
      "la"=>"latin","lb"=>"luxembourgish","lg"=>"ganda","li"=>"limburgan","ln"=>"lingala","lo"=>"lao","lt"=>"lithuanian","lu"=>"luba-katanga","lv"=>"latvian",
      "mg"=>"malagasy","mh"=>"marshallese","mi"=>"maori","mk"=>"macedonian","ml"=>"malayalam","mn"=>"mongolian","mo"=>"moldavian","mr"=>"marathi","ms"=>"malay","mt"=>"maltese","my"=>"burmese",
      "na"=>"nauru","nb"=>"norwegian","nd"=>"ndebele","ne"=>"nepali","ng"=>"ndonga","nl"=>"dutch","nn"=>"norwegian","no"=>"norwegian","nr"=>"ndebele","nv"=>"navajo","ny"=>"chichewa",
      "oc"=>"occitan","oj"=>"ojibwa","om"=>"oromo","or"=>"oriya","os"=>"ossetian",
      "pa"=>"panjabi","pi"=>"pali","pl"=>"polish","ps"=>"pushto","pt"=>"portuguese",
      "qu"=>"quechua",
      "rm"=>"romansh","rn"=>"rundi","ro"=>"romanian","ru"=>"russian","rw"=>"kinyarwanda",
      "sa"=>"sanskrit","sc"=>"sardinian","sd"=>"sindhi","se"=>"sami","sg"=>"sango","si"=>"sinhala","sk"=>"slovak","sl"=>"slovenian","sm"=>"samoan","sn"=>"shona","so"=>"somali","sq"=>"albanian","sr"=>"serbian","ss"=>"swati","st"=>"sotho","su"=>"sundanese","sv"=>"swedish","sw"=>"swahili",
      "ta"=>"tamil","te"=>"telugu","tg"=>"tajik","th"=>"thai","ti"=>"tigrinya","tk"=>"turkmen","tl"=>"tagalog","tn"=>"tswana","to"=>"tonga","tr"=>"turkish","ts"=>"tsonga","tt"=>"tatar","tw"=>"twi","ty"=>"tahitian",
      "ug"=>"uighur","uk"=>"ukrainian","ur"=>"urdu","uz"=>"uzbek",
      "ve"=>"venda","vi"=>"vietnamese","vo"=>"volapük",
      "wa"=>"walloon","wo"=>"wolof",
      "xh"=>"xhosa",
      "yi"=>"yiddish","yo"=>"yoruba",
      "za"=>"zhuang","zh"=>"chinese","zu"=>"zulu",
    );
   
    //http://www.thefutureoftheweb.com/blog/use-accept-language-header
    $langs = array();
   
    if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
        // break up string into pieces (languages and q factors)
        preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse);
   
        if (count($lang_parse[1])) {
            // create a list like "en" => 0.8
            $langs = array_combine($lang_parse[1], $lang_parse[4]);
       




            // set default to 1 for any without q factor
            foreach ($langs as $key => $val) {
                if ($val === '') $langs[$key] = 1;
            }
   
            // sort list based on value




            arsort($langs, SORT_NUMERIC);
        }
    }
    foreach ($langs as $key => $val)
    {
      $key = explode("-", $key);
      if (isset($lang_codes[$key[0]]) && file_exists(ROOT_PATH.'lang/'.$lang_codes[$key[0]].'/main.php'))
      {
        $config['language_dir'] = $lang_codes[$key[0]];
        if ($lang_codes[$key[0]] != $config['language_dir']) $l = $lang_codes[$key[0]];
        setcookie('4images_lang', $lang_codes[$key[0]], time()+ 60 * 60 * 24 * 365, "/", "", 0);
        break;
      }
    }
    unset($langs);
    unset($lang_codes);
  }
}


If you wanted to automatically detect the language of the visitor. BUT
How do you use this code if you are using version B of this mod and 1.7.6 ?

With great appreciation thanks----
Robert
As long as I can finish my site before I die.

Offline V@nо

  • Addicted member
  • ******
  • Posts: 1.223
    • View Profile
Re: [MOD] Language select
« Reply #171 on: April 01, 2009, 04:01:22 PM »
1) I've asked you once before, please do not reply twice to the same topic, edit your previous reply with additional info, questions, unless someone replied after you or if no one replied for a long time. I ask you that, because if you look at the history of your replies, you'd see that almost all your recent replies to any topics are following by one to three additional replies by you.  It is called "flood". Even though flooding is not in our forum's rules, I bet it's not granted on any forums.

2) more often then not it's more helpful see the original reply instead of just a quote from it, aka provide a link to the message you are referring to, along with the quote if you feel like it.. The original replies and replies before them can provide more useful information. A link to a specific reply can be found at it's headline or icon.

3) did you try the code? from what I recall it has nothing to do with version A or B and from what I see it should work on v1.7.6 as well.


P.S.
Please don't get offended by what I said or will say, it wasn't my intention. But you seems to rush into post a reply without first checking if it's a mistake you made, then after 5 minutes with "gee I forgot something" post another reply...please don't do that, edit your previous post instead.
I understand you don't have enough time to do everything you'd like to do, we all like that, but if you'd spent the same amount of time that required to post a message on the forum, to actually double check your steps, you'd probably save a lot of time for yourself then waiting for the other's replies ;)
Sorry for the lecture.
Your first three "must do" before you ask a question:
If I asked you to PM me, I meant PM to my primary account, this account doesn't accept PMs.

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Language select
« Reply #172 on: April 08, 2009, 01:43:03 PM »
1) I've asked you once before, please do not reply twice to the same topic, edit your previous reply with additional info, questions, unless someone replied after you or if no one replied for a long time. I ask you that, because if you look at the history of your replies, you'd see that almost all your recent replies to any topics are following by one to three additional replies by you.  It is called "flood". Even though flooding is not in our forum's rules, I bet it's not granted on any forums.

so.... if I edit a previous poist will it reappear at the end of the thread as a new post would? I think for now on unless I have some information that helps I will delete all previous posts and have only one post... the linear fashion of this forum is lacking... I think internet forums need an evolutionary advancement....


Quote
2) more often then not it's more helpful see the original reply instead of just a quote from it, aka provide a link to the message you are referring to, along with the quote if you feel like it.. The original replies and replies before them can provide more useful information. A link to a specific reply can be found at it's headline or icon.
 

I will try something different soon.

Quote
3) did you try the code? from what I recall it has nothing to do with version A or B and from what I see it should work on v1.7.6 as well.

I am in a hurry working on other things... I will try it soon... the serious issue is it prevents flash keywords from working in other languages but english... willl get back with more feedback asap.
Quote

P.S.
Please don't get offended by what I said or will say, it wasn't my intention. But you seems to rush into post a reply without first checking if it's a mistake you made, then after 5 minutes with "gee I forgot something" post another reply...please don't do that, edit your previous post instead.
I understand you don't have enough time to do everything you'd like to do, we all like that, but if you'd spent the same amount of time that required to post a message on the forum, to actually double check your steps, you'd probably save a lot of time for yourself then waiting for the other's replies ;)
Sorry for the lecture.


hmmm... I know you are the masta hacka (err master hacker)......

I dont know about you but I spend like 150 hours a week working and like 90% is on this 4images site I am trying to make and others......


I dont have the super fly secret coding power skills you clearly possess.... so even the simple shit can sometimes take me hours and hours...............

I dont just doible check.. I am doing in like 10 times check or something....

I am trying to get better at it.

My kids don not get to see me at all because I am double checking so much.....


I mean if I could solve all the problems myself than why even come to the forum :)

Ill try to be ever more efficient...
As long as I can finish my site before I die.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Language select
« Reply #173 on: April 08, 2009, 03:01:31 PM »
Hi Vano
this Mod ist not compatibel with
http://www.4homepages.de/forum/index.php?topic=24526.0

problem with cookies
http://www.4homepages.de/forum/index.php?topic=4743.msg31555#msg31555
http://www.4homepages.de/forum/index.php?topic=24526.msg134385#msg134385

can you help us?
I've updated the cookie code. For people previously installed that code I've left the old code at the bottom of the post, so they know what to search for.


so.... if I edit a previous poist will it reappear at the end of the thread as a new post would?

If your previous post is the last post of the thread then yes, it will appear at the end of the thread. If your previous post is not the last post of the thread feel free post a new reply.

Anyways, if you have any other questions regarding posting on this forum, please post them in chit-chat section or PM me directly.

Let's stay on-topic here ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Language select
« Reply #174 on: April 09, 2009, 02:05:32 AM »
ops, sorry. that is part of a file I had opened at the time of posting...my bad. code fixed.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Language select
« Reply #175 on: April 10, 2009, 03:00:23 AM »
Would you please test again, I've removed && $requested_l != $config['language_dir']
it should work now.
P.S. I don't have this mod installed, can't test it myself.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline crs

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Re: [MOD] Language select
« Reply #176 on: April 14, 2009, 03:27:04 AM »
Hello, the "url" of the links is for example know: "details.php?image_id=11191&l=deutsch"

Is there any way to hide the "&l=deutsch" or "&l=english" from all links on the 4images website?

Thanks for help

Offline egyptandy

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [MOD] Language select
« Reply #177 on: April 20, 2009, 10:11:16 AM »
Hello,
I have implemented this MOD and it works fine.
But I have still one problem.
In my "menue" I have 3 extra lines for "Links", "Imprint" and "Contact"
How should I change the code in the menue.php to have also those lines to switch between the two languages german and english.
I have already included in the lang.dir=> Deutsch=> main.php the ranslation for Contact and Imprint

This is the code for the menue.php

<table class="menue" width="100%" border="0" cellpadding="5" cellspacing="0"><tr><td valign="top" align="center"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top" align="center">

<p align="left">

» <a href="index.php?template="Imprint">Imprint</a><br />
» <a href="index.php?template="Contact">Contact</a><br />
» <a href="index.php?template=Links">Links</a><br />

</p>

</td></tr></table></td></tr></table>

Thank you for your help.

 

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Language select
« Reply #178 on: April 20, 2009, 02:44:18 PM »
Code: [Select]
<?php
global $site_sess;
?>

» <a href="<?=$site_sess->url(ROOT_PATH."index.php?template=imprint")?>">Imprint</a><br />
» <a href="<?=$site_sess->url(ROOT_PATH."index.php?template=contact")?>">Contact</a><br />
» <a href="<?=$site_sess->url(ROOT_PATH."index.php?template=links")?>">Links</a><br />
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline egyptandy

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [MOD] Language select
« Reply #179 on: April 21, 2009, 08:09:34 AM »
Thank you for your fast reply V@no.
But I am a newbe and now i am not not sure what to do.
Only to change the lines in the menue.html or to change something also on the global.php?
I have not found the mentioned line in my global.php.
Do I have to include this and at which position?
Or does the position do not matter?
Please give me an advise.