Recordad que para pedir soporte alguno, debéis facilitar los datos de soporte oportunos por favor, mirad aquí y leer las Normas generales del foro, esto nos servirá de ayuda para dar el mejor soporte..

Gracias.

La Administración de phpBB España.

Ayuda Con MOD Hide TextTema Solucionado

Aquí­ podrás dejar tus dudas sobre MODs o MODificaciones de tu phpBB2
  Reglas del Foro
Antes de participar en los foros, leer esto por favor.
Normas generales de phpBB-Es y las de Soporte
Cerrado
Avatar de Usuario
firefox
Usuario/a
Mensajes: 56
Registrado: 24 Jul 2007, 04:16

Ayuda Con MOD Hide Text

#1

Mensaje por firefox »

Hola amigos,
estas son algunas de las indicaciones para el mod hide.
algunas cosas no las entiendo,
alguien puede ayudarme?

(las marco)

[quote]
############################################################################
## MOD HIDE | Made By / Auteur: Philiweb < http://www.philiweb.fr.st/ >

There is 7 files to modify :

1 - posting.php
2 - viewtopic.php
3 - search.php
4 - topic_review.php // in the "/includes" directory
5 - bbcode.php // in the "/includes" directory
6 - bbcode.tpl // in the Templates/{Used template}/ directory
7 - posting_body.tpl // in the Templates/{Used template}/ directory

This mod is easy to install. (20 mn)



- In bbcode.php // in the "/includes" directory
-----------------

Find

$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);

Add Below

$bbcode_tpl['show'] = str_replace('{HTEXTE}', '\\1', $bbcode_tpl['show']);


*Before* this text

/**
* Does second-pass bbencoding. This should be used before displaying the message in
* a thread. Assumes the message is already first-pass encoded, and we are given the
* correct UID as used in first-pass encoding.
*/


Add this functions

function hide_in_quote($text)

{
$text = preg_replace("#\[hide\](.*?)\[\/hide\]#si","--- phpBB : The Protected Message is not copied in this quote ---", $text);
return $text;
}

function bbencode_third_pass($text, $uid, $deprotect)
{
global $bbcode_tpl;

// pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
// This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
$text = " " . $text;

// First: If there isn't a "[" and a "]" in the message, don't bother.
if (! (strpos($text, "[") && strpos($text, "]")) )
{
// Remove padding, return.
$text = substr($text, 1);
return $text;
}
// Patterns and replacements for URL and email tags..
$patterns = array();
$replacements = array();

if ( $deprotect ) {
$patterns[0] = "#\[hide:$uid\](.*?)\[/hide:$uid\]#si";
$replacements[0] = $bbcode_tpl['show'];
}
else
{
$patterns[0] = "#\[hide:$uid\](.*?)\[/hide:$uid\]#si";
$replacements[0] = $bbcode_tpl['hide'];
}

$text = preg_replace($patterns, $replacements, $text);

// Remove our padding from the string..
$text = substr($text, 1);

return $text;
}


Find in function "bbencode_first_pass"

// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\](([a-z]+?)://([^ \"\n\r]+?))\[/img\]#si", "[img:$uid]\\1[/img:$uid]", $text);

Add Below

//
message
$text = preg_replace("#\[hide\](.*?)\[\/hide\]#si","[hide:$uid]\\1[/hide:$uid]", $text);


-----------------
6 - In bbcode.tpl // in the Templates/{Used template}/ directory
-----------------

At the top, add

<!-- BEGIN show -->
</span>
<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1">
<tr>
<td><span class="genmed"><b>Protected Message:</b></span></td>
</tr>
<tr>
<td class="quote">
{HTEXTE}
</td>
</tr>
</table>
<span class="postbody">
<!-- END show -->

<!-- BEGIN hide -->
</span>
<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1">
<tr>
<td><span class="genmed"><b>Protected Message:</b></span></td>
</tr>
<tr>
<td class="quote">
<center>--- If you are a *registered user* : you need to post in this topic to see the message ---</center>
</td>
</tr>
</table>
<span class="postbody">
<!-- END hide -->

-----------------------
7 - In posting_body.tpl // in the Templates/{Used template}/ directory
-----------------------

This part add a button in the dialog box (newtopic,...).

In the list of "// Helpline messages", add :


h_help = "Hide:
message
(alt+h)";

Find this line :
bbtags = new Array('',''...

And add at the end :
'
' and '
'

You will obtain something like this :


bbtags = new Array('','','','','','','[quote]','[/quoteicy]','

Código: Seleccionar todo

','
','
  • ','
','
  • ','
','[img]','[/img]','','','
','
');


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>


Add Below : (Don't forget to adapt the "addbbcode" numbers if neccesary ! (exemple: addbbcode18 -> addbbcode20, 20 -> 22, etc)

<td><span class="genmed">
<input type="button" class="button" accesskey="h" name="addbbcode18" value="Hide" style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('h')" />
</span></td>


Next, you need to modify all the "addbbcodexx" in the rest of the file. (exemple : addbbcode20 -> addbbcode22)

That's all ! :-)
Philippe

[/quoteicy]

en el punto 5.:[quote]

*Before* this text

/**
* Does second-pass bbencoding. This should be used before displaying the message in
* a thread. Assumes the message is already first-pass encoded, and we are given the
* correct UID as used in first-pass encoding.
*/


Add this functions

function hide_in_quote($text)
{
$text = preg_replace("#\[hide\](.*?)\[\/hide\]#si","--- phpBB : The Protected Message is not copied in this quote ---", $text);
return $text;
}

function bbencode_third_pass($text, $uid, $deprotect)
{
global $bbcode_tpl;

// pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
// This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
$text = " " . $text;

// First: If there isn't a "[" and a "]" in the message, don't bother.
if (! (strpos($text, "[") && strpos($text, "]")) )[/quoteicy]

no entiendo esto de Add this functions
At the top, add ?

??


- las partes donde dice (exemple: addbbcode18 -> addbbcode20, 20 -> 22, etc) parece que hay que cambiar el numero,
que numero ponerle?

si alguien puede darme un mano, les agradezco,
saludos.
| Mostrar
Contenido Oculto
Este foro requiere que este registrado e identificado para ver el contenido oculto.

JANU1535
Ex Staff
Mensajes: 2236
Registrado: 23 Ago 2005, 11:42
Edad: 36

Re: Ayuda Con MOD Hide Text  Tema Solucionado

#2

Mensaje por JANU1535 »

Add this functions ---> El código de abajo, es una "función" en programación, tienes que añadir eso...
At the top, add ---> Añadir arriba del todo del archivo que se te indica.

Saludos.
Antes de nada, lee las Normas de phpBB-Es, y el siempre útil Foro de guías sobre phpBB 3.
Consulta la Documentación de phpBB 2 y phpBB 3 y sus correspondientes FAQS de ayuda.
Administra, modifica, actualiza tu foro con el listado de Guías de nuestra Biblioteca.
Quizás tu duda esté resuelta, y todos ahorremos tiempo.
Si es sobre cómo Crear una Consulta SQL ya lo tienes explicado en el enlace.
En general, se recomienda Buscar antes de preguntar para no repetir preguntas y dudas resueltas.
Sólo tendrás Soporte si facilitas los datos correspondientes y si respetas completamente el Copyright de phpBB.
NOTA: No damos Soporte a los foros integrados en Nuke y derivados del mismo. Infórmate AQUÍ

Avatar de Usuario
firefox
Usuario/a
Mensajes: 56
Registrado: 24 Jul 2007, 04:16

Re: Ayuda Con MOD Hide Text

#3

Mensaje por firefox »

Add this functions ---> El código de abajo, es una "función" en programación, tienes que añadir eso...
At the top, add ---> Añadir arriba del todo del archivo que se te indica.

Saludos. Muchas gracias Janu.
un saludo desde América.

PD.

He levantado un foro en phpBB3. ¿se puede restaurar en el mismo la BD de mi foro hecho en phpBB2 ?

es decir: las tablas del phbBB2 son compatibles 100% con el phpBB3 ?

saludos y gracias nuevamente.
| Mostrar
Contenido Oculto
Este foro requiere que este registrado e identificado para ver el contenido oculto.

SuperNovato
Ex Staff
Mensajes: 2521
Registrado: 15 Mar 2006, 19:34

Re: Ayuda Con MOD Hide Text

#4

Mensaje por SuperNovato »

firefox, la posdata la has preguntado en otro tema y te la acabo de contestar: http://www.phpbb-es.com/foro/viewtopic. ... highlight= ;)
Un saludo.
Marco como solucionado.
Yo no sé casi nada de esto. Pero puedo aprender.
Porque para saber estoy solo. Pero para aprender no.

[hr]Antes de nada, lee las Normas de phpBB-Es, y la siempre útil Guí­a de phpBB en Castellano.
Consulta la Biblioteca (Guías, etc.), y los FAQS de ayuda phpBB para tus problemas. Quizás esté resuelto.
Si es sobre cómo Crear una Consulta SQL ya lo tienes explicado en el enlace.
En general, se pide Buscar antes de preguntar para no repetir preguntas y dudas resueltas.
Sólo tendrás Soporte si facilitas los datos correspondientes y si respetas completamente el Copyright de phpBB.
NOTA: No damos Soporte a los foros integrados en Nuke y derivados del mismo. Infórmate [url=PHP-nuke-y-phpbb-vt1733.html]AQUÍ

Avatar de Usuario
firefox
Usuario/a
Mensajes: 56
Registrado: 24 Jul 2007, 04:16

Re: Ayuda Con MOD Hide Text

#5

Mensaje por firefox »

Gracias SuperNovato,
Si, ya lei el mensaje..
Gracias,
saludos.
| Mostrar
Contenido Oculto
Este foro requiere que este registrado e identificado para ver el contenido oculto.

Cerrado

Volver a “Soporte, preguntas sobre MODs de phpBB 2”