vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Auto Close All Tags (https://vborg.vbsupport.ru/showthread.php?t=34488)

Mutt 01-25-2002 07:44 PM

OK, this is real quick. I hate when a user tries to use the vb code buttons, but doesn't close the tags. They get all upset that the buttons didn't work. Now, my site closes tha tags for them.

go through the templates for any post pages that use the vbcode buttons.

look for
PHP Code:

function validate(theform) { 

and right after it add
PHP Code:

closeall(theform); 

done

now when they submit the form, it automatically hits the 'Close All Tags' button

Admin 01-26-2002 04:01 AM

Good idea, but it will only close tags that were created by vBulletin, i.e the user clicks Enhaced Mode then opens a tag... it won't close it if I just type it in.

Mutt 01-27-2002 11:29 PM

Firefly you are correct, but the people that type the tags ususally know to close them. it's the people that just push the bold button and then get aggrivated that their post isn't bold that I was trying to help out. It's not fool proof, but it should help someof the time

here's a little something else. it's not neccessary, but I felt it was nicer. now when you submit the form, the page is crolled up a little to bring the focus back to the message text area regaurdless of whether any end tags were added or not. I move one line in vbcode.js to fix this. I know now this is a hack instead of a template mod, but like I said, it's not necessary

open vbcode.js and scroll down to
function closeall(theform)

find the line
theform.message.focus();

and move it to right after
AddText(Addtxt,theform);

now the message window will only be brought into focus if tags are added. if you made your post correctly, nothing will happen.


All times are GMT. The time now is 11:17 AM.

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.00986 seconds
  • Memory Usage 1,714KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete