vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Diacritic marks in Search engine (https://vborg.vbsupport.ru/showthread.php?t=7224)

01-25-2001 05:36 PM

Hi all!

I use vBulletin as regional forum in Czech language. Because many users are lazy and write without diacritic marks I'll have to modify search engine, so that it would not use diacritics for searching. Because I don't know how to explain it here is example:

string in post#1: Digitální váha
string in post#2: digitalni vaha

I would like to both posts show when I write to search field: "digitalni" or "digitální".

Please help me! Thank you for any ideas on how to do it.

01-25-2001 05:44 PM

use regular expressions to replace them with their generic letter.

01-25-2001 06:27 PM

I must admit that I don't understand you. I thought that I need to hack search.php. You recommend replacement vars in admin control panel?

Sorry, but I misunderstood you.

01-25-2001 06:57 PM

Tohle uz me taky napadlo. Ale jak na to... :)

01-25-2001 10:10 PM

I meant PHP's regular expressions not vBulletin's replacement variables.

Look at: http://vbulletin.com/forum/showthread.php?threadid=7205

01-26-2001 01:14 PM

OK. I understand what reg. exp. are.
I checked search.php and found string "combinedwords". So what I have to do is check this string for reg. exp. But the search is processed by MySQL, not vB php script.
database is combined from posts with diacritics and without diacritics. I don't want to leave diacritics out forever.

01-27-2001 04:40 PM

Any help from Development team? I really need this feature.

02-18-2001 03:40 PM

Because nobody wants to help I've just researched vB 1.x php code and find my own way to do it.
I want to ask any expert or vB developer if I'm on the right track. I haven't tried it but I think it should work:

I will be replacing letters with:
Code:

str_replace("?","a",$string);
str_replace("?","i",$string);
...and so on

in $subject, $pagetext and $combinedwords string from following files:


misc.php [Building index part]
Code:

--------
    $subject=wordsonly($subject);
    $pagetext=$subject." ".wordsonly($pagetext);
    $usernames=wordsonly($usernames);
--------
HERE

global.php [function indexthread($threadid) part]
Code:

--------
    $subject=wordsonly($subject);
    $pagetext=$subject." ".wordsonly($pagetext);
    $usernames=wordsonly($usernames);
--------
HERE

search.php [MySQL Search SELECT]
Code:

HERE
--------
  $searchresults=$DB_site->query("SELECT DISTINCT
    threadid,
    lastpost
    FROM thread
    WHERE visible=1 $checkforum $subjectonly $checkuser $checkdate $combinedwords
    ORDER BY lastpost DESC");
--------

What do you think, will it work?


All times are GMT. The time now is 06:52 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.00945 seconds
  • Memory Usage 1,723KB
  • 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
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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