mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-04 22:58:10 +02:00
- BBCode helpline is now customizable
git-svn-id: file:///svn/phpbb/trunk@6223 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
3c69c8f00a
commit
541dbf8af0
@ -30,6 +30,15 @@
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>{L_BBCODE_HELPLINE}</legend>
|
||||
<p>{L_BBCODE_HELPLINE_EXPLAIN}</p>
|
||||
<dl>
|
||||
<dt><label for="bbcode_tpl">{L_BBCODE_HELPLINE_TEXT}</label></dt>
|
||||
<dd><input type="text" id="bbcode_helpline" name="bbcode_helpline" size="60" maxlength="255" value="{BBCODE_HELPLINE}" /></dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>{L_SETTINGS}</legend>
|
||||
<dl>
|
||||
|
@ -561,6 +561,7 @@
|
||||
f_help = "{LA_BBCODE_F_HELP}";
|
||||
e_help = "{LA_BBCODE_E_HELP}";
|
||||
d_help = "{LA_BBCODE_D_HELP}";
|
||||
<!-- BEGIN custom_tags -->cb_{custom_tags.BBCODE_ID}_help = "{custom_tags.BBCODE_HELPLINE}";<!-- END custom_tags -->
|
||||
|
||||
//-->
|
||||
</script>
|
||||
@ -601,7 +602,7 @@
|
||||
<!-- IF .custom_tags -->
|
||||
<br /><br />
|
||||
<!-- BEGIN custom_tags -->
|
||||
<input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" />
|
||||
<input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})"<!-- IF custom_tags.BBCODE_HELPLINE !== '' --> onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')"<!-- ENDIF --> />
|
||||
<!-- END custom_tags -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
|
@ -33,12 +33,12 @@ class acp_bbcodes
|
||||
switch ($action)
|
||||
{
|
||||
case 'add':
|
||||
$bbcode_match = $bbcode_tpl = '';
|
||||
$bbcode_match = $bbcode_tpl = $bbcode_helpline = '';
|
||||
$display_on_posting = 0;
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
$sql = 'SELECT bbcode_match, bbcode_tpl, display_on_posting
|
||||
$sql = 'SELECT bbcode_match, bbcode_tpl, display_on_posting, bbcode_helpline, bbcode_helpline
|
||||
FROM ' . BBCODES_TABLE . '
|
||||
WHERE bbcode_id = ' . $bbcode_id;
|
||||
$result = $db->sql_query($sql);
|
||||
@ -53,6 +53,7 @@ class acp_bbcodes
|
||||
$bbcode_match = $row['bbcode_match'];
|
||||
$bbcode_tpl = htmlspecialchars($row['bbcode_tpl']);
|
||||
$display_on_posting = $row['display_on_posting'];
|
||||
$bbcode_helpline = html_entity_decode($row['bbcode_helpline']);
|
||||
break;
|
||||
|
||||
case 'modify':
|
||||
@ -75,6 +76,7 @@ class acp_bbcodes
|
||||
|
||||
$bbcode_match = request_var('bbcode_match', '');
|
||||
$bbcode_tpl = html_entity_decode(request_var('bbcode_tpl', ''));
|
||||
$bbcode_helpline = htmlspecialchars(request_var('bbcode_helpline', ''));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -92,6 +94,7 @@ class acp_bbcodes
|
||||
'L_BBCODE_USAGE_EXPLAIN'=> sprintf($user->lang['BBCODE_USAGE_EXPLAIN'], '<a href="#down">', '</a>'),
|
||||
'BBCODE_MATCH' => $bbcode_match,
|
||||
'BBCODE_TPL' => $bbcode_tpl,
|
||||
'BBCODE_HELPLINE' => $bbcode_helpline,
|
||||
'DISPLAY_ON_POSTING' => $display_on_posting)
|
||||
);
|
||||
|
||||
@ -135,6 +138,7 @@ class acp_bbcodes
|
||||
'bbcode_match' => $bbcode_match,
|
||||
'bbcode_tpl' => $bbcode_tpl,
|
||||
'display_on_posting' => $display_on_posting,
|
||||
'bbcode_helpline' => $bbcode_helpline,
|
||||
'first_pass_match' => $data['first_pass_match'],
|
||||
'first_pass_replace' => $data['first_pass_replace'],
|
||||
'second_pass_match' => $data['second_pass_match'],
|
||||
|
@ -934,7 +934,7 @@ function display_custom_bbcodes()
|
||||
/*
|
||||
* @todo while adjusting custom bbcodes, think about caching this query as well as correct ordering
|
||||
*/
|
||||
$sql = 'SELECT bbcode_id, bbcode_tag
|
||||
$sql = 'SELECT bbcode_id, bbcode_tag, bbcode_helpline
|
||||
FROM ' . BBCODES_TABLE . '
|
||||
WHERE display_on_posting = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
@ -943,9 +943,10 @@ function display_custom_bbcodes()
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$template->assign_block_vars('custom_tags', array(
|
||||
'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
|
||||
'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2),
|
||||
'BBCODE_TAG' => $row['bbcode_tag'])
|
||||
'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
|
||||
'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2),
|
||||
'BBCODE_TAG' => $row['bbcode_tag'],
|
||||
'BBCODE_HELPLINE' => $row['bbcode_helpline'])
|
||||
);
|
||||
|
||||
$i++;
|
||||
|
@ -172,6 +172,7 @@ END;;
|
||||
CREATE TABLE phpbb_bbcodes (
|
||||
bbcode_id INTEGER DEFAULT 0 NOT NULL,
|
||||
bbcode_tag VARCHAR(16) DEFAULT '' NOT NULL,
|
||||
bbcode_helpline VARCHAR(255) DEFAULT '' NOT NULL,
|
||||
display_on_posting INTEGER DEFAULT 0 NOT NULL,
|
||||
bbcode_match VARCHAR(255) DEFAULT '' NOT NULL,
|
||||
bbcode_tpl BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL,
|
||||
|
@ -172,6 +172,7 @@ GO
|
||||
CREATE TABLE [phpbb_bbcodes] (
|
||||
[bbcode_id] [int] DEFAULT (0) NOT NULL ,
|
||||
[bbcode_tag] [varchar] (16) DEFAULT ('') NOT NULL ,
|
||||
[bbcode_helpline] [varchar] (255) DEFAULT ('') NOT NULL,
|
||||
[display_on_posting] [int] DEFAULT (0) NOT NULL ,
|
||||
[bbcode_match] [varchar] (255) DEFAULT ('') NOT NULL ,
|
||||
[bbcode_tpl] [text] DEFAULT ('') NOT NULL ,
|
||||
|
@ -106,6 +106,7 @@ CREATE TABLE phpbb_banlist (
|
||||
CREATE TABLE phpbb_bbcodes (
|
||||
bbcode_id tinyint(3) DEFAULT '0' NOT NULL,
|
||||
bbcode_tag varchar(16) DEFAULT '' NOT NULL,
|
||||
bbcode_helpline varchar(255) DEFAULT '' NOT NULL,
|
||||
display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
bbcode_match varchar(255) DEFAULT '' NOT NULL,
|
||||
bbcode_tpl mediumtext DEFAULT '' NOT NULL,
|
||||
|
@ -227,6 +227,7 @@ END;
|
||||
CREATE TABLE phpbb_bbcodes (
|
||||
bbcode_id number(3) DEFAULT '0' NOT NULL,
|
||||
bbcode_tag varchar2(16) DEFAULT '' NOT NULL,
|
||||
bbcode_helpline varchar2(255) DEFAULT '' NOT NULL,
|
||||
display_on_posting number(1) DEFAULT '0' NOT NULL,
|
||||
bbcode_match varchar2(255) DEFAULT '' NOT NULL,
|
||||
bbcode_tpl clob DEFAULT '' NOT NULL,
|
||||
|
@ -186,6 +186,7 @@ CREATE TABLE phpbb_banlist (
|
||||
CREATE TABLE phpbb_bbcodes (
|
||||
bbcode_id INT2 DEFAULT '0' NOT NULL,
|
||||
bbcode_tag varchar(16) DEFAULT '' NOT NULL,
|
||||
bbcode_helpline varchar(255) DEFAULT '' NOT NULL,
|
||||
display_on_posting INT2 DEFAULT '0' NOT NULL CHECK (display_on_posting >= 0),
|
||||
bbcode_match varchar(255) DEFAULT '' NOT NULL,
|
||||
bbcode_tpl TEXT DEFAULT '' NOT NULL,
|
||||
|
@ -108,6 +108,7 @@ CREATE TABLE phpbb_banlist (
|
||||
CREATE TABLE phpbb_bbcodes (
|
||||
bbcode_id tinyint(3) NOT NULL DEFAULT '0',
|
||||
bbcode_tag varchar(16) NOT NULL DEFAULT '',
|
||||
bbcode_helpline varchar(255) DEFAULT '' NOT NULL,
|
||||
display_on_posting tinyint(1) NOT NULL DEFAULT '0',
|
||||
bbcode_match varchar(255) NOT NULL DEFAULT '',
|
||||
bbcode_tpl mediumtext(16777215) NOT NULL DEFAULT '',
|
||||
|
@ -38,6 +38,9 @@ $lang = array_merge($lang, array(
|
||||
'BBCODE_EDITED' => 'BBCode edited successfully',
|
||||
'BBCODE_INVALID_TAG_NAME' => 'The BBCode tag name that you selected is invalid',
|
||||
'BBCODE_NOT_EXIST' => 'The BBCode you selected does not exist',
|
||||
'BBCODE_HELPLINE' => 'Helpline',
|
||||
'BBCODE_HELPLINE_EXPLAIN' => 'This field contains the mouseover text of the BBCode',
|
||||
'BBCODE_HELPLINE_TEXT' => 'Helpline text',
|
||||
'BBCODE_TAG' => 'Tag',
|
||||
'BBCODE_USAGE' => 'BBCode usage',
|
||||
'BBCODE_USAGE_EXAMPLE' => '[colour={COLOR}]{TEXT}[/colour]<br /><br />[font={TEXT1}]{TEXT2}[/font]',
|
||||
|
@ -30,6 +30,8 @@ s_help = "{LA_BBCODE_S_HELP}";
|
||||
f_help = "{LA_BBCODE_F_HELP}";
|
||||
e_help = "{LA_BBCODE_E_HELP}";
|
||||
d_help = "{LA_BBCODE_D_HELP}";
|
||||
<!-- BEGIN custom_tags -->cb_{custom_tags.BBCODE_ID}_help = "{custom_tags.BBCODE_HELPLINE}";<!-- END custom_tags -->
|
||||
|
||||
|
||||
function checkForm()
|
||||
{
|
||||
@ -262,7 +264,7 @@ function checkForm()
|
||||
<tr valign="middle" align="left">
|
||||
<td colspan="2">
|
||||
<!-- BEGIN custom_tags -->
|
||||
<input type="button" class="btnbbcode" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" />
|
||||
<input type="button" class="btnbbcode" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})"<!-- IF custom_tags.BBCODE_HELPLINE !== '' --> onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')"<!-- ENDIF --> />
|
||||
<!-- END custom_tags -->
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -26,6 +26,7 @@ s_help = "{LA_BBCODE_S_HELP}";
|
||||
f_help = "{LA_BBCODE_F_HELP}";
|
||||
e_help = "{LA_BBCODE_E_HELP}";
|
||||
d_help = "{LA_BBCODE_D_HELP}";
|
||||
<!-- BEGIN custom_tags -->cb_{custom_tags.BBCODE_ID}_help = "{custom_tags.BBCODE_HELPLINE}";<!-- END custom_tags -->
|
||||
|
||||
//-->
|
||||
</script>
|
||||
@ -75,7 +76,7 @@ d_help = "{LA_BBCODE_D_HELP}";
|
||||
<tr valign="middle" align="left">
|
||||
<td colspan="2">
|
||||
<!-- BEGIN custom_tags -->
|
||||
<input type="button" class="btnbbcode" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" />
|
||||
<input type="button" class="btnbbcode" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})"<!-- IF custom_tags.BBCODE_HELPLINE !== '' --> onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')"<!-- ENDIF --> />
|
||||
<!-- END custom_tags -->
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user