Annonce

Important : WordPress 2.5.1 est disponible.
Annonce 1 : Le Codex en français a besoin de vous pour avancer !
Annonce 2 : Avant de poster, n'oubliez pas de faire une petite Recherche et de lire les règles de ce forum.

#1 18-02-2008 17:46:03

sdillier
Membre WP
Date d'inscription: 07-02-2008
Messages: 9

Export spip to wordpress

Bonjour,

Ma configuration WP actuelle Mutualisé
- Version de WordPress : Mutualisé
- Thème utilisé : Custom

Problème(s) rencontré(s) :

Voilà, je souhaite réusir à exporter mon spip 1.9.2 vers wordpress, j'ai donc utiliser le script xsl de korben pour faire celà, donc j'ai aplliqué ce bout de code à mon dump.xml de spip:

Code:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  4.     xmlns:content="http://purl.org/rss/1.0/modules/content/"
  5.     xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/"
  6.     xmlns:wp="http://wordpress.org/export/1.0/"
  7.     xmlns:redirect="http://xml.apache.org/xalan/redirect" extension-element-prefixes="redirect">
  8.     <xsl:output xmlns:content="http://purl.org/rss/1.0/modules/content/"
  9.         xmlns:wp="http://wordpress.org/export/1.0/" omit-xml-declaration="yes" indent="no"
  10.         cdata-section-elements="content:encoded category title wp:comment_content  wp:category_nicename"
  11.         version="1.0"/>
  12.     <xsl:key name="rubrique" match="spip_rubriques" use="id_rubrique"/>
  13.     <xsl:key name="forumID" match="spip_forum" use="id_article"/>
  14.    
  15.     <xsl:template match="/SPIP">
  16.         <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"
  17.             xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  18.             xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wp="http://wordpress.org/export/1.0/">
  19.             <channel>
  20.                 <title>
  21.                     <xsl:apply-templates select="spip_meta" mode="nom"/>
  22.                 </title>
  23.                 <link>
  24.                     <xsl:value-of select="@adresse_site"/>
  25.                 </link>
  26.                 <description>
  27.                     <xsl:apply-templates select="spip_meta" mode="descriptif_site"/>
  28.                 </description>
  29.                 <pubDate>Fri, 28 Apr 2007 17:38:16 +0000</pubDate>
  30.                 <generator>http://wordpress.org/?v=2.1.3</generator>
  31.                 <language>fr</language>
  32.      
  33.                 <xsl:apply-templates select="spip_articles"/>
  34.             </channel>
  35.         </rss>
  36.     </xsl:template>
  37.  
  38.  
  39.    
  40.    
  41.    
  42.     <xsl:template match="//spip_articles[id_rubrique=24]">
  43.         <xsl:call-template name="articles"/>
  44.     </xsl:template>
  45.    
  46.    
  47.    
  48.     <xsl:template name="articles">
  49.        
  50.         <item>
  51.             <title>
  52.                 <xsl:value-of select="./titre"/>
  53.             </title>
  54.             <link>http://www.korben.info/?p=<xsl:value-of select="./id_article"/></link>
  55.             <pubDate>
  56.                 <xsl:value-of select="./date"/>
  57.             </pubDate>
  58.             <dc:creator>admin</dc:creator>
  59.             <xsl:apply-templates select="./id_rubrique" mode="rubrique"/>
  60.             <guid isPermaLink="false"/>
  61.             <description/>
  62.             <content:encoded>
  63.                 <xsl:value-of select="./texte"/>
  64.             </content:encoded>
  65.            
  66.             <wp:post_id>
  67.                 <xsl:value-of select="./id_article"/>
  68.             </wp:post_id>
  69.             <wp:post_date>
  70.                 <xsl:value-of select="./date"/>
  71.             </wp:post_date>
  72.             <wp:post_date_gmt>
  73.                 <xsl:value-of select="./date"/>
  74.             </wp:post_date_gmt>
  75.             <wp:comment_status>open</wp:comment_status>
  76.             <wp:ping_status>open</wp:ping_status>
  77.             <wp:post_name>
  78.                 <xsl:value-of select="./titre"/>
  79.             </wp:post_name>
  80.             <wp:status>
  81.                 <xsl:apply-templates select="./statut" mode="status_article"/>
  82.             </wp:status>
  83.             <wp:post_parent>0</wp:post_parent>
  84.             <wp:post_type>post</wp:post_type>
  85.             <xsl:apply-templates select="./id_article" mode="comment"/>
  86.            
  87.         </item>
  88.     </xsl:template>
  89.    
  90.    
  91.    
  92.    
  93.  
  94.    
  95.     <xsl:template match="id_article" mode="comment">
  96.         <xsl:apply-templates select="key('forumID',.)" mode="comment2"/>
  97.     </xsl:template>
  98.    
  99.     <xsl:template match="spip_forum" mode="comment2">
  100.         <wp:comment>
  101.             <wp:comment_id>
  102.                 <xsl:value-of select="./id_forum/text()"/>
  103.             </wp:comment_id>
  104.             <wp:comment_author>
  105.                 <xsl:value-of select="./auteur/text()"/>
  106.             </wp:comment_author>
  107.             <wp:comment_author_email>
  108.                 <xsl:value-of select="./email_auteur/text()"/>
  109.             </wp:comment_author_email>
  110.             <wp:comment_author_url>
  111.                 <xsl:value-of select="./url_site/text()"/>
  112.             </wp:comment_author_url>
  113.             <wp:comment_author_IP>
  114.                 <xsl:value-of select="./ip/text()"/>
  115.             </wp:comment_author_IP>
  116.             <wp:comment_date>
  117.                 <xsl:value-of select="./date_heure/text()"/>
  118.             </wp:comment_date>
  119.             <wp:comment_date_gmt>
  120.                 <xsl:value-of select="./date_heure/text()"/>
  121.             </wp:comment_date_gmt>
  122.             <wp:comment_content>
  123.                 <xsl:value-of select="./texte/text()"/>
  124.             </wp:comment_content>
  125.             <wp:comment_approved>1</wp:comment_approved>
  126.             <wp:comment_type/>
  127.             <wp:comment_parent>
  128.                 <xsl:value-of select="./id_parent/text()"/>
  129.             </wp:comment_parent>
  130.         </wp:comment>
  131.     </xsl:template>
  132.    
  133.    
  134. </xsl:stylesheet>

Le numéro 24 me sert à récupérer des articles concernant seuelement une catégorie, je souhaiterais cependant faire la même chose pour mes commentaires mais comment faire sachant que mes posts n'ont plus les identifiants identiques à ceux qu'ils possédaient dans SPIP ?
Merci merci !!

Hors ligne

 

Pied de page des forums

Propulsé par PunBB 1.2.17
© Copyright 2005-2006 WordPress France

Tous droits réservés - wordpress-fr.net © 2005-2006

  • RSS
WPfr ValidatorXhtml ValidatorCSS mysql Php GetFirefox
Design par AmO - Crédits - Equipe WordPress France

Réseau International : Hongrie - Allemagne - Grèce - Italie - Japon - Corée - Suisse - Turquie - USA