Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 31 May 2014, 11:11
aminp30 aminp30 is offline
 
Join Date: Jul 2013
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

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?
Reply With Quote
  #2  
Old 01 Jun 2014, 20:28
JacquiiDesigns's Avatar
JacquiiDesigns JacquiiDesigns is offline
 
Join Date: Dec 2008
Location: Tennessee
Real name: Jacquii Cooke
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.
__________________
Call For Submissions. Come share your poetry & writing at JPiC Forum.
JPiC Forum For Writers | Celebrating Diversity With The Typed Word
Reply With Quote
  #3  
Old 02 Jun 2014, 20:05
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Originally Posted by JacquiiDesigns View Post
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
Reply With Quote
  #4  
Old 02 Jun 2014, 23:55
JacquiiDesigns's Avatar
JacquiiDesigns JacquiiDesigns is offline
 
Join Date: Dec 2008
Location: Tennessee
Real name: Jacquii Cooke
Originally Posted by aminp30 View Post
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.
__________________
Call For Submissions. Come share your poetry & writing at JPiC Forum.
JPiC Forum For Writers | Celebrating Diversity With The Typed Word
Reply With Quote
  #5  
Old 07 Jun 2014, 14:06
Spangle Spangle is offline
 
Join Date: Jun 2011
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

Last edited by Spangle; 07 Jun 2014 at 14:13.
Reply With Quote
  #6  
Old 10 Jun 2014, 17:38
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Originally Posted by Spangle View Post
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.
Reply With Quote
  #7  
Old 21 Jul 2014, 03:39
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Is there any idea?
Reply With Quote
  #8  
Old 21 Jul 2014, 19:06
tbworld tbworld is offline
 
Join Date: Oct 2008
Originally Posted by aminp30 View Post
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?

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.

Last edited by tbworld; 21 Jul 2014 at 21:18.
Reply With Quote
  #9  
Old 21 Jul 2014, 21:13
aminp30 aminp30 is offline
 
Join Date: Jul 2013
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?
Reply With Quote
  #10  
Old 21 Jul 2014, 21:20
tbworld tbworld is offline
 
Join Date: Oct 2008
Originally Posted by aminp30 View Post
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.
Reply With Quote
  #11  
Old 21 Jul 2014, 22:33
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Originally Posted by tbworld View Post
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.
Attached Images
File Type: gif justify.gif (72 Bytes, 70 views)
Attached Files
File Type: zip hidpi.zip (4.7 KB, 2 views)
File Type: zip sprite.zip (54.6 KB, 2 views)
Reply With Quote
  #12  
Old 21 Jul 2014, 22:48
tbworld tbworld is offline
 
Join Date: Oct 2008
Originally Posted by aminp30 View Post
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.
Reply With Quote
  #13  
Old 21 Jul 2014, 23:04
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Originally Posted by tbworld View Post
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?
Reply With Quote
  #14  
Old 21 Jul 2014, 23:26
tbworld tbworld is offline
 
Join Date: Oct 2008
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.
Reply With Quote
  #15  
Old 21 Jul 2014, 23:43
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Originally Posted by tbworld View Post
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!

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.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 06:22.

Layout Options | Width: Wide Color: