Página 1 de 1

¿Cómo mejorar botón bbcode?  Tema Solucionado

Publicado: 11 Mar 2009, 13:21
por portugalete
Tengo los Botones de BBcodes con Imágenes siguiendo la guia de mitch.

El caso es que he añadido otro boton para Dailymotion pero a la hora de presionar el boton quiero que aparezca una ventana solicitandote la URL del enlace como pasa con los demás (imagen, youtube, etc)

¿Qué debería hacer?

La ayuda solicitada es para el foro "LaSextaWrestling" datos de soporte en la firma

Saludos

Re: ¿Cómo mejorar botón bbcode?

Publicado: 13 Mar 2009, 21:09
por Return;
Pues bien.. primero deberas desmarcar la opcion "Mostrar en post" del ACP
y quitar la linea de ayuda del bbcode de dailymotion...

Luego realiza estas operaciones si tu estilo está basado en subsilver2

Código: Seleccionar todo

#
#-----[ ABRIR ]------------------------------------------
#
styles/tuEstilo/template/posting_buttons.html

#
#-----[ BUSCAR ]------------------------------------------
#
youtube: 'Video youtube: [youtube]ID del video[/youtube]',

#
#-----[ AÑADE DESPUES EN UNA NUEVA LINEA ]------------------------------------------
#
dailymotion: 'Video DailyMotion:[dailymotion]URL del video[/dailymotion]',

#
#-----[ BUSCAR ]------------------------------------------
#
<img src="./images/posting/youtube.gif" border="0" onclick="BBcodeyoutube()" onmouseover="helpline('youtube')" onmouseout="helpline('tip')" border="0" class="bbimages">

#
#-----[ AÑADE DESPUES EN UNA NUEVA LINEA ]------------------------------------------
#
<img src="./images/posting/dailymotion.gif" border="0" alt="dailymotion" onclick="BBcodedailymotion()" onmouseover="helpline('dailymotion')" onmouseout="helpline('tip')" border="0" class="bbimages"/>

#
#-----[ ABRIR ]------------------------------------------
#
styles/tuEstilo/template/editor.js

#
#-----[ BUSCAR ]------------------------------------------
#
// BBcodes por Mitch

#
#-----[ AÑADE ANTES EN UNA NUEVA LINEA ]------------------------------------------
#
function BBcodedailymotion() {
theSelection = false;
var textarea = document.forms[form_name].elements[text_name];
textarea.focus();
if ((clientVer >= 4) && is_ie && is_win)
   {
      theSelection = document.selection.createRange().text;
      if (theSelection)
      {
bbfontstyle('[dailymotion]','[/dailymotion]');
         return;
      }
   }
   else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0))
   {
bbfontstyle('[dailymotion]','[/dailymotion]');
      return;
   }

   var Errores = '';
   var enterURL   = prompt("Introduzca la URL completa)", "http://www.dailymotion.com/us/featured/channel/creation/video/x8jubq_lengrenage_shortfilms");
   if (!enterURL)    {
      Errores += "Debes ingresar la ID del video.";
      alert("Error: "+Errores);
      return;
   }
   var Post = "[dailymotion]"+enterURL+"[/dailymotion]";
   insert_text(Post);
}
O si tu estilo está basado en prosilver:

Código: Seleccionar todo

#
#-----[ ABRIR ]------------------------------------------
#
styles/tuEstilo/template/posting_buttons.html

#
#-----[ BUSCAR ]------------------------------------------
#
<img src="./images/posting/youtube.gif" border="0" alt="youtube" onclick="BBcodeyoutube()" title="Video youtube:[youtube]ID del video[/youtube]" class="bbimages"/>

#
#-----[ AÑADE DESPUES EN UNA NUEVA LINEA ]------------------------------------------
#
<img src="./images/posting/dailymotion.gif" border="0" alt="dailymotion" onclick="BBcodedailymotion()" title="Video DailyMotion:[dailymotion]URL del video[/dailymotion]" class="bbimages"/>
#
#-----[ ABRIR ]------------------------------------------
#
styles/tuEstilo/template/editor.js

#
#-----[ BUSCAR ]------------------------------------------
#
// BBcodes por Mitch

#
#-----[ AÑADE ANTES EN UNA NUEVA LINEA ]------------------------------------------
#
function BBcodedailymotion() {
theSelection = false;
var textarea = document.forms[form_name].elements[text_name];
textarea.focus();
if ((clientVer >= 4) && is_ie && is_win)
   {
      theSelection = document.selection.createRange().text;
      if (theSelection)
      {
bbfontstyle('[dailymotion]','[/dailymotion]');
         return;
      }
   }
   else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0))
   {
bbfontstyle('[dailymotion]','[/dailymotion]');
      return;
   }

   var Errores = '';
   var enterURL   = prompt("Introduzca la URL completa)", "http://www.dailymotion.com/us/featured/channel/creation/video/x8jubq_lengrenage_shortfilms");
   if (!enterURL)    {
      Errores += "Debes ingresar la ID del video.";
      alert("Error: "+Errores);
      return;
   }
   var Post = "[dailymotion]"+enterURL+"[/dailymotion]";
   insert_text(Post);
}
Ahora solo te queda subir una imagen para el bbcode.. aca tenes una, no es muy linda pero es el logo de DailyMotion :jaja:
La ruta a la que tenes que subir la imagen es "images/posting" , el formato .gif y el tamaño 20x20, y finalmente el nombre
que deberá ser dailymotion.gif
(Click derecho en la imagen, guardar imagen como...)
(Click derecho en la imagen, guardar imagen como...)
dailymotion.gif (1.19 KiB) Visto 2133 veces
PD: Muchas gracias a Mitch por esa excelente guia para mejorar los BBcodes
PD2: Como siempre, back up de archivos, y luego de aplicarlos limpiar el caché!
Un saludo! =)

Re: ¿Cómo mejorar botón bbcode?

Publicado: 14 Mar 2009, 14:19
por portugalete
Muchísimas gracias Return; :bravo:

Todo perfecto, a ver si consigo solucionar los otros botones para relanzar el foro :wink:

Saludos :cerveza: