Advertisement:

[AYUDA] Hide Tag Special (Error en Subs.php)

Aloittaja EmiOconnor, marraskuu 04, 2007, 04:31:23 IP

« edellinen - seuraava »

EmiOconnor

Hola gente, ya se que me van a decir que hay miles de topics con respecto al Hide Tag Special... busque en todos ellos y no encontre solucion para mi problema. Es por eso que abro este nuevo tema...

Al instalar el paquete: http://custom.simplemachines.org/mods/index.php?mod=118 (HideTagSpecial170.zip)

Me da un error en Subs.php (antes de instalar)
Abri el paquete, revise package-info.xml y HideTagSpecialEnglish.xml y no encontre ninguna linea que me diga que tengo q modificar Subs-php  ???

Alguna ayuda con esto?

Gracias desde ya! ;)

EgAr

en HideTagSpecial1.1.x.mod


<edit file>
$sourcedir/Subs.php
</edit file>

<search for>
global $txt, $scripturl, $context, $modSettings, $user_info;
static $bbc_codes = array(), $itemcodes = array(), $no_autolink_tags = array();
static $disabled;
</search for>

<add after>

//On the first Parsing i will gernerate all things i need ;) after that it's not needable :)
if(!isset($modSettings['hide_preparedOption'])) {
//First there is nothing in it ;)
$modSettings['hide_preparedOption']['hiddentext'] = '&nbsp;';
$modSettings['hide_preparedOption']['unhiddentext'] = '&nbsp;';

if(empty($modSettings['hide_noinfoforguests']) || !$user_info['is_guest']) {

//Prepare the hidden information :)
$modSettings['hide_preparedOption']['hiddentext'] = isset($modSettings['hide_hiddentext']) ? $modSettings['hide_hiddentext'] : '';
$modSettings['hide_preparedOption']['hiddentext'] = str_replace('$language', $user_info['language'], $modSettings['hide_preparedOption']['hiddentext']);
if (!empty($modSettings['hide_MUIswitch']) && isset($txt['hide_hiddentext']))
$modSettings['hide_preparedOption']['hiddentext'] = str_replace('$txtvariable', $txt['hide_hiddentext'], $modSettings['hide_preparedOption']['hiddentext']);
if (!empty($modSettings['hide_enableHTML']))
$modSettings['hide_preparedOption']['hiddentext'] = un_htmlspecialchars($modSettings['hide_preparedOption']['hiddentext']);

//Prepare the unhidden infomation?
if(!empty($modSettings['hide_enableUnhiddenText'])) {
$modSettings['hide_preparedOption']['unhiddentext'] = isset($modSettings['hide_unhiddentext']) ? $modSettings['hide_unhiddentext'] : '';
$modSettings['hide_preparedOption']['unhiddentext'] = str_replace('$language', $user_info['language'], $modSettings['hide_preparedOption']['unhiddentext']);
if (!empty($modSettings['hide_MUIswitch']) && isset($txt['hide_unhiddentext']))
$modSettings['hide_preparedOption']['unhiddentext'] = str_replace('$txtvariable', $txt['hide_unhiddentext'], $modSettings['hide_preparedOption']['unhiddentext']);
if (!empty($modSettings['hide_enableHTML']))
$modSettings['hide_preparedOption']['unhiddentext'] = un_htmlspecialchars($modSettings['hide_preparedOption']['unhiddentext']);
}
}

//So prepare the unhidden Option for the Parser ;)
if(!empty($modSettings['hide_useSpanTag'])) {
$modSettings['hide_preparedOption']['before_info'] = '<span class="hiddencontent">';
$modSettings['hide_preparedOption']['after_info'] = '</span>';
}
else {
$modSettings['hide_preparedOption']['before_info'] = '<div class="hiddencontent">';
$modSettings['hide_preparedOption']['after_info'] = '</div>';
}

//Okay Let's see where i must put the unhidden Informations :)
if(!empty($modSettings['hide_enableUnhiddenText']) && empty($modSettings['hide_onlyonetimeinfo'])) {
if(empty($modSettings['hide_posUnhiddenText']) || $modSettings['hide_posUnhiddenText'] == 4)
$modSettings['hide_preparedOption']['after_info'] .= $modSettings['hide_preparedOption']['unhiddentext'];
elseif($modSettings['hide_posUnhiddenText'] == 3)
$modSettings['hide_preparedOption']['after_info'] = $modSettings['hide_preparedOption']['unhiddentext'].$modSettings['hide_preparedOption']['after_info'];
elseif($modSettings['hide_posUnhiddenText'] == 2)
$modSettings['hide_preparedOption']['before_info'] .= $modSettings['hide_preparedOption']['unhiddentext'];
elseif($modSettings['hide_posUnhiddenText'] == 1)
$modSettings['hide_preparedOption']['before_info'] = $modSettings['hide_preparedOption']['unhiddentext'].$modSettings['hide_preparedOption']['before_info'];
else
$modSettings['hide_preparedOption']['after_info'] .= $modSettings['hide_preparedOption']['unhiddentext'];
}

$modSettings['hide_preparedOption']['parse_content'] = !empty($modSettings['hide_enableUnhiddenText']) && empty($modSettings['hide_onlyonetimeinfo']);
}

//Hide Mod.. i remove the code before i do anything...
if($message !== false && !empty($message)) {
if((empty($context['user_post_avaible']) || !isset($context['user_post_avaible'])) && !empty($modSettings['hide_onlyonetimeinfo'])) {
//Okay some more things to do, i must check if there a hidden content... without i need do nothing ;)
if(preg_match("/\[hide\](.+?)\[\/hide\]/i", $message) != 0 || preg_match("/\[hide(.+?)\](.+?)\[\/hide\]/i", $message) != 0) {
//Add the Hidden Text at the end of the post :)
$message .= '[br]'.$modSettings['hide_preparedOption']['hiddentext'];
}
}
//Here i remove this content :) or show onetime unhide info :)
if(!isset($context['user_post_avaible']) || empty($context['user_post_avaible'])) {
//Remove it ;D
$message = preg_replace("/\[hide\](.+?)\[\/hide\]/i", (empty($modSettings['hide_onlyonetimeinfo']) ? $modSettings['hide_preparedOption']['hiddentext'] : "&nbsp"), $message);
$message = preg_replace(array('~\n?\[hide.*?\].+?\[/hide\]\n?~is', '~^\n~', '~\[/hide\]~'), (empty($modSettings['hide_onlyonetimeinfo']) ? $modSettings['hide_preparedOption']['hiddentext'] : "&nbsp"), $message);
}
elseif(!empty($context['user_post_avaible']) && !empty($modSettings['hide_onlyonetimeinfo']) && !empty($modSettings['hide_enableUnhiddenText'])) {
//Okay i need to add the unhidden information at the end of the post :)
if(preg_match("/\[hide\](.+?)\[\/hide\]/i", $message) != 0 || preg_match("/\[hide(.+?)\](.+?)\[\/hide\]/i", $message) != 0) {
$message .= '[br]'.$modSettings['hide_preparedOption']['unhiddentext'];
}
}
}
</add after>

<search for>
array(
'tag' => 'white',
'before' => '<span style="color: white;">',
'after' => '</span>',
),
</search for>

<add after>
array(
'tag' => 'hide',
'before' => $modSettings['hide_preparedOption']['before_info'],
'after' => $modSettings['hide_preparedOption']['after_info'],
'block_level' => true,
),
</add after>

<search for>
// Shall we take the time to cache this?
</search for>

<replace>
//So i parse now the unhidden bbc code one time ;)
if($modSettings['hide_preparedOption']['parse_content']) {
$modSettings['hide_preparedOption']['parse_content'] = false;
if(isset($bbc_codes['h'])) {
foreach($bbc_codes['h'] as $key => $item) {
if($item['tag'] == 'hide') {
$bbc_codes['h'][$key]['before'] = parse_bbc($item['before']);
$bbc_codes['h'][$key]['after'] = parse_bbc($item['after']);
break;
}
}
}
}

// Shall we take the time to cache this?
</replace>

<search for>
// Cleanup whitespace.
$message = strtr($message, array('  ' => ' &nbsp;', "\r" => '', "\n" => '<br />', '<br /> ' => '<br />&nbsp;', '&#13;' => "\n"));
</search for>

<replace>
// Cleanup whitespace.
$message = strtr($message, array('  ' => ' &nbsp;', "\r" => '', "\n" => '<br />', '<br /> ' => '<br />&nbsp;', '&#13;' => "\n"));

//Clean up some missing removed hide close tags...
if(preg_match("/\[\/hide\]/i", $message) != 0)
$message = preg_replace("/\[\/hide\]/i", '', $message);
</replace>



EmiOconnor

Gracias EgAr! no sabia como editar ese archivo... lo pude abrir con Dreamweaver...

Saludos ;)

.Sylar.

Tengo exactamente el mismo problema que EmiOconnor, he abierto el archivo "HideTagSpecial1.1.x.mod" con el Dreamweaver y he editado la parte que había por la parte que ha puesto EgAr y no hay manera, me sigue dando error con Sources/Subs.php

¿Que puedo hacer?

Mil gracias de antemano.

pityuno

Hola buenas a mi tambiém me da el mismo errro y lo edite con Dreamweaver saludos y gracias

MercadObscuro

No me gusta revivir post pero yo tengo el mismo problema mi versión es 1.1.11 y el hide 185.

Ya modifique todo en dreamweaver y no me da sigue saliendo erro :S Ayudaa!

Advertisement: