From 32f81b3c0e7be3da35d5813e5409fa3b65dc220e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 24 Jan 2009 18:38:12 +0100 Subject: Initial support for ping service It makes sense to use the weblogs.com ping service to alert people to changes on the site. So, we do. Includes an extra ping queue handler. --- lib/util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/util.php') diff --git a/lib/util.php b/lib/util.php index b5b194519..419e21e82 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1124,7 +1124,7 @@ function common_twitter_broadcast($notice, $flink) function common_enqueue_notice($notice) { - foreach (array('jabber', 'omb', 'sms', 'public') as $transport) { + foreach (array('jabber', 'omb', 'sms', 'public', 'ping') as $transport) { $qi = new Queue_item(); $qi->notice_id = $notice->id; $qi->transport = $transport; -- cgit v1.2.3-54-g00ecf From f9babf6a7d4215e763a8c1766a2e6592fe274953 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 4 Mar 2009 06:24:33 -0800 Subject: Check for config file when running When running the full system, check for a config file, and throw an error if none is found. --- index.php | 8 ++++++++ lib/common.php | 6 ++++++ lib/util.php | 6 +++++- 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'lib/util.php') diff --git a/index.php b/index.php index 914ba5bde..7f580b836 100644 --- a/index.php +++ b/index.php @@ -61,6 +61,14 @@ function main() { global $user, $action; + if (!_have_config()) { + $msg = sprintf(_("No configuration file found. Try running ". + "the installation program first.")); + $sac = new ServerErrorAction($msg); + $sac->showPage(); + return; + } + // For database errors PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handleError'); diff --git a/lib/common.php b/lib/common.php index 0fff3af2e..ca8dedeef 100644 --- a/lib/common.php +++ b/lib/common.php @@ -187,6 +187,12 @@ foreach ($_config_files as $_config_file) { } } +function _have_config() +{ + global $_have_a_config; + return $_have_a_config; +} + // XXX: Throw a conniption if database not installed // Fixup for laconica.ini diff --git a/lib/util.php b/lib/util.php index 18e4f310c..f9a787d47 100644 --- a/lib/util.php +++ b/lib/util.php @@ -81,7 +81,7 @@ function common_language() // If there is a user logged in and they've set a language preference // then return that one... - if (common_logged_in()) { + if (_have_config() && common_logged_in()) { $user = common_current_user(); $user_language = $user->language; if ($user_language) @@ -315,6 +315,10 @@ function common_current_user() { global $_cur; + if (!_have_config()) { + return null; + } + if ($_cur === false) { if (isset($_REQUEST[session_name()]) || (isset($_SESSION['userid']) && $_SESSION['userid'])) { -- cgit v1.2.3-54-g00ecf From b9781258bbfaac0e7fc91af4f77f1f340274a88e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 5 Mar 2009 11:03:42 -0800 Subject: @-links go to permalinks for local users --- lib/util.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/util.php') diff --git a/lib/util.php b/lib/util.php index f9a787d47..167508d2b 100644 --- a/lib/util.php +++ b/lib/util.php @@ -622,9 +622,15 @@ function common_at_link($sender_id, $nickname) $sender = Profile::staticGet($sender_id); $recipient = common_relative_profile($sender, common_canonical_nickname($nickname)); if ($recipient) { + $user = User::staticGet('id', $recipient->id); + if ($user) { + $url = common_local_url('userbyid', array('id' => $user->id)); + } else { + $url = $recipient->profileurl; + } $xs = new XMLStringer(false); $xs->elementStart('span', 'vcard'); - $xs->elementStart('a', array('href' => $recipient->profileurl, + $xs->elementStart('a', array('href' => $url, 'class' => 'url')); $xs->element('span', 'fn nickname', $nickname); $xs->elementEnd('a'); -- cgit v1.2.3-54-g00ecf