Merge commit 'upstream/master'
This commit is contained in:
		
				commit
				
					
						4e220ec391
					
				
			
		
					 98 changed files with 2482 additions and 929 deletions
				
			
		| 
						 | 
				
			
			@ -176,10 +176,24 @@ function random_profile() {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function contacts_not_grouped($uid) {
 | 
			
		||||
	$r = q("select * from contact where uid = %d and self = 0 and id not in (select distinct(`contact-id`) from group_member where uid = %d) ",
 | 
			
		||||
function contacts_not_grouped($uid,$start = 0,$count = 0) {
 | 
			
		||||
 | 
			
		||||
	if(! $count) {
 | 
			
		||||
		$r = q("select count(*) as total from contact where uid = %d and self = 0 and id not in (select distinct(`contact-id`) from group_member where uid = %d) ",
 | 
			
		||||
			intval($uid),
 | 
			
		||||
			intval($uid)
 | 
			
		||||
		);
 | 
			
		||||
 | 
			
		||||
		return $r;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	$r = q("select * from contact where uid = %d and self = 0 and id not in (select distinct(`contact-id`) from group_member where uid = %d) and blocked = 0 and pending = 0 limit %d, %d",
 | 
			
		||||
		intval($uid),
 | 
			
		||||
		intval($uid)
 | 
			
		||||
		intval($uid),
 | 
			
		||||
		intval($start),
 | 
			
		||||
		intval($count)
 | 
			
		||||
	);
 | 
			
		||||
 | 
			
		||||
	return $r;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -212,6 +212,7 @@ function group_side($every="contacts",$each="group",$edit = false, $group_id = 0
 | 
			
		|||
		'$title'		=> t('Groups'),
 | 
			
		||||
		'$edittext'     => t('Edit group'),
 | 
			
		||||
		'$createtext' 	=> t('Create a new group'),
 | 
			
		||||
		'$ungrouped'    => (($every === 'contacts') ? t('Contacts not in any group') : ''),
 | 
			
		||||
		'$groups'		=> $groups,
 | 
			
		||||
		'$add'			=> t('add'),
 | 
			
		||||
	));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -587,13 +587,14 @@ function fetch_xrd_links($url) {
 | 
			
		|||
 | 
			
		||||
if(! function_exists('validate_url')) {
 | 
			
		||||
function validate_url(&$url) {
 | 
			
		||||
	// no naked subdomains
 | 
			
		||||
	if(strpos($url,'.') === false)
 | 
			
		||||
	
 | 
			
		||||
	// no naked subdomains (allow localhost for tests)
 | 
			
		||||
	if(strpos($url,'.') === false && strpos($url,'/localhost/') === false)
 | 
			
		||||
		return false;
 | 
			
		||||
	if(substr($url,0,4) != 'http')
 | 
			
		||||
		$url = 'http://' . $url;
 | 
			
		||||
	$h = @parse_url($url);
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
	if(($h) && (dns_get_record($h['host'], DNS_A + DNS_CNAME + DNS_PTR))) {
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ function sexpref_selector($current="",$suffix="") {
 | 
			
		|||
 | 
			
		||||
function marital_selector($current="",$suffix="") {
 | 
			
		||||
	$o = '';
 | 
			
		||||
	$select = array('', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Partners'), t('Cohabiting'), t('Happy'), t('Not Looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Widowed'), t('Uncertain'), t('Complicated'), t('Don\'t care'), t('Ask me') );
 | 
			
		||||
	$select = array('', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Has crush'), t('Infatuated'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Imaginarily married'), t('Partners'), t('Cohabiting'), t('Common law'), t('Happy'), t('Not looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Imaginarily divorced'), t('Widowed'), t('Uncertain'), t('It\'s complicated'), t('Don\'t care'), t('Ask me') );
 | 
			
		||||
 | 
			
		||||
	$o .= "<select name=\"marital\" id=\"marital-select\" size=\"1\" >";
 | 
			
		||||
	foreach($select as $selection) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1068,10 +1068,12 @@ function unamp($s) {
 | 
			
		|||
if(! function_exists('lang_selector')) {
 | 
			
		||||
function lang_selector() {
 | 
			
		||||
	global $lang;
 | 
			
		||||
	$o = '<div id="lang-select-icon" class="icon language" title="' . t('Select an alternate language') . '" onclick="openClose(\'language-selector\');" ></div>';
 | 
			
		||||
	$o .= '<div id="language-selector" style="display: none;" >';
 | 
			
		||||
	$o .= '<form action="#" method="post" ><select name="system_language" onchange="this.form.submit();" >';
 | 
			
		||||
	
 | 
			
		||||
	$langs = glob('view/*/strings.php');
 | 
			
		||||
	
 | 
			
		||||
	$lang_options = array();
 | 
			
		||||
	$selected = "";
 | 
			
		||||
	
 | 
			
		||||
	if(is_array($langs) && count($langs)) {
 | 
			
		||||
		$langs[] = '';
 | 
			
		||||
		if(! in_array('view/en/strings.php',$langs))
 | 
			
		||||
| 
						 | 
				
			
			@ -1079,17 +1081,22 @@ function lang_selector() {
 | 
			
		|||
		asort($langs);
 | 
			
		||||
		foreach($langs as $l) {
 | 
			
		||||
			if($l == '') {
 | 
			
		||||
				$default_selected = ((! x($_SESSION,'language')) ? ' selected="selected" ' : '');
 | 
			
		||||
				$o .= '<option value="" ' . $default_selected . '>' . t('default') . '</option>';
 | 
			
		||||
				$lang_options[""] = t('default');
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			$ll = substr($l,5);
 | 
			
		||||
			$ll = substr($ll,0,strrpos($ll,'/'));
 | 
			
		||||
			$selected = (($ll === $lang && (x($_SESSION, 'language'))) ? ' selected="selected" ' : '');
 | 
			
		||||
			$o .= '<option value="' . $ll . '"' . $selected . '>' . $ll . '</option>';
 | 
			
		||||
			$selected = (($ll === $lang && (x($_SESSION, 'language'))) ? $ll : $selected);
 | 
			
		||||
			$lang_options[$ll]=$ll;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	$o .= '</select></form></div>';
 | 
			
		||||
 | 
			
		||||
	$tpl = get_markup_template("lang_selector.tpl");	
 | 
			
		||||
	$o = replace_macros($tpl, array(
 | 
			
		||||
		'$title' => t('Select an alternate language'),
 | 
			
		||||
		'$langs' => array($lang_options, $selected),
 | 
			
		||||
		
 | 
			
		||||
	));
 | 
			
		||||
	return $o;
 | 
			
		||||
}}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1510,4 +1517,4 @@ function fix_mce_lf($s) {
 | 
			
		|||
	$s = str_replace("\r\n","\n",$s);
 | 
			
		||||
	$s = str_replace("\n\n","\n",$s);
 | 
			
		||||
	return $s;
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue