diff options
-rw-r--r-- | include/follow.php | 2 | ||||
-rw-r--r-- | include/identity.php | 2 | ||||
-rw-r--r-- | mod/acl.php | 8 | ||||
-rw-r--r-- | mod/item.php | 3 | ||||
-rw-r--r-- | view/js/mod_photos.js | 13 | ||||
-rwxr-xr-x | view/tpl/photo_view.tpl | 16 |
6 files changed, 31 insertions, 13 deletions
diff --git a/include/follow.php b/include/follow.php index c8bd3c500..14385d90d 100644 --- a/include/follow.php +++ b/include/follow.php @@ -13,6 +13,8 @@ require_once('include/zot.php'); function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) { + + $result = array('success' => false,'message' => ''); $a = get_app(); diff --git a/include/identity.php b/include/identity.php index 8866b4811..9a574ea65 100644 --- a/include/identity.php +++ b/include/identity.php @@ -176,6 +176,7 @@ function create_identity($arr) { // save this for auto_friending $total_identities = $ret['total_identities']; + $nick = mb_strtolower(trim($arr['nickname'])); if(! $nick) { $ret['message'] = t('Nickname is required.'); @@ -404,6 +405,7 @@ function create_identity($arr) { $accts = get_config('system','auto_follow'); if(($accts) && (! $total_identities)) { + require_once('include/follow.php'); if(! is_array($accts)) $accts = array($accts); foreach($accts as $acct) { diff --git a/mod/acl.php b/mod/acl.php index 7eb180cc4..01f5103f1 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -87,7 +87,7 @@ function acl_init(&$a){ $contact_count = (int)$r[0]['c']; } - elseif ($type == 'a') { + elseif (($type == 'a')||($type == 'p')) { // autocomplete for Contacts @@ -168,7 +168,7 @@ function acl_init(&$a){ intval(XCHAN_FLAGS_DELETED) ); } - elseif($type == 'a') { + elseif(($type == 'a') || ($type == 'p')) { $r = q("SELECT abook_id as id, xchan_name as name, xchan_hash as hash, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag , abook_their_perms FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and not (xchan_flags & %d) @@ -204,7 +204,7 @@ function acl_init(&$a){ $r = array(); - if($type == 'm' || $type == 'a') { + if($type == 'm' || $type == 'a' || $type == 'p') { $x = array(); $x['query'] = $search; $x['photos'] = array(); @@ -216,7 +216,7 @@ function acl_init(&$a){ $x['photos'][] = $g['micro']; $x['links'][] = $g['url']; $x['suggestions'][] = $g['name']; - $x['data'][] = $g['id']; + $x['data'][] = (($type === 'p') ? '@' . str_replace(' ','_',$g['name']) : $g['id']); } } echo json_encode($x); diff --git a/mod/item.php b/mod/item.php index dd6d0e217..22d285571 100644 --- a/mod/item.php +++ b/mod/item.php @@ -1181,9 +1181,10 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) { if(local_user() && local_user() == $profile_uid) { require_once('include/group.php'); $grp = group_byname($profile_uid,$name); + if($grp) { $g = q("select hash from groups where id = %d and visible = 1 limit 1", - intval($grp[0]['id']) + intval($grp) ); if($g && $exclusive) { $access_tag .= 'gid:' . $g[0]['hash']; diff --git a/view/js/mod_photos.js b/view/js/mod_photos.js index aaa86df40..8b7706f16 100644 --- a/view/js/mod_photos.js +++ b/view/js/mod_photos.js @@ -13,6 +13,19 @@ $(document).ready(function() { 'transition' : 'elastic' }); + var a; + a = $("#photo-edit-newtag").autocomplete({ + serviceUrl: baseurl + '/acl', + minChars: 2, + width: 250, + id: 'newtag-ac', + onSelect: function(value,data) { + $("#photo-edit-newtag").val(data); + }, + }); + a.setOptions({ params: { type: 'p' }}); + + $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() { var selstr; $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() { diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl index 786145691..54e15de74 100755 --- a/view/tpl/photo_view.tpl +++ b/view/tpl/photo_view.tpl @@ -33,9 +33,9 @@ </div> <div id="photo-edit-edit"> <form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post" id="photo_edit_form"> - <input type="hidden" name="item_id" value="{{$edit.item_id}}"> + <input type="hidden" name="item_id" value="{{$edit.item_id}}" /> <label id="photo-edit-albumname-label" for="photo-edit-albumname">{{$edit.newalbum}}</label> - <input id="photo-edit-albumname" type="text" name="albname" value="{{$edit.album}}" list="dl-albums"> + <input id="photo-edit-albumname" type="text" name="albname" value="{{$edit.album}}" list="dl-albums" /> {{if $edit.albums}} <datalist id="dl-albums"> {{foreach $edit.albums as $al}} @@ -47,18 +47,18 @@ {{/if}} <div id="photo-edit-albumname-end"></div> <label id="photo-edit-caption-label" for="photo-edit-caption">{{$edit.capt_label}}</label> - <input id="photo-edit-caption" type="text" name="desc" value="{{$edit.caption}}"> + <input id="photo-edit-caption" type="text" name="desc" value="{{$edit.caption}}" /> <div id="photo-edit-caption-end"></div> <label id="photo-edit-tags-label" for="photo-edit-newtag" >{{$edit.tag_label}}</label> - <input name="newtag" id="photo-edit-newtag" title="{{$edit.help_tags}}" type="text"> + <input name="newtag" id="photo-edit-newtag" title="{{$edit.help_tags}}" type="text" /> <div id="photo-edit-tags-end"></div> <div id="photo-edit-rotate-wrapper"> <div id="photo-edit-rotate-label"> {{$edit.rotatecw}}<br> {{$edit.rotateccw}} </div> - <input type="radio" name="rotate" value="1"><br> - <input type="radio" name="rotate" value="2"> + <input type="radio" name="rotate" value="1" /><br> + <input type="radio" name="rotate" value="2" /> </div> <div id="photo-edit-rotate-end"></div> <div id="settings-default-perms" class="settings-default-perms"> @@ -69,8 +69,8 @@ </div> <br/> <div id="settings-default-perms-end"></div> - <input id="photo-edit-submit-button" type="submit" name="submit" value="{{$edit.submit}}"> - <input id="photo-edit-delete-button" type="submit" name="delete" value="{{$edit.delete}}" onclick="return confirmDelete();"> + <input id="photo-edit-submit-button" type="submit" name="submit" value="{{$edit.submit}}" /> + <input id="photo-edit-delete-button" type="submit" name="delete" value="{{$edit.delete}}" onclick="return confirmDelete();" /> <div id="photo-edit-end"></div> </form> </div> |