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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-14-2009, 09:18 PM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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].
Reply With Quote
  #2  
Old 08-15-2009, 06:41 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 08-15-2009, 04:48 PM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 08-16-2009, 01:17 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So what are you trying to do again - you are not very clear about that.
Reply With Quote
  #5  
Old 08-16-2009, 01:11 PM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #6  
Old 08-16-2009, 05:56 PM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Attached Images
File Type: jpg t1.JPG (30.3 KB, 0 views)
File Type: jpg t2.JPG (27.8 KB, 0 views)
File Type: jpg t3.JPG (27.1 KB, 0 views)
Reply With Quote
  #7  
Old 08-17-2009, 07:52 PM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So, i found out, this is a bag of function convert_url_to_bbcode, precisely convert_url_to_bbcode_callback.
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:04 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.07406 seconds
  • Memory Usage 2,239KB
  • Queries Executed 14 (?)
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
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (3)postbit_attachment
  • (7)postbit_onlinestatus
  • (7)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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete