Autor Tema: Intuitive Age v1.1.0 para SMF 2.0  (Leído 9778 veces)

C4BR3R4

  • SuperAdmin.
  • *
Intuitive Age v1.1.0 para SMF 2.0
« en: 11 de Febrero de 2016 a las 20:10 »
Intuitive Age
Camba la introducción de la fecha de nacimiento en forma de campos desplegables.
Solo en la zona del perfil y no en el registro.


Página del mod: http://custom.simplemachines.org/mods/index.php?mod=3118

Este mod solo modifica el archivo './Themes/default/Profile.template.php'

C4BR3R4

  • SuperAdmin.
  • *
Re:Intuitive Age v1.0 para SMF 2.0
« Respuesta #1 en: 08 de Marzo de 2016 a las 13:19 »
package-info.xml
Modificación para que se pueda instalar el mod en cualquier versión de SMF.

Código: (Antes) [Seleccionar]
<install for="2.0">
<readme parsebbc="true">readme.txt</readme>
<modification>modifications.xml</modification>
</install>
<uninstall for="2.0">
<readme parsebbc="true">readme.txt</readme>
<modification reverse="true">modifications.xml</modification>
</uninstall>

Código: (Después) [Seleccionar]
<install>
<readme parsebbc="true">readme.txt</readme>
<modification>modifications.xml</modification>
</install>
<uninstall>
<readme parsebbc="true">readme.txt</readme>
<modification reverse="true">modifications.xml</modification>
</uninstall>


modifications.xml
Modificación para cambiar el orden de los datos: día, mes y año.

Código: (Antes) [Seleccionar]
<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"', $context['member']['birth_date']['year'], '" class="input_text" />';
}
echo '</dd>';

Código: (Después) [Seleccionar]
<dd>
<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>
<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>';
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"', $context['member']['birth_date']['year'], '" class="input_text" />';
}
echo '</dd>';


Con estas modificaciones el mod adquiere el número de versión 1.1.0