// and www.example.com vs example.com.
// We will only change the url to an ip address if there is no existing setting
- if (empty($url) || (!link_compare($url, System::baseUrl())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $a->get_hostname))) {
+ if (empty($url) || (!link_compare($url, System::baseUrl())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $a->get_hostname()))) {
Config::set('system', 'url', System::baseUrl());
}
* that are based on unique features of the calling module.
*
*/
-function conversation(App $a, $items, $mode, $update, $preview = false, $order = 'commented', $uid = 0) {
+function conversation(App $a, array $items, $mode, $update, $preview = false, $order = 'commented', $uid = 0) {
require_once 'mod/proxy.php';
$ssl_state = ((local_user()) ? true : false);
*
* @return array items with parents and comments
*/
-function conversation_add_children($parents, $block_authors, $order, $uid) {
+function conversation_add_children(array $parents, $block_authors, $order, $uid) {
$max_comments = Config::get('system', 'max_comments', 100);
$params = ['order' => ['uid', 'commented' => true]];
$start_month = DateTimeFormat::utc($dstart, 'Y-m-d');
$end_month = DateTimeFormat::utc($dend, 'Y-m-d');
$str = day_translate(DateTimeFormat::utc($dnow, 'F'));
+
if (empty($ret[$dyear])) {
$ret[$dyear] = [];
}
+
$ret[$dyear][] = [$str, $end_month, $start_month];
$dnow = DateTimeFormat::utc($dnow . ' -1 month', 'Y-m-d');
}
$sql_extra3 = '';
$sql_table = '`thread`';
$sql_parent = '`iid`';
+ $sql_order = '';
if ($update) {
$sql_table = '`item`';
use Friendica\Util\Temporal;
use dba;
+use InvalidArgumentException;
+
require_once 'include/dba.php';
require_once 'mod/proxy.php';
* @param array $profiledata array
* @param boolean $show_connect Show connect link
*/
- public static function load(App $a, $nickname, $profile = 0, $profiledata = [], $show_connect = true)
+ public static function load(App $a, $nickname, $profile = 0, array $profiledata = [], $show_connect = true)
{
$user = dba::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]);
return;
}
- if (empty($a->page['aside'])) {
- $a->page['aside'] = '';
- }
-
- if ($profiledata) {
+ if (count($profiledata) > 0) {
+ // Add profile data to sidebar
$a->page['aside'] .= self::sidebar($profiledata, true, $show_connect);
if (!DBM::is_result($user)) {