Go Back   vb.org Archive > Community Central > vBulletin.org Site Feedback
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-14-2008, 08:56 PM
sockwater's Avatar
sockwater sockwater is offline
 
Join Date: Apr 2008
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [SQL] BBcode breaks

This [SQL] bbcode breaks when previewing or quick editing in full WYSIWYG mode.

To fix this, you can add an HTML comment to the beginning and end of the [sql] bbcode replacement text (to identify where it begins and ends), and then in a plugin on wysiwyg_parse_start (or wysiwyg_parse_complete (either one should work)), add something similar to this:

PHP Code:
$text preg_replace('#<!-- {STARTSQLTAG} -->(.+)<!-- {ENDSQLTAG} -->#U''[SQL]$1[/SQL]'$text); 
Reply With Quote
  #2  
Old 08-15-2008, 03:05 PM
Jase2 Jase2 is offline
 
Join Date: Dec 2007
Location: USA
Posts: 1,575
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This was reported before, although the staff didn't know how to fix it. I'm sure they will appreciate this.
Reply With Quote
  #3  
Old 08-15-2008, 05:24 PM
sockwater's Avatar
sockwater sockwater is offline
 
Join Date: Apr 2008
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually my code is a little bit off, since I just wrote it from memory. I've looked back at my code, and I've found an even easier way to do this. Here is a full working example.

1. Create a custom SQL bbcode, fill in any dummy text in the replacement HTML box (it won't be used). This will cause the bbcode to show up on misc,php?do=bbcode

2. Create a plugin on bbcode_create: The trick is adding 'sql' to the list of unparsed tags (the last line).
PHP Code:
if (!function_exists ('handle_sql_bbcode_tag'))
{
    function 
handle_sql_bbcode_tag (&$theobj, &$value, &$option)
    {
        
// format the HTML output for an SQL tag here
        
return "<div style='border:1px solid red;padding:10px;'>$value</div>";
    }
}
$this->tag_list['no_option']['sql'] = array ();
$this->tag_list['no_option']['sql']['callback'] = 'handle_external';
$this->tag_list['no_option']['sql']['external_callback'] = 'handle_sql_bbcode_tag';
$this->unparsed_tags[] = 'sql'
Reply With Quote
  #4  
Old 08-16-2008, 09:40 AM
Jase2 Jase2 is offline
 
Join Date: Dec 2007
Location: USA
Posts: 1,575
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any comment from staff?
Reply With Quote
  #5  
Old 08-16-2008, 09:44 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Staff will respond once we have information to share.
Reply With Quote
  #6  
Old 08-16-2008, 09:16 PM
Jase2 Jase2 is offline
 
Join Date: Dec 2007
Location: USA
Posts: 1,575
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok.
Reply With Quote
  #7  
Old 09-05-2008, 09:52 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sockwater View Post
This [SQL] bbcode breaks when previewing or quick editing in full WYSIWYG mode.

To fix this, you can add an HTML comment to the beginning and end of the [sql] bbcode replacement text (to identify where it begins and ends), and then in a plugin on wysiwyg_parse_start (or wysiwyg_parse_complete (either one should work)), add something similar to this:

PHP Code:
$text preg_replace('#<!-- {STARTSQLTAG} -->(.+)<!-- {ENDSQLTAG} -->#U''[SQL]$1[/SQL]'$text); 
Here's the original thread:
https://vborg.vbsupport.ru/showthread.php?t=168734
Reply With Quote
  #8  
Old 09-06-2008, 02:48 AM
sockwater's Avatar
sockwater sockwater is offline
 
Join Date: Apr 2008
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SirAdrian View Post
Thanks for the link. The instructions in post #3 will fix this bug.
Reply With Quote
  #9  
Old 09-06-2008, 11:42 AM
Jase2 Jase2 is offline
 
Join Date: Dec 2007
Location: USA
Posts: 1,575
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
Staff will respond once we have information to share.
So have you decided on this or not?
Reply With Quote
  #10  
Old 09-06-2008, 11:57 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jase2 View Post
So have you decided on this or not?
Nope, so far no one has had time to look - its been this way for a number of years so there is no hurry.
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:01 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.04223 seconds
  • Memory Usage 2,260KB
  • Queries Executed 11 (?)
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_php
  • (4)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
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (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_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