vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=311811

justify bbcode for vb.4.2
by aminp30
31 May 2014 11:11

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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

it works great by typing but I can't add button for it next to left align button. what should i do? :confused:

JacquiiDesigns 01 Jun 2014 20:28

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.

aminp30 02 Jun 2014 20:05

Quote:

Originally Posted by JacquiiDesigns (Post 2500380)
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.

thanks for reply dear Jacquii

I need put justify button next to left align or right align. by adding custom bbcode it's not posible

JacquiiDesigns 02 Jun 2014 23:55

Quote:

Originally Posted by aminp30 (Post 2500463)
thanks for reply dear Jacquii

I need put justify button next to left align or right align. by adding custom bbcode it's not posible

I really have no idea how you'd add that code into actual .php files.

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.

Spangle 07 Jun 2014 14:06

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

http://www.vbulletin.org/forum/showt...t=justify+text

This tell you how to do it for the Forum and for Blogs

aminp30 10 Jun 2014 17:38

Quote:

Originally Posted by Spangle (Post 2501018)
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

http://www.vbulletin.org/forum/showt...t=justify+text

This tell you how to do it for the Forum and for Blogs

Thank you but this is not what exactly I'm looking for.
I need to add justify button next to other justify buttons.

aminp30 21 Jul 2014 03:39

Is there any idea?

tbworld 21 Jul 2014 19:06

Quote:

Originally Posted by aminp30 (Post 2500228)
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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

it works great by typing but I can't add button for it next to left align button. what should i do? :confused:


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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.



Replace:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

(You can also do this in the php hook "editor_toolbar_set". It is just a bit more envolved.)

4.) Create a plugin at hook "editor_custom_toolbar_loop":


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Make sure your bbcode name is correct in all locations.

aminp30 21 Jul 2014 21:13

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?

tbworld 21 Jul 2014 21:20

Quote:

Originally Posted by aminp30 (Post 2507681)
I think your 3rd step needs a bit change.
would you please check it out?

Oops ... corrected above. Thanks.

--------------- Added 21 Jul 2014 at 21:27 ---------------

If you find a descent justify icon for the ckeditor, you might want to attach it to the post -- for others.

--------------- Added 21 Jul 2014 at 22:12 ---------------

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.

aminp30 21 Jul 2014 22:33

3 Attachment(s)
Quote:

Originally Posted by tbworld (Post 2507683)
Oops ... corrected above. Thanks.

--------------- Added 21 Jul 2014 at 21:27 ---------------

If you find a descent justify icon for the ckeditor, you might want to attach it to the post -- for others.

--------------- Added 21 Jul 2014 at 22:12 ---------------

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.

Great!
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.

tbworld 21 Jul 2014 22:48

Quote:

Originally Posted by aminp30 (Post 2507697)
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?

Glad your up and running... :)

Unfortunately, I cannot understand the next question. Could you clarify? Thanks. :)

aminp30 21 Jul 2014 23:04

Quote:

Originally Posted by tbworld (Post 2507698)
Glad your up and running... :)

Unfortunately, I cannot understand the next question. Could you clarify? Thanks. :)


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?

tbworld 21 Jul 2014 23:26

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.

aminp30 21 Jul 2014 23:43

Quote:

Originally Posted by tbworld (Post 2507702)
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.

nice sentence! :D

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I think these codes are OK. the problem is somewhere else.


All times are GMT. The time now is 19:56.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.