MyBB Community Forums

Full Version: adding a help link for mycode within sceditor
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to add a help link for users who still cannot figure out bbcode. But people do not notice it unless it is in the actual scheditor 
my current codebuttons template (anywhere i put the link it seems to be either above or below the sceditor

<center><a href="http://python-forum.io/misc.php?action=help&hid=25" target="_blank">BBCode Help</a><center>
<link rel="stylesheet" href="{$mybb->asset_url}/jscripts/sceditor/editor_themes/{$theme['editortheme']}" type="text/css" media="all" />
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/myinsertbuttons/mibutton.js?ver=3.0.0"></script>
<link rel="stylesheet" href="{$mybb->asset_url}/jscripts/sceditor/myinsertcommand/myinsertcommand.css" type="text/css" media="all" />
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/myinsertcomma nd/insertcommand.js?ver=1.0.1"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/myinsertbuttons/mibutton.js?ver=3.0.0"></script>
<link rel="stylesheet" href="{$mybb->asset_url}/jscripts/sceditor/myinsertcommand/myinsertcommand.css" type="text/css" media="all" />
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/myinsertcommand/insertcommand.js?ver=1.0.1"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/myinsertbuttons/mibutton.js?ver=3.0.0"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/jquery.sceditor.bbcode.min.js?ver=1805"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/bbcodes_sceditor.js?ver=1804"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/editor_plugins/undo.js?ver=1805"></script>
<script type="text/javascript">
var newbutbar = newbutbar2 = '',
iclid = '{$mybb->settings['myinsertbuttons_imgurapi']}';
if (!'{$mybb->settings['myinsertbuttons_rules']}'.trim() == ''){
	newbut = '{$mybb->settings['myinsertbuttons_rules']}';
	newbutbar = ''+newbut+'|';
	icm_but_rls = newbut.split(',');
	for (var i = icm_but_rls.length-1; i >= 0; i--) {
		mibutton(''+icm_but_rls[i]+'',0);
		$(mibimage(''+icm_but_rls[i]+'')).insertAfter('textarea');
	}
}
if (!'{$mybb->settings['myinsertbuttons_rules_des']}'.trim() == ''){
	newbut2 = '{$mybb->settings['myinsertbuttons_rules_des']}';
	newbutbar2 = ''+newbut2+'|';
	icm_but_rls = newbut2.split(',');
	for (var i = icm_but_rls.length-1; i >= 0; i--) {
		mibutton(''+icm_but_rls[i]+'',1);
		$(mibimage(''+icm_but_rls[i]+'')).insertAfter('textarea');
	}
}
var insertbutton = '';
if (!'{$mybb->settings['myinsertcommand_rules']}'.trim() == ''){
	insertcommand('{$mybb->settings['myinsertcommand_rules']}');
	insertbutton = 'insert|';
}
var newbutbar = newbutbar2 = '',
iclid = '{$mybb->settings['myinsertbuttons_imgurapi']}';
if (!'{$mybb->settings['myinsertbuttons_rules']}'.trim() == ''){
	newbut = '{$mybb->settings['myinsertbuttons_rules']}';
	newbutbar = ''+newbut+'|';
	icm_but_rls = newbut.split(',');
	for (var i = icm_but_rls.length-1; i >= 0; i--) {
		mibutton(''+icm_but_rls[i]+'',0);
		$(mibimage(''+icm_but_rls[i]+'')).insertAfter('textarea');
	}
}
if (!'{$mybb->settings['myinsertbuttons_rules_des']}'.trim() == ''){
	newbut2 = '{$mybb->settings['myinsertbuttons_rules_des']}';
	newbutbar2 = ''+newbut2+'|';
	icm_but_rls = newbut2.split(',');
	for (var i = icm_but_rls.length-1; i >= 0; i--) {
		mibutton(''+icm_but_rls[i]+'',1);
		$(mibimage(''+icm_but_rls[i]+'')).insertAfter('textarea');
	}
}
var insertbutton = '';
if (!'{$mybb->settings['myinsertcommand_rules']}'.trim() == ''){
	insertcommand('{$mybb->settings['myinsertcommand_rules']}');
	insertbutton = 'insert|';
}
var newbutbar = newbutbar2 = '',
iclid = '{$mybb->settings['myinsertbuttons_imgurapi']}';
if (!'{$mybb->settings['myinsertbuttons_rules']}'.trim() == ''){
	newbut = '{$mybb->settings['myinsertbuttons_rules']}';
	newbutbar = ''+newbut+'|';
	icm_but_rls = newbut.split(',');
	for (var i = icm_but_rls.length-1; i >= 0; i--) {
		mibutton(''+icm_but_rls[i]+'',0);
		$(mibimage(''+icm_but_rls[i]+'')).insertAfter('textarea');
	}
	
}
if (!'{$mybb->settings['myinsertbuttons_rules_des']}'.trim() == ''){
	newbut2 = '{$mybb->settings['myinsertbuttons_rules_des']}';
	newbutbar2 = ''+newbut2+'|';
	icm_but_rls = newbut2.split(',');
	for (var i = icm_but_rls.length-1; i >= 0; i--) {
		mibutton(''+icm_but_rls[i]+'',1);
		$(mibimage(''+icm_but_rls[i]+'')).insertAfter('textarea');
	}
}
var partialmode = {$mybb->settings['partialmode']},
opt_editor = {
	plugins: "bbcode,undo",
	style: "{$mybb->asset_url}/jscripts/sceditor/textarea_styles/jquery.sceditor.{$theme['editortheme']}",
	rtl: {$lang->settings['rtl']},
	locale: "mybblang",
	enablePasteFiltering: true,
	autoUpdate: true,
	emoticonsEnabled: {$emoticons_enabled},
	emoticons: {
		// Emoticons to be included in the dropdown
		dropdown: {
			{$dropdownsmilies}
		},
		// Emoticons to be included in the more section
		more: {
			{$moresmilies}
		},
		// Emoticons that are not shown in the dropdown but will still be converted. Can be used for things like aliases
		hidden: {
			{$hiddensmilies}
		}
	},
	emoticonsCompat: true,
	toolbar: "{$basic1}{$align}{$font}{$size}{$color}{$removeformat}{$basic2}image,{$email}{$link}|video{$emoticon}|{$list}{$code}quote|"+insertbutton+""+newbutbar+newbutbar2+"maximize,source",
};

{$editor_language}
$(function() {
	$("#{$bind}").sceditor(opt_editor);

	MyBBEditor = $("#{$bind}").sceditor("instance");
	{$sourcemode}
});
</script>
(2016-10-20, 03:01 PM)metulburr Wrote: [ -> ]I am trying to add a help link for users who still cannot figure out bbcode. But people do not notice it unless it is in the actual scheditor 
my current codebuttons template (anywhere i put the link it seems to be either above or below the sceditor
I'm far from any kind of a code expert, this will be like the almost blind leading the blind.

My understanding is if a feature is enabled that button will appear.

Leave out the Center and try putting your line immediately before the last line of the </script>

Hopefully it will have it right at the end of the buttons.

The worst that can happen is it doesn't work. Well it doesn't work now so give it a shot.

Dan
You could these templates

newthread

newreply


I didn't dig to deep but managed to get something just above the code buttons:

<td class="trow2" valign="top"><strong>{$lang->your_message}</strong><br />{$smilieinserter}</td>
<td class="trow2"> HERE
<textarea id="message" name="message" rows="20" cols="70" tabindex="2" >{$message}</textarea>

Not perfect but could help till you find a better way.