本文整理汇总了PHP中formatISBN函数的典型用法代码示例。如果您正苦于以下问题:PHP formatISBN函数的具体用法?PHP formatISBN怎么用?PHP formatISBN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了formatISBN函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_notice_id
public function get_notice_id()
{
global $pmb_keyword_sep;
$notice_id = 0;
$this->data = array();
$this->data['tit1'] = $this->data['tit4'] = $this->data['authors'] = $this->data['co_authors'] = $this->data['code'] = $this->data['npages'] = $this->data['year'] = $this->data['index_l'] = $this->data['url'] = $this->data['thumbnail_content'] = $this->data['publisher'] = $this->data['n_resume'] = "";
if ($this->mimetype == "application/epub+zip") {
//pour les ebook, on gère ca directement ici !
$this->data['tit1'] = $this->metas['title'][0];
$this->data['authors'] = $this->metas['creator'];
$this->data['co_authors'] = $this->metas['contributor'];
if ($this->metas['identifier']['isbn']) {
$this->data['code'] = \formatISBN($this->metas['identifier']['isbn'], 13);
} else {
if ($this->metas['identifier']['ean']) {
$this->data['code'] = \EANtoISBN($this->metas['identifier']['ean']);
$this->data['code'] = \formatISBN($code, 13);
}
}
if ($this->metas['identifier']['uri']) {
$this->data['url'] = \clean_string($this->metas['identifier']['uri']);
}
$this->data['publisher'] = $this->metas['publisher'][0];
$this->data['year'] = $this->metas['date'][0]['value'];
if (strlen($this->data['year']) && strlen($this->data['year']) != 4) {
$this->data['year'] = \formatdate(detectFormatDate($this->data['year']));
}
$this->data['lang'] = $this->metas['language'];
$this->data['n_resume'] = implode("\n", $this->metas['description']);
$this->data['keywords'] = implode($pmb_keyword_sep, $this->metas['subject']);
$this->data['thumbnail_content'] = $this->metas['thumbnail_content'];
} else {
foreach ($this->map['meta'] as $map_field => $map) {
foreach ($this->metas as $meta_field => $meta_value) {
if ($map_field == $meta_field) {
if (method_exists($this, $map['function'])) {
$this->data[$map['field']] = $this->{$map}['function']($this->data[$map['field']], $meta_value, $map['params']);
} else {
$this->data[$map['field']] = $meta_value;
}
break;
}
}
}
}
if (!$this->data['tit1']) {
$this->data['tit1'] = $this->name;
}
$notice_id = $this->create_notice();
$notice_id = $this->dedoublonne($notice_id);
return $notice_id;
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:52,代码来源:metasMapper.php
示例2: generateListing_B
/**
* Listing for books
* @param <type> $fisbn Book ISBN
* @param <type> $ftitle Book title
* @param <type> $fclist Array containing courses used for books
*/
function generateListing_B($fisbn, $ftitle, $fclist)
{
$formatted = formatISBN($fisbn);
if (count($fclist) == 0) {
$clabel = "";
} else {
$clabel = "Courses ";
}
$return = "\n\t\t<div class='item-title'>{$ftitle}</div>\n\t\t{$formatted}";
if (!$clabel == "") {
foreach ($fclist as $key => $val) {
$return = $return . "<div class='item-course item-info'><p>{$val}</p></div>";
}
}
return $return;
}
开发者ID:n1ckyoung,项目名称:bellbook,代码行数:22,代码来源:listing.php
示例3: traite_val
function traite_val($value, $idf)
{
switch ($idf) {
case "22":
if (isISBN($value)) {
// si la saisie est un ISBN
$code = formatISBN($value);
// si échec, ISBN erroné on le prend sous cette forme
if (!$code) {
$code = $value;
}
} else {
$code = $value;
}
$ret = $code;
break;
default:
$ret = $value;
break;
}
return $ret;
}
开发者ID:bouchra012,项目名称:PMB,代码行数:22,代码来源:export_z3950_new.php
示例4: trim
$t_notice['year'] = trim($f_year);
$f_nocoll && $t_notice['coll_id'] ? $t_notice['nocoll'] = trim($f_nocoll) : ($t_notice['nocoll'] = '');
$t_notice['mention_edition'] = trim($f_mention_edition);
if ($f_cb) {
// ce controle redondant est la pour le cas ou l'utilisateur aurait change le code
if (isEAN($f_cb)) {
// la saisie est un EAN -> on tente de le formater en ISBN
$code = EANtoISBN($f_cb);
// si echec, on prend l'EAN comme il vient
if (!$code) {
$code = $f_cb;
}
} else {
if (isISBN($f_cb)) {
// si la saisie est un ISBN
$code = formatISBN($f_cb, 13);
// si echec, ISBN errone on le prend sous cette forme
if (!$code) {
$code = $f_cb;
}
} else {
// ce n'est rien de tout ca, on prend la saisie telle quelle
$code = $f_cb;
}
}
$t_notice['code'] = $code;
}
$t_notice['npages'] = $f_npages;
$t_notice['ill'] = $f_ill;
$t_notice['size'] = $f_size;
$t_notice['prix'] = $f_prix;
开发者ID:hogsim,项目名称:PMB,代码行数:31,代码来源:update_notice.inc.php
示例5: clean_string
$ex_query = clean_string($ex_query);
$EAN = '';
$isbn = '';
$code = '';
// on teste si c'est un EAN
if (isEAN($ex_query)) {
// la chaine passée est un EAN pur (rappel : livres seulement)
$isbn = EANtoISBN($ex_query);
$EAN = $ex_query;
$code10 = formatISBN($isbn, 10);
} else {
// apparement pas un EAN
// l'utilisateur a peut-être saisi un isbn à la main
if (isISBN($ex_query)) {
$isbn = formatISBN($ex_query);
$code13 = formatISBN($isbn, 13);
} else {
$code = $ex_query;
}
}
if ($EAN && $isbn) {
// cas des EAN purs : constitution de la requête
$requete = "SELECT * FROM notices WHERE code='{$EAN}' OR code in ('{$isbn}','" . $code10 . "')";
$myQuery = mysql_query($requete, $dbh);
} elseif ($isbn) {
// recherche d'un isbn
$requete = "SELECT * FROM notices WHERE code in ('{$isbn}','" . $code13 . "')";
$myQuery = mysql_query($requete, $dbh);
} else {
// recherche d'un exemplaire
// note : le code est recherché aussi dans le champ code des notices
开发者ID:bouchra012,项目名称:PMB,代码行数:31,代码来源:expl.inc.php
示例6: traite_code_isbn
function traite_code_isbn($saisieISBN = "")
{
if ($saisieISBN) {
if (isEAN($saisieISBN)) {
// la saisie est un EAN -> on tente de le formater en ISBN
$code = EANtoISBN($saisieISBN);
// si échec, on prend l'EAN comme il vient
if (!$code) {
$code = $saisieISBN;
}
} else {
if (isISBN($saisieISBN)) {
// si la saisie est un ISBN
$code = formatISBN($saisieISBN);
// si échec, ISBN erroné on le prend sous cette forme
if (!$code) {
$code = $saisieISBN;
}
} else {
// ce n'est rien de tout ça, on prend la saisie telle quelle
$code = $saisieISBN;
}
}
return $code;
}
return "";
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:27,代码来源:isbn.inc.php
示例7: make_first_search
function make_first_search()
{
global $msg, $dbh;
global $elt_query;
global $notice_statut_query, $doctype_query;
global $nb_per_page, $nb_per_page_select;
global $results_show_all;
if (!$nb_per_page) {
$nb_per_page = $nb_per_page_select;
}
$restrict = "niveau_biblio='m' ";
if ($notice_statut_query != '-1') {
$restrict .= "and statut='" . $notice_statut_query . "' ";
}
if ($doctype_query != '-1') {
$restrict .= "and typdoc='" . $doctype_query . "' ";
}
$suite_rqt = "or code='" . $elt_query . "' ";
$isbn_verif = traite_code_isbn(stripslashes($elt_query));
if (isISBN($isbn_verif)) {
$suite_rqt .= "or code='" . formatISBN($isbn_verif, 13) . "' ";
$suite_rqt .= "or code='" . formatISBN($isbn_verif, 10) . "' ";
$q_count = "select count(*) from notices where " . $restrict . " and (0 " . $suite_rqt . ")";
$r_count = pmb_mysql_query($q_count, $dbh);
$n_count = pmb_mysql_result($r_count, 0, 0);
$this->nbresults = $n_count;
$q_list = "select notice_id from notices where " . $restrict . " and (0 " . $suite_rqt . ")";
if (!$results_show_all) {
$q_list .= " limit " . $this->page * $nb_per_page . ", " . $nb_per_page . " ";
}
$r_list = pmb_mysql_query($q_list, $dbh);
$this->t_query = $r_list;
if (!$results_show_all) {
$this->nbepage = ceil($this->nbresults / $nb_per_page);
} else {
$this->nbepage = 1;
}
} else {
$aq = new analyse_query(stripslashes($elt_query));
if ($aq->error) {
$this->show_form();
error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message));
return;
} else {
$q_members = $aq->get_query_members("notices", "index_wew", "index_sew", "notice_id");
$q_count = "select count(*) from notices where " . $restrict . " and (" . $q_members["where"] . " " . $suite_rqt . ")";
$r_count = pmb_mysql_query($q_count, $dbh);
$n_count = pmb_mysql_result($r_count, 0, 0);
$this->nbresults = $n_count;
$q_list = "select notice_id, " . $q_members['select'] . " as pert from notices where " . $restrict . " and (" . $q_members["where"] . " " . $suite_rqt . ") " . $q_members['post'];
if (!$results_show_all) {
$q_list .= " limit " . $this->page * $nb_per_page . ", " . $nb_per_page . " ";
}
$r_list = pmb_mysql_query($q_list, $dbh);
$this->t_query = $r_list;
if (!$results_show_all) {
$this->nbepage = ceil($this->nbresults / $nb_per_page);
} else {
$this->nbepage = 1;
}
}
}
return ELT_LIST;
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:64,代码来源:sel_searcher.class.php
示例8: process_isbn
function process_isbn($isbn)
{
/* We've got everything, let's have a look if ISBN already exists in notices table */
$isbn_nettoye = preg_replace('/-|\\.| |\\(|\\)|\\[|\\]|\\:|\\;|[A-WY-Z]/i', '', $isbn);
$isbn_nettoye_13 = substr($isbn_nettoye, 0, 13);
$isbn_nettoye_10 = substr($isbn_nettoye, 0, 10);
$isbn_OK = "";
if (isEAN($isbn_nettoye_13)) {
/* it's an EAN -> convert it to ISBN */
$isbn_OK = EANtoISBN($isbn_nettoye_13);
}
if (!$isbn_OK) {
if (isISBN($isbn_nettoye_10)) {
$isbn_OK = formatISBN($isbn_nettoye_10);
}
}
if (!$isbn_OK) {
$isbn_OK = clean_string($isbn);
}
return $isbn_OK;
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:21,代码来源:z3950_notice.class.php
示例9: getEnrichment
function getEnrichment($notice_id, $source_id, $type = "", $enrich_params = array(), $page = 1)
{
$params = $this->get_source_params($source_id);
if ($params["PARAMETERS"]) {
//Affichage du formulaire avec $params["PARAMETERS"]
$vars = unserialize($params["PARAMETERS"]);
foreach ($vars as $key => $val) {
global ${$key};
${$key} = $val;
}
}
$enrichment = array();
//on renvoi ce qui est demandé... si on demande rien, on renvoi tout..
switch ($type) {
case "books":
default:
$rqt = "select code from notices where notice_id = '{$notice_id}'";
$res = pmb_mysql_query($rqt);
if (pmb_mysql_num_rows($res)) {
$ref = pmb_mysql_result($res, 0, 0);
//google change son API, on s'assure d'avoir un ISBN13 formaté !
if (isEAN(${$ref})) {
// la saisie est un EAN -> on tente de le formater en ISBN
$EAN = $ref;
$isbn = EANtoISBN($ref);
// si échec, on prend l'EAN comme il vient
if (!$isbn) {
$code = str_replace("*", "%", $ref);
} else {
$code = $isbn;
$code10 = formatISBN($code, 10);
}
} else {
if (isISBN($ref)) {
// si la saisie est un ISBN
$isbn = formatISBN($ref);
// si échec, ISBN erroné on le prend sous cette forme
if (!$isbn) {
$code = str_replace("*", "%", $ref);
} else {
$code10 = $isbn;
$code = formatISBN($code10, 13);
}
} else {
// ce n'est rien de tout ça, on prend la saisie telle quelle
$code = str_replace("*", "%", $ref);
}
}
//plutot que de faire une requete pour lancer que si ca marche, on ajoute un callback en cas d'échec
if ($code) {
$enrichment['books']['content'] = "\n\t\t\t\t\t\t<div id='gbook{$notice_id}' style='width: " . $width . "px; height: " . $height . "px;margin-bottom:0.5em;'></div>";
$enrichment['books']['callback'] = "\n\t\t\t\t\t\t\tvar viewer = new google.books.DefaultViewer(document.getElementById('gbook" . $notice_id . "'));\n\t\t\t\t\t\t\tvar gbook" . $notice_id . "_failed = function(){\n\t\t\t\t\t\t\t\tvar content = document.getElementById('gbook" . $notice_id . "');\n\t\t\t\t\t\t\t\tvar span = document.createElement('span');\n\t\t\t\t\t\t\t\tvar txt = document.createTextNode('" . $this->msg["gbook_no_preview"] . "');\n\t\t\t\t\t\t\t\tspan.appendChild(txt);\n\t\t\t\t\t\t\t\tcontent.appendChild(span);\n\t\t\t\t\t\t\t\tcontent.style.height='auto';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tviewer.load('ISBN:" . str_replace("-", "", $code) . "',gbook" . $notice_id . "_failed);\t\n\t\t\t\t\t\t";
} else {
$enrichment['books']['content'] = "<span>" . $this->msg["gbook_no_preview"] . "</span>";
}
}
break;
}
$enrichment['source_label'] = $this->msg['gbooks_enrichment_source'];
return $enrichment;
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:61,代码来源:google_book.class.php
示例10: author_enrichment
static function author_enrichment($id)
{
global $opac_enrichment_bnf_sparql;
global $lang;
global $charset;
if ($opac_enrichment_bnf_sparql) {
// definition des endpoints databnf et dbpedia
$configbnf = array('remote_store_endpoint' => 'http://data.bnf.fr/sparql');
$storebnf = ARC2::getRemoteStore($configbnf);
$configdbp = array('remote_store_endpoint' => 'http://dbpedia.org/sparql');
$storedbp = ARC2::getRemoteStore($configdbp);
// verifier la date de author_enrichment_last_update => if(self)
$aut_id_bnf = self::get_id_bnf($id);
// si l'auteur est dans la base on récupère son uri bnf...
if ($aut_id_bnf != "") {
$sparql = "\n\t\t\t\t\t\tPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\n\t\t\t\t\t\tPREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n\t\t\t\t\t\tPREFIX bnf-onto: <http://data.bnf.fr/ontology/bnf-onto/>\n\t\t\t\t\t\tSELECT distinct ?author WHERE {\n\t\t\t\t\t\t?author rdf:type skos:Concept .\n\t\t\t\t\t\t?author bnf-onto:FRBNF {$aut_id_bnf}\n\t\t\t\t\t}";
$rows = $storebnf->query($sparql, 'rows');
// On vérifie qu'il n'y a pas d'erreur sinon on stoppe le programme et on renvoi une chaine vide
$err = $storebnf->getErrors();
if ($err) {
return;
}
}
// definition de l'uri bnf
if ($rows[0]["author"]) {
$uri_bnf = $rows[0]["author"];
$enrichment['links']['uri_bnf'] = $uri_bnf;
// ... ainsi que son uri dbpedia si elle existe
$sparql = "\n\t\t\t\t\t\tPREFIX rdagroup2elements: <http://rdvocab.info/ElementsGr2/>\n\t\t\t\t\t\tPREFIX owl:<http://www.w3.org/2002/07/owl#>\n\t\t\t\t\t\tPREFIX foaf: <http://xmlns.com/foaf/0.1/>\n\t\t\t\t\t\tSELECT ?dbpedia WHERE{\n\t\t\t\t\t\t<{$uri_bnf}> foaf:focus ?author.\n\t\t\t\t\t\tOPTIONAL {?author owl:sameAs ?dbpedia.\n\t\t\t\t\t\t\tFILTER regex(str(?dbpedia), 'http://dbpedia', 'i')}.\n\t\t\t\t\t}";
try {
$rows = $storebnf->query($sparql, 'rows');
} catch (Exception $e) {
$rows = array();
}
if ($rows[0]["dbpedia"]) {
$sub_dbp_uri = substr($rows[0]["dbpedia"], 28);
$uri_dbpedia = "http://dbpedia.org/resource/" . rawurlencode($sub_dbp_uri);
$enrichment['links']['uri_dbpedia'] = $uri_dbpedia;
}
}
// debut de la requete d'enrichissement
if ($uri_bnf != "") {
// recuperation des infos biographiques bnf
$sparql = "\n\t\t\t\t\t\tPREFIX foaf: <http://xmlns.com/foaf/0.1/>\n\t\t\t\t\t\tPREFIX rdagroup2elements: <http://rdvocab.info/ElementsGr2/>\n\t\t\t\t\t\tPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\n\t\t\t\t\t\tPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n\t\t\t\t\t\tPREFIX bnf-onto: <http://data.bnf.fr/ontology/bnf-onto/>\n\t\t\t\t\t\tSELECT * WHERE {\n\t\t\t\t\t\t\t<{$uri_bnf}> foaf:focus ?person .\n\t\t\t\t\t\t\t<{$uri_bnf}> skos:prefLabel ?isbd .\n\t\t\t\t\t\t\t?person foaf:page ?page .\n\t\t\t\t\t\t\tOPTIONAL {\n\t\t\t\t\t\t\t\t?person rdagroup2elements:biographicalInformation ?biography\n\t\t\t\t\t\t\t}.\n\t\t\t\t\t\t\tOPTIONAL {\n\t\t\t\t\t\t\t\t?person rdagroup2elements:dateOfBirth ?birthdate.\n\t\t\t\t\t\t\t\t?birthdate rdfs:label ?birth.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tOPTIONAL {?person bnf-onto:firstYear ?birthfirst.}\n\t\t\t\t\t\t\tOPTIONAL {?person rdagroup2elements:placeOfBirth ?birthplace .}\n\t\t\t\t\t\t\tOPTIONAL {\n\t\t\t\t\t\t\t\t?person rdagroup2elements:dateOfDeath ?deathdate .\n\t\t\t\t\t\t\t\t?deathdate rdfs:label ?death.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tOPTIONAL {?person rdagroup2elements:placeOfDeath ?deathplace .}\n\t\t\t\t\t\t}";
try {
$rows = $storebnf->query($sparql, 'rows');
} catch (Exception $e) {
$rows = array();
}
if ($rows[0]['birth']) {
$birthdate = $rows[0]['birth'];
} else {
if ($rows[0]['birthfirst']) {
$birthdate = $rows[0]['birthfirst'];
} else {
$birthdate = "";
}
}
$enrichment['bio'] = array('isbd' => $rows[0]['isbd'], 'biography_bnf' => $rows[0]['biography'], 'birthdate' => $birthdate, 'birthplace' => $rows[0]['birthplace'], 'deathdate' => $rows[0]['death'], 'deathplace' => $rows[0]['deathplace']);
// fin bio bnf
// vignettes bnf
$sparql = "\n\t\t\t\t\t\t\tPREFIX foaf: <http://xmlns.com/foaf/0.1/>\n\t\t\t\t\t\t\tPREFIX dc: <http://purl.org/dc/elements/1.1/>\n\t\t\t\t\t\t\tPREFIX dcterm: <http://purl.org/dc/terms/>\n\t\t\t\t\t\t\tSELECT * WHERE {\n\t\t\t\t\t\t\t\t<{$uri_bnf}> foaf:focus ?person .\n\t\t\t\t\t\t\t\t?person foaf:depiction ?url .\n\t\t\t\t\t\t\t}";
try {
$rows = $storebnf->query($sparql, 'rows');
} catch (Exception $e) {
$rows = array();
}
foreach ($rows as $row) {
$depictions[] = $row['url'];
}
$enrichment['depictions']['depictions_bnf'] = $depictions;
// biblio bnf
$sparql = "\n\t\t\t\t\t\t\tPREFIX foaf: <http://xmlns.com/foaf/0.1/>\n\t\t\t\t\t\t\tPREFIX dcterms: <http://purl.org/dc/terms/>\n\t\t\t\t\t\t\tPREFIX rdarelationships: <http://rdvocab.info/RDARelationshipsWEMI/>\n\t\t\t\t\t\t\tSELECT ?work ?date ?dates ?work_concept ?title MIN(?minUrl) AS ?url MIN(?minGallica) AS ?gallica WHERE {\n\t\t\t\t\t\t\t\t<{$uri_bnf}> foaf:focus ?person .\n\t\t\t\t\t\t\t\t?work dcterms:creator ?person .\n\t\t\t\t\t\t\t\tOPTIONAL { ?work dcterms:date ?date } .\n\t\t\t\t\t\t\t\tOPTIONAL { ?work <http://rdvocab.info/Elements/dateOfWork> ?dates } .\n\t\t\t\t\t\t\t\t?work_concept foaf:focus ?work .\n\t\t\t\t\t\t\t\t?work dcterms:title ?title .\n\t\t\t\t\t\t\t\tOPTIONAL{?work foaf:depiction ?minUrl .}\n\t\t\t\t\t\t\t\tOPTIONAL{\n\t\t\t\t\t\t\t\t\t?manifestation rdarelationships:workManifested ?work .\n\t\t\t\t\t\t\t\t\t?manifestation rdarelationships:electronicReproduction ?minGallica .\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} order by ?dates";
try {
$rows = $storebnf->query($sparql, 'rows');
} catch (Exception $e) {
$rows = array();
}
if ($rows[0]['work']) {
foreach ($rows as $row) {
$tab_isbn = array();
$sparql = "\n\t\t\t\t\t\t\t\tPREFIX rdarelationships: <http://rdvocab.info/RDARelationshipsWEMI/>\n\t\t\t\t\t\t\t\tPREFIX bnf-onto: <http://data.bnf.fr/ontology/bnf-onto/>\n\t\t\t\t\t\t\t\tSELECT distinct ?isbn WHERE {\n\t\t\t\t\t\t\t\t\t?manifestation rdarelationships:workManifested <" . $row['work'] . ">.\n\t\t\t\t\t\t\t\t\t?manifestation bnf-onto:isbn ?isbn\n\t\t\t\t\t\t\t\t}order by ?isbn";
try {
$isbns = $storebnf->query($sparql, 'rows');
} catch (Exception $e) {
$isbns = array();
}
foreach ($isbns as $isbn) {
$isbn['isbn'] = formatISBN($isbn['isbn']);
$tab_isbn[] = "'" . $isbn['isbn'] . "'";
}
$aut_works[] = array('title' => $row['title'], 'uri_work' => $row['work'], 'date' => $row['date'], 'work_concept' => $row['work_concept'], 'url' => $row['url'], 'gallica' => $row['gallica'], 'tab_isbn' => $tab_isbn);
}
$enrichment['biblio'] = $aut_works;
}
}
// si uri dbpedia on recherche la bio dbpedia et l'image
if ($uri_dbpedia != "") {
$langue = substr($lang, 0, 2);
$sparqldbp = "\n\t\t\t\t\t\tPREFIX dbpedia-owl:<http://dbpedia.org/ontology/>\n\t\t\t\t\t\tSELECT ?comment ?image WHERE{\n\t\t\t\t\t\t\t<{$uri_dbpedia}> dbpedia-owl:abstract ?comment FILTER langMatches( lang(?comment), '" . $langue . "' ).\n\t\t\t\t\t\t\tOPTIONAL {<{$uri_dbpedia}> dbpedia-owl:thumbnail ?image} .\n\t\t\t\t\t\t}";
//.........这里部分代码省略.........
开发者ID:hogsim,项目名称:PMB,代码行数:101,代码来源:author.class.php
示例11: mysql_fetch_object
if (mysql_num_rows($res)) {
$rep = mysql_fetch_object($res);
$img = $rep->repertoire_path . "img_" . $notice_id;
header('Content-Type: image/png');
$fp = @fopen($img, "rb");
fpassthru($fp);
fclose($fp);
exit;
}
}
if ($noticecode) {
if (isEAN($noticecode)) {
if (isISBN($noticecode)) {
if (isISBN10($noticecode)) {
$url_image10 = str_replace("!!isbn!!", str_replace("-", "", $noticecode), $_GET['url_image']);
$url_image13 = str_replace("!!isbn!!", str_replace("-", "", formatISBN($noticecode, "13")), $_GET['url_image']);
} else {
$url_image10 = str_replace("!!isbn!!", str_replace("-", "", EANtoISBN10($noticecode)), $_GET['url_image']);
$url_image13 = str_replace("!!isbn!!", str_replace("-", "", $noticecode), $_GET['url_image']);
}
} else {
$url_imageEAN = str_replace("!!isbn!!", str_replace("-", "", $noticecode), $_GET['url_image']);
}
}
$url_image = str_replace("!!isbn!!", $noticecode, $_GET['url_image']);
} else {
$url_image = rawurldecode(stripslashes($_GET['url_image']));
}
if ($opac_curl_available) {
$image = "";
$aCurl = new Curl();
开发者ID:bouchra012,项目名称:PMB,代码行数:31,代码来源:getimage.php
示例12: if
} else {
$requete = "select if(indexint_comment is not null and indexint_comment!='',concat(indexint_name,' - ',indexint_comment),indexint_name) as indexint,indexint_id, concat( indexint_name,' ',indexint_comment) as indexsimple from indexint \n\t\t\twhere if(indexint_comment is not null and indexint_comment!='',concat(indexint_name,' - ',indexint_comment),indexint_name) like '" . addslashes($start) . "%' {$restrict} and num_pclass = '{$thesaurus_classement_defaut}' order by 1 limit 20";
}
$origine = "SQL";
break;
case 'notice':
require_once './includes/isbn.inc.php';
if ($autexclude) {
$restrict = " AND notice_id not in ({$autexclude}) ";
}
$requete = "select if(serie_name is not null,if(tnvol is not null,concat(serie_name,', ',tnvol,'. ',tit1),concat(serie_name,'. ',tit1)),tit1), notice_id from notices left join series on serie_id=tparent_id where (index_sew like ' " . addslashes(strip_empty_words($start)) . "%' or TRIM(index_wew) like '" . addslashes($start) . "%' or tit1 like '" . addslashes($start) . "%' or (code like '" . traite_code_isbn(addslashes($start)) . "'";
if (isISBN(traite_code_isbn($start))) {
if (strlen(traite_code_isbn($start)) == 13) {
$requete .= " or code like '" . formatISBN(traite_code_isbn($start), 13) . "'";
} else {
$requete .= " or code like '" . formatISBN(traite_code_isbn($start), 10) . "'";
}
}
$requete .= ")) {$restrict} order by index_serie, tnvol, index_sew , code limit 20 ";
$origine = "SQL";
break;
case 'serie':
if ($autexclude) {
$restrict = " AND serie_id not in ({$autexclude}) ";
}
$requete = "select serie_name,serie_id from series where serie_name like '" . addslashes($start) . "%' {$restrict} order by 1 limit 20";
$origine = "SQL";
break;
case 'fonction':
// récupération des codes de fonction
if (!count($s_func)) {
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:31,代码来源:ajax_selector.php
示例13: search
function search($source_id, $query, $search_id)
{
$params = $this->get_source_params($source_id);
$this->fetch_global_properties();
if ($params["PARAMETERS"]) {
//Affichage du formulaire avec $params["PARAMETERS"]
$vars = unserialize($params["PARAMETERS"]);
foreach ($vars as $key => $val) {
global ${$key};
${$key} = $val;
}
}
if (!isset($url)) {
$url = "";
}
if (!isset($username)) {
$username = "";
}
if (!isset($password)) {
$password = "";
}
if (!isset($fetch_images)) {
$fetch_images = 0;
}
if (!isset($image_folder)) {
$image_folder = 0;
}
if (!isset($image_folder_public)) {
$image_folder_public = 0;
}
if (!isset($image_thumb_url)) {
$image_thumb_url = 0;
}
if (!isset($image_front)) {
$image_front = 0;
}
if (!isset($image_back)) {
$image_back = 0;
}
$this->url = $url;
$this->username = $username;
$this->password = $password;
$this->source_id = $source_id;
$this->search_id = 0;
$this->image_thumb_url = $image_thumb_url;
$this->image_front = $image_front;
$this->image_back = $image_back;
$this->image_folder = $image_folder;
$this->image_folder_url = $image_folder_public;
$this->fetchimages = $fetch_images;
$isbns = array();
foreach ($query as $amterm) {
if ($amterm->ufield == '010$a') {
$isbns[] = $amterm->values[0];
}
}
global $base_path;
$xsl_transform = file_get_contents($base_path . "/admin/connecteurs/in/aligastore/xslt/aligatopmbunimarx.xsl");
foreach ($isbns as $isbn) {
//Si on veut des images, il nous faut un isbn 13
$isbn = formatISBN($isbn, 13);
$isbn = preg_replace('/-|\\.| /', '', $isbn);
$this->fetch_and_record_notice($isbn, $xsl_transform);
}
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:65,代码来源:aligastore.class.php
示例14: import_basic
//.........这里部分代码省略.........
}
// si isbn vide, on va tenter de prendre l'EAN stocké en 345$b
if ($isbn[0] == "") {
$isbn[0] = $EAN[0];
}
// si isbn vide, on va tenter de prendre le serial en 011
if ($isbn[0] == "") {
$isbn[0] = $issn_011[0];
}
// si ISBN obligatoire et isbn toujours vide :
if ($params["isbn_mandatory"] == 1 && $isbn[0] == "") {
// on va tenter de prendre l'ISSN stocké en 225$x
$isbn[0] = $collection_225[0]['x'];
// si isbn toujours vide, on va tenter de prendre l'ISSN stocké en 410$x
if ($isbn[0] == "") {
$isbn[0] = $collection_410[0]['x'];
}
}
// on commence par voir ce que le code est (basé sur la recherche par code du module catalogage
$ex_query = clean_string($isbn[0]);
$EAN = '';
$isbn = '';
$code = '';
$code10 = '';
if (isEAN($ex_query)) {
// la saisie est un EAN -> on tente de le formater en ISBN
$EAN = $ex_query;
$isbn = EANtoISBN($ex_query);
// si échec, on prend l'EAN comme il vient
if (!$isbn) {
$code = str_replace("*", "%", $ex_query);
} else {
$code = $isbn;
$code10 = formatISBN($code, 10);
}
} else {
if (isISBN($ex_query)) {
// si la saisie est un ISBN
$isbn = formatISBN($ex_query);
// si échec, ISBN erroné on le prend sous cette forme
if (!$isbn) {
$code = str_replace("*", "%", $ex_query);
} else {
$code10 = $isbn;
$code = formatISBN($code10, 13);
}
} else {
// ce n'est rien de tout ça, on prend la saisie telle quelle
$code = str_replace("*", "%", $ex_query);
}
}
$isbn_OK = $code;
$new_notice = 0;
$notice_id = 0;
// le paramétrage est-il : dédoublonnage sur code ? / Ne dédoublonner que sur code ISBN (ignorer les ISSN) ?
if ($params["isbn_dedoublonnage"] && !$params["isbn_only"] || $params["isbn_dedoublonnage"] && $params["isbn_only"] && isISBN($isbn)) {
$trouvees = 0;
if ($EAN && $isbn) {
// cas des EAN purs : constitution de la requête
$requete = "SELECT distinct notice_id FROM notices ";
$requete .= " WHERE notices.code in ('{$code}','{$EAN}'" . ($code10 ? ",'{$code10}'" : "") . ") limit 1";
$myQuery = mysql_query($requete, $dbh);
$trouvees = mysql_num_rows($myQuery);
} elseif ($isbn) {
// recherche d'un isbn
$requete = "SELECT distinct notice_id FROM notices ";
开发者ID:bouchra012,项目名称:PMB,代码行数:67,代码来源:pmbesConvertImport.class.php
示例15: getNbActes
static function getNbActes($id_bibli, $type_acte, $statut = '-1', $aq = 0, $user_input = '')
{
global $dbh;
if ($statut == '-1') {
$filtre = '';
} elseif ($statut == 32) {
$filtre = "and ((actes.statut & 32) = 32) ";
} else {
$filtre = "and ((actes.statut & 32) = 0) and ((actes.statut & " . $statut . ") = '" . $statut . "') ";
}
if (!$aq) {
$q = "select count(1) from actes where num_entite = '" . $id_bibli . "' ";
$q .= "and type_acte = '" . $type_acte . "' " . $filtre . " ";
} else {
$isbn = '';
$t_codes = array();
if ($user_input !== '') {
if (isEAN($user_input)) {
// la saisie est un EAN -> on tente de le formater en ISBN
$isbn = EANtoISBN($user_input);
if ($isbn) {
$t_codes[] = $isbn;
$t_codes[] = formatISBN($isbn, 10);
}
} elseif (isISBN($user_input)) {
// si la saisie est un ISBN
$isbn = formatISBN($user_input);
if ($isbn) {
$t_codes[] = $isbn;
$t_codes[] = formatISBN($isbn, 13);
}
}
}
if (count($t_codes)) {
$q = "select count(distinct(id_acte)) from actes left join lignes_actes on num_acte=id_acte ";
$q .= "where ( num_entite='" . $id_bibli . "' and type_acte='" . $type_acte . "' " . $filtre . " ) ";
$q .= "and ('0' ";
foreach ($t_codes as $v) {
$q .= "or code like '%" . $v . "%' ";
}
$q .= ") ";
} else {
$members_actes = $aq->get_query_members("actes", "numero", "index_acte", "id_acte");
$members_lignes = $aq->get_query_members("lignes_actes", "code", "index_ligne", "id_ligne");
$q = "select count(distinct(id_acte)) from actes left join lignes_actes on num_acte=id_acte ";
$q .= "where ( num_entite='" . $id_bibli . "' and type_acte='" . $type_acte . "' " . $filtre . " ) ";
$q .= "and (" . $members_actes["where"] . " or " . $members_lignes["where"] . ") ";
}
}
$r = mysql_query($q, $dbh);
return mysql_result($r, 0, 0);
}
开发者ID:bouchra012,项目名称:PMB,代码行数:52,代码来源:entites.class.php
示例16: construct_query
function construct_query($query, $not, $level, $argn = "")
{
//La requête commence-t-elle par and, or ou and not ?
$pos = strpos($query, "and not");
if ($pos !== false && $pos == 0) {
$ope = "and not";
} else {
$pos = strpos($query, "or");
if ($pos !== false && $pos == 0) {
$ope = "or";
} else {
$pos = strpos($query, "and");
if ($pos !== false && $pos == 0) {
$ope = "and";
} else {
$ope = "";
}
}
}
if ($ope != "") {
//Si opérateur, recherche des arguments
$arqs = array();
preg_match("/^" . $ope . " arg" . $level . "!1\\((.*)\\) arg" . $level . "!2\\((.*)\\)\$/", $query, $args);
$return1 = construct_query($args[1], 0, $level + 1, 1);
if ($ope == "and not") {
$return2 = construct_query($args[2], 1, $level + 1, 2);
} else {
$return2 = construct_query($args[2], 0, $level + 1, 2);
}
if ($ope == "and not") {
$ope = "and";
}
$requete = "create temporary table r{$level} ENGINE=MyISAM ";
if ($ope == "and") {
$requete .= "select distinct {$return1}.notice_id from {$return1}, {$return2} where {$return1}.notice_id={$return2}.notice_id";
@pmb_mysql_query($requete);
} else {
$requete .= "select distinct notice_id from {$return1}";
@pmb_mysql_query($requete);
$requete = "insert into r{$level} select distinct notice_id from {$return2} ";
@pmb_mysql_query($requete);
}
$return = "r{$level}";
} else {
$use = explode("=", $query);
switch ($use[0]) {
//Titre
case 4:
if ($not) {
$requete = "select distinct notice_id from notices where (index_wew not like '%" . $use[1] . "%' )";
} else {
$requete = "select distinct notice_id from notices where (index_wew like '%" . $use[1] . "%' )";
}
break;
//ISBN
//ISBN
case 7:
if (isISBN($use[1])) {
// si la saisie est un ISBN
$code = formatISBN($use[1]);
// si échec, ISBN erroné on le prend sous cette forme
if (!$code) {
$code = $use[1];
}
} else {
$code = $use[1];
}
if ($not) {
$requete = "select notice_id from notices where (code!='" . $code . "')";
} else {
$requete = "select notice_id from notices where (code='" . $code . "')";
}
break;
// Auteur
// Auteur
case 1003:
if ($not) {
$requete = "create temporary table aut ENGINE=MyISAM select distinct responsability.responsability_notice as notice_id, index_author as auth from authors, responsability where responsability_author = author_id ";
@pmb_mysql_query($requete);
$requete = "select distinct notice_id from aut where auth not like '%" . $use[1] . "%'";
} else {
$requete = "select distinct notice_id from responsability, authors, notices where index_author like '%" . $use[1] . "%' and author_id=responsability_author and notice_id=responsability_notice ";
}
break;
default:
make_error(3, "1=" . $use[0]);
break;
}
$requete = "create temporary table r" . $level . "_" . $argn . " ENGINE=MyISAM " . $requete;
@pmb_mysql_query($requete);
$return = "r" . $level . "_" . $argn;
}
return $return;
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:94,代码来源:export_z3950.php
示例17: noticeInfos
function noticeInfos($notice_id, $sparql_end_point)
{
global $lang, $charset;
//On va rechercher l'isbn si il exi
|
请发表评论