Merge branch 'develop' into api_ping
This commit is contained in:
commit
04dceb9551
|
@ -27,7 +27,6 @@ Database Tables
|
||||||
| [group](help/database/db_group) | privacy groups, group info |
|
| [group](help/database/db_group) | privacy groups, group info |
|
||||||
| [group_member](help/database/db_group_member) | privacy groups, member info |
|
| [group_member](help/database/db_group_member) | privacy groups, member info |
|
||||||
| [gserver](help/database/db_gserver) | |
|
| [gserver](help/database/db_gserver) | |
|
||||||
| [guid](help/database/db_guid) | |
|
|
||||||
| [hook](help/database/db_hook) | plugin hook registry |
|
| [hook](help/database/db_hook) | plugin hook registry |
|
||||||
| [intro](help/database/db_intro) | |
|
| [intro](help/database/db_intro) | |
|
||||||
| [item](help/database/db_item) | all posts |
|
| [item](help/database/db_item) | all posts |
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
Table guid
|
|
||||||
==========
|
|
||||||
|
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
|
||||||
|---------|------------------|------------------|------|-----|---------|----------------|
|
|
||||||
| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment |
|
|
||||||
| guid | | varchar(255) | NO | MUL | | |
|
|
||||||
| plink | | varchar(255) | NO | MUL | | |
|
|
||||||
| uri | | varchar(255) | NO | MUL | | |
|
|
||||||
| network | | varchar(32) | NO | | | |
|
|
||||||
|
|
||||||
Return to [database documentation](help/database)
|
|
|
@ -59,19 +59,7 @@ The same rule applies to the JavaScript files found in
|
||||||
|
|
||||||
they will be overwritten by files in
|
they will be overwritten by files in
|
||||||
|
|
||||||
/view/theme/**your-theme-name**/js
|
/view/theme/**your-theme-name**/js.
|
||||||
|
|
||||||
### Modules
|
|
||||||
|
|
||||||
You have the freedom to override core modules found in
|
|
||||||
|
|
||||||
/mod
|
|
||||||
|
|
||||||
They will be overwritten by files in
|
|
||||||
|
|
||||||
/view/theme/**your-theme-name**/mod
|
|
||||||
|
|
||||||
Be aware that you can break things easily here if you don't know what you do. Also notice that you can override parts of the module – functions not defined in your theme module will be loaded from the core module.
|
|
||||||
|
|
||||||
## Expand an existing Theme
|
## Expand an existing Theme
|
||||||
|
|
||||||
|
|
|
@ -726,10 +726,11 @@ function guess_image_type($filename, $fromcurl=false) {
|
||||||
* @param string $avatar Link to avatar picture
|
* @param string $avatar Link to avatar picture
|
||||||
* @param int $uid User id of contact owner
|
* @param int $uid User id of contact owner
|
||||||
* @param int $cid Contact id
|
* @param int $cid Contact id
|
||||||
|
* @param bool $force force picture update
|
||||||
*
|
*
|
||||||
* @return array Returns array of the different avatar sizes
|
* @return array Returns array of the different avatar sizes
|
||||||
*/
|
*/
|
||||||
function update_contact_avatar($avatar,$uid,$cid) {
|
function update_contact_avatar($avatar,$uid,$cid, $force = false) {
|
||||||
|
|
||||||
$r = q("SELECT `avatar`, `photo`, `thumb`, `micro` FROM `contact` WHERE `id` = %d LIMIT 1", intval($cid));
|
$r = q("SELECT `avatar`, `photo`, `thumb`, `micro` FROM `contact` WHERE `id` = %d LIMIT 1", intval($cid));
|
||||||
if (!$r)
|
if (!$r)
|
||||||
|
@ -737,7 +738,7 @@ function update_contact_avatar($avatar,$uid,$cid) {
|
||||||
else
|
else
|
||||||
$data = array($r[0]["photo"], $r[0]["thumb"], $r[0]["micro"]);
|
$data = array($r[0]["photo"], $r[0]["thumb"], $r[0]["micro"]);
|
||||||
|
|
||||||
if ($r[0]["avatar"] != $avatar) {
|
if (($r[0]["avatar"] != $avatar) OR $force) {
|
||||||
$photos = import_profile_photo($avatar,$uid,$cid, true);
|
$photos = import_profile_photo($avatar,$uid,$cid, true);
|
||||||
|
|
||||||
if ($photos) {
|
if ($photos) {
|
||||||
|
|
|
@ -1,8 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* @file include/datetime.php
|
||||||
|
* @brief Some functions for date and time related tasks.
|
||||||
|
*/
|
||||||
|
|
||||||
// two-level sort for timezones.
|
|
||||||
|
|
||||||
if(! function_exists('timezone_cmp')) {
|
/**
|
||||||
|
* @brief Two-level sort for timezones.
|
||||||
|
*
|
||||||
|
* @param string $a
|
||||||
|
* @param string $b
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
function timezone_cmp($a, $b) {
|
function timezone_cmp($a, $b) {
|
||||||
if(strstr($a,'/') && strstr($b,'/')) {
|
if(strstr($a,'/') && strstr($b,'/')) {
|
||||||
if ( t($a) == t($b)) return 0;
|
if ( t($a) == t($b)) return 0;
|
||||||
|
@ -11,11 +20,16 @@ function timezone_cmp($a, $b) {
|
||||||
if(strstr($a,'/')) return -1;
|
if(strstr($a,'/')) return -1;
|
||||||
if(strstr($b,'/')) return 1;
|
if(strstr($b,'/')) return 1;
|
||||||
if ( t($a) == t($b)) return 0;
|
if ( t($a) == t($b)) return 0;
|
||||||
return ( t($a) < t($b)) ? -1 : 1;
|
|
||||||
}}
|
|
||||||
|
|
||||||
// emit a timezone selector grouped (primarily) by continent
|
return ( t($a) < t($b)) ? -1 : 1;
|
||||||
if(! function_exists('select_timezone')) {
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Emit a timezone selector grouped (primarily) by continent
|
||||||
|
*
|
||||||
|
* @param string $current Timezone
|
||||||
|
* @return string Parsed HTML output
|
||||||
|
*/
|
||||||
function select_timezone($current = 'America/Los_Angeles') {
|
function select_timezone($current = 'America/Los_Angeles') {
|
||||||
|
|
||||||
$timezone_identifiers = DateTimeZone::listIdentifiers();
|
$timezone_identifiers = DateTimeZone::listIdentifiers();
|
||||||
|
@ -52,13 +66,25 @@ function select_timezone($current = 'America/Los_Angeles') {
|
||||||
}
|
}
|
||||||
$o .= '</optgroup></select>';
|
$o .= '</optgroup></select>';
|
||||||
return $o;
|
return $o;
|
||||||
}}
|
}
|
||||||
|
|
||||||
// return a select using 'field_select_raw' template, with timezones
|
|
||||||
// groupped (primarily) by continent
|
|
||||||
// arguments follow convetion as other field_* template array:
|
/**
|
||||||
// 'name', 'label', $value, 'help'
|
* @brief Generating a Timezone selector
|
||||||
if (!function_exists('field_timezone')){
|
*
|
||||||
|
* Return a select using 'field_select_raw' template, with timezones
|
||||||
|
* groupped (primarily) by continent
|
||||||
|
* arguments follow convetion as other field_* template array:
|
||||||
|
* 'name', 'label', $value, 'help'
|
||||||
|
*
|
||||||
|
* @param string $name Name of the selector
|
||||||
|
* @param string $label Label for the selector
|
||||||
|
* @param string $current Timezone
|
||||||
|
* @param string $help Help text
|
||||||
|
*
|
||||||
|
* @return string Parsed HTML
|
||||||
|
*/
|
||||||
function field_timezone($name='timezone', $label='', $current = 'America/Los_Angeles', $help){
|
function field_timezone($name='timezone', $label='', $current = 'America/Los_Angeles', $help){
|
||||||
$options = select_timezone($current);
|
$options = select_timezone($current);
|
||||||
$options = str_replace('<select id="timezone_select" name="timezone">','', $options);
|
$options = str_replace('<select id="timezone_select" name="timezone">','', $options);
|
||||||
|
@ -69,15 +95,19 @@ function field_timezone($name='timezone', $label='', $current = 'America/Los_Ang
|
||||||
'$field' => array($name, $label, $current, $help, $options),
|
'$field' => array($name, $label, $current, $help, $options),
|
||||||
));
|
));
|
||||||
|
|
||||||
}}
|
}
|
||||||
|
|
||||||
// General purpose date parse/convert function.
|
/**
|
||||||
// $from = source timezone
|
* @brief General purpose date parse/convert function.
|
||||||
// $to = dest timezone
|
*
|
||||||
// $s = some parseable date/time string
|
* @param string $from Source timezone
|
||||||
// $fmt = output format
|
* @param string $to Dest timezone
|
||||||
|
* @param string $s Some parseable date/time string
|
||||||
if(! function_exists('datetime_convert')) {
|
* @param string $fmt Output format recognised from php's DateTime class
|
||||||
|
* http://www.php.net/manual/en/datetime.format.php
|
||||||
|
*
|
||||||
|
* @return string Formatted date according to given format
|
||||||
|
*/
|
||||||
function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d H:i:s") {
|
function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d H:i:s") {
|
||||||
|
|
||||||
// Defaults to UTC if nothing is set, but throws an exception if set to empty string.
|
// Defaults to UTC if nothing is set, but throws an exception if set to empty string.
|
||||||
|
@ -123,14 +153,20 @@ function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d
|
||||||
}
|
}
|
||||||
|
|
||||||
$d->setTimeZone($to_obj);
|
$d->setTimeZone($to_obj);
|
||||||
|
|
||||||
return($d->format($fmt));
|
return($d->format($fmt));
|
||||||
}}
|
}
|
||||||
|
|
||||||
|
|
||||||
// wrapper for date selector, tailored for use in birthday fields
|
/**
|
||||||
|
* @brief Wrapper for date selector, tailored for use in birthday fields.
|
||||||
|
*
|
||||||
|
* @param string $dob Date of Birth
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function dob($dob) {
|
function dob($dob) {
|
||||||
list($year,$month,$day) = sscanf($dob,'%4d-%2d-%2d');
|
list($year,$month,$day) = sscanf($dob,'%4d-%2d-%2d');
|
||||||
|
|
||||||
$f = get_config('system','birthday_input_format');
|
$f = get_config('system','birthday_input_format');
|
||||||
if(! $f)
|
if(! $f)
|
||||||
$f = 'ymd';
|
$f = 'ymd';
|
||||||
|
@ -138,62 +174,69 @@ function dob($dob) {
|
||||||
$value = '';
|
$value = '';
|
||||||
else
|
else
|
||||||
$value = (($year) ? datetime_convert('UTC','UTC',$dob,'Y-m-d') : datetime_convert('UTC','UTC',$dob,'m-d'));
|
$value = (($year) ? datetime_convert('UTC','UTC',$dob,'Y-m-d') : datetime_convert('UTC','UTC',$dob,'m-d'));
|
||||||
|
|
||||||
$o = '<input type="text" name="dob" value="' . $value . '" placeholder="' . t('YYYY-MM-DD or MM-DD') . '" />';
|
$o = '<input type="text" name="dob" value="' . $value . '" placeholder="' . t('YYYY-MM-DD or MM-DD') . '" />';
|
||||||
|
|
||||||
// if ($dob && $dob != '0000-00-00')
|
// if ($dob && $dob != '0000-00-00')
|
||||||
// $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),mktime(0,0,0,$month,$day,$year),'dob');
|
// $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),mktime(0,0,0,$month,$day,$year),'dob');
|
||||||
// else
|
// else
|
||||||
// $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),false,'dob');
|
// $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),false,'dob');
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a date selector
|
* @brief Returns a date selector
|
||||||
* @param $format
|
*
|
||||||
* format string, e.g. 'ymd' or 'mdy'. Not currently supported
|
* @param string $format
|
||||||
* @param $min
|
* Format string, e.g. 'ymd' or 'mdy'. Not currently supported
|
||||||
* unix timestamp of minimum date
|
* @param string $min
|
||||||
* @param $max
|
* Unix timestamp of minimum date
|
||||||
* unix timestap of maximum date
|
* @param string $max
|
||||||
* @param $default
|
* Unix timestap of maximum date
|
||||||
* unix timestamp of default date
|
* @param string $default
|
||||||
* @param $id
|
* Unix timestamp of default date
|
||||||
* id and name of datetimepicker (defaults to "datetimepicker")
|
* @param string $id
|
||||||
|
* ID and name of datetimepicker (defaults to "datetimepicker")
|
||||||
|
*
|
||||||
|
* @return string Parsed HTML output.
|
||||||
*/
|
*/
|
||||||
if(! function_exists('datesel')) {
|
|
||||||
function datesel($format, $min, $max, $default, $id = 'datepicker') {
|
function datesel($format, $min, $max, $default, $id = 'datepicker') {
|
||||||
return datetimesel($format,$min,$max,$default,$id,true,false, '','');
|
return datetimesel($format,$min,$max,$default,$id,true,false, '','');
|
||||||
}}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a time selector
|
* @brief Returns a time selector
|
||||||
* @param $format
|
*
|
||||||
* format string, e.g. 'ymd' or 'mdy'. Not currently supported
|
* @param string $format
|
||||||
|
* Format string, e.g. 'ymd' or 'mdy'. Not currently supported
|
||||||
* @param $h
|
* @param $h
|
||||||
* already selected hour
|
* Already selected hour
|
||||||
* @param $m
|
* @param $m
|
||||||
* already selected minute
|
* Already selected minute
|
||||||
* @param $id
|
* @param string $id
|
||||||
* id and name of datetimepicker (defaults to "timepicker")
|
* ID and name of datetimepicker (defaults to "timepicker")
|
||||||
|
*
|
||||||
|
* @return string Parsed HTML output.
|
||||||
*/
|
*/
|
||||||
if(! function_exists('timesel')) {
|
|
||||||
function timesel($format, $h, $m, $id='timepicker') {
|
function timesel($format, $h, $m, $id='timepicker') {
|
||||||
return datetimesel($format,new DateTime(),new DateTime(),new DateTime("$h:$m"),$id,false,true);
|
return datetimesel($format,new DateTime(),new DateTime(),new DateTime("$h:$m"),$id,false,true);
|
||||||
}}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns a datetime selector.
|
* @brief Returns a datetime selector.
|
||||||
*
|
*
|
||||||
* @param $format
|
* @param string $format
|
||||||
* format string, e.g. 'ymd' or 'mdy'. Not currently supported
|
* format string, e.g. 'ymd' or 'mdy'. Not currently supported
|
||||||
* @param $min
|
* @param string $min
|
||||||
* unix timestamp of minimum date
|
* unix timestamp of minimum date
|
||||||
* @param $max
|
* @param string $max
|
||||||
* unix timestap of maximum date
|
* unix timestap of maximum date
|
||||||
* @param $default
|
* @param string $default
|
||||||
* unix timestamp of default date
|
* unix timestamp of default date
|
||||||
* @param string $id
|
* @param string $id
|
||||||
* id and name of datetimepicker (defaults to "datetimepicker")
|
* id and name of datetimepicker (defaults to "datetimepicker")
|
||||||
* @param boolean $pickdate
|
* @param bool $pickdate
|
||||||
* true to show date picker (default)
|
* true to show date picker (default)
|
||||||
* @param boolean $picktime
|
* @param boolean $picktime
|
||||||
* true to show time picker (default)
|
* true to show time picker (default)
|
||||||
|
@ -201,17 +244,15 @@ function timesel($format, $h, $m, $id='timepicker') {
|
||||||
* set minimum date from picker with id $minfrom (none by default)
|
* set minimum date from picker with id $minfrom (none by default)
|
||||||
* @param $maxfrom
|
* @param $maxfrom
|
||||||
* set maximum date from picker with id $maxfrom (none by default)
|
* set maximum date from picker with id $maxfrom (none by default)
|
||||||
* @param boolean $required default false
|
* @param bool $required default false
|
||||||
|
*
|
||||||
* @return string Parsed HTML output.
|
* @return string Parsed HTML output.
|
||||||
*
|
*
|
||||||
* @todo Once browser support is better this could probably be replaced with
|
* @todo Once browser support is better this could probably be replaced with
|
||||||
* native HTML5 date picker.
|
* native HTML5 date picker.
|
||||||
*/
|
*/
|
||||||
if(! function_exists('datetimesel')) {
|
|
||||||
function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) {
|
function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) {
|
||||||
|
|
||||||
$a = get_app();
|
|
||||||
|
|
||||||
// First day of the week (0 = Sunday)
|
// First day of the week (0 = Sunday)
|
||||||
$firstDay = get_pconfig(local_user(),'system','first_day_of_week');
|
$firstDay = get_pconfig(local_user(),'system','first_day_of_week');
|
||||||
if ($firstDay === false) $firstDay=0;
|
if ($firstDay === false) $firstDay=0;
|
||||||
|
@ -224,43 +265,58 @@ function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pic
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
$dateformat = '';
|
$dateformat = '';
|
||||||
|
|
||||||
if($pickdate) $dateformat .= 'Y-m-d';
|
if($pickdate) $dateformat .= 'Y-m-d';
|
||||||
if($pickdate && $picktime) $dateformat .= ' ';
|
if($pickdate && $picktime) $dateformat .= ' ';
|
||||||
if($picktime) $dateformat .= 'H:i';
|
if($picktime) $dateformat .= 'H:i';
|
||||||
|
|
||||||
$minjs = $min ? ",minDate: new Date({$min->getTimestamp()}*1000), yearStart: " . $min->format('Y') : '';
|
$minjs = $min ? ",minDate: new Date({$min->getTimestamp()}*1000), yearStart: " . $min->format('Y') : '';
|
||||||
$maxjs = $max ? ",maxDate: new Date({$max->getTimestamp()}*1000), yearEnd: " . $max->format('Y') : '';
|
$maxjs = $max ? ",maxDate: new Date({$max->getTimestamp()}*1000), yearEnd: " . $max->format('Y') : '';
|
||||||
|
|
||||||
$input_text = $default ? 'value="' . date($dateformat, $default->getTimestamp()) . '"' : '';
|
$input_text = $default ? 'value="' . date($dateformat, $default->getTimestamp()) . '"' : '';
|
||||||
$defaultdatejs = $default ? ",defaultDate: new Date({$default->getTimestamp()}*1000)" : '';
|
$defaultdatejs = $default ? ",defaultDate: new Date({$default->getTimestamp()}*1000)" : '';
|
||||||
|
|
||||||
$pickers = '';
|
$pickers = '';
|
||||||
if(!$pickdate) $pickers .= ',datepicker: false';
|
if(!$pickdate) $pickers .= ',datepicker: false';
|
||||||
if(!$picktime) $pickers .= ',timepicker: false';
|
if(!$picktime) $pickers .= ',timepicker: false';
|
||||||
|
|
||||||
$extra_js = '';
|
$extra_js = '';
|
||||||
$pickers .= ",dayOfWeekStart: ".$firstDay.",lang:'".$lang."'";
|
$pickers .= ",dayOfWeekStart: ".$firstDay.",lang:'".$lang."'";
|
||||||
if($minfrom != '')
|
if($minfrom != '')
|
||||||
$extra_js .= "\$('#$minfrom').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#$id').data('xdsoft_datetimepicker').setOptions({minDate: currentDateTime})}})";
|
$extra_js .= "\$('#$minfrom').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#$id').data('xdsoft_datetimepicker').setOptions({minDate: currentDateTime})}})";
|
||||||
if($maxfrom != '')
|
if($maxfrom != '')
|
||||||
$extra_js .= "\$('#$maxfrom').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#$id').data('xdsoft_datetimepicker').setOptions({maxDate: currentDateTime})}})";
|
$extra_js .= "\$('#$maxfrom').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#$id').data('xdsoft_datetimepicker').setOptions({maxDate: currentDateTime})}})";
|
||||||
|
|
||||||
$readable_format = $dateformat;
|
$readable_format = $dateformat;
|
||||||
$readable_format = str_replace('Y','yyyy',$readable_format);
|
$readable_format = str_replace('Y','yyyy',$readable_format);
|
||||||
$readable_format = str_replace('m','mm',$readable_format);
|
$readable_format = str_replace('m','mm',$readable_format);
|
||||||
$readable_format = str_replace('d','dd',$readable_format);
|
$readable_format = str_replace('d','dd',$readable_format);
|
||||||
$readable_format = str_replace('H','HH',$readable_format);
|
$readable_format = str_replace('H','HH',$readable_format);
|
||||||
$readable_format = str_replace('i','MM',$readable_format);
|
$readable_format = str_replace('i','MM',$readable_format);
|
||||||
|
|
||||||
$o .= "<div class='date'><input type='text' placeholder='$readable_format' name='$id' id='$id' $input_text />";
|
$o .= "<div class='date'><input type='text' placeholder='$readable_format' name='$id' id='$id' $input_text />";
|
||||||
$o .= '</div>';
|
$o .= '</div>';
|
||||||
$o .= "<script type='text/javascript'>";
|
$o .= "<script type='text/javascript'>";
|
||||||
$o .= "\$(function () {var picker = \$('#$id').datetimepicker({step:5,format:'$dateformat' $minjs $maxjs $pickers $defaultdatejs}); $extra_js})";
|
$o .= "\$(function () {var picker = \$('#$id').datetimepicker({step:5,format:'$dateformat' $minjs $maxjs $pickers $defaultdatejs}); $extra_js})";
|
||||||
$o .= "</script>";
|
$o .= "</script>";
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}}
|
}
|
||||||
|
|
||||||
// implements "3 seconds ago" etc.
|
/**
|
||||||
// based on $posted_date, (UTC).
|
* @brief Returns a relative date string.
|
||||||
// Results relative to current timezone
|
*
|
||||||
// Limited to range of timestamps
|
* Implements "3 seconds ago" etc.
|
||||||
|
* Based on $posted_date, (UTC).
|
||||||
if(! function_exists('relative_date')) {
|
* Results relative to current timezone.
|
||||||
|
* Limited to range of timestamps.
|
||||||
|
*
|
||||||
|
* @param string $posted_date
|
||||||
|
* @param string $format (optional) Parsed with sprintf()
|
||||||
|
* <tt>%1$d %2$s ago</tt>, e.g. 22 hours ago, 1 minute ago
|
||||||
|
*
|
||||||
|
* @return string with relative date
|
||||||
|
*/
|
||||||
function relative_date($posted_date,$format = null) {
|
function relative_date($posted_date,$format = null) {
|
||||||
|
|
||||||
$localtime = datetime_convert('UTC',date_default_timezone_get(),$posted_date);
|
$localtime = datetime_convert('UTC',date_default_timezone_get(),$posted_date);
|
||||||
|
@ -300,23 +356,33 @@ function relative_date($posted_date,$format = null) {
|
||||||
// translators - e.g. 22 hours ago, 1 minute ago
|
// translators - e.g. 22 hours ago, 1 minute ago
|
||||||
if(! $format)
|
if(! $format)
|
||||||
$format = t('%1$d %2$s ago');
|
$format = t('%1$d %2$s ago');
|
||||||
|
|
||||||
return sprintf( $format,$r, (($r == 1) ? $str[0] : $str[1]));
|
return sprintf( $format,$r, (($r == 1) ? $str[0] : $str[1]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Returns age in years, given a date of birth,
|
|
||||||
// the timezone of the person whose date of birth is provided,
|
|
||||||
// and the timezone of the person viewing the result.
|
|
||||||
// Why? Bear with me. Let's say I live in Mittagong, Australia, and my
|
|
||||||
// birthday is on New Year's. You live in San Bruno, California.
|
|
||||||
// When exactly are you going to see my age increase?
|
|
||||||
// A: 5:00 AM Dec 31 San Bruno time. That's precisely when I start
|
|
||||||
// celebrating and become a year older. If you wish me happy birthday
|
|
||||||
// on January 1 (San Bruno time), you'll be a day late.
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns timezone correct age in years.
|
||||||
|
*
|
||||||
|
* Returns the age in years, given a date of birth, the timezone of the person
|
||||||
|
* whose date of birth is provided, and the timezone of the person viewing the
|
||||||
|
* result.
|
||||||
|
*
|
||||||
|
* Why? Bear with me. Let's say I live in Mittagong, Australia, and my birthday
|
||||||
|
* is on New Year's. You live in San Bruno, California.
|
||||||
|
* When exactly are you going to see my age increase?
|
||||||
|
*
|
||||||
|
* A: 5:00 AM Dec 31 San Bruno time. That's precisely when I start celebrating
|
||||||
|
* and become a year older. If you wish me happy birthday on January 1
|
||||||
|
* (San Bruno time), you'll be a day late.
|
||||||
|
*
|
||||||
|
* @param string $dob Date of Birth
|
||||||
|
* @param string $owner_tz (optional) Timezone of the person of interest
|
||||||
|
* @param string $viewer_tz (optional) Timezone of the person viewing
|
||||||
|
*
|
||||||
|
* @return int Age in years
|
||||||
|
*/
|
||||||
function age($dob,$owner_tz = '',$viewer_tz = '') {
|
function age($dob,$owner_tz = '',$viewer_tz = '') {
|
||||||
if(! intval($dob))
|
if(! intval($dob))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -333,64 +399,79 @@ function age($dob,$owner_tz = '',$viewer_tz = '') {
|
||||||
|
|
||||||
if(($curr_month < $month) || (($curr_month == $month) && ($curr_day < $day)))
|
if(($curr_month < $month) || (($curr_month == $month) && ($curr_day < $day)))
|
||||||
$year_diff--;
|
$year_diff--;
|
||||||
|
|
||||||
return $year_diff;
|
return $year_diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get days of a month in a given year.
|
||||||
// Get days in month
|
*
|
||||||
// get_dim($year, $month);
|
* Returns number of days in the month of the given year.
|
||||||
// returns number of days.
|
* $m = 1 is 'January' to match human usage.
|
||||||
// $month[1] = 'January';
|
*
|
||||||
// to match human usage.
|
* @param int $y Year
|
||||||
|
* @param int $m Month (1=January, 12=December)
|
||||||
if(! function_exists('get_dim')) {
|
*
|
||||||
|
* @return int Number of days in the given month
|
||||||
|
*/
|
||||||
function get_dim($y,$m) {
|
function get_dim($y,$m) {
|
||||||
|
|
||||||
$dim = array( 0,
|
$dim = array( 0,
|
||||||
31, 28, 31, 30, 31, 30,
|
31, 28, 31, 30, 31, 30,
|
||||||
31, 31, 30, 31, 30, 31);
|
31, 31, 30, 31, 30, 31);
|
||||||
|
|
||||||
if($m != 2)
|
if($m != 2)
|
||||||
return $dim[$m];
|
return $dim[$m];
|
||||||
if(((($y % 4) == 0) && (($y % 100) != 0)) || (($y % 400) == 0))
|
|
||||||
return 29;
|
|
||||||
return $dim[2];
|
|
||||||
}}
|
|
||||||
|
|
||||||
|
if(((($y % 4) == 0) && (($y % 100) != 0)) || (($y % 400) == 0))
|
||||||
|
return 29;
|
||||||
|
|
||||||
// Returns the first day in month for a given month, year
|
return $dim[2];
|
||||||
// get_first_dim($year,$month)
|
}
|
||||||
// returns 0 = Sunday through 6 = Saturday
|
|
||||||
// Months start at 1.
|
|
||||||
|
|
||||||
if(! function_exists('get_first_dim')) {
|
/**
|
||||||
|
* @brief Returns the first day in month for a given month, year.
|
||||||
|
*
|
||||||
|
* Months start at 1.
|
||||||
|
*
|
||||||
|
* @param int $y Year
|
||||||
|
* @param int $m Month (1=January, 12=December)
|
||||||
|
*
|
||||||
|
* @return string day 0 = Sunday through 6 = Saturday
|
||||||
|
*/
|
||||||
function get_first_dim($y,$m) {
|
function get_first_dim($y,$m) {
|
||||||
$d = sprintf('%04d-%02d-01 00:00', intval($y), intval($m));
|
$d = sprintf('%04d-%02d-01 00:00', intval($y), intval($m));
|
||||||
return datetime_convert('UTC','UTC',$d,'w');
|
|
||||||
}}
|
|
||||||
|
|
||||||
// output a calendar for the given month, year.
|
return datetime_convert('UTC','UTC',$d,'w');
|
||||||
// if $links are provided (array), e.g. $links[12] => 'http://mylink' ,
|
}
|
||||||
// date 12 will be linked appropriately. Today's date is also noted by
|
|
||||||
// altering td class.
|
|
||||||
// Months count from 1.
|
|
||||||
|
|
||||||
|
/**
|
||||||
/// @TODO Provide (prev,next) links, define class variations for different size calendars
|
* @brief Output a calendar for the given month, year.
|
||||||
|
*
|
||||||
|
* If $links are provided (array), e.g. $links[12] => 'http://mylink' ,
|
||||||
if(! function_exists('cal')) {
|
* date 12 will be linked appropriately. Today's date is also noted by
|
||||||
|
* altering td class.
|
||||||
|
* Months count from 1.
|
||||||
|
*
|
||||||
|
* @param int $y Year
|
||||||
|
* @param int $m Month
|
||||||
|
* @param bool $links (default false)
|
||||||
|
* @param string $class
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @todo Provide (prev,next) links, define class variations for different size calendars
|
||||||
|
*/
|
||||||
function cal($y = 0,$m = 0, $links = false, $class='') {
|
function cal($y = 0,$m = 0, $links = false, $class='') {
|
||||||
|
|
||||||
|
|
||||||
// month table - start at 1 to match human usage.
|
// month table - start at 1 to match human usage.
|
||||||
|
|
||||||
$mtab = array(' ',
|
$mtab = array(' ',
|
||||||
'January','February','March',
|
'January','February','March',
|
||||||
'April','May','June',
|
'April','May','June',
|
||||||
'July','August','September',
|
'July','August','September',
|
||||||
'October','November','December'
|
'October','November','December'
|
||||||
);
|
);
|
||||||
|
|
||||||
$thisyear = datetime_convert('UTC',date_default_timezone_get(),'now','Y');
|
$thisyear = datetime_convert('UTC',date_default_timezone_get(),'now','Y');
|
||||||
|
@ -400,54 +481,63 @@ function cal($y = 0,$m = 0, $links = false, $class='') {
|
||||||
if(! $m)
|
if(! $m)
|
||||||
$m = intval($thismonth);
|
$m = intval($thismonth);
|
||||||
|
|
||||||
$dn = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
|
$dn = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
|
||||||
$f = get_first_dim($y,$m);
|
$f = get_first_dim($y,$m);
|
||||||
$l = get_dim($y,$m);
|
$l = get_dim($y,$m);
|
||||||
$d = 1;
|
$d = 1;
|
||||||
$dow = 0;
|
$dow = 0;
|
||||||
$started = false;
|
$started = false;
|
||||||
|
|
||||||
if(($y == $thisyear) && ($m == $thismonth))
|
if(($y == $thisyear) && ($m == $thismonth))
|
||||||
$tddate = intval(datetime_convert('UTC',date_default_timezone_get(),'now','j'));
|
$tddate = intval(datetime_convert('UTC',date_default_timezone_get(),'now','j'));
|
||||||
|
|
||||||
$str_month = day_translate($mtab[$m]);
|
$str_month = day_translate($mtab[$m]);
|
||||||
$o = '<table class="calendar' . $class . '">';
|
$o = '<table class="calendar' . $class . '">';
|
||||||
$o .= "<caption>$str_month $y</caption><tr>";
|
$o .= "<caption>$str_month $y</caption><tr>";
|
||||||
for($a = 0; $a < 7; $a ++)
|
for($a = 0; $a < 7; $a ++)
|
||||||
$o .= '<th>' . mb_substr(day_translate($dn[$a]),0,3,'UTF-8') . '</th>';
|
$o .= '<th>' . mb_substr(day_translate($dn[$a]),0,3,'UTF-8') . '</th>';
|
||||||
$o .= '</tr><tr>';
|
|
||||||
|
|
||||||
while($d <= $l) {
|
$o .= '</tr><tr>';
|
||||||
if(($dow == $f) && (! $started))
|
|
||||||
$started = true;
|
|
||||||
$today = (((isset($tddate)) && ($tddate == $d)) ? "class=\"today\" " : '');
|
|
||||||
$o .= "<td $today>";
|
|
||||||
$day = str_replace(' ',' ',sprintf('%2.2d', $d));
|
|
||||||
if($started) {
|
|
||||||
if(is_array($links) && isset($links[$d]))
|
|
||||||
$o .= "<a href=\"{$links[$d]}\">$day</a>";
|
|
||||||
else
|
|
||||||
$o .= $day;
|
|
||||||
$d ++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$o .= ' ';
|
|
||||||
$o .= '</td>';
|
|
||||||
$dow ++;
|
|
||||||
if(($dow == 7) && ($d <= $l)) {
|
|
||||||
$dow = 0;
|
|
||||||
$o .= '</tr><tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($dow)
|
|
||||||
for($a = $dow; $a < 7; $a ++)
|
|
||||||
$o .= '<td> </td>';
|
|
||||||
$o .= '</tr></table>'."\r\n";
|
|
||||||
|
|
||||||
return $o;
|
while($d <= $l) {
|
||||||
}}
|
if(($dow == $f) && (! $started))
|
||||||
|
$started = true;
|
||||||
|
|
||||||
|
$today = (((isset($tddate)) && ($tddate == $d)) ? "class=\"today\" " : '');
|
||||||
|
$o .= "<td $today>";
|
||||||
|
$day = str_replace(' ',' ',sprintf('%2.2d', $d));
|
||||||
|
if($started) {
|
||||||
|
if(is_array($links) && isset($links[$d]))
|
||||||
|
$o .= "<a href=\"{$links[$d]}\">$day</a>";
|
||||||
|
else
|
||||||
|
$o .= $day;
|
||||||
|
|
||||||
|
$d ++;
|
||||||
|
} else {
|
||||||
|
$o .= ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
$o .= '</td>';
|
||||||
|
$dow ++;
|
||||||
|
if(($dow == 7) && ($d <= $l)) {
|
||||||
|
$dow = 0;
|
||||||
|
$o .= '</tr><tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($dow)
|
||||||
|
for($a = $dow; $a < 7; $a ++)
|
||||||
|
$o .= '<td> </td>';
|
||||||
|
|
||||||
|
$o .= '</tr></table>'."\r\n";
|
||||||
|
|
||||||
|
return $o;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Create a birthday event.
|
||||||
|
*
|
||||||
|
* Update the year and the birthday.
|
||||||
|
*/
|
||||||
function update_contact_birthdays() {
|
function update_contact_birthdays() {
|
||||||
|
|
||||||
// This only handles foreign or alien networks where a birthday has been provided.
|
// This only handles foreign or alien networks where a birthday has been provided.
|
||||||
|
@ -474,8 +564,6 @@ function update_contact_birthdays() {
|
||||||
$bdtext = sprintf( t('%s\'s birthday'), $rr['name']);
|
$bdtext = sprintf( t('%s\'s birthday'), $rr['name']);
|
||||||
$bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]') ;
|
$bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]') ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`,`adjust`)
|
$r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`,`adjust`)
|
||||||
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d' ) ",
|
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d' ) ",
|
||||||
intval($rr['uid']),
|
intval($rr['uid']),
|
||||||
|
|
|
@ -748,21 +748,6 @@ function db_definition() {
|
||||||
"nurl" => array("nurl"),
|
"nurl" => array("nurl"),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$database["guid"] = array(
|
|
||||||
"fields" => array(
|
|
||||||
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
|
|
||||||
"guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
|
|
||||||
"plink" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
|
|
||||||
"uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
|
|
||||||
"network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
|
|
||||||
),
|
|
||||||
"indexes" => array(
|
|
||||||
"PRIMARY" => array("id"),
|
|
||||||
"guid" => array("guid"),
|
|
||||||
"plink" => array("plink"),
|
|
||||||
"uri" => array("uri"),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$database["hook"] = array(
|
$database["hook"] = array(
|
||||||
"fields" => array(
|
"fields" => array(
|
||||||
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
|
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
|
||||||
|
|
|
@ -374,7 +374,7 @@ function delivery_run(&$argv, &$argc){
|
||||||
break;
|
break;
|
||||||
|
|
||||||
logger('mod-delivery: local delivery');
|
logger('mod-delivery: local delivery');
|
||||||
local_delivery($x[0],$atom);
|
dfrn::import($atom, $x[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1423
include/dfrn.php
1423
include/dfrn.php
File diff suppressed because it is too large
Load diff
2170
include/items.php
2170
include/items.php
File diff suppressed because it is too large
Load diff
|
@ -17,15 +17,6 @@ define('OSTATUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes
|
||||||
define('OSTATUS_DEFAULT_POLL_TIMEFRAME', 1440); // given in minutes
|
define('OSTATUS_DEFAULT_POLL_TIMEFRAME', 1440); // given in minutes
|
||||||
define('OSTATUS_DEFAULT_POLL_TIMEFRAME_MENTIONS', 14400); // given in minutes
|
define('OSTATUS_DEFAULT_POLL_TIMEFRAME_MENTIONS', 14400); // given in minutes
|
||||||
|
|
||||||
define("NS_ATOM", "http://www.w3.org/2005/Atom");
|
|
||||||
define("NS_THR", "http://purl.org/syndication/thread/1.0");
|
|
||||||
define("NS_GEORSS", "http://www.georss.org/georss");
|
|
||||||
define("NS_ACTIVITY", "http://activitystrea.ms/spec/1.0/");
|
|
||||||
define("NS_MEDIA", "http://purl.org/syndication/atommedia");
|
|
||||||
define("NS_POCO", "http://portablecontacts.net/spec/1.0");
|
|
||||||
define("NS_OSTATUS", "http://ostatus.org/schema/1.0");
|
|
||||||
define("NS_STATUSNET", "http://status.net/schema/api/1/");
|
|
||||||
|
|
||||||
function ostatus_check_follow_friends() {
|
function ostatus_check_follow_friends() {
|
||||||
$r = q("SELECT `uid`,`v` FROM `pconfig` WHERE `cat`='system' AND `k`='ostatus_legacy_contact' AND `v` != ''");
|
$r = q("SELECT `uid`,`v` FROM `pconfig` WHERE `cat`='system' AND `k`='ostatus_legacy_contact' AND `v` != ''");
|
||||||
|
|
||||||
|
@ -193,14 +184,14 @@ function ostatus_salmon_author($xml, $importer) {
|
||||||
@$doc->loadXML($xml);
|
@$doc->loadXML($xml);
|
||||||
|
|
||||||
$xpath = new DomXPath($doc);
|
$xpath = new DomXPath($doc);
|
||||||
$xpath->registerNamespace('atom', "http://www.w3.org/2005/Atom");
|
$xpath->registerNamespace('atom', NAMESPACE_ATOM1);
|
||||||
$xpath->registerNamespace('thr', "http://purl.org/syndication/thread/1.0");
|
$xpath->registerNamespace('thr', NAMESPACE_THREAD);
|
||||||
$xpath->registerNamespace('georss', "http://www.georss.org/georss");
|
$xpath->registerNamespace('georss', NAMESPACE_GEORSS);
|
||||||
$xpath->registerNamespace('activity', "http://activitystrea.ms/spec/1.0/");
|
$xpath->registerNamespace('activity', NAMESPACE_ACTIVITY);
|
||||||
$xpath->registerNamespace('media', "http://purl.org/syndication/atommedia");
|
$xpath->registerNamespace('media', NAMESPACE_MEDIA);
|
||||||
$xpath->registerNamespace('poco', "http://portablecontacts.net/spec/1.0");
|
$xpath->registerNamespace('poco', NAMESPACE_POCO);
|
||||||
$xpath->registerNamespace('ostatus', "http://ostatus.org/schema/1.0");
|
$xpath->registerNamespace('ostatus', NAMESPACE_OSTATUS);
|
||||||
$xpath->registerNamespace('statusnet', "http://status.net/schema/api/1/");
|
$xpath->registerNamespace('statusnet', NAMESPACE_STATUSNET);
|
||||||
|
|
||||||
$entries = $xpath->query('/atom:entry');
|
$entries = $xpath->query('/atom:entry');
|
||||||
|
|
||||||
|
@ -224,14 +215,14 @@ function ostatus_import($xml,$importer,&$contact, &$hub) {
|
||||||
@$doc->loadXML($xml);
|
@$doc->loadXML($xml);
|
||||||
|
|
||||||
$xpath = new DomXPath($doc);
|
$xpath = new DomXPath($doc);
|
||||||
$xpath->registerNamespace('atom', "http://www.w3.org/2005/Atom");
|
$xpath->registerNamespace('atom', NAMESPACE_ATOM1);
|
||||||
$xpath->registerNamespace('thr', "http://purl.org/syndication/thread/1.0");
|
$xpath->registerNamespace('thr', NAMESPACE_THREAD);
|
||||||
$xpath->registerNamespace('georss', "http://www.georss.org/georss");
|
$xpath->registerNamespace('georss', NAMESPACE_GEORSS);
|
||||||
$xpath->registerNamespace('activity', "http://activitystrea.ms/spec/1.0/");
|
$xpath->registerNamespace('activity', NAMESPACE_ACTIVITY);
|
||||||
$xpath->registerNamespace('media', "http://purl.org/syndication/atommedia");
|
$xpath->registerNamespace('media', NAMESPACE_MEDIA);
|
||||||
$xpath->registerNamespace('poco', "http://portablecontacts.net/spec/1.0");
|
$xpath->registerNamespace('poco', NAMESPACE_POCO);
|
||||||
$xpath->registerNamespace('ostatus', "http://ostatus.org/schema/1.0");
|
$xpath->registerNamespace('ostatus', NAMESPACE_OSTATUS);
|
||||||
$xpath->registerNamespace('statusnet', "http://status.net/schema/api/1/");
|
$xpath->registerNamespace('statusnet', NAMESPACE_STATUSNET);
|
||||||
|
|
||||||
$gub = "";
|
$gub = "";
|
||||||
$hub_attributes = $xpath->query("/atom:feed/atom:link[@rel='hub']")->item(0)->attributes;
|
$hub_attributes = $xpath->query("/atom:feed/atom:link[@rel='hub']")->item(0)->attributes;
|
||||||
|
@ -1120,16 +1111,16 @@ function ostatus_format_picture_post($body) {
|
||||||
function ostatus_add_header($doc, $owner) {
|
function ostatus_add_header($doc, $owner) {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
$root = $doc->createElementNS(NS_ATOM, 'feed');
|
$root = $doc->createElementNS(NAMESPACE_ATOM1, 'feed');
|
||||||
$doc->appendChild($root);
|
$doc->appendChild($root);
|
||||||
|
|
||||||
$root->setAttribute("xmlns:thr", NS_THR);
|
$root->setAttribute("xmlns:thr", NAMESPACE_THREAD);
|
||||||
$root->setAttribute("xmlns:georss", NS_GEORSS);
|
$root->setAttribute("xmlns:georss", NAMESPACE_GEORSS);
|
||||||
$root->setAttribute("xmlns:activity", NS_ACTIVITY);
|
$root->setAttribute("xmlns:activity", NAMESPACE_ACTIVITY);
|
||||||
$root->setAttribute("xmlns:media", NS_MEDIA);
|
$root->setAttribute("xmlns:media", NAMESPACE_MEDIA);
|
||||||
$root->setAttribute("xmlns:poco", NS_POCO);
|
$root->setAttribute("xmlns:poco", NAMESPACE_POCO);
|
||||||
$root->setAttribute("xmlns:ostatus", NS_OSTATUS);
|
$root->setAttribute("xmlns:ostatus", NAMESPACE_OSTATUS);
|
||||||
$root->setAttribute("xmlns:statusnet", NS_STATUSNET);
|
$root->setAttribute("xmlns:statusnet", NAMESPACE_STATUSNET);
|
||||||
|
|
||||||
$attributes = array("uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION."-".DB_UPDATE_VERSION);
|
$attributes = array("uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION."-".DB_UPDATE_VERSION);
|
||||||
xml_add_element($doc, $root, "generator", FRIENDICA_PLATFORM, $attributes);
|
xml_add_element($doc, $root, "generator", FRIENDICA_PLATFORM, $attributes);
|
||||||
|
@ -1321,6 +1312,10 @@ function ostatus_add_author($doc, $owner) {
|
||||||
function ostatus_entry($doc, $item, $owner, $toplevel = false, $repeat = false) {
|
function ostatus_entry($doc, $item, $owner, $toplevel = false, $repeat = false) {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
|
if (($item["id"] != $item["parent"]) AND (normalise_link($item["author-link"]) != normalise_link($owner["url"]))) {
|
||||||
|
logger("OStatus entry is from author ".$owner["url"]." - not from ".$item["author-link"].". Quitting.", LOGGER_DEBUG);
|
||||||
|
}
|
||||||
|
|
||||||
$is_repeat = false;
|
$is_repeat = false;
|
||||||
|
|
||||||
/* if (!$repeat) {
|
/* if (!$repeat) {
|
||||||
|
@ -1343,15 +1338,15 @@ function ostatus_entry($doc, $item, $owner, $toplevel = false, $repeat = false)
|
||||||
$entry = $doc->createElement("activity:object");
|
$entry = $doc->createElement("activity:object");
|
||||||
$title = sprintf("New note by %s", $owner["nick"]);
|
$title = sprintf("New note by %s", $owner["nick"]);
|
||||||
} else {
|
} else {
|
||||||
$entry = $doc->createElementNS(NS_ATOM, "entry");
|
$entry = $doc->createElementNS(NAMESPACE_ATOM1, "entry");
|
||||||
|
|
||||||
$entry->setAttribute("xmlns:thr", NS_THR);
|
$entry->setAttribute("xmlns:thr", NAMESPACE_THREAD);
|
||||||
$entry->setAttribute("xmlns:georss", NS_GEORSS);
|
$entry->setAttribute("xmlns:georss", NAMESPACE_GEORSS);
|
||||||
$entry->setAttribute("xmlns:activity", NS_ACTIVITY);
|
$entry->setAttribute("xmlns:activity", NAMESPACE_ACTIVITY);
|
||||||
$entry->setAttribute("xmlns:media", NS_MEDIA);
|
$entry->setAttribute("xmlns:media", NAMESPACE_MEDIA);
|
||||||
$entry->setAttribute("xmlns:poco", NS_POCO);
|
$entry->setAttribute("xmlns:poco", NAMESPACE_POCO);
|
||||||
$entry->setAttribute("xmlns:ostatus", NS_OSTATUS);
|
$entry->setAttribute("xmlns:ostatus", NAMESPACE_OSTATUS);
|
||||||
$entry->setAttribute("xmlns:statusnet", NS_STATUSNET);
|
$entry->setAttribute("xmlns:statusnet", NAMESPACE_STATUSNET);
|
||||||
|
|
||||||
$author = ostatus_add_author($doc, $owner);
|
$author = ostatus_add_author($doc, $owner);
|
||||||
$entry->appendChild($author);
|
$entry->appendChild($author);
|
||||||
|
|
|
@ -26,6 +26,9 @@ function poller_run(&$argv, &$argc){
|
||||||
unset($db_host, $db_user, $db_pass, $db_data);
|
unset($db_host, $db_user, $db_pass, $db_data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (poller_max_connections_reached())
|
||||||
|
return;
|
||||||
|
|
||||||
$load = current_load();
|
$load = current_load();
|
||||||
if($load) {
|
if($load) {
|
||||||
$maxsysload = intval(get_config('system','maxloadavg'));
|
$maxsysload = intval(get_config('system','maxloadavg'));
|
||||||
|
@ -117,6 +120,40 @@ function poller_run(&$argv, &$argc){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Checks if the number of database connections has reached a critical limit.
|
||||||
|
*
|
||||||
|
* @return bool Are more than 3/4 of the maximum connections used?
|
||||||
|
*/
|
||||||
|
function poller_max_connections_reached() {
|
||||||
|
$r = q("SHOW VARIABLES WHERE `variable_name` = 'max_connections'");
|
||||||
|
if (!$r)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$max = intval($r[0]["Value"]);
|
||||||
|
if ($max == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$r = q("SHOW STATUS WHERE `variable_name` = 'Threads_connected'");
|
||||||
|
if (!$r)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$connected = intval($r[0]["Value"]);
|
||||||
|
if ($connected == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$level = $connected / $max;
|
||||||
|
|
||||||
|
logger("Connection usage: ".$connected."/".$max, LOGGER_DEBUG);
|
||||||
|
|
||||||
|
if ($level < (3/4))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
logger("Maximum level (3/4) of connections reached: ".$connected."/".$max);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief fix the queue entry if the worker process died
|
* @brief fix the queue entry if the worker process died
|
||||||
*
|
*
|
||||||
|
|
11
index.php
11
index.php
|
@ -233,16 +233,7 @@ if(strlen($a->module)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If not, next look for module overrides by the theme
|
* If not, next look for a 'standard' program module in the 'mod' directory
|
||||||
*/
|
|
||||||
|
|
||||||
if((! $a->module_loaded) && (file_exists("view/theme/" . current_theme() . "/mod/{$a->module}.php"))) {
|
|
||||||
include_once("view/theme/" . current_theme() . "/mod/{$a->module}.php");
|
|
||||||
// We will not set module_loaded to true to allow for partial overrides.
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Finally, look for a 'standard' program module in the 'mod' directory
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if((! $a->module_loaded) && (file_exists("mod/{$a->module}.php"))) {
|
if((! $a->module_loaded) && (file_exists("mod/{$a->module}.php"))) {
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
require_once("mod/hostxrd.php");
|
require_once("mod/hostxrd.php");
|
||||||
require_once("mod/nodeinfo.php");
|
require_once("mod/nodeinfo.php");
|
||||||
|
|
||||||
if(! function_exists('_well_known_init')) {
|
|
||||||
function _well_known_init(&$a){
|
function _well_known_init(&$a){
|
||||||
if ($a->argc > 1) {
|
if ($a->argc > 1) {
|
||||||
switch($a->argv[1]) {
|
switch($a->argv[1]) {
|
||||||
|
@ -20,9 +19,7 @@ function _well_known_init(&$a){
|
||||||
http_status_exit(404);
|
http_status_exit(404);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('wk_social_relay')) {
|
|
||||||
function wk_social_relay(&$a) {
|
function wk_social_relay(&$a) {
|
||||||
|
|
||||||
define('SR_SCOPE_ALL', 'all');
|
define('SR_SCOPE_ALL', 'all');
|
||||||
|
@ -67,4 +64,3 @@ function wk_social_relay(&$a) {
|
||||||
echo json_encode($relay, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|
echo json_encode($relay, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
require_once('include/Scrape.php');
|
||||||
|
|
||||||
if(! function_exists('acctlink_init')) {
|
|
||||||
function acctlink_init(&$a) {
|
function acctlink_init(&$a) {
|
||||||
|
|
||||||
if(x($_GET,'addr')) {
|
if(x($_GET,'addr')) {
|
||||||
$addr = trim($_GET['addr']);
|
$addr = trim($_GET['addr']);
|
||||||
$res = probe_url($addr);
|
$res = probe_url($addr);
|
||||||
|
@ -14,4 +14,3 @@ function acctlink_init(&$a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
require_once("include/acl_selectors.php");
|
require_once("include/acl_selectors.php");
|
||||||
|
|
||||||
if(! function_exists('acl_init')) {
|
|
||||||
function acl_init(&$a){
|
function acl_init(&$a){
|
||||||
acl_lookup($a);
|
acl_lookup($a);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@ require_once("include/text.php");
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_post')) {
|
|
||||||
function admin_post(&$a){
|
function admin_post(&$a){
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,7 +110,6 @@ function admin_post(&$a){
|
||||||
goaway($a->get_baseurl(true) . '/admin' );
|
goaway($a->get_baseurl(true) . '/admin' );
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Generates content of the admin panel pages
|
* @brief Generates content of the admin panel pages
|
||||||
|
@ -130,7 +128,6 @@ function admin_post(&$a){
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_content')) {
|
|
||||||
function admin_content(&$a) {
|
function admin_content(&$a) {
|
||||||
|
|
||||||
if(!is_site_admin()) {
|
if(!is_site_admin()) {
|
||||||
|
@ -248,7 +245,6 @@ function admin_content(&$a) {
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Subpage with some stats about "the federation" network
|
* @brief Subpage with some stats about "the federation" network
|
||||||
|
@ -264,7 +260,6 @@ function admin_content(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_federation')) {
|
|
||||||
function admin_page_federation(&$a) {
|
function admin_page_federation(&$a) {
|
||||||
// get counts on active friendica, diaspora, redmatrix, hubzilla, gnu
|
// get counts on active friendica, diaspora, redmatrix, hubzilla, gnu
|
||||||
// social and statusnet nodes this node is knowing
|
// social and statusnet nodes this node is knowing
|
||||||
|
@ -366,7 +361,6 @@ function admin_page_federation(&$a) {
|
||||||
'$baseurl' => $a->get_baseurl(),
|
'$baseurl' => $a->get_baseurl(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Admin Inspect Queue Page
|
* @brief Admin Inspect Queue Page
|
||||||
|
@ -381,7 +375,6 @@ function admin_page_federation(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_queue')) {
|
|
||||||
function admin_page_queue(&$a) {
|
function admin_page_queue(&$a) {
|
||||||
// get content from the queue table
|
// get content from the queue table
|
||||||
$r = q("SELECT c.name,c.nurl,q.id,q.network,q.created,q.last from queue as q, contact as c where c.id=q.cid order by q.cid, q.created;");
|
$r = q("SELECT c.name,c.nurl,q.id,q.network,q.created,q.last from queue as q, contact as c where c.id=q.cid order by q.cid, q.created;");
|
||||||
|
@ -401,7 +394,6 @@ function admin_page_queue(&$a) {
|
||||||
'$entries' => $r,
|
'$entries' => $r,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Admin Summary Page
|
* @brief Admin Summary Page
|
||||||
|
@ -414,7 +406,6 @@ function admin_page_queue(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_summary')) {
|
|
||||||
function admin_page_summary(&$a) {
|
function admin_page_summary(&$a) {
|
||||||
$r = q("SELECT `page-flags`, COUNT(uid) as `count` FROM `user` GROUP BY `page-flags`");
|
$r = q("SELECT `page-flags`, COUNT(uid) as `count` FROM `user` GROUP BY `page-flags`");
|
||||||
$accounts = array(
|
$accounts = array(
|
||||||
|
@ -461,14 +452,12 @@ function admin_page_summary(&$a) {
|
||||||
'$plugins' => array( t('Active plugins'), $a->plugins )
|
'$plugins' => array( t('Active plugins'), $a->plugins )
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Process send data from Admin Site Page
|
* @brief Process send data from Admin Site Page
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_site_post')) {
|
|
||||||
function admin_page_site_post(&$a) {
|
function admin_page_site_post(&$a) {
|
||||||
if(!x($_POST,"page_site")) {
|
if(!x($_POST,"page_site")) {
|
||||||
return;
|
return;
|
||||||
|
@ -781,7 +770,6 @@ function admin_page_site_post(&$a) {
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Generate Admin Site subpage
|
* @brief Generate Admin Site subpage
|
||||||
|
@ -791,7 +779,6 @@ function admin_page_site_post(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_site')) {
|
|
||||||
function admin_page_site(&$a) {
|
function admin_page_site(&$a) {
|
||||||
|
|
||||||
/* Installed langs */
|
/* Installed langs */
|
||||||
|
@ -996,7 +983,7 @@ function admin_page_site(&$a) {
|
||||||
'$form_security_token' => get_form_security_token("admin_site")
|
'$form_security_token' => get_form_security_token("admin_site")
|
||||||
|
|
||||||
));
|
));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1011,7 +998,6 @@ function admin_page_site(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
**/
|
**/
|
||||||
if(! function_exists('admin_page_dbsync')) {
|
|
||||||
function admin_page_dbsync(&$a) {
|
function admin_page_dbsync(&$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
@ -1087,7 +1073,7 @@ function admin_page_dbsync(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1095,7 +1081,6 @@ function admin_page_dbsync(&$a) {
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_users_post')) {
|
|
||||||
function admin_page_users_post(&$a){
|
function admin_page_users_post(&$a){
|
||||||
$pending = ( x($_POST, 'pending') ? $_POST['pending'] : array() );
|
$pending = ( x($_POST, 'pending') ? $_POST['pending'] : array() );
|
||||||
$users = ( x($_POST, 'user') ? $_POST['user'] : array() );
|
$users = ( x($_POST, 'user') ? $_POST['user'] : array() );
|
||||||
|
@ -1186,7 +1171,6 @@ function admin_page_users_post(&$a){
|
||||||
goaway($a->get_baseurl(true) . '/admin/users' );
|
goaway($a->get_baseurl(true) . '/admin/users' );
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Admin panel subpage for User management
|
* @brief Admin panel subpage for User management
|
||||||
|
@ -1200,7 +1184,6 @@ function admin_page_users_post(&$a){
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_users')) {
|
|
||||||
function admin_page_users(&$a){
|
function admin_page_users(&$a){
|
||||||
if($a->argc>2) {
|
if($a->argc>2) {
|
||||||
$uid = $a->argv[3];
|
$uid = $a->argv[3];
|
||||||
|
@ -1353,7 +1336,7 @@ function admin_page_users(&$a){
|
||||||
$o .= paginate($a);
|
$o .= paginate($a);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Plugins admin page
|
* @brief Plugins admin page
|
||||||
|
@ -1371,7 +1354,6 @@ function admin_page_users(&$a){
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_plugins')) {
|
|
||||||
function admin_page_plugins(&$a){
|
function admin_page_plugins(&$a){
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1502,14 +1484,12 @@ function admin_page_plugins(&$a){
|
||||||
'$form_security_token' => get_form_security_token("admin_themes"),
|
'$form_security_token' => get_form_security_token("admin_themes"),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $themes
|
* @param array $themes
|
||||||
* @param string $th
|
* @param string $th
|
||||||
* @param int $result
|
* @param int $result
|
||||||
*/
|
*/
|
||||||
if(! function_exists('toggle_theme')) {
|
|
||||||
function toggle_theme(&$themes,$th,&$result) {
|
function toggle_theme(&$themes,$th,&$result) {
|
||||||
for($x = 0; $x < count($themes); $x ++) {
|
for($x = 0; $x < count($themes); $x ++) {
|
||||||
if($themes[$x]['name'] === $th) {
|
if($themes[$x]['name'] === $th) {
|
||||||
|
@ -1524,14 +1504,12 @@ function toggle_theme(&$themes,$th,&$result) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $themes
|
* @param array $themes
|
||||||
* @param string $th
|
* @param string $th
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
if(! function_exists('theme_status')) {
|
|
||||||
function theme_status($themes,$th) {
|
function theme_status($themes,$th) {
|
||||||
for($x = 0; $x < count($themes); $x ++) {
|
for($x = 0; $x < count($themes); $x ++) {
|
||||||
if($themes[$x]['name'] === $th) {
|
if($themes[$x]['name'] === $th) {
|
||||||
|
@ -1545,13 +1523,12 @@ function theme_status($themes,$th) {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $themes
|
* @param array $themes
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('rebuild_theme_table')) {
|
|
||||||
function rebuild_theme_table($themes) {
|
function rebuild_theme_table($themes) {
|
||||||
$o = '';
|
$o = '';
|
||||||
if(count($themes)) {
|
if(count($themes)) {
|
||||||
|
@ -1565,7 +1542,7 @@ function rebuild_theme_table($themes) {
|
||||||
}
|
}
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Themes admin page
|
* @brief Themes admin page
|
||||||
|
@ -1583,7 +1560,6 @@ function rebuild_theme_table($themes) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_themes')) {
|
|
||||||
function admin_page_themes(&$a){
|
function admin_page_themes(&$a){
|
||||||
|
|
||||||
$allowed_themes_str = get_config('system','allowed_themes');
|
$allowed_themes_str = get_config('system','allowed_themes');
|
||||||
|
@ -1758,14 +1734,13 @@ function admin_page_themes(&$a){
|
||||||
'$form_security_token' => get_form_security_token("admin_themes"),
|
'$form_security_token' => get_form_security_token("admin_themes"),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Prosesses data send by Logs admin page
|
* @brief Prosesses data send by Logs admin page
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_logs_post')) {
|
|
||||||
function admin_page_logs_post(&$a) {
|
function admin_page_logs_post(&$a) {
|
||||||
if(x($_POST,"page_logs")) {
|
if(x($_POST,"page_logs")) {
|
||||||
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
|
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
|
||||||
|
@ -1783,7 +1758,6 @@ function admin_page_logs_post(&$a) {
|
||||||
goaway($a->get_baseurl(true) . '/admin/logs' );
|
goaway($a->get_baseurl(true) . '/admin/logs' );
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Generates admin panel subpage for configuration of the logs
|
* @brief Generates admin panel subpage for configuration of the logs
|
||||||
|
@ -1801,7 +1775,6 @@ function admin_page_logs_post(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_logs')) {
|
|
||||||
function admin_page_logs(&$a){
|
function admin_page_logs(&$a){
|
||||||
|
|
||||||
$log_choices = array(
|
$log_choices = array(
|
||||||
|
@ -1833,7 +1806,6 @@ function admin_page_logs(&$a){
|
||||||
'$phplogcode' => "error_reporting(E_ERROR | E_WARNING | E_PARSE );\nini_set('error_log','php.out');\nini_set('log_errors','1');\nini_set('display_errors', '1');",
|
'$phplogcode' => "error_reporting(E_ERROR | E_WARNING | E_PARSE );\nini_set('error_log','php.out');\nini_set('log_errors','1');\nini_set('display_errors', '1');",
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Generates admin panel subpage to view the Friendica log
|
* @brief Generates admin panel subpage to view the Friendica log
|
||||||
|
@ -1853,7 +1825,6 @@ function admin_page_logs(&$a){
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_viewlogs')) {
|
|
||||||
function admin_page_viewlogs(&$a){
|
function admin_page_viewlogs(&$a){
|
||||||
$t = get_markup_template("admin_viewlogs.tpl");
|
$t = get_markup_template("admin_viewlogs.tpl");
|
||||||
$f = get_config('system','logfile');
|
$f = get_config('system','logfile');
|
||||||
|
@ -1890,14 +1861,12 @@ function admin_page_viewlogs(&$a){
|
||||||
'$logname' => get_config('system','logfile')
|
'$logname' => get_config('system','logfile')
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Prosesses data send by the features admin page
|
* @brief Prosesses data send by the features admin page
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_features_post')) {
|
|
||||||
function admin_page_features_post(&$a) {
|
function admin_page_features_post(&$a) {
|
||||||
|
|
||||||
check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features');
|
check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features');
|
||||||
|
@ -1929,7 +1898,6 @@ function admin_page_features_post(&$a) {
|
||||||
goaway($a->get_baseurl(true) . '/admin/features' );
|
goaway($a->get_baseurl(true) . '/admin/features' );
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Subpage for global additional feature management
|
* @brief Subpage for global additional feature management
|
||||||
|
@ -1945,7 +1913,6 @@ function admin_page_features_post(&$a) {
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('admin_page_features')) {
|
|
||||||
function admin_page_features(&$a) {
|
function admin_page_features(&$a) {
|
||||||
|
|
||||||
if((argc() > 1) && (argv(1) === 'features')) {
|
if((argc() > 1) && (argv(1) === 'features')) {
|
||||||
|
@ -1978,4 +1945,3 @@ function admin_page_features(&$a) {
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ require_once('include/Contact.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
require_once('mod/contacts.php');
|
require_once('mod/contacts.php');
|
||||||
|
|
||||||
if(! function_exists('allfriends_content')) {
|
|
||||||
function allfriends_content(&$a) {
|
function allfriends_content(&$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
@ -98,4 +97,3 @@ function allfriends_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
if(! function_exists('amcd_content')) {
|
|
||||||
function amcd_content(&$a) {
|
function amcd_content(&$a) {
|
||||||
//header("Content-type: text/json");
|
//header("Content-type: text/json");
|
||||||
echo <<< EOT
|
echo <<< EOT
|
||||||
|
@ -47,4 +47,3 @@ echo <<< EOT
|
||||||
EOT;
|
EOT;
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
11
mod/api.php
11
mod/api.php
|
@ -1,8 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once('include/api.php');
|
require_once('include/api.php');
|
||||||
|
|
||||||
if(! function_exists('oauth_get_client')) {
|
|
||||||
function oauth_get_client($request){
|
function oauth_get_client($request){
|
||||||
|
|
||||||
|
|
||||||
$params = $request->get_parameters();
|
$params = $request->get_parameters();
|
||||||
$token = $params['oauth_token'];
|
$token = $params['oauth_token'];
|
||||||
|
|
||||||
|
@ -17,10 +19,9 @@ function oauth_get_client($request){
|
||||||
|
|
||||||
return $r[0];
|
return $r[0];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('api_post')) {
|
|
||||||
function api_post(&$a) {
|
function api_post(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
|
@ -30,10 +31,9 @@ function api_post(&$a) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('api_content')) {
|
|
||||||
function api_content(&$a) {
|
function api_content(&$a) {
|
||||||
if ($a->cmd=='api/oauth/authorize'){
|
if ($a->cmd=='api/oauth/authorize'){
|
||||||
/*
|
/*
|
||||||
|
@ -114,4 +114,3 @@ function api_content(&$a) {
|
||||||
echo api_call($a);
|
echo api_call($a);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
40
mod/apps.php
40
mod/apps.php
|
@ -1,23 +1,25 @@
|
||||||
<?php
|
<?php
|
||||||
if(! function_exists('apps_content')) {
|
|
||||||
function apps_content(&$a) {
|
function apps_content(&$a) {
|
||||||
$privateaddons = get_config('config','private_addons');
|
$privateaddons = get_config('config','private_addons');
|
||||||
if ($privateaddons === "1") {
|
if ($privateaddons === "1") {
|
||||||
if((! (local_user()))) {
|
if((! (local_user()))) {
|
||||||
info( t("You must be logged in to use addons. "));
|
info( t("You must be logged in to use addons. "));
|
||||||
return;
|
return;};
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$title = t('Applications');
|
|
||||||
|
|
||||||
if(count($a->apps)==0)
|
|
||||||
notice( t('No installed applications.') . EOL);
|
|
||||||
|
|
||||||
$tpl = get_markup_template("apps.tpl");
|
|
||||||
return replace_macros($tpl, array(
|
|
||||||
'$title' => $title,
|
|
||||||
'$apps' => $a->apps,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$title = t('Applications');
|
||||||
|
|
||||||
|
if(count($a->apps)==0)
|
||||||
|
notice( t('No installed applications.') . EOL);
|
||||||
|
|
||||||
|
|
||||||
|
$tpl = get_markup_template("apps.tpl");
|
||||||
|
return replace_macros($tpl, array(
|
||||||
|
'$title' => $title,
|
||||||
|
'$apps' => $a->apps,
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
|
|
||||||
if(! function_exists('attach_init')) {
|
|
||||||
function attach_init(&$a) {
|
function attach_init(&$a) {
|
||||||
|
|
||||||
if($a->argc != 2) {
|
if($a->argc != 2) {
|
||||||
|
@ -47,4 +47,3 @@ function attach_init(&$a) {
|
||||||
killme();
|
killme();
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ function visible_lf($s) {
|
||||||
return str_replace("\n",'<br />', $s);
|
return str_replace("\n",'<br />', $s);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('babel_content')) {
|
|
||||||
function babel_content(&$a) {
|
function babel_content(&$a) {
|
||||||
|
|
||||||
$o .= '<h1>Babel Diagnostic</h1>';
|
$o .= '<h1>Babel Diagnostic</h1>';
|
||||||
|
@ -78,4 +77,3 @@ function babel_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once('include/conversation.php');
|
require_once('include/conversation.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
if(! function_exists('bookmarklet_init')) {
|
|
||||||
function bookmarklet_init(&$a) {
|
function bookmarklet_init(&$a) {
|
||||||
$_GET["mode"] = "minimal";
|
$_GET["mode"] = "minimal";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('bookmarklet_content')) {
|
|
||||||
function bookmarklet_content(&$a) {
|
function bookmarklet_content(&$a) {
|
||||||
if(!local_user()) {
|
if(!local_user()) {
|
||||||
$o = '<h2>'.t('Login').'</h2>';
|
$o = '<h2>'.t('Login').'</h2>';
|
||||||
|
@ -46,4 +44,3 @@ function bookmarklet_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -4,28 +4,21 @@
|
||||||
* General purpose landing page for plugins/addons
|
* General purpose landing page for plugins/addons
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(! function_exists('cb_init')) {
|
|
||||||
function cb_init(&$a) {
|
function cb_init(&$a) {
|
||||||
call_hooks('cb_init');
|
call_hooks('cb_init');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('cb_post')) {
|
|
||||||
function cb_post(&$a) {
|
function cb_post(&$a) {
|
||||||
call_hooks('cb_post', $_POST);
|
call_hooks('cb_post', $_POST);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('cb_afterpost')) {
|
|
||||||
function cb_afterpost(&$a) {
|
function cb_afterpost(&$a) {
|
||||||
call_hooks('cb_afterpost');
|
call_hooks('cb_afterpost');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('cb_content')) {
|
|
||||||
function cb_content(&$a) {
|
function cb_content(&$a) {
|
||||||
$o = '';
|
$o = '';
|
||||||
call_hooks('cb_content', $o);
|
call_hooks('cb_content', $o);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ require_once('include/Contact.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
require_once('mod/contacts.php');
|
require_once('mod/contacts.php');
|
||||||
|
|
||||||
if(! function_exists('common_content')) {
|
|
||||||
function common_content(&$a) {
|
function common_content(&$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
@ -145,4 +144,3 @@ function common_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
if(! function_exists('community_init')) {
|
|
||||||
function community_init(&$a) {
|
function community_init(&$a) {
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
unset($_SESSION['theme']);
|
unset($_SESSION['theme']);
|
||||||
unset($_SESSION['mobile-theme']);
|
unset($_SESSION['mobile-theme']);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('community_content')) {
|
|
||||||
function community_content(&$a, $update = 0) {
|
function community_content(&$a, $update = 0) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
@ -114,9 +115,7 @@ function community_content(&$a, $update = 0) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('community_getitems')) {
|
|
||||||
function community_getitems($start, $itemspage) {
|
function community_getitems($start, $itemspage) {
|
||||||
if (get_config('system','community_page_style') == CP_GLOBAL_COMMUNITY)
|
if (get_config('system','community_page_style') == CP_GLOBAL_COMMUNITY)
|
||||||
return(community_getpublicitems($start, $itemspage));
|
return(community_getpublicitems($start, $itemspage));
|
||||||
|
@ -141,10 +140,9 @@ function community_getitems($start, $itemspage) {
|
||||||
);
|
);
|
||||||
|
|
||||||
return($r);
|
return($r);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('community_getpublicitems')) {
|
|
||||||
function community_getpublicitems($start, $itemspage) {
|
function community_getpublicitems($start, $itemspage) {
|
||||||
$r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`,
|
$r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`,
|
||||||
`author-name` AS `name`, `owner-avatar` AS `photo`,
|
`author-name` AS `name`, `owner-avatar` AS `photo`,
|
||||||
|
@ -159,4 +157,3 @@ function community_getpublicitems($start, $itemspage) {
|
||||||
|
|
||||||
return($r);
|
return($r);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
|
|
||||||
if(! function_exists('contactgroup_content')) {
|
|
||||||
function contactgroup_content(&$a) {
|
function contactgroup_content(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,4 +48,3 @@ function contactgroup_content(&$a) {
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ require_once('include/Scrape.php');
|
||||||
require_once('mod/proxy.php');
|
require_once('mod/proxy.php');
|
||||||
require_once('include/Photo.php');
|
require_once('include/Photo.php');
|
||||||
|
|
||||||
if(! function_exists('contacts_init')) {
|
|
||||||
function contacts_init(&$a) {
|
function contacts_init(&$a) {
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
@ -89,10 +88,9 @@ function contacts_init(&$a) {
|
||||||
'$base' => $base
|
'$base' => $base
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('contacts_batch_actions')) {
|
|
||||||
function contacts_batch_actions(&$a){
|
function contacts_batch_actions(&$a){
|
||||||
$contacts_id = $_POST['contact_batch'];
|
$contacts_id = $_POST['contact_batch'];
|
||||||
if (!is_array($contacts_id)) return;
|
if (!is_array($contacts_id)) return;
|
||||||
|
@ -134,10 +132,10 @@ function contacts_batch_actions(&$a){
|
||||||
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
|
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
|
||||||
else
|
else
|
||||||
goaway($a->get_baseurl(true) . '/contacts');
|
goaway($a->get_baseurl(true) . '/contacts');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('contacts_post')) {
|
|
||||||
function contacts_post(&$a) {
|
function contacts_post(&$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
|
@ -217,11 +215,10 @@ function contacts_post(&$a) {
|
||||||
$a->data['contact'] = $r[0];
|
$a->data['contact'] = $r[0];
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*contact actions*/
|
/*contact actions*/
|
||||||
if(! function_exists('_contact_update')) {
|
|
||||||
function _contact_update($contact_id) {
|
function _contact_update($contact_id) {
|
||||||
$r = q("SELECT `uid`, `url`, `network` FROM `contact` WHERE `id` = %d", intval($contact_id));
|
$r = q("SELECT `uid`, `url`, `network` FROM `contact` WHERE `id` = %d", intval($contact_id));
|
||||||
if (!$r)
|
if (!$r)
|
||||||
|
@ -242,9 +239,7 @@ function _contact_update($contact_id) {
|
||||||
// pull feed and consume it, which should subscribe to the hub.
|
// pull feed and consume it, which should subscribe to the hub.
|
||||||
proc_run('php',"include/onepoll.php","$contact_id", "force");
|
proc_run('php',"include/onepoll.php","$contact_id", "force");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('_contact_update_profile')) {
|
|
||||||
function _contact_update_profile($contact_id) {
|
function _contact_update_profile($contact_id) {
|
||||||
$r = q("SELECT `uid`, `url`, `network` FROM `contact` WHERE `id` = %d", intval($contact_id));
|
$r = q("SELECT `uid`, `url`, `network` FROM `contact` WHERE `id` = %d", intval($contact_id));
|
||||||
if (!$r)
|
if (!$r)
|
||||||
|
@ -304,9 +299,7 @@ function _contact_update_profile($contact_id) {
|
||||||
// Update the entry in the gcontact table
|
// Update the entry in the gcontact table
|
||||||
update_gcontact_from_probe($data["url"]);
|
update_gcontact_from_probe($data["url"]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('_contact_block')) {
|
|
||||||
function _contact_block($contact_id, $orig_record) {
|
function _contact_block($contact_id, $orig_record) {
|
||||||
$blocked = (($orig_record['blocked']) ? 0 : 1);
|
$blocked = (($orig_record['blocked']) ? 0 : 1);
|
||||||
$r = q("UPDATE `contact` SET `blocked` = %d WHERE `id` = %d AND `uid` = %d",
|
$r = q("UPDATE `contact` SET `blocked` = %d WHERE `id` = %d AND `uid` = %d",
|
||||||
|
@ -315,10 +308,8 @@ function _contact_block($contact_id, $orig_record) {
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
return $r;
|
return $r;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('_contact_ignore')) {
|
}
|
||||||
function _contact_ignore($contact_id, $orig_record) {
|
function _contact_ignore($contact_id, $orig_record) {
|
||||||
$readonly = (($orig_record['readonly']) ? 0 : 1);
|
$readonly = (($orig_record['readonly']) ? 0 : 1);
|
||||||
$r = q("UPDATE `contact` SET `readonly` = %d WHERE `id` = %d AND `uid` = %d",
|
$r = q("UPDATE `contact` SET `readonly` = %d WHERE `id` = %d AND `uid` = %d",
|
||||||
|
@ -328,9 +319,6 @@ function _contact_ignore($contact_id, $orig_record) {
|
||||||
);
|
);
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('_contact_archive')) {
|
|
||||||
function _contact_archive($contact_id, $orig_record) {
|
function _contact_archive($contact_id, $orig_record) {
|
||||||
$archived = (($orig_record['archive']) ? 0 : 1);
|
$archived = (($orig_record['archive']) ? 0 : 1);
|
||||||
$r = q("UPDATE `contact` SET `archive` = %d WHERE `id` = %d AND `uid` = %d",
|
$r = q("UPDATE `contact` SET `archive` = %d WHERE `id` = %d AND `uid` = %d",
|
||||||
|
@ -343,18 +331,14 @@ function _contact_archive($contact_id, $orig_record) {
|
||||||
}
|
}
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('_contact_drop')) {
|
|
||||||
function _contact_drop($contact_id, $orig_record) {
|
function _contact_drop($contact_id, $orig_record) {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
terminate_friendship($a->user,$a->contact,$orig_record);
|
terminate_friendship($a->user,$a->contact,$orig_record);
|
||||||
contact_remove($orig_record['id']);
|
contact_remove($orig_record['id']);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('contacts_content')) {
|
|
||||||
function contacts_content(&$a) {
|
function contacts_content(&$a) {
|
||||||
|
|
||||||
$sort_type = 0;
|
$sort_type = 0;
|
||||||
|
@ -815,9 +799,7 @@ function contacts_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('contacts_tab')) {
|
|
||||||
function contacts_tab($a, $contact_id, $active_tab) {
|
function contacts_tab($a, $contact_id, $active_tab) {
|
||||||
// tabs
|
// tabs
|
||||||
$tabs = array(
|
$tabs = array(
|
||||||
|
@ -891,9 +873,7 @@ function contacts_tab($a, $contact_id, $active_tab) {
|
||||||
|
|
||||||
return $tab_str;
|
return $tab_str;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('contact_posts')) {
|
|
||||||
function contact_posts($a, $contact_id) {
|
function contact_posts($a, $contact_id) {
|
||||||
|
|
||||||
$r = q("SELECT `url` FROM `contact` WHERE `id` = %d", intval($contact_id));
|
$r = q("SELECT `url` FROM `contact` WHERE `id` = %d", intval($contact_id));
|
||||||
|
@ -921,9 +901,7 @@ function contact_posts($a, $contact_id) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('_contact_detail_for_template')) {
|
|
||||||
function _contact_detail_for_template($rr){
|
function _contact_detail_for_template($rr){
|
||||||
|
|
||||||
$community = '';
|
$community = '';
|
||||||
|
@ -974,5 +952,5 @@ function _contact_detail_for_template($rr){
|
||||||
'url' => $url,
|
'url' => $url,
|
||||||
'network' => network_to_name($rr['network'], $rr['url']),
|
'network' => network_to_name($rr['network'], $rr['url']),
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
// fast - e.g. one or two milliseconds to fetch parent items for the current content,
|
// fast - e.g. one or two milliseconds to fetch parent items for the current content,
|
||||||
// and 10-20 milliseconds to fetch all the child items.
|
// and 10-20 milliseconds to fetch all the child items.
|
||||||
|
|
||||||
if(! function_exists('content_content')) {
|
|
||||||
function content_content(&$a, $update = 0) {
|
function content_content(&$a, $update = 0) {
|
||||||
|
|
||||||
require_once('include/conversation.php');
|
require_once('include/conversation.php');
|
||||||
|
@ -304,9 +304,9 @@ function content_content(&$a, $update = 0) {
|
||||||
echo json_encode($o);
|
echo json_encode($o);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('render_content')) {
|
|
||||||
|
|
||||||
function render_content(&$a, $items, $mode, $update, $preview = false) {
|
function render_content(&$a, $items, $mode, $update, $preview = false) {
|
||||||
|
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
|
@ -897,5 +897,5 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
||||||
|
|
||||||
|
|
||||||
return $threads;
|
return $threads;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
* addons repository will be listed though ATM)
|
* addons repository will be listed though ATM)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(! function_exists('credits_content')) {
|
|
||||||
function credits_content (&$a) {
|
function credits_content (&$a) {
|
||||||
/* fill the page with credits */
|
/* fill the page with credits */
|
||||||
$f = fopen('util/credits.txt','r');
|
$f = fopen('util/credits.txt','r');
|
||||||
|
@ -19,4 +18,3 @@ function credits_content (&$a) {
|
||||||
'$names' => $arr,
|
'$names' => $arr,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
require_once("include/contact_selectors.php");
|
require_once("include/contact_selectors.php");
|
||||||
require_once("mod/contacts.php");
|
require_once("mod/contacts.php");
|
||||||
|
|
||||||
if(! function_exists('crepair_init')) {
|
|
||||||
function crepair_init(&$a) {
|
function crepair_init(&$a) {
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
@ -29,9 +28,8 @@ function crepair_init(&$a) {
|
||||||
profile_load($a, "", 0, get_contact_details_by_url($contact["url"]));
|
profile_load($a, "", 0, get_contact_details_by_url($contact["url"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('crepair_post')) {
|
|
||||||
function crepair_post(&$a) {
|
function crepair_post(&$a) {
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
@ -93,9 +91,9 @@ function crepair_post(&$a) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('crepair_content')) {
|
|
||||||
|
|
||||||
function crepair_content(&$a) {
|
function crepair_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -182,5 +180,5 @@ function crepair_content(&$a) {
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
require_once('mod/settings.php');
|
require_once('mod/settings.php');
|
||||||
|
|
||||||
if(! function_exists('delegate_init')) {
|
|
||||||
function delegate_init(&$a) {
|
function delegate_init(&$a) {
|
||||||
return settings_init($a);
|
return settings_init($a);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('delegate_content')) {
|
|
||||||
function delegate_content(&$a) {
|
function delegate_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -146,5 +144,5 @@ function delegate_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
require_once('include/enotify.php');
|
require_once('include/enotify.php');
|
||||||
|
|
||||||
if(! function_exists('dfrn_confirm_post')) {
|
|
||||||
function dfrn_confirm_post(&$a,$handsfree = null) {
|
function dfrn_confirm_post(&$a,$handsfree = null) {
|
||||||
|
|
||||||
if(is_array($handsfree)) {
|
if(is_array($handsfree)) {
|
||||||
|
@ -802,5 +801,5 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
|
||||||
|
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
require_once('include/dfrn.php');
|
||||||
require_once('include/event.php');
|
require_once('include/event.php');
|
||||||
|
|
||||||
require_once('library/defuse/php-encryption-1.2.1/Crypto.php');
|
require_once('library/defuse/php-encryption-1.2.1/Crypto.php');
|
||||||
|
|
||||||
if(! function_exists('dfrn_notify_post')) {
|
|
||||||
function dfrn_notify_post(&$a) {
|
function dfrn_notify_post(&$a) {
|
||||||
logger(__function__, LOGGER_TRACE);
|
logger(__function__, LOGGER_TRACE);
|
||||||
$dfrn_id = ((x($_POST,'dfrn_id')) ? notags(trim($_POST['dfrn_id'])) : '');
|
$dfrn_id = ((x($_POST,'dfrn_id')) ? notags(trim($_POST['dfrn_id'])) : '');
|
||||||
|
@ -209,14 +209,13 @@ function dfrn_notify_post(&$a) {
|
||||||
logger('rino: decrypted data: ' . $data, LOGGER_DATA);
|
logger('rino: decrypted data: ' . $data, LOGGER_DATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = local_delivery($importer,$data);
|
$ret = dfrn::import($data, $importer);
|
||||||
xml_status($ret);
|
xml_status($ret);
|
||||||
|
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('dfrn_notify_content')) {
|
|
||||||
function dfrn_notify_content(&$a) {
|
function dfrn_notify_content(&$a) {
|
||||||
|
|
||||||
if(x($_GET,'dfrn_id')) {
|
if(x($_GET,'dfrn_id')) {
|
||||||
|
@ -340,5 +339,5 @@ function dfrn_notify_content(&$a) {
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ require_once('include/items.php');
|
||||||
require_once('include/auth.php');
|
require_once('include/auth.php');
|
||||||
require_once('include/dfrn.php');
|
require_once('include/dfrn.php');
|
||||||
|
|
||||||
if(! function_exists('dfrn_poll_init')) {
|
|
||||||
function dfrn_poll_init(&$a) {
|
function dfrn_poll_init(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -195,11 +195,11 @@ function dfrn_poll_init(&$a) {
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(! function_exists('dfrn_poll_post')) {
|
|
||||||
function dfrn_poll_post(&$a) {
|
function dfrn_poll_post(&$a) {
|
||||||
|
|
||||||
$dfrn_id = ((x($_POST,'dfrn_id')) ? $_POST['dfrn_id'] : '');
|
$dfrn_id = ((x($_POST,'dfrn_id')) ? $_POST['dfrn_id'] : '');
|
||||||
|
@ -377,9 +377,7 @@ function dfrn_poll_post(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('dfrn_poll_content')) {
|
|
||||||
function dfrn_poll_content(&$a) {
|
function dfrn_poll_content(&$a) {
|
||||||
|
|
||||||
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
||||||
|
@ -564,4 +562,3 @@ function dfrn_poll_content(&$a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
if(! function_exists('directory_init')) {
|
|
||||||
function directory_init(&$a) {
|
function directory_init(&$a) {
|
||||||
$a->set_pager_itemspage(60);
|
$a->set_pager_itemspage(60);
|
||||||
|
|
||||||
|
@ -16,17 +16,17 @@ function directory_init(&$a) {
|
||||||
unset($_SESSION['mobile-theme']);
|
unset($_SESSION['mobile-theme']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('directory_post')) {
|
|
||||||
function directory_post(&$a) {
|
function directory_post(&$a) {
|
||||||
if(x($_POST,'search'))
|
if(x($_POST,'search'))
|
||||||
$a->data['search'] = $_POST['search'];
|
$a->data['search'] = $_POST['search'];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('directory_content')) {
|
|
||||||
|
|
||||||
function directory_content(&$a) {
|
function directory_content(&$a) {
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
@ -217,4 +217,3 @@ function directory_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ require_once('include/Contact.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
require_once('mod/contacts.php');
|
require_once('mod/contacts.php');
|
||||||
|
|
||||||
if(! function_exists('dirfind_init')) {
|
|
||||||
function dirfind_init(&$a) {
|
function dirfind_init(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -20,9 +19,9 @@ function dirfind_init(&$a) {
|
||||||
|
|
||||||
$a->page['aside'] .= follow_widget();
|
$a->page['aside'] .= follow_widget();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('dirfind_content')) {
|
|
||||||
|
|
||||||
function dirfind_content(&$a, $prefix = "") {
|
function dirfind_content(&$a, $prefix = "") {
|
||||||
|
|
||||||
$community = false;
|
$community = false;
|
||||||
|
@ -236,4 +235,3 @@ function dirfind_content(&$a, $prefix = "") {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
if(! function_exists('display_init')) {
|
|
||||||
function display_init(&$a) {
|
function display_init(&$a) {
|
||||||
|
|
||||||
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
||||||
|
@ -85,10 +85,9 @@ function display_init(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
profile_load($a, $nick, 0, $profiledata);
|
profile_load($a, $nick, 0, $profiledata);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('display_fetchauthor')) {
|
|
||||||
function display_fetchauthor($a, $item) {
|
function display_fetchauthor($a, $item) {
|
||||||
|
|
||||||
$profiledata = array();
|
$profiledata = array();
|
||||||
|
@ -221,9 +220,7 @@ function display_fetchauthor($a, $item) {
|
||||||
|
|
||||||
return($profiledata);
|
return($profiledata);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('display_content')) {
|
|
||||||
function display_content(&$a, $update = 0) {
|
function display_content(&$a, $update = 0) {
|
||||||
|
|
||||||
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
|
||||||
|
@ -525,4 +522,4 @@ function display_content(&$a, $update = 0) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
require_once('include/acl_selectors.php');
|
require_once('include/acl_selectors.php');
|
||||||
|
|
||||||
if(! function_exists('editpost_content')) {
|
|
||||||
function editpost_content(&$a) {
|
function editpost_content(&$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
@ -151,5 +150,7 @@ function editpost_content(&$a) {
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ require_once('include/datetime.php');
|
||||||
require_once('include/event.php');
|
require_once('include/event.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
if(! function_exists('events_post')) {
|
|
||||||
function events_post(&$a) {
|
function events_post(&$a) {
|
||||||
|
|
||||||
logger('post: ' . print_r($_REQUEST,true));
|
logger('post: ' . print_r($_REQUEST,true));
|
||||||
|
@ -157,9 +156,9 @@ function events_post(&$a) {
|
||||||
|
|
||||||
goaway($_SESSION['return_url']);
|
goaway($_SESSION['return_url']);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('events_content')) {
|
|
||||||
|
|
||||||
function events_content(&$a) {
|
function events_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -579,4 +578,3 @@ function events_content(&$a) {
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ require_once('include/Photo.php');
|
||||||
/**
|
/**
|
||||||
* @param App $a
|
* @param App $a
|
||||||
*/
|
*/
|
||||||
if(! function_exists('fbrowser_content')) {
|
|
||||||
function fbrowser_content($a){
|
function fbrowser_content($a){
|
||||||
|
|
||||||
if (!local_user())
|
if (!local_user())
|
||||||
|
@ -142,5 +141,5 @@ function fbrowser_content($a){
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once('include/security.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
if(! function_exists('filer_content')) {
|
|
||||||
function filer_content(&$a) {
|
function filer_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -35,4 +35,3 @@ function filer_content(&$a) {
|
||||||
}
|
}
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('filerm_content')) {
|
|
||||||
function filerm_content(&$a) {
|
function filerm_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -26,4 +25,3 @@ function filerm_content(&$a) {
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ require_once('include/follow.php');
|
||||||
require_once('include/Contact.php');
|
require_once('include/Contact.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
|
|
||||||
if(! function_exists('follow_content')) {
|
|
||||||
function follow_content(&$a) {
|
function follow_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -149,9 +148,7 @@ function follow_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('follow_post')) {
|
|
||||||
function follow_post(&$a) {
|
function follow_post(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -188,4 +185,3 @@ function follow_post(&$a) {
|
||||||
goaway($return_url);
|
goaway($return_url);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('friendica_init')) {
|
|
||||||
function friendica_init(&$a) {
|
function friendica_init(&$a) {
|
||||||
if ($a->argv[1]=="json"){
|
if ($a->argv[1]=="json"){
|
||||||
$register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
|
$register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
|
||||||
|
@ -57,9 +56,9 @@ function friendica_init(&$a) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('friendica_content')) {
|
|
||||||
|
|
||||||
function friendica_content(&$a) {
|
function friendica_content(&$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
@ -106,5 +105,5 @@ function friendica_content(&$a) {
|
||||||
call_hooks('about_hook', $o);
|
call_hooks('about_hook', $o);
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('fsuggest_post')) {
|
|
||||||
function fsuggest_post(&$a) {
|
function fsuggest_post(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -65,11 +65,11 @@ function fsuggest_post(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(! function_exists('fsuggest_content')) {
|
|
||||||
function fsuggest_content(&$a) {
|
function fsuggest_content(&$a) {
|
||||||
|
|
||||||
require_once('include/acl_selectors.php');
|
require_once('include/acl_selectors.php');
|
||||||
|
@ -109,4 +109,3 @@ function fsuggest_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('validate_members')) {
|
|
||||||
function validate_members(&$item) {
|
function validate_members(&$item) {
|
||||||
$item = intval($item);
|
$item = intval($item);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('group_init')) {
|
|
||||||
function group_init(&$a) {
|
function group_init(&$a) {
|
||||||
if(local_user()) {
|
if(local_user()) {
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
$a->page['aside'] = group_side('contacts','group','extended',(($a->argc > 1) ? intval($a->argv[1]) : 0));
|
$a->page['aside'] = group_side('contacts','group','extended',(($a->argc > 1) ? intval($a->argv[1]) : 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('group_post')) {
|
|
||||||
|
|
||||||
function group_post(&$a) {
|
function group_post(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -67,9 +64,7 @@ function group_post(&$a) {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('group_content')) {
|
|
||||||
function group_content(&$a) {
|
function group_content(&$a) {
|
||||||
$change = false;
|
$change = false;
|
||||||
|
|
||||||
|
@ -234,5 +229,5 @@ function group_content(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return replace_macros($tpl, $context);
|
return replace_macros($tpl, $context);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('hcard_init')) {
|
|
||||||
function hcard_init(&$a) {
|
function hcard_init(&$a) {
|
||||||
|
|
||||||
$blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
|
$blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
|
||||||
|
@ -47,5 +46,6 @@ function hcard_init(&$a) {
|
||||||
$dfrn_pages = array('request', 'confirm', 'notify', 'poll');
|
$dfrn_pages = array('request', 'confirm', 'notify', 'poll');
|
||||||
foreach($dfrn_pages as $dfrn)
|
foreach($dfrn_pages as $dfrn)
|
||||||
$a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".$a->get_baseurl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
|
$a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".$a->get_baseurl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ if (!function_exists('load_doc_file')) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('help_content')) {
|
|
||||||
function help_content(&$a) {
|
function help_content(&$a) {
|
||||||
|
|
||||||
nav_set_selected('help');
|
nav_set_selected('help');
|
||||||
|
@ -99,5 +98,5 @@ function help_content(&$a) {
|
||||||
}
|
}
|
||||||
</style>".$html;
|
</style>".$html;
|
||||||
return $html;
|
return $html;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
require_once('include/crypto.php');
|
require_once('include/crypto.php');
|
||||||
|
|
||||||
if(! function_exists('hostxrd_init')) {
|
|
||||||
function hostxrd_init(&$a) {
|
function hostxrd_init(&$a) {
|
||||||
header('Access-Control-Allow-Origin: *');
|
header('Access-Control-Allow-Origin: *');
|
||||||
header("Content-type: text/xml");
|
header("Content-type: text/xml");
|
||||||
|
@ -28,5 +27,5 @@ function hostxrd_init(&$a) {
|
||||||
));
|
));
|
||||||
session_write_close();
|
session_write_close();
|
||||||
exit();
|
exit();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('ignored_init')) {
|
|
||||||
function ignored_init(&$a) {
|
function ignored_init(&$a) {
|
||||||
|
|
||||||
$ignored = 0;
|
$ignored = 0;
|
||||||
|
@ -43,4 +43,3 @@ function ignored_init(&$a) {
|
||||||
echo json_encode($ignored);
|
echo json_encode($ignored);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ require_once "include/Photo.php";
|
||||||
|
|
||||||
$install_wizard_pass=1;
|
$install_wizard_pass=1;
|
||||||
|
|
||||||
if(! function_exists('install_init')) {
|
|
||||||
function install_init(&$a){
|
function install_init(&$a){
|
||||||
|
|
||||||
// $baseurl/install/testrwrite to test if rewite in .htaccess is working
|
// $baseurl/install/testrwrite to test if rewite in .htaccess is working
|
||||||
|
@ -22,10 +22,9 @@ function install_init(&$a){
|
||||||
global $install_wizard_pass;
|
global $install_wizard_pass;
|
||||||
if (x($_POST,'pass'))
|
if (x($_POST,'pass'))
|
||||||
$install_wizard_pass = intval($_POST['pass']);
|
$install_wizard_pass = intval($_POST['pass']);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('install_post')) {
|
|
||||||
function install_post(&$a) {
|
function install_post(&$a) {
|
||||||
global $install_wizard_pass, $db;
|
global $install_wizard_pass, $db;
|
||||||
|
|
||||||
|
@ -113,18 +112,14 @@ function install_post(&$a) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('get_db_errno')) {
|
|
||||||
function get_db_errno() {
|
function get_db_errno() {
|
||||||
if(class_exists('mysqli'))
|
if(class_exists('mysqli'))
|
||||||
return mysqli_connect_errno();
|
return mysqli_connect_errno();
|
||||||
else
|
else
|
||||||
return mysql_errno();
|
return mysql_errno();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('install_content')) {
|
|
||||||
function install_content(&$a) {
|
function install_content(&$a) {
|
||||||
|
|
||||||
global $install_wizard_pass, $db;
|
global $install_wizard_pass, $db;
|
||||||
|
@ -309,7 +304,6 @@ function install_content(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* checks : array passed to template
|
* checks : array passed to template
|
||||||
|
@ -318,8 +312,7 @@ function install_content(&$a) {
|
||||||
* required : boolean
|
* required : boolean
|
||||||
* help : string optional
|
* help : string optional
|
||||||
*/
|
*/
|
||||||
if(! function_exists('check_add')) {
|
function check_add(&$checks, $title, $status, $required, $help){
|
||||||
function check_add(&$checks, $title, $status, $required, $help) {
|
|
||||||
$checks[] = array(
|
$checks[] = array(
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
|
@ -327,9 +320,7 @@ function check_add(&$checks, $title, $status, $required, $help) {
|
||||||
'help' => $help,
|
'help' => $help,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('check_php')) {
|
|
||||||
function check_php(&$phpath, &$checks) {
|
function check_php(&$phpath, &$checks) {
|
||||||
$passed = $passed2 = $passed3 = false;
|
$passed = $passed2 = $passed3 = false;
|
||||||
if (strlen($phpath)){
|
if (strlen($phpath)){
|
||||||
|
@ -379,10 +370,9 @@ function check_php(&$phpath, &$checks) {
|
||||||
check_add($checks, t('PHP register_argc_argv'), $passed3, true, $help);
|
check_add($checks, t('PHP register_argc_argv'), $passed3, true, $help);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('check_keys')) {
|
|
||||||
function check_keys(&$checks) {
|
function check_keys(&$checks) {
|
||||||
|
|
||||||
$help = '';
|
$help = '';
|
||||||
|
@ -402,10 +392,10 @@ function check_keys(&$checks) {
|
||||||
$help .= t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".');
|
$help .= t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".');
|
||||||
}
|
}
|
||||||
check_add($checks, t('Generate encryption keys'), $res, true, $help);
|
check_add($checks, t('Generate encryption keys'), $res, true, $help);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('check_funcs')) {
|
|
||||||
function check_funcs(&$checks) {
|
function check_funcs(&$checks) {
|
||||||
$ck_funcs = array();
|
$ck_funcs = array();
|
||||||
check_add($ck_funcs, t('libCurl PHP module'), true, true, "");
|
check_add($ck_funcs, t('libCurl PHP module'), true, true, "");
|
||||||
|
@ -467,9 +457,8 @@ function check_funcs(&$checks) {
|
||||||
/*if((x($_SESSION,'sysmsg')) && is_array($_SESSION['sysmsg']) && count($_SESSION['sysmsg']))
|
/*if((x($_SESSION,'sysmsg')) && is_array($_SESSION['sysmsg']) && count($_SESSION['sysmsg']))
|
||||||
notice( t('Please see the file "INSTALL.txt".') . EOL);*/
|
notice( t('Please see the file "INSTALL.txt".') . EOL);*/
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('check_htconfig')) {
|
|
||||||
function check_htconfig(&$checks) {
|
function check_htconfig(&$checks) {
|
||||||
$status = true;
|
$status = true;
|
||||||
$help = "";
|
$help = "";
|
||||||
|
@ -484,10 +473,9 @@ function check_htconfig(&$checks) {
|
||||||
}
|
}
|
||||||
|
|
||||||
check_add($checks, t('.htconfig.php is writable'), $status, false, $help);
|
check_add($checks, t('.htconfig.php is writable'), $status, false, $help);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('check_smarty3')) {
|
|
||||||
function check_smarty3(&$checks) {
|
function check_smarty3(&$checks) {
|
||||||
$status = true;
|
$status = true;
|
||||||
$help = "";
|
$help = "";
|
||||||
|
@ -501,10 +489,9 @@ function check_smarty3(&$checks) {
|
||||||
}
|
}
|
||||||
|
|
||||||
check_add($checks, t('view/smarty3 is writable'), $status, true, $help);
|
check_add($checks, t('view/smarty3 is writable'), $status, true, $help);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('check_htaccess')) {
|
|
||||||
function check_htaccess(&$checks) {
|
function check_htaccess(&$checks) {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
$status = true;
|
$status = true;
|
||||||
|
@ -524,9 +511,7 @@ function check_htaccess(&$checks) {
|
||||||
// cannot check modrewrite if libcurl is not installed
|
// cannot check modrewrite if libcurl is not installed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('check_imagik')) {
|
|
||||||
function check_imagik(&$checks) {
|
function check_imagik(&$checks) {
|
||||||
$imagick = false;
|
$imagick = false;
|
||||||
$gif = false;
|
$gif = false;
|
||||||
|
@ -543,18 +528,16 @@ function check_imagik(&$checks) {
|
||||||
check_add($checks, t('ImageMagick supports GIF'), $gif, false, "");
|
check_add($checks, t('ImageMagick supports GIF'), $gif, false, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('manual_config')) {
|
|
||||||
|
|
||||||
function manual_config(&$a) {
|
function manual_config(&$a) {
|
||||||
$data = htmlentities($a->data['txt'],ENT_COMPAT,'UTF-8');
|
$data = htmlentities($a->data['txt'],ENT_COMPAT,'UTF-8');
|
||||||
$o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
|
$o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
|
||||||
$o .= "<textarea rows=\"24\" cols=\"80\" >$data</textarea>";
|
$o .= "<textarea rows=\"24\" cols=\"80\" >$data</textarea>";
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('load_database_rem')) {
|
|
||||||
function load_database_rem($v, $i){
|
function load_database_rem($v, $i){
|
||||||
$l = trim($i);
|
$l = trim($i);
|
||||||
if (strlen($l)>1 && ($l[0]=="-" || ($l[0]=="/" && $l[1]=="*"))){
|
if (strlen($l)>1 && ($l[0]=="-" || ($l[0]=="/" && $l[1]=="*"))){
|
||||||
|
@ -563,9 +546,8 @@ function load_database_rem($v, $i){
|
||||||
return $v."\n".$i;
|
return $v."\n".$i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('load_database')) {
|
|
||||||
function load_database($db) {
|
function load_database($db) {
|
||||||
|
|
||||||
require_once("include/dbstructure.php");
|
require_once("include/dbstructure.php");
|
||||||
|
@ -585,9 +567,7 @@ function load_database($db) {
|
||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('what_next')) {
|
|
||||||
function what_next() {
|
function what_next() {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
$baseurl = $a->get_baseurl();
|
$baseurl = $a->get_baseurl();
|
||||||
|
@ -599,4 +579,5 @@ function what_next() {
|
||||||
.t("Go to your new Friendica node <a href='$baseurl/register'>registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.")
|
.t("Go to your new Friendica node <a href='$baseurl/register'>registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.")
|
||||||
."</p>";
|
."</p>";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
require_once('include/email.php');
|
require_once('include/email.php');
|
||||||
|
|
||||||
if(! function_exists('invite_post')) {
|
|
||||||
function invite_post(&$a) {
|
function invite_post(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -94,9 +93,8 @@ function invite_post(&$a) {
|
||||||
notice( sprintf( tt("%d message sent.", "%d messages sent.", $total) , $total) . EOL);
|
notice( sprintf( tt("%d message sent.", "%d messages sent.", $total) , $total) . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('invite_content')) {
|
|
||||||
function invite_content(&$a) {
|
function invite_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -144,4 +142,3 @@ function invite_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
16
mod/item.php
16
mod/item.php
|
@ -25,7 +25,6 @@ require_once('include/text.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
require_once('include/Scrape.php');
|
require_once('include/Scrape.php');
|
||||||
|
|
||||||
if(! function_exists('item_post')) {
|
|
||||||
function item_post(&$a) {
|
function item_post(&$a) {
|
||||||
|
|
||||||
if((! local_user()) && (! remote_user()) && (! x($_REQUEST,'commenter')))
|
if((! local_user()) && (! remote_user()) && (! x($_REQUEST,'commenter')))
|
||||||
|
@ -845,9 +844,6 @@ function item_post(&$a) {
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store the guid and other relevant data
|
|
||||||
add_guid($datarray);
|
|
||||||
|
|
||||||
$post_id = $r[0]['id'];
|
$post_id = $r[0]['id'];
|
||||||
logger('mod_item: saved item ' . $post_id);
|
logger('mod_item: saved item ' . $post_id);
|
||||||
|
|
||||||
|
@ -1018,9 +1014,7 @@ function item_post(&$a) {
|
||||||
item_post_return($a->get_baseurl(), $api_source, $return_path);
|
item_post_return($a->get_baseurl(), $api_source, $return_path);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('item_post_return')) {
|
|
||||||
function item_post_return($baseurl, $api_source, $return_path) {
|
function item_post_return($baseurl, $api_source, $return_path) {
|
||||||
// figure out how to return, depending on from whence we came
|
// figure out how to return, depending on from whence we came
|
||||||
|
|
||||||
|
@ -1040,9 +1034,9 @@ function item_post_return($baseurl, $api_source, $return_path) {
|
||||||
echo json_encode($json);
|
echo json_encode($json);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('item_content')) {
|
|
||||||
|
|
||||||
function item_content(&$a) {
|
function item_content(&$a) {
|
||||||
|
|
||||||
if((! local_user()) && (! remote_user()))
|
if((! local_user()) && (! remote_user()))
|
||||||
|
@ -1061,7 +1055,6 @@ function item_content(&$a) {
|
||||||
}
|
}
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function removes the tag $tag from the text $body and replaces it with
|
* This function removes the tag $tag from the text $body and replaces it with
|
||||||
|
@ -1075,7 +1068,6 @@ function item_content(&$a) {
|
||||||
*
|
*
|
||||||
* @return boolean true if replaced, false if not replaced
|
* @return boolean true if replaced, false if not replaced
|
||||||
*/
|
*/
|
||||||
if(! function_exists('handle_tag')) {
|
|
||||||
function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $network = "") {
|
function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $network = "") {
|
||||||
require_once("include/Scrape.php");
|
require_once("include/Scrape.php");
|
||||||
require_once("include/socgraph.php");
|
require_once("include/socgraph.php");
|
||||||
|
@ -1250,9 +1242,8 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $netwo
|
||||||
|
|
||||||
return array('replaced' => $replaced, 'contact' => $r[0]);
|
return array('replaced' => $replaced, 'contact' => $r[0]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('store_diaspora_comment_sig')) {
|
|
||||||
function store_diaspora_comment_sig($datarray, $author, $uprvkey, $parent_item, $post_id) {
|
function store_diaspora_comment_sig($datarray, $author, $uprvkey, $parent_item, $post_id) {
|
||||||
// We won't be able to sign Diaspora comments for authenticated visitors - we don't have their private key
|
// We won't be able to sign Diaspora comments for authenticated visitors - we don't have their private key
|
||||||
|
|
||||||
|
@ -1290,4 +1281,3 @@ function store_diaspora_comment_sig($datarray, $author, $uprvkey, $parent_item,
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
require_once('include/like.php');
|
require_once('include/like.php');
|
||||||
|
|
||||||
if(! function_exists('like_content')) {
|
|
||||||
function like_content(&$a) {
|
function like_content(&$a) {
|
||||||
if(! local_user() && ! remote_user()) {
|
if(! local_user() && ! remote_user()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -29,11 +28,11 @@ function like_content(&$a) {
|
||||||
killme(); // NOTREACHED
|
killme(); // NOTREACHED
|
||||||
// return; // NOTREACHED
|
// return; // NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Decide how to return. If we were called with a 'return' argument,
|
// Decide how to return. If we were called with a 'return' argument,
|
||||||
// then redirect back to the calling page. If not, just quietly end
|
// then redirect back to the calling page. If not, just quietly end
|
||||||
if(! function_exists('like_content_return')) {
|
|
||||||
function like_content_return($baseurl, $return_path) {
|
function like_content_return($baseurl, $return_path) {
|
||||||
|
|
||||||
if($return_path) {
|
if($return_path) {
|
||||||
|
@ -46,4 +45,4 @@ function like_content_return($baseurl, $return_path) {
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once('include/datetime.php');
|
require_once('include/datetime.php');
|
||||||
|
|
||||||
if(! function_exists('localtime_post')) {
|
|
||||||
function localtime_post(&$a) {
|
function localtime_post(&$a) {
|
||||||
|
|
||||||
$t = $_REQUEST['time'];
|
$t = $_REQUEST['time'];
|
||||||
|
@ -13,10 +13,9 @@ function localtime_post(&$a) {
|
||||||
|
|
||||||
if($_POST['timezone'])
|
if($_POST['timezone'])
|
||||||
$a->data['mod-localtime'] = datetime_convert('UTC',$_POST['timezone'],$t,$bd_format);
|
$a->data['mod-localtime'] = datetime_convert('UTC',$_POST['timezone'],$t,$bd_format);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('localtime_content')) {
|
|
||||||
function localtime_content(&$a) {
|
function localtime_content(&$a) {
|
||||||
$t = $_REQUEST['time'];
|
$t = $_REQUEST['time'];
|
||||||
if(! $t)
|
if(! $t)
|
||||||
|
@ -46,5 +45,5 @@ function localtime_content(&$a) {
|
||||||
$o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form>';
|
$o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form>';
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('lockview_content')) {
|
|
||||||
function lockview_content(&$a) {
|
function lockview_content(&$a) {
|
||||||
|
|
||||||
$type = (($a->argc > 1) ? $a->argv[1] : 0);
|
$type = (($a->argc > 1) ? $a->argv[1] : 0);
|
||||||
|
@ -86,5 +86,5 @@ function lockview_content(&$a) {
|
||||||
|
|
||||||
echo $o . implode(', ', $l);
|
echo $o . implode(', ', $l);
|
||||||
killme();
|
killme();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
if(! function_exists('login_content')) {
|
|
||||||
function login_content(&$a) {
|
function login_content(&$a) {
|
||||||
if(x($_SESSION,'theme'))
|
if(x($_SESSION,'theme'))
|
||||||
unset($_SESSION['theme']);
|
unset($_SESSION['theme']);
|
||||||
|
@ -9,5 +9,5 @@ function login_content(&$a) {
|
||||||
if(local_user())
|
if(local_user())
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
return login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
|
return login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ require_once('include/email.php');
|
||||||
require_once('include/enotify.php');
|
require_once('include/enotify.php');
|
||||||
require_once('include/text.php');
|
require_once('include/text.php');
|
||||||
|
|
||||||
if(! function_exists('lostpass_post')) {
|
|
||||||
function lostpass_post(&$a) {
|
function lostpass_post(&$a) {
|
||||||
|
|
||||||
$loginame = notags(trim($_POST['login-name']));
|
$loginame = notags(trim($_POST['login-name']));
|
||||||
|
@ -75,10 +74,10 @@ function lostpass_post(&$a) {
|
||||||
'body' => $body));
|
'body' => $body));
|
||||||
|
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('lostpass_content')) {
|
|
||||||
function lostpass_content(&$a) {
|
function lostpass_content(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -165,5 +164,5 @@ function lostpass_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
if(! function_exists('maintenance_content')) {
|
|
||||||
function maintenance_content(&$a) {
|
function maintenance_content(&$a) {
|
||||||
return replace_macros(get_markup_template('maintenance.tpl'), array(
|
return replace_macros(get_markup_template('maintenance.tpl'), array(
|
||||||
'$sysdown' => t('System down for maintenance')
|
'$sysdown' => t('System down for maintenance')
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require_once("include/text.php");
|
require_once("include/text.php");
|
||||||
|
|
||||||
if(! function_exists('manage_post')) {
|
|
||||||
function manage_post(&$a) {
|
function manage_post(&$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
|
@ -87,9 +87,9 @@ function manage_post(&$a) {
|
||||||
goaway( $a->get_baseurl() . "/profile/" . $a->user['nickname'] );
|
goaway( $a->get_baseurl() . "/profile/" . $a->user['nickname'] );
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('manage_content')) {
|
|
||||||
|
|
||||||
function manage_content(&$a) {
|
function manage_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -144,5 +144,5 @@ function manage_content(&$a) {
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ require_once('mod/proxy.php');
|
||||||
* @param App &$a
|
* @param App &$a
|
||||||
* @return void|string
|
* @return void|string
|
||||||
*/
|
*/
|
||||||
if(! function_exists('match_content')) {
|
|
||||||
function match_content(&$a) {
|
function match_content(&$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
@ -110,4 +109,3 @@ function match_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
require_once('include/acl_selectors.php');
|
require_once('include/acl_selectors.php');
|
||||||
require_once('include/message.php');
|
require_once('include/message.php');
|
||||||
|
|
||||||
if(! function_exists('message_init')) {
|
|
||||||
function message_init(&$a) {
|
function message_init(&$a) {
|
||||||
|
|
||||||
$tabs = '';
|
$tabs = '';
|
||||||
|
@ -37,10 +36,9 @@ function message_init(&$a) {
|
||||||
'$baseurl' => $a->get_baseurl(true),
|
'$baseurl' => $a->get_baseurl(true),
|
||||||
'$base' => $base
|
'$base' => $base
|
||||||
));
|
));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('message_post')) {
|
|
||||||
function message_post(&$a) {
|
function message_post(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -93,7 +91,7 @@ function message_post(&$a) {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
|
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
|
// Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
|
||||||
|
@ -173,7 +171,7 @@ function item_redir_and_replace_images($body, $images, $cid) {
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
if(! function_exists('message_content')) {
|
|
||||||
function message_content(&$a) {
|
function message_content(&$a) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
@ -532,9 +530,7 @@ function message_content(&$a) {
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('get_messages')) {
|
|
||||||
function get_messages($user, $lstart, $lend) {
|
function get_messages($user, $lstart, $lend) {
|
||||||
|
|
||||||
return q("SELECT max(`mail`.`created`) AS `mailcreated`, min(`mail`.`seen`) AS `mailseen`,
|
return q("SELECT max(`mail`.`created`) AS `mailcreated`, min(`mail`.`seen`) AS `mailseen`,
|
||||||
|
@ -545,9 +541,7 @@ function get_messages($user, $lstart, $lend) {
|
||||||
intval($user), intval($lstart), intval($lend)
|
intval($user), intval($lstart), intval($lend)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('render_messages')) {
|
|
||||||
function render_messages($msg, $t) {
|
function render_messages($msg, $t) {
|
||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
@ -599,4 +593,3 @@ function render_messages($msg, $t) {
|
||||||
|
|
||||||
return $rslt;
|
return $rslt;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
require_once('library/asn1.php');
|
require_once('library/asn1.php');
|
||||||
|
|
||||||
if(! function_exists('modexp_init')) {
|
|
||||||
function modexp_init(&$a) {
|
function modexp_init(&$a) {
|
||||||
|
|
||||||
if($a->argc != 2)
|
if($a->argc != 2)
|
||||||
|
@ -30,5 +29,6 @@ function modexp_init(&$a) {
|
||||||
echo 'RSA' . '.' . $m . '.' . $e ;
|
echo 'RSA' . '.' . $m . '.' . $e ;
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_once('include/security.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
if(! function_exists('mood_init')) {
|
|
||||||
function mood_init(&$a) {
|
function mood_init(&$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
|
@ -105,9 +105,9 @@ function mood_init(&$a) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('mood_content')) {
|
|
||||||
|
|
||||||
function mood_content(&$a) {
|
function mood_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -138,5 +138,5 @@ function mood_content(&$a) {
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('msearch_post')) {
|
|
||||||
function msearch_post(&$a) {
|
function msearch_post(&$a) {
|
||||||
|
|
||||||
$perpage = (($_POST['n']) ? $_POST['n'] : 80);
|
$perpage = (($_POST['n']) ? $_POST['n'] : 80);
|
||||||
|
@ -39,5 +38,5 @@ function msearch_post(&$a) {
|
||||||
echo json_encode($output);
|
echo json_encode($output);
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
require_once("include/nav.php");
|
require_once("include/nav.php");
|
||||||
|
|
||||||
if(! function_exists('navigation_content')) {
|
|
||||||
function navigation_content(&$a) {
|
function navigation_content(&$a) {
|
||||||
|
|
||||||
$nav_info = nav_info($a);
|
$nav_info = nav_info($a);
|
||||||
|
@ -23,5 +22,5 @@ function navigation_content(&$a) {
|
||||||
'$apps' => $a->apps,
|
'$apps' => $a->apps,
|
||||||
'$clear_notifs' => t('Clear notifications')
|
'$clear_notifs' => t('Clear notifications')
|
||||||
));
|
));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('network_init')) {
|
|
||||||
function network_init(&$a) {
|
function network_init(&$a) {
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -155,10 +153,9 @@ function network_init(&$a) {
|
||||||
$a->page['aside'] .= networks_widget($a->get_baseurl(true) . '/network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
|
$a->page['aside'] .= networks_widget($a->get_baseurl(true) . '/network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
|
||||||
$a->page['aside'] .= saved_searches($search);
|
$a->page['aside'] .= saved_searches($search);
|
||||||
$a->page['aside'] .= fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : ''));
|
$a->page['aside'] .= fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : ''));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('saved_searches')) {
|
|
||||||
function saved_searches($search) {
|
function saved_searches($search) {
|
||||||
|
|
||||||
if(! feature_enabled(local_user(),'savedsearch'))
|
if(! feature_enabled(local_user(),'savedsearch'))
|
||||||
|
@ -207,7 +204,7 @@ function saved_searches($search) {
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -225,7 +222,6 @@ function saved_searches($search) {
|
||||||
*
|
*
|
||||||
* @return Array ( $no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active );
|
* @return Array ( $no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active );
|
||||||
*/
|
*/
|
||||||
if(! function_exists('network_query_get_sel_tab')) {
|
|
||||||
function network_query_get_sel_tab($a) {
|
function network_query_get_sel_tab($a) {
|
||||||
$no_active='';
|
$no_active='';
|
||||||
$starred_active = '';
|
$starred_active = '';
|
||||||
|
@ -282,12 +278,10 @@ function network_query_get_sel_tab($a) {
|
||||||
|
|
||||||
return array($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active);
|
return array($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return selected network from query
|
* Return selected network from query
|
||||||
*/
|
*/
|
||||||
if(! function_exists('network_query_get_sel_net')) {
|
|
||||||
function network_query_get_sel_net() {
|
function network_query_get_sel_net() {
|
||||||
$network = false;
|
$network = false;
|
||||||
|
|
||||||
|
@ -297,9 +291,7 @@ function network_query_get_sel_net() {
|
||||||
|
|
||||||
return $network;
|
return $network;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('network_query_get_sel_group')) {
|
|
||||||
function network_query_get_sel_group($a) {
|
function network_query_get_sel_group($a) {
|
||||||
$group = false;
|
$group = false;
|
||||||
|
|
||||||
|
@ -309,9 +301,8 @@ function network_query_get_sel_group($a) {
|
||||||
|
|
||||||
return $group;
|
return $group;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('network_content')) {
|
|
||||||
function network_content(&$a, $update = 0) {
|
function network_content(&$a, $update = 0) {
|
||||||
|
|
||||||
require_once('include/conversation.php');
|
require_once('include/conversation.php');
|
||||||
|
@ -895,4 +886,4 @@ function network_content(&$a, $update = 0) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('newmember_content')) {
|
|
||||||
function newmember_content(&$a) {
|
function newmember_content(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,4 +82,3 @@ function newmember_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
require_once("include/plugin.php");
|
require_once("include/plugin.php");
|
||||||
|
|
||||||
if(! function_exists('nodeinfo_wellknown')) {
|
|
||||||
function nodeinfo_wellknown(&$a) {
|
function nodeinfo_wellknown(&$a) {
|
||||||
if (!get_config("system", "nodeinfo")) {
|
if (!get_config("system", "nodeinfo")) {
|
||||||
http_status_exit(404);
|
http_status_exit(404);
|
||||||
|
@ -20,9 +19,7 @@ function nodeinfo_wellknown(&$a) {
|
||||||
echo json_encode($nodeinfo, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|
echo json_encode($nodeinfo, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('nodeinfo_init')) {
|
|
||||||
function nodeinfo_init(&$a){
|
function nodeinfo_init(&$a){
|
||||||
if (!get_config("system", "nodeinfo")) {
|
if (!get_config("system", "nodeinfo")) {
|
||||||
http_status_exit(404);
|
http_status_exit(404);
|
||||||
|
@ -146,9 +143,9 @@ function nodeinfo_init(&$a){
|
||||||
echo json_encode($nodeinfo, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|
echo json_encode($nodeinfo, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('nodeinfo_cron')) {
|
|
||||||
|
|
||||||
function nodeinfo_cron() {
|
function nodeinfo_cron() {
|
||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
@ -263,5 +260,5 @@ function nodeinfo_cron() {
|
||||||
logger("cron_end");
|
logger("cron_end");
|
||||||
set_config('nodeinfo','last_calucation', time());
|
set_config('nodeinfo','last_calucation', time());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -4,7 +4,6 @@ require_once('include/Contact.php');
|
||||||
require_once('include/socgraph.php');
|
require_once('include/socgraph.php');
|
||||||
require_once('include/contact_selectors.php');
|
require_once('include/contact_selectors.php');
|
||||||
|
|
||||||
if(! function_exists('nogroup_init')) {
|
|
||||||
function nogroup_init(&$a) {
|
function nogroup_init(&$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
|
@ -18,9 +17,8 @@ function nogroup_init(&$a) {
|
||||||
|
|
||||||
$a->page['aside'] .= group_side('contacts','group','extended',0,$contact_id);
|
$a->page['aside'] .= group_side('contacts','group','extended',0,$contact_id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('nogroup_content')) {
|
|
||||||
function nogroup_content(&$a) {
|
function nogroup_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -68,5 +66,5 @@ function nogroup_content(&$a) {
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('noscrape_init')) {
|
|
||||||
function noscrape_init(&$a) {
|
function noscrape_init(&$a) {
|
||||||
|
|
||||||
if($a->argc > 1)
|
if($a->argc > 1)
|
||||||
|
@ -63,5 +62,5 @@ function noscrape_init(&$a) {
|
||||||
header('Content-type: application/json; charset=utf-8');
|
header('Content-type: application/json; charset=utf-8');
|
||||||
echo json_encode($json_info);
|
echo json_encode($json_info);
|
||||||
exit;
|
exit;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('notes_init')) {
|
|
||||||
function notes_init(&$a) {
|
function notes_init(&$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
|
@ -13,10 +12,10 @@ function notes_init(&$a) {
|
||||||
nav_set_selected('home');
|
nav_set_selected('home');
|
||||||
|
|
||||||
// profile_load($a,$which,$profile);
|
// profile_load($a,$which,$profile);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('notes_content')) {
|
|
||||||
function notes_content(&$a,$update = false) {
|
function notes_content(&$a,$update = false) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -136,4 +135,3 @@ function notes_content(&$a,$update = false) {
|
||||||
$o .= paginate($a);
|
$o .= paginate($a);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/* identi.ca -> friendica items permanent-url compatibility */
|
/* identi.ca -> friendica items permanent-url compatibility */
|
||||||
|
|
||||||
if(! function_exists('notice_init')) {
|
function notice_init(&$a){
|
||||||
function notice_init(&$a) {
|
|
||||||
$id = $a->argv[1];
|
$id = $a->argv[1];
|
||||||
$r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
|
$r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
|
||||||
intval($id)
|
intval($id)
|
||||||
|
@ -17,5 +16,5 @@ if(! function_exists('notice_init')) {
|
||||||
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ include_once("include/bbcode.php");
|
||||||
include_once("include/contact_selectors.php");
|
include_once("include/contact_selectors.php");
|
||||||
include_once("include/Scrape.php");
|
include_once("include/Scrape.php");
|
||||||
|
|
||||||
if(! function_exists('notifications_post')) {
|
|
||||||
function notifications_post(&$a) {
|
function notifications_post(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -59,11 +58,11 @@ function notifications_post(&$a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(! function_exists('notifications_content')) {
|
|
||||||
|
|
||||||
function notifications_content(&$a) {
|
function notifications_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -580,4 +579,3 @@ function notifications_content(&$a) {
|
||||||
$o .= paginate($a);
|
$o .= paginate($a);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
require_once('include/NotificationsManager.php');
|
require_once('include/NotificationsManager.php');
|
||||||
if(! function_exists('notify_init')) {
|
|
||||||
|
|
||||||
function notify_init(&$a) {
|
function notify_init(&$a) {
|
||||||
if(! local_user()) return;
|
if(! local_user()) return;
|
||||||
|
|
||||||
$nm = new NotificationsManager();
|
$nm = new NotificationsManager();
|
||||||
|
|
||||||
if($a->argc > 2 && $a->argv[1] === 'view' && intval($a->argv[2])) {
|
if($a->argc > 2 && $a->argv[1] === 'view' && intval($a->argv[2])) {
|
||||||
|
@ -33,10 +33,9 @@ function notify_init(&$a) {
|
||||||
echo $j;
|
echo $j;
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('notify_content')) {
|
|
||||||
function notify_content(&$a) {
|
function notify_content(&$a) {
|
||||||
if(! local_user()) return login();
|
if(! local_user()) return login();
|
||||||
|
|
||||||
|
@ -69,6 +68,5 @@ function notify_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
require_once("include/oembed.php");
|
require_once("include/oembed.php");
|
||||||
|
|
||||||
if(! function_exists('oembed_content')) {
|
function oembed_content(&$a){
|
||||||
function oembed_content(&$a) {
|
|
||||||
// logger('mod_oembed ' . $a->query_string, LOGGER_ALL);
|
// logger('mod_oembed ' . $a->query_string, LOGGER_ALL);
|
||||||
|
|
||||||
if ($a->argv[1]=='b2h'){
|
if ($a->argv[1]=='b2h'){
|
||||||
|
@ -34,4 +33,3 @@ function oembed_content(&$a) {
|
||||||
}
|
}
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('oexchange_init')) {
|
|
||||||
function oexchange_init(&$a) {
|
function oexchange_init(&$a) {
|
||||||
|
|
||||||
if(($a->argc > 1) && ($a->argv[1] === 'xrd')) {
|
if(($a->argc > 1) && ($a->argv[1] === 'xrd')) {
|
||||||
|
@ -11,10 +11,9 @@ function oexchange_init(&$a) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('oexchange_content')) {
|
|
||||||
function oexchange_content(&$a) {
|
function oexchange_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -53,5 +52,7 @@ function oexchange_content(&$a) {
|
||||||
$_REQUEST = $post;
|
$_REQUEST = $post;
|
||||||
require_once('mod/item.php');
|
require_once('mod/item.php');
|
||||||
item_post($a);
|
item_post($a);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
require_once('library/openid.php');
|
require_once('library/openid.php');
|
||||||
|
|
||||||
if(! function_exists('openid_content')) {
|
|
||||||
function openid_content(&$a) {
|
function openid_content(&$a) {
|
||||||
|
|
||||||
$noid = get_config('system','no_openid');
|
$noid = get_config('system','no_openid');
|
||||||
|
@ -93,4 +94,3 @@ function openid_content(&$a) {
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
if(! function_exists('opensearch_content')) {
|
function opensearch_content(&$a) {
|
||||||
function opensearch_content(&$a) {
|
|
||||||
$tpl = get_markup_template('opensearch.tpl');
|
$tpl = get_markup_template('opensearch.tpl');
|
||||||
|
|
||||||
header("Content-type: application/opensearchdescription+xml");
|
header("Content-type: application/opensearchdescription+xml");
|
||||||
|
@ -13,6 +13,6 @@ if(! function_exists('opensearch_content')) {
|
||||||
echo $o;
|
echo $o;
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
?>
|
?>
|
|
@ -3,7 +3,6 @@
|
||||||
require_once('include/Scrape.php');
|
require_once('include/Scrape.php');
|
||||||
require_once('include/follow.php');
|
require_once('include/follow.php');
|
||||||
|
|
||||||
if(! function_exists('ostatus_subscribe_content')) {
|
|
||||||
function ostatus_subscribe_content(&$a) {
|
function ostatus_subscribe_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -77,4 +76,3 @@ function ostatus_subscribe_content(&$a) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -4,8 +4,7 @@ This file is part of the Diaspora protocol. It is used for fetching single publi
|
||||||
*/
|
*/
|
||||||
require_once("include/diaspora.php");
|
require_once("include/diaspora.php");
|
||||||
|
|
||||||
if(! function_exists('p_init')) {
|
function p_init($a){
|
||||||
function p_init($a) {
|
|
||||||
if ($a->argc != 2) {
|
if ($a->argc != 2) {
|
||||||
header($_SERVER["SERVER_PROTOCOL"].' 510 '.t('Not Extended'));
|
header($_SERVER["SERVER_PROTOCOL"].' 510 '.t('Not Extended'));
|
||||||
killme();
|
killme();
|
||||||
|
@ -80,4 +79,3 @@ function p_init($a) {
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ if(!function_exists('deletenode')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('completeurl')) {
|
|
||||||
function completeurl($url, $scheme) {
|
function completeurl($url, $scheme) {
|
||||||
$urlarr = parse_url($url);
|
$urlarr = parse_url($url);
|
||||||
|
|
||||||
|
@ -54,9 +53,7 @@ function completeurl($url, $scheme) {
|
||||||
|
|
||||||
return($complete);
|
return($complete);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('parseurl_getsiteinfo_cached')) {
|
|
||||||
function parseurl_getsiteinfo_cached($url, $no_guessing = false, $do_oembed = true) {
|
function parseurl_getsiteinfo_cached($url, $no_guessing = false, $do_oembed = true) {
|
||||||
|
|
||||||
if ($url == "")
|
if ($url == "")
|
||||||
|
@ -80,9 +77,7 @@ function parseurl_getsiteinfo_cached($url, $no_guessing = false, $do_oembed = tr
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('parseurl_getsiteinfo')) {
|
|
||||||
function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $count = 1) {
|
function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $count = 1) {
|
||||||
require_once("include/network.php");
|
require_once("include/network.php");
|
||||||
require_once("include/Photo.php");
|
require_once("include/Photo.php");
|
||||||
|
@ -405,15 +400,11 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co
|
||||||
|
|
||||||
return($siteinfo);
|
return($siteinfo);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('arr_add_hashes')) {
|
|
||||||
function arr_add_hashes(&$item,$k) {
|
function arr_add_hashes(&$item,$k) {
|
||||||
$item = '#' . $item;
|
$item = '#' . $item;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('parse_url_content')) {
|
|
||||||
function parse_url_content(&$a) {
|
function parse_url_content(&$a) {
|
||||||
|
|
||||||
$text = null;
|
$text = null;
|
||||||
|
@ -567,5 +558,4 @@ function parse_url_content(&$a) {
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
require_once('include/Photo.php');
|
require_once('include/Photo.php');
|
||||||
|
|
||||||
if(! function_exists('photo_init')) {
|
|
||||||
function photo_init(&$a) {
|
function photo_init(&$a) {
|
||||||
global $_SERVER;
|
global $_SERVER;
|
||||||
|
|
||||||
|
@ -210,4 +209,3 @@ function photo_init(&$a) {
|
||||||
killme();
|
killme();
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ require_once('include/redir.php');
|
||||||
require_once('include/tags.php');
|
require_once('include/tags.php');
|
||||||
require_once('include/threads.php');
|
require_once('include/threads.php');
|
||||||
|
|
||||||
if(! function_exists('photos_init')) {
|
|
||||||
function photos_init(&$a) {
|
function photos_init(&$a) {
|
||||||
|
|
||||||
if($a->argc > 1)
|
if($a->argc > 1)
|
||||||
|
@ -122,9 +121,9 @@ function photos_init(&$a) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('photos_post')) {
|
|
||||||
|
|
||||||
function photos_post(&$a) {
|
function photos_post(&$a) {
|
||||||
|
|
||||||
logger('mod-photos: photos_post: begin' , LOGGER_DEBUG);
|
logger('mod-photos: photos_post: begin' , LOGGER_DEBUG);
|
||||||
|
@ -958,9 +957,9 @@ function photos_post(&$a) {
|
||||||
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
|
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('photos_content')) {
|
|
||||||
|
|
||||||
function photos_content(&$a) {
|
function photos_content(&$a) {
|
||||||
|
|
||||||
// URLs:
|
// URLs:
|
||||||
|
@ -1907,4 +1906,4 @@ function photos_content(&$a) {
|
||||||
$o .= paginate($a);
|
$o .= paginate($a);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
10
mod/ping.php
10
mod/ping.php
|
@ -5,7 +5,6 @@ require_once('include/ForumManager.php');
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
require_once("mod/proxy.php");
|
require_once("mod/proxy.php");
|
||||||
|
|
||||||
if(! function_exists('ping_init')) {
|
|
||||||
function ping_init(&$a) {
|
function ping_init(&$a) {
|
||||||
|
|
||||||
header("Content-type: text/xml");
|
header("Content-type: text/xml");
|
||||||
|
@ -339,9 +338,7 @@ function ping_init(&$a) {
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('ping_get_notifications')) {
|
|
||||||
function ping_get_notifications($uid) {
|
function ping_get_notifications($uid) {
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
|
@ -392,7 +389,11 @@ function ping_get_notifications($uid) {
|
||||||
// Replace the name with {0} but ensure to make that only once
|
// Replace the name with {0} but ensure to make that only once
|
||||||
// The {0} is used later and prints the name in bold.
|
// The {0} is used later and prints the name in bold.
|
||||||
|
|
||||||
$pos = strpos($notification["message"],$notification['name']);
|
if ($notification['name'] != "")
|
||||||
|
$pos = strpos($notification["message"],$notification['name']);
|
||||||
|
else
|
||||||
|
$pos = false;
|
||||||
|
|
||||||
if ($pos !== false)
|
if ($pos !== false)
|
||||||
$notification["message"] = substr_replace($notification["message"],"{0}",$pos,strlen($notification["name"]));
|
$notification["message"] = substr_replace($notification["message"],"{0}",$pos,strlen($notification["name"]));
|
||||||
|
|
||||||
|
@ -409,4 +410,3 @@ function ping_get_notifications($uid) {
|
||||||
|
|
||||||
return($result);
|
return($result);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('poco_init')) {
|
|
||||||
function poco_init(&$a) {
|
function poco_init(&$a) {
|
||||||
require_once("include/bbcode.php");
|
require_once("include/bbcode.php");
|
||||||
|
|
||||||
|
@ -325,5 +324,5 @@ function poco_init(&$a) {
|
||||||
else
|
else
|
||||||
http_status_exit(500);
|
http_status_exit(500);
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ require_once('include/security.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
if(! function_exists('poke_init')) {
|
|
||||||
function poke_init(&$a) {
|
function poke_init(&$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
|
@ -140,9 +140,9 @@ function poke_init(&$a) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('poke_content')) {
|
|
||||||
|
|
||||||
function poke_content(&$a) {
|
function poke_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -201,5 +201,5 @@ function poke_content(&$a) {
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ require_once('include/crypto.php');
|
||||||
// not yet ready for prime time
|
// not yet ready for prime time
|
||||||
//require_once('include/zot.php');
|
//require_once('include/zot.php');
|
||||||
|
|
||||||
if(! function_exists('post_post')) {
|
|
||||||
function post_post(&$a) {
|
function post_post(&$a) {
|
||||||
|
|
||||||
$bulk_delivery = false;
|
$bulk_delivery = false;
|
||||||
|
@ -49,4 +48,4 @@ function post_post(&$a) {
|
||||||
http_status_exit(($ret) ? $ret : 200);
|
http_status_exit(($ret) ? $ret : 200);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('pretheme_init')) {
|
|
||||||
function pretheme_init(&$a) {
|
function pretheme_init(&$a) {
|
||||||
|
|
||||||
if($_REQUEST['theme']) {
|
if($_REQUEST['theme']) {
|
||||||
|
@ -21,4 +20,3 @@ function pretheme_init(&$a) {
|
||||||
}
|
}
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
require_once('include/Scrape.php');
|
require_once('include/Scrape.php');
|
||||||
|
|
||||||
if(! function_exists('probe_content')) {
|
|
||||||
function probe_content(&$a) {
|
function probe_content(&$a) {
|
||||||
|
|
||||||
$o .= '<h3>Probe Diagnostic</h3>';
|
$o .= '<h3>Probe Diagnostic</h3>';
|
||||||
|
@ -23,4 +22,3 @@ function probe_content(&$a) {
|
||||||
}
|
}
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require_once('include/contact_widgets.php');
|
require_once('include/contact_widgets.php');
|
||||||
require_once('include/redir.php');
|
require_once('include/redir.php');
|
||||||
|
|
||||||
if(! function_exists('profile_init')) {
|
|
||||||
function profile_init(&$a) {
|
function profile_init(&$a) {
|
||||||
|
|
||||||
if(! x($a->page,'aside'))
|
if(! x($a->page,'aside'))
|
||||||
|
@ -65,10 +65,10 @@ function profile_init(&$a) {
|
||||||
foreach($dfrn_pages as $dfrn)
|
foreach($dfrn_pages as $dfrn)
|
||||||
$a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".$a->get_baseurl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
|
$a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".$a->get_baseurl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
|
||||||
$a->page['htmlhead'] .= "<link rel=\"dfrn-poco\" href=\"".$a->get_baseurl()."/poco/{$which}\" />\r\n";
|
$a->page['htmlhead'] .= "<link rel=\"dfrn-poco\" href=\"".$a->get_baseurl()."/poco/{$which}\" />\r\n";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('profile_content')) {
|
|
||||||
function profile_content(&$a, $update = 0) {
|
function profile_content(&$a, $update = 0) {
|
||||||
|
|
||||||
$category = $datequery = $datequery2 = '';
|
$category = $datequery = $datequery2 = '';
|
||||||
|
@ -350,4 +350,3 @@ function profile_content(&$a, $update = 0) {
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
require_once("include/Photo.php");
|
require_once("include/Photo.php");
|
||||||
|
|
||||||
if(! function_exists('profile_photo_init')) {
|
|
||||||
function profile_photo_init(&$a) {
|
function profile_photo_init(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -10,10 +9,10 @@ function profile_photo_init(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
profile_load($a,$a->user['nickname']);
|
profile_load($a,$a->user['nickname']);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('profile_photo_post')) {
|
|
||||||
function profile_photo_post(&$a) {
|
function profile_photo_post(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -165,7 +164,7 @@ function profile_photo_post(&$a) {
|
||||||
$ph->orient($src);
|
$ph->orient($src);
|
||||||
@unlink($src);
|
@unlink($src);
|
||||||
return profile_photo_crop_ui_head($a, $ph);
|
return profile_photo_crop_ui_head($a, $ph);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -324,3 +323,4 @@ function profile_photo_crop_ui_head(&$a, $ph){
|
||||||
$a->page['end'] .= replace_macros(get_markup_template("cropend.tpl"), array());
|
$a->page['end'] .= replace_macros(get_markup_template("cropend.tpl"), array());
|
||||||
return;
|
return;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
require_once("include/Contact.php");
|
require_once("include/Contact.php");
|
||||||
|
|
||||||
if(! function_exists('profiles_init')) {
|
|
||||||
function profiles_init(&$a) {
|
function profiles_init(&$a) {
|
||||||
|
|
||||||
nav_set_selected('profiles');
|
nav_set_selected('profiles');
|
||||||
|
@ -140,10 +139,9 @@ function profiles_init(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('profile_clean_keywords')) {
|
|
||||||
function profile_clean_keywords($keywords) {
|
function profile_clean_keywords($keywords) {
|
||||||
$keywords = str_replace(","," ",$keywords);
|
$keywords = str_replace(","," ",$keywords);
|
||||||
$keywords = explode(" ", $keywords);
|
$keywords = explode(" ", $keywords);
|
||||||
|
@ -160,9 +158,7 @@ function profile_clean_keywords($keywords) {
|
||||||
|
|
||||||
return $keywords;
|
return $keywords;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('profiles_post')) {
|
|
||||||
function profiles_post(&$a) {
|
function profiles_post(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -506,9 +502,8 @@ function profiles_post(&$a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('profile_activity')) {
|
|
||||||
function profile_activity($changed, $value) {
|
function profile_activity($changed, $value) {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
|
@ -598,9 +593,8 @@ function profile_activity($changed, $value) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('profiles_content')) {
|
|
||||||
function profiles_content(&$a) {
|
function profiles_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -824,5 +818,5 @@ function profiles_content(&$a) {
|
||||||
}
|
}
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('profperm_init')) {
|
|
||||||
function profperm_init(&$a) {
|
function profperm_init(&$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
|
@ -10,10 +9,10 @@ function profperm_init(&$a) {
|
||||||
$profile = $a->argv[1];
|
$profile = $a->argv[1];
|
||||||
|
|
||||||
profile_load($a,$which,$profile);
|
profile_load($a,$which,$profile);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! function_exists('profperm_content')) {
|
|
||||||
function profperm_content(&$a) {
|
function profperm_content(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -157,5 +156,6 @@ function profperm_content(&$a) {
|
||||||
}
|
}
|
||||||
$o .= '</div>';
|
$o .= '</div>';
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ define("PROXY_SIZE_LARGE", "large");
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
require_once("include/Photo.php");
|
require_once("include/Photo.php");
|
||||||
|
|
||||||
if(! function_exists('proxy_init')) {
|
|
||||||
function proxy_init() {
|
function proxy_init() {
|
||||||
global $a, $_SERVER;
|
global $a, $_SERVER;
|
||||||
|
|
||||||
|
@ -233,9 +232,7 @@ function proxy_init() {
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('proxy_url')) {
|
|
||||||
function proxy_url($url, $writemode = false, $size = "") {
|
function proxy_url($url, $writemode = false, $size = "") {
|
||||||
global $_SERVER;
|
global $_SERVER;
|
||||||
|
|
||||||
|
@ -297,13 +294,11 @@ function proxy_url($url, $writemode = false, $size = "") {
|
||||||
else
|
else
|
||||||
return ($proxypath.$size);
|
return ($proxypath.$size);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $url string
|
* @param $url string
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
if(! function_exists('proxy_is_local_image')) {
|
|
||||||
function proxy_is_local_image($url) {
|
function proxy_is_local_image($url) {
|
||||||
if ($url[0] == '/') return true;
|
if ($url[0] == '/') return true;
|
||||||
|
|
||||||
|
@ -314,9 +309,7 @@ function proxy_is_local_image($url) {
|
||||||
$url = normalise_link($url);
|
$url = normalise_link($url);
|
||||||
return (substr($url, 0, strlen($baseurl)) == $baseurl);
|
return (substr($url, 0, strlen($baseurl)) == $baseurl);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('proxy_parse_query')) {
|
|
||||||
function proxy_parse_query($var) {
|
function proxy_parse_query($var) {
|
||||||
/**
|
/**
|
||||||
* Use this function to parse out the query array element from
|
* Use this function to parse out the query array element from
|
||||||
|
@ -335,9 +328,7 @@ function proxy_parse_query($var) {
|
||||||
unset($val, $x, $var);
|
unset($val, $x, $var);
|
||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('proxy_img_cb')) {
|
|
||||||
function proxy_img_cb($matches) {
|
function proxy_img_cb($matches) {
|
||||||
|
|
||||||
// if the picture seems to be from another picture cache then take the original source
|
// if the picture seems to be from another picture cache then take the original source
|
||||||
|
@ -351,13 +342,10 @@ function proxy_img_cb($matches) {
|
||||||
|
|
||||||
return $matches[1].proxy_url(htmlspecialchars_decode($matches[2])).$matches[3];
|
return $matches[1].proxy_url(htmlspecialchars_decode($matches[2])).$matches[3];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('proxy_parse_html')) {
|
|
||||||
function proxy_parse_html($html) {
|
function proxy_parse_html($html) {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
$html = str_replace(normalise_link($a->get_baseurl())."/", $a->get_baseurl()."/", $html);
|
$html = str_replace(normalise_link($a->get_baseurl())."/", $a->get_baseurl()."/", $html);
|
||||||
|
|
||||||
return preg_replace_callback("/(<img [^>]*src *= *[\"'])([^\"']+)([\"'][^>]*>)/siU", "proxy_img_cb", $html);
|
return preg_replace_callback("/(<img [^>]*src *= *[\"'])([^\"']+)([\"'][^>]*>)/siU", "proxy_img_cb", $html);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('hub_return')) {
|
|
||||||
function hub_return($valid,$body) {
|
function hub_return($valid,$body) {
|
||||||
|
|
||||||
if($valid) {
|
if($valid) {
|
||||||
|
@ -15,18 +14,18 @@ function hub_return($valid,$body) {
|
||||||
|
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// when receiving an XML feed, always return OK
|
// when receiving an XML feed, always return OK
|
||||||
if(! function_exists('hub_post_return')) {
|
|
||||||
function hub_post_return() {
|
function hub_post_return() {
|
||||||
|
|
||||||
header($_SERVER["SERVER_PROTOCOL"] . ' 200 ' . 'OK');
|
header($_SERVER["SERVER_PROTOCOL"] . ' 200 ' . 'OK');
|
||||||
killme();
|
killme();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(! function_exists('pubsub_init')) {
|
|
||||||
function pubsub_init(&$a) {
|
function pubsub_init(&$a) {
|
||||||
|
|
||||||
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
|
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
|
||||||
|
@ -96,11 +95,9 @@ function pubsub_init(&$a) {
|
||||||
hub_return(true, $hub_challenge);
|
hub_return(true, $hub_challenge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
|
|
||||||
if(! function_exists('pubsub_post')) {
|
|
||||||
function pubsub_post(&$a) {
|
function pubsub_post(&$a) {
|
||||||
|
|
||||||
$xml = file_get_contents('php://input');
|
$xml = file_get_contents('php://input');
|
||||||
|
@ -158,5 +155,8 @@ function pubsub_post(&$a) {
|
||||||
consume_feed($xml,$importer,$contact,$feedhub,1,2);
|
consume_feed($xml,$importer,$contact,$feedhub,1,2);
|
||||||
|
|
||||||
hub_post_return();
|
hub_post_return();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('post_var')) {
|
|
||||||
function post_var($name) {
|
function post_var($name) {
|
||||||
return (x($_POST, $name)) ? notags(trim($_POST[$name])) : '';
|
return (x($_POST, $name)) ? notags(trim($_POST[$name])) : '';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(! function_exists('pubsubhubbub_init')) {
|
|
||||||
function pubsubhubbub_init(&$a) {
|
function pubsubhubbub_init(&$a) {
|
||||||
// PuSH subscription must be considered "public" so just block it
|
// PuSH subscription must be considered "public" so just block it
|
||||||
// if public access isn't enabled.
|
// if public access isn't enabled.
|
||||||
|
@ -161,5 +158,5 @@ function pubsubhubbub_init(&$a) {
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('qsearch_init')) {
|
|
||||||
function qsearch_init(&$a) {
|
function qsearch_init(&$a) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
|
@ -48,4 +47,4 @@ function qsearch_init(&$a) {
|
||||||
echo json_encode((object) $results);
|
echo json_encode((object) $results);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(! function_exists('randprof_init')) {
|
|
||||||
function randprof_init(&$a) {
|
function randprof_init(&$a) {
|
||||||
require_once('include/Contact.php');
|
require_once('include/Contact.php');
|
||||||
$x = random_profile();
|
$x = random_profile();
|
||||||
|
@ -8,4 +8,3 @@ function randprof_init(&$a) {
|
||||||
goaway(zrl($x));
|
goaway(zrl($x));
|
||||||
goaway($a->get_baseurl() . '/profile');
|
goaway($a->get_baseurl() . '/profile');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue