vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   URL in custom BBCode (https://vborg.vbsupport.ru/showthread.php?t=220911)

mad@Max 08-14-2009 09:18 PM

URL in custom BBCode
 
Let's say i wrote my bbcode through a bbcode_create.
All fine, but if i post a link, like [mybb]http://somelink.com/[mybb], link will be parsed after reload page (if it was ajax). And after reload page posted link not will be trimmed.
That doesn't happen, if before of link will be exist a whitespace or a new line, like
Code:

[mybb] http://somelink.com/[mybb]
[mybb]
http://somelink.com/[mybb]

It's are the bug or my curves hands? :)

PS A similar situation can be replicated in the hack BB Code [table].

Dismounted 08-15-2009 06:41 AM

You shouldn't need to be creating BB codes themselves in bbcode_create. You should be creating them in bbcode_fetch_tags. Please provide code as to what you're doing currently.

mad@Max 08-15-2009 04:48 PM

Should... I tried different ways, include bbcode_fetch_tags, but nothing changes.
I talk about only url bbcode, other bbcodes (inside custom bbcode) normally spend this situation.

Dismounted 08-16-2009 01:17 AM

So what are you trying to do again - you are not very clear about that.

mad@Max 08-16-2009 01:11 PM

Ok, this example
Code:

<hookname>bbcode_create</hookname>
<phpcode><![CDATA[if (!function_exists('handle_bbcode_custom'))
{
    function handle_bbcode_custom(&$parser, $code, $options)
    {
        $code = 'code';
        return $code;
    }
}]]></phpcode>
<hookname>bbcode_fetch_tags</hookname>
<phpcode><![CDATA[$tag_list['no_option']['custom'] = array(
        'callback' => 'handle_external',
        'external_callback' => 'handle_bbcode_custom',
        'strip_empty' => true
);
$tag_list['option']['custom'] = array(
        'callback' => 'handle_external',
        'external_callback' => 'handle_bbcode_custom',
        'strip_empty' => true
);]]></phpcode>

This is are template of creating custom bbcode? I'm a right?

mad@Max 08-16-2009 05:56 PM

1 Attachment(s)
Another example in images on custom bbcode "spoiler".
First attach: we open the post in ajax editor and add couple links into bbcode spoiler
Second attach: we save the edited post
Third attach: we refresh the page
So, how can we see the first link isn't processed as needed.

mad@Max 08-17-2009 07:52 PM

So, i found out, this is a bag of function convert_url_to_bbcode, precisely convert_url_to_bbcode_callback.


All times are GMT. The time now is 05:02 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.01204 seconds
  • Memory Usage 1,720KB
  • 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_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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