• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP strip_empty_words函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中strip_empty_words函数的典型用法代码示例。如果您正苦于以下问题:PHP strip_empty_words函数的具体用法?PHP strip_empty_words怎么用?PHP strip_empty_words使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了strip_empty_words函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: import_new_notice_suite

function import_new_notice_suite()
{
    global $dbh;
    global $notice_id;
    global $info_606_a;
    global $pmb_keyword_sep;
    global $info_900;
    $mots_cles = '';
    for ($a = 0; $a < sizeof($info_606_a); $a++) {
        $mots_cles .= $info_606_a[$a][0] . " {$pmb_keyword_sep} ";
    }
    $mots_cles ? $index_matieres = strip_empty_words($mots_cles) : ($index_matieres = '');
    $rqt_maj = "update notices set index_l='" . addslashes($mots_cles) . "', index_matieres=' " . addslashes($index_matieres) . " ' where notice_id='{$notice_id}' ";
    pmb_mysql_query($rqt_maj, $dbh);
    for ($i = 0; $i < count($info_900); $i++) {
        $req = " select idchamp, type, datatype from notices_custom where name='" . $info_900[$i]['n'] . "'";
        $res = pmb_mysql_query($req, $dbh);
        if (pmb_mysql_num_rows($res)) {
            $perso = pmb_mysql_fetch_object($res);
            if ($perso->idchamp) {
                if ($perso->type == 'list') {
                    $requete = "select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='" . addslashes($info_900[$i]['a']) . "' and notices_custom_champ={$perso->idchamp}";
                    $resultat = pmb_mysql_query($requete);
                    if (pmb_mysql_num_rows($resultat)) {
                        $value = pmb_mysql_result($resultat, 0, 0);
                    } else {
                        $requete = "select max(notices_custom_list_value*1) from notices_custom_lists where notices_custom_champ={$perso->idchamp}";
                        $resultat = pmb_mysql_query($requete);
                        $max = @pmb_mysql_result($resultat, 0, 0);
                        $n = $max + 1;
                        $requete = "insert into notices_custom_lists (notices_custom_champ,notices_custom_list_value,notices_custom_list_lib) values({$perso->idchamp},{$n},'" . addslashes($info_900[$i]['a']) . "')";
                        pmb_mysql_query($requete);
                        $value = $n;
                    }
                    $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_integer) values({$perso->idchamp},{$notice_id},{$value})";
                    pmb_mysql_query($requete);
                } elseif ($perso->type == 'date_box') {
                    $tmp_date = '';
                    $tmp_date = str_replace('/', '', $info_900[$i]['a']);
                    $tmp_date = substr($tmp_date, 4, 4) . '-' . substr($tmp_date, 0, 2) . '-' . substr($tmp_date, 2, 2);
                    $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_date) values({$perso->idchamp},{$notice_id},'" . addslashes($tmp_date) . "')";
                    pmb_mysql_query($requete);
                } else {
                    $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_" . $perso->datatype . ") values({$perso->idchamp},{$notice_id},'" . addslashes($info_900[$i]['a']) . "')";
                    pmb_mysql_query($requete);
                }
            }
        }
    }
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:50,代码来源:func_pmi_customfields.inc.php


示例2: save

 function save()
 {
     global $dbh;
     $no = new noeuds($this->num_noeud);
     $num_thesaurus = $no->num_thesaurus;
     $q = "update categories set ";
     $q .= "num_thesaurus = '" . $num_thesaurus . "', ";
     $q .= "libelle_categorie = '" . addslashes($this->libelle_categorie) . "', ";
     $q .= "note_application = '" . addslashes($this->note_application) . "', ";
     $q .= "comment_public = '" . addslashes($this->comment_public) . "', ";
     $q .= "comment_voir = '" . addslashes($this->comment_voir) . "', ";
     $q .= "index_categorie = ' " . addslashes(strip_empty_words($this->libelle_categorie, $this->langue)) . " ' ";
     $q .= "where num_noeud = '" . $this->num_noeud . "' and langue = '" . $this->langue . "' ";
     $r = pmb_mysql_query($q, $dbh);
     categories::update_index($this->num_noeud);
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:16,代码来源:categories.class.php


示例3: save

 function save()
 {
     global $dbh;
     if ($this->libelle == '') {
         die("Erreur de création frais");
     }
     if ($this->id_frais) {
         $q = "update frais set libelle ='" . $this->libelle . "', condition_frais = '" . $this->condition_frais . "', ";
         $q .= "montant = '" . $this->montant . "', num_cp_compta = '" . $this->num_cp_compta . "', ";
         $q .= "num_tva_achat = '" . $this->num_tva_achat . "', index_libelle = ' " . strip_empty_words($this->libelle) . " ' ";
         $q .= "where id_frais = '" . $this->id_frais . "' ";
         $r = mysql_query($q, $dbh);
     } else {
         $q = "insert into frais set libelle = '" . $this->libelle . "', condition_frais =  '" . $this->condition_frais . "', ";
         $q .= "montant = '" . $this->montant . "', num_cp_compta = '" . $this->num_cp_compta . "', num_tva_achat = '" . $this->num_tva_achat . "', index_libelle = ' " . strip_empty_words($this->libelle) . " ' ";
         $r = mysql_query($q, $dbh);
         $this->id_frais = mysql_insert_id($dbh);
     }
 }
开发者ID:bouchra012,项目名称:PMB,代码行数:19,代码来源:frais.class.php


示例4: save

 function save()
 {
     global $titre, $sujet, $idtheme, $idtype, $date_fin, $id_empr, $dbh, $demandes_statut_notice, $pmb_type_audit;
     global $demandes_email_demandes;
     $index_wew = $titre;
     $index_sew = strip_empty_words($index_wew);
     $index_ncontenu = strip_empty_words($sujet);
     $req = "insert into notices set \n\t\ttit1='" . $titre . "',\n\t\tn_contenu='" . $sujet . "',\n\t\tstatut ='" . $demandes_statut_notice . "',\n\t\tindex_sew ='" . $index_sew . "',\n\t\tindex_wew ='" . $index_wew . "',\n\t\tindex_n_contenu = '" . $index_ncontenu . "',\n\t\tcreate_date = CURRENT_TIMESTAMP()\n\t\t";
     mysql_query($req, $dbh);
     $id_notice = mysql_insert_id();
     if ($pmb_type_audit) {
         $query = "INSERT INTO audit SET ";
         $query .= "type_obj='1', ";
         $query .= "object_id='{$id_notice}', ";
         $query .= "type_modif=1 ";
         $result = @mysql_query($query, $dbh);
     }
     $date = date("Ymd", time());
     $req = "insert into demandes set \n\t\t\ttitre_demande='" . $titre . "',\n\t\t\tsujet_demande='" . $sujet . "',\n\t\t\ttheme_demande='" . $idtheme . "',\n\t\t\ttype_demande='" . $idtype . "',\n\t\t\tdeadline_demande='" . $date_fin . "',\n\t\t\tdate_demande='" . $date . "',\n\t\t\tdate_prevue='" . $date . "',\n\t\t\tnum_demandeur='" . $id_empr . "',\n\t\t\tnum_notice='" . $id_notice . "',\n\t\t\tetat_demande=1\n\t\t";
     mysql_query($req, $dbh);
     if ($demandes_email_demandes) {
         $this->alert_mail_users_pmb($id_empr);
     }
 }
开发者ID:bouchra012,项目名称:PMB,代码行数:24,代码来源:demandes.class.php


示例5: rec_record

 function rec_record($record, $source_id, $search_id)
 {
     global $charset, $base_path, $url, $search_index;
     $date_import = date("Y-m-d H:i:s", time());
     //Recherche du 001
     $ref = $record["001"][0];
     //Mise � jour
     if ($ref) {
         //Si conservation des anciennes notices, on regarde si elle existe
         if (!$this->del_old) {
             $requete = "select count(*) from entrepot_source_" . $source_id . " where ref='" . addslashes($ref) . "' and search_id='" . addslashes($search_id) . "'";
             $rref = pmb_mysql_query($requete);
             if ($rref) {
                 $ref_exists = pmb_mysql_result($rref, 0, 0);
             }
         }
         //Si pas de conservation des anciennes notices, on supprime
         if ($this->del_old) {
             $requete = "delete from entrepot_source_" . $source_id . " where ref='" . addslashes($ref) . "' and search_id='" . addslashes($search_id) . "'";
             pmb_mysql_query($requete);
             $this->delete_from_external_count($source_id, $ref);
         }
         //Si pas de conservation ou ref�rence inexistante
         if ($this->del_old || !$this->del_old && !$ref_exists) {
             //Insertion de l'ent�te
             $n_header["rs"] = "*";
             $n_header["ru"] = "*";
             $n_header["el"] = "1";
             $n_header["bl"] = "m";
             $n_header["hl"] = "0";
             $n_header["dt"] = $this->types[$search_index[$url][0]];
             if (!$n_header["dt"]) {
                 $n_header["dt"] = "a";
             }
             $n_header["001"] = $record["001"][0];
             //R�cup�ration d'un ID
             $requete = "insert into external_count (recid, source_id) values('" . addslashes($this->get_id() . " " . $source_id . " " . $ref) . "', " . $source_id . ")";
             $rid = pmb_mysql_query($requete);
             if ($rid) {
                 $recid = pmb_mysql_insert_id();
             }
             foreach ($n_header as $hc => $code) {
                 $requete = "insert into entrepot_source_" . $source_id . " (connector_id,source_id,ref,date_import,ufield,usubfield,field_order,subfield_order,value,i_value,recid,search_id) values(\n\t\t\t\t\t'" . addslashes($this->get_id()) . "'," . $source_id . ",'" . addslashes($ref) . "','" . $date_import . "',\n\t\t\t\t\t'" . $hc . "','',-1,0,'" . addslashes($code) . "','',{$recid},'" . addslashes($search_id) . "')";
                 pmb_mysql_query($requete);
             }
             $field_order = 0;
             foreach ($record as $field => $val) {
                 for ($i = 0; $i < count($val); $i++) {
                     if (is_array($val[$i])) {
                         foreach ($val[$i] as $sfield => $vals) {
                             for ($j = 0; $j < count($vals); $j++) {
                                 //if ($charset!="utf-8")  $vals[$j]=utf8_decode($vals[$j]);
                                 $requete = "insert into entrepot_source_" . $source_id . " (connector_id,source_id,ref,date_import,ufield,usubfield,field_order,subfield_order,value,i_value,recid,search_id) values(\n\t\t\t\t\t\t\t\t\t'" . addslashes($this->get_id()) . "'," . $source_id . ",'" . addslashes($ref) . "','" . $date_import . "',\n\t\t\t\t\t\t\t\t\t'" . addslashes($field) . "','" . addslashes($sfield) . "'," . $field_order . "," . $j . ",'" . addslashes($vals[$j]) . "',\n\t\t\t\t\t\t\t\t\t' " . addslashes(strip_empty_words($vals[$j])) . " ',{$recid},'" . addslashes($search_id) . "')";
                                 pmb_mysql_query($requete);
                             }
                         }
                     } else {
                         //if ($charset!="utf-8")  $vals[$i]=utf8_decode($vals[$i]);
                         $requete = "insert into entrepot_source_" . $source_id . " (connector_id,source_id,ref,date_import,ufield,usubfield,field_order,subfield_order,value,i_value,recid) values(\n\t\t\t\t\t\t\t'" . addslashes($this->get_id()) . "'," . $source_id . ",'" . addslashes($ref) . "','" . $date_import . "',\n\t\t\t\t\t\t\t'" . addslashes($field) . "',''," . $field_order . ",0,'" . addslashes($val[$i]) . "',\n\t\t\t\t\t\t\t' " . addslashes(strip_empty_words($val[$i])) . " ',{$recid},'" . addslashes($search_id) . "')";
                         pmb_mysql_query($requete);
                     }
                     $field_order++;
                 }
             }
         }
     }
 }
开发者ID:hogsim,项目名称:PMB,代码行数:67,代码来源:nasa_ads.class.php


示例6: import_new_notice_suite


//.........这里部分代码省略.........
            $requete = "update notices set niveau_biblio='a', niveau_hierar='2', year='" . addslashes($info_464[0]['d']) . "', npages='" . addslashes($info_464[0]['p']) . "', date_parution='" . $info['date_date'] . "' where notice_id={$notice_id}";
            mysql_query($requete);
            $requete = "insert into analysis (analysis_bulletin,analysis_notice) values({$bulletin_id},{$notice_id})";
            mysql_query($requete);
            $bulletin_ex = $bulletin_id;
        }
    } else {
        $bulletin_ex = 0;
    }
    //Traitement du thésaurus
    $unknown_desc = array();
    $ordre_categ = 0;
    for ($i = 0; $i < count($info_606_a); $i++) {
        for ($j = 0; $j < count($info_606_a[$i]); $j++) {
            $descripteur = trim($info_606_a[$i][$j]);
            //Recherche du terme
            $requete = "SELECT id_noeud,num_renvoi_voir from noeuds JOIN categories ON (noeuds.id_noeud = categories.num_noeud) where categories.libelle_categorie = '" . addslashes($descripteur) . "' ";
            $resultat = mysql_query($requete);
            if (mysql_num_rows($resultat) == 1) {
                $categ_id = mysql_result($resultat, 0, 0);
                if (mysql_result($resultat, 0, 1)) {
                    $categ_id = mysql_result($resultat, 0, 1);
                }
                $requete = "INSERT IGNORE INTO notices_categories (notcateg_notice,num_noeud,ordre_categorie) VALUES({$notice_id},{$categ_id},{$ordre_categ})";
                mysql_query($requete);
                $ordre_categ++;
            } else {
                $unknown_desc[] = $descripteur;
            }
        }
    }
    if (count($unknown_desc)) {
        $mots_cles = implode($pmb_keyword_sep, $unknown_desc);
        $requete = "UPDATE notices SET index_l=IF(index_l != '',CONCAT(index_l,'" . $pmb_keyword_sep . "','" . addslashes($mots_cles) . "'),'" . addslashes($mots_cles) . "'), index_matieres=IF(index_matieres != '',CONCAT(index_matieres,' ','" . addslashes(strip_empty_words($mots_cles)) . "'),'" . addslashes(strip_empty_words($mots_cles)) . "') WHERE notice_id='" . $notice_id . "'";
        mysql_query($requete);
    }
    //Thème
    if (count($info_900)) {
        $requete = "SELECT name,type,datatype FROM notices_custom WHERE idchamp=1";
        $res = mysql_query($requete);
        if (mysql_num_rows($res) && mysql_result($res, 0, 1) == "list" && mysql_result($res, 0, 2) == "integer") {
            $requete = "select max(notices_custom_list_value*1) from notices_custom_lists where notices_custom_champ=1";
            $resultat = mysql_query($requete);
            $max = @mysql_result($resultat, 0, 0);
            $n = $max + 1;
            for ($i = 0; $i < count($info_900); $i++) {
                for ($j = 0; $j < count($info_900[$i]); $j++) {
                    $requete = "select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='" . addslashes($info_900[$i][$j]) . "' and notices_custom_champ=1";
                    $resultat = mysql_query($requete);
                    if (mysql_num_rows($resultat)) {
                        $value = mysql_result($resultat, 0, 0);
                    } else {
                        $requete = "insert into notices_custom_lists (notices_custom_champ,notices_custom_list_value,notices_custom_list_lib) values(1,{$n},'" . addslashes($info_900[$i][$j]) . "')";
                        mysql_query($requete);
                        $value = $n;
                        $n++;
                    }
                    $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_integer) values(1,{$notice_id},{$value})";
                    mysql_query($requete);
                }
            }
        } else {
            mysql_query("insert into error_log (error_origin, error_text) values ('import_expl_" . addslashes(SESSid) . ".inc', 'Il n\\'y a pas de CP de notice avec l\\'identifiant=1 ou il n\\'est pas de type liste entier : le 900 n\\'est donc pas repris (Thème)') ");
        }
    }
    //Genres
开发者ID:bouchra012,项目名称:PMB,代码行数:67,代码来源:func_bcdi.inc.php


示例7: rec_record

 function rec_record($record)
 {
     global $charset, $base_path;
     $rec = new oai_record($record, $charset, $base_path . "/admin/connecteurs/in/oai/xslt", $this->metadata_prefix, $this->xslt_transform, $this->sets_names);
     $rec_uni = $rec->unimarc;
     if (!$rec->error) {
         //On a un enregistrement unimarc, on l'enregistre
         $rec_uni_dom = new xml_dom($rec_uni, $charset);
         if (!$rec_uni_dom->error) {
             //Initialisation
             $ref = "";
             $ufield = "";
             $usubfield = "";
             $field_order = 0;
             $subfield_order = 0;
             $value = "";
             $date_import = $rec->header["DATESTAMP"];
             $fs = $rec_uni_dom->get_nodes("unimarc/notice/f");
             //Recherche du 001
             for ($i = 0; $i < count($fs); $i++) {
                 if ($fs[$i]["ATTRIBS"]["c"] == "001") {
                     $ref = $rec_uni_dom->get_datas($fs[$i]);
                     break;
                 }
             }
             //Mise à jour
             if ($ref) {
                 //Si conservation des anciennes notices, on regarde si elle existe
                 if (!$this->del_old) {
                     $requete = "select count(*) from entrepot_source_" . $this->source_id . " where connector_id='" . addslashes($this->get_id()) . "' and ref='" . addslashes($ref) . "'";
                     $rref = pmb_mysql_query($requete);
                     if ($rref) {
                         $ref_exists = pmb_mysql_result($rref, 0, 0);
                     }
                 }
                 //Si pas de conservation des anciennes notices, on supprime
                 if ($this->del_old) {
                     $requete = "delete from entrepot_source_" . $this->source_id . " where connector_id='" . addslashes($this->get_id()) . "' and ref='" . addslashes($ref) . "'";
                     pmb_mysql_query($requete);
                 }
                 //Si pas de conservation ou reférence inexistante
                 if ($this->del_old || !$this->del_old && !$ref_exists) {
                     //Insertion de l'entête
                     $n_header["rs"] = $rec_uni_dom->get_value("unimarc/notice/rs");
                     $n_header["ru"] = $rec_uni_dom->get_value("unimarc/notice/ru");
                     $n_header["el"] = $rec_uni_dom->get_value("unimarc/notice/el");
                     $n_header["bl"] = $rec_uni_dom->get_value("unimarc/notice/bl");
                     $n_header["hl"] = $rec_uni_dom->get_value("unimarc/notice/hl");
                     $n_header["dt"] = $rec_uni_dom->get_value("unimarc/notice/dt");
                     //Récupération d'un ID
                     $requete = "insert into external_count (recid) values('" . addslashes($this->get_id() . " " . $this->source_id . " " . $ref) . "')";
                     $rid = pmb_mysql_query($requete);
                     if ($rid) {
                         $recid = pmb_mysql_insert_id();
                     }
                     foreach ($n_header as $hc => $code) {
                         $requete = "insert into entrepot_source_" . $this->source_id . " (connector_id,source_id,ref,date_import,ufield,usubfield,field_order,subfield_order,value,i_value,recid) values(\n\t\t\t\t\t\t\t'" . addslashes($this->get_id()) . "'," . $this->source_id . ",'" . addslashes($ref) . "','" . addslashes($date_import) . "',\n\t\t\t\t\t\t\t'" . $hc . "','',-1,0,'" . addslashes($code) . "','',{$recid})";
                         pmb_mysql_query($requete);
                     }
                     for ($i = 0; $i < count($fs); $i++) {
                         $ufield = $fs[$i]["ATTRIBS"]["c"];
                         $field_order = $i;
                         $ss = $rec_uni_dom->get_nodes("s", $fs[$i]);
                         if (is_array($ss)) {
                             for ($j = 0; $j < count($ss); $j++) {
                                 $usubfield = $ss[$j]["ATTRIBS"]["c"];
                                 $value = $rec_uni_dom->get_datas($ss[$j]);
                                 $subfield_order = $j;
                                 $requete = "insert into entrepot_source_" . $this->source_id . " (connector_id,source_id,ref,date_import,ufield,usubfield,field_order,subfield_order,value,i_value,recid) values(\n\t\t\t\t\t\t\t\t\t'" . addslashes($this->get_id()) . "'," . $this->source_id . ",'" . addslashes($ref) . "','" . addslashes($date_import) . "',\n\t\t\t\t\t\t\t\t\t'" . addslashes($ufield) . "','" . addslashes($usubfield) . "'," . $field_order . "," . $subfield_order . ",'" . addslashes($value) . "',\n\t\t\t\t\t\t\t\t\t' " . addslashes(strip_empty_words($value)) . " ',{$recid})";
                                 pmb_mysql_query($requete);
                             }
                         } else {
                             $value = $rec_uni_dom->get_datas($fs[$i]);
                             $requete = "insert into entrepot_source_" . $this->source_id . " (connector_id,source_id,ref,date_import,ufield,usubfield,field_order,subfield_order,value,i_value,recid) values(\n\t\t\t\t\t\t\t\t'" . addslashes($this->get_id()) . "'," . $this->source_id . ",'" . addslashes($ref) . "','" . addslashes($date_import) . "',\n\t\t\t\t\t\t\t\t'" . addslashes($ufield) . "','" . addslashes($usubfield) . "'," . $field_order . "," . $subfield_order . ",'" . addslashes($value) . "',\n\t\t\t\t\t\t\t\t' " . addslashes(strip_empty_words($value)) . " ',{$recid})";
                             pmb_mysql_query($requete);
                         }
                     }
                 }
                 $this->n_recu++;
             }
         }
     }
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:83,代码来源:oai.class.php


示例8: indexAcquisitions

 function indexAcquisitions()
 {
     global $msg, $dbh, $charset, $PMBusername;
     if (SESSrights & ADMINISTRATION_AUTH) {
         //SUGGESTIONS
         $result .= "<h3>" . htmlentities($msg["nettoyage_reindex_sug"], ENT_QUOTES, $charset) . "</h3>";
         $query = mysql_query("SELECT id_suggestion, titre, editeur, auteur, code, commentaires FROM suggestions");
         if (mysql_num_rows($query)) {
             while ($row = mysql_fetch_object($query)) {
                 // index acte
                 $req_update = "UPDATE suggestions ";
                 $req_update .= "SET index_suggestion = ' " . strip_empty_words($row->titre) . " " . strip_empty_words($row->editeur) . " " . strip_empty_words($row->auteur) . " " . $row->code . " " . strip_empty_words($row->commentaires) . " ' ";
                 $req_update .= "WHERE id_suggestion = " . $row->id_suggestion . " ";
                 $update = mysql_query($req_update);
             }
             mysql_free_result($query);
         }
         $actes = mysql_query("SELECT count(1) FROM suggestions", $dbh);
         $count = mysql_result($actes, 0, 0);
         $result .= htmlentities($msg["nettoyage_reindex_sug"], ENT_QUOTES, $charset) . " {$count} " . htmlentities($msg["nettoyage_res_reindex_sug"], ENT_QUOTES, $charset);
         //ENTITES
         $result .= "<h3>" . htmlentities($msg["nettoyage_reindex_ent"], ENT_QUOTES, $charset) . "</h3>";
         $query = mysql_query("SELECT id_entite, raison_sociale FROM entites");
         if (mysql_num_rows($query)) {
             while ($row = mysql_fetch_object($query)) {
                 // index acte
                 $req_update = "UPDATE entites ";
                 $req_update .= "SET index_entite = ' " . strip_empty_words($row->raison_sociale) . " ' ";
                 $req_update .= "WHERE id_entite = " . $row->id_entite . " ";
                 $update = mysql_query($req_update);
             }
             mysql_free_result($query);
         }
         $entites = mysql_query("SELECT count(1) FROM entites", $dbh);
         $count = mysql_result($entites, 0, 0);
         $result .= htmlentities($msg["nettoyage_reindex_ent"], ENT_QUOTES, $charset) . " {$count} " . htmlentities($msg["nettoyage_res_reindex_ent"], ENT_QUOTES, $charset);
         //ACTES
         $result .= "<h3>" . htmlentities($msg["nettoyage_reindex_act"], ENT_QUOTES, $charset) . "</h3>";
         $query = mysql_query("SELECT actes.id_acte, actes.numero, entites.raison_sociale, actes.commentaires, actes.reference FROM actes, entites where num_fournisseur=id_entite LIMIT " . $start . ", " . $lot . " ");
         if (mysql_num_rows($query)) {
             while ($row = mysql_fetch_object($query)) {
                 // index acte
                 $req_update = "UPDATE actes ";
                 $req_update .= "SET index_acte = ' " . $row->numero . " " . strip_empty_words($row->raison_sociale) . " " . strip_empty_words($row->commentaires) . " " . strip_empty_words($row->reference) . " ' ";
                 $req_update .= "WHERE id_acte = " . $row->id_acte . " ";
                 $update = mysql_query($req_update);
                 //index lignes_actes
                 $query_2 = mysql_query("SELECT id_ligne, code, libelle FROM lignes_actes where num_acte = '" . $row->id_acte . "' ");
                 if (mysql_num_rows($query_2)) {
                     while ($row_2 = mysql_fetch_object($query_2)) {
                         $req_update_2 = "UPDATE lignes_actes ";
                         $req_update_2 .= "SET index_ligne = ' " . strip_empty_words($row_2->libelle) . " ' ";
                         $req_update_2 .= "WHERE id_ligne = " . $row_2->id_ligne . " ";
                         $update_2 = mysql_query($req_update_2);
                     }
                     mysql_free_result($query_2);
                 }
             }
             mysql_free_result($query);
         }
         $actes = mysql_query("SELECT count(1) FROM actes", $dbh);
         $count = mysql_result($actes, 0, 0);
         $result .= htmlentities($msg["nettoyage_reindex_act"], ENT_QUOTES, $charset) . " {$count} " . htmlentities($msg["nettoyage_res_reindex_act"], ENT_QUOTES, $charset);
         //FINI
         $result .= htmlentities($msg["nettoyage_reindex_acq_fini"], ENT_QUOTES, $charset);
     } else {
         $result .= sprintf($msg["planificateur_rights_bad_user_rights"], $PMBusername);
     }
 }
开发者ID:bouchra012,项目名称:PMB,代码行数:69,代码来源:pmbesClean.class.php


示例9: update_global_index

 function update_global_index($id)
 {
     global $dbh;
     global $include_path;
     $p_perso = new custom_parametres_perso("authperso", "authperso", $this->id);
     $mots_perso = $p_perso->get_fields_recherche($id);
     if ($mots_perso) {
         $infos_global .= $mots_perso . ' ';
         $infos_global_index .= strip_empty_words($mots_perso) . ' ';
     }
     $req = "update authperso_authorities set authperso_infos_global='" . addslashes($infos_global) . "', authperso_index_infos_global='" . addslashes(' ' . $infos_global_index) . "' where id_authperso_authority={$id}";
     pmb_mysql_query($req, $dbh);
     $indexation_authority = new indexation_authperso($include_path . "/indexation/authorities/authperso/champs_base.xml", "authorities", AUT_TABLE_AUTHPERSO, $this->id);
     $indexation_authority->maj($id);
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:15,代码来源:authperso.class.php


示例10: import_new_notice_suite


//.........这里部分代码省略.........
        $mots_cles = $index_sujets;
    }
    for ($a = 0; $a < sizeof($info_600_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_600_a[$a][0];
        for ($j = 0; $j < sizeof($info_600_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_600_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_600_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_600_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_600_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_600_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_600_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_600_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_601_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_601_a[$a][0];
        for ($j = 0; $j < sizeof($info_601_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_601_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_601_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_601_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_601_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_601_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_601_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_601_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_602_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_602_a[$a][0];
        for ($j = 0; $j < sizeof($info_602_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_602_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_602_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_602_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_602_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_602_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_602_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_602_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_605_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_605_a[$a][0];
        for ($j = 0; $j < sizeof($info_605_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_605_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_605_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_605_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_605_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_605_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_605_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_605_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_606_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_606_a[$a][0];
        for ($j = 0; $j < sizeof($info_606_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_606_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_606_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_606_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_606_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_606_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_606_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_606_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_607_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_607_a[$a][0];
        for ($j = 0; $j < sizeof($info_607_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_607_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_607_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_607_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_607_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_607_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_607_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_607_z[$a][$j];
        }
    }
    $mots_cles ? $index_matieres = strip_empty_words($mots_cles) : ($index_matieres = '');
    $rqt_maj = "update notices set index_l='" . addslashes($mots_cles) . "', index_matieres=' " . addslashes($index_matieres) . " ' where notice_id='{$notice_id}' ";
    mysql_query($rqt_maj, $dbh);
    if ($tmp = trim($info_856[0])) {
        $rqt_maj = "update notices set thumbnail_url='" . addslashes($tmp) . "' where notice_id='" . $notice_id . "' ";
        mysql_query($rqt_maj, $dbh);
    }
}
开发者ID:bouchra012,项目名称:PMB,代码行数:101,代码来源:func_adav.inc.php


示例11: startwith

 function startwith($elt)
 {
     if (pmb_substr(strip_empty_words($elt["title"]), 0, pmb_strlen(strip_empty_words($this->start))) == strip_empty_words($this->start)) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:hogsim,项目名称:PMB,代码行数:8,代码来源:perio_a2z.class.php


示例12: rec_record

 function rec_record($record, $source_id, $search_id)
 {
     global $charset, $base_path;
     $date_import = date("Y-m-d H:i:s", time());
     $r = array();
     //Inversion du tableau
     $r["rs"] = $record["RS"][0]["value"] ? $record["RS"][0]["value"] : "*";
     $r["ru"] = $record["RU"][0]["value"] ? $record["RU"][0]["value"] : "*";
     $r["el"] = $record["EL"][0]["value"] ? $record["EL"][0]["value"] : "*";
     $r["bl"] = $record["BL"][0]["value"] ? $record["BL"][0]["value"] : "*";
     $r["hl"] = $record["HL"][0]["value"] ? $record["HL"][0]["value"] : "*";
     $r["dt"] = $record["DT"][0]["value"] ? $record["DT"][0]["value"] : "*";
     $exemplaires = array();
     for ($i = 0; $i < count($record["F"]); $i++) {
         if ($record["F"][$i]["C"] == 996) {
             //C'est une localisation, les localisations ne sont pas fusionnées.
             $t = array();
             for ($j = 0; $j < count($record["F"][$i]["S"]); $j++) {
                 //Sous champ
                 $sub = $record["F"][$i]["S"][$j];
                 $t[$sub["C"]] = $sub["value"];
             }
             $exemplaires[] = $t;
         } else {
             if ($record["F"][$i]["value"]) {
                 $r[$record["F"][$i]["C"]][] = $record["F"][$i]["value"];
             } else {
                 $t = array();
                 for ($j = 0; $j < count($record["F"][$i]["S"]); $j++) {
                     //Sous champ
                     $sub = $record["F"][$i]["S"][$j];
                     $t[$sub["C"]][] = $sub["value"];
                 }
                 $r[$record["F"][$i]["C"]][] = $t;
             }
         }
     }
     $record = $r;
     //Recherche du 001
     $ref = $record["001"][0];
     //Mise à jour
     if (!$ref) {
         $ref = md5(print_r($record, true));
     }
     if ($ref) {
         //Si conservation des anciennes notices, on regarde si elle existe
         if (!$this->del_old) {
             $requete = "select count(*) from entrepot_source_{$source_id} where ref='" . addslashes($ref) . "'";
             $rref = pmb_mysql_query($requete);
             if ($rref) {
                 $ref_exists = pmb_mysql_result($rref, 0, 0);
             }
         }
         //Si pas de conservation des anciennes notices, on supprime
         if ($this->del_old) {
             $requete = "delete from entrepot_source_{$source_id} where ref='" . addslashes($ref) . "'";
             pmb_mysql_query($requete);
             $this->delete_from_external_count($source_id, $ref);
         }
         //Si pas de conservation ou reférence inexistante
         if ($this->del_old || !$this->del_old && !$ref_exists) {
             //Insertion de l'entête
             $n_header["rs"] = $record["rs"];
             $n_header["ru"] = $record["ru"];
             $n_header["el"] = $record["el"];
             $n_header["bl"] = $record["bl"];
             $n_header["hl"] = $record["hl"];
             $n_header["dt"] = $record["dt"];
             //Récupération d'un ID
             $requete = "insert into external_count (recid, source_id) values('" . addslashes($this->get_id() . " " . $source_id . " " . $ref) . "', {$source_id})";
             $rid = pmb_mysql_query($requete);
             if ($rid) {
                 $recid = pmb_mysql_insert_id();
             }
             foreach ($n_header as $hc => $code) {
                 $requete = "insert into entrepot_source_{$source_id} (connector_id,source_id,ref,date_import,ufield,usubfield,field_order,subfield_order,value,i_value,recid,search_id) values(\n\t\t\t\t\t'" . addslashes($this->get_id()) . "'," . $source_id . ",'" . addslashes($ref) . "','" . $date_import . "',\n\t\t\t\t\t'" . $hc . "','',-1,0,'" . addslashes($code) . "','',{$recid},'" . addslashes($search_id) . "')";
                 pmb_mysql_query($requete);
             }
             $field_order = 0;
             foreach ($exemplaires as $exemplaire) {
                 $sub_field_order = 0;
                 foreach ($exemplaire as $exkey => $exvalue) {
                     $requete = "insert into entrepot_source_{$source_id} (connector_id,source_id,ref,date_import,ufield,usubfield,field_order,subfield_order,value,i_value,recid,search_id) values(\n\t\t\t\t\t\t'" . addslashes($this->get_id()) . "'," . $source_id . ",'" . addslashes($ref) . "','" . $date_import . "',\n\t\t\t\t\t\t'996','" . addslashes($exkey) . "'," . $field_order . "," . $sub_field_order . ",'" . addslashes($exvalue) . "',\n\t\t\t\t\t\t' " . addslashes(strip_empty_words($exvalue)) . " ',{$recid},'" . addslashes($search_id) . "')";
                     pmb_mysql_query($requete);
                     $sub_field_order++;
                 }
                 $field_order++;
             }
             foreach ($record as $field => $val) {
                 for ($i = 0; $i < count($val); $i++) {
                     if (is_array($val[$i])) {
                         foreach ($val[$i] as $sfield => $vals) {
                             for ($j = 0; $j < count($vals); $j++) {
                                 $requete = "insert into entrepot_source_{$source_id} (connector_id,source_id,ref,date_import,ufield,usubfield,field_order,subfield_order,value,i_value,recid,search_id) values(\n\t\t\t\t\t\t\t\t\t'" . addslashes($this->get_id()) . "'," . $source_id . ",'" . addslashes($ref) . "','" . $date_import . "',\n\t\t\t\t\t\t\t\t\t'" . addslashes($field) . "','" . addslashes($sfield) . "'," . $field_order . "," . $j . ",'" . addslashes($vals[$j]) . "',\n\t\t\t\t\t\t\t\t\t' " . addslashes(strip_empty_words($vals[$j])) . " ',{$recid},'" . addslashes($search_id) . "')";
                                 pmb_mysql_query($requete);
                             }
                         }
                     } else {
                         $requete = "insert into entrepot_source_{$source_id} (connector_id,source_id,ref,date_import,ufield,usubfield,field_order,subfield_order,value,i_value,recid,search_id) values(\n\t\t\t\t\t\t\t'" . addslashes($this->get_id()) . "'," . $source_id . ",'" . addslashes($ref) . "','" . $date_import . "',\n\t\t\t\t\t\t\t'" . addslashes($field) . "',''," . $field_order . ",0,'" . addslashes($val[$i]) . "',\n\t\t\t\t\t\t\t' " . addslashes(strip_empty_words($val[$i])) . " ',{$recid},'" . addslashes($search_id) . "')";
                         pmb_mysql_query($requete);
//.........这里部分代码省略.........
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:101,代码来源:cfile.class.php


示例13: test_other_query

function test_other_query($n_res = 0, $n_gen = 0, $n_tit = 0, $n_mat = 0, $query, $operator = TRUE, $force_regexp = FALSE)
{
    // fonction d'analyse d'une recherche sur titre
    // la fonction retourne un tableau :
    $query_result = array('type' => 0, 'restr' => '', 'order' => '', 'display', 'nbr_rows' => 0);
    // $query_result['type'] = type de la requête :
    // 0 : rien (problème)
    // 1: match/against
    // 2: regexp
    // 3: regexp pure sans traitement
    // $query_result['restr'] = critères de restriction
    // $query_result['order'] = critères de tri
    // $query_result['nbr_rows'] = nombre de lignes qui matchent
    // $query_result['display'] = affichage en clair de la requête utilisateur
    // si operator TRUE La recherche est booléenne AND
    // si operator FALSE La recherche est booléenne OR
    // si force_regexp : la recherche est forcée en mode regexp
    $stopwords = FALSE;
    global $dbh;
    // initialisation opérateur
    $operator ? $dopt = 'AND' : ($dopt = 'OR');
    $query = pmb_strtolower($query);
    // espaces en début et fin
    $query = pmb_preg_replace('/^\\s+|\\s+$/', '', $query);
    // espaces en double
    $query = pmb_preg_replace('/\\s+/', ' ', $query);
    // contrôle de la requete
    if (!$query) {
        return $query_result;
    }
    // déterminer si la requête est une regexp
    // si c'est le cas, on utilise la saisie utilisateur sans modification
    // (on part du principe qu'il sait ce qu'il fait)
    if (pmb_preg_match('/\\^|\\$|\\[|\\]|\\.|\\*|\\{|\\}|\\|/', $query)) {
        // regexp pure : pas de modif de la saisie utilisateur
        $query_result['type'] = 3;
        if ($n_res) {
            $query_result['restr'] = "n_resume REGEXP '{$query}' OR n_contenu REGEXP '{$query}' ";
        } else {
            $query_result['restr'] = "";
        }
        if ($n_gen) {
            if ($query_result['restr']) {
                $query_result['restr'] .= " OR ";
            }
            $query_result['restr'] .= " n_gen REGEXP '{$query}'";
        }
        if ($n_tit) {
            if ($query_result['restr']) {
                $query_result['restr'] .= " OR ";
            }
            $query_result['restr'] .= " tit1 REGEXP '{$query}' OR tit2 REGEXP '{$query}' OR tit3 REGEXP '{$query}' OR tit4 REGEXP '{$query}' OR index_serie REGEXP '{$query}' ";
        }
        if ($n_mat) {
            if ($query_result['restr']) {
                $query_result['restr'] .= " OR ";
            }
            $query_result['restr'] .= " index_l REGEXP '{$query}' ";
        }
        $query_result['order'] = "index_serie ASC, tnvol ASC, index_sew ASC";
        $query_result['display'] = $query;
    } else {
        // nettoyage de la chaîne
        $query = pmb_preg_replace("/[\\(\\)\\,\\;\\'\\!\\-\\+]/", ' ', $query);
        // on supprime les mots vides
        $query = strip_empty_words($query);
        // contrôle de la requete
        if (!$query) {
            return $query_result;
        }
        // la saisie est splitée en un tableau
        $tab = pmb_split('/\\s+/', $query);
        // on cherche à détecter les mots de moins de 4 caractères (stop words)
        // si il y des mots remplissant cette condition, c'est la méthode regexp qui sera employée
        foreach ($tab as $dummyke 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP strip_escape_custom函数代码示例发布时间:2022-05-23
下一篇:
PHP strip_empty_chars函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap