I create a form with name lang-form and an action inside the folder actions/user

Dimitris Kerestetzis Posted in Beginning Developers 8 years ago

I create a form with name lang-form and an action inside the folder actions/user/lang.php
I register the action inside the file libraries/ossn.lib.initialize.php

ossn_register_action('user/lang', ossn_route()->actions . 'user/lang.php');

The form and action works only when the user is offline.....when a user make login the form and action dont work.
Can someone help? :/

Replies
gr Dimitris Kerestetzis Replied 8 years ago

Zet man,

I want to create a language switcher.
I have register the greek language, with the english language which is default in ossn.
What you suggest ???
I have to create a component for that?
Its more easily way?

German Michael Zülsdorff Replied 8 years ago

Dimitris,

you're still trying to change core files which is definitely the wrong way as Arsalan told you already 3 days ago.
The chance of getting help is much better if you make your code part of a loadable component and make it available on Github. Things like ossn_register_action can be easily called from the component's ossn_com.php, there's absolutely no need to change the core library.

gr Dimitris Kerestetzis Replied 8 years ago

And inside the action the code is

 if(isset($_POST['sitelang'])){

 $settings = new OssnDatabase;
 $sitelang = input('sitelang');

 ossn_site_setting_update('lang', $sitelang, 3);

 redirect(REF);

}