aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2011-12-31 20:14:45 +0100
committerSem <sembrestels@riseup.net>2011-12-31 20:14:45 +0100
commit9f4da6d87f2c520b975f968cedbcde4f3dce1a25 (patch)
treefee953cf498b6083faf56c61042d3bee07110331 /mod
parenta22660e997611fe2afb97689ea23774578ee80db (diff)
parente49df853b2cc3a6a9bc2dd527a64951050142eb9 (diff)
downloadelgg-9f4da6d87f2c520b975f968cedbcde4f3dce1a25.tar.gz
elgg-9f4da6d87f2c520b975f968cedbcde4f3dce1a25.tar.bz2
Merge git://github.com/Elgg/Elgg
Diffstat (limited to 'mod')
-rw-r--r--mod/blog/actions/blog/auto_save_revision.php2
-rw-r--r--mod/blog/actions/blog/save.php4
-rw-r--r--mod/developers/start.php14
-rw-r--r--mod/embed/manifest.xml5
-rw-r--r--mod/embed/start.php27
-rw-r--r--mod/embed/views/default/embed/layout.php7
-rw-r--r--mod/embed/views/default/js/embed/embed.php32
-rw-r--r--mod/externalpages/start.php7
-rw-r--r--mod/file/views/default/embed/file_upload/content.php3
-rw-r--r--mod/groups/start.php2
-rw-r--r--mod/groups/views/default/groups/membershiprequests.php3
-rw-r--r--mod/likes/start.php5
-rw-r--r--mod/logbrowser/start.php2
-rw-r--r--mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php12
-rw-r--r--mod/logbrowser/views/default/logbrowser/refine.php7
-rw-r--r--mod/messages/languages/en.php1
-rw-r--r--mod/messages/start.php5
-rw-r--r--mod/messages/views/default/forms/messages/process.php3
-rw-r--r--mod/oauth_api/manifest.xml4
-rw-r--r--mod/profile/start.php2
-rw-r--r--mod/profile/views/default/profile/owner_block.php5
-rw-r--r--mod/search/pages/search/index.php7
-rw-r--r--mod/search/start.php5
-rw-r--r--mod/search/views/default/search/search_box.php7
-rw-r--r--mod/thewire/pages/thewire/everyone.php3
-rw-r--r--mod/thewire/pages/thewire/friends.php2
-rw-r--r--mod/thewire/pages/thewire/owner.php2
-rw-r--r--mod/thewire/start.php2
-rw-r--r--mod/uservalidationbyemail/lib/functions.php8
-rw-r--r--mod/uservalidationbyemail/start.php11
30 files changed, 155 insertions, 44 deletions
diff --git a/mod/blog/actions/blog/auto_save_revision.php b/mod/blog/actions/blog/auto_save_revision.php
index 1acf3b31b..66b65c5fd 100644
--- a/mod/blog/actions/blog/auto_save_revision.php
+++ b/mod/blog/actions/blog/auto_save_revision.php
@@ -63,7 +63,7 @@ if ($title && $description) {
if (!$auto_save) {
$annotation_id = $blog->annotate('blog_auto_save', $description);
} elseif ($auto_save instanceof ElggAnnotation && $auto_save->value != $description) {
- $blog->clearAnnotations('blog_auto_save');
+ $blog->deleteAnnotations('blog_auto_save');
$annotation_id = $blog->annotate('blog_auto_save', $description);
} elseif ($auto_save instanceof ElggAnnotation && $auto_save->value == $description) {
// this isn't an error because we have an up to date annotation.
diff --git a/mod/blog/actions/blog/save.php b/mod/blog/actions/blog/save.php
index 8be67ec6c..8ca8ce846 100644
--- a/mod/blog/actions/blog/save.php
+++ b/mod/blog/actions/blog/save.php
@@ -131,10 +131,10 @@ if (!$error) {
elgg_clear_sticky_form('blog');
// remove autosave draft if exists
- $blog->clearAnnotations('blog_auto_save');
+ $blog->deleteAnnotations('blog_auto_save');
// no longer a brand new post.
- $blog->clearMetadata('new_post');
+ $blog->deleteMetadata('new_post');
// if this was an edit, create a revision annotation
if (!$new_post && $revision_text) {
diff --git a/mod/developers/start.php b/mod/developers/start.php
index 2e3df7663..79ec0655a 100644
--- a/mod/developers/start.php
+++ b/mod/developers/start.php
@@ -23,6 +23,8 @@ function developers_init() {
elgg_register_js('jquery.jstree', 'mod/developers/vendors/jsTree/jquery.jstree.js', 'footer');
elgg_register_css('jquery.jstree', 'mod/developers/vendors/jsTree/themes/default/style.css');
+ elgg_load_js('jquery.form');
+
elgg_register_js('elgg.dev', 'js/developers/developers.js', 'footer');
elgg_load_js('elgg.dev');
}
@@ -166,13 +168,13 @@ function developers_theme_preview_controller($page) {
$pages = array(
'buttons',
- 'components',
- 'forms',
- 'grid',
+ 'components',
+ 'forms',
+ 'grid',
'icons',
- 'modules',
- 'navigation',
- 'typography',
+ 'modules',
+ 'navigation',
+ 'typography',
);
foreach ($pages as $page_name) {
diff --git a/mod/embed/manifest.xml b/mod/embed/manifest.xml
index 7ffbc23a4..46ab2df9e 100644
--- a/mod/embed/manifest.xml
+++ b/mod/embed/manifest.xml
@@ -13,9 +13,10 @@
<type>elgg_release</type>
<version>1.8</version>
</requires>
- <requires>
+ <suggests>
<type>plugin</type>
<name>file</name>
- </requires>
+ <version>1.8.1</version>
+ </suggests>
<activate_on_install>true</activate_on_install>
</plugin_manifest>
diff --git a/mod/embed/start.php b/mod/embed/start.php
index 015c0c0e4..a3ccab66b 100644
--- a/mod/embed/start.php
+++ b/mod/embed/start.php
@@ -37,10 +37,15 @@ function embed_longtext_menu($hook, $type, $items, $vars) {
if (elgg_get_context() == 'embed') {
return $items;
}
+
+ $url = 'embed';
+ if (elgg_get_page_owner_guid()) {
+ $url = 'embed?container_guid=' . elgg_get_page_owner_guid();
+ }
$items[] = ElggMenuItem::factory(array(
'name' => 'embed',
- 'href' => "embed",
+ 'href' => $url,
'text' => elgg_echo('embed:media'),
'rel' => 'lightbox',
'link_class' => "elgg-longtext-control elgg-lightbox embed-control embed-control-{$vars['id']}",
@@ -49,6 +54,7 @@ function embed_longtext_menu($hook, $type, $items, $vars) {
elgg_load_js('lightbox');
elgg_load_css('lightbox');
+ elgg_load_js('jquery.form');
elgg_load_js('elgg.embed');
return $items;
@@ -64,7 +70,9 @@ function embed_longtext_menu($hook, $type, $items, $vars) {
*/
function embed_select_tab($hook, $type, $items, $vars) {
- $tab_name = array_pop(explode('/', full_url()));
+ // can this ba called from page handler instead?
+ $page = get_input('page');
+ $tab_name = array_pop(explode('/', $page));
foreach ($items as $item) {
if ($item->getName() == $tab_name) {
$item->setSelected();
@@ -85,6 +93,11 @@ function embed_select_tab($hook, $type, $items, $vars) {
*/
function embed_page_handler($page) {
+ $container_guid = (int)get_input('container_guid');
+ if ($container_guid) {
+ elgg_set_page_owner_guid($container_guid);
+ }
+
echo elgg_view('embed/layout');
// exit because this is in a modal display.
@@ -120,15 +133,17 @@ function embed_list_items($entities, $vars = array()) {
*/
function embed_get_list_options($options = array()) {
+ $container_guids = array(elgg_get_logged_in_user_guid());
if (elgg_get_page_owner_guid()) {
- $container_guid = elgg_get_page_owner_guid();
- } else {
- $container_guid = elgg_get_logged_in_user_guid();
+ $page_owner_guid = elgg_get_page_owner_guid();
+ if ($page_owner_guid != elgg_get_logged_in_user_guid()) {
+ $container_guids[] = $page_owner_guid;
+ }
}
$defaults = array(
'limit' => 6,
- 'container_guid' => $container_guid,
+ 'container_guids' => $container_guids,
'item_class' => 'embed-item',
);
diff --git a/mod/embed/views/default/embed/layout.php b/mod/embed/views/default/embed/layout.php
index c1e43f13c..e906160b1 100644
--- a/mod/embed/views/default/embed/layout.php
+++ b/mod/embed/views/default/embed/layout.php
@@ -21,10 +21,17 @@ if ($selected->getData('view')) {
}
}
+
+$container_info = elgg_view('input/hidden', array(
+ 'name' => 'embed_container_guid',
+ 'value' => elgg_get_page_owner_guid(),
+));
+
echo <<<HTML
<div class="embed-wrapper">
$title
$menu
$tab
+ $container_info
</div>
HTML;
diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php
index 8a8f0290c..5fd534a09 100644
--- a/mod/embed/views/default/js/embed/embed.php
+++ b/mod/embed/views/default/js/embed/embed.php
@@ -35,7 +35,12 @@ elgg.embed.insert = function(event) {
// generalize this based on a css class attached to what should be inserted
var content = ' ' + $(this).find(".embed-insert").parent().html() + ' ';
-
+
+ // this is a temporary work-around for #3971
+ if (content.indexOf('thumbnail.php') != -1) {
+ content = content.replace('size=small', 'size=medium');
+ }
+
textArea.val(textArea.val() + content);
textArea.focus();
@@ -75,9 +80,13 @@ elgg.embed.submit = function(event) {
if (response.status >= 0) {
var forward = $('input[name=embed_forward]').val();
var url = elgg.normalize_url('embed/tab/' + forward);
+ url = elgg.embed.addContainerGUID(url);
$('.embed-wrapper').parent().load(url);
}
}
+ },
+ error: function(xhr, status) {
+ // nothing for now
}
});
@@ -93,8 +102,27 @@ elgg.embed.submit = function(event) {
* @return void
*/
elgg.embed.forward = function(event) {
- $('.embed-wrapper').parent().load($(this).attr('href'));
+ // make sure container guid is passed
+ var url = $(this).attr('href');
+ url = elgg.embed.addContainerGUID(url);
+
+ $('.embed-wrapper').parent().load(url);
event.preventDefault();
};
+/**
+ * Adds the container guid to a URL
+ *
+ * @param {string} url
+ * @return string
+ */
+elgg.embed.addContainerGUID = function(url) {
+ if (url.indexOf('container_guid=') == -1) {
+ var guid = $('input[name=embed_container_guid]').val();
+ return url + '?container_guid=' + guid;
+ } else {
+ return url;
+ }
+};
+
elgg.register_hook_handler('init', 'system', elgg.embed.init);
diff --git a/mod/externalpages/start.php b/mod/externalpages/start.php
index 13235af53..152a8b4d9 100644
--- a/mod/externalpages/start.php
+++ b/mod/externalpages/start.php
@@ -43,8 +43,11 @@ function expages_setup_footer_menu() {
$pages = array('about', 'terms', 'privacy');
foreach ($pages as $page) {
$url = "$page";
- $item = new ElggMenuItem($page, elgg_echo("expages:$page"), $url);
- elgg_register_menu_item('walled_garden', $item);
+ $wg_item = new ElggMenuItem($page, elgg_echo("expages:$page"), $url);
+ elgg_register_menu_item('walled_garden', $wg_item);
+
+ $footer_item = clone $wg_item;
+ elgg_register_menu_item('footer', $footer_item);
}
}
diff --git a/mod/file/views/default/embed/file_upload/content.php b/mod/file/views/default/embed/file_upload/content.php
index 4d3db0d97..8b630c828 100644
--- a/mod/file/views/default/embed/file_upload/content.php
+++ b/mod/file/views/default/embed/file_upload/content.php
@@ -7,7 +7,8 @@ $form_vars = array(
'enctype' => 'multipart/form-data',
'class' => 'elgg-form-embed',
);
-echo elgg_view_form('file/upload', $form_vars);
+$body_vars = array('container_guid' => elgg_get_page_owner_guid());
+echo elgg_view_form('file/upload', $form_vars, $body_vars);
// the tab we want to be forwarded to after upload is complete
echo elgg_view('input/hidden', array(
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 7dcf6b7c4..09362cbbc 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -830,7 +830,7 @@ function discussion_add_to_river_menu($hook, $type, $return, $params) {
if (elgg_instanceof($object, 'object', 'groupforumtopic')) {
if ($item->annotation_id == 0) {
$group = $object->getContainerEntity();
- if ($group->canWriteToContainer() || elgg_is_admin_logged_in()) {
+ if ($group && ($group->canWriteToContainer() || elgg_is_admin_logged_in())) {
$options = array(
'name' => 'reply',
'href' => "#groups-reply-$object->guid",
diff --git a/mod/groups/views/default/groups/membershiprequests.php b/mod/groups/views/default/groups/membershiprequests.php
index 9cd28262f..2bac0e32b 100644
--- a/mod/groups/views/default/groups/membershiprequests.php
+++ b/mod/groups/views/default/groups/membershiprequests.php
@@ -7,7 +7,6 @@
*/
if (!empty($vars['requests']) && is_array($vars['requests'])) {
- $user = elgg_get_logged_in_user_entity();
echo '<ul class="elgg-list">';
foreach ($vars['requests'] as $user) {
$icon = elgg_view_entity_icon($user, 'tiny', array('use_hover' => 'true'));
@@ -44,5 +43,5 @@ if (!empty($vars['requests']) && is_array($vars['requests'])) {
}
echo '</ul>';
} else {
- echo '<p class="mtm">' . elgg_echo('groups:requests:none') . "</p>";
+ echo '<p class="mtm">' . elgg_echo('groups:requests:none') . '</p>';
}
diff --git a/mod/likes/start.php b/mod/likes/start.php
index 690d7c052..0f8e12159 100644
--- a/mod/likes/start.php
+++ b/mod/likes/start.php
@@ -65,6 +65,11 @@ function likes_river_menu_setup($hook, $type, $return, $params) {
if ($item->type == "group" && $item->view != "river/group/create") {
return $return;
}
+
+ // don't like users #4116
+ if ($item->type == "user") {
+ return $return;
+ }
$object = $item->getObjectEntity();
if (!elgg_in_context('widgets') && $item->annotation_id == 0) {
diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php
index 3bffe800a..22659877b 100644
--- a/mod/logbrowser/start.php
+++ b/mod/logbrowser/start.php
@@ -23,7 +23,7 @@ function logbrowser_init() {
function logbrowser_user_hover_menu($hook, $type, $return, $params) {
$user = $params['entity'];
- $url = "admin/utilities/logbrowser?user_guid={$user->guid}";
+ $url = "admin/administer_utilities/logbrowser?user_guid={$user->guid}";
$item = new ElggMenuItem('logbrowser', elgg_echo('logbrowser:explore'), $url);
$item->setSection('admin');
$return[] = $item;
diff --git a/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php
index 2be1f33dc..a04ef686a 100644
--- a/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php
+++ b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php
@@ -13,14 +13,14 @@ $offset = get_input('offset');
$search_username = get_input('search_username');
if ($search_username) {
if ($user = get_user_by_username($search_username)) {
- $user = $user->guid;
+ $user_guid = $user->guid;
}
} else {
$user_guid = get_input('user_guid',0);
if ($user_guid) {
- $user = (int) $user_guid;
+ $user_guid = (int) $user_guid;
} else {
- $user = "";
+ $user_guid = null;
}
}
@@ -35,14 +35,14 @@ if ($timeupper) {
}
$refine = elgg_view('logbrowser/refine', array(
- 'user_guid' => $user,
+ 'user_guid' => $user_guid,
'timeupper' => $timeupper,
'timelower' => $timelower,
));
// Get log entries
-$log = get_system_log($user, "", "", "","", $limit, $offset, false, $timeupper, $timelower);
-$count = get_system_log($user, "", "", "","", $limit, $offset, true, $timeupper, $timelower);
+$log = get_system_log($user_guid, "", "", "","", $limit, $offset, false, $timeupper, $timelower);
+$count = get_system_log($user_guid, "", "", "","", $limit, $offset, true, $timeupper, $timelower);
$table = elgg_view('logbrowser/table', array('log_entries' => $log));
diff --git a/mod/logbrowser/views/default/logbrowser/refine.php b/mod/logbrowser/views/default/logbrowser/refine.php
index 27cb6042f..86460c79e 100644
--- a/mod/logbrowser/views/default/logbrowser/refine.php
+++ b/mod/logbrowser/views/default/logbrowser/refine.php
@@ -18,13 +18,18 @@ $toggle_link = elgg_view('output/url', array(
'rel' => 'toggle',
));
+$form_class = 'elgg-module elgg-module-inline';
+if (!isset($vars['user_guid'])) {
+ $form_class .= ' hidden';
+}
+
?>
<div id="logbrowser-search-area" class="mbm">
<div>
<?php echo $toggle_link; ?>
</div>
- <div id="log-browser-search-form" class="elgg-module elgg-module-inline hidden">
+ <div id="log-browser-search-form" class="<?php echo $form_class; ?>">
<div class="elgg-head">
<h3><?php echo elgg_echo('logbrowser:search'); ?></h3>
</div>
diff --git a/mod/messages/languages/en.php b/mod/messages/languages/en.php
index 308c3d519..7732a9dce 100644
--- a/mod/messages/languages/en.php
+++ b/mod/messages/languages/en.php
@@ -11,6 +11,7 @@ $english = array(
*/
'messages' => "Messages",
+ 'messages:unreadcount' => "%s unread",
'messages:back' => "back to messages",
'messages:user' => "%s's inbox",
'messages:posttitle' => "%s's messages: %s",
diff --git a/mod/messages/start.php b/mod/messages/start.php
index e4ef4d43a..1a2709324 100644
--- a/mod/messages/start.php
+++ b/mod/messages/start.php
@@ -125,11 +125,13 @@ function messages_notifier() {
if (elgg_is_logged_in()) {
$class = "elgg-icon elgg-icon-mail";
$text = "<span class='$class'></span>";
-
+ $tooltip = elgg_echo("messages");
+
// get unread messages
$num_messages = (int)messages_count_unread();
if ($num_messages != 0) {
$text .= "<span class=\"messages-new\">$num_messages</span>";
+ $tooltip .= " (" . elgg_echo("messages:unreadcount", array($num_messages)) . ")";
}
elgg_register_menu_item('topbar', array(
@@ -137,6 +139,7 @@ function messages_notifier() {
'href' => 'messages/inbox/' . elgg_get_logged_in_user_entity()->username,
'text' => $text,
'priority' => 600,
+ 'title' => $tooltip,
));
}
}
diff --git a/mod/messages/views/default/forms/messages/process.php b/mod/messages/views/default/forms/messages/process.php
index 7e182b8f0..f86c3217a 100644
--- a/mod/messages/views/default/forms/messages/process.php
+++ b/mod/messages/views/default/forms/messages/process.php
@@ -10,7 +10,8 @@
$messages = $vars['list'];
if (!$messages) {
- $messages = elgg_echo('messages:nomessages');
+ echo elgg_echo('messages:nomessages');
+ return true;
}
echo '<div class="messages-container">';
diff --git a/mod/oauth_api/manifest.xml b/mod/oauth_api/manifest.xml
index efd3d944f..991be6a22 100644
--- a/mod/oauth_api/manifest.xml
+++ b/mod/oauth_api/manifest.xml
@@ -18,4 +18,8 @@
<type>plugin</type>
<name>oauth_lib</name>
</conflicts>
+ <conflicts>
+ <type>php_extension</type>
+ <name>oauth</name>
+ </conflicts>
</plugin_manifest>
diff --git a/mod/profile/start.php b/mod/profile/start.php
index adee838fc..abe044632 100644
--- a/mod/profile/start.php
+++ b/mod/profile/start.php
@@ -73,7 +73,7 @@ function profile_page_handler($page) {
// use the core profile edit page
$base_dir = elgg_get_root_path();
require "{$base_dir}pages/profile/edit.php";
- return;
+ return true;
}
// main profile page
diff --git a/mod/profile/views/default/profile/owner_block.php b/mod/profile/views/default/profile/owner_block.php
index 35199726a..63cb5391a 100644
--- a/mod/profile/views/default/profile/owner_block.php
+++ b/mod/profile/views/default/profile/owner_block.php
@@ -11,7 +11,10 @@ if (!$user) {
return TRUE;
}
-$icon = elgg_view_entity_icon($user, 'large', array('use_hover' => 'true'));
+$icon = elgg_view_entity_icon($user, 'large', array(
+ 'use_hover' => false,
+ 'use_link' => false,
+));
// grab the actions and admin menu items from user hover
$menu = elgg_trigger_plugin_hook('register', "menu:user_hover", array('entity' => $user), array());
diff --git a/mod/search/pages/search/index.php b/mod/search/pages/search/index.php
index c4e8d2219..efa3ec037 100644
--- a/mod/search/pages/search/index.php
+++ b/mod/search/pages/search/index.php
@@ -19,7 +19,12 @@ $query = stripslashes(get_input('q', get_input('tag', '')));
// @todo - create function for sanitization of strings for display in 1.8
// encode <,>,&, quotes and characters above 127
-$display_query = mb_convert_encoding($query, 'HTML-ENTITIES', 'UTF-8');
+if (function_exists('mb_convert_encoding')) {
+ $display_query = mb_convert_encoding($query, 'HTML-ENTITIES', 'UTF-8');
+} else {
+ // if no mbstring extension, we just strip characters
+ $display_query = preg_replace("/[^\x01-\x7F]/", "", $query);
+}
$display_query = htmlspecialchars($display_query, ENT_QUOTES, 'UTF-8', false);
// check that we have an actual query
diff --git a/mod/search/start.php b/mod/search/start.php
index 73a96dc0a..bb8531e9c 100644
--- a/mod/search/start.php
+++ b/mod/search/start.php
@@ -107,6 +107,7 @@ function search_get_highlighted_relevant_substrings($haystack, $query, $min_matc
$word = elgg_strtolower($word);
$count = elgg_substr_count($haystack_lc, $word);
$word_len = elgg_strlen($word);
+ $haystack_len = elgg_strlen($haystack_lc);
// find the start positions for the words
if ($count > 1) {
@@ -117,6 +118,10 @@ function search_get_highlighted_relevant_substrings($haystack, $query, $min_matc
$stop = $pos + $word_len + $min_match_context;
$lengths[] = $stop - $start;
$offset += $pos + $word_len;
+
+ if ($offset >= $haystack_len) {
+ break;
+ }
}
} else {
$pos = elgg_strpos($haystack_lc, $word);
diff --git a/mod/search/views/default/search/search_box.php b/mod/search/views/default/search/search_box.php
index 9440dd1de..87d59519c 100644
--- a/mod/search/views/default/search/search_box.php
+++ b/mod/search/views/default/search/search_box.php
@@ -24,7 +24,12 @@ $value = stripslashes($value);
// @todo - create function for sanitization of strings for display in 1.8
// encode <,>,&, quotes and characters above 127
-$display_query = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8');
+if (function_exists('mb_convert_encoding')) {
+ $display_query = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8');
+} else {
+ // if no mbstring extension, we just strip characters
+ $display_query = preg_replace("/[^\x01-\x7F]/", "", $value);
+}
$display_query = htmlspecialchars($display_query, ENT_QUOTES, 'UTF-8', false);
diff --git a/mod/thewire/pages/thewire/everyone.php b/mod/thewire/pages/thewire/everyone.php
index 4e88d17af..909f0caf2 100644
--- a/mod/thewire/pages/thewire/everyone.php
+++ b/mod/thewire/pages/thewire/everyone.php
@@ -8,13 +8,14 @@ elgg_push_breadcrumb(elgg_echo('thewire'));
$title = elgg_echo('thewire:everyone');
+$content = '';
if (elgg_is_logged_in()) {
$form_vars = array('class' => 'thewire-form');
$content .= elgg_view_form('thewire/add', $form_vars);
$content .= elgg_view('input/urlshortener');
}
-$content = elgg_list_entities(array(
+$content .= elgg_list_entities(array(
'type' => 'object',
'subtype' => 'thewire',
'limit' => 15,
diff --git a/mod/thewire/pages/thewire/friends.php b/mod/thewire/pages/thewire/friends.php
index 26ad03da6..e7f5eed59 100644
--- a/mod/thewire/pages/thewire/friends.php
+++ b/mod/thewire/pages/thewire/friends.php
@@ -14,7 +14,7 @@ elgg_push_breadcrumb(elgg_echo('thewire'), "thewire/all");
elgg_push_breadcrumb($owner->name, "thewire/owner/$owner->username");
elgg_push_breadcrumb(elgg_echo('friends'));
-if (get_loggedin_userid() == $owner->guid) {
+if (elgg_get_logged_in_user_guid() == $owner->guid) {
$form_vars = array('class' => 'thewire-form');
$content = elgg_view_form('thewire/add', $form_vars);
$content .= elgg_view('input/urlshortener');
diff --git a/mod/thewire/pages/thewire/owner.php b/mod/thewire/pages/thewire/owner.php
index a95786b0a..f544aa655 100644
--- a/mod/thewire/pages/thewire/owner.php
+++ b/mod/thewire/pages/thewire/owner.php
@@ -14,7 +14,7 @@ $title = elgg_echo('thewire:user', array($owner->name));
elgg_push_breadcrumb(elgg_echo('thewire'), "thewire/all");
elgg_push_breadcrumb($owner->name);
-if (get_loggedin_userid() == $owner->guid) {
+if (elgg_get_logged_in_user_guid() == $owner->guid) {
$form_vars = array('class' => 'thewire-form');
$content = elgg_view_form('thewire/add', $form_vars);
$content .= elgg_view('input/urlshortener');
diff --git a/mod/thewire/start.php b/mod/thewire/start.php
index c0890344f..328e5d46c 100644
--- a/mod/thewire/start.php
+++ b/mod/thewire/start.php
@@ -217,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);
diff --git a/mod/uservalidationbyemail/lib/functions.php b/mod/uservalidationbyemail/lib/functions.php
index eaca374f4..f3091f94d 100644
--- a/mod/uservalidationbyemail/lib/functions.php
+++ b/mod/uservalidationbyemail/lib/functions.php
@@ -87,7 +87,13 @@ function uservalidationbyemail_get_unvalidated_users_sql_where() {
global $CONFIG;
$validated_id = get_metastring_id('validated');
- $one_id = get_metastring_id(1);
+ if ($validated_id === false) {
+ $validated_id = add_metastring('validated');
+ }
+ $one_id = get_metastring_id('1');
+ if ($one_id === false) {
+ $one_id = add_metastring('1');
+ }
// thanks to daveb@freenode for the SQL tips!
$wheres = array();
diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php
index 8de5d0522..ea59a2e7b 100644
--- a/mod/uservalidationbyemail/start.php
+++ b/mod/uservalidationbyemail/start.php
@@ -69,6 +69,17 @@ function uservalidationbyemail_disable_new_user($hook, $type, $value, $params) {
return;
}
+ // another plugin is requesting that registration be terminated
+ // no need for uservalidationbyemail
+ if (!$value) {
+ return $value;
+ }
+
+ // has the user already been validated?
+ if (elgg_get_user_validation_status($user->guid) == true) {
+ return $value;
+ }
+
// disable user to prevent showing up on the site
// set context so our canEdit() override works
elgg_push_context('uservalidationbyemail_new_user');