Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2299 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  Problème de liaison wikimedia/wikimindmap

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Problème de liaison wikimedia/wikimindmap

n°2132532
Lazuly
Posté le 22-03-2012 à 16:37:38  profilanswer
 

Bonjour,
 
Je suis actuellement amenée à réaliser un projet web et j'ai quelques soucis.
J'ai créé un wikimedia à cette adresse : http://soundspace.paprikart.fr/wiki/index.php (il ne contient que des articles de test). Je voudrais que ce wikimedia soit relié au système wikimindmap. J'ai donc également installé un wikimindmap à cette adresse : http://soundspace.paprikart.fr/public/viewmap.php
En gros wikimindmap permet de consulter un wiki sous forme de carte heuristique. Vous verrez si vous déroulez la liste que j'ai bien essayé d'ajouter l'adresse de mon wiki personnel (les autres sont là à la base). Mais ça ne fonctionne pas. Quand je tape un mot dans le champ de recherche en choisissant mon wiki rien ne se passe.
 
Je n'ai trouvé que ce tuto pour faire le lien entre mon wiki et le mindmap : https://github.com/nyfelix/wikimind [...] r-own-wiki
 
Voici les codes des deux fichiers :
 
Viewmap.php :
 

Code :
  1. <?php
  2. /*
  3. Copyright (C) 2010  Felix Nyffenegger
  4.     This program is free software: you can redistribute it and/or modify
  5.     it under the terms of the GNU General Public License as published by
  6.     the Free Software Foundation, either version 3 of the License, or
  7.     (at your option) any later version.
  8.     This program is distributed in the hope that it will be useful,
  9.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.     GNU General Public License for more details.
  12.     You should have received a copy of the GNU General Public License
  13.     along with this program.  If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. include_once("inc/config.inc.php" );
  16. $wiki = "";
  17. $topic = "";
  18. if (isset($_GET["wiki"])) {
  19. $wiki = $_GET["wiki"];
  20. }
  21. if (isset($_GET["topic"])) {
  22. $topic = $_GET["topic"];
  23. }
  24. ?>
  25. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  26. <html>
  27.     <head>
  28.         <title>WikiMindMap</title>
  29.         <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1";  charset="iso-8895-1">
  30.         <meta name="keywords" content="Wiki, Wikipedia, Mindmap, Mind-Map, browse, knowledge network">
  31.         <meta name="description" content="WikiMindMap is a tool to browse easily and efficiently in Wiki content, inspired by the mindmap technique">
  32.         <script type="text/javascript" src="js/flashobject.js">
  33.         </script>
  34.         <link rel='stylesheet' type='text/css' href='assets/wmm.css' />
  35.     </head>
  36.     <body>
  37.         <p align="center">
  38.             <img src="assets/logo.gif">
  39.         </p>
  40.         <form name="search" action="viewmap.php" method="get">
  41.             <p align="center">
  42.                 Select a Wiki:
  43.                 <select name="wiki">
  44.                     <option <?php echo ($wiki == "ca.wikipedia.org" ? "selected" : "" ); ?> >ca.wikipedia.org</option>
  45.                     <option <?php echo ($wiki == "de.wikipedia.org" ? "selected" : "" ); ?> >de.wikipedia.org</option>
  46.                     <option <?php echo ($wiki == "en.wikipedia.org" ? "selected" : "" ); ?> >en.wikipedia.org</option>
  47.                     <option <?php echo ($wiki == "es.wikipedia.org" ? "selected" : "" ); ?> >es.wikipedia.org</option>
  48.                     <option <?php echo ($wiki == "fr.wikipedia.org" ? "selected" : "" ); ?> >fr.wikipedia.org</option>
  49.                     <option <?php echo ($wiki == "id.wikipedia.org" ? "selected" : "" ); ?> >id.wikipedia.org</option>
  50.                     <option <?php echo ($wiki == "it.wikipedia.org" ? "selected" : "" ); ?> >it.wikipedia.org</option>
  51.                     <option <?php echo ($wiki == "nl.wikipedia.org" ? "selected" : "" ); ?> >nl.wikipedia.org</option>
  52.                     <option <?php echo ($wiki == "pl.wikipedia.org" ? "selected" : "" ); ?> >pl.wikipedia.org</option>
  53.                     <option <?php echo ($wiki == "pt.wikipedia.org" ? "selected" : "" ); ?> >pt.wikipedia.org</option>
  54.                     <option <?php echo ($wiki == "sv.wikipedia.org" ? "selected" : "" ); ?> >sv.wikipedia.org</option>
  55.      <option <?php echo ($wiki == "http://soundspace.paprikart.fr/wiki/" ? "selected" : "" ); ?> >http://soundspace.paprikart.fr/wiki/</option>
  56.                 </select>
  57.                 Enter your Topic:<input name="topic" type="text" value="<?php echo $topic; ?>">&nbsp;<input type="submit" value="Search">
  58.             </p>
  59.         </form>
  60.         <table width="100%" border="0" cellspacing="0">
  61.             <tr>
  62.                 <td colspan="3" class="bar">
  63.                     <div align="left" class="menuText">
  64.                         &nbsp;<a href="getfreemind.php?Wiki=<?php echo $wiki; ?>&Topic=<?php echo  urlencode($topic); ?>">Download this mindmap as Freemind file</a>
  65.                     </div>
  66.                 </td>
  67.             </tr>
  68.             <tr>
  69.                 <td width="5%">
  70.                     &nbsp;
  71.                 </td>
  72.                 <td width="90%" height="400">
  73.                     <div id="flashcontent">
  74.                         <p>
  75.                             Flash plugin or Javascript are turned off.
  76.                             Activate both  and reload to view the mindmap
  77.                         </p>
  78.                     </div>
  79.                     <script type="text/javascript">
  80.                         setTimeout("runFlash()", 1);
  81.                         //runFlash();
  82.                         function getWindowHeight(){
  83.                             var windowHeight = 0;
  84.                             if (typeof(window.innerHeight) == 'number') {
  85.                                 windowHeight = window.innerHeight;
  86.                             }
  87.                             else {
  88.                                 if (document.documentElement && document.documentElement.clientHeight) {
  89.                                     windowHeight = document.documentElement.clientHeight;
  90.                                 }
  91.                                 else {
  92.                                     if (document.body && document.body.clientHeight) {
  93.                                         windowHeight = document.body.clientHeight;
  94.                                     }
  95.                                 }
  96.                             }
  97.                             return windowHeight;
  98.                         }
  99.                        
  100.                         function runFlash(){
  101.                             var h = getWindowHeight();
  102.                             h = h - 200;
  103.                            
  104.                             document.getElementById("flashcontent" ).style.height = h;
  105.                             var fo = new FlashObject("visorFreemind.swf", "visorFreeMind", "100%", h, 6, "#9999ff" );
  106.                             fo.addParam("quality", "high" );
  107.                             fo.addParam("bgcolor", "#000000" );
  108.                             fo.addVariable("openUrl", "_blank" );
  109.                             fo.addVariable("initLoadFile", "getpages.php?Wiki=<?php echo $wiki; ?>&Topic=<?php echo  urlencode($topic); ?>" );
  110.                             fo.addVariable("startCollapsedToLevel", "1" );
  111.                             fo.addVariable("mainNodeShape", "bubble" );
  112.                             fo.write("flashcontent" );
  113.                         };
  114.                     </script>
  115.                 </td>
  116.                 <td width="5%">
  117.                     &nbsp;
  118.                 </td>
  119.             </tr>
  120.             <tr class="bar">
  121.                 <td colspan="3">
  122.                     <span class="menuText">
  123.                         <?php
  124.       if ($production) {
  125.        echo '<a href="help.htm">Help</a> <a href="about.htm">About / Support WikiMindMap</a> <a href="contact.htm">Contact</a>';
  126.       } else
  127.       {
  128.        echo 'Development Version';
  129.       }
  130.      ?>
  131.                     </span>
  132.                 </td>
  133.             </tr>
  134.         </table>
  135.         <div align="center" class="footerText">
  136.             All content of the mindmap is derived from the wiki selected above and is licensed under the terms of <a href="http://www.gnu.org/copyleft/fdl.html" target="_blank">GNU Free Documentaion Licence</a>. You can retrieve the original material by a left click on the topic.
  137.             <br>
  138.             Copyright (c) 2007 by Felix Nyffenegger
  139.         </div>
  140.         <p>
  141.             &nbsp;
  142.         </p>
  143.         <script type="text/javascript">
  144.             var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www." );
  145.             document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E" ));
  146.         </script>
  147.     </body>
  148. </html>


 
Config.inc.php :
 

Code :
  1. <?php
  2. $production = false;
  3. ?>


 
Je vous remercie d'avance.
 
Bonne journée à vous !


Message édité par Lazuly le 25-03-2013 à 15:40:04
mood
Publicité
Posté le 22-03-2012 à 16:37:38  profilanswer
 

n°2132544
olivthill
Posté le 22-03-2012 à 18:02:39  profilanswer
 

1. Il me semble que votre wiki de test ne soit pas utilisable, car il ne contient pas de lien (des mots définis entre double crochets qui renvoient à d'autres pages du wiki), parce que, en testant le mindmap avec Wikipedia (http://www.wikimindmap.org/), il me semble qu'il n'affiche rien s'il n'y a pas de lien. Par exemple : http://www.wikimindmap.org/viewmap [...] mit=Search n'affiche des branches que pour les mots qui sont en bleu dans l'article, c'est-à-dire pour les liens.
 
2. Quels phrases, quels mots, est-ce que vous ne comprenez pas dans les explications de Github ?
 
Par exemple, est-ce que vous avez compris qu'il faut initialiser certaines variables (en PHP, une variable se reconnait parce que son nom commence par un dollar) (les variables $wiki, $rootname, etc.) ?
 
3. Mais, en fait, ce n'est même pas nécessaire d'initaliser les variables, car on peut passer les variables en paramètre dans l'URL
 
Par exemple, j'arrive à faire marcher mindmap avec votre wiki en tapant :

http://www.wikimindmap.org/viewmap.php?wiki=soundspace.paprikart.fr&topic=Test&Submit=Search

(sur une seule ligne)
 
Vous voyez alors s'afficher un bel oval contenant "Test", ce qui prouve que le mindmap a bien marché.
Mais, vous ne voyez aucune branche, puisqu'il n'y a pas de lien dans votre page Test, comme dit précédement.
 
Edit : Je viens d'ajouter un lien dans votre page "Test", et on ne voit toujours pas de branche sortir de l'oval. il doit falloir faire autre chose, mais on y est presque.


Message édité par olivthill le 22-03-2012 à 18:15:00
n°2132551
Lazuly
Posté le 22-03-2012 à 18:54:52  profilanswer
 

Merci beaucoup pour la réponse.
 
Ce que je ne comprends pas dans le tuto c'est surtout la partie d'édition du ficher "config.inc.php"
 
J'ai fait plein de tests d'édition de ce fichier mais ça ne faisait que faire planter le wikimindmap, donc j'ai retéléchargé celui de départ qui ne contient que cette ligne :
 

Code :
  1. <?php
  2.     $production = false;
  3.     ?>


 
Dans le tuto, voici le passage qui concerne ce fichier. Il n'y a apparemment que quelques lignes à ajouter mais rien de ce que j'ai tenté de faire ne fonctionne, je m'y connais pas assez en php donc forcément je ne fais que tatonner...
 

Code :
  1. 4. config.inc.php (in subfolder /inc) - Needs Editing
  2. For each wiki you want to generate mind maps for you will need enter two variables, $index_path and $access_path within config.inc.php
  3. Mediawiki by default runs user friendly URL’s so that for example, the full URL of
  4. http://server_name/wiki/index.php/ [...] e=Mind_map
  5. can be displayed as
  6. http://server_name/wiki/index.php/Mind_map
  7. or even as
  8. http://server_name/wiki/Mind_map
  9. $index_path
  10. This variable is used by getpages.php when it queries the wiki to return a ‘raw’ copy of the page, i.e. the pure wiki text, without any html codes so that it can strip out everything and just leave all the links and sections. To do this getpages.php need to know the part in the full URL between the server_name and the index.php page, this will just be the folder route you created, from your web root, when you installed mediawiki.
  11. For my installation $index_path was simply /wiki as I only added on folder level below the site root. It will be used with the variables $wiki and $topic to build the $url using
  12. $url = 'http://'.$wiki.$index_path.'/index.php?title='.$topic.'&action=raw';
  13. with my data it gives us
  14. $url = http://192.168.0.18/wiki/index.php [...] action=raw
  15. (&action=raw on the end returns the raw wiki text, rather than rendered html)
  16. $access_path
  17. This variable is used by WikiMindMap when you click on the page link in the mindmap to open the relevant mediawiki page in a new window.
  18. The simplest way to to work out what it should be is to open your mediawiki site and navigate to a page (don’t use the URL for the home page for this), my install for example shows a URL of http://192.168.0.18/wiki/index.php/Mind_map
  19. We can ignore the http://192.168.0.18 part and the /Mind_map as these are $wiki and $topic, so we want the bit between; for my installation then $access_path was /wiki/index.php
  20. It will be used with the variables $wiki and $topic to build the $wikilink
  21. $wikilink = 'http://'.$wiki.$access_path.'/'.$topic;
  22. becoming with my data
  23. $wikilink = http://192.168.0.18/wiki/index.php/Mind_map
  24. $index_path and $access_path are set in the switch statement starting at the beginning of config_inc.php, you will need to create a new case ---> break section for each mediawiki installation you want to generate mindmaps for, the default section at the bottom will be applied if none of the case sections match the selected installation, and these are the correct settings for the wikipedia sites.
  25. switch ($wiki) {
  26.     case "192.168.0.18":
  27.       $index_path = "/wiki";
  28.       $access_path = "/wiki/index.php";
  29.       break;
  30.     default:
  31.       $index_path = "/w";
  32.       $access_path = "/wiki";
  33.       break;
  34.   }


 
Mais peut-être le problème vient-il aussi du fichier "viewmap.php", ce fichier était aussi à éditer (j'ai mis le code dans mon premier post).


Message édité par Lazuly le 25-03-2013 à 15:41:14

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  Problème de liaison wikimedia/wikimindmap

 

Sujets relatifs
[RESOLU] Problème de cration de tableau avec ExtJS 4[XML] Problème avec formulaire envoi
Probleme pour compiler un fichier javaProbleme couleur de fond newsletter
wx-widget - Problème de conception avec Threadprobléme d'installation et compilation de QWT sous netbeans
problème réception port série.problème de '
[Résolu] Quote Execute + Find pour le listing de fichier 
Plus de sujets relatifs à : Problème de liaison wikimedia/wikimindmap


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR