diff --git a/boot.php b/boot.php index dafe20b83..1faeaf15a 100755 --- a/boot.php +++ b/boot.php @@ -50,7 +50,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'H'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1158 ); +define ( 'DB_UPDATE_VERSION', 1159 ); /** * @brief Constant with a HTML line break. diff --git a/include/api.php b/include/api.php index 3862ba7eb..b51bcc5f0 100644 --- a/include/api.php +++ b/include/api.php @@ -660,26 +660,30 @@ require_once('include/attach.php'); dbesc($_REQUEST['file_id']) ); if($r) { - if($r[0]['is_dir']) - $r[0]['data'] = ''; + $ptr = $r[0]; + if($length === 0) + $length = intval($ptr['filesize']); + + if($ptr['is_dir']) + $ptr['data'] = ''; elseif(! intval($r[0]['os_storage'])) { - $r[0]['start'] = $start; - $x = substr(dbunescbin($r[0]['data'],$start,$length)); - $r[0]['length'] = strlen($x); - $r[0]['data'] = base64_encode($x); + $ptr['start'] = $start; + $x = substr(dbunescbin($ptr['data'],$start,$length)); + $ptr['length'] = strlen($x); + $ptr['data'] = base64_encode($x); } else { - $fp = fopen(dbunescbin($r[0]['data'],'r')); + $fp = fopen(dbunescbin($ptr['data']),'r'); if($fp) { $seek = fseek($fp,$start,SEEK_SET); $x = fread($fp,$length); - $r[0]['start'] = $start; - $r[0]['length'] = strlen($x); - $r[0]['data'] = base64_encode($x); + $ptr['start'] = $start; + $ptr['length'] = strlen($x); + $ptr['data'] = base64_encode($x); } } - $ret = array('attach' => $r[0]); + $ret = array('attach' => $ptr); json_return_and_die($ret); } killme(); diff --git a/include/attach.php b/include/attach.php index 1bba88c63..8a568d8e1 100644 --- a/include/attach.php +++ b/include/attach.php @@ -722,7 +722,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { intval($filesize), intval(1), intval($is_photo), - dbesc($os_relpath), + dbesc($os_basepath . $os_relpath), dbesc($created), intval($existing_id), intval($channel_id) @@ -742,7 +742,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { intval($x[0]['revision'] + 1), intval(1), intval($is_photo), - dbesc($os_relpath), + dbesc($os_basepath . $os_relpath), dbesc($created), dbesc($created), dbesc($x[0]['allow_cid']), @@ -783,7 +783,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { intval(0), intval(1), intval($is_photo), - dbesc($os_relpath), + dbesc($os_basepath . $os_relpath), dbesc($created), dbesc($created), dbesc(($arr && array_key_exists('allow_cid',$arr)) ? $arr['allow_cid'] : $str_contact_allow), diff --git a/install/update.php b/install/update.php index d6b543466..38e76afda 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ - + EOT; return $s; -} \ No newline at end of file +} diff --git a/mod/settings.php b/mod/settings.php index 8bfff3765..18bfaeb08 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -1102,12 +1102,13 @@ function settings_content(&$a) { '$expert' => feature_enabled(local_channel(),'expert'), '$hint' => t('Please enable expert mode (in Settings > Additional features) to adjust!'), '$lbl_misc' => t('Miscellaneous Settings'), - '$photo_path' => array('photo_path', t('Default photo upload folder'), get_pconfig(local_channel(),'system','photo_path'), '%Y - current year, %m - current month'), - '$attach_path' => array('attach_path', t('Default file upload folder'), get_pconfig(local_channel(),'system','attach_path'), '%Y - current year, %m - current month'), + '$photo_path' => array('photo_path', t('Default photo upload folder'), get_pconfig(local_channel(),'system','photo_path'), t('%Y - current year, %m - current month')), + '$attach_path' => array('attach_path', t('Default file upload folder'), get_pconfig(local_channel(),'system','attach_path'), t('%Y - current year, %m - current month')), '$menus' => $menu, '$menu_desc' => t('Personal menu to display in your channel pages'), '$removeme' => t('Remove Channel'), '$removechannel' => t('Remove this channel.'), + '$firefoxshare' => t('Firefox Share $Projectname provider'), )); call_hooks('settings_form',$o); diff --git a/version.inc b/version.inc index d0eb99d9c..b1085e3d5 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-11-04.1206 +2015-11-05.1207 diff --git a/view/css/mod_settings.css b/view/css/mod_settings.css index 7eff8e45b..e81d115d4 100644 --- a/view/css/mod_settings.css +++ b/view/css/mod_settings.css @@ -1,3 +1,11 @@ .group { margin-left: 10px; } + +.ffsapilink { + margin: 10px 0; +} + +.channel-menu { + margin-top: 24px; +} diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl index ab62ede45..7c1f4578d 100755 --- a/view/tpl/settings.tpl +++ b/view/tpl/settings.tpl @@ -136,7 +136,7 @@ - {{if $menus}} +