aboutsummaryrefslogtreecommitdiff
path: root/mod/thewire/start.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/thewire/start.php')
-rw-r--r--mod/thewire/start.php94
1 files changed, 49 insertions, 45 deletions
diff --git a/mod/thewire/start.php b/mod/thewire/start.php
index d5e995359..328e5d46c 100644
--- a/mod/thewire/start.php
+++ b/mod/thewire/start.php
@@ -20,6 +20,7 @@ elgg_register_event_handler('init', 'system', 'thewire_init');
function thewire_init() {
global $CONFIG;
+ // this can be removed in favor of activate/deactivate scripts
if (!update_subtype('object', 'thewire', 'ElggWire')) {
add_subtype('object', 'thewire', 'ElggWire');
}
@@ -84,57 +85,60 @@ function thewire_init() {
* thewire/tag/<tag> View wire posts tagged with <tag>
*
* @param array $page From the page_handler function
- * @return true|false Depending on success
+ * @return bool
*/
function thewire_page_handler($page) {
$base_dir = elgg_get_plugins_path() . 'thewire/pages/thewire';
- // if just /thewire go to global view in the else statement
- if (isset($page[0]) && $page[0]) {
-
- switch ($page[0]) {
- case "all":
- include "$base_dir/everyone.php";
- break;
-
- case "friends":
- include "$base_dir/friends.php";
- break;
-
- case "owner":
- include "$base_dir/owner.php";
- break;
-
- case "thread":
- if (isset($page[1])) {
- set_input('thread_id', $page[1]);
- }
- include "$base_dir/thread.php";
- break;
- case "reply":
- if (isset($page[1])) {
- set_input('guid', $page[1]);
- }
- include "$base_dir/reply.php";
- break;
- case "tag":
- if (isset($page[1])) {
- set_input('tag', $page[1]);
- }
- include "$base_dir/tag.php";
- break;
- case "previous":
- if (isset($page[1])) {
- set_input('guid', $page[1]);
- }
- include "$base_dir/previous.php";
- break;
- }
- } else {
- include "$base_dir/everyone.php";
+ if (!isset($page[0])) {
+ $page = array('all');
}
+ switch ($page[0]) {
+ case "all":
+ include "$base_dir/everyone.php";
+ break;
+
+ case "friends":
+ include "$base_dir/friends.php";
+ break;
+
+ case "owner":
+ include "$base_dir/owner.php";
+ break;
+
+ case "thread":
+ if (isset($page[1])) {
+ set_input('thread_id', $page[1]);
+ }
+ include "$base_dir/thread.php";
+ break;
+
+ case "reply":
+ if (isset($page[1])) {
+ set_input('guid', $page[1]);
+ }
+ include "$base_dir/reply.php";
+ break;
+
+ case "tag":
+ if (isset($page[1])) {
+ set_input('tag', $page[1]);
+ }
+ include "$base_dir/tag.php";
+ break;
+
+ case "previous":
+ if (isset($page[1])) {
+ set_input('guid', $page[1]);
+ }
+ include "$base_dir/previous.php";
+ break;
+
+ default:
+ return false;
+ }
return true;
}
@@ -213,7 +217,7 @@ function thewire_filter($text) {
// usernames
$text = preg_replace(
- '/(^|[^\w])@([\w]+)/',
+ '/(^|[^\w])@([\w.]+)/',
'$1<a href="' . $CONFIG->wwwroot . 'thewire/owner/$2">@$2</a>',
$text);