fluxRSS

41 posts in this topic

Posted · Report post

Bonjour,

apres l'une de mes questions posées (nuages de tag) qui a fait debat ;) , aujourd'hui je souhaterais faire un fluxRSS sur la boutique

Est ce possible ?

merci

Share this post


: post
Share on other sites

Posted · Report post

Débat fort interessant sur le nuage de tag ;)

Concernant le RSS je pense que cela est possible mais de la a savoir comment.

Tu veux un RSS sur quoi précisement, tous les produit, les nouveautés, les promos?

A+

Share this post


: post
Share on other sites

Posted · Report post

Je pense sur les nouveautés + news ca peut etre sympa afin de rester en contact avec ceux qui les prennent ;)

Share this post


: post
Share on other sites

Posted · Report post

 

Share this post


: post
Share on other sites

Posted · Report post

Oui tout a fait;

mais l'on peut aussi integrer le contenu redactionel avec en plus qq promo + news

Avez vous un debut de code afin de voir par ou commencer

Merci a vous

Share this post


: post
Share on other sites

Posted · Report post

Bon je viens de faire ça : http://www.3dvf.fr/rss.php

Qui fonctionne uniquement sur la rubrique nouveauté de la boutique.

BAh en fait c'est super simple ;)

Est ce que cela correspond a ce que tu voulais?

EDIT : je passe pas la validation RSS a cause de la date, et d'un tag /item!!!

Share this post


: post
Share on other sites

Posted · Report post

bennnnnnnnnn oui, ......... c'est cela ;)

trop fort trop rapide

Share this post


: post
Share on other sites

Posted · Report post

Alors pour avoir le flux RSS des nouveautés de votre boutique :

1) Ajouter cette ligne entre les balise <head></head> de la page haut.php

<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://monsite.com/rss.php" />

2) Créer la page rss.php a la racine du site :

<?
/* RSS 3DVF / PEEL
*/
include("configuration.inc.php");

Header("content-type: application/xml");
// En-tête
echo "<"."?xml version=\"1.0\" encoding=\"ISO-8859-1\"?".">
<rss version=\"2.0\">
<channel>
<title>Flux RSS 3DVF.fr</title>
<link>http://www.3dvf.fr</link>
<description> Quoi de neuf sur monsite.com ?</description>
";

// R&eacute;cup&eacute;ration et affichage des donn&eacute;es
$sql = "SELECT id,nom_fr,date_maj,descriptif_fr FROM peel_produits WHERE on_promo = '1' AND etat ='1' ";
$result=mysql_query($sql) or DIE('Une erreur de connexion &agrave; la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR());
while($prod=mysql_fetch_array($result))
{
$id_rss = $prod['id'];
$nom_rss = $prod['nom_fr'];
$date_rss = $prod['date_maj'];
$desc_rss = $prod['descriptif_fr'];
$date = strtotime($date_rss);
echo "<item>
<title>".$nom_rss."</title>
<guid>".$wwwroot."/achat/produit_details.php?id=".$id_rss."</guid>
<pubDate>".gmdate('D, d M Y H:i:s',$date)." GMT</pubDate>
<description>".$desc_rss."</description>
</item>
";
}
// Fin d'affichage
echo "</channel>
</rss>
";
?>[/codebox]

Le tour est joué : http://feedvalidator.org/

A+ Pascal

Share this post


: post
Share on other sites

Posted · Report post

Prochaine étape générer la gestion de urlrewrit.

A+

Share this post


: post
Share on other sites

Posted · Report post

Prochaine étape générer la gestion de urlrewrit.

A+

tu as déja la réécriture d'url, tu veux faire quoi ?

Willy

Share this post


: post
Share on other sites

Posted · Report post

 

Share this post


: post
Share on other sites

Posted · Report post

 

Share this post


: post
Share on other sites

Posted · Report post

que les liens generés dans le flux rss soient en url rw si la boutique est configurée ainsi !

OKy j'avais pas calculé ;)

Willy

Share this post


: post
Share on other sites

Posted · Report post

Prochaine étape générer la gestion de urlrewrit.

A+

Pour cela tu copies la fonction qui est dans rewrite.php: function href_link($id, $cat), et au lieu de lui faire écrire un lien de type balise <a>, tu en écris un de type <link>.

Et dans ton programme, tu appels ta nouvelle fonction au lieu de <link>http://www.3dvf.fr/achat/produit_details.php?id=".$id_rss."</link>

Willy

Share this post


: post
Share on other sites

Posted · Report post

Le tour est joué, mais il y un warning sur le site : http://feedvalidator.org/

Ce site valide quoi ?

Que le code est correcte et qu'il plaira a eric-lavoisier ? ;)

Willy

Share this post


: post
Share on other sites

Posted · Report post

Ce site valide quoi ?

Que le code est correcte et qu'il plaira a eric-lavoisier ? ;)

Willy

oui :D

Share this post


: post
Share on other sites

Posted · Report post

Bon est bien je viens de modifier la fonction que tu site Willy, mais voila le résultat : http://www.3dvf.fr/rss.php

le lien ne ce créer pas corectement, la balise link et placé avant la balise ITEM !!!!

Je ne comprend pas pourquoi!

Share this post


: post
Share on other sites

Posted · Report post

pourquoi ne pas utiliser la meme façon de faire qu'avec le fichier sitemap.php qui doit lui aussi avoir les liens réécris

Share this post


: post
Share on other sites

Posted · Report post

 

Share this post


: post
Share on other sites

Posted · Report post

Bon est bien je viens de modifier la fonction que tu site Willy, mais voila le résultat : http://www.3dvf.fr/rss.php

le lien ne ce créer pas corectement, la balise link et placé avant la balise ITEM !!!!

Je ne comprend pas pourquoi!

Explique un peu ec que tu as fait, ce que tu as mis et ou.

Willy

Share this post


: post
Share on other sites

Posted · Report post

Dans rewrite.php j'ai modifié :

if($id != 0){
echo "<link>$wwwroot/".$chaine2."-".$cat."/".$chaine.".html</link>";
} else {
echo "<link>$wwwroot/cat-".$chaine3.".html</link>";
}[/codebox]

et dans rss.php

[codebox]echo "<item>
<title>".$nom_rss."</title>
".rss_link($id_rss, $cat['categorie_id'])."
<pubDate>".gmdate('D, d M Y H:i:s',$date)." GMT</pubDate>
<description>".$desc_rss."</description>
</item>
";

Share this post


: post
Share on other sites

Posted · Report post

Ca doit donner un truc comme ca:

function href_link2($id, $cat){


global $wwwroot;


$link = ""; 


if($id != 0){

// Produits

$sql_prod_query = mysql_query("SELECT peel_produits.nom_".$_SESSION['langue']." as nom FROM peel_produits WHERE peel_produits.id='".$id."'");

$result_prod = mysql_fetch_array($sql_prod_query);

$chaine = mrpropre($result_prod['nom']) . "-" . $id;

}


//Categories

$sql_cat_query = mysql_query("SELECT peel_categories.nom_".$_SESSION['langue']." as nom FROM peel_categories WHERE peel_categories.id='".$cat."'");

$result_cat = mysql_fetch_array($sql_cat_query);

$chaine2 = mrpropre($result_cat['nom']);

$chaine3 = mrpropre($result_cat['nom'])."-".$cat;


//Rubriques


if($id == 0){ // on est dans une catego

 $link = "<link>" .$wwwroot ."/cat-".$chaine3.".html</link>";

}


if($id != 0){

 $link = "<link>" .$wwwroot ."/".$chaine2."-".$cat."/".$chaine.".html</link>";

} else {

 $link = "<link>" .$wwwroot ."/cat-".$chaine3.".html</link>";

}


return ($link);

}

Share this post


: post
Share on other sites

Posted · Report post

Pas de soucis et en plus si c'est valide c'est éric qui va etre content ;)

Tu peux éditer ton message pour mettre les dernieres sources ?

Willy

Share this post


: post
Share on other sites

Posted · Report post

 

Share this post


: post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

Twitter Advisto ecommerce

Facebook PEEL Shopping