Merge branch 'master' into notify

This commit is contained in:
friendica 2011-12-22 15:42:01 -08:00
commit 95b4bc55bf
34 changed files with 3790 additions and 3425 deletions

View file

@ -9,9 +9,9 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '2.3.1193' );
define ( 'FRIENDICA_VERSION', '2.3.1203' );
define ( 'DFRN_PROTOCOL_VERSION', '2.22' );
define ( 'DB_UPDATE_VERSION', 1111 );
define ( 'DB_UPDATE_VERSION', 1112 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@ -1036,6 +1036,8 @@ function get_birthdays() {
if($r && count($r)) {
$total = 0;
$now = strtotime('now');
$cids = array();
$istoday = false;
foreach($r as $rr) {
if(strlen($rr['name']))
@ -1052,6 +1054,13 @@ function get_birthdays() {
foreach($r as $rr) {
if(! strlen($rr['name']))
continue;
// avoid duplicates
if(in_array($rr['cid'],$cids))
continue;
$cids[] = $rr['cid'];
$today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false);
$sparkle = '';
$url = $rr['url'];

View file

@ -694,6 +694,7 @@ CREATE TABLE IF NOT EXISTS `gcontact` (
`url` CHAR( 255 ) NOT NULL ,
`nurl` CHAR( 255 ) NOT NULL ,
`photo` CHAR( 255 ) NOT NULL,
`connect` CHAR( 255 ) NOT NULL,
INDEX ( `nurl` )
) ENGINE = MyISAM DEFAULT CHARSET=utf8;

View file

@ -173,9 +173,9 @@ function bb2diaspora($Text,$preserve_nl = false) {
// html5 video and audio
// $Text = preg_replace("/\[video\](.*?)\[\/video\]/", '<video src="$1" controls="controls" width="425" height="350"><a href="$1">$1</a></video>', $Text);
$Text = preg_replace("/\[video\](.*?)\[\/video\]/", '$1', $Text);
// $Text = preg_replace("/\[audio\](.*?)\[\/audio\]/", '<audio src="$1" controls="controls"><a href="$1">$1</a></audio>', $Text);
$Text = preg_replace("/\[audio\](.*?)\[\/audio\]/", '$1', $Text);
// $Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/", '<iframe src="$1" width="425" height="350"><a href="$1">$1</a></iframe>', $Text);

View file

@ -11,6 +11,7 @@ function stripcode_br_cb($s) {
function tryoembed($match){
$url = ((count($match)==2)?$match[1]:$match[2]);
logger("tryoembed: $url");
$o = oembed_fetch_url($url);
@ -180,22 +181,18 @@ function bbcode($Text,$preserve_nl = false) {
$Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '<iframe src="$1" width="425" height="350"><a href="$1">$1</a></iframe>', $Text);
/*if (get_pconfig(local_user(), 'oembed', 'use_for_youtube' )==1){
// use oembed for youtube links
$Text = preg_replace("/\[youtube\]/",'[embed]',$Text);
$Text = preg_replace("/\[\/youtube\]/",'[/embed]',$Text);
} else {*/
// Youtube extensions
$Text = preg_replace_callback("/\[youtube\](https?:\/\/www.youtube.com\/watch\?v\=.*?)\[\/youtube\]/ism", 'tryoembed', $Text);
$Text = preg_replace_callback("/\[youtube\](https?:\/\/youtu.be\/.*?)\[\/youtube\]/ism",'tryoembed',$Text);
// Youtube extensions
$Text = preg_replace_callback("/\[youtube\](https?:\/\/www.youtube.com\/watch\?v\=.*?)\[\/youtube\]/ism", 'tryoembed', $Text);
$Text = preg_replace_callback("/\[youtube\](www.youtube.com\/watch\?v\=.*?)\[\/youtube\]/ism", 'tryoembed', $Text);
$Text = preg_replace_callback("/\[youtube\](https?:\/\/youtu.be\/.*?)\[\/youtube\]/ism",'tryoembed',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/embed\/(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/embed\/(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text);
$Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '<iframe width="425" height="350" src="http://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $Text);
//}
$Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '<iframe width="425" height="350" src="http://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $Text);
$Text = preg_replace_callback("/\[vimeo\](https?:\/\/player.vimeo.com\/video\/[0-9]+).*?\[\/vimeo\]/ism",'tryoembed',$Text);
$Text = preg_replace_callback("/\[vimeo\](https?:\/\/vimeo.com\/[0-9]+).*?\[\/vimeo\]/ism",'tryoembed',$Text);

View file

@ -294,7 +294,7 @@ function conversation(&$a, $items, $mode, $update) {
$arr = array('item' => $item, 'output' => $tmp_item);
call_hooks('display_item', $arr);
$threads[$threadsid]['id'] = $arr[$item['item_id']];
$threads[$threadsid]['id'] = $item['item_id'];
$threads[$threadsid]['html'] .= $arr['output'];
}

View file

@ -69,7 +69,7 @@ function diaspora_dispatch($importer,$msg) {
$ret = diaspora_retraction($importer,$xmlbase->retraction,$msg);
}
elseif($xmlbase->signed_retraction) {
$ret = diaspora_signed_retraction($importer,$xmlbase->retraction,$msg);
$ret = diaspora_signed_retraction($importer,$xmlbase->signed_retraction,$msg);
}
elseif($xmlbase->photo) {
$ret = diaspora_photo($importer,$xmlbase->photo,$msg);
@ -188,6 +188,13 @@ function diaspora_msg_build($msg,$user,$contact,$prvkey,$pubkey,$public = false)
logger('diaspora_msg_build: ' . $msg, LOGGER_DATA);
// without a public key nothing will work
if(! $pubkey) {
logger('diaspora_msg_build: pubkey missing: contact id: ' . $contact['id']);
return '';
}
$inner_aes_key = random_string(32);
$b_inner_aes_key = base64_encode($inner_aes_key);
$inner_iv = random_string(16);
@ -1562,6 +1569,7 @@ EOT;
function diaspora_retraction($importer,$xml) {
$guid = notags(unxmlify($xml->guid));
$diaspora_handle = notags(unxmlify($xml->diaspora_handle));
$type = notags(unxmlify($xml->type));
@ -1593,7 +1601,8 @@ function diaspora_retraction($importer,$xml) {
// NOTREACHED
}
function diaspora_signed_retraction($importer,$xml) {
function diaspora_signed_retraction($importer,$xml,$msg) {
$guid = notags(unxmlify($xml->target_guid));
$diaspora_handle = notags(unxmlify($xml->sender_handle));
@ -1601,8 +1610,10 @@ function diaspora_signed_retraction($importer,$xml) {
$sig = notags(unxmlify($xml->target_author_signature));
$contact = diaspora_get_contact_by_handle($importer['uid'],$diaspora_handle);
if(! $contact)
if(! $contact) {
logger('diaspora_signed_retraction: no contact');
return;
}
// this may not yet work for comments. Need to see how the relaying works
// and figure out who signs it.
@ -1621,7 +1632,7 @@ function diaspora_signed_retraction($importer,$xml) {
if($type === 'StatusMessage') {
$r = q("select * from item where guid = '%s' and uid = %d limit 1",
dbesc('guid'),
dbesc($guid),
intval($importer['uid'])
);
if(count($r)) {
@ -1633,6 +1644,8 @@ function diaspora_signed_retraction($importer,$xml) {
}
}
}
else
logger('diaspora_signed_retraction: unknown type: ' . $type);
return 202;
// NOTREACHED
@ -1672,6 +1685,12 @@ function diaspora_profile($importer,$xml) {
$birthday = datetime_convert('UTC','UTC',$birthday,'Y-m-d');
// this is to prevent multiple birthday notifications in a single year
// if we already have a stored birthday and the 'm-d' part hasn't changed, preserve the entry, which will preserve the notify year
if(substr($birthday,5) === substr($contact['bd'],5))
$birthday = $contact['bd'];
$r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s', `avatar-date` = '%s' , `bd` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($name),
dbesc(datetime_convert()),

View file

@ -40,17 +40,34 @@ function poco_load($cid,$uid = 0,$url = null) {
if(! $url)
return;
logger('poco_load: ' . $url, LOGGER_DATA);
$url = $url . (($uid) ? '/@me/@all?fields=displayName,urls,photos' : '?fields=displayName,urls,photos') ;
$s = fetch_url($url . '/@me/@all?fields=displayName,urls,photos');
logger('poco_load: ' . $url, LOGGER_DEBUG);
$s = fetch_url($url);
logger('poco_load: returns ' . $s, LOGGER_DATA);
logger('poco_load: return code: ' . $a->get_curl_code(), LOGGER_DEBUG);
if(($a->get_curl_code() > 299) || (! $s))
return;
$j = json_decode($s);
logger('poco_load: json: ' . print_r($j,true),LOGGER_DATA);
if(! isset($j->entry))
return;
$total = 0;
foreach($j->entry as $entry) {
$total ++;
$profile_url = '';
$profile_photo = '';
$connect_url = '';
$name = '';
$name = $entry->displayName;
@ -58,13 +75,18 @@ function poco_load($cid,$uid = 0,$url = null) {
foreach($entry->urls as $url) {
if($url->type == 'profile') {
$profile_url = $url->value;
break;
continue;
}
if($url->type == 'webfinger') {
$connect_url = str_replace('acct:' , '', $url->value);
continue;
}
}
foreach($entry->photos as $photo) {
if($photo->type == 'profile') {
$profile_photo = $photo->value;
break;
continue;
}
}
@ -79,21 +101,23 @@ function poco_load($cid,$uid = 0,$url = null) {
$gcid = $x[0]['id'];
if($x[0]['name'] != $name || $x[0]['photo'] != $profile_photo) {
q("update gcontact set `name` = '%s', `photo` = '%s' where
`nurl` = '%s' limit 1",
q("update gcontact set `name` = '%s', `photo` = '%s', `connect` = '%s'
where `nurl` = '%s' limit 1",
dbesc($name),
dbesc($profile_photo),
dbesc($connect_url),
dbesc(normalise_link($profile_url))
);
}
}
else {
q("insert into `gcontact` (`name`,`url`,`nurl`,`photo`)
values ( '%s', '%s', '%s', '%s') ",
q("insert into `gcontact` (`name`,`url`,`nurl`,`photo`,`connect`)
values ( '%s', '%s', '%s', '%s','%s') ",
dbesc($name),
dbesc($profile_url),
dbesc(normalise_link($profile_url)),
dbesc($profile_photo)
dbesc($profile_photo),
dbesc($connect_url)
);
$x = q("select * from `gcontact` where `nurl` = '%s' limit 1",
dbesc(normalise_link($profile_url))
@ -127,6 +151,7 @@ function poco_load($cid,$uid = 0,$url = null) {
}
}
logger("poco_load: loaded $total entries",LOGGER_DEBUG);
q("delete from glink where `cid` = %d and `uid` = %d and `updated` < UTC_TIMESTAMP - INTERVAL 2 DAY",
intval($cid),
@ -222,20 +247,22 @@ function suggestion_query($uid, $start = 0, $limit = 40) {
intval($limit)
);
if(count($r))
if(count($r) && count($r) >= ($limit -1))
return $r;
$r = q("SELECT gcontact.* from gcontact
$r2 = q("SELECT gcontact.* from gcontact
left join glink on glink.gcid = gcontact.id
where uid = 0 and cid = 0 and not gcontact.nurl in ( select nurl from contact where uid = %d)
where glink.uid = 0 and glink.cid = 0 and not gcontact.nurl in ( select nurl from contact where uid = %d)
and not gcontact.id in ( select gcid from gcign where uid = %d )
order by rand limit %d, %d ",
order by rand() limit %d, %d ",
intval($uid),
intval($uid),
intval($start),
intval($limit)
);
return $r;
return array_merge($r,$r2);
}

View file

@ -635,7 +635,7 @@ function search($s,$id='search-box',$url='/search',$save = false) {
if(! function_exists('valid_email')) {
function valid_email($x){
if(preg_match('/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/',$x))
if(preg_match('/^[_a-zA-Z0-9\-\+]+(\.[_a-zA-Z0-9\-\+]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/',$x))
return true;
return false;
}}

View file

@ -171,6 +171,9 @@ ACL.prototype.update_view = function(){
$('.profile-jot-net input').attr('disabled', 'disabled');
$('#profile-jot-desc').html('&nbsp;');
}
$("#acl-list-content .acl-list-item").each(function(){
$(this).removeClass("groupshow grouphide");
});
$("#acl-list-content .acl-list-item").each(function(){
itemid = $(this).attr('id');
@ -194,8 +197,17 @@ ACL.prototype.update_view = function(){
uclass="grouphide";
}
$(that.group_uids[id]).each(function(i,v){
$("#c"+v).removeClass("groupshow grouphide").addClass(uclass);
$(that.group_uids[id]).each(function(i,v) {
if(uclass == "grouphide")
$("#c"+v).removeClass("groupshow");
if(uclass != "") {
var cls = $("#c"+v).attr('class');
if( cls == undefined)
return true;
var hiding = cls.indexOf('grouphide');
if(hiding == -1)
$("#c"+v).addClass(uclass);
}
});
break;

View file

@ -241,26 +241,34 @@
$('.tread-wrapper',data).each(function() {
var ident = $(this).attr('id');
if($('#' + ident).length == 0 && profile_page == 1) {
$('img',this).each(function() {
$(this).attr('src',$(this).attr('dst'));
});
$('#' + prev).after($(this));
}
else {
$('img',this).each(function() {
$(this).attr('src',$(this).attr('dst'));
});
$('#' + ident).replaceWith($(this));
}
prev = ident;
});
// reset vars for inserting individual items
prev = 'live-' + src;
/* prev = 'live-' + src;
$('.wall-item-outside-wrapper',data).each(function() {
var ident = $(this).attr('id');
if($('#' + ident).length == 0) {
$('img',this).each(function() {
$(this).attr('src',$(this).attr('dst'));
});
$('#' + prev).after($(this));
if($('#' + ident).length == 0 && prev != 'live-' + src) {
$('img',this).each(function() {
$(this).attr('src',$(this).attr('dst'));
});
$('#' + prev).after($(this));
}
else {
$('#' + ident + ' ' + '.wall-item-ago').replaceWith($(this).find('.wall-item-ago'));
@ -275,7 +283,7 @@
}
prev = ident;
});
*/
$('.like-rotator').hide();
if(commentBusy) {
commentBusy = false;

View file

@ -60,8 +60,8 @@ function acl_init(&$a){
intval($count)
);
foreach($r as $g){
// logger('acl: group: ' . $g['name'] . ' members: ' . $g['uids']);
$groups[] = array(
"type" => "g",
"photo" => "images/default-group-mm.png",

View file

@ -1,7 +1,7 @@
<?php
/**
* Friendika admin
* Friendica admin
*/
require_once("include/remoteupdate.php");
@ -277,7 +277,7 @@ function admin_page_site(&$a) {
/* Banner */
$banner = get_config('system','banner');
if($banner == false)
$banner = '<a href="http://project.friendika.com"><img id="logo-img" src="images/friendika-32.png" alt="logo" /></a><span id="logo-text"><a href="http://project.friendika.com">Friendika</a></span>';
$banner = '<a href="http://friendica.com"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="http://friendica.com">Friendica</a></span>';
$banner = htmlspecialchars($banner);
//echo "<pre>"; var_dump($lang_choices); die("</pre>");
@ -325,7 +325,7 @@ function admin_page_site(&$a) {
'$no_community_page' => array('no_community_page', t("Show Community Page"), !get_config('system','no_community_page'), "Display a Community page showing all recent public postings on this site."),
'$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disable'), "Provide built-in OStatus \x28identi.ca, status.net, etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed."),
'$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), "Provide built-in Diaspora network compatibility."),
'$dfrn_only' => array('dfrn_only', t('Only allow Friendika contacts'), get_config('system','dfrn_only'), "All contacts must use Friendika protocols. All other built-in communication protocols disabled."),
'$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), "All contacts must use Friendica protocols. All other built-in communication protocols disabled."),
'$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), "If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites."),
'$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""),
'$proxy' => array('proxy', t("Proxy URL"), get_config('system','proxy'), ""),
@ -657,7 +657,7 @@ function admin_page_logs(&$a){
// name, label, value, help string, extra data...
'$debugging' => array('debugging', t("Debugging"),get_config('system','debugging'), ""),
'$logfile' => array('logfile', t("Log file"), get_config('system','logfile'), t("Must be writable by web server. Relative to your Friendika index.php.")),
'$logfile' => array('logfile', t("Log file"), get_config('system','logfile'), t("Must be writable by web server. Relative to your Friendica top-level directory.")),
'$loglevel' => array('loglevel', t("Log level"), get_config('system','loglevel'), "", $log_choices),
));
}

View file

@ -2,7 +2,7 @@
require_once('Scrape.php');
function follow_post(&$a) {
function follow_init(&$a) {
if(! local_user()) {
notice( t('Permission denied.') . EOL);
@ -10,7 +10,7 @@ function follow_post(&$a) {
// NOTREACHED
}
$url = $orig_url = notags(trim($_POST['url']));
$url = $orig_url = notags(trim($_REQUEST['url']));
// remove ajax junk, e.g. Twitter
@ -22,6 +22,14 @@ function follow_post(&$a) {
// NOTREACHED
}
if(! $url) {
notice( t('Connect URL missing.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
$ret = probe_url($url);
if($ret['network'] === NETWORK_DFRN) {
@ -202,7 +210,9 @@ function follow_post(&$a) {
}
}
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
// goaway($_SESSION['return_url']);
if(strstr($_SESSION['return_url'],'contacts'))
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
goaway($_SESSION['return_url']);
// NOTREACHED
}

View file

@ -43,9 +43,9 @@ function friendica_content(&$a) {
$o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
$o .= t('running at web location') . ' ' . z_root() . '</p><p>';
$o .= t('Please visit <a href="http://project.friendika.com">Project.Friendika.com</a> to learn more about the Friendica project.') . '</p><p>';
$o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';
$o .= t('Bug reports and issues: please visit') . ' ' . '<a href="http://bugs.friendika.com">Bugs.Friendika.com</a></p><p>';
$o .= t('Bug reports and issues: please visit') . ' ' . '<a href="http://bugs.friendica.com">Bugs.Friendica.com</a></p><p>';
$o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
$o .= '<p></p>';

View file

@ -3,6 +3,9 @@
if(! function_exists('home_init')) {
function home_init(&$a) {
$ret = array();
call_hooks('home_init',$ret);
if(local_user() && ($a->user['nickname']))
goaway( $a->get_baseurl() . "/profile/" . $a->user['nickname'] );

View file

@ -398,9 +398,13 @@ function item_post(&$a) {
continue;
$basetag = str_replace('_',' ',substr($tag,1));
$body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
if(strlen($str_tags))
$str_tags .= ',';
$str_tags .= '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
$newtag = '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
if(! stristr($str_tags,$newtag)) {
if(strlen($str_tags))
$str_tags .= ',';
$str_tags .= $newtag;
}
continue;
}
if(strpos($tag,'@') === 0) {

View file

@ -7,6 +7,8 @@ function match_content(&$a) {
if(! local_user())
return;
$_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
$o .= '<h2>' . t('Profile Match') . '</h2>';
$r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
@ -41,14 +43,20 @@ function match_content(&$a) {
}
if(count($j->results)) {
$tpl = get_markup_template('match.tpl');
foreach($j->results as $jj) {
$connlnk = $a->get_baseurl() . '/follow/?url=' . $jj->url;
$o .= replace_macros($tpl,array(
'$url' => $jj->url,
'$name' => $jj->name,
'$photo' => $jj->photo,
'$inttxt' => ' ' . t('is interested in:'),
'$conntxt' => t('Connect'),
'$connlnk' => $connlnk,
'$tags' => $jj->tags
));
}

View file

@ -301,7 +301,8 @@ function network_content(&$a, $update = 0) {
}
$sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $star_sql AND ( `contact-id` IN ( $contact_str ) OR `allow_gid` REGEXP '<" . intval($group) . ">' )) ";
// $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $star_sql AND ( `contact-id` IN ( $contact_str ) OR `allow_gid` REGEXP '<" . intval($group) . ">' )) ";
$sql_extra = " AND `item`.`parent` IN ( SELECT DISTINCT(`parent`) FROM `item` WHERE 1 $star_sql AND ( `contact-id` IN ( $contact_str ) OR `allow_gid` REGEXP '<" . intval($group) . ">' )) ";
$o = '<h2>' . t('Group: ') . $r[0]['name'] . '</h2>' . $o;
}
elseif($cid) {
@ -398,10 +399,9 @@ function network_content(&$a, $update = 0) {
$simple_update = (($update) ? " and `item`.`unseen` = 1 " : '');
if($nouveau) {
// "New Item View" - show all items unthreaded in reverse created date order
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
$items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
@ -414,7 +414,7 @@ function network_content(&$a, $update = 0) {
ORDER BY `item`.`received` DESC $pager_sql ",
intval($_SESSION['uid'])
);
}
else {

View file

@ -3,7 +3,7 @@
function newmember_content(&$a) {
$o = '<h3>' . t('Welcome to Friendika') . '</h3>';
$o = '<h3>' . t('Welcome to Friendica') . '</h3>';
$o .= '<h3>' . t('New Member Checklist') . '</h3>';
@ -25,13 +25,13 @@ function newmember_content(&$a) {
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
if(! $mail_disabled)
$o .= '<li>' . '<a href="settings">' . t('Enter your email access information on your Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</a></li>' . EOL;
$o .= '<li>' . '<a href="settings/connectors">' . t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</a></li>' . EOL;
$o .= '<li>' . '<a href="profiles">' . t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</a></li>' . EOL;
$o .= '<li>' . '<a href="profiles">' . t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.') . '</a></li>' . EOL;
$o .= '<li>' . '<a href="contacts">' . t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Connect</em> dialog.') . '</a></li>' . EOL;
$o .= '<li>' . '<a href="contacts">' . t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.') . '</a></li>' . EOL;
$o .= '<li>' . '<a href="directory">' . t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.') . '</a></li>' . EOL;

View file

@ -125,8 +125,11 @@ function poco_init(&$a) {
$entry['id'] = $rr['id'];
if($fields_ret['displayName'])
$entry['displayName'] = $rr['name'];
if($fields_ret['urls'])
if($fields_ret['urls']) {
$entry['urls'] = array(array('value' => $rr['url'], 'type' => 'profile'));
if($rr['addr'] && ($rr['network'] !== NETWORK_MAIL))
$entry['urls'][] = array('value' => 'acct:' . $rr['addr'], 'type' => 'webfinger');
}
if($fields_ret['preferredUsername'])
$entry['preferredUsername'] = $rr['nick'];
if($fields_ret['photos'])

View file

@ -38,7 +38,7 @@ function profile_init(&$a) {
if(! $blocked) {
$keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : '');
$keywords = str_replace(array(',',' ',',,'),array(' ',',',','),$keywords);
$keywords = str_replace(array('#',',',' ',',,'),array('',' ',',',','),$keywords);
if(strlen($keywords))
$a->page['htmlhead'] .= '<meta name="keywords" content="' . $keywords . '" />' . "\r\n" ;
}

View file

@ -8,6 +8,15 @@ function register_post(&$a) {
$verified = 0;
$blocked = 1;
$max_dailies = intval(get_config('system','max_daily_registrations'));
if($max_dailes) {
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
if($r && $r[0]['total'] >= $max_dailies) {
return;
}
}
switch($a->config['register_policy']) {
@ -462,6 +471,16 @@ function register_content(&$a) {
return;
}
$max_dailies = intval(get_config('system','max_daily_registrations'));
if($max_dailes) {
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
if($r && $r[0]['total'] >= $max_dailies) {
logger('max daily registrations exceeded.');
notice( t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
return;
}
}
if(x($_SESSION,'theme'))
unset($_SESSION['theme']);

View file

@ -29,6 +29,8 @@ function suggest_content(&$a) {
return;
}
$_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
$a->page['aside'] .= follow_widget();
$a->page['aside'] .= findpeople_widget();
@ -39,19 +41,23 @@ function suggest_content(&$a) {
$r = suggestion_query(local_user());
if(! count($r)) {
$o .= t('No suggestions. This works best when you have more than one contact/friend.');
$o .= t('No suggestions available. If this is a new site, please try again in 24 hours.');
return $o;
}
$tpl = get_markup_template('suggest_friends.tpl');
foreach($r as $rr) {
$connlnk = $a->get_baseurl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
$o .= replace_macros($tpl,array(
'$url' => $rr['url'],
'$name' => $rr['name'],
'$photo' => $rr['photo'],
'$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'],
'$conntxt' => t('Connect'),
'$connlnk' => $connlnk,
'$ignore' => t('Ignore/Hide')
));
}

View file

@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1111 );
define( 'UPDATE_VERSION' , 1112 );
/**
*
@ -944,3 +944,7 @@ function update_1110() {
}
function update_1111() {
q("ALTER TABLE `gcontact` ADD `connect` CHAR( 255 ) NOT NULL ");
}

File diff suppressed because it is too large Load diff

View file

@ -9,4 +9,8 @@
<a href="$url" title="$name[$tags]">$name</a>
</div>
<div class="profile-match-end"></div>
{{ if $connlnk }}
<div class="profile-match-connect"><a href="$connlnk" title="$conntxt">$conntxt</a></div>
{{ endif }}
</div>

View file

@ -2,6 +2,6 @@
{{ if $entry.id }}<id>$entry.id</id>{{ endif }}
{{ if $entry.displayName }}<displayName>$entry.displayName</displayName>{{ endif }}
{{ if $entry.preferredUsername }}<preferredUsername>$entry.preferredUsername</preferredUsername>{{ endif }}
{{ if $entry.urls }}<urls><value>$entry.urls.value</value><type>$entry.urls.type</type></urls>{{ endif }}
{{ if $entry.photos }}<photos><value>$entry.photos.value</value><type>$entry.photos.type</type></photos>{{ endif }}
{{ if $entry.urls }}{{ for $entry.urls as $url }}<urls><value>$url.value</value><type>$url.type</type></urls>{{ endfor }}{{ endif }}
{{ if $entry.photos }}{{ for $entry.photos as $photo }}<photos><value>$photo.value</value><type>$photo.type</type></photos>{{ endfor }}{{ endif }}
</entry>

View file

@ -10,4 +10,7 @@
<a href="$url" title="$name">$name</a>
</div>
<div class="profile-match-end"></div>
{{ if $connlnk }}
<div class="profile-match-connect"><a href="$connlnk" title="$conntxt">$conntxt</a></div>
{{ endif }}
</div>

View file

@ -2,3 +2,48 @@
$a->theme_info = array(
'extends' => 'duepuntozero',
);
$a->page['htmlhead'] .= <<< EOT
<script>
$(document).ready(function() {
$('.group-edit-icon').hover(
function() {
$(this).addClass('icon'); $(this).removeClass('iconspacer');},
function() {
$(this).removeClass('icon'); $(this).addClass('iconspacer');}
);
$('.sidebar-group-element').hover(
function() {
id = $(this).attr('id');
$('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
function() {
id = $(this).attr('id');
$('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
);
$('.savedsearchdrop').hover(
function() {
$(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
function() {
$(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
);
$('.savedsearchterm').hover(
function() {
id = $(this).attr('id');
$('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
function() {
id = $(this).attr('id');
$('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
);
});
</script>
EOT;

View file

@ -2383,6 +2383,11 @@ aside input[type='text'] {
clear: both;
}
.profile-match-connect {
text-align: center;
font-weight: bold;
}
.profile-match-wrapper {
float: left;
padding: 10px;

View file

@ -2,3 +2,48 @@
$a->theme_info = array(
'extends' => 'duepuntozero',
);
$a->page['htmlhead'] .= <<< EOT
<script>
$(document).ready(function() {
$('.group-edit-icon').hover(
function() {
$(this).addClass('icon'); $(this).removeClass('iconspacer');},
function() {
$(this).removeClass('icon'); $(this).addClass('iconspacer');}
);
$('.sidebar-group-element').hover(
function() {
id = $(this).attr('id');
$('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
function() {
id = $(this).attr('id');
$('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
);
$('.savedsearchdrop').hover(
function() {
$(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
function() {
$(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
);
$('.savedsearchterm').hover(
function() {
id = $(this).attr('id');
$('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
function() {
id = $(this).attr('id');
$('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
);
});
</script>
EOT;

View file

@ -1,6 +1,6 @@
@import url('../duepuntozero/style.css');
a, a:visited { color: #7433af; text-decoration: none; }
a, a:link, a:visited { color: #7433af; text-decoration: none; }
a:hover {text-decoration: underline; }

View file

@ -2,3 +2,48 @@
$a->theme_info = array(
'extends' => 'duepuntozero',
);
$a->page['htmlhead'] .= <<< EOT
<script>
$(document).ready(function() {
$('.group-edit-icon').hover(
function() {
$(this).addClass('icon'); $(this).removeClass('iconspacer');},
function() {
$(this).removeClass('icon'); $(this).addClass('iconspacer');}
);
$('.sidebar-group-element').hover(
function() {
id = $(this).attr('id');
$('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
function() {
id = $(this).attr('id');
$('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
);
$('.savedsearchdrop').hover(
function() {
$(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
function() {
$(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
);
$('.savedsearchterm').hover(
function() {
id = $(this).attr('id');
$('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
function() {
id = $(this).attr('id');
$('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
);
});
</script>
EOT;

View file

@ -4,7 +4,10 @@
<img src="$photo" alt="$name" />
</a>
</div>
<span><a href="$url">$name</a> is interested in:<br />$tags</span>
<span><a href="$url">$name</a>$inttxt<br />$tags</span>
<div class="profile-match-break"></div>
{{ if $connlnk }}
<div class="profile-match-connect"><a href="$connlnk" title="$conntxt">$conntxt</a></div>
{{ endif }}
<div class="profile-match-end"></div>
</div>