Multiple Languages
Re: Multiple Languages
You can use usort function to sort your array in any order.
Don't forget to run script update
Re: Multiple Languages
I could use usort from my language template file directly but i need categories with at least a certain number of galleries.
Re: Multiple Languages
You can create an array from
<categories
$category[name] = <!--TOTAL_GALLERIES-->;
</categories>
and then filter it.
<categories
$category[name] = <!--TOTAL_GALLERIES-->;
</categories>
and then filter it.
Don't forget to run script update
Re: Multiple Languages
Hello, I have the code you gave me in common.php
It is working fine. But i see a lot of error in apache error logs:
How can i fix it?
Thank you.
Code: Select all
if (!strstr($_SERVER['HTTP_REFERER'], 'domain.com') and !$_GET['force_lng']) {
$str = $_SERVER['REQUEST_URI']; $str2 = substr($str, 3);
if (strstr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'fr')) {
header("Location: http://www.domain.com/fr".$str."");
exit;
} elseif (strstr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'de')) {
header("Location: http://www.domain.com/de".$str."");
exit;
.....
} else {
header("Location: http://www.domain.com/en".$str."");
exit;
}
}
Code: Select all
PHP Notice: Undefined index: HTTP_REFERER in /data/www/domain.com/html/scj/cgi/common.php on line 16
PHP Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /data/www/domain.com/html/scj/cgi/common.php on line 47
Thank you.
Re: Multiple Languages
Add
if (!isset($_SERVER['HTTP_REFERER'])) $_SERVER['HTTP_REFERER'] = '';
if (!isset($_SERVER['HTTP_REFERER'])) $_SERVER['HTTP_REFERER'] = '';
Don't forget to run script update
Re: Multiple Languages
I also have this error:
But have else at the end:
Code: Select all
/data/www/pornyep.com/html/kli/cgi/common.php on line 58
[Mon Oct 24 20:44:16.087267 2016] [:error] [pid 4103] [client 157.55.39.88:45268] PHP Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /data/www/domain.com/html/scj/cgi/common.php on line 61
[Mon Oct 24 20:44:16.087271 2016] [:error] [pid 4103] [client 157.55.39.88:45268] PHP Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /data/www/domain.com/html/scj/cgi/common.php on line 64
[Mon Oct 24 20:44:16.087275 2016] [:error] [pid 4103] [client 157.55.39.88:45268] PHP Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /data/www/domain.com/html/scj/cgi/common.php on line 67
[Mon Oct 24 20:44:16.087279 2016] [:error] [pid 4103] [client 157.55.39.88:45268] PHP Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /data/www/domain.com/html/scj/cgi/common.php on line 70
[Mon Oct 24 20:44:16.087284 2016] [:error] [pid 4103] [client 157.55.39.88:45268] PHP Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /data/www/domain.com/html/scj/cgi/common.php on line 73
Code: Select all
if (!strstr($_SERVER['HTTP_REFERER'], 'domain.com') and !$_GET['force_lng']) {
$str = $_SERVER['REQUEST_URI']; $str2 = substr($str, 3);
if (strstr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'fr')) {
header("Location: http://www.domain.com/fr".$str."");
exit;
} elseif (strstr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'de')) {
header("Location: http://www.domain.com/de".$str."");
exit;
.....
} else {
header("Location: http://www.domain.com/en".$str."");
exit;
}
}
Re: Multiple Languages
if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) $_SERVER['HTTP_ACCEPT_LANGUAGE'] = '';
Don't forget to run script update
Re: Multiple Languages
One last error i get:
PHP Notice: Undefined index: force_lng in /data/www/domain.com/html/scj/cgi/common.php on line 20
Line 20 is:
PHP Notice: Undefined index: force_lng in /data/www/domain.com/html/scj/cgi/common.php on line 20
Code: Select all
if (!isset($_SERVER['HTTP_REFERER'])) $_SERVER['HTTP_REFERER'] = '';
if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) $_SERVER['HTTP_ACCEPT_LANGUAGE'] = '';
if (!strstr($_SERVER['HTTP_REFERER'], 'domain.com') and !$_GET['force_lng']) {
$str = $_SERVER['REQUEST_URI']; $str2 = substr($str, 3);
if (strstr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'fr')) {
header("Location: http://www.domain.com/fr".$str."");
exit;
} elseif (strstr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'de')) {
header("Location: http://www.domain.com/de".$str."");
exit;
....
} else {
header("Location: http://www.domain.com/en".$str."");
exit;
}
}
Code: Select all
if (!strstr($_SERVER['HTTP_REFERER'], 'domain.com') and !$_GET['force_lng']) {
Re: Multiple Languages
if (!isset($_GET['force_lng'])) $_GET['force_lng'] = '';
Don't forget to run script update