From f12611677707ceb1128d115ce4b2b48f68972f7e Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 13 Apr 2015 15:48:11 -0700 Subject: rev update --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index ffc321393..9ba451e9d 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-04-11.999 +2015-04-13.1001 -- cgit v1.2.3 From d3bc721138433b3d4940f0c8ade7ebd39fff9b6e Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 13 Apr 2015 16:03:09 -0700 Subject: item_check_service_class wasn't returning correct results --- mod/item.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mod/item.php b/mod/item.php index 45ac4a6aa..53064132c 100644 --- a/mod/item.php +++ b/mod/item.php @@ -116,7 +116,7 @@ function item_post(&$a) { * Check service class limits */ if ($uid && !(x($_REQUEST,'parent')) && !(x($_REQUEST,'post_id'))) { - $ret = item_check_service_class($uid,x($_REQUEST,'webpage')); + $ret = item_check_service_class($uid,(($_REQUEST['webpage'] == ITEM_WEBPAGE) ? true : false)); if (!$ret['success']) { notice( t($ret['message']) . EOL) ; if(x($_REQUEST,'return')) @@ -1084,6 +1084,7 @@ function item_check_service_class($channel_id,$iswebpage) { $ret = array('success' => false, $message => ''); if ($iswebpage) { + // note: we aren't counting comanche templates and blocks, only webpages $r = q("select count(id) as total from item where parent = id and ( item_restrict & %d ) > 0 and ( item_restrict & %d ) = 0 and uid = %d ", intval(ITEM_WEBPAGE), @@ -1092,7 +1093,8 @@ function item_check_service_class($channel_id,$iswebpage) { ); } else { - $r = q("select count(id) as total from item where parent = id and item_restrict = 0 and uid = %d ", + $r = q("select count(id) as total from item where parent = id and item_restrict = 0 and (item_flags & %d) > 0 and uid = %d ", + intval(ITEM_WALL), intval($channel_id) ); } @@ -1103,14 +1105,16 @@ function item_check_service_class($channel_id,$iswebpage) { } if (!$iswebpage) { + $max = service_class_fetch($channel_id,'total_items'); if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) { - $result['message'] .= upgrade_message() . sprintf( t('You have reached your limit of %1$.0f top level posts.'),$r[0]['total']); + $result['message'] .= upgrade_message() . sprintf( t('You have reached your limit of %1$.0f top level posts.'),$max); return $result; } } else { + $max = service_class_fetch($channel_id,'total_pages'); if(! service_class_allows($channel_id,'total_pages',$r[0]['total'])) { - $result['message'] .= upgrade_message() . sprintf( t('You have reached your limit of %1$.0f webpages.'),$r[0]['total']); + $result['message'] .= upgrade_message() . sprintf( t('You have reached your limit of %1$.0f webpages.'),$max); return $result; } } -- cgit v1.2.3 From 213ca7f8b584c9b75f25aa560b1f3eda1e415f54 Mon Sep 17 00:00:00 2001 From: Habeas Codice Date: Mon, 13 Apr 2015 16:18:11 -0700 Subject: unquote binary --- mod/attach.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/attach.php b/mod/attach.php index cf72d09c6..118c67dd5 100644 --- a/mod/attach.php +++ b/mod/attach.php @@ -36,7 +36,8 @@ function attach_init(&$a) { header('Content-disposition: attachment; filename="' . $r['data']['filename'] . '"'); if($r['data']['flags'] & ATTACH_FLAG_OS ) { - $istream = fopen('store/' . $c[0]['channel_address'] . '/' . $r['data']['data'],'rb'); + $fname = dbunescbin($r['data']['data']); + $istream = fopen('store/' . $c[0]['channel_address'] . '/' . $fname,'rb'); $ostream = fopen('php://output','wb'); if($istream && $ostream) { pipe_streams($istream,$ostream); @@ -45,7 +46,7 @@ function attach_init(&$a) { } } else - echo $r['data']['data']; + echo dbunescbin($r['data']['data']); killme(); } -- cgit v1.2.3 From 338b80560f12eb54d8d52d4fb42ff4c1507d7574 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 14 Apr 2015 01:13:12 -0700 Subject: comanche preview is probably important --- doc/to_do_code.bb | 1 + version.inc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/to_do_code.bb b/doc/to_do_code.bb index 713885f92..a0835d224 100644 --- a/doc/to_do_code.bb +++ b/doc/to_do_code.bb @@ -17,6 +17,7 @@ We need much more than this, but here are areas where developers can help. Pleas [li]Write more webpage widgets[/li] [li]restricted access OAuth clients[/li] [li](Advanced) create a UI for building Comanche pages[/li] +[li](less advanced) create a way to preview Comanche results on a preview page while editing on another page[/li] [li]Extend WebDAV to provide desktop access to photo albums[/li] [li]External post connectors - create standard interface[/li] [li]External post connectors, add popular services[/li] diff --git a/version.inc b/version.inc index 9ba451e9d..548eb28e1 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-04-13.1001 +2015-04-14.1002 -- cgit v1.2.3 From bf2a97147ecef7528e9adbed3cf4a1f3af03ad72 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Apr 2015 11:50:21 +0200 Subject: some more on webpages --- include/text.php | 27 +++++++++++++++------------ mod/editwebpage.php | 2 +- mod/webpages.php | 8 ++++---- view/css/mod_webpages.css | 3 ++- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/include/text.php b/include/text.php index 791254e52..29654e1fd 100644 --- a/include/text.php +++ b/include/text.php @@ -1595,18 +1595,20 @@ function layout_select($channel_id, $current = '') { intval($channel_id), intval(ITEM_PDL) ); + if($r) { - $o = t('Select a page layout: '); - $o .= ''; } + $o = replace_macros(get_markup_template('field_select_raw.tpl'), array( + '$field' => array('layout_mid', t('Page layout'), $selected, t('You can create your own with the layouts tool'), $options) + )); + return $o; } @@ -1639,13 +1641,14 @@ function mimetype_select($channel_id, $current = 'text/bbcode') { } } - $o = t('Page content type: '); - $o .= ''; + + $o = replace_macros(get_markup_template('field_select_raw.tpl'), array( + '$field' => array('mimetype', t('Page content type'), $selected, t('If unsure select text/bbcode'), $options) + )); return $o; } @@ -2105,7 +2108,7 @@ function design_tools() { $who = $channel['channel_address']; return replace_macros(get_markup_template('design_tools.tpl'), array( - '$title' => t('Design'), + '$title' => t('Design Tools'), '$who' => $who, '$sys' => $sys, '$blocks' => t('Blocks'), diff --git a/mod/editwebpage.php b/mod/editwebpage.php index e81cde479..e30a33171 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -126,7 +126,7 @@ function editwebpage_content(&$a) { $plaintext = true; if(get_config('system','page_mimetype')) - $mimeselect = ''; + $mimeselect = ''; else $mimeselect = mimetype_select($itm[0]['uid'],$mimetype); diff --git a/mod/webpages.php b/mod/webpages.php index b4c4e6e4e..2b284813a 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -70,10 +70,10 @@ function webpages_content(&$a) { return; } - if(feature_enabled($owner,'expert') || $a->is_sys) { - $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); - if(! $mimetype) - $mimetype = 'choose'; + $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); + + if(! $mimetype) { + $mimetype = 'choose'; } else { $mimetype = 'text/bbcode'; diff --git a/view/css/mod_webpages.css b/view/css/mod_webpages.css index af1ef5357..29cd1e803 100644 --- a/view/css/mod_webpages.css +++ b/view/css/mod_webpages.css @@ -12,8 +12,9 @@ #webpage-list-table td:nth-child(1){ padding: 7px 3px 7px 10px; - white-space: nowrap; + word-wrap: break-word; } + #webpage-list-table th:nth-child(5), #webpage-list-table td:nth-child(5){ padding: 7px 3px; -- cgit v1.2.3 From 2001ad94bd16c283b2cc79d8e48646d61acb5a77 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Apr 2015 11:59:49 +0200 Subject: dont suggest anything here it explains itself --- include/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/text.php b/include/text.php index 29654e1fd..f1f6d41f0 100644 --- a/include/text.php +++ b/include/text.php @@ -1647,7 +1647,7 @@ function mimetype_select($channel_id, $current = 'text/bbcode') { } $o = replace_macros(get_markup_template('field_select_raw.tpl'), array( - '$field' => array('mimetype', t('Page content type'), $selected, t('If unsure select text/bbcode'), $options) + '$field' => array('mimetype', t('Page content type'), $selected, '', $options) )); return $o; -- cgit v1.2.3 From 953819e7da8152f959f04c733ce617cc34cf8c7d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Apr 2015 12:52:31 +0200 Subject: css fixes and remove expert mode for block page content type --- mod/blocks.php | 11 +++-------- mod/webpages.php | 3 --- view/css/mod_webpages.css | 2 +- view/tpl/webpagelist.tpl | 2 +- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/mod/blocks.php b/mod/blocks.php index 1b7a3588f..e0f32f4f1 100644 --- a/mod/blocks.php +++ b/mod/blocks.php @@ -78,16 +78,11 @@ function blocks_content(&$a) { return; } + $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); - if(feature_enabled($owner,'expert')) { - $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); - if(! $mimetype) - $mimetype = 'choose'; + if(! $mimetype) { + $mimetype = 'choose'; } - else { - $mimetype = 'text/bbcode'; - } - $x = array( 'webpage' => ITEM_BUILDBLOCK, diff --git a/mod/webpages.php b/mod/webpages.php index 2b284813a..e2b5eb3a4 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -75,9 +75,6 @@ function webpages_content(&$a) { if(! $mimetype) { $mimetype = 'choose'; } - else { - $mimetype = 'text/bbcode'; - } $layout = (($_REQUEST['layout']) ? $_REQUEST['layout'] : get_pconfig($owner,'system','page_layout')); if(! $layout) diff --git a/view/css/mod_webpages.css b/view/css/mod_webpages.css index 29cd1e803..32291adc7 100644 --- a/view/css/mod_webpages.css +++ b/view/css/mod_webpages.css @@ -7,12 +7,12 @@ } #webpage-list-table th:nth-child(1){ + padding: 7px 3px 7px 10px; white-space: nowrap; } #webpage-list-table td:nth-child(1){ padding: 7px 3px 7px 10px; - word-wrap: break-word; } #webpage-list-table th:nth-child(5), diff --git a/view/tpl/webpagelist.tpl b/view/tpl/webpagelist.tpl index 4e5b3e0e4..9d440eb64 100644 --- a/view/tpl/webpagelist.tpl +++ b/view/tpl/webpagelist.tpl @@ -13,7 +13,7 @@ {{/if}} {{if $pages}} -
+
-- cgit v1.2.3 From 3a45206b9971ee981ea61de31c8413350ebcdd7b Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 14 Apr 2015 16:22:33 -0700 Subject: default perms not being set in some cases --- mod/connedit.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mod/connedit.php b/mod/connedit.php index 70839e373..8ae1707ae 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -177,7 +177,17 @@ function connedit_post(&$a) { if(($_REQUEST['pending']) && ($abook_flags & ABOOK_FLAG_PENDING)) { $abook_flags = ( $abook_flags ^ ABOOK_FLAG_PENDING ); $new_friend = true; + if(! $abook_my_perms) { + $abook_my_perms = get_channel_default_perms(local_channel()); + + $role = get_pconfig(local_channel(),'system','permissions_role'); + if($role) { + $x = get_role_perms($role); + if($x['perms_accept']) + $abook_my_perms = $x['perms_accept']; + } + } } $r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, abook_flags = %d -- cgit v1.2.3 From 32acb7f6e1d7b504cb633cb951ed6d722a75182f Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 14 Apr 2015 20:50:38 -0700 Subject: post_activity_item incorrectly setting the obj_type when a valid type was specified --- include/items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index e08aab85a..659d0e350 100755 --- a/include/items.php +++ b/include/items.php @@ -436,7 +436,7 @@ function post_activity_item($arr) { $arr['verb'] = ((x($arr,'verb')) ? $arr['verb'] : ACTIVITY_POST); $arr['obj_type'] = ((x($arr,'obj_type')) ? $arr['obj_type'] : ACTIVITY_OBJ_NOTE); - if($is_comment) + if($is_comment && $arr['obj_type'] === ACTIVITY_OBJ_NOTE)) $arr['obj_type'] = ACTIVITY_OBJ_COMMENT; $arr['allow_cid'] = ((x($arr,'allow_cid')) ? $arr['allow_cid'] : $channel['channel_allow_cid']); -- cgit v1.2.3 From 9942dec09cf5dc2ab4b2644adf3e48808443338b Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 14 Apr 2015 20:52:07 -0700 Subject: match parens --- include/items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 659d0e350..01f207878 100755 --- a/include/items.php +++ b/include/items.php @@ -436,7 +436,7 @@ function post_activity_item($arr) { $arr['verb'] = ((x($arr,'verb')) ? $arr['verb'] : ACTIVITY_POST); $arr['obj_type'] = ((x($arr,'obj_type')) ? $arr['obj_type'] : ACTIVITY_OBJ_NOTE); - if($is_comment && $arr['obj_type'] === ACTIVITY_OBJ_NOTE)) + if(($is_comment) && ($arr['obj_type'] === ACTIVITY_OBJ_NOTE)) $arr['obj_type'] = ACTIVITY_OBJ_COMMENT; $arr['allow_cid'] = ((x($arr,'allow_cid')) ? $arr['allow_cid'] : $channel['channel_allow_cid']); -- cgit v1.2.3 From 2c8394a4b90b5b6dc52d5d886fd8e96134e57406 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 14 Apr 2015 21:48:42 -0700 Subject: funny I should mention comanche preview (yesterday) as clicking the view link on a layout does nothing interesting at all. So I've made it do a crude but useable preview with page content of 'Lorem Ipsum'. --- mod/page.php | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/mod/page.php b/mod/page.php index 05d88aa52..ad1862a7a 100644 --- a/mod/page.php +++ b/mod/page.php @@ -55,11 +55,12 @@ function page_init(&$a) { $sql_options = item_permissions_sql($u[0]['channel_id']); $r = q("select item.* from item left join item_id on item.id = item_id.iid - where item.uid = %d and sid = '%s' and service = 'WEBPAGE' and - item_restrict = %d $sql_options $revision limit 1", + where item.uid = %d and sid = '%s' and (( service = 'WEBPAGE' and + item_restrict = %d ) or ( service = 'PDL' and item_restrict = %d )) $sql_options $revision limit 1", intval($u[0]['channel_id']), dbesc($page_id), - intval(ITEM_WEBPAGE) + intval(ITEM_WEBPAGE), + intval(ITEM_PDL) ); if(! $r) { @@ -83,7 +84,12 @@ function page_init(&$a) { return; } - if($r[0]['layout_mid']) { + if($r[0]['item_restrict'] == ITEM_PDL) { + require_once('include/comanche.php'); + comanche_parser(get_app(),$r[0]['body']); + get_app()->pdl = $r[0]['body']; + } + elseif($r[0]['layout_mid']) { $l = q("select body from item where mid = '%s' and uid = %d limit 1", dbesc($r[0]['layout_mid']), intval($u[0]['channel_id']) @@ -98,8 +104,6 @@ function page_init(&$a) { $a->data['webpage'] = $r; - - } @@ -111,17 +115,11 @@ function page_content(&$a) { if(! $r) return; - // logger('layout: ' . print_r($a->layout,true)); - - // Use of widgets should be determined by Comanche, but we don't have it on system pages yet, so... - - // I recommend we now get rid of this bit - it's quite a hack to work around... - mike - - if ($perms['write_pages']) { - $chan = $a->channel['channel_id']; - $who = $channel_address; - $which = $r[0]['id']; - $o .= writepages_widget($who,$which); + if($r[0]['item_restrict'] == ITEM_PDL) { + $r[0]['body'] = t('Ipsum Lorem'); + $r[0]['mimetype'] = 'text/plain'; + $r[0]['title'] = ''; + } xchan_query($r); -- cgit v1.2.3 From 834044b15bf4cd3f436f065449cbc0ed76b4de93 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 15 Apr 2015 09:20:27 +0200 Subject: title=>name --- include/conversation.php | 2 +- view/tpl/jot.tpl | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 67f3afde0..05898cfce 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1171,7 +1171,7 @@ function status_editor($a, $x, $popup = false) { '$action' => $a->get_baseurl(true) . '/item', '$share' => (x($x,'button') ? $x['button'] : t('Share')), '$webpage' => $webpage, - '$placeholdpagetitle' => ((x($x,'ptlabel')) ? $x['ptlabel'] : t('Page link title')), + '$placeholdpagetitle' => ((x($x,'ptlabel')) ? $x['ptlabel'] : t('Page link name')), '$pagetitle' => (x($x,'pagetitle') ? $x['pagetitle'] : ''), '$id_select' => $id_select, '$id_seltext' => t('Post as'), diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index ed1d1e35f..927b3a5b9 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -19,6 +19,11 @@ {{$id_seltext}} {{$id_select}} {{/if}} + {{if $webpage}} + + {{/if}} @@ -27,11 +32,6 @@ {{/if}} - {{if $webpage}} - - {{/if}}
-- cgit v1.2.3
{{$pagelink_txt}}