Merge pull request #1003 from annando/master

app.net feeds, number of comments and better handling of the reply button in "vier"
This commit is contained in:
fabrixxm 2014-05-30 09:38:26 +02:00
commit 5fb971d060
8 changed files with 37 additions and 5 deletions

View file

@ -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);

View file

@ -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);
}

View file

@ -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:'),
@ -478,6 +479,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);
@ -630,12 +632,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"),
));

View file

@ -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}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>
</form>

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -99,7 +99,7 @@
{{if $item.threaded}}
{{/if}}
{{if $item.comment}}
<span id="comment-{{$item.id}}" class="fakelink togglecomment" onclick="commentExpand({{$item.id}}); openClose('item-comments-{{$item.id}}');"><i class="icon-reply"></i></span>
<span id="comment-{{$item.id}}" class="fakelink togglecomment" onclick="openClose('item-comments-{{$item.id}}'); commentExpand({{$item.id}});"><i class="icon-reply"></i></span>
{{/if}}
{{if $item.vote}}
{{if $item.vote.like}}