summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-05-01 08:00:41 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-05-01 08:00:41 -0700
commit1a61a171cdb39444e2c0fbed7cf3a92e0ec271df (patch)
treeedf2eb852163f3806d813ac6292ab67be1aed40f
parenta86a0e91a5acb5ea894a3d066f9adf3b1ef305ae (diff)
parent19a21947046062fc0cc313b23ae7418d317def89 (diff)
Merge branch '0.7.x' into cometplugin
-rw-r--r--.gitignore3
-rw-r--r--actions/accesstoken.php2
-rw-r--r--actions/api.php1
-rw-r--r--actions/favoritesrss.php2
-rw-r--r--actions/openidsettings.php4
-rw-r--r--actions/recoverpassword.php4
-rw-r--r--actions/showfavorites.php4
-rw-r--r--actions/twitapistatuses.php38
-rw-r--r--classes/Notice.php136
-rw-r--r--classes/Notice_inbox.php51
-rw-r--r--classes/User.php18
-rw-r--r--js/identica-badge.js2
-rw-r--r--js/util.js29
-rw-r--r--lib/galleryaction.php4
-rw-r--r--lib/router.php4
-rw-r--r--lib/subpeopletagcloudsection.php1
-rw-r--r--lib/subscriberspeopleselftagcloudsection.php10
-rw-r--r--lib/subscriberspeopletagcloudsection.php5
-rw-r--r--lib/subscriptionspeopleselftagcloudsection.php9
-rw-r--r--lib/subscriptionspeopletagcloudsection.php4
-rw-r--r--plugins/LinkbackPlugin.php8
-rwxr-xr-xscripts/getvaliddaemons.php52
-rwxr-xr-xscripts/startdaemons.sh6
-rwxr-xr-xscripts/stopdaemons.sh2
-rw-r--r--theme/base/css/display.css33
25 files changed, 326 insertions, 106 deletions
diff --git a/.gitignore b/.gitignore
index 83a53dfa3..da6947bfd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,6 @@ dataobject.ini
*.rej
.#*
*.swp
+.buildpath
+.project
+.settings
diff --git a/actions/accesstoken.php b/actions/accesstoken.php
index bb68d3314..46b43c702 100644
--- a/actions/accesstoken.php
+++ b/actions/accesstoken.php
@@ -59,7 +59,7 @@ class AccesstokenAction extends Action
try {
common_debug('getting request from env variables', __FILE__);
common_remove_magic_from_request();
- $req = OAuthRequest::from_request('POST', common_locale_url('accesstoken'));
+ $req = OAuthRequest::from_request('POST', common_local_url('accesstoken'));
common_debug('getting a server', __FILE__);
$server = omb_oauth_server();
common_debug('fetching the access token', __FILE__);
diff --git a/actions/api.php b/actions/api.php
index d2f0a2eff..8762b4bcd 100644
--- a/actions/api.php
+++ b/actions/api.php
@@ -130,6 +130,7 @@ class ApiAction extends Action
'statuses/friends_timeline',
'statuses/friends',
'statuses/replies',
+ 'statuses/mentions',
'statuses/followers',
'favorites/favorites');
diff --git a/actions/favoritesrss.php b/actions/favoritesrss.php
index f85bf1b19..6b46b8dec 100644
--- a/actions/favoritesrss.php
+++ b/actions/favoritesrss.php
@@ -107,7 +107,7 @@ class FavoritesrssAction extends Rss10Action
$c = array('url' => common_local_url('favoritesrss',
array('nickname' =>
$user->nickname)),
- 'title' => sprintf(_("%s favorite notices"), $user->nickname),
+ 'title' => sprintf(_("%s's favorite notices"), $user->nickname),
'link' => common_local_url('showfavorites',
array('nickname' =>
$user->nickname)),
diff --git a/actions/openidsettings.php b/actions/openidsettings.php
index 92469d20f..5f59ebc01 100644
--- a/actions/openidsettings.php
+++ b/actions/openidsettings.php
@@ -67,8 +67,8 @@ class OpenidsettingsAction extends AccountSettingsAction
function getInstructions()
{
- return _('[OpenID](%%doc.openid%%) lets you log into many sites ' .
- ' with the same user account. '.
+ return _('[OpenID](%%doc.openid%%) lets you log into many sites' .
+ ' with the same user account.'.
' Manage your associated OpenIDs from here.');
}
diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php
index 620fe7eb8..82263fcd5 100644
--- a/actions/recoverpassword.php
+++ b/actions/recoverpassword.php
@@ -151,11 +151,11 @@ class RecoverpasswordAction extends Action
$this->element('p', null,
_('If you\'ve forgotten or lost your' .
' password, you can get a new one sent to' .
- ' the email address you have stored ' .
+ ' the email address you have stored' .
' in your account.'));
} else if ($this->mode == 'reset') {
$this->element('p', null,
- _('You\'ve been identified. Enter a ' .
+ _('You\'ve been identified. Enter a' .
' new password below. '));
}
$this->elementEnd('div');
diff --git a/actions/showfavorites.php b/actions/showfavorites.php
index 6e011d5ca..eed62a2ab 100644
--- a/actions/showfavorites.php
+++ b/actions/showfavorites.php
@@ -74,9 +74,9 @@ class ShowfavoritesAction extends Action
function title()
{
if ($this->page == 1) {
- return sprintf(_("%s favorite notices"), $this->user->nickname);
+ return sprintf(_("%s's favorite notices"), $this->user->nickname);
} else {
- return sprintf(_("%s favorite notices, page %d"),
+ return sprintf(_("%s's favorite notices, page %d"),
$this->user->nickname,
$this->page);
}
diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php
index 323c4f1f8..3abeba367 100644
--- a/actions/twitapistatuses.php
+++ b/actions/twitapistatuses.php
@@ -144,10 +144,10 @@ class TwitapistatusesAction extends TwitterapiAction
break;
case 'atom':
if (isset($apidata['api_arg'])) {
- $selfuri = $selfuri = common_root_url() .
+ $selfuri = common_root_url() .
'api/statuses/friends_timeline/' . $apidata['api_arg'] . '.atom';
} else {
- $selfuri = $selfuri = common_root_url() .
+ $selfuri = common_root_url() .
'api/statuses/friends_timeline.atom';
}
$this->show_atom_timeline($notice, $title, $id, $link, $subtitle, null, $selfuri);
@@ -231,10 +231,10 @@ class TwitapistatusesAction extends TwitterapiAction
break;
case 'atom':
if (isset($apidata['api_arg'])) {
- $selfuri = $selfuri = common_root_url() .
+ $selfuri = common_root_url() .
'api/statuses/user_timeline/' . $apidata['api_arg'] . '.atom';
} else {
- $selfuri = $selfuri = common_root_url() .
+ $selfuri = common_root_url() .
'api/statuses/user_timeline.atom';
}
$this->show_atom_timeline($notice, $title, $id, $link, $subtitle, $suplink, $selfuri);
@@ -344,7 +344,7 @@ class TwitapistatusesAction extends TwitterapiAction
$this->show($args, $apidata);
}
- function replies($args, $apidata)
+ function mentions($args, $apidata)
{
parent::handle($args);
@@ -360,11 +360,13 @@ class TwitapistatusesAction extends TwitterapiAction
$profile = $user->getProfile();
$sitename = common_config('site', 'name');
- $title = sprintf(_('%1$s / Updates replying to %2$s'), $sitename, $user->nickname);
+ $title = sprintf(_('%1$s / Updates mentioning %2$s'),
+ $sitename, $user->nickname);
$taguribase = common_config('integration', 'taguri');
- $id = "tag:$taguribase:Replies:".$user->id;
+ $id = "tag:$taguribase:Mentions:".$user->id;
$link = common_local_url('replies', array('nickname' => $user->nickname));
- $subtitle = sprintf(_('%1$s updates that reply to updates from %2$s / %3$s.'), $sitename, $user->nickname, $profile->getBestName());
+ $subtitle = sprintf(_('%1$s updates that reply to updates from %2$s / %3$s.'),
+ $sitename, $user->nickname, $profile->getBestName());
if (!$page) {
$page = 1;
@@ -385,7 +387,8 @@ class TwitapistatusesAction extends TwitterapiAction
$since = strtotime($this->arg('since'));
- $notice = $user->getReplies((($page-1)*20), $count, $since_id, $before_id, $since);
+ $notice = $user->getReplies((($page-1)*20),
+ $count, $since_id, $before_id, $since);
$notices = array();
while ($notice->fetch()) {
@@ -400,14 +403,10 @@ class TwitapistatusesAction extends TwitterapiAction
$this->show_rss_timeline($notices, $title, $link, $subtitle);
break;
case 'atom':
- if (isset($apidata['api_arg'])) {
- $selfuri = $selfuri = common_root_url() .
- 'api/statuses/replies/' . $apidata['api_arg'] . '.atom';
- } else {
- $selfuri = $selfuri = common_root_url() .
- 'api/statuses/replies.atom';
- }
- $this->show_atom_timeline($notices, $title, $id, $link, $subtitle, null, $selfuri);
+ $selfuri = common_root_url() .
+ ltrim($_SERVER['QUERY_STRING'], 'p=');
+ $this->show_atom_timeline($notices, $title, $id, $link, $subtitle,
+ null, $selfuri);
break;
case 'json':
$this->show_json_timeline($notices);
@@ -418,6 +417,11 @@ class TwitapistatusesAction extends TwitterapiAction
}
+ function replies($args, $apidata)
+ {
+ call_user_func(array($this, 'mentions'), $args, $apidata);
+ }
+
function show($args, $apidata)
{
parent::handle($args);
diff --git a/classes/Notice.php b/classes/Notice.php
index 27b98de1c..6a7522bd3 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -285,7 +285,7 @@ class Notice extends Memcached_DataObject
// Clear the user's cache
$cache = common_memcache();
if (!empty($cache)) {
- $cache->delete(common_cache_key('user:notices_with_friends:' . $this->profile_id));
+ $cache->delete(common_cache_key('notice_inbox:by_user:'.$this->profile_id));
}
$this->blowNoticeCache($blowLast);
$this->blowPublicCache($blowLast);
@@ -307,9 +307,9 @@ class Notice extends Memcached_DataObject
$member->group_id = $group_inbox->group_id;
if ($member->find()) {
while ($member->fetch()) {
- $cache->delete(common_cache_key('user:notices_with_friends:' . $member->profile_id));
+ $cache->delete(common_cache_key('notice_inbox:by_user:' . $member->profile_id));
if ($blowLast) {
- $cache->delete(common_cache_key('user:notices_with_friends:' . $member->profile_id . ';last'));
+ $cache->delete(common_cache_key('notice_inbox:by_user:' . $member->profile_id . ';last'));
}
}
}
@@ -352,9 +352,9 @@ class Notice extends Memcached_DataObject
'WHERE subscription.subscribed = ' . $this->profile_id);
while ($user->fetch()) {
- $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id));
+ $cache->delete(common_cache_key('notice_inbox:by_user:'.$user->id));
if ($blowLast) {
- $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id . ';last'));
+ $cache->delete(common_cache_key('notice_inbox:by_user:'.$user->id.';last'));
}
}
$user->free();
@@ -613,27 +613,80 @@ class Notice extends Memcached_DataObject
return $wrapper;
}
+ function getStreamByIds($ids)
+ {
+ $cache = common_memcache();
+
+ if (!empty($cache)) {
+ $notices = array();
+ foreach ($ids as $id) {
+ $notices[] = Notice::staticGet('id', $id);
+ }
+ return new ArrayWrapper($notices);
+ } else {
+ $notice = new Notice();
+ $notice->whereAdd('id in (' . implode(', ', $ids) . ')');
+ $notice->orderBy('id DESC');
+
+ $notice->find();
+ return $notice;
+ }
+ }
+
function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null)
{
+ $ids = Notice::stream(array('Notice', '_publicStreamDirect'),
+ array(),
+ 'public',
+ $offset, $limit, $since_id, $before_id, $since);
+
+ return Notice::getStreamByIds($ids);
+ }
+
+ function _publicStreamDirect($offset=0, $limit=20, $since_id=0, $before_id=0, $since=null)
+ {
+ $notice = new Notice();
- $parts = array();
+ $notice->selectAdd(); // clears it
+ $notice->selectAdd('id');
- $qry = 'SELECT * FROM notice ';
+ $notice->orderBy('id DESC');
+
+ if (!is_null($offset)) {
+ $notice->limit($offset, $limit);
+ }
if (common_config('public', 'localonly')) {
- $parts[] = 'is_local = 1';
+ $notice->whereAdd('is_local = 1');
} else {
# -1 == blacklisted
- $parts[] = 'is_local != -1';
+ $notice->whereAdd('is_local != -1');
+ }
+
+ if ($since_id != 0) {
+ $notice->whereAdd('id > ' . $since_id);
}
- if ($parts) {
- $qry .= ' WHERE ' . implode(' AND ', $parts);
+ if ($before_id != 0) {
+ $notice->whereAdd('id < ' . $before_id);
+ }
+
+ if (!is_null($since)) {
+ $notice->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\'');
+ }
+
+ $ids = array();
+
+ if ($notice->find()) {
+ while ($notice->fetch()) {
+ $ids[] = $notice->id;
+ }
}
- return Notice::getStream($qry,
- 'public',
- $offset, $limit, $since_id, $before_id, null, $since);
+ $notice->free();
+ $notice = NULL;
+
+ return $ids;
}
function addToInboxes()
@@ -947,4 +1000,59 @@ class Notice extends Memcached_DataObject
array('notice' => $this->id));
}
}
+
+ function stream($fn, $args, $cachekey, $offset=0, $limit=20, $since_id=0, $before_id=0, $since=null)
+ {
+ $cache = common_memcache();
+
+ if (empty($cache) ||
+ $since_id != 0 || $before_id != 0 || !is_null($since) ||
+ ($offset + $limit) > NOTICE_CACHE_WINDOW) {
+ return call_user_func_array($fn, array_merge($args, array($offset, $limit, $since_id,
+ $before_id, $since)));
+ }
+
+ $idkey = common_cache_key($cachekey);
+
+ $idstr = $cache->get($idkey);
+
+ if (!empty($idstr)) {
+ // Cache hit! Woohoo!
+ $window = explode(',', $idstr);
+ $ids = array_slice($window, $offset, $limit);
+ return $ids;
+ }
+
+ $laststr = $cache->get($idkey.';last');
+
+ if (!empty($laststr)) {
+ $window = explode(',', $laststr);
+ $last_id = $window[0];
+ $new_ids = call_user_func_array($fn, array_merge($args, array(0, NOTICE_CACHE_WINDOW,
+ $last_id, 0, null)));
+
+ $new_window = array_merge($new_ids, $window);
+
+ $new_windowstr = implode(',', $new_window);
+
+ $result = $cache->set($idkey, $new_windowstr);
+ $result = $cache->set($idkey . ';last', $new_windowstr);
+
+ $ids = array_slice($new_window, $offset, $limit);
+
+ return $ids;
+ }
+
+ $window = call_user_func_array($fn, array_merge($args, array(0, NOTICE_CACHE_WINDOW,
+ 0, 0, null)));
+
+ $windowstr = implode(',', $window);
+
+ $result = $cache->set($idkey, $windowstr);
+ $result = $cache->set($idkey . ';last', $windowstr);
+
+ $ids = array_slice($window, $offset, $limit);
+
+ return $ids;
+ }
}
diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php
index 81ddb4538..dec14b0d1 100644
--- a/classes/Notice_inbox.php
+++ b/classes/Notice_inbox.php
@@ -1,7 +1,7 @@
<?php
/*
* Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -21,7 +21,11 @@ if (!defined('LACONICA')) { exit(1); }
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
-class Notice_inbox extends Memcached_DataObject
+// We keep 5 pages of inbox notices in memcache, +1 for pagination check
+
+define('INBOX_CACHE_WINDOW', 101);
+
+class Notice_inbox extends Memcached_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
@@ -38,4 +42,47 @@ class Notice_inbox extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
+
+ function stream($user_id, $offset, $limit, $since_id, $before_id, $since)
+ {
+ return Notice::stream(array('Notice_inbox', '_streamDirect'),
+ array($user_id),
+ 'notice_inbox:by_user:'.$user_id,
+ $offset, $limit, $since_id, $before_id, $since);
+ }
+
+ function _streamDirect($user_id, $offset, $limit, $since_id, $before_id, $since)
+ {
+ $inbox = new Notice_inbox();
+
+ $inbox->user_id = $user_id;
+
+ if ($since_id != 0) {
+ $inbox->whereAdd('notice_id > ' . $since_id);
+ }
+
+ if ($before_id != 0) {
+ $inbox->whereAdd('notice_id < ' . $before_id);
+ }
+
+ if (!is_null($since)) {
+ $inbox->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\'');
+ }
+
+ $inbox->orderBy('notice_id DESC');
+
+ if (!is_null($offset)) {
+ $inbox->limit($offset, $limit);
+ }
+
+ $ids = array();
+
+ if ($inbox->find()) {
+ while ($inbox->fetch()) {
+ $ids[] = $inbox->notice_id;
+ }
+ }
+
+ return $ids;
+ }
}
diff --git a/classes/User.php b/classes/User.php
index 3b9b5cd83..ce7ea1464 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -444,21 +444,17 @@ class User extends Memcached_DataObject
'SELECT notice.* ' .
'FROM notice JOIN subscription ON notice.profile_id = subscription.subscribed ' .
'WHERE subscription.subscriber = %d ';
- $order = null;
+ return Notice::getStream(sprintf($qry, $this->id),
+ 'user:notices_with_friends:' . $this->id,
+ $offset, $limit, $since_id, $before_id,
+ $order, $since);
} else if ($enabled === true ||
($enabled == 'transitional' && $this->inboxed == 1)) {
- $qry =
- 'SELECT notice.* ' .
- 'FROM notice JOIN notice_inbox ON notice.id = notice_inbox.notice_id ' .
- 'WHERE notice_inbox.user_id = %d ';
- // NOTE: we override ORDER
- $order = null;
+ $ids = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since);
+
+ return Notice::getStreamByIds($ids);
}
- return Notice::getStream(sprintf($qry, $this->id),
- 'user:notices_with_friends:' . $this->id,
- $offset, $limit, $since_id, $before_id,
- $order, $since);
}
function blowFavesCache()
diff --git a/js/identica-badge.js b/js/identica-badge.js
index 869230b7a..ffa55ae93 100644
--- a/js/identica-badge.js
+++ b/js/identica-badge.js
@@ -128,7 +128,7 @@
var a = document.createElement('A');
a.innerHTML = 'get this';
a.target = '_blank';
- a.href = 'http://identica/doc/badge';
+ a.href = 'http://identi.ca/doc/badge';
$.s.f.appendChild(a);
$.s.appendChild($.s.f);
$.f.getUser();
diff --git a/js/util.js b/js/util.js
index 16422df57..f15c4f2bb 100644
--- a/js/util.js
+++ b/js/util.js
@@ -166,23 +166,14 @@ $(document).ready(function(){
$("#notice_action-submit").addClass("disabled");
return true;
},
- timeout: 7000,
error: function (xhr, textStatus, errorThrown) { $("#form_notice").removeClass("processing");
$("#notice_action-submit").removeAttr("disabled");
$("#notice_action-submit").removeClass("disabled");
-
- if (textStatus == "timeout") {
- alert ("Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists");
+ if ($(".error", xhr.responseXML).length > 0) {
+ $('#form_notice').append(document._importNode($(".error", xhr.responseXML).get(0), true));
}
else {
- switch(xhr.status) {
- default: case 404:
- alert("Sorry! We had trouble sending your notice. Please report the problem to the site administrator if this happens again.");
- break;
- case 502: case 503: case 504:
- alert("Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists.");
- break;
- }
+ alert("Sorry! We had trouble sending your notice ("+xhr.status+" "+xhr.statusText+"). Please report the problem to the site administrator if this happens again.");
}
},
success: function(xml) { if ($("#error", xml).length > 0) {
@@ -197,11 +188,15 @@ $(document).ready(function(){
alert(result);
}
else {
- $("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true));
- $("#notices_primary .notice:first").css({display:"none"});
- $("#notices_primary .notice:first").fadeIn(2500);
- NoticeHover();
- NoticeReply();
+ li = $("li", xml).get(0);
+ id = li.id;
+ if ($("#"+li.id).length == 0) {
+ $("#notices_primary .notices").prepend(document._importNode(li, true));
+ $("#notices_primary .notice:first").css({display:"none"});
+ $("#notices_primary .notice:first").fadeIn(2500);
+ NoticeHover();
+ NoticeReply();
+ }
}
$("#notice_data-text").val("");
counter();
diff --git a/lib/galleryaction.php b/lib/galleryaction.php
index 0484918ce..8fa11a756 100644
--- a/lib/galleryaction.php
+++ b/lib/galleryaction.php
@@ -134,9 +134,11 @@ class GalleryAction extends Action
$this->elementStart('li', array('id'=>'filter_tags_item'));
$this->elementStart('form', array('name' => 'bytag',
'id' => 'bytag',
+ 'action' => common_path('?action=' . $this->trimmed('action')),
'method' => 'post'));
$this->dropdown('tag', _('Tag'), $content,
_('Choose a tag to narrow list'), false, $tag);
+ $this->hidden('nickname', $this->user->nickname);
$this->submit('submit', _('Go'));
$this->elementEnd('form');
$this->elementEnd('li');
@@ -169,4 +171,4 @@ class GalleryAction extends Action
{
return array();
}
-} \ No newline at end of file
+}
diff --git a/lib/router.php b/lib/router.php
index 6fb2f9487..12590b790 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -231,12 +231,12 @@ class Router
$m->connect('api/statuses/:method',
array('action' => 'api',
'apiaction' => 'statuses'),
- array('method' => '(public_timeline|friends_timeline|user_timeline|update|replies|friends|followers|featured)(\.(atom|rss|xml|json))?'));
+ array('method' => '(public_timeline|friends_timeline|user_timeline|update|replies|mentions|friends|followers|featured)(\.(atom|rss|xml|json))?'));
$m->connect('api/statuses/:method/:argument',
array('action' => 'api',
'apiaction' => 'statuses'),
- array('method' => '(user_timeline|friends_timeline|replies|show|destroy|friends|followers)'));
+ array('method' => '(user_timeline|friends_timeline|replies|mentions|show|destroy|friends|followers)'));
// users
diff --git a/lib/subpeopletagcloudsection.php b/lib/subpeopletagcloudsection.php
index d98f28afa..9f6948dc9 100644
--- a/lib/subpeopletagcloudsection.php
+++ b/lib/subpeopletagcloudsection.php
@@ -74,3 +74,4 @@ class SubPeopleTagCloudSection extends TagCloudSection
$this->out->elementEnd('li');
}
}
+
diff --git a/lib/subscriberspeopleselftagcloudsection.php b/lib/subscriberspeopleselftagcloudsection.php
index b5a39c6de..115241a53 100644
--- a/lib/subscriberspeopleselftagcloudsection.php
+++ b/lib/subscriberspeopleselftagcloudsection.php
@@ -49,6 +49,14 @@ class SubscribersPeopleSelfTagCloudSection extends SubPeopleTagCloudSection
}
function query() {
- return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged group by tag order by weight desc';
+// return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged group by tag order by weight desc';
+
+
+ return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc';
+
+// return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscribed where subscriber=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc';
+
+
}
}
+
diff --git a/lib/subscriberspeopletagcloudsection.php b/lib/subscriberspeopletagcloudsection.php
index 23011efdd..4dafbc1c7 100644
--- a/lib/subscriberspeopletagcloudsection.php
+++ b/lib/subscriberspeopletagcloudsection.php
@@ -53,8 +53,9 @@ class SubscribersPeopleTagCloudSection extends SubPeopleTagCloudSection
return common_local_url('subscribers', array('nickname' => $nickname, 'tag' => $tag));
}
-
function query() {
- return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagged and subscribed=tagger where subscribed=%d and subscriber != subscribed group by tag order by weight desc';
+// return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagged and subscribed=tagger where subscribed=%d and subscriber != subscribed group by tag order by weight desc';
+ return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagged and subscribed=tagger where subscribed=%d and subscriber != subscribed and tag is not null group by tag order by weight desc';
}
}
+
diff --git a/lib/subscriptionspeopleselftagcloudsection.php b/lib/subscriptionspeopleselftagcloudsection.php
index 8ac65adb0..3896294d2 100644
--- a/lib/subscriptionspeopleselftagcloudsection.php
+++ b/lib/subscriptionspeopleselftagcloudsection.php
@@ -49,6 +49,13 @@ class SubscriptionsPeopleSelfTagCloudSection extends SubPeopleTagCloudSection
}
function query() {
- return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscriber != subscribed and tagger = tagged group by tag order by weight desc';
+// return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscriber != subscribed and tagger = tagged group by tag order by weight desc';
+
+
+
+ return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscribed where subscriber=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc';
+
+// return 'select tag, count(tag) as weight from subscription left join profile_tag on tagger = subscriber where subscribed=%d and subscribed != subscriber and tagger = tagged and tag is not null group by tag order by weight desc';
}
}
+
diff --git a/lib/subscriptionspeopletagcloudsection.php b/lib/subscriptionspeopletagcloudsection.php
index c3f7d1763..f9c8672e3 100644
--- a/lib/subscriptionspeopletagcloudsection.php
+++ b/lib/subscriptionspeopletagcloudsection.php
@@ -54,6 +54,8 @@ class SubscriptionsPeopleTagCloudSection extends SubPeopleTagCloudSection
}
function query() {
- return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagger and subscribed=tagged where subscriber=%d and subscriber != subscribed group by tag order by weight desc';
+// return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagger and subscribed=tagged where subscriber=%d and subscriber != subscribed group by tag order by weight desc';
+ return 'select tag, count(tag) as weight from subscription left join profile_tag on subscriber=tagger and subscribed=tagged where subscriber=%d and subscriber != subscribed and tag is not null group by tag order by weight desc';
}
}
+
diff --git a/plugins/LinkbackPlugin.php b/plugins/LinkbackPlugin.php
index 881ead99e..93a0294c4 100644
--- a/plugins/LinkbackPlugin.php
+++ b/plugins/LinkbackPlugin.php
@@ -121,6 +121,12 @@ class LinkbackPlugin extends Plugin
{
$args = array($this->notice->uri, $url);
+ if (!extension_loaded('xmlrpc')) {
+ if (!dl('xmlrpc.so')) {
+ common_log(LOG_ERR, "Can't pingback; xmlrpc extension not available.");
+ }
+ }
+
$request = xmlrpc_encode_request('pingback.ping', $args);
$context = stream_context_create(array('http' => array('method' => "POST",
'header' =>
@@ -141,7 +147,7 @@ class LinkbackPlugin extends Plugin
}
// Largely cadged from trackback_cls.php by
- // Ran Aroussi <ran@blogish.org>, GPL2
+ // Ran Aroussi <ran@blogish.org>, GPL2 or any later version
// http://phptrackback.sourceforge.net/
function getTrackback($text, $url)
diff --git a/scripts/getvaliddaemons.php b/scripts/getvaliddaemons.php
new file mode 100755
index 000000000..482e63af7
--- /dev/null
+++ b/scripts/getvaliddaemons.php
@@ -0,0 +1,52 @@
+#!/usr/bin/env php
+<?php
+/*
+ * Laconica - a distributed open-source microblogging tool
+ * Copyright (C) 2008, Controlez-Vous, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * Utility script to get a list of daemons that should run, based on the
+ * current configuration. This is used by startdaemons.sh to determine what
+ * it should and shouldn't start up. The output is a list of space-separated
+ * daemon names.
+ */
+
+
+# Abort if called from a web server
+if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
+ print "This script must be run from the command line\n";
+ exit();
+}
+
+define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
+define('LACONICA', true);
+
+require_once(INSTALLDIR . '/lib/common.php');
+
+if(common_config('xmpp','enabled')) {
+ echo "xmppdaemon.php jabberqueuehandler.php publicqueuehandler.php ";
+ echo "xmppconfirmhandler.php ";
+}
+if(common_config('memcached','enabled')) {
+ echo "memcachedqueuehandler.php ";
+}
+echo "ombqueuehandler.php ";
+echo "twitterqueuehandler.php ";
+echo "facebookqueuehandler.php ";
+echo "pingqueuehandler.php ";
+echo "inboxqueuehandler.php ";
+echo "smsqueuehandler.php ";
diff --git a/scripts/startdaemons.sh b/scripts/startdaemons.sh
index 66f9ed4e0..3869e95c4 100755
--- a/scripts/startdaemons.sh
+++ b/scripts/startdaemons.sh
@@ -21,11 +21,9 @@
# Note that the 'maildaemon' needs to run as a mail filter.
DIR=`dirname $0`
+DAEMONS=`php $DIR/getvaliddaemons.php`
-for f in xmppdaemon.php jabberqueuehandler.php publicqueuehandler.php \
- xmppconfirmhandler.php smsqueuehandler.php ombqueuehandler.php \
- twitterqueuehandler.php facebookqueuehandler.php pingqueuehandler.php \
- memcachedqueuehandler.php inboxqueuehandler.php; do
+for f in $DAEMONS; do
echo -n "Starting $f...";
php $DIR/$f
diff --git a/scripts/stopdaemons.sh b/scripts/stopdaemons.sh
index 196991de0..f6d71eddf 100755
--- a/scripts/stopdaemons.sh
+++ b/scripts/stopdaemons.sh
@@ -25,7 +25,7 @@ DIR=`php $SDIR/getpiddir.php`
for f in jabberhandler ombhandler publichandler smshandler pinghandler \
xmppconfirmhandler xmppdaemon twitterhandler facebookhandler \
- memcachedhandler inboxhandler; do
+ memcachehandler inboxhandler; do
FILES="$DIR/$f.*.pid"
for ff in "$FILES" ; do
diff --git a/theme/base/css/display.css b/theme/base/css/display.css
index 2fb1c007f..dc6b4bc29 100644
--- a/theme/base/css/display.css
+++ b/theme/base/css/display.css
@@ -86,7 +86,7 @@ border:0;
.error,
.success {
-padding:4px 7px;
+padding:4px 1.55%;
border-radius:4px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
@@ -426,6 +426,7 @@ line-height:1;
#form_notice fieldset {
border:0;
padding:0;
+position:relative;
}
#form_notice legend {
display:none;
@@ -480,7 +481,13 @@ margin-bottom:7px;
margin-left:18px;
float:left;
}
-
+#form_notice .error {
+float:left;
+clear:both;
+width:96.9%;
+margin-bottom:0;
+line-height:1.618;
+}
/* entity_profile */
.entity_profile {
@@ -835,23 +842,6 @@ text-transform:lowercase;
}
-
-.notice-data {
-position:absolute;
-top:18px;
-right:0;
-min-height:50px;
-margin-bottom:4px;
-}
-.notice .entry-content .notice-data dt {
-display:none;
-}
-
-.notice-data a {
-display:block;
-outline:none;
-}
-
.notice-options {
padding-left:2%;
float:left;
@@ -1029,6 +1019,8 @@ padding-right:30px;
.hentry .entry-content p {
margin-bottom:18px;
}
+.system_notice ul,
+.instructions ul,
.hentry entry-content ol,
.hentry .entry-content ul {
list-style-position:inside;
@@ -1153,9 +1145,6 @@ clear:both;
margin-bottom:0;
}
-.instructions ul {
-list-style-position:inside;
-}
.instructions p,
.instructions ul {
margin-bottom:18px;