Merge remote-tracking branch 'mike/master' into dev
This commit is contained in:
commit
a0e390c6c8
@ -9,17 +9,37 @@ class Profs {
|
||||
|
||||
if(array_key_exists('basic',$_REQUEST)) {
|
||||
$arr = explode(',',$_REQUEST['basic']);
|
||||
for($x = 0; $x < count($arr); $x ++)
|
||||
if(trim($arr[$x]))
|
||||
$arr[$x] = trim($arr[$x]);
|
||||
set_config('system','profile_fields_basic',$arr);
|
||||
|
||||
array_walk($arr,'array_trim');
|
||||
$narr = [];
|
||||
if(count($arr)) {
|
||||
foreach($arr as $a) {
|
||||
if(strlen($a)) {
|
||||
$narr[] = $a;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(! $narr)
|
||||
del_config('system','profile_fields_basic');
|
||||
else
|
||||
set_config('system','profile_fields_basic',$narr);
|
||||
|
||||
|
||||
if(array_key_exists('advanced',$_REQUEST)) {
|
||||
$arr = explode(',',$_REQUEST['advanced']);
|
||||
for($x = 0; $x < count($arr); $x ++)
|
||||
if(trim($arr[$x]))
|
||||
$arr[$x] = trim($arr[$x]);
|
||||
set_config('system','profile_fields_advanced',$arr);
|
||||
array_walk($arr,'array_trim');
|
||||
$narr = [];
|
||||
if(count($arr)) {
|
||||
foreach($arr as $a) {
|
||||
if(strlen($a)) {
|
||||
$narr[] = $a;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(! $narr)
|
||||
del_config('system','profile_fields_advanced');
|
||||
else
|
||||
set_config('system','profile_fields_advanced',$narr);
|
||||
|
||||
}
|
||||
goaway(z_root() . '/admin/profs');
|
||||
}
|
||||
@ -98,6 +118,7 @@ class Profs {
|
||||
$basic = '';
|
||||
$barr = array();
|
||||
$fields = get_profile_fields_basic();
|
||||
|
||||
if(! $fields)
|
||||
$fields = get_profile_fields_basic(1);
|
||||
if($fields) {
|
||||
|
@ -101,6 +101,11 @@ class Directory extends \Zotlabs\Web\Controller {
|
||||
if($suggest) {
|
||||
|
||||
$r = suggestion_query(local_channel(),get_observer_hash());
|
||||
|
||||
if(! $r) {
|
||||
notice( t('No default suggestions were found.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
// Remember in which order the suggestions were
|
||||
$addresses = array();
|
||||
|
@ -32,7 +32,7 @@ class Sitelist extends \Zotlabs\Web\Controller {
|
||||
|
||||
$result = array('success' => false);
|
||||
|
||||
$r = q("select count(site_url) as total from site where site_type = %d $sql_extra ",
|
||||
$r = q("select count(site_url) as total from site where site_type = %d and site_dead = 0 $sql_extra ",
|
||||
intval(SITE_TYPE_ZOT)
|
||||
);
|
||||
|
||||
@ -42,7 +42,7 @@ class Sitelist extends \Zotlabs\Web\Controller {
|
||||
$result['start'] = $start;
|
||||
$result['limit'] = $limit;
|
||||
|
||||
$r = q("select * from site where site_type = %d $sql_extra $sql_order $sql_limit",
|
||||
$r = q("select * from site where site_type = %d and site_dead = 0 $sql_extra $sql_order $sql_limit",
|
||||
intval(SITE_TYPE_ZOT)
|
||||
);
|
||||
|
||||
|
@ -1126,8 +1126,7 @@ function channel_export_items($channel_id, $start, $finish) {
|
||||
/**
|
||||
* @brief Loads a profile into the App structure.
|
||||
*
|
||||
* The function requires a writeable copy of the main App structure, and the
|
||||
* nickname of a valid channel.
|
||||
* The function requires the nickname of a valid channel.
|
||||
*
|
||||
* Permissions of the current observer are checked. If a restricted profile is available
|
||||
* to the current observer, that will be loaded instead of the channel default profile.
|
||||
@ -1897,6 +1896,7 @@ function is_public_profile() {
|
||||
function get_profile_fields_basic($filter = 0) {
|
||||
|
||||
$profile_fields_basic = (($filter == 0) ? get_config('system','profile_fields_basic') : null);
|
||||
|
||||
if(! $profile_fields_basic)
|
||||
$profile_fields_basic = array('fullname','pdesc','chandesc','comms','gender','dob','dob_tz','region','country_name','marital','sexual','homepage','hometown','keywords','about','contact');
|
||||
|
||||
|
@ -1412,6 +1412,13 @@ function get_mail_elements($x) {
|
||||
}
|
||||
else {
|
||||
$arr['body'] = (($x['body']) ? htmlspecialchars($x['body'], ENT_COMPAT,'UTF-8',false) : '');
|
||||
|
||||
$maxlen = get_max_import_size();
|
||||
|
||||
if($maxlen && mb_strlen($arr['body']) > $maxlen) {
|
||||
$arr['body'] = mb_substr($arr['body'],0,$maxlen,'UTF-8');
|
||||
logger('message length exceeds max_import_size: truncated');
|
||||
}
|
||||
}
|
||||
|
||||
$arr['title'] = (($x['title'])? htmlspecialchars($x['title'],ENT_COMPAT,'UTF-8',false) : '');
|
||||
|
@ -52,7 +52,7 @@ function poco_load($xchan = '', $url = null) {
|
||||
elseif($s['return_code'] == 404)
|
||||
logger('poco_load: nothing found');
|
||||
else
|
||||
logger('poco_load: returns ' . print_r($s,true));
|
||||
logger('poco_load: returns ' . print_r($s,true), LOGGER_DATA);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -288,11 +288,14 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) {
|
||||
|
||||
function update_suggestions() {
|
||||
|
||||
$dirmode = get_config('system', 'directory_mode');
|
||||
if($dirmode === false)
|
||||
$dirmode = DIRECTORY_MODE_NORMAL;
|
||||
$dirmode = get_config('system', 'directory_mode', DIRECTORY_MODE_NORMAL);
|
||||
|
||||
if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) {
|
||||
if($dirmode == DIRECTORY_MODE_STANDALONE) {
|
||||
poco_load('', z_root() . '/poco');
|
||||
return;
|
||||
}
|
||||
|
||||
if($dirmode == DIRECTORY_MODE_PRIMARY) {
|
||||
$url = z_root() . '/sitelist';
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user