本文整理汇总了PHP中thesaurus::getByEltId方法的典型用法代码示例。如果您正苦于以下问题:PHP thesaurus::getByEltId方法的具体用法?PHP thesaurus::getByEltId怎么用?PHP thesaurus::getByEltId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thesaurus
的用法示例。
在下文中一共展示了thesaurus::getByEltId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: category
function category($id = 0)
{
if ($id) {
// on cherche à atteindre une notice existante
$this->id = $id;
$this->is_under_tilde = 0;
$this->thes = thesaurus::getByEltId($id);
$this->getData();
} else {
// la notice n'existe pas
$this->id = 0;
$this->is_under_tilde = 0;
$this->getData();
}
}
示例2: get_data
function get_data()
{
global $dbh;
global $categorie_separator;
global $lang;
// on récupère les infos de la catégorie
$this->thes = thesaurus::getByEltId($this->id);
if (categories::exists($this->id, $lang)) {
$lg = $lang;
} else {
$lg = $this->thes->langue_defaut;
}
$query = "select ";
$query .= "categories.libelle_categorie,categories.note_application, categories.comment_public, ";
$query .= "noeuds.num_parent, noeuds.num_renvoi_voir ";
$query .= "from noeuds, categories ";
$query .= "where categories.langue = '" . $lg . "' ";
$query .= "and noeuds.id_noeud = '" . $this->id . "' ";
$query .= "and noeuds.id_noeud = categories.num_noeud ";
$query .= "limit 1";
$result = pmb_mysql_query($query, $dbh);
$current = pmb_mysql_fetch_object($result);
$this->libelle = $current->libelle_categorie;
$this->parent = $current->num_parent;
$this->voir = $current->num_renvoi_voir;
$this->note = $current->note_application;
$this->comment = $current->comment_public;
// on regarde si la catégorie à des enfants
$query = "select count(1) from noeuds where num_parent = '" . $this->id . "' ";
$result = pmb_mysql_query($query, $dbh);
$this->has_child = pmb_mysql_result($result, 0, 0);
// on regarde si la catégorie à des associées
$query = "select count(1) from voir_aussi where num_noeud_orig = '" . $this->id . "' or num_noeud_dest = '" . $this->id . "' ";
$result = pmb_mysql_query($query, $dbh);
$this->has_child = $this->has_child + pmb_mysql_result($result, 0, 0);
// on regarde si la catégorie est utilisée dans des notices
$query = "select count(1) from notices_categories where num_noeud = '" . $this->id . "' ";
$result = pmb_mysql_query($query, $dbh);
$this->has_notices = pmb_mysql_result($result, 0, 0);
}
示例3: make_human_query
//.........这里部分代码省略.........
$requete = str_replace("!!statut_r!!", "", $requete);
}
if ($this->fixedfields[$s[1]]["INPUT_OPTIONS"]["QUERY"][0]["USE_GLOBAL"]) {
$use_global = explode(",", $this->fixedfields[$s[1]]["INPUT_OPTIONS"]["QUERY"][0]["USE_GLOBAL"]);
for ($j = 0; $j < count($use_global); $j++) {
$var_global = $use_global[$j];
global ${$var_global};
$requete = str_replace("!!" . $var_global . "!!", ${$var_global}, $requete);
}
}
$resultat = pmb_mysql_query($requete);
$opt = array();
while ($r_ = @pmb_mysql_fetch_row($resultat)) {
$opt[$r_[0]] = $r_[1];
}
for ($j = 0; $j < count($field); $j++) {
$field_aff[$j] = $opt[$field[$j]];
}
break;
case "marc_list":
$opt = new marc_list($this->fixedfields[$s[1]]["INPUT_OPTIONS"]["NAME"][0]["value"]);
for ($j = 0; $j < count($field); $j++) {
$field_aff[$j] = $opt->table[$field[$j]];
}
break;
case "date":
$field_aff[0] = format_date($field[0]);
break;
case "authoritie":
for ($j = 0; $j < sizeof($field); $j++) {
if (is_numeric($field[$j]) && ${$op} == "AUTHORITY") {
switch ($ff['INPUT_OPTIONS']['SELECTOR']) {
case "categorie":
$thes = thesaurus::getByEltId($field[$j]);
$field[$j] = categories::getlibelle($field[$j], $lang) . " [" . $thes->libelle_thesaurus . "]";
if (isset($fieldvar["id_thesaurus"])) {
unset($fieldvar["id_thesaurus"]);
}
break;
case "auteur":
$aut = new auteur($field[$j]);
if ($aut->rejete) {
$field[$j] = $aut->name . ', ' . $aut->rejete;
} else {
$field[$j] = $aut->name;
}
if ($aut->date) {
$field[$j] .= " ({$aut->date})";
}
break;
case "editeur":
$ed = new editeur($field[$j]);
$field[$j] = $ed->name;
if ($ed->ville) {
if ($ed->pays) {
$field[$j] .= " ({$ed->ville} - {$ed->pays})";
} else {
$field[$j] .= " ({$ed->ville})";
}
}
break;
case "collection":
$coll = new collection($field[$j]);
$field[$j] = $coll->name;
break;
case "subcollection":
示例4: replace
function replace($by = 0, $link_save = 0)
{
global $msg, $dbh;
global $pmb_synchro_rdf;
if ($this->id_noeud == $by || !$this->id_noeud || !$by) {
return $msg["categ_imposible_remplace_elle_meme"];
}
$aut_link = new aut_link(AUT_TABLE_CATEG, $this->id_noeud);
// "Conserver les liens entre autorités" est demandé
if ($link_save) {
// liens entre autorités
$aut_link->add_link_to(AUT_TABLE_CATEG, $by);
}
$aut_link->delete();
//synchro_rdf : on empile les noeuds impactés pour les traiter plus loin
if ($pmb_synchro_rdf) {
$arrayIdImpactes = array();
$arrayThesImpactes = array();
$thes = thesaurus::getByEltId($this->id_noeud);
$arrayThesImpactes[] = $thes->id_thesaurus;
//parent
if ($this->num_parent != $thes->num_noeud_racine) {
$arrayIdImpactes[] = $this->num_parent;
}
//enfants
$res = noeuds::listChilds($this->id_noeud, 1);
if (pmb_mysql_num_rows($res)) {
while ($row = pmb_mysql_fetch_array($res)) {
$arrayIdImpactes[] = $row[0];
}
}
//renvoi_voir
if ($this->num_renvoi_voir) {
$arrayIdImpactes[] = $this->num_renvoi_voir;
}
}
$noeuds_a_garder = new noeuds($by);
//Si les noeuds sont du même thésaurus
if ($noeuds_a_garder->num_thesaurus == $this->num_thesaurus) {
//On déplace les catégories qui renvoi vers l'ancien noeuds pour qu'elle renvoie vers le nouveau
if (noeuds::isTarget($this->id_noeud)) {
$requete = "UPDATE noeuds SET num_renvoi_voir='" . $by . "' WHERE num_renvoi_voir='" . $this->id_noeud . "' and id_noeud!='" . $by . "' ";
@pmb_mysql_query($requete, $dbh);
}
//On garde les liens voir_aussi
$requete = "UPDATE ignore voir_aussi SET num_noeud_orig='" . $by . "' WHERE num_noeud_orig='" . $this->id_noeud . "' and num_noeud_dest!='" . $by . "' ";
@pmb_mysql_query($requete, $dbh);
$requete = "UPDATE ignore voir_aussi SET num_noeud_dest='" . $by . "' WHERE num_noeud_dest='" . $this->id_noeud . "' and num_noeud_orig!='" . $by . "'";
@pmb_mysql_query($requete, $dbh);
}
if (noeuds::isTarget($this->id_noeud)) {
//Si le noeuds à supprimé est utilisé pour des renvois et qu'il reste des liens on les supprime
//On supprime les renvoies
$requete = "UPDATE noeuds SET num_renvoi_voir='0' WHERE num_renvoi_voir='" . $this->id_noeud . "'";
@pmb_mysql_query($requete, $dbh);
}
//On déplace les notices liées
$requete = "UPDATE ignore notices_categories SET num_noeud='" . $by . "' where num_noeud = '" . $this->id_noeud . "' ";
@pmb_mysql_query($requete, $dbh);
//nettoyage d'autorities_sources
$query = "select * from authorities_sources where num_authority = " . $this->id_noeud . " and authority_type = 'category'";
$result = pmb_mysql_query($query);
if (pmb_mysql_num_rows($result)) {
while ($row = pmb_mysql_fetch_object($result)) {
if ($row->authority_favorite == 1) {
//on suprime les références si l'autorité a été importée...
$query = "delete from notices_authorities_sources where num_authority_source = " . $row->id_authority_source;
pmb_mysql_result($query);
$query = "delete from authorities_sources where id_authority_source = " . $row->id_authority_source;
pmb_mysql_result($query);
} else {
//on fait suivre le reste
$query = "update authorities_sources set num_authority = " . $by . " where num_authority_source = " . $row->id_authority_source;
pmb_mysql_query($query);
}
}
}
//On supprime le noeuds
$this->delete();
// effacement de l'identifiant unique d'autorité
$authority = new authority(0, $this->id_noeud, AUT_TABLE_CATEG);
$authority->delete();
//synchro_rdf
if ($pmb_synchro_rdf) {
//on ajoute les noeuds impactés par le $by
$thesBy = thesaurus::getByEltId($by);
if (!in_array($thesBy->id_thesaurus, $arrayThesImpactes)) {
$arrayThesImpactes[] = $thesBy->id_thesaurus;
}
$arrayIdImpactes[] = $by;
//parent
if ($noeuds_a_garder->num_parent != $thesBy->num_noeud_racine) {
$arrayIdImpactes[] = $noeuds_a_garder->num_parent;
}
//enfants
$res = noeuds::listChilds($noeuds_a_garder->id_noeud, 1);
if (pmb_mysql_num_rows($res)) {
while ($row = pmb_mysql_fetch_array($res)) {
$arrayIdImpactes[] = $row[0];
}
//.........这里部分代码省略.........
示例5: if
$q .= "and " . $first_clause . " ";
$q .= "and ( if (catlg.num_noeud is null, " . $members_catdef['where'] . ", " . $members_catlg['where'] . ") ) ";
}
$r = mysql_query($q, $dbh);
$q = "INSERT INTO catjoin SELECT ";
}
$q = 'select distinct catjoin.num_noeud, catjoin.* from catjoin ' . $clause . ' ORDER BY pert desc, catjoin.index_categorie ' . $limiter;
$found = mysql_query($q, $dbh);
while ($mesCategories_trouvees = mysql_fetch_object($found)) {
print "<li class='categ_colonne'>";
if ($mesCategories_trouvees->num_renvoi_voir) {
// Affichage des renvois_voir
if (categories::exists($mesCategories_trouvees->num_renvoi_voir, $lang)) {
$lg = $lang;
} else {
$thes = thesaurus::getByEltId($mesCategories_trouvees->num_noeud);
$lg = $thes->langue_defaut;
}
$q = "select * from noeuds, categories where num_noeud='" . $mesCategories_trouvees->num_renvoi_voir . "' and langue = '" . $lg . "' and noeuds.id_noeud = categories.num_noeud limit 1";
$found_see = mysql_query($q, $dbh);
$mesCategories = @mysql_fetch_object($found_see);
print pmb_bidi("<b>" . $mesCategories_trouvees->libelle_categorie . "</b> " . $msg['term_show_see'] . " ");
} else {
$mesCategories = $mesCategories_trouvees;
}
// Affichage de l'arborescence des renvois voir
if ($mesCategories->num_parent) {
$bar = categories::listAncestors($mesCategories->num_noeud, $lang);
$bar = array_reverse($bar);
if ($bar[3]) {
print pmb_bidi("<a href=./index.php?lvl=categ_see&id=" . $bar[3]['num_noeud'] . "><img src='./images/folder.gif' border='0' align='middle'>...</a> > ");
示例6: getlibelle
function getlibelle($num_noeud = 0, $langue = "")
{
global $dbh;
$lib = "";
if (!$num_noeud) {
$num_noeud = $this->num_noeud;
$langue = $this->langue;
}
$thes = thesaurus::getByEltId($num_noeud);
if (categories::exists($num_noeud, $langue)) {
$lg = $langue;
} else {
$lg = $thes->langue_defaut;
}
$q = "select libelle_categorie from categories where num_noeud = '" . $num_noeud . "' ";
$q .= "and langue = '" . $lg . "' limit 1";
$r = pmb_mysql_query($q, $dbh);
if (pmb_mysql_num_rows($r)) {
$lib = pmb_mysql_result($r, 0, 0);
}
return $lib;
}
示例7: str_replace
$browser_header .= "<a href='";
$browser_header .= $base_url;
$browser_header .= $tcateg->path_table[$i]['id'];
$browser_header .= '&id2=' . $tcateg->path_table[$i]['id'];
$browser_header .= '&id_thes=' . $id_thes;
$browser_header .= "'>";
$browser_header .= $tcateg->path_table[$i]['libelle'];
$browser_header .= "</a>";
}
$browser_header ? $browser_header .= '><strong>' : ($browser_header = '<strong>');
$browser_header .= $tcateg->path_table[sizeof($tcateg->path_table) - 1]['libelle'];
$browser_header .= '</strong>';
$bouton_ajouter = str_replace("!!id_aj!!", $tcateg->path_table[sizeof($tcateg->path_table) - 1]['id'], $bouton_ajouter);
} else {
$browser_header = "";
$t = thesaurus::getByEltId($cat[0]);
$bouton_ajouter = str_replace("!!id_aj!!", $t->num_noeud_racine, $bouton_ajouter);
}
$premier = false;
}
if (!$tcateg->is_under_tilde || $tcateg->voir_id || $keep_tilde) {
$not_use_in_indexation = $tcateg->not_use_in_indexation;
$browser_content .= "<tr><td>";
if ($id_thes == -1 && $thesaurus_mode_pmb) {
$display = '[' . htmlentities($tcateg->thes->libelle_thesaurus, ENT_QUOTES, $charset) . ']';
} else {
$display = '';
}
if ($tcateg->voir_id) {
$tcateg_voir = new category($tcateg->voir_id);
$display .= "{$tcateg->libelle} -><i>" . $tcateg_voir->catalog_form . "@</i>";
示例8: get_human_field
protected function get_human_field($field, $values)
{
global $msg, $charset;
switch ($field["INPUT_TYPE"]) {
case "list":
$options = $field["INPUT_OPTIONS"]["OPTIONS"][0];
$opt = array();
for ($j = 0; $j < count($options["OPTION"]); $j++) {
if (substr($options["OPTION"][$j]["value"], 0, 4) == "msg:") {
$opt[$options["OPTION"][$j]["VALUE"]] = $msg[substr($options["OPTION"][$j]["value"], 4, strlen($options["OPTION"][$j]["value"]) - 4)];
} else {
$opt[$options["OPTION"][$j]["VALUE"]] = $options["OPTION"][$j]["value"];
}
}
for ($j = 0; $j < count($values); $j++) {
$field_aff[$j] = $opt[$values[$j]];
}
break;
case "query_list":
$requete = $field["INPUT_OPTIONS"]["QUERY"][0]["value"];
if ($field["FILTERING"] == "yes") {
$requete = str_replace("!!acces_j!!", "", $requete);
$requete = str_replace("!!statut_j!!", "", $requete);
$requete = str_replace("!!statut_r!!", "", $requete);
}
if ($field["INPUT_OPTIONS"]["QUERY"][0]["USE_GLOBAL"]) {
$use_global = explode(",", $field["INPUT_OPTIONS"]["QUERY"][0]["USE_GLOBAL"]);
for ($j = 0; $j < count($use_global); $j++) {
$var_global = $use_global[$j];
global ${$var_global};
$requete = str_replace("!!" . $var_global . "!!", ${$var_global}, $requete);
}
}
$resultat = pmb_mysql_query($requete);
$opt = array();
while ($r_ = @pmb_mysql_fetch_row($resultat)) {
$opt[$r_[0]] = $r_[1];
}
for ($j = 0; $j < count($values); $j++) {
$field_aff[$j] = $opt[$values[$j]];
}
break;
case "marc_list":
$opt = new marc_list($field["INPUT_OPTIONS"]["NAME"][0]["value"]);
for ($j = 0; $j < count($values); $j++) {
$field_aff[$j] = $opt->table[$values[$j]];
}
break;
case "date":
$field_aff[0] = format_date($values[0]);
break;
case "authoritie":
for ($j = 0; $j < sizeof($values); $j++) {
if (is_numeric($values[$j]) && ${$op} == "AUTHORITY") {
switch ($field['INPUT_OPTIONS']['SELECTOR']) {
case "categorie":
$thes = thesaurus::getByEltId($values[$j]);
$values[$j] = categories::getlibelle($values[$j], $lang) . " [" . $thes->libelle_thesaurus . "]";
if (isset($fieldvar["id_thesaurus"])) {
unset($fieldvar["id_thesaurus"]);
}
break;
case "auteur":
$aut = new auteur($values[$j]);
if ($aut->rejete) {
$values[$j] = $aut->name . ', ' . $aut->rejete;
} else {
$values[$j] = $aut->name;
}
if ($aut->date) {
$values[$j] .= " ({$aut->date})";
}
break;
case "editeur":
$ed = new editeur($values[$j]);
$values[$j] = $ed->name;
if ($ed->ville) {
if ($ed->pays) {
$values[$j] .= " ({$ed->ville} - {$ed->pays})";
} else {
$values[$j] .= " ({$ed->ville})";
}
}
break;
case "collection":
$coll = new collection($values[$j]);
$values[$j] = $coll->name;
break;
case "subcollection":
$coll = new subcollection($values[$j]);
$values[$j] = $coll->name;
break;
case "serie":
$serie = new serie($values[$j]);
$values[$j] = $serie->name;
break;
case "indexint":
$indexint = new indexint($values[$j]);
if ($indexint->comment) {
$values[$j] = $indexint->name . " - " . $indexint->comment;
//.........这里部分代码省略.........
示例9: listAncestors
function listAncestors($id_noeud = 0)
{
global $dbh;
if (!$id_noeud && is_object($this)) {
$id_noeud = $this->id_noeud;
$path = $this->path;
} else {
$q = "select path from noeuds where id_noeud = '" . $id_noeud . "' ";
$r = mysql_query($q, $dbh);
if ($r && mysql_num_rows($r)) {
$path = mysql_result($r, 0, 0);
}
}
if ($path) {
$id_list = explode('/', $path);
krsort($id_list);
return $id_list;
}
if (!$id_noeud && is_object($this)) {
$id_noeud = $this->id_noeud;
}
$thes = thesaurus::getByEltId($id_noeud);
$id_top = $thes->num_noeud_racine;
$i = 0;
$id_list[$i] = $id_noeud;
while ($id_list[$i] != $id_top && $id_list[$i] != 0) {
$q = "select num_parent from noeuds where id_noeud = '" . $id_list[$i] . "' limit 1";
$r = mysql_query($q, $dbh);
$i++;
$id_list[$i] = mysql_result($r, 0, 0);
}
return $id_list;
}
示例10: listSynonyms
/**
* Permet de récupérer les catégories dont le num_renvoi correspond à l'id du noeud courant
*/
function listSynonyms()
{
global $dbh, $lang;
$thes = thesaurus::getByEltId($this->id);
$q = "select id_noeud from noeuds where num_thesaurus = '" . $thes->id_thesaurus . "' and autorite = 'ORPHELINS' ";
$r = pmb_mysql_query($q, $dbh);
if ($r && pmb_mysql_num_rows($r)) {
$num_noeud_orphelins = pmb_mysql_result($r, 0, 0);
} else {
$num_noeud_orphelins = 0;
}
$q = "select ";
$q .= "catdef.num_noeud, noeuds.autorite, noeuds.num_parent, noeuds.num_renvoi_voir, noeuds.visible, noeuds.num_thesaurus, ";
$q .= "if (catlg.num_noeud is null, catdef.langue, catlg.langue ) as langue, ";
$q .= "if (catlg.num_noeud is null, catdef.libelle_categorie, catlg.libelle_categorie ) as libelle_categorie, ";
$q .= "if (catlg.num_noeud is null, catdef.note_application, catlg.note_application ) as note_application, ";
$q .= "if (catlg.num_noeud is null, catdef.comment_public, catlg.comment_public ) as comment_public, ";
$q .= "if (catlg.num_noeud is null, catdef.comment_voir, catlg.comment_voir ) as comment_voir, ";
$q .= "if (catlg.num_noeud is null, catdef.index_categorie, catlg.index_categorie ) as index_categorie ";
$q .= "from noeuds left join categories as catdef on noeuds.id_noeud=catdef.num_noeud and catdef.langue = '" . $thes->langue_defaut . "' ";
$q .= "left join categories as catlg on catdef.num_noeud = catlg.num_noeud and catlg.langue = '" . $lang . "' ";
$q .= "where ";
$q .= "noeuds.num_parent = '{$num_noeud_orphelins}' and noeuds.num_renvoi_voir='" . $this->id . "' ";
//if (!$keep_tilde) $q.= "and catdef.libelle_categorie not like '~%' ";
//if ($ordered !== 0) $q.= "order by ".$ordered." ";
$q .= "";
// A voir pour ajouter un parametre gestion maxddisplay
$r = pmb_mysql_query($q, $dbh);
while ($cat_see = pmb_mysql_fetch_object($r)) {
$this->list_see[] = array('id' => $cat_see->num_noeud, 'name' => $cat_see->comment_public, 'parend_id' => $cat_see->num_parent, 'libelle' => $cat_see->libelle_categorie);
}
return $this->list_see;
}