forked from GNUsocial/gnu-social
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
This commit is contained in:
commit
cd1361fe96
9
README
9
README
@ -1223,6 +1223,7 @@ supported: an array of mime types you accept to store and distribute,
|
|||||||
like 'image/gif', 'video/mpeg', 'audio/mpeg', etc. Make sure you
|
like 'image/gif', 'video/mpeg', 'audio/mpeg', etc. Make sure you
|
||||||
setup your server to properly reckognize the types you want to
|
setup your server to properly reckognize the types you want to
|
||||||
support.
|
support.
|
||||||
|
uploads: false to disable uploading files with notices (true by default).
|
||||||
|
|
||||||
For quotas, be sure you've set the upload_max_filesize and post_max_size
|
For quotas, be sure you've set the upload_max_filesize and post_max_size
|
||||||
in php.ini to be large enough to handle your upload. In httpd.conf
|
in php.ini to be large enough to handle your upload. In httpd.conf
|
||||||
@ -1246,6 +1247,14 @@ Options for group functionality.
|
|||||||
maxaliases: maximum number of aliases a group can have. Default 3. Set
|
maxaliases: maximum number of aliases a group can have. Default 3. Set
|
||||||
to 0 or less to prevent aliases in a group.
|
to 0 or less to prevent aliases in a group.
|
||||||
|
|
||||||
|
|
||||||
|
oohembed
|
||||||
|
--------
|
||||||
|
|
||||||
|
oEmbed endpoint for multimedia attachments (links in posts).
|
||||||
|
|
||||||
|
endpoint: oohembed endpoint using http://oohembed.com/ software.
|
||||||
|
|
||||||
Troubleshooting
|
Troubleshooting
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
@ -79,7 +79,6 @@ class File extends Memcached_DataObject
|
|||||||
&& ('text/html' === substr($redir_data['type'], 0, 9))
|
&& ('text/html' === substr($redir_data['type'], 0, 9))
|
||||||
&& ($oembed_data = File_oembed::_getOembed($given_url))
|
&& ($oembed_data = File_oembed::_getOembed($given_url))
|
||||||
&& isset($oembed_data['json'])) {
|
&& isset($oembed_data['json'])) {
|
||||||
|
|
||||||
File_oembed::saveNew($oembed_data['json'], $file_id);
|
File_oembed::saveNew($oembed_data['json'], $file_id);
|
||||||
}
|
}
|
||||||
return $x;
|
return $x;
|
||||||
@ -98,7 +97,6 @@ class File extends Memcached_DataObject
|
|||||||
if ($redir_url === $given_url) {
|
if ($redir_url === $given_url) {
|
||||||
$x = File::saveNew($redir_data, $given_url);
|
$x = File::saveNew($redir_data, $given_url);
|
||||||
$file_id = $x->id;
|
$file_id = $x->id;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$x = File::processNew($redir_url, $notice_id);
|
$x = File::processNew($redir_url, $notice_id);
|
||||||
$file_id = $x->id;
|
$file_id = $x->id;
|
||||||
|
@ -53,7 +53,7 @@ class File_oembed extends Memcached_DataObject
|
|||||||
|
|
||||||
|
|
||||||
function _getOembed($url, $maxwidth = 500, $maxheight = 400, $format = 'json') {
|
function _getOembed($url, $maxwidth = 500, $maxheight = 400, $format = 'json') {
|
||||||
$cmd = 'http://oohembed.com/oohembed/?url=' . urlencode($url);
|
$cmd = common_config('oohembed', 'endpoint') . '?url=' . urlencode($url);
|
||||||
if (is_int($maxwidth)) $cmd .= "&maxwidth=$maxwidth";
|
if (is_int($maxwidth)) $cmd .= "&maxwidth=$maxwidth";
|
||||||
if (is_int($maxheight)) $cmd .= "&maxheight=$maxheight";
|
if (is_int($maxheight)) $cmd .= "&maxheight=$maxheight";
|
||||||
if (is_string($format)) $cmd .= "&format=$format";
|
if (is_string($format)) $cmd .= "&format=$format";
|
||||||
|
@ -223,6 +223,12 @@ class Notice extends Memcached_DataObject
|
|||||||
$notice->addToInboxes();
|
$notice->addToInboxes();
|
||||||
$notice->saveGroups();
|
$notice->saveGroups();
|
||||||
$notice->saveUrls();
|
$notice->saveUrls();
|
||||||
|
$orig2 = clone($notice);
|
||||||
|
$notice->rendered = common_render_content($final, $notice);
|
||||||
|
if (!$notice->update($orig2)) {
|
||||||
|
common_log_db_error($notice, 'UPDATE', __FILE__);
|
||||||
|
return _('Problem saving notice.');
|
||||||
|
}
|
||||||
|
|
||||||
$notice->query('COMMIT');
|
$notice->query('COMMIT');
|
||||||
|
|
||||||
@ -242,8 +248,6 @@ class Notice extends Memcached_DataObject
|
|||||||
* follow redirects and save all available file information
|
* follow redirects and save all available file information
|
||||||
* (mimetype, date, size, oembed, etc.)
|
* (mimetype, date, size, oembed, etc.)
|
||||||
*
|
*
|
||||||
* @param class $notice Notice to pull URLs from
|
|
||||||
*
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function saveUrls() {
|
function saveUrls() {
|
||||||
|
@ -222,4 +222,6 @@ $config['sphinx']['port'] = 3312;
|
|||||||
// $config['attachments']['file_quota'] = 5000000;
|
// $config['attachments']['file_quota'] = 5000000;
|
||||||
// $config['attachments']['user_quota'] = 50000000;
|
// $config['attachments']['user_quota'] = 50000000;
|
||||||
// $config['attachments']['monthly_quota'] = 15000000;
|
// $config['attachments']['monthly_quota'] = 15000000;
|
||||||
|
// $config['attachments']['uploads'] = true;
|
||||||
|
|
||||||
|
// $config['oohembed']['endpoint'] = 'http://oohembed.com/oohembed/';
|
||||||
|
@ -200,9 +200,11 @@ $config =
|
|||||||
'file_quota' => 5000000,
|
'file_quota' => 5000000,
|
||||||
'user_quota' => 50000000,
|
'user_quota' => 50000000,
|
||||||
'monthly_quota' => 15000000,
|
'monthly_quota' => 15000000,
|
||||||
|
'uploads' => true,
|
||||||
),
|
),
|
||||||
'group' =>
|
'group' =>
|
||||||
array('maxaliases' => 3),
|
array('maxaliases' => 3),
|
||||||
|
'oohembed' => array('endpoint' => 'http://oohembed.com/oohembed/')
|
||||||
);
|
);
|
||||||
|
|
||||||
$config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');
|
$config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');
|
||||||
|
@ -90,7 +90,9 @@ class NoticeForm extends Form
|
|||||||
$this->user = common_current_user();
|
$this->user = common_current_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->enctype = 'multipart/form-data';
|
if (common_config('attachments', 'uploads')) {
|
||||||
|
$this->enctype = 'multipart/form-data';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -148,12 +150,14 @@ class NoticeForm extends Form
|
|||||||
$this->out->element('dd', array('id' => 'notice_text-count'),
|
$this->out->element('dd', array('id' => 'notice_text-count'),
|
||||||
'140');
|
'140');
|
||||||
$this->out->elementEnd('dl');
|
$this->out->elementEnd('dl');
|
||||||
$this->out->element('label', array('for' => 'notice_data-attach'),_('Attach'));
|
if (common_config('attachments', 'uploads')) {
|
||||||
$this->out->element('input', array('id' => 'notice_data-attach',
|
$this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
|
||||||
'type' => 'file',
|
$this->out->element('label', array('for' => 'notice_data-attach'),_('Attach'));
|
||||||
'name' => 'attach',
|
$this->out->element('input', array('id' => 'notice_data-attach',
|
||||||
'title' => _('Attach a file')));
|
'type' => 'file',
|
||||||
$this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
|
'name' => 'attach',
|
||||||
|
'title' => _('Attach a file')));
|
||||||
|
}
|
||||||
if ($this->action) {
|
if ($this->action) {
|
||||||
$this->out->hidden('notice_return-to', $this->action, 'returnto');
|
$this->out->hidden('notice_return-to', $this->action, 'returnto');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user