![]() |
justify bbcode for vb.4.2
hi guys
i need to add justify bbcode, but not as a custom bbcode. I found the code in class_bbcode.php --> line 3542. and added this code PHP Code:
|
Hmmm. Why revise the actual class_bbcode.php file?!
Don't you think the purpose of the default custom bbcode functionality is to... add custom bbcodes easily and without the need of modifying the vB script...? As for what you should do? Really haven't a clue. Good luck with it though. J. |
Quote:
I need put justify button next to left align or right align. by adding custom bbcode it's not posible |
Quote:
If you use the built-in custom bbcode functionality though - there's a formfield that allows you to easily use the justify button/image of your choice. There's really no need to edit the class_bbcode.php for what you're trying to accomplish. J. |
There is a fix for those that want justify by altering the relative code, that way all post are automatically justified, it also works in the blog.
**EDIT** See this post https://vborg.vbsupport.ru/showthrea...t=justify+text This tell you how to do it for the Forum and for Blogs |
Quote:
I need to add justify button next to other justify buttons. |
Is there any idea?
|
Quote:
1.) In "bbcode.php" remove your 'justify' tag or rename it to 'justifyold'. This is hindering you, more then you know. 2.) Create a 'justify' bbcode using your HTML and include an icon. - Make sure it has been added it to the CKEDITOR before proceeding. -- Yes, I know it is in the wrong position, please continue. - Note: There is no justify icon in the sprite, thus the need to add one. 3.) In '/vb/ckeditor.php': Find: Code:
$justify = (vB::$vbulletin->stylevars['textdirection']['string'] == 'ltr' ? array('JustifyLeft', 'JustifyCenter', 'JustifyRight') : array('JustifyRight', 'JustifyCenter', 'JustifyLeft')); Replace: Code:
$justify = (vB::$vbulletin->stylevars['textdirection']['string'] == 'ltr' ? array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'justify') : array('JustifyRight', 'JustifyCenter', 'JustifyLeft', 'justify')); 4.) Create a plugin at hook "editor_custom_toolbar_loop": Code:
// Hook: editor_custom_toolbar_loop |
nice tutorial tbworld, but I think there is a little problem.
I created a custom bbcode correctly.(it worked perfect) but the replace code in '/vb/ckeditor.php' does not work and the plugin works perfect and remove justify from the end I think your 3rd step needs a bit change. would you please check it out? |
Quote:
--------------- Added [DATE]1405978076[/DATE] at [TIME]1405978076[/TIME] --------------- If you find a descent justify icon for the ckeditor, you might want to attach it to the post -- for others. --------------- Added [DATE]1405980722[/DATE] at [TIME]1405980722[/TIME] --------------- Comment -- This really needs a full JavaScript plugin to handle exceptions. Image placement and spacing is not handled correctly with just a simple HTML solution. |
1 Attachment(s)
Quote:
It works perfect. thanks a lot dear tbworld Yes of course I have two justify icon and also edited sprite.png and added justify and rtl and ltr. Excuse me but I have another question. is there any way to use this bbcode as like as right and left and center? I mean it just affect on Source mode with no interface in normal mode? Let's me thank you again for your tutorial. |
Quote:
Unfortunately, I cannot understand the next question. Could you clarify? Thanks. :) |
Quote:
ummmm! when you click on center button for example, in normal mode there is no tag but in source mode you can see [ center ] tag. now if you click on justify button you can see [ justify ] tag both in normal and source mode. is there any way to hide this tag in normal mode as like as other justify buttons? was it clear? |
Thank you for restating. Let me look at it a bit, and the answer is yes. I just didn't notice it was there. I am a little surprised it is not stripped by default, but obviously I overlooked something.
Quick fixes are never quick :) I will take a look at it later today, thanks for pointing it out. If I have time I will rewrite the plugin in JavaScript and fix the image positioning problems. |
Quote:
thanks a lot, :flower: I taked a look at plugin.js in justify folder in "clientscript\ckeditor\plugins". Justify completely defined there. look at this codes: Code:
CKEDITOR.plugins.add( 'justify', |
All times are GMT. The time now is 05:00 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|