Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
44263d5ac3
2
UPDATES
Normal file
2
UPDATES
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
alter table `group` add hash char(255) not null default '' after id, add index (hash);
|
||||||
|
alter table photo add size int(10) unsigned not null default '0' after width, add index (size);
|
6
boot.php
6
boot.php
@ -1334,12 +1334,6 @@ if(! function_exists('profile_sidebar')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(get_my_url() && $profile['unkmail'])
|
|
||||||
$wallmessage = t('Message');
|
|
||||||
else
|
|
||||||
$wallmessage = false;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// show edit profile to yourself
|
// show edit profile to yourself
|
||||||
if($is_owner) {
|
if($is_owner) {
|
||||||
|
@ -2,9 +2,22 @@
|
|||||||
|
|
||||||
|
|
||||||
function vcard_from_xchan($xchan) {
|
function vcard_from_xchan($xchan) {
|
||||||
|
|
||||||
|
$connect = false;
|
||||||
|
if(local_user()) {
|
||||||
|
$r = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
|
||||||
|
dbesc($xchan['xchan_hash']),
|
||||||
|
intval(local_user())
|
||||||
|
);
|
||||||
|
if(! $r)
|
||||||
|
$connect = t('Connect');
|
||||||
|
}
|
||||||
|
|
||||||
return replace_macros(get_markup_template('xchan_vcard.tpl'),array(
|
return replace_macros(get_markup_template('xchan_vcard.tpl'),array(
|
||||||
'$name' => $xchan['xchan_name'],
|
'$name' => $xchan['xchan_name'],
|
||||||
'$photo' => $xchan['xchan_photo_l']
|
'$photo' => $xchan['xchan_photo_l'],
|
||||||
|
'$url' => $xchan['xchan_addr'],
|
||||||
|
'$connect' => $connect
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,7 +528,7 @@ class Photo {
|
|||||||
$x = q("select id from photo where `resource_id` = '%s' and uid = %d and `xchan` = '%s' and `scale` = %d limit 1",
|
$x = q("select id from photo where `resource_id` = '%s' and uid = %d and `xchan` = '%s' and `scale` = %d limit 1",
|
||||||
dbesc($rid),
|
dbesc($rid),
|
||||||
intval($uid),
|
intval($uid),
|
||||||
intval($xchan),
|
dbesc($xchan),
|
||||||
intval($scale)
|
intval($scale)
|
||||||
);
|
);
|
||||||
if(count($x)) {
|
if(count($x)) {
|
||||||
|
@ -1,61 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once("boot.php");
|
require_once('include/cli_startup.php');
|
||||||
require_once('include/Scrape.php');
|
require_once('include/zot.php');
|
||||||
require_once('include/socgraph.php');
|
|
||||||
|
|
||||||
function gprobe_run($argv, $argc){
|
function gprobe_run($argv, $argc){
|
||||||
global $a, $db;
|
|
||||||
|
|
||||||
if(is_null($a)) {
|
cli_startup();
|
||||||
$a = new App;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(is_null($db)) {
|
|
||||||
@include(".htconfig.php");
|
|
||||||
require_once("dba.php");
|
|
||||||
$db = new dba($db_host, $db_user, $db_pass, $db_data);
|
|
||||||
unset($db_host, $db_user, $db_pass, $db_data);
|
|
||||||
};
|
|
||||||
|
|
||||||
require_once('include/session.php');
|
$a = get_app();
|
||||||
require_once('include/datetime.php');
|
|
||||||
|
|
||||||
load_config('config');
|
|
||||||
load_config('system');
|
|
||||||
|
|
||||||
$a->set_baseurl(get_config('system','baseurl'));
|
|
||||||
|
|
||||||
load_hooks();
|
|
||||||
|
|
||||||
if($argc != 2)
|
if($argc != 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$url = hex2bin($argv[1]);
|
$url = hex2bin($argv[1]);
|
||||||
|
|
||||||
$r = q("select * from gcontact where nurl = '%s' limit 1",
|
$r = q("select * from xchan where xchan_addr = '%s' limit 1",
|
||||||
dbesc(normalise_link($url))
|
dbesc(normalise_link($url))
|
||||||
);
|
);
|
||||||
|
|
||||||
if(! count($r)) {
|
if(! $r) {
|
||||||
|
$x = zot_finger($url,null);
|
||||||
$arr = probe_url($url);
|
if($x) {
|
||||||
if(count($arr) && x($arr,'network') && $arr['network'] === NETWORK_DFRN) {
|
$j = json_decode($x,true);
|
||||||
q("insert into `gcontact` (`name`,`url`,`nurl`,`photo`)
|
$y = import_xchan($j);
|
||||||
values ( '%s', '%s', '%s', '%s') ",
|
|
||||||
dbesc($arr['name']),
|
|
||||||
dbesc($arr['url']),
|
|
||||||
dbesc(normalise_link($arr['url'])),
|
|
||||||
dbesc($arr['photo'])
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
$r = q("select * from gcontact where nurl = '%s' limit 1",
|
|
||||||
dbesc(normalise_link($url))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if(count($r))
|
|
||||||
poco_load(0,0,$r[0]['id'], str_replace('/channel/','/poco/',$r[0]['url']));
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,8 +26,20 @@ function group_add($uid,$name) {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$r = q("INSERT INTO `group` ( `uid`, `name` )
|
|
||||||
VALUES( %d, '%s' ) ",
|
do {
|
||||||
|
$dups = false;
|
||||||
|
$hash = random_string() . $name;
|
||||||
|
|
||||||
|
$r = q("SELECT id FROM group WHERE hash = '%s' LIMIT 1", dbesc($hash));
|
||||||
|
if(count($r))
|
||||||
|
$dups = true;
|
||||||
|
} while($dups == true);
|
||||||
|
|
||||||
|
|
||||||
|
$r = q("INSERT INTO `group` ( hash, uid, name )
|
||||||
|
VALUES( '%s', %d, '%s' ) ",
|
||||||
|
dbesc($hash),
|
||||||
intval($uid),
|
intval($uid),
|
||||||
dbesc($name)
|
dbesc($name)
|
||||||
);
|
);
|
||||||
|
@ -23,7 +23,7 @@ function nav(&$a) {
|
|||||||
minChars: 2,
|
minChars: 2,
|
||||||
width: 250,
|
width: 250,
|
||||||
});
|
});
|
||||||
a.setOptions({ params: { autoSubmit: true, type: 'x' }});
|
a.setOptions({ autoSubmit: true, params: { type: 'x' }});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1044,7 +1044,7 @@ function scale_external_images($s, $include_link = true, $scale_replace = false)
|
|||||||
|
|
||||||
// replace the special char encoding
|
// replace the special char encoding
|
||||||
|
|
||||||
$s = htmlspecialchars($s,ENT_QUOTES,'UTF-8');
|
$s = htmlspecialchars($s,ENT_COMPAT,'UTF-8');
|
||||||
|
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ function notags($string) {
|
|||||||
if(! function_exists('escape_tags')) {
|
if(! function_exists('escape_tags')) {
|
||||||
function escape_tags($string) {
|
function escape_tags($string) {
|
||||||
|
|
||||||
return(htmlspecialchars($string, ENT_QUOTES, 'UTF-8', false));
|
return(htmlspecialchars($string, ENT_COMPAT, 'UTF-8', false));
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
@ -331,7 +331,7 @@ function expand_acl($s) {
|
|||||||
|
|
||||||
if(! function_exists('sanitise_acl')) {
|
if(! function_exists('sanitise_acl')) {
|
||||||
function sanitise_acl(&$item) {
|
function sanitise_acl(&$item) {
|
||||||
if(intval($item))
|
if(strlen($item))
|
||||||
$item = '<' . notags(trim($item)) . '>';
|
$item = '<' . notags(trim($item)) . '>';
|
||||||
else
|
else
|
||||||
unset($item);
|
unset($item);
|
||||||
@ -545,7 +545,7 @@ function contact_block() {
|
|||||||
$total = intval($r[0]['total']);
|
$total = intval($r[0]['total']);
|
||||||
}
|
}
|
||||||
if(! $total) {
|
if(! $total) {
|
||||||
$contacts = t('No contacts');
|
$contacts = t('No connnections');
|
||||||
$micropro = Null;
|
$micropro = Null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -556,7 +556,7 @@ function contact_block() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$contacts = sprintf( tt('%d Contact','%d Contacts', $total),$total);
|
$contacts = sprintf( tt('%d Connection','%d Connections', $total),$total);
|
||||||
$micropro = Array();
|
$micropro = Array();
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
$micropro[] = micropro($rr,true,'mpfriend');
|
$micropro[] = micropro($rr,true,'mpfriend');
|
||||||
@ -568,7 +568,7 @@ function contact_block() {
|
|||||||
$o = replace_macros($tpl, array(
|
$o = replace_macros($tpl, array(
|
||||||
'$contacts' => $contacts,
|
'$contacts' => $contacts,
|
||||||
'$nickname' => $a->profile['nickname'],
|
'$nickname' => $a->profile['nickname'],
|
||||||
'$viewcontacts' => t('View Contacts'),
|
'$viewcontacts' => t('View Connnections'),
|
||||||
'$micropro' => $micropro,
|
'$micropro' => $micropro,
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -579,46 +579,35 @@ function contact_block() {
|
|||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
function chanlink_hash($s) {
|
||||||
|
return z_root() . '/chanview?f=&hash=' . urlencode($s);
|
||||||
|
}
|
||||||
|
|
||||||
|
function chanlink_url($s) {
|
||||||
|
return z_root() . '/chanview?f=&url=' . urlencode($s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function chanlink_cid($d) {
|
||||||
|
return z_root() . '/chanview?f=&cid=' . intval($d);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(! function_exists('micropro')) {
|
if(! function_exists('micropro')) {
|
||||||
function micropro($contact, $redirect = false, $class = '', $textmode = false) {
|
function micropro($contact, $redirect = false, $class = '', $textmode = false) {
|
||||||
|
|
||||||
if($class)
|
$url = chanlink_hash($contact['xchan_hash']);
|
||||||
$class = ' ' . $class;
|
|
||||||
|
|
||||||
$url = $contact['xchan_url'];
|
return replace_macros(get_markup_template(($textmode)?'micropro_txt.tpl':'micropro_img.tpl'),array(
|
||||||
$sparkle = '';
|
'$click' => $click,
|
||||||
$redir = false;
|
'$class' => $class,
|
||||||
|
'$url' => $url,
|
||||||
if($redirect) {
|
'$photo' => $contact['xchan_photo_s'],
|
||||||
$a = get_app();
|
'$name' => $contact['xchan_name'],
|
||||||
$redirect_url = $a->get_baseurl() . '/magic/' . $contact['abook_id'];
|
'$title' => $contact['xchan_name'] . ' [' . $contact['xchan_addr'] . ']',
|
||||||
if(local_user() && ($contact['abook_channel'] == local_user()) && ($contact['xchan_network'] === NETWORK_ZOT)) {
|
));
|
||||||
$redir = true;
|
|
||||||
$url = $redirect_url;
|
|
||||||
$sparkle = ' sparkle';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$url = zid($url);
|
|
||||||
}
|
|
||||||
$click = ((x($contact,'click')) ? ' onclick="' . $contact['click'] . '" ' : '');
|
|
||||||
if($click)
|
|
||||||
$url = '';
|
|
||||||
if($textmode) {
|
|
||||||
return '<div class="contact-block-textdiv' . $class . '"><a class="contact-block-link' . $class . $sparkle
|
|
||||||
. (($click) ? ' fakelink' : '') . '" '
|
|
||||||
. (($redir) ? ' ' : '')
|
|
||||||
. (($url) ? ' href="' . $url . '"' : '') . $click
|
|
||||||
. '" title="' . $contact['xchan_name'] . ' [' . $contact['xchan_url'] . ']" alt="' . $contact['xchan_name']
|
|
||||||
. '" >'. $contact['xchan_name'] . '</a></div>' . "\r\n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return '<div class="contact-block-div' . $class . '"><a class="contact-block-link' . $class . $sparkle
|
|
||||||
. (($click) ? ' fakelink' : '') . '" '
|
|
||||||
. (($redir) ? ' ' : '')
|
|
||||||
. (($url) ? ' href="' . $url . '"' : '') . $click . ' ><img class="contact-block-img' . $class . $sparkle . '" src="'
|
|
||||||
. $contact['xchan_photo_s'] . '" title="' . $contact['xchan_name'] . ' [' . $contact['xchan_url'] . ']" alt="' . $contact['xchan_name']
|
|
||||||
. '" /></a></div>' . "\r\n";
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
@ -963,7 +952,7 @@ function prepare_body($item,$attach = false) {
|
|||||||
foreach($terms as $t) {
|
foreach($terms as $t) {
|
||||||
if(strlen($x))
|
if(strlen($x))
|
||||||
$x .= ',';
|
$x .= ',';
|
||||||
$x .= htmlspecialchars($t['term'],ENT_QUOTES,'UTF-8')
|
$x .= htmlspecialchars($t['term'],ENT_COMPAT,'UTF-8')
|
||||||
. ((local_user() == $item['uid']) ? ' <a href="' . $a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&cat=' . urlencode($t['term']) . '" title="' . t('remove') . '" >' . t('[remove]') . '</a>' : '');
|
. ((local_user() == $item['uid']) ? ' <a href="' . $a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&cat=' . urlencode($t['term']) . '" title="' . t('remove') . '" >' . t('[remove]') . '</a>' : '');
|
||||||
}
|
}
|
||||||
if(strlen($x))
|
if(strlen($x))
|
||||||
@ -978,7 +967,7 @@ function prepare_body($item,$attach = false) {
|
|||||||
foreach($terms as $t) {
|
foreach($terms as $t) {
|
||||||
if(strlen($x))
|
if(strlen($x))
|
||||||
$x .= ' ';
|
$x .= ' ';
|
||||||
$x .= htmlspecialchars($t['term'],ENT_QUOTES,'UTF-8')
|
$x .= htmlspecialchars($t['term'],ENT_COMPAT,'UTF-8')
|
||||||
. ' <a href="' . $a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . urlencode($t['term']) . '" title="' . t('remove') . '" >' . t('[remove]') . '</a>';
|
. ' <a href="' . $a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . urlencode($t['term']) . '" title="' . t('remove') . '" >' . t('[remove]') . '</a>';
|
||||||
}
|
}
|
||||||
if(strlen($x) && (local_user() == $item['uid']))
|
if(strlen($x) && (local_user() == $item['uid']))
|
||||||
|
@ -406,7 +406,7 @@ function import_xchan_from_json($j) {
|
|||||||
|
|
||||||
require_once("Photo.php");
|
require_once("Photo.php");
|
||||||
|
|
||||||
$photos = import_profile_photo($j->photo,0,$xchan_hash);
|
$photos = import_profile_photo($j->photo,$xchan_hash);
|
||||||
$r = q("update xchan set xchan_photo_date = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s'
|
$r = q("update xchan set xchan_photo_date = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s'
|
||||||
where xchan_hash = '%s' limit 1",
|
where xchan_hash = '%s' limit 1",
|
||||||
dbesc($j->photo_updated),
|
dbesc($j->photo_updated),
|
||||||
@ -524,7 +524,7 @@ function import_xchan($arr) {
|
|||||||
|
|
||||||
require_once("Photo.php");
|
require_once("Photo.php");
|
||||||
|
|
||||||
$photos = import_profile_photo($arr['photo'],0,$xchan_hash);
|
$photos = import_profile_photo($arr['photo'],$xchan_hash);
|
||||||
$r = q("update xchan set xchan_photo_date = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s'
|
$r = q("update xchan set xchan_photo_date = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s'
|
||||||
where xchan_hash = '%s' limit 1",
|
where xchan_hash = '%s' limit 1",
|
||||||
dbesc($arr['photo_updated']),
|
dbesc($arr['photo_updated']),
|
||||||
@ -870,7 +870,6 @@ function delete_imported_item($sender,$item,$uid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function process_mail_delivery($sender,$arr,$deliveries) {
|
function process_mail_delivery($sender,$arr,$deliveries) {
|
||||||
|
|
||||||
|
|
||||||
foreach($deliveries as $d) {
|
foreach($deliveries as $d) {
|
||||||
$r = q("select * from channel where channel_hash = '%s' limit 1",
|
$r = q("select * from channel where channel_hash = '%s' limit 1",
|
||||||
|
@ -425,6 +425,7 @@ CREATE TABLE IF NOT EXISTS `glink` (
|
|||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `group` (
|
CREATE TABLE IF NOT EXISTS `group` (
|
||||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`hash` char(255) NOT NULL DEFAULT '',
|
||||||
`uid` int(10) unsigned NOT NULL,
|
`uid` int(10) unsigned NOT NULL,
|
||||||
`visible` tinyint(1) NOT NULL DEFAULT '0',
|
`visible` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
`deleted` tinyint(1) NOT NULL DEFAULT '0',
|
`deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
@ -432,7 +433,8 @@ CREATE TABLE IF NOT EXISTS `group` (
|
|||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `uid` (`uid`),
|
KEY `uid` (`uid`),
|
||||||
KEY `visible` (`visible`),
|
KEY `visible` (`visible`),
|
||||||
KEY `deleted` (`deleted`)
|
KEY `deleted` (`deleted`),
|
||||||
|
KEY `hash` (`hash`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `group_member` (
|
CREATE TABLE IF NOT EXISTS `group_member` (
|
||||||
@ -708,6 +710,7 @@ CREATE TABLE IF NOT EXISTS `photo` (
|
|||||||
`type` char(128) NOT NULL DEFAULT 'image/jpeg',
|
`type` char(128) NOT NULL DEFAULT 'image/jpeg',
|
||||||
`height` smallint(6) NOT NULL,
|
`height` smallint(6) NOT NULL,
|
||||||
`width` smallint(6) NOT NULL,
|
`width` smallint(6) NOT NULL,
|
||||||
|
`size` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
`data` mediumblob NOT NULL,
|
`data` mediumblob NOT NULL,
|
||||||
`scale` tinyint(3) NOT NULL,
|
`scale` tinyint(3) NOT NULL,
|
||||||
`profile` tinyint(1) NOT NULL DEFAULT '0',
|
`profile` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
@ -724,7 +727,8 @@ CREATE TABLE IF NOT EXISTS `photo` (
|
|||||||
KEY `type` (`type`),
|
KEY `type` (`type`),
|
||||||
KEY `contact-id` (`contact-id`),
|
KEY `contact-id` (`contact-id`),
|
||||||
KEY `aid` (`aid`),
|
KEY `aid` (`aid`),
|
||||||
KEY `xchan` (`xchan`)
|
KEY `xchan` (`xchan`),
|
||||||
|
KEY `size` (`size`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `profile` (
|
CREATE TABLE IF NOT EXISTS `profile` (
|
||||||
|
@ -105,7 +105,7 @@ ACL.prototype.on_button_hide = function(event){
|
|||||||
|
|
||||||
ACL.prototype.set_allow = function(itemid){
|
ACL.prototype.set_allow = function(itemid){
|
||||||
type = itemid[0];
|
type = itemid[0];
|
||||||
id = parseInt(itemid.substr(1));
|
id = itemid.substr(1);
|
||||||
switch(type){
|
switch(type){
|
||||||
case "g":
|
case "g":
|
||||||
if (that.allow_gid.indexOf(id)<0){
|
if (that.allow_gid.indexOf(id)<0){
|
||||||
@ -129,7 +129,7 @@ ACL.prototype.set_allow = function(itemid){
|
|||||||
|
|
||||||
ACL.prototype.set_deny = function(itemid){
|
ACL.prototype.set_deny = function(itemid){
|
||||||
type = itemid[0];
|
type = itemid[0];
|
||||||
id = parseInt(itemid.substr(1));
|
id = itemid.substr(1);
|
||||||
switch(type){
|
switch(type){
|
||||||
case "g":
|
case "g":
|
||||||
if (that.deny_gid.indexOf(id)<0){
|
if (that.deny_gid.indexOf(id)<0){
|
||||||
@ -178,7 +178,7 @@ ACL.prototype.update_view = function(){
|
|||||||
$("#acl-list-content .acl-list-item").each(function(){
|
$("#acl-list-content .acl-list-item").each(function(){
|
||||||
itemid = $(this).attr('id');
|
itemid = $(this).attr('id');
|
||||||
type = itemid[0];
|
type = itemid[0];
|
||||||
id = parseInt(itemid.substr(1));
|
id = itemid.substr(1);
|
||||||
|
|
||||||
btshow = $(this).children(".acl-button-show").removeClass("selected");
|
btshow = $(this).children(".acl-button-show").removeClass("selected");
|
||||||
bthide = $(this).children(".acl-button-hide").removeClass("selected");
|
bthide = $(this).children(".acl-button-hide").removeClass("selected");
|
||||||
@ -248,7 +248,7 @@ ACL.prototype.populate = function(data){
|
|||||||
that.list_content.height(height);
|
that.list_content.height(height);
|
||||||
$(data.items).each(function(){
|
$(data.items).each(function(){
|
||||||
html = "<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'>"+that.item_tpl+"</div>";
|
html = "<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'>"+that.item_tpl+"</div>";
|
||||||
html = html.format( this.photo, this.name, this.type, this.id, '', this.network, this.link );
|
html = html.format( this.photo, this.name, this.type, this.xid, '', this.network, this.link );
|
||||||
if (this.uids!=undefined) that.group_uids[this.id] = this.uids;
|
if (this.uids!=undefined) that.group_uids[this.id] = this.uids;
|
||||||
//console.log(html);
|
//console.log(html);
|
||||||
that.list_content.append(html);
|
that.list_content.append(html);
|
||||||
|
42
mod/acl.php
42
mod/acl.php
@ -27,8 +27,8 @@ function acl_init(&$a){
|
|||||||
|
|
||||||
|
|
||||||
if ($search!=""){
|
if ($search!=""){
|
||||||
$sql_extra = "AND `name` LIKE '%%".dbesc($search)."%%'";
|
$sql_extra = " AND `name` LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
|
||||||
$sql_extra2 = "AND (`attag` LIKE '%%".dbesc($search)."%%' OR `name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')";
|
$sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . ") ";
|
||||||
|
|
||||||
$col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' );
|
$col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' );
|
||||||
$sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
|
$sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
|
||||||
@ -48,14 +48,14 @@ function acl_init(&$a){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($type=='' || $type=='c'){
|
if ($type=='' || $type=='c'){
|
||||||
$r = q("SELECT COUNT(`id`) AS c FROM `contact`
|
$r = q("SELECT COUNT(abook_id) AS c FROM abook left join xchan on abook_xchan = xchan_hash
|
||||||
WHERE `uid` = %d AND `self` = 0
|
WHERE abook_channel = %d AND not ( abook_flags & %d ) $sql_extra2" ,
|
||||||
AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
|
intval(local_user()),
|
||||||
AND `notify` != '' $sql_extra2" ,
|
intval(ABOOK_FLAG_SELF|ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVE)
|
||||||
intval(local_user())
|
|
||||||
);
|
);
|
||||||
$contact_count = (int)$r[0]['c'];
|
$contact_count = (int)$r[0]['c'];
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif ($type == 'm') {
|
elseif ($type == 'm') {
|
||||||
|
|
||||||
// autocomplete for Private Messages
|
// autocomplete for Private Messages
|
||||||
@ -94,7 +94,8 @@ function acl_init(&$a){
|
|||||||
|
|
||||||
if ($type=='' || $type=='g'){
|
if ($type=='' || $type=='g'){
|
||||||
|
|
||||||
$r = q("SELECT `group`.`id`, `group`.`name`, GROUP_CONCAT(DISTINCT `group_member`.`xchan` SEPARATOR ',') as uids
|
$r = q("SELECT `group`.`id`, `group`.`hash`, `group`.`name`,
|
||||||
|
GROUP_CONCAT(DISTINCT `group_member`.`xchan` SEPARATOR ',') as uids
|
||||||
FROM `group`,`group_member`
|
FROM `group`,`group_member`
|
||||||
WHERE `group`.`deleted` = 0 AND `group`.`uid` = %d
|
WHERE `group`.`deleted` = 0 AND `group`.`uid` = %d
|
||||||
AND `group_member`.`gid`=`group`.`id`
|
AND `group_member`.`gid`=`group`.`id`
|
||||||
@ -113,24 +114,24 @@ function acl_init(&$a){
|
|||||||
"type" => "g",
|
"type" => "g",
|
||||||
"photo" => "images/twopeople.png",
|
"photo" => "images/twopeople.png",
|
||||||
"name" => $g['name'],
|
"name" => $g['name'],
|
||||||
"id" => intval($g['id']),
|
"id" => $g['id'],
|
||||||
"uids" => array_map("intval", explode(",",$g['uids'])),
|
"xid" => $g['hash'],
|
||||||
|
"uids" => explode(",",$g['uids']),
|
||||||
"link" => ''
|
"link" => ''
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($type=='' || $type=='c'){
|
if ($type=='' || $type=='c') {
|
||||||
|
$r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick
|
||||||
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
|
FROM abook left join xchan on abook_xchan = xchan_hash
|
||||||
WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 AND `notify` != ''
|
WHERE abook_channel = %d AND not ( abook_flags & %d ) $sql_extra2 order by xchan_name asc" ,
|
||||||
$sql_extra2
|
intval(local_user()),
|
||||||
ORDER BY `name` ASC ",
|
intval(ABOOK_FLAG_SELF|ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVE)
|
||||||
intval(local_user())
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif($type == 'm') {
|
elseif($type == 'm') {
|
||||||
dbg(1);
|
|
||||||
$r = q("SELECT xchan_hash as id, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url
|
$r = q("SELECT xchan_hash as id, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url
|
||||||
FROM abook left join xchan on abook_xchan = xchan_hash
|
FROM abook left join xchan on abook_xchan = xchan_hash
|
||||||
WHERE abook_channel = %d and ( (abook_their_perms = null) or (abook_their_perms & %d ))
|
WHERE abook_channel = %d and ( (abook_their_perms = null) or (abook_their_perms & %d ))
|
||||||
@ -139,7 +140,6 @@ dbg(1);
|
|||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
intval(PERMS_W_MAIL)
|
intval(PERMS_W_MAIL)
|
||||||
);
|
);
|
||||||
dbg(0);
|
|
||||||
}
|
}
|
||||||
elseif($type == 'a') {
|
elseif($type == 'a') {
|
||||||
$r = q("SELECT abook_id as id, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag FROM abook left join xchan on abook_xchan = xchan_hash
|
$r = q("SELECT abook_id as id, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag FROM abook left join xchan on abook_xchan = xchan_hash
|
||||||
@ -186,8 +186,8 @@ dbg(0);
|
|||||||
"type" => "c",
|
"type" => "c",
|
||||||
"photo" => $g['micro'],
|
"photo" => $g['micro'],
|
||||||
"name" => $g['name'],
|
"name" => $g['name'],
|
||||||
"id" => intval($g['id']),
|
"id" => $g['id'],
|
||||||
"network" => $g['network'],
|
"xid" => $g['hash'],
|
||||||
"link" => $g['url'],
|
"link" => $g['url'],
|
||||||
"nick" => $g['nick'],
|
"nick" => $g['nick'],
|
||||||
);
|
);
|
||||||
|
@ -22,7 +22,11 @@ function chanview_content(&$a) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif($_REQUEST['url']) {
|
elseif($_REQUEST['url']) {
|
||||||
$r = array(array('xchan_url' => $_REQUEST['url']));
|
$r = q("select * from xchan where xchan_url = '%s' limit 1",
|
||||||
|
dbesc($_REQUEST['url'])
|
||||||
|
);
|
||||||
|
if(! $r)
|
||||||
|
$r = array(array('xchan_url' => $_REQUEST['url']));
|
||||||
}
|
}
|
||||||
if($r) {
|
if($r) {
|
||||||
$xchan = $r[0];
|
$xchan = $r[0];
|
||||||
|
@ -1 +1 @@
|
|||||||
2012-12-05.160
|
2012-12-06.161
|
||||||
|
@ -5,7 +5,7 @@ $(document).ready(function() {
|
|||||||
minChars: 2,
|
minChars: 2,
|
||||||
width: 350,
|
width: 350,
|
||||||
});
|
});
|
||||||
a.setOptions({ params: { autoSubmit: true, type: 'a' }});
|
a.setOptions({ autoSubmit: true, params: { type: 'a' }});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
1
view/tpl/micropro_img.tpl
Normal file
1
view/tpl/micropro_img.tpl
Normal file
@ -0,0 +1 @@
|
|||||||
|
<div class="contact-block-div{{if $class}} $class{{endif}}"><a class="contact-block-link{{if $class}} $class{{endif}}{{if $click}} fakelink{{endif}}" href="{{if $click}}#{{else}}$url{{endif}}" {{if $click}}onclick="$click"{{endif}}><img class="contact-block-img{{if $class}} $class{{endif}}" src="$photo" title="$title" alt="$name" /></a></div>
|
1
view/tpl/micropro_txt.tpl
Normal file
1
view/tpl/micropro_txt.tpl
Normal file
@ -0,0 +1 @@
|
|||||||
|
<div class="contact-block-textdiv{{if $class}} $class{{endif}}"><a class="contact-block-link{{if $class}} $class{{endif}}{{if $click}} fakelink{{endif}}" href="{{if $click}}#{{else}}$url{{endif}}" {{if $click}}onclick="$click"{{endif}} title="$title">$name</a></div>
|
@ -47,16 +47,6 @@
|
|||||||
{{ if $homepage }}<dl class="homepage"><dt class="homepage-label">$homepage</dt><dd class="homepage-url"><a href="$profile.homepage" >$profile.homepage</a></dd></dl>{{ endif }}
|
{{ if $homepage }}<dl class="homepage"><dt class="homepage-label">$homepage</dt><dd class="homepage-url"><a href="$profile.homepage" >$profile.homepage</a></dd></dl>{{ endif }}
|
||||||
|
|
||||||
|
|
||||||
<div id="profile-extra-links">
|
|
||||||
<ul>
|
|
||||||
{{ if $connect }}
|
|
||||||
<li><a id="dfrn-request-link" href="dfrn_request/$profile.nickname">$connect</a></li>
|
|
||||||
{{ endif }}
|
|
||||||
{{ if $wallmessage }}
|
|
||||||
<li><a id="wallmessage-link" href="wallmessage/$profile.nickname">$wallmessage</a></li>
|
|
||||||
{{ endif }}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
$contact_block
|
$contact_block
|
||||||
|
@ -2,3 +2,14 @@
|
|||||||
<div class="fn">$name</div>
|
<div class="fn">$name</div>
|
||||||
<div id="profile-photo-wrapper"><img class="vcard-photo photo" src="$photo" alt="name" /></div>
|
<div id="profile-photo-wrapper"><img class="vcard-photo photo" src="$photo" alt="name" /></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="profile-extra-links">
|
||||||
|
<ul>
|
||||||
|
{{ if $connect }}
|
||||||
|
<li><a id="follow-link" href="follow?f=&url=$follow">$connect</a></li>
|
||||||
|
{{ endif }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user