wildcardsearch / mentionme Goto Github PK
View Code? Open in Web Editor NEWA plugin for MyBB 1.8.x that allows Twitter-style tagging and integration with MyAlerts
License: GNU General Public License v3.0
A plugin for MyBB 1.8.x that allows Twitter-style tagging and integration with MyAlerts
License: GNU General Public License v3.0
I don't consider this mission-critical but it does need to be addressed.
Reported here: http://community.mybb.com/thread-131448-post-1064194.html#pid1064194
Should MentionMe have single quote support? http://community.mybb.com/thread-131448-post-1046593.html#pid1046593
@WildcardSearch @'WildcardSearch' @"WildcardSearch" (Woah, better than GitHub! ๐)
It certainly doesn't always happen but now two board owners have confirmed that from time to time (at least) quoted mentions may produce alerts.
Looking into it but haven't found a problem in the code yet.
If a moderator edits a post that contains mentions an alert could be created to the mentioned user and attributed to the moderator editing the post. Need to check if $edit_uid == $post['uid']
and if not, avoid creating mentions altogether.
I've just realized the new version of MentionMe doesn't come with its setting enabled by default. As discussed here it should be quite easy to edit existing functions.
I know @euantor is going to update again the settings system with a reverse logic you've suggested but in the meantime it would be nice to have a working solution. You can see how I've built it up in all my MyAlerts-related plugins (and also in the force_enable_alerts.php script :D).
If you agree with me I'll pop a new Pull Request as fast as possible.
function mention_try_name($username = '')
{
global $db;
static $name_list = array();
if($username)
{
$user_query = $db->simple_select("users", "uid, username, usergroup, displaygroup", "LOWER(username)='" . $db->escape_string(strtolower($username)) . "'", array('limit' => 1));
if($db->num_rows($user_query) === 1)
{
return $db->fetch_array($user_query);
}
}
return false;
}
I don't know why you are using this instead of the core get_user($username)
function. I know you're aiming to retrieve a small amount of data limited to uid, username, usergroup and displaygroup, but get_user
function tries to get data from cache if possible, saving potential queries and server load.
Don't send an alert if the mentioning user is on the mentioned user's ignore list.
Requested here: http://community.mybb.com/thread-131448-post-1062347.html#pid1062347
When looking at #30 I realized that MentionMe can benefit from the new installer that I use on ASB because it adds templates that can be customized per theme.
Currently after force enabling mention alerts the following flash message is show:
Alerts enabled for all users
That is inaccurate and leads the user to believe that all alerts have been force-enabled.
I was supposed to find and move all of this last version ๐ Oh well.
All in all, the mentions do work but for some members it doesn't seem to be working correctly. I think this may be since one of my mods was changing peoples names. This could include him changing their name since they wanted a space or a special character in their name. Example includes, EternalBlaze renamed to Eternal Blaze.
I think this might have affected how some people are not getting mentions anymore and even quote alerts which I also posted about at Euan's github.
Is there anyway I can fix this problem? If there's a "proper" way to have a clean wipe and clean install of it to fix all of these problems, I do not mind doing it but I already tried deactivating, uninstalling, reinstalling, deleting all files off of the FTP and even reuploading but no dice. Any help would be appreciated. Not getting alerts is getting some members a bit rowdy.
Hi @WildcardSearch,
what's up? While digging into MentionMe - I will install it someday on my board ๐ - I've found some parts that may be optimized.
Right now you're hooking into parse_message which is fired for every message when building the postbit. This causes your code to be executed X times per thread where X stands for the number of posts.
You're using a static variable to cache users in multiple lookups and that's really nice. Also, you've built a caching method for commonly mentioned users and this boosts even more the plugin's performances. But here stands the problem: what if there are plenty of mentions in a single thread's page? The scenario:
Although it may seems a rare situation, we can optimize this by changing things a little bit:
Result: one query against 20.
It would be nice to have an option to do not use style for groups (green=admin, purple=moderator etc.)
So disable it and everybody will have same color
The regex is looking for any quote chars (`"|'|``) when it should be looking for a matching pair of the quote character.
Hi
Issue with Facebook registration plugin MyFacebook Connect - when people register via it, their username is like their real name 'firstname lastname'
so mentionme is not able to take the space while tagging them
Help
@Shade- reported this eons ago and I haven't had the chance to make the changes as of yet. Will mark this for 2.3
When the popup is still loading the name cache and the user presses the enter key, it dismisses the popup. This seems unintuitive to me.
In that routine we only need user name but are getting the full name cache set.
Thanks for the great plugin.
I recently installed it and found a bug: When a user edits a post and adds a mention (during the edit), the subject line is blank and the alert does not appear properly.
I traced it to mention_alerts.php, line 61. $post is a local variable (and is blank.)
To fix this, I just added $post to the global declaration on line 43 and it seems to have fixed it:
global $db, $mybb, $Alerts, $post;
Hope this helps...
While reviewing the code in preparation for the next feature release and the improvements to be made I noticed a few things that could be better and a few things that could be implemented to save a little processing power and perhaps a query here and there.
I will try to get this done for the feature release of 1.6 (soon, I hope)
An incorrectly aliased field name causes a Fatal Error for only non-staff members (during permission checks).
Reported here: http://community.mybb.com/thread-131448-post-1063960.html#pid1063960
If an email address coincidentally contains a valid mention (@ + valid username), a mention will be created, spoiling the email address.
Reported here: http://community.mybb.com/thread-131448-post-1063372.html#pid1063372
Really there is another issue in that email addresses will cause unnecessary searches for user names and could increase queries.
A variable is used that was not declared locally therefore creating window.element
unintentionally.
. . . also need to look at moving some other hard coded HTML in the plugin.
It would be nice to show nicknames from the thread where you reply. You know, write @ and then show for example last 5 nicknames from this thread... it would be useful before you type any other letter.
I forgot to consider classic view. ๐
Reported: http://community.mybb.com/thread-131448-post-1063960.html#pid1063960 (its a long post)
Thanks to some practical application of plugin version control using the cache (Advanced Sidebox) I feel that adding the same seamless upgrade module to MentionMe would be beneficial and relatively simple as well.
This should also help to facilitate the update to MyAlerts new settings design ( Issue #4 ) . . .
Will try to get this done soon.
Fatal error: Call to undefined function get_called_class() in /home/bf4br419/public_html/forum/inc/plugins/MentionMe/classes/WildcardPluginCache.php on line 28
Reported here: http://community.mybb.com/thread-131448-post-1078178.html#pid1078178
Related to WildcardSearch/Advanced-Sidebox#184
It has been requested and re-requested so I will try to get this done for 2.3
In some cases, two or more instances of the same user name may be shown in the auto completion prediction/suggestion list. I specifically remember checking the cache for duplicates but there is obviously some flaw in my logic.
I have a person on the forum with a $ in his name and he doesn't get alerts when he is mentioned. An example being @cat$
His name is cat$ but he doesn't get an alert since he has a special character in his name. I think he gets a mention as "@cat$" but what happens is that when you see the mention in the post this time, it says @cat$ and some other special gibberish letters afterwards.
Any help will be appreciated. Thanks.
I'm not sure if you've fixed this issue. I've haven't seen it around so perhaps you have. ๐
If you were to gather the user IDs of the mentions in the post when inserted and add to a sterilized array in the posts row and check new mentions against that list then mentions shouldn't get repeated. This will be easier if bundled in along with #62.
Hi, great job with the mod and all, but I'm having some serious problem that have been causing me to rip out my hair. -_-
I've gotten the MyAlerts to work properly beforehand and this is without me knowing about mentionme first. I mean as in MyAlerts working properly but since I've updated it to 1.04, I think? The update where it fixes the default avatar images or whatever. I have some minor problems there too, but I'll save them for a bit later.
Anyways, after I installed the new updated one, I finally uploaded and installed MentionMe. I'll just list some problems that have occurred for me.
The mentionme settings do not appear in the User CP and this is a problem I've been having in general too with MyAlert settings. I've installed other mods that work with Myalerts as well and those settings don't appear in the User CP.
What I mean is that like how MyAlerts allows you to change settings in the user cp, other mods/plugins that I've installed that work with MyAlerts does not have their settings there and same with MentionMe. I don't have any option of enabling/disabling alerts except normal 5 options that comes with MyAlerts. They are also not enabled at the start anymore either like they used to in the older versions of MyAlerts which is a bit strange as well.
If I do set the settings on though, they do work properly, it's just weird how the other settings aren't there such as mentionme and the like. I also get this error a ton too:
"MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
1054 - Unknown column 'myalerts_settings' in 'field list'
Query:
SELECT uid, myalerts_settings FROM mybb_users "
This happens a lot when I'm uninstalling or just trying to enable/disable it in the ACP. I think this could be a huge factor in why a lot of my plugins with MyAlerts isn't working right but I don't know too much about this stuff so I'm not sure.
I've downloaded your MentionMe from here and the one off of myBB and no luck and same with the updated 1.04 MyAlerts from euantor. Is it possible if you could just make a copy of the files that you have that's working for your forum and just see if it makes a difference if we try them to see if it makes difference as well?
I already put this branch into use on my forum and immediately noticed that when using un-quoted mentions there is a spacing issue.
Hi @mark how are you
is rendered as
Hi @Markhow are you
Haven't found the problem yet, will update.
To stay up to date MentionMe will have to change as well.
Luckily @euantor is helping me with the details so this should go pretty smoothly I hope ๐
This isn't something users will notice, but it has to be done to maintain functionality and compatiblity with MyAlerts.
Tecca from TESOF reported that editing a post to add a mention (quick edit or full edit) doesn't alert the user mentioned.
When a name includes double-quotes (example User "name"
) which is legal in MyBB, the JavaScript will insert the name as @"User "name""
which will not be matched/linked correctly.
Need to check the name and use appropriate quote characters.
At the moment this plugin stores mentions as @JordanMussi
(or @"JordanMussi"
or @'JordanMussi'
etc.). However this leads to querying the DB for a user matching this username. In the first instance this is more costly as usernames with multiple words cause multiple queries, for example @Jordan Mussi
(discounting the mention cache).
Also @Jordan Mussi
would match a user called Jordan before myself (annoying ๐).
My proposal is to store mentions with the user id but only show the username to users.
For example on the MyBB Community Forums my user id is 51459 so typing @JordanMussi
in a message would be replaced with <mentionme:51459>
in the DB.
Furthermore, if I was to change my name previous mentions would not be lost as it is my user id that they are referring to (although the user posting has no idea).
However past mentions would still have to be parsed as before and merging users could create a problem (but the latter is a problem with the current method).
To summarise:
@JordanMussi
, @"JordanMussi"
, @'JordanMussi'
etc. are converted to <mentionme:51459>
when inserted into the database (in newreply, editpost etc.).
I hope I have made this easy to understand. ๐
When either autocompletion or postbit buttons are enabled, the xmlhttp
hook is added regardless of whether it is needed or not.
I'm assigning 'no'
to a field that is integer-- will change to 0
Cause a WSOD on my forum where I am testing the feature branch. Will fix soon.
Hi,
this plugin is not working on my site. I type @ but no autocomplete shown, nothing
@martec made me think about this when he reported permissions checks.
Need to add postbit_multimention
class to the anchor in mentionme_postbit_button
template and rework the JS to alter class names for on
and off
(selected/not selected) so that multi mentions will work out of the box for users with CSS postbit buttons.
Reported here: http://community.mybb.com/thread-131448-post-1063873.html#pid1063873
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.