Profil ve Kayıt Sırasında Flags Ekleme

phpBB 2.0.x sürümleri için yapılmasını istediğiniz veya arayıpta bulamadığınız MODları buraya yazabilirsiniz.
Kilitli
okyanus_05
Kayıtlı Kullanıcı
Mesajlar: 39
Kayıt: 24.11.2007, 11:20
Konum: Türkiye
İletişim:

Profil ve Kayıt Sırasında Flags Ekleme

Mesaj gönderen okyanus_05 »

Arkadaşlar bi sitede gördümde siteye kayıt olurken ülke seçimi yapıyor ülke seçmeden kayıt olmuyor yani zorunlu alana ekleniyor

[ resmi görüntülemek için tıklayın ]

Bide profile girdiğinde oradada seçim yapıla biliyor sizce böyle bir mod felan varmı acaba

[ resmi görüntülemek için tıklayın ]

Arkadaşlar bide mod kurarken ardına ekle ne demek acaba yani bulduğumuz kodun sonunamı ekliyoruz yoksa altınamı bi açıklarsanız çok sevinirim
Phpbb Aşığım Sana Ne Yapayım
okyanus_05
Kayıtlı Kullanıcı
Mesajlar: 39
Kayıt: 24.11.2007, 11:20
Konum: Türkiye
İletişim:

Re: Profil ve Kayıt Sırasında Flags Ekleme

Mesaj gönderen okyanus_05 »

Arkadaşlar bu özellik smfde imiş onun modunu felan buldum ama bunu phpbb ye nasıl uyarlıyacağız ben uğraşıyorum ama phpbb'nin yabancısı olduğum için beceremiyorum aşağıdaki kodlar smf mod kodları onu phpbb'ye nasıl uyarlarız

Flags http://www.badongo.com/file/5559636

Kod: Tümünü seç

    * flags dosyası $imagesdir hedefine kopyalanacaktır

SMF dosyalarına modifikasyonlar

$sourcedir/Register.php dosyasında
Bul:

		fatal_lang_error('under_age_registration_prohibited', false, array($modSettings['coppaAge']));
	}
 



Sonrasına ekle:

 
	// 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);
	}
 




$sourcedir/Subs.php dosyasında
Dosyanın sonuna ekle:

 
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;
}
 




$sourcedir/ModSettings.php dosyasında
Bul:

			array('check', 'enableReportPM'),
			array('int', 'max_pm_recipients'),
 



Sonrasına ekle:

 
		'',
			// 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'),
 




$sourcedir/Profile.php dosyasında
Bul:

 
	$erase_options = array();
	if (isset($_POST['default_options']) && is_array($_POST['default_options']))
 



Öncesine ekle:

 
	// 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);
	}
 




$themedir/Register.template.php dosyasında
Bul:

	// Are there age restrictions in place?
	if (!empty($modSettings['coppaAge']))
 



Öncesine ekle:

 
	// 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>';
	}
 




$themedir/Profile.template.php dosyasında
Bul:

								<td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
							</tr>
							<tr>
								<td width="40%"><b>', $txt[231], ': </b></td>
 



Değiştir:

								<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>




Bul:

				</tr><tr>
					<td><b>', $txt[227], ':</b></td>
					<td>', $context['member']['location'], '</td>
				</tr><tr>
 



Değiştir:

				</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']))
	{
		$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>
 




$themedir/Display.template.php dosyasında
Bul:

 
			// Show the member's gender icon?
			if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
				echo '
								', $txt[231], ': ', $message['member']['gender']['image'], '<br />';
 



Sonrasına ekle:

 
			// Did they select a flag?
			if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']))
			{
				$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 />';
			}
 




$boarddir/Themes/babylon/Display.template.php dosyasında
Bul:

 
			// Show the member's gender icon?
			if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
				echo '
								', $txt[231], ': ', $message['member']['gender']['image'], '<br />';
 



Sonrasına ekle:

 
			// Did they select a flag?
			if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']))
			{
				$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 />';
			}
 




$languagedir/Modifications.english.php dosyasında
Dosyanın sonuna ekle:

 
// 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';
 
Phpbb Aşığım Sana Ne Yapayım
Kilitli

“2.0.x MOD İstekleri” sayfasına dön

Kimler çevrimiçi

Bu forumu görüntüleyen kullanıcılar: Hiç bir kayıtlı kullanıcı yok ve 0 misafir