network -> stream

This commit is contained in:
zotlabs 2020-02-12 21:36:21 -08:00
parent da46f493a4
commit 04ae664c92
24 changed files with 77 additions and 54 deletions

View file

@ -49,7 +49,7 @@ class ThreadStream {
$ob_hash = (($this->observer) ? $this->observer['xchan_hash'] : '');
switch($mode) {
case 'network':
case 'stream':
$this->profile_owner = local_channel();
$this->writable = true;
break;

View file

@ -34,7 +34,7 @@ class Affinity extends \Zotlabs\Web\Controller {
function get() {
$desc = t('This app (when installed) presents a slider control in your connection editor and also on your network page. The slider represents your degree of friendship with each connection. It allows you to zoom in or out and display conversations from only your closest friends or everybody in your stream.');
$desc = t('This app (when installed) presents a slider control in your connection editor and also on your stream page. The slider represents your degree of friendship with each connection. It allows you to zoom in or out and display conversations from only your closest friends or everybody in your stream.');
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
@ -42,7 +42,7 @@ class Affinity extends \Zotlabs\Web\Controller {
return $text;
}
$text .= EOL . t('The number below represents the default maximum slider position for your network/stream page as a percentage.') . EOL . EOL;
$text .= EOL . t('The number below represents the default maximum slider position for your stream page as a percentage.') . EOL . EOL;
$setting_fields = $text;

View file

@ -555,7 +555,7 @@ class Connedit extends Controller {
'recent' => array(
'label' => t('Recent Activity'),
'url' => z_root() . '/network/?f=&cid=' . $contact['abook_id'],
'url' => z_root() . '/stream/?f=&cid=' . $contact['abook_id'],
'sel' => '',
'title' => t('View recent posts and comments'),
),

View file

@ -41,7 +41,7 @@ class Home extends Controller {
$dest = get_config('system','startpage');
}
if (! $dest) {
$dest = z_root() . '/network';
$dest = z_root() . '/stream';
}
goaway($dest);
}

View file

@ -533,7 +533,7 @@ class Import extends Controller {
change_channel($channel['channel_id']);
goaway(z_root() . '/network' );
goaway(z_root() . '/stream' );
}
/**

View file

@ -50,7 +50,7 @@ class Notes extends Controller {
return $text;
}
$desc = t('This app is installed. The Notes tool can be found on your network stream page.');
$desc = t('This app is installed. The Notes tool can be found on your stream page.');
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';

View file

@ -33,7 +33,7 @@ class Ping extends Controller {
$result['notify'] = 0;
$result['home'] = 0;
$result['network'] = 0;
$result['stream'] = 0;
$result['intros'] = 0;
$result['mail'] = 0;
$result['register'] = 0;
@ -234,7 +234,7 @@ class Ping extends Controller {
// mark all items read
if (x($_REQUEST, 'markRead') && local_channel()) {
switch ($_REQUEST['markRead']) {
case 'network':
case 'stream':
$r = q("UPDATE item SET item_unseen = 0 WHERE uid = %d AND item_unseen = 1",
intval(local_channel())
);
@ -356,7 +356,7 @@ class Ping extends Controller {
}
if (argc() > 1 && (argv(1) === 'network' || argv(1) === 'home')) {
if (argc() > 1 && (argv(1) === 'stream' || argv(1) === 'home')) {
$local_result = array();
$item_normal_moderate = $item_normal;
@ -588,13 +588,13 @@ class Ping extends Controller {
$result['home'] ++;
}
else {
$result['network'] ++;
$result['stream'] ++;
}
}
}
}
if (! ($vnotify & VNOTIFY_NETWORK))
$result['network'] = 0;
$result['stream'] = 0;
if (! ($vnotify & VNOTIFY_CHANNEL))
$result['home'] = 0;
@ -708,7 +708,7 @@ class Ping extends Controller {
dbesc($forums[$x]['xchan_hash'])
);
if ($r[0]['unseen']) {
$forums[$x]['notify_link'] = (($forums[$x]['private_forum']) ? $forums[$x]['xchan_url'] : z_root() . '/network/?f=&pf=1&cid=' . $forums[$x]['abook_id']);
$forums[$x]['notify_link'] = (($forums[$x]['private_forum']) ? $forums[$x]['xchan_url'] : z_root() . '/stream/?f=&pf=1&cid=' . $forums[$x]['abook_id']);
$forums[$x]['name'] = $forums[$x]['xchan_name'];
$forums[$x]['addr'] = $forums[$x]['xchan_addr'];
$forums[$x]['url'] = $forums[$x]['xchan_url'];

View file

@ -93,7 +93,7 @@ class Rpost extends Controller {
if(argc() > 1 && argv(1) === 'return') {
if($_SESSION['remote_return'])
goaway($_SESSION['remote_return']);
goaway(z_root() . '/network');
goaway(z_root() . '/stream');
}
$plaintext = true;

View file

@ -32,9 +32,9 @@ class Display {
$channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400);
if($channel_divmore_height < 50)
$channel_divmore_height = 50;
$network_divmore_height = ((x($_POST,'network_divmore_height')) ? intval($_POST['network_divmore_height']) : 400);
if($network_divmore_height < 50)
$network_divmore_height = 50;
$stream_divmore_height = ((x($_POST,'stream_divmore_height')) ? intval($_POST['stream_divmore_height']) : 400);
if($stream_divmore_height < 50)
$stream_divmore_height = 50;
$browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0);
$browser_update = $browser_update * 1000;
@ -52,7 +52,7 @@ class Display {
set_pconfig(local_channel(),'system','itemspage', $itemspage);
set_pconfig(local_channel(),'system','no_smilies',1-intval($nosmile));
set_pconfig(local_channel(),'system','channel_divmore_height', $channel_divmore_height);
set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height);
set_pconfig(local_channel(),'system','stream_divmore_height', $stream_divmore_height);
set_pconfig(local_channel(),'system','channel_menu', $channel_menu);
$newschema = '';
@ -197,7 +197,7 @@ class Display {
'$theme_config' => $theme_config,
'$expert' => feature_enabled(local_channel(),'advanced_theming'),
'$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400), t('click to expand content exceeding this height')),
'$network_divmore_height' => array('network_divmore_height', t('Network page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400) , t('click to expand content exceeding this height')),
'$stream_divmore_height' => array('stream_divmore_height', t('Stream page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','stream_divmore_height')) ? get_pconfig(local_channel(),'system','stream_divmore_height') : 400) , t('click to expand content exceeding this height')),
));

View file

@ -11,7 +11,7 @@ require_once('include/conversation.php');
require_once('include/acl_selectors.php');
class Network extends Controller {
class Stream extends Controller {
function init() {
if (! local_channel()) {
@ -44,7 +44,7 @@ class Network extends Controller {
}
$arr = [ 'query' => App::$query_string ];
call_hooks('network_content_init', $arr);
call_hooks('stream_content_init', $arr);
$channel = App::$data;
@ -66,7 +66,7 @@ class Network extends Controller {
$verb = ((x($_REQUEST,'verb')) ? $_REQUEST['verb'] : '');
$dm = ((x($_REQUEST,'dm')) ? $_REQUEST['dm'] : 0);
$order = get_pconfig(local_channel(), 'mod_network', 'order', 0);
$order = get_pconfig(local_channel(), 'mod_stream', 'order', 0);
switch ($order) {
case 0:
$order = 'comment';
@ -114,7 +114,7 @@ class Network extends Controller {
killme();
}
notice( t('No such group') . EOL );
goaway(z_root() . '/network');
goaway(z_root() . '/stream');
}
$group = $gid;
@ -155,7 +155,7 @@ class Network extends Controller {
killme();
}
notice( t('No such channel') . EOL );
goaway(z_root() . '/network');
goaway(z_root() . '/stream');
}
$def_acl = [ 'allow_cid' => '<' . $cid_r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
@ -296,7 +296,7 @@ class Network extends Controller {
}
else {
notice( t('Invalid channel.') . EOL);
goaway(z_root() . '/network');
goaway(z_root() . '/stream');
}
}
@ -313,19 +313,19 @@ class Network extends Controller {
// We only launch liveUpdate if you aren't filtering in some incompatible
// way and also you aren't writing a comment (discovered in javascript).
$maxheight = get_pconfig(local_channel(),'system','network_divmore_height');
$maxheight = get_pconfig(local_channel(),'system','stream_divmore_height');
if(! $maxheight)
$maxheight = 400;
$o .= '<div id="live-network"></div>' . "\r\n";
$o .= '<div id="live-stream"></div>' . "\r\n";
$o .= "<script> var profile_uid = " . local_channel()
. "; var profile_page = " . App::$pager['page']
. "; divmore_height = " . intval($maxheight) . "; </script>\r\n";
App::$page['htmlhead'] .= replace_macros(get_markup_template('build_query.tpl'), [
'$baseurl' => z_root(),
'$pgtype' => 'network',
'$pgtype' => 'stream',
'$uid' => ((local_channel()) ? local_channel() : '0'),
'$gid' => (($gid) ? $gid : '0'),
'$cid' => (($cid) ? $cid : '0'),
@ -463,7 +463,7 @@ class Network extends Controller {
$abook_uids = " and abook.abook_channel = " . local_channel() . " ";
$uids = " and item.uid = " . local_channel() . " ";
if (get_pconfig(local_channel(),'system','network_list_mode'))
if (get_pconfig(local_channel(),'system','stream_list_mode'))
$page_mode = 'list';
else
$page_mode = 'client';
@ -599,7 +599,7 @@ class Network extends Controller {
}
}
$mode = (($nouveau) ? 'network-new' : 'network');
$mode = (($nouveau) ? 'stream-new' : 'stream');
if ($search) {
$mode = 'search';

23
Zotlabs/Update/_1237.php Normal file
View file

@ -0,0 +1,23 @@
<?php
namespace Zotlabs\Update;
class _1237 {
function run() {
q("update app set app_url = '%s' where app_url = '%s' ",
dbesc(z_root() . '/stream'),
dbesc(z_root() . '/network')
);
q("update app set app_url = '%s' where app_url = '%s' ",
dbesc('$baseurl/stream'),
dbesc('$baseurl/network')
);
return UPDATE_SUCCESS;
}
function verify() {
return true;
}
}

View file

@ -50,7 +50,7 @@ class Activity {
$o .= '<h3>' . t('Activity','widget') . '</h3><ul class="nav nav-pills flex-column">';
foreach($arr as $rv) {
$o .= '<li class="nav-item"><a class="nav-link" href="network?f=&xchan=' . urlencode($rv['author_xchan']) . '" ><span class="badge badge-secondary float-right">' . ((intval($rv['total'])) ? intval($rv['total']) : '') . '</span><img src="' . $rv['author']['xchan_photo_s'] . '" class="menu-img-1" /> ' . $rv['author']['xchan_name'] . '</a></li>';
$o .= '<li class="nav-item"><a class="nav-link" href="stream?f=&xchan=' . urlencode($rv['author_xchan']) . '" ><span class="badge badge-secondary float-right">' . ((intval($rv['total'])) ? intval($rv['total']) : '') . '</span><img src="' . $rv['author']['xchan_photo_s'] . '" class="menu-img-1" /> ' . $rv['author']['xchan_name'] . '</a></li>';
}
$o .= '</ul></div>';
}

View file

@ -80,7 +80,7 @@ class Groups {
/**
* @FIXME
* This SQL makes the counts correct when you get forum posts arriving from different routes/sources
* (like personal channels). However the network query for these posts doesn't yet include this
* (like personal channels). However the stream query for these posts doesn't yet include this
* correction and it makes the SQL for that query pretty hairy so this is left as a future exercise.
* It may make more sense in that query to look for the mention in the body rather than another join,
* but that makes it very inefficient.
@ -104,7 +104,7 @@ class Groups {
foreach($r1 as $rr) {
$link = 'network?f=&pf=1&cid=' . $rr['abook_id'];
$link = 'stream?f=&pf=1&cid=' . $rr['abook_id'];
if($x3) {
foreach($x3 as $xx) {
if($rr['xchan_hash'] == $xx['xchan']) {

View file

@ -43,7 +43,7 @@ class Newmember {
t('Communicate'),
[
'channel/' . $c['channel_address'] => t('View your channel homepage'),
'network' => t('View your network stream'),
'stream' => t('View your stream'),
],
t('Miscellaneous'),

View file

@ -11,13 +11,13 @@ class Notifications {
$channel = App::get_channel();
$notifications[] = [
'type' => 'network',
'type' => 'stream',
'icon' => 'th',
'severity' => 'secondary',
'label' => t('New Stream Activity'),
'title' => t('New Stream Activity Notifications'),
'viewall' => [
'url' => 'network',
'url' => 'stream',
'label' => t('View your stream activity')
],
'markall' => [

View file

@ -37,7 +37,7 @@ class Pinned {
return $ret;
}
$o = conversation($id_list,'network-new',0,'traditional');
$o = conversation($id_list,'stream-new',0,'traditional');
// change some id and class names so that auto-update doesn't stumble over them

View file

@ -51,7 +51,7 @@ require_once('include/items.php');
define ( 'STD_VERSION', '20.02.13' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1236 );
define ( 'DB_UPDATE_VERSION', 1237 );
define ( 'PLATFORM_NAME', 'zap' );
define ( 'PLATFORM_ARCHITECTURE', 'zap' );

View file

@ -464,7 +464,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
$previewing = (($preview) ? ' preview ' : '');
$preview_lbl = t('This is an unsaved preview');
if (in_array($mode, [ 'network', 'pubstream'])) {
if (in_array($mode, [ 'stream', 'pubstream'])) {
$profile_owner = local_channel();
$page_writeable = ((local_channel()) ? true : false);
@ -474,7 +474,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
// We only launch liveUpdate if you aren't filtering in some incompatible
// way and also you aren't writing a comment (discovered in javascript).
$live_update_div = '<div id="live-network"></div>' . "\r\n"
$live_update_div = '<div id="live-stream"></div>' . "\r\n"
. "<script> var profile_uid = " . $_SESSION['uid']
. "; var netargs = '" . substr(App::$cmd,8)
. '?f='
@ -614,9 +614,9 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
if($items) {
if(in_array($mode, [ 'network-new', 'search', 'community', 'moderate' ])) {
if(in_array($mode, [ 'stream-new', 'search', 'community', 'moderate' ])) {
// "New Item View" on network page or search page results
// "New Item View" on stream page or search page results
// - just loop through the items and format them minimally for display
$tpl = 'search_item.tpl';
@ -667,7 +667,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
$location = format_location($item);
localize_item($item);
if($mode === 'network-new')
if($mode === 'stream-new')
$dropping = true;
else
$dropping = false;
@ -929,7 +929,7 @@ function thread_action_menu($item,$mode = '') {
'href' => '#'
];
if(! in_array($mode, [ 'network-new', 'search', 'community'])) {
if(! in_array($mode, [ 'stream-new', 'search', 'community'])) {
if($item['parent'] == $item['id'] && (get_observer_hash() != $item['author_xchan'])) {
$menu[] = [
'menu' => 'follow_thread',
@ -1006,7 +1006,7 @@ function thread_author_menu($item, $mode = '') {
$poke_link = z_root() . '/poke/?f=&c=' . $contact['abook_id'];
if (! intval($contact['abook_self']))
$contact_url = z_root() . '/connedit/' . $contact['abook_id'];
$posts_link = z_root() . '/network/?cid=' . $contact['abook_id'];
$posts_link = z_root() . '/stream/?cid=' . $contact['abook_id'];
$clean_url = normalise_link($item['author-link']);
}

View file

@ -3302,14 +3302,14 @@ function item_expire($uid,$days,$comment_days = 7) {
if(! $comment_days)
$comment_days = 7;
// $expire_network_only = save your own wall posts
// $expire_stream_only = save your own wall posts
// and just expire conversations started by others
// do not enable this until we can pass bulk delete messages through zot
// $expire_network_only = get_pconfig($uid,'expire','network_only');
// $expire_stream_only = get_pconfig($uid,'expire','stream_only');
$expire_network_only = 1;
$expire_stream_only = 1;
$sql_extra = ((intval($expire_network_only)) ? " AND item_wall = 0 " : "");
$sql_extra = ((intval($expire_stream_only)) ? " AND item_wall = 0 " : "");
$expire_limit = get_config('system','expire_limit');
if(! intval($expire_limit))
@ -3929,7 +3929,7 @@ function zot_feed($uid, $observer_hash, $arr) {
function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = CLIENT_MODE_NORMAL,$module = 'network') {
function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = CLIENT_MODE_NORMAL,$module = 'stream') {
$result = array('success' => false);
@ -4064,7 +4064,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
if (array_key_exists('cmin',$arr) || array_key_exists('cmax',$arr)) {
if (($arr['cmin'] != 0) || ($arr['cmax'] != 99)) {
// Not everybody who shows up in the network stream will be in your address book.
// Not everybody who shows up in the stream will be in your address book.
// By default those that aren't are assumed to have closeness = 99; but this isn't
// recorded anywhere. So if cmax is 99, we'll open the search up to anybody in
// the stream with a NULL address book entry.

View file

@ -577,7 +577,7 @@ function notificationsUpdate(cached_data) {
}
function handleNotifications(data) {
if(data.network || data.home || data.intros || data.register || data.mail || data.all_events || data.notify || data.files || data.pubs || data.forums) {
if(data.stream || data.home || data.intros || data.register || data.mail || data.all_events || data.notify || data.files || data.pubs || data.forums) {
$('.notifications-btn').css('opacity', 1);
$('#no_notifications').hide();
}
@ -931,7 +931,7 @@ function collapseHeight() {
function updateInit() {
if($('#live-network').length) { src = 'network'; }
if($('#live-stream').length) { src = 'stream'; }
if($('#live-channel').length) { src = 'channel'; }
if($('#live-pubstream').length) { src = 'pubstream'; }
if($('#live-display').length) { src = 'display'; }

View file

@ -59,7 +59,7 @@
{{include file="field_input.tpl" field=$ajaxint}}
{{include file="field_input.tpl" field=$itemspage}}
{{include file="field_input.tpl" field=$channel_divmore_height}}
{{include file="field_input.tpl" field=$network_divmore_height}}
{{include file="field_input.tpl" field=$stream_divmore_height}}
{{include file="field_checkbox.tpl" field=$nosmile}}
{{include file="field_checkbox.tpl" field=$channel_menu}}
{{include file="field_checkbox.tpl" field=$user_scalable}}