aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Lib/Apps.php14
-rw-r--r--Zotlabs/Module/File_upload.php2
-rw-r--r--Zotlabs/Module/Network.php2
-rw-r--r--Zotlabs/Module/Ping.php7
-rw-r--r--app/pubstream.apd6
-rw-r--r--include/attach.php14
-rw-r--r--view/tpl/cloud_actionspanel.tpl2
-rwxr-xr-xview/tpl/photo_album.tpl5
-rwxr-xr-xview/tpl/photos_recent.tpl5
9 files changed, 41 insertions, 16 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index 68587df49..7287bdd52 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -169,6 +169,7 @@ class Apps {
$requires = explode(',',$ret['requires']);
foreach($requires as $require) {
$require = trim(strtolower($require));
+ $toggle = (($require[0] == '!') ? 0 : 1);
switch($require) {
case 'nologin':
if(local_channel())
@@ -191,10 +192,12 @@ class Apps {
unset($ret);
break;
default:
- if(! (local_channel() && feature_enabled(local_channel(),$require)))
+ $unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true);
+ $unset = ((get_config('system', ltrim($require, '!')) == $toggle) ? false : true);
+
+ if($unset)
unset($ret);
break;
-
}
}
}
@@ -307,6 +310,7 @@ class Apps {
$requires = explode(',',$v);
foreach($requires as $require) {
$require = trim(strtolower($require));
+ $toggle = (($require[0] == '!') ? 0 : 1);
switch($require) {
case 'nologin':
if(local_channel())
@@ -330,10 +334,12 @@ class Apps {
return '';
break;
default:
- if(! (local_channel() && feature_enabled(local_channel(),$require)))
+ $unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true);
+ $unset = ((get_config('system', ltrim($require, '!')) == $toggle) ? false : true);
+
+ if($unset)
return '';
break;
-
}
}
}
diff --git a/Zotlabs/Module/File_upload.php b/Zotlabs/Module/File_upload.php
index f036d3f43..bce81ad7a 100644
--- a/Zotlabs/Module/File_upload.php
+++ b/Zotlabs/Module/File_upload.php
@@ -35,6 +35,8 @@ class File_upload extends \Zotlabs\Web\Controller {
if($_REQUEST['filename']) {
$r = attach_mkdir($channel, get_observer_hash(), $_REQUEST);
+ if($r['success'])
+ goaway(z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['data']['display_path']);
}
else {
$r = attach_store($channel, get_observer_hash(), '', $_REQUEST);
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index d689efd14..597ba084b 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -534,7 +534,7 @@ class Network extends \Zotlabs\Web\Controller {
if($parents_str) {
$update_unseen = " AND ( id IN ( " . dbesc($parents_str) . " )";
- $update_unseen .= " AND obj_type != " . dbesc(ACTIVITY_OBJ_FILE) . "";
+ $update_unseen .= " AND obj_type != '" . dbesc(ACTIVITY_OBJ_FILE) . "'";
$update_unseen .= " OR ( parent IN ( " . dbesc($parents_str) . " ) AND verb in ( '" . dbesc(ACTIVITY_LIKE) . "','" . dbesc(ACTIVITY_DISLIKE) . "' ))) ";
}
}
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php
index bf926075c..190208727 100644
--- a/Zotlabs/Module/Ping.php
+++ b/Zotlabs/Module/Ping.php
@@ -291,9 +291,12 @@ class Ping extends \Zotlabs\Web\Controller {
$r = q("SELECT * FROM item
WHERE item_unseen = 1 and uid = %d $item_normal
- and author_xchan != '%s' ORDER BY created DESC limit 300",
+ AND author_xchan != '%s'
+ AND obj_type != '%s'
+ ORDER BY created DESC limit 300",
intval(local_channel()),
- dbesc($ob_hash)
+ dbesc($ob_hash),
+ dbesc(ACTIVITY_OBJ_FILE)
);
if($r) {
diff --git a/app/pubstream.apd b/app/pubstream.apd
new file mode 100644
index 000000000..065be24bc
--- /dev/null
+++ b/app/pubstream.apd
@@ -0,0 +1,6 @@
+version: 1
+url: $baseurl/pubstream
+requires: !disable_discover_tab
+name: Public Stream
+photo: icon:globe
+categories: Social
diff --git a/include/attach.php b/include/attach.php
index 4d20f094c..75235d7e1 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -611,7 +611,8 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
// A freshly uploaded file. Check for duplicate and resolve with the channel's overwrite settings.
- $r = q("select filename, id, hash, filesize from attach where filename = '%s' and folder = '%s' ",
+ $r = q("select filename, id, hash, filesize from attach where uid = %d and filename = '%s' and folder = '%s' ",
+ intval($channel_id),
dbesc($filename),
dbesc($folder_hash)
);
@@ -633,7 +634,8 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
$ext = $def_extension;
}
- $r = q("select filename from attach where ( filename = '%s' OR filename like '%s' ) and folder = '%s' ",
+ $r = q("select filename from attach where uid = %d and ( filename = '%s' OR filename like '%s' ) and folder = '%s' ",
+ intval($channel_id),
dbesc($basename . $ext),
dbesc($basename . '(%)' . $ext),
dbesc($folder_hash)
@@ -708,7 +710,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
$os_relpath = ltrim($os_relpath,'/');
$os_path = $os_relpath;
- $display_path = $pathname . '/' . $filename;
+ $display_path = ltrim($pathname . '/' . $filename,'/');
if($src)
@file_put_contents($os_basepath . $os_relpath,@file_get_contents($src));
@@ -886,9 +888,9 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
}
if($notify) {
- $cloudPath = z_root() . '/cloud/' . $channel['channel_address'] . $r['0']['display_path'];
- $object = get_file_activity_object($channel['channel_id'], $r['0']['hash'], $cloudPath);
- file_activity($channel['channel_id'], $object, $r['0']['allow_cid'], $r['0']['allow_gid'], $r['0']['deny_cid'], $r['0']['deny_gid'], 'post', $notify);
+ //$cloudPath = z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['0']['display_path'];
+ //$object = get_file_activity_object($channel['channel_id'], $r['0']['hash'], $cloudPath);
+ //file_activity($channel['channel_id'], $object, $r['0']['allow_cid'], $r['0']['allow_gid'], $r['0']['deny_cid'], $r['0']['deny_gid'], 'post', $notify);
}
return $ret;
diff --git a/view/tpl/cloud_actionspanel.tpl b/view/tpl/cloud_actionspanel.tpl
index fc3e7f82f..baee48da3 100644
--- a/view/tpl/cloud_actionspanel.tpl
+++ b/view/tpl/cloud_actionspanel.tpl
@@ -26,7 +26,7 @@
<input type="hidden" name="return_url" value="{{$return_url}}" />
<label for="files-upload">{{$upload_header}}</label>
<input class="form-group pull-left" id="files-upload" type="file" name="userfile">
- {{include file="field_checkbox.tpl" field=$notify}}
+ {{**include file="field_checkbox.tpl" field=$notify**}}
<div class="pull-right btn-group">
<div class="btn-group">
{{if $lockstate}}
diff --git a/view/tpl/photo_album.tpl b/view/tpl/photo_album.tpl
index 8bacb1575..89b169f58 100755
--- a/view/tpl/photo_album.tpl
+++ b/view/tpl/photo_album.tpl
@@ -28,5 +28,8 @@
</div>
</div>
<div class="photos-end"></div>
-<script>$(document).ready(function() { loadingPage = false; justifyPhotos('photo-album-contents-{{$album_id}}'); });</script>
+<script>
+ loadingPage = false;
+ justifyPhotos('photo-album-contents-{{$album_id}}');
+</script>
<div id="page-spinner"></div>
diff --git a/view/tpl/photos_recent.tpl b/view/tpl/photos_recent.tpl
index 8fe631ca6..c6a9067c1 100755
--- a/view/tpl/photos_recent.tpl
+++ b/view/tpl/photos_recent.tpl
@@ -19,5 +19,8 @@
</div>
</div>
<div class="photos-end"></div>
-<script>$(document).ready(function() { loadingPage = false; justifyPhotos('photo-album-contents-{{$album_id}}'); });</script>
+<script>
+ loadingPage = false;
+ justifyPhotos('photo-album-contents-{{$album_id}}');
+</script>
<div id="page-spinner"></div>