Exemplo n.º 1
0
function ajax_modify_type_empty_word()
{
    global $id_mot, $type_lien;
    @mysql_query("update linked_mots set type_lien=" . $type_lien . " where num_mot=" . $id_mot);
    semantique::gen_table_empty_word();
    ajax_http_send_response("1", "text/text");
    return;
}
Exemplo n.º 2
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: misc.inc.php,v 1.56.2.2 2014-10-28 10:44:32 mbertin Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once "{$class_path}/semantique.class.php";
require_once $class_path . "/parse_format.class.php";
//ajout des mots vides calculés
$add_empty_words = semantique::add_empty_words();
if ($add_empty_words) {
    eval($add_empty_words);
}
//Fonction de récupération d'une URL vignette
function get_vignette($notice_id)
{
    global $opac_book_pics_url;
    global $opac_url_base;
    $requete = "select code,thumbnail_url from notices where notice_id={$notice_id}";
    $res = mysql_query($requete);
    if ($res) {
        $notice = mysql_fetch_object($res);
        if ($notice->code || $notice->thumbnail_url) {
            if ($notice->thumbnail_url) {
                $url_image_ok = $notice->thumbnail_url;
            } else {
                $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $notice->code);
                $url_image = $opac_book_pics_url;
            $pmb_nb_noti_calc_empty_words = $nb_noti;
            @pmb_mysql_query("update parametres set valeur_param='" . $nb_noti . "' where type_param='pmb' and sstype_param='nb_noti_calc_empty_words'");
            $nb_noti = floor($r[0] * $nb_noti / 100);
            semantique::calculate_empty_words($nb_noti);
            semantique::gen_table_empty_word();
        }
        break;
    case 'del':
        if ($id_mot && $type_lien) {
            @pmb_mysql_query("delete from linked_mots where num_mot=" . $id_mot . " and num_linked_mot=0 and type_lien=" . $type_lien);
            $rqt = "select num_mot from linked_mots where num_mot=" . $id_mot . " or num_linked_mot=" . $id_mot;
            $query_exist = pmb_mysql_query($rqt);
            if ($query_exist && !pmb_mysql_num_rows($query_exist)) {
                @pmb_mysql_query("delete from mots where id_mot=" . $id_mot);
            }
            semantique::gen_table_empty_word();
        }
        break;
    default:
        break;
}
if ($action != 'add') {
    //nombre de notices pour le calcul
    if (!$pmb_nb_noti_calc_empty_words) {
        $pmb_nb_noti_calc_empty_words = "50";
    }
    $autorites_list_empty_word = str_replace("!!nb_noti!!", $pmb_nb_noti_calc_empty_words, $autorites_list_empty_word);
    //pagination
    if (!$page) {
        $page = 1;
    }
Exemplo n.º 4
0
$baseurl = "./autorites.php?categ=semantique&sub=synonyms";
if (!$page) {
    $page = 1;
}
//si on recherche une clé spécifique, on remplace !!cle!! par la clé sinon par rien
if ($word_search) {
    $aff_liste_mots = str_replace("!!cle!!", "'" . stripslashes($word_search) . "'", $aff_liste_mots);
} else {
    $aff_liste_mots = str_replace("!!cle!!", "", $aff_liste_mots);
}
switch ($action) {
    case 'view':
        $aff_mots = str_replace("!!mots_js!!", $mot_js, $aff_modif_mot);
        if ($mot) {
            $mot = stripslashes($mot);
            $t = semantique::list_synonyms(rawurldecode($mot));
            $compt = count($t);
            if ($compt) {
                //parcours des mots liés trouvés
                for ($j = 0; $j < $compt; $j++) {
                    $mots_lies .= $aff_mot_lie;
                    $mots_lies = str_replace("!!iword!!", $j, $mots_lies);
                    $mots_lies = str_replace("!!word!!", stripslashes($t[$j]["mot"]), $mots_lies);
                    $mots_lies = str_replace("!!id_word!!", $t[$j]["code"], $mots_lies);
                    if ($j == 0) {
                        $mots_lies = str_replace("!!bouton_ajouter!!", "<input type='button' class='bouton' value='+' onClick=\"add_word();\"/>", $mots_lies);
                    } else {
                        $mots_lies = str_replace("!!bouton_ajouter!!", "", $mots_lies);
                    }
                }
                $aff_mots = str_replace("!!supprimer!!", "<div class='right'><input type='button' class='bouton' value='" . $msg["63"] . "' onClick=\"var response; response=confirm('" . $msg["word_del_confirm"] . "'); if (response) document.location='./autorites.php?categ=semantique&sub=synonyms&action=del&id_mot=!!id_mot!!&mot=!!mot!!'; return false;\"></div>\n", $aff_mots);