From 65457e73bfc8fe04ad57acce7800cd7640f30e7e Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 18 Jun 2009 10:49:45 -0700 Subject: Config option for bidirectional Twitter bridge --- config.php.sample | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config.php.sample b/config.php.sample index 7649c5262..529164108 100644 --- a/config.php.sample +++ b/config.php.sample @@ -153,6 +153,9 @@ $config['sphinx']['port'] = 3312; // Twitter integration source attribute. Note: default is Laconica // $config['integration']['source'] = 'Laconica'; +// Enable bidirectional Twitter bridge +// $config['twitterbridge']['enabled'] = true; + // Edit throttling. Off by default. If turned on, you can only post 20 notices // every 10 minutes. Admins may want to play with the settings to minimize inconvenience for // real users without getting uncontrollable floods from spammers or runaway bots. -- cgit v1.2.3-54-g00ecf From 730c173238841cdc4d52bb074e53d4a74f7871bf Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 18 Jun 2009 18:48:19 +0000 Subject: Updated markup and CSS for attachment_view --- lib/attachmentlist.php | 62 ++++++++++++++++++++++++++-------------------- theme/base/css/display.css | 22 +++++++++++----- 2 files changed, 51 insertions(+), 33 deletions(-) diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php index c80c0c418..7bd441bf4 100644 --- a/lib/attachmentlist.php +++ b/lib/attachmentlist.php @@ -210,7 +210,7 @@ class AttachmentListItem extends Widget function showRepresentation() { $thumbnail = File_thumbnail::staticGet('file_id', $this->attachment->id); if (!empty($thumbnail)) { - $this->out->element('img', array('alt' => 'nothing to say', 'src' => $thumbnail->url, 'width' => $thumbnail->width, 'height' => $thumbnail->height)); + $this->out->element('img', array('alt' => '', 'src' => $thumbnail->url, 'width' => $thumbnail->width, 'height' => $thumbnail->height)); } } @@ -244,39 +244,47 @@ class AttachmentListItem extends Widget class Attachment extends AttachmentListItem { function showLink() { + $this->out->elementStart('div', array('id' => 'attachment_view', + 'class' => 'hentry')); + $this->out->elementStart('div', 'entry-title'); $this->out->elementStart('a', $this->linkAttr()); $this->out->element('span', null, $this->linkTitle()); $this->showRepresentation(); $this->out->elementEnd('a'); - - if (empty($this->oembed->author_name) && empty($this->oembed->provider)) { - return; - } - - $this->out->elementStart('dl', 'oembed_info'); - - if (!empty($this->oembed->author_name)) { - $this->out->element('dt', null, _('Author:')); - - $this->out->elementStart('dd'); - if (empty($this->oembed->author_url)) { - $this->out->text($this->oembed->author_name); - } else { - $this->out->element('a', array('href' => $this->oembed->author_url), $this->oembed->author_name); + $this->out->elementEnd('div'); + + if ($this->oembed->author_name || $this->oembed->provider) { + $this->out->elementStart('div', array('id' => 'oembed_info', + 'class' => 'entry-content')); + if (!empty($this->oembed->author_name)) { + $this->out->elementStart('dl', 'vcard author'); + $this->out->element('dt', null, _('Author')); + $this->out->elementStart('dd', 'fn'); + if (empty($this->oembed->author_url)) { + $this->out->text($this->oembed->author_name); + } else { + $this->out->element('a', array('href' => $this->oembed->author_url, + 'class' => 'url'), $this->oembed->author_name); + } + $this->out->elementEnd('dd'); + $this->out->elementEnd('dl'); } - $this->out->elementEnd('dd'); - } - if (!empty($this->oembed->provider)) { - $this->out->element('dt', null, _('Provider:')); - $this->out->elementStart('dd'); - if (empty($this->oembed->provider_url)) { - $this->out->text($this->oembed->provider); - } else { - $this->out->element('a', array('href' => $this->oembed->provider_url), $this->oembed->provider); + if (!empty($this->oembed->provider)) { + $this->out->elementStart('dl', 'vcard'); + $this->out->element('dt', null, _('Provider')); + $this->out->elementStart('dd', 'fn'); + if (empty($this->oembed->provider_url)) { + $this->out->text($this->oembed->provider); + } else { + $this->out->element('a', array('href' => $this->oembed->provider_url, + 'class' => 'url'), $this->oembed->provider); + } + $this->out->elementEnd('dd'); + $this->out->elementEnd('dl'); } - $this->out->elementEnd('dd'); + $this->out->elementEnd('div'); } - $this->out->elementEnd('dl'); + $this->out->elementEnd('div'); } function show() { diff --git a/theme/base/css/display.css b/theme/base/css/display.css index daf5ada1c..8957a5b40 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -1018,6 +1018,22 @@ border-radius:7px; -webkit-border-radius:7px; } +#attachment_view #oembed_info { +margin-top:11px; +} +#attachment_view #oembed_info dt, +#attachment_view #oembed_info dd { +float:left; +} +#attachment_view #oembed_info dt { +clear:left; +margin-right:11px; +font-weight:bold; +} +#attachment_view #oembed_info dt:after { +content: ":"; +} + #usergroups #new_group { float: left; margin-right: 2em; @@ -1284,9 +1300,3 @@ display:none; .guide { clear:both; } - -dl.oembed_info dt, -dl.oembed_info dd { -display: inline; -} - -- cgit v1.2.3-54-g00ecf From 23d6d19e75f273bf6e72fbcbbf8e6789f77d07ff Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 18 Jun 2009 19:03:44 +0000 Subject: Better attachment view check --- lib/attachmentlist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php index 7bd441bf4..a2446a886 100644 --- a/lib/attachmentlist.php +++ b/lib/attachmentlist.php @@ -253,7 +253,7 @@ class Attachment extends AttachmentListItem $this->out->elementEnd('a'); $this->out->elementEnd('div'); - if ($this->oembed->author_name || $this->oembed->provider) { + if (!empty($this->oembed->author_name) || !empty($this->oembed->provider)) { $this->out->elementStart('div', array('id' => 'oembed_info', 'class' => 'entry-content')); if (!empty($this->oembed->author_name)) { -- cgit v1.2.3-54-g00ecf From e0fb15c185f4ca81743937c27557c9402ba59071 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 18 Jun 2009 19:19:19 +0000 Subject: Make sure we have a DB connection before setting its charset --- classes/Memcached_DataObject.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 33ac70dd0..f945e94ff 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -242,13 +242,16 @@ class Memcached_DataObject extends DB_DataObject if (common_config('db', 'type') == 'mysql' && common_config('db', 'utf8')) { $conn = $DB->connection; - if ($DB instanceof DB_mysqli) { - mysqli_set_charset($conn, 'utf8'); - } else if ($DB instanceof DB_mysql) { - mysql_set_charset('utf8', $conn); + if (!empty($conn)) { + if ($DB instanceof DB_mysqli) { + mysqli_set_charset($conn, 'utf8'); + } else if ($DB instanceof DB_mysql) { + mysql_set_charset('utf8', $conn); + } } } } return $result; } + } -- cgit v1.2.3-54-g00ecf