. # -------------------------------------------------------- # $Id: issues_rss.php,v 1.8.2.1 2007-10-13 22:33:16 giallu Exp $ # -------------------------------------------------------- ?> setPublisher( $publisher ); $rssfile->setCreator( $creator ); $rssfile->setRights( $rights ); $rssfile->setCoverage( $coverage ); $rssfile->setContributor( $contributor ); # hourly / daily / weekly / ... $period = (string) 'hourly'; # every X hours/days/... $frequency = (int) 1; $base = (string) date( 'Y-m-d\TH:i:sO' ); # add missing : in the O part of the date. PHP 5 supports a 'c' format which will output the format # exactly as we want it. # // 2002-10-02T10:00:00-0500 -> // 2002-10-02T10:00:00-05:00 $base = substr( $base, 0, 22 ) . ':' . substr( $base, -2 ); $rssfile->addSYdata( $period, $frequency, $base ); $t_page_number = 1; $t_issues_per_page = 25; $t_page_count = 0; $t_issues_count = 0; $t_project_id = $f_project_id; if ( $f_username !== null ) { $t_user_id = user_get_id_by_name( $f_username ); } else { $t_user_id = user_get_id_by_name( config_get( 'anonymous_account' ) ); } $t_show_sticky = null; if ( $f_filter_id == 0 ) { $t_custom_filter = filter_get_default(); $t_custom_filter['sort'] = $c_sort_field; } else { # null will be returned if the user doesn't have access right to access the filter. $t_custom_filter = filter_db_get_filter( $f_filter_id, $t_user_id ); if ( null === $t_custom_filter ) { access_denied(); } $t_custom_filter = filter_deserialize( $t_custom_filter ); } $t_issues = filter_get_bug_rows( $t_page_number, $t_issues_per_page, $t_page_count, $t_issues_count, $t_custom_filter, $t_project_id, $t_user_id, $t_show_sticky ); # Loop through results for ( $i = 0; $i < count( $t_issues ); $i++ ) { $row = $t_issues[$i]; $t_bug = bug_get( $row['id'], true ); $about = $link = $t_path . "view.php?id=" . $row['id']; $title = string_rss_links( bug_format_id( $row['id'] ) . ': ' . $t_bug->summary ); if ( $row['view_state'] == VS_PRIVATE ) { $title .= ' [' . lang_get( 'private' ) . ']'; } $description = string_rss_links( $t_bug->description ); # subject is category. $subject = string_rss_links( $t_bug->category ); # optional DC value $date = date( 'Y-m-d\TH:i:sO', $t_bug->last_updated ); # author of item $author = string_rss_links( user_get_name( $t_bug->reporter_id ) ); if ( access_has_global_level( config_get( 'show_user_email_threshold' ) ) ) { $t_author_email = user_get_field( $t_bug->reporter_id, 'email' ); if ( is_blank( $t_author_email ) ) { $t_author_email = $author . '@example.com'; } } else { $t_author_email = $author . '@example.com'; } $author .= ' <' . $t_author_email . '>'; # $comments = 'http://www.example.com/sometext.php?somevariable=somevalue&comments=1'; # url to comment page rss 2.0 value $comments = $t_path . 'view.php?id=' . $row['id'] . '#bugnotes'; # optional mod_im value for dispaying a different pic for every item $image = ''; $rssfile->addItem( $about, $title, $link, $description, $subject, $date, $author, $comments, $image ); } # @@@ consider making this a configuration option. # 0.91 / 1.0 / 2.0 $version = '2.0'; $rssfile->outputRSS( $version ); ?>