Changeset 3645 for extensions/piclens/generate_rss.php
- Timestamp:
- Jul 20, 2009, 7:35:50 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/piclens/generate_rss.php
r3637 r3645 2 2 /* 3 3 * Plugin Name: CoolIris-Piclens 4 * Version: 0.3.4 5 * Description: Cooliris/Piclens activation 6 * Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=234 7 * Author: Tiico 8 * Author URI: 9 * */ 10 /********* Fichier generate_rss.php *********/ 4 * File : generate_rss.php 5 */ 11 6 12 7 $debug = false; … … 24 19 25 20 // extensions video 26 $py_addext = array("gvideo", "dm", "ytube", "wideo", "vimeo" , "flv");21 $py_addext = array("gvideo", "dm", "ytube", "wideo", "vimeo"); 27 22 $video_ext_piclens = array("flv"); 28 23 … … 512 507 513 508 echo "<title><![CDATA[" 514 .parse($obj->my_config['piclens_rss_name'], $row, $plugins_ExtendedDesc )509 .parse($obj->my_config['piclens_rss_name'], $row, $plugins_ExtendedDesc, $obj->my_config['piclens_maxcomment_nb']) 515 510 ."]]></title>\n"; 516 511 517 512 518 513 echo '<media:description type="html"><![CDATA[' 519 .parse($obj->my_config['piclens_rss_desc'], $row, $plugins_ExtendedDesc )514 .parse($obj->my_config['piclens_rss_desc'], $row, $plugins_ExtendedDesc, $obj->my_config['piclens_maxcomment_nb']) 520 515 .']]> </media:description>'; 521 516 … … 655 650 } 656 651 657 658 function parse($data, $row, $plugins_ExtendedDesc = false )652 // parse the configuration to complete with the correct informations 653 function parse($data, $row, $plugins_ExtendedDesc = false, $nb_comment = 0) 659 654 { 655 656 // Eviter de charger les commentaires (appels base) si ils ne sont pas affichés 657 if (strpos($data, '%ID') === false) 658 $nb_comment = 0; 659 660 660 include (PICLENS_PATH.'include/config_param.inc.php'); 661 661 … … 671 671 } 672 672 673 673 // Return the last comments of an image id 674 function get_comment($img_id, $nb_comment = 0) 675 { 676 $commentstring = ''; 677 678 if ($nb_comment != 0) 679 { 680 $query = ' 681 SELECT id,author,date,image_id,content 682 FROM '.COMMENTS_TABLE.' 683 WHERE image_id = '.$img_id.' 684 AND validated = \'true\' 685 ORDER BY date ASC 686 LIMIT 0,'.$nb_comment.' 687 ;'; 688 $result = pwg_query( $query ); 689 $first = true; 690 691 while ($row = mysql_fetch_array($result)) 692 { 693 694 // Format : "Commentaire (Utilisateur - Date)" 695 $commentstring .= ($first ? '' : " / \n") 696 .trigger_event('render_comment_content',$row['content']) 697 .' ('. trigger_event('render_comment_author', 698 empty($row['author']) 699 ? l10n('guest') 700 : $row['author']) 701 .' - ' 702 .format_date( $row['date'], false) 703 .")"; 704 705 $first = false; 706 707 } 708 } 709 return $commentstring; 710 } 674 711 675 712 ?>
Note: See TracChangeset
for help on using the changeset viewer.