Merge remote-tracking branch 'friendica/develop' into improvement/ping-php-json
This commit is contained in:
commit
133120007c
40 changed files with 9841 additions and 9771 deletions
|
@ -428,6 +428,21 @@ function admin_page_queue(&$a) {
|
|||
* @return string
|
||||
*/
|
||||
function admin_page_summary(&$a) {
|
||||
global $db;
|
||||
// are there MyISAM tables in the DB? If so, trigger a warning message
|
||||
$r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1",
|
||||
dbesc($db->database_name()));
|
||||
$showwarning = false;
|
||||
$warningtext = array();
|
||||
if (dbm::is_result($r)) {
|
||||
$showwarning = true;
|
||||
$warningtext[] = sprintf(t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the <tt>convert_innodb.sql</tt> in the <tt>/util</tt> directory of your Friendica installation.<br />'), 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
|
||||
}
|
||||
// MySQL >= 5.7.4 doesn't support the IGNORE keyword in ALTER TABLE statements
|
||||
if ((version_compare($db->server_info(), '5.7.4') >= 0) AND
|
||||
!(strpos($db->server_info(), 'MariaDB') !== false)) {
|
||||
$warningtext[] = t('You are using a MySQL version which does not support all features that Friendica uses. You should consider switching to MariaDB.');
|
||||
}
|
||||
$r = q("SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` GROUP BY `page-flags`");
|
||||
$accounts = array(
|
||||
array(t('Normal Account'), 0),
|
||||
|
@ -478,7 +493,9 @@ function admin_page_summary(&$a) {
|
|||
'$platform' => FRIENDICA_PLATFORM,
|
||||
'$codename' => FRIENDICA_CODENAME,
|
||||
'$build' => get_config('system','build'),
|
||||
'$plugins' => array(t('Active plugins'), $a->plugins)
|
||||
'$plugins' => array(t('Active plugins'), $a->plugins),
|
||||
'$showwarning' => $showwarning,
|
||||
'$warningtext' => $warningtext
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -1388,6 +1405,7 @@ function admin_page_users(&$a){
|
|||
'$h_deleted' => t('User waiting for permanent deletion'),
|
||||
'$th_pending' => array(t('Request date'), t('Name'), t('Email')),
|
||||
'$no_pending' => t('No registrations.'),
|
||||
'$pendingnotetext' => t('Note from the user'),
|
||||
'$approve' => t('Approve'),
|
||||
'$deny' => t('Deny'),
|
||||
'$delete' => t('Delete'),
|
||||
|
|
|
@ -744,6 +744,9 @@ function item_post(&$a) {
|
|||
|
||||
if($preview) {
|
||||
require_once('include/conversation.php');
|
||||
// We set the datarray ID to -1 because in preview mode the dataray
|
||||
// doesn't have an ID.
|
||||
$datarray["id"] = -1;
|
||||
$o = conversation($a,array(array_merge($contact_record,$datarray)),'search', false, true);
|
||||
logger('preview: ' . $o);
|
||||
echo json_encode(array('preview' => $o));
|
||||
|
|
|
@ -395,10 +395,10 @@ function network_content(&$a, $update = 0) {
|
|||
|
||||
if($group) {
|
||||
if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) {
|
||||
notice( sprintf( tt('Warning: This group contains %s member from an insecure network.',
|
||||
'Warning: This group contains %s members from an insecure network.',
|
||||
$t), $t ) . EOL);
|
||||
notice( t('Private messages to this group are at risk of public disclosure.') . EOL);
|
||||
notice(sprintf(tt("Warning: This group contains %s member from a network that doesn't allow non public messages.",
|
||||
"Warning: This group contains %s members from a network that doesn't allow non public messages.",
|
||||
$t), $t).EOL);
|
||||
notice(t("Messages in this group won't be send to these receivers.").EOL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -453,6 +453,7 @@ function network_content(&$a, $update = 0) {
|
|||
if ($nouveau OR strlen($file) OR $update) {
|
||||
$sql_table = "`item`";
|
||||
$sql_parent = "`parent`";
|
||||
$sql_post_table = " INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent`";
|
||||
}
|
||||
|
||||
$sql_nets = (($nets) ? sprintf(" and $sql_table.`network` = '%s' ", dbesc($nets)) : '');
|
||||
|
@ -487,9 +488,9 @@ function network_content(&$a, $update = 0) {
|
|||
$gcontact_str_self = $self[0]["gid"];
|
||||
}
|
||||
|
||||
$sql_post_table = " INNER JOIN `item` AS `temp1` ON `temp1`.`id` = ".$sql_table.".".$sql_parent;
|
||||
$sql_extra3 .= " AND ($sql_table.`contact-id` IN ($contact_str) ";
|
||||
$sql_extra3 .= " OR ($sql_table.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '".protect_sprintf('%<'.intval($group).'>%')."' AND `temp1`.`private`))";
|
||||
$sql_post_table .= " INNER JOIN `item` AS `temp1` ON `temp1`.`id` = ".$sql_table.".".$sql_parent;
|
||||
$sql_extra3 .= " AND (`thread`.`contact-id` IN ($contact_str) ";
|
||||
$sql_extra3 .= " OR (`thread`.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '".protect_sprintf('%<'.intval($group).'>%')."' AND `temp1`.`private`))";
|
||||
} else {
|
||||
$sql_extra3 .= " AND false ";
|
||||
info( t('Group is empty'));
|
||||
|
@ -503,7 +504,7 @@ function network_content(&$a, $update = 0) {
|
|||
elseif($cid) {
|
||||
|
||||
$r = qu("SELECT `id`,`name`,`network`,`writable`,`nurl`, `forum`, `prv`, `contact-type`, `addr`, `thumb`, `location` FROM `contact` WHERE `id` = %d
|
||||
AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
|
||||
AND NOT `blocked` LIMIT 1",
|
||||
intval($cid)
|
||||
);
|
||||
if(count($r)) {
|
||||
|
@ -569,7 +570,7 @@ function network_content(&$a, $update = 0) {
|
|||
if($tag) {
|
||||
$sql_extra = "";
|
||||
|
||||
$sql_post_table = sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
|
||||
$sql_post_table .= sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
|
||||
dbesc(protect_sprintf($search)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG), intval(local_user()));
|
||||
$sql_order = "`item`.`id`";
|
||||
$order_mode = "id";
|
||||
|
@ -583,7 +584,7 @@ function network_content(&$a, $update = 0) {
|
|||
}
|
||||
}
|
||||
if(strlen($file)) {
|
||||
$sql_post_table = sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
|
||||
$sql_post_table .= sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
|
||||
dbesc(protect_sprintf($file)), intval(TERM_OBJ_POST), intval(TERM_FILE), intval(local_user()));
|
||||
$sql_order = "`item`.`id`";
|
||||
$order_mode = "id";
|
||||
|
@ -602,7 +603,7 @@ function network_content(&$a, $update = 0) {
|
|||
if(get_config('system', 'old_pager')) {
|
||||
$r = qu("SELECT COUNT(*) AS `total`
|
||||
FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = $sql_table.`contact-id`
|
||||
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
|
||||
AND NOT `contact`.`blocked`
|
||||
WHERE $sql_table.`uid` = %d AND $sql_table.`visible` AND NOT $sql_table.`deleted`
|
||||
$sql_extra2 $sql_extra3
|
||||
$sql_extra $sql_nets ",
|
||||
|
@ -680,7 +681,7 @@ function network_content(&$a, $update = 0) {
|
|||
|
||||
$r = qu("SELECT `item`.`parent` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid`
|
||||
FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
|
||||
AND NOT `contact`.`blocked`
|
||||
WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`deleted` $sql_extra4
|
||||
AND NOT `item`.`moderated` AND `item`.`unseen`
|
||||
$sql_extra3 $sql_extra $sql_nets
|
||||
|
@ -690,7 +691,7 @@ function network_content(&$a, $update = 0) {
|
|||
} else {
|
||||
$r = qu("SELECT `thread`.`iid` AS `item_id`, `thread`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid`
|
||||
FROM $sql_table $sql_post_table STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
|
||||
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
|
||||
AND NOT `contact`.`blocked`
|
||||
WHERE `thread`.`uid` = %d AND `thread`.`visible` AND NOT `thread`.`deleted`
|
||||
AND NOT `thread`.`moderated`
|
||||
$sql_extra2 $sql_extra3 $sql_extra $sql_nets
|
||||
|
|
24
mod/ping.php
24
mod/ping.php
|
@ -131,7 +131,7 @@ function ping_init(App $a)
|
|||
if ($item['wall']) {
|
||||
$home_count++;
|
||||
} else {
|
||||
$network++;
|
||||
$network_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ function ping_init(App $a)
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
$intro = count($intros1) + count($intros2);
|
||||
$intro_count = count($intros1) + count($intros2);
|
||||
$intros = $intros1+$intros2;
|
||||
|
||||
$myurl = $a->get_baseurl() . '/profile/' . $a->user['nickname'] ;
|
||||
|
@ -190,10 +190,8 @@ function ping_init(App $a)
|
|||
FROM `contact` RIGHT JOIN `register` ON `register`.`uid` = `contact`.`uid`
|
||||
WHERE `contact`.`self` = 1");
|
||||
if ($regs) {
|
||||
$register = $regs[0]['total'];
|
||||
$register_count = $regs[0]['total'];
|
||||
}
|
||||
} else {
|
||||
$register = 0;
|
||||
}
|
||||
|
||||
$ev = q("SELECT count(`event`.`id`) AS total, type, start, adjust FROM `event`
|
||||
|
@ -231,9 +229,9 @@ function ping_init(App $a)
|
|||
|
||||
$data['intro'] = $intro_count;
|
||||
$data['mail'] = $mail_count;
|
||||
$data['net'] = $network;
|
||||
$data['home'] = $home;
|
||||
$data['register'] = $register;
|
||||
$data['net'] = $network_count;
|
||||
$data['home'] = $home_count;
|
||||
$data['register'] = $register_count;
|
||||
|
||||
$data['all-events'] = $all_events;
|
||||
$data['all-events-today'] = $all_events_today;
|
||||
|
@ -242,10 +240,10 @@ function ping_init(App $a)
|
|||
$data['birthdays'] = $birthdays;
|
||||
$data['birthdays-today'] = $birthdays_today;
|
||||
|
||||
if (dbm::is_result($notifs) && !$sysnotify) {
|
||||
if (dbm::is_result($notifs)) {
|
||||
foreach ($notifs as $notif) {
|
||||
if ($notif['seen'] == 0) {
|
||||
$sysnotify ++;
|
||||
$sysnotify_count ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -356,7 +354,7 @@ function ping_init(App $a)
|
|||
if ($format == 'json') {
|
||||
$data['groups'] = $groups_unseen;
|
||||
$data['forums'] = $forums_unseen;
|
||||
$data['notify'] = $sysnotify + $intro + $mail_count + $register;
|
||||
$data['notify'] = $sysnotify_count + $intro_count + $mail_count + $register_count;
|
||||
$data['notifications'] = $notifications;
|
||||
$data['sysmsgs'] = array(
|
||||
'notice' => $sysmsgs,
|
||||
|
@ -375,7 +373,7 @@ function ping_init(App $a)
|
|||
}
|
||||
} else {
|
||||
// Legacy slower XML format output
|
||||
$data = ping_format_xml_data($data, $sysnotify, $notifications, $sysmsgs, $sysmsgs_info, $groups_unseen, $forums_unseen);
|
||||
$data = ping_format_xml_data($data, $sysnotify_count, $notifications, $sysmsgs, $sysmsgs_info, $groups_unseen, $forums_unseen);
|
||||
|
||||
header("Content-type: text/xml");
|
||||
echo xml::from_array(array("result" => $data), $xml);
|
||||
|
@ -468,7 +466,7 @@ function ping_get_notifications($uid)
|
|||
* @deprecated
|
||||
*
|
||||
* @param array $data The initial ping data array
|
||||
* @param int $sysnotify Number of unseen system notifications
|
||||
* @param int $sysnotify_count Number of unseen system notifications
|
||||
* @param array $notifs Complete list of notification
|
||||
* @param array $sysmsgs List of system notice messages
|
||||
* @param array $sysmsgs_info List of system info messages
|
||||
|
|
|
@ -233,66 +233,87 @@ function proxy_init() {
|
|||
killme();
|
||||
}
|
||||
|
||||
function proxy_url($url, $writemode = false, $size = "") {
|
||||
global $_SERVER;
|
||||
|
||||
/**
|
||||
* @brief Transform a remote URL into a local one
|
||||
*
|
||||
* This function only performs the URL replacement on http URL and if the
|
||||
* provided URL isn't local, "the isn't deactivated" (sic) and if the config
|
||||
* system.proxy_disabled is set to false.
|
||||
*
|
||||
* @param string $url The URL to proxyfy
|
||||
* @param bool $writemode Returns a local path the remote URL should be saved to
|
||||
* @param string $size One of the PROXY_SIZE_* constants
|
||||
*
|
||||
* @return string The proxyfied URL or relative path
|
||||
*/
|
||||
function proxy_url($url, $writemode = false, $size = '') {
|
||||
$a = get_app();
|
||||
|
||||
if (substr($url, 0, strlen('http')) !== 'http') {
|
||||
return($url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
// Only continue if it isn't a local image and the isn't deactivated
|
||||
if (proxy_is_local_image($url)) {
|
||||
$url = str_replace(normalise_link($a->get_baseurl())."/", $a->get_baseurl()."/", $url);
|
||||
return($url);
|
||||
$url = str_replace(normalise_link($a->get_baseurl()) . '/', $a->get_baseurl() . '/', $url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
if (get_config("system", "proxy_disabled"))
|
||||
return($url);
|
||||
if (get_config('system', 'proxy_disabled')) {
|
||||
return $url;
|
||||
}
|
||||
|
||||
// Image URL may have encoded ampersands for display which aren't desirable for proxy
|
||||
$url = html_entity_decode($url, ENT_NOQUOTES, 'utf-8');
|
||||
|
||||
// Creating a sub directory to reduce the amount of files in the cache directory
|
||||
$basepath = $a->get_basepath()."/proxy";
|
||||
$basepath = $a->get_basepath() . '/proxy';
|
||||
|
||||
$path = substr(hash("md5", $url), 0, 2);
|
||||
$shortpath = hash('md5', $url);
|
||||
$longpath = substr($shortpath, 0, 2);
|
||||
|
||||
if (is_dir($basepath) and $writemode)
|
||||
if (!is_dir($basepath."/".$path)) {
|
||||
mkdir($basepath."/".$path);
|
||||
chmod($basepath."/".$path, 0777);
|
||||
if (is_dir($basepath) and $writemode) {
|
||||
if (!is_dir($basepath . '/' . $longpath)) {
|
||||
mkdir($basepath . '/' . $longpath);
|
||||
chmod($basepath . '/' . $longpath, 0777);
|
||||
}
|
||||
|
||||
$path .= "/".strtr(base64_encode($url), '+/', '-_');
|
||||
|
||||
// Checking for valid extensions. Only add them if they are safe
|
||||
$pos = strrpos($url, ".");
|
||||
if ($pos) {
|
||||
$extension = strtolower(substr($url, $pos+1));
|
||||
$pos = strpos($extension, "?");
|
||||
if ($pos)
|
||||
$extension = substr($extension, 0, $pos);
|
||||
}
|
||||
|
||||
$extensions = array("jpg", "jpeg", "gif", "png");
|
||||
$longpath .= '/' . strtr(base64_encode($url), '+/', '-_');
|
||||
|
||||
if (in_array($extension, $extensions))
|
||||
$path .= ".".$extension;
|
||||
// Checking for valid extensions. Only add them if they are safe
|
||||
$pos = strrpos($url, '.');
|
||||
if ($pos) {
|
||||
$extension = strtolower(substr($url, $pos + 1));
|
||||
$pos = strpos($extension, '?');
|
||||
if ($pos) {
|
||||
$extension = substr($extension, 0, $pos);
|
||||
}
|
||||
}
|
||||
|
||||
$proxypath = $a->get_baseurl()."/proxy/".$path;
|
||||
$extensions = array('jpg', 'jpeg', 'gif', 'png');
|
||||
if (in_array($extension, $extensions)) {
|
||||
$shortpath .= '.' . $extension;
|
||||
$longpath .= '.' . $extension;
|
||||
}
|
||||
|
||||
if ($size != "")
|
||||
$size = ":".$size;
|
||||
$proxypath = $a->get_baseurl() . '/proxy/' . $longpath;
|
||||
|
||||
if ($size != '') {
|
||||
$size = ':' . $size;
|
||||
}
|
||||
|
||||
// Too long files aren't supported by Apache
|
||||
// Writemode in combination with long files shouldn't be possible
|
||||
if ((strlen($proxypath) > 250) AND $writemode)
|
||||
return (hash("md5", $url));
|
||||
elseif (strlen($proxypath) > 250)
|
||||
return ($a->get_baseurl()."/proxy/".hash("md5", $url)."?url=".urlencode($url));
|
||||
elseif ($writemode)
|
||||
return ($path);
|
||||
else
|
||||
return ($proxypath.$size);
|
||||
if ((strlen($proxypath) > 250) AND $writemode) {
|
||||
return $shortpath;
|
||||
} elseif (strlen($proxypath) > 250) {
|
||||
return $a->get_baseurl() . '/proxy/' . $shortpath . '?url=' . urlencode($url);
|
||||
} elseif ($writemode) {
|
||||
return $longpath;
|
||||
} else {
|
||||
return $proxypath . $size;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -113,12 +113,13 @@ function register_post(&$a) {
|
|||
}
|
||||
|
||||
$hash = random_string();
|
||||
$r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password`, `language` ) VALUES ( '%s', '%s', %d, '%s', '%s' ) ",
|
||||
$r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password`, `language`, `note` ) VALUES ( '%s', '%s', %d, '%s', '%s', '%s' ) ",
|
||||
dbesc($hash),
|
||||
dbesc(datetime_convert()),
|
||||
intval($user['uid']),
|
||||
dbesc($result['password']),
|
||||
dbesc($lang)
|
||||
dbesc($lang),
|
||||
dbesc($_POST['permonlybox'])
|
||||
);
|
||||
|
||||
// invite system
|
||||
|
@ -262,6 +263,8 @@ function register_content(&$a) {
|
|||
$o = replace_macros($o, array(
|
||||
'$oidhtml' => $oidhtml,
|
||||
'$invitations' => get_config('system','invitation_only'),
|
||||
'$permonly' => $a->config['register_policy'] == REGISTER_APPROVE,
|
||||
'$permonlybox' => array('permonlybox', t('Note for the admin'), '', t('Leave a message for the admin, why you want to join this node')),
|
||||
'$invite_desc' => t('Membership on this site is by invitation only.'),
|
||||
'$invite_label' => t('Your invitation ID: '),
|
||||
'$invite_id' => $invite_id,
|
||||
|
|
|
@ -301,6 +301,7 @@ function settings_post(&$a) {
|
|||
$infinite_scroll = x($_POST, 'infinite_scroll') ? intval($_POST['infinite_scroll']) : 0;
|
||||
$no_auto_update = x($_POST, 'no_auto_update') ? intval($_POST['no_auto_update']) : 0;
|
||||
$bandwidth_saver = x($_POST, 'bandwidth_saver') ? intval($_POST['bandwidth_saver']) : 0;
|
||||
$nowarn_insecure = x($_POST, 'nowarn_insecure') ? intval($_POST['nowarn_insecure']) : 0;
|
||||
$browser_update = x($_POST, 'browser_update') ? intval($_POST['browser_update']) : 0;
|
||||
if ($browser_update != -1) {
|
||||
$browser_update = $browser_update * 1000;
|
||||
|
@ -321,6 +322,7 @@ function settings_post(&$a) {
|
|||
set_pconfig(local_user(),'system','mobile_theme',$mobile_theme);
|
||||
}
|
||||
|
||||
set_pconfig(local_user(), 'system', 'nowarn_insecure' , $nowarn_insecure);
|
||||
set_pconfig(local_user(), 'system', 'update_interval' , $browser_update);
|
||||
set_pconfig(local_user(), 'system', 'itemspage_network' , $itemspage_network);
|
||||
set_pconfig(local_user(), 'system', 'itemspage_mobile_network', $itemspage_mobile_network);
|
||||
|
@ -951,6 +953,8 @@ function settings_content(&$a) {
|
|||
$theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']);
|
||||
$mobile_theme_selected = (!x($_SESSION,'mobile-theme')? $default_mobile_theme : $_SESSION['mobile-theme']);
|
||||
|
||||
$nowarn_insecure = intval(get_pconfig(local_user(), 'system', 'nowarn_insecure'));
|
||||
|
||||
$browser_update = intval(get_pconfig(local_user(), 'system','update_interval'));
|
||||
if (intval($browser_update) != -1)
|
||||
$browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds
|
||||
|
@ -995,6 +999,7 @@ function settings_content(&$a) {
|
|||
|
||||
'$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes, true),
|
||||
'$mobile_theme' => array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false),
|
||||
'$nowarn_insecure' => array('nowarn_insecure', t('Suppress warning of insecure networks'), $nowarn_insecure, t("Should the system suppress the warning that the current group contains members of networks that can't receive non public postings.")),
|
||||
'$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds. Enter -1 to disable it.')),
|
||||
'$itemspage_network' => array('itemspage_network', t("Number of items to display per page:"), $itemspage_network, t('Maximum of 100 items')),
|
||||
'$itemspage_mobile_network' => array('itemspage_mobile_network', t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, t('Maximum of 100 items')),
|
||||
|
|
|
@ -47,7 +47,7 @@ function viewcontacts_content(&$a) {
|
|||
}
|
||||
|
||||
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
|
||||
WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
|
||||
WHERE `uid` = %d AND NOT `blocked` AND NOT `hidden` AND NOT `archive`
|
||||
AND `network` IN ('%s', '%s', '%s')",
|
||||
intval($a->profile['uid']),
|
||||
dbesc(NETWORK_DFRN),
|
||||
|
@ -58,7 +58,7 @@ function viewcontacts_content(&$a) {
|
|||
$a->set_pager_total($r[0]['total']);
|
||||
|
||||
$r = q("SELECT * FROM `contact`
|
||||
WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
|
||||
WHERE `uid` = %d AND NOT `blocked` AND NOT `hidden` AND NOT `archive`
|
||||
AND `network` IN ('%s', '%s', '%s')
|
||||
ORDER BY `name` ASC LIMIT %d, %d",
|
||||
intval($a->profile['uid']),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue