diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-08-24 14:44:45 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-08-24 14:44:45 +0200 |
commit | f036c25dca3bbf18b994dff3b32492bef0ff4d50 (patch) | |
tree | 508bb52dddcca5af3321f548aad3db30307ea0aa /Zotlabs/Module | |
parent | 7fc4292ed866026552add794d573d521481a0519 (diff) | |
parent | 7018da3f127e9d2abdb359516d079fc038a4c2a3 (diff) | |
download | volse-hubzilla-f036c25dca3bbf18b994dff3b32492bef0ff4d50.tar.gz volse-hubzilla-f036c25dca3bbf18b994dff3b32492bef0ff4d50.tar.bz2 volse-hubzilla-f036c25dca3bbf18b994dff3b32492bef0ff4d50.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Articles.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php index 284868241..e1f0b4ab0 100644 --- a/Zotlabs/Module/Articles.php +++ b/Zotlabs/Module/Articles.php @@ -51,6 +51,8 @@ class Articles extends \Zotlabs\Web\Controller { $sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'],'item', $category, TERM_CATEGORY)); } + $datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : ''); + $datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : ''); $which = argv(1); @@ -143,10 +145,21 @@ class Articles extends \Zotlabs\Web\Controller { $sql_item = "and item.id = " . intval($r[0]['iid']) . " "; } } - + if($datequery) { + $sql_extra2 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery)))); + $order = 'post'; + } + if($datequery2) { + $sql_extra2 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2)))); + } + + if($datequery || $datequery2) { + $sql_extra2 .= " and item.item_thread_top != 0 "; + } + $r = q("select * from item where item.uid = %d and item_type = %d - $sql_extra $sql_item order by item.created desc $pager_sql", + $sql_extra $sql_extra2 $sql_item order by item.created desc $pager_sql", intval($owner), intval(ITEM_TYPE_ARTICLE) ); |