Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-17-2007, 08:11 PM
PhinisheDTom PhinisheDTom is offline
 
Join Date: Jan 2007
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Custom bbcode and WYSIWYG editor...again!

I've scoured this forum and seen the question asked several times, but never satisfactorily answered: How do you get a simple custom bbcode to render properly in the WYSIWYG editor? I'm using a patched vB 3.6.4, and I'm just trying to add two simple text formatting tools--strikethrough and superscript.

If I add icons via the BB Code Manager--the "approved" way of doing it--the code properly renders the formatted text in the posted message, but shows up as raw tags in the WYSIWYG editor, which irks and confuses my users. If I add the icons manually in the editor template, the code properly renders the formatted text in the WYSIWYG editor, but is stripped out of the posted message entirely. Surely there must be some relatively easy hack to a PHP or JS file that will get it to look right in both places! I've figured out every other vB development problem I've had, but I can't seem to crack this one. Any ideas?
Reply With Quote
  #2  
Old 04-18-2007, 05:24 AM
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is just a "me too" ... can't help you, but I have exactly the same problem, and am actively working on finding a solution. If you do happen to work this out, please follow up with whatever you come up with. I'll do the same if I can find a maintainable solution (i.e. hook based, no code edits).

-- hugh

[vborg keeps merging this post with my first one for some reaosn, trying again]

Well, as far as I can tell, the reason is in append_custom_tags(), where it does this:

PHP Code:
                // str_replace is stop gap until custom tags are updated to the new format
                
$this->tag_list["$has_option"]["$customtag[bbcodetag]"] = array(
                    
'callback' => 'handle_wysiwyg_unparsable',
                    
'strip_empty' => true
                
); 
In other words, even if you define a callback function to handle the bbcode, it'll get blown away and replaced with 'handle_wysiwyg_unparsable', which basically just returns the bbcode unchanged.

And unfortunately I've yet to find a hook which will enable me to override that, although I'm still looking. I'm intreagued by your statement that "If I add the icons manually in the editor template, the code properly renders the formatted text in the WYSIWYG editor", which I haven't investigated yet. From my reading of the code, I'm not quite sure how or why that would work, but if it does ... I'll try and work out how and why!

[edit - looks like might be able to do something with the 'bbcode_create' hook for setting the callback function]

Going back the other way (from WYSIWYG to bbcode) there seems to be a hook (wysiwyg_parse_complete) where I could call the standard parse_wysiwyg_recurse() on a custom parse_wysiwyg_mybbcode() function.

If I don't find anything, I guess our only choice is to start beating up on the developers either for a new hook, or to finish the "until custom tags are updated to the new format" stuff!

-- hugh
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 12:26 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.07699 seconds
  • Memory Usage 2,176KB
  • Queries Executed 13 (?)
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
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)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
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete