Simple Machines Community Forum

SMF Support => Language Specific Support => Bosanski/Hrvatski/Srpski (Bosnian/Croatian/Serbian) => Topic started by: Skipper. on October 31, 2010, 12:11:51 PM

Title: Hide tag special- problem sa fajlom Subs.php
Post by: Skipper. on October 31, 2010, 12:11:51 PM
Pokušao sam da instaliram Hide tag special mod i prilikom instalacije sam naišao na sledeći problem.
Sve ide glatko dok ne dođem do fajla Subs.php prva izmena koja se odnosi na ovaj mod je sledeća:
posle ovoga:
static $disabled;
dodati ovo:

// 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'] = ' ';
$modSettings['hide_preparedOption']['unhiddentext'] = ' ';

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']);

// Okay this is the check up if he is allowed to unhide it everytime! (Risky if wrong setup or diffrent mods can handle hide tag)
$modSettings['hide_preparedOption']['auto_unhide_parser'] = false;
if (!empty($modSettings['hide_unhideparser']) && !empty($modSettings['hide_autounhidegroups']))
{
$modSettings['hide_autounhidegroups'] = !is_array($modSettings['hide_autounhidegroups']) ? explode(',', $modSettings['hide_autounhidegroups']) : $modSettings['hide_autounhidegroups'];
foreach ($user_info['groups'] as $group_id)
if (in_array($group_id, $modSettings['hide_autounhidegroups']))
{
$modSettings['hide_preparedOption']['auto_unhide_parser'] = true;
break; //One is enouph ;D
}
}
}

// Hide Mod.. i remove the code before i do anything...
if ($message !== false && !empty($message))
{
if ($modSettings['hide_preparedOption']['auto_unhide_parser'])
$context['user_post_avaible'] = 1;
// Add the Hidden Text at the end of the post :)
if ((empty($context['user_post_avaible']) || !isset($context['user_post_avaible'])) && !empty($modSettings['hide_onlyonetimeinfo']) && hideTagExists($message, $cache_id))
$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);
}
// Okay i need to add the unhidden information at the end of the post :)
elseif (!empty($context['user_post_avaible']) && !empty($modSettings['hide_onlyonetimeinfo']) && !empty($modSettings['hide_enableUnhiddenText']) && hideTagExists($message, $cache_id))
$message .= '[br]'.$modSettings['hide_preparedOption']['unhiddentext'];
}

A kad ja otvorim Subs.php i pronađem potrebam kod meni stoji sledeće:
static $disabled, $default_disabled, $parse_tag_cache;
Pokušao sam nešto da presložim ove kodove ali ne ide. Stalno mi izbaci neku grešku.
Verzija foruma 2.0 RC3
Help please  ::)
Title: Re: Hide tag special- problem sa fajlom Subs.php
Post by: Masterd on October 31, 2010, 01:37:22 PM
Ja sam dodao potrebni kod ispod ovoga i savršeno radi:

static $disabled, $default_disabled, $parse_tag_cache;
Title: Re: Hide tag special- problem sa fajlom Subs.php
Post by: Skipper. on October 31, 2010, 03:39:59 PM
Kod mene neće  :(
Title: Re: Hide tag special- problem sa fajlom Subs.php
Post by: Masterd on November 01, 2010, 04:08:43 AM
Daj cijeli file, prije nego si pokušao. Možda ima konflikte s drugim modovima.
Title: Re: Hide tag special- problem sa fajlom Subs.php
Post by: Skipper. on November 02, 2010, 02:36:24 PM
Ubačen u atačment  :)
Title: Re: Hide tag special- problem sa fajlom Subs.php
Post by: Skipper. on November 04, 2010, 08:27:25 AM
Bump  :)
Title: Re: Hide tag special- problem sa fajlom Subs.php
Post by: Masterd on November 05, 2010, 08:02:07 AM
Probaj sada. Kod mene je ovako radilo bez problema. Ako ne radi, onda je neki konflikt s modom. :D
Title: Re: Hide tag special- problem sa fajlom Subs.php
Post by: Masterd on November 07, 2010, 06:06:04 AM
Ima li kakvih novosti?
Title: Re: Hide tag special- problem sa fajlom Subs.php
Post by: Skipper. on November 07, 2010, 08:52:08 AM
Imao sam nekih drugih stvari da pozavršavam i malo sam se borio sa piraterijom na forumu pa još nisam stigao da ponovo ovo pokušam. Uglavnom obavestiću te jel radi  ;)
Title: Re: Hide tag special- problem sa fajlom Subs.php
Post by: Masterd on November 07, 2010, 10:55:38 AM
Ne trebaš se žuriti. Samo sam htio znati je li uspjelo. :D