当前位置: 首页>>代码示例>>PHP>>正文


PHP categories::searchLibelle方法代码示例

本文整理汇总了PHP中categories::searchLibelle方法的典型用法代码示例。如果您正苦于以下问题:PHP categories::searchLibelle方法的具体用法?PHP categories::searchLibelle怎么用?PHP categories::searchLibelle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在categories的用法示例。


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

示例1: import_new_notice_suite

function import_new_notice_suite()
{
    global $dbh;
    global $notice_id;
    global $info_606_a;
    global $info_900;
    $ordre_categ = 0;
    for ($i = 0; $i < count($info_606_a); $i++) {
        for ($j = 0; $j < count($info_606_a[$i]); $j++) {
            $descripteur = $info_606_a[$i][$j];
            //Recherche du terme
            //dans le thesaurus par defaut et dans la langue de l'interface
            $libelle = addslashes($descripteur);
            $categ_id = categories::searchLibelle($libelle);
            if ($categ_id) {
                $requete = "INSERT INTO notices_categories (notcateg_notice,num_noeud,ordre_categorie) values({$notice_id},{$categ_id},{$ordre_categ})";
                pmb_mysql_query($requete, $dbh);
                $ordre_categ++;
            }
        }
    }
    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_" . $perso->datatype . ") values({$perso->idchamp},{$notice_id},'" . $value . "')";
                    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,代码行数:51,代码来源:func_biotope.inc.php

示例2: import_new_notice_suite

function import_new_notice_suite()
{
    global $dbh;
    global $notice_id;
    global $info_606;
    $ordre_categ = 0;
    foreach ($info_606 as $categorie) {
        $libelle = $categorie["a"];
        $lang = $categorie["z"];
        // Recherche du terme
        // dans le thesaurus par defaut et dans la langue de l'interface
        $libelle = addslashes($libelle);
        $categ_id = categories::searchLibelle($libelle, 0, $lang);
        if ($categ_id) {
            $requete = "INSERT INTO notices_categories (notcateg_notice,num_noeud,ordre_categorie) values({$notice_id},{$categ_id},{$ordre_categ})";
            pmb_mysql_query($requete, $dbh);
            $ordre_categ++;
        }
    }
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:20,代码来源:func_lvm.inc.php

示例3: create_categ

function create_categ($tab_categ, $id_thes, $id_parent, $create_node = true)
{
    global $lang;
    if (trim($tab_categ)) {
        $resultat = categories::searchLibelle(addslashes($tab_categ), $id_thes, $lang, $id_parent);
        if (!$resultat && $id_parent && $create_node) {
            // création de la catégorie
            $n = new noeuds();
            $n->num_parent = $id_parent;
            $n->num_thesaurus = $id_thes;
            $n->save();
            $resultat = $id_n = $n->id_noeud;
            $c = new categories($id_n, $lang);
            $c->libelle_categorie = $tab_categ;
            $c->save();
        }
        return $resultat;
    }
    return 0;
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:20,代码来源:func_category_auto.inc.php

示例4: traite_categories_from_form

function traite_categories_from_form()
{
    global $rameau, $categ_pas_trouvee;
    global $dbh;
    global $thes;
    $tableau_606 = unserialize(stripslashes($rameau));
    $info_606_a = $tableau_606["info_606_a"];
    $info_606_j = $tableau_606["info_606_j"];
    $info_606_x = $tableau_606["info_606_x"];
    $info_606_y = $tableau_606["info_606_y"];
    $info_606_z = $tableau_606["info_606_z"];
    $categ_pas_trouvee = array();
    for ($a = 0; $a < sizeof($info_606_a); $a++) {
        $libelle_final = trim($info_606_a[$a][0]);
        if (!$libelle_final) {
            break;
        }
        $res_a = categories::searchLibelle(addslashes($libelle_final), $thes->id_thesaurus, 'fr_FR', '');
        if ($res_a) {
            $categ_retour[]['categ_id'] = $res_a;
        } else {
            $categ_pas_trouvee[] = $libelle_final;
        }
        // récup des sous-categ $j
        for ($j = 0; $j < sizeof($info_606_j[$a]); $j++) {
            $res_j = categories::searchLibelle(addslashes(trim($info_606_j[$a][$j])), $thes->id_thesaurus, 'fr_FR', '');
            if ($res_j) {
                $categ_retour[]['categ_id'] = $res_j;
            } else {
                $categ_pas_trouvee[] = trim($info_606_j[$a][$j]);
            }
        }
        // récup des sous-categ $x
        for ($x = 0; $x < sizeof($info_606_x[$a]); $x++) {
            $res_x = categories::searchLibelle(addslashes(trim($info_606_x[$a][$x])), $thes->id_thesaurus, 'fr_FR', '');
            if ($res_x) {
                $categ_retour[]['categ_id'] = $res_x;
            } else {
                $categ_pas_trouvee[] = trim($info_606_x[$a][$x]);
            }
        }
        for ($y = 0; $y < sizeof($info_606_y[$a]); $y++) {
            $res_y = categories::searchLibelle(addslashes(trim($info_606_y[$a][$y])), $thes->id_thesaurus, 'fr_FR', '');
            if ($res_y) {
                $categ_retour[]['categ_id'] = $res_y;
            } else {
                $categ_pas_trouvee[] = trim($info_606_y[$a][$y]);
            }
        }
        for ($z = 0; $z < sizeof($info_606_z[$a]); $z++) {
            $res_z = categories::searchLibelle(addslashes(trim($info_606_z[$a][$z])), $thes->id_thesaurus, 'fr_FR', '');
            if ($res_z) {
                $categ_retour[]['categ_id'] = $res_z;
            } else {
                $categ_pas_trouvee[] = trim($info_606_z[$a][$z]);
            }
        }
    }
    // DEBUG echo "<pre>"; print_r($categ_retour) ; echo "</pre>"; exit ;
    return $categ_retour;
}
开发者ID:bouchra012,项目名称:PMB,代码行数:61,代码来源:func_rameau_to_thesaurus.inc.php

示例5: find_categ

function find_categ($term, $id_thesaurus, $lang)
{
    $categ_id = categories::searchLibelle(addslashes($term), $id_thesaurus, $lang);
    if ($categ_id) {
        //le terme existe
        $noeud = new noeuds($categ_id);
        if ($noeud->num_renvoi_voir) {
            $categ_to_index = $noeud->num_renvoi_voir;
        } else {
            $categ_to_index = $categ_id;
        }
    } else {
        $categ_to_index = 0;
    }
    return $categ_to_index;
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:16,代码来源:func_delphe.inc.php

示例6: import_new_notice_suite

function import_new_notice_suite()
{
    global $dbh;
    global $notice_id;
    global $info_606_a, $info_606_j, $info_606_x, $info_606_y, $info_606_z;
    global $id_rech_theme;
    global $thesaurus_defaut;
    global $thes;
    /* 
    echo "<pre>";
    print_r ($info_949);
    print_r ($info_997);
    echo "</pre>";
    */
    // les champs $606 sont stockés dans les catégories
    //	$a >> en sous catégories de $id_rech_theme
    // 		$j en complément de $a
    //		$x en sous catégories de $a
    // $y >> en sous catégories de $id_rech_geo
    // $z >> en sous catégories de $id_rech_chrono
    // TRAITEMENT :
    // pour $a=0 à size_of $info_606_a
    //	pour $j=0 à size_of $info_606_j[$a]
    //		concaténer $libelle_j .= $info_606_j[$a][$j]
    //	$libelle_final = $info_606_a[0]." ** ".$libelle_j
    //	Rechercher si l'enregistrement existe déjà dans categories =
    //	$categid = categories::searchLibelle(addslashes($libelle_final), $thesaurus_defaut, 'fr_FR', $id_rech_theme)
    //	Créer si besoin et récupérer l'id $categid_a
    //	$categid_parent =  $categid_a
    //	pour $x=0 à size_of $info_606_x[$a]
    //		Rechercher si l'enregistrement existe déjà dans categories =
    //	$categid = categories::searchLibelle(addslashes($info_606_x[$a][$x]), $thesaurus_defaut, 'fr_FR', $categ_parent)
    //		Créer si besoin et récupérer l'id $categid_parent
    //
    //	$categid_parent =  $id_rech_geo
    //	pour $y=0 à size_of $info_606_y[$a]
    //		Rechercher si l'enregistrement existe déjà dans categories =
    //	$categid = categories::searchLibelle(addslashes($info_606_y[$a][$y]), $thesaurus_defaut, 'fr_FR', $categ_parent)
    //		Créer si besoin et récupérer l'id $categid_parent
    //
    //	$categid_parent =  $id_rech_chrono
    //	pour $y=0 à size_of $info_606_z[$a]
    //		Rechercher si l'enregistrement existe déjà dans categories =
    //	$categid = categories::searchLibelle(addslashes($info_606_z[$a][$y]]), $thesaurus_defaut, 'fr_FR', $categ_parent)
    //		Créer si besoin et récupérer l'id $categid_parent
    //
    $libelle_j = "";
    for ($a = 0; $a < sizeof($info_606_a); $a++) {
        for ($j = 0; $j < sizeof($info_606_j[$a]); $j++) {
            if (!$libelle_j) {
                $libelle_j .= trim($info_606_j[$a][$j]);
            } else {
                $libelle_j .= " ** " . trim($info_606_j[$a][$j]);
            }
        }
        if (!$libelle_j) {
            $libelle_final = trim($info_606_a[$a][0]);
        } else {
            $libelle_final = trim($info_606_a[$a][0]) . " ** " . $libelle_j;
        }
        if (!$libelle_final) {
            break;
        }
        $res_a = categories::searchLibelle(addslashes($libelle_final), $thesaurus_defaut, 'fr_FR', $id_rech_theme);
        if ($res_a) {
            $categid_a = $res_a;
        } else {
            $categid_a = create_categ($id_rech_theme, $libelle_final, strip_empty_words($libelle_final, 'fr_FR'));
        }
        // récup des sous-categ en cascade sous $a
        $categ_parent = $categid_a;
        for ($x = 0; $x < sizeof($info_606_x[$a]); $x++) {
            $res_x = categories::searchLibelle(addslashes(trim($info_606_x[$a][$x])), $thesaurus_defaut, 'fr_FR', $categ_parent);
            if ($res_x) {
                $categ_parent = $res_x;
            } else {
                $categ_parent = create_categ($categ_parent, trim($info_606_x[$a][$x]), strip_empty_words($info_606_x[$a][$x], 'fr_FR'));
            }
        }
        // fin récup des $x en cascade sous l'id de la catégorie 606$a
        if ($categ_parent != $id_rech_theme) {
            // insertion dans la table notices_categories
            $rqt_ajout = "insert into notices_categories set notcateg_notice='" . $notice_id . "', num_noeud='" . $categ_parent . "' ";
            $res_ajout = @mysql_query($rqt_ajout, $dbh);
        }
        // récup TOUT EN CASCADE
        $id_rech_geo = $categ_parent;
        // récup des categ géo à loger sous la categ géo principale
        $categ_parent = $id_rech_geo;
        for ($y = 0; $y < sizeof($info_606_y[$a]); $y++) {
            $res_y = categories::searchLibelle(addslashes(trim($info_606_y[$a][$y])), $thesaurus_defaut, 'fr_FR', $categ_parent);
            if ($res_y) {
                $categ_parent = $res_y;
            } else {
                $categ_parent = create_categ($categ_parent, trim($info_606_y[$a][$y]), strip_empty_words($info_606_y[$a][$y], 'fr_FR'));
            }
        }
        // fin récup des $y en cascade sous l'id de la catégorie principale thème géo
        if ($categ_parent != $id_rech_geo) {
            // insertion dans la table notices_categories
//.........这里部分代码省略.........
开发者ID:bouchra012,项目名称:PMB,代码行数:101,代码来源:func_rameau_mba.inc.php

示例7: import_new_notice_suite


//.........这里部分代码省略.........
                if ($flag_titre_serie_recuperation && $is_serie || !$is_serie) {
                    $requete = "select * from notices_custom_values where notices_custom_small_text='" . $num_opsys . "'";
                    //print "new $type_opsys:    $requete <br />";
                    $resultat = pmb_mysql_query($requete);
                    //Notice existe-t-elle comme notice temporaire?
                    if (@pmb_mysql_num_rows($resultat)) {
                        //Si oui, récupération id notice temporaire a supprimer
                        $old_n = pmb_mysql_fetch_object($resultat);
                        $notice_id_old = $old_n->notices_custom_origine;
                        // modifie les anciennes relations sur la vrai notice
                        $requete = "update notices_relations set linked_notice='{$notice_id}' where linked_notice='{$notice_id_old}' ";
                        //print "$requete <br />";
                        pmb_mysql_query($requete);
                        // suppression de la notice temporaire
                        $requete = "delete from notices where notice_id=" . $notice_id_old;
                        pmb_mysql_query($requete);
                        $requete = "delete from notices_custom_values where notices_custom_origine='" . $notice_id_old . "'";
                        pmb_mysql_query($requete);
                        //print "$requete <br />";
                    }
                } else {
                    if ($is_serie) {
                        // suprimer la notice car on en veut pas
                        del_notice($notice_id);
                        return;
                    }
                }
            }
        }
    }
    //Genre dans Thesaurus
    for ($i = 0; $i < count($info_902_a); $i++) {
        for ($j = 0; $j < count($info_902_a[$i]); $j++) {
            $resultat = categories::searchLibelle(addslashes($info_902_a[$i][$j]), $num_thesaurus, 'fr_FR');
            if (!$resultat) {
                /*vérification de l'existence des categs, sinon création */
                $resultat = create_categ($thes, $thes->num_noeud_racine, $info_902_a[$i][$j], ' ' . strip_empty_words($info_902_a[$i][$j]) . ' ');
            }
            /* ajout de l'indexation à la notice dans la table notices_categories*/
            $rqt_ajout = "insert into notices_categories set notcateg_notice='" . $notice_id . "', num_noeud='" . $resultat . "' ";
            $res_ajout = @pmb_mysql_query($rqt_ajout, $dbh);
        }
    }
    //centre interet dans Thesaurus
    for ($i = 0; $i < count($info_901); $i++) {
        $resultat = categories::searchLibelle(addslashes($info_901[$i]['a']), $num_thesaurus_centre_interet, 'fr_FR');
        if (!$resultat) {
            /*vérification de l'existence des categs, sinon création */
            $resultat = create_categ($thes_centre_interet, $thes_centre_interet->num_noeud_racine, $info_901[$i]['a'], ' ' . strip_empty_words($info_901[$i]['a']) . ' ', $info_901[$i][3]);
        }
        /* ajout de l'indexation à la notice dans la table notices_categories*/
        $rqt_ajout = "insert into notices_categories set notcateg_notice='" . $notice_id . "', num_noeud='" . $resultat . "' ";
        $res_ajout = @pmb_mysql_query($rqt_ajout, $dbh);
    }
    // Pcdm (686) dans le plan de classement
    //	print "<pre>";	print_r($info_686_a);print "</pre>";
    if (count($info_686_a)) {
        //vérification de l'existence des categs, sinon création
        $requete = "select indexint_id from indexint where indexint_name='" . addslashes($info_686_a[0]) . "' and num_pclass='2'";
        //print "$requete <br />";
        $result = pmb_mysql_query($requete);
        if ($row = pmb_mysql_fetch_row($result)) {
            $indexint_id = $row[0];
        } else {
            $requete = "insert into indexint SET indexint_name='" . addslashes($info_686_a[0]) . "', num_pclass='2' ";
            //print "$requete <br />";
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:67,代码来源:func_opsys_morges.inc.php

示例8: import_new_notice_suite


//.........这里部分代码省略.........
            //Supression de la notice
            $requete = "delete from notices where notice_id={$notice_id}";
            mysql_query($requete);
            $bulletin_ex = $bulletin_id;
        } else {
            $annee = $info_464[0]['d'];
            $date_parution = $info['date_date'];
            //Récupère la date du bulletin (non disponible autrement si il existe déjà) pour l'article
            $select = "SELECT date_date FROM bulletins WHERE bulletin_id='" . $bulletin_id . "'";
            $res_date = mysql_query($select);
            if ($res_date && mysql_num_rows($res_date)) {
                $date_parution = mysql_result($res_date, 0, 0);
                $annee = substr($date_parution, 0, 4);
            }
            //Passage de la notice en article
            $requete = "update notices set niveau_biblio='a', niveau_hierar='2', year='" . addslashes($annee) . "', npages='" . addslashes($info_464[0]['p']) . "', date_parution='" . addslashes($date_parution) . "' 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
            //dans le thesaurus par defaut et dans la langue de l'interface
            $libelle = addslashes($descripteur);
            $categ_id = categories::searchLibelle($libelle);
            if ($categ_id) {
                $requete = "INSERT 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($info_610)) {
        for ($i = 0; $i < count($info_610); $i++) {
            $tmp = explode($pmb_keyword_sep, $info_610[$i]);
            if (count($tmp)) {
                foreach ($tmp as $value) {
                    if ($libelle = addslashes(trim($value))) {
                        $categ_id = categories::searchLibelle($libelle);
                        if ($categ_id) {
                            $requete = "INSERT INTO notices_categories (notcateg_notice,num_noeud,ordre_categorie) VALUES({$notice_id},{$categ_id},{$ordre_categ})";
                            mysql_query($requete);
                            $ordre_categ++;
                        } else {
                            $unknown_desc[] = trim($value);
                        }
                    }
                }
            }
        }
    }
    if ($unknown_desc) {
        $mots_cles = implode($pmb_keyword_sep, $unknown_desc);
        $requete = "update notices set index_l='" . addslashes($mots_cles) . "', index_matieres=' " . addslashes(strip_empty_words($mots_cles)) . " ' where notice_id={$notice_id}";
        mysql_query($requete);
开发者ID:bouchra012,项目名称:PMB,代码行数:67,代码来源:func_bretagne.inc.php

示例9: import_new_notice_suite


//.........这里部分代码省略.........
        for ($j = 0; $j < sizeof($info_600_j[$a]); $j++) {
            $rameau .= " -- " . trim($info_600_j[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_600_x[$a]); $j++) {
            $rameau .= " -- " . trim($info_600_x[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_600_y[$a]); $j++) {
            $rameau .= " -- " . trim($info_600_y[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_600_z[$a]); $j++) {
            $rameau .= " -- " . trim($info_600_z[$a][$j]);
        }
    }
    for ($a = 0; $a < sizeof($info_601_a); $a++) {
        $rameau .= "@@@" . trim($info_601_a[$a][0]);
        for ($j = 0; $j < sizeof($info_601_j[$a]); $j++) {
            $rameau .= " -- " . trim($info_601_j[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_601_x[$a]); $j++) {
            $rameau .= " -- " . trim($info_601_x[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_601_y[$a]); $j++) {
            $rameau .= " -- " . trim($info_601_y[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_601_z[$a]); $j++) {
            $rameau .= " -- " . trim($info_601_z[$a][$j]);
        }
    }
    for ($a = 0; $a < sizeof($info_602_a); $a++) {
        $rameau .= "@@@" . trim($info_602_a[$a][0]);
        for ($j = 0; $j < sizeof($info_602_j[$a]); $j++) {
            $rameau .= " -- " . trim($info_602_j[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_602_x[$a]); $j++) {
            $rameau .= " -- " . trim($info_602_x[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_602_y[$a]); $j++) {
            $rameau .= " -- " . trim($info_602_y[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_602_z[$a]); $j++) {
            $rameau .= " -- " . trim($info_602_z[$a][$j]);
        }
    }
    for ($a = 0; $a < sizeof($info_605_a); $a++) {
        $rameau .= "@@@" . trim($info_605_a[$a][0]);
        for ($j = 0; $j < sizeof($info_605_j[$a]); $j++) {
            $rameau .= " -- " . trim($info_605_j[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_605_x[$a]); $j++) {
            $rameau .= " -- " . trim($info_605_x[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_605_y[$a]); $j++) {
            $rameau .= " -- " . trim($info_605_y[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_605_z[$a]); $j++) {
            $rameau .= " -- " . trim($info_605_z[$a][$j]);
        }
    }
    for ($a = 0; $a < sizeof($info_606_a); $a++) {
        $rameau .= "@@@" . trim($info_606_a[$a][0]);
        for ($j = 0; $j < sizeof($info_606_j[$a]); $j++) {
            $rameau .= " -- " . trim($info_606_j[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_606_x[$a]); $j++) {
            $rameau .= " -- " . trim($info_606_x[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_606_y[$a]); $j++) {
            $rameau .= " -- " . trim($info_606_y[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_606_z[$a]); $j++) {
            $rameau .= " -- " . trim($info_606_z[$a][$j]);
        }
    }
    for ($a = 0; $a < sizeof($info_607_a); $a++) {
        $rameau .= "@@@" . trim($info_607_a[$a][0]);
        for ($j = 0; $j < sizeof($info_607_j[$a]); $j++) {
            $rameau .= " -- " . trim($info_607_j[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_607_x[$a]); $j++) {
            $rameau .= " -- " . trim($info_607_x[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_607_y[$a]); $j++) {
            $rameau .= " -- " . trim($info_607_y[$a][$j]);
        }
        for ($j = 0; $j < sizeof($info_607_z[$a]); $j++) {
            $rameau .= " -- " . trim($info_607_z[$a][$j]);
        }
    }
    $categ_first = explode("@@@", stripslashes($rameau));
    for ($i = 1; $i < count($categ_first); $i++) {
        $resultat = categories::searchLibelle(addslashes($categ_first[$i]), $thesaurus_defaut, 'fr_FR');
        if (!$resultat) {
            /*vérification de l'existence des categs, sinon création */
            $resultat = create_categ_cpt_rameau_first_level($thes->num_noeud_racine, $categ_first[$i], ' ' . strip_empty_words($categ_first[$i]) . ' ');
        }
        /* ajout de l'indexation à la notice dans la table notices_categories*/
        $rqt_ajout = "insert into notices_categories set notcateg_notice='" . $notice_id . "', num_noeud='" . $resultat . "', ordre_categorie=" . ($i - 1);
        $res_ajout = @mysql_query($rqt_ajout, $dbh);
    }
}
开发者ID:bouchra012,项目名称:PMB,代码行数:101,代码来源:func_cpt_rameau_first_level.inc.php

示例10: import_new_notice_suite


//.........这里部分代码省略.........
                    $info['date_date'] = $info_904[0];
                }
            }
            $bulletin_id = $bulletin->update($info);
        }
        $bulletin_ex = $bulletin_id;
        if ($r->tit1 == '_OBJECT_BULLETIN_' || is_array($info_464) && $info_464[0]['z'] == 'objet') {
            //$info_464[0]['z']=='objet' >> Compatibilite import memonotices
            $is_object = true;
            //notice de bulletin a supprimer
            notice::del_notice($notice_id);
        } else {
            //Passage de la notice en article
            $np = '';
            if (is_array($info_464) && $info_464[0]['p'] != '') {
                $np = ", npages='" . addslashes($info_464[0]['p']) . "' ";
            }
            $requete = "update notices set niveau_biblio='a', niveau_hierar='2', year='" . addslashes($info_463[0]['e']) . "'" . $np . ", 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);
        }
    }
    if (!$is_object) {
        //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 = $info_606_a[$i][$j];
                //Recherche du terme
                //dans le thesaurus par defaut et dans la langue de l'interface
                $libelle = addslashes($descripteur);
                $categ_id = categories::searchLibelle($libelle);
                if ($categ_id) {
                    $requete = "INSERT INTO notices_categories (notcateg_notice,num_noeud,ordre_categorie) values({$notice_id},{$categ_id},{$ordre_categ})";
                    mysql_query($requete, $dbh);
                    $ordre_categ++;
                } else {
                    $unknown_desc[] = $descripteur;
                }
            }
        }
        if ($unknown_desc) {
            $mots_cles = implode($pmb_keyword_sep, $unknown_desc);
            $il = '';
            $qil = "select index_l from notices where notice_id={$notice_id} ";
            $ril = mysql_query($qil, $dbh);
            $il = trim(mysql_result($ril, 0, 0));
            if ($il) {
                $mots_cles = $il . $pmb_keyword_sep . $mots_cles;
            }
            $requete = "update notices set index_l='" . addslashes($mots_cles) . "', index_matieres=' " . addslashes(strip_empty_words($mots_cles)) . " ' where notice_id={$notice_id}";
            mysql_query($requete, $dbh);
        }
        $notes = '';
        //Thème
        $qn = "select idchamp from notices_custom where name='theme' ";
        $rn = mysql_query($qn, $dbh);
        if (mysql_num_rows($rn)) {
            $idc_theme = mysql_result($rn, 0, 0);
        }
        if (count($info_900) && $idc_theme) {
            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={$idc_theme} ";
开发者ID:bouchra012,项目名称:PMB,代码行数:67,代码来源:func_aix.inc.php

示例11: traite_categories_from_form

function traite_categories_from_form()
{
    global $rameau;
    global $thesaurus_defaut;
    global $thes;
    $categories = array();
    $categ_first = explode(" @@@ ", stripslashes($rameau));
    for ($i = 0; $i < count($categ_first); $i++) {
        $categ_first[$i] = trim($categ_first[$i]);
        if ($categ_first[$i]) {
            $resultat = categories::searchLibelle(addslashes($categ_first[$i]), $thesaurus_defaut, 'fr_FR');
            if (!$resultat) {
                $categories[]["categ_id"] = create_categ($thes->num_noeud_racine, $categ_first[$i], " " . addslashes(strip_empty_words($categ_first[$i])) . " ");
            } else {
                $categories[]["categ_id"] = $resultat;
            }
        }
    }
    return $categories;
}
开发者ID:bouchra012,项目名称:PMB,代码行数:20,代码来源:func_other_rameau_first_level.inc.php

示例12: do_thesaurus_ascodocpsy

function do_thesaurus_ascodocpsy($id_thesaurus, $nom_categ, $branch_values = array(), $lang = 'fr_FR', $ordre_categ = 0)
{
    global $notice_id;
    $res = pmb_mysql_query("select id_noeud from noeuds where autorite='TOP' and num_thesaurus='" . $id_thesaurus . "'");
    if ($res && pmb_mysql_num_rows($res)) {
        $parent_thes = pmb_mysql_result($res, 0, 0);
    } else {
        return;
    }
    $rqt = "select id_noeud from noeuds join categories on id_noeud=num_noeud and libelle_categorie='" . $nom_categ . "' and num_parent='" . $parent_thes . "'";
    $res = pmb_mysql_query($rqt);
    if ($res && pmb_mysql_num_rows($res)) {
        $num_parent = pmb_mysql_result($res, 0, 0);
        foreach ($branch_values as $terms) {
            foreach ($terms as $term) {
                $categ_id = categories::searchLibelle(addslashes($term), $id_thesaurus, $lang, $num_parent);
                if ($categ_id) {
                    //le terme existe
                    $noeud = new noeuds($categ_id);
                    if ($noeud->num_renvoi_voir) {
                        $categ_to_index = $noeud->num_renvoi_voir;
                    } else {
                        $categ_to_index = $categ_id;
                    }
                } else {
                    //le terme est à créé
                    $n = new noeuds();
                    $n->num_thesaurus = $id_thesaurus;
                    $n->num_parent = $num_parent;
                    $n->save();
                    $c = new categories($n->id_noeud, $lang);
                    $c->libelle_categorie = $term;
                    $c->index_categorie = ' ' . strip_empty_words($term) . ' ';
                    $c->save();
                    $categ_to_index = $n->id_noeud;
                }
                $requete = "INSERT INTO notices_categories (notcateg_notice,num_noeud,ordre_categorie) VALUES({$notice_id},{$categ_to_index},{$ordre_categ})";
                pmb_mysql_query($requete);
                $ordre_categ++;
            }
        }
    }
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:43,代码来源:func_ascodocpsy.inc.php

示例13: import_new_notice_suite

function import_new_notice_suite()
{
    global $info_461, $info_463, $info_530;
    global $info_900, $info_901, $tit_200a;
    global $info_215, $titre_ppal_200, $champ_210, $titre_perio_530a;
    global $info_606_a, $info_897;
    global $notice_id;
    global $bull_id;
    global $bl, $hl;
    echo "<pre>";
    $bull_id = 0;
    //cas d'un article
    if ($bl == "a" && $hl == "2") {
        //on peut pas découper une date, on a pas de date mais une mention
        if (decoupe_date($info_463[0]["d"]) == 0 && clean_string($info_463[0]["e"]) == "") {
            $info_463[0]["e"] = $info_463[0]["d"];
            $info_463[0]["d"] = "";
        }
        $bulletin = array('titre' => clean_string($info_463[0]["t"]), 'date' => decoupe_date($info_463[0]["d"]), 'mention' => clean_string($info_463[0]["e"]), 'num' => clean_string($info_463[0]["v"]));
        $perio = array('titre' => $info_461[0]['t'], 'code' => $info_461[0]['x']);
        notice_to_article($perio, $bulletin);
        $update = " update notices set typdoc='t' where notice_id = {$notice_id}";
        mysql_query($update);
        //cas d'un bulletin
    } else {
        if ($bl == "s" && $hl == "2") {
            if (decoupe_date($champ_210[0]['h']) == 0 && clean_string($titre_ppal_200[0]['h']) == "") {
                $titre_ppal_200[0]['h'] = $champ_210[0]['h'];
                $champ_210[0]['h'] = "";
            }
            $bulletin = array('titre' => clean_string($titre_ppal_200[0]['i']), 'date' => decoupe_date($champ_210[0]['h']), 'mention' => clean_string($champ_210[0]['d']), 'num' => clean_string($titre_ppal_200[0]['h']));
            $perio = array('titre' => $info_461[0]['t'], 'code' => $info_461[0]['x']);
            $bull_id = genere_bulletin($perio, $bulletin);
            $update = " update notices set typdoc='t' where notice_id = {$notice_id}";
            mysql_query($update);
        }
    }
    //on s'occupe des descripteurs;
    $id_thesaurus = 1;
    $non_classes = 3;
    $lang = "fr_FR";
    $ordre_categ = 0;
    foreach ($info_606_a as $terms) {
        foreach ($terms as $term) {
            $categ_id = categories::searchLibelle(addslashes($term), $id_thesaurus, $lang);
            if ($categ_id) {
                //le terme existe
                $noeud = new noeuds($categ_id);
                if ($noeud->num_renvoi_voir) {
                    $categ_to_index = $noeud->num_renvoi_voir;
                } else {
                    $categ_to_index = $categ_id;
                }
            } else {
                //le terme est à créé
                $n = new noeuds();
                $n->num_thesaurus = $id_thesaurus;
                $n->num_parent = $non_classes;
                $n->save();
                $c = new categories($n->id_noeud, $lang);
                $c->libelle_categorie = $term;
                $c->index_categorie = ' ' . strip_empty_words($term) . ' ';
                $c->save();
                $categ_to_index = $n->id_noeud;
            }
            $requete = "INSERT INTO notices_categories (notcateg_notice,num_noeud,ordre_categorie) VALUES({$notice_id},{$categ_to_index},{$ordre_categ})";
            mysql_query($requete);
            $ordre_categ++;
        }
    }
    //on traite le commentaire de gestion
    $up = "update notices set commentaire_gestion = '" . addslashes($info_901[0][0]) . "' where notice_id = {$notice_id}";
    mysql_query($up);
    //traitement des Champs perso
    //classique on commence par cherché l'id
    foreach ($info_900 as $champperso) {
        $champ = array('libelle' => $champperso['l'], 'nom' => $champperso['n'], 'value' => $champperso['a']);
        recup_champ_perso($champ, "notices", $notice_id);
    }
    //gestion des 897$...
    foreach ($info_897 as $docnum) {
        //si on a pas d'url, on traite pas
        if ($docnum['u']) {
            //on reprend pas les site web...
            if ($docnum['m'] != "text/html") {
                $doc = array('titre' => clean_string($docnum['a']), 'mimetype' => $docnum['m'], 'nom_fic' => clean_string($docnum['f']), 'url' => $docnum['u']);
                create_docnum($doc);
            }
        }
    }
    echo "</pre>";
}
开发者ID:bouchra012,项目名称:PMB,代码行数:92,代码来源:func_aiss.inc.php

示例14: check_if_exists

 function check_if_exists($data, $id_thesaurus, $num_parent = 0, $lang = "")
 {
     $lang = strtolower($lang);
     switch ($lang) {
         case "fr":
         case "fre":
         case "français":
         case "francais":
         case "french":
             $lang = "fr_FR";
             break;
         default:
             $lang = "fr_FR";
             break;
     }
     if ($data['label'] == "") {
         return 0;
     }
     $query = "select * from thesaurus where id_thesaurus = " . $id_thesaurus;
     $result = pmb_mysql_query($query);
     $id = 0;
     if (pmb_mysql_num_rows($result)) {
         $row = pmb_mysql_fetch_object($result);
         $id = categories::searchLibelle(addslashes($data['label']), $id_thesaurus, $lang, $num_parent);
     }
     return $id;
 }
开发者ID:hogsim,项目名称:PMB,代码行数:27,代码来源:category.class.php

示例15: build_categ

 static function build_categ($tab_categ, $id_thes, $id_parent, $do_lien = true, $do_create = true)
 {
     global $incr_categ, $notice_id, $lang;
     if (trim($tab_categ)) {
         $resultat = categories::searchLibelle(addslashes($tab_categ), $id_thes, $lang, $id_parent);
         if (!$resultat && $id_parent && $do_create) {
             // création de la catégorie
             $n = new noeuds();
             $n->num_parent = $id_parent;
             $n->num_thesaurus = $id_thes;
             $n->save();
             $resultat = $id_n = $n->id_noeud;
             $c = new categories($id_n, $lang);
             $c->libelle_categorie = $tab_categ;
             $c->save();
         }
         // ajout de l'indexation à la notice dans la table notices_categories
         if ($do_lien && $resultat && $notice_id) {
             $incr_categ++;
             $rqt_ajout = "insert IGNORE into notices_categories set notcateg_notice='" . $notice_id . "', num_noeud='" . $resultat . "', ordre_categorie='" . $incr_categ . "' ";
             pmb_mysql_query($rqt_ajout);
         }
         return $resultat;
     }
     return 0;
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:26,代码来源:category_auto.class.php


注:本文中的categories::searchLibelle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。