From 39386ded36c666ff072be92cdead1a79eddd1b89 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 27 Feb 2017 21:26:37 +0000 Subject: [PATCH 1/2] "old_share" is removed --- include/api.php | 22 +++++++++------------- mod/admin.php | 3 --- mod/share.php | 26 ++++++++------------------ view/templates/admin_site.tpl | 1 - 4 files changed, 17 insertions(+), 35 deletions(-) diff --git a/include/api.php b/include/api.php index d7fa1d587..701e527cc 100644 --- a/include/api.php +++ b/include/api.php @@ -1686,20 +1686,16 @@ use \Friendica\Core\Config; ); if ($r[0]['body'] != "") { - if (!intval(get_config('system','old_share'))) { - if (strpos($r[0]['body'], "[/share]") !== false) { - $pos = strpos($r[0]['body'], "[share"); - $post = substr($r[0]['body'], $pos); - } 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 .= $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']; + if (strpos($r[0]['body'], "[/share]") !== false) { + $pos = strpos($r[0]['body'], "[share"); + $post = substr($r[0]['body'], $pos); + } 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 .= $r[0]['body']; + $post .= "[/share]"; + } + $_REQUEST['body'] = $post; $_REQUEST['profile_uid'] = api_user(); $_REQUEST['type'] = 'wall'; $_REQUEST['api_source'] = true; diff --git a/mod/admin.php b/mod/admin.php index 147513083..5cfeeb376 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -649,7 +649,6 @@ function admin_page_site_post(App $a) { $diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? True : False); $ssl_policy = ((x($_POST,'ssl_policy')) ? intval($_POST['ssl_policy']) : 0); $force_ssl = ((x($_POST,'force_ssl')) ? True : False); - $old_share = ((x($_POST,'old_share')) ? True : False); $hide_help = ((x($_POST,'hide_help')) ? True : False); $suppress_language = ((x($_POST,'suppress_language')) ? 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('system','force_ssl', $force_ssl); - set_config('system','old_share', $old_share); set_config('system','hide_help', $hide_help); set_config('system','use_fulltext_engine', $use_fulltext_engine); 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), '$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.")), - '$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.")), '$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.")), diff --git a/mod/share.php b/mod/share.php index 928ccdef2..36a4d5945 100644 --- a/mod/share.php +++ b/mod/share.php @@ -15,28 +15,18 @@ function share_init(App $a) { if(! dbm::is_result($r) || ($r[0]['private'] == 1)) killme(); - if (!intval(get_config('system','old_share'))) { - if (strpos($r[0]['body'], "[/share]") !== false) { - $pos = strpos($r[0]['body'], "[share"); - $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]"; - } + if (strpos($r[0]['body'], "[/share]") !== false) { + $pos = strpos($r[0]['body'], "[share"); + $o = substr($r[0]['body'], $pos); } 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']) - $o .= '[b]' . $r[0]['title'] . '[/b]' . "\n"; - $o .= $r[0]['body'] . "\n" ; - - $o .= (($r[0]['plink']) ? '[url=' . $r[0]['plink'] . ']' . t('link') . '[/url]' . "\n" : ''); + $o .= '[b]'.$r[0]['title'].'[/b]'."\n"; + $o .= $r[0]['body']; + $o.= "[/share]"; } + echo $o; killme(); } diff --git a/view/templates/admin_site.tpl b/view/templates/admin_site.tpl index 2edfddb88..e778b7ad4 100644 --- a/view/templates/admin_site.tpl +++ b/view/templates/admin_site.tpl @@ -56,7 +56,6 @@ {{include file="field_select.tpl" field=$theme_mobile}} {{include file="field_select.tpl" field=$ssl_policy}} {{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_select.tpl" field=$singleuser}}
From cc86d8ea14e4c1a6c57945ee248a659a1003df58 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 27 Feb 2017 23:59:05 +0000 Subject: [PATCH 2/2] Language data won't be displayed anymore (it was experimental stuff) --- mod/admin.php | 3 --- object/Item.php | 27 --------------------------- view/templates/admin_site.tpl | 1 - 3 files changed, 31 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index 147513083..4b8182dfe 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -651,7 +651,6 @@ function admin_page_site_post(App $a) { $force_ssl = ((x($_POST,'force_ssl')) ? True : False); $old_share = ((x($_POST,'old_share')) ? True : False); $hide_help = ((x($_POST,'hide_help')) ? True : False); - $suppress_language = ((x($_POST,'suppress_language')) ? True : False); $suppress_tags = ((x($_POST,'suppress_tags')) ? True : False); $use_fulltext_engine = ((x($_POST,'use_fulltext_engine')) ? True : False); $itemcache = ((x($_POST,'itemcache')) ? notags(trim($_POST['itemcache'])) : ''); @@ -734,7 +733,6 @@ function admin_page_site_post(App $a) { set_config('config','sitename',$sitename); set_config('config','hostname',$hostname); set_config('config','sender_email', $sender_email); - set_config('system','suppress_language',$suppress_language); set_config('system','suppress_tags',$suppress_tags); set_config('system','shortcut_icon',$shortcut_icon); set_config('system','touch_icon',$touch_icon); @@ -1052,7 +1050,6 @@ function admin_page_site(App $a) { '$nodeinfo' => array('nodeinfo', t("Publish server information"), get_config('system','nodeinfo'), t("If enabled, general server and usage data will be published. The data contains the name and version of the server, number of users with public profiles, number of posts and the activated protocols and connectors. See the-federation.info for details.")), '$use_fulltext_engine' => array('use_fulltext_engine', t("Use MySQL full text engine"), get_config('system','use_fulltext_engine'), t("Activates the full text engine. Speeds up search - but can only search for four and more characters.")), - '$suppress_language' => array('suppress_language', t("Suppress Language"), get_config('system','suppress_language'), t("Suppress language information in meta information about a posting.")), '$suppress_tags' => array('suppress_tags', t("Suppress Tags"), get_config('system','suppress_tags'), t("Suppress showing a list of hashtags at the end of the posting.")), '$itemcache' => array('itemcache', t("Path to item cache"), get_config('system','itemcache'), t("The item caches buffers generated bbcode and external images.")), '$itemcache_duration' => array('itemcache_duration', t("Cache duration in seconds"), get_config('system','itemcache_duration'), t("How long should the cache files be hold? Default value is 86400 seconds (One day). To disable the item cache, set the value to -1.")), diff --git a/object/Item.php b/object/Item.php index d95af3419..b693520b9 100644 --- a/object/Item.php +++ b/object/Item.php @@ -287,32 +287,6 @@ class Item extends BaseObject { localize_item($item); - if ($item["postopts"] and !get_config("system", "suppress_language")) { - //$langdata = explode(";", $item["postopts"]); - //$langstr = substr($langdata[0], 5)." (".round($langdata[1]*100, 1)."%)"; - $langstr = ""; - if (substr($item["postopts"], 0, 5) == "lang=") { - $postopts = substr($item["postopts"], 5); - - $languages = explode(":", $postopts); - - if (sizeof($languages) == 1) { - $languages = array(); - $languages[] = $postopts; - } - - foreach ($languages as $language) { - $langdata = explode(";", $language); - if ($langstr != "") { - $langstr .= ", "; - } - - //$langstr .= $langdata[0]." (".round($langdata[1]*100, 1)."%)"; - $langstr .= round($langdata[1]*100, 1)."% ".$langdata[0]; - } - } - } - $body = prepare_body($item,true); list($categories, $folders) = get_cats_and_terms($item); @@ -420,7 +394,6 @@ class Item extends BaseObject { 'previewing' => ($conv->is_preview() ? ' preview ' : ''), 'wait' => t('Please wait'), 'thread_level' => $thread_level, - 'postopts' => $langstr, 'edited' => $edited, 'network' => $item["item_network"], 'network_name' => network_to_name($item['item_network'], $profile_link), diff --git a/view/templates/admin_site.tpl b/view/templates/admin_site.tpl index 2edfddb88..9c02131f0 100644 --- a/view/templates/admin_site.tpl +++ b/view/templates/admin_site.tpl @@ -132,7 +132,6 @@ {{include file="field_input.tpl" field=$lockpath}} {{include file="field_input.tpl" field=$temppath}} {{include file="field_input.tpl" field=$basepath}} - {{include file="field_checkbox.tpl" field=$suppress_language}} {{include file="field_checkbox.tpl" field=$suppress_tags}} {{include file="field_checkbox.tpl" field=$nodeinfo}} {{include file="field_input.tpl" field=$embedly}}