Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 11-26-2004, 08:03 AM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Puzzled by parse_bbcode function - help :(

I can trying to parse the content using the parse_bbcode function.
However the page is loading very slow because of the parsing , and I cannot figure out why.
If I use the bottom code instead ( ie. dont parse but the result is not what I want ), the page loads fast.

How come ?

Code:
$newsmain['content'] = parse_bbcode($newsmain['content'], '1', 1, 0, '', 1, 0);
$newscontent = $newsmain['content'];
vs.

Code:
$newscontent = $newsmain['content'];
Reply With Quote
  #2  
Old 11-26-2004, 12:03 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hm, I would suggest using the parse_bbcode2 function. I do not know the difference, I just know that using the bbcode2, it takes alot less arguements than that above there, and it loads fast enough.

Reply With Quote
  #3  
Old 11-26-2004, 04:24 PM
burnist's Avatar
burnist burnist is offline
 
Join Date: Jul 2003
Location: Ireland
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Turn your vB into Debug mode and have a look at the secret settings in there. That should tell you why bbcode_parse should not be used and bbcode_parse2 should
Reply With Quote
  #4  
Old 11-26-2004, 11:44 PM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What debug mode ?

Anyways, I tried this :
Code:
$newsmain['content'] = parse_bbcode2($newsmain['content'], 0, 1, 1, 1, 0, 1);
But it still is the same case of slow loading.

What am i doing wrong ?
Reply With Quote
  #5  
Old 11-27-2004, 03:01 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

heres a small snippet of code from the RPG Integration Hack:
Code:
parse_bbcode2($battletext, 0, 0, 1, 1);
It does not parse HTML
It does not parse IMG
It parses smileys
It parses BBCode

You do not need to set the two final attributes in your parse_bbcode, because the values you input are the same as vB has for default.



//peace
Reply With Quote
  #6  
Old 11-27-2004, 11:41 PM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Revan, even doing that I still face the same problem.
That's why I am puzzled.
There seems nothing wrong with the querying.
Reply With Quote
  #7  
Old 11-29-2004, 06:16 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Revan
Hm, I would suggest using the parse_bbcode2 function. I do not know the difference, I just know that using the bbcode2, it takes alot less arguements than that above there, and it loads fast enough.

parse_bbcode is used with a cache like the posting cache. If done correct with a cache you can avoid having the parse bbcode on everypage view.

parse_bbcode2 takes raw vBcode and converts it to html for the browser when the page is called. It also dose image checking if allowed.

parse_bbcode is used to pass raw html built by parse_bbcode2 to the browser while still checking it for permissions. By storing the html in a mysql table on the first page view and calling it on all page views afterwards you avoid multiple preg_replace function calls, and save alot of generation time.
Reply With Quote
  #8  
Old 11-29-2004, 11:43 PM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Brad, so how does that fix my problem ?
Reply With Quote
Reply

Thread Tools
Display Modes

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 05:17 AM.


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.09036 seconds
  • Memory Usage 2,227KB
  • 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
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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