Advertisement:

Author Topic: language  (Read 1909 times)

Pigeon

  • Sr. Member
  • ****
  • Posts: 498
language
« on: November 07, 2015, 01:17:55 pm »
hey guys,
theme: modern

i created a page (lang.php) for language-selection and put it in public_html folder (osclass installed folder)
and put 3 links for 3 languages, (i just want, when i click on them, it redirects to main.php and change the language of website)

links:
Code: [Select]
<ul class="lang">
<li><a href=<?php echo osc_base_url() . "index.php?page=language&locale=en_US"?> target="_self">English</a></li>
<li><a href=<?php echo osc_base_url() . "index.php?page=language&locale=es_ES"?> target="_self">Spanish</a></li>
<li><a href=<?php echo osc_base_url() . "index.php?page=language&locale=it_IT"?> target="_self">Italian</a></li>
</ul>

but when i click on them, they do NOT work, it does NOT redirect to main.php

and when i remove the part of the link after (?), it works and it redirects to main.php but does NOT select a language:
Code: [Select]
<li><a href=<?php echo osc_base_url() . "index.php"?> target="_self">English Language</a></li>

what should i do to change the osclass language by clicking on a link in this page? i just want 3 links (like: english, spanish, italian) and when i click on one of them, it redirects to main.php and changes the language of the website
Thanks
« Last Edit: November 07, 2015, 01:46:03 pm by Pigeon »

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: language
« Reply #1 on: November 07, 2015, 04:16:28 pm »
@Pigeon
Reason why you are not going to homepage is in file:
oc-includes/osclass/controller/language.php

Here you have

           
Code: [Select]
$redirect_url = '';
            if($_SERVER['HTTP_REFERER'] != '') {
                $redirect_url = $_SERVER['HTTP_REFERER'];
            } else {
                $redirect_url = osc_base_url(true);
            }


If you replace this code with:
Code: [Select]
            $redirect_url = osc_base_url(true);

It should go everytime to home.
Did not tested.

Pigeon

  • Sr. Member
  • ****
  • Posts: 498
Re: language
« Reply #2 on: November 07, 2015, 11:30:34 pm »
@Pigeon
Reason why you are not going to homepage is in file:
oc-includes/osclass/controller/language.php

Here you have

           
Code: [Select]
$redirect_url = '';
            if($_SERVER['HTTP_REFERER'] != '') {
                $redirect_url = $_SERVER['HTTP_REFERER'];
            } else {
                $redirect_url = osc_base_url(true);
            }


If you replace this code with:
Code: [Select]
            $redirect_url = osc_base_url(true);

It should go everytime to home.
Did not tested.

frosticek,
thank you very much, it worked, i appreciate it.
but would you explain me this code?, whats its job? maybe i have a problem later if i remove that. thank you again for helping
           
Code: [Select]
$redirect_url = '';
            if($_SERVER['HTTP_REFERER'] != '') {
                $redirect_url = $_SERVER['HTTP_REFERER'];
            } else {
                $redirect_url = osc_base_url(true);
            }

Pigeon

  • Sr. Member
  • ****
  • Posts: 498
Re: language
« Reply #3 on: November 07, 2015, 11:36:18 pm »
frosticek,
i found its job
if i replace that code, then when i change the language of website on other page like item.php, it redirects to main.php, and that's not good
lets find another way
thanks

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: language
« Reply #4 on: November 09, 2015, 05:43:13 pm »
@Pigeon
It is core change so I am not going to look more into it. What I know is that this code should set redirect page after language changed on any page of osclass installation.

Pigeon

  • Sr. Member
  • ****
  • Posts: 498
Re: language
« Reply #5 on: November 10, 2015, 12:07:16 pm »
@Pigeon
It is core change so I am not going to look more into it. What I know is that this code should set redirect page after language changed on any page of osclass installation.

frosticek,
as i told you , if i change that code to your code, it redirects to main.php page if i change language in any pages in osclass
for example, it redirects to main.php page if i change language in item.php or public-profile page
what we want is, to stay on the same page when we change the language, and also redirects to main.php when i click on language link on (lang.php) as i described in my first post
thanks frosticek

Pigeon

  • Sr. Member
  • ****
  • Posts: 498
Re: language
« Reply #6 on: December 07, 2015, 11:41:36 am »
no one?

Pigeon

  • Sr. Member
  • ****
  • Posts: 498
Re: language
« Reply #7 on: December 11, 2015, 01:53:27 am »
there is no developer in this forum? here used to have couple developers, where are they?

Pigeon

  • Sr. Member
  • ****
  • Posts: 498
Re: language
« Reply #8 on: December 14, 2015, 02:55:17 am »
...
« Last Edit: December 14, 2015, 06:46:21 am by Pigeon »