Page 1 of 1
Переменная с текущим URL'ом
Posted: Sat Jun 10, 2017 3:40 pm
by burn
Здравствуйте,
возможно добавить переменную с текущим URL'ом ?
Хотим сделать переключение на нужный язык без переброса в корень сайта, т.е. если открыта галера и выбираешь другой язык, нужно чтобы только сменился язык, а страница осталась прежней.
Или подскажите как это можно сделать ?
Re: Переменная с текущим URL'ом
Posted: Sat Jun 10, 2017 4:00 pm
by admin
<? print_r($_GET); ?>
список всех переменных которые получает скрипт из урла
тагом можно вывести как
<!--GET_varname-->
Re: Переменная с текущим URL'ом
Posted: Tue Jun 13, 2017 2:15 pm
by filthlab
Hi,
I have the same problem here - when changing the language the visitor should stay on the same page, just the language should be changed, for instance if the visitor is here:
http://filthlab.com/category/Amateur/ctr/3/
and change the language to DE, he/she should be just redirected to:
http://filthlab.com/de/category/Amateur/ctr/3/
Can't see how
<? print_r($_GET); ?>
will help for this
Re: Переменная с текущим URL'ом
Posted: Tue Jun 13, 2017 4:27 pm
by admin
When you do <? print_r($_GET); ?> for
http://filthlab.com/category/Amateur/ctr/3/
you'll see something like
group_name = Amateur
order= ctr
page = 3
so it's easy to create a link like
/de/category/<!--GET_group_name-->/<!--GET_order-->/<!--GET_page-->/
this way you can create any link for example you'd like to have links like
http://filthlab.com/c-Amateur-ctr-3/ - all you have to do is to change template and that's it, so need to change the script.
Re: Переменная с текущим URL'ом
Posted: Wed Jun 14, 2017 12:07 pm
by filthlab
This will work for /categories/ dir only. Is there a way to define where the surfer is - mainpage, /categories/, /tube/, search?
Also, when some or all of the <!--GET_group_name-->/<!--GET_order-->/<!--GET_page--> is empty we will get invalid url.
Re: Переменная с текущим URL'ом
Posted: Wed Jun 14, 2017 3:30 pm
by admin
You can get this from $_SERVER for example
or <!--CURRENT_TEMPLATE-->
or just pass any extra variable in rewrites like &page_prefix=category and then use it in template like /<!--GET_page_prefix-->