vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   new bbcode - problem with switching in wysigw mode (https://vborg.vbsupport.ru/showthread.php?t=208682)

bartek24m 03-18-2009 08:43 AM

new bbcode - problem with switching in wysigw mode
 
I have problem with my new bbcode
I add up new bbcode [TESTT] with one conditions:

in includes/class_bbcode.php

before:
Quote:

function handle_bbcode_img_match($link)
add:

PHP Code:

    function handle_bbcode_testt($code)
    {
        global 
$vbulletin$vbphrase$stylevar$show;
if (
$vbulletin->userinfo['userid'] == '0')
{
        return 
'code 1';
}
else
{
        return 
'code 2';
}

    } 

and before:
Quote:

($hook = vBulletinHook::fetch_hook('bbcode_fetch_tags')) ? eval($hook) : false;
ADD


PHP Code:

    if ($vbulletin->options['allowedbbcodes'])
    {
        
//[TESTT]
        
$tag_list['no_option']['testt'] = array(
            
'callback' => 'handle_bbcode_testt',
            
'strip_empty' => true,
            
'disable_smilies' => true,
            
'disable_wordwrap' => true,
            
'strip_space_after' => 2
        
);
    } 

Problem is when my users write
[testt]something[/testt]
and after that they try to look up by switching in WYSIGW mode (https://vborg.vbsupport.ru/external/2011/07/26.gif)

the tagss disapper ! and they get just code 2 ! :(

how to solve that issue

i need it couse when users click preview posts they get a code 2 in their messages and the conditionals dont work for guests

Marco van Herwaarden 03-18-2009 08:57 AM

This will probably not work anyways as the post is evaluated, parsed and added to the post cache when the first person views the post. Further views of the post will use the cached version and not re-parse it.

Also it is normal behaviour that in WYSIWYG mode bb-codes are parsed and hidden.


All times are GMT. The time now is 04:38 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.01019 seconds
  • Memory Usage 1,722KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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