diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common.php | 27 | ||||
-rw-r--r-- | lib/stream.php | 4 |
2 files changed, 27 insertions, 4 deletions
diff --git a/lib/common.php b/lib/common.php index f7b93011c..4cef9f0d9 100644 --- a/lib/common.php +++ b/lib/common.php @@ -33,7 +33,9 @@ define('MAX_AVATAR_SIZE', 256 * 1024); $config = array('site' => - array('name' => 'Just another µB'), + array('name' => 'Just another µB', + 'server' => 'localhost', + 'path' => '/'), 'avatar' => array('directory' => INSTALLDIR . 'files', 'path' => '/files'), @@ -258,13 +260,13 @@ function common_avatar_url($filename) { } function common_local_url($action, $args) { + global $config; /* XXX: pretty URLs */ $extra = ''; foreach ($args as $key => $value) { $extra .= "&${key}=${value}"; } - /* XXX: correct path */ - return "/index.php?action=${action}${extra}"; + return "http://".$config['site']['server'].'/'.$config['site']['path']."/index.php?action=${action}${extra}"; } function commmon_date_string($dt) { @@ -272,6 +274,25 @@ function commmon_date_string($dt) { return date(DATE_RFC822); } +function common_redirect($url, $code=307) { + static $status = (301 => "Moved Permanently", + 302 => "Found", + 303 => "See Other", + 307 => "Temporary Redirect"); + header("Status: ${code} $status[$code]"); + header("Location: $url"); + common_element('a', array('href' => $url), $url); +} + +function common_broadcast_notices($id) { + // XXX: broadcast notices to remote subscribers + // XXX: broadcast notices to SMS + // XXX: broadcast notices to Jabber + // XXX: broadcast notices to other IM + // XXX: use a queue system like http://code.google.com/p/microapps/wiki/NQDQ + return true; +} + // XXX: set up gettext function _t($str) { $str } diff --git a/lib/stream.php b/lib/stream.php index 912969380..6b2ab24ff 100644 --- a/lib/stream.php +++ b/lib/stream.php @@ -47,7 +47,9 @@ class StreamAction extends Action { $profile->nickname); # FIXME: URL, image, video, audio common_element('span', array('class' => 'content'), $notice->content); - common_element('span', array('class' => 'date'), + $noticeurl = common_local_url('shownotice', array('notice' => $notice->id)); + common_element('a', array('class' => 'notice', + 'href' => $noticeurl), common_date_string($notice->created)); common_end_element('div'); } |