Autor Tópico: Colocar Idade e localidade nos Post!  (Lida 3208 vezes)

0 Membros e 1 Visitante estão a ver este tópico.

Offline Sharkman

  • Iniciar SmfPt
  • *
  • Mensagens: 11
  • Rank: 2
  • Sexo: Masculino
Colocar Idade e localidade nos Post!
« em: 10 de Janeiro de 2008, 18:16 »
Deixo aqui como adicionar A idade e Localidade ao perfil nos tópicos.


Na pasta source/Load.php

Procurar :

Código: [Seleccione]
);

return true;
}

Substituir por:

Código: [Seleccione]
);

// ===== Begin modification - Display Age and Location next to posts =====
if (!empty($profile['birthdate']) && $profile['birthdate'] !== '0001-01-01')
{
list ($birth_year, $birth_month, $birth_day) = sscanf($profile['birthdate'], '%d-%d-%d');
$datearray = getdate(forum_time());
$memberContext[$user] += array(
'age' => $birth_year <= 4 ? $txt[470] : $datearray['year'] - $birth_year - (($datearray['mon'] > $birth_month || ($datearray['mon'] == $birth_month && $datearray['mday'] >= $birth_day)) ? 0 : 1)
);
}
// ===== End modification =====

return true;
}

Na pasta theme/Display.template.php

Procurar por:


Código: [Seleccione]
echo '
', $txt[231], ': ', $message['member']['gender']['image'], '<br />';

Colocar Antes :

Código: [Seleccione]
// ===== Begin modification - Display Age and Location next to posts =====
loadLanguage('Profile');
// Show the member's age
if (isset($message['member']['age']))
echo '
', $txt[420], ': ', $message['member']['age'], '<br />';

// Show the member's location
if ($message['member']['location'] != '')
echo '
', $txt[227], ': ', $message['member']['location'], '<br />';
// ===== End modification =====

Na pasta language/index.portuguese-utf8.php

Procurar por:

Código: [Seleccione]
$txt[227] = 'Localidade';
Adicionar Antes:

Código: [Seleccione]
// ===== Begin modification - Display Age and Location next to posts =====
// This was copied from Profile.english.php
$txt[420] = 'Idade';
// ===== End modification =====


Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Re: Colocar Idade e localidade nos Post!
« Responder #1 em: 10 de Janeiro de 2008, 21:27 »
 :palmas :palmas :palmas
Bom trabalho

Offline patrijosa

  • Sou o que nada sou!
  • Iniciar SmfPt
  • *
  • Mensagens: 16
  • Rank: 3
  • Sexo: Masculino
Re: Colocar Idade e localidade nos Post!
« Responder #2 em: 17 de Janeiro de 2008, 19:10 »
valeu a diga

Muito bom

 :palmas  :palmas  :palmas
O verdadeiro sábio é um eterno aprendiz!