diff options
author | zotlabs <mike@macgirvin.com> | 2018-08-22 13:30:16 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-08-22 13:30:16 -0700 |
commit | 6ecd31a715c3d4fb5f2073f376cb9509bc6427d6 (patch) | |
tree | a9c61d76e99197139af0789c8774323e124264d0 /include | |
parent | b25192332ba3b17f1141ff643b3ce2dd4591c528 (diff) | |
download | volse-hubzilla-6ecd31a715c3d4fb5f2073f376cb9509bc6427d6.tar.gz volse-hubzilla-6ecd31a715c3d4fb5f2073f376cb9509bc6427d6.tar.bz2 volse-hubzilla-6ecd31a715c3d4fb5f2073f376cb9509bc6427d6.zip |
tweak archive widget for articles
Diffstat (limited to 'include')
-rwxr-xr-x | include/items.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php index ee7bfd5bc..eb7b9ef78 100755 --- a/include/items.php +++ b/include/items.php @@ -3782,18 +3782,30 @@ function delete_item_lowlevel($item, $stage = DROPITEM_NORMAL, $force = false) { * * @param int $uid * @param boolean $wall (optional) default false + * hack: $wall = 2 selects articles * @return string|boolean date string, otherwise false */ function first_post_date($uid, $wall = false) { - $wall_sql = (($wall) ? " and item_wall = 1 " : "" ); - $item_normal = item_normal(); + $wall_sql = (($wall === 1) ? " and item_wall = 1 " : "" ); + if($wall === 2) { + $wall_sql = " and item_type = 7 "; + $item_normal = " and item.item_hidden = 0 and item.item_type = 7 and item.item_deleted = 0 + and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0 + and item.item_blocked = 0 "; + + } + else { + $item_normal = item_normal(); + } + $r = q("select id, created from item where uid = %d and id = parent $item_normal $wall_sql order by created asc limit 1", intval($uid) ); + if($r) { // logger('first_post_date: ' . $r[0]['id'] . ' ' . $r[0]['created'], LOGGER_DATA); return substr(datetime_convert('',date_default_timezone_get(),$r[0]['created']),0,10); |