diff options
-rwxr-xr-x | boot.php | 1 | ||||
-rw-r--r-- | include/zot.php | 9 | ||||
-rw-r--r-- | mod/directory.php | 3 | ||||
-rw-r--r-- | mod/dirsearch.php | 2 | ||||
-rw-r--r-- | mod/ping.php | 8 | ||||
-rw-r--r-- | mod/zfinger.php | 16 | ||||
-rw-r--r-- | version.inc | 2 | ||||
-rw-r--r-- | view/js/main.js | 2 | ||||
-rwxr-xr-x | view/tpl/direntry.tpl | 6 |
9 files changed, 41 insertions, 8 deletions
@@ -414,6 +414,7 @@ define ( 'XCHAN_FLAGS_ORPHAN', 0x0002); define ( 'XCHAN_FLAGS_CENSORED', 0x0004); define ( 'XCHAN_FLAGS_SELFCENSORED', 0x0008); define ( 'XCHAN_FLAGS_SYSTEM', 0x0010); +define ( 'XCHAN_FLAGS_PUBFORUM', 0x0020); define ( 'XCHAN_FLAGS_DELETED', 0x1000); /* * Traficlights for Administration of HubLoc diff --git a/include/zot.php b/include/zot.php index bdc1f607f..2954408b9 100644 --- a/include/zot.php +++ b/include/zot.php @@ -699,10 +699,10 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) { $dirmode = get_config('system','directory_mode'); - if((($arr['site']['directory_mode'] === 'standalone') || ($dirmode & DIRECTORY_MODE_STANDALONE)) -&& ($arr['site']['url'] != z_root())) + if((($arr['site']['directory_mode'] === 'standalone') || ($dirmode & DIRECTORY_MODE_STANDALONE)) && ($arr['site']['url'] != z_root())) $arr['searchable'] = false; + $hidden = (1 - intval($arr['searchable'])); // Be careful - XCHAN_FLAGS_HIDDEN should evaluate to 1 @@ -721,6 +721,11 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) { if($deleted_changed) $new_flags = $new_flags ^ XCHAN_FLAGS_DELETED; + $public_forum = (($r[0]['xchan_flags'] & XCHAN_FLAGS_PUBFORUM) ? true : false); + $pubforum_changed = ((intval($public_forum) != intval($arr['public_forum'])) ? true : false); + if($pubforum_changed) + $new_flags = $r[0]['xchan_flags'] ^ XCHAN_FLAGS_PUBFORUM; + if(($r[0]['xchan_name_date'] != $arr['name_updated']) || ($r[0]['xchan_connurl'] != $arr['connections_url']) || ($r[0]['xchan_flags'] != $new_flags) diff --git a/mod/directory.php b/mod/directory.php index 09ff2ae09..10e90b145 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -203,6 +203,7 @@ function directory_content(&$a) { $entry = array( 'id' => ++$t, 'profile_link' => $profile_link, + 'public_forum' => $rr['public_forum'], 'photo' => $rr['photo'], 'hash' => $rr['hash'], 'alttext' => $rr['name'] . ' ' . $rr['address'], @@ -210,6 +211,7 @@ function directory_content(&$a) { 'details' => $pdesc . $details, 'profile' => $profile, 'address' => $rr['address'], + 'nickname' => substr($rr['address'],0,strpos($rr['address'],'@')), 'location' => $location, 'gender' => $gender, 'pdesc' => $pdesc, @@ -219,6 +221,7 @@ function directory_content(&$a) { 'hometown' => $hometown, 'about' => $about, 'conn_label' => t('Connect'), + 'forum_label' => t('Public Forum:'), 'connect' => $connect_link, 'online' => $online, 'kw' => (($out) ? t('Keywords: ') : ''), diff --git a/mod/dirsearch.php b/mod/dirsearch.php index d8f611e6a..516b5cc73 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -226,6 +226,8 @@ function dirsearch_content(&$a) { $entry['name'] = $rr['xchan_name']; $entry['hash'] = $rr['xchan_hash']; + $entry['public_forum'] = (($rr['xchan_flags'] & XCHAN_FLAGS_PUBFORUM) ? true : false); + $entry['url'] = $rr['xchan_url']; $entry['photo_l'] = $rr['xchan_photo_l']; $entry['photo'] = $rr['xchan_photo_m']; diff --git a/mod/ping.php b/mod/ping.php index 98584cb14..e52c162ec 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -222,7 +222,7 @@ function ping_init(&$a) { 'url' => $zz['url'], 'photo' => $zz['photo'], 'when' => relative_date($zz['date']), - 'class' => (($zz['seen']) ? 'notify-seen' : 'notify-unseen'), + 'hclass' => (($zz['seen']) ? 'notify-seen' : 'notify-unseen'), 'message' => strip_tags(bbcode($zz['msg'])) ); } @@ -251,7 +251,7 @@ function ping_init(&$a) { 'url' => $zz['xchan_url'], 'photo' => $zz['xchan_photo_s'], 'when' => relative_date($zz['created']), - 'class' => (($zz['mail_flags'] & MAIL_SEEN) ? 'notify-seen' : 'notify-unseen'), + 'hclass' => (($zz['mail_flags'] & MAIL_SEEN) ? 'notify-seen' : 'notify-unseen'), 'message' => t('sent you a private message'), ); } @@ -302,7 +302,7 @@ function ping_init(&$a) { 'url' => $rr['xchan_url'], 'photo' => $rr['xchan_photo_s'], 'when' => relative_date($rr['abook_created']), - 'class' => ('notify-unseen'), + 'hclass' => ('notify-unseen'), 'message' => t('added your channel') ); } @@ -343,7 +343,7 @@ function ping_init(&$a) { 'url' => $rr['xchan_url'], 'photo' => $rr['xchan_photo_s'], 'when' => $when, - 'class' => ('notify-unseen'), + 'hclass' => ('notify-unseen'), 'message' => t('posted an event') ); } diff --git a/mod/zfinger.php b/mod/zfinger.php index 666f141ec..c2aebc675 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -108,6 +108,21 @@ function zfinger_init(&$a) { if($deleted || $censored) $searchable = false; + $public_forum = false; + + $role = get_pconfig($e['channel_id'],'system','permissions_role'); + if($role === 'forum') { + $public_forum = true; + } + else { + // check if it has characteristics of a public forum based on custom permissions. + $t = q("select abook_my_perms from abook where abook_channel = %d and (abook_flags & %d) limit 1", + intval($e['channel_id']), + intval(ABOOK_FLAG_SELF) + ); + if($t && ($t[0]['abook_my_perms'] & PERMS_W_TAGWALL)) + $public_forum = true; + } // This is for birthdays and keywords, but must check access permissions @@ -174,6 +189,7 @@ function zfinger_init(&$a) { $ret['target_sig'] = $zsig; $ret['searchable'] = $searchable; $ret['adult_content'] = $adult_channel; + $ret['public_forum'] = $public_forum; if($deleted) $ret['deleted'] = $deleted; diff --git a/version.inc b/version.inc index 2859cdc11..7bd986426 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2014-11-09.854 +2014-11-10.855 diff --git a/view/js/main.js b/view/js/main.js index beedb7f01..a55b8fbb1 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -749,7 +749,7 @@ function updateConvItems(mode,data) { $("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark); $(data.notify).each(function() { - html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.class); + html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass); $("#nav-" + notifyType + "-menu").append(html); }); $(".dropdown-menu img[data-src]").each(function(i, el){ diff --git a/view/tpl/direntry.tpl b/view/tpl/direntry.tpl index 691905ecd..879a168c9 100755 --- a/view/tpl/direntry.tpl +++ b/view/tpl/direntry.tpl @@ -12,6 +12,12 @@ <div class='contact-info'> <div class="contact-name" id="directory-name-{{$entry.id}}" ><a href='{{$entry.profile_link}}' >{{$entry.name}}</a>{{if $entry.online}} <i class="icon-asterisk online-now" title="{{$entry.online}}"></i>{{/if}}</div> +{{if $entry.public_forum}} +<div class="contact-forum"> +{{$entry.forum_label}} @{{$entry.nickname}}+ +</div> +{{/if}} + <div class="contact-details">{{$entry.details}}</div> {{if $entry.hometown}} <div class="directory-hometown">{{$entry.hometown}} </div> |