Cacher Fil RSS

Démonstration

Voici la liste de widget possédant une démo. Certaine démo ne fonctionnent pas sur ce serveur, c’est normal ! Elles utilisent des données externes (comme une base de données ou un annuaire LDAP) non disponnible sur ce serveur.

 

Pxxo_Widget_Atom

Apparence(s)

Exemple 1
Atom
Exemple 2
Atom

Usage

<?php

// *********************************************************************** //
// *                                                                     * //
// *                                                                     * //
// *                                                                     * //
// *  Pour afficher le flux au format JSON, il suffit de modifier l'URL  * //
// *                                                                     * //
// *  en remplaçant  =atom par =json                                     * // 
// *                                                                     * //
// *                                                                     * //
// *                                                                     * //
// *********************************************************************** //


// // // // // // // // // // // // // // // // // // // // // // // // // //
//                                                                         //
// Exemple n°1 : Création  un tableau de paramètre simpliste.              //
//                                                                         //
// // // // // // // // // // // // // // // // // // // // // // // // // //

$params = array(
    
'id' => 'test',
    
'title' => 'Exemple',
    
'updated' => time(),
    
'authors' => array(
        
'truc@exemple.fr' => 'Monsieur Truc',
    ),
    
'content' => array(
        
'type' => 'text',
        
'value' => 'Un flux de test',
    ),
    
'entries' => array(
        array(
            
'id' => '#1',
            
'title' => 'Entry One',
            
'link' => 'http://www.exemple.com/#1',
            
'published' => time(),
            
'updated' => time(),
            
'content' => array(
                
'type' => 'text',
                
'value' => 'Contenu de l\'entrée Un',
            ),
            
'authors' => array(
                
'truc@exemple.fr' => 'Monsieur Truc',
                
'bidule@exemple.fr' => 'Madame Bidule',
            ),
            
'categories' => array(
                
'cat1' => 'catégorie #1',
                
'cat2' => 'catégorie #2',
            ),
        ),
        array(
            
'id' => '#2',
            
'title' => 'Entry Two',
            
'link' => 'http://www.exemple.com/#2',
            
'published' => time(),
            
'updated' => time(),
            
'content' => array(
                
'type' => 'html',
                
'value' => '<b>Contenu de l\'entrée Un</b>',
            ),
            
'authors' => array(
                
'truc@exemple.fr' => 'Monsieur Truc',
            ),
            
'categories' => array(
                
'cat1' => 'catégorie #1',
            ),
        ),
    )
);
$obj1 = new Pxxo_Widget_Atom($params);


// // // // // // // // // // // // // // // // // // // // // // // // // //
//                                                                         //
// Exemple n°2 : Création avec une callback.                               //
//                                                                         //
// // // // // // // // // // // // // // // // // // // // // // // // // //


 
function feed() {
    return array( 
            
'version' => '1.0',
            
'encoding' => 'UTF-8',
            
'feed' => array(
                
'xmlns' => 'http://www.w3.org/2005/Atom',
                
'xmlns:openSearch' => 'http://a9.com/-/spec/opensearchrss/1.0/',
                
'id' => array(
                    
'value' => 'id du flux',
                ),
                
'updated' => array(
                    
'value' => date('Y-m-d\TH:i:s\Z'),
                ),
                
'title' => array(
                    
'type' => 'text',
                    
'value' => 'Titre du flux',
                ),
                
'link' => array(
                    array(
                        
'rel' => 'self',
                        
'type' => 'UTF-8',
                        
'href' => 'http://www.exemple.fr',
                    ),
                ),
                
'author' => array(
                    array(
                        
'name' => array(
                            
'value' => 'touv'
                        
),
                        
'email' => array(
                            
'value' => 'touv@exemple.fr'
                        
),
                    ),
                ),
                
'generator' => array(
                    
'version' => '1.0',
                    
'uri' => 'http://www.pxxo.net/fr/doc/pxxo_widget_atom',
                    
'value' => 'Pxxo_Widget_Atom',
                ),
                
'openSearch:startIndex' => array( 
                    
'value' => 1,
                ),
                
'openSearch:itemsPerPage' => array(
                    
'value' => 10,
                ),
                
'openSearch:totalResults' => array(
                    
'value' => 101,
                ),
                
'openSearch:Query' => array(
                    
'role' => null,
                    
'searchTerms' => 'q',
                    
'value' => 'truc',
                    
'startPage' => 1,
                ),
                
'content' => array(
                    
'type' => 'text',
                    
'value' => 'Résulat',
                ),
                
'entry' => array(
                    array(
                        
'id' => array(
                            
'value' => '#1',
                        ),
                        
'published' => array(
                            
'value' =>  date('Y-m-d\TH:i:s\Z'),
                        ),
                        
'updated' =>array(
                            
'value' =>  date('Y-m-d\TH:i:s\Z'),
                        ),
                        
'category'=> array(
                            array(
                                
'scheme' => 'http://www.exemple.fr/tags/t1',
                                
'term' => 't1',
                            ),
                        ),
                        
'title' => array(
                            
'type' => 'text',
                            
'value' => 'Title1',
                        ),
                        
'content' => array(
                            
'type' => 'text',
                            
'value' => 'Content1',
                        ),
                        
'link' => array(
                            array(
                                
'type' => 'text/html',
                                
'href' => 'http://www.exemple.fr/1',
                            ),
                        ),
                        
'author' => array(
                            array(
                                
'name' => array('value' => null),
                                
'email' => array('value' => null),
                            ),
                        ),
                    ),
                    array(
                        
'id' => array(
                            
'value' => '#1',
                        ),
                        
'published' => array(
                            
'value' =>  date('Y-m-d\TH:i:s\Z'),
                        ),
                        
'updated' =>array(
                            
'value' =>  date('Y-m-d\TH:i:s\Z'),
                        ),
                        
'category'=> array(
                            array(
                                
'scheme' => 'http://www.exemple.fr/tags/t1',
                                
'term' => 't1',
                            ),
                        ),
                        
'title' => array(
                            
'type' => 'text',
                            
'value' => 'Title2',
                        ),
                        
'content' => array(
                            
'type' => 'text',
                            
'value' => 'Content2',
                        ),
                        
'link' => array(
                            array(
                                
'type' => 'text/html',
                                
'href' => 'http://www.exemple.fr/2',
                            ),
                        ),
                        
'author' => array(
                            array(
                                
'name' => array('value' => null),
                                
'email' => array('value' => null),
                            ),
                        ),
                    ),
                ),
            ),
        );
}
 
 
$params = array();
$params['ClassID'] = 'alt';
$params['feed_callback'] = 'feed';
 
$obj2 = new Pxxo_Widget_Atom($params);

 

 

Powered by Pxxo