diff options
author | Michael Meer <michael@meer.name> | 2014-01-28 09:49:09 +0100 |
---|---|---|
committer | Michael Meer <michael@meer.name> | 2014-01-28 09:49:09 +0100 |
commit | 8ddee71c2b0f384470965dd46a2e594a4f98f8e0 (patch) | |
tree | 84bcf6e0f94365b186b4613b43d7a72f5f22f525 /include | |
parent | 904db593df914d2932d9c2f018b00987052461d7 (diff) | |
parent | f104b4dc275891785ec03abd779d8aafe5163815 (diff) | |
download | volse-hubzilla-8ddee71c2b0f384470965dd46a2e594a4f98f8e0.tar.gz volse-hubzilla-8ddee71c2b0f384470965dd46a2e594a4f98f8e0.tar.bz2 volse-hubzilla-8ddee71c2b0f384470965dd46a2e594a4f98f8e0.zip |
Merge branch 'master' of https://github.com/friendica/red
to be in sync with main repro
Diffstat (limited to 'include')
-rw-r--r-- | include/ItemObject.php | 2 | ||||
-rw-r--r-- | include/conversation.php | 1 | ||||
-rw-r--r-- | include/menu.php | 50 |
3 files changed, 11 insertions, 42 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php index 9a62cee4b..e9a0b65c0 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -218,7 +218,7 @@ class Item extends BaseObject { 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'), 'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''), - 'expiretime' => (($item['expires'] > 0) ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''), + 'expiretime' => (($item['expires'] !== '0000-00-00 00:00:00') ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''), 'lock' => $lock, 'verified' => $verified, 'unverified' => $unverified, diff --git a/include/conversation.php b/include/conversation.php index 34d661004..316bc1612 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -687,6 +687,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'), 'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''), + 'expiretime' => (($item['expires'] !== '0000-00-00 00:00:00') ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''), 'location' => $location, 'indent' => '', 'owner_name' => $owner_name, diff --git a/include/menu.php b/include/menu.php index 515f47758..d69c5d0d3 100644 --- a/include/menu.php +++ b/include/menu.php @@ -23,29 +23,6 @@ function menu_fetch($name,$uid,$observer_xchan) { return null; } -function bookmarks_menu_fetch($uid,$observer_xchan,$flags = MENU_BOOKMARK) { - - $sel_option = (($flags) ? ' and menu_flags = ' . intval($menu_flags) . ' ' : ''); - - $sql_options = permissions_sql($uid); - - $r = q("select * from menu where menu_channel_id = %d $sel_option limit 1", - intval($uid) - ); - if($r) { - $x = q("select * from menu_item where mitem_menu_id = %d and mitem_channel_id = %d - $sql_options - order by mitem_order asc, mitem_desc asc", - intval($r[0]['menu_id']), - intval($uid) - ); - return array('menu' => $r[0], 'items' => $x ); - } - - return null; -} - - function menu_render($menu) { if(! $menu) return ''; @@ -95,7 +72,7 @@ function menu_create($arr) { $menu_channel_id = intval($arr['menu_channel_id']); - $r = q("select * from menu where menu_name = '%s' and menu_channel_id = %d and menu_flags = %d limit 1", + $r = q("select * from menu where menu_name = '%s' and menu_channel_id = %d limit 1", dbesc($menu_name), intval($menu_channel_id), intval($menu_flags) @@ -124,8 +101,11 @@ function menu_create($arr) { } -function menu_list($channel_id) { - $r = q("select * from menu where menu_channel_id = %d order by menu_name", +function menu_list($channel_id, $flags = 0) { + + $sel_options = (($flags) ? " and ( menu_flags & " . intval($flags) . " ) " : ''); + + $r = q("select * from menu where menu_channel_id = %d $sel_options order by menu_name", intval($channel_id) ); return $r; @@ -153,9 +133,8 @@ function menu_edit($arr) { $menu_channel_id = intval($arr['menu_channel_id']); - $r = q("select menu_id from menu where menu_name = '%s' and menu_flags = %d and menu_channel_id = %d limit 1", + $r = q("select menu_id from menu where menu_name = '%s' and menu_channel_id = %d limit 1", dbesc($menu_name), - intval($menu_flags), intval($menu_channel_id) ); if(($r) && ($r[0]['menu_id'] != $menu_id)) { @@ -173,22 +152,11 @@ function menu_edit($arr) { return false; } - - $r = q("select * from menu where menu_name = '%s' and menu_channel_id = %d and menu_desc = '%s' and menu_flags = %d limit 1", - dbesc($menu_name), - intval($menu_channel_id), - dbesc($menu_desc), - intval($menu_flags) - ); - - if($r) - return false; - - - return q("update menu set menu_name = '%s', menu_desc = '%s', + return q("update menu set menu_name = '%s', menu_desc = '%s', menu_flags = %d, where menu_id = %d and menu_channel_id = %d limit 1", dbesc($menu_name), dbesc($menu_desc), + intval($menu_flags), intval($menu_id), intval($menu_channel_id) ); |