This commit is contained in:
zotlabs 2018-07-18 18:51:01 -07:00
parent 91ac38f18e
commit a757749be6
4 changed files with 126 additions and 83 deletions

View file

@ -1 +1,45 @@
This is ZAP, a Zot6 test/development server. Use at your own risk.
* ZAP
Zap is a social networking app running under the Zot/6 protocol and the LAMP web stack.
It is based on Red, which in turn is based on Hubzilla. It is otherwise unrelated to those projects and the software has a completely different scope and purpose.
19-July-2018
============
There is a lot more work yet to be done, but the basic Zap application is nearing alpha quality.
TODO before alpha release:
* convert mail to ActivityStreams
* test nomadic channels
* correct any links in the documentation and remove the descriptions of Hubzilla features which do not exist in Zap
*** Things you should know
Zap is nomadic and does not federate with any other platform or protocol currently. It will only **ever** federate with nomadic-aware services/protocols. Full stop.
If you are looking for a specific Hubzilla feature, you came to the wrong place.
If you are looking for ActivityPub support, you came to the wrong place.
If you are looking for stable software, check back in a few months.
If you encounter issues, fix them and submit a pull request.
Pull requests which add unnecessary features will be ignored. These should be implemented using apps and/or addons.
The database configuration is not yet "stable". You probably do not want to install this as a production service at this time, and please do not use this software for storing any critical information which is not backed up elsewhere.

View file

@ -5,7 +5,7 @@ use Zotlabs\Lib\Libsync;
require_once('include/security.php');
require_once('include/bbcode.php');
require_once('include/event.php');
class Like extends \Zotlabs\Web\Controller {
@ -359,7 +359,7 @@ class Like extends \Zotlabs\Web\Controller {
$bodyverb = t('%1$s likes %2$s\'s %3$s');
if($verb === 'dislike')
$bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s');
if($verb === 'attendyes')
if($verb === 'attendyes')
$bodyverb = t('%1$s is attending %2$s\'s %3$s');
if($verb === 'attendno')
$bodyverb = t('%1$s is not attending %2$s\'s %3$s');
@ -368,9 +368,12 @@ class Like extends \Zotlabs\Web\Controller {
if(! isset($bodyverb))
killme();
// @FIXME Not sure if this is still needed
// if(local_channel() && $verb === 'attendyes') {
// event_addtocal($item['id'],$ch[0]['channel_id']);
// }
if($extended_like) {
$ulink = '[zrl=' . $ch[0]['xchan_url'] . ']' . $ch[0]['xchan_name'] . '[/zrl]';
$alink = '[zrl=' . $observer['xchan_url'] . ']' . $observer['xchan_name'] . '[/zrl]';

View file

@ -23,7 +23,7 @@ class Activity_filter {
$tabs[] = [
'label' => t('Personal Posts'),
'icon' => 'user-circle',
'url' => z_root() . '/' . $cmd . '/?f=&conv=1',
'url' => z_root() . '/' . $cmd . '/?conv=1',
'sel' => $conv_active,
'title' => t('Show posts that mention or involve me')
];
@ -38,76 +38,72 @@ class Activity_filter {
$tabs[] = [
'label' => t('Starred Posts'),
'icon' => 'star',
'url'=>z_root() . '/' . $cmd . '/?f=&star=1',
'url'=>z_root() . '/' . $cmd . '/?star=1',
'sel'=>$starred_active,
'title' => t('Show posts that I have starred')
];
}
if(feature_enabled(local_channel(),'groups')) {
$groups = q("SELECT * FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
intval(local_channel())
);
if($groups) {
foreach($groups as $g) {
if(x($_GET,'gid')) {
$group_active = (($_GET['gid'] == $g['id']) ? 'active' : '');
$filter_active = 'group';
}
$gsub[] = [
'label' => $g['gname'],
'icon' => '',
'url' => z_root() . '/' . $cmd . '/?f=&gid=' . $g['id'],
'sel' => $group_active,
'title' => sprintf(t('Show posts related to the %s privacy group'), $g['gname'])
];
$groups = q("SELECT * FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
intval(local_channel())
);
if($groups) {
foreach($groups as $g) {
if(x($_GET,'gid')) {
$group_active = (($_GET['gid'] == $g['id']) ? 'active' : '');
$filter_active = 'group';
}
$tabs[] = [
'id' => 'privacy_groups',
'label' => t('Privacy Groups'),
'icon' => 'users',
'url' => '#',
'sel' => (($filter_active == 'group') ? true : false),
'title' => t('Show my privacy groups'),
'sub' => $gsub
$gsub[] = [
'label' => $g['gname'],
'icon' => '',
'url' => z_root() . '/' . $cmd . '/?f=&gid=' . $g['id'],
'sel' => $group_active,
'title' => sprintf(t('Show posts related to the %s privacy group'), $g['gname'])
];
}
$tabs[] = [
'id' => 'privacy_groups',
'label' => t('Privacy Groups'),
'icon' => 'users',
'url' => '#',
'sel' => (($filter_active == 'group') ? true : false),
'title' => t('Show my privacy groups'),
'sub' => $gsub
];
}
if(feature_enabled(local_channel(),'forums_tab')) {
$forums = get_forum_channels(local_channel());
$forums = get_forum_channels(local_channel());
if($forums) {
foreach($forums as $f) {
if(x($_GET,'pf') && x($_GET,'cid')) {
$forum_active = ((x($_GET,'pf') && $_GET['cid'] == $f['abook_id']) ? 'active' : '');
$filter_active = 'forums';
}
$fsub[] = [
'label' => $f['xchan_name'],
'img' => $f['xchan_photo_s'],
'url' => (($f['private_forum']) ? $f['xchan_url'] : z_root() . '/' . $cmd . '/?f=&pf=1&cid=' . $f['abook_id']),
'sel' => $forum_active,
'title' => t('Show posts to this forum'),
'lock' => (($f['private_forum']) ? 'lock' : '')
];
if($forums) {
foreach($forums as $f) {
if(x($_GET,'pf') && x($_GET,'cid')) {
$forum_active = ((x($_GET,'pf') && $_GET['cid'] == $f['abook_id']) ? 'active' : '');
$filter_active = 'forums';
}
$tabs[] = [
'id' => 'forums',
'label' => t('Forums'),
'icon' => 'comments-o',
'url' => '#',
'sel' => (($filter_active == 'forums') ? true : false),
'title' => t('Show forums'),
'sub' => $fsub
$fsub[] = [
'label' => $f['xchan_name'],
'img' => $f['xchan_photo_s'],
'url' => (($f['private_forum']) ? $f['xchan_url'] : z_root() . '/' . $cmd . '/?f=&pf=1&cid=' . $f['abook_id']),
'sel' => $forum_active,
'title' => t('Show posts to this forum'),
'lock' => (($f['private_forum']) ? 'lock' : '')
];
}
$tabs[] = [
'id' => 'forums',
'label' => t('Forums'),
'icon' => 'comments-o',
'url' => '#',
'sel' => (($filter_active == 'forums') ? true : false),
'title' => t('Show forums'),
'sub' => $fsub
];
}
if(feature_enabled(local_channel(),'filing')) {
$terms = q("select distinct term from term where uid = %d and ttype = %d order by term asc",
intval(local_channel()),
@ -142,30 +138,30 @@ class Activity_filter {
}
}
if(x($_GET,'search')) {
$filter_active = 'search';
$tabs[] = [
'label' => t('Search'),
'icon' => 'search',
'url' => z_root() . '/' . $cmd . '/?f=&search=' . $_GET['search'],
'sel' => 'active disabled',
'title' => t('Panel search')
];
}
// if(x($_GET,'search')) {
// $filter_active = 'search';
// $tabs[] = [
// 'label' => t('Search'),
// 'icon' => 'search',
// 'url' => z_root() . '/' . $cmd . '/?search=' . $_GET['search'],
// 'sel' => 'active disabled',
// 'title' => t('Panel search')
// ];
// }
$name = [];
if(feature_enabled(local_channel(),'name_tab')) {
if(x($_GET,'cid') && ! x($_GET,'pf')) {
$filter_active = 'name';
}
$name = [
'label' => x($_GET,'name') ? $_GET['name'] : t('Filter by name'),
'icon' => 'filter',
'url'=> z_root() . '/' . $cmd . '/',
'sel'=> $filter_active == 'name' ? 'is-valid' : '',
'title' => ''
];
}
// $name = [];
// if(feature_enabled(local_channel(),'name_tab')) {
// if(x($_GET,'cid') && ! x($_GET,'pf')) {
// $filter_active = 'name';
// }
// $name = [
// 'label' => x($_GET,'name') ? $_GET['name'] : t('Filter by name'),
// 'icon' => 'filter',
// 'url'=> z_root() . '/' . $cmd . '/',
// 'sel'=> $filter_active == 'name' ? 'is-valid' : '',
// 'title' => ''
// ];
// }
$reset = [];
if($filter_active) {

View file

@ -187,7 +187,7 @@ function string2bb(element) {
match: /(^|\s)(\#)([^ \n]{2,})$/,
index: 3,
cache: true,
search: function(term, callback) { $.getJSON('/hashtags/' + '$f=&t=' + term).done(function(data) { callback($.map(data, function(entry) { return entry.text.toLowerCase().indexOf(term.toLowerCase()) === 0 ? entry : null; })); }); },
search: function(term, callback) { $.getJSON('/hashtags/' + '?f=&t=' + term).done(function(data) { callback($.map(data, function(entry) { return entry.text.toLowerCase().indexOf(term.toLowerCase()) === 0 ? entry : null; })); }); },
replace: function(item) { return "$1$2" + item.text + ' '; },
context: function(text) { return text.toLowerCase(); },
template: tag_format