本文整理汇总了PHP中notice::replace方法的典型用法代码示例。如果您正苦于以下问题:PHP notice::replace方法的具体用法?PHP notice::replace怎么用?PHP notice::replace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notice
的用法示例。
在下文中一共展示了notice::replace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: import_new_notice
//.........这里部分代码省略.........
for ($j = 0; $j < count($tu_500_s[$i]); $j++) {
$value_tu[$i]['ref'][$j] = $tu_500_s[$i][$j];
}
for ($j = 0; $j < count($tu_500_j[$i]); $j++) {
$value_tu[$i]['subdiv'][$j] = $tu_500_j[$i][$j];
}
if ($authorities_notices && $aut['authority_number'] != "") {
$tu_id = keep_authority_infos($value_tu[$i]['authority_number'], "uniform_title", $origin_authority, $notice_id, $value_tu[$i]);
} else {
$tu_id = titre_uniforme::import($value_tu[$i]);
}
if ($tu_id) {
$requete = "INSERT INTO notices_titres_uniformes SET \n\t\t\t\t\tntu_num_notice='{$notice_id}', \n\t\t\t\t\tntu_num_tu='{$tu_id}', \n\t\t\t\t\tntu_titre='" . addslashes($tu_500[$i]['i']) . "', \n\t\t\t\t\tntu_date='" . addslashes($tu_500[$i]['k']) . "', \n\t\t\t\t\tntu_sous_vedette='" . addslashes($tu_500[$i]['l']) . "', \n\t\t\t\t\tntu_langue='" . addslashes($tu_500[$i]['m']) . "', \n\t\t\t\t\tntu_version='" . addslashes($tu_500[$i]['q']) . "', \n\t\t\t\t\tntu_mention='" . addslashes($tu_500[$i]['w']) . "',\n\t\t\t\t\tntu_ordre={$i} \t\t\t\t\n\t\t\t\t\t";
mysql_query($requete, $dbh);
}
}
}
global $lang_code;
global $org_lang_code;
$rqt_ins = "insert into notices_langues (num_notice, type_langue, code_langue, ordre_langue) VALUES ";
$values = "";
for ($i = 0; $i < count($lang_code); $i++) {
$lang_code[$i] = trim($lang_code[$i]);
if ($values != "") {
$values .= ",";
}
$values .= "('{$notice_id}',0, '" . addslashes($lang_code[$i]) . "','{$i}') ";
//$rqt_ins = "insert into notices_langues (num_notice, type_langue, code_langue) VALUES ('$notice_id',0, '".addslashes($lang_code[$i])."') " ;
//@mysql_query($rqt_ins, $dbh);
}
for ($i = 0; $i < count($org_lang_code); $i++) {
$org_lang_code[$i] = trim($org_lang_code[$i]);
if ($values != "") {
$values .= ",";
}
$values .= "('{$notice_id}',1, '" . addslashes($org_lang_code[$i]) . "','" . $i . "') ";
//$rqt_ins = "insert into notices_langues (num_notice, type_langue, code_langue) VALUES ('$notice_id',1, '".addslashes($org_lang_code[$i])."') " ;
// @mysql_query($rqt_ins, $dbh);
}
@mysql_query($rqt_ins . $values, $dbh);
//Import des catégories
category_auto::save_info_categ();
//Calcule de la signature
$sign = new notice_doublon();
$val = $sign->gen_signature($notice_id);
mysql_query("update notices set signature='{$val}' where notice_id=" . $notice_id, $dbh);
//Si on a un id de notice et qu'il n'est pas dans le tableau des notices créées, on l'ajoute
if ($link_generate && trim($id_unimarc) !== "" && !$notices_crees[$id_unimarc]) {
$notices_crees[$id_unimarc] = $notice_id;
} elseif ($link_generate && trim($id_unimarc) !== "" && $notices_crees[$id_unimarc]) {
//Si la notice a déjà été créé (Export des liens dans les notices liées) on remplace celle précédemment par celle en cour de traitement
$niveau_biblio = $bibliographic_level . $hierarchic_level;
switch ($niveau_biblio) {
case 'm0':
//On a une notice de monographie
$notice_a_supp = $notices_crees[$id_unimarc];
//On garde les liens
$requete = "UPDATE notices_relations SET num_notice='" . $notice_id . "' WHERE num_notice='" . $notice_a_supp . "' ";
@mysql_query($requete, $dbh);
$requete = "UPDATE notices_relations SET linked_notice='" . $notice_id . "' WHERE linked_notice='" . $notice_a_supp . "' ";
@mysql_query($requete, $dbh);
$ma_notice = new notice($notice_a_supp);
$ma_notice->replace($notice_id);
break;
case 's1':
//On a une notice de periodique
$notice_a_supp = $notices_crees[$id_unimarc];
$ma_notice = new serial($notice_a_supp);
$ma_notice->replace($notice_id);
break;
case 'b2':
//On a une notice de bulletin
$notice_a_supp = $notices_crees[$id_unimarc];
//Dans les bulletins
$requete = "update bulletins set num_notice='" . $notice_id . "' where num_notice='" . $notice_a_supp . "' ";
mysql_query($requete, $dbh);
//Dans les relations entre notice
$requete = "update notices_relations set num_notice='" . $notice_id . "' where num_notice='" . $notice_a_supp . "'";
mysql_query($requete, $dbh);
$requete = "update notices_relations set linked_notice='" . $notice_id . "' where linked_notice='" . $notice_a_supp . "'";
mysql_query($requete, $dbh);
notice::del_notice($notice_a_supp);
break;
case 'a2':
//On a une notice d'article
$notice_a_supp = $notices_crees[$id_unimarc];
//Dans les bulletins
$requete = "update analysis set analysis_notice='" . $notice_id . "' where analysis_notice='" . $notice_a_supp . "' ";
mysql_query($requete, $dbh);
//Dans les relations entre notice
$requete = "update notices_relations set num_notice='" . $notice_id . "' where num_notice='" . $notice_a_supp . "'";
mysql_query($requete, $dbh);
$requete = "update notices_relations set linked_notice='" . $notice_id . "' where linked_notice='" . $notice_a_supp . "'";
mysql_query($requete, $dbh);
notice::del_notice($notice_a_supp);
break;
}
$notices_crees[$id_unimarc] = $notice_id;
}
}
示例2: import_new_notice_suite
function import_new_notice_suite()
{
global $dbh;
global $notice_id;
global $bl, $hl;
global $infos_4XX;
global $hierarchic_level;
global $bibliographic_level;
global $doc_type;
global $origine_notice;
global $notices_crees;
global $issn_011, $info_900;
global $tit_200a;
global $isbn;
global $statutnot;
global $info_003;
global $info_336, $info_337;
global $isbn_only, $isbn_dedoublonnage;
if (isset($bibliographic_level) && isset($hierarchic_level)) {
$niveau_biblio = $bibliographic_level . $hierarchic_level;
} else {
$niveau_biblio = $bl . $hl;
}
//num_notice = fille
//linked_notice = mere
$sens = array('mother' => array("linked_notice", "num_notice"), 'child' => array("num_notice", "linked_notice"));
$link_type = array('412' => array('code' => "v", 'sens_link' => "child"), '413' => array('code' => "v", 'sens_link' => "mother"), '421' => array('code' => "e", 'sens_link' => "mother"), '422' => array('code' => "e", 'sens_link' => "child"), '423' => array('code' => "k", 'sens_link' => "child"), '430' => array('code' => "l", 'sens_link' => "child"), '431' => array('code' => "o", 'sens_link' => "mother"), '432' => array('code' => "t", 'sens_link' => "child"), '433' => array('code' => "o", 'sens_link' => "mother"), '434' => array('code' => "m", 'sens_link' => "child"), '435' => array('code' => "s", 'sens_link' => "child"), '436' => array('code' => "n", 'sens_link' => "mother"), '437' => array('code' => "o", 'sens_link' => "mother"), '440' => array('code' => "l", 'sens_link' => "mother"), '441' => array('code' => "o", 'sens_link' => "child"), '442' => array('code' => "t", 'sens_link' => "mother"), '443' => array('code' => "o", 'sens_link' => "child"), '444' => array('code' => "m", 'sens_link' => "mother"), '445' => array('code' => "s", 'sens_link' => "mother"), '446' => array('code' => "o", 'sens_link' => "child"), '447' => array('code' => "n", 'sens_link' => "child"), '451' => array('code' => "u", 'sens_link' => "child"), '452' => array('code' => "p", 'sens_link' => "child"), '453' => array('code' => "h", 'sens_link' => "mother"), '454' => array('code' => "h", 'sens_link' => "child"), '455' => array('code' => "q", 'sens_link' => "mother"), '456' => array('code' => "q", 'sens_link' => "child"), '520' => array('code' => "f", 'sens_link' => "child"));
//dédoublonnage !
if ($isbn && $isbn_dedoublonnage) {
$query = "select notice_id from notices where code like '" . $isbn . "' and notice_id != " . $notice_id;
$result = mysql_query($query);
if (mysql_num_rows($result)) {
$row = mysql_fetch_object($result);
notice::del_notice($notice_id);
$notice_id = $row->notice_id;
mysql_query("insert into error_log (error_origin, error_text) values ('import_expl_" . addslashes(SESSid) . ".inc', '" . addslashes("La notice (" . $tit_200a[0] . ", " . $isbn . ") n'a pas été reprise car elle existe déjà en base (notice id: " . $notice_id . ")") . "') ");
}
}
if (!$isbn_dedoublonnage || $isbn_only == 1) {
$rq = "UPDATE notices SET code=REPLACE(code, '_pasToucheACa', '') WHERE notice_id = " . $notice_id;
mysql_query($rq);
} elseif ($issn_011[0]) {
$query = "select notice_id from notices where code like '" . $issn_011[0] . "' and notice_id != " . $notice_id;
$result = mysql_query($query);
if (mysql_num_rows($result)) {
while ($row = mysql_fetch_object($result)) {
if (in_array($row->notice_id, $notices_crees)) {
$old = new notice($row->notice_id);
$old->replace($notice_id);
$tab = array_flip($notices_crees);
unset($tab[$row->notice_id]);
$notices_crees = array_flip($tab);
} else {
notice::del_notice($notice_id);
$notice_id = $row->notice_id;
mysql_query("insert into error_log (error_origin, error_text) values ('import_expl_" . addslashes(SESSid) . ".inc', '" . addslashes("La notice (" . $tit_200a[0] . ", " . $isbn . ") n'a pas été reprise car elle existe déjà en base (notice id: " . $notice_id . ")") . "') ");
}
}
}
}
$n_gen_plus = "";
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...
//.........这里部分代码省略.........
示例3: die
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
die("no access");
}
// page de remplacement notice
//verification des droits de modification notice
$acces_m = 1;
if ($gestion_acces_active == 1 && $gestion_acces_user_notice == 1) {
require_once "{$class_path}/acces.class.php";
$ac = new acces();
$dom_1 = $ac->setDomain(1);
$acces_m = $dom_1->getRights($PMBuserid, $id, 8);
}
if ($acces_m == 0) {
error_message('', htmlentities($dom_1->getComment('mod_noti_error'), ENT_QUOTES, $charset), 1, '');
} else {
print "<h1>{$msg['catal_rep_not_h1']}</h1>";
if (!$by) {
require_once "{$include_path}/templates/catal_form.tpl.php";
$notice = new notice($id);
$notice->replace_form();
} else {
// routine de remplacement
$notice = new notice($id);
$rep_result = $notice->replace($by);
if (!$rep_result) {
print "<div class='row'><div class='msg-perio'>" . $msg["maj_encours"] . "</div></div>\n\t\t\t\t<script type=\"text/javascript\">document.location='./catalog.php?categ=isbd&id={$by}'</script>";
} else {
error_message($msg[132], $rep_result, 1, "./catalog.php?categ=modif&id={$id}");
}
}
}