aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-12-30 15:25:06 -0800
committerfriendica <info@friendica.com>2014-12-30 15:25:06 -0800
commitabd345f80f5074d325fd137e48a23925eaa66802 (patch)
treec5a469a001b2eb9ae5482b93b557a42e3181208f /mod
parent2f650b74d35335815c48537cd03c81cc92a3c4f8 (diff)
parentae9d08267c632cae36a4ebd34c2077fd0051e0e7 (diff)
downloadvolse-hubzilla-abd345f80f5074d325fd137e48a23925eaa66802.tar.gz
volse-hubzilla-abd345f80f5074d325fd137e48a23925eaa66802.tar.bz2
volse-hubzilla-abd345f80f5074d325fd137e48a23925eaa66802.zip
Merge branch 'master' into trinidad
Diffstat (limited to 'mod')
-rw-r--r--mod/filestorage.php8
-rw-r--r--mod/parse_url.php9
-rw-r--r--mod/ping.php4
-rw-r--r--mod/settings.php5
4 files changed, 21 insertions, 5 deletions
diff --git a/mod/filestorage.php b/mod/filestorage.php
index 1767ea6bf..6b731e440 100644
--- a/mod/filestorage.php
+++ b/mod/filestorage.php
@@ -32,7 +32,7 @@ function filestorage_post(&$a) {
$str_group_deny = perms2str($_REQUEST['group_deny']);
$str_contact_deny = perms2str($_REQUEST['contact_deny']);
- attach_change_permissions($channel_id, $resource, $str_contact_allow, $str_group_allow, $str_contact_deny,$str_group_deny, $recurse = false);
+ attach_change_permissions($channel_id, $resource, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, $recurse);
//Build directory tree and redirect
$channel = $a->get_channel();
@@ -127,10 +127,14 @@ function filestorage_content(&$a) {
$lockstate = (($f['allow_cid'] || $f['allow_gid'] || $f['deny_cid'] || $f['deny_gid']) ? 'lock' : 'unlock');
+ // Encode path that is used for link so it's a valid URL
+ // Keep slashes as slashes, otherwise mod_rewrite doesn't work correctly
+ $encoded_path = str_replace('%2F', '/', rawurlencode($cloudpath));
+
$o = replace_macros(get_markup_template('attach_edit.tpl'), array(
'$header' => t('Edit file permissions'),
'$file' => $f,
- '$cloudpath' => z_root() . '/' . $cloudpath,
+ '$cloudpath' => z_root() . '/' . $encoded_path,
'$parentpath' => $parentpath,
'$uid' => $channel['channel_id'],
'$channelnick' => $channel['channel_address'],
diff --git a/mod/parse_url.php b/mod/parse_url.php
index 340e1a67e..23d608411 100644
--- a/mod/parse_url.php
+++ b/mod/parse_url.php
@@ -307,7 +307,14 @@ function parse_url_content(&$a) {
$max_images = intval($max_images);
foreach ($siteinfo["images"] as $imagedata) {
- $image .= '[img='.$imagedata["width"].'x'.$imagedata["height"].']'.$imagedata["src"].'[/img]' . "\n";
+ if ($url) {
+ $image .= sprintf('[url=%s]', $url);
+ }
+ $image .= '[img='.$imagedata["width"].'x'.$imagedata["height"].']'.$imagedata["src"].'[/img]';
+ if ($url) {
+ $image .= '[/url]';
+ }
+ $image .= "\n";
$total_images ++;
if($max_images && $max_images >= $total_images)
break;
diff --git a/mod/ping.php b/mod/ping.php
index cdb6aa0b2..593ae21f8 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -277,7 +277,7 @@ function ping_init(&$a) {
$r = q("SELECT * FROM item
WHERE item_restrict = %d and ( item_flags & %d ) > 0 and uid = %d
- and author_xchan != '%s' ",
+ and author_xchan != '%s' ORDER BY created DESC",
intval(ITEM_VISIBLE),
intval(ITEM_UNSEEN),
intval(local_user()),
@@ -300,7 +300,7 @@ function ping_init(&$a) {
if(argc() > 1 && (argv(1) === 'intros')) {
$result = array();
- $r = q("SELECT * FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) > 0 and not ((abook_flags & %d) > 0 or (xchan_flags & %d) > 0)",
+ $r = q("SELECT * FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) > 0 and not ((abook_flags & %d) > 0 or (xchan_flags & %d) > 0) ORDER BY abook_created DESC",
intval(local_user()),
intval(ABOOK_FLAG_PENDING),
intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED),
diff --git a/mod/settings.php b/mod/settings.php
index ea7b2ba06..be6f2cfb9 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -449,6 +449,8 @@ function settings_post(&$a) {
if(x($_POST,'vnotify11'))
$vnotify += intval($_POST['vnotify11']);
+ $always_show_in_notices = x($_POST,'always_show_in_notices') ? 1 : 0;
+
$channel = $a->get_channel();
$err = '';
@@ -478,6 +480,7 @@ function settings_post(&$a) {
set_pconfig(local_user(),'system','blocktags',$blocktags);
set_pconfig(local_user(),'system','channel_menu',$channel_menu);
set_pconfig(local_user(),'system','vnotify',$vnotify);
+ set_pconfig(local_user(),'system','always_show_in_notices',$always_show_in_notices);
set_pconfig(local_user(),'system','evdays',$evdays);
$r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d $set_perms where channel_id = %d",
@@ -995,6 +998,7 @@ function settings_content(&$a) {
$permissions_role = get_pconfig(local_user(),'system','permissions_role');
$permissions_set = (($permissions_role && $permissions_role != 'custom') ? true : false);
$vnotify = get_pconfig(local_user(),'system','vnotify');
+ $always_show_in_notices = get_pconfig(local_user(),'system','always_show_in_notices');
if($vnotify === false)
$vnotify = (-1);
@@ -1080,6 +1084,7 @@ function settings_content(&$a) {
'$vnotify9' => array('vnotify9', t('System critical alerts'), ($vnotify & VNOTIFY_ALERT), VNOTIFY_ALERT, t('Recommended')),
'$vnotify10' => array('vnotify10', t('New connections'), ($vnotify & VNOTIFY_INTRO), VNOTIFY_INTRO, t('Recommended')),
'$vnotify11' => array('vnotify11', t('System Registrations'), ($vnotify & VNOTIFY_REGISTER), VNOTIFY_REGISTER, ''),
+ '$always_show_in_notices' => array('always_show_in_notices', t('Also show new wall posts, private messages and connections under Notices'), $always_show_in_notices, 1, ''),
'$evdays' => array('evdays', t('Notify me of events this many days in advance'), $evdays, t('Must be greater than 0')),