Neues Modul: Suche

Begonnen von Webfan, 26 Oktober 2011, 17:52:47

⏪ vorheriges - nächstes ⏩

0 Mitglieder und 1 Gast betrachten dieses Thema.

trulla

 :)
Gut, also dann funktioniert alles.

Webfan

Moin,
@Pragma Team: Habt Ihr schon das Modul angeschaut? *...mal vorsichtig nachfrag..*
Wenn es Kritikpunkte gibt, bitte ich um eine Mitteilung.

Außerdem bitte ich darum, sollte der DL freigeschaltet werden, folgenden Hinweis von oben in der Beschreibung zu ergänzen:
Zitat"Hinweis: Je nach Suchanfragen können in der cache Tabelle erhebliche Datenvolumen entstehen, es sollte also noch Datenbankspeicher in bis zu etwa 50-100% der Größe der bisherigen PMX Tabellen zur Verfügung stehen (oder mehr)."
Danke für Eure Mühen  :bye:

...Bitte nicht gedrängelt fühlen, ich bin halt ein neugieriger Mensch  ;)

:bye:

Webfan

Moin,
hallo, hallo  :bye:

Die did you mean Funktion von algebre funktioniert nicht mehr, da Google wohl was geändert hat.
Die neue Lösung ist noch nicht so weit das ich sie veröffentlichen kann.

Ansonsten hab ich bisher nix zu verbessern gefunden...?

:bye:

shorty

 hello  :smile:

Thanks for your job  :thumbup:
But it's not work for me, i've the same error :
Specified key was too long; max key length is 1000 bytes
and i don't know how do for add good tables config

This what my dumper tool tell me
Table `mxtradz_suche_cache`


Fields of table `mxtradz_suche_cache`
créer nouveau champs

Field Type Size NULL Key Attribute Default Extra Tri Commentaire
edit field  delete field  1. query text non utf8_general_ci
edit field  delete field  2. url text non utf8_general_ci
edit field  delete field  3. preview text non utf8_general_ci
edit field  delete field  4. module varchar 255 non utf8_general_ci
edit field  delete field  5. ranking decimal 20,2 non 0.00
edit field  delete field  6. time text non utf8_general_ci

Indices de la table `mxtradz_suche_cache`
  Nom colonnes Taille Type Permettre la duplication Cardinalité Commentaire
La table ne contient aucun indice


Thanks you for your support
Regards

Webfan

Hello shorty,
if you use utf8 collation the max keysize for url and query would be 166.
So try to install the tables and then create a primary key url and query with size 166.

:bye:

shorty

#25
 Ok, thanks, it's working for me now  :thumbup:
But it's not work with smf forums  :gruebel:
i've tried to modify this
'SMF' => array( 0,1, 'funcSucheMod_SMF' ),
to
'SMF' => array( 1,1, 'funcSucheMod_SMF' ),

and i don't see smf lines into Suche.functions.php

This mod will be perfect if it's integrate SMF & Coppermine/Sirius & more mods

I've also tried :

function funcSucheMod_Forum($cq, $q, $rankingDEF)
{
global $prefix;
global $SucheSettingsDefault;

  $sqlq="SELECT * FROM my_forum_prefix_smf_topics
                                   WHERE
                                    titel LIKE '%".mxAddSlashesForSQL(strip_tags($q))."%'
                                   OR
                                    beschreibung LIKE '%".mxAddSlashesForSQL(strip_tags($q))."%'
                                   OR
                                    keywords LIKE '%".mxAddSlashesForSQL(strip_tags($q))."%'
                                   ";
   $result = sql_query($sqlq);
   while($row = sql_fetch_array($result) )
     {
         $ranking = $rankingDEF;
         
         if($cq == $q)$ranking = $ranking + _SUCHE_RANKING_COMPLETE_QUERY_;

         $countwords= substr_count($row['titel'],  strip_tags($q));
         $ranking = $ranking + ($countwords * _SUCHE_RANKING_TITLE_MATCH_);

         $countwords= substr_count($row['beschreibung'],  strip_tags($q));
         $ranking = $ranking + ($countwords * _SUCHE_RANKING_TEXT_MATCH_);

         
$contentpreview = substr(strip_tags($row['beschreibung']), 0, strlen($q) ).'... .... '
                  .substr(strip_tags($row['beschreibung']), strnpos(strip_tags($row['beschreibung']), strip_tags($q), 1), 580).'...';


         $contentpreview =  str_ireplace("".strip_tags($q)."",
                         '<font style="'._SUCHE_HIGHLIGHT_FONTSTYLE_.'">'
                         .strip_tags($q).
                         '</font>',
                          strip_tags($contentpreview)  );
                         
         $link = 'modules.php?action=search2&name=Forum&search='.$row['id'];     
         
         $sqlq2="INSERT INTO ".$prefix._SUCHE_TABLENAME_CACHE_."
                                               SET
                                                query='".mxAddSlashesForSQL(strip_tags($cq))."',
                                                url='".mxAddSlashesForSQL(strip_tags($link))."',
                                                preview='".mxAddSlashesForSQL($contentpreview)."',
                                                module='Forum',
                                                ranking='".mxAddSlashesForSQL(strip_tags($ranking))."',
                                                time='".intval(_SUCHE_JETZT_SEKUNDEN_)."',
                                                title='".mxAddSlashesForSQL(strip_tags($row['titel']))."'
                                                ";
         sql_query($sqlq2);                                       
     }                                   


}


But it's not work

note :  the prefix of this smf forum is different than prefix of the website

Webfan

Sorry, maybe I will add it later but for now you have to add mods for your own in Suche.functions.php, like the existing examples.

shorty

ok i understand  :smile:,
i hope you will have the time to do this.
the mod will be complete after smf integration.
Algebre do it into this topic http://www.pragmamx.fr/Forum-topic-1484.html
but the different search are separate. I don't know how adapt this part of mods into you script to have one request and all results of differents modules in one page

Webfan

Version 1.0.2.0: http://www.webfan.de/Downloads-lid-Suche-Suchemodul-fuer-das-PragmaMx-58.html
changes:
- did you mean disabled by default
- rezepte modul search
- smf modul search (I did not tested it so far, unsure about $link?)

#####################################################################################
function funcSucheMod_SMF($cq, $q, $rankingDEF)
{
global $prefix;
global $SucheSettingsDefault;


  $sqlq="SELECT * FROM ".$prefix."_smf_messages
                                 WHERE
                                  subject LIKE '%".mxAddSlashesForSQL(strip_tags($q))."%'
                                 OR
                                  body LIKE '%".mxAddSlashesForSQL(strip_tags($q))."%'
                                 ";
                                 

   $result = sql_query($sqlq);
   while($row = sql_fetch_array($result) )
     {
         $ranking = $rankingDEF;

         if($cq == $q)$ranking = $ranking + _SUCHE_RANKING_COMPLETE_QUERY_;

         $countwords= substr_count($row['subject'],  strip_tags($q));
         $ranking = $ranking + ($countwords * _SUCHE_RANKING_TITLE_MATCH_);

         $countwords= substr_count($row['body'],  strip_tags($q));
         $ranking = $ranking + ($countwords * _SUCHE_RANKING_TEXT_MATCH_);


$contentpreview = substr(strip_tags($row['body']), 0, strlen($q) ).'... .... '
                  .substr(strip_tags($row['body']), strnpos(strip_tags($row['body']), strip_tags($q), 1), 580).'...';


         $contentpreview =  str_ireplace("".strip_tags($q)."",
                         '<font style="'._SUCHE_HIGHLIGHT_FONTSTYLE_.'">'
                         .strip_tags($q).
                         '</font>',
                          strip_tags($contentpreview)  );


$link='modules.php?name=Forum&amp;topic='.$row['ID_TOPIC'].'&amp;start=msg'.$row['ID_MSG'].'#msg'.$row['ID_MSG'].'';

         $sqlq2="INSERT INTO ".$prefix._SUCHE_TABLENAME_CACHE_."
                                               SET
                                                query='".mxAddSlashesForSQL(strip_tags($cq))."',
                                                url='".mxAddSlashesForSQL(strip_tags($link))."',
                                                preview='".mxAddSlashesForSQL($contentpreview)."',
                                                module='SMF',
                                                ranking='".mxAddSlashesForSQL(strip_tags($ranking))."',
                                                time='".intval(_SUCHE_JETZT_SEKUNDEN_)."',
                                                title='".mxAddSlashesForSQL(strip_tags($row['subject']))."'
                                                ";
         sql_query($sqlq2);
     }


}
#####################################################################################


:bye:


shorty

 it's works perfectly, thanks very much for you works !!   :drinks:

so i've few ideas for this mod.
i think if it's include by default search into other pragmaMx addons (with autorization)
-mx-shop support
-Coppermine support
-Sirus Gallery Support
-Contest-Mx Support

Best regards

shorty

 Hello and thanks for your great work on PragmaMx
I ve found a minor error in the version i have.

in suche.functions.php

found :

         $link = 'modules.php?name=Web_Links&amp;lid='.$row['lid'];     

replace by

          $link = 'modules.php?name=Web_Links&op=view&lid='.$row['lid'];

:smile: