Merge pull request #3225 from annando/1702-no_old_share

The old share option is removed
This commit is contained in:
Tobias Diekershoff 2017-03-13 07:52:38 +01:00 committed by GitHub
commit e2c515baa9
4 changed files with 17 additions and 35 deletions

View file

@ -1686,20 +1686,16 @@ use \Friendica\Core\Config;
); );
if ($r[0]['body'] != "") { if ($r[0]['body'] != "") {
if (!intval(get_config('system','old_share'))) { if (strpos($r[0]['body'], "[/share]") !== false) {
if (strpos($r[0]['body'], "[/share]") !== false) { $pos = strpos($r[0]['body'], "[share");
$pos = strpos($r[0]['body'], "[share"); $post = substr($r[0]['body'], $pos);
$post = substr($r[0]['body'], $pos); } else {
} else { $post = share_header($r[0]['author-name'], $r[0]['author-link'], $r[0]['author-avatar'], $r[0]['guid'], $r[0]['created'], $r[0]['plink']);
$post = share_header($r[0]['author-name'], $r[0]['author-link'], $r[0]['author-avatar'], $r[0]['guid'], $r[0]['created'], $r[0]['plink']);
$post .= $r[0]['body'];
$post .= "[/share]";
}
$_REQUEST['body'] = $post;
} else
$_REQUEST['body'] = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8')."[url=".$r[0]['reply_url']."]".$r[0]['reply_author']."[/url] \n".$r[0]['body'];
$post .= $r[0]['body'];
$post .= "[/share]";
}
$_REQUEST['body'] = $post;
$_REQUEST['profile_uid'] = api_user(); $_REQUEST['profile_uid'] = api_user();
$_REQUEST['type'] = 'wall'; $_REQUEST['type'] = 'wall';
$_REQUEST['api_source'] = true; $_REQUEST['api_source'] = true;

View file

@ -649,7 +649,6 @@ function admin_page_site_post(App $a) {
$diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? True : False); $diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? True : False);
$ssl_policy = ((x($_POST,'ssl_policy')) ? intval($_POST['ssl_policy']) : 0); $ssl_policy = ((x($_POST,'ssl_policy')) ? intval($_POST['ssl_policy']) : 0);
$force_ssl = ((x($_POST,'force_ssl')) ? True : False); $force_ssl = ((x($_POST,'force_ssl')) ? True : False);
$old_share = ((x($_POST,'old_share')) ? True : False);
$hide_help = ((x($_POST,'hide_help')) ? True : False); $hide_help = ((x($_POST,'hide_help')) ? True : False);
$suppress_language = ((x($_POST,'suppress_language')) ? True : False); $suppress_language = ((x($_POST,'suppress_language')) ? True : False);
$suppress_tags = ((x($_POST,'suppress_tags')) ? True : False); $suppress_tags = ((x($_POST,'suppress_tags')) ? True : False);
@ -805,7 +804,6 @@ function admin_page_site_post(App $a) {
set_config('config','private_addons', $private_addons); set_config('config','private_addons', $private_addons);
set_config('system','force_ssl', $force_ssl); set_config('system','force_ssl', $force_ssl);
set_config('system','old_share', $old_share);
set_config('system','hide_help', $hide_help); set_config('system','hide_help', $hide_help);
set_config('system','use_fulltext_engine', $use_fulltext_engine); set_config('system','use_fulltext_engine', $use_fulltext_engine);
set_config('system','itemcache', $itemcache); set_config('system','itemcache', $itemcache);
@ -996,7 +994,6 @@ function admin_page_site(App $a) {
'$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile-theme'), t("Theme for mobile devices"), $theme_choices_mobile), '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile-theme'), t("Theme for mobile devices"), $theme_choices_mobile),
'$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices), '$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices),
'$force_ssl' => array('force_ssl', t("Force SSL"), get_config('system','force_ssl'), t("Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.")), '$force_ssl' => array('force_ssl', t("Force SSL"), get_config('system','force_ssl'), t("Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.")),
'$old_share' => array('old_share', t("Old style 'Share'"), get_config('system','old_share'), t("Deactivates the bbcode element 'share' for repeating items.")),
'$hide_help' => array('hide_help', t("Hide help entry from navigation menu"), get_config('system','hide_help'), t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")), '$hide_help' => array('hide_help', t("Hide help entry from navigation menu"), get_config('system','hide_help'), t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")),
'$singleuser' => array('singleuser', t("Single user instance"), get_config('system','singleuser'), t("Make this instance multi-user or single-user for the named user"), $user_names), '$singleuser' => array('singleuser', t("Single user instance"), get_config('system','singleuser'), t("Make this instance multi-user or single-user for the named user"), $user_names),
'$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),

View file

@ -15,28 +15,18 @@ function share_init(App $a) {
if(! dbm::is_result($r) || ($r[0]['private'] == 1)) if(! dbm::is_result($r) || ($r[0]['private'] == 1))
killme(); killme();
if (!intval(get_config('system','old_share'))) { if (strpos($r[0]['body'], "[/share]") !== false) {
if (strpos($r[0]['body'], "[/share]") !== false) { $pos = strpos($r[0]['body'], "[share");
$pos = strpos($r[0]['body'], "[share"); $o = substr($r[0]['body'], $pos);
$o = substr($r[0]['body'], $pos);
} else {
$o = share_header($r[0]['author-name'], $r[0]['author-link'], $r[0]['author-avatar'], $r[0]['guid'], $r[0]['created'], $r[0]['plink']);
if($r[0]['title'])
$o .= '[b]'.$r[0]['title'].'[/b]'."\n";
$o .= $r[0]['body'];
$o.= "[/share]";
}
} else { } else {
$o = ''; $o = share_header($r[0]['author-name'], $r[0]['author-link'], $r[0]['author-avatar'], $r[0]['guid'], $r[0]['created'], $r[0]['plink']);
$o .= "\xE2\x99\xb2" . ' [url=' . $r[0]['author-link'] . ']' . $r[0]['author-name'] . '[/url]' . "\n";
if($r[0]['title']) if($r[0]['title'])
$o .= '[b]' . $r[0]['title'] . '[/b]' . "\n"; $o .= '[b]'.$r[0]['title'].'[/b]'."\n";
$o .= $r[0]['body'] . "\n" ; $o .= $r[0]['body'];
$o.= "[/share]";
$o .= (($r[0]['plink']) ? '[url=' . $r[0]['plink'] . ']' . t('link') . '[/url]' . "\n" : '');
} }
echo $o; echo $o;
killme(); killme();
} }

View file

@ -56,7 +56,6 @@
{{include file="field_select.tpl" field=$theme_mobile}} {{include file="field_select.tpl" field=$theme_mobile}}
{{include file="field_select.tpl" field=$ssl_policy}} {{include file="field_select.tpl" field=$ssl_policy}}
{{if $ssl_policy.2 == 1}}{{include file="field_checkbox.tpl" field=$force_ssl}}{{/if}} {{if $ssl_policy.2 == 1}}{{include file="field_checkbox.tpl" field=$force_ssl}}{{/if}}
{{include file="field_checkbox.tpl" field=$old_share}}
{{include file="field_checkbox.tpl" field=$hide_help}} {{include file="field_checkbox.tpl" field=$hide_help}}
{{include file="field_select.tpl" field=$singleuser}} {{include file="field_select.tpl" field=$singleuser}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit|escape:'html'}}" /></div> <div class="submit"><input type="submit" name="page_site" value="{{$submit|escape:'html'}}" /></div>