Mammouth du PHP |
1311 Messages
10 nov. 2005, 16:10
mercie de ta reponse
j'ai autre probleme
j'ai voulue incorporé un feuille xsl pour mettre en forme mon fil
et le resultat c'est qu'il maffiche mon fichier php avec le quelle je construit le fil c'est a dire essai1.php
<?php
include 'config/parametre.ini.php';
$path=dirname(__file__);
define('SMARTY_DIR_LIB',$path.'/lib/Smarty/libs');
define('DIR_ACTIONS',$path.'/Action/');
function __autoload($nom)
{
require dirname(__file__).'/lib/class/'.$nom.'.php';
}
$mysql=new Mysqldb(SERVEUR,LOGIN,PASS,BASE);
$dao=new DAO($mysql);
$rss=new rss2_ab();
//$rss->send();
$champs=array('date','description','titre','id_a');
$table=array('actu');
$dao->SetVar($table,$champs);
$rss->channel=array('title'=>'essai','description'=>'premier test','link'=>'http://localhost/projet_ing/');
$rss->encoding='utf-8';
//$rss->lastBuildDate=date("d/m/Y-H:i:s");
$rss->language='fr';
$rss->xslt='./rss2.xsl';
foreach($dao->Select('','Limit 0,4') as $cle=>$tab)
{
$rss->item=array('title'=>$tab[2],'description'=>$tab[1],'link'=>'http://localhost/projet_ing/index.php?module=actu&action=display&id='.$tab[3],'date'=>$tab[0],'guid'=>$tab[3]);
}
//$rss->lastBuildDate=date('d M Y H:i');
$rss->createrss2();
//$rss->send();
//echo $rss->content;
?>
et voila ce qu'il maffiche
Code : Tout sélectionner
send(); $champs=array('date','description','titre','id_a'); $table=array('actu'); $dao->SetVar($table,$champs); $rss->channel=array('title'=>'essai','description'=>'premier test','link'=>'http://localhost/projet_ing/'); $rss->encoding='utf-8'; //$rss->lastBuildDate=date("d/m/Y-H:i:s"); $rss->language='fr'; $rss->xslt='./rss2.xsl'; foreach($dao->Select('','Limit 0,4') as $cle=>$tab) { $rss->item=array('title'=>$tab[2],'description'=>$tab[1],'link'=>'http://localhost/projet_ing/index.php?module=actu&action=display&id='.$tab[3],'date'=>$tab[0],'guid'=>$tab[3]); } //$rss->lastBuildDate=date('d M Y H:i'); $rss->createrss2(); //$rss->send(); //echo $rss->content; ?>
et voici le fichier xml tel qu'il devrais etre
Code : Tout sélectionner
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!--<!DOCTYPE rss SYSTEM "http://localhost/projet_ing/RSS/rss2.dtd" >-->
<?xml-stylesheet href="./rss2.xsl" type="text/xsl"?>
<rss version="2.0">
<channel>
<title>essai</title>
<link>http://localhost/projet_ing/</link>
<description>premier test</description>
<language>fr</language>
<item>
<title>test1</title>
<link>http://localhost/projet_ing/index.php?module=actu&action=display&id=1</link>
<description>premier test1</description>
<guid>1</guid>
</item>
<item>
<title>test2</title>
<link>http://localhost/projet_ing/index.php?module=actu&action=display&id=2</link>
<description>2ieme test</description>
<guid>2</guid>
</item>
</channel>
</rss>
ca merde ou, la je suis depaser
j'ai rien fait et maintenant ca fonctionne bien, j'ai peur
