diff options
author | Michael Vogel <icarus@dabo.de> | 2012-04-14 13:15:25 +0200 |
---|---|---|
committer | Michael Vogel <icarus@dabo.de> | 2012-04-14 13:15:25 +0200 |
commit | 4e220ec391514fbdeaa7d64abfd1752a9b44bbaa (patch) | |
tree | 1cb3cb621221e948be9e0e91916aac0dd6fccb0e /include | |
parent | 572678fef95816deaa1ecafe5cbcfb8cc65963c9 (diff) | |
parent | 0d869ceb65badbd4d80dd0d5cf2d631bca7f5b9e (diff) | |
download | volse-hubzilla-4e220ec391514fbdeaa7d64abfd1752a9b44bbaa.tar.gz volse-hubzilla-4e220ec391514fbdeaa7d64abfd1752a9b44bbaa.tar.bz2 volse-hubzilla-4e220ec391514fbdeaa7d64abfd1752a9b44bbaa.zip |
Merge commit 'upstream/master'
Diffstat (limited to 'include')
-rw-r--r-- | include/Contact.php | 20 | ||||
-rw-r--r-- | include/group.php | 1 | ||||
-rw-r--r-- | include/network.php | 7 | ||||
-rw-r--r-- | include/profile_selectors.php | 2 | ||||
-rw-r--r-- | include/text.php | 25 |
5 files changed, 39 insertions, 16 deletions
diff --git a/include/Contact.php b/include/Contact.php index 8d893cf70..388819b01 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -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; diff --git a/include/group.php b/include/group.php index 4a35912e5..edb547de6 100644 --- a/include/group.php +++ b/include/group.php @@ -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'), )); diff --git a/include/network.php b/include/network.php index 23ef50b21..8c678a443 100644 --- a/include/network.php +++ b/include/network.php @@ -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; } diff --git a/include/profile_selectors.php b/include/profile_selectors.php index 92579f64a..a2cef959d 100644 --- a/include/profile_selectors.php +++ b/include/profile_selectors.php @@ -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) { diff --git a/include/text.php b/include/text.php index 4ec59a665..8c8db66a9 100644 --- a/include/text.php +++ b/include/text.php @@ -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; -}
\ No newline at end of file +} |