Go Back   vb.org Archive > Community Discussions > Style and Graphics Requests (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 05-31-2014, 10:11 AM
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 06-01-2014, 07:28 PM
JacquiiDesigns's Avatar
JacquiiDesigns JacquiiDesigns is offline
 
Join Date: Dec 2008
Location: Tennessee
Posts: 687
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Благодарность от:
aminp30
  #3  
Old 06-02-2014, 07:05 PM
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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 06-02-2014, 10:55 PM
JacquiiDesigns's Avatar
JacquiiDesigns JacquiiDesigns is offline
 
Join Date: Dec 2008
Location: Tennessee
Posts: 687
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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.
Reply With Quote
Благодарность от:
tbworld
  #5  
Old 06-07-2014, 01:06 PM
Spangle Spangle is offline
 
Join Date: Jun 2011
Posts: 520
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Благодарность от:
aminp30
  #6  
Old 06-10-2014, 04:38 PM
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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

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.
Reply With Quote
  #7  
Old 07-21-2014, 02:39 AM
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any idea?
Reply With Quote
  #8  
Old 07-21-2014, 06:06 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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
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?

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.
Reply With Quote
Благодарность от:
aminp30
  #9  
Old 07-21-2014, 08:13 PM
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 07-21-2014, 08:20 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 12:57 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09308 seconds
  • Memory Usage 2,297KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (2)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (4)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete