Página 1 de 1

LaTex Y Advance BBCode Box V5.0.0??

Publicado: 12 Feb 2007, 23:20
por Maurorodas
Mod Title: LaTeX Rendering Class
Mod Version: 0.8
url: http://www.mayer.dial.pipex.com/tex.htm

Hola, he instalado en mi foro el Advance BBCode Box v5.0.0, mi foro es de química y para ello quiero instalar el LaTex render, en las instrucciones de instalacion de LaTex me pide cambiar ciertas partes del posting_body.tpl que el Advance obviamente cambió, será que hay que hacer o simplemente son incompatibles???.

El Latex pide encontrar

Código: Seleccionar todo

f_help = "{L_BBCODE_F_HELP}";
y añadir despues

Código: Seleccionar todo

x_help = "{L_BBCODE_X_HELP}";
pero el Anvance BBcode cambió esa linea por un script así

Código: Seleccionar todo

list_help = "Lista Ordenada: [list|=1|a]texto[/list] Nota: usted puede usar [*] para insertar puntos";
strike_help = "Texto Tachado: [s]texto[/s]";
sup_help = "Exponente: [sup]texto[/sup]";
sub_help = "Subíndice: [sub]texto[/sub]";
symbol_help = "Insertar símbolo en el post";
solo por mostrar algo.

que puedo hacer??

El Latex pìde encontrar

Código: Seleccionar todo

bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quoteicy]','[code]','
','
  • ','
','
  • ','
','[img]','[/img]','','');[/code]

y el advance ya lo desapareció


gracias por su ayuda.

Respuesta: LaTex Y Advance BBCode Box V5.0.0??

Publicado: 13 Feb 2007, 01:28
por mitch
No te preocupes...

En el archivo mods/bbcode_box/bbcode_box.js
Buscar:

Código: Seleccionar todo

sub_help =
En la linea siguiente agregar

Código: Seleccionar todo

tex_help = "Latex: [tex]código[/tex]";
Buscar:

Código: Seleccionar todo

var subscript = 0;
Agregar luego:

Código: Seleccionar todo

var tex = 0;
Buscar:

Código: Seleccionar todo

function BBCbold() {
Agregar ANTES:

Código: Seleccionar todo

function BBCtex() {
	var txtarea = document.post.message;
	
	if ((clientVer >= 4) && is_ie && is_win) {
		theSelection = document.selection.createRange().text;
		if (theSelection != '') {
		document.selection.createRange().text = "[tex]" + theSelection + "[/tex]";
		document.post.message.focus();
		return;
		}
	}
	else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
	{
		mozWrap(txtarea, "[tex]", "[/tex]");
		return;
	}
	if (tex == 0) {
		ToAdd = "[tex]";
		document.post.tex.src = "mods/bbcode_box/images/tex1.gif";
		tex = 1;
	} else {
		ToAdd = "[/tex]";
		document.post.tex.src = "mods/bbcode_box/images/tex.gif";
		tex = 0;
	}
	PostWrite(ToAdd);
}
Luego, hace falta agregar el boton nada mas... en posting_body.tpl, en el lugar que mas te acomode

Código: Seleccionar todo

<img border="0" src="mods/bbcode_box/images/tex.gif" name="tex" type="image" onClick="BBCtex()" onMouseOver="helpline('tex')" class="postimage" alt="tex">
Ah y obviamente para el boton, vas a tener que crear 2 imagenes .GIF, una llamada tex.gif y otra llamada tex1.gif (efecto sin pulsar, y pulsado).
Toma como referencias las imagenes de los otros botones de bbcode box mod (que están en la carpeta mods\bbcode_box\images)

Un saludo

Respuesta: LaTex Y Advance BBCode Box V5.0.0??

Publicado: 13 Feb 2007, 15:54
por Maurorodas
gracias Mitch, ya hice lo que me dices. Que pena ser tan canson, pero se me presenta el siguiente problema, para que LaTex funcione en mi foro, tengo entendido que tengo que instalar también el mimetex, lo estoy instalando y se presenta el mismo problema que con el LaTex, podrías ayudarme con el reemplazo del código??

este es el código que pide cambiar

Código: Seleccionar todo

#-----[ OPEN ]--------------------------------------------- 
# 
includes/bbcode.php

#
#-----[ FIND ]---------------------------------------------
# around line 195
// Patterns and replacements for URL and email tags..
$patterns = array();
$replacements = array();

# 
#-----[ AFTER, ADD ]-------------------------------------- 
# 
## replace the path below with your path	
include("/home/domain_name/public_html/phpbb/mimetex/phpbb_hook_2.php");

#
#-----[ FIND ]---------------------------------------------
# around line 288
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);

# 
#-----[ AFTER, ADD ]-------------------------------------- 
# 
## replace the path below with your path	
include("/home/domain_name/public_html/phpbb/mimetex/phpbb_hook_1.php");

## Add a TeX button which will add the [tex] and [/tex] tags
# 
#-----[ OPEN ]--------------------------------------------- 
# 
templates/subSilver/posting_body.tpl

#
#-----[ FIND ]---------------------------------------------
#
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quoteicy]','[code]','
','
  • ','
','
  • ','
','[img]','[/img]','','');

#
#-----[ REPLACE WITH ]---------------------------------------
#
bbtags = new Array('','','','','','','[quote]','[/quoteicy]','

Código: Seleccionar todo

','
','
  • ','
','
  • ','
','[img]','[/img]','','','[tex]','[/tex]');
## if you have other buttons just add '[tex]','[/tex]' to the end of the array

## widen the textboxes to line up with new buttons
#
#-----[ FIND ]---------------------------------------------
#
<input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" />

#
#-----[ REPLACE WITH ]---------------------------------------
#
<input type="text" name="subject" size="45" maxlength="60" style="width:500px" tabindex="2" class="post" value="{SUBJECT}" />

#
#-----[ FIND ]---------------------------------------------
#
<td colspan="9"><span class="gen">
<textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea>

#
#-----[ REPLACE WITH ]---------------------------------------
#
<td colspan="10"><span class="gen">
<textarea name="message" rows="15" cols="35" wrap="virtual" style="width:500px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea>

#
#-----[ FIND ]---------------------------------------------
#
<td><span class="genmed">
<input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
</span></td>

#
#-----[ AFTER, ADD ]--------------------------------------
#
## replace 18 (twice) with an even number 2 more than the number in the previous lines.
## Change x (in accesskey="x") if you already have this letter for other buttons
<td><span class="genmed">
<input type="button" class="button" accesskey="x" name="addbbcode18" value="TeX" style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('x')" />
</span></td>

#
#-----[ FIND ]---------------------------------------------
# replace 18 (three times) with an even number 2 more than the number above
<select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">

#
#-----[ REPLACE WITH ]---------------------------------------
#
<select name="addbbcode20" onChange="bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">

#
#-----[ FIND ]---------------------------------------------
# replace 20 (three times) with an even number 2 more than the number above
</select> &nbsp;{L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">

#
#-----[ REPLACE WITH ]---------------------------------------
#
</select> &nbsp;{L_FONT_SIZE}:<select name="addbbcode22" onChange="bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">[/code]


gracias y perdona la molestia

Respuesta: LaTex Y Advance BBCode Box V5.0.0??

Publicado: 13 Feb 2007, 17:05
por mitch
Para eso, no es necesario lo de posting_body.tpl, solo lo que te he indicado arriba, por algun motivo este otro mod tambien agrega un boton para el latex, da lo mismo, solo necesitamos 1 solo boton. Asi que para mimetex, saltate el paso del posting_body.tpl.

Respuesta: LaTex Y Advance BBCode Box V5.0.0??

Publicado: 13 Feb 2007, 18:03
por Maurorodas
Nuevamente gracias por tu ayuda, ya lo he hecho tengo instalado el Latexrender y el mimetex y no funciona, el boton me aparece, en la ventana aparece [tex] pero introduzco una formula y no pasa nada el codigo aparece igualito, :( :(

Que me hace falta instalar???

gracias

Respuesta: LaTex Y Advance BBCode Box V5.0.0??

Publicado: 13 Feb 2007, 20:43
por mitch
Maurorodas, la parte de los .PHP seguramente, lo que te he indicado es solo para que aparezca el boton, y te aparezca el bbcode [tex]texto[/tex]
El resto, lo hacen los archivos .PHP