mirror of
https://github.com/moparisthebest/moparscape.org-smf
synced 2024-11-21 08:15:09 -05:00
Apply spoiler mod
This commit is contained in:
parent
1ad3593908
commit
417facb436
BIN
Packages/backups/2014-02-20_before_Spoiler-0.tar.gz
Normal file
BIN
Packages/backups/2014-02-20_before_Spoiler-0.tar.gz
Normal file
Binary file not shown.
@ -1 +1 @@
|
|||||||
1391538735
|
1392908711
|
@ -453,6 +453,8 @@ function ModifyBasicSettings($return_config = false)
|
|||||||
$config_vars = array(
|
$config_vars = array(
|
||||||
// Big Options... polls, sticky, bbc....
|
// Big Options... polls, sticky, bbc....
|
||||||
array('select', 'pollMode', array($txt['disable_polls'], $txt['enable_polls'], $txt['polls_as_topics'])),
|
array('select', 'pollMode', array($txt['disable_polls'], $txt['enable_polls'], $txt['polls_as_topics'])),
|
||||||
|
|
||||||
|
array('select', 'defaultSpoilerStyle', array(1 => $txt['spoiler_tag_onhoverovershow'], 2 => $txt['spoiler_tag_onlinkclickshow'], 3 => $txt['spoiler_tag_onbuttonclickshow'])),
|
||||||
'',
|
'',
|
||||||
// Basic stuff, titles, flash, permissions...
|
// Basic stuff, titles, flash, permissions...
|
||||||
array('check', 'allow_guestAccess'),
|
array('check', 'allow_guestAccess'),
|
||||||
|
@ -1674,6 +1674,14 @@ function create_control_richedit($editorOptions)
|
|||||||
'after' => '[/quote]',
|
'after' => '[/quote]',
|
||||||
'description' => $txt['bbc_quote']
|
'description' => $txt['bbc_quote']
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'image' => 'spoiler',
|
||||||
|
'code' => 'spoiler',
|
||||||
|
'before' => '[spoiler]',
|
||||||
|
'after' => '[/spoiler]',
|
||||||
|
'description' => $txt['bbc_spoiler']
|
||||||
|
),
|
||||||
array(),
|
array(),
|
||||||
array(
|
array(
|
||||||
'image' => 'list',
|
'image' => 'list',
|
||||||
|
@ -844,6 +844,87 @@ function shorten_subject($subject, $len)
|
|||||||
// Shorten it by the length it was too long, and strip off junk from the end.
|
// Shorten it by the length it was too long, and strip off junk from the end.
|
||||||
return $smcFunc['substr']($subject, 0, $len) . '...';
|
return $smcFunc['substr']($subject, 0, $len) . '...';
|
||||||
}
|
}
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// The current time with offset.
|
// The current time with offset.
|
||||||
function forum_time($use_user_offset = true, $timestamp = null)
|
function forum_time($use_user_offset = true, $timestamp = null)
|
||||||
@ -1539,6 +1620,24 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra
|
|||||||
'before' => '<sup>',
|
'before' => '<sup>',
|
||||||
'after' => '</sup>',
|
'after' => '</sup>',
|
||||||
),
|
),
|
||||||
|
|
||||||
|
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>',
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
'tag' => 'table',
|
'tag' => 'table',
|
||||||
'before' => '<table class="bbc_table">',
|
'before' => '<table class="bbc_table">',
|
||||||
|
@ -257,6 +257,19 @@ function template_settings()
|
|||||||
'label' => $txt['hide_post_group'],
|
'label' => $txt['hide_post_group'],
|
||||||
'description' => $txt['hide_post_group_desc'],
|
'description' => $txt['hide_post_group_desc'],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'id' => 'spoiler_style',
|
||||||
|
'label' => $txt['spoiler_tag_label'],
|
||||||
|
'description' => $txt['spoiler_tag_desc'],
|
||||||
|
'options' => array(
|
||||||
|
0 => $txt['spoiler_tag_default'],
|
||||||
|
1 => $txt['spoiler_tag_onhoverovershow'],
|
||||||
|
2 => $txt['spoiler_tag_onlinkclickshow'],
|
||||||
|
3 => $txt['spoiler_tag_onbuttonclickshow'],
|
||||||
|
),
|
||||||
|
'type' => 'number',
|
||||||
|
),
|
||||||
'',
|
'',
|
||||||
array(
|
array(
|
||||||
'id' => 'show_bbc',
|
'id' => 'show_bbc',
|
||||||
|
@ -3552,4 +3552,41 @@ img#smflogo
|
|||||||
.signature img, .signature object, .signature embed
|
.signature img, .signature object, .signature embed
|
||||||
{
|
{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
fieldset.spoiler
|
||||||
|
{
|
||||||
|
border: 1px dashed gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset.spoiler > legend
|
||||||
|
{
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.spoilerheader a
|
||||||
|
{
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 1.1em;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.spoilerheader input
|
||||||
|
{
|
||||||
|
background-color: #cececc;
|
||||||
|
color: #3e3e33;
|
||||||
|
font: 0.9em sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.spoilerbody
|
||||||
|
{
|
||||||
|
color: #0f0f0f;
|
||||||
|
border: 1px dotted gray;
|
||||||
|
padding: 1em;
|
||||||
|
margin: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset.spoiler div.spoilerbody
|
||||||
|
{
|
||||||
|
border: 0px;
|
||||||
|
padding: 0em;
|
||||||
|
}
|
||||||
|
BIN
Themes/core/images/bbc/spoiler.gif
Normal file
BIN
Themes/core/images/bbc/spoiler.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 762 B |
@ -263,6 +263,19 @@ function template_settings()
|
|||||||
'label' => $txt['hide_post_group'],
|
'label' => $txt['hide_post_group'],
|
||||||
'description' => $txt['hide_post_group_desc'],
|
'description' => $txt['hide_post_group_desc'],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'id' => 'spoiler_style',
|
||||||
|
'label' => $txt['spoiler_tag_label'],
|
||||||
|
'description' => $txt['spoiler_tag_desc'],
|
||||||
|
'options' => array(
|
||||||
|
0 => $txt['spoiler_tag_default'],
|
||||||
|
1 => $txt['spoiler_tag_onhoverovershow'],
|
||||||
|
2 => $txt['spoiler_tag_onlinkclickshow'],
|
||||||
|
3 => $txt['spoiler_tag_onbuttonclickshow'],
|
||||||
|
),
|
||||||
|
'type' => 'number',
|
||||||
|
),
|
||||||
'',
|
'',
|
||||||
array(
|
array(
|
||||||
'id' => 'show_bbc',
|
'id' => 'show_bbc',
|
||||||
|
@ -3649,4 +3649,41 @@ img#smflogo
|
|||||||
.signature img, .signature object, .signature embed
|
.signature img, .signature object, .signature embed
|
||||||
{
|
{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
fieldset.spoiler
|
||||||
|
{
|
||||||
|
border: 1px dashed gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset.spoiler > legend
|
||||||
|
{
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.spoilerheader a
|
||||||
|
{
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 1.1em;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.spoilerheader input
|
||||||
|
{
|
||||||
|
background-color: #cececc;
|
||||||
|
color: #3e3e33;
|
||||||
|
font: 0.9em sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.spoilerbody
|
||||||
|
{
|
||||||
|
color: #0f0f0f;
|
||||||
|
border: 1px dotted gray;
|
||||||
|
padding: 1em;
|
||||||
|
margin: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset.spoiler div.spoilerbody
|
||||||
|
{
|
||||||
|
border: 0px;
|
||||||
|
padding: 0em;
|
||||||
|
}
|
||||||
|
BIN
Themes/default/images/bbc/spoiler.gif
Normal file
BIN
Themes/default/images/bbc/spoiler.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 762 B |
@ -601,4 +601,8 @@ $helptxt['custom_mask'] = 'The input mask is important for your forum\'s securit
|
|||||||
</div><br /><br />
|
</div><br /><br />
|
||||||
More information and advanced techniques may be found on the internet.';
|
More information and advanced techniques may be found on the internet.';
|
||||||
|
|
||||||
|
|
||||||
|
// Spoiler Tag Mod
|
||||||
|
$helptxt['defaultSpoilerStyle'] = 'Set this to change the default type of spoiler used on the forum.';
|
||||||
|
|
||||||
?>
|
?>
|
@ -11,4 +11,25 @@ $txt['doublePostHelp'] = 'Time(in Days) before double posting is considered as a
|
|||||||
$txt['doublePostAdmin_sub'] = 'Is set as in Days. Click on the "?" if you want more information. Leave Blank to prevent double posting always';
|
$txt['doublePostAdmin_sub'] = 'Is set as in Days. Click on the "?" if you want more information. Leave Blank to prevent double posting always';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Spoiler Mod
|
||||||
|
// BBC Strings
|
||||||
|
$txt['bbc_spoiler'] = 'Insert Spoiler';
|
||||||
|
|
||||||
|
// Post View Text
|
||||||
|
$txt['spoiler_tag_text'] = 'Spoiler';
|
||||||
|
$txt['spoiler_tag_click_info'] = '(click to show/hide)';
|
||||||
|
$txt['spoiler_tag_hover_info'] = '(hover to show)';
|
||||||
|
|
||||||
|
// Mod Settings
|
||||||
|
$txt['defaultSpoilerStyle'] = 'Spoiler Mode';
|
||||||
|
$txt['spoiler_tag_onhoverovershow'] = 'Show on Hover';
|
||||||
|
$txt['spoiler_tag_onlinkclickshow'] = 'Show on Link Click';
|
||||||
|
$txt['spoiler_tag_onbuttonclickshow'] = 'Show on Button Click';
|
||||||
|
|
||||||
|
|
||||||
|
// Extra Settings String for per-theme selection
|
||||||
|
$txt['spoiler_tag_label'] = 'Spoiler Mode';
|
||||||
|
$txt['spoiler_tag_desc'] = 'Choose how spoilers will display on the theme.';
|
||||||
|
$txt['spoiler_tag_default'] = '(use global default spoiler mode)';
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user