本文整理汇总了PHP中notice::majNoticesGlobalIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP notice::majNoticesGlobalIndex方法的具体用法?PHP notice::majNoticesGlobalIndex怎么用?PHP notice::majNoticesGlobalIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notice
的用法示例。
在下文中一共展示了notice::majNoticesGlobalIndex方法的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: error_message
if ($result) {
include './catalog/notices/isbd.inc.php';
} else {
// echec de la requete
error_message($libelle, $msg[281], 1, "./catalog.php");
}
//Recherche du titre uniforme automatique
global $opac_enrichment_bnf_sparql;
$opac_enrichment_bnf_sparql = 1;
$titre_uniforme = notice::getAutomaticTu($id);
// permet de charger la bonne langue, mot vide...
$info = notice::indexation_prepare($id);
// Mise a jour des index de la notice
notice::majNotices($id);
// Mise a jour de la table notices_global_index
notice::majNoticesGlobalIndex($id);
// Mise a jour de la table notices_mots_global_index
notice::majNoticesMotsGlobalIndex($id);
// restaure l'environnement de langue
notice::indexation_restaure($info);
//synchro_rdf
if ($pmb_synchro_rdf) {
$synchro_rdf->addRdf($id, 0);
}
} else {
if ($f_tit1 == "") {
// erreur : le champ tit1 est vide
error_message($libelle, $notitle_message, 1, "./catalog.php");
} else {
error_message_history($msg["notice_champs_perso"], $p_perso->error_message, 1);
}
示例3: floor
if (pmb_mysql_num_rows($query)) {
// définition de l'état de la jauge
$state = floor($start / ($count / $jauge_size));
$state .= "px";
// mise à jour de l'affichage de la jauge
print "<table border='0' align='center' width='{$jauge_size}' cellpadding='0'><tr><td class='jauge' width='100%'>";
print "<img src='../../images/jauge.png' width='{$state}' height='16px'></td></tr></table>";
// calcul pourcentage avancement
$percent = floor($start / $count * 100);
// affichage du % d'avancement et de l'état
print "<div align='center'>{$percent}%</div>";
while ($mesNotices = pmb_mysql_fetch_assoc($query)) {
// permet de charger la bonne langue, mot vide...
$info = notice::indexation_prepare($mesNotices['notice_id']);
// 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']);
// restaure l'environnement de langue
notice::indexation_restaure($info);
}
pmb_mysql_free_result($query);
$next = $start + $lot;
print "\n\t<form class='form-{$current_module}' name='current_state' action='./clean.php' method='post'>\n\t<input type='hidden' name='v_state' value=\"" . urlencode($v_state) . "\">\n\t<input type='hidden' name='spec' value=\"{$spec}\">\n\t<input type='hidden' name='start' value=\"{$next}\">\n\t<input type='hidden' name='count' value=\"{$count}\">\n\t</form>\n\t<script type=\"text/javascript\"><!-- \n\tsetTimeout(\"document.forms['current_state'].submit()\",1000); \n\t-->\n\t</script>";
} else {
$spec = $spec - INDEX_GLOBAL;
$not = pmb_mysql_query("SELECT count(1) FROM notices_global_index", $dbh);
$compte = pmb_mysql_result($not, 0, 0);
$v_state .= "<br /><img src=../../images/d.gif hspace=3>" . htmlentities($msg["nettoyage_reindex_global"], ENT_QUOTES, $charset) . " :";
$v_state .= $compte . " " . htmlentities($msg["nettoyage_res_reindex_global"], ENT_QUOTES, $charset);
print "\n\t\t<form class='form-{$current_module}' name='process_state' action='./clean.php' method='post'>\n\t\t<input type='hidden' name='v_state' value=\"" . urlencode($v_state) . "\">\n\t\t<input type='hidden' name='spec' value=\"{$spec}\">\n\t\t</form>\n\t\t<script type=\"text/javascript\"><!--\n\t\t\tdocument.forms['process_state'].submit();\n\t\t\t-->\n\t\t</script>";
示例4: 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');
}
}
示例5: create_notice
public function create_notice()
{
global $dbh;
global $pmb_keyword_sep;
$fields = "\n\t\t\ttit1='" . addslashes($this->title) . "',\n\t\t\tn_resume='" . addslashes($this->summary) . "',\n\t\t\tlien='" . addslashes($this->url) . "',\n\t\t\tthumbnail_url='" . addslashes($this->logo_url) . "',\n\t\t\tdate_parution='" . addslashes($this->publication_date) . "',\n\t\t\tindex_l='" . addslashes(implode($pmb_keyword_sep, $this->tags)) . "'\n\t\t";
$req = "INSERT INTO notices SET {$fields} ";
pmb_mysql_query($req, $dbh);
$num_notice = pmb_mysql_insert_id();
if (!$num_notice) {
return array();
}
$query .= "update docwatch_items set\titem_num_notice = '" . $num_notice . "' where id_item = '" . $this->id . "'";
pmb_mysql_query($query, $dbh);
// 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);
}
示例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: 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;
}
示例9: 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;
}
示例10: mysql_query
$r = mysql_query($requete, $dbh) or die(mysql_error() . " <br />" . $requete);
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;
示例11: 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);
示例12: 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');
}
}
示例13: update_index
function update_index($id)
{
global $dbh;
// On cherche tous les n-uplet de la table notice correspondant à cet auteur.
$found = mysql_query("select distinct(notice_id) from notices where tparent_id='" . $id . "'", $dbh);
// Pour chaque n-uplet trouvés on met a jour la table notice_global_index avec l'auteur modifié :
while ($mesNotices = mysql_fetch_object($found)) {
$notice_id = $mesNotices->notice_id;
notice::majNotices($notice_id);
//Le titre de série est indexé dans les index de la notice
notice::majNoticesGlobalIndex($notice_id);
notice::majNoticesMotsGlobalIndex($notice_id, 'serie');
}
}
示例14: update_index
static function update_index($id)
{
global $dbh;
global $include_path;
$indexation_authority = new indexation_authority($include_path . "/indexation/authorities/publishers/champs_base.xml", "authorities", AUT_TABLE_PUBLISHERS);
$indexation_authority->maj($id);
// On cherche tous les n-uplet de la table notice correspondant a cet éditeur.
$found = pmb_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'éditeur modifié :
while ($mesNotices = pmb_mysql_fetch_object($found)) {
$notice_id = $mesNotices->notice_id;
notice::majNoticesGlobalIndex($notice_id);
notice::majNoticesMotsGlobalIndex($notice_id, 'publisher');
}
}
示例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);
}
}
}