Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Center and Space buttons for vBcode Details »»
Center and Space buttons for vBcode
Version: 1.00, by Boofo Boofo is offline
Developer Last Online: Jun 2012 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 07-25-2002 Last Update: Never Installs: 19
 
No support by the author.

Space Button to insert a space into messages
Center Button to center text in messages.
Version 1.1 (By Boofo)

A special thanks goes out to bad_madman for all of his help and advice in developing this small hack. It never would have been without him. Thank you, sir.

What this hack does:

This hack will add a "Space" and "Center" button to your vB Code in newreply, newthread and editpost templates. If you try to add a space with the spacebar in a message, it will be parsed out when you save the message. With this it actually inserts a hidden & nbsp; (space code) into the message. The "center" button will allow you to center text in your message.

Tested on vBulletin 2.2.5

NOTE: Updated for version 2.2.6
Due to the censorship parsing of the hard space which is being parsed to the underscore character, you will need to make an additional file edit for the SPACE button to work. The file attachment has been updated.

Install time: less than 2 minutes
Files to edit: 2 (root/vbcode_language.js and admin/functions.php)
Templates to edit: 1 (vbcode_buttons)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 07-29-2002, 09:47 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Uhh...doesn't work for me on 2.2.6...I click the Button, and I enter the text I want, and when I submit, on show thread it shows up like this
Quote:
Booofffaaaasssuuu
Reply With Quote
  #13  
Old 07-29-2002, 10:00 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you do this, too? Won't work without it.

PHP Code:
Add new custom vB Code for the "center" tag (in vB Admin CP):

vB Code tagcenter
vB Code replacement
: <div align="center">{param}</div> (or you can use: <p align="center">{param}</p>)
vB Code example: [center]Centered Text[/center]
Use {
option} ?: No 
NOTE: Only use

<div align="center">{param}</div>

or

<p align="center">{param}</p>

I put them both in there so you could choose which one you want to use. I use <div align="center">{param}</div>.

Quote:
Originally posted by DrkFusion
Uhh...doesn't work for me on 2.2.6...I click the Button, and I enter the text I want, and when I submit, on show thread it shows up like this
Reply With Quote
  #14  
Old 07-29-2002, 10:08 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Uhh..it wasn't in the txt....

Edit: nm...I see it, I was ina hurry :-D
Thanks

Drk
Reply With Quote
  #15  
Old 07-29-2002, 10:41 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks like remedial reading for you, Drk. Report to class!

Quote:
Originally posted by DrkFusion
Uhh..it wasn't in the txt....

Edit: nm...I see it, I was ina hurry :-D
Thanks

Drk
Reply With Quote
  #16  
Old 07-30-2002, 05:42 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, as far as I can tell, the underscore is new part of the censorship option in 2.2.6. (The file attachment in the first post has been updated.) Please test this and let me know if it fixes your problem.

If you want to be able to use the SPACE button in 2.2.6, you can go to your admin/functions.php and replace this line:

PHP Code:
$text str_replace(chr(160), '_'$text); 
with this line:

PHP Code:
//  $text = str_replace(chr(160), '_', $text); 
Quote:
Originally posted by vdinh


Same problem ... If I use this hack for version 2.2.6, it replace the space created by the hacked button with an underscore _ ...
Reply With Quote
  #17  
Old 08-03-2002, 03:57 AM
vdinh vdinh is offline
 
Join Date: Feb 2002
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Boofo
Ok, as far as I can tell, the underscore is new part of the censorship option in 2.2.6. (The file attachment in the first post has been updated.) Please test this and let me know if it fixes your problem.

If you want to be able to use the SPACE button in 2.2.6, you can go to your admin/functions.php and replace this line:

PHP Code:
$text str_replace(chr(160), '_'$text); 
with this line:

PHP Code:
//  $text = str_replace(chr(160), '_', $text); 
Boofo, it worked !!! Thanks a lot, I needed this
Reply With Quote
  #18  
Old 08-03-2002, 04:22 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vdinh,

Make sure you hit the install button. The wife says when it reaches 15, I can have supper (and I am getting hungry).
Reply With Quote
  #19  
Old 08-03-2002, 04:28 AM
vdinh vdinh is offline
 
Join Date: Feb 2002
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Boofo
vdinh,

Make sure you hit the install button. The wife says when it reaches 15, I can have supper (and I am getting hungry).
Hehe ... I just hit it 1 min ago

There is a slight problem ... Wonder if it is my own problem or the script's ... When I try to edit a message, any time I hit the SPACE button, it gives a SPACE at the end of the message, not at the intended place ... Can you help clarify this? Thanks again
Reply With Quote
  #20  
Old 08-03-2002, 04:37 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That will happen with any button you use there. That is a feature in vb. There is a fix out for it. It has something to do with the textarea. I'll see if I can find it around here somewhere. Try a search for it, too.

Quote:
Originally posted by vdinh


Hehe ... I just hit it 1 min ago

There is a slight problem ... Wonder if it is my own problem or the script's ... When I try to edit a message, any time I hit the SPACE button, it gives a SPACE at the end of the message, not at the intended place ... Can you help clarify this? Thanks again
Reply With Quote
  #21  
Old 08-27-2002, 10:36 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found an answer fo you.

Change this:

Quote:
<textarea name="message" rows="10" cols="$textareacols" wrap="virtual" tabindex="1"></textarea>
to this:

Quote:
<textarea name="message" rows="10" cols="$textareacols" wrap="virtual" tabindex="1" onChange=getActiveText(this) onclick=getActiveText(this)></textarea>
Quote:
Originally posted by vdinh
There is a slight problem ... Wonder if it is my own problem or the script's ... When I try to edit a message, any time I hit the SPACE button, it gives a SPACE at the end of the message, not at the intended place ... Can you help clarify this? Thanks again
Reply With Quote
Reply


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 07:58 PM.


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.05067 seconds
  • Memory Usage 2,324KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_php
  • (10)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete