Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Tokzu on September 02, 2014, 09:48:36 PM

Title: Language On Register
Post by: Tokzu on September 02, 2014, 09:48:36 PM
Link al mod (http://custom.simplemachines.org/mods/index.php?mod=3918)

Language On Register v1.0
by Kaero Webs (http://www.kaerowebs.com)

Demo (http://demo1.kaerowebs.com/index.php?action=register) || Support Board (http://www.kaerowebs.com/index.php?board=9.0) || Online Manual (http://wiki.kaerowebs.com/kw/Language_On_Register:Main_Page) || Changelog (http://wiki.kaerowebs.com/kw/Language_On_Register:Main_Page#Changelog)

(https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif) (https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9LXCEDBQZSVT6&lc=MX&item_name=Language%20On%20Register&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)




Description
Language On Register (or LORegister) is a modification that allows the new users to select their prefered language when they register.




Compatibility
LORegister is compatible with SMF 2.0.X, any previous version is not supported.




Languages




Features




Changelog v1.0 (18/08/2014)
Legend: !Bugfix +New -Removed *Modified
* Initial release.




(http://i.creativecommons.org/l/by-sa/4.0/88x31.png) (http://creativecommons.org/licenses/by-sa/4.0/)
Fanfics System by Kaero Webs (http://www.kaerowebs.com) is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (http://creativecommons.org/licenses/by-sa/4.0/).


Title: Re: Language On Register
Post by: Ninja ZX-10RR on October 23, 2014, 02:58:29 PM
I can't manage to make the 2nd edit to this file successfully, it fails, I tried to edit it but I got a blank screen  O:) would you kindly help me please? :) The code to be added is this one:
Code (find, but there isn't anymore, maybe for updates idk) Select
echo '
</fieldset>
<span class="botslice"><span></span></span>
</div>';

// If we have either of these, show the extra group.


Code (add before) Select
if (!empty($modSettings['userLanguage']) && !empty($modSettings['loregister_show']) && $modSettings['loregister_show'] == 1)
{
loadlanguage('Profile');

echo '
<dl class="register_form" id="language_group">
<dt>
<strong><label for="lngfile">', $txt['preferred_language'], ':</label></strong>
</dt>
<dd>
<select id="lngfile" name="lngfile">';

if (empty($context['languages']))
getLanguages();

foreach ($context['languages'] as $key => $lang)
echo '
<option value="', $key, '" ', ($key == $language) ? 'selected="selected" ' : '', '>', str_replace('-utf8', '', $lang['name']), '</option>';

echo '
</select>
</dd>
</dl>';
}

Title: Re: Language On Register
Post by: Shambles on October 23, 2014, 03:20:47 PM
It's at line 268 of the file you submitted
Title: Re: Language On Register
Post by: Ninja ZX-10RR on October 23, 2014, 04:30:45 PM
..............................And then I realize that I posted the file I had edited to match the default theme and then again I realize that the mod works with the edited file... Ok, I need more sleep. Thanks Shambles for letting me know xD
Title: Re: Language On Register
Post by: Shambles on October 23, 2014, 05:30:07 PM
So you owe me 45 seconds of my life.

I want it back now.

Right Now. I take paypal.
Title: Re: Language On Register
Post by: Ninja ZX-10RR on October 23, 2014, 05:30:52 PM
(http://www.katzy.dsl.pipex.com/Smileys/a043.gif)
        Ninja-Shambles

:P
Title: Re: Language On Register
Post by: Apllicmz on November 09, 2014, 11:21:48 AM
Nice Work
when Update dont forget portuguese files

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
$txt['loregister_show'] = 'Solicite idioma no registo';
$txt['loregister_disabled'] = 'Desactivado';
$txt['loregister_required'] = 'Informa&ccedil;&otilde;es necess&aacute;rias na Sec&ccedil;&atilde;o';
$txt['loregister_additional'] = 'Informa&ccedil;&otilde;es adicionais na Sec&ccedil;&atilde;o';
]]></add>
        </operation>
    </file>
    <file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
$txt['loregister_show'] = 'Solicite idioma no registo';
$txt['loregister_disabled'] = 'Desactivado';
$txt['loregister_required'] = 'Informa&ccedil;&otilde;es necess&aacute;rias na Sec&ccedil;&atilde;o';
$txt['loregister_additional'] = 'Informa&ccedil;&otilde;es adicionais na Sec&ccedil;&atilde;o';
]]></add>
        </operation>
    </file>

Title: Re: Language On Register
Post by: Tokzu on November 09, 2014, 11:33:10 AM
Quote from: Joomlamz on November 09, 2014, 11:21:48 AM
Nice Work
when Update dont forget portuguese files

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
$txt['loregister_show'] = 'Solicite idioma no registo';
$txt['loregister_disabled'] = 'Desactivado';
$txt['loregister_required'] = 'Informa&ccedil;&otilde;es necess&aacute;rias na Sec&ccedil;&atilde;o';
$txt['loregister_additional'] = 'Informa&ccedil;&otilde;es adicionais na Sec&ccedil;&atilde;o';
]]></add>
        </operation>
    </file>
    <file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
$txt['loregister_show'] = 'Solicite idioma no registo';
$txt['loregister_disabled'] = 'Desactivado';
$txt['loregister_required'] = 'Informa&ccedil;&otilde;es necess&aacute;rias na Sec&ccedil;&atilde;o';
$txt['loregister_additional'] = 'Informa&ccedil;&otilde;es adicionais na Sec&ccedil;&atilde;o';
]]></add>
        </operation>
    </file>



Thanks Joomlamz, I'll include it on the next update. ;D
Title: Re: Language On Register
Post by: Ninja ZX-10RR on December 05, 2014, 05:07:12 PM
It would be quite cool to list the languages in alphabetical order, especially if there are many... I just realized that they are all ordered in a way that I can't understand.

EDIT: nvm I got it.
Title: Re: Language On Register
Post by: Tokzu on December 07, 2014, 10:49:04 AM
Yes, the languages are in alphabetical order based on english language.
Title: Re: Language On Register
Post by: Ninja ZX-10RR on December 07, 2014, 11:20:25 AM
They weren't at all, actually. I had to add one more string (a ksort) to make them show up like that.
Ref: http://www.italiansmf.net/forum/index.php?topic=1231.0
Title: Re: Language On Register
Post by: Tokzu on December 07, 2014, 11:33:25 AM
Oh, ok. I'll fix this on the next version. Thanks for appoint this. :D
Title: Re: Language On Register
Post by: Ninja ZX-10RR on December 07, 2014, 11:35:16 AM
Np :) oh btw to be clear I added the first string mentioned before the second mentioned in that topic, since it's italian it might have been unclear ;)

Yep it's good especially if you have all languages installed like me ;D
Title: Re: Language On Register
Post by: Tokzu on December 07, 2014, 11:45:03 AM
Yeah, I don't understand italian but only for the code I interpretdd it has to be before the foreach. (the php coding is an universal language :P)