Skip to content

Instantly share code, notes, and snippets.

@zorgsoft zorgsoft/date.php
Last active Mar 26, 2019

Embed
What would you like to do?
MODx Evo DocLister RSS
<?php
// Сниппет date
// Форматирование даты
if(!isset($en)){
setlocale(LC_ALL, 'ru_RU.UTF-8', 'ru', 'russian');
} else {
setlocale(LC_ALL, 'en_US.UTF-8', 'en', 'english');
}
$date = isset($date)?(isset($sqldate)?$date:strtotime($date)):time();
return strftime(isset($format)?$format:'%d-%m-%Y', $date);
<?xml version='1.0' encoding='utf-8' ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="[(site_url)]rss" rel="self" type="application/rss+xml" />
<title>c0der.ru</title>
<link>[(site_url)]</link>
<description>[(site_name)]</description>
<language>ru-ru</language>
<generator>Hands</generator>
<managingEditor>[(emailsender)] (c0der)</managingEditor>
<webMaster>[(emailsender)] (c0der)</webMaster>
<image>
<url>[(site_url)]avatar_logo.jpg</url>
<title>c0der.ru</title>
<link>[(site_url)]</link>
</image>
[!DocLister?
&display=`100`
&summary=`len:600,notags`
&dotSummary=`0`
&dateSource=`pub_date`
&parents=`7`
&urlScheme=`full`
&depth=`3`
&tvList=`photo,tag`
&id=`rss`
&dateFormat=`%a, %d %b %Y %H:%M:%S %z`
&tplId1=`rss_list_first_item`
&tpl=`rss_list_item`
&filters=`AND(content:template:is:4)`
!]
</channel>
</rss>
<item>
<title>[+e.title+]</title>
<link>[+url+]</link>
<guid isPermaLink='true'>[+url+]</guid>
<description>[+summary+]</description>
<category>[[DocInfo? &docid=`[+parent+]` &field=`pagetitle`]]</category>
<pubDate>[[date? &date=`[+createdon+]` &sqldate=`1` &format=`%a, %d %b %Y %H:%M:%S %z` &en=`true`]]</pubDate>
</item>
<lastBuildDate>[[date? &date=`[+createdon+]` &sqldate=`1` &format=`%a, %d %b %Y %H:%M:%S %z` &en=`true`]]</lastBuildDate>
<item>
<title>[+e.title+]</title>
<link>[+url+]</link>
<guid isPermaLink='true'>[+url+]</guid>
<description>[+summary+]</description>
<category>[[DocInfo? &docid=`[+parent+]` &field=`pagetitle`]]</category>
<pubDate>[[date? &date=`[+createdon+]` &sqldate=`1` &format=`%a, %d %b %Y %H:%M:%S %z` &en=`true`]]</pubDate>
</item>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.