08-27-2020, 09:27 AM
#1
0
Hola, os dejo como poner el editor Debes agradecer para ver el contenido... igual que la versión Debes agradecer para ver el contenido... , lo he probado en la Debes agradecer para ver el contenido... pero tiene que funcionar en cualquier tema.Si tienes problemas con otro tema o lo que sea respecto al mod,coméntalo aquí dejando tu web y un usuario demo.
En c.core.php --> inc/class/c.core.php
Buscar:
Cambiar por:
En acciones.js --> themes/tutema/js/acciones.js
Buscar:
Cambiar por:
Buscar:
Cambiar por:
Buscar:
Cambiar por:
Buscar:
Cambiar por:
En funciones.js --> themes/tutema/js/funciones.js
Buscar:
Cambiar por:
Buscar:
Cambiar por:
En main_header.tpl --> themes/tutema/templates/sections/main_header.tpl
Buscar:
Agregar debajo:
Buscar:
Agregar debajo:
Subir esta carpeta y ya lo tienen funcionando.
Mega
Google Drive
Mediafire
En c.core.php --> inc/class/c.core.php
Buscar:
/*
parseBBCode($bbcode)
*/
function parseBBCode($bbcode, $type = 'normal', $smiles = true, $mentions = true) {
// Class BBCode
include_once(TS_EXTRA . 'bbcode.inc.php');
$parser = new BBCode();
// Seleccionar texto
$parser->setText($bbcode);
// Seleccionar tipo
switch ($type) {
// NORMAL
case 'normal':
// BBCodes permitidos
$parser->setRestriction(array('url', 'code', 'quote', 'font', 'size', 'color', 'img', 'b', 'i', 'u', 's', 'align', 'spoiler', 'swf', 'video', 'goear', 'hr', 'sub', 'sup', 'table', 'td', 'tr', 'ul', 'li', 'ol', 'notice', 'info', 'warning', 'error', 'success'));
break;
// FIRMA
case 'firma':
// BBCodes permitidos
$parser->setRestriction(array('url', 'font', 'size', 'color', 'img', 'b', 'i', 'u', 's', 'align', 'spoiler'));
break;
// NOTICIAS
case 'news':
// BBCodes permitidos
$parser->setRestriction(array('url', 'b', 'i', 'u', 's'));
break;
// SOLO SMILES (Esta opción se mantiene por compatibilidad con versiones anteriores, pero en su lugar se recomienda utilizar la opción "normal")
case 'smiles':
$parser->setRestriction(array('url', 'code', 'quote', 'quotePHPost', 'font', 'size', 'color', 'img', 'b', 'i', 'u', 'align', 'spoiler', 'swf', 'goear', 'hr', 'li'));
break;
}
// HTML
$html = $parser->getAsHtml();
// SMILES
if ($smiles) $html = $parser->parseSmiles();
// MENCIONES
if ($mentions) $html = $parser->parseMentions();
// Retornar resultado
return $html;
}
Cambiar por:
/*
parseBBCode($bbcode)
*/
function parseBBCode($bbcode, $type = 'normal') {
// Class BBCode
include_once(TS_EXTRA . 'bbcode.inc.php');
$parser = new BBCode();
// Seleccionar texto
$parser->setText($bbcode);
// Seleccionar tipo
switch ($type) {
// NORMAL
case 'normal':
// BBCodes permitidos
$parser->setRestriction(array('url', 'code', 'quote', 'font', 'size', 'color', 'img', 'b', 'i', 'u', 's', 'align', 'spoiler', 'swf', 'video', 'goear', 'hr', 'sub', 'sup', 'table', 'td', 'tr', 'ul', 'li', 'ol', 'notice', 'info', 'warning', 'error', 'success'));
// SMILES
$parser->parseSmiles();
// MENCIONES
$parser->parseMentions();
break;
// FIRMA
case 'firma':
// BBCodes permitidos
$parser->setRestriction(array('url', 'font', 'size', 'color', 'img', 'b', 'i', 'u', 's', 'align', 'spoiler'));
break;
// NOTICIAS
case 'news':
// BBCodes permitidos
$parser->setRestriction(array('url', 'b', 'i', 'u', 's'));
// SMILES
$parser->parseSmiles();
break;
// SOLO SMILES (Esta opción se mantiene por compatibilidad con versiones anteriores, pero en su lugar se recomienda utilizar la opción "normal")
case 'smiles':
$parser->setRestriction(array('url', 'code', 'quote', 'quotePHPost', 'font', 'size', 'color', 'img', 'b', 'i', 'u', 'align', 'spoiler', 'swf', 'goear', 'hr', 'li'));
// SMILES
$parser->parseSmiles();
// MENCIONES
$parser->parseMentions();
break;
}
// Retornar resultado HTML
return $parser->getAsHtml();
}
En acciones.js --> themes/tutema/js/acciones.js
Buscar:
/* Citar comentarios */
function citar_comment(id, nick){
var textarea = $('#body_comm');
textarea.focus();
textarea.val(((textarea.val()!='') ? textarea.val() + '\n' : '') + '[quote=' + nick + ']' + htmlspecialchars_decode($('#citar_comm_'+id).html(), 'ENT_NOQUOTES') + '[/quote]\n');
}
Cambiar por:
/* Citar comentarios */
function citar_comment(id, nick){
var textarea = $('#body_comm');
var message = $.trim($('#comment-body-'+id).html());
$('.wysibb-texarea').execCommand('quote',{autor: nick, seltext: message});
}
Buscar:
//Imprimir editores
function print_editor(){
//Editor de posts
if($('#markItUp') && !$('#markItUpMarkItUp').length){
$('#markItUp').markItUp(mySettings);
$('#emoticons a').live("click",function(){
emoticon = ' ' + $(this).attr("smile") + ' ';
$.markItUp({ replaceWith:emoticon });
return false;
});
}
//Editor de posts comentarios
if($('#body_comm') && !$('#markItUpbody_comm').length){
$('#body_comm').markItUp(mySettings_cmt);
}
//Editor de respuestas comunidades
if($('#body_resp') && !$('#markItUpbody_resp').length){
$('#body_resp').markItUp(mySettings_cmt);
}
}
/* FIN - Editor */
Cambiar por:
//Imprimir editores
function print_editor(){
//Editor de posts
if($('#markItUp').length && !$('.wysibb-texarea').length || $('#wysibb').length && !$('.wysibb-texarea').length){
$('#markItUp, #wysibb').removeAttr('onblur onfocus class style').css('height', '400').addClass('required').wysibb();
$('#moreemofn, #emoticons').remove();
}
//Editor de posts comentarios
if($('#body_comm').length && !$('.wysibb-texarea').length){
var wbbOpt = { buttons: "smilebox,|,bold,italic,underline,strike,sup,sub,|,img,video,link" }
$('#body_comm').removeAttr('onblur onfocus class style title').css('height', '80').html('').wysibb(wbbOpt);
}
//Editor de respuestas comunidades
if($('#body_resp') && !$('#markItUpbody_resp').length){
$('#body_resp').markItUp(mySettings_cmt);
}
//Editor de respuesta de mensajes
if($('#respuesta').length && !$('.wysibb-texarea').length){
var wbbOpt = { buttons: "smilebox,|,bold,italic,underline,strike,sup,sub,|,img,video,link,|,removeFormat" }
$('#respuesta').removeAttr('onblur onfocus class style title').css('height', '80').html('').wysibb(wbbOpt);
}
}
/* FIN - Editor */
Buscar:
mydialog.buttons(true, true, 'Enviar', 'mensaje.enviar(0)', true, true, true, 'Cancelar', 'close', true, false);
mydialog.center();
Cambiar por:
mydialog.buttons(true, true, 'Enviar', '$(\'.wysibb-texarea\').sync(); mensaje.enviar(0)', true, true, true, 'Cancelar', 'close', true, false);
var wbbOpt = { resize_maxheight: 170, buttons: "smilebox,|,bold,italic,underline,strike,sup,sub,|,img,video,link,|,removeFormat" }
$('#msg_body').wysibb(wbbOpt);
mydialog.center();
Buscar:
// RESPONDER
responder: function(mp_id){
this.vars['mp_id'] = $('#mp_id').val();
this.vars['mp_body'] = encodeURIComponent($('#respuesta').val()); // Fix: 14/12/2014 - 1.1.000.9
if(this.vars['mp_body'] == '') {
$('#respuesta').focus();
return;
}
//
this.ajax('respuesta','id=' + this.vars['mp_id'] + '&body=' + this.vars['mp_body'], function(h){
$('#respuesta').val(''); // LIMPIAMOS
switch(h.charAt(0)){
case '0':
mydialog.alert("Error", h.substring(3));
break;
case '1':
$('#historial').append($(h.substring(3)).fadeIn('slow'));
break;
}
$('#respuesta').focus();
});
},
Cambiar por:
// RESPONDER
responder: function(mp_id){
this.vars['mp_id'] = $('#mp_id').val();
this.vars['mp_body'] = encodeURIComponent($('#respuesta').bbcode()); // Fix: 06/05/2018 - 1.3
if(this.vars['mp_body'] == '') {
$('#respuesta').focus();
return;
}
//
this.ajax('respuesta','id=' + this.vars['mp_id'] + '&body=' + this.vars['mp_body'], function(h){
$('#respuesta').val(''); // LIMPIAMOS
$('.wysibb-body').html('');
switch(h.charAt(0)){
case '0':
mydialog.alert("Error", h.substring(3));
break;
case '1':
$('#historial').append($(h.substring(3)).fadeIn('slow'));
break;
}
$('#respuesta').focus();
});
},
En funciones.js --> themes/tutema/js/funciones.js
Buscar:
// NUEVO COMENTARIO
nuevo: function(mostrar_resp, comentarionum){
// EVITAR FLOOD
$('#btnsComment').attr({'disabled':'disabled'});
//
var textarea = $('#body_comm');
var text = textarea.val();
Cambiar por:
// NUEVO COMENTARIO
nuevo: function(mostrar_resp, comentarionum){
// EVITAR FLOOD
$('#btnsComment').attr({'disabled':'disabled'});
//
var textarea = $('#body_comm');
var text = textarea.bbcode();
Buscar:
// VISTA PREVIA DEL COMENTARIO
preview: function(id, type){
var textarea = (type == 'new') ? $('#' + id) : $('#edit-comment-' + id);
var text = textarea.val();
Cambiar por:
// VISTA PREVIA DEL COMENTARIO
preview: function(id, type){
var textarea = (type == 'new') ? $('#' + id) : $('#edit-comment-' + id);
var text = textarea.bbcode();
En main_header.tpl --> themes/tutema/templates/sections/main_header.tpl
Buscar:
<link href="{$tsConfig.tema.t_url}/extras.css" rel="stylesheet" type="text/css" />
Agregar debajo:
<link href="{$tsConfig.css}/wysibb.css" rel="stylesheet" type="text/css" />
Buscar:
<script src="{$tsConfig.js}/funciones.js" type="text/javascript"></script>
Agregar debajo:
<script src="{$tsConfig.js}/wysibb.js" type="text/javascript"></script>
Subir esta carpeta y ya lo tienen funcionando.
Mega
Google Drive
Mediafire
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]
[img]Registrate o inicia tu sesión para ver este contenido[/img]