What is $context['utf8'] equivalent code in EA, if any? It is reported as an undefined error.
If I got it right, $context['convert_utf8'] in SMF is true if the forum is configured to use UTF-8, false otherwise.
ElkArte is UTF8-only, so I guess we just dropped the variable because pointless (in the sense that it shall be always true).
I know EA is UTF-8 only as I was asking about this charset last time, but for social login addon (that I am converting) it will get data from the social media API which may not be in UTF-8 form, thus that need to be converted to UTF-8. Thus, there is a need for that, at least to be added to the addon.
Can you point me where or how do I create this UTF-8 check as I am not so sure how to do it?
All the relevant code I can find regarding to UTF-8 is:
// Encode.
if (!$context['utf-8'])
{
$regOptions ['extra_register_vars'] ['location'] = utf8_decode($regOptions ['extra_register_vars'] ['location']);
$regOptions ['extra_register_vars'] ['real_name'] = utf8_decode($regOptions ['extra_register_vars'] ['real_name']);
$regOptions ['extra_register_vars'] ['personal_text'] = utf8_decode($regOptions ['extra_register_vars'] ['personal_text']);
$regOptions ['username'] = utf8_decode($regOptions ['username']);
}
now, this reads "if the forum is not using UTF-8, then let's take the response from the server and
convert it from UTF-8 to ISO-8859-1 (http://php.net/manual/en/function.utf8-decode.php).
Elk is UTF-8, so $context['utf-8'] would always be true, and that block of code would never be executed.
So it's pointless to have, just remove it altogether. ;)
Is there anything else I missed?
I do believe that's data that I am talking about and it is taken from the social media sites for the forum. That particular option is available in the OneAll control panel/settings. There is no point on taking it from the forum for media sites. But I may be wrong.
Anyway, that is not a main issue for me to make it work but the ip address. For this utf-8 undefined error, I think I could uncomment it temporarily.
I think you lost me here, but I'll try with a wild guess.
The bit of code comes from the addon.
The $context['utf-8'] comes from SMF.
The data in $regOptions come from... I guess from OneAll server (at least in part, not sure because I never used it).
But anyway, the important bit that is the utf-8 is from SMF.
Posted there. :)
I'm not sure about uncommenting, comment the entire block out, yes. Comment out only the "if" line I would say it's not a good idea. But again I never used or tried so I can't be entirely sure.