本文整理汇总了PHP中notice::majNoticesMotsGlobalIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP notice::majNoticesMotsGlobalIndex方法的具体用法?PHP notice::majNoticesMotsGlobalIndex怎么用?PHP notice::majNoticesMotsGlobalIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notice
的用法示例。
在下文中一共展示了notice::majNoticesMotsGlobalIndex方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexGlobal
function indexGlobal()
{
global $msg, $dbh, $charset, $PMBusername;
if (SESSrights & ADMINISTRATION_AUTH) {
$result .= "<h3>" . htmlentities($msg["nettoyage_reindex_global"], ENT_QUOTES, $charset) . "</h3>";
//remise a zero de la table au début
mysql_query("delete from notices_global_index", $dbh);
mysql_query("delete from notices_mots_global_index", $dbh);
$query = mysql_query("select notice_id from notices order by notice_id");
if (mysql_num_rows($query)) {
while ($mesNotices = mysql_fetch_assoc($query)) {
// Mise à jour de la table "notices_global_index"
notice::majNoticesGlobalIndex($mesNotices['notice_id']);
// Mise à jour de la table "notices_mots_global_index"
notice::majNoticesMotsGlobalIndex($mesNotices['notice_id']);
}
mysql_free_result($query);
}
$not = mysql_query("SELECT count(1) FROM notices_global_index", $dbh);
$count = mysql_result($not, 0, 0);
$result .= $count . " " . htmlentities($msg["nettoyage_res_reindex_global"], ENT_QUOTES, $charset);
} else {
$result .= sprintf($msg["planificateur_rights_bad_user_rights"], $PMBusername);
}
return $result;
}
示例2: update_index
function update_index($id)
{
global $dbh;
// On cherche tous les n-uplet de la table notice correspondant a cet auteur.
$found = mysql_query("select distinct notice_id from notices where ed1_id='" . $id . "' OR ed2_id='" . $id . "'", $dbh);
// Pour chaque n-uplet trouves on met a jour la table notice_global_index avec l'auteur modifie :
while ($mesNotices = mysql_fetch_object($found)) {
$notice_id = $mesNotices->notice_id;
notice::majNoticesGlobalIndex($notice_id);
notice::majNoticesMotsGlobalIndex($notice_id, 'publisher');
}
}
示例3: update_index
static function update_index($id)
{
global $dbh;
global $include_path;
$indexation_authority = new indexation_authority($include_path . "/indexation/authorities/collections/champs_base.xml", "authorities", AUT_TABLE_COLLECTIONS);
$indexation_authority->maj($id);
// On cherche tous les n-uplet de la table notice correspondant à cette collection.
$found = pmb_mysql_query("select distinct notice_id from notices where coll_id='" . $id . "'", $dbh);
// Pour chaque n-uplet trouvés on met a jour la table notice_global_index avec la collection modifiée :
while ($mesNotices = pmb_mysql_fetch_object($found)) {
$notice_id = $mesNotices->notice_id;
notice::majNoticesGlobalIndex($notice_id);
notice::majNoticesMotsGlobalIndex($notice_id, 'collection');
}
}
示例4: pmb_mysql_query
$requete .= ", expl_comment='" . ${f_ex_comment} . "'";
$requete .= ", expl_prix='{$f_ex_prix}'";
$requete .= ", expl_owner='{$f_ex_owner}'";
$requete .= ", type_antivol='{$type_antivol}'";
$requete .= ", expl_nbparts='{$f_ex_nbparts}'";
$requete .= $limiter;
$result = pmb_mysql_query($requete, $dbh);
if (!$expl_id) {
$expl_id = pmb_mysql_insert_id();
audit::insert_creation(AUDIT_EXPL, $expl_id);
} else {
$audit->get_new_infos("SELECT expl_statut, expl_location, transfert_location_origine, transfert_statut_origine, transfert_section_origine, expl_owner FROM exemplaires WHERE expl_cb='{$f_ex_cb}' ");
$audit->save_info_modif(AUDIT_EXPL, $expl_id, "expl_update.inc.php");
}
// traitement des concepts
if ($thesaurus_concepts_active == 1) {
$index_concept = new index_concept($expl_id, TYPE_EXPL);
$index_concept->save();
}
//Insertion des champs personalisés
$p_perso->rec_fields_perso($expl_id);
// Mise a jour de la table notices_mots_global_index
notice::majNoticesMotsGlobalIndex($id, 'expl');
// tout va bene, on réaffiche l'ISBD
print "<div class='row'><div class='msg-perio'>" . $msg[maj_encours] . "</div></div>";
$id_form = md5(microtime());
$retour = "./catalog.php?categ=isbd&id={$id}";
print "\n\t\t<form class='form-{$current_module}' name=\"dummy\" method=\"post\" action=\"{$retour}\" style=\"display:none\">\n\t\t\t<input type=\"hidden\" name=\"id_form\" value=\"{$id_form}\">\n\t\t</form>\n\t\t<script type=\"text/javascript\">document.dummy.submit();</script>\n\t\t";
} else {
error_message($msg[301], $msg[303], 1, "./catalog.php?categ=isbd&id={$id}");
}
示例5: addslashes
if ($tmp_not = pmb_mysql_fetch_object($result)) {
$id_notice = $tmp_not->notice_id;
$acreer = 0;
}
}
if ($acreer) {
$requete = "INSERT INTO notices SET code='" . addslashes($pe_isbn) . "', tit1='{$pe_titre}', statut='{$pmb_pret_express_statut}', niveau_biblio='m', niveau_hierar='0', create_date=sysdate() ";
$result = pmb_mysql_query($requete, $dbh);
if (!$result) {
die('ERROR PE: insert into notice');
}
$id_notice = pmb_mysql_insert_id();
audit::insert_creation(AUDIT_NOTICE, $id_notice);
notice::majNotices($id_notice);
notice::majNoticesGlobalIndex($id_notice, 1);
notice::majNoticesMotsGlobalIndex($id_notice);
if ($gestion_acces_active == 1) {
require_once "{$class_path}/acces.class.php";
$ac = new acces();
//traitement des droits acces user_notice
if ($gestion_acces_user_notice == 1) {
$dom_1 = $ac->setDomain(1);
$dom_1->storeUserRights(0, $id_notice);
}
//traitement des droits acces empr_notice
if ($gestion_acces_empr_notice == 1) {
$dom_2 = $ac->setDomain(2);
$dom_2->storeUserRights(0, $id_notice);
}
}
}
示例6: create_record_child
public function create_record_child($id_parent, $data)
{
global $dbh;
global $pmb_nomenclature_record_children_link;
$tit1 = "Notice fille temporaire de la nomenclature {$id_parent}";
$fields = "\r\n\t\ttit1='" . addslashes($tit1) . "'\r\n\t\t";
$req = "INSERT INTO notices SET {$fields} ";
pmb_mysql_query($req, $dbh);
$this->id = pmb_mysql_insert_id();
if (!$this->id) {
return 0;
}
if (!$data["rank"]) {
$data["rank"] = 1;
}
$requete = 'INSERT INTO notices_relations VALUES("' . $this->id . '","' . $id_parent . '","' . $pmb_nomenclature_record_children_link . '","' . $data["rank"] . '")';
pmb_mysql_query($requete, $dbh);
$this->save($data);
$this->fetch_datas();
$data = $this->get_data();
$tit1 = $data["instrument_name"] . $data["voice_name"];
if ($data["musicstand_name"]) {
$tit1 .= " / " . $data["musicstand_name"];
}
if ($data["formation_label"]) {
$tit1 .= " / " . $data["formation_label"];
}
$fields = "\r\n\t\ttit1='" . addslashes($tit1) . "'\r\n\t\t";
$req = "UPDATE notices SET {$fields} where notice_id= " . $this->id;
pmb_mysql_query($req, $dbh);
// permet de charger la bonne langue, mot vide...
$info = notice::indexation_prepare($this->id);
// Mise a jour des index de la notice
notice::majNotices($this->id);
// Mise a jour de la table notices_global_index
notice::majNoticesGlobalIndex($this->id);
// Mise a jour de la table notices_mots_global_index
notice::majNoticesMotsGlobalIndex($this->id);
// restaure l'environnement de langue
notice::indexation_restaure($info);
return array('id' => $this->id, 'title' => $tit1);
}
示例7: create_notice
public function create_notice()
{
global $dbh;
global $pmb_keyword_sep;
if (docwatch_watch::check_watch_rights($this->num_watch)) {
/** Récupération des paramètres défini dans la veille pour la création de notice à partir de ses items **/
$query = "select watch_record_default_type, watch_record_default_status from docwatch_watches where id_watch =" . $this->num_watch;
$result = pmb_mysql_query($query, $dbh);
if (pmb_mysql_num_rows($result)) {
$row = pmb_mysql_fetch_object($result);
$record_type = $row->watch_record_default_type;
$record_status = $row->watch_record_default_status;
} else {
return array();
}
$tab_tag = array();
foreach ($this->tags as $tag) {
$tab_tag[] = $tag["label"];
}
$fields = "\n\t\t\t\ttit1='" . addslashes($this->title) . "',\n\t\t\t\tn_resume='" . addslashes($this->summary) . "',\n\t\t\t\tlien='" . addslashes($this->url) . "',\n\t\t\t\tthumbnail_url='" . addslashes($this->logo_url) . "',\n\t\t\t\tdate_parution='" . addslashes($this->publication_date) . "',\n\t\t\t\tyear='" . addslashes(format_date($this->publication_date)) . "',\n\t\t\t\ttypdoc='" . addslashes($record_type) . "',\n\t\t\t\tstatut='" . addslashes($record_status) . "',\n\t\t\t\tindex_l='" . addslashes(implode($pmb_keyword_sep, $tab_tag)) . "'\n\t\t\t";
$req = "INSERT INTO notices SET {$fields} ";
pmb_mysql_query($req, $dbh);
$num_notice = pmb_mysql_insert_id();
if (!$num_notice) {
return array();
}
foreach ($this->descriptors as $num_categ => $label) {
$query = "insert into notices_categories set notcateg_notice = '" . $num_notice . "', num_noeud='" . $num_categ . "'";
pmb_mysql_query($query, $dbh);
}
$query = "update docwatch_items set\titem_num_notice = '" . $num_notice . "' where id_item = '" . $this->id . "'";
pmb_mysql_query($query, $dbh);
$this->set_num_notice($num_notice);
// permet de charger la bonne langue, mot vide...
$info = notice::indexation_prepare($num_notice);
// Mise a jour des index de la notice
notice::majNotices($num_notice);
// Mise a jour de la table notices_global_index
notice::majNoticesGlobalIndex($num_notice);
// Mise a jour de la table notices_mots_global_index
notice::majNoticesMotsGlobalIndex($num_notice);
// restaure l'environnement de langue
notice::indexation_restaure($info);
return array('id' => $num_notice, 'title' => $this->title, 'link' => "./catalog.php?categ=isbd&id=" . $num_notice);
}
}
示例8: creer_lien_notice_bulletin
function creer_lien_notice_bulletin($ancien_id = 0, $id_perio = 0, $id_bulletin = 0, $id_not_bull = 0, $titre_not_bull = "", $bulletin)
{
global $dbh, $msg, $isbn_OK, $tit_200a, $notice_id, $notices_crees, $statutnot;
//On control que ce bulletin n'a pas déjà une notice
$requete = "select num_notice from bulletins where bulletin_id='" . $id_bulletin . "'";
if ($id_not_bull) {
$requete .= " and num_notice!='" . $id_not_bull . "'";
}
$res = mysql_query($requete, $dbh);
if (mysql_num_rows($res) && mysql_result($res, 0, 0)) {
//Si j'ai déja une notice associé à ce bulletin je la récupère
if ($id_not_bull) {
//Si j'ai aussi un identifiant de notice de bulletin, je supprime le plus récent
notice::del_notice($id_not_bull);
mysql_query("insert into error_log (error_origin, error_text) values ('import_" . addslashes(SESSid) . ".inc', '" . $msg[542] . " {$id_unimarc} " . " {$isbn_OK} " . addslashes(clean_string(implode(" ; ", $tit_200a))) . "') ", $dbh);
$id_notice_bulletin = mysql_result($res, 0, 0);
//A voir pr modif
} else {
$id_notice_bulletin = mysql_result($res, 0, 0);
}
$notice_id = $id_notice_bulletin;
} else {
if ($titre_not_bull) {
//Si j'ai un titre je créé la notice de bulletin
$requete = "insert into notices (tit1,niveau_biblio, niveau_hierar,statut) values ('" . addslashes(clean_string($titre_not_bull)) . "', 'b', '2','" . $statutnot . "')";
mysql_query($requete, $dbh);
$id_notice_bulletin = mysql_insert_id();
audit::insert_creation(AUDIT_NOTICE, $id_notice_bulletin);
//calcul des droits d'accès s'ils sont activés
calc_notice_acces_rights($id_notice_bulletin);
// Mise à jour des index de la notice
notice::majNotices($id_notice_bulletin);
// Mise à jour de la table "notices_global_index"
notice::majNoticesGlobalIndex($id_notice_bulletin);
// Mise à jour de la table "notices_mots_global_index"
notice::majNoticesMotsGlobalIndex($id_notice_bulletin);
} else {
$id_notice_bulletin = $id_not_bull;
}
//On créer le lien entre le bulletin et la notice de bulletin
$requete = "update bulletins set num_notice='" . $id_notice_bulletin . "' where bulletin_id='" . $id_bulletin . "'";
mysql_query($requete, $dbh);
}
$notices_crees[$ancien_id] = $id_notice_bulletin;
//Lien entre la notice de bulletin et la notice de periodique
$requete = "insert into notices_relations(num_notice,linked_notice,relation_type) values ('" . $id_notice_bulletin . "','" . $id_perio . "','b')";
mysql_query($requete);
if ($id_notice_bulletin && $bulletin["date"]) {
$requete = "UPDATE notices SET year='" . addslashes(substr($bulletin["date"], 0, 4)) . "', date_parution='" . addslashes($bulletin["date"]) . "' WHERE notice_id='" . $id_notice_bulletin . "'";
mysql_query($requete);
}
return $id_notice_bulletin;
}
示例9: update_index
static function update_index($id)
{
global $dbh;
// On cherche tous les n-uplet de la table notice correspondant à cet auteur.
$found = pmb_mysql_query("select distinct responsability_notice from responsability where responsability_author='" . $id . "'", $dbh);
// Pour chaque n-uplet trouvés on met a jour la table notice_global_index avec l'auteur modifié :
while ($mesNotices = pmb_mysql_fetch_object($found)) {
$notice_id = $mesNotices->responsability_notice;
notice::majNoticesGlobalIndex($notice_id);
notice::majNoticesMotsGlobalIndex($notice_id, 'author');
}
// On met à jour les titres uniformes correspondant à cet auteur
$found = pmb_mysql_query("select distinct responsability_tu_num from responsability_tu where responsability_tu_author_num='" . $id . "'", $dbh);
// Pour chaque n-uplet trouvés on met a jour l'index du titre uniforme avec l'auteur modifié :
while ($mesTu = pmb_mysql_fetch_object($found)) {
titre_uniforme::update_index_tu($mesTu->responsability_tu_num);
titre_uniforme::update_index($mesTu->responsability_tu_num);
}
}
示例10: update_linked_elements
public static function update_linked_elements($num_concept)
{
global $dbh;
$num_concept += 0;
$query = "select num_object,type_object from index_concept where num_concept = " . $num_concept;
$result = pmb_mysql_query($query, $dbh);
if ($result && pmb_mysql_num_rows($result)) {
while ($row = pmb_mysql_fetch_object($result)) {
switch ($row->type_object) {
case TYPE_NOTICE:
notice::majNoticesMotsGlobalIndex($row->num_object, "concept");
break;
default:
//TODO AR
break;
}
}
}
}
示例11: import_basic
//.........这里部分代码省略.........
// dédoublonnage sur isbn
if ($EAN || $isbn || $code) {
if ($trouvees == 0) {
$new_notice = 1;
} else {
$new_notice = 0;
$notice_id = mysql_result($myQuery, 0, "notice_id");
$sql_log = mysql_query("insert into error_log (error_origin, error_text) values ('import_expl_" . addslashes(SESSid) . ".inc', '" . $msg[542] . " {$EAN} || {$isbn} || {$code} " . addslashes($tit_200a[0]) . "') ");
}
} else {
if ($params["isbn_mandatory"] == 1) {
$sql_log = mysql_query("insert into error_log (error_origin, error_text) values ('import_" . addslashes(SESSid) . ".inc', '" . $msg[543] . "') ");
} else {
$new_notice = 1;
$sql_log = mysql_query("insert into error_log (error_origin, error_text) values ('import_" . addslashes(SESSid) . ".inc', '" . $msg[565] . "') ");
}
}
} else {
// pas de dédoublonnage
if ($params["isbn_mandatory"] == 1 && $isbn_OK == "") {
$sql_log = mysql_query("insert into error_log (error_origin, error_text) values ('import_" . addslashes(SESSid) . ".inc', '" . $msg[543] . "') ");
} elseif ($isbn_OK) {
$new_notice = 1;
} else {
$new_notice = 1;
$sql_log = mysql_query("insert into error_log (error_origin, error_text) values ('import_" . addslashes(SESSid) . ".inc', '" . $msg[565] . "') ");
}
}
/* the notice is new, we are going to import it... */
if ($new_notice == 1) {
import_new_notice();
if ($params["link_generate"]) {
import_notice_link();
}
import_new_notice_suite();
// Mise à jour de la table "notices_global_index"
notice::majNoticesGlobalIndex($notice_id);
// Mise à jour de la table "notices_mots_global_index"
notice::majNoticesMotsGlobalIndex($notice_id);
} else {
$notice_deja_presente++;
//TRAITEMENT DES DOCS NUMERIQUES SUR NOTICE EXISTANTE
global $add_explnum;
//Fonction d'import func_ensai_ensae.inc.php
if ($add_explnum === TRUE && function_exists("ajoute_explnum")) {
ajoute_explnum();
}
}
// TRAITEMENT DES EXEMPLAIRES ICI
if ($with_expl) {
traite_exemplaires();
}
}
}
//Fin du traitement des notices
//Gestion des logs
$formulaire = "";
$script = "";
$log["notice_deja_presente"] = $notice_deja_presente;
$log["notice_rejetee"] = $notice_rejetee;
$log["nbtot_notice"] = $nbtot_notice;
$log["stdout"] = ob_get_contents();
if ($charset != "utf-8") {
$log["stdout"] = utf8_encode($log["stdout"]);
}
ob_end_clean();
$gen_liste_log = "";
$resultat_liste = mysql_query("SELECT error_origin, error_text, count(*) as nb_error FROM error_log where error_origin in ('expl_" . addslashes(SESSid) . ".class','import_expl_" . addslashes(SESSid) . ".inc','iimport_expl_" . addslashes(SESSid) . ".inc','import_" . addslashes(SESSid) . ".inc.php', 'import_" . addslashes(SESSid) . ".inc','import_func_" . addslashes(SESSid) . ".inc.php') group by error_origin, error_text", $dbh);
$nb_liste = mysql_num_rows($resultat_liste);
if ($nb_liste > 0) {
$i_log = 0;
while ($i_log < $nb_liste) {
$tmp = array();
$tmp["error_origin"] = mysql_result($resultat_liste, $i_log, "error_origin");
if ($charset != "utf-8") {
$tmp["error_origin"] = utf8_encode($tmp["error_origin"]);
}
$tmp["error_text"] = mysql_result($resultat_liste, $i_log, "error_text");
if ($charset != "utf-8") {
$tmp["error_text"] = utf8_encode($tmp["error_text"]);
}
$tmp["nb_error"] = mysql_result($resultat_liste, $i_log, "nb_error");
$log["error_log"][] = $tmp;
$i_log++;
}
mysql_query("DELETE FROM error_log WHERE error_origin in ('expl_" . addslashes(SESSid) . ".class','import_expl_" . addslashes(SESSid) . ".inc','iimport_expl_" . addslashes(SESSid) . ".inc','import_" . addslashes(SESSid) . ".inc.php', 'import_" . addslashes(SESSid) . ".inc','import_func_" . addslashes(SESSid) . ".inc.php')", $dbh);
} else {
$log["result"] = $this->msg["import_basic_msg_ok"];
if ($charset != "utf-8") {
$log["result"] = utf8_encode($log["result"]);
}
}
} else {
$log["result"] = $this->msg["import_basic_msg_ko"];
if ($charset != "utf-8") {
$log["result"] = utf8_encode($log["result"]);
}
}
return $log;
}
示例12: delete
function delete()
{
global $dbh;
if ($this->isEnUpload()) {
$up = new upload_folder($this->explnum_repertoire);
$chemin = str_replace("//", "/", $this->explnum_rep_path . $this->explnum_path . $this->explnum_nomfichier);
$chemin = $up->encoder_chaine($chemin);
if (file_exists($chemin)) {
unlink($chemin);
}
}
$requete = "DELETE FROM explnum WHERE explnum_id=" . $this->explnum_id;
mysql_query($requete, $dbh);
//on oublie pas la localisation associé
$requete = "delete from explnum_location where num_explnum = " . $this->explnum_id;
mysql_query($requete, $dbh);
// Suppression des segments et locuteurs
$requete = "delete from explnum_speakers where explnum_speaker_explnum_num = " . $this->explnum_id;
mysql_query($requete, $dbh);
$requete = "delete from explnum_segments where explnum_segment_explnum_num = " . $this->explnum_id;
mysql_query($requete, $dbh);
//On recalcule l'index global pour la notice
if ($this->explnum_notice) {
// Mise a jour de la table notices_mots_global_index
notice::majNoticesMotsGlobalIndex($this->explnum_notice, "explnum");
} elseif ($this->explnum_bulletin) {
// Mise a jour de la table notices_mots_global_index pour toutes les notices en relation avec l'exemplaire
$req_maj = "SELECT bulletin_notice,num_notice FROM bulletins WHERE bulletin_id='" . $this->explnum_bulletin . "'";
$res_maj = mysql_query($req_maj);
if ($res_maj && mysql_num_rows($res_maj)) {
if ($tmp = mysql_result($res_maj, 0, 0)) {
//Périodique
notice::majNoticesMotsGlobalIndex($tmp, "explnum");
}
if ($tmp = mysql_result($res_maj, 0, 1)) {
//Notice de bulletin
notice::majNoticesMotsGlobalIndex($tmp, "explnum");
}
}
}
}
示例13: notices_langues
// traitement des langues originales
$rqt_ins = "insert into notices_langues (num_notice, type_langue, code_langue, ordre_langue) VALUES ";
while (list($key, $val) = each($f_langorg_form)) {
$tmpcode_langue = $val['code'];
if ($tmpcode_langue) {
$tmpordre_langue = $val['ordre'];
$rqt = $rqt_ins . " ('{$result}',1, '{$tmpcode_langue}', {$tmpordre_langue}) ";
$res_ins = @pmb_mysql_query($rqt, $dbh);
}
}
//Traitement des champs persos
$p_perso->rec_fields_perso($result);
// Mise à jour de la table notices_global_index
notice::majNoticesGlobalIndex($result);
// Mise à jour de la table notices_mots_global_index
notice::majNoticesMotsGlobalIndex($result);
if ($gestion_acces_active == 1) {
//mise a jour des droits d'acces user_notice (idem notice mere perio)
if ($gestion_acces_user_notice == 1) {
$q = "replace into acces_res_1 select {$result}, res_prf_num, usr_prf_num, res_rights, res_mask from acces_res_1 where res_num=" . $myAnalysis->bulletin_notice;
pmb_mysql_query($q, $dbh);
}
//mise a jour des droits d'acces empr_notice
if ($gestion_acces_empr_notice == 1) {
$dom_2 = $ac->setDomain(2);
if ($analysis_id) {
$dom_2->storeUserRights(1, $result, $res_prf, $chk_rights, $prf_rad, $r_rad);
} else {
$dom_2->storeUserRights(0, $result, $res_prf, $chk_rights, $prf_rad, $r_rad);
}
}
示例14: mysql_fetch_object
if (mysql_numrows($r)) {
$loc = mysql_fetch_object($r);
$tab_index_l = array();
$tab_index_l = explode($pmb_keyword_sep, trim($loc->index_l));
$tab_index_l[] = stripslashes($loc->libelle);
for ($j = 0; $j < sizeof($tab_index_l); $j++) {
if (!$tab_index_l[$j]) {
unset($tab_index_l[$j]);
}
}
$index_l = addslashes(implode($pmb_keyword_sep, $tab_index_l));
$index_matieres = " " . strip_empty_words($index_l) . " ";
$requete = "update notices set index_l='" . $index_l . "',index_matieres='{$index_matieres}' where notice_id='" . $loc->num_notice . "'";
mysql_query($requete, $dbh) or die(mysql_error() . " <br />" . $requete);
notice::majNoticesGlobalIndex($loc->num_notice);
notice::majNoticesMotsGlobalIndex($loc->num_notice);
$requete = "delete from tags where id_tag='" . $valid_id_tags[$i] . "'";
mysql_query($requete, $dbh) or die(mysql_error() . " <br />" . $requete);
}
}
}
break;
case 'supprimer':
for ($i = 0; $i < sizeof($valid_id_tags); $i++) {
$acces_m = 1;
if ($acces_jm) {
$q = "select count(1) from tags {$acces_jm} where id_tag=" . $valid_id_tags[$i];
$r = mysql_query($q, $dbh);
if (mysql_result($r, 0, 0) == 0) {
$acces_m = 0;
}
示例15: import_new_notice_suite
//.........这里部分代码省略.........
if (count($info_336)) {
foreach ($info_336 as $value) {
if ($tmp = trim($value)) {
if ($n_gen_plus) {
$n_gen_plus .= "\n";
}
$n_gen_plus .= $tmp;
}
}
}
if (count($info_337)) {
foreach ($info_337 as $value) {
if ($tmp = trim($value)) {
if ($n_gen_plus) {
$n_gen_plus .= "\n";
}
$n_gen_plus .= $tmp;
}
}
}
if ($n_gen_plus) {
$requ = "UPDATE notices SET n_gen=IF(n_gen != '',CONCAT(n_gen,'\n" . addslashes($n_gen_plus) . "'),'" . addslashes($n_gen_plus) . "') WHERE notice_id = " . $notice_id;
if (!mysql_query($requ)) {
echo "Requête echoué: " . $requ . "<br/>";
}
}
switch ($niveau_biblio) {
case "s1":
case "s0":
foreach ($infos_4XX as $key => $children) {
foreach ($children as $child) {
$issn = "";
//on commence par chercher si la notice existe
$issn = traite_code_ISSN($child['x']);
if ($issn) {
$query = "select notice_id from notices where code ='" . $issn . "' and niveau_biblio = 's' and niveau_hierar = '1'";
$result = mysql_query($query);
if (!mysql_num_rows($result)) {
//la notice n'existe pas, il faut la créer...
/* Origine de la notice */
$origine_not['nom'] = clean_string($origine_notice[0]['b']);
$origine_not['pays'] = clean_string($origine_notice[0]['a']);
$orinot_id = origine_notice::import($origine_not);
if ($orinot_id == 0) {
$orinot_id = 1;
}
$query = "insert into notices set \n\t\t\t\t\t\t\t\ttypdoc = '" . $doc_type . "',\n\t\t\t\t\t\t\t\ttit1 = '" . addslashes(clean_string($child['t'])) . "',\n\t\t\t\t\t\t\t\tcode = '" . $issn . "',\n\t\t\t\t\t\t\t\tniveau_biblio = 's',\n\t\t\t\t\t\t\t\tniveau_hierar = '1',\n\t\t\t\t\t\t\t\tstatut = " . $statutnot . ",\n\t\t\t\t\t\t\t\torigine_catalogage = '" . $orinot_id . "',\n\t\t\t\t\t\t\t\tcreate_date = sysdate(),\n\t\t\t\t\t\t\t\tupdate_date = sysdate()\n\t\t\t\t\t\t\t";
mysql_query($query);
$child_id = mysql_insert_id();
$notices_crees[$child[0]] = $child_id;
notice::majNotices($child_id);
notice::majNoticesGlobalIndex($child_id);
notice::majNoticesMotsGlobalIndex($child_id);
} else {
$child_id = mysql_result($result, 0, 0);
}
if ($child_id) {
// on regarde si une relation similaire existe déjà...
$query = "select relation_type from notices_relations where relation_type = '" . $link_type[$key]['code'] . "' and ((num_notice = " . $notice_id . " and linked_notice = " . $child_id . ") or (num_notice = " . $child_id . " and linked_notice = " . $notice_id . "))";
$result = mysql_query($query);
if (!mysql_num_rows($result)) {
$rank = 0;
$query = "select count(rank) from notices_relations where relation_type = '" . $link_type[$key]['code'] . "' and ";
if ($link_type[$key]['sens_link'] == "mother") {
$query .= "num_notice = " . $child_id;
} else {
$query .= "num_notice = " . $notice_id;
}
$result = mysql_query($query);
if (mysql_num_rows($result)) {
$rank = mysql_result($result, 0, 0);
}
$query = "insert into notices_relations set \n\t\t\t\t\t\t\t\t\t" . $sens[$link_type[$key]['sens_link']][0] . " = " . $notice_id . ",\n\t\t\t\t\t\t\t\t\t" . $sens[$link_type[$key]['sens_link']][1] . " = " . $child_id . ",\n\t\t\t\t\t\t\t\t\trelation_type = '" . $link_type[$key]['code'] . "',\n\t\t\t\t\t\t\t\t\trank = " . ($rank + 1) . "\n\t\t\t\t\t\t\t\t";
mysql_query($query);
}
}
}
}
}
break;
}
if (count($info_900)) {
for ($i = 0; $i < count($info_900); $i++) {
if (trim($info_900[$i]["a"])) {
if (!renseigne_cp_agro($info_900[$i], $notice_id)) {
mysql_query("insert into error_log (error_origin, error_text) values ('import_expl_" . addslashes(SESSid) . ".inc', '" . addslashes("La valeur : " . $info_900[$i]["a"] . " n'a pas été reprise dans le champ personnalisé : " . $info_900[$i]["n"] . " car le champ n'existe pas ou n'est pas défini de la même façon") . "') ");
}
}
}
}
if ($tmp = trim($info_003[0])) {
$requete = "SELECT notices_custom_origine FROM notices_custom_values WHERE notices_custom_champ=22 AND notices_custom_origine='" . $notice_id . "' AND notices_custom_small_text='" . addslashes($tmp) . "' ";
$res = mysql_query($requete);
if ($res && mysql_num_rows($res)) {
} else {
$requete = "INSERT INTO notices_custom_values(notices_custom_champ, notices_custom_origine, notices_custom_small_text) VALUES('22','" . $notice_id . "','" . addslashes($tmp) . "')";
mysql_query($requete);
}
}
}