From c759ee55e198a6dd2b1e7691b3d3779394441d2d Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 29 May 2014 20:26:33 +0200 Subject: [PATCH 1/5] Better handling of app.net feeds. --- include/items.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 94285e61ba..a2ee14414d 100755 --- a/include/items.php +++ b/include/items.php @@ -425,7 +425,7 @@ function get_atom_elements($feed, $item, $contact = array()) { $res = array(); $author = $item->get_author(); - if($author) { + if($author) { $res['author-name'] = unxmlify($author->get_name()); $res['author-link'] = unxmlify($author->get_link()); } @@ -438,6 +438,12 @@ function get_atom_elements($feed, $item, $contact = array()) { $res['body'] = unxmlify($item->get_content()); $res['plink'] = unxmlify($item->get_link(0)); + if (isset($contact["network"]) AND ($contact["network"] == NETWORK_FEED) AND strstr($res['plink'], ".app.net/")) { + logger("get_atom_elements: detected app.net posting: ".print_r($res, true), LOGGER_DEBUG); + $res['title'] = ""; + $res['body'] = nl2br($res['body']); + } + // removing the content of the title if its identically to the body // This helps with auto generated titles e.g. from tumblr if (title_is_body($res["title"], $res["body"])) @@ -860,6 +866,9 @@ function get_atom_elements($feed, $item, $contact = array()) { $res["title"] = ""; } elseif (isset($contact["network"]) AND ($contact["network"] == NETWORK_OSTATUS)) $res["body"] = add_page_info_to_body($res["body"]); + elseif (isset($contact["network"]) AND ($contact["network"] == NETWORK_FEED) AND strstr($res['plink'], ".app.net/")) { + $res["body"] = add_page_info_to_body($res["body"]); + } $arr = array('feed' => $feed, 'item' => $item, 'result' => $res); From b0df06dd726a9b287f3ea87e151dd6823a69cb75 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 29 May 2014 20:27:06 +0200 Subject: [PATCH 2/5] Vier: When clicking on the reply button, the focus now automatically changes to the textarea. --- view/templates/head.tpl | 1 + view/theme/vier/css/font2.css | 2 +- view/theme/vier/templates/wall_thread.tpl | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/view/templates/head.tpl b/view/templates/head.tpl index 589a7db5e2..f1f6b55052 100644 --- a/view/templates/head.tpl +++ b/view/templates/head.tpl @@ -47,6 +47,7 @@ $("#comment-edit-text-" + id).value = ''; $("#comment-edit-text-" + id).addClass("comment-edit-text-full"); $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); + $("#comment-edit-text-" + id).focus(); $("#mod-cmnt-wrap-" + id).show(); openMenu("comment-edit-submit-wrapper-" + id); return true; diff --git a/view/theme/vier/css/font2.css b/view/theme/vier/css/font2.css index 47706703cf..a0afe8c045 100644 --- a/view/theme/vier/css/font2.css +++ b/view/theme/vier/css/font2.css @@ -51,7 +51,7 @@ display: inline-block; text-decoration: inherit; vertical-align: top; - font-size: 1.3333333333333333em; + font-size: 1.2em; } a .icon { display: inline-block; diff --git a/view/theme/vier/templates/wall_thread.tpl b/view/theme/vier/templates/wall_thread.tpl index 049ae18474..7363032d82 100644 --- a/view/theme/vier/templates/wall_thread.tpl +++ b/view/theme/vier/templates/wall_thread.tpl @@ -99,7 +99,7 @@ {{if $item.threaded}} {{/if}} {{if $item.comment}} - + {{/if}} {{if $item.vote}} {{if $item.vote.like}} From 00b8355ad5445a63d6821bbabd259337fa2454b9 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 29 May 2014 22:26:03 +0200 Subject: [PATCH 3/5] The number of comments per post are now editable. --- mod/admin.php | 9 ++++++--- view/templates/admin_site.tpl | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index 7cc5694e5f..cee2523932 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -355,13 +355,14 @@ function admin_page_site_post(&$a){ $use_fulltext_engine = ((x($_POST,'use_fulltext_engine')) ? True : False); $itemcache = ((x($_POST,'itemcache')) ? notags(trim($_POST['itemcache'])) : ''); $itemcache_duration = ((x($_POST,'itemcache_duration')) ? intval($_POST['itemcache_duration']) : 0); + $max_comments = ((x($_POST,'max_comments')) ? intval($_POST['max_comments']) : 0); $lockpath = ((x($_POST,'lockpath')) ? notags(trim($_POST['lockpath'])) : ''); $temppath = ((x($_POST,'temppath')) ? notags(trim($_POST['temppath'])) : ''); $basepath = ((x($_POST,'basepath')) ? notags(trim($_POST['basepath'])) : ''); $singleuser = ((x($_POST,'singleuser')) ? notags(trim($_POST['singleuser'])) : ''); if($ssl_policy != intval(get_config('system','ssl_policy'))) { if($ssl_policy == SSL_POLICY_FULL) { - q("update `contact` set + q("update `contact` set `url` = replace(`url` , 'http:' , 'https:'), `photo` = replace(`photo` , 'http:' , 'https:'), `thumb` = replace(`thumb` , 'http:' , 'https:'), @@ -477,6 +478,7 @@ function admin_page_site_post(&$a){ set_config('system','use_fulltext_engine', $use_fulltext_engine); set_config('system','itemcache', $itemcache); set_config('system','itemcache_duration', $itemcache_duration); + set_config('system','max_comments', $max_comments); set_config('system','lockpath', $lockpath); set_config('system','temppath', $temppath); set_config('system','basepath', $basepath); @@ -629,12 +631,13 @@ function admin_page_site(&$a) { '$suppress_language' => array('suppress_language', t("Suppress Language"), get_config('system','suppress_language'), t("Suppress language information in meta information about a posting.")), '$itemcache' => array('itemcache', t("Path to item cache"), get_config('system','itemcache'), "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).")), + '$max_comments' => array('max_comments', t("Maximum numbers of comments per post"), get_config('system','max_comments'), t("How much comments should be shown for each post? Default value is 100.")), '$lockpath' => array('lockpath', t("Path for lock file"), get_config('system','lockpath'), "The lock file is used to avoid multiple pollers at one time. Only define a folder here."), '$temppath' => array('temppath', t("Temp path"), get_config('system','temppath'), "If you have a restricted system where the webserver can't access the system temp path, enter another path here."), '$basepath' => array('basepath', t("Base path to installation"), get_config('system','basepath'), "If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."), - + '$relocate_url' => array('relocate_url', t("New base url"), $a->get_baseurl(), "Change base url for this server. Sends relocate message to all DFRN contacts of all users."), - + '$form_security_token' => get_form_security_token("admin_site"), )); diff --git a/view/templates/admin_site.tpl b/view/templates/admin_site.tpl index 6791fb87f3..835b027fe8 100644 --- a/view/templates/admin_site.tpl +++ b/view/templates/admin_site.tpl @@ -111,6 +111,7 @@ {{include file="field_checkbox.tpl" field=$use_fulltext_engine}} {{include file="field_input.tpl" field=$itemcache}} {{include file="field_input.tpl" field=$itemcache_duration}} + {{include file="field_input.tpl" field=$max_comments}}
From 1fdfd614f011e406f1590ff38f07f2c87c07484d Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 29 May 2014 22:56:04 +0200 Subject: [PATCH 4/5] Vier: Make the smiley button look better integrated into the theme. --- view/theme/vier/style.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index 6563be23e0..56fcb40855 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -1728,6 +1728,13 @@ h2 { margin-left: 15px; cursor: pointer; } +#profile-smiley-wrapper { + float: left; + margin-left: 15px; + cursor: pointer; + margin-top: 3px; + height: 10px; +} #jot-perms-icon { float: right; margin-left: 15px; From 6a28ae8b524176e1342d712c4bbd8011b9c24a2f Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 30 May 2014 01:02:32 +0200 Subject: [PATCH 5/5] Just some better handling of tracker variables (url encoding) --- include/network.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/network.php b/include/network.php index 79843a3322..166f911680 100644 --- a/include/network.php +++ b/include/network.php @@ -1126,9 +1126,20 @@ function original_url($url, $depth=1, $fetchbody = false) { if (in_array($param, array("utm_source", "utm_medium", "utm_term", "utm_content", "utm_campaign", "wt_mc", "pk_campaign", "pk_kwd", "mc_cid", "mc_eid", "fb_action_ids", "fb_action_types", "fb_ref", + "awesm", "woo_campaign", "woo_source", "woo_medium", "woo_content", "woo_term"))) { + + $pair = $param."=".urlencode($value); + $url = str_replace($pair, "", $url); + + // Second try: if the url isn't encoded completely + $pair = $param."=".str_replace(" ", "+", $value); + $url = str_replace($pair, "", $url); + + // Third try: Maybey the url isn't encoded at all $pair = $param."=".$value; $url = str_replace($pair, "", $url); + $url = str_replace(array("?&", "&&"), array("?", ""), $url); }