News:

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

Main Menu

Country Flags para smf 1.3

Started by Hostx, August 22, 2007, 10:40:18 AM

Previous topic - Next topic

Hostx

Instalei este pacote/mod: http://custom.simplemachines.org/mods/index.php?mod=417

E foi instalado com sucesso, só que o mais estranho é que não encontro as definições do mesmo.

Já procurei em todos os separadores e não encontrei.

Vi que era compativel com as versoes 1.1 e 1.2 (o meu software é smf 1.3)... será que é por causa da incompatibilidade?
Visitem o novo Fórum de Tugas, agora é Tuga Web Fórum - http://www.tugawebforum.empiresp.com [nofollow]

Obrigado

panzetti

não seria talvez a versão de lingua?
André Panzetti
www.shotgames.com.br

Hostx

Quote from: panzetti on August 22, 2007, 10:57:52 AM
não seria talvez a versão de lingua?

Como assim?... só funciona com o idioma ingles?
Visitem o novo Fórum de Tugas, agora é Tuga Web Fórum - http://www.tugawebforum.empiresp.com [nofollow]

Obrigado

Hostx

Visitem o novo Fórum de Tugas, agora é Tuga Web Fórum - http://www.tugawebforum.empiresp.com [nofollow]

Obrigado

panzetti

olha geralmente vem os arquivos que fazem modificações em algum arquivo .linguagem

exemplo

arcade que eu uso

tem o seu proprio arcade.english.php eu criei um arcade.brazilian.php com o mesmo conteudo do arcade.english.php , ai começou a aparecer no meu forum...
André Panzetti
www.shotgames.com.br

Hostx

#5
podes-me dizer como criaste esse tal arcade.brasilian? dava jeito para mim era countryflags.portugal

Bastou clicar em rename?

Não estou a perceber...
Visitem o novo Fórum de Tugas, agora é Tuga Web Fórum - http://www.tugawebforum.empiresp.com [nofollow]

Obrigado

panzetti

Exemplo no original ele criou o seguinite arquivo

arcade.english.php

como meu tema esta em portugues brasil então eu criei

arcade.brazilian.php (com o mesmo conteudo do english)

desta forma começou a aparecer a o conteudo no forum!
André Panzetti
www.shotgames.com.br

Hostx

COnsegui!! não foi bem como disseste panzetti, mas sem essa explicação tbm nao chegava lá.

Portanto temos o código:

<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>jaybachatero:country_flags</id>
<version>1.0.1</version>

<file name="$sourcedir/Register.php">
<operation>
<search position="before"><![CDATA[ fatal_lang_error('under_age_registration_prohibited', false, array($modSettings['coppaAge']));
}
]]></search>
<add><![CDATA[
// Convert the $_POST['country'] to $_POST['default_options']['country']
if (isset($_POST['country']))
{
$_POST['default_options']['country'] = $_POST['country'];

// Check if it's required to select location
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
fatal_lang_error('country_flag_required', false);
}
]]></add>
</operation>
</file>

<file name="$sourcedir/Subs.php">
<operation>
<search position="end" />
<add><![CDATA[
function CountryFlag()
{
$flags = array(
'af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria',
'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola',
'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua and Barbuda',
'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba',
'au' => 'Australia', 'at' => 'Austria', 'az' => 'Azerbaijan',
'bs' => 'Bahamas', 'bh' => 'Bahrain', 'bd' => 'Bangladesh',
'bb' => 'Barbados', 'by' => 'Belarus', 'be' => 'Belgium',
'bz' => 'Belize', 'bj' => 'Benin', 'bm' => 'Bermuda',
'bt' => 'Bhutan', 'bo' => 'Bolivia', 'ba' => 'Bosnia and Herzegovina',
'bw' => 'Botswana', 'bv' => 'Bouvet Island', 'br' => 'Brazil',
'io' => 'British Indian Ocean Territory', 'bn' => 'Brunei Darussalam', 'bg' => 'Bulgaria',
'bf' => 'Burkina Faso', 'bi' => 'Burundi', 'kh' => 'Cambodia',
'cm' => 'Cameroon', 'ca' => 'Canada', 'cv' => 'Cape Verde',
'ky' => 'Cayman Islands', 'cf' => 'Central African Republic', 'td' => 'Chad',
'cl' => 'Chile', 'cn' => 'China', 'cx' => 'Christmas Island',
'cc' => 'Cocos (Keeling) Islands', 'co' => 'Colombia', 'km' => 'Comoros',
'cg' => 'Congo, Republic of the', 'cd' => 'Congo, The Democratic Republic of the', 'ck' => 'Cook Islands',
'cr' => 'Costa Rica', 'ci' => 'Côte d\'Ivoire', 'hr' => 'Croatia',
'cu' => 'Cuba', 'cy' => 'Cyprus', 'cz' => 'Czech Republic',
'dk' => 'Denmark', 'dj' => 'Djibouti', 'dm' => 'Dominica',
'do' => 'Dominican Republic', 'ec' => 'Ecuador', 'eg' => 'Egypt',
'sv' => 'El Salvador', 'gq' => 'Equatorial Guinea', 'er' => 'Eritrea',
'ee' => 'Estonia', 'et' => 'Ethiopia', 'fk' => 'Falkland Islands (Islas Malvinas)',
'fo' => 'Faroe Islands', 'fj' => 'Fiji', 'fi' => 'Finland',
'fr' => 'France', 'gf' => 'French Guiana', 'pf' => 'French Polynesia',
'tf' => 'French Southern Territories', 'ga' => 'Gabon', 'gm' => 'Gambia',
'ge' => 'Georgia', 'de' => 'Germany', 'gh' => 'Ghana',
'gi' => 'Gibraltar', 'gr' => 'Greece', 'gl' => 'Greenland',
'gd' => 'Grenada', 'gp' => 'Guadeloupe', 'gu' => 'Guam',
'gt' => 'Guatemala', 'gn' => 'Guinea', 'gw' => 'Guinea-Bissau',
'gy' => 'Guyana', 'ht' => 'Haiti', 'hm' => 'Heard Island and McDonald Islands',
'va' => 'Vatican City State', 'hn' => 'Honduras', 'hk' => 'Hong Kong',
'hu' => 'Hungary', 'is' => 'Iceland', 'in' => 'India',
'id' => 'Indonesia', 'ir' => 'Iran, Islamic Republic of', 'iq' => 'Iraq',
'ie' => 'Ireland, Republic of', 'il' => 'Israel', 'it' => 'Italy',
'jm' => 'Jamaica', 'jp' => 'Japan', 'jo' => 'Jordan',
'kz' => 'Kazakhstan', 'ke' => 'Kenya', 'ki' => 'Kiribati',
'kp' => 'Korea, Democratic People\'s Republic of', 'kr' => 'Korea, Republic of', 'kw' => 'Kuwait',
'kg' => 'Kyrgyzstan', 'la' => 'Lao People\'s Democratic Republic', 'lv' => 'Latvia',
'lb' => 'Lebanon', 'ls' => 'Lesotho', 'lr' => 'Liberia',
'ly' => 'Libyan Arab Jamahiriya', 'li' => 'Liechtenstein', 'lt' => 'Lithuania',
'lu' => 'Luxembourg', 'mo' => 'Macao', 'mk' => 'Macedonia, The Former Yugoslav Republic of',
'mg' => 'Madagascar', 'mw' => 'Malawi', 'my' => 'Malaysia',
'mv' => 'Maldives', 'ml' => 'Mali', 'mt' => 'Malta',
'mh' => 'Marshall Islands', 'mq' => 'Martinique', 'mr' => 'Mauritania',
'mu' => 'Mauritius', 'yt' => 'Mayotte', 'mx' => 'Mexico',
'fm' => 'Micronesia, Federated States of', 'md' => 'Moldova, Republic of', 'mc' => 'Monaco',
'mn' => 'Mongolia', 'ms' => 'Montserrat', 'ma' => 'Morocco',
'mz' => 'Mozambique', 'mm' => 'Myanmar', 'na' => 'Namibia',
'nr' => 'Nauru', 'np' => 'Nepal', 'nl' => 'Netherlands',
'an' => 'Netherlands Antilles', 'nc' => 'New Caledonia', 'nz' => 'New Zealand',
'ni' => 'Nicaragua', 'ne' => 'Niger', 'ng' => 'Nigeria',
'nu' => 'Niue', 'nf' => 'Norfolk Island', 'mp' => 'Northern Mariana Islands',
'no' => 'Norway', 'om' => 'Oman', 'pk' => 'Pakistan',
'pw' => 'Palau', 'ps' => 'Palestinian Territory, Occupied', 'pa' => 'Panama',
'pg' => 'Papua New Guinea', 'py' => 'Paraguay', 'pe' => 'Peru',
'ph' => 'Philippines', 'pn' => 'Pitcairn', 'pl' => 'Poland',
'pt' => 'Portugal', 'pr' => 'Puerto Rico', 'qa' => 'Qatar',
're' => 'Reunion', 'ro' => 'Romania', 'ru' => 'Russian Federation',
'rw' => 'Rwanda', 'sh' => 'Saint Helena', 'kn' => 'Saint Kitts and Nevis',
'lc' => 'Saint Lucia', 'pm' => 'Saint Pierre and Miquelon', 'vc' => 'Saint Vincent and the Grenadines',
'ws' => 'Samoa', 'sm' => 'San Marino', 'st' => 'Sao Tome and Principe',
'sa' => 'Saudi Arabia', 'sn' => 'Senegal', 'cs' => 'Serbia and Montenegro',
'sc' => 'Seychelles', 'sl' => 'Sierra Leone', 'sg' => 'Singapore',
'sk' => 'Slovakia', 'si' => 'Slovenia', 'sb' => 'Solomon Islands',
'so' => 'Somalia', 'za' => 'South Africa', 'gs' => 'South Georgia and the South Sandwich Islan',
'es' => 'Spain', 'lk' => 'Sri Lanka', 'sd' => 'Sudan',
'sr' => 'Suriname', 'sj' => 'Svalbard and Jan Mayen', 'sz' => 'Swaziland',
'se' => 'Sweden', 'ch' => 'Switzerland', 'sy' => 'Syrian Arab Republic',
'tw' => 'Taiwan', 'tj' => 'Tajikistan', 'tz' => 'Tanzania, United Republic of',
'th' => 'Thailand', 'tl' => 'Timor-Leste', 'tg' => 'Togo',
'tk' => 'Tokelau', 'to' => 'Tonga', 'tt' => 'Trinidad and Tobago',
'tn' => 'Tunisia', 'tr' => 'Turkey', 'tm' => 'Turkmenistan',
'tc' => 'Turks and Caicos Islands', 'tv' => 'Tuvalu', 'ug' => 'Uganda',
'ua' => 'Ukraine', 'ae' => 'United Arab Emirates', 'gb' => 'United Kingdom',
'us' => 'United States', 'um' => 'United States Minor Outlying Islands', 'uy' => 'Uruguay',
'uz' => 'Uzbekistan', 'vu' => 'Vanuatu', 've' => 'Venezuela',
'vn' => 'Viet Nam', 'vg' => 'Virgin Islands, British', 'vi' => 'Virgin Islands, U.S.',
'wf' => 'Wallis and Futuna', 'eh' => 'Western Sahara', 'ye' => 'Yemen',
'zm' => 'Zambia', 'zw' => 'Zimbabwe',
);
return $flags;
}
]]></add>
</operation>
</file>

<file name="$sourcedir/ModSettings.php">
<operation>
<search position="before"><![CDATA[ // Reporting of personal messages?
array('check', 'enableReportPM'),
]]></search>
<add><![CDATA[
'',
// Show flags
array('select', 'country_flag_ask', array($txt['country_flag_disabled'], $txt['country_flag_profile'], $txt['country_flag_registration'], $txt['country_flag_both'])),
array('check', 'country_flag_required'),
array('check', 'country_flag_show'),
]]></add>
</operation>
</file>

<file name="$sourcedir/Profile.php">
<operation>
<search position="after"><![CDATA[
$erase_options = array();
if (isset($_POST['default_options']) && is_array($_POST['default_options']))
]]></search>
<add><![CDATA[
// Convert the $_POST['country'] to $_POST['default_options']['country']
if (isset($_POST['country']))
{
$_POST['default_options']['country'] = $_POST['country'];

// Check if it's required to select location
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
fatal_lang_error('country_flag_error_required', false);
}
]]></add>
</operation>
</file>

<file name="$themedir/Register.template.php">
<operation>
<search position="after"><![CDATA[ // Are there age restrictions in place?
if (!empty($modSettings['coppaAge']))
]]></search>
<add><![CDATA[
// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3)
{
// Call the function that has all the flag info
$flags = CountryFlag();

echo '
<script language="JavaScript" type="text/javascript">
function showflags()
{
document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<tr>
<td width="40%" align="top">
<b>', $txt['country_flag_label'], ':</b>
</td>
<td>
<select name="country" onchange="showflags()">
<option value=""></option>';

// Loop and show the drop down.
foreach ($flags as $key => $name)
echo '
<option value="', $key, '">', $name, '</option>';

echo '
</select>
<img id="flags" src="', $settings['default_theme_url'], '/images/blank.gif" width="25" height="15" align="top" />
</td>
</tr>';
}
]]></add>
</operation>
</file>

<file name="$themedir/Profile.template.php">
<operation>
<search position="replace"><![CDATA[ <td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>
<tr>
<td width="40%"><b>', $txt[231], ': </b></td>
]]></search>
<add><![CDATA[ <td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>';

// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 1 || $modSettings['country_flag_ask'] == 3)
{
// Call the function that has all the flag info
$flags = CountryFlag();

echo '
<script language="JavaScript" type="text/javascript">
function showflags()
{
document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<tr>
<td width="40%" align="top">
<b>', $txt['country_flag_label'], ':</b>
</td>
<td>
<select name="country" onchange="showflags()">
<option value=""></option>';

// Loop and show the drop down.
foreach ($flags as $key => $name)
echo '
<option value="', $key, '" ', isset($context['member']['options']['country']) &&  $context['member']['options']['country'] == $key ? 'selected="selected"' : '', '>', $name, '</option>';

echo '
</select>
<img id="flags" src="', $settings['default_theme_url'], '/images/', isset($context['member']['options']['country']) && !empty($context['member']['options']['country']) ? 'flags/' . $context['member']['options']['country'] . '.png': 'blank.gif', '" width="25" height="15" align="top" />
</td>
</tr>';
}

echo '
<tr>
<td width="40%"><b>', $txt[231], ': </b></td>
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ </tr><tr>
<td><b>', $txt[227], ':</b></td>
<td>', $context['member']['location'], '</td>
</tr><tr>
]]></search>
<add><![CDATA[ </tr><tr>
<td><b>', $txt[227], ':</b></td>
<td>', $context['member']['location'], '</td>
</tr><tr>
<td><b>', $txt['country_flag'], ':</b></td>
<td>';

// Did they select a flag?
if(isset($context['member']['options']['country']) && !empty($context['member']['options']['country']))
{
$flags = CountryFlag();
echo
$flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
}

echo '
</td>
</tr><tr>
]]></add>
</operation>
</file>

<file name="$themedir/Display.template.php">
<operation>
<search position="before"><![CDATA[
// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
echo '
', $txt[231], ': ', $message['member']['gender']['image'], '<br />';
]]></search>
<add><![CDATA[
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
]]></add>
</operation>
</file>

<file name="$boarddir/Themes/babylon/Display.template.php">
<operation>
<search position="before"><![CDATA[
// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
echo '
', $txt[231], ': ', $message['member']['gender']['image'], '<br />';
]]></search>
<add><![CDATA[
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
]]></add>
</operation>
</file>

<file name="$languagedir/Modifications.english.php">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Please select your country';
$txt['country_flag_error_required'] = 'You must select the country that you visit us from';
$txt['country_flag_ask'] = 'Ask for country flag on';
$txt['country_flag_disabled'] = 'Don\'t show (Disabled)';
$txt['country_flag_profile'] = 'Profile';
$txt['country_flag_registration'] = 'Registration';
$txt['country_flag_both'] = 'Both';
$txt['country_flag_required'] = 'Require a member to select a location?';
$txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).';
$txt['country_flag'] = 'Country';
]]></add>
</operation>
</file>
</modification>


alterasse o <file name="$languagedir/Modifications.english.php"> para <file name="$languagedir/Modifications.portuguese.php">

e fica assim:

<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>jaybachatero:country_flags</id>
<version>1.0.1</version>

<file name="$sourcedir/Register.php">
<operation>
<search position="before"><![CDATA[ fatal_lang_error('under_age_registration_prohibited', false, array($modSettings['coppaAge']));
}
]]></search>
<add><![CDATA[
// Convert the $_POST['country'] to $_POST['default_options']['country']
if (isset($_POST['country']))
{
$_POST['default_options']['country'] = $_POST['country'];

// Check if it's required to select location
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
fatal_lang_error('country_flag_required', false);
}
]]></add>
</operation>
</file>

<file name="$sourcedir/Subs.php">
<operation>
<search position="end" />
<add><![CDATA[
function CountryFlag()
{
$flags = array(
'af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria',
'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola',
'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua and Barbuda',
'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba',
'au' => 'Australia', 'at' => 'Austria', 'az' => 'Azerbaijan',
'bs' => 'Bahamas', 'bh' => 'Bahrain', 'bd' => 'Bangladesh',
'bb' => 'Barbados', 'by' => 'Belarus', 'be' => 'Belgium',
'bz' => 'Belize', 'bj' => 'Benin', 'bm' => 'Bermuda',
'bt' => 'Bhutan', 'bo' => 'Bolivia', 'ba' => 'Bosnia and Herzegovina',
'bw' => 'Botswana', 'bv' => 'Bouvet Island', 'br' => 'Brazil',
'io' => 'British Indian Ocean Territory', 'bn' => 'Brunei Darussalam', 'bg' => 'Bulgaria',
'bf' => 'Burkina Faso', 'bi' => 'Burundi', 'kh' => 'Cambodia',
'cm' => 'Cameroon', 'ca' => 'Canada', 'cv' => 'Cape Verde',
'ky' => 'Cayman Islands', 'cf' => 'Central African Republic', 'td' => 'Chad',
'cl' => 'Chile', 'cn' => 'China', 'cx' => 'Christmas Island',
'cc' => 'Cocos (Keeling) Islands', 'co' => 'Colombia', 'km' => 'Comoros',
'cg' => 'Congo, Republic of the', 'cd' => 'Congo, The Democratic Republic of the', 'ck' => 'Cook Islands',
'cr' => 'Costa Rica', 'ci' => 'Côte d\'Ivoire', 'hr' => 'Croatia',
'cu' => 'Cuba', 'cy' => 'Cyprus', 'cz' => 'Czech Republic',
'dk' => 'Denmark', 'dj' => 'Djibouti', 'dm' => 'Dominica',
'do' => 'Dominican Republic', 'ec' => 'Ecuador', 'eg' => 'Egypt',
'sv' => 'El Salvador', 'gq' => 'Equatorial Guinea', 'er' => 'Eritrea',
'ee' => 'Estonia', 'et' => 'Ethiopia', 'fk' => 'Falkland Islands (Islas Malvinas)',
'fo' => 'Faroe Islands', 'fj' => 'Fiji', 'fi' => 'Finland',
'fr' => 'France', 'gf' => 'French Guiana', 'pf' => 'French Polynesia',
'tf' => 'French Southern Territories', 'ga' => 'Gabon', 'gm' => 'Gambia',
'ge' => 'Georgia', 'de' => 'Germany', 'gh' => 'Ghana',
'gi' => 'Gibraltar', 'gr' => 'Greece', 'gl' => 'Greenland',
'gd' => 'Grenada', 'gp' => 'Guadeloupe', 'gu' => 'Guam',
'gt' => 'Guatemala', 'gn' => 'Guinea', 'gw' => 'Guinea-Bissau',
'gy' => 'Guyana', 'ht' => 'Haiti', 'hm' => 'Heard Island and McDonald Islands',
'va' => 'Vatican City State', 'hn' => 'Honduras', 'hk' => 'Hong Kong',
'hu' => 'Hungary', 'is' => 'Iceland', 'in' => 'India',
'id' => 'Indonesia', 'ir' => 'Iran, Islamic Republic of', 'iq' => 'Iraq',
'ie' => 'Ireland, Republic of', 'il' => 'Israel', 'it' => 'Italy',
'jm' => 'Jamaica', 'jp' => 'Japan', 'jo' => 'Jordan',
'kz' => 'Kazakhstan', 'ke' => 'Kenya', 'ki' => 'Kiribati',
'kp' => 'Korea, Democratic People\'s Republic of', 'kr' => 'Korea, Republic of', 'kw' => 'Kuwait',
'kg' => 'Kyrgyzstan', 'la' => 'Lao People\'s Democratic Republic', 'lv' => 'Latvia',
'lb' => 'Lebanon', 'ls' => 'Lesotho', 'lr' => 'Liberia',
'ly' => 'Libyan Arab Jamahiriya', 'li' => 'Liechtenstein', 'lt' => 'Lithuania',
'lu' => 'Luxembourg', 'mo' => 'Macao', 'mk' => 'Macedonia, The Former Yugoslav Republic of',
'mg' => 'Madagascar', 'mw' => 'Malawi', 'my' => 'Malaysia',
'mv' => 'Maldives', 'ml' => 'Mali', 'mt' => 'Malta',
'mh' => 'Marshall Islands', 'mq' => 'Martinique', 'mr' => 'Mauritania',
'mu' => 'Mauritius', 'yt' => 'Mayotte', 'mx' => 'Mexico',
'fm' => 'Micronesia, Federated States of', 'md' => 'Moldova, Republic of', 'mc' => 'Monaco',
'mn' => 'Mongolia', 'ms' => 'Montserrat', 'ma' => 'Morocco',
'mz' => 'Mozambique', 'mm' => 'Myanmar', 'na' => 'Namibia',
'nr' => 'Nauru', 'np' => 'Nepal', 'nl' => 'Netherlands',
'an' => 'Netherlands Antilles', 'nc' => 'New Caledonia', 'nz' => 'New Zealand',
'ni' => 'Nicaragua', 'ne' => 'Niger', 'ng' => 'Nigeria',
'nu' => 'Niue', 'nf' => 'Norfolk Island', 'mp' => 'Northern Mariana Islands',
'no' => 'Norway', 'om' => 'Oman', 'pk' => 'Pakistan',
'pw' => 'Palau', 'ps' => 'Palestinian Territory, Occupied', 'pa' => 'Panama',
'pg' => 'Papua New Guinea', 'py' => 'Paraguay', 'pe' => 'Peru',
'ph' => 'Philippines', 'pn' => 'Pitcairn', 'pl' => 'Poland',
'pt' => 'Portugal', 'pr' => 'Puerto Rico', 'qa' => 'Qatar',
're' => 'Reunion', 'ro' => 'Romania', 'ru' => 'Russian Federation',
'rw' => 'Rwanda', 'sh' => 'Saint Helena', 'kn' => 'Saint Kitts and Nevis',
'lc' => 'Saint Lucia', 'pm' => 'Saint Pierre and Miquelon', 'vc' => 'Saint Vincent and the Grenadines',
'ws' => 'Samoa', 'sm' => 'San Marino', 'st' => 'Sao Tome and Principe',
'sa' => 'Saudi Arabia', 'sn' => 'Senegal', 'cs' => 'Serbia and Montenegro',
'sc' => 'Seychelles', 'sl' => 'Sierra Leone', 'sg' => 'Singapore',
'sk' => 'Slovakia', 'si' => 'Slovenia', 'sb' => 'Solomon Islands',
'so' => 'Somalia', 'za' => 'South Africa', 'gs' => 'South Georgia and the South Sandwich Islan',
'es' => 'Spain', 'lk' => 'Sri Lanka', 'sd' => 'Sudan',
'sr' => 'Suriname', 'sj' => 'Svalbard and Jan Mayen', 'sz' => 'Swaziland',
'se' => 'Sweden', 'ch' => 'Switzerland', 'sy' => 'Syrian Arab Republic',
'tw' => 'Taiwan', 'tj' => 'Tajikistan', 'tz' => 'Tanzania, United Republic of',
'th' => 'Thailand', 'tl' => 'Timor-Leste', 'tg' => 'Togo',
'tk' => 'Tokelau', 'to' => 'Tonga', 'tt' => 'Trinidad and Tobago',
'tn' => 'Tunisia', 'tr' => 'Turkey', 'tm' => 'Turkmenistan',
'tc' => 'Turks and Caicos Islands', 'tv' => 'Tuvalu', 'ug' => 'Uganda',
'ua' => 'Ukraine', 'ae' => 'United Arab Emirates', 'gb' => 'United Kingdom',
'us' => 'United States', 'um' => 'United States Minor Outlying Islands', 'uy' => 'Uruguay',
'uz' => 'Uzbekistan', 'vu' => 'Vanuatu', 've' => 'Venezuela',
'vn' => 'Viet Nam', 'vg' => 'Virgin Islands, British', 'vi' => 'Virgin Islands, U.S.',
'wf' => 'Wallis and Futuna', 'eh' => 'Western Sahara', 'ye' => 'Yemen',
'zm' => 'Zambia', 'zw' => 'Zimbabwe',
);
return $flags;
}
]]></add>
</operation>
</file>

<file name="$sourcedir/ModSettings.php">
<operation>
<search position="before"><![CDATA[ // Reporting of personal messages?
array('check', 'enableReportPM'),
]]></search>
<add><![CDATA[
'',
// Show flags
array('select', 'country_flag_ask', array($txt['country_flag_disabled'], $txt['country_flag_profile'], $txt['country_flag_registration'], $txt['country_flag_both'])),
array('check', 'country_flag_required'),
array('check', 'country_flag_show'),
]]></add>
</operation>
</file>

<file name="$sourcedir/Profile.php">
<operation>
<search position="after"><![CDATA[
$erase_options = array();
if (isset($_POST['default_options']) && is_array($_POST['default_options']))
]]></search>
<add><![CDATA[
// Convert the $_POST['country'] to $_POST['default_options']['country']
if (isset($_POST['country']))
{
$_POST['default_options']['country'] = $_POST['country'];

// Check if it's required to select location
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
fatal_lang_error('country_flag_error_required', false);
}
]]></add>
</operation>
</file>

<file name="$themedir/Register.template.php">
<operation>
<search position="after"><![CDATA[ // Are there age restrictions in place?
if (!empty($modSettings['coppaAge']))
]]></search>
<add><![CDATA[
// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3)
{
// Call the function that has all the flag info
$flags = CountryFlag();

echo '
<script language="JavaScript" type="text/javascript">
function showflags()
{
document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<tr>
<td width="40%" align="top">
<b>', $txt['country_flag_label'], ':</b>
</td>
<td>
<select name="country" onchange="showflags()">
<option value=""></option>';

// Loop and show the drop down.
foreach ($flags as $key => $name)
echo '
<option value="', $key, '">', $name, '</option>';

echo '
</select>
<img id="flags" src="', $settings['default_theme_url'], '/images/blank.gif" width="25" height="15" align="top" />
</td>
</tr>';
}
]]></add>
</operation>
</file>

<file name="$themedir/Profile.template.php">
<operation>
<search position="replace"><![CDATA[ <td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>
<tr>
<td width="40%"><b>', $txt[231], ': </b></td>
]]></search>
<add><![CDATA[ <td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>';

// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 1 || $modSettings['country_flag_ask'] == 3)
{
// Call the function that has all the flag info
$flags = CountryFlag();

echo '
<script language="JavaScript" type="text/javascript">
function showflags()
{
document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<tr>
<td width="40%" align="top">
<b>', $txt['country_flag_label'], ':</b>
</td>
<td>
<select name="country" onchange="showflags()">
<option value=""></option>';

// Loop and show the drop down.
foreach ($flags as $key => $name)
echo '
<option value="', $key, '" ', isset($context['member']['options']['country']) &&  $context['member']['options']['country'] == $key ? 'selected="selected"' : '', '>', $name, '</option>';

echo '
</select>
<img id="flags" src="', $settings['default_theme_url'], '/images/', isset($context['member']['options']['country']) && !empty($context['member']['options']['country']) ? 'flags/' . $context['member']['options']['country'] . '.png': 'blank.gif', '" width="25" height="15" align="top" />
</td>
</tr>';
}

echo '
<tr>
<td width="40%"><b>', $txt[231], ': </b></td>
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ </tr><tr>
<td><b>', $txt[227], ':</b></td>
<td>', $context['member']['location'], '</td>
</tr><tr>
]]></search>
<add><![CDATA[ </tr><tr>
<td><b>', $txt[227], ':</b></td>
<td>', $context['member']['location'], '</td>
</tr><tr>
<td><b>', $txt['country_flag'], ':</b></td>
<td>';

// Did they select a flag?
if(isset($context['member']['options']['country']) && !empty($context['member']['options']['country']))
{
$flags = CountryFlag();
echo
$flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
}

echo '
</td>
</tr><tr>
]]></add>
</operation>
</file>

<file name="$themedir/Display.template.php">
<operation>
<search position="before"><![CDATA[
// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
echo '
', $txt[231], ': ', $message['member']['gender']['image'], '<br />';
]]></search>
<add><![CDATA[
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
]]></add>
</operation>
</file>

<file name="$boarddir/Themes/babylon/Display.template.php">
<operation>
<search position="before"><![CDATA[
// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
echo '
', $txt[231], ': ', $message['member']['gender']['image'], '<br />';
]]></search>
<add><![CDATA[
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
]]></add>
</operation>
</file>

<file name="$languagedir/Modifications.portuguese.php">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Please select your country';
$txt['country_flag_error_required'] = 'You must select the country that you visit us from';
$txt['country_flag_ask'] = 'Ask for country flag on';
$txt['country_flag_disabled'] = 'Don\'t show (Disabled)';
$txt['country_flag_profile'] = 'Profile';
$txt['country_flag_registration'] = 'Registration';
$txt['country_flag_both'] = 'Both';
$txt['country_flag_required'] = 'Require a member to select a location?';
$txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).';
$txt['country_flag'] = 'Country';
]]></add>
</operation>
</file>
</modification>


Tá um bocado grande os códigos, é porque poderá ter alguem o mesmo problema.

cumps
Visitem o novo Fórum de Tugas, agora é Tuga Web Fórum - http://www.tugawebforum.empiresp.com [nofollow]

Obrigado

panzetti

é mas pode perceber que agora vc não tem a linguagem english.. por isso eu prefiro instalar primeiro e depois criar o arquivo..
André Panzetti
www.shotgames.com.br

Hostx

E também tenho no profile tudo em english, o que muda é tar a funcar. lol
Visitem o novo Fórum de Tugas, agora é Tuga Web Fórum - http://www.tugawebforum.empiresp.com [nofollow]

Obrigado

margarett

Por isso é que criei um guia para adaptar os MODs à lingua...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: