Problem whith QuickLinks

Forum_Lexicon_Desc

Problem whith QuickLinks

Beitragvon Zef » 28. Jan 2006 03:10

Hi all, sorry i dont speak german at all

I've installed Lexicon on my site and all was good... yesterday.
Today I want to add quicklinks MOD but it is fonctionnal always if a word is LIKE the name in lexicon

Example : "Phishing" is good but "phishing" is not !

Can you help me ?
Zef
 
Beiträge: 2
Registriert: 28. Jan 2006 00:47

Beitragvon AmigaLink » 28. Jan 2006 13:28

Hmmm - I don't understand the problem. :?
You would like that in postings the word "phishing" be linked to the Lexicon entry "Phishing"?

If yes: Open the viewtopic.php
find
Code: Alles auswählen
      $message = str_replace('\"', '"', substr(preg_replace('#(\µ(((?>([^µ§]+|(?R)))*)\§))#se', "preg_replace(\$quicklink_keyword, \$quicklink_lex_url, '\\0')", 'µ' . $message . '§'), 1, -1));
and replace with
Code: Alles auswählen
      $message = str_replace('\"', '"', substr(preg_replace('#(\µ(((?>([^µ§]+|(?R)))*)\§))#si', "preg_replace(\$quicklink_keyword, \$quicklink_lex_url, '\\0')", 'µ' . $message . '§'), 1, -1));
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon Zef » 28. Jan 2006 22:54

Yes it is the problem (little).

So I tried your solution but it is not good because all posts contains a "preg_replace blablabla" string in the begining of the post and a "§" at the end if I apply your precedent code.

Sorry if I monopolize your time with my little problem.
Zef
Zef
 
Beiträge: 2
Registriert: 28. Jan 2006 00:47

Beitragvon AmigaLink » 29. Jan 2006 01:49

Bild Sorry

Find:
Code: Alles auswählen
      {
         $crosslink_word[] = '#\b(' . $row['keyword'] . ')\s#';
         $crosslink_url[] = '<a href="lexicon.'.$phpEx.'?'.LEXICON_KEY_URL.'=' . $row['keyword'] . '" class="crosslink" alt="'.$lang['to_Lexicon'].'" title="'.$lang['to_Lexicon'].'">' . $row['keyword'] . '</a> ';
         $crosslink_word[] = '#\s(' . $row['keyword'] . ')\b#';
         $crosslink_url[] = ' <a href="lexicon.'.$phpEx.'?'.LEXICON_KEY_URL.'=' . $row['keyword'] . '" class="crosslink" alt="'.$lang['to_Lexicon'].'" title="'.$lang['to_Lexicon'].'">' . $row['keyword'] . '</a>';
      }
Replace with:
Code: Alles auswählen
      {
         $crosslink_word[] = '#\b(' . $row['keyword'] . ')\s#i';
         $crosslink_url[] = '<a href="lexicon.'.$phpEx.'?'.LEXICON_KEY_URL.'=' . $row['keyword'] . '" class="crosslink" alt="'.$lang['to_Lexicon'].'" title="'.$lang['to_Lexicon'].'">' . $row['keyword'] . '</a> ';
         $crosslink_word[] = '#\s(' . $row['keyword'] . ')\b#i';
         $crosslink_url[] = ' <a href="lexicon.'.$phpEx.'?'.LEXICON_KEY_URL.'=' . $row['keyword'] . '" class="crosslink" alt="'.$lang['to_Lexicon'].'" title="'.$lang['to_Lexicon'].'">' . $row['keyword'] . '</a>';
      }

If you use the cache-version you must do the same in the includes/functions_cache.php and delete the includes/def_lexicon.php to regenerate the cache.

The disadvantage is that the word in the posting will automatically represented exactly like it in the lexicon!
And it exists no differend between words which will be acronyms like Mod and MOD. If you have Mod and MOD in your lexicon (eg. like here an AmigaLink.de) it will only linked to the first of this two entrys.
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW


Zurück zu Lexicon v2



Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 4 Gäste

cron