[Tutorial] Iniciar tópico rápido

Ver o tópico anterior Ver o tópico seguinte Ir para baixo

Admin
Admin
Administrador
Tempo Online : 250d 6h 21m 59s
Mensagens : 693
Reputação : 4
https://bestweb.forumeiro.com

MensagemAdmin Seg Out 03, 2016 10:40 pm

[Tutorial] Iniciar tópico rápido AMRgBGy
Autor: Daemon
Funcionalidade: PunBB

Primeiro iremos até o Painel de Controle em, Módulos :seta:  Portal & Widgets :seta: Gestão dos widgets do fórum :seta: Criar um widget personalizado.
Em "utilizar um table type" marque: NÃO.
Código:
Código:
<ul class="tool_list">
 <li>
 <a class="new_topic" id="new_topic" href="#newtopic">Iniciar novo tópico</a>
 </li>
</ul>
<script>
jQuery(document).ready(function() {
 if(window.location.pathname == '/' || window.location.pathname == '/forum')
  var opts = jQuery('form[name="jumpbox"] select').html();
  var form_newtpc = document.createElement('div');
  form_newtpc.className = 'ntpc_element',
  form_newtpc.style.display = 'none',
  form_newtpc.innerHTML = '<h3 class="dialog_title">Selecionar Fórum</h3>' +
                                       '<hr class="bsHr">' +
                                         '<a href="#" class="dialog_close">×</a>' +
                                       '<div class="space">' +
                                       '<select class="ntpc_s">'+opts+'</select>' +
                                       '<br>' +
                                        '<div class="space_b">' +
                                           '<button type="button" id="getf" class="button_continue">Continuar</button>' +
                                        '</div>' +
                                      '</div>';
 jQuery('body').append(form_newtpc);
 jQuery('.dialog_close').click(function(d) {
  d.preventDefault();
 jQuery('.modal_ntpc').fadeOut('450');
 jQuery(form_newtpc).animate({"height": "toggle"}, 400);
 });
 jQuery('#new_topic').click(function(d) {
  d.preventDefault();
  jQuery('<div class="modal_ntpc"></div>').insertBefore(form_newtpc);
  jQuery(form_newtpc).animate({"height": "toggle"}, 400);
 jQuery('#getf').click(function() {
  var selectedValue = jQuery('.ntpc_s').val();
  var value = selectedValue.match(/\d+/g);
 if(selectedValue.indexOf('f') < 0) {
  jQuery('.type_warning').remove();
  jQuery('<span class="type_warning">Este campo é obrigatório</span>').insertBefore('.space_b');
 } else {
  location.href = '/post?f='+value+'&mode=newtopic';
 }
 });
 });
});
</script>
</script>
<style>
.modal_ntpc {
background: rgba(200,200,200,0.8);
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 900;
}
.ntpc_element {
left: 50%;
margin-left: -250px;
margin-top: -210px;
top: 43%;
z-index: 999;
width: 35%;
max-width: 500px;
position: fixed;
background: #fff;
box-shadow: 0px 5px 55px rgba(0,0,0,0.4);
}
.type_warning{color: #a52638;}
.ntpc_element select {
background: #fff url(http://i.imgur.com/Kj9CW90.png) repeat-x top;
min-height: 32px;
border: 1px solid #b3b3b3;
width: 100%;
max-width: 350px;
border-radius: 3px;
padding: 7px 25px 7px 7px;
position: relative;
cursor: pointer;
margin-bottom: 5px;
}
.ntpc_element .space {padding: 15px;}
.dialog_close {
position: absolute;
top: 0;
right: 0;
display: block;
color: #000;
width: 44px;
height: 44px;
line-height: 48px;
font-size: 34px;
font-weight: 300;
text-align: center;
z-index: 999;
-webkit-transition: 0.2s all linear;
-moz-transition: 0.2s all linear;
-ms-transition: 0.2s all linear;
-o-transition: 0.2s all linear;
transition: 0.2s all linear;
}
.dialog_close:hover {color: #cd3816 !important;}
.ntpc_element .space_b {
margin-top: 15px;
}
.ntpc_element .button_continue {
background: #262e33;
color: #ffffff;
font-size: 13px;
font-weight: 500;
text-align: center;
text-decoration: none;
text-shadow: none;
white-space: nowrap;
cursor: pointer;
display: inline-block;
vertical-align: middle;
padding: 10px 20px;
border-radius: 3px;
border: 1px solid rgba(0,0,0,0.1);
-webkit-transition: 0.1s all linear;
-moz-transition: 0.1s all linear;
-ms-transition: 0.1s all linear;
-o-transition: 0.1s all linear;
transition: 0.1s all linear;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.ntpc_element .button_continue:hover {opacity: 0.9;}
.dialog_title {
color: #333;
font-size: 26px !important;
font-weight: 300 !important;
text-align: left;
line-height: 1.2;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin: 0;
padding: 12px 15px 0 15px;
}
.dialog_title ~ .bsHr {
margin: 12px 15px 0 15px;
}
hr.bsHr {
margin: 15px 0;
height: 0;
padding: 0;
border-width: 2px 0 0 0;
border-style: solid;
border-color: #ebebeb;
}
.tool_list {
width: 100%;
display: inline;
padding: 0;
list-style: none;
margin: 0;
}
.new_topic {
background: #94a66a;
color: #ffffff !important;
display: block;
width: 100%;
text-overflow: ellipsis;
overflow: hidden;
text-shadow: 1px 1px 0px rgba(0,0,0,0.2);
font-size: 14px;
line-height: 42px;
font-weight: 500;
text-align: center;
text-decoration: none;
text-shadow: none;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
white-space: nowrap;
cursor: pointer;
display: inline-block;
vertical-align: middle;
padding: 0 20px;
border-radius: 3px;
border: 1px solid rgba(0,0,0,0.1);
-webkit-transition: 0.1s all linear;
-moz-transition: 0.1s all linear;
-ms-transition: 0.1s all linear;
-o-transition: 0.1s all linear;
transition: 0.1s all linear;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.new_topic:hover {
opacity: 0.9;
}
</style>
Adicione o widget na coluna 1 ou 2, e lembre-se de ocultá-lo para convidados.

Ver o tópico anterior Ver o tópico seguinte Ir para o topo

Cria uma conta ou logue para postar uma mensagem.

Você precisa ser um membro, para poder postar uma resposta.

Criar conta

Participe de nossa comunidade, basta se registrar. É Fácil!


Criar uma conta

Logar

Já tem uma conta? Sem problemas, Logue agora.


Logar-se

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