summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Shorturl_api.php2
-rw-r--r--lib/arraywrapper.php2
-rw-r--r--lib/channel.php2
-rw-r--r--lib/clienterroraction.php2
-rw-r--r--lib/command.php2
-rw-r--r--lib/commandinterpreter.php2
-rw-r--r--lib/common.php11
-rw-r--r--lib/daemon.php2
-rw-r--r--lib/dberroraction.php2
-rw-r--r--lib/error.php2
-rw-r--r--lib/facebookutil.php2
-rw-r--r--lib/galleryaction.php2
-rw-r--r--lib/noticeform.php2
-rw-r--r--lib/oauthstore.php2
-rw-r--r--lib/omb.php2
-rw-r--r--lib/openid.php2
-rw-r--r--lib/peoplesearchresults.php2
-rw-r--r--lib/queuehandler.php2
-rw-r--r--lib/rssaction.php4
-rw-r--r--lib/search_engines.php41
-rw-r--r--lib/searchaction.php6
-rw-r--r--lib/servererroraction.php2
-rw-r--r--lib/subs.php2
-rw-r--r--lib/theme.php36
-rw-r--r--lib/twitter.php2
-rw-r--r--lib/twitterapi.php2
-rw-r--r--lib/util.php2
-rw-r--r--lib/xmppqueuehandler.php2
28 files changed, 103 insertions, 41 deletions
diff --git a/lib/Shorturl_api.php b/lib/Shorturl_api.php
index 924aa93a8..29f4eb3a6 100644
--- a/lib/Shorturl_api.php
+++ b/lib/Shorturl_api.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
diff --git a/lib/arraywrapper.php b/lib/arraywrapper.php
index ef0eeffa5..a8a12b3bb 100644
--- a/lib/arraywrapper.php
+++ b/lib/arraywrapper.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
diff --git a/lib/channel.php b/lib/channel.php
index f1e205546..38c1d4d67 100644
--- a/lib/channel.php
+++ b/lib/channel.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
diff --git a/lib/clienterroraction.php b/lib/clienterroraction.php
index 0c48414d5..7ddc35eb6 100644
--- a/lib/clienterroraction.php
+++ b/lib/clienterroraction.php
@@ -13,7 +13,7 @@
* @link http://laconi.ca/
*
* 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
diff --git a/lib/command.php b/lib/command.php
index 507990a0b..564661382 100644
--- a/lib/command.php
+++ b/lib/command.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
diff --git a/lib/commandinterpreter.php b/lib/commandinterpreter.php
index 49c733c03..6538d4442 100644
--- a/lib/commandinterpreter.php
+++ b/lib/commandinterpreter.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
diff --git a/lib/common.php b/lib/common.php
index 17eed71cd..a8c7634f6 100644
--- a/lib/common.php
+++ b/lib/common.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
@@ -94,7 +94,6 @@ $config =
array('name' => 'Just another Laconica microblog',
'server' => $_server,
'theme' => 'default',
- 'skin' => 'default',
'design' =>
array('backgroundcolor' => '#F0F2F5',
'contentcolor' => '#FFFFFF',
@@ -152,7 +151,9 @@ $config =
'blacklist' => array(),
'autosource' => array()),
'theme' =>
- array('server' => null),
+ array('server' => null,
+ 'dir' => null,
+ 'path'=> null),
'throttle' =>
array('enabled' => false, // whether to throttle edits; false by default
'count' => 20, // number of allowed messages in timespan
@@ -240,7 +241,9 @@ $config =
),
'group' =>
array('maxaliases' => 3),
- 'oohembed' => array('endpoint' => 'http://oohembed.com/oohembed/')
+ 'oohembed' => array('endpoint' => 'http://oohembed.com/oohembed/'),
+ 'search' =>
+ array('type' => 'fulltext'),
);
$config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');
diff --git a/lib/daemon.php b/lib/daemon.php
index 9c1ae50a0..a0df00bdc 100644
--- a/lib/daemon.php
+++ b/lib/daemon.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
diff --git a/lib/dberroraction.php b/lib/dberroraction.php
index 0dc92490c..a04e5f74f 100644
--- a/lib/dberroraction.php
+++ b/lib/dberroraction.php
@@ -12,7 +12,7 @@
* @link http://laconi.ca/
*
* 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
diff --git a/lib/error.php b/lib/error.php
index 282682133..bbf9987cf 100644
--- a/lib/error.php
+++ b/lib/error.php
@@ -13,7 +13,7 @@
* @link http://laconi.ca/
*
* 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
diff --git a/lib/facebookutil.php b/lib/facebookutil.php
index 242d2e06f..4d0df797b 100644
--- a/lib/facebookutil.php
+++ b/lib/facebookutil.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
diff --git a/lib/galleryaction.php b/lib/galleryaction.php
index 498c82851..b389fc00f 100644
--- a/lib/galleryaction.php
+++ b/lib/galleryaction.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
diff --git a/lib/noticeform.php b/lib/noticeform.php
index a36b7f31f..4e2a2edd6 100644
--- a/lib/noticeform.php
+++ b/lib/noticeform.php
@@ -151,12 +151,12 @@ class NoticeForm extends Form
'140');
$this->out->elementEnd('dl');
if (common_config('attachments', 'uploads')) {
- $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
$this->out->element('label', array('for' => 'notice_data-attach'),_('Attach'));
$this->out->element('input', array('id' => 'notice_data-attach',
'type' => 'file',
'name' => 'attach',
'title' => _('Attach a file')));
+ $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
}
if ($this->action) {
$this->out->hidden('notice_return-to', $this->action, 'returnto');
diff --git a/lib/oauthstore.php b/lib/oauthstore.php
index 183164e17..f224c6c22 100644
--- a/lib/oauthstore.php
+++ b/lib/oauthstore.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
diff --git a/lib/omb.php b/lib/omb.php
index 40cb847df..4f6a96095 100644
--- a/lib/omb.php
+++ b/lib/omb.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
diff --git a/lib/openid.php b/lib/openid.php
index 3af7a39cf..0b7633284 100644
--- a/lib/openid.php
+++ b/lib/openid.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
diff --git a/lib/peoplesearchresults.php b/lib/peoplesearchresults.php
index 9d9d17299..9f6696b5f 100644
--- a/lib/peoplesearchresults.php
+++ b/lib/peoplesearchresults.php
@@ -12,7 +12,7 @@
* @link http://laconi.ca/
*
* 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
diff --git a/lib/queuehandler.php b/lib/queuehandler.php
index f76f16e07..d5e0150d9 100644
--- a/lib/queuehandler.php
+++ b/lib/queuehandler.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
diff --git a/lib/rssaction.php b/lib/rssaction.php
index eafdbf131..6f6c9a8cb 100644
--- a/lib/rssaction.php
+++ b/lib/rssaction.php
@@ -212,6 +212,10 @@ class Rss10Action extends Action
$this->element('sioc:has_creator', array('rdf:resource' => $creator_uri.'#acct'));
$this->element('laconica:postIcon', array('rdf:resource' => $profile->avatarUrl()));
$this->element('cc:licence', array('rdf:resource' => common_config('license', 'url')));
+ if ($notice->reply_to) {
+ $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to));
+ $this->element('sioc:reply_to', array('rdf:resource' => $replyurl));
+ }
$this->elementEnd('item');
$this->creators[$creator_uri] = $profile;
}
diff --git a/lib/search_engines.php b/lib/search_engines.php
index 7b9dbb618..772f41883 100644
--- a/lib/search_engines.php
+++ b/lib/search_engines.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
@@ -118,12 +118,20 @@ class MySQLSearch extends SearchEngine
}
return true;
} else if ('identica_notices' === $this->table) {
- $this->target->whereAdd('MATCH(content) ' .
- 'AGAINST (\''.addslashes($q).'\' IN BOOLEAN MODE)');
+
+ // Don't show imported notices
+ $this->target->whereAdd('notice.is_local != ' . NOTICE_GATEWAY);
+
if (strtolower($q) != $q) {
+ $this->target->whereAdd("( MATCH(content) AGAINST ('" . addslashes($q) .
+ "' IN BOOLEAN MODE)) OR ( MATCH(content) " .
+ "AGAINST ('" . addslashes(strtolower($q)) .
+ "' IN BOOLEAN MODE))");
+ } else {
$this->target->whereAdd('MATCH(content) ' .
- 'AGAINST (\''.addslashes(strtolower($q)).'\' IN BOOLEAN MODE)', 'OR');
+ 'AGAINST (\''.addslashes($q).'\' IN BOOLEAN MODE)');
}
+
return true;
} else {
throw new ServerException('Unknown table: ' . $this->table);
@@ -131,6 +139,28 @@ class MySQLSearch extends SearchEngine
}
}
+class MySQLLikeSearch extends SearchEngine
+{
+ function query($q)
+ {
+ if ('identica_people' === $this->table) {
+ $qry = sprintf('(nickname LIKE "%%%1$s%%" OR '.
+ ' fullname LIKE "%%%1$s%%" OR '.
+ ' location LIKE "%%%1$s%%" OR '.
+ ' bio LIKE "%%%1$s%%" OR '.
+ ' homepage LIKE "%%%1$s%%")', addslashes($q));
+ } else if ('identica_notices' === $this->table) {
+ $qry = sprintf('content LIKE "%%%1$s%%"', addslashes($q));
+ } else {
+ throw new ServerException('Unknown table: ' . $this->table);
+ }
+
+ $this->target->whereAdd($qry);
+
+ return true;
+ }
+}
+
class PGSearch extends SearchEngine
{
function query($q)
@@ -138,6 +168,9 @@ class PGSearch extends SearchEngine
if ('identica_people' === $this->table) {
return $this->target->whereAdd('textsearch @@ plainto_tsquery(\''.addslashes($q).'\')');
} else if ('identica_notices' === $this->table) {
+
+ // XXX: We need to filter out gateway notices (notice.is_local = -2) --Zach
+
return $this->target->whereAdd('to_tsvector(\'english\', content) @@ plainto_tsquery(\''.addslashes($q).'\')');
} else {
throw new ServerException('Unknown table: ' . $this->table);
diff --git a/lib/searchaction.php b/lib/searchaction.php
index e74450e11..34fe9373f 100644
--- a/lib/searchaction.php
+++ b/lib/searchaction.php
@@ -12,7 +12,7 @@
* @link http://laconi.ca/
*
* 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
@@ -148,10 +148,10 @@ You can also try your search on other engines:
* [Tweet scan](http://www.tweetscan.com/indexi.php?s=%s)
* [Google](http://www.google.com/search?q=site%%3A%%%%site.server%%%%+%s)
* [Yahoo](http://search.yahoo.com/search?p=site%%3A%%%%site.server%%%%+%s)
-
+* [Collecta](http://collecta.com/#q=%s)
E_O_T
-), $qe, $qe, $qe, $qe);
+), $qe, $qe, $qe, $qe, $qe);
$this->elementStart('dl', array('id' => 'help_search', 'class' => 'help'));
$this->element('dt', null, _('Search help'));
$this->elementStart('dd', 'instructions');
diff --git a/lib/servererroraction.php b/lib/servererroraction.php
index 595dcf147..db7352166 100644
--- a/lib/servererroraction.php
+++ b/lib/servererroraction.php
@@ -13,7 +13,7 @@
* @link http://laconi.ca/
*
* 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
diff --git a/lib/subs.php b/lib/subs.php
index 0e7b9ded5..3bd67b39c 100644
--- a/lib/subs.php
+++ b/lib/subs.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
diff --git a/lib/theme.php b/lib/theme.php
index 0d8824822..2fe6ab69b 100644
--- a/lib/theme.php
+++ b/lib/theme.php
@@ -43,10 +43,14 @@ if (!defined('LACONICA')) {
function theme_file($relative, $theme=null)
{
- if (!$theme) {
+ if (empty($theme)) {
$theme = common_config('site', 'theme');
}
- return INSTALLDIR.'/theme/'.$theme.'/'.$relative;
+ $dir = common_config('theme', 'dir');
+ if (empty($dir)) {
+ $dir = INSTALLDIR.'/theme';
+ }
+ return $dir.'/'.$theme.'/'.$relative;
}
/**
@@ -60,13 +64,31 @@ function theme_file($relative, $theme=null)
function theme_path($relative, $theme=null)
{
- if (!$theme) {
+ if (empty($theme)) {
$theme = common_config('site', 'theme');
}
+
+ $path = common_config('theme', 'path');
+
+ if (empty($path)) {
+ $path = common_config('site', 'path') . '/theme/';
+ }
+
+ if ($path[strlen($path)-1] != '/') {
+ $path .= '/';
+ }
+
+ if ($path[0] != '/') {
+ $path = '/'.$path;
+ }
+
$server = common_config('theme', 'server');
- if ($server) {
- return 'http://'.$server.'/'.$theme.'/'.$relative;
- } else {
- return common_path('theme/'.$theme.'/'.$relative);
+
+ if (empty($server)) {
+ $server = common_config('site', 'server');
}
+
+ // XXX: protocol
+
+ return 'http://'.$server.$path.$theme.'/'.$relative;
}
diff --git a/lib/twitter.php b/lib/twitter.php
index c1d0dc254..3ec082686 100644
--- a/lib/twitter.php
+++ b/lib/twitter.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
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index 269b60efc..f538a0298 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.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
diff --git a/lib/util.php b/lib/util.php
index 1d5708bd6..0aff893fd 100644
--- a/lib/util.php
+++ b/lib/util.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
diff --git a/lib/xmppqueuehandler.php b/lib/xmppqueuehandler.php
index 91015fd45..a078cd9f7 100644
--- a/lib/xmppqueuehandler.php
+++ b/lib/xmppqueuehandler.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