News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Language Drop Down for Guests

Started by AhmedaBahrain, January 29, 2016, 06:19:00 AM

Previous topic - Next topic

AhmedaBahrain

I am using this modification:

http://custom.simplemachines.org/mods/index.php?mod=598

And I've worked around with it to work with the latest version of the Simple Machines Forums, but there is only one issue I'm facing now. And the issue is that in the code (Load.php):

// Language Drop Down Checking.
if (isset($_POST['language']))
{
if (empty($context['languages']))
$languages = getLanguages();

// Silly me, we can't set languages for guests :D
if (!empty($user_info['id']) && isset($languages[$_POST['language']]))
{
updateMemberData($user_info['id'], array('lngfile' => $_POST['language']));
$user_info['language'] = $_POST['language'];
$_SESSION['language'] = $user_info['language'];
}
elseif (isset($languages[$_POST['language']]))
$user_info['language'] = $_POST['language'];
}


If you're a guest, then you're able to change the language on POST request, but then on refresh it's back to the default language. I'm pretty sure it's because you can't updateMemberData for guests, but I wanted to know if there is another tweak to get this to work for guests too?

Thank you.

Kindred

mod specific questions should be asked in the thread dedicated to supporting that specific mod....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

AhmedaBahrain

Quote from: Kindred on January 29, 2016, 06:35:32 AM
mod specific questions should be asked in the thread dedicated to supporting that specific mod....
I'm positive there will be no answer for a while, so I'm trying to find a way around it. Since the mod is out-dated, I'm trying to add my on way of doing this by editing the mod here and there.

Can anyone help me please?  :(

Kindred

and yet, that does not change the fact that we do not support MODS here...   mod support is the responsibility of the mod author - and often finds help from other users of the mod.

Asking here is less than useful. because 99% of us have never even looked at that mod -- which is why you SHOULD be asking for help in the support topic for the mod -- because the people there HAVE looked at (and most often used) that mod.



so, I say again... your question should be posed here: http://www.simplemachines.org/community/index.php?topic=139200.0

if there is no support for the mod, perhaps you should start looking for another mod?
maybe http://custom.simplemachines.org/mods/index.php?mod=2705
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: