summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-03-06 16:17:58 -0800
committerEvan Prodromou <evan@controlyourself.ca>2009-03-06 16:17:58 -0800
commit13c183e2f4e0738233658ca79103bbe4a6d57992 (patch)
tree298b18c43906919b2ee615e20f3507f333354575 /lib/util.php
parent9a2f3358537566084a29fd421891fbc236185e9f (diff)
parent0617c7b7730e4e42cd6285737f9fe999688fbdc6 (diff)
Merge branch '0.7.x' into 0.8.x
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/util.php b/lib/util.php
index 18e4f310c..9637dc506 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'])) {
@@ -618,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');
@@ -842,7 +852,7 @@ function common_broadcast_notice($notice, $remote=false)
function common_enqueue_notice($notice)
{
- foreach (array('jabber', 'omb', 'sms', 'public', 'twitter', 'facebook') as $transport) {
+ foreach (array('jabber', 'omb', 'sms', 'public', 'twitter', 'facebook', 'ping') as $transport) {
$qi = new Queue_item();
$qi->notice_id = $notice->id;
$qi->transport = $transport;