function bloc($periode,$clusters)//construit le bloc vignettes passe ou présent. { echo '<table class=tableitems width=100% cellspacing=0 cellpadding=5 style="font-variant:small-caps; size:small; font-style:italic;">'; for($i=0;$i<count($clusters);$i++){ echo '<tr align=center>'; echo '<tr align=center>'; echo '<td>'; $imagestructure = image_cluster(arrange_periode($periode),$clusters[$i]); $href = href_cluster(arrange_periode($periode),$clusters[$i]); //$height = (250) / count($clusters); $height = 120; echo "<center><a href=".$href."><img height=".$height."px src=".$imagestructure."></a></center>"; echo '</td>'; echo "</tr>"; } echo "</table>"; }
} else { $my_period = arrange_periode(end($list_of_periods)); } $titleheader = 'carte (' . get_short_string_periode($my_period) . ')'; include "include/header.php"; include "banner.php"; //******************************************* //bloc choix du terme //******************************************* $resultat = mysql_query("select id,forme_principale FROM concepts ORDER by forme_principale") or die("Requête non executées."); while ($ligne = mysql_fetch_array($resultat)) { $id = $ligne['id']; $dico_termes[$id] = $ligne['forme_principale']; $add_concept_now = 0; if (array_key_exists($id, $periode_concepts)) { if (in_array($my_period, arrange_periode($periode_concepts[$id]))) { $add_concept_now = 1; } } if ($my_period == -1) { $add_concept_now = 1; } if ($add_concept_now) { $liste_termes_brute[] = $ligne['forme_principale']; $id_termes_brute[] = $id; } } //******************************************* //bloc récupération des sources //******************************************* //$resultat=mysql_query("select id,auteurs FROM auteurs ORDER by auteurs") or die ("Reque non executée.");
.title(function(d) "lié par "+d.ourDEG+" billets") .event("mousedown", pv.Behavior.drag()) .event("drag", force) .event("dblclick", function (d) { if (helper.editmode()!=0) { // * enleve le noeud selectionne et retrace le reseau * mynetwork.nodes=mynetwork.nodes.filter(function (k) k.nodeName != d.nodeName); mynetwork.links=mynetwork.links.filter(function (k) (k.source != d.pvID && k.target != d.pvID)); force.iterations(0); force.nodes(mynetwork.nodes); force.links(mynetwork.links); force.reset(); vis.render(); } else { if (d.group!="0") self.location="'.$double_click_url_prefix.'="+d.ourID+"&periode='.arrange_periode($my_period).$double_click_url_postfix.'";} } ); noeuds.anchor("bottom") .add(pv.Label) .text(function(d) d.nodeName) .font(function (d) { if (d.group=="0") {return "bold 160% verdana, sans-serif";} else { return (80+'.$node_font_size_function.'(d.ourDEG)).toString()+"% verdana, sans-serif"; } }); vis.render(); helper.render();
//$clusters contient la liste des clusters, par periodes. echo "<table width=100%><tr valign=top><td width=2.5%></td><td width=95%>"; echo "<table width=100% class=specialsubbanner cellspacing=0>"; echo '<tr style="color:black; font-weight:bold;"><td align=left>'; echo "désambiguïsation"; echo "</td><td align=right>période sélectionnée: "; echo '<form action="meta12.php" method="get" style="display:inline";>'; echo '<select name="periode">'; foreach ($periodes as $periode) { echo '<option value='.arrange_periode($periode); if ($periode==arrange_periode($my_period)) echo(" selected"); echo '>'; echo get_string_periode(arrange_periode($periode)); echo '</option>'; } echo '</select>'; echo '<input type="hidden" value="'.$label1.'" name="label1">'; echo '<input type="hidden" value="'.$label2.'" name="label2">'; echo '<input type="submit" value="Changer">'; echo '</form>'; echo "</tr></table>"; echo '<td width=2.5%></td></tr></table>'; echo "<p>";
$ensemble_concepts_tri=array(); for($i=0;$i<count($ensemble_concepts);$i++) {$ensemble_concepts_tri[$ensemble_concepts_string[$i]]=$ensemble_concepts[$i];} uksort($ensemble_concepts_tri,"strcasecmpcam"); $ensemble_concepts_tri_keys=array_keys($ensemble_concepts_tri); $ncolumns=3; $columns=make_columns($ncolumns,count($ensemble_concepts_tri)); echo "<table class=tableitems width=100%><tr valign=top>"; foreach($columns as $col) { echo "<td width=".width_column($ncolumns)."%>"; for ($i=$col[0];$i<=$col[1];$i++){ $key=$ensemble_concepts_tri_keys[$i]; $id=$ensemble_concepts_tri[$key]; echo "<a href=chart.php?id_concept=".$id."&periode=".arrange_periode($my_period).">".$key.'</a> <i style="font-size:6pt;">('.$id.")</i><br>"; } echo "</td><td width=3%></td>"; } echo "</tr></table>"; echo "</td>"; echo("</tr>"); echo "</table>"; echo "</td><td width=2.5%></td></tr></table>"; //on ferme l'acces à la base de donnees
} } $list_of_periods=sort_periods($periode_brute); if(isset( $_GET['periode'])) $my_period=$_GET['periode']; else $my_period=arrange_periode(end($list_of_periods)); // $titleheader="liste des champs (".get_short_string_periode($my_period).")"; include("include/header.php"); include("banner.php"); $resultat=mysql_query("select id_cluster,label_1,label_2,periode, nb_sons,nb_fathers FROM cluster WHERE periode ='".derange_periode($my_period)."' GROUP by id_cluster ORDER by periode, label_1, label_2, id_cluster") or die ("<b>Requête non exécutée</b>."); while ($ligne=mysql_fetch_array($resultat)){ $periode=arrange_periode($ligne['periode']); $liste_termes_brute[] = "<b>".$dico_termes[$ligne['label_1']]."</b> - ".$dico_termes[$ligne['label_2']]; $liste_termes_brute_id[]=array($ligne['label_1'],$ligne['label_2']); $id_termes_brute[] = $ligne['id_cluster']; $fils[] = $ligne['nb_sons'] ; $pere[] = $ligne['nb_fathers'] ; } $resultat=mysql_query("select periode FROM cluster GROUP by periode ORDER by periode") or die ("<b>Requête non exécutée</b>."); while ($ligne=mysql_fetch_array($resultat)){ $periode_termes_brute[]=$ligne['periode'];} echo '<p><table width=100% class=tableitems>'; echo '<tr valign=top><td width=2.5%></td><td><h2 class=subtitle>liste complète des champs thématiques</h2></td><td width=2.5%></td></tr></table>';
$pp=derange_periode($pp); $c=$clusters[$pp]; $cstr=array(); if (count($c)>0){ //y-a-t-il au moins des clusters pour la periode? if ($my_period==-1) echo "<tr><td class=small>période ".get_string_periode(arrange_periode($pp))."</td></tr>"; foreach ($c['clusters'] as $cp) { $resultat=mysql_query("SELECT label_1,label_2,lettre,nb_sons,nb_fathers FROM cluster WHERE id_cluster=".$cp['id']." AND periode=\"".$cp['periode']."\" ORDER by periode,concept") or die ("Requête non executée."); while ($ligne=mysql_fetch_array($resultat)) $clu_tmp[]=$ligne; $clu_tmp=end($clu_tmp); $label1=$clu_tmp['label_1']; $label2=$clu_tmp['label_2']; $lettre=$clu_tmp['lettre']; $nbsons=$clu_tmp['nb_sons']; $nbfathers=$clu_tmp['nb_fathers']; $hrefh='href=cluster.php?id_cluster='.$cp['id'].'&periode='.arrange_periode($cp['periode']).'>'; $href='<a '.$hrefh; $href12='<a href=meta12.php?label1='.$label1.'&label2='.$label2.'&periode='.$my_period.'>'; $ktmp='<b>'.$dico_termes[$label1].'</b> - '.$dico_termes[$label2]; //if ($lettre=="") $lettre="-"; $arrows=""; if ($nbfathers>0) $arrows.="↑"; if ($nbsons>0) $arrows.="↓"; $strtmp='<td><a class=dead '.$hrefh; //$strtmp.=$cp['id'].'/'; $strtmp.=$lettre.$arrows.'</a></td>'; $strtmp.='<td width=3%></td>'; $strtmp.='<td>'; $bend=end($cp['billets']); foreach ($cp['billets'] as $b) {
$info_sources[$site]['titres'][]=clean_text(str_replace('popostrophe',"'",$row['title'])); if ($type_date=='jour') { $info_sources[$site]['dates'][]=adjust_date_jours($row['jours']);} else {$info_sources[$site]['dates'][]=$row['jours'];} $info_sources[$site]['nbtermes'][]=$nb_terme; $info_sources[$site]['content'][]=$content; $info_sources[$site]['concepts'][]=$concepts; $i++; } uksort($info_sources,"strcasecmpcam"); display_billets($info_sources,$list_of_concepts,arrange_periode($my_period),$type_notice);} else { echo "aucun billet pertinent"; } echo "</td>"; echo "</tr>"; echo "</table>"; echo "<td width=2.5%></td></tr>"; echo "</table>"; } if ($nav=="reseau semantique") { include("reseau_semantique.php");}
function display_cluster_title ($s, $direction) { global $dico_termes,$mainloc,$arraykey,$last_display_periode,$jscriptmp,$my_period,$nav; $label1=$s['label1']; $label2=$s['label2']; $lettre=$s['lettre']; $shref='cluster.php?id_cluster='.$s['id']."&periode=".arrange_periode($s['periode']).'&nav='.$nav; $speriode=get_short_string_periode(arrange_periode($s['periode']),0,1); $stitle='"<b>'.remove_popo($dico_termes[$label1]).'</b> - '.remove_popo($dico_termes[$label2]).'"'; // $periodchange indique si on a un changement de période par rapport au dernier champ thématique affiché $periodchange=($last_display_periode!=$s['periode']); $ecart=floor(abs(compute_periode(derange_periode($my_period))-compute_periode($s['periode']))/7001000); //if ($periodchange && $last_display_periode!="") // echo '<tr style="background:white;"><td></td><td></td><td></td><td><hr class="dashed"></td></tr>'; //else { //if (!$periodchange) echo '<tr style="height:4px;font-size:0pt;'.($ecart>0?' background:white;':'').'"><td> </td><td></td><td></td><td></td></tr>'; } echo '<tr width=100% valign=top'.($ecart>0?' style="background:white;"':'').'>'; echo '<td class=commentitems style="font-size:xx-small;">'; if ($ecart>0 && $periodchange) echo ("<b>...</b> "); echo '</td>'; echo '<td class=commentitems style="font-size:xx-small;">'; if ($last_display_periode!=$s['periode']) echo $speriode." "; if ($ecart>0 && $periodchange) echo "<br/><b> [".($direction=="succ"?"+":"-").($ecart+1)." sem.] </b>"; echo '</td>'; $sbox=selective_column_tt($arraykey,$s['termes'],$s['plus'],$s['minus']); $sid=$s['id']."_".str_replace(" ","_",$s['periode']); if ($direction=="succ") { if (intval($s['fils'])>0) $sarrow='↓ '; } else { if (intval($s['pere'])>0) $sarrow='↑ '; } echo '<td>'; $jscriptmp.=display_helper('(période '.get_string_periode(arrange_periode($s['periode'])).')','<div style="font-variant:small-caps;"><a href='.$shref.'>'.$sarrow.$stitle.'</a></div><br>'.$sbox,$sid,"magnify-wide.png","resizable: true"); echo '</td>'; echo ' <td class=tableitems style="font-variant:small-caps; size:small; font-style:italic;">'; echo ' <span onMouseOver="ShowContent(\'box'.$sid.'\'); ShowContent(\'title'.$sid.'\'); HideContent(\'mainbox\'); HideContent(\'maintitle\');" onMouseOut="HideContent(\'box'.$sid.'\'); HideContent(\'title'.$sid.'\'); ShowContent(\'mainbox\'); ShowContent(\'maintitle\');">'; echo '<a id="'.$sid.'" href="'.$shref.'">'; echo '<span style="font-style:normal;">'.$sarrow.'</span>'.$stitle; if ($lettre!="") echo ' ('.$lettre.')'; echo '</a>'; echo '</span>'; //echo '<a id="'.$sid.'" class="questionMark jTip jTip_element_'.$sid.'S jTip_width_300" name="Détails" href="'.$shref.'">'; //echo '<span id="'.$sid.'S" class="JT_hidden">'; //echo $sbox; //echo '</span>'; echo '</td>'; echo '</tr>'; echo '<tr style="height:4px;font-size:0pt;'.($ecart>0?' background:white;':'').'"><td> </td><td></td><td></td><td></td></tr>'; echo '</td>'; $last_display_periode=$s['periode']; }
force.iterations(100); force.springConstant(0.0001); force.springLength(40); force.link.add(pv.Line); force.node.add(pv.Dot) .size(function(d) (d.linkDegree + 4) * Math.pow(this.scale, -1.5)) .shape("square") .fillStyle(function(d) d.fix ? "brown" : colors(d.group)) .strokeStyle(function() this.fillStyle().darker()) .lineWidth(1) .title(function(d) d.nodeName) .event("mousedown", pv.Behavior.drag()) .event("drag", force) .event("dblclick", function (d) window.location="source.php?id_source="+d.ourID+"&periode='.arrange_periode($my_period).'&nav=soc") .anchor("bottom").add(pv.Label).text(function(d) d.nodeName); vis.render(); </script>'; $tmpfile = ecrire_json($liste_auteur_unique,$legende,$aut_occ,$liens_from,$liens_to,$cluster_name,0); //$tmpfile="TMP/TMP_9v8A67.txt"; //echo $tmpfile; //$tmpfile='json_data.txt'; //affichage de l'appli flex echo "\n<table width=100%><tr valign=top>";
echo "</i></td>"; echo "<td align=right width=10%>"; if ($nosucc) echo '<b style="font-variant:small-caps;">(pas de successeur)</b>'; echo '<table class=commentitems align=center width=100% cellspacing=0 cellpadding=5 rules=rows style="font-variant:small-caps; size:small; font-style:italic;">'; foreach ($succ as $s) { $label1=$s['label1']; $label2=$s['label2']; $futur = intval($s['fils']); echo '<tr>'; echo '<td>'; echo '<a href=cluster.php?id_cluster='.$s['id']."&periode=".arrange_periode($s['periode']).'&nav=cooc>'; echo '"<b>'.$dico_termes[$label1].'</b> - '.$dico_termes[$label2].'"'; if ($futur>0) { echo '&darr'; } echo '</a><br>'; echo '</td>'; echo '</tr>'; } echo '</table>'; echo "</td>"; echo "</tr>"; echo "<tr>";
function explode_period($periode) { $periode_v = explode('-', arrange_periode($periode)); return array("from" => $periode_v[0], "to" => $periode_v[1]); }
echo "</i></td>"; echo "<td align=right width=10%>"; if ($nosucc) echo '<b style="font-variant:small-caps;">(pas de successeur)</b>'; echo '<table class=commentitems align=center width=100% cellspacing=0 cellpadding=5 rules=rows style="font-variant:small-caps; size:small; font-style:italic;">'; foreach ($succ as $s) { $label1=$s['label1']; $label2=$s['label2']; echo '<tr>'; echo '<td>'; echo '<a href=cluster.php?id_cluster='.$s['id']."&periode=".arrange_periode($s['periode']).'&nav=soc'.'&pertinence='.strval(100*$pertinence).'>'; echo '"<b>'.$dico_termes[$label1].'</b> - '.$dico_termes[$label2].'"'; if ($futur>0) { echo '&darr'; } echo '</a><br>'; echo '</td>'; echo '</tr>'; } echo '</table>'; echo "</td>"; echo "</tr>"; echo "<tr>";
} echo "</table>"; } } echo "</td>"; echo "<td align=left width=57.5%>"; echo "<small>"; $liste_concepts_voisins_temp=array(); for( $i = 0 ; $i < count($concepts_voisins_string) ; $i++ ) { $liste_concepts_voisins_temp[]='<a href="chart.php?id_concept='.$concepts_voisins[$i].'&periode='.arrange_periode($periode).'">'.$concepts_voisins_string[$i].'</a>'; } echo '<table width=100% class=tableitems>'; echo '<tr valign=top>';//<td width='.$widthcolumn.'%>'; usort($liste_concepts_voisins_temp,"strcasecmpcam"); display_columns(3,$liste_concepts_voisins_temp); echo "</tr></table>"; echo "</small>"; echo "</td>"; echo("</tr>"); echo "</table>"; }
function link2clusters($jscriptmp, $id_partition, $partition_infos, $period) { // génère des petits carrés pour faire un lien vers les //autres clusters de la même période sur le fil thématique global $jscriptmp; $clusters = getClutersFromThisPeriod($id_partition, $period); $nbcluster = ''; for ($i = 0; $i < count($clusters); $i++) { $nbcluster .= '<img src="images/cluster.gif" border="0" >'; } //// préparation des liens vers les clusters de la même période et du même fil thématique $jscriptmp .= "\n\$('#dialoglinkCluster" . $id_partition . "')\n.dialog({ autoOpen: false, stack: true, resizable: false, modal:true, width:600, closeOnEscape:true})\n.click(function () { \$('#dialoglinkCluster" . $id_partition . "').dialog('close'); });\n\n\$('#openerlinkCluster" . $id_partition . "').click(function(e) {\nif (!\$('#dialoglinkCluster" . $id_partition . "').dialog('isOpen'))\n\$('#dialoglinkCluster" . $id_partition . "').dialog('option','position', [\$(this).position().left+25,25]).dialog('open');\nelse\n\$('#dialoglinkCluster" . $id_partition . "').dialog('close');\nreturn false;\n});"; if (count($clusters) == 1) { $clusters = $clusters[0]; $linkcluster = ''; } else { $cluster_Link_html = '<ul>'; for ($i = 0; $i < count($clusters); $i++) { $cluster_Link_html .= '<li><a href="' . $clusters[$i][attribut] . '"><font color=blue>' . str_replace('---', '/', remove_popo($clusters[$i][label])) . '</font></a></li>'; } $cluster_Link_html .= '</ul>'; $linkcluster = '<a href scr=# id="openerlinkCluster' . $id_partition . '">' . $nbcluster . '</a>'; } echo '<span id="dialoglinkCluster' . $id_partition . '" style="display:none;" title="Période du ' . get_short_string_periode(arrange_periode($period)) . '">'; echo 'Autres clusters pour ce fil thématique : ' . $cluster_Link_html; echo '</span>'; return array($jscriptmp, $linkcluster); }
} </style>"; //******************************************* //bloc choix du terme //******************************************* $vraidicotermesjs=array(); //vrai dico. $resultat=mysql_query("select id,forme_principale FROM concepts ORDER by forme_principale") or die ("Requête non executée."); while ($ligne=mysql_fetch_array($resultat)){ $id=$ligne['id']; $terme=$ligne['forme_principale']; $terme=str_replace('popostrophe ',"’",$terme); $add_concept_now=0; if (array_key_exists($id,$periode_concepts)) if (in_array($my_period,arrange_periode($periode_concepts[$id]))) $add_concept_now=1; if ($my_period==-1) $add_concept_now=1; if ($add_concept_now) { $liste_termes_brute[] = $terme; $id_termes_brute[] = $id; $vraidicotermesjs[$terme]=$id; } $dico_termes[$id]=$terme; } $liste_termes=array(); $id_termes=array(); $initiale=""; $initiales=''; for($i=0;$i<count($liste_termes_brute);$i++){