Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -31,8 +31,9 @@ function directory_content(&$a) {
|
||||
if(x($_REQUEST,'safe'))
|
||||
$safe_mode = (intval($_REQUEST['safe']));
|
||||
|
||||
|
||||
|
||||
$pubforums = null;
|
||||
if(array_key_exists('pubforums',$_REQUEST))
|
||||
$pubforums = intval($_REQUEST['pubforums']);
|
||||
|
||||
$o = '';
|
||||
nav_set_selected('directory');
|
||||
@@ -92,11 +93,21 @@ function directory_content(&$a) {
|
||||
$query .= '&keywords=' . urlencode($keywords);
|
||||
if($advanced)
|
||||
$query .= '&query=' . urlencode($advanced);
|
||||
if(! is_null($pubforums))
|
||||
$query .= '&pubforums=' . intval($pubforums);
|
||||
|
||||
if(! is_null($pubforums))
|
||||
$query .= '&pubforums=' . intval($pubforums);
|
||||
|
||||
$sort_order = ((x($_REQUEST,'order')) ? $_REQUEST['order'] : '');
|
||||
if($pubforums)
|
||||
$sort_order = 'normal';
|
||||
|
||||
if($sort_order)
|
||||
$query .= '&order=' . urlencode($sort_order);
|
||||
|
||||
|
||||
|
||||
if($a->pager['page'] != 1)
|
||||
$query .= '&p=' . $a->pager['page'];
|
||||
|
||||
|
||||
@@ -64,6 +64,9 @@ function dirsearch_content(&$a) {
|
||||
$agege = ((x($_REQUEST,'agege')) ? intval($_REQUEST['agege']) : 0 );
|
||||
$agele = ((x($_REQUEST,'agele')) ? intval($_REQUEST['agele']) : 0 );
|
||||
$kw = ((x($_REQUEST,'kw')) ? intval($_REQUEST['kw']) : 0 );
|
||||
$forums = ((array_key_exists('pubforums',$_REQUEST)) ? intval($_REQUEST['pubforums']) : null);
|
||||
|
||||
|
||||
|
||||
// by default use a safe search
|
||||
$safe = ((x($_REQUEST,'safe'))); // ? intval($_REQUEST['safe']) : 1 );
|
||||
@@ -108,6 +111,10 @@ function dirsearch_content(&$a) {
|
||||
if($keywords)
|
||||
$sql_extra .= dir_query_build($joiner,'xprof_keywords',$keywords);
|
||||
|
||||
if(! is_null($forums))
|
||||
$sql_extra .= dir_flag_build($joiner,'xprof_flags',XCHAN_FLAGS_PUBFORUM, $forums);
|
||||
|
||||
|
||||
// we only support an age range currently. You must set both agege
|
||||
// (greater than or equal) and agele (less than or equal)
|
||||
|
||||
@@ -179,7 +186,6 @@ function dirsearch_content(&$a) {
|
||||
else
|
||||
$order = " order by xchan_name_date desc ";
|
||||
|
||||
|
||||
if($sync) {
|
||||
$spkt = array('transactions' => array());
|
||||
$r = q("select * from updates where ud_date >= '%s' and ud_guid != '' order by ud_date desc",
|
||||
@@ -273,6 +279,11 @@ function dir_query_build($joiner,$field,$s) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function dir_flag_build($joiner,$field,$bit,$s) {
|
||||
return dbesc($joiner) . " ( " . dbesc('xchan_flags') . " & " . intval($bit) . " ) " . ((intval($s)) ? '>' : '=' ) . " 0 ";
|
||||
}
|
||||
|
||||
|
||||
function dir_parse_query($s) {
|
||||
|
||||
$ret = array();
|
||||
|
||||
@@ -275,6 +275,11 @@ function events_content(&$a) {
|
||||
if(! $m)
|
||||
$m = intval($thismonth);
|
||||
|
||||
$export = false;
|
||||
if(argc() === 4 && argv(3) === 'export')
|
||||
$export = true;
|
||||
|
||||
|
||||
// Put some limits on dates. The PHP date functions don't seem to do so well before 1900.
|
||||
// An upper limit was chosen to keep search engines from exploring links millions of years in the future.
|
||||
|
||||
@@ -413,6 +418,12 @@ function events_content(&$a) {
|
||||
}
|
||||
}
|
||||
|
||||
if($export) {
|
||||
header('Content-type: text/calendar');
|
||||
echo ical_wrapper($r);
|
||||
killme();
|
||||
}
|
||||
|
||||
if ($a->argv[1] === 'json'){
|
||||
echo json_encode($events); killme();
|
||||
}
|
||||
@@ -432,6 +443,7 @@ function events_content(&$a) {
|
||||
'$new_event'=> array($a->get_baseurl().'/events/new',t('Create New Event'),'',''),
|
||||
'$previus' => array($a->get_baseurl()."/events/$prevyear/$prevmonth",t('Previous'),'',''),
|
||||
'$next' => array($a->get_baseurl()."/events/$nextyear/$nextmonth",t('Next'),'',''),
|
||||
'$export' => array($a->get_baseurl()."/events/$y/$m/export",t('Export'),'',''),
|
||||
'$calendar' => cal($y,$m,$links, ' eventcal'),
|
||||
'$events' => $events,
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ function home_content(&$a, $update = 0, $load = false) {
|
||||
|
||||
// See if the sys channel set a homepage
|
||||
if (! $channel_address) {
|
||||
require_once('include/identity.php');
|
||||
$u = get_sys_channel();
|
||||
if ($u) {
|
||||
$u = array($u);
|
||||
@@ -233,4 +234,6 @@ function home_content(&$a, $update = 0, $load = false) {
|
||||
return $o;
|
||||
}
|
||||
|
||||
return $o;
|
||||
|
||||
}
|
||||
@@ -798,6 +798,7 @@ function post_post(&$a) {
|
||||
$ret['service_class'] = $u[0]['account_service_class'];
|
||||
|
||||
// Set "do not track" flag if this site or this channel's profile is restricted
|
||||
// in some way
|
||||
|
||||
if(intval(get_config('system','block_public')))
|
||||
$ret['DNT'] = true;
|
||||
@@ -805,6 +806,8 @@ function post_post(&$a) {
|
||||
$ret['DNT'] = true;
|
||||
if(get_pconfig($c[0]['channel_id'],'system','do_not_track'))
|
||||
$ret['DNT'] = true;
|
||||
if(get_pconfig($c[0]['channel_id'],'system','hide_online_status'))
|
||||
$ret['DNT'] = true;
|
||||
|
||||
json_return_and_die($ret);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user