diff options
author | friendica <redmatrix@redmatrix.me> | 2015-04-23 21:29:27 -0700 |
---|---|---|
committer | friendica <redmatrix@redmatrix.me> | 2015-04-23 21:29:27 -0700 |
commit | ca305f54210b233dec4f81a8f91da46c2df6c6b7 (patch) | |
tree | fb5e880bc34a25737188498a4d06b4bb898ab4c1 /mod/blocks.php | |
parent | 5ac177391bf7f8f13da5089b907829cf6f77650b (diff) | |
parent | c696860cc53bc25558d83de5eda65d9b583da382 (diff) | |
download | volse-hubzilla-ca305f54210b233dec4f81a8f91da46c2df6c6b7.tar.gz volse-hubzilla-ca305f54210b233dec4f81a8f91da46c2df6c6b7.tar.bz2 volse-hubzilla-ca305f54210b233dec4f81a8f91da46c2df6c6b7.zip |
Merge https://github.com/redmatrix/redmatrix into pending_merge
Diffstat (limited to 'mod/blocks.php')
-rw-r--r-- | mod/blocks.php | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/mod/blocks.php b/mod/blocks.php index b74b034e5..f609164e0 100644 --- a/mod/blocks.php +++ b/mod/blocks.php @@ -70,7 +70,6 @@ function blocks_content(&$a) { return; } - // Block design features from visitors if((! $uid) || ($uid != $owner)) { @@ -105,11 +104,10 @@ function blocks_content(&$a) { if($_REQUEST['pagetitle']) $x['pagetitle'] = $_REQUEST['pagetitle']; - - $editor = status_editor($a,$x); - $r = q("select * from item_id where uid = %d and service = 'BUILDBLOCK' order by sid asc", + $r = q("select * from item_id left join item on item_id.iid = item.id + where item_id.uid = %d and service = 'BUILDBLOCK' order by item.created desc", intval($owner) ); @@ -118,7 +116,22 @@ function blocks_content(&$a) { if($r) { $pages = array(); foreach($r as $rr) { - $pages[$rr['iid']][] = array('url' => $rr['iid'],'title' => $rr['sid']); + $element_arr = array( + 'type' => 'block', + 'body' => $rr['body'], + 'created' => $rr['created'], + 'edited' => $rr['edited'], + 'mimetype' => $rr['mimetype'], + 'pagetitle' => $rr['sid'], + 'mid' => $rr['mid'] + ); + $pages[$rr['iid']][] = array( + 'url' => $rr['iid'], + 'title' => $rr['sid'], + 'created' => $rr['created'], + 'edited' => $rr['edited'], + 'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]' + ); } } @@ -128,8 +141,13 @@ function blocks_content(&$a) { $o .= replace_macros(get_markup_template('blocklist.tpl'), array( '$baseurl' => $url, '$title' => t('Blocks'), + '$name' => t('Block Name'), + '$created' => t('Created'), + '$edited' => t('Edited'), '$create' => t('Create'), '$edit' => t('Edit'), + '$share' => t('Share'), + '$delete' => t('Delete'), '$editor' => $editor, '$pages' => $pages, '$channel' => $which, |