News:

Join the Facebook Fan Page.

Main Menu

Modification Conflic

Started by ilabsolutions, June 21, 2010, 09:27:38 AM

Previous topic - Next topic

ilabsolutions

At this stage I am rather frustrated about the balk shoutbox screen I am getting when I put the spoiler function in subs.php. This is the function that is being called
// Spoiler choosing function
function build_spoiler($position, $topic = '')
{
global $txt, $settings, $context, $modSettings;

// Optional topic if given
if($topic != '')
$topic = ': '.$topic;

//Use global style if the theme-specific isn't set or is set to "follow global" (aka 0)
$spoilerTagStyle = isset($settings['spoiler_style']) ? $settings['spoiler_style'] : 0;
if($spoilerTagStyle == 0)
    {
//Use "hover" if the global style isn't explicitly set
$spoilerTagStyle = isset($modSettings['defaultSpoilerStyle']) ? $modSettings['defaultSpoilerStyle'] : 1;
}

/*
Styles:
3: button
2: link
1: hover (default)
*/
$retval = '';

switch($position)
    {
case 'before':
switch($spoilerTagStyle)
            {
case 3:
$retval = (
'<div class="spoiler"><div class="spoilerheader">'.
'<input type="button" class="spoilerbutton" value="'.$txt['spoiler_tag_text'].$topic.'" '.
'onclick="n = this.parentNode.parentNode.lastChild;if(n.style.display == \'none\') {n.style.display = \'block\';} else {n.style.display = \'none\';} return false;"/> '.
$txt['spoiler_tag_click_info'].'</div><div class="spoilerbody" style="display: none">'
);
break;

case 2:
$retval = (
'<div class="spoiler"><div class="spoilerheader">'.
'<a href="javascript:void(0)" '.
'onclick="n = this.parentNode.parentNode.lastChild; if(n.style.display == \'none\') { n.style.display = \'block\'; } else { n.style.display = \'none\'; } return false;">'.$txt['spoiler_tag_text'].$topic.'</a> '.
$txt['spoiler_tag_click_info'].'</div><div class="spoilerbody" style="display: none">'
);
break;

case 1:
default:
$retval = (
'<fieldset class="spoiler" '.
'onmouseover="this.lastChild.style.display = \'block\';" onmouseout="this.lastChild.style.display=\'none\'">'.
'<legend><b>'.$txt['spoiler_tag_text'].$topic.'</b> <small>'.$txt['spoiler_tag_hover_info'].'</small>'.
'</legend><div class="spoilerbody" style="display: none">'
);
}
        break;

case 'after':
switch($spoilerTagStyle)
            {
case 3:
case 2:
$retval = (
'</div></div>'
);
break;

case 1:
default:
$retval = (
'</div></fieldset>'
);
                   
}
break;
}
return $retval;
}



array(
            'tag' => 'spoiler',
            'block_level' => true,
            'before' => build_spoiler('before'),
            'after' => build_spoiler('after'),
            'disabled_before' => '<div style="display: none;">',
            'disabled_after' => '</div>',
            ),
         array(
            'tag' => 'spoiler',
            'type' => 'unparsed_equals',
            'block_level' => true,
            'before' => build_spoiler('before', "$1"),
            'after' => build_spoiler('after'),
            'disabled_before' => '<div style="display: none;">',
            'disabled_after' => '</div>',
            ),


I use the ajax chatbox with chat and shoutbox in one systeem. So if you see any code that can conflict I will hear it :)

CapadY

I don't know this part of code but in the upperblock build_spoiler is called with one parameter, in the lowerblock build_spoiler is called with two parameters. I don't know if the called function can handle this difference.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

ilabsolutions

But they are both different mod, but it conflicts on any way when I put the function in subs php my shoutbox goes blank. This mods seems to work correctly at other people

Deaks

do you get any errors in the error log  that can be from the spoiler or shoutbox
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Advertisement: