vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Style and Graphics Requests (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=226)
-   -   justify bbcode for vb.4.2 (https://vborg.vbsupport.ru/showthread.php?t=311811)

aminp30 05-31-2014 09:11 AM

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:

// [JUSTIFY]
            
$tag_list['no_option']['justify'] = array(
                
'html'              => '<div style="text-align: justify;">%1$s</div>',
                
'ignore_global_strip_space_after' => true,
                
'strip_empty'       => true,
                
'strip_space_after' => 1
            
); 

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

JacquiiDesigns 06-01-2014 06:28 PM

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 06-02-2014 06:05 PM

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 06-02-2014 09:55 PM

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 06-07-2014 12:06 PM

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

aminp30 06-10-2014 03:38 PM

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

https://vborg.vbsupport.ru/showthrea...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 07-21-2014 01:39 AM

Is there any idea?

tbworld 07-21-2014 05:06 PM

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
PHP Code:

// [JUSTIFY]
            
$tag_list['no_option']['justify'] = array(
                
'html'              => '<div style="text-align: justify;">%1$s</div>',
                
'ignore_global_strip_space_after' => true,
                
'strip_empty'       => true,
                
'strip_space_after' => 1
            
); 

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:
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'));
(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":

Code:

// Hook: editor_custom_toolbar_loop
// Desc: Editor - Remove 'BBCODE' icon from the end of the toolbar chain.

if ($title === 'justify') unset($title);

Make sure your bbcode name is correct in all locations.

aminp30 07-21-2014 07:13 PM

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 07-21-2014 07:20 PM

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 [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.


All times are GMT. The time now is 08:47 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02078 seconds
  • Memory Usage 1,756KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete