/** */ public function perform($data = FALSE) { /* create the object - remember, not all attibutes are supported by every rss version. just hand over an empty string if you don't need a specific attribute */ if (isset($data['filename'])) { $filename = $data['filename']; } else { $filename = FALSE; } if (!isset($data['rss']['encoding'])) { $data['rss']['encoding'] = 'UTF-8'; } $encoding = (string) $data['rss']['encoding']; if (!isset($data['rss']['about'])) { $data['rss']['about'] = ''; } $about = (string) $data['rss']['about']; if (!isset($data['rss']['title'])) { $data['rss']['title'] = ''; } $title = (string) $data['rss']['title']; if (!isset($data['rss']['description'])) { $data['rss']['description'] = ''; } $description = (string) $data['rss']['description']; if (!isset($data['rss']['image_link'])) { $data['rss']['image_link'] = ''; } $image_link = (string) $data['rss']['image_link']; if (!isset($data['rss']['category'])) { $data['rss']['category'] = ''; } $category = (string) $data['rss']['category']; // (only rss 2.0) if (!isset($data['rss']['cache'])) { $data['rss']['cache'] = 0; } $cache = (string) $data['rss']['cache']; // in minutes (only rss 2.0) $rssfile = new RSSBuilder($encoding, $about, $title, $description, $image_link, $category, $cache, $filename); /* if you want you can add additional Dublic Core data to the basic rss file (if rss version supports it) */ if (!isset($data['dc']['publisher'])) { $data['dc']['publisher'] = ''; } $publisher = (string) $data['dc']['publisher']; // person, an organization, or a service if (!isset($data['dc']['creator'])) { $data['dc']['creator'] = ''; } $creator = (string) $data['dc']['creator']; // person, an organization, or a service $date = (string) time(); if (!isset($data['dc']['language'])) { $data['dc']['language'] = ''; } $language = (string) $data['dc']['language']; if (!isset($data['dc']['rights'])) { $data['dc']['rights'] = ''; } $rights = (string) $data['dc']['rights']; if (!isset($data['dc']['coverage'])) { $data['dc']['coverage'] = ''; } $coverage = (string) $data['dc']['coverage']; // spatial location , temporal period or jurisdiction if (!isset($data['dc']['contributor'])) { $data['dc']['contributor'] = ''; } $contributor = (string) $data['dc']['contributor']; // person, an organization, or a service $rssfile->addDCdata($publisher, $creator, $date, $language, $rights, $coverage, $contributor); /* if you want you can add additional Syndication data to the basic rss file (if rss version supports it) */ if (!isset($data['sydate']['period'])) { $data['sydate']['period'] = ''; } $period = (string) $data['sydate']['period']; // hourly / daily / weekly / ... if (!isset($data['sydate']['frequency'])) { $data['sydate']['frequency'] = 0; } $frequency = (int) $data['sydate']['frequency']; // every X hours/days/... if (!isset($data['sydate']['base'])) { $data['sydate']['base'] = 10000; } $base = (string) time() - $data['sydate']['base']; $rssfile->addSYdata($period, $frequency, $base); return $rssfile; }
$rights = ''; # spatial location , temporal period or jurisdiction $coverage = (string) ''; # person, an organization, or a service $contributor = (string) ''; $rssfile->addDCdata($publisher, $creator, $date, $language, $rights, $coverage, $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 = utf8_substr($base, 0, 22) . ':' . utf8_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 {
$t_rights = ''; # spatial location , temporal period or jurisdiction $t_coverage = ''; # person, an organization, or a service $t_contributor = ''; $t_rssfile->addDCdata($t_publisher, $t_creator, $t_date, $t_language, $t_rights, $t_coverage, $t_contributor); # hourly / daily / weekly / ... $t_period = 'hourly'; # every X hours/days/... $t_frequency = 1; $t_base = 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 $t_base = utf8_substr($t_base, 0, 22) . ':' . utf8_substr($t_base, -2); $t_rssfile->addSYdata($t_period, $t_frequency, $t_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 {