meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:rssfeed [2024/12/22 12:38] – [Retrieving RSS feed items] duncancplugin:rssfeed [2025/03/07 13:24] (current) – [Formatting the feed items] duncanc
Line 115: Line 115:
  
 The source of the content depends on the type of feed. For an RSS feed the ''description'' field is used if present, otherwise the ''content'' field. For an Atom feed the ''summary'' field is used if present, otherwise the ''content'' field. The source of the content depends on the type of feed. For an RSS feed the ''description'' field is used if present, otherwise the ''content'' field. For an Atom feed the ''summary'' field is used if present, otherwise the ''content'' field.
-The published date is formatted using a configuration setting. The default is to display as dd/mm/yyyy hh:mm. 
  
 Additionally, placeholders for custom tags can be included. The placeholders must match exactly the custom tags entered on the Settings page. Additionally, placeholders for custom tags can be included. The placeholders must match exactly the custom tags entered on the Settings page.
Line 128: Line 127:
  
 The template is on the Settings page in the RSS Settings group. The template is on the Settings page in the RSS Settings group.
 +
 +=== Formatting the published date ===
 +
 +If the php ''intl'' extension is enabled then the plugin will format the published date in the language of the feed, which is identified by the ''<language>'' element. The date is formatted using a format string containing placeholders as explained at [[https://unicode-org.github.io/icu/userguide/format_parse/datetime/#date-field-symbol-table| https://unicode-org.github.io/icu/userguide/format_parse/datetime/#date-field-symbol-table]]. This allows month and weekday names to be in the feed's language. For example, this shows the published date formatted in Spanish
 +{{:plugin:rss12.png?nolink&500|}}
 +
 +If the php ''intl'' extension is not enabled or the feed does not identify its language then the plugin will format the published date using the php ''date()'' formatting as described at [[https://www.php.net/manual/en/datetime.format.php|https://www.php.net/manual/en/datetime.format.php]]. In this case month and weekday names will be in English.
 ==== Send a test message ==== ==== Send a test message ====
  
Line 183: Line 189:
 ===== Deleting RSS feed items ===== ===== Deleting RSS feed items =====
  
-Once feed items have been included in a campaign there is no need to keep them in the phplist database. To delete items older than a number of days use the menu Campaigns > Delete outdated RSS items. You can also select to delete feeds that have no items and are not used by any campaigns.+Once feed items have been included in a campaign there is no need to keep them in the phplist database. To delete items older than a number of days use the menu Campaigns > Delete outdated RSS items. You can also select to delete unused feeds, those that have no items and are not used by any campaigns.
  
-The command can also be automated using a cron job.  The command will be similar to this (but adjust for the directory in which phplist is installed). The ''-d'' parameter is the number of days for which to keep feed items. The optional ''-u'' parameter is whether to delete unused feeds, a value of 1 to delete unused feeds.+The command can also be automated using a cron job.  The command will be similar to this (but adjust for the directory in which phplist is installed). The ''-d'' parameter is the number of days for which to keep feed items. The optional ''-u'' parameter is whether to delete unused feeds.
 The ''-c'' parameter is required only if the ''config.php'' file is not in the default location of the ''lists/config'' directory. The ''-c'' parameter is required only if the ''config.php'' file is not in the default location of the ''lists/config'' directory.
  
-''php /home/xxx/public_html/lists/admin/index.php -p delete -m RssFeedPlugin -d 99 -u -c /home/xxx/public_html/lists/config/config.php''+''php /home/xxx/public_html/lists/admin/index.php -p delete -m RssFeedPlugin -d 99 -u -c /home/xxx/public_html/lists/config/config.php''
  
 You can also run the command as a remote page if you have a limited cron capability. This approach fetches the page using a linux command such as wget or curl. The URL requires the //Secret for remote processing// value from the phplist Settings page. The ''days'' parameter is the number of days for which to keep items. The optional ''unusedfeeds'' parameter is whether to delete unused feeds. This method requires phpList 3.3.7 or later. You can also run the command as a remote page if you have a limited cron capability. This approach fetches the page using a linux command such as wget or curl. The URL requires the //Secret for remote processing// value from the phplist Settings page. The ''days'' parameter is the number of days for which to keep items. The optional ''unusedfeeds'' parameter is whether to delete unused feeds. This method requires phpList 3.3.7 or later.
  
-''wget -O rssdelete.out '%%https://mysite.com/lists/admin/?page=delete&pi=RssFeedPlugin&days=99&secret=xxxxxxxx'%%''+''wget -O rssdelete.out '%%https://mysite.com/lists/admin/?page=delete&pi=RssFeedPlugin&days=99&unusedfeeds=&secret=xxxxxxxx'%%''
  
  
Line 268: Line 274:
   * Text to append when the title of the latest item is used in the subject.   * Text to append when the title of the latest item is used in the subject.
   * Additional feed elements that should be included in each item's data.   * Additional feed elements that should be included in each item's data.
-  * The format to be used to display the published date.+  * The php ''date()'' format to be used to display the published date. This is used when the php ''intl'' extension is not enabled. 
 +  * The php ''IntlDateFormatter'' format to be used to display the published date. This is used when the php ''intl'' extension is enabled.
   * Whether to filter item content for whitelisted tags only. The default is to filter.   * Whether to filter item content for whitelisted tags only. The default is to filter.
   * Whether to generate special content when an item's URL field is to YouTube or to a pdf file. The default is not to generate the special content.   * Whether to generate special content when an item's URL field is to YouTube or to a pdf file. The default is not to generate the special content.