View Single Post
  #494  
Old 10-08-2002, 06:27 PM
jOOPeON jOOPeON is offline
 
Join Date: Mar 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by fastforward

This is something I did not take into account. The index routine does indeed strip more than the default vB routine. This was done purposely to eliminate some of the extraneous crap that vB indexes. Obviously that wasn't such a smart move where extended character sets are required. I'll make sure the next version takes it into account.

If you know a bit about regular expressions, it shouldn't be too hard to fix the code.
Sorry, my coding sucks without instructions
I guess it have something to do with this subroutine?
(or sub wordsonly/sub remove_bb_code)

# index post body
$pagetext =~ s/^\[q[1-9]\]>+.*$//go; # remove all quoted stuff
if (length($pagetext) < 10000) {
my $text = remove_bb_code("$pagetext");
$text = wordsonly("$text");
my @words = split(/\s+/,$text);
my $words_sel="";
foreach my $word (@words) {
if ($word && ((length($word) >= $vbconfig{minsearchlength})) && ((length($word) <= $vbconfig{maxsearchlength}))) {
$word = $dbh->quote($word);
$words_sel .= "$word,";
db_execute("INSERT IGNORE INTO word (title) VALUES ($word)");
}
}
chop $words_sel;
if ($words_sel) {
my $wordids = db_fetch("SELECT wordid FROM word WHERE title in ($words_sel)");
while (my $wid = $wordids->fetchrow_array) {
db_execute("INSERT IGNORE INTO searchindex (wordid,postid,intitle) VALUES ($wid,$id,0)");
}
}
} else {
console(" *-> Post $id skipped... (too long)\n");
}
}

Or this?

sub remove_bb_code {
my $text = $_[0];
my ($bbo,$bbc);
my $bbcodes = db_fetch("SELECT bbcodetag FROM bbcode");
while (my $bbcode = $bbcodes->fetchrow_array) {
$bbo=quotemeta("[".$bbcode."]");
$bbc=quotemeta("[/".$bbcode."]");
$text =~ s/$bbo|$bbc//gi; # easy stuff
}
$text =~ s/&quot;|&lt;|&gt;/ /gsio;
$text =~ s/&amp;|<br>|<(\/)?body>|<p>|<(\/)?html>//gsoi;
$text =~ s/\[size=[0-9]+\]|\[\/size\]//ig; # size
$text =~ s/\[color=(\"\#)?[A-Za-z0-9]+(\")?\]|\[\/color\]//ig; # color
$text =~ s/\[url(=)?(")?//ig;
$text =~ s/(\")?\](.+)\[\/url\]/$2/gi;
$text =~ s/\[email(=)?(\")?//ig;
$text =~ s/(\")?\](.+)\[\/email\]/$2/gi;
$text =~ s/\[font=(\"\#)?[A-Za-z]+(\")?\]|\[\/font\]//ig; # font
$text =~ s/\[list(=)?[1Aa]?\]|\[\/list(=)?[1Aa]?\]//ig; # list
$text =~ s/\[\*\]/ - /ig;
$text =~ s/\[(\/)?code\]//ig;
return $text;
}


Can you briefly tell me what to seek, so I could try to fix it.
Regards,
Joop
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01874 seconds
  • Memory Usage 1,770KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete