Merge remote branch 'upstream/master'

Conflicts:
	include/items.php
This commit is contained in:
Michael Vogel 2012-06-29 21:43:49 +02:00
commit 65268d25e6
55 changed files with 1631 additions and 946 deletions

View file

@ -10,9 +10,9 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.0.1382' );
define ( 'FRIENDICA_VERSION', '3.0.1388' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1149 );
define ( 'DB_UPDATE_VERSION', 1151 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@ -434,6 +434,8 @@ if(! class_exists('App')) {
$this->pager['page'] = ((x($_GET,'page') && intval($_GET['page']) > 0) ? intval($_GET['page']) : 1);
$this->pager['itemspage'] = 50;
$this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
if($this->pager['start'] < 1)
$this->pager['start'] = 1;
$this->pager['total'] = 0;
}
@ -1252,6 +1254,9 @@ if(! function_exists('get_birthdays')) {
'$event_reminders' => t('Birthday Reminders'),
'$event_title' => t('Birthdays this week:'),
'$events' => $r,
'$lbr' => '{', // raw brackets mess up if/endif macro processing
'$rbr' => '}'
));
}
}
@ -1374,9 +1379,9 @@ if(! function_exists('proc_run')) {
if(count($args) && $args[0] === 'php')
$args[0] = ((x($a->config,'php_path')) && (strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
foreach ($args as $arg){
$arg = escapeshellarg($arg);
}
for($x = 0; $x < count($args); $x ++)
$args[$x] = escapeshellarg($args[$x]);
$cmdline = implode($args," ");
proc_close(proc_open($cmdline." &",array(),$foo));
}

View file

@ -254,6 +254,7 @@ CREATE TABLE IF NOT EXISTS `event` (
`edited` datetime NOT NULL,
`start` datetime NOT NULL,
`finish` datetime NOT NULL,
`summary` text NOT NULL,
`desc` text NOT NULL,
`location` text NOT NULL,
`type` char(255) NOT NULL,
@ -263,7 +264,14 @@ CREATE TABLE IF NOT EXISTS `event` (
`allow_gid` mediumtext NOT NULL,
`deny_cid` mediumtext NOT NULL,
`deny_gid` mediumtext NOT NULL,
PRIMARY KEY (`id`)
PRIMARY KEY (`id`),
KEY `uid` ( `uid` ),
KEY `cid` ( `cid` ),
KEY `uri` ( `uri` ),
KEY `type` ( `type` ),
KEY `start` ( `start` ),
KEY `finish` ( `finish` ),
KEY `adjust` ( `adjust` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
@ -831,6 +839,8 @@ CREATE TABLE IF NOT EXISTS `profile` (
`religion` char(255) NOT NULL,
`pub_keywords` text NOT NULL,
`prv_keywords` text NOT NULL,
`likes` text NOT NULL,
`dislikes` text NOT NULL,
`about` text NOT NULL,
`summary` char(255) NOT NULL,
`music` text NOT NULL,

View file

@ -565,7 +565,8 @@
if(requestdata('lat') && requestdata('long'))
$_REQUEST['coord'] = sprintf("%s %s",requestdata('lat'),requestdata('long'));
$_REQUEST['profile_uid'] = local_user();
if(requestdata('parent'))
if($parent)
$_REQUEST['type'] = 'net-comment';
else {
$_REQUEST['type'] = 'wall';
@ -864,8 +865,13 @@
logger('API: api_statuses_show: '.$id);
//$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
//$sql_extra = "";
if ($_GET["conversation"] == "true") $sql_extra .= " AND `item`.`parent` = %d ORDER BY `received` ASC "; else $sql_extra .= " AND `item`.`id` = %d";
$conversation = (x($_REQUEST,'conversation')?1:0);
$sql_extra = '';
if ($conversation)
$sql_extra .= " AND `item`.`parent` = %d ORDER BY `received` ASC ";
else
$sql_extra .= " AND `item`.`id` = %d";
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
@ -875,14 +881,13 @@
WHERE `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
AND `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra
",
$sql_extra",
intval($id)
);
//var_dump($r);
$ret = api_format_items($r,$user_info);
//var_dump($ret);
if ($_GET["conversation"] == "true") {
if ($conversation) {
$data = array('$statuses' => $ret);
return api_apply_template("timeline", $type, $data);
} else {
@ -1233,6 +1238,40 @@
return($as);
}
function api_format_messages($item, $recipient, $sender) {
// standard meta information
$ret=Array(
'id' => $item['id'],
'created_at' => api_date($item['created']),
'sender_id' => $sender['id'] ,
'sender_screen_name' => $sender['screen_name'],
'sender' => $sender,
'recipient_id' => $recipient['id'],
'recipient_screen_name' => $recipient['screen_name'],
'recipient' => $recipient,
);
//don't send title to regular StatusNET requests to avoid confusing these apps
if (x($_GET, 'getText')) {
$ret['title'] = $item['title'] ;
if ($_GET["getText"] == "html") {
$ret['text'] = bbcode($item['body']);
}
elseif ($_GET["getText"] == "plain") {
$ret['text'] = html2plain(bbcode($item['body']), 0);
}
}
else {
$ret['text'] = $item['title']."\n".html2plain(bbcode($item['body']), 0);
}
if (isset($_GET["getUserObjects"]) && $_GET["getUserObjects"] == "false") {
unset($ret['sender']);
unset($ret['recipient']);
}
return $ret;
}
function api_format_items($r,$user_info) {
//logger('api_format_items: ' . print_r($r,true));
@ -1429,7 +1468,13 @@
'logo' => $logo, 'fancy' => 'true', 'language' => 'en', 'email' => $email, 'broughtby' => '',
'broughtbyurl' => '', 'timezone' => 'UTC', 'closed' => $closed, 'inviteonly' => 'false',
'private' => $private, 'textlimit' => $textlimit, 'sslserver' => $sslserver, 'ssl' => $ssl,
'shorturllength' => '30'
'shorturllength' => '30',
'friendica' => array(
'FRIENDICA_PLATFORM' => FRIENDICA_PLATFORM,
'FRIENDICA_VERSION' => FRIENDICA_VERSION,
'DFRN_PROTOCOL_VERSION' => DFRN_PROTOCOL_VERSION,
'DB_UPDATE_VERSION' => DB_UPDATE_VERSION
)
),
);
@ -1506,34 +1551,36 @@
$sender = api_get_user($a);
require_once("include/message.php");
$r = q("SELECT `id` FROM `contact` WHERE `uid`=%d AND `nick`='%s'",
intval(local_user()),
dbesc($_POST['screen_name']));
$recipient = api_get_user($a, $r[0]['id']);
require_once("include/message.php");
$replyto = '';
$sub = '';
if (x($_REQUEST,'replyto')) {
$r = q('SELECT `parent-uri`, `title` FROM `mail` WHERE `uid`=%d AND `id`=%d',
intval(local_user()),
intval($_REQUEST['replyto']));
$replyto = $r[0]['parent-uri'];
$sub = $r[0]['title'];
}
else {
if (x($_REQUEST,'title')) {
$sub = $_REQUEST['title'];
}
else {
$sub = ((strlen($_POST['text'])>10)?substr($_POST['text'],0,10)."...":$_POST['text']);
$id = send_message($recipient['id'], $_POST['text'], $sub);
}
}
$id = send_message($recipient['id'], $_POST['text'], $sub, $replyto);
if ($id>-1) {
$r = q("SELECT * FROM `mail` WHERE id=%d", intval($id));
$item = $r[0];
$ret=Array(
'id' => $item['id'],
'created_at'=> api_date($item['created']),
'sender_id'=> $sender['id'] ,
'sender_screen_name'=> $sender['screen_name'],
'sender'=> $sender,
'recipient_id'=> $recipient['id'],
'recipient_screen_name'=> $recipient['screen_name'],
'recipient'=> $recipient,
'text'=> $item['title']."\n".html2plain(bbcode($item['body']), 0) ,
);
$ret = api_format_messages($r[0], $recipient, $sender);
} else {
$ret = array("error"=>$id);
@ -1564,46 +1611,37 @@
$start = $page*$count;
$profile_url = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
if ($box=="sentbox") {
$sql_extra = "`from-url`='%s'";
} else {
$sql_extra = "`from-url`!='%s'";
$sql_extra = "`from-url`='".dbesc( $profile_url )."'";
}
elseif ($box=="conversation") {
$sql_extra = "`parent-uri`='".dbesc( $_GET["uri"] ) ."'";
}
elseif ($box=="all") {
$sql_extra = "true";
}
elseif ($box=="inbox") {
$sql_extra = "`from-url`!='".dbesc( $profile_url )."'";
}
$r = q("SELECT * FROM `mail` WHERE uid=%d AND $sql_extra ORDER BY created DESC LIMIT %d,%d",
intval(local_user()),
dbesc( $a->get_baseurl() . '/profile/' . $a->user['nickname'] ),
intval($start), intval($count)
);
$ret = Array();
foreach($r as $item) {
switch ($box){
case "inbox":
if ($box == "inbox" || $item['from-url'] != $profile_url){
$recipient = $user_info;
$sender = api_get_user($a,$item['contact-id']);
break;
case "sentbox":
}
elseif ($box == "sentbox" || $item['from-url'] != $profile_url){
$recipient = api_get_user($a,$item['contact-id']);
$sender = $user_info;
break;
}
$ret[]=Array(
'id' => $item['id'],
'created_at'=> api_date($item['created']),
'sender_id'=> $sender['id'] ,
'sender_screen_name'=> $sender['screen_name'],
'sender'=> $sender,
'recipient_id'=> $recipient['id'],
'recipient_screen_name'=> $recipient['screen_name'],
'recipient'=> $recipient,
'text'=> $item['title']."\n".html2plain(bbcode($item['body']), 0) ,
);
$ret[]=api_format_messages($item, $recipient, $sender);
}
@ -1624,6 +1662,14 @@
function api_direct_messages_inbox(&$a, $type){
return api_direct_messages_box($a, $type, "inbox");
}
function api_direct_messages_all(&$a, $type){
return api_direct_messages_box($a, $type, "all");
}
function api_direct_messages_conversation(&$a, $type){
return api_direct_messages_box($a, $type, "conversation");
}
api_register_func('api/direct_messages/conversation','api_direct_messages_conversation',true);
api_register_func('api/direct_messages/all','api_direct_messages_all',true);
api_register_func('api/direct_messages/sent','api_direct_messages_sentbox',true);
api_register_func('api/direct_messages','api_direct_messages_inbox',true);

View file

@ -68,9 +68,14 @@ function stripdcode_br_cb($s) {
function diaspora_ul($s) {
// Replace "[\\*]" followed by any number (including zero) of
// Replace "[*]" followed by any number (including zero) of
// spaces by "* " to match Diaspora's list format
return preg_replace("/\[\\\\\*\]( *)/", "* ", $s[1]);
if( strpos($s[0], "[list]") === 0 )
return '<ul class="listbullet" style="list-style-type: circle;">' . preg_replace("/\[\*\]( *)/", "* ", $s[1]) . '</ul>';
elseif( strpos($s[0], "[ul]") === 0 )
return '<ul class="listbullet" style="list-style-type: circle;">' . preg_replace("/\[\*\]( *)/", "* ", $s[1]) . '</ul>';
else
return $s[0];
}
@ -80,12 +85,47 @@ function diaspora_ol($s) {
// 1. First element
// 1. Second element
// 1. Third element
return preg_replace("/\[\\\\\*\]( *)/", "1. ", $s[1]);
if( strpos($s[0], "[list=1]") === 0 )
return '<ul class="listdecimal" style="list-style-type: decimal;">' . preg_replace("/\[\*\]( *)/", "1. ", $s[1]) . '</ul>';
elseif( strpos($s[0], "[list=i]") === 0 )
return '<ul class="listlowerroman" style="list-style-type: lower-roman;">' . preg_replace("/\[\*\]( *)/", "1. ", $s[1]) . '</ul>';
elseif( strpos($s[0], "[list=I]") === 0 )
return '<ul class="listupperroman" style="list-style-type: upper-roman;">' . preg_replace("/\[\*\]( *)/", "1. ", $s[1]) . '</ul>';
elseif( strpos($s[0], "[list=a]") === 0 )
return '<ul class="listloweralpha" style="list-style-type: lower-alpha;">' . preg_replace("/\[\*\]( *)/", "1. ", $s[1]) . '</ul>';
elseif( strpos($s[0], "[list=A]") === 0 )
return '<ul class="listupperalpha" style="list-style-type: upper-alpha;">' . preg_replace("/\[\*\]( *)/", "1. ", $s[1]) . '</ul>';
elseif( strpos($s[0], "[ol]") === 0 )
return '<ul class="listdecimal" style="list-style-type: decimal;">' . preg_replace("/\[\*\]( *)/", "1. ", $s[1]) . '</ul>';
else
return $s[0];
}
function bb2diaspora($Text,$preserve_nl = false) {
// bbcode() will convert "[*]" into "<li>" with no closing "</li>"
// Markdownify() is unable to handle these, as it makes each new
// "<li>" into a deeper nested element until it crashes. So pre-format
// the lists as Diaspora lists before sending the $Text to bbcode()
//
// Note that to get nested lists to work for Diaspora, we would need
// to define the closing tag for the list elements. So nested lists
// are going to be flattened out in Diaspora for now
$endlessloop = 0;
while ((((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false)) ||
((strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false)) ||
((strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false))) && (++$endlessloop < 20)) {
$Text = preg_replace_callback("/\[list\](.*?)\[\/list\]/is", 'diaspora_ul', $Text);
$Text = preg_replace_callback("/\[list=1\](.*?)\[\/list\]/is", 'diaspora_ol', $Text);
$Text = preg_replace_callback("/\[list=i\](.*?)\[\/list\]/s",'diaspora_ol', $Text);
$Text = preg_replace_callback("/\[list=I\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
$Text = preg_replace_callback("/\[list=a\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
$Text = preg_replace_callback("/\[list=A\](.*?)\[\/list\]/s", 'diaspora_ol', $Text);
$Text = preg_replace_callback("/\[ul\](.*?)\[\/ul\]/is", 'diaspora_ul', $Text);
$Text = preg_replace_callback("/\[ol\](.*?)\[\/ol\]/is", 'diaspora_ol', $Text);
}
// Convert it to HTML - don't try oembed
$Text = bbcode($Text, $preserve_nl, false);
@ -93,6 +133,12 @@ function bb2diaspora($Text,$preserve_nl = false) {
$md = new Markdownify(false, false, false);
$Text = $md->parseString($Text);
// If the text going into bbcode() has a plain URL in it, i.e.
// with no [url] tags around it, it will come out of parseString()
// looking like: <http://url.com>, which gets removed by strip_tags().
// So take off the angle brackets of any such URL
$Text = preg_replace("/<http(.*?)>/is", "http$1", $Text);
// Remove all unconverted tags
$Text = strip_tags($Text);

View file

@ -162,7 +162,10 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
// handle nested lists
$endlessloop = 0;
while ((strpos($Text, "[/list]") !== false) and (strpos($Text, "[list") !== false) and (++$endlessloop < 20)) {
while ((((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false)) ||
((strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false)) ||
((strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false))) && (++$endlessloop < 20)) {
$Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=\](.*?)\[\/list\]/ism", '<ul class="listnone" style="list-style-type: none;">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=1\](.*?)\[\/list\]/ism", '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>' ,$Text);
@ -170,10 +173,9 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
$Text = preg_replace("/\[list=((?-i)I)\](.*?)\[\/list\]/ism", '<ul class="listupperroman" style="list-style-type: upper-roman;">$2</ul>' ,$Text);
$Text = preg_replace("/\[list=((?-i)a)\](.*?)\[\/list\]/ism", '<ul class="listloweralpha" style="list-style-type: lower-alpha;">$2</ul>' ,$Text);
$Text = preg_replace("/\[list=((?-i)A)\](.*?)\[\/list\]/ism", '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$2</ul>' ,$Text);
}
$Text = preg_replace("/\[ul\](.*?)\[\/ul\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>' ,$Text);
$Text = preg_replace("/\[ol\](.*?)\[\/ol\]/ism", '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>' ,$Text);
}
$Text = preg_replace("/\[th\](.*?)\[\/th\]/sm", '<th>$1</th>' ,$Text);
$Text = preg_replace("/\[td\](.*?)\[\/td\]/sm", '<td>$1</td>' ,$Text);
@ -295,12 +297,16 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
$Text = oembed_bbcode2html($Text);
// If we found an event earlier, strip out all the event code and replace with a reformatted version.
// Replace the event-start section with the entire formatted event. The other bbcode is stripped.
// Summary (e.g. title) is required, earlier revisions only required description (in addition to
// start which is always required). Allow desc with a missing summary for compatibility.
if(x($ev,'desc') && x($ev,'start')) {
if((x($ev,'desc') || x($ev,'summary')) && x($ev,'start')) {
$sub = format_event_html($ev);
$Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/ism",$sub,$Text);
$Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/ism",'',$Text);
$Text = preg_replace("/\[event\-summary\](.*?)\[\/event\-summary\]/ism",'',$Text);
$Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/ism",'',$Text);
$Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/ism",$sub,$Text);
$Text = preg_replace("/\[event\-finish\](.*?)\[\/event\-finish\]/ism",'',$Text);
$Text = preg_replace("/\[event\-location\](.*?)\[\/event\-location\]/ism",'',$Text);
$Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/ism",'',$Text);

View file

@ -432,7 +432,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
continue;
$toplevelpost = (($item['id'] == $item['parent']) ? true : false);
$toplevelprivate = false;
// Take care of author collapsing and comment collapsing
// (author collapsing is currently disabled)
@ -440,7 +440,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
// If there are more than two comments, squash all but the last 2.
if($toplevelpost) {
$toplevelprivate = (($toplevelpost && $item['private']) ? true : false);
$item_writeable = (($item['writable'] || $item['self']) ? true : false);
$comments_seen = 0;
@ -485,7 +485,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $item['cid'] ;
$lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
$lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
? t('Private Message')
: false);
@ -546,16 +546,16 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
}
$likebuttons = '';
$shareable = ((($profile_owner == local_user()) && ((! $item['private']) || $item['network'] === NETWORK_FEED)) ? true : false);
$shareable = ((($profile_owner == local_user()) && (! $item['private'] == 1)) ? true : false);
if($page_writeable) {
if($toplevelpost) {
/* if($toplevelpost) { */
$likebuttons = array(
'like' => array( t("I like this \x28toggle\x29"), t("like")),
'dislike' => array( t("I don't like this \x28toggle\x29"), t("dislike")),
);
if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share'));
}
/* } */
$qc = $qcomment = null;
@ -659,8 +659,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
else
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb));
$like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
$dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
$like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : '');
$dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
call_hooks('render_location',$locate);
@ -876,13 +876,17 @@ function like_puller($a,$item,&$arr,$mode) {
}
else
$url = zrl($url);
if(! ((isset($arr[$item['parent'] . '-l'])) && (is_array($arr[$item['parent'] . '-l']))))
$arr[$item['parent'] . '-l'] = array();
if(! isset($arr[$item['parent']]))
$arr[$item['parent']] = 1;
if(! $item['thr-parent'])
$item['thr-parent'] = $item['parent-uri'];
if(! ((isset($arr[$item['thr-parent'] . '-l'])) && (is_array($arr[$item['thr-parent'] . '-l']))))
$arr[$item['thr-parent'] . '-l'] = array();
if(! isset($arr[$item['thr-parent']]))
$arr[$item['thr-parent']] = 1;
else
$arr[$item['parent']] ++;
$arr[$item['parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['author-name'] . '</a>';
$arr[$item['thr-parent']] ++;
$arr[$item['thr-parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['author-name'] . '</a>';
}
return;
}}

View file

@ -447,11 +447,13 @@ function update_contact_birthdays() {
*
*/
$bdtext = t('Birthday:') . ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]' ;
$bdtext = sprintf( t('%s\'s birthday'), $rr['name']);
$bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]') ;
$r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`desc`,`type`,`adjust`)
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%d' ) ",
$r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`,`adjust`)
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d' ) ",
intval($rr['uid']),
intval($rr['id']),
dbesc(datetime_convert()),
@ -459,6 +461,7 @@ function update_contact_birthdays() {
dbesc(datetime_convert('UTC','UTC', $nextbd)),
dbesc(datetime_convert('UTC','UTC', $nextbd . ' + 1 day ')),
dbesc($bdtext),
dbesc($bdtext2),
dbesc('birthday'),
intval(0)
);

View file

@ -113,7 +113,7 @@ function delivery_run($argv, $argc){
$uid = $r[0]['uid'];
$updated = $r[0]['edited'];
// The following seems superfluous. We've already checked for "if (! intval($r[0]['parent']))" a few lines up
// POSSIBLE CLEANUP --> The following seems superfluous. We've already checked for "if (! intval($r[0]['parent']))" a few lines up
if(! $parent_id)
continue;
@ -280,7 +280,7 @@ function delivery_run($argv, $argc){
continue;
// private emails may be in included in public conversations. Filter them.
if(($public_message) && $item['private'])
if(($public_message) && $item['private'] == 1)
continue;
$item_contact = get_item_contact($item,$icontacts);
@ -383,7 +383,7 @@ function delivery_run($argv, $argc){
continue;
// private emails may be in included in public conversations. Filter them.
if(($public_message) && $item['private'])
if(($public_message) && $item['private'] == 1)
continue;
$item_contact = get_item_contact($item,$icontacts);

View file

@ -1560,7 +1560,8 @@ function diaspora_photo($importer,$xml,$msg) {
$link_text = '[img]' . $remote_photo_path . $remote_photo_name . '[/img]' . "\n";
$link_text = scale_external_images($link_text);
$link_text = scale_external_images($link_text, true,
array($remote_photo_name, 'scaled_full_' . $remote_photo_name));
if(strpos($parent_item['body'],$link_text) === false) {
$r = q("update item set `body` = '%s', `visible` = 1 where `id` = %d and `uid` = %d limit 1",
@ -2251,7 +2252,6 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) {
$relay_retract = true;
$target_type = ( ($item['verb'] === ACTIVITY_LIKE) ? 'Like' : 'Comment');
$sender_signed_text = $item['guid'] . ';' . $target_type ;
$sql_sign_id = 'retract_iid';
$tpl = get_markup_template('diaspora_relayable_retraction.tpl');
@ -2262,13 +2262,10 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) {
$target_type = 'Post';
// $positive = (($item['deleted']) ? 'false' : 'true');
$positive = 'true';
$sender_signed_text = $item['guid'] . ';' . $target_type . ';' . $parent_guid . ';' . $positive . ';' . $myaddr;
$tpl = get_markup_template('diaspora_like_relay.tpl');
}
else { // item is a comment
$sender_signed_text = $item['guid'] . ';' . $parent_guid . ';' . $text . ';' . $myaddr;
$tpl = get_markup_template('diaspora_comment_relay.tpl');
}
@ -2294,6 +2291,13 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) {
return;
}
if($relay_retract)
$sender_signed_text = $item['guid'] . ';' . $target_type;
elseif($like)
$sender_signed_text = $item['guid'] . ';' . $target_type . ';' . $parent_guid . ';' . $positive . ';' . $handle;
else
$sender_signed_text = $item['guid'] . ';' . $parent_guid . ';' . $text . ';' . $handle;
// Sign the relayable with the top-level owner's signature
//
// We'll use the $sender_signed_text that we just created, instead of the $signed_text

View file

@ -12,6 +12,9 @@ function format_event_html($ev) {
$o = '<div class="vevent">' . "\r\n";
$o .= '<p class="summary event-summary">' . bbcode($ev['summary']) . '</p>' . "\r\n";
$o .= '<p class="description event-description">' . bbcode($ev['desc']) . '</p>' . "\r\n";
$o .= '<p class="event-start">' . t('Starts:') . ' <abbr class="dtstart" title="'
@ -114,6 +117,9 @@ function format_event_bbcode($ev) {
$o = '';
if($ev['summary'])
$o .= '[event-summary]' . $ev['summary'] . '[/event-summary]';
if($ev['desc'])
$o .= '[event-description]' . $ev['desc'] . '[/event-description]';
@ -147,6 +153,9 @@ function bbtoevent($s) {
$ev = array();
$match = '';
if(preg_match("/\[event\-summary\](.*?)\[\/event\-summary\]/is",$s,$match))
$ev['summary'] = $match[1];
$match = '';
if(preg_match("/\[event\-description\](.*?)\[\/event\-description\]/is",$s,$match))
$ev['desc'] = $match[1];
@ -244,6 +253,7 @@ function event_store($arr) {
`edited` = '%s',
`start` = '%s',
`finish` = '%s',
`summary` = '%s',
`desc` = '%s',
`location` = '%s',
`type` = '%s',
@ -258,6 +268,7 @@ function event_store($arr) {
dbesc($arr['edited']),
dbesc($arr['start']),
dbesc($arr['finish']),
dbesc($arr['summary']),
dbesc($arr['desc']),
dbesc($arr['location']),
dbesc($arr['type']),
@ -306,9 +317,9 @@ function event_store($arr) {
// New event. Store it.
$r = q("INSERT INTO `event` ( `uid`,`cid`,`uri`,`created`,`edited`,`start`,`finish`,`desc`,`location`,`type`,
$r = q("INSERT INTO `event` ( `uid`,`cid`,`uri`,`created`,`edited`,`start`,`finish`,`summary`, `desc`,`location`,`type`,
`adjust`,`nofinish`,`allow_cid`,`allow_gid`,`deny_cid`,`deny_gid`)
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s' ) ",
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s' ) ",
intval($arr['uid']),
intval($arr['cid']),
dbesc($arr['uri']),
@ -316,6 +327,7 @@ function event_store($arr) {
dbesc($arr['edited']),
dbesc($arr['start']),
dbesc($arr['finish']),
dbesc($arr['summary']),
dbesc($arr['desc']),
dbesc($arr['location']),
dbesc($arr['type']),

View file

@ -62,6 +62,11 @@ function new_contact($uid,$url,$interactive = false) {
}
}
// This extra param just confuses things, remove it
if($ret['network'] === NETWORK_DIASPORA)
$ret['url'] = str_replace('?absolute=true','',$ret['url']);
@ -89,6 +94,11 @@ function new_contact($uid,$url,$interactive = false) {
$ret['notify'] = '';
}
if(! $ret['notify']) {
$result['message'] .= t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL;
}
@ -129,6 +139,32 @@ function new_contact($uid,$url,$interactive = false) {
}
else {
// check service class limits
$r = q("select count(*) as total from contact where uid = %d and pending = 0 and self = 0",
intval($uid)
);
if(count($r))
$total_contacts = $r[0]['total'];
if(! service_class_allows($uid,'total_contacts',$total_contacts)) {
$result['message'] .= upgrade_message();
return $result;
}
$r = q("select count(network) as total from contact where uid = %d and network = '%s' and pending = 0 and self = 0",
intval($uid),
dbesc($network)
);
if(count($r))
$total_network = $r[0]['total'];
if(! service_class_allows($uid,'total_contacts_' . $network,$total_network)) {
$result['message'] .= upgrade_message();
return $result;
}
$new_relation = (($ret['network'] === NETWORK_MAIL) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING);
if($ret['network'] === NETWORK_DIASPORA)
$new_relation = CONTACT_IS_FOLLOWER;

View file

@ -469,8 +469,8 @@ function get_atom_elements($feed,$item) {
$res['last-child'] = 0;
$private = $item->get_item_tags(NAMESPACE_DFRN,'private');
if($private && $private[0]['data'] == 1)
$res['private'] = 1;
if($private && intval($private[0]['data']) > 0)
$res['private'] = intval($private[0]['data']);
else
$res['private'] = 0;
@ -817,7 +817,7 @@ function item_store($arr,$force_parent = false) {
// email correspondents to be private even if the overall thread is not.
if($r[0]['private'])
$arr['private'] = 1;
$arr['private'] = $r[0]['private'];
// Edge case. We host a public forum that was originally posted to privately.
// The original author commented, but as this is a comment, the permissions
@ -1460,11 +1460,12 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
*
*/
$bdtext = t('Birthday:') . ' [url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' ;
$bdtext = sprintf( t('%s\'s birthday'), $contact['name']);
$bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' ) ;
$r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`desc`,`type`)
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s' ) ",
$r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`)
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
intval($contact['uid']),
intval($contact['id']),
dbesc(datetime_convert()),
@ -1472,6 +1473,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
dbesc(datetime_convert('UTC','UTC', $birthday)),
dbesc(datetime_convert('UTC','UTC', $birthday . ' + 1 day ')),
dbesc($bdtext),
dbesc($bdtext2),
dbesc('birthday')
);
@ -1660,6 +1662,21 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
continue;
}
$force_parent = false;
if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) {
if($contact['network'] === NETWORK_OSTATUS)
$force_parent = true;
if(strlen($datarray['title']))
unset($datarray['title']);
$r = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
dbesc(datetime_convert()),
dbesc($parent_uri),
intval($importer['uid'])
);
$datarray['last-child'] = 1;
}
$r = q("SELECT `uid`, `last-child`, `edited`, `body` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($item_id),
intval($importer['uid'])
@ -1703,19 +1720,6 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
continue;
}
$force_parent = false;
if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) {
if($contact['network'] === NETWORK_OSTATUS)
$force_parent = true;
if(strlen($datarray['title']))
unset($datarray['title']);
$r = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
dbesc(datetime_convert()),
dbesc($parent_uri),
intval($importer['uid'])
);
$datarray['last-child'] = 1;
}
if(($contact['network'] === NETWORK_FEED) || (! strlen($contact['notify']))) {
// one way feed - no remote comment ability
@ -1728,10 +1732,12 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
$datarray['type'] = 'activity';
$datarray['gravity'] = GRAVITY_LIKE;
// only one like or dislike per person
$r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1",
$r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent-uri` = '%s' OR `thr-parent` = '%s') limit 1",
intval($datarray['uid']),
intval($datarray['contact-id']),
dbesc($datarray['verb'])
dbesc($datarray['verb']),
dbesc($parent_uri),
dbesc($parent_uri)
);
if($r && count($r))
continue;
@ -1811,6 +1817,13 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
}
}
if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) {
if(strlen($datarray['title']))
unset($datarray['title']);
$datarray['last-child'] = 1;
}
$r = q("SELECT `uid`, `last-child`, `edited`, `body` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($item_id),
intval($importer['uid'])
@ -1873,24 +1886,23 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
if(! is_array($contact))
return;
if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) {
if(strlen($datarray['title']))
unset($datarray['title']);
$datarray['last-child'] = 1;
}
if(($contact['network'] === NETWORK_FEED) || (! strlen($contact['notify']))) {
// one way feed - no remote comment ability
$datarray['last-child'] = 0;
}
if($contact['network'] === NETWORK_FEED)
$datarray['private'] = 1;
$datarray['private'] = 2;
// This is my contact on another system, but it's really me.
// Turn this into a wall post.
if($contact['remote_self'])
if($contact['remote_self']) {
$datarray['wall'] = 1;
if($contact['network'] === NETWORK_FEED) {
$datarray['private'] = 0;
}
}
$datarray['parent-uri'] = $item_id;
$datarray['uid'] = $importer['uid'];
@ -2148,6 +2160,67 @@ function local_delivery($importer,$data) {
}
if($deleted) {
// check for relayed deletes to our conversation
$is_reply = false;
$r = q("select * from item where uri = '%s' and uid = %d limit 1",
dbesc($uri),
intval($importer['importer_uid'])
);
if(count($r)) {
$parent_uri = $r[0]['parent-uri'];
if($r[0]['id'] != $r[0]['parent'])
$is_reply = true;
}
if($is_reply) {
$community = false;
if($importer['page-flags'] == PAGE_COMMUNITY || $importer['page-flags'] == PAGE_PRVGROUP ) {
$sql_extra = '';
$community = true;
logger('local_delivery: possible community delete');
}
else
$sql_extra = " and contact.self = 1 and item.wall = 1 ";
// was the top-level post for this reply written by somebody on this site?
// Specifically, the recipient?
$is_a_remote_delete = false;
$r = q("select `item`.`id`, `item`.`uri`, `item`.`tag`, `item`.`forum_mode`,`item`.`origin`,`item`.`wall`,
`contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item`
LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uri` = '%s' AND (`item`.`parent-uri` = '%s' or `item`.`thr-parent` = '%s')
AND `item`.`uid` = %d
$sql_extra
LIMIT 1",
dbesc($parent_uri),
dbesc($parent_uri),
dbesc($parent_uri),
intval($importer['importer_uid'])
);
if($r && count($r))
$is_a_remote_delete = true;
// Does this have the characteristics of a community or private group comment?
// If it's a reply to a wall post on a community/prvgroup page it's a
// valid community comment. Also forum_mode makes it valid for sure.
// If neither, it's not.
if($is_a_remote_delete && $community) {
if((! $r[0]['forum_mode']) && (! $r[0]['wall'])) {
$is_a_remote_delete = false;
logger('local_delivery: not a community delete');
}
}
if($is_a_remote_delete) {
logger('local_delivery: received remote delete');
}
}
$r = q("SELECT `item`.*, `contact`.`self` FROM `item` left join contact on `item`.`contact-id` = `contact`.`id`
WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d AND NOT `item`.`file` LIKE '%%[%%' LIMIT 1",
dbesc($uri),
@ -2235,6 +2308,10 @@ function local_delivery($importer,$data) {
);
}
}
// if this is a relayed delete, propagate it to other recipients
if($is_a_remote_delete)
proc_run('php',"include/notifier.php","drop",$item['id']);
}
}
}
@ -2268,15 +2345,17 @@ function local_delivery($importer,$data) {
$is_a_remote_comment = false;
// POSSIBLE CLEANUP --> Why select so many fields when only forum_mode and wall are used?
$r = q("select `item`.`id`, `item`.`uri`, `item`.`tag`, `item`.`forum_mode`,`item`.`origin`,`item`.`wall`,
`contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item`
LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uri` = '%s' AND `item`.`parent-uri` = '%s'
WHERE `item`.`uri` = '%s' AND (`item`.`parent-uri` = '%s' or `item`.`thr-parent` = '%s')
AND `item`.`uid` = %d
$sql_extra
LIMIT 1",
dbesc($parent_uri),
dbesc($parent_uri),
dbesc($parent_uri),
intval($importer['importer_uid'])
);
if($r && count($r))
@ -2364,10 +2443,13 @@ function local_delivery($importer,$data) {
$datarray['gravity'] = GRAVITY_LIKE;
$datarray['last-child'] = 0;
// only one like or dislike per person
$r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1",
$r = q("select id from item where uid = %d and `contact-id` = %d and verb = '%s' and (`thr-parent` = '%s' or `parent-uri` = '%s') and deleted = 0 limit 1",
intval($datarray['uid']),
intval($datarray['contact-id']),
dbesc($datarray['verb'])
dbesc($datarray['verb']),
dbesc($datarray['parent-uri']),
dbesc($datarray['parent-uri'])
);
if($r && count($r))
continue;
@ -2535,10 +2617,12 @@ function local_delivery($importer,$data) {
$datarray['type'] = 'activity';
$datarray['gravity'] = GRAVITY_LIKE;
// only one like or dislike per person
$r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1",
$r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent-uri` = '%s' OR `thr-parent` = '%s') limit 1",
intval($datarray['uid']),
intval($datarray['contact-id']),
dbesc($datarray['verb'])
dbesc($datarray['verb']),
dbesc($parent_uri),
dbesc($parent_uri)
);
if($r && count($r))
continue;
@ -2933,8 +3017,10 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) {
if(strlen($item['owner-name']))
$o .= atom_author('dfrn:owner',$item['owner-name'],$item['owner-link'],80,80,$item['owner-avatar']);
if(($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri']))
$o .= '<thr:in-reply-to ref="' . xmlify($item['parent-uri']) . '" type="text/html" href="' . xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['parent']) . '" />' . "\r\n";
if(($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri']) || ($item['thr-parent'])) {
$parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']);
$o .= '<thr:in-reply-to ref="' . xmlify($parent_item) . '" type="text/html" href="' . xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['parent']) . '" />' . "\r\n";
}
$o .= '<id>' . xmlify($item['uri']) . '</id>' . "\r\n";
$o .= '<title>' . xmlify($item['title']) . '</title>' . "\r\n";
@ -2955,7 +3041,7 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) {
$o .= '<georss:point>' . xmlify($item['coord']) . '</georss:point>' . "\r\n";
if(($item['private']) || strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid']))
$o .= '<dfrn:private>1</dfrn:private>' . "\r\n";
$o .= '<dfrn:private>' . (($item['private']) ? $item['private'] : 1) . '</dfrn:private>' . "\r\n";
if($item['extid'])
$o .= '<dfrn:extid>' . xmlify($item['extid']) . '</dfrn:extid>' . "\r\n";
@ -3351,40 +3437,8 @@ function drop_item($id,$interactive = true) {
);
}
// Add a relayable_retraction signature for Diaspora. Note that we can't add a target_author_signature
// if the comment was deleted by a remote user. That should be ok, because if a remote user is deleting
// the comment, that means we're the home of the post, and Diaspora will only
// check the parent_author_signature of retractions that it doesn't have to relay further
//
// I don't think this function gets called for an "unlike," but I'll check anyway
$signed_text = $item['guid'] . ';' . ( ($item['verb'] === ACTIVITY_LIKE) ? 'Like' : 'Comment');
if(local_user() == $item['uid']) {
$handle = $a->user['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
$authorsig = base64_encode(rsa_sign($signed_text,$a->user['prvkey'],'sha256'));
}
else {
$r = q("SELECT `nick`, `url` FROM `contact` WHERE `id` = '%d' LIMIT 1",
$item['contact-id']
);
if(count($r)) {
// The below handle only works for NETWORK_DFRN. I think that's ok, because this function
// only handles DFRN deletes
$handle_baseurl_start = strpos($r['url'],'://') + 3;
$handle_baseurl_length = strpos($r['url'],'/profile') - $handle_baseurl_start;
$handle = $r['nick'] . '@' . substr($r['url'], $handle_baseurl_start, $handle_baseurl_length);
$authorsig = '';
}
}
if(isset($handle))
q("insert into sign (`retract_iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($item['id']),
dbesc($signed_text),
dbesc($authorsig),
dbesc($handle)
);
// Add a relayable_retraction signature for Diaspora.
store_diaspora_retract_sig($item, $a->user, $a->get_baseurl());
}
$drop_id = intval($item['id']);
@ -3472,3 +3526,51 @@ function posted_date_widget($url,$uid,$wall) {
));
return $o;
}
function store_diaspora_retract_sig($item, $user, $baseurl) {
// Note that we can't add a target_author_signature
// if the comment was deleted by a remote user. That should be ok, because if a remote user is deleting
// the comment, that means we're the home of the post, and Diaspora will only
// check the parent_author_signature of retractions that it doesn't have to relay further
//
// I don't think this function gets called for an "unlike," but I'll check anyway
$enabled = intval(get_config('system','diaspora_enabled'));
if(! $enabled) {
logger('drop_item: diaspora support disabled, not storing retraction signature', LOGGER_DEBUG);
return;
}
logger('drop_item: storing diaspora retraction signature');
$signed_text = $item['guid'] . ';' . ( ($item['verb'] === ACTIVITY_LIKE) ? 'Like' : 'Comment');
if(local_user() == $item['uid']) {
$handle = $user['nickname'] . '@' . substr($baseurl, strpos($baseurl,'://') + 3);
$authorsig = base64_encode(rsa_sign($signed_text,$user['prvkey'],'sha256'));
}
else {
$r = q("SELECT `nick`, `url` FROM `contact` WHERE `id` = '%d' LIMIT 1",
$item['contact-id']
);
if(count($r)) {
// The below handle only works for NETWORK_DFRN. I think that's ok, because this function
// only handles DFRN deletes
$handle_baseurl_start = strpos($r['url'],'://') + 3;
$handle_baseurl_length = strpos($r['url'],'/profile') - $handle_baseurl_start;
$handle = $r['nick'] . '@' . substr($r['url'], $handle_baseurl_start, $handle_baseurl_length);
$authorsig = '';
}
}
if(isset($handle))
q("insert into sign (`retract_iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($item['id']),
dbesc($signed_text),
dbesc($authorsig),
dbesc($handle)
);
return;
}

View file

@ -793,7 +793,7 @@ function add_fcontact($arr,$update = false) {
}
function scale_external_images($s,$include_link = true) {
function scale_external_images($s, $include_link = true, $scale_replace = false) {
$a = get_app();
@ -803,10 +803,22 @@ function scale_external_images($s,$include_link = true) {
require_once('include/Photo.php');
foreach($matches as $mtch) {
logger('scale_external_image: ' . $mtch[1]);
$hostname = str_replace('www.','',substr($a->get_baseurl(),strpos($a->get_baseurl(),'://')+3));
if(stristr($mtch[1],$hostname))
continue;
$i = fetch_url($mtch[1]);
// $scale_replace, if passed, is an array of two elements. The
// first is the name of the full-size image. The second is the
// name of a remote, scaled-down version of the full size image.
// This allows Friendica to display the smaller remote image if
// one exists, while still linking to the full-size image
if($scale_replace)
$scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[1]);
else
$scaled = $mtch[1];
$i = fetch_url($scaled);
// guess mimetype from headers or filename
$type = guess_image_type($mtch[1],true);
@ -822,7 +834,7 @@ function scale_external_images($s,$include_link = true) {
$new_width = $ph->getWidth();
$new_height = $ph->getHeight();
logger('scale_external_images: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], LOGGER_DEBUG);
$s = str_replace($mtch[0],'[img=' . $new_width . 'x' . $new_height. ']' . $mtch[1] . '[/img]'
$s = str_replace($mtch[0],'[img=' . $new_width . 'x' . $new_height. ']' . $scaled . '[/img]'
. "\n" . (($include_link)
? '[url=' . $mtch[1] . ']' . t('view full size') . '[/url]' . "\n"
: ''),$s);

View file

@ -125,7 +125,7 @@ function notifier_run($argv, $argc){
$uid = $r[0]['uid'];
$updated = $r[0]['edited'];
// The following seems superfluous. We've already checked for "if (! intval($r[0]['parent']))" a few lines up
// POSSIBLE CLEANUP --> The following seems superfluous. We've already checked for "if (! intval($r[0]['parent']))" a few lines up
if(! $parent_id)
return;
@ -399,7 +399,7 @@ function notifier_run($argv, $argc){
// private emails may be in included in public conversations. Filter them.
if(($public_message) && $item['private'])
if(($public_message) && $item['private'] == 1)
continue;

View file

@ -316,3 +316,87 @@ function get_theme_screenshot($theme) {
}
return($a->get_baseurl() . '/images/blank.png');
}
// check service_class restrictions. If there are no service_classes defined, everything is allowed.
// if $usage is supplied, we check against a maximum count and return true if the current usage is
// less than the subscriber plan allows. Otherwise we return boolean true or false if the property
// is allowed (or not) in this subscriber plan. An unset property for this service plan means
// the property is allowed, so it is only necessary to provide negative properties for each plan,
// or what the subscriber is not allowed to do.
function service_class_allows($uid,$property,$usage = false) {
if($uid == local_user()) {
$service_class = $a->user['service_class'];
}
else {
$r = q("select service_class from user where uid = %d limit 1",
intval($uid)
);
if($r !== false and count($r)) {
$service_class = $r[0]['service_class'];
}
}
if(! x($service_class))
return true; // everything is allowed
$arr = get_config('service_class',$service_class);
if(! is_array($arr) || (! count($arr)))
return true;
if($usage === false)
return ((x($arr[$property])) ? (bool) $arr['property'] : true);
else {
if(! array_key_exists($property,$arr))
return true;
return (((intval($usage)) < intval($arr[$property])) ? true : false);
}
}
function service_class_fetch($uid,$property) {
if($uid == local_user()) {
$service_class = $a->user['service_class'];
}
else {
$r = q("select service_class from user where uid = %d limit 1",
intval($uid)
);
if($r !== false and count($r)) {
$service_class = $r[0]['service_class'];
}
}
if(! x($service_class))
return false; // everything is allowed
$arr = get_config('service_class',$service_class);
if(! is_array($arr) || (! count($arr)))
return false;
return((array_key_exists($property,$arr)) ? $arr[$property] : false);
}
function upgrade_link($bbcode = false) {
$l = get_config('service_class','upgrade_link');
if(! $l)
return '';
if($bbcode)
$t = sprintf('[url=%s]' . t('Click here to upgrade.') . '[/url]', $l);
else
$t = sprintf('<a href="%s">' . t('Click here to upgrade.') . '</div>', $l);
return $t;
}
function upgrade_message($bbcode = false) {
$x = upgrade_link($bbcode);
return t('This action exceeds the limits set by your subscription plan.') . (($x) ? ' ' . $x : '') ;
}
function upgrade_bool_message($bbcode = false) {
$x = upgrade_link($bbcode);
return t('This action is not available under your subscription plan.') . (($x) ? ' ' . $x : '') ;
}

View file

@ -59,6 +59,11 @@ function advanced_profile(&$a) {
if($txt = prepare_text($a->profile['interest'])) $profile['interest'] = array( t('Hobbies/Interests:'), $txt);
if($txt = prepare_text($a->profile['likes'])) $profile['likes'] = array( t('Likes:'), $txt);
if($txt = prepare_text($a->profile['dislikes'])) $profile['dislikes'] = array( t('Dislikes:'), $txt);
if($txt = prepare_text($a->profile['contact'])) $profile['contact'] = array( t('Contact information and Social Networks:'), $txt);
if($txt = prepare_text($a->profile['music'])) $profile['music'] = array( t('Musical interests:'), $txt);

View file

@ -750,40 +750,40 @@ function smilies($s, $sample = false) {
);
$icons = array(
'<img src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-brokenheart.gif" alt="</3" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-brokenheart.gif" alt="<\\3" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-smile.gif" alt=":-)" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-wink.gif" alt=";-)" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-frown.gif" alt=":-(" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-P" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-p" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-\"" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-\"" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-x" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-X" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-laughing.gif" alt=":-D" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt="8-|" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt="8-O" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt=":-O" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-thumbsup.gif" alt="\\o/" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="o.O" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="O.o" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="o_O" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="O_o" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-cry.gif" alt=":\'(" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-foot-in-mouth.gif" alt=":-!" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-undecided.gif" alt=":-/" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-embarassed.gif" alt=":-[" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-cool.gif" alt="8-)" />',
'<img src="' . $a->get_baseurl() . '/images/beer_mug.gif" alt=":beer" />',
'<img src="' . $a->get_baseurl() . '/images/beer_mug.gif" alt=":homebrew" />',
'<img src="' . $a->get_baseurl() . '/images/coffee.gif" alt=":coffee" />',
'<img src="' . $a->get_baseurl() . '/images/smiley-facepalm.gif" alt=":facepalm" />',
'<img src="' . $a->get_baseurl() . '/images/like.gif" alt=":like" />',
'<img src="' . $a->get_baseurl() . '/images/dislike.gif" alt=":dislike" />',
'<a href="http://project.friendika.com">~friendika <img src="' . $a->get_baseurl() . '/images/friendika-16.png" alt="~friendika" /></a>',
'<a href="http://friendica.com">~friendica <img src="' . $a->get_baseurl() . '/images/friendica-16.png" alt="~friendica" /></a>'
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-brokenheart.gif" alt="</3" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-brokenheart.gif" alt="<\\3" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-smile.gif" alt=":-)" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-wink.gif" alt=";-)" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-frown.gif" alt=":-(" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-P" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-p" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-\"" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-\"" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-x" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-X" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-laughing.gif" alt=":-D" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt="8-|" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt="8-O" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt=":-O" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-thumbsup.gif" alt="\\o/" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="o.O" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="O.o" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="o_O" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="O_o" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-cry.gif" alt=":\'(" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-foot-in-mouth.gif" alt=":-!" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-undecided.gif" alt=":-/" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-embarassed.gif" alt=":-[" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-cool.gif" alt="8-)" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/beer_mug.gif" alt=":beer" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/beer_mug.gif" alt=":homebrew" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/coffee.gif" alt=":coffee" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-facepalm.gif" alt=":facepalm" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/like.gif" alt=":like" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/dislike.gif" alt=":dislike" />',
'<a href="http://project.friendika.com">~friendika <img class="smiley" src="' . $a->get_baseurl() . '/images/friendika-16.png" alt="~friendika" /></a>',
'<a href="http://friendica.com">~friendica <img class="smiley" src="' . $a->get_baseurl() . '/images/friendica-16.png" alt="~friendica" /></a>'
);
$params = array('texts' => $texts, 'icons' => $icons, 'string' => $s);
@ -823,7 +823,7 @@ function preg_heart($x) {
return $x[0];
$t = '';
for($cnt = 0; $cnt < strlen($x[1]); $cnt ++)
$t .= '<img src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />';
$t .= '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />';
$r = str_replace($x[0],$t,$x[0]);
return $r;
}
@ -1059,12 +1059,13 @@ function feed_salmonlinks($nick) {
if(! function_exists('get_plink')) {
function get_plink($item) {
$a = get_app();
if (x($item,'plink') && ((! $item['private']) || ($item['network'] === NETWORK_FEED))){
if (x($item,'plink') && ($item['private'] != 1)) {
return array(
'href' => $item['plink'],
'title' => t('link to source'),
);
} else {
}
else {
return false;
}
}}

View file

@ -147,13 +147,18 @@ function create_user($arr) {
require_once('include/crypto.php');
$keys = new_keypair(1024);
$keys = new_keypair(4096);
if($keys === false) {
$result['message'] .= t('SERIOUS ERROR: Generation of security keys failed.') . EOL;
return $result;
}
$default_service_class = get_config('system','default_service_class');
if(! $default_service_class)
$default_service_class = '';
$prvkey = $keys['prvkey'];
$pubkey = $keys['pubkey'];
@ -173,8 +178,8 @@ function create_user($arr) {
$spubkey = $sres['pubkey'];
$r = q("INSERT INTO `user` ( `guid`, `username`, `password`, `email`, `openid`, `nickname`,
`pubkey`, `prvkey`, `spubkey`, `sprvkey`, `register_date`, `verified`, `blocked`, `timezone` )
VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, 'UTC' )",
`pubkey`, `prvkey`, `spubkey`, `sprvkey`, `register_date`, `verified`, `blocked`, `timezone`, `service_class` )
VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, 'UTC', '%s' )",
dbesc(generate_user_guid()),
dbesc($username),
dbesc($new_password_encoded),
@ -187,7 +192,8 @@ function create_user($arr) {
dbesc($sprvkey),
dbesc(datetime_convert()),
intval($verified),
intval($blocked)
intval($blocked),
dbesc($default_service_class)
);
if($r) {

View file

@ -275,7 +275,7 @@ aStates[249]="|'Adan|'Ataq|Abyan|Al Bayda'|Al Hudaydah|Al Jawf|Al Mahrah|Al Mahw
aStates[250]="|Kosovo|Montenegro|Serbia|Vojvodina";
aStates[251]="|Central|Copperbelt|Eastern|Luapula|Lusaka|North-Western|Northern|Southern|Western";
aStates[252]="|Bulawayo|Harare|ManicalandMashonaland Central|Mashonaland East|Mashonaland West|Masvingo|Matabeleland North|Matabeleland South|Midlands";
aStates[253]="|Self Hosted|Private Server|Architects Of Sleep|DFRN|Distributed Friend Network|Free-Beer.ch|Foojbook|Free-Haven|Friendica.eu|Friendika.me.4.it|Friendika - I Ask Questions|Frndc.com|Hipatia|Hungerfreunde|Kaluguran Community|Kak Ste?|Karl.Markx.pm|Loozah Social Club|MyFriendica.net|MyFriendNetwork|Oi!|OpenMindSpace|Recolutionari.es|Sysfu Social Club|theshi.re|Tumpambae|Uzmiac|Other";
aStates[253]="|Self Hosted|Private Server|Architects Of Sleep|DFRN|Distributed Friend Network|Free-Beer.ch|Foojbook|Free-Haven|Friendica.eu|Friendika.me.4.it|Friendika - I Ask Questions|Frndc.com|Hikado|Hipatia|Hungerfreunde|Kaluguran Community|Kak Ste?|Karl.Markx.pm|Loozah Social Club|MyFriendica.net|MyFriendNetwork|Oi!|OpenMindSpace|Recolutionari.es|SPRACI|Sysfu Social Club|theshi.re|Tumpambae|Uzmiac|Other";
/*
* gArCountryInfo
* (0) Country name

8
js/jquery.js vendored

File diff suppressed because one or more lines are too long

View file

@ -146,7 +146,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
*/
require_once('include/crypto.php');
$res = new_keypair(1024);
$res = new_keypair(4096);
$private_key = $res['prvkey'];
$public_key = $res['pubkey'];

View file

@ -57,12 +57,13 @@ function events_post(&$a) {
if(strcmp($finish,$start) < 0)
$finish = $start;
$summary = escape_tags(trim($_POST['summary']));
$desc = escape_tags(trim($_POST['desc']));
$location = escape_tags(trim($_POST['location']));
$type = 'event';
if((! $desc) || (! $start)) {
notice( t('Event description and start time are required.') . EOL);
if((! $summary) || (! $start)) {
notice( t('Event title and start time are required.') . EOL);
goaway($a->get_baseurl() . '/events/new');
}
@ -107,6 +108,7 @@ function events_post(&$a) {
$datarray = array();
$datarray['start'] = $start;
$datarray['finish'] = $finish;
$datarray['summary'] = $summary;
$datarray['desc'] = $desc;
$datarray['location'] = $location;
$datarray['type'] = $type;
@ -118,7 +120,7 @@ function events_post(&$a) {
$datarray['allow_gid'] = $str_group_allow;
$datarray['deny_cid'] = $str_contact_deny;
$datarray['deny_gid'] = $str_group_deny;
$datarray['private'] = $private_event;
$datarray['private'] = (($private_event) ? 1 : 0);
$datarray['id'] = $event_id;
$datarray['created'] = $created;
$datarray['edited'] = $edited;
@ -278,9 +280,11 @@ function events_content(&$a) {
$last_date = $d;
$edit = ((! $rr['cid']) ? array($a->get_baseurl().'/events/event/'.$rr['id'],t('Edit event'),'','') : null);
$title = strip_tags(bbcode($rr['summary']));
if(! $title) {
list($title, $_trash) = explode("<br",bbcode($rr['desc']),2);
$title = strip_tags($title);
}
$html = format_event_html($rr);
$rr['desc'] = bbcode($rr['desc']);
$rr['location'] = bbcode($rr['location']);
@ -351,6 +355,7 @@ function events_content(&$a) {
$n_checked = ((x($orig_event) && $orig_event['nofinish']) ? ' checked="checked" ' : '');
$a_checked = ((x($orig_event) && $orig_event['adjust']) ? ' checked="checked" ' : '');
$t_orig = ((x($orig_event)) ? $orig_event['summary'] : '');
$d_orig = ((x($orig_event)) ? $orig_event['desc'] : '');
$l_orig = ((x($orig_event)) ? $orig_event['location'] : '');
$eid = ((x($orig_event)) ? $orig_event['id'] : 0);
@ -405,10 +410,11 @@ function events_content(&$a) {
'$eid' => $eid,
'$cid' => $cid,
'$uri' => $uri,
'$title' => t('Event details'),
'$desc' => sprintf( t('Format is %s %s. Starting date and Description are required.'),$dateformat,$timeformat),
'$s_text' => t('Event Starts:') . ' <span class="required">*</span> ',
'$title' => t('Event details'),
'$desc' => sprintf( t('Format is %s %s. Starting date and Title are required.'),$dateformat,$timeformat),
'$s_text' => t('Event Starts:') . ' <span class="required" title="' . t('Required') . '">*</span>',
'$s_dsel' => datesel($f,'start',$syear+5,$syear,false,$syear,$smonth,$sday),
'$s_tsel' => timesel('start',$shour,$sminute),
'$n_text' => t('Finish date/time is not known or not relevant'),
@ -418,10 +424,12 @@ function events_content(&$a) {
'$f_tsel' => timesel('finish',$fhour,$fminute),
'$a_text' => t('Adjust for viewer timezone'),
'$a_checked' => $a_checked,
'$d_text' => t('Description:') . ' <span class="required">*</span>',
'$d_text' => t('Description:'),
'$d_orig' => $d_orig,
'$l_text' => t('Location:'),
'$l_orig' => $l_orig,
'$t_text' => t('Title:') . ' <span class="required" title="' . t('Required') . '">*</span>',
'$t_orig' => $t_orig,
'$sh_text' => t('Share this event'),
'$sh_checked' => $sh_checked,
'$acl' => (($cid) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $a->user),false)),

View file

@ -108,7 +108,7 @@ function item_post(&$a) {
}
}
if($parent) logger('mod_post: parent=' . $parent);
if($parent) logger('mod_item: item_post parent=' . $parent);
$profile_uid = ((x($_REQUEST,'profile_uid')) ? intval($_REQUEST['profile_uid']) : 0);
$post_id = ((x($_REQUEST,'post_id')) ? intval($_REQUEST['post_id']) : 0);
@ -228,7 +228,7 @@ function item_post(&$a) {
|| strlen($parent_item['allow_gid'])
|| strlen($parent_item['deny_cid'])
|| strlen($parent_item['deny_gid'])) {
$private = 1;
$private = (($parent_item['private']) ? $parent_item['private'] : 1);
}
$str_contact_allow = $parent_item['allow_cid'];
@ -728,26 +728,10 @@ function item_post(&$a) {
}
// We won't be able to sign Diaspora comments for authenticated visitors - we don't have their private key
if($self) {
require_once('include/bb2diaspora.php');
$signed_body = html_entity_decode(bb2diaspora($datarray['body']));
$myaddr = $a->user['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
if($datarray['verb'] === ACTIVITY_LIKE)
$signed_text = $datarray['guid'] . ';' . 'Post' . ';' . $parent_item['guid'] . ';' . 'true' . ';' . $myaddr;
else
$signed_text = $datarray['guid'] . ';' . $parent_item['guid'] . ';' . $signed_body . ';' . $myaddr;
// Store the comment signature information in case we need to relay to Diaspora
store_diaspora_comment_sig($datarray, $author, ($self ? $a->user['prvkey'] : false), $parent_item, $post_id);
$authorsig = base64_encode(rsa_sign($signed_text,$a->user['prvkey'],'sha256'));
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($post_id),
dbesc($signed_text),
dbesc(base64_encode($authorsig)),
dbesc($myaddr)
);
}
}
else {
$parent = $post_id;
@ -1038,3 +1022,47 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) {
return array('replaced' => $replaced, 'contact' => $r[0]);
}
function store_diaspora_comment_sig($datarray, $author, $uprvkey, $parent_item, $post_id) {
// We won't be able to sign Diaspora comments for authenticated visitors - we don't have their private key
$enabled = intval(get_config('system','diaspora_enabled'));
if(! $enabled) {
logger('mod_item: diaspora support disabled, not storing comment signature', LOGGER_DEBUG);
return;
}
logger('mod_item: storing diaspora comment signature');
require_once('include/bb2diaspora.php');
$signed_body = html_entity_decode(bb2diaspora($datarray['body']));
// $myaddr = $user['nickname'] . '@' . substr($baseurl, strpos($baseurl,'://') + 3);
// if( $author['network'] === NETWORK_DIASPORA)
// $diaspora_handle = $author['addr'];
// else {
// Only works for NETWORK_DFRN
$contact_baseurl_start = strpos($author['url'],'://') + 3;
$contact_baseurl_length = strpos($author['url'],'/profile') - $contact_baseurl_start;
$contact_baseurl = substr($author['url'], $contact_baseurl_start, $contact_baseurl_length);
$diaspora_handle = $author['nick'] . '@' . $contact_baseurl;
// }
$signed_text = $datarray['guid'] . ';' . $parent_item['guid'] . ';' . $signed_body . ';' . $diaspora_handle;
if( $uprvkey !== false )
$authorsig = base64_encode(rsa_sign($signed_text,$uprvkey,'sha256'));
else
$authorsig = '';
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($post_id),
dbesc($signed_text),
dbesc(base64_encode($authorsig)),
dbesc($diaspora_handle)
);
return;
}

View file

@ -37,7 +37,7 @@ function like_content(&$a) {
logger('like: verb ' . $verb . ' item ' . $item_id);
$r = q("SELECT * FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s') AND `id` = `parent` LIMIT 1",
$r = q("SELECT * FROM `item` WHERE `id` = '%s' OR `uri` = '%s' LIMIT 1",
dbesc($item_id),
dbesc($item_id)
);
@ -121,57 +121,16 @@ function like_content(&$a) {
intval($like_item['id'])
);
// Clean up the `sign` table
// Clean up the Diaspora signatures for this like
// Go ahead and do it even if Diaspora support is disabled. We still want to clean up
// if it had been enabled in the past
$r = q("DELETE FROM `sign` WHERE `iid` = %d",
intval($like_item['id'])
);
// Save the author information for the unlike in case we need to relay to Diaspora
// Note that we can only create a signature for a user of the local server. We don't have
// a key for remote users. That is ok, because if a remote user is "unlike"ing a post, it
// means we are the relay, and for relayable_retractions, Diaspora
// only checks the parent_author_signature if it doesn't have to relay further
//
// If $item['resource-id'] exists, it means the item is a photo. Diaspora doesn't support
// likes on photos, so don't bother.
if(($activity === ACTIVITY_LIKE) && (! $item['resource-id'])) {
$signed_text = $like_item['guid'] . ';' . 'Like';
if( $contact['network'] === NETWORK_DIASPORA)
$diaspora_handle = $contact['addr'];
else { // Only works for NETWORK_DFRN
$contact_baseurl_start = strpos($contact['url'],'://') + 3;
$contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start;
$contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length);
$diaspora_handle = $contact['nick'] . '@' . $contact_baseurl;
// Get contact's private key if he's a user of the local Friendica server
$r = q("SELECT `contact`.`uid` FROM `contact` WHERE `url` = '%s' AND `self` = 1 LIMIT 1",
dbesc($contact['url'])
);
if( $r) {
$contact_uid = $r['uid'];
$r = q("SELECT prvkey FROM user WHERE uid = %d LIMIT 1",
intval($contact_uid)
);
if( $r)
$authorsig = base64_encode(rsa_sign($signed_text,$r['prvkey'],'sha256'));
}
}
if(! isset($authorsig))
$authorsig = '';
q("insert into sign (`retract_iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($like_item['id']),
dbesc($signed_text),
dbesc($authorsig),
dbesc($diaspora_handle)
);
}
store_diaspora_like_retract_sig($activity, $item, $like_item, $contact);
// proc_run('php',"include/notifier.php","like","$post_id"); // $post_id isn't defined here!
@ -217,6 +176,7 @@ EOT;
$arr['gravity'] = GRAVITY_LIKE;
$arr['parent'] = $item['id'];
$arr['parent-uri'] = $item['uri'];
$arr['thr-parent'] = $item['uri'];
$arr['owner-name'] = $remote_owner['name'];
$arr['owner-link'] = $remote_owner['url'];
$arr['owner-avatar'] = $remote_owner['thumb'];
@ -251,15 +211,98 @@ EOT;
// Save the author information for the like in case we need to relay to Diaspora
store_diaspora_like_sig($activity, $post_type, $contact, $post_id);
$arr['id'] = $post_id;
call_hooks('post_local_end', $arr);
proc_run('php',"include/notifier.php","like","$post_id");
killme();
// return; // NOTREACHED
}
function store_diaspora_like_retract_sig($activity, $item, $like_item, $contact) {
// Note that we can only create a signature for a user of the local server. We don't have
// a key for remote users. That is ok, because if a remote user is "unlike"ing a post, it
// means we are the relay, and for relayable_retractions, Diaspora
// only checks the parent_author_signature if it doesn't have to relay further
//
// If $item['resource-id'] exists, it means the item is a photo. Diaspora doesn't support
// likes on photos, so don't bother.
$enabled = intval(get_config('system','diaspora_enabled'));
if(! $enabled) {
logger('mod_like: diaspora support disabled, not storing like retraction signature', LOGGER_DEBUG);
return;
}
logger('mod_like: storing diaspora like retraction signature');
if(($activity === ACTIVITY_LIKE) && (! $item['resource-id'])) {
$signed_text = $like_item['guid'] . ';' . 'Like';
// if( $contact['network'] === NETWORK_DIASPORA)
// $diaspora_handle = $contact['addr'];
// else {
// Only works for NETWORK_DFRN
$contact_baseurl_start = strpos($contact['url'],'://') + 3;
$contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start;
$contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length);
$diaspora_handle = $contact['nick'] . '@' . $contact_baseurl;
// Get contact's private key if he's a user of the local Friendica server
$r = q("SELECT `contact`.`uid` FROM `contact` WHERE `url` = '%s' AND `self` = 1 LIMIT 1",
dbesc($contact['url'])
);
if( $r) {
$contact_uid = $r['uid'];
$r = q("SELECT prvkey FROM user WHERE uid = %d LIMIT 1",
intval($contact_uid)
);
if( $r)
$authorsig = base64_encode(rsa_sign($signed_text,$r['prvkey'],'sha256'));
}
// }
if(! isset($authorsig))
$authorsig = '';
q("insert into sign (`retract_iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($like_item['id']),
dbesc($signed_text),
dbesc($authorsig),
dbesc($diaspora_handle)
);
}
return;
}
function store_diaspora_like_sig($activity, $post_type, $contact, $post_id) {
// Note that we can only create a signature for a user of the local server. We don't have
// a key for remote users. That is ok, because if a remote user is "unlike"ing a post, it
// means we are the relay, and for relayable_retractions, Diaspora
// only checks the parent_author_signature if it doesn't have to relay further
$enabled = intval(get_config('system','diaspora_enabled'));
if(! $enabled) {
logger('mod_like: diaspora support disabled, not storing like signature', LOGGER_DEBUG);
return;
}
logger('mod_like: storing diaspora like signature');
if(($activity === ACTIVITY_LIKE) && ($post_type === t('status'))) {
if( $contact['network'] === NETWORK_DIASPORA)
$diaspora_handle = $contact['addr'];
else { // Only works for NETWORK_DFRN
// if( $contact['network'] === NETWORK_DIASPORA)
// $diaspora_handle = $contact['addr'];
// else {
// Only works for NETWORK_DFRN
$contact_baseurl_start = strpos($contact['url'],'://') + 3;
$contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start;
$contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length);
@ -279,7 +322,7 @@ EOT;
if( $r)
$contact_uprvkey = $r['prvkey'];
}
}
// }
$r = q("SELECT guid, parent FROM `item` WHERE id = %d LIMIT 1",
intval($post_id)
@ -307,13 +350,5 @@ EOT;
}
}
$arr['id'] = $post_id;
call_hooks('post_local_end', $arr);
proc_run('php',"include/notifier.php","like","$post_id");
killme();
// return; // NOTREACHED
return;
}

View file

@ -33,7 +33,7 @@ function lockview_content(&$a) {
$deny_users = expand_acl($item['deny_cid']);
$deny_groups = expand_acl($item['deny_gid']);
if(($item['private']) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
&& (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
echo t('Remote privacy information not available.') . '<br />';

View file

@ -215,10 +215,10 @@ function parse_url_content(&$a) {
$i = fetch_url($image);
if($i) {
require_once('include/Photo.php');
// guess mimetype from headers or filename
$type = guess_image_type($image,true);
require_once('include/Photo.php');
$ph = new Photo($i, $type);
if($ph->is_valid()) {
if($ph->getWidth() > 300 || $ph->getHeight() > 300) {

View file

@ -39,7 +39,9 @@ function photos_init(&$a) {
$o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg') . '" alt="' . $a->data['user']['username'] . '" /></div>';
$o .= '</div>';
if(! intval($a->data['user']['hidewall'])) {
$albums_visible = ((intval($a->data['user']['hidewall']) && (! local_user()) && (! remote_user())) ? false : true);
if($albums_visible) {
$o .= '<div id="side-bar-photos-albums" class="widget">';
$o .= '<h3>' . '<a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '">' . t('Photo Albums') . '</a></h3>';
@ -709,6 +711,24 @@ function photos_post(&$a) {
logger('mod/photos.php: photos_post(): loading the contents of ' . $src , LOGGER_DEBUG);
$imagedata = @file_get_contents($src);
$r = q("select sum(octet_length(data)) as total from photo where uid = %d and scale = 0 and album != 'Contact Photos' ",
intval($a->data['user']['uid'])
);
$limit = service_class_fetch($a->data['user']['uid'],'photo_upload_limit');
if(($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) {
notice( upgrade_message() . EOL );
@unlink($src);
$foo = 0;
call_hooks('photo_post_end',$foo);
killme();
}
$ph = new Photo($imagedata, $type);
if(! $ph->is_valid()) {
@ -966,12 +986,25 @@ function photos_content(&$a) {
<input type="submit" name="submit" value="' . t('Submit') . '" id="photos-upload-submit" /> </div>';
$r = q("select sum(octet_length(data)) as total from photo where uid = %d and scale = 0 and album != 'Contact Photos' ",
intval($a->data['user']['uid'])
);
$limit = service_class_fetch($a->data['user']['uid'],'photo_upload_limit');
if($limit !== false) {
$usage_message = sprintf( t("You have used %1$.2f Mbytes of %2$.2f Mbytes photo storage."), $r[0]['total'] / 1024000, $limit / 1024000 );
}
else {
$usage_message = sprintf( t('You have used %1$.2f Mbytes of photo storage.'), $r[0]['total'] / 1024000 );
}
$tpl = get_markup_template('photos_upload.tpl');
$o .= replace_macros($tpl,array(
'$pagename' => t('Upload Photos'),
'$sessid' => session_id(),
'$usage' => $usage_message,
'$nickname' => $a->data['user']['nickname'],
'$newalbum' => t('New album name: '),
'$existalbumtext' => t('or existing album name: '),

View file

@ -130,6 +130,9 @@ function profiles_post(&$a) {
$politic = notags(trim($_POST['politic']));
$religion = notags(trim($_POST['religion']));
$likes = fix_mce_lf(escape_tags(trim($_POST['likes'])));
$dislikes = fix_mce_lf(escape_tags(trim($_POST['dislikes'])));
$about = fix_mce_lf(escape_tags(trim($_POST['about'])));
$interest = fix_mce_lf(escape_tags(trim($_POST['interest'])));
$contact = fix_mce_lf(escape_tags(trim($_POST['contact'])));
@ -156,6 +159,14 @@ function profiles_post(&$a) {
$changes[] = '[color=#ff0000]&hearts;[/color] ' . t('Romantic Partner');
$value = strip_tags($with);
}
if($likes != $orig[0]['likes']) {
$changes[] = t('Likes');
$value = $likes;
}
if($dislikes != $orig[0]['dislikes']) {
$changes[] = t('Dislikes');
$value = $dislikes;
}
if($work != $orig[0]['work']) {
$changes[] = t('Work/Employment');
}
@ -222,6 +233,8 @@ function profiles_post(&$a) {
`religion` = '%s',
`pub_keywords` = '%s',
`prv_keywords` = '%s',
`likes` = '%s',
`dislikes` = '%s',
`about` = '%s',
`interest` = '%s',
`contact` = '%s',
@ -254,6 +267,8 @@ function profiles_post(&$a) {
dbesc($religion),
dbesc($pub_keywords),
dbesc($prv_keywords),
dbesc($likes),
dbesc($dislikes),
dbesc($about),
dbesc($interest),
dbesc($contact),
@ -577,6 +592,8 @@ function profiles_content(&$a) {
'$lbl_religion' => t('Religious Views:'),
'$lbl_pubkey' => t('Public Keywords:'),
'$lbl_prvkey' => t('Private Keywords:'),
'$lbl_likes' => t('Likes:'),
'$lbl_dislikes' => t('Dislikes:'),
'$lbl_ex2' => t('Example: fishing photography software'),
'$lbl_pubdsc' => t("\x28Used for suggesting potential friends, can be seen by others\x29"),
'$lbl_prvdsc' => t("\x28Used for searching profiles, never shown to others\x29"),
@ -617,6 +634,8 @@ function profiles_content(&$a) {
'$religion' => $r[0]['religion'],
'$pub_keywords' => $r[0]['pub_keywords'],
'$prv_keywords' => $r[0]['prv_keywords'],
'$likes' => $r[0]['likes'],
'$dislikes' => $r[0]['dislikes'],
'$music' => $r[0]['music'],
'$book' => $r[0]['book'],
'$tv' => $r[0]['tv'],

View file

@ -677,6 +677,14 @@ function settings_content(&$a) {
$tpl = get_markup_template("settings_connectors.tpl");
if(! service_class_allows(local_user(),'email_connect')) {
$mail_disabled_message = upgrade_bool_message();
}
else {
$mail_disabled_message = (($mail_disabled) ? t('Email access is disabled on this site.') : '');
}
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_connectors"),
@ -688,7 +696,7 @@ function settings_content(&$a) {
'$h_imap' => t('Email/Mailbox Setup'),
'$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
'$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $mail_chk,''),
'$mail_disabled' => (($mail_disabled) ? t('Email access is disabled on this site.') : ''),
'$mail_disabled' => $mail_disabled_message,
'$mail_server' => array('mail_server', t('IMAP server name:'), $mail_server, ''),
'$mail_port' => array('mail_port', t('IMAP port:'), $mail_port, ''),
'$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array( 'notls'=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL')),
@ -921,9 +929,6 @@ function settings_content(&$a) {
));
$invisible = (((! $profile['publish']) && (! $profile['net-publish']))
? true : false);
@ -931,9 +936,6 @@ function settings_content(&$a) {
info( t('Profile is <strong>not published</strong>.') . EOL );
$subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . $a->get_baseurl(true) . '/profile/' . $nickname : '');
$tpl_addr = get_markup_template("settings_nick_set.tpl");
@ -1029,17 +1031,6 @@ function settings_content(&$a) {
'$h_descadvn' => t('Change the behaviour of this account for special situations'),
'$pagetype' => $pagetype,
));
call_hooks('settings_form',$o);

View file

@ -15,7 +15,7 @@ function share_init(&$a) {
intval($post_id),
intval(local_user())
);
if(! count($r) || ($r[0]['private'] && ($r[0]['network'] != NETWORK_FEED)))
if(! count($r) || ($r[0]['private'] == 1))
killme();
$o = '';

View file

@ -60,6 +60,19 @@ function wall_attach_post(&$a) {
return;
}
$r = q("select sum(octet_length(data)) as total from attach where uid = %d ",
intval($page_owner_uid)
);
$limit = service_class_fetch($page_owner_uid,'attach_upload_limit');
if(($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) {
echo upgrade_message(true) . EOL ;
@unlink($src);
killme();
}
$filedata = @file_get_contents($src);
$mimetype = z_mime_content_type($filename);
$hash = random_string();

View file

@ -79,6 +79,19 @@ function wall_upload_post(&$a) {
killme();
}
$r = q("select sum(octet_length(data)) as total from photo where uid = %d and scale = 0 and album != 'Contact Photos' ",
intval($page_owner_uid)
);
$limit = service_class_fetch($page_owner_uid,'photo_upload_limit');
if(($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) {
echo upgrade_message(true) . EOL ;
@unlink($src);
killme();
}
$imagedata = @file_get_contents($src);
$ph = new Photo($imagedata, $filetype);

View file

@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1149 );
define( 'UPDATE_VERSION' , 1151 );
/**
*
@ -1289,3 +1289,21 @@ function update_1148() {
return UPDATE_FAILED;
return UPDATE_SUCCESS;
}
function update_1149() {
$r1 = q("ALTER TABLE profile ADD likes text NOT NULL after prv_keywords");
$r2 = q("ALTER TABLE profile ADD dislikes text NOT NULL after likes");
if (! ($r1 && $r2))
return UPDATE_FAILED;
return UPDATE_SUCCESS;
}
function update_1150() {
$r = q("ALTER TABLE event ADD summary text NOT NULL after finish, add index ( uid ), add index ( cid ), add index ( uri ), add index ( `start` ), add index ( finish ), add index ( `type` ), add index ( adjust ) ");
if(! $r)
return UPDATE_FAILED;
return UPDATE_SUCCESS;
}

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
Hey,
I'm $sitename.
I'm $sitename;
The friendica developers released update $update recently,
but when I tried to install it, something went terribly wrong.
This needs to be fixed soon and I can't do it alone. Please contact a

View file

@ -26,6 +26,10 @@ $f_dsel $f_tsel
<div id="event-adjust-break"></div>
<div id="event-summary-text">$t_text</div>
<input type="text" id="event-summary" name="summary" value="$t_orig" />
<div id="event-desc-text">$d_text</div>
<textarea id="event-desc-textarea" name="desc">$d_orig</textarea>

View file

@ -1,4 +1,7 @@
<h3>$pagename</h3>
<div id="photos-usage-message">$usage</div>
<form action="photos/$nickname" enctype="multipart/form-data" method="post" name="photos-upload-form" id="photos-upload-form" >
<div id="photos-upload-new-wrapper" >
<div id="photos-upload-newalbum-div">

View file

@ -89,6 +89,19 @@
</dl>
{{ endif }}
{{ if $profile.likes }}
<dl id="aprofile-likes" class="aprofile">
<dt>$profile.likes.0</dt>
<dd>$profile.likes.1</dd>
</dl>
{{ endif }}
{{ if $profile.dislikes }}
<dl id="aprofile-dislikes" class="aprofile">
<dt>$profile.dislikes.0</dt>
<dd>$profile.dislikes.1</dd>
</dl>
{{ endif }}
{{ if $profile.contact }}
<dl id="aprofile-contact" class="aprofile">

View file

@ -187,6 +187,30 @@ $lbl_hobbies
</div>
<div id="likes-jot-wrapper" >
<p id="likes-jot-desc" >
$lbl_likes
</p>
<textarea rows="10" cols="72" id="likes-jot-text" name="likes" >$likes</textarea>
</div>
<div id="likes-jot-end"></div>
</div>
<div id="dislikes-jot-wrapper" >
<p id="dislikes-jot-desc" >
$lbl_dislikes
</p>
<textarea rows="10" cols="72" id="dislikes-jot-text" name="dislikes" >$dislikes</textarea>
</div>
<div id="dislikes-jot-end"></div>
</div>
<div id="contact-jot-wrapper" >
<p id="contact-jot-desc" >
$lbl_social

View file

@ -70,7 +70,7 @@
<div style="display: none;">
<div id="profile-jot-acl-wrapper" style="width:auto;height:auto;overflow:auto;">
$acl
<hr style="clear:both"/>
<hr style="clear:both;"/>
<div id="profile-jot-email-label">$emailcc</div><input type="text" name="emailcc" id="profile-jot-email" title="$emtitle" />
<div id="profile-jot-email-end"></div>
$jotnets

View file

@ -528,7 +528,7 @@ if ($color=="dark") $color_path = "/diabook-dark/";
$entry = replace_macros($tpl,array(
'$id' => $rr['id'],
'$profile-link' => $profile_link,
'$photo' => $rr[$photo],
'$photo' => $a->get_cached_avatar_image($rr[$photo]),
'$alt-text' => $rr['name'],
));
$aside['$lastusers_items'][] = $entry;

View file

@ -19,8 +19,9 @@
<div id="conversation-end"></div>
{{ if $dropping }}
<div class="delete-checked">
<a href="#" onclick="deleteCheckedItems();return false;"><span class="icon delete"></span><span class="s22 text" onmouseover="imgbright(this);" onmouseout="imgdull(this);">$dropping</span></a>
<div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems(); return false;">
<div id="item-delete-selected-icon" class="icon drophide" title="$dropping" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div>
<div id="item-delete-selected-desc" >$dropping</div>
</div>
<div id="item-delete-selected-end"></div>
{{ endif }}

View file

@ -59,7 +59,7 @@ h6{font-size:xx-small;}
.button{color:#eeeecc;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;padding:5px;cursor:pointer;}.button a{color:#eeeecc;font-weight:bold;}
#profile-listing-desc a{color:#eeeecc;font-weight:bold;}
[class$="-desc"],[id$="-desc"]{color:#eeeecc;background:#2e2f2e;border:2px outset #d4d580;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;margin:3px 10px 7px 0;padding:5px;font-weight:bold;font-size:smaller;}
#item-delete-selected-desc{float:left;margin-right:5px;}#item-delete-selected-desc:hover{text-decoration:underline;}
#item-delete-selected-desc{float:left;font-size:x-small;margin-right:5px;}#item-delete-selected-desc:hover{text-decoration:underline;}
.intro-approve-as-friend-desc{margin-top:10px;}
.intro-desc{margin-bottom:20px;font-weight:bold;}
#group-edit-desc{margin:10px 0px;}
@ -214,7 +214,7 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm
.wall-item-subtools1{width:30px;height:30px;list-style:none outside none;margin:18px 0 30px -20px;padding:0;}
.wall-item-subtools2{width:25px;height:25px;list-style:none outside none;margin:-78px 0 0 5px;padding:0;}
.wall-item-title{font-size:1.2em;font-weight:bold;margin-bottom:1.4em;}
.wall-item-body{margin:15px 10px 10px 0px;text-align:left;overflow-x:auto;}
.wall-item-body{margin:1em;text-align:left;overflow-x:auto;}
.wall-item-lock-wrapper{float:right;width:22px;height:22px;margin:0 -5px 0 0;opacity:1;}
.wall-item-dislike,.wall-item-like{clear:left;font-size:0.8em;color:#888b85;margin:5px 0 5px 10.2em;-webkit-transition:all 0.75s ease-in-out;-moz-transition:all 0.75s ease-in-out;-o-transition:all 0.75s ease-in-out;-ms-transition:all 0.75s ease-in-out;transition:all 0.75s ease-in-out;opacity:0.5;}.wall-item-dislike:hover,.wall-item-like:hover{opacity:1;}
.wall-item-author,.wall-item-actions-author,.wall-item-ago{color:#eeeecc;line-height:1;display:inline-block;font-size:x-small;margin:0.5em auto;font-weight:bold;}
@ -226,7 +226,6 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm
.wallwall .wall-item-photo-end{clear:both;}
.wall-item-arrowphoto-wrapper{position:absolute;left:35px;top:80px;z-index:10002;}
.wall-item-photo-menu{min-width:92px;font-size:0.75em;border:2px solid #555753;border-top:0px;background:#555753;position:absolute;left:-2px;top:101px;display:none;z-index:10003;-o-border-radius:0 5px 5px 5px;-webkit-border-radius:0 5px 5px 5px;-moz-border-radius:0 5px 5px 5px;-ms-border-radius:0 5px 5px 5px;border-radius:0 5px 5px 5px;}.wall-item-photo-menu li a{white-space:nowrap;display:block;padding:5px 6px;color:#eeeeee;}.wall-item-photo-menu li a:hover{color:#555753;background:#eeeeee;}
#item-delete-selected{overflow:auto;width:100%;}
#connect-services-header,#extra-help-header{margin:1.5em 0 0 0;}
#connect-services,#extra-help{margin:0px;padding:0px;list-style:none;list-style-position:inside;margin:1em 0 0 0;}#connect-services li,#extra-help li{display:inline;}
.ccollapse-wrapper{font-size:0.9em;margin-left:5em;}
@ -390,9 +389,8 @@ div[id$="wrapper"]{height:100%;}div[id$="wrapper"] br{clear:left;}
.filesavetags:hover,.categorytags:hover{margin:20px 0;opacity:1.0 !important;}
.item-select{opacity:0.1;margin:5px 0 0 6px !important;}.item-select:hover{opacity:1;}
.checkeditem{opacity:1;}
#item-delete-selected{margin-top:30px;}
.delete-checked{position:absolute;left:35px;margin-top:20px;}
#item-delete-selected-icon{float:left;margin-right:5px;}
#item-delete-selected{margin:3em 5px;position:relative;left:4em;width:15em;overflow:auto;}
#item-delete-selected-icon{float:left;margin:11px 5px;}
.fc-state-highlight{background:#eeeecc;color:#2e2f2e;}
.directory-item{float:left;margin:0 5px 4px 0;padding:3px;width:180px;height:250px;position:relative;}
#group-sidebar{margin-bottom:10px;}

View file

@ -325,6 +325,7 @@ h6 {
}
#item-delete-selected-desc {
float: left;
font-size: x-small;
margin-right: 5px;
&:hover {
text-decoration: underline;
@ -1428,7 +1429,7 @@ nav #nav-notifications-linkmenu {
margin-bottom: 1.4em;
}
.wall-item-body {
margin: 15px 10px 10px 0px;
margin: 1em;
text-align: left;
overflow-x: auto;
}
@ -1533,10 +1534,6 @@ nav #nav-notifications-linkmenu {
}
}
}
#item-delete-selected {
overflow: auto;
width: 100%;
}
#connect-services-header,
#extra-help-header {
margin: 1.5em 0 0 0;
@ -2369,18 +2366,15 @@ div {
opacity: 1;
}
#item-delete-selected {
margin-top: 30px;
}
/* was tired of having no way of moving it around, so
* here's a little 'hook' to do so */
.delete-checked {
position: absolute;
left: 35px;
margin-top: 20px;
margin: 3em 5px;
position: relative;
left: 4em;
width: 15em;
overflow: auto;
}
#item-delete-selected-icon {
float: left;
margin-right: 5px;
margin: 11px 5px;
}
.fc-state-highlight {
background: @main_colour;

View file

@ -20,25 +20,26 @@
<div id="profile-jot-submit-wrapper" class="jothidden">
<div id="profile-upload-wrapper" style="display: $visitor;">
<div id="wall-image-upload-div"><a class="icon camera" href="#" onclick="return false;" id="wall-image-upload" title="$upload"></a></div>
<div id="wall-image-upload-div"><a href="#" onclick="return false;" id="wall-image-upload" class="icon camera" title="$upload"></a></div>
</div>
<div id="profile-attach-wrapper" style="display: $visitor;">
<div id="wall-file-upload-div"><a class="icon attach" href="#" onclick="return false;" id="wall-file-upload" title="$attach"></a></div>
<div id="wall-file-upload-div"><a href="#" onclick="return false;" id="wall-file-upload" class="icon attach" title="$attach"></a></div>
</div>
<div id="profile-link-wrapper" style="display: $visitor;" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);">
<a class="icon link" id="profile-link" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;" title="$weblink"></a>
<a id="profile-link" class="icon link" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;" title="$weblink"></a>
</div>
<div id="profile-video-wrapper" style="display: $visitor;">
<a class="icon video" id="profile-video" onclick="jotVideoURL();return false;" title="$video"></a>
<a id="profile-video" class="icon video" onclick="jotVideoURL();return false;" title="$video"></a>
</div>
<div id="profile-audio-wrapper" style="display: $visitor;">
<a class="icon audio" id="profile-audio" onclick="jotAudioURL();return false;" title="$audio"></a>
<a id="profile-audio" class="icon audio" onclick="jotAudioURL();return false;" title="$audio"></a>
</div>
<div id="profile-location-wrapper" style="display: $visitor;">
<a class="icon globe" id="profile-location" onclick="jotGetLocation();return false;" title="$setloc"></a>
<a id="profile-location" class="icon globe" onclick="jotGetLocation();return false;" title="$setloc"></a>
</div>
<div id="profile-nolocation-wrapper" style="display: none;">
<a class="icon noglobe" id="profile-nolocation" onclick="jotClearLocation();return false;" title="$noloc"></a>
<a id="profile-nolocation" class="icon noglobe" onclick="jotClearLocation();return false;" title="$noloc"></a>
</div>
<div id="profile-jot-plugin-wrapper">
@ -57,12 +58,12 @@
</div> <!-- /#jot-tools -->
<div id="jot-preview-content" style="display:none;"></div>
<div style="display: none;">
<div id="profile-jot-acl-wrapper" style="width:auto;height:auto;overflow:auto;">
$acl
<hr style="clear:both" />
<div id="profile-jot-email-label">$emailcc</div>
<input type="text" name="emailcc" id="profile-jot-email" title="$emtitle" />
<div id="profile-jot-email-label">$emailcc</div><input type="text" name="emailcc" id="profile-jot-email" title="$emtitle" />
<div id="profile-jot-email-end"></div>
$jotnets
</div>

View file

@ -59,7 +59,7 @@ h6{font-size:xx-small;}
.button{color:#111111;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;padding:5px;cursor:pointer;}.button a{color:#111111;font-weight:bold;}
#profile-listing-desc a{color:#eeeeec;font-weight:bold;}
[class$="-desc"],[id$="-desc"]{color:#eeeeec;background:#2e3436;border:2px outset #111111;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;margin:3px 10px 7px 0;padding:5px;font-weight:bold;font-size:smaller;}
#item-delete-selected-desc{float:left;margin-right:5px;}#item-delete-selected-desc:hover{text-decoration:underline;}
#item-delete-selected-desc{float:left;font-size:x-small;margin-right:5px;}#item-delete-selected-desc:hover{text-decoration:underline;}
.intro-approve-as-friend-desc{margin-top:10px;}
.intro-desc{margin-bottom:20px;font-weight:bold;}
#group-edit-desc{margin:10px 0px;}
@ -214,7 +214,7 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm
.wall-item-subtools1{width:30px;height:30px;list-style:none outside none;margin:18px 0 30px -20px;padding:0;}
.wall-item-subtools2{width:25px;height:25px;list-style:none outside none;margin:-78px 0 0 5px;padding:0;}
.wall-item-title{font-size:1.2em;font-weight:bold;margin-bottom:1.4em;}
.wall-item-body{margin:15px 10px 10px 0px;text-align:left;overflow-x:auto;}
.wall-item-body{margin:1em;text-align:left;overflow-x:auto;}
.wall-item-lock-wrapper{float:right;width:22px;height:22px;margin:0 -5px 0 0;opacity:1;}
.wall-item-dislike,.wall-item-like{clear:left;font-size:0.8em;color:#111111;margin:5px 0 5px 10.2em;-webkit-transition:all 0.75s ease-in-out;-moz-transition:all 0.75s ease-in-out;-o-transition:all 0.75s ease-in-out;-ms-transition:all 0.75s ease-in-out;transition:all 0.75s ease-in-out;opacity:0.5;}.wall-item-dislike:hover,.wall-item-like:hover{opacity:1;}
.wall-item-author,.wall-item-actions-author,.wall-item-ago{color:#111111;line-height:1;display:inline-block;font-size:x-small;margin:0.5em auto;font-weight:bold;}
@ -226,7 +226,6 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm
.wallwall .wall-item-photo-end{clear:both;}
.wall-item-arrowphoto-wrapper{position:absolute;left:35px;top:80px;z-index:10002;}
.wall-item-photo-menu{min-width:92px;font-size:0.75em;border:2px solid #555753;border-top:0px;background:#555753;position:absolute;left:-2px;top:101px;display:none;z-index:10003;-o-border-radius:0 5px 5px 5px;-webkit-border-radius:0 5px 5px 5px;-moz-border-radius:0 5px 5px 5px;-ms-border-radius:0 5px 5px 5px;border-radius:0 5px 5px 5px;}.wall-item-photo-menu li a{white-space:nowrap;display:block;padding:5px 6px;color:#eeeeec;}.wall-item-photo-menu li a:hover{color:#555753;background:#eeeeec;}
#item-delete-selected{overflow:auto;width:100%;}
#connect-services-header,#extra-help-header{margin:1.5em 0 0 0;}
#connect-services,#extra-help{margin:0px;padding:0px;list-style:none;list-style-position:inside;margin:1em 0 0 0;}#connect-services li,#extra-help li{display:inline;}
.ccollapse-wrapper{font-size:0.9em;margin-left:5em;}
@ -390,9 +389,8 @@ div[id$="wrapper"]{height:100%;}div[id$="wrapper"] br{clear:left;}
.filesavetags:hover,.categorytags:hover{margin:20px 0;opacity:1.0 !important;}
.item-select{opacity:0.1;margin:5px 0 0 6px !important;}.item-select:hover{opacity:1;}
.checkeditem{opacity:1;}
#item-delete-selected{margin-top:30px;}
.delete-checked{position:absolute;left:35px;margin-top:20px;}
#item-delete-selected-icon{float:left;margin-right:5px;}
#item-delete-selected{margin:3em 5px;position:relative;left:4em;width:15em;overflow:auto;}
#item-delete-selected-icon{float:left;margin:11px 5px;}
.fc-state-highlight{background:#eeeeec;color:#111111;}
.directory-item{float:left;margin:0 5px 4px 0;padding:3px;width:180px;height:250px;position:relative;}
#group-sidebar{margin-bottom:10px;}

View file

@ -326,6 +326,7 @@ h6 {
}
#item-delete-selected-desc {
float: left;
font-size: x-small;
margin-right: 5px;
&:hover {
text-decoration: underline;
@ -1429,7 +1430,7 @@ nav #nav-notifications-linkmenu {
margin-bottom: 1.4em;
}
.wall-item-body {
margin: 15px 10px 10px 0px;
margin: 1em;
text-align: left;
overflow-x: auto;
}
@ -1534,10 +1535,6 @@ nav #nav-notifications-linkmenu {
}
}
}
#item-delete-selected {
overflow: auto;
width: 100%;
}
#connect-services-header,
#extra-help-header {
margin: 1.5em 0 0 0;
@ -2370,18 +2367,15 @@ div {
opacity: 1;
}
#item-delete-selected {
margin-top: 30px;
}
/* was tired of having no way of moving it around, so
* here's a little 'hook' to do so */
.delete-checked {
position: absolute;
left: 35px;
margin-top: 20px;
margin: 3em 5px;
position: relative;
left: 4em;
width: 15em;
overflow: auto;
}
#item-delete-selected-icon {
float: left;
margin-right: 5px;
margin: 11px 5px;
}
.fc-state-highlight {
background: @bg_colour;

View file

@ -78,8 +78,8 @@
</div>
</div>
<div class="wall-item-wrapper-end"></div>
<div class="wall-item-like" id="wall-item-like-$item.id">$item.like</div>
<div class="wall-item-dislike" id="wall-item-dislike-$item.id">$item.dislike</div>
<div class="wall-item-like $item.indent" id="wall-item-like-$item.id">$item.like</div>
<div class="wall-item-dislike $item.indent" id="wall-item-dislike-$item.id">$item.dislike</div>
<div class="wall-item-comment-wrapper" >
$item.comment
</div>

View file

@ -86,8 +86,8 @@ class="icon recycle wall-item-share-buttons" title="$item.vote.share.0" onclick
</div>
</div>
<div class="wall-item-wrapper-end"></div>
<div class="wall-item-like" id="wall-item-like-$item.id">$item.like</div>
<div class="wall-item-dislike" id="wall-item-dislike-$item.id">$item.dislike</div>
<div class="wall-item-like $item.indent" id="wall-item-like-$item.id">$item.like</div>
<div class="wall-item-dislike $item.indent" id="wall-item-dislike-$item.id">$item.dislike</div>
<div class="wall-item-comment-separator"></div>
<div class="wall-item-comment-wrapper">
$item.comment

View file

@ -935,6 +935,10 @@ input#dfrn-url {
background: #EEEEEE;
}
.wall-item-like.comment, .wall-item-dislike.comment {
margin-left: 50px;
}
.wall-item-info {
display: block;
float: left;
@ -1640,6 +1644,9 @@ input#dfrn-url {
display:block!important;
}
#photos-usage-message {
margin-bottom: 15px;
}
#acl-wrapper {
@ -2414,9 +2421,40 @@ aside input[type='text'] {
font-size: 20px;
}
#event-summary-text {
margin-top: 15px;
}
#event-share-checkbox {
float: left;
margin-top: 10px;
}
#event-share-text {
float: left;
margin-top: 10px;
margin-left: 5px;
}
#event-share-break {
clear: both;
margin-bottom: 10px;
}
#event-summary {
width: 400px;
}
.vevent {
border: 1px solid #CCCCCC;
}
.vevent .event-summary {
margin-left: 10px;
margin-right: 10px;
font-weight: bold;
}
.vevent .event-description, .vevent .event-location {
margin-left: 10px;
margin-right: 10px;

View file

@ -1 +1,8 @@
{{ if $classtoday }}
<script>
$(document).ready(function() $lbr
$('#events-reminder').addClass($.trim('$classtoday'));
$rbr);
</script>
{{ endif }}

View file

@ -67,6 +67,8 @@ nav #site-location {
opacity: 1.0;
filter:alpha(opacity=100);
box-shadow: 4px 4px 3px 0 #444444;
margin-left: 0px;
margin-top: 0px;
}
#events-reminder:hover {
@ -108,6 +110,8 @@ nav #site-location {
#posted-date-selector {
margin-left: 30px !important;
margin-top: 5px !important;
margin-right: 0px !important;
margin-bottom: 0px !important;
}
@ -115,6 +119,9 @@ nav #site-location {
box-shadow: 4px 4px 3px 0 #444444;
margin-left: 25px !important;
margin-top: 0px !important;
margin-right: 5px !important;
margin-bottom: 5px !important;
}
.contact-entry-photo img, .profile-match-photo img, #photo-photo img, .directory-photo-img, .photo-album-photo, .photo-top-photo, .profile-jot-text, .group-selected, .nets-selected, .fileas-selected, #profile-jot-submit, .categories-selected {

View file

@ -69,8 +69,8 @@
</div>
</div>
<div class="wall-item-wrapper-end"></div>
<div class="wall-item-like" id="wall-item-like-$item.id">$item.like</div>
<div class="wall-item-dislike" id="wall-item-dislike-$item.id">$item.dislike</div>
<div class="wall-item-like $item.indent" id="wall-item-like-$item.id">$item.like</div>
<div class="wall-item-dislike $item.indent" id="wall-item-dislike-$item.id">$item.dislike</div>
<div class="wall-item-comment-wrapper" >
$item.comment
</div>

View file

@ -74,8 +74,8 @@
</div>
</div>
<div class="wall-item-wrapper-end"></div>
<div class="wall-item-like" id="wall-item-like-$item.id">$item.like</div>
<div class="wall-item-dislike" id="wall-item-dislike-$item.id">$item.dislike</div>
<div class="wall-item-like $item.indent" id="wall-item-like-$item.id">$item.like</div>
<div class="wall-item-dislike $item.indent" id="wall-item-dislike-$item.id">$item.dislike</div>
<div class="wall-item-comment-separator"></div>
<div class="wall-item-comment-wrapper">
$item.comment