Daha fazla
- Meslek
- Judge Dredd
vBulletin comes with CKEditor anymore. So, you don't have to mess with a lot of code if want to add "Code" button near "Quote" button in quick reply editor.
Just open up /httpdocs/forum/vb/ckeditor.php
And then search for
You will find something like this:
Now add this code after 'Quote':
The result will be like this:
Do this for two places.
In the end, it will be like this:
Now you can enjoy adding code in quick reply mode
Just open up /httpdocs/forum/vb/ckeditor.php
And then search for
Kod:
'Quote'
You will find something like this:
Kod:
protected function setToolbar($toolbartype)
{
$toolbar = array();
$iespell = (is_browser('ie') AND !is_browser('ie64bit') AND !is_browser('mac'));
$justify = (vB::$vbulletin->stylevars['textdirection']['string'] == 'ltr' ? array('JustifyLeft', 'JustifyCenter', 'JustifyRight') : array('JustifyRight', 'JustifyCenter', 'JustifyLeft'));
if ($this->editor_type == 'qr')
{
$toolbar[] = array('RemoveFormat');
$toolbar[] = array('PasteText', '-', 'Bold', 'Italic', 'Underline');
$toolbar[] = array('Font', 'FontSize', 'TextColor');
$toolbar[] = array('Smiley');
$toolbar[] = array('Link', 'Email', 'Unlink', 'Image', 'Video', '-', 'Quote');
Now add this code after 'Quote':
Kod:
, 'Code'
The result will be like this:
Kod:
protected function setToolbar($toolbartype)
{
$toolbar = array();
$iespell = (is_browser('ie') AND !is_browser('ie64bit') AND !is_browser('mac'));
$justify = (vB::$vbulletin->stylevars['textdirection']['string'] == 'ltr' ? array('JustifyLeft', 'JustifyCenter', 'JustifyRight') : array('JustifyRight', 'JustifyCenter', 'JustifyLeft'));
if ($this->editor_type == 'qr')
{
$toolbar[] = array('RemoveFormat');
$toolbar[] = array('PasteText', '-', 'Bold', 'Italic', 'Underline');
$toolbar[] = array('Font', 'FontSize', 'TextColor');
$toolbar[] = array('Smiley');
$toolbar[] = array('Link', 'Email', 'Unlink', 'Image', 'Video', '-', 'Quote', 'Code');
Do this for two places.
In the end, it will be like this:
Kod:
/**
* Sets the toolbar options in the editor based on the editor type requested
*
* @var int Toolbar type 0 - Simple / 1 - Standard / 2 - WYSIWYG
*/
protected function setToolbar($toolbartype)
{
$toolbar = array();
$iespell = (is_browser('ie') AND !is_browser('ie64bit') AND !is_browser('mac'));
$justify = (vB::$vbulletin->stylevars['textdirection']['string'] == 'ltr' ? array('JustifyLeft', 'JustifyCenter', 'JustifyRight') : array('JustifyRight', 'JustifyCenter', 'JustifyLeft'));
if ($this->editor_type == 'qr')
{
$toolbar[] = array('RemoveFormat');
$toolbar[] = array('PasteText', '-', 'Bold', 'Italic', 'Underline');
$toolbar[] = array('Font', 'FontSize', 'TextColor');
$toolbar[] = array('Smiley');
$toolbar[] = array('Link', 'Email', 'Unlink', 'Image', 'Video', '-', 'Quote', 'Code');
if ($iespell)
{
$toolbar[] = array('iespell');
}
$this->config['toolbar'] = $toolbar;
}
else if ($this->editor_type == 'qr_small')
{
$toolbar[] = array('RemoveFormat');
$toolbar[] = array('PasteText', '-', 'Bold', 'Italic', 'Underline');
$toolbar[] = array('Font', 'FontSize', 'TextColor');
$toolbar[] = array('Smiley');
$toolbar[] = array('Link', 'Email', 'Unlink', 'Image', 'Video');
if ($iespell)
{
$toolbar[] = array('iespell');
}
$this->config['toolbar'] = $toolbar;
}
else if ($this->editor_type == 'qe')
{
$toolbar[] = array('RemoveFormat');
$toolbar[] = array('PasteText', '-', 'Bold', 'Italic', 'Underline');
$toolbar[] = array('Font', 'FontSize', 'TextColor');
$toolbar[] = array('Smiley');
$toolbar[] = array('Link', 'Email', 'Unlink', 'Image', 'Video', '-', 'Quote', 'Code');
if ($iespell)
{
$toolbar[] = array('iespell');
}
$this->config['toolbar'] = $toolbar;
Now you can enjoy adding code in quick reply mode