Merge branch 'master' into notify

This commit is contained in:
friendica 2011-12-12 20:13:12 -08:00
commit ed725df5f1
21 changed files with 402 additions and 291 deletions

View file

@ -9,7 +9,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '2.3.1192' );
define ( 'FRIENDICA_VERSION', '2.3.1193' );
define ( 'DFRN_PROTOCOL_VERSION', '2.22' );
define ( 'DB_UPDATE_VERSION', 1111 );
@ -422,6 +422,10 @@ class App {
}
function init_pagehead() {
$interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 40000);
if($interval < 10000)
$interval = 40000;
$this->page['title'] = $this->config['sitename'];
$tpl = file_get_contents('view/head.tpl');
$this->page['htmlhead'] = replace_macros($tpl,array(
@ -430,7 +434,8 @@ class App {
'$delitem' => t('Delete this item?'),
'$comment' => t('Comment'),
'$showmore' => t('show more'),
'$showfewer' => t('show fewer')
'$showfewer' => t('show fewer'),
'$update_interval' => $interval
));
}

View file

@ -69,14 +69,3 @@ $a->config['system']['rino_encrypt'] = true;
$a->config['system']['theme'] = 'duepuntozero';
// Addons or plugins are configured here.
// This is a comma seperated list of addons to enable. Example:
// $a->config['system']['addon'] = 'js_upload,randplace,oembed';
$a->config['system']['addon'] = 'js_upload';
// Disable oembed embedding
// This disable the conversion of [embed]$url[/embed] tag in html
// $a->config['system']['no_oembed'] = true;

View file

@ -93,12 +93,6 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) {
load_translation_table($lang);
}
/*
* Create the page head after setting the language
*
*/
$a->init_pagehead();
/**
*
@ -119,6 +113,16 @@ if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module ==
if(! x($_SESSION,'authenticated'))
header('X-Account-Management-Status: none');
/*
* Create the page head after setting the language
* and getting any auth credentials
*/
$a->init_pagehead();
if(! x($_SESSION,'sysmsg'))
$_SESSION['sysmsg'] = array();

158
js/jquery.js vendored

File diff suppressed because one or more lines are too long

View file

@ -204,15 +204,21 @@
});
}) ;
}
timer = setTimeout(NavUpdate,30000);
timer = setTimeout(NavUpdate,updateInterval);
}
function liveUpdate() {
if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; }
if(($('.comment-edit-text-full').length) || (in_progress)) {
if(livetime) {
clearTimeout(livetime);
}
livetime = setTimeout(liveUpdate, 10000);
return;
}
if(livetime != null)
livetime = null;
prev = 'live-' + src;
in_progress = true;
@ -235,7 +241,7 @@
$('.tread-wrapper',data).each(function() {
var ident = $(this).attr('id');
if($('#' + ident).length == 0) {
if($('#' + ident).length == 0 && profile_page == 1) {
$('img',this).each(function() {
$(this).attr('src',$(this).attr('dst'));
});

25
library/tiptip/README.txt Normal file
View file

@ -0,0 +1,25 @@
TipTip
*******
small modification to work with jQuery 1.6.4
(works also with jQuery 1.7b1)
*******
Copyright 2010 Drew Wilson
http://www.drewwilson.com
http://code.drewwilson.com/entry/tiptip-jquery-plugin
Version 1.3 - Updated: Mar. 23, 2010
This Plug-In will create a custom tooltip to replace the default
browser tooltip. It is extremely lightweight and very smart in
that it detects the edges of the browser window and will make sure
the tooltip stays within the current window size. As a result the
tooltip will adjust itself to be displayed above, below, to the left
or to the right depending on what is necessary to stay within the
browser window. It is completely customizable as well via CSS.
This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html

View file

@ -0,0 +1,191 @@
/*!
* TipTip
* Copyright 2010 Drew Wilson
* www.drewwilson.com
* code.drewwilson.com/entry/tiptip-jquery-plugin
*
* Version 1.3 - Updated: Mar. 23, 2010
*
* This Plug-In will create a custom tooltip to replace the default
* browser tooltip. It is extremely lightweight and very smart in
* that it detects the edges of the browser window and will make sure
* the tooltip stays within the current window size. As a result the
* tooltip will adjust itself to be displayed above, below, to the left
* or to the right depending on what is necessary to stay within the
* browser window. It is completely customizable as well via CSS.
*
* This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function($){
$.fn.tipTip = function(options) {
var defaults = {
activation: "hover",
keepAlive: false,
maxWidth: "200px",
edgeOffset: 3,
defaultPosition: "bottom",
delay: 400,
fadeIn: 200,
fadeOut: 200,
attribute: "title",
content: false, // HTML or String to fill TipTIp with
enter: function(){},
exit: function(){}
};
var opts = $.extend(defaults, options);
// Setup tip tip elements and render them to the DOM
if($("#tiptip_holder").length <= 0){
var tiptip_holder = $('<div id="tiptip_holder" style="max-width:'+ opts.maxWidth +';"></div>');
var tiptip_content = $('<div id="tiptip_content"></div>');
var tiptip_arrow = $('<div id="tiptip_arrow"></div>');
$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')));
} else {
var tiptip_holder = $("#tiptip_holder");
var tiptip_content = $("#tiptip_content");
var tiptip_arrow = $("#tiptip_arrow");
}
return this.each(function(){
var org_elem = $(this);
if(opts.content){
var org_title = opts.content;
} else {
var org_title = org_elem.attr(opts.attribute);
}
if(org_title && org_title != ""){
if(!opts.content){
org_elem.removeAttr(opts.attribute); //remove original Attribute
}
var timeout = false;
if(opts.activation == "hover"){
org_elem.hover(function(){
active_tiptip();
}, function(){
if(!opts.keepAlive){
deactive_tiptip();
}
});
if(opts.keepAlive){
tiptip_holder.hover(function(){}, function(){
deactive_tiptip();
});
}
} else if(opts.activation == "focus"){
org_elem.focus(function(){
active_tiptip();
}).blur(function(){
deactive_tiptip();
});
} else if(opts.activation == "click"){
org_elem.click(function(){
active_tiptip();
return false;
}).hover(function(){},function(){
if(!opts.keepAlive){
deactive_tiptip();
}
});
if(opts.keepAlive){
tiptip_holder.hover(function(){}, function(){
deactive_tiptip();
});
}
}
function active_tiptip(){
opts.enter.call(this);
tiptip_content.html(org_title);
tiptip_holder.hide().removeAttr("class").css("margin","0");
tiptip_arrow.removeAttr("style");
var top = parseInt(org_elem.offset()['top']);
var left = parseInt(org_elem.offset()['left']);
var org_width = parseInt(org_elem.outerWidth());
var org_height = parseInt(org_elem.outerHeight());
var tip_w = tiptip_holder.outerWidth();
var tip_h = tiptip_holder.outerHeight();
var w_compare = Math.round((org_width - tip_w) / 2);
var h_compare = Math.round((org_height - tip_h) / 2);
var marg_left = Math.round(left + w_compare);
var marg_top = Math.round(top + org_height + opts.edgeOffset);
var t_class = "";
var arrow_top = "";
var arrow_left = Math.round(tip_w - 12) / 2;
if(opts.defaultPosition == "bottom"){
t_class = "_bottom";
} else if(opts.defaultPosition == "top"){
t_class = "_top";
} else if(opts.defaultPosition == "left"){
t_class = "_left";
} else if(opts.defaultPosition == "right"){
t_class = "_right";
}
var right_compare = (w_compare + left) < parseInt($(window).scrollLeft());
var left_compare = (tip_w + left) > parseInt($(window).width());
if((right_compare && w_compare < 0) || (t_class == "_right" && !left_compare) || (t_class == "_left" && left < (tip_w + opts.edgeOffset + 5))){
t_class = "_right";
arrow_top = Math.round(tip_h - 13) / 2;
arrow_left = -12;
marg_left = Math.round(left + org_width + opts.edgeOffset);
marg_top = Math.round(top + h_compare);
} else if((left_compare && w_compare < 0) || (t_class == "_left" && !right_compare)){
t_class = "_left";
arrow_top = Math.round(tip_h - 13) / 2;
arrow_left = Math.round(tip_w);
marg_left = Math.round(left - (tip_w + opts.edgeOffset + 5));
marg_top = Math.round(top + h_compare);
}
var top_compare = (top + org_height + opts.edgeOffset + tip_h + 8) > parseInt($(window).height() + $(window).scrollTop());
var bottom_compare = ((top + org_height) - (opts.edgeOffset + tip_h + 8)) < 0;
if(top_compare || (t_class == "_bottom" && top_compare) || (t_class == "_top" && !bottom_compare)){
if(t_class == "_top" || t_class == "_bottom"){
t_class = "_top";
} else {
t_class = t_class+"_top";
}
arrow_top = tip_h;
marg_top = Math.round(top - (tip_h + 5 + opts.edgeOffset));
} else if(bottom_compare | (t_class == "_top" && bottom_compare) || (t_class == "_bottom" && !top_compare)){
if(t_class == "_top" || t_class == "_bottom"){
t_class = "_bottom";
} else {
t_class = t_class+"_bottom";
}
arrow_top = -12;
marg_top = Math.round(top + org_height + opts.edgeOffset);
}
if(t_class == "_right_top" || t_class == "_left_top"){
marg_top = marg_top + 5;
} else if(t_class == "_right_bottom" || t_class == "_left_bottom"){
marg_top = marg_top - 5;
}
if(t_class == "_left_top" || t_class == "_left_bottom"){
marg_left = marg_left + 5;
}
tiptip_arrow.css({"margin-left": arrow_left+"px", "margin-top": arrow_top+"px"});
tiptip_holder.css({"margin-left": marg_left+"px", "margin-top": marg_top+"px"}).attr("class","tip"+t_class);
if (timeout){ clearTimeout(timeout); }
timeout = setTimeout(function(){ tiptip_holder.stop(true,true).fadeIn(opts.fadeIn); }, opts.delay);
}
function deactive_tiptip(){
opts.exit.call(this);
if (timeout){ clearTimeout(timeout); }
tiptip_holder.fadeOut(opts.fadeOut);
}
}
});
}
})(jQuery);

View file

@ -1,4 +1,4 @@
/*
/*!
* TipTip
* Copyright 2010 Drew Wilson
* www.drewwilson.com
@ -10,7 +10,7 @@
* browser tooltip. It is extremely lightweight and very smart in
* that it detects the edges of the browser window and will make sure
* the tooltip stays within the current window size. As a result the
* tooltip will adjust itself to be displayed above, below, to the left
* tooltip will adjust itself to be displayed above, below, to the left
* or to the right depending on what is necessary to stay within the
* browser window. It is completely customizable as well via CSS.
*
@ -18,4 +18,4 @@
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);
(function(a){a.fn.tipTip=function(c){var g={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var e=a.extend(g,c);if(a("#tiptip_holder").length<=0){var b=a('<div id="tiptip_holder" style="max-width:'+e.maxWidth+';"></div>');var d=a('<div id="tiptip_content"></div>');var f=a('<div id="tiptip_arrow"></div>');a("body").append(b.html(d).prepend(f.html('<div id="tiptip_arrow_inner"></div>')))}else{var b=a("#tiptip_holder");var d=a("#tiptip_content");var f=a("#tiptip_arrow")}return this.each(function(){var i=a(this);if(e.content){var l=e.content}else{var l=i.attr(e.attribute)}if(l&&l!=""){if(!e.content){i.removeAttr(e.attribute)}var h=false;if(e.activation=="hover"){i.hover(function(){k()},function(){if(!e.keepAlive){j()}});if(e.keepAlive){b.hover(function(){},function(){j()})}}else{if(e.activation=="focus"){i.focus(function(){k()}).blur(function(){j()})}else{if(e.activation=="click"){i.click(function(){k();return false}).hover(function(){},function(){if(!e.keepAlive){j()}});if(e.keepAlive){b.hover(function(){},function(){j()})}}}}function k(){e.enter.call(this);d.html(l);b.hide().removeAttr("class").css("margin","0");f.removeAttr("style");var y=parseInt(i.offset()["top"]);var p=parseInt(i.offset()["left"]);var v=parseInt(i.outerWidth());var A=parseInt(i.outerHeight());var x=b.outerWidth();var s=b.outerHeight();var w=Math.round((v-x)/2);var o=Math.round((A-s)/2);var n=Math.round(p+w);var m=Math.round(y+A+e.edgeOffset);var t="";var C="";var u=Math.round(x-12)/2;if(e.defaultPosition=="bottom"){t="_bottom"}else{if(e.defaultPosition=="top"){t="_top"}else{if(e.defaultPosition=="left"){t="_left"}else{if(e.defaultPosition=="right"){t="_right"}}}}var r=(w+p)<parseInt(a(window).scrollLeft());var q=(x+p)>parseInt(a(window).width());if((r&&w<0)||(t=="_right"&&!q)||(t=="_left"&&p<(x+e.edgeOffset+5))){t="_right";C=Math.round(s-13)/2;u=-12;n=Math.round(p+v+e.edgeOffset);m=Math.round(y+o)}else{if((q&&w<0)||(t=="_left"&&!r)){t="_left";C=Math.round(s-13)/2;u=Math.round(x);n=Math.round(p-(x+e.edgeOffset+5));m=Math.round(y+o)}}var z=(y+A+e.edgeOffset+s+8)>parseInt(a(window).height()+a(window).scrollTop());var B=((y+A)-(e.edgeOffset+s+8))<0;if(z||(t=="_bottom"&&z)||(t=="_top"&&!B)){if(t=="_top"||t=="_bottom"){t="_top"}else{t=t+"_top"}C=s;m=Math.round(y-(s+5+e.edgeOffset))}else{if(B|(t=="_top"&&B)||(t=="_bottom"&&!z)){if(t=="_top"||t=="_bottom"){t="_bottom"}else{t=t+"_bottom"}C=-12;m=Math.round(y+A+e.edgeOffset)}}if(t=="_right_top"||t=="_left_top"){m=m+5}else{if(t=="_right_bottom"||t=="_left_bottom"){m=m-5}}if(t=="_left_top"||t=="_left_bottom"){n=n+5}f.css({"margin-left":u+"px","margin-top":C+"px"});b.css({"margin-left":n+"px","margin-top":m+"px"}).attr("class","tip"+t);if(h){clearTimeout(h)}h=setTimeout(function(){b.stop(true,true).fadeIn(e.fadeIn)},e.delay)}function j(){e.exit.call(this);if(h){clearTimeout(h)}b.fadeOut(e.fadeOut)}}})}})(jQuery);

View file

@ -252,12 +252,16 @@ function dfrn_request_post(&$a) {
*
* Cleanup old introductions that remain blocked.
* Also remove the contact record, but only if there is no existing relationship
*
* Do not remove email contacts as these may be awaiting email verification
*/
$r = q("SELECT `intro`.*, `intro`.`id` AS `iid`, `contact`.`id` AS `cid`, `contact`.`rel`
FROM `intro` LEFT JOIN `contact` on `intro`.`contact-id` = `contact`.`id`
WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0 AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE ");
WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0
AND `contact`.`network` != '%s'
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE ",
dbesc(NETWORK_MAIL)
);
if(count($r)) {
foreach($r as $rr) {
if(! $rr['rel']) {
@ -271,6 +275,32 @@ function dfrn_request_post(&$a) {
}
}
/**
*
* Cleanup any old email intros - which will have a greater lifetime
*/
$r = q("SELECT `intro`.*, `intro`.`id` AS `iid`, `contact`.`id` AS `cid`, `contact`.`rel`
FROM `intro` LEFT JOIN `contact` on `intro`.`contact-id` = `contact`.`id`
WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0
AND `contact`.`network` = '%s'
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 3 DAY ",
dbesc(NETWORK_MAIL)
);
if(count($r)) {
foreach($r as $rr) {
if(! $rr['rel']) {
q("DELETE FROM `contact` WHERE `id` = %d LIMIT 1",
intval($rr['cid'])
);
}
q("DELETE FROM `intro` WHERE `id` = %d LIMIT 1",
intval($rr['iid'])
);
}
}
$url = trim($_POST['dfrn_url']);
if(! strlen($url)) {
notice( t("Invalid locator") . EOL );

View file

@ -266,16 +266,6 @@ function network_content(&$a, $update = 0) {
}
// We aren't going to try and figure out at the item, group, and page
// level which items you've seen and which you haven't. If you're looking
// at the top level network page just mark everything seen.
if((! $group) && (! $cid) && (! $star)) {
$r = q("UPDATE `item` SET `unseen` = 0
WHERE `unseen` = 1 AND `uid` = %d",
intval($_SESSION['uid'])
);
}
// We don't have to deal with ACL's on this page. You're looking at everything
// that belongs to you, hence you can see all of it. We will filter by group if
@ -382,21 +372,30 @@ function network_content(&$a, $update = 0) {
}
if($update) {
$r = q("SELECT COUNT(*) AS `total`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra2
$sql_extra ",
intval($_SESSION['uid'])
);
// only setup pagination on initial page view
$pager_sql = '';
if(count($r)) {
$a->set_pager_total($r[0]['total']);
$a->set_pager_itemspage(40);
}
else {
$r = q("SELECT COUNT(*) AS `total`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra2
$sql_extra ",
intval($_SESSION['uid'])
);
if(count($r)) {
$a->set_pager_total($r[0]['total']);
$a->set_pager_itemspage(40);
}
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
}
$simple_update = (($update) ? " and `item`.`unseen` = 1 " : '');
if($nouveau) {
@ -408,13 +407,12 @@ function network_content(&$a, $update = 0) {
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
FROM `item`, `contact`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
$simple_update
AND `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra
ORDER BY `item`.`received` DESC LIMIT %d ,%d ",
intval($_SESSION['uid']),
intval($a->pager['start']),
intval($a->pager['itemspage'])
ORDER BY `item`.`received` DESC $pager_sql ",
intval($_SESSION['uid'])
);
}
@ -430,17 +428,27 @@ function network_content(&$a, $update = 0) {
// Fetch a page full of parent items for this page
$r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact_uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`parent` = `item`.`id`
$sql_extra
ORDER BY `item`.$ordering DESC LIMIT %d ,%d ",
intval(local_user()),
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
if($update) {
$r = q("SELECT distinct(`parent`) AS `item_id`, `contact`.`uid` AS `contact_uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
and `item`.`parent` in ( select parent from item where unseen = 1 )
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra ",
intval(local_user())
);
}
else {
$r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact_uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`parent` = `item`.`id`
$sql_extra
ORDER BY `item`.$ordering DESC $pager_sql ",
intval(local_user())
);
}
// Then fetch all the children of the parents that are on this page
@ -452,7 +460,7 @@ function network_content(&$a, $update = 0) {
$parents_arr[] = $rr['item_id'];
$parents_str = implode(', ', $parents_arr);
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
$items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
@ -469,12 +477,24 @@ function network_content(&$a, $update = 0) {
}
}
// We aren't going to try and figure out at the item, group, and page
// level which items you've seen and which you haven't. If you're looking
// at the top level network page just mark everything seen.
if((! $group) && (! $cid) && (! $star)) {
$r = q("UPDATE `item` SET `unseen` = 0
WHERE `unseen` = 1 AND `uid` = %d",
intval(local_user())
);
}
// Set this so that the conversation function can find out contact info for our wall-wall items
$a->page_contact = $a->contact;
$mode = (($nouveau) ? 'network-new' : 'network');
$o .= conversation($a,$r,$mode,$update);
$o .= conversation($a,$items,$mode,$update);
if(! $update) {
$o .= paginate($a);

View file

@ -154,12 +154,6 @@ function profile_content(&$a, $update = 0) {
}
if($is_owner) {
$r = q("UPDATE `item` SET `unseen` = 0
WHERE `wall` = 1 AND `unseen` = 1 AND `uid` = %d",
intval(local_user())
);
}
/**
* Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups
@ -168,33 +162,49 @@ function profile_content(&$a, $update = 0) {
$sql_extra = permissions_sql($a->profile['profile_uid'],$remote_contact,$groups);
$r = q("SELECT COUNT(*) AS `total`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1
$sql_extra ",
intval($a->profile['profile_uid'])
if($update) {
);
$r = q("SELECT distinct(parent) AS `item_id`, `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
and `item`.`parent` in (select parent from item where unseen = 1 )
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`wall` = 1
$sql_extra
ORDER BY `item`.`created` DESC",
intval($a->profile['profile_uid'])
);
if(count($r)) {
$a->set_pager_total($r[0]['total']);
$a->set_pager_itemspage(40);
}
else {
$r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1
$sql_extra
ORDER BY `item`.`created` DESC LIMIT %d ,%d ",
intval($a->profile['profile_uid']),
intval($a->pager['start']),
intval($a->pager['itemspage'])
$r = q("SELECT COUNT(*) AS `total`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1
$sql_extra ",
intval($a->profile['profile_uid'])
);
);
if(count($r)) {
$a->set_pager_total($r[0]['total']);
$a->set_pager_itemspage(40);
}
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
$r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1
$sql_extra
ORDER BY `item`.`created` DESC $pager_sql ",
intval($a->profile['profile_uid'])
);
}
$parents_arr = array();
$parents_str = '';
@ -204,7 +214,7 @@ function profile_content(&$a, $update = 0) {
$parents_arr[] = $rr['item_id'];
$parents_str = implode(', ', $parents_arr);
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
$items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, `contact`.`rel`,
`contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
@ -232,10 +242,18 @@ function profile_content(&$a, $update = 0) {
$o .= '<div id="live-profile"></div>' . "\r\n";
$o .= "<script> var profile_uid = " . $a->profile['profile_uid']
. "; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
. "; var netargs = '?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
}
$o .= conversation($a,$r,'profile',$update);
if($is_owner) {
$r = q("UPDATE `item` SET `unseen` = 0
WHERE `wall` = 1 AND `unseen` = 1 AND `uid` = %d",
intval(local_user())
);
}
$o .= conversation($a,$items,'profile',$update);
if(! $update) {
$o .= paginate($a);

View file

@ -223,7 +223,12 @@ function settings_post(&$a) {
$expire_notes = ((x($_POST,'expire_notes')) ? intval($_POST['expire_notes']) : 0);
$expire_starred = ((x($_POST,'expire_starred')) ? intval($_POST['expire_starred']) : 0);
$expire_photos = ((x($_POST,'expire_photos'))? intval($_POST['expire_photos']) : 0);
$browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0);
$browser_update = $browser_update * 1000;
if($browser_update < 10000)
$browser_update = 40000;
$allow_location = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
$publish = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0);
@ -313,6 +318,7 @@ function settings_post(&$a) {
set_pconfig(local_user(),'expire','photos', $expire_photos);
set_pconfig(local_user(),'system','suggestme', $suggestme);
set_pconfig(local_user(),'system','update_interval', $browser_update);
$r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `expire` = %d, `openidserver` = '%s', `blockwall` = %d, `hidewall` = %d, `blocktags` = %d WHERE `uid` = %d LIMIT 1",
dbesc($username),
@ -618,6 +624,9 @@ function settings_content(&$a) {
$suggestme = get_pconfig(local_user(), 'system','suggestme');
$suggestme = (($suggestme===false)?0:$suggestme); // default if not set: 0
$browser_update = intval(get_pconfig(local_user(), 'system','update_interval'));
$browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds
if(! strlen($a->user['timezone']))
$timezone = date_default_timezone_get();
@ -770,8 +779,7 @@ function settings_content(&$a) {
'$defloc' => array('defloc', t('Default Post Location:'), $defloc, ''),
'$allowloc' => array('allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''),
'$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes),
'$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')),
'$h_prv' => t('Security and Privacy Settings'),

View file

@ -1,4 +1,4 @@
<?php
<?php
// Nastavte následující pro Vaši instalaci MySQL
// Zkopírujte nebo přejmenujte tento soubor na .htconfig.php
@ -70,9 +70,4 @@ $a->config['system']['rino_encrypt'] = true;
$a->config['system']['theme'] = 'duepuntozero';
// Addony or pluginy se nastavují zde.
// Toto je list čárkou oddělených addonů, které jsou povoleny. Příklad:
// $a->config['system']['addon'] = 'js_upload,randplace,oembed';
$a->config['system']['addon'] = 'js_upload';

View file

@ -66,9 +66,3 @@ $a->config['system']['rino_encrypt'] = true;
$a->config['system']['theme'] = 'duepuntozero';
// Addons or plugins are configured here.
// This is a comma seperated list of addons to enable. Example:
// $a->config['system']['addon'] = 'js_upload,randplace,oembed';
$a->config['system']['addon'] = 'js_upload';

View file

@ -66,9 +66,3 @@ $a->config['system']['rino_encrypt'] = true;
$a->config['system']['theme'] = 'duepuntozero';
// Addons or plugins are configured here.
// This is a comma seperated list of addons to enable. Example:
// $a->config['system']['addon'] = 'js_upload,randplace,oembed';
$a->config['system']['addon'] = 'js_upload';

View file

@ -66,8 +66,3 @@ $a->config['system']['rino_encrypt'] = true;
$a->config['system']['theme'] = 'duepuntozero';
// Addons or plugins are configured here.
// This is a comma seperated list of addons to enable. Example:
// $a->config['system']['addon'] = 'js_upload,randplace,oembed';
$a->config['system']['addon'] = 'js_upload';

View file

@ -66,8 +66,3 @@ $a->config['system']['rino_encrypt'] = true;
$a->config['system']['theme'] = 'duepuntozero';
// Addons or plugins are configured here.
// This is a comma seperated list of addons to enable. Example:
// $a->config['system']['addon'] = 'js_upload,randplace,oembed';
$a->config['system']['addon'] = 'js_upload';

View file

@ -28,6 +28,8 @@
<script type="text/javascript" src="$baseurl/js/main.js" ></script>
<script>
var updateInterval = $update_interval;
function confirmDelete() { return confirm("$delitem"); }
function commentOpen(obj,id) {
if(obj.value == '$comment') {

View file

@ -66,8 +66,3 @@ $a->config['system']['rino_encrypt'] = true;
$a->config['system']['theme'] = 'duepuntozero';
// Addons or plugins are configured here.
// This is a comma seperated list of addons to enable. Example:
// $a->config['system']['addon'] = 'js_upload,randplace,oembed';
$a->config['system']['addon'] = 'js_upload';

View file

@ -29,6 +29,7 @@ $nickname_block
{{inc field_input.tpl with $field=$defloc }}{{endinc}}
{{inc field_checkbox.tpl with $field=$allowloc }}{{endinc}}
{{inc field_select.tpl with $field=$theme }}{{endinc}}
{{inc field_input.tpl with $field=$ajaxint }}{{endinc}}
<div class="settings-submit-wrapper" >

View file

@ -66,9 +66,3 @@ $a->config['system']['rino_encrypt'] = true;
$a->config['system']['theme'] = 'duepuntozero';
// Addons or plugins are configured here.
// This is a comma seperated list of addons to enable. Example:
// $a->config['system']['addon'] = 'js_upload,randplace,oembed';
$a->config['system']['addon'] = 'js_upload';