Best Style

Você não está conectado. Conecte-se ou registre-se

Reputação estilo IPB

Ver o tópico anterior Ver o tópico seguinte Ir para baixo  Mensagem [Página 1 de 1]

1Reputação estilo IPB Empty Reputação estilo IPB 19.12.15 16:03

Sliw

Sliw
Administrador
Informações:
Autor
: Daemon
Funcionalidade: Todas as versões




Neste tutorial iremos ensiná-los a personalizar o seu perfil de reputação como na plataforma IPB.

Acesse:
Painel de Controle Modulos Html e Javascript Gestão dos Codigos Javascript

E crie um novo Javascript em investimento nos Tópicos com o seguinte código de acordo com a versão que estais a usar.
PunBB
Código:
$(document).ready(function() {
$('.pun .post .user').each(function() {
$(this).html($(this).html().replace(/<span class="label/g,'<dd><div class="post_field"><span class="label'));
});
$('.user-info .post_field:contains("Reputação")').each(function() {
var rep = $(this).text().match(/\d+/g);
var rank = '';
$(this).addClass('reputation');
$(this).append('<span class="title" style="font-weight:normal"></span>');
if(rep == 0) {
        rank = 'Neutro';
        $(this).addClass('zero');
}
else if(rep >= 1 && rep < 5) {
        rank = 'Iniciante';
}
else if(rep >= 5 && rep < 10) {
        rank = 'Membro ativo';
}
else if(rep >= 10) {
        rank = 'Excelente';
}
$('.title', this).text(rank);
});
});
PhpBB3:
Código:
$(document).ready(function() {
$('.postprofile dl').each(function() {
$(this).html($(this).html().replace(/<span class="label/g,'<dd><div class="post_field"><span class="label'));
});
$('.postprofile dl .post_field:contains("Reputação")').each(function() {
var rep = $(this).text().match(/\d+/g);
var rank = '';
$(this).addClass('reputation');
$(this).append('<span class="title" style="font-weight:normal"></span>');
if(rep == 0) {
        rank = 'Neutro';
        $(this).addClass('zero');
}
else if(rep >= 1 && rep < 5) {
        rank = 'Iniciante';
}
else if(rep >= 5 && rep < 10) {
        rank = 'Membro ativo';
}
else if(rep >= 10) {
        rank = 'Excelente';
}
$('.title', this).text(rank);
});
});
PhpBB2:
Código:
$(document).ready(function() {
$('.post td .postdetails').each(function() {
$(this).html($(this).html().replace(/<span class="label/g,'<dd><div class="post_field"><span class="label'));
});
$('.post .row1 .postdetails .post_field:contains("Reputação")').each(function() {
var rep = $(this).text().match(/\d+/g);
var rank = '';
$(this).addClass('reputation');
$(this).append('<span class="title" style="font-weight:normal"></span>');
if(rep == 0) {
        rank = 'Neutro';
        $(this).addClass('zero');
}
else if(rep >= 1 && rep < 5) {
        rank = 'Iniciante';
}
else if(rep >= 5 && rep < 10) {
        rank = 'Membro ativo';
}
else if(rep >= 10) {
        rank = 'Excelente';
}
$('.title', this).text(rank);
});
});
Invision:
Código:
$(document).ready(function() {
$('.postprofile .postprofile-details.postdetails').each(function() {
$(this).html($(this).html().replace(/<span class="label/g,'<dd><div class="post_field"><span class="label'));
});
$('.postprofile .postprofile-details.postdetails .post_field:contains("Reputação")').each(function() {
var rep = $(this).text().match(/\d+/g);
var rank = '';
$(this).addClass('reputation');
$(this).append('<span class="title" style="font-weight:normal"></span>');
if(rep == 0) {
        rank = 'Neutro';
        $(this).addClass('zero');
}
else if(rep >= 1 && rep < 5) {
        rank = 'Iniciante';
}
else if(rep >= 5 && rep < 10) {
        rank = 'Membro ativo';
}
else if(rep >= 10) {
        rank = 'Excelente';
}
$('.title', this).text(rank);
});
});
Após feito isto acesse:
Painel de Controle Visualização Imagens e Cores Cores Folha de Estilo
e Adicione esse Código a sua folha de estilo css (para todas as versões funciona esse codigo CSS, mas, só funciona juntamente com o JS que mandei acima.):
Código:
.reputation {
  background-color: rgb(141, 177, 62)!important;
  background-image: url(http://i38.servimg.com/u/f38/17/31/71/58/highli10.png);
  border-radius: 3px;
  color: rgb(255, 255, 255);
  font-weight: bold;
  display: block;
  margin: 0 auto;
  margin-bottom: 3px;
  padding: 3px 7px;
  max-width: 125px;
  text-align: center;
  text-shadow: rgba(0, 0, 0, 0.298039) 0px -1px 0px;
  background-position: 0px 1px;
  background-repeat: repeat no-repeat;
}
.reputation.zero {
  background-color: rgb(16, 16, 16)!important;
  color: rgb(255, 255, 255);
}

Vamos entender o código...
Localize esta parte do código no JS que criou:
Código:
else if(rep >= 1 && rep < 5) {
        rank = 'Iniciante';
}

Isto significa que membros com reputação igual ou maior que 1, e menor do que 5, terão o título de iniciante. Onde está escrito :contains("Reputação"), se aplicará o efeito. Se o seu campo de reputação estiver com outro nome, basta mudar nesta parte do código.

https://beststyle.forumeiros.com

Sliw

Sliw
Administrador
Tutorial Aceito

https://beststyle.forumeiros.com

Ver o tópico anterior Ver o tópico seguinte Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos