22 Oca 2021 18:09 Yeni Konu Oluştur

Haberler:

Sitemiz Smf 2.1 ve Smf 2.0 sürümleri için Destek ve Tema paylaşım forumudur


Kayıt Olurken Yaş Sorma

Başlatan snrj, 28 May 2014 21:31

« önceki - sonraki »

0 Üye ve 4 Ziyaretçi konuyu incelemekte.

*

  1. 3,002

  2. 581

  3. 877


Register.template.php bul
// If OpenID is enabled, give the user a choice between password and OpenID.
üstüne ekle
global $context, $txt, $modSettings;
if (cache_get_data('intuitive_age', 120) != null)
{
$years = cache_get_data('intuitive_age', 120);
}
else
{
$years = array();
$base_year = 1904;
$current_year = date('Y');
$count = $base_year;
$age = 0;
$ages = array();
while ($count < $current_year)
{
++$count;
$years[] = $count;
}
$years = array_reverse($years);
foreach ($years as $year)
{
$ages[$year] = ++$age;
$year = array();
$year[$age] = $year;
}
cache_put_data('intuitive_age', $years, 120);
}
$days = array(
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31,
);

// Just show the pretty box!
echo '
<dl class="register_form">
<dt>
<strong>', $txt['dob'], ':</strong>
</dt>
<dd>
<select name="bday1" id="bday1" style="padding: 4px;">
<option value="00"', isset($context['member']['birth_date']['month']) && ($context['member']['birth_date']['month'] == '' || $context['member']['birth_date']['month'] == '00') ? ' selected="selected"' : '', '>', $txt['calendar_month'], '&nbsp;</option>';
foreach ($txt['months_short'] as $key => $month)
{
echo '<option value="', $key, '"', !empty($context['member']['birth_date']['month']) && $context['member']['birth_date']['month'] == $key ? ' selected="selected"' : '', '>', $month, '&nbsp;</option>';
}
echo '</select>
<select name="bday2" id="bday2" style="padding: 4px;">
<option value="00"', isset($context['member']['birth_date']['day']) && ($context['member']['birth_date']['day'] == '' || $context['member']['birth_date']['day'] == '00') ? ' selected="selected"' : '', '>', $txt['calendar_day'], '&nbsp;</option>';
foreach ($days as $day)
{
echo '<option value="', $day, '"', !empty($context['member']['birth_date']['day']) && $context['member']['birth_date']['day'] == $day ? ' selected="selected"' : '', '>', $day, '&nbsp;</option>';
}
echo '</select>';
if (!empty($years))
{
echo '<select name="bday3" id="bday2" style="padding: 4px;">
<option value="0000"', isset($context['member']['birth_date']['year']) && ($context['member']['birth_date']['year'] == '' || $context['member']['birth_date']['year'] == '0000') ? ' selected="selected"' : '', '>', $txt['calendar_year'], '&nbsp;</option>';
foreach ($years as $key => $year)
{
echo '<option value="', $year, '"', !empty($context['member']['birth_date']['year']) && $context['member']['birth_date']['year'] == $year ? ' selected="selected"' : '', '', !empty($modSettings['coppaAge']) && $modSettings['coppaAge'] >= $year && $modSettings['coppaType'] == 0 ? ' disabled="disabled"' : '', '>', $year, '&nbsp;</option>';
}
echo '</select>';
}
else
{
echo '<input type="text" name="bday3" size="4" maxlength="4" value="', (!empty($context['member']['birth_date']) ? $context['member']['birth_date']['year'] : ''), '" /> -
<input type="text" name="bday1" size="2" maxlength="2" value="', (!empty($context['member']['birth_date']) ? $context['member']['birth_date']['month'] : ''), '" /> -
<input type="text" name="bday2" size="2" maxlength="2" value="', (!empty($context['member']['birth_date']) ? $context['member']['birth_date']['day'] : ''), '" />';
}
echo '
</dd>
</dl>';


Login.turkish.php uygun bir yere ekleyin
$txt['dob']= 'Yaşınız';
alt kısımdaki kodlar sadece zorunlu yapmak içindir
gerekli hale getirme (zorunlu yapma)
Register.php

Kod (Find) Seç
// Handle a string as a birthdate...
if (isset($_POST['birthdate']) && $_POST['birthdate'] != '')
$_POST['birthdate'] = strftime('%Y-%m-%d', strtotime($_POST['birthdate']));
// Or birthdate parts...
elseif (!empty($_POST['bday1']) && !empty($_POST['bday2']))
$_POST['birthdate'] = sprintf('%04d-%02d-%02d', empty($_POST['bday3']) ? 0 : (int) $_POST['bday3'], (int) $_POST['bday1'], (int) $_POST['bday2']);


Kod (Replace With) Seç
// Handle a string as a birthdate...
if (isset($_POST['birthdate']) && $_POST['birthdate'] != '')
$_POST['birthdate'] = strftime('%Y-%m-%d', strtotime($_POST['birthdate']));
// Or birthdate parts...
elseif (!empty($_POST['bday1']) && !empty($_POST['bday2']) && !empty($_POST['bday3']))
$_POST['birthdate'] = sprintf('%04d-%02d-%02d', (int) $_POST['bday3'], (int) $_POST['bday1'], (int) $_POST['bday2']);


Kod (Find) Seç
'theme_vars' => array(),

Kod (Add After) Seç
'birthdate' => $_POST['birthdate'],




Subs-Members.php

Kod (Find) Seç
if (!empty($regOptions['check_reserved_name']) && isReservedName($regOptions['username'], 0, false))

Kod (Add Before) Seç
// Birthdate Checking!
if (empty($regOptions['birthdate']) || $regOptions['birthdate'] == '0000-00-00')
{
fatal_error('Birthday is a required field!',false);
}else{
$arr=split("-",$regOptions['birthdate']); // splitting the array
$mm=$arr[1]; // first element of the array is month
$dd=$arr[2]; // second element is date
$yy=$arr[0]; // third element is year
If(!checkdate($mm,$dd,$yy)){
fatal_error('The Birthday you entered appears to be invalid!',false);
}
}
        list($Y,$m,$d)    = explode("-",$regOptions['birthdate']);
        If ((date("md") < $m.$d ? date("Y")-$Y-1 : date("Y")-$Y) < $modSettings['coppaAge'])
        fatal_error('Sorry! You are too young.',false);


Kod (Find) Seç
'REALNAME' => $regOptions['register_vars']['real_name'],

Kod (Add After) Seç
'birthdate' => $regOptions['birthdate'],





  1. 632

  2. 250
Birthday is a required field! bunu nerden turkceye cevirecegim

*

  1. 3,002

  2. 581

  3. 877
sources/Subs-Members.php bul
fatal_error('Birthday is a required field!',false);
burdan ' işaretlerine dikkat edin yalnız silerseniz hata alırsınız



  1. 632

  2. 250

Teşekkürler.



  1. 632

  2. 250

*

  1. 19

  2. 3
Yaş girme ve profilde göstermeyi mevcut üyelere zorunlu hale getirebilirmiyiz?

*

  1. 19

  2. 3
Alıntı yapılan: reprimond - 02 Haz 2016 22:57Yaş girme ve profilde göstermeyi mevcut üyelere zorunlu hale getirebilirmiyiz?
birkez güncelleyim


MENU ×