diff --git a/boot.php b/boot.php index 139564ec55..3a9e8c3e72 100644 --- a/boot.php +++ b/boot.php @@ -1255,6 +1255,10 @@ if(! function_exists('info')) { */ function info($s) { $a = get_app(); + + if (local_user() AND get_pconfig(local_user(),'system','ignore_info')) + return; + if(! x($_SESSION,'sysmsg_info')) $_SESSION['sysmsg_info'] = array(); if($a->interactive) $_SESSION['sysmsg_info'][] = $s; diff --git a/images/dreamwidth.png b/images/dreamwidth.png new file mode 100644 index 0000000000..fe39b962ee Binary files /dev/null and b/images/dreamwidth.png differ diff --git a/images/insanejournal.gif b/images/insanejournal.gif new file mode 100644 index 0000000000..1c045aece3 Binary files /dev/null and b/images/insanejournal.gif differ diff --git a/include/diaspora.php b/include/diaspora.php index 4db8ea321b..3673b1fc2e 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -2309,26 +2309,40 @@ function diaspora_send_status($item,$owner,$contact,$public_batch = false) { require_once('include/datetime.php'); $created = datetime_convert('UTC','UTC',$item['created'],'Y-m-d H:i:s \U\T\C'); - // To-Do // Detect a share element and do a reshare // see: https://github.com/Raven24/diaspora-federation/blob/master/lib/diaspora-federation/entities/reshare.rb - $tpl = get_markup_template('diaspora_post.tpl'); - $msg = replace_macros($tpl, array( - '$body' => $body, - '$guid' => $item['guid'], - '$handle' => xmlify($myaddr), - '$public' => $public, - '$created' => $created, - '$provider' => $item["app"] - )); + if (!$item['private'] AND ($ret = diaspora_is_reshare($item["body"]))) { + $tpl = get_markup_template('diaspora_reshare.tpl'); + $msg = replace_macros($tpl, array( + '$root_handle' => xmlify($ret['root_handle']), + '$root_guid' => $ret['root_guid'], + '$guid' => $item['guid'], + '$handle' => xmlify($myaddr), + '$public' => $public, + '$created' => $created, + '$provider' => $item["app"] + )); + } else { + $tpl = get_markup_template('diaspora_post.tpl'); + $msg = replace_macros($tpl, array( + '$body' => $body, + '$guid' => $item['guid'], + '$handle' => xmlify($myaddr), + '$public' => $public, + '$created' => $created, + '$provider' => $item["app"] + )); + } - logger('diaspora_send_status: ' . $owner['username'] . ' -> ' . $contact['name'] . ' base message: ' . $msg, LOGGER_DATA); + logger('diaspora_send_status: '.$owner['username'].' -> '.$contact['name'].' base message: '.$msg, LOGGER_DATA); $slap = 'xml=' . urlencode(urlencode(diaspora_msg_build($msg,$owner,$contact,$owner['uprvkey'],$contact['pubkey'],$public_batch))); //$slap = 'xml=' . urlencode(diaspora_msg_build($msg,$owner,$contact,$owner['uprvkey'],$contact['pubkey'],$public_batch)); $return_code = diaspora_transmit($owner,$contact,$slap,$public_batch); + logger('diaspora_send_status: guid: '.$item['guid'].' result '.$return_code, LOGGER_DEBUG); + if(count($images)) { diaspora_send_images($item,$owner,$contact,$images,$public_batch); } @@ -2336,6 +2350,53 @@ function diaspora_send_status($item,$owner,$contact,$public_batch = false) { return $return_code; } +function diaspora_is_reshare($body) { + $body = trim($body); + + // Skip if it isn't a pure repeated messages + // Does it start with a share? + if (strpos($body, "[share") > 0) + return(false); + + // Does it end with a share? + if (strlen($body) > (strrpos($body, "[/share]") + 8)) + return(false); + + $attributes = preg_replace("/\[share(.*?)\]\s?(.*?)\s?\[\/share\]\s?/ism","$1",$body); + // Skip if there is no shared message in there + if ($body == $attributes) + return(false); + + $profile = ""; + preg_match("/profile='(.*?)'/ism", $attributes, $matches); + if ($matches[1] != "") + $profile = $matches[1]; + + preg_match('/profile="(.*?)"/ism', $attributes, $matches); + if ($matches[1] != "") + $profile = $matches[1]; + + $ret= array(); + + $ret["root_handle"] = preg_replace("=https?://(.*)/u/(.*)=ism", "$2@$1", $profile); + if (($ret["root_handle"] == $profile) OR ($ret["root_handle"] == "")) + return(false); + + $link = ""; + preg_match("/link='(.*?)'/ism", $attributes, $matches); + if ($matches[1] != "") + $link = $matches[1]; + + preg_match('/link="(.*?)"/ism', $attributes, $matches); + if ($matches[1] != "") + $link = $matches[1]; + + $ret["root_guid"] = preg_replace("=https?://(.*)/posts/(.*)=ism", "$2", $link); + if (($ret["root_guid"] == $link) OR ($ret["root_guid"] == "")) + return(false); + + return($ret); +} function diaspora_send_images($item,$owner,$contact,$images,$public_batch = false) { $a = get_app(); diff --git a/mod/delegate.php b/mod/delegate.php index 8c50318590..dd9caba252 100644 --- a/mod/delegate.php +++ b/mod/delegate.php @@ -117,6 +117,9 @@ function delegate_content(&$a) { if(! in_array($rr['uid'],$uids)) $potentials[] = $rr; + require_once("mod/settings.php"); + settings_init($a); + $o = replace_macros(get_markup_template('delegate.tpl'),array( '$header' => t('Delegate Page Management'), '$base' => $a->get_baseurl(), @@ -136,4 +139,4 @@ function delegate_content(&$a) { return $o; -} \ No newline at end of file +} diff --git a/mod/settings.php b/mod/settings.php index c86ca69bb9..2519928b6d 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -265,6 +265,7 @@ function settings_post(&$a) { $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : $a->user['theme']); $mobile_theme = ((x($_POST,'mobile_theme')) ? notags(trim($_POST['mobile_theme'])) : ''); $nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0); + $noinfo = ((x($_POST,'noinfo')) ? intval($_POST['noinfo']) : 0); $infinite_scroll = ((x($_POST,'infinite_scroll')) ? intval($_POST['infinite_scroll']) : 0); $browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0); $browser_update = $browser_update * 1000; @@ -287,6 +288,7 @@ function settings_post(&$a) { set_pconfig(local_user(),'system','itemspage_network', $itemspage_network); set_pconfig(local_user(),'system','itemspage_mobile_network', $itemspage_mobile_network); set_pconfig(local_user(),'system','no_smilies',$nosmile); + set_pconfig(local_user(),'system','ignore_info',$noinfo); set_pconfig(local_user(),'system','infinite_scroll',$infinite_scroll); @@ -850,6 +852,9 @@ function settings_content(&$a) { $nosmile = get_pconfig(local_user(),'system','no_smilies'); $nosmile = (($nosmile===false)? '0': $nosmile); // default if not set: 0 + $noinfo = get_pconfig(local_user(),'system','ignore_info'); + $noinfo = (($noinfo===false)? '0': $noinfo); // default if not set: 0 + $infinite_scroll = get_pconfig(local_user(),'system','infinite_scroll'); $infinite_scroll = (($infinite_scroll===false)? '0': $infinite_scroll); // default if not set: 0 @@ -873,6 +878,7 @@ function settings_content(&$a) { '$itemspage_network' => array('itemspage_network', t("Number of items to display per page:"), $itemspage_network, t('Maximum of 100 items')), '$itemspage_mobile_network' => array('itemspage_mobile_network', t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, t('Maximum of 100 items')), '$nosmile' => array('nosmile', t("Don't show emoticons"), $nosmile, ''), + '$noinfo' => array('noinfo', t("Don't show notices"), $noinfo, ''), '$infinite_scroll' => array('infinite_scroll', t("Infinite scroll"), $infinite_scroll, ''), '$theme_config' => $theme_config, diff --git a/mod/uexport.php b/mod/uexport.php index bad924d8e8..a44620a976 100644 --- a/mod/uexport.php +++ b/mod/uexport.php @@ -3,19 +3,23 @@ function uexport_init(&$a){ if(! local_user()) killme(); - + + require_once("mod/settings.php"); + settings_init($a); + +/* $tabs = array( array( 'label' => t('Account settings'), 'url' => $a->get_baseurl(true).'/settings', 'selected' => '', - ), + ), array( 'label' => t('Display settings'), 'url' => $a->get_baseurl(true).'/settings/display', 'selected' =>'', - ), - + ), + array( 'label' => t('Connector settings'), 'url' => $a->get_baseurl(true).'/settings/connectors', @@ -42,17 +46,18 @@ function uexport_init(&$a){ 'selected' => '' ) ); - + $tabtpl = get_markup_template("generic_links_widget.tpl"); $a->page['aside'] = replace_macros($tabtpl, array( '$title' => t('Settings'), '$class' => 'settings-widget', '$items' => $tabs, )); +*/ } function uexport_content(&$a){ - + if ($a->argc > 1) { header("Content-type: application/json"); header('Content-Disposition: attachment; filename="'.$a->user['nickname'].'.'.$a->argv[1].'"'); @@ -73,15 +78,15 @@ function uexport_content(&$a){ array('/uexport/backup',t('Export all'),t('Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account (photos are not exported)')), ); call_hooks('uexport_options', $options); - + $tpl = get_markup_template("uexport.tpl"); return replace_macros($tpl, array( '$baseurl' => $a->get_baseurl(), '$title' => t('Export personal data'), '$options' => $options )); - - + + } function _uexport_multirow($query) { @@ -117,7 +122,7 @@ function uexport_account($a){ $user = _uexport_row( sprintf( "SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval(local_user()) ) ); - + $contact = _uexport_multirow( sprintf( "SELECT * FROM `contact` WHERE `uid` = %d ",intval(local_user()) ) ); @@ -139,7 +144,7 @@ function uexport_account($a){ $group = _uexport_multirow( sprintf( "SELECT * FROM `group` WHERE uid = %d",intval(local_user()) ) ); - + $group_member = _uexport_multirow( sprintf( "SELECT * FROM `group_member` WHERE uid = %d",intval(local_user()) ) ); @@ -195,4 +200,4 @@ function uexport_all(&$a) { echo json_encode($output)."\n"; } -} \ No newline at end of file +} diff --git a/view/global.css b/view/global.css index 0191c7d7c3..b165cbd4f3 100644 --- a/view/global.css +++ b/view/global.css @@ -1,10 +1,14 @@ /* List of social Networks */ -img.connector { +img.connector, img.connector-disabled { height: 40px; margin-right: 10px; border-radius: 10px; } +img.connector-disabled { + opacity: 0.5; +} + h3.connector { display: inline-block; vertical-align: bottom; diff --git a/view/templates/comment_item.tpl b/view/templates/comment_item.tpl index caf98168d0..8cc524283e 100644 --- a/view/templates/comment_item.tpl +++ b/view/templates/comment_item.tpl @@ -34,7 +34,7 @@
diff --git a/view/templates/diaspora_reshare.tpl b/view/templates/diaspora_reshare.tpl new file mode 100644 index 0000000000..c2b4bf7744 --- /dev/null +++ b/view/templates/diaspora_reshare.tpl @@ -0,0 +1,18 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} + + + + {{$root_handle}} + {{$root_guid}} + {{$guid}} + {{$handle}} + {{$public}} + {{$created}} + {{$provider}} + + + diff --git a/view/templates/field_themeselect.tpl b/view/templates/field_themeselect.tpl index cde744594b..4736235815 100644 --- a/view/templates/field_themeselect.tpl +++ b/view/templates/field_themeselect.tpl @@ -3,12 +3,12 @@ * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN * *}} - + {{if $field.5}}{{/if}}
{{$field.3}} -
+ {{if $field.5}}
{{/if}}
diff --git a/view/templates/jot.tpl b/view/templates/jot.tpl index bd9902159c..b1c121e352 100644 --- a/view/templates/jot.tpl +++ b/view/templates/jot.tpl @@ -59,7 +59,8 @@ {{$bang}} - {{$preview}} + + {{if $preview}}{{/if}}
diff --git a/view/templates/settings_display.tpl b/view/templates/settings_display.tpl index 5da575049f..a135842cf3 100644 --- a/view/templates/settings_display.tpl +++ b/view/templates/settings_display.tpl @@ -14,6 +14,7 @@ {{include file="field_input.tpl" field=$itemspage_mobile_network}} {{include file="field_input.tpl" field=$ajaxint}} {{include file="field_checkbox.tpl" field=$nosmile}} +{{include file="field_checkbox.tpl" field=$noinfo}} {{include file="field_checkbox.tpl" field=$infinite_scroll}} diff --git a/view/templates/settings_oauth_edit.tpl b/view/templates/settings_oauth_edit.tpl index e3960bf75f..0b55b6b268 100644 --- a/view/templates/settings_oauth_edit.tpl +++ b/view/templates/settings_oauth_edit.tpl @@ -16,7 +16,7 @@
- +
diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index 2f05b07e08..5e8d97418c 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -727,6 +727,7 @@ nav #nav-messages-linkmenu.selected, nav #nav-user-linklabel.selected, nav #nav-apps-link.selected { background-color: #364e59; + border-bottom-style: none; } /* nav #nav-community-link { */ @@ -1424,8 +1425,9 @@ h2 { /* width: 700px; */ width: 100%; padding: 0; - margin: 10px 0; + margin: 10px 0px 0px 0px; border-bottom: 0px; + box-shadow: none; } .wall-item-bottom .comment-edit-preview { @@ -1926,12 +1928,12 @@ ul.tabs a { margin-bottom: 10px; } -div.pager, .birthday-notice, #jot-preview-link, .comment-edit-submit-wrapper .fakelink { +div.pager, .birthday-notice, .comment-edit-submit-wrapper .fakelink { padding: 2px 7px 2px 7px; color: black; } -div.pager, .birthday-notice, ul.tabs a, #jot-preview-link, .comment-edit-submit-wrapper .fakelink { +div.pager, .birthday-notice, ul.tabs a, .comment-edit-submit-wrapper .fakelink { border: 1px solid lightgray; background: #F2F2F2; margin-top: 2px; @@ -1942,11 +1944,11 @@ ul.tabs a:hover { color: #333; } -#event-notice:hover, #birthday-notice:hover, ul.tabs li .active, #jot-preview-link:hover, .comment-edit-submit-wrapper .fakelink:hover { +#event-notice:hover, #birthday-notice:hover, ul.tabs li .active, .comment-edit-submit-wrapper .fakelink:hover { color: black; } -ul.tabs a:hover, #event-notice:hover, #birthday-notice:hover, ul.tabs li .active, #jot-preview-link:hover, .comment-edit-submit-wrapper .fakelink:hover { +ul.tabs a:hover, #event-notice:hover, #birthday-notice:hover, ul.tabs li .active, .comment-edit-submit-wrapper .fakelink:hover { background-color: #e5e5e5; text-decoration: none; border: 1px solid darkgray; diff --git a/view/theme/vier/templates/comment_item.tpl b/view/theme/vier/templates/comment_item.tpl index b683f12424..7cbc02e060 100644 --- a/view/theme/vier/templates/comment_item.tpl +++ b/view/theme/vier/templates/comment_item.tpl @@ -46,7 +46,8 @@ - {{$preview}} + {{if $preview}}{{/if}} + diff --git a/view/theme/vier/templates/nav.tpl b/view/theme/vier/templates/nav.tpl index fb3483d446..9254bbccc6 100644 --- a/view/theme/vier/templates/nav.tpl +++ b/view/theme/vier/templates/nav.tpl @@ -42,12 +42,12 @@